def translate_jobconf_dict(jobconf, hadoop_version=None):
 translated_jobconf = jobconf.copy()
 translation_warnings = {}
 for (variable, value) in jobconf.items():
  if hadoop_version:
   variants = [translate_jobconf(variable, hadoop_version)]
  else:
   variants = translate_jobconf_for_all_versions(variable)
  for variant in variants:
   if (variant in jobconf):
    continue
   translated_jobconf[variant] = value
   if hadoop_version:
    translation_warnings[variable] = variant
 if translation_warnings:
  log.warning('Detected hadoop configuration property names that do not match hadoop version %s:\nThe have been translated as follows\n %s', hadoop_version, '\n'.join([('%s: %s' % (variable, variant)) for (variable, variant) in sorted(translation_warnings.items())]))
 return translated_jobconf

def translate_jobconf_dict ( jobconf , hadoop_version = None ) : translated_jobconf = jobconf . copy ( ) translation_warnings = { } for ( variable , value ) in jobconf . items ( ) : if hadoop_version : variants = [ translate_jobconf ( variable , hadoop_version ) ] else : variants = translate_jobconf_for_all_versions ( variable ) for variant in variants : if ( variant in jobconf ) : continue translated_jobconf [ variant ] = value if hadoop_version : translation_warnings [ variable ] = variant if translation_warnings : log . warning ( 'Detected hadoop configuration property names that do not match hadoop version %s:\nThe have been translated as follows\n %s' , hadoop_version , '\n' . join ( [ ( '%s: %s' % ( variable , variant ) ) for ( variable , variant ) in sorted ( translation_warnings . items ( ) ) ] ) ) return translated_jobconf
translates the configuration property name to match those that are accepted in hadoop_version .