code: def assert_cfg(cfg):
      r"""Checks config values, do necessary post processing to the configs"""
      if cfg.dataset.task not in ["node", "edge", "graph", "link_pred"]:
          raise ValueError(
              "Task {} not supported, must be one of node, "
              "edge, graph, link_pred".format(cfg.dataset.task)
          )
      if (
          "classification" in cfg.dataset.task_type
          and cfg.model.loss_fun == "mse"
      ):
          cfg.model.loss_fun = "cross_entropy"
          logging.warning(
              "model.loss_fun changed to cross_entropy for classification."
          )
      if (
          cfg.dataset.task_type == "regression"
          and cfg.model.loss_fun == "cross_entropy"
      ):
          cfg.model.loss_fun = "mse"
          logging.warning(
              "model.loss_fun changed to mse for regression."
          )
      if cfg.dataset.task == "graph" and cfg.dataset.transductive:
          cfg.dataset.transductive = False
          logging.warning(
              "dataset.transductive changed " "to False for graph task."
          )
      if cfg.gnn.layers_post_mp < 1:
          cfg.gnn.layers_post_mp = 1
          logging.warning("Layers after message passing should be >=1")
      if cfg.gnn.head == "default":
          cfg.gnn.head = cfg.dataset.task
      cfg.run_dir = cfg.out_dir
  
file_path: GraphGym/graphgym/config.py
imports: import functools
  import inspect
  import logging
  import os
  import shutil
  from collections.abc import Iterable
  from dataclasses import asdict
  from typing import Any
  from yacs.config import CfgNode
  import graphgym.register
  import graphgym.contrib.config
label_desc: Use image node_id 2 for calling a global function with example usage: assert_cfg(cfg) without return types