<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_path(path):
 """ Imports any valid python module or attribute path as though it were a module :Example: True :Parameters: path : `str` A valid python path that crosses modules and/or attributes """
  # noqa
    sys.path.insert(0, ".")
    parts = path.split(".")
    module = None

    # Import the module as deeply as possible.  Prioritize an attribute chain
    # over a module chain
    for i in range(1, len(parts)+1):
        if module is not None and hasattr(module, parts[i-1]):
            try:
                return _import_attributes(module, parts[i-1:])
            except AttributeError:
                pass
        module_path = ".".join(parts[0:i])
        module = importlib.import_module(module_path)

    return module