code: def get_num_features(X):
      if isinstance(X, tf.Tensor):
          return X.get_shape().as_list()[-1]
      elif is_array(X):
          return list(np.shape(X))[-1]
      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 27 for calling a global function with example usage: get_num_features(X) and returns: X, list