code: def main():
      parser = argparse.ArgumentParser(
          description="Copy items from Sqlite to mongo"
      )
      parser.add_argument(
          "cache_dir", type=str, help="Directory for the .sqlite files"
      )
      parser.add_argument(
          "mongo_host", type=str, help="Mongo host to copy items to"
      )
      parser.add_argument(
          "--organization",
          type=str,
          help="Organization to copy cache for",
      )
      parser.add_argument(
          "--range-start",
          type=int,
          help="The start of the range to copy",
      )
      parser.add_argument(
          "--range-end",
          type=int,
          help="The end of the range to copy (exclusive)",
      )
      parser.add_argument(
          "--all",
          action="store_true",
          default=None,
          help="Copy caches for all organizations",
      )
      parser.add_argument(
          "--bulk-write",
          action="store_true",
          default=None,
          help="Uses bulk writes",
      )
      parser.add_argument(
          "--dry-run",
          action="store_true",
          default=None,
          help="Skips actually writing to mongo",
      )
      args = parser.parse_args()
  
      if (args.range_start or args.range_end) and not args.organization:
          raise ValueError(
              "--range_start and --range_end require --organization to be specified"
          )
  
      if args.all:
          copy_all_caches(
              cache_dir=args.cache_dir,
              mongo_host=args.mongo_host,
              dry_run=bool(args.dry_run),
          )
      elif args.organization:
          copy_cache(
              cache_dir=args.cache_dir,
              mongo_host=args.mongo_host,
              organization=args.organization,
              dry_run=bool(args.dry_run),
              range_start=args.range_start,
              range_end=args.range_end,
          )
      else:
          raise ValueError(
              "Either --all or --organization must be specified"
          )
  
file_path: H2O/h2o_hf/helm/scripts/cache/copy_cache.py
imports: import argparse
  import json
  import os
  from sqlitedict import SqliteDict
  from helm.common.cache import _MongoKeyValueStore
  from helm.common.hierarchical_logger import hlog, htrack
  from typing import Optional
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types