code: def convert_bio_to_json(
      base_input_path,
      base_output_path,
      short_name,
      suffix="bio",
      shard_names=SHARDS,
      shards=SHARDS,
  ):
      """
      Convert BIO files to json
  
      It can often be convenient to put the intermediate BIO files in
      the same directory as the output files, in which case you can pass
      in same path for both base_input_path and base_output_path.
      """
      for input_shard, output_shard in zip(shard_names, shards):
          input_filename = os.path.join(
              base_input_path,
              "%s.%s.%s" % (short_name, input_shard, suffix),
          )
          if not os.path.exists(input_filename):
              alt_filename = os.path.join(
                  base_input_path, "%s.%s" % (input_shard, suffix)
              )
              if os.path.exists(alt_filename):
                  input_filename = alt_filename
              else:
                  raise FileNotFoundError(
                      "Cannot find %s component of %s in %s or %s"
                      % (
                          output_shard,
                          short_name,
                          input_filename,
                          alt_filename,
                      )
                  )
          output_filename = os.path.join(
              base_output_path,
              "%s.%s.json" % (short_name, output_shard),
          )
          print(
              "Converting %s to %s" % (input_filename, output_filename)
          )
          prepare_ner_file.process_dataset(
              input_filename, output_filename
          )
  
imports: from collections import defaultdict
  import json
  import os
  import random
  from stanza.models.common.doc import Document
  import stanza.utils.datasets.ner.prepare_ner_file
label_desc: Use image node_id 1 for calling a global function with example usage: convert_bio_to_json(base_input_path, base_output_path, short_name, suffix, shard_names, shards) without return types