def _compute_example(self, label):
if label in self._raw_examples:<EOL><INDENT>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>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, list):<EOL><INDENT>return [get_json_val(dt.data_type, v) for v in val]<EOL><DEDENT>else:<EOL><INDENT>return val<EOL><DEDENT><DEDENT>example_field = list(example.fields.values())[<NUM_LIT:0>]<EOL>ex_val = OrderedDict([('<STR_LIT>', example_field.name)])<EOL>for field in self.all_fields:<EOL><INDENT>if field.name == example_field.name:<EOL><INDENT>break<EOL><DEDENT><DEDENT>data_type, _ = unwrap_nullable(field.data_type)<EOL>inner_ex_val = get_json_val(data_type, example_field.value)<EOL>if (isinstance(data_type, Struct) and<EOL>not data_type.has_enumerated_subtypes()):<EOL><INDENT>ex_val.update(inner_ex_val)<EOL><DEDENT>else:<EOL><INDENT>if inner_ex_val is not None:<EOL><INDENT>ex_val[field.name] = inner_ex_val<EOL><DEDENT><DEDENT>return Example(example.label, example.text, ex_val, ast_node=example)<EOL><DEDENT>else:<EOL><INDENT>for field in self.all_fields:<EOL><INDENT>if label == field.name:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise AssertionError('<STR_LIT>' % label)<EOL><DEDENT>assert is_void_type(field.data_type)<EOL>return Example(<EOL>field.name, field.doc, OrderedDict([('<STR_LIT>', field.name)]))<EOL><DEDENT>
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.