code: def _text_vocab_subsample_vocab_helper(
      vocab_freq_file,
      vocab_min_count,
      vocab_freq_dtype,
      corpus_size=None,
  ):
      # 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)
          ]
      )
      # keep_prob calculated from vocab file with relative frequencies of:
      # and: 40
      # life: 8
      # the: 30
      # to: 20
      # universe: 2
  
      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_freq_dtype=tf.dtypes.float64,
          vocab_min_count=vocab_min_count,
          vocab_subsampling=0.05,
          corpus_size=corpus_size,
          min_skips=1,
          max_skips=1,
          seed=123,
      )
  
      expected_tokens, expected_labels = _split_tokens_labels(
          [
              (b"the", b"to"),
              (b"to", b"the"),
              (b"to", b"life"),
              (b"life", b"to"),
          ]
      )
      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 16 for calling a global function with example usage: _text_vocab_subsample_vocab_helper(vocab_freq_file, vocab_min_count, vocab_freq_dtype, corpus_size) without return types