code: def module_name_from_path(folder_name, verbose=False):
      folder_name = folder_name.split('.pyc')[0]
      folder_name = folder_name.split('.py')[0]
      folder_name = os.path.normpath(folder_name)
      path = folder_name + '/'
      package = get_python_package(path)
      module = []
      if verbose:
          print(('folder_name', folder_name))
      while True:
          path = os.path.dirname(path)
          module.append(os.path.basename(path))
          if os.path.basename(path) == package:
              path = os.path.dirname(path)
              break
          if os.path.dirname(path) == path:
              path, module = None, None
              break
          if verbose:
              print(('path', path, os.path.dirname(path)))
          if verbose:
              print(('module', module))
      if verbose:
          print(('module', module))
      module.reverse()
      module = '.'.join(module)
      return module, path