code: def _remove_names_prefix(
      names: List[Union[str, List[str]]]
  ) -> List[str]:
      if len(names) == 0:
          return []
  
      if isinstance(names[0], list):
          common = names[0]
      else:
          common = None
  
      for n in names:
          if common is None:
              break
          if not isinstance(n, list):
              common = None
          merge = []
          for x, y in zip(common, n):
              if x != y:
                  merge.append(None)
              else:
                  merge.append(x)
          common = merge
  
      res = []
      for n in names:
          if isinstance(n, list):
              if common is not None:
                  n = [
                      p
                      for i, p in enumerate(n)
                      if i > len(common) or p != common[i]
                  ]
              n = "-".join(n)
  
          res.append(n)
  
      return res
  
imports: from typing import Tuple, Optional, List, overload, Union, TYPE_CHECKING
  import numpy
  from labml.internal.analytics import cache
  from labml.internal.analytics.altair import density
  from labml.internal.analytics.altair import histogram
  from labml.internal.analytics.altair import scatter
  from labml.internal.analytics.altair import binned_heatmap
  from labml.internal.analytics.indicators import IndicatorCollection
  from labml.internal.analytics.models import ModelProbe
  from labml.internal.analytics.models import ValueCollection
  from labml.internal.analytics.models import DeepValueCollection
  from labml.internal.analytics.viz import text_attention
  from labml.internal.analytics.viz import init_inline_viz
label_desc: Use image node_id 1 for calling a global function with example usage: _remove_names_prefix(names) and returns: res, list