def _handle_usecols(self, columns, usecols_key):
if self.usecols is not None:<EOL><INDENT>if callable(self.usecols):<EOL><INDENT>col_indices = _evaluate_usecols(self.usecols, usecols_key)<EOL><DEDENT>elif any(isinstance(u, str) for u in self.usecols):<EOL><INDENT>if len(columns) > <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>col_indices = []<EOL>for col in self.usecols:<EOL><INDENT>if isinstance(col, str):<EOL><INDENT>try:<EOL><INDENT>col_indices.append(usecols_key.index(col))<EOL><DEDENT>except ValueError:<EOL><INDENT>_validate_usecols_names(self.usecols, usecols_key)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>col_indices.append(col)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>col_indices = self.usecols<EOL><DEDENT>columns = [[n for i, n in enumerate(column) if i in col_indices]<EOL>for column in columns]<EOL>self._col_indices = col_indices<EOL><DEDENT>return columns<EOL>
Sets self._col_indices

usecols_key is used if there are string usecols.