code: def testAddSpatialNoise(self):
      patternMachine = PatternMachine(10000, 1000, num=100)
      sequenceMachine = SequenceMachine(patternMachine)
      numbers = range(0, 100)
      numbers.append(None)
  
      sequence = sequenceMachine.generateFromNumbers(numbers)
      noisy = sequenceMachine.addSpatialNoise(sequence, 0.5)
  
      overlap = len(noisy[0] & patternMachine.get(0))
      self.assertTrue(400 < overlap < 600)
  
      sequence = sequenceMachine.generateFromNumbers(numbers)
      noisy = sequenceMachine.addSpatialNoise(sequence, 0.0)
  
      overlap = len(noisy[0] & patternMachine.get(0))
      self.assertEqual(overlap, 1000)
  
file_path: nupic-legacy/tests/unit/nupic/data/generators/sequence_machine_test.py
imports: import unittest
  from nupic.data.generators.pattern_machine import PatternMachine, ConsecutivePatternMachine
  from nupic.data.generators.sequence_machine import SequenceMachine
label_desc: Use image node_id 3 for calling the SequenceMachineTest obj's underlying member method code with example usage: obj.testAddSpatialNoise() without return types