Search for a user.

@param string $name Instagram username
@param int $limit Limit of returned results

@return mixed
326461
public function searchUser($name, $limit = 0)
    {
        $params = array();

        $params['q'] = $name;
        if ($limit > 0) {
            $params['count'] = $limit;
        }

        return $this->_makeCall('users/search', false, $params);
    }
72767
public function pins($username, $limit = Pagination::DEFAULT_LIMIT)
    {
        return $this->paginateByUsername(
            $username, UrlBuilder::RESOURCE_USER_PINS, $limit
        );
    }
1223459
public function index($name){
		$len = sizeof($this->rules);
		for ($i=0; $i < $len; $i++) { 
			if ($this->rules[$i]["name"]==$name)
				return $i;
		}
		return false;
	}
882508
public function getFans($limit=null, $filter = null)
    {
        if($this->oFans == null){
            $this->setFans(self::getManager()->findFans($this->id, $page=1, $filter, $limit));
        }

        return $this->oFans;
    }
976016
public function search($query, $limit = 10000, $showData = true, $include = null, $exclude = null)
    {
        $showData = $showData === true ? 1 : 0;

        $uri = "{$this->uri}?q=" . urlencode($query) . "&limit=$limit" . "&showData=$showData";

        if ($include) {
            $uri .= "&include=$include";
        } elseif($exclude) {
            $uri .= "&exclude=$exclude";
        }

        $response = Request::get($uri)
            ->authenticateWith($this->username, $this->password
            )->send();

        return $this->processResponse($response);
    }
361512
def search_user(self, user_name, quiet=False, limit=9):
        

        result = self.search(user_name, search_type=1002, limit=limit)

        if result['result']['userprofileCount'] <= 0:
            LOG.warning('User %s not existed!', user_name)
            raise SearchNotFound('user {} not existed'.format(user_name))
        else:
            users = result['result']['userprofiles']
            if quiet:
                user_id, user_name = users[0]['userId'], users[0]['nickname']
                user = User(user_id, user_name)
                return user
            else:
                return self.display.select_one_user(users)
330066
public function members(int $limit = 100) : array
    {
        $returnMembers = [];

        $members = $this->get(sprintf(self::COMMUNITY_ENDPOINT . 'communities/%s/members', $this->id()), [
            'limit' => $limit
        ]);

        if ($members->size === 0) return $returnMembers;

        foreach ($members->members as $member) {
            $returnMembers[] = new User($this->client, $member->onlineId);
        }

        return $returnMembers;
    }
1219794
public function lastIndexByName($name) {
        for ($i = count($this->tokens) - 1; $i >= 0; $i--) {
            if ($this->tokens[$i]->getName() === $name) {
                return $i;
            }
        }

        return null;
    }
1336783
public function followingBoards($username, $limit = Pagination::DEFAULT_LIMIT)
    {
        return $this->following($username, UrlBuilder::FOLLOWING_BOARDS, $limit);
    }
315237
public function followingPeople($username, $limit = Pagination::DEFAULT_LIMIT)
    {
        return $this->following($username, UrlBuilder::FOLLOWING_PEOPLE, $limit);
    }
840121
public function search($params)
    {
        $query = UserModel::find();
        if(array_key_exists("page", $params)&&array_key_exists("pageLimit", $params)){
            $query = $query->orderBy('id')
                    ->offset($params["page"]*$params["pageLimit"])
                    ->limit($params["pageLimit"]);
        }
        if(array_key_exists("status",$params)){
            $query->where(['status'=>$params["status"]]);
        }
        if(array_key_exists("q",$params)){
            $query->andFilterWhere(['like','username', $params["q"] ]);
        }
        $count = $query->count();
        $query=$query->all();


        return ['count'=>$count,'items'=>$query];
    }
31650
private function getProfileValue($name)
    {
        if (isset($this->data[static::PROFILE][$name])) {
            return $this->data[static::PROFILE][$name];
        }

        return null;
    }
263821
public function getFeed($limit = 12)
    {
        if (empty($this->userName)) {
            throw new InstagramException('Username cannot be empty');
        }

        if ($this->endCursor) {
            if (!$this->cacheManager instanceof CacheManager) {
                throw new CacheException('CacheManager object must be specified to use pagination');
            }

            $feed     = new JsonTransportFeed($this->client, $this->endCursor, $this->cacheManager);
            $hydrator = new JsonHydrator();
        } else {
            $feed     = new HtmlTransportFeed($this->client, $this->cacheManager);
            $hydrator = new HtmlHydrator();
        }

        $dataFetched = $feed->fetchData($this->userName, $limit);

        $hydrator->setData($dataFetched);

        return $hydrator->getHydratedData();
    }
781749
public static function message_search_users($userid, $search, $limitfrom = 0, $limitnum = 0) {
        global $USER;

        $systemcontext = context_system::instance();

        $params = array(
            'userid' => $userid,
            'search' => $search,
            'limitfrom' => $limitfrom,
            'limitnum' => $limitnum
        );
        $params = self::validate_parameters(self::message_search_users_parameters(), $params);
        self::validate_context($systemcontext);

        if (($USER->id != $params['userid']) && !has_capability('moodle/site:readallmessages', $systemcontext)) {
            throw new moodle_exception('You do not have permission to perform this action.');
        }

        list($contacts, $noncontacts) = \core_message\api::message_search_users(
            $params['userid'],
            $params['search'],
            $params['limitfrom'],
            $params['limitnum']);

        return array('contacts' => $contacts, 'noncontacts' => $noncontacts);
    }
1189324
public function tweets($limit = 1000)
    { 
        $params = [
            'index' => $this->_esindex,
            'type' => $this->_estype,
            'size' => $limit,
            'body' => [
                'query' => [
                    'match_all' => []
                ]
            ]
        ];
        $query = $this->_es->search($params);
        if ($query['hits']['total'] >= 1)
            $result = $query['hits']['hits'];
        else
            $result = [];
        return $result;
    }
1268043
public function getByName($name) {
        $templates = $this->listAll();
        if (empty($templates['user']))
            return false;
        foreach ($templates['user'] as $template) {
            if ($template['name'] === $name) {
                return $template['id'];
            }
        }
        return false;
    }
381157
public function findByName($name)
    {
        $q = $this->createSelectQuery();
        $q->where($q->expr->eq('name', $q->bindValue($name, ':name')));
        return $this->loadOneFromQuery($q);
    }