To solve the given optimization problem, we first need to define the decision variables and the objective function. Let's denote the number of package X as \(x\) and the number of package Y as \(y\). The objective is to maximize profit, which can be calculated based on the profits per package.

The profit from selling \(x\) packages of type X is $70\(x\), and the profit from selling \(y\) packages of type Y is $120\(y\). Thus, the total profit \(P\) can be represented as:
\[ P = 70x + 120y \]

We need to maximize \(P\) under the given constraints:

1. **Green Tea Constraint**: Each package X contains 5 bottles of green tea, and each package Y contains 3 bottles of green tea. The shop has 1200 bottles of green tea available.
   - Constraint: \(5x + 3y \leq 1200\)

2. **Black Tea Constraint**: Each package X contains 2 bottles of black tea, and each package Y contains 4 bottles of black tea. The shop has 900 bottles of black tea available.
   - Constraint: \(2x + 4y \leq 900\)

3. **Non-Negativity Constraints**: Since we cannot sell a negative number of packages, both \(x\) and \(y\) must be non-negative.
   - Constraints: \(x \geq 0\) and \(y \geq 0\)

Now, let's translate these constraints and the objective function into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
model = Model("Tea_Shop_Optimization")

# Define variables
x = model.addVar(vtype=GRB.CONTINUOUS, name="package_x")
y = model.addVar(vtype=GRB.CONTINUOUS, name="package_y")

# Objective function: Maximize profit
model.setObjective(70*x + 120*y, GRB.MAXIMIZE)

# Constraints
model.addConstr(5*x + 3*y <= 1200, "green_tea_constraint")
model.addConstr(2*x + 4*y <= 900, "black_tea_constraint")

# Optimize the model
model.optimize()

# Print results
if model.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Package X: {x.x}")
    print(f"Package Y: {y.x}")
    print(f"Total Profit: ${70*x.x + 120*y.x:.2f}")
else:
    print("No optimal solution found")
```

```python
from gurobipy import *

# Create a new model
model = Model("Tea_Shop_Optimization")

# Define variables
x = model.addVar(vtype=GRB.CONTINUOUS, name="package_x")
y = model.addVar(vtype=GRB.CONTINUOUS, name="package_y")

# Objective function: Maximize profit
model.setObjective(70*x + 120*y, GRB.MAXIMIZE)

# Constraints
model.addConstr(5*x + 3*y <= 1200, "green_tea_constraint")
model.addConstr(2*x + 4*y <= 900, "black_tea_constraint")

# Optimize the model
model.optimize()

# Print results
if model.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Package X: {x.x}")
    print(f"Package Y: {y.x}")
    print(f"Total Profit: ${70*x.x + 120*y.x:.2f}")
else:
    print("No optimal solution found")
```