code: def dropout(incoming, keep_prob, noise_shape=None, name="Dropout"):
      """Dropout.
  
      Outputs the input element scaled up by `1 / keep_prob`. The scaling is so
      that the expected sum is unchanged.
  
      By default, each element is kept or dropped independently. If noise_shape
      is specified, it must be broadcastable to the shape of x, and only dimensions
      with noise_shape[i] == shape(x)[i] will make independent decisions. For
      example, if shape(x) = [k, l, m, n] and noise_shape = [k, 1, 1, n], each
      batch and channel component will be kept independently and each row and column
      will be kept or not kept together.
  
      Arguments:
          incoming : A `Tensor`. The incoming tensor.
          keep_prob : A float representing the probability that each element
              is kept.
          noise_shape : A 1-D Tensor of type int32, representing the shape for
              randomly generated keep/drop flags.
          name : A name for this layer (optional).
  
      References:
          Dropout: A Simple Way to Prevent Neural Networks from Overfitting.
          N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever & R. Salakhutdinov,
          (2014), Journal of Machine Learning Research, 5(Jun)(2), 1929-1958.
  
      Links:
        [https://www.cs.toronto.edu/~hinton/absps/JMLRdropout.pdf]
          (https://www.cs.toronto.edu/~hinton/absps/JMLRdropout.pdf)
  
      """
  
      with tf.name_scope(name) as scope:
          inference = incoming
  
          def apply_dropout():
              if type(inference) in [list, np.array]:
                  for x in inference:
                      x = tf.nn.dropout(x, keep_prob, noise_shape)
                  return inference
              else:
                  return tf.nn.dropout(
                      inference, keep_prob, noise_shape
                  )
  
          is_training = tflearn.get_training_mode()
          inference = tf.cond(
              is_training, apply_dropout, lambda: inference
          )
  
      # Track output tensor.
      tf.add_to_collection(
          tf.GraphKeys.LAYER_TENSOR + "/" + name, inference
      )
  
      return inference
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  import tensorflow.compat.v1
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import standard_ops
  import tflearn
  from tflearn import utils
  from tflearn import variables
  from tflearn import activations
  from tflearn import initializations
  from tflearn import regularizers
label_desc: Use image node_id 3 for calling a global function with example usage: dropout(incoming, keep_prob, noise_shape, name) and returns: inference, inference, tf