def _get_modulestore_branch_setting():
 def get_branch_setting():
  '\n        Finds and returns the branch setting based on the Django request and the configuration settings\n        '
  branch = None
  hostname = get_current_request_hostname()
  if hostname:
   mappings = getattr(settings, 'HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS', None)
   if mappings:
    for key in mappings.iterkeys():
     if re.match(key, hostname):
      return mappings[key]
  if (branch is None):
   branch = getattr(settings, 'MODULESTORE_BRANCH', None)
  return branch
 return get_branch_setting()

def _get_modulestore_branch_setting ( ) : def get_branch_setting ( ) : branch = None hostname = get_current_request_hostname ( ) if hostname : mappings = getattr ( settings , 'HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS' , None ) if mappings : for key in mappings . iterkeys ( ) : if re . match ( key , hostname ) : return mappings [ key ] if ( branch is None ) : branch = getattr ( settings , 'MODULESTORE_BRANCH' , None ) return branch return get_branch_setting ( )
returns the branch setting for the module store from the current django request if configured .