def identifies(id, ref):
    """Returns true if string `id` matches TableReference `ref`"""
    return (id == ref.alias or id == ref.name or ref.schema and id == ref.
        schema + '.' + ref.name)
