class_docstr: Common base class for ``AlgorithmConfig`` and ``CustomAlgorithmConfig``.
  
  It's a "union set" of 2 derived classes. So users can use it as either one.
code: def _validate_canonical(self):
      super()._validate_canonical()
      if (
          self.class_name is None
      ):  # assume it's built-in algorithm by default
          assert self.name
          assert self.code_directory is None
      else:  # custom algorithm
          assert self.name is None
          assert self.class_name
          assert self.code_directory is not None
          if not Path(self.code_directory).is_dir():
              raise ValueError(
                  f'CustomAlgorithmConfig: code_directory "{self.code_directory}" is not a directory'
              )
  
file_path: nni/nni/experiment/config/algorithm.py
imports: from dataclasses import dataclass
  from pathlib import Path
  from typing import Any, Dict, Optional
  from .base import ConfigBase
  from .utils import PathLike
label_desc: Use image node_id 1 for calling the _AlgorithmConfig obj's underlying member method code with example usage: obj._validate_canonical() without return types