code: def noisy_moments(self, moments: 'Iterable[cirq.Moment]',
                        system_qubits: Sequence['cirq.Qid']
                       ) -> Sequence['cirq.OP_TREE']:
          
          if not hasattr(self.noisy_moment, '_not_overridden'):
              result = []
              for moment in moments:
                  result.append(self.noisy_moment(moment, system_qubits))
              return result
  
          if not hasattr(self.noisy_operation, '_not_overridden'):
              result = []
              for moment in moments:
                  result.append([self.noisy_operation(op) for op in moment])
              return result
  
          assert False, 'Should be unreachable.'
docs: Adds possibly stateful noise to a series of moments.
  
          Args:
              moments: The moments to add noise to.
              system_qubits: A list of all qubits in the system.
  
          Returns:
              A sequence of OP_TREEs, with the k'th tree corresponding to the
              noisy operations for the k'th moment.