code: def compute(self, inputs, outputs):
      
  
      # If there's a reset, don't call compute. In some implementations, an empty
      # input might cause unwanted effects.
      if "resetIn" in inputs:
        assert len(inputs["resetIn"]) == 1
        if inputs["resetIn"][0] != 0:
          # send empty output
          self._tm.reset()
          outputs["activeCells"][:] = 0
          outputs["predictedActiveCells"][:] = 0
          outputs["winnerCells"][:] = 0
          return
  
      activeColumns = inputs["activeColumns"].nonzero()[0]
  
      if "basalInput" in inputs:
        basalInput = inputs["basalInput"].nonzero()[0]
      else:
        basalInput = np.empty(0, dtype="uint32")
  
      if "apicalInput" in inputs:
        apicalInput = inputs["apicalInput"].nonzero()[0]
      else:
        apicalInput = np.empty(0, dtype="uint32")
  
      if "basalGrowthCandidates" in inputs:
        basalGrowthCandidates = inputs["basalGrowthCandidates"].nonzero()[0]
      else:
        basalGrowthCandidates = basalInput
  
      if "apicalGrowthCandidates" in inputs:
        apicalGrowthCandidates = inputs["apicalGrowthCandidates"].nonzero()[0]
      else:
        apicalGrowthCandidates = apicalInput
  
      self._tm.compute(activeColumns, basalInput, apicalInput,
                       basalGrowthCandidates, apicalGrowthCandidates, self.learn)
  
      # Extract the active / predicted cells and put them into binary arrays.
      outputs["activeCells"][:] = 0
      outputs["activeCells"][self._tm.getActiveCells()] = 1
      outputs["predictedCells"][:] = 0
      outputs["predictedCells"][
        self._tm.getPredictedCells()] = 1
      outputs["predictedActiveCells"][:] = (outputs["activeCells"] *
                                            outputs["predictedCells"])
      outputs["winnerCells"][:] = 0
      outputs["winnerCells"][self._tm.getWinnerCells()] = 1
docs: Run one iteration of TM's compute.