Prepare an array of users
@param array $list
772215
protected function prepareListUser(array &$list)
    {
        $stores = $this->store->getList();

        foreach ($list as &$item) {

            $item['url'] = '';

            if (isset($stores[$item['store_id']])) {
                $item['url'] = $this->store->getUrl($stores[$item['store_id']]) . "/account/{$item['user_id']}";
            }
        }
    }
1213484
protected function preparePagesBlog(array &$list)
    {
        foreach ($list as &$item) {

            list($teaser, $body) = $this->explodeText($item['description']);

            if ($body !== '') {
                $item['teaser'] = strip_tags($teaser);
            }

            $this->setItemEntityUrl($item, array('entity' => 'page'));
        }
    }
963136
function(members) {
              users = {};
              members.each(function(member) {
                if(member.id !== 'anonymous' && member.id !== 'undefined') {
                  if(settings.randomColor && member.info.color === undefined) {
                    member.info.color = settings.templates.color(member.id);
                  }
                  // sort list with admin first
                  html = (member.info.isAdmin)
                    ? settings.templates.userList(member.info) + html
                    : html + settings.templates.userList(member.info)
                  ;
                  users[ member.id ] = member.info;
                }
              });
              $module
                .data('users', users)
                .data('user', users[members.me.id] )
                .removeClass(className.loading)
              ;
              $userList
                .html(html)
              ;
              module.user.updateCount();
              $.proxy(settings.onJoin, $userList.children())();
            }
1184666
public void setUsers(List<User> users) {
		users.forEach(u -> validateNonNull(u));
		this.users = new ArrayList<>(users);
	}
1021178
protected function prepareListModule(array &$list)
    {
        foreach ($list as &$item) {
            $item['has_dependencies'] = !empty($item['requires']) || !empty($item['required_by']);
        }
    }
1350451
public function setGroupIdList($groupList)
    {
        if (!empty($groupList)) {
            foreach ($groupList as $group) {
                $this->groupIds[] = $group['GroupId'];
            }
        }

    }
1116073
protected function _toArray( array $list )
	{
		$result = array();

		foreach( $list as $item ) {
			$result[] = (object) $item->toArray();
		}

		return $result;
	}
984632
public static function get_users_in_context(userlist $userlist) {
        $context = $userlist->get_context();

        if (!is_a($context, \context_user::class)) {
            return;
        }

        // Add users based on userkey.
        \core_userkey\privacy\provider::get_user_contexts_with_script($userlist, $context, 'tool_mobile');
    }
668715
protected function __apiForceDelete (array $list)
    {
        HCGroupsUsers::whereIn ('group_id', $list)->forceDelete ();
        HCGroups::onlyTrashed ()->whereIn ('id', $list)->forceDelete ();

        return hcSuccess ();
    }
1203601
public function prependImageList($list) {
		$currentList = $this->getImageList();
		$list = array_merge($list, $currentList);
		return $this->setImageList($list);
	}
737740
public function listToMap(array $list)
    {
        $map = array();
        for ($i = 0, $n = count($list); $i < $n; $i += 2) {
            $map[$list[$i]] = $list[$i + 1];
        }
        return (object)$map;
    }
863426
public function set_users(array $users) {
        $this->users = $users;
        $hasbulkops = !empty($this->bulkoperations);
        foreach ($users as $userid=>$user) {
            $user = (array)$user;
            $row = new html_table_row();
            $row->attributes = array('class' => 'userinforow');
            $row->id = 'user_'.$userid;
            $row->cells = array();
            if ($hasbulkops) {
                // Add a checkbox into the first column.
                $input = html_writer::empty_tag('input', array('type' => 'checkbox', 'name' => 'bulkuser[]', 'value' => $userid));
                $row->cells[] = new html_table_cell($input);
            }
            foreach ($this->fields as $field => $label) {
                if (is_array($label)) {
                    $bits = array();
                    foreach (array_keys($label) as $subfield) {
                        if (array_key_exists($subfield, $user)) {
                            $bits[] = html_writer::tag('div', $user[$subfield], array('class'=>'subfield subfield_'.$subfield));
                        }
                    }
                    if (empty($bits)) {
                        $bits[] = '&nbsp;';
                    }
                    $row->cells[] = new html_table_cell(join(' ', $bits));
                } else {
                    if (!array_key_exists($field, $user)) {
                        $user[$field] = '&nbsp;';
                    }
                    $row->cells[] = new html_table_cell($user[$field]);
                }
            }
            $this->data[] = $row;
        }
    }
503599
protected function arrayShuffle($list)
    {
        $keys = array_keys($list);
        shuffle($keys);

        $new = [];
        foreach ($keys as $key) {
            $new[$key] = $list[$key];
        }

        return $new;
    }
1047507
public function setWhiteList(array $list)
    {
        $list = array_unique(array_filter(array_map('trim', array_values($list))));
        sort($list);
        if ($this->whiteList !== $list) {
            $this->clear();
            $this->whiteList = $list;
        }
        return $this;
    }
432000
protected function _executeList( array $list, $name = 'db' )
	{
		$conn = $this->_getConnection( $name );

		foreach( $list as $sql ) {
			$conn->create( $sql )->execute()->finish();
		}
	}
909533
def prepare_list
      page_info
      @list = user_scoped.where(@page_info.record.conditions).
          page(@page_info.page).
          per(@page_info.lines)
      if !@page_info.order_by.blank?
        @list = @list.order(@page_info.order_by + ' ' + @page_info.dir)
      end

      @count = user_scoped.where(@page_info.record.conditions).count
    end
442942
public function extend(ListInterface $list)
    {
        $args = $list->toArray();
        array_unshift($args, null);
        $args[0] = &$this->data;

        call_user_func_array('array_push', $args);
    }