def column_is_foreign_key(column):
  """Returns whether a column object is marked as a foreign key."""
  foreign_key = column['is foreign key']
  if isinstance(foreign_key, str):
    foreign_key = foreign_key.lower()

    if foreign_key in {'y', 'n', 'yes', 'no', '-'}:
      foreign_key = foreign_key in {'y', 'yes'}
    else:
      raise ValueError('Foreign key should be a boolean: ' + foreign_key)

  return foreign_key
Returns whether a column object is marked as a foreign key.
language/xsp/data_preprocessing/schema_utils.py