code: def calc_cache_key(custom_models: dict[str, CustomModel]) -> str:
      """Generate a key to cache a custom extension implementation with.
  
      There is no metadata other than the Model classes, so this is the only
      base to generate a cache key.
  
      We build the model keys from the list of ``model.full_name``. This is
      not ideal but possibly a better solution can be found found later.
  
      """
      model_names = {
          model.full_name for model in custom_models.values()
      }
      encoded_names = ",".join(sorted(model_names)).encode("utf-8")
      return hashlib.sha256(encoded_names).hexdigest()
  
imports: from __future__ import annotations
  import logging
  import hashlib
  import json
  import os
  import re
  import sys
  from os.path import abspath, dirname, exists, isabs, join
  from pathlib import Path
  from subprocess import PIPE, Popen
  from typing import Any, Callable, Sequence
  from ..core.has_props import HasProps
  from ..settings import settings
  from .strings import snakify
label_desc: Use image node_id 6 for calling a global function with example usage: calc_cache_key(custom_models) and returns: hashlib