def METHOD_NAME(uid):
    """
    A Python wrapper to retrieve a user by UID. Returns:
        (res, user_dict)
    if res is NssReturnCode.SUCCESS, then user_dict contains the keys
    corresponding to the C passwd structure fields. Otherwise, the dictionary
    is empty and errno indicates the error code
    """
    result = Passwd()
    result_p = POINTER(Passwd)(result)
    buff = create_string_buffer(PASSWD_BUFLEN)
    res, errno, result_p = getpwuid_r(uid, result_p, buff, PASSWD_BUFLEN)
    if errno != 0:
        raise SssdNssError(errno, "getpwuid_r")
    user_dict = set_user_dict(res, result_p)
    return res, user_dict