Return the user's information in a json object
166768
def userinfo_json(request, user_id):
    
    data = {'first_name': '',
            'last_name': '',
            'email': '',
            'slug': '',
            'bio': '',
            'phone': '',
            'is_active': False}

    try:
        member = StaffMember.objects.get(pk=user_id)
        for key in data.keys():
            if hasattr(member, key):
                data[key] = getattr(member, key, '')

    except StaffMember.DoesNotExist:
        pass

    return HttpResponse(json.dumps(data),
                        mimetype='application/json')
798768
def _get_user(session, slug_or_user_id):
        
        user_json_items = session.fetch('users.get', user_ids=slug_or_user_id, fields=User.USER_FIELDS)
        return User.from_json(session, user_json_items[0])
1027113
def get_user_by_key(id, key, fields = {})
      data = {
          'id' => id,
          'key' => key,
          'fields' => fields
      }
      api_get(:user, data)
    end
7831
def to_json(self):
        
        self.logger.debug("Returning json info")
        individual_info = {
            'family_id': self.family,
            'id':self.individual_id, 
            'sex':str(self.sex), 
            'phenotype': str(self.phenotype), 
            'mother': self.mother, 
            'father': self.father,
            'extra_info': self.extra_info
        }
        return individual_info
999051
def _get_user_info(self, access_token):
        """"""
        info_response = self._call('GET', self.info_url, params={'access_token': access_token})
        user_info = info_response.get('info')
        return user_info
748842
async def _get_person_json(self, id_, url_params=None):
        
        url = self.url_builder(
            'person/{person_id}',
            dict(person_id=id_),
            url_params=url_params or OrderedDict(),
        )
        data = await self.get_data(url)
        return data
62292
def from_json(cls, file_path=None):
        """"""
        with io.open(file_path, encoding=text_type('utf-8')) as stream:
            try:
                users_json = json.load(stream)
            except ValueError:
                raise ValueError('No JSON object could be decoded')
            return cls.construct_user_list(raw_users=users_json.get('users'))
508412
def wrap_json(cls, json):
        
        u = User(usertype=json['type'],
                 name=json['name'],
                 logo=json['logo'],
                 twitchid=json['_id'],
                 displayname=json['display_name'],
                 bio=json['bio'])
        return u
316261
def info():
    """"""
    if current_app.testing or current_app.debug:
        return jsonify(dict(
            user=request.oauth.user.id,
            client=request.oauth.client.client_id,
            scopes=list(request.oauth.scopes)
        ))
    else:
        abort(404)
1310666
def get_account_details(self, account):
        
        result = {}
        try:
            luser = self._get_account(account.username)
            luser = preload(luser, database=self._database)
        except ObjectDoesNotExist:
            return result

        for i, j in luser.items():
            if i != 'userPassword' and j is not None:
                result[i] = j

        return result
591743
def user_info(self, username):
        
        request_url = "{}/api/0/user/{}".format(self.instance, username)

        return_value = self._call_api(request_url)

        return return_value
878618
def _get_meta_data(self):
        """"""
        return {
            "comment": self.request.headers.get("comment", ""),
            "author": self.get_current_user() or self.settings.get('annonymous_user')
        }
264164
def get_user_details(self, response):
        """"""
        email = response['email']
        username = response.get('nickname', email).split('@', 1)[0]
        return {'username': username,
                'email': email,
                'fullname': '',
                'first_name': '',
                'last_name': ''}
328530
function serializeUserData(object) {
      try {
        return JSON.parse(JSON.stringify(object.userData));
      } catch (error) {
        console.warn(
          "THREE.GLTFExporter: userData of '" +
            object.name +
            "' " +
            "won't be serialized because of JSON.stringify error - " +
            error.message
        );

        return {};
      }
    }
989931
def json_data(self, name, default=None):
        
        value = self.get(name)
        if value is Missing.Value:
            return default
        return value
791884
def _get_userinfo(self):
        
        if not hasattr(self, "_userinfo"):
            userinfo = {
                "name": self.user_name,
                "email": self.user_email,
                "url": self.user_url
            }
            if self.user_id:
                u = self.user
                if u.email:
                    userinfo["email"] = u.email

                # If the user has a full name, use that for the user name.
                # However, a given user_name overrides the raw user.username,
                # so only use that if this comment has no associated name.
                if u.get_full_name():
                    userinfo["name"] = self.user.get_full_name()
                elif not self.user_name:
                    userinfo["name"] = u.get_username()
            self._userinfo = userinfo
        return self._userinfo
879471
def get(self, user_id):
        """"""
        user = db.User.find_one(User.user_id == user_id)
        roles = db.Role.all()

        if not user:
            return self.make_response('Unable to find the user requested, might have been removed', HTTP.NOT_FOUND)

        return self.make_response({
            'user': user.to_json(),
            'roles': roles
        }, HTTP.OK)