from pathlib import Path
from typing import Optional


def get_class(p: Path) -> Optional[str]:
    """Get the class-name of the given path."""
    cls = p.with_suffix('').name.split('_')[0].strip()
    return None if cls.lower() == 'none' else cls