def uid_to_user(uid):
    try:
        return pwd.getpwuid(uid).pw_name
    except (KeyError, NameError):
        # If user is not present, fall back to the uid.
        return uid
Convert a uid to a user name
dataset/ETHPy150Open saltstack/salt/salt/modules/file.py/uid_to_user