from typing import Union
import ast


def is_relative_import(node: Union[ast.Import, ast.ImportFrom]) -> bool:
    """Return `True` if the given import is a relative import."""
    if not isinstance(node, ast.ImportFrom):
        return False

    return node.level != 0