import ntpath


def path_leaf(path: str):
    """
    Returns the name of a file given its path
    https://stackoverflow.com/a/8384788/11814682
    """
    head, tail = ntpath.split(path)
    return tail or ntpath.basename(head)