code: def find_or_create_node(branch, key):
      """
      Given a list, look for dictionary with a key matching key and return it's
      value. If it doesn't exist, create it with the value of an empty list and
      return that.
      """
      for node in branch:
          if not isinstance(node, dict):
              continue
  
          if key in node:
              return node[key]
  
      new_branch = []
      node = {key: new_branch}
      branch.append(node)
      return new_branch
  
imports: from __future__ import annotations
  import functools
  import logging
  import os
  import posixpath
  import re
  import shutil
  import sys
  import warnings
  from collections import defaultdict
  from datetime import datetime, timezone
  from pathlib import PurePath
  from typing import TYPE_CHECKING, Collection, Iterable, MutableSequence, TypeVar
  from urllib.parse import urlsplit
  from mkdocs import exceptions
  from mkdocs.utils.yaml import get_yaml_loader, yaml_load
label_desc: Use image node_id 21 for calling a global function with example usage: find_or_create_node(branch, key) and returns: new_branch, node