code: def setParameter(self, name, index, value):
      
      if name == "learningMode":
        self.learningMode = bool(int(value))
      elif name == "inferenceMode":
        self.inferenceMode = bool(int(value))
      else:
        return PyRegion.setParameter(self, name, index, value)
docs: Overrides :meth:`nupic.bindings.regions.PyRegion.PyRegion.setParameter`.