def collect_cases(data_dir):
cases = {}<EOL>for root, dirs, files in os.walk(data_dir):<EOL><INDENT>if not dirs:<EOL><INDENT>split_case = os.path.relpath(root, data_dir).split(os.path.sep)<EOL>if split_case[<NUM_LIT:0>] not in cases:<EOL><INDENT>cases[split_case[<NUM_LIT:0>]] = []<EOL><DEDENT>cases[split_case[<NUM_LIT:0>]].append("<STR_LIT:->".join(split_case[<NUM_LIT:1>:]))<EOL><DEDENT><DEDENT>return cases<EOL>
Find all cases and subcases of a particular run type