添加用户到黑名单方法（每秒钟限 100 次） 方法
        @param  userId:用户 Id。（必传）
        @param  blackUserId:被加到黑名单的用户Id。（必传）
	 
        @return code:返回码，200 为正常。
        @return errorMessage:错误信息。
420146
def addBlacklist(self, userId, blackUserId):
        

        desc = {
            "name": "CodeSuccessReslut",
            "desc": " http 成功返回结果",
            "fields": [{
                "name": "code",
                "type": "Integer",
                "desc": "返回码，200 为正常。"
            }, {
                "name": "errorMessage",
                "type": "String",
                "desc": "错误信息。"
            }]
        }
        r = self.call_api(
            method=('API', 'POST', 'application/x-www-form-urlencoded'),
            action='/user/blacklist/add.json',
            params={"userId": userId,
                    "blackUserId": blackUserId})
        return Response(r, desc)
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)
774966
public User getUser(int userId) throws GitLabApiException {
        GitLabApiForm formData = new GitLabApiForm().withParam("with_custom_attributes", customAttributesEnabled);
        Response response = get(Response.Status.OK, formData.asMap(), "users", userId);
        return (response.readEntity(User.class));
    }
975750
function(userId, messageId, callback) {
      if (!userId) return callback(new Error(utils.i18n.messages.userId));
      messageId = utils.toUUID(messageId);
      if (!messageId) return callback(new Error(utils.i18n.messages.mid));
      utils.debug('Message getFromUser: ' + userId + ', ' + messageId);

      request.get({
        path: '/users/' + querystring.escape(userId) + '/messages/' + messageId
      }, callback);
    }
40958
public void setUserId(String userId) {
        if (userId == null) {
            _properties.remove(AMQP_PROP_USER_ID);
            return;
        }
        
        _properties.put(AMQP_PROP_USER_ID, userId);
    }
554157
public WebhookMessageBuilder setUsername(String username)
    {
        this.username = Helpers.isBlank(username) ? null : username;
        return this;
    }
306332
private String getUserEmail(Long userId) {
    UserDAO userDAO = new UserDAO();
    User user = userDAO.findById(userId);
    return user.getDefaultEmailAsString();
  }
89601
public Credential authorize(String userId) throws IOException {
    try {
      Credential credential = flow.loadCredential(userId);
      if (credential != null
          && (credential.getRefreshToken() != null ||
              credential.getExpiresInSeconds() == null ||
              credential.getExpiresInSeconds() > 60)) {
        return credential;
      }
      // open in browser
      String redirectUri = receiver.getRedirectUri();
      AuthorizationCodeRequestUrl authorizationUrl =
          flow.newAuthorizationUrl().setRedirectUri(redirectUri);
      onAuthorization(authorizationUrl);
      // receive authorization code and exchange it for an access token
      String code = receiver.waitForCode();
      TokenResponse response = flow.newTokenRequest(code).setRedirectUri(redirectUri).execute();
      // store credential and return it
      return flow.createAndStoreCredential(response, userId);
    } finally {
      receiver.stop();
    }
  }
352730
function(userId) {
    return new Promise((resolve, reject) => {
      this._start()
          .uri('/api/user')
          .urlSegment(userId)
          .get()
          .go(this._responseHandler(resolve, reject));
    });
  }
1145127
def get_user_by_userid(self, userid):
        '''  '''
        response, status_code = self.__pod__.Users.get_v2_user(
            sessionToken=self.__session__,
            uid=userid
        ).result()
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
816031
def get_user_id_by_user(self, username):
        '''  '''
        response, status_code = self.__pod__.Users.get_v2_user(
            sessionToken=self.__session__,
            username=username
        ).result()
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
662114
public static function userId($userId)
    {
        self::requireUtf8($userId, 'userId');

        $userIdLength = mb_strlen($userId);
        if (0 >= $userIdLength || 256 < $userIdLength) {
            throw new InputValidationException('invalid length: 0 < userId <= 256');
        }

        return $userId;
    }
93121
function(userId, properties, callback) {
      if (!userId) return callback(new Error(utils.i18n.identities.id));
      if (!properties.display_name) return callback(new Error(utils.i18n.identities.displayName));
      utils.debug('Identity replace: ' + userId);

      request.put({
        path: '/users/' + userId + '/identity',
        body: properties
      }, callback || utils.nop);
    }
811714
public GetQYUserInfoResponse get(String userId){
        BeanUtil.requireNonNull(userId, "userId is null");
        GetQYUserInfoResponse response;
        String url = BASE_API_URL + "cgi-bin/user/get?access_token=#&userid=" + userId;
        BaseResponse r = executeGet(url);
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        response = JSONUtil.toBean(resultJson, GetQYUserInfoResponse.class);
        return response;
    }
489921
function(userId) {
    var self = this;

    if (userId !== null && typeof userId !== "string")
      throw new Error("setUserId must be called on string or null, not " +
                      typeof userId);

    // Prevent newly-created universal subscriptions from being added to our
    // session; they will be found below when we call startUniversalSubs.
    //
    // (We don't have to worry about named subscriptions, because we only add
    // them when we process a 'sub' message. We are currently processing a
    // 'method' message, and the method did not unblock, because it is illegal
    // to call setUserId after unblock. Thus we cannot be concurrently adding a
    // new named subscription.)
    self._dontStartNewUniversalSubs = true;

    // Prevent current subs from updating our collectionViews and call their
    // stop callbacks. This may yield.
    self._eachSub(function (sub) {
      sub._deactivate();
    });

    // All subs should now be deactivated. Stop sending messages to the client,
    // save the state of the published collections, reset to an empty view, and
    // update the userId.
    self._isSending = false;
    var beforeCVs = self.collectionViews;
    self.collectionViews = {};
    self.userId = userId;

    // Save the old named subs, and reset to having no subscriptions.
    var oldNamedSubs = self._namedSubs;
    self._namedSubs = {};
    self._universalSubs = [];

    _.each(oldNamedSubs, function (sub, subscriptionId) {
      self._namedSubs[subscriptionId] = sub._recreate();
      // nb: if the handler throws or calls this.error(), it will in fact
      // immediately send its 'nosub'. This is OK, though.
      self._namedSubs[subscriptionId]._runHandler();
    });

    // Allow newly-created universal subs to be started on our connection in
    // parallel with the ones we're spinning up here, and spin up universal
    // subs.
    self._dontStartNewUniversalSubs = false;
    self.startUniversalSubs();

    // Start sending messages again, beginning with the diff from the previous
    // state of the world to the current state. No yields are allowed during
    // this diff, so that other changes cannot interleave.
    Meteor._noYieldsAllowed(function () {
      self._isSending = true;
      self._diffCollectionViews(beforeCVs);
      if (!_.isEmpty(self._pendingReady)) {
        self.sendReady(self._pendingReady);
        self._pendingReady = [];
      }
    });
  }
5319
private static @Nullable
    User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) {
        User u = AllUsers.get(id);
        if (u == null && (create || UserIdMapper.getInstance().isMapped(id))) {
            u = new User(id, fullName);
            AllUsers.put(id, u);
            if (!id.equals(fullName) && !UserIdMapper.getInstance().isMapped(id)) {
                try {
                    u.save();
                } catch (IOException x) {
                    LOGGER.log(Level.WARNING, "Failed to save user configuration for " + id, x);
                }
            }
        }
        return u;
    }
537845
public GetMenuResponse tryMatchMenu(String userId) {
        BeanUtil.requireNonNull(userId, "userId is null");
        LOG.debug("测试个性化菜单.....");
        GetMenuResponse response;
        String url = BASE_API_URL + "cgi-bin/menu/trymatch?access_token=#";
        Map<String, String> params = new HashMap<String, String>();
        params.put("user_id", userId);
        BaseResponse r = executePost(url, JSONUtil.toJson(params));
//        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
//        response = JSONUtil.toBean(resultJson, GetMenuResponse.class);
        if (isSuccess(r.getErrcode())) {
            JSONObject jsonObject = JSONUtil.getJSONFromString(r.getErrmsg());
            //通过jsonpath不断修改type的值，才能正常解析- -
            List buttonList = (List) JSONPath.eval(jsonObject, "$.menu.button");
            if (CollectionUtil.isNotEmpty(buttonList)) {
                for (Object button : buttonList) {
                    List subList = (List) JSONPath.eval(button, "$.sub_button");
                    if (CollectionUtil.isNotEmpty(subList)) {
                        for (Object sub : subList) {
                            Object type = JSONPath.eval(sub, "$.type");
                            JSONPath.set(sub, "$.type", type.toString().toUpperCase());
                        }
                    } else {
                        Object type = JSONPath.eval(button, "$.type");
                        JSONPath.set(button, "$.type", type.toString().toUpperCase());
                    }
                }
            }
            response = JSONUtil.toBean(jsonObject.toJSONString(), GetMenuResponse.class);
        } else {
            response = JSONUtil.toBean(r.toJsonString(), GetMenuResponse.class);
        }
        return response;
    }