def _get_index_name(self, columns):
orig_names = list(columns)<EOL>columns = list(columns)<EOL>try:<EOL><INDENT>line = self._next_line()<EOL><DEDENT>except StopIteration:<EOL><INDENT>line = None<EOL><DEDENT>try:<EOL><INDENT>next_line = self._next_line()<EOL><DEDENT>except StopIteration:<EOL><INDENT>next_line = None<EOL><DEDENT>implicit_first_cols = <NUM_LIT:0><EOL>if line is not None:<EOL><INDENT>if self.index_col is not False:<EOL><INDENT>implicit_first_cols = len(line) - self.num_original_columns<EOL><DEDENT>if next_line is not None:<EOL><INDENT>if len(next_line) == len(line) + self.num_original_columns:<EOL><INDENT>self.index_col = lrange(len(line))<EOL>self.buf = self.buf[<NUM_LIT:1>:]<EOL>for c in reversed(line):<EOL><INDENT>columns.insert(<NUM_LIT:0>, c)<EOL><DEDENT>orig_names = list(columns)<EOL>self.num_original_columns = len(columns)<EOL>return line, orig_names, columns<EOL><DEDENT><DEDENT><DEDENT>if implicit_first_cols > <NUM_LIT:0>:<EOL><INDENT>self._implicit_index = True<EOL>if self.index_col is None:<EOL><INDENT>self.index_col = lrange(implicit_first_cols)<EOL><DEDENT>index_name = None<EOL><DEDENT>else:<EOL><INDENT>(index_name, columns_,<EOL>self.index_col) = _clean_index_names(columns, self.index_col,<EOL>self.unnamed_cols)<EOL><DEDENT>return index_name, orig_names, columns<EOL>
Try several cases to get lines:

0) There are headers on row 0 and row 1 and their
total summed lengths equals the length of the next line.
Treat row 0 as columns and row 1 as indices
1) Look for implicit index: there are more columns
on row 1 than row 0. If this is true, assume that row
1 lists index columns and row 0 lists normal columns.
2) Get index from the columns if it was listed.