code: def test_filter_input_subsample_vocab():
      """Tests input filtering based on vocab subsampling."""
      # The outputs are non-deterministic, so set random seed to help ensure
      # that the outputs remain constant for testing.
      tf.random.set_seed(42)
  
      input_tensor = tf.constant(
          [
              # keep_prob = (sqrt(30/(0.05*100)) + 1) * (0.05*100/30) = 0.57.
              b"the",
              b"answer",  # Not in vocab. (Always discarded)
              b"to",  # keep_prob = 0.75.
              b"life",  # keep_prob > 1. (Always kept)
              b"and",  # keep_prob = 0.48.
              b"universe",  # Below vocab threshold of 3. (Always discarded)
          ]
      )
      keys = tf.constant([b"and", b"life", b"the", b"to", b"universe"])
      values = tf.constant([40, 8, 30, 20, 2], tf.dtypes.int64)
      vocab_freq_table = tf.lookup.StaticHashTable(
          tf.lookup.KeyValueTensorInitializer(keys, values), -1
      )
  
      output = skip_gram_ops._filter_input(
          input_tensor=input_tensor,
          vocab_freq_table=vocab_freq_table,
          vocab_min_count=3,
          vocab_subsampling=0.05,
          corpus_size=tf.math.reduce_sum(values),
          seed=9,
      )
      np.testing.assert_equal(
          np.asanyarray([b"the", b"to", b"life", b"and"]),
          output.numpy(),
      )
  
imports: import csv
  import os
  import tempfile
  import numpy
  import pytest
  import tensorflow
  from tensorflow_addons import text
  from tensorflow_addons.text import skip_gram_ops
label_desc: Use image node_id 14 for calling a global function with example usage: test_filter_input_subsample_vocab() without return types