

def resolve_import(import_path, from_module):
    'Resolves relative imports from a module.\n    '
    if ((not import_path) or (not import_path.startswith('.'))):
        return import_path
    from_module = from_module.split('.')
    dots = 0
    for c in import_path:
        if (c == '.'):
            dots += 1
        else:
            break
    if dots:
        from_module = from_module[:(- dots)]
        import_path = import_path[dots:]
    if import_path:
        dots.append(import_path)
    return '.'.join(from_module)

dataset/ETHPy150Open tweekmonster/moult/moult/utils.py resolve_import/VarMisuse@110/165 `from_module`->`dots`