def _is_match(self, response, answer):
def compare_conditions(droppable_id, spatial_units, response_conditions):<EOL><INDENT>"""<STR_LIT>"""<EOL>coordinate_match = True<EOL>for coordinate in response_conditions['<STR_LIT>']['<STR_LIT>'][droppable_id]:<EOL><INDENT>answer_match = False<EOL>for spatial_unit in spatial_units:<EOL><INDENT>if (coordinate['<STR_LIT>'] == spatial_unit['<STR_LIT>'] and<EOL>coordinate['<STR_LIT>'] in spatial_unit['<STR_LIT>']):<EOL><INDENT>answer_match = True<EOL>break<EOL><DEDENT><DEDENT>coordinate_match = coordinate_match and answer_match<EOL><DEDENT>return coordinate_match<EOL><DEDENT>if response.has_zone_conditions():<EOL><INDENT>return bool(response.get_zone_conditions() == answer.get_zone_conditions())<EOL><DEDENT>answer_conditions = self._get_conditions_map(answer)<EOL>response_conditions = self._get_conditions_map(response)<EOL>if set(answer_conditions['<STR_LIT>']['<STR_LIT>']) != set(response_conditions['<STR_LIT>']['<STR_LIT>']):<EOL><INDENT>return False<EOL><DEDENT>for droppable_id, spatial_units in answer_conditions['<STR_LIT>']['<STR_LIT>'].items():<EOL><INDENT>if len(spatial_units) != len(response_conditions['<STR_LIT>']['<STR_LIT>'][droppable_id]):<EOL><INDENT>return False<EOL><DEDENT>if not compare_conditions(droppable_id, spatial_units, response_conditions):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>for droppable_id, spatial_units in answer_conditions['<STR_LIT>']['<STR_LIT>'].items():<EOL><INDENT>if compare_conditions(droppable_id, spatial_units, response_conditions):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL>
Does the response match the answer