// Tweets returns a collection of Tweets matching a search query.
// https://dev.twitter.com/rest/reference/get/search/tweets
169863
func (s *SearchService) Tweets(params *SearchTweetParams) (*Search, *http.Response, error) {
	search := new(Search)
	apiError := new(APIError)
	resp, err := s.sling.New().Get("tweets.json").QueryStruct(params).Receive(search, apiError)
	return search, resp, relevantError(err, *apiError)
}
173105
func (x *Index) Search(c context.Context, query string, opts *SearchOptions) *Iterator {
	t := &Iterator{
		c:           c,
		index:       x,
		searchQuery: query,
		more:        moreSearch,
		limit:       -1,
	}
	if opts != nil {
		if opts.Limit > 0 {
			t.limit = opts.Limit
		}
		t.fields = opts.Fields
		t.idsOnly = opts.IDsOnly
		t.sort = opts.Sort
		t.exprs = opts.Expressions
	}
	return t
}
838669
func (c *Clique) APIs(chain consensus.ChainReader) []rpc.API {
	return []rpc.API{{
		Namespace: "clique",
		Version:   "1.0",
		Service:   &API{chain: chain, clique: c},
		Public:    false,
	}}
}
1344643
func (t *Tree) Search(topic string) []interface{} {
	t.mutex.RLock()
	defer t.mutex.RUnlock()

	segments := strings.Split(topic, t.Separator)
	values := t.search([]interface{}{}, 0, segments, t.root)

	return t.clean(values)
}
399619
func (t Triple) Strings() []string {
	acc := make([]string, 0, 4)
	acc = append(acc, string(t.S))
	acc = append(acc, string(t.P))
	acc = append(acc, string(t.O))
	acc = append(acc, string(t.V))
	return acc
}
461831
def tweets_for_user(screen_name, limit=1e10):
    
    qu = Queue()
    p = Thread(target=_tweets_for_user, args=(qu, screen_name, limit))
    p.start()
    p.join(910)
    if p.is_alive():
        sys.stderr.write('no results after 15 minutes for %s. Aborting.' % screen_name)
        return []
    else:
        return qu.get()
1285105
func (s *UserService) Search(query string, params *UserSearchParams) ([]User, *http.Response, error) {
	if params == nil {
		params = &UserSearchParams{}
	}
	params.Query = query
	users := new([]User)
	apiError := new(APIError)
	resp, err := s.sling.New().Get("search.json").QueryStruct(params).Receive(users, apiError)
	return *users, resp, relevantError(err, *apiError)
}
540637
func (r *Rule) Matches(msg map[string]interface{}) bool {
	for field, values := range r.Matchers {
		if !fieldMatches(field, values, msg) {
			return false
		}
	}
	return true
}
870657
func (rs *ResultSet) Strings() []string {
	ss := make([]string, len(rs.items))
	for index, item := range rs.items {
		s, ok := item.(fmt.Stringer)
		if !ok {
			// Must not happen!
			panic("illegal type in array")
		}
		ss[index] = s.String()
	}
	return ss
}
345246
func (c *Verification) Search(m *VerifySearchRequest) (*VerifySearchResponse, error) {
	var verifySearchResponse *VerifySearchResponse

	if !c.client.useOauth {
		m.apiKey = c.client.apiKey
		m.apiSecret = c.client.apiSecret
	}

	var r *http.Request
	buf, err := json.Marshal(m)
	if err != nil {
		return nil, errors.New("invalid message struct - unable to convert to JSON")
	}

	b := bytes.NewBuffer(buf)
	r, err = http.NewRequest("POST", apiRootv2+"/verify/search/json", b)
	if err != nil {
		return nil, err
	}

	r.Header.Add("Accept", "application/json")
	r.Header.Add("Content-Type", "application/json")

	resp, err := c.client.HTTPClient.Do(r)
	if err != nil {
		return nil, err
	}

	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}

	err = json.Unmarshal(body, &verifySearchResponse)
	if err != nil {
		return nil, err
	}

	return verifySearchResponse, nil
}
1260631
private function listHashTags(array $tweet)
    {
        $list = [];

        if (array_key_exists('entities', $tweet) and array_key_exists('hashtags', $tweet['entities']))
        {
            $hashTags = $tweet['entities']['hashtags'];

            foreach ($hashTags as $hashTag)
            {
                if (array_key_exists('text', $hashTag))
                {
                    $list[] = $hashTag['text'];
                }
            }
        }

        return $list;
    }
88312
func (l *List) All() (results []string, err error) {
	if l.name == nil {
		return nil, ErrDoesNotExist
	}
	return results, (*bbolt.DB)(l.db).View(func(tx *bbolt.Tx) error {
		bucket := tx.Bucket(l.name)
		if bucket == nil {
			return ErrBucketNotFound
		}
		return bucket.ForEach(func(_, value []byte) error {
			results = append(results, string(value))
			return nil // Continue ForEach
		})
	})
}
731278
func (search *Search) Tags(tag string) (*SearchResult, error) {
	insta := search.inst
	body, err := insta.sendRequest(
		&reqOptions{
			Endpoint: urlSearchTag,
			Query: map[string]string{
				"is_typeahead": "true",
				"rank_token":   insta.rankToken,
				"q":            tag,
			},
		},
	)
	if err != nil {
		return nil, err
	}

	res := &SearchResult{}
	err = json.Unmarshal(body, res)
	return res, err
}
153811
func (src List) URLs() map[version.Binary][]string {
	result := map[version.Binary][]string{}
	for _, tools := range src {
		result[tools.Version] = append(result[tools.Version], tools.URL)
	}
	return result
}
748714
func ExtractCashtags(text string) []*TwitterEntity {
	if !strings.Contains(text, "$") {
		return nil
	}

	var (
		result       entitiesT
		cashtagStart int
		cashtagEnd   int
		offset       int
		nextOffset   int
	)

	// Start at the beginning of the input string,
	// walking forward one match at a time. We have
	// to walk the string because the regexp package
	// lacks support for lookahead assertions
	for {
		offset = nextOffset
		substr := text[offset:]
		match := validCashtag.FindStringSubmatchIndex(substr)

		// If no matches are found in this portion of the string,
		// we're done
		if match == nil {
			break
		}

		cashtagStart = match[validCashtagGroupCashtag*2]
		cashtagEnd = match[validCashtagGroupCashtag*2+1]

		// Next time around, start at the end of the current match,
		// minus 1 because indices are not inclusive
		nextOffset = cashtagEnd + offset - 1

		result = append(result, &TwitterEntity{
			Text:         substr[cashtagStart-1 : cashtagEnd],
			cashtag:      substr[cashtagStart:cashtagEnd],
			cashtagIsSet: true,
			ByteRange: Range{
				Start: cashtagStart + offset - 1,
				Stop:  cashtagEnd + offset,
			},
			Type: CASH_TAG,
		})
	}
	result.fixIndices(text)
	return result
}
1300951
func Strings(strings []string) string {
	var buf bytes.Buffer

	for _, s := range strings {
		buf.WriteString(fmt.Sprintf("%s-", s))
	}

	return fmt.Sprintf("%d", String(buf.String()))
}
996724
func (m *Matcher) Patterns() []string {
	m.mut.Lock()
	defer m.mut.Unlock()

	patterns := make([]string, len(m.patterns))
	for i, pat := range m.patterns {
		patterns[i] = pat.String()
	}
	return patterns
}