def _safe_region(region=None, context=None):
 ret = (region or settings.get('region'))
 context = (context or identity)
 if (not ret):
  if (not context):
   _create_identity()
   context = identity
  ret = context.get_default_region()
 if (not ret):
  try:
   ret = regions[0]
  except IndexError:
   ret = ''
 return ret

def _safe_region ( region = None , context = None ) : ret = ( region or settings . get ( 'region' ) ) context = ( context or identity ) if ( not ret ) : if ( not context ) : _create_identity ( ) context = identity ret = context . get_default_region ( ) if ( not ret ) : try : ret = regions [ 0 ] except IndexError : ret = '' return ret
value to use when no region is specified .