def lchown(path, user, group):
    path = os.path.expanduser(path)

    uid = user_to_uid(user)
    gid = group_to_gid(group)
    err = ''
    if uid == '':
        if user:
            err += 'User does not exist\n'
        else:
            uid = -1
    if gid == '':
        if group:
            err += 'Group does not exist\n'
        else:
            gid = -1

    return os.lchown(path, uid, gid)
util method used by reflectors. builds a where clause to link a row to another table.
dataset/ETHPy150Open saltstack/salt/salt/modules/file.py/lchown--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/enterprise/reflector.py/Reflector.buildWhereClause