def numSynapses(self, segment=None):
if segment is not None:<EOL><INDENT>return len(segment._synapses)<EOL><DEDENT>return self._numSynapses<EOL>
Returns the number of Synapses.

:param segment: (:class:`Segment`) Optional parameter to get the number of 
       synapses on a segment.

:returns: (int) Number of synapses on all segments if segment is not 
          specified, or on a specified segment.