<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_flavors(session):
 """Build the flavors mapping returns the mappings id <-> flavor """

    nclient = nova.Client(NOVA_VERSION, session=session,
                          region_name=os.environ['OS_REGION_NAME'])
    flavors = nclient.flavors.list()
    to_id = dict(list(map(lambda n: [n.name, n.id], flavors)))
    to_flavor = dict(list(map(lambda n: [n.id, n.name], flavors)))
    return to_id, to_flavor