## Problem Description and Formulation

The problem is a classic example of a linear programming problem. The toy shop wants to maximize its profit by producing the optimal number of dolls and soldiers given the constraints on crafting and sanding time.

Let's define the variables:
- \(D\) as the number of dolls produced
- \(S\) as the number of soldiers produced

The objective function to maximize profit (\(P\)) is:
\[ P = 8D + 10S \]

The constraints based on the available time for crafting (\(C\)) and sanding (\(S\)) are:
- Crafting time: \(10D + 15S \leq 1000\)
- Sanding time: \(5D + 8S \leq 800\)
- Non-negativity: \(D \geq 0, S \geq 0\)

## Gurobi Code

To solve this problem using Gurobi in Python, we will use the Gurobi Python API. First, ensure you have Gurobi installed in your Python environment. You can install it via pip if you have the Gurobi license and the appropriate installation files, but typically it's installed through a package manager or directly from the Gurobi website.

```python
import gurobi

def solve_toy_shop_problem():
    # Create a new model
    model = gurobi.Model()

    # Define variables
    D = model.addVar(lb=0, name="Dolls")
    S = model.addVar(lb=0, name="Soldiers")

    # Objective function: Maximize profit
    model.setObjective(8 * D + 10 * S, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(10 * D + 15 * S <= 1000, name="Crafting_Time")
    model.addConstr(5 * D + 8 * S <= 800, name="Sanding_Time")

    # Optimize
    model.optimize()

    # Print solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution found. Profit: ${model.objVal}")
        print(f"Dolls: {D.varValue}, Soldiers: {S.varValue}")
    else:
        print("No optimal solution found.")

# Run the function
solve_toy_shop_problem()
```

This code defines the problem in Gurobi, solves it, and prints out the optimal number of dolls and soldiers to produce in order to maximize profit, given the constraints. If no optimal solution is found, it indicates that the problem is infeasible or unbounded.