

def get_method_rates(self, obj):
    encounter_rates = LocationAreaEncounterRate.objects.filter(location_area=obj).order_by('encounter_method_id')
    method_ids = encounter_rates.values('encounter_method_id').distinct()
    encounter_rate_list = []
    for id in method_ids:
        encounter_rate_details = OrderedDict()
        encounter_method_object = EncounterMethod.objects.get(pk=id['encounter_method_id'])
        encounter_method_data = EncounterMethodSummarySerializer(encounter_method_object, context=encounter_method_data.context).data
        encounter_rate_details['encounter_method'] = encounter_method_data
        area_encounter_objects = encounter_rates.filter(encounter_method_id=id['encounter_method_id'])
        serializer = LocationAreaEncounterRateSerializer(area_encounter_objects, many=True, context=self.context)
        encounter_rate_details['version_details'] = []
        for area_encounter in serializer.data:
            version_detail = OrderedDict()
            version_detail['rate'] = area_encounter['rate']
            version_detail['version'] = area_encounter['version']
            encounter_rate_details['version_details'].append(version_detail)
        encounter_rate_list.append(encounter_rate_details)
    return encounter_rate_list

dataset/ETHPy150Open phalt/pokeapi/pokemon_v2/serializers.py LocationAreaDetailSerializer.get_method_rates/VarMisuse@85/154 `self`->`encounter_method_data`