code: def _get_partial(name, partials_dict, partials_path, partials_ext):
      """Load a partial"""
      try:
          # Maybe the partial is in the dictionary
          return partials_dict[name]
      except KeyError:
          # Don't try loading from the file system if the partials_path is None or empty
          if partials_path is None or partials_path == "":
              return ""
  
          # Nope...
          try:
              # Maybe it's in the file system
              path_ext = "." + partials_ext if partials_ext else ""
              partial_path = path.join(partials_path, name + path_ext)
              with io.open(
                  partial_path, "r", encoding="utf-8"
              ) as partial:
                  return partial.read()
  
          except IOError:
              # Alright I give up on you
              return ""
  
imports: import io
  from os import linesep, path
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: _get_partial(name, partials_dict, partials_path, partials_ext) and returns: partials_dict, str, partial, str