def parse_label_arg(s):
    """If s is a file load it as JSON, otherwise parse s as JSON."""
    if os.path.exists(s):
        with open(s, "r") as fp:
            return json.load(fp)
    else:
        return json.loads(s)
If s is a file load it as JSON, otherwise parse s as JSON.
cvat-cli/src/cvat_cli/_internal/parsers.py