code: def random_sample(data, n_samples):
      with tf.name_scope("random-sample"):
          data_shape = tf.shape(data)
          max_index = data_shape[0]
          sample_indices = tf.random_uniform(
              (n_samples,), minval=0, maxval=max_index, dtype=tf.int32
          )
          return tf.gather(data, sample_indices)
  
imports: import numpy
  import tensorflow
  from neupy.core.config import DumpableObject
  from neupy.core.properties import IntProperty, ParameterProperty
  from neupy.algorithms.base import BaseNetwork
  from neupy.utils import asfloat, format_data, dot, iters, tf_utils
  from neupy import init
label_desc: Use image node_id 2 for calling a global function with example usage: random_sample(data, n_samples) and returns: tf