code: def stimulus(self, stimulus):
          
  
          if not isinstance(stimulus, SimulationStimulus):
              stimulus = SimulationStimulus.FromString(stimulus)
  
          self.stimuli.append(stimulus)
          self.stimuli.sort(key=lambda x:x.time)
docs: Add a simulation stimulus at a given time.
  
          A stimulus is a specific input given to the graph at a specific
          time to a specific input stream.  The format for specifying a
          stimulus is:
          [time: ][system ]input X = Y
          where X and Y are integers.
  
          This will cause the simulator to inject this input at the given time.
          If you specify a time of 0 seconds, it will happen before the simulation
          starts.  Similarly, if you specify a time of 1 second it will also happen
          before anything else since the simulations start with a tick value of 1.
  
          The stimulus is injected before any other things happen at each new tick.
  
          Args:
              stimulus (str or SimulationStimulus): A prebuilt stimulus object or
                  a string description of the stimulus of the format:
                  [time: ][system ]input X = Y
                  where time is optional and defaults to 0 seconds if not specified.
  
          Examples:
              sim.stimulus('system input 10 = 15')
              sim.stimulus('1 minute: input 1 = 5')