def createServer(self, r):
        """
        Create a L{server.Site} bound to a L{DummyChannel} and the
        given resource as its root.

        @param r: The root resource.
        @type r: L{resource.Resource}

        @return: The channel to which the site is bound.
        @rtype: L{DummyChannel}
        """
        chan = DummyChannel()
        chan.site = server.Site(r)
        return chan

        Create a L{server.Site} bound to a L{DummyChannel} and the
        given resource as its root.

        @param r: The root resource.
        @type r: L{resource.Resource}

        @return: The channel to which the site is bound.
        @rtype: L{DummyChannel}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_web.py