code: def get_num_sample(X):
      if is_array(X):
          return np.shape(X)[0]
      elif isinstance(X, tf.Tensor):
          return X.get_shape()[0]
      else:
          raise ValueError("Unknown data type.")
  
imports: from __future__ import division, print_function, absolute_import
  import os
  import random
  import numpy
  from PIL import Image
  import pickle
  import csv
  import warnings
  import tensorflow.compat.v1
  from io import BytesIO
label_desc: Use image node_id 29 for calling a global function with example usage: get_num_sample(X) and returns: np, X