Return or set the username

        :param string value: the new username to use
        :returns: string or new :class:`URL` instance
762500
def username(self, value=None):
        
        if value is not None:
            return URL._mutate(self, username=value)
        return unicode_unquote(self._tuple.username)
795573
def display_user(value, arg):
    ''' 
    '''
    if value.user == arg and arg.username != ANONYMOUS_USERNAME:
        return "You"
    else:
        return value.user.get_full_name()
698835
def username_or(user, attr):
    
    if not settings.ACCOUNTS_NO_USERNAME:
        attr = "username"
    value = getattr(user, attr)
    if callable(value):
        value = value()
    return value
414386
def username(self):
        """"""
        if len(self._inp_username.value.strip()) == 0: # if username provided by user
            if not self.hostname is None:
                config = parse_sshconfig(self.hostname)
                if 'user' in config: # if username is present in the config file
                    return config['user']
            else:
                return None
        else:
            return self._inp_username.value
300870
def str_if_not_none(value):
    
    if not(value is None or isinstance(value, string_types)):
        value = str(value)

    return value
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
841634
def get_user(self, username):
        

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

        result = User(r.json())
        return result
250592
def modify_url_for_impersonation(cls, url, impersonate_user, username):
        
        if impersonate_user is not None and username is not None:
            url.username = username
668789
def name(self, value):
        
        if not isinstance(value, six.string_types):
            raise ValueError("Pass a string")
        self._properties["id"] = value
625675
def get_user_by_username(self, username):
        
        results = self.get_users(filter='username eq "%s"' % (username))
        if results['totalResults'] == 0:
            logging.warning("Found no matches for given username.")
            return
        elif results['totalResults'] > 1:
            logging.warning("Found %s matches for username %s" %
                (results['totalResults'], username))

        return results['resources'][0]
604676
def clean_username(self):
        
        user = None
        try:
            user = User.objects.get(username__iexact=self.\
                    cleaned_data['username'])
        except User.DoesNotExist:
            return self.cleaned_data['username']

        if user:
            if user.username == self.user.username:
                return self.cleaned_data['username']

        raise forms.ValidationError(_(\
                "A user with that username already exists."))
386227
def _quote_username(name):
    '''
    
    '''
    if not isinstance(name, six.string_types):
        return str(name)  # future lint: disable=blacklisted-function
    else:
        return salt.utils.stringutils.to_str(name)
60142
def username(self):
        
        if self._username is None:
            if self.has_logged_in:
                self._username = self._get_username()
            else:
                raise AuthenticationError('Not logged in.')
        return self._username
664930
def get_user(self, username):
        
        for user in self.users:
            if user.id.name == username:
                return user
        return None
349569
def get_username(self, claims):
        """"""
        # bluntly stolen from django-browserid
        # https://github.com/mozilla/django-browserid/blob/master/django_browserid/auth.py
        username_algo = self.get_settings('OIDC_USERNAME_ALGO', None)

        if username_algo:
            if isinstance(username_algo, six.string_types):
                username_algo = import_string(username_algo)
            return username_algo(claims.get('email'))

        return default_username_algo(claims.get('email'))
377376
def username_is_available(self, new_username):
        

        # Return True if new_username equals current user's username
        if self.user_manager.call_or_get(current_user.is_authenticated):
            if new_username == current_user.username:
                return True

        # Return True if new_username does not exist,
        # Return False otherwise.
        return self.find_user_by_username(new_username) == None
723673
def create_user(self, username, first_name=None, last_name=None):
		
		
		url = api_url+'users/'
		payload = {
			'username':username
		}
		if first_name:
			payload['first_name'] = first_name
		if last_name:
			payload['last_name'] = last_name
		r = requests.post(url, data=json.dumps(payload), headers=self.headers)
		print(request_status(r))
		r.raise_for_status()
		return User(r.json())