def METHOD_NAME(
    transaction,
    accounts,
    company_abbr="_TIRC",
    rate=9,
    charge_type="On Net Total",
    row_id=None,
):
    if isinstance(accounts, str):
        accounts = [accounts]
    if transaction.doctype in SALES_DOCTYPES:
        account_type = "Output Tax"
    else:
        account_type = "Input Tax"
    for account in accounts:
        tax = {
            "charge_type": charge_type,
            "row_id": row_id,
            "account_head": f"{account_type} {account} - {company_abbr}",
            "description": account,
            "rate": rate,
            "cost_center": f"Main - {company_abbr}",
        }
        if account.endswith("RCM"):
            tax["add_deduct_tax"] = "Deduct"
        transaction.append("taxes", tax)