class_docstr: A client to the Stanford CoreNLP server. 
code: def tregex(
      self,
      text=None,
      pattern=None,
      filter=False,
      annotators=None,
      properties=None,
      trees=None,
  ):
      # parse is not included by default in some of the pipelines,
      # so we may need to manually override the annotators
      # to include parse in order for tregex to do anything
      if annotators is None and self.annotators is not None:
          assert isinstance(self.annotators, str)
          pieces = self.annotators.split(",")
          if "parse" not in pieces:
              annotators = self.annotators + ",parse"
      else:
          annotators = "tokenize,ssplit,pos,parse"
      if pattern is None:
          raise ValueError("Cannot have None as a pattern for tregex")
  
      # TODO: we could also allow for passing in a complete document,
      # along with the original text, so that the spans returns are more accurate
      if trees is not None:
          if properties is None:
              properties = {}
          properties["inputFormat"] = "serialized"
          if "serializer" not in properties:
              properties[
                  "serializer"
              ] = "edu.stanford.nlp.pipeline.ProtobufAnnotationSerializer"
          doc = Document()
          full_text = []
          for tree_idx, tree in enumerate(trees):
              sentence = doc.sentence.add()
              sentence.sentenceIndex = tree_idx
              sentence.tokenOffsetBegin = len(full_text)
              leaves = tree.leaf_labels()
              full_text.extend(leaves)
              sentence.tokenOffsetEnd = len(full_text)
              self.fill_tree_proto(tree, sentence.parseTree)
              for word in leaves:
                  token = sentence.token.add()
                  # the other side uses both value and word, weirdly enough
                  token.value = word
                  token.word = word
                  # without the actual tokenization, at least we can
                  # stop the words from running together
                  token.after = " "
          doc.text = " ".join(full_text)
          with io.BytesIO() as stream:
              writeToDelimitedString(doc, stream)
              text = stream.getvalue()
  
      return self.__regex(
          "/tregex", text, pattern, filter, annotators, properties
      )
  
imports: import atexit
  import contextlib
  import enum
  import io
  import os
  import re
  import requests
  import logging
  import json
  import shlex
  import socket
  import subprocess
  import time
  import sys
  import uuid
  from datetime import datetime
  from pathlib import Path
  from urllib.parse import urlparse
  from stanza.protobuf import Document, parseFromDelimitedString, writeToDelimitedString, to_text
label_desc: Use image node_id 10 for calling the CoreNLPClient obj's underlying member method code with example usage: obj.tregex(text, pattern, filter, annotators, properties, trees) and returns: self