human
Solve the following python programming problem given the following code:
@frappe.whitelist()
def get_contact_list(txt):
assistant
#Here is the Python code you requested.

    """Returns contacts (from autosuggest)
    """
    txt = txt.replace(u'%', u'')
    def get_users():
        return filter(None, frappe.db.sql_list(u'select    email    from    tabUser    where    email    like    %s', ((u'%' + txt) + u'%')))
    try:
        out = filter(None, frappe.db.sql_list(u'select    distinct    email_id    from    `tabContact`    \n DCTB  DCTB  DCTB where    email_id    like    %(txt)s    or    concat(first_name,    "    ",    last_name)    like    %(txt)s    order    by\n DCTB  DCTB  DCTB if    (locate(    %(_txt)s,    concat(first_name,    "    ",    last_name)),    locate(    %(_txt)s,    concat(first_name,    "    ",    last_name)),    99999),\n DCTB  DCTB  DCTB if    (locate(    %(_txt)s,    email_id),    locate(    %(_txt)s,    email_id),    99999)', {u'txt': (u'%%%s%%' % frappe.db.escape(txt)), u'_txt': txt.replace(u'%', u'')}))
        if (not out):
            out = get_users()
    except Exception as e:
        if (e.args[0] == 1146):
            out = get_users()
        else:
            raise
    return out