code: def do_annotate(args):
      args.props = dict(args.props) if args.props else {}
      if args.sentence_mode:
          args.props["ssplit.isOneSentence"] = True
  
      with corenlp.CoreNLPClient(
          annotators=args.annotators,
          properties=args.props,
          be_quiet=not args.verbose_server,
      ) as client:
          for line in args.input:
              if line.startswith("#"):
                  continue
  
              ann = client.annotate(
                  line.strip(), output_format=args.format
              )
  
              if args.format == "json":
                  if args.sentence_mode:
                      ann = ann["sentences"][0]
  
                  args.output.write(json.dumps(ann))
                  args.output.write("\n")
  
file_path: stanza/stanza/server/main.py
imports: import corenlp
  import json
  import re
  import csv
  import sys
  from collections import namedtuple, OrderedDict
label_desc: Use image node_id 2 for calling a global function with example usage: do_annotate(args) without return types