def identifies(id, ref):

    return id == ref.alias or id == ref.name or (
        ref.schema and (id == ref.schema + '.' + ref.name))
Returns true if string `id` matches TableReference `ref`
dataset/ETHPy150Open dbcli/pgcli/pgcli/packages/sqlcompletion.py/identifies