def match_column_identifier(column_names, c, column_offset=1):
 if (isinstance(c, six.string_types) and (not c.isdigit()) and (c in column_names)):
  return column_names.index(c)
 else:
  try:
   c = (int(c) - column_offset)
  except:
   raise ColumnIdentifierError(("Column '%s' is invalid. It is neither an integer nor a column name. Column names are: %s" % (c, repr(column_names)[1:(-1)])))
  if (c < 0):
   raise ColumnIdentifierError('Column 0 is invalid. Columns are 1-based.')
  if (c >= len(column_names)):
   raise ColumnIdentifierError(("Column %i is invalid. The last column is '%s' at index %i." % (c, column_names[(-1)], (len(column_names) - 1))))
 return c

def match_column_identifier ( column_names , c , column_offset = 1 ) : if ( isinstance ( c , six . string_types ) and ( not c . isdigit ( ) ) and ( c in column_names ) ) : return column_names . index ( c ) else : try : c = ( int ( c ) - column_offset ) except : raise ColumnIdentifierError ( ( "Column '%s' is invalid. It is neither an integer nor a column name. Column names are: %s" % ( c , repr ( column_names ) [ 1 : ( - 1 ) ] ) ) ) if ( c < 0 ) : raise ColumnIdentifierError ( 'Column 0 is invalid. Columns are 1-based.' ) if ( c >= len ( column_names ) ) : raise ColumnIdentifierError ( ( "Column %i is invalid. The last column is '%s' at index %i." % ( c , column_names [ ( - 1 ) ] , ( len ( column_names ) - 1 ) ) ) ) return c
determine what column a single column id matches in a series of column names .