Adds the current user as follower of the given user.
518907
async def follow_user(self, request):
        """"""
        username = request.match_info['username']
        session = await get_session(request)
        user_id = session.get('user_id')

        if not user_id:
            raise web.HTTPNotAuthorized()

        whom_id = await db.get_user_id(self.mongo.user, username)

        if whom_id is None:
            raise web.HTTPFound()

        await self.mongo.follower.update(
            {'who_id': ObjectId(user_id)},
            {'$push': {'whom_id': whom_id}}, upsert=True)

        return redirect(request, 'user_timeline', parts={"username": username})
646593
def add_user_to_group(self, user, group_name):
        
        group, _ = Group.objects.get_or_create(name = group_name)
        group.user_set.add(user)
1331694
def add(self, member, score):
        """"""
        return self.client.zadd(self.name, member, score)
17433
public void setCurrentUser( BackendlessUser user )
  {
    if( currentUser == null )
      currentUser = user;
    else
      currentUser.setProperties( user.getProperties() );
  }
922515
def add_user(self, user, is_admin=False):
        
        users_count = self.users.all().count()
        if users_count == 0:
            is_admin = True
        # TODO get specific org user?
        org_user = self._org_user_model.objects.create(
            user=user, organization=self, is_admin=is_admin
        )
        if users_count == 0:
            # TODO get specific org user?
            self._org_owner_model.objects.create(
                organization=self, organization_user=org_user
            )

        # User added signal
        user_added.send(sender=self, user=user)
        return org_user
251538
public void addReportingUser(String userId)
	{
		addActiveParticipant(
				userId, 
				null, 
				null, 
				true, 
				null, 
				null);
	}
504141
def addUsersToGroup(self, user_ids, thread_id=None):
        
        thread_id, thread_type = self._getThread(thread_id, None)
        data = self._getSendData(thread_id=thread_id, thread_type=ThreadType.GROUP)

        data["action_type"] = "ma-type:log-message"
        data["log_message_type"] = "log:subscribe"

        user_ids = require_list(user_ids)

        for i, user_id in enumerate(user_ids):
            if user_id == self._uid:
                raise FBchatUserError(
                    "Error when adding users: Cannot add self to group thread"
                )
            else:
                data[
                    "log_message_data[added_participants][{}]".format(i)
                ] = "fbid:{}".format(user_id)

        return self._doSendRequest(data)
488434
def create(self, user, obj, **kwargs):
        
        follow = Follow(user=user)
        follow.target = obj
        follow.save()
        return follow
104740
def member_add(self, stream_id, user_id):
        '''  '''
        req_hook = 'pod/v1/room/' + str(stream_id) + '/membership/add'
        req_args = '{ "id": %s }' % user_id
        status_code, response = self.__rest__.POST_query(req_hook, req_args)
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
1048228
def add_member(self, user):
        
        user = Transform.to_user(user)
        data = {
            'id': user
        }
        extra = {
            'resource': self.__class__.__name__,
            'query': {
                'id': self.id,
                'data': data,
            }
        }
        logger.info('Adding team member using id', extra=extra)
        response = self._api.post(
            url=self._URL['members_query'].format(id=self.id), data=data)
        member_data = response.json()
        return TeamMember(api=self._api, **member_data)
460646
def is_following(self, user, obj):
        
        if isinstance(user, AnonymousUser):
            return False        
        return 0 < self.get_follows(obj).filter(user=user).count()
993483
public void addUser(UserDefinition userDef) {
        String userID = userDef.getID();
        Utils.require(!Utils.isEmpty(userID), "User ID must be set");
        Utils.require(!m_users.containsKey(userID), "Duplicate user ID: " + userID);
        m_users.put(userID, userDef);
    }
248799
def add_user(self, ):
        
        i = self.user_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            user = item.internal_data()
            if self._project:
                self._project.users.add(user)
            else:
                self._task.users.add(user)
            self.users.append(user)
            item.set_parent(None)
403009
async def add_member(self, db, user):
        '''  '''

        # use model's pk as query
        query = {self.primary_key: self.pk}
        # push review
        result = await db[self.get_collection_name()].update_one(
            filter=query,
            update={'$addToSet': {'members': DBRefField(User).to_python(user)}},
        )
        return result
298021
def add_current_spouse(spouse)

      raise_unless_current_spouse_enabled
      check_incompatible_relationship(:current_spouse,spouse)

      if gclass.perform_validation_enabled
        self.current_spouse = spouse
        spouse.current_spouse = self
        transaction do
          spouse.save!
          save!
        end
      else
        transaction do
          self.update_attribute(:current_spouse,spouse)
          spouse.update_attribute(:current_spouse,self)
        end
      end

    end
295583
public function followResource($userId, $resourceId, $resourceClass)
    {
        $followerResource = new FollowerResource();
        $followerResource->setFollowerId($userId);
        $followerResource->setResourceId($resourceId);
        $followerResource->setHash($this->getHash($resourceId, $resourceClass));
        $followerResource->setResourceClass($resourceClass);

        $this->getEntityManager()->persist($followerResource);
        $this->getEntityManager()->flush();

        return $followerResource;
    }
776134
def followers(user_name, repo_name, params={})
      _update_user_repo_params(user_name, repo_name)
      _validate_user_repo_params(user, repo) unless user? && repo?
      normalize! params

      response = get_request("/1.0/repositories/#{user}/#{repo.downcase}/followers/", params)
      return response unless block_given?
      response.each { |el| yield el }
    end