@staticmethod
  def GetModuleFile(module, is_file=os.path.isfile):
    module_file = getattr(module, '__file__', None)
    if module_file is None:
      return None


    source_file = module_file[:module_file.rfind('py') + 2]

    if is_file(source_file):
      return source_file
    return module.__file__
Helper method to try to determine modules source file.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/dev_appserver.py/ModuleManager.GetModuleFile