<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def computeActivity(self, activeInputsBySource, permanenceThreshold=None):
 """ Calculate the number of active synapses per segment. @param activeInputsBySource (dict) The active cells in each source. Example: {"customInputName1": np.array([42, 69])} """

    overlaps = None

    for source, connections in self.connectionsBySource.iteritems():
      o = connections.computeActivity(activeInputsBySource[source],
                                      permanenceThreshold)
      if overlaps is None:
        overlaps = o
      else:
        overlaps += o

    return overlaps