code: def get_batchsize(input):
      if isinstance(input, (list, tuple)):
          return get_batchsize(input[0])
      elif isinstance(input, dict):
          return get_batchsize(list(input.values())[0])
      else:
          return input.shape[0]
  
imports: import time
  import numbers
  import socket
  import collections
  import numpy
  from contextlib import closing, contextmanager
  import torch
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 6 for calling a global function with example usage: get_batchsize(input) and returns: get_batchsize, get_batchsize, input