To solve this optimization problem, we first need to define the decision variables and the objective function. Let's denote the number of batches of maple pecan ice cream as \(x_1\) and the number of batches of mint chocolate ice cream as \(x_2\).

The objective is to maximize profit. Given that the profit per batch of maple pecan ice cream is $400 and per batch of mint chocolate ice cream is $250, the objective function can be written as:
\[ \text{Maximize:} \quad 400x_1 + 250x_2 \]

Next, we need to consider the constraints based on the availability of the mixing and freezing machines. For the mixing machine, each batch of maple pecan ice cream requires 50 minutes, and each batch of mint chocolate ice cream requires 30 minutes. The total time available on the mixing machine is 8000 minutes per month. This gives us our first constraint:
\[ 50x_1 + 30x_2 \leq 8000 \]

For the freezing machine, each batch of maple pecan ice cream requires 80 minutes, and each batch of mint chocolate ice cream requires 70 minutes. The total time available on the freezing machine is 10000 minutes per month. This gives us our second constraint:
\[ 80x_1 + 70x_2 \leq 10000 \]

Additionally, we have non-negativity constraints because the number of batches cannot be negative:
\[ x_1 \geq 0, \quad x_2 \geq 0 \]

Now, let's translate this problem into Gurobi code in Python:

```python
from gurobipy import *

# Create a model
m = Model("Ice_Cream_Production")

# Define the decision variables
x1 = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="Maple_Pecan_Batches")
x2 = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="Mint_Chocolate_Batches")

# Define the objective function
m.setObjective(400*x1 + 250*x2, GRB.MAXIMIZE)

# Add constraints
m.addConstr(50*x1 + 30*x2 <= 8000, "Mixing_Machine_Time")
m.addConstr(80*x1 + 70*x2 <= 10000, "Freezing_Machine_Time")

# Optimize the model
m.optimize()

# Print the results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Maple Pecan Batches: {x1.x}")
    print(f"Mint Chocolate Batches: {x2.x}")
    print(f"Total Profit: ${400*x1.x + 250*x2.x:.2f}")
else:
    print("No optimal solution found")

```