sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
frappe/erpnext:erpnext/patches/v16_0/add_new_stock_entry_types.py
import frappe def execute(): for stock_entry_type in [ "Receive from Customer", "Return Raw Material to Customer", "Subcontracting Delivery", "Subcontracting Return", ]: if not frappe.db.exists("Stock Entry Type", stock_entry_type): frappe.new_doc("Stock Entry Type", purpose=stock_entry_type, is_standa...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v16_0/add_new_stock_entry_types.py", "license": "GNU General Public License v3.0", "lines": 12, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v16_0/rename_subcontracted_quantity.py
import frappe from frappe.model.utils.rename_field import rename_field def execute(): if frappe.db.has_column("Purchase Order Item", "subcontracted_quantity"): rename_field("Purchase Order Item", "subcontracted_quantity", "subcontracted_qty")
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v16_0/rename_subcontracted_quantity.py", "license": "GNU General Public License v3.0", "lines": 5, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/subcontracting/doctype/subcontracting_inward_order/subcontracting_inward_order.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe import _ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc from frappe.utils import comma_and, flt, get_link_to_form from erpnext.buy...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/subcontracting/doctype/subcontracting_inward_order/subcontracting_inward_order.py", "license": "GNU General Public License v3.0", "lines": 471, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition":...
license
frappe/erpnext:erpnext/subcontracting/doctype/subcontracting_inward_order/subcontracting_inward_order_dashboard.py
from frappe import _ def get_data(): return { "fieldname": "subcontracting_inward_order", "transactions": [ { "label": _("Transactions"), "items": ["Stock Entry"], }, { "label": _("Manufacturing"), "items": ["Work Order"], }, ], }
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/subcontracting/doctype/subcontracting_inward_order/subcontracting_inward_order_dashboard.py", "license": "GNU General Public License v3.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "rep...
function_simple
frappe/erpnext:erpnext/subcontracting/doctype/subcontracting_inward_order/test_subcontracting_inward_order.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt import frappe from frappe.tests import IntegrationTestCase # On IntegrationTestCase, the doctype test records and all # link-field test record dependencies are recursively loaded # Use these module variables to add/remove to/from t...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/subcontracting/doctype/subcontracting_inward_order/test_subcontracting_inward_order.py", "license": "GNU General Public License v3.0", "lines": 509, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetit...
test
frappe/erpnext:erpnext/subcontracting/doctype/subcontracting_inward_order_item/subcontracting_inward_order_item.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe.model.document import Document from frappe.query_builder.functions import Sum class SubcontractingInwardOrderItem(Document): # begin: auto-generated types # This code is ...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/subcontracting/doctype/subcontracting_inward_order_item/subcontracting_inward_order_item.py", "license": "GNU General Public License v3.0", "lines": 43, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "rep...
license
frappe/erpnext:erpnext/subcontracting/doctype/subcontracting_inward_order_received_item/subcontracting_inward_order_received_item.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class SubcontractingInwardOrderReceivedItem(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anythin...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/subcontracting/doctype/subcontracting_inward_order_received_item/subcontracting_inward_order_received_item.py", "license": "GNU General Public License v3.0", "lines": 30, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pa...
license
frappe/erpnext:erpnext/subcontracting/doctype/subcontracting_inward_order_scrap_item/subcontracting_inward_order_scrap_item.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class SubcontractingInwardOrderScrapItem(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything i...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/subcontracting/doctype/subcontracting_inward_order_scrap_item/subcontracting_inward_order_scrap_item.py", "license": "GNU General Public License v3.0", "lines": 22, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern"...
license
frappe/erpnext:erpnext/subcontracting/doctype/subcontracting_inward_order_service_item/subcontracting_inward_order_service_item.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class SubcontractingInwardOrderServiceItem(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/subcontracting/doctype/subcontracting_inward_order_service_item/subcontracting_inward_order_service_item.py", "license": "GNU General Public License v3.0", "lines": 24, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_patt...
license
frappe/erpnext:erpnext/accounts/report/consolidated_trial_balance/consolidated_trial_balance.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe import _ from frappe.utils import flt, getdate, now_datetime, nowdate import erpnext from erpnext.accounts.doctype.account.account import get_root_company from erpnext.accou...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/accounts/report/consolidated_trial_balance/consolidated_trial_balance.py", "license": "GNU General Public License v3.0", "lines": 366, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "t...
license
frappe/erpnext:erpnext/accounts/report/consolidated_trial_balance/test_consolidated_trial_balance.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt import frappe from frappe import _ from frappe.tests import IntegrationTestCase from frappe.utils import flt, today from erpnext.accounts.report.consolidated_trial_balance.consolidated_trial_balance import execute from...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/accounts/report/consolidated_trial_balance/test_consolidated_trial_balance.py", "license": "GNU General Public License v3.0", "lines": 93, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, ...
test
frappe/erpnext:erpnext/patches/v16_0/set_posting_datetime_for_sabb_and_drop_indexes.py
import click import frappe def execute(): frappe.db.sql( """ UPDATE `tabSerial and Batch Bundle` JOIN `tabStock Ledger Entry` ON `tabSerial and Batch Bundle`.`name` = `tabStock Ledger Entry`.`serial_and_batch_bundle` SET `tabSerial and Batch Bundle`.`posting_datetime` = `tabStock Ledger Entry`.`posting_dat...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v16_0/set_posting_datetime_for_sabb_and_drop_indexes.py", "license": "GNU General Public License v3.0", "lines": 24, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": ...
function_simple
frappe/erpnext:erpnext/manufacturing/doctype/master_production_schedule/master_production_schedule.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import math import frappe from frappe import _, bold from frappe.model.document import Document from frappe.utils import add_days, getdate, parse_json class MasterProductionSchedule(Document): # b...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/master_production_schedule/master_production_schedule.py", "license": "GNU General Public License v3.0", "lines": 374, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1...
license
frappe/erpnext:erpnext/manufacturing/doctype/master_production_schedule/test_master_production_schedule.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt # import frappe from frappe.tests import IntegrationTestCase # On IntegrationTestCase, the doctype test records and all # link-field test record dependencies are recursively loaded # Use these module variables to add/remove to/from...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/master_production_schedule/test_master_production_schedule.py", "license": "GNU General Public License v3.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition"...
test
frappe/erpnext:erpnext/manufacturing/doctype/master_production_schedule_item/master_production_schedule_item.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class MasterProductionScheduleItem(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything in this...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/master_production_schedule_item/master_production_schedule_item.py", "license": "GNU General Public License v3.0", "lines": 24, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repeti...
license
frappe/erpnext:erpnext/manufacturing/doctype/sales_forecast/sales_forecast.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc from frappe.utils import add_to_date class SalesForecast(Document): # begin: auto-generated t...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/sales_forecast/sales_forecast.py", "license": "GNU General Public License v3.0", "lines": 74, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
frappe/erpnext:erpnext/manufacturing/doctype/sales_forecast/sales_forecast_dashboard.py
from frappe import _ def get_data(): return { "fieldname": "demand_planning", "transactions": [ { "label": _("MPS"), "items": ["Master Production Schedule"], }, ], }
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/sales_forecast/sales_forecast_dashboard.py", "license": "GNU General Public License v3.0", "lines": 11, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template":...
function_simple
frappe/erpnext:erpnext/manufacturing/doctype/sales_forecast/test_sales_forecast.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt # import frappe from frappe.tests import IntegrationTestCase # On IntegrationTestCase, the doctype test records and all # link-field test record dependencies are recursively loaded # Use these module variables to add/remove to/from...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/sales_forecast/test_sales_forecast.py", "license": "GNU General Public License v3.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
frappe/erpnext:erpnext/manufacturing/doctype/sales_forecast_item/sales_forecast_item.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class SalesForecastItem(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything in this block. f...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/sales_forecast_item/sales_forecast_item.py", "license": "GNU General Public License v3.0", "lines": 23, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template":...
license
frappe/erpnext:erpnext/patches/v16_0/set_reporting_currency.py
import frappe from frappe.utils import getdate from frappe.utils.nestedset import get_descendants_of from erpnext.accounts.utils import get_fiscal_year from erpnext.setup.utils import get_exchange_rate def execute(): set_company_reporting_currency() set_amounts_in_reporting_currency_on_gle_and_acb() def set_comp...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v16_0/set_reporting_currency.py", "license": "GNU General Public License v3.0", "lines": 118, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
frappe/erpnext:erpnext/selling/doctype/delivery_schedule_item/delivery_schedule_item.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class DeliveryScheduleItem(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything in this block. ...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/selling/doctype/delivery_schedule_item/delivery_schedule_item.py", "license": "GNU General Public License v3.0", "lines": 22, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template":...
license
frappe/erpnext:erpnext/selling/doctype/delivery_schedule_item/test_delivery_schedule_item.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt # import frappe from frappe.tests import IntegrationTestCase # On IntegrationTestCase, the doctype test records and all # link-field test record dependencies are recursively loaded # Use these module variables to add/remove to/from...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/selling/doctype/delivery_schedule_item/test_delivery_schedule_item.py", "license": "GNU General Public License v3.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "templ...
test
frappe/erpnext:erpnext/stock/doctype/item_lead_time/item_lead_time.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class ItemLeadTime(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything in this block. from t...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/stock/doctype/item_lead_time/item_lead_time.py", "license": "GNU General Public License v3.0", "lines": 25, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
frappe/erpnext:erpnext/stock/doctype/item_lead_time/test_item_lead_time.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt # import frappe from frappe.tests import IntegrationTestCase # On IntegrationTestCase, the doctype test records and all # link-field test record dependencies are recursively loaded # Use these module variables to add/remove to/from...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/stock/doctype/item_lead_time/test_item_lead_time.py", "license": "GNU General Public License v3.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
frappe/erpnext:erpnext/manufacturing/doctype/workstation_cost/test_workstation_cost.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt # import frappe from frappe.tests import IntegrationTestCase # On IntegrationTestCase, the doctype test records and all # link-field test record dependencies are recursively loaded # Use these module variables to add/remove to/from...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/workstation_cost/test_workstation_cost.py", "license": "GNU General Public License v3.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": ...
test
frappe/erpnext:erpnext/manufacturing/doctype/workstation_cost/workstation_cost.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class WorkstationCost(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything in this block. fro...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/workstation_cost/workstation_cost.py", "license": "GNU General Public License v3.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
frappe/erpnext:erpnext/manufacturing/doctype/workstation_operating_component/test_workstation_operating_component.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt # import frappe from frappe.tests import IntegrationTestCase # On IntegrationTestCase, the doctype test records and all # link-field test record dependencies are recursively loaded # Use these module variables to add/remove to/from...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/workstation_operating_component/test_workstation_operating_component.py", "license": "GNU General Public License v3.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "r...
test
frappe/erpnext:erpnext/manufacturing/doctype/workstation_operating_component/workstation_operating_component.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class WorkstationOperatingComponent(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything in thi...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/workstation_operating_component/workstation_operating_component.py", "license": "GNU General Public License v3.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repeti...
license
frappe/erpnext:erpnext/manufacturing/doctype/workstation_operating_component_account/test_workstation_operating_component_account.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt # import frappe from frappe.tests import IntegrationTestCase # On IntegrationTestCase, the doctype test records and all # link-field test record dependencies are recursively loaded # Use these module variables to add/remove to/from...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/workstation_operating_component_account/test_workstation_operating_component_account.py", "license": "GNU General Public License v3.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pa...
test
frappe/erpnext:erpnext/manufacturing/doctype/workstation_operating_component_account/workstation_operating_component_account.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class WorkstationOperatingComponentAccount(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/manufacturing/doctype/workstation_operating_component_account/workstation_operating_component_account.py", "license": "GNU General Public License v3.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern...
license
frappe/erpnext:erpnext/patches/v15_0/update_fieldname_in_accounting_dimension_filter.py
import frappe from frappe.query_builder import DocType def execute(): default_accounting_dimension() ADF = DocType("Accounting Dimension Filter") AD = DocType("Accounting Dimension") accounting_dimension_filter = ( frappe.qb.from_(ADF) .join(AD) .on(AD.document_type == ADF.accounting_dimension) .select(A...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/update_fieldname_in_accounting_dimension_filter.py", "license": "GNU General Public License v3.0", "lines": 30, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template":...
function_simple
frappe/erpnext:erpnext/patches/v16_0/make_workstation_operating_components.py
import frappe from frappe import _ def get_operating_cost_account(company): company_details = frappe.db.get_value( "Company", company, ["default_operating_cost_account", "default_expense_account"], as_dict=True ) return company_details.get("default_operating_cost_account") or company_details.get( "default_exp...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v16_0/make_workstation_operating_components.py", "license": "GNU General Public License v3.0", "lines": 62, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v15_0/update_uae_zero_rated_fetch.py
import frappe from erpnext.regional.united_arab_emirates.setup import make_custom_fields def execute(): if not frappe.db.get_value("Company", {"country": "United Arab Emirates"}): return make_custom_fields()
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/update_uae_zero_rated_fetch.py", "license": "GNU General Public License v3.0", "lines": 6, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v16_0/update_serial_no_reference_name.py
import frappe def execute(): # Update the reference_name, reference_doctype fields for Serial No where it is null if not frappe.db.has_column("Serial and Batch Bundle", "posting_date"): return sabb = frappe.qb.DocType("Serial and Batch Bundle") sabb_entry = frappe.qb.DocType("Serial and Batch Entry") serial_...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v16_0/update_serial_no_reference_name.py", "license": "GNU General Public License v3.0", "lines": 24, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/stock/report/serial_no_and_batch_traceability/serial_no_and_batch_traceability.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe import _ from frappe.query_builder import Case def execute(filters: dict | None = None): report = ReportData(filters) report.validate_filters() data = report.get_data() ...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/stock/report/serial_no_and_batch_traceability/serial_no_and_batch_traceability.py", "license": "GNU General Public License v3.0", "lines": 480, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition":...
license
frappe/erpnext:erpnext/patches/v15_0/add_company_payment_gateway_account.py
import frappe def execute(): for gateway_account in frappe.get_list("Payment Gateway Account", fields=["name", "payment_account"]): company = frappe.db.get_value("Account", gateway_account.payment_account, "company") frappe.db.set_value("Payment Gateway Account", gateway_account.name, "company", company)
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/add_company_payment_gateway_account.py", "license": "GNU General Public License v3.0", "lines": 5, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v15_0/repost_gl_entries_with_no_account_subcontracting.py
import frappe def execute(): def cancel_incorrect_gl_entries(gl_entries): table = frappe.qb.DocType("GL Entry") frappe.qb.update(table).set(table.is_cancelled, 1).where(table.name.isin(gl_entries)).run() def recreate_gl_entries(voucher_nos): for doc in voucher_nos: doc = frappe.get_doc("Subcontracting Rec...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/repost_gl_entries_with_no_account_subcontracting.py", "license": "GNU General Public License v3.0", "lines": 25, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template"...
function_simple
frappe/erpnext:erpnext/patches/v15_0/update_payment_ledger_entries_against_advance_doctypes.py
import frappe from erpnext.accounts.utils import get_advance_payment_doctypes DOCTYPE = "Payment Ledger Entry" def execute(): """ Description: Set against_voucher as entry for Payment Ledger Entry against advance vouchers. """ advance_payment_doctypes = get_advance_payment_doctypes() if not advance_payment_d...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/update_payment_ledger_entries_against_advance_doctypes.py", "license": "GNU General Public License v3.0", "lines": 19, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "tem...
function_simple
frappe/erpnext:erpnext/stock/doctype/landed_cost_vendor_invoice/landed_cost_vendor_invoice.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class LandedCostVendorInvoice(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything in this bloc...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/stock/doctype/landed_cost_vendor_invoice/landed_cost_vendor_invoice.py", "license": "GNU General Public License v3.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "temp...
license
frappe/erpnext:erpnext/stock/report/landed_cost_report/landed_cost_report.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe import _ def execute(filters: dict | None = None): columns = get_columns() data = get_data(filters) return columns, data def get_columns() -> list[dict]: return [ ...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/stock/report/landed_cost_report/landed_cost_report.py", "license": "GNU General Public License v3.0", "lines": 123, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
frappe/erpnext:erpnext/patches/v15_0/patch_missing_buying_price_list_in_material_request.py
import frappe import frappe.defaults def execute(): if frappe.db.has_column("Material Request", "buying_price_list") and ( default_buying_price_list := frappe.defaults.get_defaults().buying_price_list ): docs = frappe.get_all( "Material Request", filters={"buying_price_list": ["is", "not set"], "docstatus": ...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/patch_missing_buying_price_list_in_material_request.py", "license": "GNU General Public License v3.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "templa...
function_simple
frappe/erpnext:erpnext/patches/v15_0/remove_sales_partner_from_consolidated_sales_invoice.py
import frappe def execute(): SalesInvoice = frappe.qb.DocType("Sales Invoice") query = ( frappe.qb.update(SalesInvoice) .set(SalesInvoice.sales_partner, "") .set(SalesInvoice.commission_rate, 0) .set(SalesInvoice.total_commission, 0) .where(SalesInvoice.is_consolidated == 1) ) # For develop/version-16...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/remove_sales_partner_from_consolidated_sales_invoice.py", "license": "GNU General Public License v3.0", "lines": 14, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "templ...
function_simple
frappe/erpnext:erpnext/patches/v15_0/rename_price_list_to_buying_price_list.py
import frappe from frappe.model.utils.rename_field import rename_field def execute(): if frappe.db.has_column("Material Request", "price_list"): rename_field( "Material Request", "price_list", "buying_price_list", )
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/rename_price_list_to_buying_price_list.py", "license": "GNU General Public License v3.0", "lines": 9, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v15_0/set_company_on_pos_inv_merge_log.py
import frappe def execute(): pos_invoice_merge_logs = frappe.db.get_all( "POS Invoice Merge Log", {"docstatus": 1}, ["name", "pos_closing_entry"] ) frappe.db.auto_commit_on_many_writes = 1 for log in pos_invoice_merge_logs: if log.pos_closing_entry and frappe.db.exists("POS Closing Entry", log.pos_closing_en...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/set_company_on_pos_inv_merge_log.py", "license": "GNU General Public License v3.0", "lines": 11, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v15_0/set_status_cancelled_on_cancelled_pos_opening_entry_and_pos_closing_entry.py
import frappe from frappe.query_builder import DocType def execute(): POSOpeningEntry = DocType("POS Opening Entry") POSClosingEntry = DocType("POS Closing Entry") frappe.qb.update(POSOpeningEntry).set(POSOpeningEntry.status, "Cancelled").where( POSOpeningEntry.docstatus == 2 ).run() frappe.qb.update(POSClosi...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/set_status_cancelled_on_cancelled_pos_opening_entry_and_pos_closing_entry.py", "license": "GNU General Public License v3.0", "lines": 11, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repe...
function_simple
frappe/erpnext:erpnext/accounts/doctype/pegged_currencies/pegged_currencies.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class PeggedCurrencies(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything in this block. fr...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/accounts/doctype/pegged_currencies/pegged_currencies.py", "license": "GNU General Public License v3.0", "lines": 14, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
frappe/erpnext:erpnext/accounts/doctype/pegged_currencies/test_pegged_currencies.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt # import frappe from frappe.tests import IntegrationTestCase, UnitTestCase # On IntegrationTestCase, the doctype test records and all # link-field test record dependencies are recursively loaded # Use these module variables to add/...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/accounts/doctype/pegged_currencies/test_pegged_currencies.py", "license": "GNU General Public License v3.0", "lines": 21, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" ...
test
frappe/erpnext:erpnext/accounts/doctype/pegged_currency_details/pegged_currency_details.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class PeggedCurrencyDetails(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything in this block....
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/accounts/doctype/pegged_currency_details/pegged_currency_details.py", "license": "GNU General Public License v3.0", "lines": 18, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "templat...
license
frappe/erpnext:erpnext/patches/v15_0/update_pick_list_fields.py
import frappe from frappe.query_builder.functions import IfNull def execute(): update_delivery_note() update_pick_list_items() def update_delivery_note(): DN = frappe.qb.DocType("Delivery Note") DNI = frappe.qb.DocType("Delivery Note Item") frappe.qb.update(DNI).join(DN).on(DN.name == DNI.parent).set(DNI.agai...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/update_pick_list_fields.py", "license": "GNU General Public License v3.0", "lines": 18, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v15_0/rename_pos_closing_entry_fields.py
import frappe from frappe.model.utils.rename_field import rename_field def execute(): rename_field("POS Closing Entry", "pos_transactions", "pos_invoices", validate=False) if frappe.db.exists("DocType", "Sales Invoice Reference"): rename_field("POS Closing Entry", "sales_invoice_transactions", "sales_invoices", v...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/rename_pos_closing_entry_fields.py", "license": "GNU General Public License v3.0", "lines": 6, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/accounts/report/calculated_discount_mismatch/calculated_discount_mismatch.py
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import json import frappe from frappe import _ from frappe.query_builder import Order, Tuple from frappe.utils.formatters import format_value AFFECTED_DOCTYPES = frozenset( ( "POS Invoice", "Pu...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/accounts/report/calculated_discount_mismatch/calculated_discount_mismatch.py", "license": "GNU General Public License v3.0", "lines": 145, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, ...
license
frappe/erpnext:erpnext/patches/v15_0/unset_incorrect_additional_discount_percentage.py
import frappe from frappe import scrub from frappe.model.meta import get_field_precision from frappe.utils import flt from semantic_version import Version from erpnext.accounts.report.calculated_discount_mismatch.calculated_discount_mismatch import ( AFFECTED_DOCTYPES, LAST_MODIFIED_DATE_THRESHOLD, ) def execute()...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/unset_incorrect_additional_discount_percentage.py", "license": "GNU General Public License v3.0", "lines": 81, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": ...
function_complex
frappe/erpnext:erpnext/patches/v15_0/drop_sle_indexes.py
import click import frappe def execute(): table = "tabStock Ledger Entry" index_list = ["posting_datetime_creation_index", "item_warehouse", "batch_no_item_code_warehouse_index"] for index in index_list: if not frappe.db.has_index(table, index): continue try: frappe.db.sql_ddl(f"ALTER TABLE `{table}` D...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/drop_sle_indexes.py", "license": "GNU General Public License v3.0", "lines": 13, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v15_0/set_cancelled_status_to_cancelled_pos_invoice.py
import frappe from frappe.query_builder import DocType def execute(): POSInvoice = DocType("POS Invoice") frappe.qb.update(POSInvoice).set(POSInvoice.status, "Cancelled").where(POSInvoice.docstatus == 2).run()
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/set_cancelled_status_to_cancelled_pos_invoice.py", "license": "GNU General Public License v3.0", "lines": 5, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": ""...
function_simple
frappe/erpnext:erpnext/patches/v14_0/update_full_name_in_contract.py
import frappe from frappe import qb def execute(): con = qb.DocType("Contract") for c in ( qb.from_(con) .select(con.name, con.party_type, con.party_name) .where(con.party_full_name.isnull()) .run(as_dict=True) ): field = c.party_type.lower() + "_name" if res := frappe.db.get_value(c.party_type, c.part...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v14_0/update_full_name_in_contract.py", "license": "GNU General Public License v3.0", "lines": 13, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v15_0/remove_agriculture_roles.py
import frappe def execute(): if "agriculture" in frappe.get_installed_apps(): return for role in ["Agriculture User", "Agriculture Manager"]: assignments = frappe.get_all("Has Role", {"role": role}, pluck="name") for assignment in assignments: frappe.delete_doc("Has Role", assignment, ignore_missing=True,...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/remove_agriculture_roles.py", "license": "GNU General Public License v3.0", "lines": 9, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v15_0/rename_group_by_to_categorize_by_in_custom_reports.py
import json import frappe def execute(): custom_reports = frappe.get_all( "Report", filters={ "report_type": "Custom Report", "reference_report": ["in", ["General Ledger", "Supplier Quotation Comparison"]], }, fields=["name", "json"], ) for report in custom_reports: report_json = json.loads(repor...
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/rename_group_by_to_categorize_by_in_custom_reports.py", "license": "GNU General Public License v3.0", "lines": 18, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "templat...
function_simple
frappe/erpnext:erpnext/patches/v15_0/set_grand_total_to_default_mop.py
import frappe def execute(): if frappe.db.has_column("POS Profile", "disable_grand_total_to_default_mop"): POSProfile = frappe.qb.DocType("POS Profile") frappe.qb.update(POSProfile).set(POSProfile.set_grand_total_to_default_mop, 1).where( POSProfile.disable_grand_total_to_default_mop == 0 ).run()
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v15_0/set_grand_total_to_default_mop.py", "license": "GNU General Public License v3.0", "lines": 7, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
frappe/erpnext:erpnext/patches/v14_0/set_update_price_list_based_on.py
import frappe from frappe.utils import cint def execute(): frappe.db.set_single_value( "Stock Settings", "update_price_list_based_on", ( "Price List Rate" if cint(frappe.db.get_single_value("Selling Settings", "editable_price_list_rate")) else "Rate" ), )
{ "repo_id": "frappe/erpnext", "file_path": "erpnext/patches/v14_0/set_update_price_list_based_on.py", "license": "GNU General Public License v3.0", "lines": 12, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
freqtrade/freqtrade:freqtrade/rpc/api_server/api_trading.py
import logging from fastapi import APIRouter, Depends, Query from fastapi.exceptions import HTTPException from freqtrade.enums import TradingMode from freqtrade.rpc import RPC from freqtrade.rpc.api_server.api_schemas import ( Balances, BlacklistPayload, BlacklistResponse, Count, DailyWeeklyMonthl...
{ "repo_id": "freqtrade/freqtrade", "file_path": "freqtrade/rpc/api_server/api_trading.py", "license": "GNU General Public License v3.0", "lines": 256, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
freqtrade/freqtrade:freqtrade/rpc/api_server/api_webserver.py
import logging from fastapi import APIRouter, Depends from freqtrade.data.history.datahandlers import get_datahandler from freqtrade.enums import CandleType, TradingMode from freqtrade.rpc.api_server.api_schemas import ( AvailablePairs, ExchangeListResponse, FreqAIModelListResponse, HyperoptLossListRe...
{ "repo_id": "freqtrade/freqtrade", "file_path": "freqtrade/rpc/api_server/api_webserver.py", "license": "GNU General Public License v3.0", "lines": 83, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
freqtrade/freqtrade:freqtrade/system/set_mp_start_method.py
from multiprocessing import get_all_start_methods, get_start_method, set_start_method def set_mp_start_method(): """ Set multiprocessing start method to not be fork. forkserver will become the default in 3.14 - and is deprecated in 3.13 """ try: sms = get_all_start_methods() if "fo...
{ "repo_id": "freqtrade/freqtrade", "file_path": "freqtrade/system/set_mp_start_method.py", "license": "GNU General Public License v3.0", "lines": 12, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
freqtrade/freqtrade:freqtrade/util/ft_ttlcache.py
import time from cachetools import TTLCache class FtTTLCache(TTLCache): """ A TTLCache with a different default timer to allow for easier mocking in tests. """ def __init__(self, maxsize, ttl, timer=time.time, getsizeof=None): super().__init__(maxsize=maxsize, ttl=ttl, timer=timer, getsizeof...
{ "repo_id": "freqtrade/freqtrade", "file_path": "freqtrade/util/ft_ttlcache.py", "license": "GNU General Public License v3.0", "lines": 8, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
freqtrade/freqtrade:freqtrade/util/singleton.py
from typing import Any class SingletonMeta(type): """ A thread-safe implementation of Singleton. Use as metaclass to create singleton classes. """ _instances: dict = {} def __call__(cls, *args: Any, **kwargs: Any) -> Any: if cls not in cls._instances: instance = super()._...
{ "repo_id": "freqtrade/freqtrade", "file_path": "freqtrade/util/singleton.py", "license": "GNU General Public License v3.0", "lines": 12, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
freqtrade/freqtrade:tests/test_pip_audit.py
""" Run pip audit to check for known security vulnerabilities in installed packages. Original Idea and base for this implementation by Michael Kennedy's blog: https://mkennedy.codes/posts/python-supply-chain-security-made-easy/ """ import os import subprocess import sys from pathlib import Path import pytest IN_GIT...
{ "repo_id": "freqtrade/freqtrade", "file_path": "tests/test_pip_audit.py", "license": "GNU General Public License v3.0", "lines": 84, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
freqtrade/freqtrade:freqtrade/exchange/coinex.py
import logging from freqtrade.exchange import Exchange from freqtrade.exchange.exchange_types import FtHas logger = logging.getLogger(__name__) class Coinex(Exchange): """ CoinEx exchange class. Contains adjustments needed for Freqtrade to work with this exchange. Please note that this exchange is...
{ "repo_id": "freqtrade/freqtrade", "file_path": "freqtrade/exchange/coinex.py", "license": "GNU General Public License v3.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
freqtrade/freqtrade:freqtrade/plugins/pairlist/DelistFilter.py
""" Delist pair list filter """ import logging from datetime import UTC, datetime, timedelta from freqtrade.exceptions import ConfigurationError from freqtrade.exchange.exchange_types import Ticker from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting from freqtrade.util i...
{ "repo_id": "freqtrade/freqtrade", "file_path": "freqtrade/plugins/pairlist/DelistFilter.py", "license": "GNU General Public License v3.0", "lines": 79, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
freqtrade/freqtrade:freqtrade/exchange/bitget.py
import logging from datetime import datetime, timedelta import ccxt from freqtrade.constants import BuySell from freqtrade.enums import OPTIMIZE_MODES, CandleType, MarginMode, TradingMode from freqtrade.exceptions import ( DDosProtection, OperationalException, RetryableOrderError, TemporaryError, ) fr...
{ "repo_id": "freqtrade/freqtrade", "file_path": "freqtrade/exchange/bitget.py", "license": "GNU General Public License v3.0", "lines": 231, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
freqtrade/freqtrade:tests/exchange/test_bitget.py
from copy import deepcopy from datetime import timedelta from unittest.mock import MagicMock, PropertyMock import pytest from freqtrade.enums import CandleType, MarginMode, RunMode, TradingMode from freqtrade.exceptions import OperationalException, RetryableOrderError from freqtrade.exchange.common import API_RETRY_C...
{ "repo_id": "freqtrade/freqtrade", "file_path": "tests/exchange/test_bitget.py", "license": "GNU General Public License v3.0", "lines": 187, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
freqtrade/freqtrade:tests/strategy/test_strategy_parameters.py
# pragma pylint: disable=missing-docstring, C0103 import pytest from freqtrade.enums import HyperoptState from freqtrade.exceptions import OperationalException from freqtrade.optimize.hyperopt_tools import HyperoptStateContainer from freqtrade.strategy.parameters import ( BaseParameter, BooleanParameter, ...
{ "repo_id": "freqtrade/freqtrade", "file_path": "tests/strategy/test_strategy_parameters.py", "license": "GNU General Public License v3.0", "lines": 107, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
freqtrade/freqtrade:freqtrade/exchange/luno.py
import logging from freqtrade.exchange import Exchange from freqtrade.exchange.exchange_types import FtHas logger = logging.getLogger(__name__) class Luno(Exchange): """ Luno exchange class. Contains adjustments needed for Freqtrade to work with this exchange. Please note that this exchange is not...
{ "repo_id": "freqtrade/freqtrade", "file_path": "freqtrade/exchange/luno.py", "license": "GNU General Public License v3.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
freqtrade/freqtrade:freqtrade/exchange/modetrade.py
import logging # from freqtrade.enums import MarginMode, TradingMode from freqtrade.exchange import Exchange from freqtrade.exchange.exchange_types import FtHas logger = logging.getLogger(__name__) class Modetrade(Exchange): """ MOdetrade exchange class. Contains adjustments needed for Freqtrade to work ...
{ "repo_id": "freqtrade/freqtrade", "file_path": "freqtrade/exchange/modetrade.py", "license": "GNU General Public License v3.0", "lines": 19, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
freqtrade/freqtrade:tests/data/test_historic_precision.py
# pragma pylint: disable=missing-docstring, C0103 from datetime import UTC import pandas as pd from numpy import nan from pandas import DataFrame, Timestamp from freqtrade.data.btanalysis.historic_precision import get_tick_size_over_time def test_get_tick_size_over_time(): """ Test the get_tick_size_over_t...
{ "repo_id": "freqtrade/freqtrade", "file_path": "tests/data/test_historic_precision.py", "license": "GNU General Public License v3.0", "lines": 233, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
freqtrade/freqtrade:tests/util/test_wallet_util.py
import pytest from freqtrade.util import get_dry_run_wallet @pytest.mark.parametrize( "wallet,stake_currency,expected", [ (1000, "USDT", 1000), ({"USDT": 1000, "USDC": 500}, "USDT", 1000), ({"USDT": 1000, "USDC": 500}, "USDC", 500), ({"USDT": 1000, "USDC": 500}, "NOCURR", 0.0)...
{ "repo_id": "freqtrade/freqtrade", "file_path": "tests/util/test_wallet_util.py", "license": "GNU General Public License v3.0", "lines": 16, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
geekcomputers/Python:Collatz Sequence/Collaze-Visualize.py
import time import matplotlib.pyplot as plt def collatz_sequence(n): """Generate the Collatz sequence for n.""" steps = [n] while n != 1: n = n // 2 if n % 2 == 0 else 3 * n + 1 steps.append(n) return steps def visualize(sequence, title="Collatz Sequence"): plt.clf() plt.plot(...
{ "repo_id": "geekcomputers/Python", "file_path": "Collatz Sequence/Collaze-Visualize.py", "license": "MIT License", "lines": 57, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
geekcomputers/Python:password_checker_code.py
import string def check_password_strength(password): strength = 0 # Criteria 1: Length (Must be at least 8 characters) if len(password) >= 8: strength += 1 # Criteria 2: Must contain Digits (0-9) has_digit = False for char in password: if char.isdigit(): ha...
{ "repo_id": "geekcomputers/Python", "file_path": "password_checker_code.py", "license": "MIT License", "lines": 28, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:image_compressor.py
import os import sys from PIL import Image def compress_image(image_path, quality=60): """ Compresses an image by reducing its quality. Args: image_path (str): Path to the image file. quality (int): Quality of the output image (1-100). Default is 60. """ try: # Open the...
{ "repo_id": "geekcomputers/Python", "file_path": "image_compressor.py", "license": "MIT License", "lines": 43, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:photo_timestamp_renamer.py
#!/usr/bin/env python3 """ Author: Ivan Costa Neto Date: 13-01-26 Auto-rename photos by timestamp, so you can organize those vacation trip photos!! Name format: YYYY-MM-DD_HH-MM-SS[_NN].ext Uses EXIF DateTimeOriginal when available (best for JPEG), otherwise falls back to file modified time, i.e. python rename_ph...
{ "repo_id": "geekcomputers/Python", "file_path": "photo_timestamp_renamer.py", "license": "MIT License", "lines": 155, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
geekcomputers/Python:ML/examples/neural_architecture_search.py
import sys sys.path.insert(0, '.') import torch from src.python.neuralforge.nas.search_space import SearchSpace from src.python.neuralforge.nas.evolution import EvolutionarySearch from src.python.neuralforge.nas.evaluator import ProxyEvaluator from src.python.neuralforge.data.dataset import SyntheticDataset, DataLoade...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/examples/neural_architecture_search.py", "license": "MIT License", "lines": 47, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/examples/train_cifar10.py
import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import torch import torch.nn as nn from src.python.neuralforge import Trainer, Config from src.python.neuralforge.data.datasets import get_dataset from src.python.neuralforge.data.dataset import DataLoaderBuilder from src.python.ne...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/examples/train_cifar10.py", "license": "MIT License", "lines": 52, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/examples/train_custom.py
import sys sys.path.insert(0, '.') import torch import torch.nn as nn from src.python.neuralforge import Trainer, Config from src.python.neuralforge.data.dataset import SyntheticDataset, DataLoaderBuilder from src.python.neuralforge.models.resnet import ResNet18 from src.python.neuralforge.optim.optimizers import Adam...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/examples/train_custom.py", "license": "MIT License", "lines": 38, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/cli/gui.py
import sys import os def main(): try: from PyQt6.QtWidgets import QApplication except ImportError: print("Error: PyQt6 not installed") print("Install with: pip install neuralforge[gui]") print("Or: pip install PyQt6") sys.exit(1) current_dir = os.path.dirname(os...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/cli/gui.py", "license": "MIT License", "lines": 383, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
geekcomputers/Python:ML/src/python/neuralforge/cli/nas.py
import argparse import torch from neuralforge.nas.search_space import SearchSpace from neuralforge.nas.evolution import EvolutionarySearch from neuralforge.nas.evaluator import ProxyEvaluator from neuralforge.data.datasets import get_dataset from neuralforge.data.dataset import SyntheticDataset, DataLoaderBuilder from ...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/cli/nas.py", "license": "MIT License", "lines": 57, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/cli/test.py
import argparse import sys import os sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) import torch import torch.nn.functional as F from torchvision import transforms from PIL import Image import numpy as np from neuralforge.data.datasets import get_dataset, get_num_classes from neuralf...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/cli/test.py", "license": "MIT License", "lines": 108, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
geekcomputers/Python:ML/src/python/neuralforge/cli/train.py
import argparse import sys import torch import torch.nn as nn import random import numpy as np from neuralforge.trainer import Trainer from neuralforge.config import Config from neuralforge.data.datasets import get_dataset, get_num_classes from neuralforge.data.dataset import SyntheticDataset, DataLoaderBuilder from n...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/cli/train.py", "license": "MIT License", "lines": 178, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
geekcomputers/Python:ML/src/python/neuralforge/config.py
import json import os from typing import Any, Dict, Optional from dataclasses import dataclass, asdict @dataclass class Config: model_name: str = "neuralforge_model" batch_size: int = 32 epochs: int = 100 learning_rate: float = 0.001 weight_decay: float = 0.0001 optimizer: str = "adamw" sch...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/config.py", "license": "MIT License", "lines": 45, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/data/augmentation.py
import torch import random import numpy as np from PIL import Image, ImageEnhance, ImageOps from typing import List, Tuple class RandAugment: def __init__(self, n: int = 2, m: int = 9): self.n = n self.m = m self.augment_list = [ (self.auto_contrast, 0, 1), (self.equ...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/data/augmentation.py", "license": "MIT License", "lines": 161, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/data/dataset.py
import torch from torch.utils.data import Dataset, DataLoader from torchvision import datasets, transforms from PIL import Image import os from typing import Optional, Callable, Tuple, List import numpy as np class ImageDataset(Dataset): def __init__( self, root: str, transform: Optional[Ca...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/data/dataset.py", "license": "MIT License", "lines": 147, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
geekcomputers/Python:ML/src/python/neuralforge/data/datasets.py
import torch from torch.utils.data import Dataset from torchvision import datasets, transforms import os from typing import Optional, Callable class CIFAR10Dataset: def __init__(self, root='./data', train=True, transform=None, download=True): if transform is None: if train: tran...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/data/datasets.py", "license": "MIT License", "lines": 288, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
geekcomputers/Python:ML/src/python/neuralforge/data/transforms.py
from torchvision import transforms import torch from typing import List, Tuple def get_transforms(image_size: int = 224, is_training: bool = True, mean=None, std=None): if mean is None: mean = [0.485, 0.456, 0.406] if std is None: std = [0.229, 0.224, 0.225] if is_training: ret...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/data/transforms.py", "license": "MIT License", "lines": 87, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/models/efficientnet.py
import torch.nn as nn from ..nn.convolution import EfficientNetBlock class EfficientNetB0(nn.Module): def __init__(self, num_classes=1000): super().__init__() self.stem = nn.Sequential( nn.Conv2d(3, 32, 3, stride=2, padding=1, bias=False), nn.BatchNorm2d(32), ...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/models/efficientnet.py", "license": "MIT License", "lines": 38, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/models/resnet.py
import torch.nn as nn from ..nn.convolution import ResNetBlock def ResNet18(num_classes=1000, in_channels=3): from ..nn.convolution import ResNet return ResNet(ResNetBlock, [2, 2, 2, 2], num_classes, in_channels) def ResNet34(num_classes=1000, in_channels=3): from ..nn.convolution import ResNet return...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/models/resnet.py", "license": "MIT License", "lines": 12, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/models/vit.py
import torch.nn as nn from ..nn.attention import VisionTransformerBlock def VisionTransformer( img_size=224, patch_size=16, in_channels=3, num_classes=1000, embed_dim=768, depth=12, num_heads=12, mlp_ratio=4.0, dropout=0.1 ): return VisionTransformerBlock( img_size=img_s...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/models/vit.py", "license": "MIT License", "lines": 23, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/nas/evaluator.py
import torch import torch.nn as nn from torch.utils.data import DataLoader, Subset import time from typing import Tuple from .search_space import SearchSpace, Architecture class ModelEvaluator: def __init__( self, train_loader: DataLoader, val_loader: DataLoader, device: str = 'cuda...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/nas/evaluator.py", "license": "MIT License", "lines": 108, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
geekcomputers/Python:ML/src/python/neuralforge/nas/evolution.py
import torch import random import numpy as np from typing import List, Dict, Any from tqdm import tqdm from .search_space import SearchSpace, Architecture from .evaluator import ModelEvaluator class EvolutionarySearch: def __init__( self, search_space: SearchSpace, evaluator: ModelEvaluator...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/nas/evolution.py", "license": "MIT License", "lines": 101, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/nas/search_space.py
import torch import torch.nn as nn from typing import List, Dict, Any, Optional import random import numpy as np class Architecture: def __init__(self, genome: List[int]): self.genome = genome self.fitness = 0.0 self.accuracy = 0.0 self.params = 0 self.flops = 0 def...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/nas/search_space.py", "license": "MIT License", "lines": 149, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
geekcomputers/Python:ML/src/python/neuralforge/nn/activations.py
import torch import torch.nn as nn import torch.nn.functional as F class GELU(nn.Module): def __init__(self): super().__init__() def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(0.7978845608 * (x + 0.044715 * torch.pow(x, 3)))) class Swish(nn.Module): def __init__(self): ...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/nn/activations.py", "license": "MIT License", "lines": 92, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/nn/attention.py
import torch import torch.nn as nn import torch.nn.functional as F import math from typing import Optional class MultiHeadAttention(nn.Module): def __init__(self, embed_dim, num_heads, dropout=0.1, bias=True): super().__init__() assert embed_dim % num_heads == 0 self.embed_dim = em...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/nn/attention.py", "license": "MIT License", "lines": 161, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
geekcomputers/Python:ML/src/python/neuralforge/nn/convolution.py
import torch import torch.nn as nn import torch.nn.functional as F from typing import List, Optional class ResNetBlock(nn.Module): def __init__(self, in_channels, out_channels, stride=1, downsample=None): super().__init__() self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=str...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/nn/convolution.py", "license": "MIT License", "lines": 197, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
geekcomputers/Python:ML/src/python/neuralforge/nn/layers.py
import torch import torch.nn as nn import torch.nn.functional as F from typing import Optional class ConvBlock(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1, use_bn=True, activation='relu', drop_rate=0.0): super().__init__() self.conv...
{ "repo_id": "geekcomputers/Python", "file_path": "ML/src/python/neuralforge/nn/layers.py", "license": "MIT License", "lines": 146, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple