returns an array of participants for the discussion
429960
def participants(exclude_email=nil)
      ps = []
      self.posts.each do |p|
        if p.author_name && p.author_email
          ps << [p.author_name, p.author_email]
        end
      end
      ps.delete_if{|p| p[1] == exclude_email}.uniq
    end
1094048
def contributors(self, limit=None):
        
        return self._reddit.contributors(self.display_name, limit=limit)
852368
public void addParticipants(@NonNull final String conversationId, @NonNull final List<Participant> participants, @Nullable Callback<ComapiResult<Void>> callback) {
        adapter.adapt(addParticipants(conversationId, participants), callback);
    }
209541
def get_submissions(self, course, user_input):
        

        # Build lists of wanted users based on classrooms and specific users
        list_classroom_id = [ObjectId(o) for o in user_input.aggregation]
        classroom = list(self.database.aggregations.find({"_id": {"$in": list_classroom_id}}))
        more_username = [s["students"] for s in classroom]  # Extract usernames of students
        more_username = [y for x in more_username for y in x]  # Flatten lists
        
        # Get tasks based on organisational tags
        more_tasks = []
        for org_tag in user_input.org_tags:
            if org_tag in course.get_organisational_tags_to_task():
                more_tasks += course.get_organisational_tags_to_task()[org_tag]

        #Base query
        query_base = {
                "username": {"$in": user_input.user + more_username},
                "courseid": course.get_id(),
                "taskid": {"$in": user_input.task + more_tasks}
                }

        # Additional query field
        query_advanced = {}
        if user_input.grade_min and not user_input.grade_max:
            query_advanced["grade"] = {"$gte": float(user_input.grade_min)}
        elif not user_input.grade_min and user_input.grade_max:
            query_advanced["grade"] = {"$lte": float(user_input.grade_max)}
        elif user_input.grade_min and user_input.grade_max:
            query_advanced["grade"] = {"$gte": float(user_input.grade_min), "$lte": float(user_input.grade_max)}

        try:
            date_before = datetime.strptime(user_input.date_before, "%Y-%m-%d %H:%M:%S") if user_input.date_before else ''
            date_after = datetime.strptime(user_input.date_after, "%Y-%m-%d %H:%M:%S") if user_input.date_after else ''

            if date_before and not date_after:
                query_advanced["submitted_on"] = {"$lte": date_before}
            elif not date_before and date_after:
                query_advanced["submitted_on"] = {"$gte": date_after}
            elif date_before and date_after:
                query_advanced["submitted_on"] = {"$gte": date_after, "$lte": date_before}
        except ValueError:  # If match of datetime.strptime() fails
            pass
        
        # Query with tags
        if len(user_input.filter_tags) == len(user_input.filter_tags_presence):
            for i in range(0, len(user_input.filter_tags)):
                if id_checker(user_input.filter_tags[i]):
                    state = (user_input.filter_tags_presence[i] in ["True", "true"])
                    query_advanced["tests." + user_input.filter_tags[i]] = {"$in": [None, False]} if not state else True
            
        # Mongo operations
        data = list(self.database.submissions.find({**query_base, **query_advanced}).sort([(user_input.sort_by, 
            pymongo.DESCENDING if user_input.order == "0" else pymongo.ASCENDING)]))
        data = [dict(list(f.items()) + [("url", self.submission_url_generator(str(f["_id"])))]) for f in data]

        # Get best submissions from database
        user_tasks = list(self.database.user_tasks.find(query_base, {"submissionid": 1, "_id": 0}))
        best_submissions_list = [u["submissionid"] for u in user_tasks]  # list containing ids of best submissions
        for d in data:
            d["best"] = d["_id"] in best_submissions_list  # mark best submissions

        # Keep best submissions
        if "eval" in user_input or ("eval_dl" in user_input and "download" in web.input()):
            data = [d for d in data if d["best"]]
        return data, classroom
263534
def get_participants(self, namespace, room):
        """"""
        for sid, active in six.iteritems(self.rooms[namespace][room].copy()):
            yield sid
1220673
def contributors(self):
        """"""
        if not self._contributors:
            self._contributors = self.get_contributors()
        return self._contributors
682970
def check_who_read(self, messages):
        
        # we get the corresponding Participation objects
        for m in messages:
            readers = []
            for p in m.thread.participation_set.all():
                if p.date_last_check is None:
                    pass
                elif p.date_last_check > m.sent_at:
                    # the message has been read
                    readers.append(p.participant.id)
            setattr(m, "readers", readers)

        return messages
270654
def add_request_participants(self, issue_id_or_key, users_list):
        
        url = 'rest/servicedeskapi/request/{}/participant'.format(issue_id_or_key)
        data = {'usernames': users_list}

        return self.post(url, data=data)
280846
def participants(self):
        """"""
        ret = []
        for p in self.players:
            try:
                if     p.isComputer: ret.append(p)
                if not p.isObserver: ret.append(p) # could cause an exception if player isn't a PlayerPreGame
            except AttributeError: pass
        return ret
964407
def collaborators(self):
        
        if self.api and self.collaborator_ids:
            return self.api._get_users(self.collaborator_ids)
1005405
def quality(self):
        
        from udata.models import Discussion  # noqa: Prevent circular imports
        result = {}
        if not self.id:
            # Quality is only relevant on saved Datasets
            return result
        if self.next_update:
            result['frequency'] = self.frequency
            result['update_in'] = -(self.next_update - datetime.now()).days
        if self.tags:
            result['tags_count'] = len(self.tags)
        if self.description:
            result['description_length'] = len(self.description)
        if self.resources:
            result['has_resources'] = True
            result['has_only_closed_or_no_formats'] = all(
                resource.closed_or_no_format for resource in self.resources)
            result['has_unavailable_resources'] = not all(
                self.check_availability())
        discussions = Discussion.objects(subject=self)
        if discussions:
            result['discussions'] = len(discussions)
            result['has_untreated_discussions'] = not all(
                discussion.person_involved(self.owner)
                for discussion in discussions)
        result['score'] = self.compute_quality_score(result)
        return result
579854
function(messageContent, threadId) {
                /**
                 * + replyInfoVO                  {object : replyInfoVO}
                 *   - participant                {object : ParticipantVO}
                 *   - repliedToMessageId         {long}
                 *   - message                    {string}
                 *   - deleted                    {boolean}
                 *   - messageType                {int}
                 *   - metadata                   {string}
                 *   - systemMetadata             {string}
                 */

                var replyInfo = {
                    deleted: messageContent.deleted,
                    participant: undefined,
                    repliedToMessageId: messageContent.repliedToMessageId,
                    repliedToMessageTime: (messageContent.repliedToMessageNanos)
                        ? (parseInt(parseInt(messageContent.repliedToMessageTime) / 1000) * 1000000000) + parseInt(messageContent.repliedToMessageNanos)
                        : (parseInt(messageContent.repliedToMessageTime)),
                    repliedToMessageTimeMiliSeconds: parseInt(messageContent.repliedToMessageTime),
                    repliedToMessageTimeNanos: parseInt(messageContent.repliedToMessageNanos),
                    message: messageContent.message,
                    deleted: messageContent.deleted,
                    messageType: messageContent.messageType,
                    metadata: messageContent.metadata,
                    systemMetadata: messageContent.systemMetadata
                };

                if (messageContent.participant) {
                    replyInfo.participant = formatDataToMakeParticipant(messageContent.participant, threadId);
                }

                return replyInfo;
            }
990538
def subscribers(options = {})
      load
      return [] if info['push'].nil? || info['push']['subscribers'].nil?

      info['push']['subscribers'].map { |s| Subscriber.new(s, self, options) }
    end
1142658
def list_reced_topics(self, user_alias=None, start=0):
        
        user_alias = user_alias or self.api.user_alias
        xml = self.api.xml(API_GROUP_LIST_USER_RECED_TOPICS % user_alias, params={'start': start})
        return build_list_result(self._parse_topic_table(xml, 'title,comment,time,group,rec'), xml)
675249
public function list_participants($currentgroup, $idsonly, $tablesort = false) {
        global $DB, $USER;

        // Get the last known sort order for the grading table.

        if (empty($currentgroup)) {
            $currentgroup = 0;
        }

        $key = $this->context->id . '-' . $currentgroup . '-' . $this->show_only_active_users();
        if (!isset($this->participants[$key])) {
            list($esql, $params) = get_enrolled_sql($this->context, 'mod/assign:submit', $currentgroup,
                    $this->show_only_active_users());

            $fields = 'u.*';
            $orderby = 'u.lastname, u.firstname, u.id';

            $additionaljoins = '';
            $additionalfilters = '';
            $instance = $this->get_instance();
            if (!empty($instance->blindmarking)) {
                $additionaljoins .= " LEFT JOIN {assign_user_mapping} um
                                  ON u.id = um.userid
                                 AND um.assignment = :assignmentid1
                           LEFT JOIN {assign_submission} s
                                  ON u.id = s.userid
                                 AND s.assignment = :assignmentid2
                                 AND s.latest = 1
                        ";
                $params['assignmentid1'] = (int) $instance->id;
                $params['assignmentid2'] = (int) $instance->id;
                $fields .= ', um.id as recordid ';

                // Sort by submission time first, then by um.id to sort reliably by the blind marking id.
                // Note, different DBs have different ordering of NULL values.
                // Therefore we coalesce the current time into the timecreated field, and the max possible integer into
                // the ID field.
                if (empty($tablesort)) {
                    $orderby = "COALESCE(s.timecreated, " . time() . ") ASC, COALESCE(s.id, " . PHP_INT_MAX . ") ASC, um.id ASC";
                }
            }

            if ($instance->markingworkflow &&
                    $instance->markingallocation &&
                    !has_capability('mod/assign:manageallocations', $this->get_context()) &&
                    has_capability('mod/assign:grade', $this->get_context())) {

                $additionaljoins .= ' LEFT JOIN {assign_user_flags} uf
                                     ON u.id = uf.userid
                                     AND uf.assignment = :assignmentid3';

                $params['assignmentid3'] = (int) $instance->id;

                $additionalfilters .= ' AND uf.allocatedmarker = :markerid';
                $params['markerid'] = $USER->id;
            }

            $sql = "SELECT $fields
                      FROM {user} u
                      JOIN ($esql) je ON je.id = u.id
                           $additionaljoins
                     WHERE u.deleted = 0
                           $additionalfilters
                  ORDER BY $orderby";

            $users = $DB->get_records_sql($sql, $params);

            $cm = $this->get_course_module();
            $info = new \core_availability\info_module($cm);
            $users = $info->filter_user_list($users);

            $this->participants[$key] = $users;
        }

        if ($tablesort) {
            // Resort the user list according to the grading table sort and filter settings.
            $sortedfiltereduserids = $this->get_grading_userid_list(true, '');
            $sortedfilteredusers = [];
            foreach ($sortedfiltereduserids as $nextid) {
                $nextid = intval($nextid);
                if (isset($this->participants[$key][$nextid])) {
                    $sortedfilteredusers[$nextid] = $this->participants[$key][$nextid];
                }
            }
            $this->participants[$key] = $sortedfilteredusers;
        }

        if ($idsonly) {
            $idslist = array();
            foreach ($this->participants[$key] as $id => $user) {
                $idslist[$id] = new stdClass();
                $idslist[$id]->id = $id;
            }
            return $idslist;
        }
        return $this->participants[$key];
    }
91993
def get_participants_for_section(section, person=None):
    
    section_label = encode_section_label(section.section_label())
    url = "/rest/gradebook/v1/section/{}/participants".format(section_label)
    headers = {}

    if person is not None:
        headers["X-UW-Act-as"] = person.uwnetid

    data = get_resource(url, headers)

    participants = []
    for pt in data["participants"]:
        participants.append(_participant_from_json(pt))

    return participants
850681
public function getParticipation(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/participation',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
    }