def convert_image ( value, level = 3 ):
    global image_resource_cache

    if not isinstance( value, basestring ):
        return value

    key             = value
    is_traits_image = (value[:1] == '@')
    if not is_traits_image:
        search_path = get_resource_path( level )
        key         = '%s[%s]' % ( value, search_path )

    result = image_resource_cache.get( key )
    if result is None:
        if is_traits_image:
            try:
                from .image.image import ImageLibrary

                result = ImageLibrary.image_resource( value )
            except:
                result = None
        else:
            from pyface.image_resource import ImageResource
            result = ImageResource( value, search_path = [ search_path ] )

        image_resource_cache[ key ] = result

    return result
Test that Divmod can be imported.
dataset/ETHPy150Open enthought/traitsui/traitsui/ui_traits.py/convert_image--crossover with--dataset/ETHPy150Open twisted/nevow/nevow/test/test_athena.py/StandardLibraryTestCase.test_divmodImport