human
I wrote the below code

    metapath = list(sys.meta_path)
    finder = None
    loader = None
    class K(object, ):
        def __init__(self):
            self.calls = []
        def __getattribute__(self, name):
            if (name != 'calls'):
                self.calls.append(name)
            if (name == 'find_module'):
                return finder
            if (name == 'load_module'):
                return loader
            return object.__getattribute__(self, name)
    loaderInst = K()
    sys.meta_path.append(loaderInst)
    def ok_finder(name, path):
        loaderInst.calls.append((name, path))
        return loaderInst
    def ok_loader(name):
        loaderInst.calls.append(name)
        return 'abc'
    try:
        try:
            import xyz
        except TypeError:
            AreEqual(loaderInst.calls[0], 'find_module')
            loaderInst.calls = []
        finder = ok_finder
        try:
            import xyz
        except TypeError:
            AreEqual(loaderInst.calls[0], 'find_module')
            AreEqual(loaderInst.calls[1], ('xyz', None))
            loaderInst.calls = []
        loader = ok_loader
        import xyz
        AreEqual(xyz, 'abc')
        AreEqual(loaderInst.calls[0], 'find_module')
        AreEqual(loaderInst.calls[1], ('xyz', None))
        AreEqual(loaderInst.calls[2], 'load_module')
        AreEqual(loaderInst.calls[3], 'xyz')
    finally:
        sys.meta_path = metapath

What's a good function header?
assistant
#Here's a good function header.

def test_custom_meta_path():