def get_parser(parser: ArgumentParser | None = None) -> ArgumentParser:
        """Create a new parser if none is provided."""
        if parser is None:
            parser = ArgumentParser()
            parser.add_argument("--config", type=str | Path, help="Configuration file path.", required=True)

        return parser
Create a new parser if none is provided.
src/anomalib/pipelines/components/base/pipeline.py