from typing import Tuple
import re


def parse_func_path(path: str) -> Tuple[str, str]:
    """
    Parses a function path 'file_or_module::func'.

    Parameters
    ----------
    path : str
        path should have the format: 'file_or_module::func', where `file_or_module`
        is a filename or python module and `func` is a function name.

    Returns
    -------
    Tuple[str, str]
        A tuple of file_or_module and function name.
    """
    match = re.match(r"(?P<file>.+)::(?P<func>.+)", path)
    if not match:
        raise ValueError("Invalid function specification: '{}'".format(path))
    return match["file"], match["func"]