docstr: JsonValidator(T) is function (s)->x that parses json string s into python value x, where x is of type T.
  
  Example Usage:
  >>> from typing import Union, List
  >>> import argparse
  >>> parser = argparse.ArgumentParser()
  >>> parser.add_argument("--x", type=JsonValidator(Union[int, List[float]]))
  >>> assert parser.parse_args(["--x=123"]).x == 123
  >>> assert parser.parse_args(["--x=[1, 2]"]).x == [1., 2.]
code: def __init__(self, expected_type: type):
      """
      JsonValidator(T) is function (s)->x that parses json string s into python value x, where x is of type T.
  
      Example Usage:
      >>> from typing import Union, List
      >>> import argparse
      >>> parser = argparse.ArgumentParser()
      >>> parser.add_argument("--x", type=JsonValidator(Union[int, List[float]]))
      >>> assert parser.parse_args(["--x=123"]).x == 123
      >>> assert parser.parse_args(["--x=[1, 2]"]).x == [1., 2.]
      """
      self.expected_type = expected_type
  
file_path: ml-cvnets/options/parse_args.py
imports: import json
  import typing
  from typing import Any
label_desc: Use image node_id 1 to create a new JsonValidator object  with example: obj = JsonValidator(expected_type)