def do_populate(clear=False):
 scope_dict = oauth_scopes.public_scopes
 if clear:
  ApiOAuth2Scope.remove()
 for (name, scope) in scope_dict.iteritems():
  if (scope.is_public is True):
   get_or_create(name, scope.description, save=True)
  else:
   logger.info('{} is not a publicly advertised scope; did not load into database'.format(name))

def do_populate ( clear = False ) : scope_dict = oauth_scopes . public_scopes if clear : ApiOAuth2Scope . remove ( ) for ( name , scope ) in scope_dict . iteritems ( ) : if ( scope . is_public is True ) : get_or_create ( name , scope . description , save = True ) else : logger . info ( '{} is not a publicly advertised scope; did not load into database' . format ( name ) )
given a dictionary of scope definitions .