File size: 552 Bytes
03a907a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import sys
import importlib
from pathlib import Path

_REPO_ROOT = str(Path(__file__).parent)
if _REPO_ROOT not in sys.path:
    sys.path.insert(0, _REPO_ROOT)

import dataset as _real_dataset

sys.modules.setdefault("src.dataset", _real_dataset)

import pkgutil
for _pkg in pkgutil.iter_modules(_real_dataset.__path__):
    _full = f"dataset.{_pkg.name}"
    _alias = f"src.dataset.{_pkg.name}"
    try:
        _mod = importlib.import_module(_full)
        sys.modules.setdefault(_alias, _mod)
    except Exception:
        pass