def getHandleErrorCodeMatcher(self):
        """
        Return a L{hamcrest.core.matcher.Matcher} for the argument
        L{OpenSSL.SSL.Error} will be constructed with for this case.
        This is basically just a random OpenSSL implementation detail.
        It would be better if this test worked in a way which did not
        require this.
        """
        # We expect an error about how we tried to write to a shutdown
        # connection.  This is terribly implementation-specific.
        return hamcrest.contains(
            hamcrest.contains(
                hamcrest.equal_to('SSL routines'),
                hamcrest.any_of(
                    hamcrest.equal_to('SSL_write'),
                    hamcrest.equal_to('ssl_write_internal'),
                ),
                hamcrest.equal_to('protocol is shutdown'),
            ),
        )

        Return a L{hamcrest.core.matcher.Matcher} for the argument
        L{OpenSSL.SSL.Error} will be constructed with for this case.
        This is basically just a random OpenSSL implementation detail.
        It would be better if this test worked in a way which did not
        require this.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ssl.py