code: def filter_pretrained_cfg(cfg, remove_source=False, remove_null=True):
      filtered_cfg = {}
      keep_null = {
          "pool_size",
          "first_conv",
          "classifier",
      }  # always keep these keys, even if none
      for k, v in cfg.items():
          if remove_source and k in {
              "url",
              "file",
              "hf_hub_id",
              "hf_hub_id",
              "hf_hub_filename",
              "source",
          }:
              continue
          if remove_null and v is None and k not in keep_null:
              continue
          filtered_cfg[k] = v
      return filtered_cfg
  
file_path: pytorch-image-models/timm/models/_pretrained.py
imports: import copy
  from collections import deque, defaultdict
  from dataclasses import dataclass, field, replace, asdict
  from typing import Any, Deque, Dict, Tuple, Optional, Union
label_desc: Use image node_id 1 for calling a global function with example usage: filter_pretrained_cfg(cfg, remove_source, remove_null) and returns: filtered_cfg