def _load_opts_from_mrjob_conf(runner_alias, conf_path, already_loaded):
 conf = _conf_object_at_path(conf_path)
 if (conf is None):
  return [(None, {})]
 real_conf_path = os.path.realpath(conf_path)
 if (real_conf_path in already_loaded):
  return []
 else:
  already_loaded.append(real_conf_path)
 try:
  values = (conf['runners'][runner_alias] or {})
 except (KeyError, TypeError, ValueError):
  values = {}
 inherited = []
 if conf.get('include', None):
  includes = conf['include']
  if isinstance(includes, string_types):
   includes = [includes]
  for include in reversed(includes):
   include = os.path.join(os.path.dirname(real_conf_path), expand_path(include))
   inherited = (_load_opts_from_mrjob_conf(runner_alias, include, already_loaded) + inherited)
 return (inherited + [(conf_path, values)])

def _load_opts_from_mrjob_conf ( runner_alias , conf_path , already_loaded ) : conf = _conf_object_at_path ( conf_path ) if ( conf is None ) : return [ ( None , { } ) ] real_conf_path = os . path . realpath ( conf_path ) if ( real_conf_path in already_loaded ) : return [ ] else : already_loaded . append ( real_conf_path ) try : values = ( conf [ 'runners' ] [ runner_alias ] or { } ) except ( KeyError , TypeError , ValueError ) : values = { } inherited = [ ] if conf . get ( 'include' , None ) : includes = conf [ 'include' ] if isinstance ( includes , string_types ) : includes = [ includes ] for include in reversed ( includes ) : include = os . path . join ( os . path . dirname ( real_conf_path ) , expand_path ( include ) ) inherited = ( _load_opts_from_mrjob_conf ( runner_alias , include , already_loaded ) + inherited ) return ( inherited + [ ( conf_path , values ) ] )
helper for :py:func:load_opts_from_mrjob_conf for recursive use .