code: def _path_from_module(module):
          
          # Convert paths to list because Python's _NamespacePath doesn't support
          # indexing.
          paths = list(getattr(module, '__path__', []))
          if len(paths) != 1:
              filename = getattr(module, '__file__', None)
              if filename is not None:
                  paths = [os.path.dirname(filename)]
              else:
                  # For unknown reasons, sometimes the list returned by __path__
                  # contains duplicates that must be removed.
                  paths = list(set(paths))
          if len(paths) > 1:
              raise ImproperlyConfigured(
                  "The bot module %r has multiple filesystem locations (%r); "
                  "you must configure this bot with an AppConfig subclass "
                  "with a 'path' class attribute." % (module, paths))
          elif not paths:
              raise ImproperlyConfigured(
                  "The bot module %r has no filesystem location, "
                  "you must configure this bot with an AppConfig subclass "
                  "with a 'path' class attribute." % (module,))
          return paths[0]
docs: Attempt to determine bot's filesystem path from its module.