code: def test_multi_type_override(self):
      class AdaptiveTypeCheck(Typing):
          @property
          def input_types(self):
              # __call__ assumed to be for inference only,
              # therefore infer types checked at class scope
              return {"y": NeuralType(("B",), ChannelType())}
  
          @property
          def output_types(self):
              # __call__ assumed to be for inference only,
              # therefore infer types checked at class scope
              return {"v": NeuralType(("B",), ChannelType())}
  
          def __call__(self, **kwargs):
              # Call should call and forward appropriate method in its own mode
              # Let default "forward" call be the infer mode (this is upto developer)
              # Therefore default class level types == infer types
              return self.infer_forward(y=kwargs["y"])
  
          @typecheck(
              input_types={"x": NeuralType(("B",), ElementType())},
              output_types={"u": NeuralType(("B",), ElementType())},
          )
          def train_forward(self, x):
              return x + 10
  
          @typecheck(
              input_types={
                  "x": NeuralType(("B",), ElementType()),
                  "y": NeuralType(("B",), ChannelType()),
              },
              output_types={
                  "u": NeuralType(("B",), ElementType()),
                  "v": NeuralType(("B",), ChannelType()),
              },
          )
          def eval_forward(self, x, y):
              return x - 1, y - 1
  
          @typecheck(
              input_types={"y": NeuralType(("B",), ChannelType())},
              output_types={"v": NeuralType(("B",), ChannelType())},
          )
          def infer_forward(self, y):
              return y - 10
  
      obj = AdaptiveTypeCheck()
  
      x = torch.zeros(10)
      y = torch.full([10], fill_value=5, dtype=torch.int32)
  
      # infer mode
      y = obj(y=y)
  
      assert torch.all(y == -5)
      assert (
          y.neural_type.compare(NeuralType(("B",), ChannelType()))
          == NeuralTypeComparisonResult.SAME
      )
  
      x, y = obj.eval_forward(x=x, y=y)
  
      assert torch.all(x == -1)
      assert torch.all(y == -6)
      assert (
          x.neural_type.compare(NeuralType(("B",), ElementType()))
          == NeuralTypeComparisonResult.SAME
      )
      assert (
          y.neural_type.compare(NeuralType(("B",), ChannelType()))
          == NeuralTypeComparisonResult.SAME
      )
  
      x = obj.train_forward(x=x)
  
      assert torch.all(x == 9)
      assert (
          x.neural_type.compare(NeuralType(("B",), ElementType()))
          == NeuralTypeComparisonResult.SAME
      )
  
      # In train func, call eval signature
      with pytest.raises(TypeError):
          _ = obj.train_forward(x=x, y=y)
  
      with pytest.raises(TypeError):
          # wrong input + wrong mode
          _ = obj.infer_forward(x=x)
  
imports: from typing import List, NamedTuple
  import pytest
  import torch
  from nemo.core import Typing, typecheck
  from nemo.core.neural_types import *
label_desc: Use image node_id 24 for calling the TestNeuralTypeCheckSystem obj's underlying member method code with example usage: obj.test_multi_type_override() and returns: dict, dict, self, unknown, unknown,  unknown, unknown