def _get_args(self, args: Namespace) -> dict:
        """Get pipeline arguments by parsing the config file.

        Args:
            args (Namespace): Arguments to run the pipeline. These are the args returned by ArgumentParser.

        Returns:
            dict: Pipeline arguments.
        """
        if args is None:
            logger.warning("No arguments provided, parsing arguments from command line.")
            parser = self.get_parser()
            args = parser.parse_args()

        with Path(args.config).open(encoding="utf-8") as file:
            return yaml.safe_load(file)
Get pipeline arguments by parsing the config file.

        Args:
            args (Namespace): Arguments to run the pipeline. These are the args returned by ArgumentParser.

        Returns:
            dict: Pipeline arguments.
        
src/anomalib/pipelines/components/base/pipeline.py