<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_metadata(cls, request, response, head=None):
 """Parses out the head and link properties based on the HTTP Request from the client, and the Protobuf response from the validator. """

        head = response.get('head_id', head)
        metadata = {'link': cls._build_url(request, head=head)}

        if head is not None:
            metadata['head'] = head
        return metadata