code: def testBasicLSTMCellWithDropout(self):
      def _is_close(x, y, digits=4):
          delta = x - y
          return delta < 10 ** (-digits)
  
      def _is_close_in(x, items, digits=4):
          for i in items:
              if _is_close(x, i, digits):
                  return True
          return False
  
      keep_prob = 0.5
      c_high = 2.9998924946
      c_low = 0.999983298578
      h_low = 0.761552567265
      h_high = 0.995008519604
      num_units = 5
      allowed_low = [1, 2, 3]
  
      with self.cached_session() as sess:
          with tf.variable_scope(
              "other", initializer=tf.constant_initializer(1)
          ):
              x = tf.zeros([1, 5])
              c = tf.zeros([1, 5])
              h = tf.zeros([1, 5])
              state = rnn_cell.LSTMStateTuple(c, h)
              cell = contrib_rnn.LayerNormBasicLSTMCell(
                  num_units,
                  layer_norm=False,
                  dropout_keep_prob=keep_prob,
              )
  
              g, s = cell(x, state)
              sess.run([tf.global_variables_initializer()])
              res = sess.run(
                  [g, s],
                  {
                      x.name: np.ones([1, 5]),
                      c.name: np.ones([1, 5]),
                      h.name: np.ones([1, 5]),
                  },
              )
  
              # Since the returned tensors are of size [1,n]
              # get the first component right now.
              actual_h = res[0][0]
              actual_state_c = res[1].c[0]
              actual_state_h = res[1].h[0]
  
              # For each item in `c` (the cell inner state) check that
              # it is equal to one of the allowed values `c_high` (not
              # dropped out) or `c_low` (dropped out) and verify that the
              # corresponding item in `h` (the cell activation) is coherent.
              # Count the dropped activations and check that their number is
              # coherent with the dropout probability.
              dropped_count = 0
              self.assertTrue((actual_h == actual_state_h).all())
              for citem, hitem in zip(actual_state_c, actual_state_h):
                  self.assertTrue(_is_close_in(citem, [c_low, c_high]))
                  if _is_close(citem, c_low):
                      self.assertTrue(_is_close(hitem, h_low))
                      dropped_count += 1
                  elif _is_close(citem, c_high):
                      self.assertTrue(_is_close(hitem, h_high))
              self.assertIn(dropped_count, allowed_low)
  
imports: import itertools
  from absl.testing import parameterized
  from magenta.contrib import rnn
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling the LayerNormBasicLSTMCellTest obj's underlying member method code with example usage: obj.testBasicLSTMCellWithDropout() and returns: unknown, False, True