<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def decode_data(response_content, data_type, entire_response=None):
 """ Interprets downloaded data and returns it. :type response_content: bytes :param data_type: expected downloaded data type :type data_type: constants.MimeType :param entire_response: A response obtained from execution of download request :type entire_response: requests.Response or dict or None :return: downloaded data :rtype: numpy array in case of image data type, or other possible data type :raises: ValueError """

    LOGGER.debug('data_type=%s', data_type)

    if data_type is MimeType.JSON:
        if isinstance(entire_response, requests.Response):
            return entire_response.json()
        return json.loads(response_content.decode('utf-8'))
    if MimeType.is_image_format(data_type):
        return decode_image(response_content, data_type)
    if data_type is MimeType.XML or data_type is MimeType.GML or data_type is MimeType.SAFE:
        return ElementTree.fromstring(response_content)

    try:
        return {
            MimeType.RAW: response_content,
            MimeType.TXT: response_content,
            MimeType.REQUESTS_RESPONSE: entire_response,
            MimeType.ZIP: BytesIO(response_content)
        }[data_type]
    except KeyError:
        raise ValueError('Unknown response data type {}'.format(data_type))