Takes a username as a string and returns a boolean. True indicates that
        the provided user has been blacklisted
541315
def user_is_blacklisted(self, user):
        '''
        
        '''
        return not salt.utils.stringutils.check_whitelist_blacklist(user, blacklist=self.blacklist.get('users', []))
668921
def blacklistNode(self, nodeName: str, reason: str = None, code: int = None):
        
        msg = "{} blacklisting node {}".format(self, nodeName)
        if reason:
            msg += " for reason {}".format(reason)
        if code:
            msg += " for code {}".format(code)
        logger.display(msg)
        self.nodeBlacklister.blacklist(nodeName)
406101
def get_user_name(user, full_name=True):
     # noqa
    try:
        if full_name:
            name = ' '.join([user.first_name, user.last_name])
        else:
            name = user.first_name
    except AttributeError:
        name = None

    return name
244018
def User(self, Username=''):
        
        if not Username:
            Username = self.CurrentUserHandle
        o = User(self, Username)
        o.OnlineStatus # Test if such a user exists.
        return o
931418
function username(value, fromIndex) {
  var index = fromIndex
  var length = value.length
  var size

  /* First character of username cannot be a dash. */
  if (value.charCodeAt(index) === CC_DASH) {
    return -1
  }

  while (index < length) {
    if (!usernameCharacter(value.charCodeAt(index))) {
      break
    }

    index++
  }

  size = index - fromIndex

  /* Last character of username can no longer be a dash, but could be (GH-13). */
  if (!size || size > MAX_USER_LENGTH) {
    return -1
  }

  return index
}
1267470
def clean(self):
        
        if self.user:
            self.username = self.user.username
        elif not self.username:
            raise ValidationError({
                'username': _NOT_BLANK_MESSAGE,
                'user': _NOT_BLANK_MESSAGE
            })
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]
209983
function tokenExists(username, token, done) {
  return getTokenHashes(username, function(getTokensErr, hashes) {
    if (getTokensErr) {
      return done(getTokensErr);
    }

    if (!hashes || !hashes.length) {
      return done(null, false);
    }

    let index = 0;
    let found = false;

    async.until(() => found || (index >= hashes.length), function(next) {
      bcrypt.compare(token, hashes[index++].uuid, function(err, match) {
        found = match;
        return next(err);
      });
    }, (err) => done(err, found ? hashes[index - 1] : undefined));
  });
}
211036
def delete_by_user_name(user_name):
        '''
        
        '''
        try:
            del_count = TabMember.delete().where(TabMember.user_name == user_name)
            del_count.execute()
            return True
        except:
            return False
167533
def get_user(self, username):
        
        User = get_user_model()  # noqa
        try:
            user = User.objects.get(**{
                User.USERNAME_FIELD: username,
                'is_active': False
            })
            return user
        except User.DoesNotExist:
            return None
194834
public UserInfoResult[] getBlackList(String username)
            throws APIConnectionException, APIRequestException {
        StringUtils.checkUsername(username);
        ResponseWrapper response = _httpClient.sendGet(_baseUrl + userPath + "/" + username + "/blacklist");
        return _gson.fromJson(response.responseContent, UserInfoResult[].class);
    }
1235309
def get_user(self, username):
        
        User = get_user_model()
        try:
            user = User.objects.get(**{
                User.USERNAME_FIELD: username,
            })
            if user.is_active:
                raise ActivationError(
                    self.ALREADY_ACTIVATED_MESSAGE,
                    code='already_activated'
                )
            return user
        except User.DoesNotExist:
            raise ActivationError(
                self.BAD_USERNAME_MESSAGE,
                code='bad_username'
            )
693866
def get_member_details(self, username):
        
        members = self.get_members()
        for member in members:
            if member.username == username:
                return member
780815
def get_black_list(self, begin_openid=None):
        
        data = {}
        if begin_openid:
            data['begin_openid'] = begin_openid
        return self._post(
            'tags/members/getblacklist',
            data=data,
        )
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
1208778
String getBlacklistFilter() {

        if (m_ignoreBlacklist) {
            return "";
        }
        String result = "";
        List<CmsUUID> blacklist = m_config.getBlacklist();
        List<String> blacklistStrings = Lists.newArrayList();
        for (CmsUUID id : blacklist) {
            blacklistStrings.add("\"" + id.toString() + "\"");
        }
        if (!blacklistStrings.isEmpty()) {
            result = "&fq=-id:(" + CmsStringUtil.listAsString(blacklistStrings, " OR ") + ")";
        }
        return result;
    }
940338
def hasUser(self):
        
        username = self.getUsername()
        if not username:
            return False
        user = api.get_user(username)
        return user is not None