code: def _safe_name_list(lst, operation, name):
      if operation == "write":
          assert isinstance(lst, (list, tuple, np.ndarray)), type(lst)
          if any("{COLON}" in val for val in lst):
              raise ValueError(
                  f'The substring "{{COLON}}" in {name} not supported.'
              )
          return ":".join(val.replace(":", "{COLON}") for val in lst)
      else:
          # take a sanitized string and return a list of strings
          assert operation == "read"
          assert lst is None or isinstance(lst, str)
          if not lst:  # None or empty string
              return []
          return [val.replace("{COLON}", ":") for val in lst.split(":")]
  
imports: import os.path
  import re
  import time
  import uuid
  from contextlib import contextmanager
  from gzip import GzipFile
  import numpy
  from scipy.sparse import csc_matrix, csr_matrix
  from ..utils import _file_like, _validate_type, logger
  from ..utils.numerics import _cal_to_julian
  from .constants import FIFF
label_desc: Use image node_id 14 for calling a global function with example usage: _safe_name_list(lst, operation, name) and returns: str, unknown, list