def basename(path: Optional[str]) -> Optional[str]:
    """ Returns the final component of a pathname and None if the argument is None """
    if path is not None:
        return os.path.basename(path)