@classmethod
def _leaf_action(cls, path, leaf_action):
    """
        Split a path into head and leaf and apply an action to the leaf.
        The leaf is the `path`s last element (if `path` contains only a
        single element then it's also the leaf).

        Parameters
        ----------
        path : unicode
            The path from which the leaf element is extracted.
        leaf_action : callable
            Function that shall be applied to the leaf element.

        Returns
        -------
        result
            The return value of ``leaf_action(leaf)``.

        See Also
        --------
        :method:`~ConfigurationAdaptor.element_name_from_indexed_path` : For the path syntax
        """
    return leaf_action(cls.split_path(path)[-1])
