def replaceHome(self, tempHome):
        oldHome = os.environ.get('HOME')
        def cleanupHome():
            if oldHome is None:
                del os.environ['HOME']
            else:
                os.environ['HOME'] = oldHome
        self.addCleanup(cleanupHome)
        os.environ['HOME'] = tempHome
This method is used in the case of multi-channel images (not 2D images).
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/conch/test/test_knownhosts.py/DefaultAPITests.replaceHome--crossover with--dataset/ETHPy150Open menpo/menpo/menpo/feature/features.py/_np_gradient