def fetch_and_index(self, fetch_func):
        "Fetch data with func, return dict indexed by ID"
        data, e = fetch_func()
        if e: raise e
        yield {row['id']: row for row in data}
def fetch_and_index ( self , fetch_func ) : data , e = fetch_func ( ) if e : raise e yield { row [ 'id' ] : row for row in data }
Fetch data with func, return dict indexed by ID