@classmethod
def from_any(cls, stylespec: str):
    """Returns a configured StyleBook. First it attempts to load
        a StyleBook from stylespec interpreted as a filesystem path.
        If no file is found, the method next tries to load a StyleBook
        using stylespec is a style name (see `available_styles`).

        If both of those fail, ValueError is raised.

        :param str stylespec: path or style name
        """
    try:
        return cls.from_filename(stylespec)
    except FileNotFoundError:
        pass
    try:
        return cls.by_name(stylespec)
    except FileNotFoundError:
        pass
    raise ValueError(f"unable to find a style matching '{stylespec}'")
