def _get_imports_m(self, data_types, default_imports):
if not isinstance(data_types, list):<EOL><INDENT>data_types = [data_types]<EOL><DEDENT>import_classes = default_imports<EOL>for data_type in data_types:<EOL><INDENT>import_classes.append(fmt_class_prefix(data_type))<EOL>if data_type.parent_type:<EOL><INDENT>import_classes.append(fmt_class_prefix(data_type.parent_type))<EOL><DEDENT>if is_struct_type(<EOL>data_type) and data_type.has_enumerated_subtypes():<EOL><INDENT>for _, subtype in data_type.get_all_subtypes_with_tags():<EOL><INDENT>import_classes.append(fmt_class_prefix(subtype))<EOL><DEDENT><DEDENT>for field in data_type.all_fields:<EOL><INDENT>data_type, _ = unwrap_nullable(field.data_type)<EOL>while is_list_type(data_type) or is_map_type(data_type):<EOL><INDENT>data_type = (data_type.value_data_type if<EOL>is_map_type(data_type) else data_type.data_type)<EOL><DEDENT>if is_user_defined_type(data_type):<EOL><INDENT>import_classes.append(fmt_class_prefix(data_type))<EOL><DEDENT><DEDENT><DEDENT>if import_classes:<EOL><INDENT>import_classes = list(set(import_classes))<EOL>import_classes.sort()<EOL><DEDENT>return import_classes<EOL>
Emits all necessary implementation file imports for the given Stone data type.