code: def _infer_path(module_name, template):
      if template is None:
          if CONFIG.pages_folder:
              pages_module = str(Path(CONFIG.pages_folder).name)
              path = (
                  module_name.split(pages_module)[-1]
                  .replace("_", "-")
                  .replace(".", "/")
                  .lower()
              )
          else:
              path = (
                  module_name.replace("_", "-")
                  .replace(".", "/")
                  .lower()
              )
      else:
          # replace the variables in the template with "none" to create a default path if
          # no path is supplied
          path = re.sub("<.*?>", "none", template)
      path = "/" + path if not path.startswith("/") else path
      return path
  
imports: import collections
  import importlib
  import os
  import re
  import sys
  from fnmatch import fnmatch
  from pathlib import Path
  from os.path import isfile, join
  from urllib.parse import parse_qs
  import flask
  from .None import _validate
  from ._utils import AttributeDict
  from ._get_paths import get_relative_path
  from ._callback_context import context_value
  from ._get_app import get_app
label_desc: Use image node_id 3 for calling a global function with example usage: _infer_path(module_name, template) and returns: path