code: def test_no_deprecated_v1():
      # TODO: remove all elements of the list and remove the allowlist
      # This allowlist should not grow. Do not add elements to this list.
      allowlist = [
          "tensorflow_addons/text/skip_gram_ops.py",
          "tensorflow_addons/seq2seq/decoder.py",
          "tensorflow_addons/seq2seq/tests/attention_wrapper_test.py",
      ]
      for file_path, line_idx, line in get_lines_of_source_code(
          allowlist
      ):
          if "tf.compat.v1" in line:
              raise NameError(
                  "The usage of a tf.compat.v1 API was found in file {} at line {}:\n\n"
                  "   {}\n"
                  "TensorFlow Addons doesn't support running programs with "
                  "`tf.compat.v1.disable_v2_behavior()`.\n"
                  "As such, there should be no need for the compatibility module "
                  "tf.compat. Please find an alternative using only the TF2.x API."
                  "".format(file_path, line_idx, line)
              )
  
file_path: addons/tools/testing/source_code_test.py
imports: import glob
  import os
  from typedapi import ensure_api_is_typed
  import importlib
  import tensorflow_addons
  import tensorflow
label_desc: Use image node_id 9 for calling a global function with example usage: test_no_deprecated_v1() without return types