code: def expect_tensor(scalar_type, shape=None):
      def verify(actual_type):
          np.testing.assert_equal(actual_type.scalarType(), scalar_type)
          # if shape is not None:
          #     np.testing.assert_equal(actual_type.sizes(), shape)
          if shape is not None:
              np.testing.assert_equal(actual_type.varyingSizes(), shape)
  
      return verify
  
imports: import io
  import numpy
  import onnx
  import pytorch_test_common
  import torch
  from pytorch_test_common import skipIfUnsupportedMinOpsetVersion
  from torch.onnx import _constants, utils
  from torch.onnx._globals import GLOBALS
  from torch.onnx._internal import jit_utils
  from torch.testing._internal import common_utils
label_desc: Use image node_id 1 for calling a global function with example usage: expect_tensor(scalar_type, shape) and returns: verify