def _get_current_inventory_resources(conn, rp):
 cur_res_sel = sa.select([_INV_TBL.c.resource_class_id]).where((_INV_TBL.c.resource_provider_id == rp.id))
 existing_resources = conn.execute(cur_res_sel).fetchall()
 return set([r[0] for r in existing_resources])

def _get_current_inventory_resources ( conn , rp ) : cur_res_sel = sa . select ( [ _INV_TBL . c . resource_class_id ] ) . where ( ( _INV_TBL . c . resource_provider_id == rp . id ) ) existing_resources = conn . execute ( cur_res_sel ) . fetchall ( ) return set ( [ r [ 0 ] for r in existing_resources ] )
returns a set() containing the resource class ids for all resources currently having an inventory record for the supplied resource provider .