1import json
2 if 'id' not in dest:
3 dest['id'] = -1
4 targetId = dest['id']
1if 'to' not in data:
2 raise ValueError("No target in given data")
3if 'data' not in data['to']:
4 raise ValueError("No data for target")
1json_string = """{"a": 1, "b": 2, "c": 3}"""
2a_dictionary = json.loads(json_string)
3
4b_in_dict = "b" in a_dictionary