<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_name(name, default_ns=None):
 """Import an object based on the dotted string. If `ns` is provided, use it as the namespace if `name` does not have a dot. True True """

    if '.' not in name:
        if default_ns is None:
            return importlib.import_module(name)
        else:
            name = default_ns + '.' + name
    module_name, object_name = name.rsplit('.', 1)
    module = importlib.import_module(module_name)
    return getattr(module, object_name)