def _reprTest(self, serverFactory, factoryName):
        filename = self.mktemp()
        unixPort = reactor.listenUNIX(filename, serverFactory)

        connectedString = "<%s on %r>" % (factoryName, filename)
        self.assertEqual(repr(unixPort), connectedString)
        self.assertEqual(str(unixPort), connectedString)

        d = defer.maybeDeferred(unixPort.stopListening)
        def stoppedListening(ign):
            unconnectedString = "<%s (not listening)>" % (factoryName,)
            self.assertEqual(repr(unixPort), unconnectedString)
            self.assertEqual(str(unixPort), unconnectedString)
        d.addCallback(stoppedListening)
        return d
This function calculate the distances for all the input examples
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_unix.py/UnixSocketTestCase._reprTest--crossover with--dataset/ETHPy150Open bt3gl/Advanced-Machine-Learning/k-NN/kNN.py/calculate_distances