code: def _get_condensed_steps(
      series: List[List[Tuple[int, any]]], limit: int
  ):
      steps = {}
      step_lookups = []
  
      series = [s for s in series if len(s) != 1 or s[0][0] != -1]
  
      for s in series:
          lookup = {}
          for i, c in enumerate(s):
              steps[c[0]] = steps.get(c[0], 0) + 1
              lookup[c[0]] = i
          step_lookups.append(lookup)
  
      steps = [k for k, v in steps.items() if v == len(series)]
      if len(steps) == 0:
          return [], step_lookups
  
      steps = sorted(steps)
      last = steps[-1]
      interval = max(1, last // (limit - 1))
  
      condensed = [steps[0]]
      for s in steps[1:]:
          if s - condensed[-1] >= interval:
              condensed.append(s)
      if condensed[-1] != steps[-1]:
          condensed.append(steps[-1])
      return condensed, step_lookups
  
file_path: labml/client/labml/internal/analytics/cache.py
imports: from pathlib import PurePath
  from typing import List, Tuple
  import numpy
  from labml.internal.analytics.indicators import Indicator, Run, RunsSet
label_desc: Use image node_id 5 for calling a global function with example usage: _get_condensed_steps(series, limit) and returns: condensed,  step_lookups, list,  step_lookups