def requires(resource, msg=None):
 if (sys._getframe().f_back.f_globals.get('__name__') == '__main__'):
  return
 if (not is_resource_enabled(resource)):
  if (msg is None):
   msg = ("Use of the `%s' resource not enabled" % resource)
  raise ResourceDenied(msg)

def requires ( resource , msg = None ) : if ( sys . _getframe ( ) . f_back . f_globals . get ( '__name__' ) == '__main__' ) : return if ( not is_resource_enabled ( resource ) ) : if ( msg is None ) : msg = ( "Use of the `%s' resource not enabled" % resource ) raise ResourceDenied ( msg )
raise resourcedenied if the specified resource is not available .