def get_user(name=None, uid=None):

    db = api.common.get_conn()

    match = {}

    if uid is not None:
        match.update({'uid': uid})
    elif name is not None:
        match.update({'username': name})
    elif api.auth.is_logged_in():
        match.update({'uid': api.auth.get_uid()})
    else:
        raise InternalException("Uid or name must be specified for get_user")

    user = db.users.find_one(match)

    if user is None:
        raise InternalException("User does not exist")

    return user
Retrieve a user based on a property. If the user is logged in,
dataset/ETHPy150Open IceCTF/ctf-platform/api/api/user.py/get_user