code: def test_port_shape_rejection(self):
      class InputPortShapeRejection(Typing):
          @property
          def input_types(self):
              return {
                  "x": NeuralType(("B", "T"), ElementType())
              }  # expect rank 2 matrix
  
          @property
          def output_types(self):
              return {"w": NeuralType(("B",), ElementType())}
  
          @typecheck()
          def __call__(self, x):
              x += 1
              return x
  
      # Test input port mismatch
      obj = InputPortShapeRejection()
  
      with pytest.raises(TypeError):
          _ = obj(x=torch.zeros(10))
  
      class OutputPortShapeRejection(Typing):
          @property
          def input_types(self):
              return {"x": NeuralType(("B",), ElementType())}
  
          @property
          def output_types(self):
              return {
                  "w": NeuralType(
                      ("B", "T", "D"), ElementType()
                  ),  # expect rank 3 matrix
              }
  
          @typecheck()
          def __call__(self, x):
              return x + 1
  
      obj = OutputPortShapeRejection()
  
      with pytest.raises(TypeError):
          _ = obj(x=torch.zeros(10))
  
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 14 for calling the TestNeuralTypeCheckSystem obj's underlying member method code with example usage: obj.test_port_shape_rejection() and returns: dict, dict, x, dict, dict, unknown