<commit_before># -*- coding: utf-8 -*-

import logging
from openerp import api, fields, models, _
from openerp.exceptions import UserError, ValidationError

_logger = logging.getLogger(__name__)


class DeliveryCarrier(models.Model):
    _inherit = 'delivery.carrier'
    
    def _get_shipping_country(self,countries):
        country_ids = set()
        #values['shipping_countries'] = values['countries']

        delivery_carriers = self.search([('shipping_enabled', '=', True)])
        for carrier in delivery_carriers:
            if not carrier.country_ids and not carrier.state_ids:
                return values
            # Authorized shipping countries
            country_ids = country_ids|set(carrier.country_ids.ids)

        shipping_countries = countries.filtered(lambda r: r.id in list(country_ids))
        return shipping_countries
    
    @api.multi
    def get_price_available_invoice(self, invoice):
        self.ensure_one()
        total = weight = volume = quantity = 0
        total_delivery = 0.0
        ProductUom = self.env['product.uom']<commit_msg>[FIX] fix undeclared var<commit_after># -*- coding: utf-8 -*-

import logging
from openerp import api, fields, models, _
from openerp.exceptions import UserError, ValidationError

_logger = logging.getLogger(__name__)


class DeliveryCarrier(models.Model):
    _inherit = 'delivery.carrier'
    
    def _get_shipping_country(self,countries):
        country_ids = set()
        #values['shipping_countries'] = values['countries']

        delivery_carriers = self.search([('shipping_enabled', '=', True)])
        for carrier in delivery_carriers:
            if not carrier.country_ids:
                return False
            # Authorized shipping countries
            country_ids = country_ids|set(carrier.country_ids.ids)

        shipping_countries = countries.filtered(lambda r: r.id in list(country_ids))
        return shipping_countries
    
    @api.multi
    def get_price_available_invoice(self, invoice):
        self.ensure_one()
        total = weight = volume = quantity = 0
        total_delivery = 0.0
        ProductUom = self.env['product.uom']
{'fraction_non_alphanumeric': 0.09534883720930233, 'fraction_numerical': 0.0037209302325581397, 'mean_word_length': 2.954044117647059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7555198', 'n_tokens_mistral': 634, 'n_tokens_neox': 607, 'n_words': 139}