code: def LinesCoupler(cdata, clock=None, **kwargs):
      if isinstance(cdata, LineSingle):
          return SingleCoupler(cdata, clock)  # return for single line
  
      cdatacls = (
          cdata.__class__
      )  # copy important structures before creation
      try:
          LinesCoupler.counter += 1  # counter for unique class name
      except AttributeError:
          LinesCoupler.counter = 0
  
      # Prepare a MultiCoupler subclass
      nclsname = str("LinesCoupler_%d" % LinesCoupler.counter)
      ncls = type(nclsname, (MultiCoupler,), {})
      thismod = sys.modules[LinesCoupler.__module__]
      setattr(thismod, ncls.__name__, ncls)
      # Replace lines et al., to get a sensible clone
      ncls.lines = cdatacls.lines
      ncls.params = cdatacls.params
      ncls.plotinfo = cdatacls.plotinfo
      ncls.plotlines = cdatacls.plotlines
  
      obj = ncls(cdata, **kwargs)  # instantiate
      # The clock is set here to avoid it being interpreted as a data by the
      # LineIterator background scanning code
      if clock is None:
          clock = getattr(cdata, "_clock", None)
          if clock is not None:
              nclock = getattr(clock, "_clock", None)
              if nclock is not None:
                  clock = nclock
              else:
                  nclock = getattr(clock, "data", None)
                  if nclock is not None:
                      clock = nclock
  
          if clock is None:
              clock = obj._owner
  
      obj._clock = clock
      return obj
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import collections
  import operator
  import sys
  from .utils.py3 import map, range, zip, with_metaclass, string_types
  from .utils import DotDict
  from .lineroot import LineRoot, LineSingle
  from .linebuffer import LineActions, LineNum
  from .lineseries import LineSeries, LineSeriesMaker
  from .dataseries import DataSeries
  from .None import metabase
label_desc: Use image node_id 1 for calling a global function with example usage: LinesCoupler(cdata, clock) and returns: obj, SingleCoupler