How can I use itertools to simplify this nested for loop?
def get_test_cases():
with open("file_path", "r", encoding="utf-8") as index_file:
data = yaml.safe_load(index_file)
for a_dict in data:
for a_name, b_list in a_dict.items():
for b_dict in b_list:
for b_name, c_list in b_dict.items():
for c_dict in c_list:
for c_name, d_list in c_dict.items():
for d_case in d_list:
yield a_name, b_name, c_name, d_case