code: def process_ptb3_revised(paths, dataset_name, *args):
      input_dir = os.path.join(
          paths["CONSTITUENCY_BASE"],
          "english",
          "LDC2015T13_eng_news_txt_tbnk-ptb_revised",
      )
      if not os.path.exists(input_dir):
          backup_input_dir = os.path.join(
              paths["CONSTITUENCY_BASE"], "english", "LDC2015T13"
          )
          if not os.path.exists(backup_input_dir):
              raise FileNotFoundError(
                  "Could not find ptb3-revised in either %s or %s"
                  % (input_dir, backup_input_dir)
              )
          input_dir = backup_input_dir
  
      bracket_dir = os.path.join(input_dir, "data", "penntree")
      output_dir = paths["CONSTITUENCY_DATA_DIR"]
  
      # compensate for a weird mislabeling in the original dataset
      label_map = {"ADJ-PRD": "ADJP-PRD"}
  
      train_trees = []
      for i in tqdm(range(2, 22)):
          new_trees = tree_reader.read_directory(
              os.path.join(bracket_dir, "%02d" % i)
          )
          new_trees = [
              t.remap_constituent_labels(label_map) for t in new_trees
          ]
          train_trees.extend(new_trees)
  
      move_tregex = "_ROOT_ <1 __=home <2 /^[.]$/=move"
      move_tsurgeon = "move move >-1 home"
  
      print("Moving sentence final punctuation if necessary")
      with tsurgeon.Tsurgeon() as tsurgeon_processor:
          train_trees = [
              tsurgeon_processor.process(
                  tree, move_tregex, move_tsurgeon
              )[0]
              for tree in tqdm(train_trees)
          ]
  
      dev_trees = tree_reader.read_directory(
          os.path.join(bracket_dir, "22")
      )
      dev_trees = [
          t.remap_constituent_labels(label_map) for t in dev_trees
      ]
  
      test_trees = tree_reader.read_directory(
          os.path.join(bracket_dir, "23")
      )
      test_trees = [
          t.remap_constituent_labels(label_map) for t in test_trees
      ]
      print(
          "Read %d train trees, %d dev trees, and %d test trees"
          % (len(train_trees), len(dev_trees), len(test_trees))
      )
      datasets = [train_trees, dev_trees, test_trees]
      write_dataset(datasets, output_dir, dataset_name)
  
imports: import argparse
  import os
  import random
  import sys
  import tempfile
  from tqdm import tqdm
  from stanza.models.constituency import parse_tree
  import stanza.utils.default_paths
  from stanza.models.constituency import tree_reader
  from stanza.models.constituency.parse_tree import Tree
  from stanza.server import tsurgeon
  from stanza.utils.datasets.constituency import utils
  from stanza.utils.datasets.constituency.convert_alt import convert_alt
  from stanza.utils.datasets.constituency.convert_arboretum import convert_tiger_treebank
  from stanza.utils.datasets.constituency.convert_cintil import convert_cintil_treebank
  import stanza.utils.datasets.constituency.convert_ctb
  from stanza.utils.datasets.constituency.convert_it_turin import convert_it_turin
  from stanza.utils.datasets.constituency.convert_it_vit import convert_it_vit
  from stanza.utils.datasets.constituency.convert_starlang import read_starlang
  from stanza.utils.datasets.constituency.utils import SHARDS, write_dataset
  import stanza.utils.datasets.constituency.vtb_convert
  import stanza.utils.datasets.constituency.vtb_split
label_desc: Use image node_id 13 for calling a global function with example usage: process_ptb3_revised(paths, dataset_name) without return types