<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _sense(self, featureSDR, learn, waitForSettle):
 """ Send the sensory input into the network. Optionally, send it multiple times until the network settles. """


    for monitor in self.monitors.values():
      monitor.beforeSense(featureSDR)

    iteration = 0
    prevCellActivity = None
    while True:
      (inputParams,
       locationParams) = self.column.sensoryCompute(featureSDR, learn)

      if waitForSettle:
        cellActivity = (set(self.column.getSensoryRepresentation()),
                        set(self.column.getLocationRepresentation()))
        if cellActivity == prevCellActivity:
          # It settled. Don't even log this timestep.
          break

        prevCellActivity = cellActivity

      for monitor in self.monitors.values():
        if iteration > 0:
          monitor.beforeSensoryRepetition()
        monitor.afterInputCompute(**inputParams)
        monitor.afterLocationAnchor(**locationParams)

      iteration += 1

      if not waitForSettle or iteration >= self.maxSettlingTime:
        break