code: def generate_get_metadata_container(registered_containers):
      def get_metadata_container(
          container_id, expected_container_type: ContainerType
      ):
          """This function will return run as well as projects. Will be cleaned in ModelRegistry"""
          for exp in registered_containers:
              if container_id in (str(exp.id), get_qualified_name(exp)):
                  return exp
  
          raise MetadataContainerNotFound.of_container_type(
              container_type=expected_container_type,
              container_id=container_id,
          )
  
      return get_metadata_container
  
file_path: neptune-client/tests/unit/neptune/new/cli/utils.py
imports: import threading
  from pathlib import Path
  from typing import Optional
  from neptune.cli.utils import get_qualified_name
  from neptune.constants import ASYNC_DIRECTORY, OFFLINE_DIRECTORY
  from neptune.exceptions import MetadataContainerNotFound
  from neptune.internal.backends.api_model import ApiExperiment
  from neptune.internal.container_type import ContainerType
  from neptune.internal.disk_queue import DiskQueue
  from neptune.internal.utils.sync_offset_file import SyncOffsetFile
  from tests.unit.neptune.new.utils.api_experiments_factory import api_metadata_container, api_run
label_desc: Use image node_id 1 for calling a global function with example usage: generate_get_metadata_container(registered_containers) and returns: get_metadata_container, exp