class_docstr: A client to the Stanford CoreNLP server. 
code: def __init__(
      self,
      start_server=StartServer.FORCE_START,
      endpoint=DEFAULT_ENDPOINT,
      timeout=DEFAULT_TIMEOUT,
      threads=DEFAULT_THREADS,
      annotators=None,
      pretokenized=False,
      output_format=None,
      properties=None,
      stdout=None,
      stderr=None,
      memory=DEFAULT_MEMORY,
      be_quiet=False,
      max_char_length=DEFAULT_MAX_CHAR_LENGTH,
      preload=True,
      classpath=None,
      **kwargs,
  ):
      # whether or not server should be started by client
      self.start_server = start_server
      self.server_props_path = None
      self.server_start_time = None
      self.server_host = None
      self.server_port = None
      self.server_classpath = None
      # validate properties
      validate_corenlp_props(
          properties=properties,
          annotators=annotators,
          output_format=output_format,
      )
      # set up client defaults
      self.properties = properties
      self.annotators = annotators
      self.pretokenized = pretokenized
      self.output_format = output_format
      self._setup_client_defaults()
      # start the server
      if isinstance(start_server, bool):
          warning_msg = (
              f"Setting 'start_server' to a boolean value when constructing {self.__class__.__name__} is deprecated and will stop"
              + " to function in a future version of stanza. Please consider switching to using a value from stanza.server.StartServer."
          )
          logger.warning(warning_msg)
          start_server = (
              StartServer.FORCE_START
              if start_server is True
              else StartServer.DONT_START
          )
  
      # start the server
      if (
          start_server is StartServer.FORCE_START
          or start_server is StartServer.TRY_START
      ):
          # record info for server start
          self.server_start_time = datetime.now()
          # set up default properties for server
          self._setup_server_defaults()
          host, port = urlparse(endpoint).netloc.split(":")
          port = int(port)
          assert (
              host == "localhost"
          ), "If starting a server, endpoint must be localhost"
          classpath = resolve_classpath(classpath)
          start_cmd = (
              f"java -Xmx{memory} -cp '{classpath}'  edu.stanford.nlp.pipeline.StanfordCoreNLPServer "
              f"-port {port} -timeout {timeout} -threads {threads} -maxCharLength {max_char_length} "
              f"-quiet {be_quiet} "
          )
  
          self.server_classpath = classpath
          self.server_host = host
          self.server_port = port
  
          # set up server defaults
          if self.server_props_path is not None:
              start_cmd += (
                  f" -serverProperties {self.server_props_path}"
              )
  
          # possibly set pretokenized
          if self.pretokenized:
              start_cmd += f" -preTokenized"
  
          # set annotators for server default
          if self.annotators is not None:
              annotators_str = (
                  self.annotators
                  if type(annotators) == str
                  else ",".join(annotators)
              )
              start_cmd += f" -annotators {annotators_str}"
  
          # specify what to preload, if anything
          if preload:
              if type(preload) == bool:
                  # -preload flag means to preload all default annotators
                  start_cmd += " -preload"
              elif type(preload) == list:
                  # turn list into comma separated list string, only preload these annotators
                  start_cmd += f" -preload {','.join(preload)}"
              elif type(preload) == str:
                  # comma separated list of annotators
                  start_cmd += f" -preload {preload}"
  
          # set outputFormat for server default
          # if no output format requested by user, set to serialized
          start_cmd += f" -outputFormat {self.output_format}"
  
          # additional options for server:
          # - server_id
          # - ssl
          # - status_port
          # - uriContext
          # - strict
          # - key
          # - username
          # - password
          # - blockList
          for kw in ["ssl", "strict"]:
              if kwargs.get(kw) is not None:
                  start_cmd += f" -{kw}"
          for kw in [
              "status_port",
              "uriContext",
              "key",
              "username",
              "password",
              "blockList",
              "server_id",
          ]:
              if kwargs.get(kw) is not None:
                  start_cmd += f" -{kw} {kwargs.get(kw)}"
          stop_cmd = None
      else:
          start_cmd = stop_cmd = None
          host = port = None
  
      super(CoreNLPClient, self).__init__(
          start_cmd,
          stop_cmd,
          endpoint,
          stdout,
          stderr,
          be_quiet,
          host=host,
          port=port,
          ignore_binding_error=(start_server == StartServer.TRY_START),
      )
  
      self.timeout = timeout
  
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 1 to create a new CoreNLPClient object from inherited base classes: RobustService with example: obj = CoreNLPClient(start_server, endpoint, timeout, threads, annotators, pretokenized, output_format, properties, stdout, stderr, memory, be_quiet, max_char_length, preload, classpath)