tries to parse the user name from various objects
160992
def __getUsername(self):
        """"""

        if self._securityHandler is not None and \
           not self._securityHandler._username is None:
            return self._securityHandler._username
        elif self._securityHandler is not None and \
               hasattr(self._securityHandler, "org_url") and \
               self._securityHandler.org_url is not None:
            from .administration import Administration
            user = Administration(url=self._securityHandler.org_url,
                                  securityHandler=self._securityHandler,
                                  proxy_url=self._proxy_url,
                                  proxy_port=self._proxy_port).portals.portalSelf.user
            return user['username']
        else:
            from .administration import Administration
            url = self._url.lower().split('/content/')[0]
            user = Administration(url=url,
                                  securityHandler=self._securityHandler,
                                  proxy_url=self._proxy_url,
                                  proxy_port=self._proxy_port).portals.portalSelf.user
            return user['username']
1220231
def parse(cls, string):
		'''
			
		'''
		obj, i = cls.match(string, 0)
		if i != len(string):
			raise Exception("Could not parse '" + string + "' beyond index " + str(i))
		return obj
443040
def get_values_of_matching_keys(pattern_dict, user_name):
    '''
    
    '''
    ret = []
    for expr in pattern_dict:
        if salt.utils.stringutils.expr_match(user_name, expr):
            ret.extend(pattern_dict[expr])
    return ret
40171
function extractUserId(userIdObject: any): any {
  let newUserId = '';
  if (_.isObject(userIdObject)) {
    Object.keys(userIdObject).forEach(field => {
      newUserId = userIdObject[field];
    });
  } else {
    newUserId = userIdObject;
  }
  return newUserId;
}
943300
def get_username(details, backend, response, *args, **kwargs):
    

    user = details.get('user')
    if not user:
        user_uuid = kwargs.get('uid')
        if not user_uuid:
            return

        username = uuid_to_username(user_uuid)
    else:
        username = user.username

    return {
        'username': username
    }
690183
def user_with_name(self, given_name=None, sn=None):
        """"""
        results = []

        if sn and not given_name:
            results = User.objects.filter(last_name=sn)
        elif given_name:
            query = {'first_name': given_name}
            if sn:
                query['last_name'] = sn
            results = User.objects.filter(**query)

            if len(results) == 0:
                # Try their first name as a nickname
                del query['first_name']
                query['nickname'] = given_name
                results = User.objects.filter(**query)

        if len(results) == 1:
            return results.first()

        return None
1357742
def username(anon, obj, field, val):
    
    return anon.faker.user_name(field=field)
562260
def get_owner_names_value(self, obj):
        """"""
        return [
            self._get_user(user)
            for user in get_users_with_permission(obj, get_full_perm('owner', obj))
        ]
290172
def _get_id_from_username(self, username):
        
        _mask = "mask[id, username]"
        _filter = {'users': {'username': utils.query_filter(username)}}
        user = self.list_users(_mask, _filter)
        if len(user) == 1:
            return [user[0]['id']]
        elif len(user) > 1:
            raise exceptions.SoftLayerError("Multiple users found with the name: %s" % username)
        else:
            raise exceptions.SoftLayerError("Unable to find user id for %s" % username)
980736
function readGetUserItemData(message, tokens) {
	message.userName = protocol.decodeString(tokens[1]);
	readGetItemData(message, tokens.slice(2));
}
841634
def get_user(self, username):
        

        r = self._query_('/users/%s' % username, 'GET')

        result = User(r.json())
        return result
931912
def user_parse(data):
        """"""
        resp = data.get('response', [{}])[0]
        yield 'id', resp.get('uid')
        yield 'first_name', resp.get('first_name')
        yield 'last_name', resp.get('last_name')
        yield 'username', resp.get('nickname')
        yield 'city', resp.get('city')
        yield 'country', resp.get('country')
        yield 'picture', resp.get('photo_big')
686782
def get_username(self):
        
        username = self.get_as_nullable_string("username")
        username = username if username != None else self.get_as_nullable_string("user")
        return username
398317
def load_name(self, load):
        '''
        
        '''
        if 'eauth' not in load:
            return ''
        fstr = '{0}.auth'.format(load['eauth'])
        if fstr not in self.auth:
            return ''
        try:
            pname_arg = salt.utils.args.arg_lookup(self.auth[fstr])['args'][0]
            return load[pname_arg]
        except IndexError:
            return ''
740895
def user_parse(data):
        """"""
        yield 'id', data.get('uuid')
        yield 'username', data.get('username')
        yield 'last_name', data.get('display_name')
        links = data.get('links', {})
        yield 'picture', links.get('avatar', {}).get('href')
        yield 'link', links.get('html', {}).get('href')
1098138
function parseString(str) {
  var obj = {};
  var pairs = str.split('&');
  var pair;
  var pos;

  for (var i = 0, len = pairs.length; i < len; ++i) {
    pair = pairs[i];
    pos = pair.indexOf('=');
    if (pos == -1) {
      obj[decodeURIComponent(pair)] = '';
    } else {
      obj[decodeURIComponent(pair.slice(0, pos))] =
        decodeURIComponent(pair.slice(pos + 1));
    }
  }

  return obj;
}
795573
def display_user(value, arg):
    ''' 
    '''
    if value.user == arg and arg.username != ANONYMOUS_USERNAME:
        return "You"
    else:
        return value.user.get_full_name()