## Step 1: Define the symbolic representation of the problem

Let's denote:
- $x_1$ as the number of lattes
- $x_2$ as the number of cappuccinos

The objective is to maximize profit, where the profit per latte is $2 and per cappuccino is $1. So, the objective function is $2x_1 + x_2$.

## Step 2: Define the constraints based on the given resources

Each latte needs 4 units of milk and each cappuccino needs 2 units of milk, with a total of 80 units of milk available. This gives us the constraint $4x_1 + 2x_2 \leq 80$.

Each latte needs 1 unit of coffee and each cappuccino needs 2 units of coffee, with a total of 50 units of coffee available. This gives us the constraint $x_1 + 2x_2 \leq 50$.

Additionally, $x_1 \geq 0$ and $x_2 \geq 0$ because the number of lattes and cappuccinos cannot be negative.

## 3: Symbolic representation of the optimization problem

The symbolic representation is:
```json
{
'sym_variables': [('x1', 'lattes'), ('x2', 'cappuccinos')],
'objective_function': '2*x1 + x2',
'constraints': [
    '4*x1 + 2*x2 <= 80',
    'x1 + 2*x2 <= 50',
    'x1 >= 0',
    'x2 >= 0'
]
}
```

## 4: Convert the symbolic representation into Gurobi code

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

```python
import gurobi

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

    # Define the variables
    x1 = model.addVar(name='lattes', lb=0, ub=gurobi.GRB.INFINITY)
    x2 = model.addVar(name='cappuccinos', lb=0, ub=gurobi.GRB.INFINITY)

    # Set the objective function
    model.setObjective(2*x1 + x2, gurobi.GRB.MAXIMIZE)

    # Add constraints
    model.addConstr(4*x1 + 2*x2 <= 80, name='milk_constraint')
    model.addConstr(x1 + 2*x2 <= 50, name='coffee_constraint')

    # Optimize the model
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal number of lattes: {x1.varValue}")
        print(f"Optimal number of cappuccinos: {x2.varValue}")
        print(f"Maximum profit: {model.objVal}")
    else:
        print("The model is infeasible")

solve_cafe_problem()
```