code: def test_skip_gram_sample_with_text_vocab_filter_vocab():
      """Tests skip-gram sampling with text vocab and freq threshold
      filtering."""
      input_tensor = tf.constant(
          [
              b"the",
              b"answer",  # Will be filtered before candidate generation.
              b"to",
              b"life",
              b"and",
              b"universe",  # Will be filtered before candidate generation.
          ]
      )
  
      # b"answer" is not in vocab file, and b"universe"'s frequency is below
      # threshold of 3.
      with tempfile.TemporaryDirectory() as tmp_dir:
          vocab_freq_file = _make_text_vocab_freq_file(tmp_dir)
  
          tokens, labels = text.skip_gram_sample_with_text_vocab(
              input_tensor=input_tensor,
              vocab_freq_file=vocab_freq_file,
              vocab_token_index=0,
              vocab_freq_index=1,
              vocab_min_count=3,
              min_skips=1,
              max_skips=1,
          )
  
      expected_tokens, expected_labels = _split_tokens_labels(
          [
              (b"the", b"to"),
              (b"to", b"the"),
              (b"to", b"life"),
              (b"life", b"to"),
              (b"life", b"and"),
              (b"and", b"life"),
          ]
      )
      np.testing.assert_equal(
          np.asanyarray(expected_tokens), tokens.numpy()
      )
      np.testing.assert_equal(
          np.asanyarray(expected_labels), labels.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 15 for calling a global function with example usage: test_skip_gram_sample_with_text_vocab_filter_vocab() without return types