docs: def add_n_delay(delay_input, delay_time, initial_value, order, subs, subscript_dict):
      """
      Creates code to instantiate a stateful 'Delay' object,
      and provides reference to that object's output.
  
      The name of the stateful object is based upon the passed in parameters, so if
      there are multiple places where identical delay functions are referenced, the
      translated python file will only maintain one stateful object, and reference it
      multiple times.
  
      Parameters
      ----------
  
      delay_input: <string>
          Reference to the model component that is the input to the delay
  
      delay_time: <string>
          Can be a number (in string format) or a reference to another model element
          which will calculate the delay. This is calculated throughout the simulation
          at runtime.
  
      initial_value: <string>
          This is used to initialize the stocks that are present in the delay. We
          initialize the stocks with equal values so that the outflow in the first
          timestep is equal to this value.
  
      order: string
          The number of stocks in the delay pipeline. As we construct the delays at
          build time, this must be an integer and cannot be calculated from other
          model components. Anything else will yield a ValueError.
  
      Returns
      -------
      reference: basestring
          reference to the delay object `__call__` method, which will return the output
          of the delay process
  
      new_structure: list
          list of element construction dictionaries for the builder to assemble
      """
      # the py name has to be unique to all the passed parameters, or if there are two things
      # that delay the output by different amounts, they'll overwrite the original function...
  
      stateful = {
          'py_name': utils.make_python_identifier('_delay_%s_%s_%s_%s' % (delay_input,
                                                                         delay_time,
                                                                         initial_value,
                                                                         order))[0],
          'real_name': 'Delay of %s' % delay_input,
          'doc': 'Delay time: %s \n Delay initial value %s \n Delay order %s' % (
              delay_time, initial_value, order),
          'py_expr': 'functions.Delay(lambda: %s, lambda: %s, lambda: %s, lambda: %s)' % (
              delay_input, delay_time, initial_value, order),
          'unit': 'None',
          'lims': 'None',
          'eqn': 'None',
          'subs': '',
          'kind': 'stateful',
          'arguments': ''
      }
  
      return "%s()" % stateful['py_name'], [stateful]