def name_to_uid(name):
    if name is None:
        return None

    try:
        uid = int(name)
    except ValueError:
        try:
            pwrec = pwd.getpwnam(name)
        except KeyError:
            return None
        uid = pwrec[2]
    else:
        try:
            pwrec = pwd.getpwuid(uid)
        except __HOLE__:
            return None
    return uid
dataset/ETHPy150Open XiaoMi/minos/supervisor/supervisor/datatypes.py/name_to_uid