from typing import Callable


def path_match_any_element(path: str, condition: Callable[[str], bool]) -> bool:
    """
    Return True if any element of the path matches a given condition.

    Parameters
    ----------
    path : str
        The path to check.
    condition : Callable[[str], bool]
        A function that takes a string and returns True if the string matches.

    Returns
    -------
    bool
        True if any element of the path matches the condition.

    >>> path_match_any_element("/foo/bar/baz", lambda x: x.startswith("b"))
    True
    >>> path_match_any_element("/foo/bar/baz", lambda x: x.startswith("a"))
    False
    >>> path_match_any_element("/foo/.git/baz", lambda x: x in [".git", ".hg", ".svn", ".bzr"])
    True
    >>> path_match_any_element("/foo/bar/.git", lambda x: x in [".git", ".hg", ".svn", ".bzr"])
    True
    """
    return any(condition(elem) for elem in path.split("/"))