@unittest.skipUnless(HAVE_IPYTHON, "requires IPython")
    def test__pretty(self):
        ann = get_annotations()
        ann['seed'] = self.seed1
        ann = pretty(ann).replace('\n ', '\n  ')
        res = pretty(self.seg1)

        sig0 = pretty(self.sigs1[0])
        sig1 = pretty(self.sigs1[1])
        sig2 = pretty(self.sigs1[2])
        sig3 = pretty(self.sigs1[3])
        sig0 = sig0.replace('\n', '\n   ')
        sig1 = sig1.replace('\n', '\n   ')
        sig2 = sig2.replace('\n', '\n   ')
        sig3 = sig3.replace('\n', '\n   ')

        sigarr0 = pretty(self.sigarrs1[0])
        sigarr1 = pretty(self.sigarrs1[1])
        sigarr0 = sigarr0.replace('\n', '\n   ')
        sigarr1 = sigarr1.replace('\n', '\n   ')

        targ = ("Segment with " +
                ("%s analogsignals, %s analogsignalarrays, " %
                 (len(self.sigs1a), len(self.sigarrs1a))) +
                ("%s epochs, %s epocharrays, " %
                 (len(self.epcs1a), len(self.epcas1a))) +
                ("%s events, %s eventarrays, " %
                 (len(self.evts1a), len(self.evtas1a))) +
                ("%s irregularlysampledsignals, " %
                 len(self.irsigs1a)) +
                ("%s spikes, %s spiketrains\n" %
                 (len(self.spikes1a), len(self.trains1a))) +
                ("name: '%s'\ndescription: '%s'\n" %
                 (self.seg1.name, self.seg1.description)
                 ) +

                (ann % "annotations: %s\n") +

                ("# analogsignals (N=%s)\n" % len(self.sigs1a)) +

                ('%s: %s\n' % (0, sig0)) +
                ('%s: %s\n' % (1, sig1)) +
                ('%s: %s\n' % (2, sig2)) +
                ('%s: %s\n' % (3, sig3)) +

                ("# analogsignalarrays (N=%s)\n" % len(self.sigarrs1a)) +

                ('%s: %s\n' % (0, sigarr0)) +
                ('%s: %s' % (1, sigarr1)))

        self.assertEqual(res, targ)
dataset/ETHPy150Open NeuralEnsemble/python-neo/neo/test/coretest/test_segment.py/TestSegment.test__pretty/swapped operands of `%`