from typing import Optional
from typing import Tuple
import inspect
from pathlib import Path


def get_call_site(frames_back: int) -> Optional[Tuple[str, int]]:
    """
    Returns path of the call site file, and line number

    :param frames_back: number of frames to look back in the call stack for the
                        call site of interest. For example 1 is the call site of
                        the get_relative_call_site itself, 2 is the call site of
                        the function that called get_relative_call_site and so on.
    """
    caller_frame = inspect.stack()[frames_back]
    caller_fname_path = Path(caller_frame.filename)
    caller_lineno = caller_frame.lineno
    return caller_fname_path.as_posix(), caller_lineno