def read(self, filename=None):
self._init_filename(filename)<EOL>data = odict()<EOL>with open(self.real_filename) as ndx:<EOL><INDENT>current_section = None<EOL>for line in ndx:<EOL><INDENT>line = line.strip()<EOL>if len(line) == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>m = self.SECTION.match(line)<EOL>if m:<EOL><INDENT>current_section = m.group('<STR_LIT:name>')<EOL>data[current_section] = []  <EOL>continue<EOL><DEDENT>if current_section is not None:<EOL><INDENT>data[current_section].extend(map(int, line.split()))<EOL><DEDENT><DEDENT><DEDENT>super(NDX,self).update(odict([(name, self._transform(atomnumbers))<EOL>for name, atomnumbers in data.items()]))<EOL>
Read and parse index file *filename*.