<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def search(term, exact=False, rows=1e6):
    '''Searches ChEBI via ols.'''
    url = 'https://www.ebi.ac.uk/ols/api/search?ontology=chebi' + \
        '&exact=' + str(exact) + '&q=' + term + \
        '&rows=' + str(int(rows))

    response = requests.get(url)
    data = response.json()

    return [ChebiEntity(doc['obo_id']) for doc in data['response']['docs']]