def _file_from_modpath(modpath, path=None, context=None):
 assert (len(modpath) > 0)
 if (context is not None):
  try:
   (mtype, mp_filename) = _module_file(modpath, [context])
  except ImportError:
   (mtype, mp_filename) = _module_file(modpath, path)
 else:
  (mtype, mp_filename) = _module_file(modpath, path)
 if (mtype == PY_COMPILED):
  try:
   return get_source_file(mp_filename)
  except NoSourceFile:
   return mp_filename
 elif (mtype == C_BUILTIN):
  return None
 elif (mtype == PKG_DIRECTORY):
  mp_filename = _has_init(mp_filename)
 return mp_filename

def _file_from_modpath ( modpath , path = None , context = None ) : assert ( len ( modpath ) > 0 ) if ( context is not None ) : try : ( mtype , mp_filename ) = _module_file ( modpath , [ context ] ) except ImportError : ( mtype , mp_filename ) = _module_file ( modpath , path ) else : ( mtype , mp_filename ) = _module_file ( modpath , path ) if ( mtype == PY_COMPILED ) : try : return get_source_file ( mp_filename ) except NoSourceFile : return mp_filename elif ( mtype == C_BUILTIN ) : return None elif ( mtype == PKG_DIRECTORY ) : mp_filename = _has_init ( mp_filename ) return mp_filename
given a mod path .