code: def check_dim(var, dim, name):
      if len(var.shape) != dim:
          raise ValueError("{} must be {}D".format(name, dim))
  
imports: import numpy
  import torch
  from torch.autograd import Function, Variable
  from torch.nn import Module
label_desc: Use image node_id 3 for calling a global function with example usage: check_dim(var, dim, name) without return types