def column_is_primary_key(column):
  """Returns whether a column object is marked as a primary key."""
  primary_key = column['is primary key']
  if isinstance(primary_key, str):
    primary_key = primary_key.lower()
    if primary_key in {'y', 'n', 'yes', 'no', '-'}:
      primary_key = primary_key in {'y', 'yes'}
    else:
      raise ValueError('primary key should be a boolean: ' + primary_key)
  return primary_key
Returns whether a column object is marked as a primary key.
language/xsp/data_preprocessing/schema_utils.py