def get_dependencies(primary_type, types):
deps = set()<EOL>struct_names_yet_to_be_expanded = [primary_type]<EOL>while len(struct_names_yet_to_be_expanded) > <NUM_LIT:0>:<EOL><INDENT>struct_name = struct_names_yet_to_be_expanded.pop()<EOL>deps.add(struct_name)<EOL>fields = types[struct_name]<EOL>for field in fields:<EOL><INDENT>if field["<STR_LIT:type>"] not in types:<EOL><INDENT>continue<EOL><DEDENT>elif field["<STR_LIT:type>"] in deps:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>struct_names_yet_to_be_expanded.append(field["<STR_LIT:type>"])<EOL><DEDENT><DEDENT><DEDENT>deps.remove(primary_type)<EOL>return tuple(deps)<EOL>
Perform DFS to get all the dependencies of the primary_type