<commit_before># Copyright (C) 2022 NextERP Romania
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import sys


def install(package):
    try:
        __import__(package)
    except Exception:
        import subprocess

        subprocess.call([sys.executable, "-m", "pip", "install", package])


install("openupgradelib")

try:
    from openupgradelib import openupgrade
except ImportError:
    openupgrade = None


@openupgrade.migrate(use_env=True)
def migrate(env, version):
    openupgrade.rename_fields(
        env,
        [
            (
                "stock.landed.cost",
                "stock_landed_cost",
                "tax_value",
                "l10n_ro_tax_value",
            ),
            (
                "stock.landed.cost",
                "stock_landed_cost",
                "tax_id",
                "l10n_ro_tax_id",
            ),
        ],
    )
    invoices_with_dvi = env["account.move"].search([("dvi_id", "!=", False)])
    for invoice in invoices_with_dvi:
        invoice.dvi_id.l10n_ro_cost_type = "dvi"
<commit_msg>update pre-migration<commit_after># Copyright (C) 2022 NextERP Romania
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import sys


def install(package):
    try:
        __import__(package)
    except Exception:
        import subprocess

        subprocess.call([sys.executable, "-m", "pip", "install", package])


install("openupgradelib")

try:
    from openupgradelib import openupgrade
except ImportError:
    openupgrade = None


@openupgrade.migrate(use_env=True)
def migrate(env, version):
    openupgrade.rename_fields(
        env,
        [
            (
                "stock.landed.cost",
                "stock_landed_cost",
                "tax_value",
                "l10n_ro_tax_value",
            ),
            (
                "stock.landed.cost",
                "stock_landed_cost",
                "tax_id",
                "l10n_ro_tax_id",
            ),
        ],
    )

{'fraction_non_alphanumeric': 0.11477045908183632, 'fraction_numerical': 0.010978043912175649, 'mean_word_length': 1.8520625889046942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6031565', 'n_tokens_mistral': 672, 'n_tokens_neox': 625, 'n_words': 110}