<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_serialize_func(self, name, spec):
 """ Return the function that is used for serialization. """

        func = getattr(self, 'serialize_' + name, None)
        if func:
            # this factory has a special serializer function for this field
            return func
        func = getattr(spec.fields[name], 'serialize', None)
        if func:
            return func
        return lambda value, entity, request: value