<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def import_submodules(package, name=None, recursive=True):
 """Import all submodules of ``package``. Parameters package : `module` or string Package whose submodules to import. name : string, optional Override the package name with this value in the full submodule names. By default, ``package`` is used. recursive : bool, optional If ``True``, recursively import all submodules of ``package``. Otherwise, import only the modules at the top level. Returns ------- pkg_dict : dict Dictionary where keys are the full submodule names and values are the corresponding module objects. """

    if isinstance(package, str):
        package = importlib.import_module(package)

    if name is None:
        name = package.__name__

    submodules = [m[0] for m in inspect.getmembers(package, inspect.ismodule)
                  if m[1].__name__.startswith('odl')]

    results = {}
    for pkgname in submodules:
        full_name = name + '.' + pkgname
        try:
            results[full_name] = importlib.import_module(full_name)
        except ImportError:
            pass
        else:
            if recursive:
                results.update(import_submodules(full_name, full_name))
    return results