code: def _parse_path_variables(pathname, path_template):
      """
      creates the dict of path variables passed to the layout
      e.g. path_template= "/asset/<asset_id>"
           if pathname provided by the browser is "/assets/a100"
           returns **{"asset_id": "a100"}
      """
  
      # parse variable definitions e.g. <var_name> from template
      # and create pattern to match
      wildcard_pattern = re.sub("<.*?>", "*", path_template)
      var_pattern = re.sub("<.*?>", "(.*)", path_template)
  
      # check that static sections of the pathname match the template
      if not fnmatch(pathname, wildcard_pattern):
          return None
  
      # parse variable names e.g. var_name from template
      var_names = re.findall("<(.*?)>", path_template)
  
      # parse variables from path
      variables = re.findall(var_pattern, pathname)
      variables = (
          variables[0] if isinstance(variables[0], tuple) else variables
      )
  
      return dict(zip(var_names, variables))
  
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 8 for calling a global function with example usage: _parse_path_variables(pathname, path_template) and returns: dict, None