## Problem Description and Formulation

The problem is a classic example of a linear programming problem. The bakery needs to decide how many stuffed donuts and pastries to produce to maximize profit, given the limited availability of the baking and stuffing machines.

Let's define the decision variables:

* $x_d$ = number of stuffed donuts to produce
* $x_p$ = number of stuffed pastries to produce

The objective function is to maximize profit:

* Profit = $2x_d + 4x_p$

The constraints are:

* Baking machine availability: $2x_d + 5x_p \leq 10000$
* Stuffing machine availability: $3x_d + 2x_p \leq 7000$
* Non-negativity constraints: $x_d \geq 0, x_p \geq 0$

## Gurobi Code

```python
import gurobi

# Create a new Gurobi model
model = gurobi.Model()

# Define the decision variables
x_d = model.addVar(lb=0, name="donuts")
x_p = model.addVar(lb=0, name="pastries")

# Define the objective function
model.setObjective(2 * x_d + 4 * x_p, gurobi.GRB.MAXIMIZE)

# Define the constraints
model.addConstr(2 * x_d + 5 * x_p <= 10000, name="baking_machine")
model.addConstr(3 * x_d + 2 * x_p <= 7000, name="stuffing_machine")

# Optimize the model
model.optimize()

# Print the solution
if model.status == gurobi.GRB.OPTIMAL:
    print("Optimal solution found.")
    print(f"Number of donuts: {x_d.varValue}")
    print(f"Number of pastries: {x_p.varValue}")
    print(f"Max profit: {model.objVal}")
else:
    print("No optimal solution found.")
```