def __eq__(self, other):
    """ Equality operator for Connections instances.
    Checks if two instances are functionally identical

    :param other: (:class:`Connections`) Connections instance to compare to
    """
    #pylint: disable=W0212
    for i in xrange(self.numCells):
      segments = self._cells[i]._segments
      otherSegments = other._cells[i]._segments

      if len(segments) != len(otherSegments):
        return False

      for j in xrange(len(segments)):
        segment = segments[j]
        otherSegment = otherSegments[j]
        synapses = segment._synapses
        otherSynapses = otherSegment._synapses

        if len(synapses) != len(otherSynapses):
          return False

        for synapse in synapses:
          found = False
          for candidate in otherSynapses:
            if synapse == candidate:
              found = True
              break

          if not found:
            return False

    if (len(self._synapsesForPresynapticCell) !=
        len(self._synapsesForPresynapticCell)):
      return False

    for i in self._synapsesForPresynapticCell.keys():
      synapses = self._synapsesForPresynapticCell[i]
      otherSynapses = other._synapsesForPresynapticCell[i]
      if len(synapses) != len(otherSynapses):
        return False

      for synapse in synapses:
        found = False
        for candidate in otherSynapses:
          if synapse == candidate:
            found = True
            break

        if not found:
          return False

    if self._numSynapses != other._numSynapses:
      return False

    #pylint: enable=W0212
    return True
def __eq__ ( self , other ) : for i in xrange ( self . numCells ) : segments = self . _cells [ i ] . _segments otherSegments = other . _cells [ i ] . _segments if len ( segments ) != len ( otherSegments ) : return False for j in xrange ( len ( segments ) ) : segment = segments [ j ] otherSegment = otherSegments [ j ] synapses = segment . _synapses otherSynapses = otherSegment . _synapses if len ( synapses ) != len ( otherSynapses ) : return False for synapse in synapses : found = False for candidate in otherSynapses : if synapse == candidate : found = True break if not found : return False if ( len ( self . _synapsesForPresynapticCell ) != len ( self . _synapsesForPresynapticCell ) ) : return False for i in self . _synapsesForPresynapticCell . keys ( ) : synapses = self . _synapsesForPresynapticCell [ i ] otherSynapses = other . _synapsesForPresynapticCell [ i ] if len ( synapses ) != len ( otherSynapses ) : return False for synapse in synapses : found = False for candidate in otherSynapses : if synapse == candidate : found = True break if not found : return False if self . _numSynapses != other . _numSynapses : return False return True
Equality operator for Connections instances.
    Checks if two instances are functionally identical

    :param other: (:class:`Connections`) Connections instance to compare to