Return information about an user based on uuid
326509
def api_user_uuid(request, userUuid, key=None, hproPk=None):
    """"""

    if not check_api_key(request, key, hproPk):
        return HttpResponseForbidden

    # From UUID to Pk
    from users.models import TechUser

    user = get_object_or_404(TechUser, uuid=userUuid)

    (_, _, hproject) = getPlugItObject(hproPk)

    user.ebuio_member = hproject.isMemberRead(user)
    user.ebuio_admin = hproject.isMemberWrite(user)
    user.subscription_labels = _get_subscription_labels(user, hproject)

    return api_user(request, user.pk, key, hproPk)
1112864
def _get_user(self, user):
        """"""
        return ' '.join([user.username, user.first_name, user.last_name])
140079
def get_user(self, idvalue, options=None):
        
        options = options or {}
        data = options.copy()
        data['id'] = idvalue
        return self.api_get('user', data)
351949
def fetch_user(query):
    """"""
    user_filter = {'pk': query} if query.isdigit() else {'username': query}
    user_model = get_user_model()

    try:
        return user_model.objects.get(**user_filter)
    except user_model.DoesNotExist:
        raise exceptions.ParseError("Unknown user: {}".format(query))
388956
def get_username(uid,**kwargs):
    
    rs = db.DBSession.query(User.username).filter(User.id==uid).one()

    if rs is None:
        raise ResourceNotFoundError("User with ID %s not found"%uid)

    return rs.username
242385
def query_get_user_contact_info(uid):
    
    # FIXME compatibility with postgresql
    query1 = """SELECT nickname, email,
                       """ + \
        datetime_format('last_login') + \
        """
                     FROM "user" WHERE id=%s"""
    params1 = (uid,)
    res1 = run_sql(query1, params1)
    if res1:
        return res1[0]
    else:
        return ()
1045015
def get_user_by_id(self, uid):
        """"""
        self.logger.debug('User %s has been found in database', uid)
        return dict(uid=uid, password_hash='secret_hash')
1348057
def _get_user(self, username):
        """"""
        data = self.client.get(self._key(username))
        if data is None:
            return None
        return json.loads(data.decode())
1053238
def get_user(uwnetid, include_course_summary=True):
    
    url = author_uid_url(uwnetid) + "?%s" % CUSTOM_FIELD
    if include_course_summary:
        url = "%s&%s" % (url, COURSE_SUMMARY)
    resp = get_resource(url)
    return _process_json_resp_data(resp)
719149
def get_user_id(username):
    
    uid = single_line_stdout('id -u {0}'.format(username), expected_errors=(1,), shell=False)
    return check_int(uid)
503164
def get_uid(username)
      Etc.passwd { |u| return u.uid if u.name == username }
    end
1363803
def get_user(uid):
    
    if db is not None:
        try:
            uid = uid.decode('utf-8')
        except AttributeError:
            pass
        d = db.hgetall('user:{0}'.format(uid))
        if d:
            nd = {}
            # strings everywhere
            for k in d:
                try:
                    nd[k.decode('utf-8')] = d[k].decode('utf-8')
                except AttributeError:
                    try:
                        nd[k.decode('utf-8')] = d[k]
                    except AttributeError:
                        nd[k] = d[k]
            for p in PERMISSIONS:
                nd[p] = nd.get(p) == '1'
            return User(uid=uid, **nd)
        else:
            return None
    else:
        d = app.config['COIL_USERS'].get(uid)
        if d:
            return User(uid=uid, **d)
        else:
            return None
705505
def get_user(self, id, **data):
        
        
        return self.get("/users/{0}/".format(id), data=data)
1205832
def getuser(self, user_id):
        
        request = requests.get(
            '{0}/{1}'.format(self.users_url, user_id),
            headers=self.headers, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 200:
            return request.json()
        else:
            return False
67358
def uuid_object(title="Reference", description="Select an object", default=None, display=True):
    """"""

    uuid = {
        'pattern': '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{'
                   '4}-['
                   'a-fA-F0-9]{4}-[a-fA-F0-9]{12}$',
        'type': 'string',
        'title': title,
        'description': description,
    }

    if not display:
        uuid['x-schema-form'] = {
            'condition': "false"
        }

    if default is not None:
        uuid['default'] = default

    return uuid
551465
def get_user(self, userPk):
        """"""
        r = self._request('user/' + str(userPk))
        if r:
            # Set base properties and copy data inside the user
            u = User()
            u.pk = u.id = userPk
            u.__dict__.update(r.json())
            return u
        return None
658917
def authenticated_userid(request):
    
    user = getattr(request, 'user', None)
    key = user.pk_field()
    return getattr(user, key)