code: def test_re2_extract():
      """test_text_input"""
      filename = os.path.join(
          os.path.dirname(os.path.abspath(__file__)),
          "test_text",
          "lorem.txt",
      )
      with open(filename, "rb") as f:
          lines = [line.strip() for line in f]
      filename = "file://" + filename
  
      dataset = tf.data.TextLineDataset(filename).map(
          lambda x: tfio.experimental.text.re2_full_match(
              x, ".+(ipsum).+(dolor).+"
          )
      )
      i = 0
      for v in dataset:
          r, g = v
          if re.match(b".+(ipsum).+(dolor).+", lines[i]):
              assert r.numpy()
              assert g[0].numpy().decode() == "ipsum"
              assert g[1].numpy().decode() == "dolor"
          else:
              assert not r.numpy()
              assert g[0].numpy().decode() == ""
              assert g[1].numpy().decode() == ""
          i += 1
      assert i == len(lines)
  
file_path: io/tests/test_text.py
imports: import os
  import re
  import tempfile
  import pytest
  import numpy
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 3 for calling a global function with example usage: test_re2_extract() without return types