def file_from_modpath(modpath, path=None, context_file=None):
 if (context_file is not None):
  context = dirname(context_file)
 else:
  context = context_file
 if (modpath[0] == 'xml'):
  try:
   return _file_from_modpath((['_xmlplus'] + modpath[1:]), path, context)
  except ImportError:
   return _file_from_modpath(modpath, path, context)
 elif (modpath == ['os', 'path']):
  return os.path.__file__
 return _file_from_modpath(modpath, path, context)

def file_from_modpath ( modpath , path = None , context_file = None ) : if ( context_file is not None ) : context = dirname ( context_file ) else : context = context_file if ( modpath [ 0 ] == 'xml' ) : try : return _file_from_modpath ( ( [ '_xmlplus' ] + modpath [ 1 : ] ) , path , context ) except ImportError : return _file_from_modpath ( modpath , path , context ) elif ( modpath == [ 'os' , 'path' ] ) : return os . path . __file__ return _file_from_modpath ( modpath , path , context )
given a mod path .