code: def validate_colormap(cm: tp.Optional[str]) -> None:
      VALID_MODIFIERS = ["inverse"]
      if cm is None:
          return
      cm_modifiers = cm.split("#", 1)
      cm = cm_modifiers[0]
      # We don't want `d3.interpolateTurbo` but just `interpolateTurbo`
      if (
          cm is not None
          and not cm.startswith("interpolate")
          and not cm.startswith("scheme")
      ):
          raise ExperimentValidationError(
              f"""Invalid colormap `{cm}`.
  Valid colormaps can be found in https://github.com/d3/d3-scale-chromatic. Their name starts with `interpolate` or `scheme`.
  Examples include `interpolateSpectral`, `interpolateViridis`, `interpolateSinebow`, `schemeYlOrRd`
  """
          )
      if len(cm_modifiers) > 1:
          for modifier in cm_modifiers[1].split(","):
              if modifier not in VALID_MODIFIERS:
                  raise ExperimentValidationError(
                      f"""Invalid colormap modifier `{modifier}`.
  Valid colormaps modifiers: {','.join(VALID_MODIFIERS)}
  """
                  )
  
imports: import csv
  import uuid
  import json
  import codecs
  import warnings
  from abc import ABCMeta, abstractmethod
  from enum import Enum
  from collections import defaultdict
  from pathlib import Path
  import typing
label_desc: Use image node_id 1 for calling a global function with example usage: validate_colormap(cm) without return types