'Imports Python class/module or Java class with given name.
Class can either live in a module/package or be standalone Java class.
In the former case the name is something like \'MyClass\' and in the
latter it could be \'your.package.YourLibrary\'. Python classes always
live in a module, but if the module name is exactly same as the class
name then simple \'MyLibrary\' will import a class.
Python modules can be imported both using format \'MyModule\' and
\'mymodule.submodule\'.
`name` can also be a path to the imported file/directory. In that case
importing is done using `import_class_or_module_by_path` method.
If `instantiate_with_args` is not None, imported classes are
instantiated with the specified arguments automatically.'

def import_class_or_module(self, name, instantiate_with_args=None, return_source=False):

    try:
        (imported, source) = self._import_class_or_module(name)
        self._log_import_succeeded(imported, name, source)
        imported = self._instantiate_if_needed(imported, instantiate_with_args)
    except DataError as err:
        self._raise_import_failed(name, err)
    else:
        return ((imported, source) if return_source else imported)
