'Return twitter search results for a given term.
Args:
term:
Term to search by. Optional if you include geocode.
since_id:
Returns results with an ID greater than (that is, more recent
than) the specified ID. There are limits to the number of
Tweets which can be accessed through the API. If the limit of
Tweets has occurred since the since_id, the since_id will be
forced to the oldest ID available. [Optional]
max_id:
Returns only statuses with an ID less than (that is, older
than) or equal to the specified ID. [Optional]
until:
Returns tweets generated before the given date. Date should be
formatted as YYYY-MM-DD. [Optional]
geocode:
Geolocation information in the form (latitude, longitude, radius)
[Optional]
count:
Number of results to return.    Default is 15 [Optional]
lang:
Language for results as ISO 639-1 code.    Default is None (all languages)
[Optional]
locale:
Language of the search query. Currently only \'ja\' is effective. This is
intended for language-specific consumers and the default should work in
the majority of cases.
result_type:
Type of result which should be returned.    Default is "mixed".    Other
valid options are "recent" and "popular". [Optional]
include_entities:
If True, each tweet will include a node called "entities,".
This node offers a variety of metadata about the tweet in a
discrete structure, including: user_mentions, urls, and
hashtags. [Optional]
Returns:
A sequence of twitter.Status instances, one for each message containing
the term'

def GetSearch(self, term=None, geocode=None, since_id=None, max_id=None, until=None, count=15, lang=None, locale=None, result_type='mixed', include_entities=None):

    parameters = {}
    if since_id:
        try:
            parameters['since_id'] = long(since_id)
        except:
            raise TwitterError('since_id    must    be    an    integer')
    if max_id:
        try:
            parameters['max_id'] = long(max_id)
        except:
            raise TwitterError('max_id    must    be    an    integer')
    if until:
        parameters['until'] = until
    if lang:
        parameters['lang'] = lang
    if locale:
        parameters['locale'] = locale
    if ((term is None) and (geocode is None)):
        return []
    if (term is not None):
        parameters['q'] = term
    if (geocode is not None):
        parameters['geocode'] = ','.join(map(str, geocode))
    if include_entities:
        parameters['include_entities'] = 1
    try:
        parameters['count'] = int(count)
    except:
        raise TwitterError('count    must    be    an    integer')
    if (result_type in ['mixed', 'popular', 'recent']):
        parameters['result_type'] = result_type
    url = ('%s/search/tweets.json' % self.base_url)
    json = self._FetchUrl(url, parameters=parameters)
    data = self._ParseAndCheckTwitter(json)
    return [Status.NewFromJsonDict(x) for x in data['statuses']]
