'" Returns a list of results from Bing for the given query.
- type : SEARCH, IMAGE or NEWS,
- start: maximum 1000 results => start 1-100 with count=10, 1000/count,
- count: maximum 50, or 15 for news,
- size : for images, either SMALL, MEDIUM or LARGE.
There is no daily query limit.'

def search(self, query, type=SEARCH, start=1, count=10, sort=RELEVANCY, size=None, cached=True, **kwargs):

    if (type not in (SEARCH, IMAGE, NEWS)):
        raise SearchEngineTypeError
    if (type == SEARCH):
        src = 'Web'
    if (type == IMAGE):
        src = 'Image'
    if (type == NEWS):
        src = 'News'
    if ((not query) or (count < 1) or (start < 1) or (start > (1000 / count))):
        return Results(((BING + src) + '?'), query, type)
    url = URL((BING + 'Composite'), method=GET, query={'Sources': (("'" + src.lower()) + "'"), 'Query': (("'" + query) + "'"), '$skip': (1 + ((start - 1) * count)), '$top': min(count, (((type == NEWS) and 15) or 50)), '$format': 'json'})
    if (size in (TINY, SMALL, MEDIUM, LARGE)):
        url.query['ImageFilters'] = {TINY: "'Size:Small'", SMALL: "'Size:Small'", MEDIUM: "'Size:Medium'", LARGE: "'Size:Large'"}[size]
    if ((type in (SEARCH, IMAGE)) and (self.language is not None)):
        url.query['Query'] = (url.query['Query'][:(-1)] + ("    language:    %s'" % self.language))
    if ((type in (NEWS,)) and (self.language is not None)):
        market = locale.market(self.language)
        if market:
            url.query['Market'] = (("'" + market) + "'")
    kwargs['authentication'] = ('', self.license)
    kwargs.setdefault('unicode', True)
    kwargs.setdefault('throttle', self.throttle)
    try:
        data = url.download(cached=cached, **kwargs)
    except HTTP401Authentication:
        raise HTTP401Authentication(('Bing    %s    API    is    a    paid    service' % type))
    except HTTP503ServiceUnavailable:
        raise SearchEngineLimitError
    data = json.loads(data)
    data = data.get('d', {})
    data = data.get('results', [{}])[0]
    results = Results(BING, query, type)
    results.total = int((data.get((src + 'Total')) or 0))
    for x in data.get(src, []):
        r = Result(url=None)
        r.url = self.format(x.get('MediaUrl', x.get('Url')))
        r.title = self.format(x.get('Title'))
        r.text = self.format(x.get('Description', x.get('Snippet')))
        r.language = (self.language or '')
        r.date = self.format(x.get('DateTime', x.get('Date')))
        r.author = self.format(x.get('Source'))
        results.append(r)
    return results
