<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def value(self, name, value):
 """Defines a default `value` for a template field identified by `name`. Default values for header fields can be set with header:field syntax. Examples: | Value | foo | 42 | | Value | struct.sub_field | 0xcafe | | Value | header:version | 0x02 | """

        if isinstance(value, _StructuredElement):
            self._struct_fields_as_values(name, value)
        elif name.startswith('header:'):
            self._header_values[name.partition(':')[-1]] = value
        else:
            self._field_values[name] = value