class_docstr: Metadata class for input/output neural types.
  
  # Primary attributes
  original_types: Preserve the dictionary of type information provided.
  
  ignore_collections: For backward compatibility, container support can be disabled explicitly
      using this flag. When set to True, all nesting is ignored and nest-depth checks are skipped.
  
  # Derived attributed
  mandatory_types: Sub-dictionary of `original_types` which contains only those types which
      are mandatory to include when calling the function.
  
  base_types: Dictionary of flattened `str: NeuralType` definitions, disregarding the nest level
      details into appropriate arguments.
  
  container_depth: Dictionary mapping `str: int` - such that the valid depth of the nest of this
      neural type is recorded.
  
  has_container_types: Bool flag declaring if any of the neural types declares a container nest
      in its signature.
  
  is_singular_container_type: Bool flag declaring if this is a single Neural Type with a container
      nest in its signature. Required for supporting python list expansion in return statement.
class_docstr_tok: ["Metadata","class","for","input\/output","neural","types",".","#","Primary","attributes","original_types",":","Preserve","the","dictionary","of","type","information","provided",".","ignore_collections",":","For","backward","compatibility",",","container","support","can","be","disabled","explicitly","using","this","flag",".","When","set","to","True",",","all","nesting","is","ignored","and","nest-depth","checks","are","skipped",".","#","Derived","attributed","mandatory_types",":","Sub-dictionary","of","`","original_types","`","which","contains","only","those","types","which","are","mandatory","to","include","when","calling","the","function",".","base_types",":","Dictionary","of","flattened","`","str",":","NeuralType","`","definitions",",","disregarding","the","nest","level","details","into","appropriate","arguments",".","container_depth",":","Dictionary","mapping","`","str",":","int","`","-","such","that","the","valid","depth","of","the","nest","of","this","neural","type","is","recorded",".","has_container_types",":","Bool","flag","declaring","if","any","of","the","neural","types","declares","a","container","nest","in","its","signature",".","is_singular_container_type",":","Bool","flag","declaring","if","this","is","a","single","Neural","Type","with","a","container","nest","in","its","signature",".","Required","for","supporting","python","list","expansion","in","return","statement","."]
code: def __post_init__(self):
      # If even one NeuralType declares a container nest, set to True
      has_container_types = False
      for type_val in self.original_types.values():
          if isinstance(type_val, (list, tuple)):
              has_container_types = True
              break
      self.has_container_types = has_container_types
  
      # If only one NeuralType is declared, and it declares a container nest, set to True
      if self.has_container_types and len(self.original_types) == 1:
          self.is_singular_container_type = True
      else:
          self.is_singular_container_type = False
  
      # If container nests are declared, flatten the nest into `base_types`
      # Also compute the nest depth for each of the NeuralTypes
      if self.has_container_types:
          self.base_types = {}
          self.container_depth = {}
  
          for type_key, type_val in self.original_types.items():
              depth = 0
              while isinstance(type_val, (list, tuple)):
                  if len(type_val) > 1:
                      raise TypeError(
                          f"Neural Type `{type_key}`: {type_val} definition contains more than one element when"
                          "declaring the nested container structure.\n"
                          "Please ensure that you have only 1 NeuralType inside of the entire nested structure "
                          "definition."
                      )
  
                  type_val = type_val[0]
                  depth += 1
  
              self.base_types[type_key] = type_val
              self.container_depth[type_key] = depth
      else:
          # Otherwise, simply preserve the original_types and set depth of nest to 0.
          self.base_types = self.original_types
          self.container_depth = {
              type_key: 0 for type_key in self.base_types.keys()
          }
  
      # Compute subset of original_types which are mandatory in the call argspec
      self.mandatory_types = {
          type_key: type_val
          for type_key, type_val in self.base_types.items()
          if not type_val.optional
      }
  
imports: import hashlib
  import inspect
  import traceback
  from abc import ABC, abstractmethod
  from contextlib import contextmanager
  from dataclasses import dataclass, field
  from enum import Enum
  from functools import total_ordering
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Tuple, Union
  import hydra
  import torch
  import wrapt
  from huggingface_hub import HfApi, HfFolder, ModelFilter, hf_hub_download
  from huggingface_hub.hf_api import ModelInfo
  from omegaconf import DictConfig, OmegaConf
  import nemo
  from nemo.core.connectors.save_restore_connector import SaveRestoreConnector
  from nemo.core.neural_types import NeuralType, NeuralTypeComparisonResult
  from nemo.utils import logging
  from nemo.utils.cloud import maybe_download_from_cloud
  from nemo.utils.data_utils import resolve_cache_dir
  from nemo.utils.model_utils import import_class_by_path, maybe_update_config_version
label_desc: Use image node_id 1 for calling the TypecheckMetadata obj's underlying member method code with example usage: obj.__post_init__() without return types