@contextmanager
def environment():
 reg = registry(common.get_db_name())
 with reg.cursor() as cr:
  (yield api.Environment(cr, SUPERUSER_ID, {}))
  cr.commit()

@ contextmanager def environment ( ) : reg = registry ( common . get_db_name ( ) ) with reg . cursor ( ) as cr : ( yield api . Environment ( cr , SUPERUSER_ID , { } ) ) cr . commit ( )
returns the environment of the device .