<s> """<STR_LIT>""" <EOL> from django . conf import settings <EOL> def openstack ( request ) : <EOL> """<STR_LIT>""" <EOL> context = { } <EOL> context . setdefault ( '<STR_LIT>' , [ ] ) <EOL> if request . user . is_authenticated ( ) : <EOL> context [ '<STR_LIT>' ] = [ <EOL> tenant for tenant in <EOL> request . user . authorized_tenants if tenant . enabled ] <EOL> available_regions = getattr ( settings , '<STR_LIT>' , [ ] ) <EOL> regions = { '<STR_LIT>' : len ( available_regions ) > <NUM_LIT:1> , <EOL> '<STR_LIT>' : { '<STR_LIT>' : request . session . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT:name>' : request . session . get ( '<STR_LIT>' ) } , <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : region [ <NUM_LIT:0> ] , '<STR_LIT:name>' : region [ <NUM_LIT:1> ] } for <EOL> region in available_regions ] } <EOL> context [ '<STR_LIT>' ] = regions <EOL> return context </s>
