Get user activities (works for all users!)
977580
def user_activities(username, tournament=1):
    """"""
    click.echo(prettify(napi.get_user_activities(username, tournament)))
21655
def users_activate(user):
    """"""
    user_obj = _datastore.get_user(user)
    if user_obj is None:
        raise click.UsageError('ERROR: User not found.')
    if _datastore.activate_user(user_obj):
        click.secho('User "{0}" has been activated.'.format(user), fg='green')
    else:
        click.secho('User "{0}" was already activated.'.format(user),
                    fg='yellow')
359817
def search(self, **kw):
        """"""
        q = db.select(self.table).condition('status', 'active')
        for k, v in kw:
            q.condition(k, v)
        data = q.execute()
        users = []
        for user in data:
            users.append(self.load(user, self.model))
        return users
202145
function getUsers(){
    console.log('getUsers called');
    grout.Users.get().then(function(app){
      console.log('apps list loaded:', app);
      document.getElementById("output").innerHTML = JSON.stringify(app);
    }, function(err){
      console.error('Error getting users:', err);
    });
  }
876791
def query_all_user():
        '''
        
        '''
        return TabLog.select().where(TabLog.user_id != 'None').distinct(TabLog.user_id).order_by(
            TabLog.user_id
        )
1186045
def getUserAuthorizations(self, login, user):
    
    self.send_getUserAuthorizations(login, user)
    return self.recv_getUserAuthorizations()
641742
def get_all_users(resource_root, view=None):
  
  return call(resource_root.get, USERS_PATH, ApiUser, True,
      params=view and dict(view=view) or None)
1342931
def _get_user_groups(session, user_id, filter):
        
        return session.fetch_items('groups.get', Group.from_json, count=1000, user_id=user_id, filter=filter, extended=1, fields=",".join(Group.GROUP_FIELDS))
511187
def gather_explicit_activities(self):
        
        for stmt in self.statements:
            agents = stmt.agent_list()
            # Activity types given as ActivityConditions
            for agent in agents:
                if agent is not None and agent.activity is not None:
                    agent_base = self._get_base(agent)
                    agent_base.add_activity(agent.activity.activity_type)
            # Object activities given in RegulateActivity statements
            if isinstance(stmt, RegulateActivity):
                if stmt.obj is not None:
                    obj_base = self._get_base(stmt.obj)
                    obj_base.add_activity(stmt.obj_activity)
            # Activity types given in ActiveForms
            elif isinstance(stmt, ActiveForm):
                agent_base = self._get_base(stmt.agent)
                agent_base.add_activity(stmt.activity)
                if stmt.is_active:
                    agent_base.add_active_state(stmt.activity, stmt.agent,
                                                stmt.evidence)
                else:
                    agent_base.add_inactive_state(stmt.activity, stmt.agent,
                                                  stmt.evidence)
366994
def active_all(self, user=None):
        
        qs = self.deleted()
        if user:
            qs = qs.filter(recipient=user)
        qs.update(deleted=False)
1269424
def activities(self):
        
        if self._activities is None:
            self._activities = self._fetch_activities()
        return self._activities
1291067
def find_users(session, *usernames):
    """"""
    user_string = ','.join(usernames)
    return _make_request(session, FIND_USERS_URL, user_string)
1096563
def get_user_data(self, subid, params=None):
        ''' 
        '''
        params = update_params(params, {'SUBID': subid})
        return self.request('/v1/server/get_user_data', params, 'GET')
1177745
def render_activity activities, options = {}
      if activities.is_a? PublicActivity::Activity
        activities.render self, options
      elsif activities.respond_to?(:map)
        # depend on ORMs to fetch as needed
        # maybe we can support Postgres streaming with this?
        activities.map {|activity| activity.render self, options.dup }.join.html_safe
      end
    end
1008160
public function activityAction()
    {
        $filter = $this->getEvent()->getRouteMatch()->getParam('filter');
        $userId = $this->zfcUserAuthentication()->getIdentity()->getId();
        $user = $this->getServiceLocator()->get('playgrounduser_user_service')->getUserMapper()->findById($userId);
        $stories = $this->getStoryTellingService()->getStoryTellingMapper()->findWithStoryMappingByUser(
            $user,
            $filter
        );
        $total = count($stories);



        $activities = array();
        foreach ($stories as $story) {
            $matchToFilter = false || empty($filter);
            foreach ($story->getOpenGraphStoryMapping()->getStory()->getObjects() as $object) {
                if (strtolower($filter) == strtolower($object->getCode())) {
                    $matchToFilter = true;
                }
            }
            if ($matchToFilter) {
                $activities[] = array(
                  "object" => json_decode($story->getObject(), true),
                  "openGraphMapping" => $story->getOpenGraphStoryMapping()->getId(),
                  "hint"   => $story->getOpenGraphStoryMapping()->getHint(),
                  "activity_stream_text" => $story->getOpenGraphStoryMapping()->getActivityStream(),
                  "picto" => $story->getOpenGraphStoryMapping()->getPicto(),
                  "points" => $story->getPoints(),
                  'created_at' => $story->getCreatedAt(),
                  'definition' => $story->getOpenGraphStoryMapping()->getStory()->getDefinition(),
                  'label' => $story->getOpenGraphStoryMapping()->getStory()->getLabel()
                );
            }
        }

        if (is_array($activities)) {
            $paginator = new \Zend\Paginator\Paginator(new \Zend\Paginator\Adapter\ArrayAdapter($activities));
            $paginator->setItemCountPerPage(25);
            $paginator->setCurrentPageNumber($this->getEvent()->getRouteMatch()->getParam('p'));
        } else {
            $paginator = $activities;
        }

        $filters = $this->getObjectService()->getObjectMapper()->findAll();


        return new ViewModel(
            array(
                'stories' => $paginator,
                'filter'  => $filter,
                'filters' => $filters,
                'total' => $total
            )
        );
    }
1287536
def get_users_in_project(self, projectname):
        
        cmd = ["list", "assoc", "where", "account=%s" % projectname]
        results = self._read_output(cmd)

        user_list = []
        for result in results:
            if result["User"] != "":
                user_list.append(result["User"])
        return user_list
456254
def user_blocks(user_text, session):
    
    logger.debug("Getting blocks for {0}".format(user_text))
    doc = session.get(action='query', list='blocks', bkusers=user_text,
                      bkprop=['id', 'timestamp'])
    return [mwtypes.Timestamp(b['timestamp']) for b in doc['query']['blocks']]