Let $x_1$ be the amount invested in the money market fund and $x_2$ be the amount invested in foreign bonds. The objective is to maximize the total return, which is $0.02x_1 + 0.102x_2$.

The total investment is $150,000, so $x_1 + x_2 = 150000$.

The minimum investment in the money market fund is 40% of the total investment, so $x_1 \ge 0.40 \times 150000 = 60000$.

The maximum investment in foreign bonds is 40% of the total investment, so $x_2 \le 0.40 \times 150000 = 60000$.

The complete linear program is:

Maximize $0.02x_1 + 0.102x_2$
Subject to:
$x_1 + x_2 = 150000$
$x_1 \ge 60000$
$x_2 \le 60000$
$x_1, x_2 \ge 0$


```python
import gurobipy as gp

# Create a new model
m = gp.Model("asset_allocation")

# Create variables
x1 = m.addVar(name="money_market")  # Investment in money market fund
x2 = m.addVar(name="foreign_bonds")  # Investment in foreign bonds

# Set objective function
m.setObjective(0.02 * x1 + 0.102 * x2, gp.GRB.MAXIMIZE)

# Add constraints
m.addConstr(x1 + x2 == 150000, "total_investment")
m.addConstr(x1 >= 60000, "min_money_market")
m.addConstr(x2 <= 60000, "max_foreign_bonds")

# Optimize model
m.optimize()

# Print results
if m.status == gp.GRB.OPTIMAL:
    print(f"Optimal investment in money market: {x1.x}")
    print(f"Optimal investment in foreign bonds: {x2.x}")
    print(f"Optimal total return: {m.objVal}")
else:
    print("The model is infeasible or unbounded.")

```
