<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute(self, deltaLocation=(), newLocation=(), featureLocationInput=(), featureLocationGrowthCandidates=(), learn=True):
 """ Run one time step of the Location Memory algorithm. @param deltaLocation (sorted numpy array) @param newLocation (sorted numpy array) @param featureLocationInput (sorted numpy array) @param featureLocationGrowthCandidates (sorted numpy array) """

    prevActiveCells = self.activeCells

    self.activeDeltaSegments = np.where(
      (self.internalConnections.computeActivity(
        prevActiveCells, self.connectedPermanence
      ) >= self.activationThreshold)
      &
      (self.deltaConnections.computeActivity(
        deltaLocation, self.connectedPermanence
      ) >= self.activationThreshold))[0]

    # When we're moving, the feature-location input has no effect.
    if len(deltaLocation) == 0:
      self.activeFeatureLocationSegments = np.where(
        self.featureLocationConnections.computeActivity(
          featureLocationInput, self.connectedPermanence
        ) >= self.activationThreshold)[0]
    else:
      self.activeFeatureLocationSegments = np.empty(0, dtype="uint32")


    if len(newLocation) > 0:
      # Drive activations by relaying this location SDR.
      self.activeCells = newLocation

      if learn:
        # Learn the delta.
        self._learnTransition(prevActiveCells, deltaLocation, newLocation)

        # Learn the featureLocationInput.
        self._learnFeatureLocationPair(newLocation, featureLocationInput,
                                       featureLocationGrowthCandidates)


    elif len(prevActiveCells) > 0:
      if len(deltaLocation) > 0:
        # Drive activations by applying the deltaLocation to the current location.
        # Completely ignore the featureLocationInput. It's outdated, associated
        # with the previous location.

        cellsForDeltaSegments = self.internalConnections.mapSegmentsToCells(
          self.activeDeltaSegments)

        self.activeCells = np.unique(cellsForDeltaSegments)
      else:
        # Keep previous active cells active.
        # Modulate with the featureLocationInput.

        if len(self.activeFeatureLocationSegments) > 0:

          cellsForFeatureLocationSegments = (
            self.featureLocationConnections.mapSegmentsToCells(
              self.activeFeatureLocationSegments))
          self.activeCells = np.intersect1d(prevActiveCells,
                                            cellsForFeatureLocationSegments)
        else:
          self.activeCells = prevActiveCells

    elif len(featureLocationInput) > 0:
      # Drive activations with the featureLocationInput.

      cellsForFeatureLocationSegments = (
        self.featureLocationConnections.mapSegmentsToCells(
          self.activeFeatureLocationSegments))

      self.activeCells = np.unique(cellsForFeatureLocationSegments)