code: def argparse_schema(schema):
      """Wrapper that performs validation and converts SchemaErrors into
      ArgumentTypeErrors for better argument error reporting.
  
      """
  
      def check(x):
          try:
              return schema.validate(x)
          except s.SchemaError as e:
              raise argparse.ArgumentTypeError(e.code) from None
  
      return check
  
file_path: caliban/caliban/util/argparse.py
imports: import argparse
  import itertools
  import os
  from typing import Dict, List, Optional, Tuple
  from blessings import Terminal
  import caliban.util
  import caliban.util.fs
  import schema
label_desc: Use image node_id 2 for calling a global function with example usage: argparse_schema(schema) and returns: check, schema