'Check that all required fields are set, and update global state.
The imports specified in the preamble are imported at this time.'

def CheckInitialized(self):

    python_import = getattr(self, 'import')
    topname = python_import.split('.')[0]
    module_name = getattr(self, 'as')
    if (not module_name):
        module_name = python_import.split('.')[(-1)]
    __import__(python_import, _global_temp_globals)
    _global_temp_globals[topname] = sys.modules[topname]
    _global_temp_globals[module_name] = sys.modules[python_import]
