code: def load_grammar(*, version: str = None, path: str = None):
      """
      Loads a :py:class:`parso.Grammar`. The default version is the current Python
      version.
  
      :param str version: A python version string, e.g. ``version='3.8'``.
      :param str path: A path to a grammar file
      """
      version_info = parse_version_string(version)
  
      file = path or os.path.join(
          "python",
          "grammar%s%s.txt" % (version_info.major, version_info.minor),
      )
  
      global _loaded_grammars
      path = os.path.join(os.path.dirname(__file__), file)
      try:
          return _loaded_grammars[path]
      except KeyError:
          try:
              bnf_text = pkgutil.get_data("parso", file).decode("utf-8")
              if bnf_text is None:
                  raise FileNotFoundError
  
              grammar = PythonGrammar(version_info, bnf_text)
              return _loaded_grammars.setdefault(path, grammar)
          except (FileNotFoundError, IOError):
              message = (
                  "Python version %s.%s is currently not supported."
                  % (version_info.major, version_info.minor)
              )
              raise NotImplementedError(message)
  
imports: import hashlib
  import os
  import pkgutil
  from typing import Generic, TypeVar, Union, Dict, Optional, Any
  from pathlib import Path
  from parso._compatibility import is_pypy
  from parso.pgen2 import generate_grammar
  from parso.utils import split_lines, python_bytes_to_unicode, PythonVersionInfo, parse_version_string
  from parso.python.diff import DiffParser
  from parso.python.tokenize import tokenize_lines, tokenize
  from parso.python.token import PythonTokenTypes
  from parso.cache import parser_cache, load_module, try_to_save_module
  from parso.parser import BaseParser
  from parso.python.parser import Parser
  from parso.python.errors import ErrorFinderConfig
  from parso.python import pep8
  from parso.file_io import FileIO, KnownContentFileIO
  from parso.normalizer import RefactoringNormalizer, NormalizerConfig
label_desc: Use image node_id 1 for calling a global function with example usage: load_grammar() and returns: _loaded_grammars, _loaded_grammars