def iterfiles(service, name=None, mimeType=SHEET, order=FILEORDER):
    """Fetch and yield ``(id, name)`` pairs for Google drive files."""
    params = {'orderBy': order, 'pageToken': None}
    q = []
    if name is not None:
        q.append("name='%s'" % name)
    if mimeType is not None:
        q.append("mimeType='%s'" % mimeType)
    if q:
        params['q'] = ' and '.join(q)

    while True:
        response = service.files().list(**params).execute()
        for f in response['files']:
            yield f['id'], f['name']
        try:
            params['pageToken'] = response['nextPageToken']
        except KeyError:
            return
Fetch and yield ``(id, name)`` pairs for Google drive files.