code: def test_tokensregex(self, corenlp_client):
      pattern = (
          "([ner: PERSON]+) /wrote/ /an?/ []{0,3} /sentence|article/"
      )
      matches = corenlp_client.tokensregex(TEXT, pattern)
      assert len(matches["sentences"]) == 1
      assert matches["sentences"][0]["length"] == 1
      assert matches == {
          "sentences": [
              {
                  "0": {
                      "text": "Chris wrote a simple sentence",
                      "begin": 0,
                      "end": 5,
                      "1": {"text": "Chris", "begin": 0, "end": 1},
                  },
                  "length": 1,
              },
          ]
      }
  
imports: from http.server import BaseHTTPRequestHandler, HTTPServer
  import multiprocessing
  import pytest
  import requests
  import stanza.server
  import stanza.server.client
  import shlex
  import subprocess
  import time
  from stanza.models.constituency import tree_reader
  from stanza.tests import *
label_desc: Use image node_id 7 for calling the TestCoreNLPClient obj's underlying member method code with example usage: obj.test_tokensregex(corenlp_client) without return types