human
Complete the below
@disabled
@skip('silverlight')
def test_import_hooks_import_precence():

    ''''__import__ takes precedence over import hooks'
    '''
 What is a the Python code you requested?
assistant
#Here is the Python code you requested.
    global myimpCalled
    myimpCalled = None
    class myimp(object, ):
        def find_module(self, fullname, path=None):
            global myimpCalled
            myimpCalled = (fullname, path)
    def myimport(*args):
        return 'myimport'
    import distutils
    import distutils.command
    mi = myimp()
    sys.meta_path.append(mi)
    builtinimp = get_builtins_dict()['__import__']
    try:
        get_builtins_dict()['__import__'] = myimport
        import abc
        AreEqual(abc, 'myimport')
        AreEqual(myimpCalled, None)
        reload(distutils)
        AreEqual(myimpCalled, ('distutils', None))
        reload(distutils.command)
        AreEqual(myimpCalled[0], 'distutils.command')
        AreEqual(myimpCalled[1][0][(-7):], 'distutils')
    finally:
        get_builtins_dict()['__import__'] = builtinimp
        sys.meta_path.remove(mi)