def METHOD_NAME(sles):
	item_warehouse_sles = {}
	for sle in sles:
		item_warehouse_sles.setdefault((sle.item_code, sle.warehouse), []).append(sle)
	data = []
	for _item_wh, sles in item_warehouse_sles.items():
		for idx, sle in enumerate(sles):
			queue = json.loads(sle.stock_queue or "[]")
			sle.fifo_queue_qty = 0.0
			sle.fifo_stock_value = 0.0
			for qty, rate in queue:
				sle.fifo_queue_qty += flt(qty)
				sle.fifo_stock_value += flt(qty) * flt(rate)
			sle.fifo_qty_diff = sle.qty_after_transaction - sle.fifo_queue_qty
			sle.fifo_value_diff = sle.stock_value - sle.fifo_stock_value
			if sle.batch_no:
				sle.use_batchwise_valuation = frappe.db.get_value(
					"Batch", sle.batch_no, "use_batchwise_valuation", cache=True
				)
			if abs(sle.fifo_qty_diff) > 0.001 or abs(sle.fifo_value_diff) > 0.1:
				if idx:
					data.append(sles[idx - 1])
				data.append(sle)
				data.append({})
				break
	return data