def _compute_example_enumerated_subtypes(self, label):
assert label in self._raw_examples, label<EOL>example = self._raw_examples[label]<EOL>example_field = list(example.fields.values())[<NUM_LIT:0>]<EOL>for subtype_field in self.get_enumerated_subtypes():<EOL><INDENT>if subtype_field.name == example_field.name:<EOL><INDENT>data_type = subtype_field.data_type<EOL>break<EOL><DEDENT><DEDENT>ref = example_field.value<EOL>if not data_type._has_example(ref.label):<EOL><INDENT>raise InvalidSpec(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % (data_type.name, ref.label),<EOL>ref.lineno, ref.path)<EOL><DEDENT>ordered_value = OrderedDict([('<STR_LIT>', example_field.name)])<EOL>flat_example = data_type._compute_example_flat_helper(ref.label)<EOL>ordered_value.update(flat_example.value)<EOL>flat_example.value = ordered_value<EOL>return flat_example<EOL>
Analogous to :meth:`_compute_example_flat_helper` but for structs with
enumerated subtypes.