def _compute_example_flat_helper(self, label):
assert label in self._raw_examples, label<EOL>example = self._raw_examples[label]<EOL>def deref_example_ref(dt, val):<EOL><INDENT>dt, _ = unwrap_nullable(dt)<EOL>if not dt._has_example(val.label):<EOL><INDENT>raise InvalidSpec(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % (dt.name, val.label),<EOL>val.lineno, val.path)<EOL><DEDENT>return dt._compute_example(val.label).value<EOL><DEDENT>ex_val = OrderedDict()<EOL>def get_json_val(dt, val):<EOL><INDENT>if isinstance(val, AstExampleRef):<EOL><INDENT>return deref_example_ref(dt, val)<EOL><DEDENT>elif isinstance(val, TagRef):<EOL><INDENT>return val.union_data_type._compute_example(val.tag_name).value<EOL><DEDENT>elif isinstance(val, list):<EOL><INDENT>dt, _ = unwrap_nullable(dt)<EOL>return [get_json_val(dt.data_type, v) for v in val]<EOL><DEDENT>elif isinstance(val, dict):<EOL><INDENT>dt, _ = unwrap_nullable(dt)<EOL>if is_alias(dt):<EOL><INDENT>return val<EOL><DEDENT>return {k: get_json_val(dt.value_data_type, v) for (k, v) in val.items()}<EOL><DEDENT>else:<EOL><INDENT>return val<EOL><DEDENT><DEDENT>for field in self.all_fields:<EOL><INDENT>if field.name in example.fields:<EOL><INDENT>example_field = example.fields[field.name]<EOL>if example_field.value is None:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>ex_val[field.name] = get_json_val(<EOL>field.data_type, example_field.value)<EOL><DEDENT><DEDENT>elif field.has_default:<EOL><INDENT>ex_val[field.name] = get_json_val(<EOL>field.data_type, field.default)<EOL><DEDENT><DEDENT>return Example(example.label, example.text, ex_val, ast_node=example)<EOL>
From the "raw example," resolves references to examples of other data
types to compute the final example.

Returns an Example object. The `value` attribute contains a
JSON-serializable representation of the example.