#NEWLINE# def jobconf_from_env( variable , default = None ) : #NEWLINE# #INDENT# "Get the value of a jobconf variable from the runtime environment.\n\n    For example, a :py:class:`~mrjob.job.MRJob` could use\n    ``jobconf_from_env('map.input.file')`` to get the name of the file a\n    mapper is reading input from.\n\n    If the name of the jobconf variable is different in different versions of\n    Hadoop (e.g. in Hadoop 2.0, ``map.input.file`` is\n    ``mapreduce.map.input.file``), we'll automatically try all variants before\n    giving up.\n\n    Return *default* if that jobconf variable isn't set.\n    " #NEWLINE# name = variable . replace ( '.' , '_' ) #NEWLINE# if ( name in os . environ ) : #NEWLINE# #INDENT# return os . environ [ name ] #NEWLINE# #UNINDENT# for var in _JOBCONF_MAP . get ( variable , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) . values ( ) : #NEWLINE# #INDENT# name = var . replace ( '.' , '_' ) #NEWLINE# if ( name in os . environ ) : #NEWLINE# #INDENT# return os . environ [ name ] #NEWLINE# #UNINDENT# #UNINDENT# return default