def test_primeDirective(self):
        """
        We do not contaminate normal function pickling with concerns from
        Twisted.
        """
        def expected(n):
            return "\n".join([
                    "c" + __name__,
                    sampleFunction.__name__, "p" + n, "."
                ]).encode("ascii")
        self.assertEqual(pickle.dumps(sampleFunction, protocol=0),
                         expected("0"))
        try:
            import cPickle
        except:
            pass
        else:
            self.assertEqual(
                cPickle.dumps(sampleFunction, protocol=0),
                expected("1")
            )

        We do not contaminate normal function pickling with concerns from
        Twisted.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/persisted/test/test_styles.py