def METHOD_NAME(variant_list):
	buying = frappe.db.get_all(
		"Item Price",
		fields=[
			"avg(price_list_rate) as avg_rate",
			"item_code",
		],
		filters={"item_code": ["in", variant_list], "buying": 1},
		group_by="item_code",
	)
	buying_price_map = {}
	for row in buying:
		buying_price_map[row.get("item_code")] = row.get("avg_rate")
	return buying_price_map