code: def _parse_json(argname, json_string, expected_type):
      """parses a json string, validating the return type"""
  
      try:
          obj = json.loads(json_string)
          assert isinstance(obj, expected_type)
      except Exception:
          raise argparse.ArgumentTypeError(
              "%s must be a json %s. Got '%s'."
              % (argname, expected_type.__name__, json_string)
          )
  
      return obj
  
file_path: caliban/caliban/resources/caliban_launcher.py
imports: import argparse
  import copy
  import google.auth
  import json
  import logging
  import os
  import subprocess
  import sys
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: _parse_json(argname, json_string, expected_type) and returns: obj