code: def __init__(self, descriptor_string=None, prev_names=None):
      # self.operator is a string that may be 'Offset', 'Append',
      # 'Sum', 'Failover', 'IfDefined', 'Offset', 'Switch', 'Round',
      # 'ReplaceIndex'; it also may be None, representing the base-case
      # (where it's just a layer name)
  
      # self.items will be whatever items are
      # inside the parentheses, e.g. if this is Sum(foo bar),
      # then items will be [d1, d2], where d1 is a Descriptor for
      # 'foo' and d1 is a Descriptor for 'bar'.  However, there are
      # cases where elements of self.items are strings or integers,
      # for instance in an expression 'ReplaceIndex(ivector, x, 0)',
      # self.items would be [d, 'x', 0], where d is a Descriptor
      # for 'ivector'.  In the case where self.operator is None (where
      # this Descriptor represents just a bare layer name), self.
      # items contains the name of the input layer as a string.
      self.operator = None
      self.items = None
  
      if descriptor_string != None:
          try:
              tokens = tokenize_descriptor(
                  descriptor_string, prev_names
              )
              pos = 0
              (d, pos) = parse_new_descriptor(tokens, pos, prev_names)
              # note: 'pos' should point to the 'end of string' marker
              # that terminates 'tokens'.
              if pos != len(tokens) - 1:
                  raise RuntimeError(
                      "Parsing Descriptor, saw junk at end: "
                      + " ".join(tokens[pos:-1])
                  )
              # copy members from d.
              self.operator = d.operator
              self.items = d.items
          except RuntimeError as e:
              traceback.print_tb(sys.exc_info()[2])
              raise RuntimeError(
                  "Error parsing Descriptor '{0}', specific error was: {1}".format(
                      descriptor_string, repr(e)
                  )
              )
  
imports: from __future__ import print_function
  from __future__ import division
  import re
  import sys
label_desc: Use image node_id 1 to create a new Descriptor object from inherited base classes: object with example: obj = Descriptor(descriptor_string, prev_names)