<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_nearest_point(bus1, network):
 """ Function that finds the geographical nearest point in a network from a given bus. Parameters ----- bus1: float id of bus network: Pypsa network container network including the comparable buses Returns ------ bus0 : float bus_id of nearest point """


    bus1_index = network.buses.index[network.buses.index == bus1]

    forbidden_buses = np.append(
        bus1_index.values, network.lines.bus1[
                network.lines.bus0 == bus1].values)

    forbidden_buses = np.append(
        forbidden_buses, network.lines.bus0[network.lines.bus1 == bus1].values)

    forbidden_buses = np.append(
        forbidden_buses, network.links.bus0[network.links.bus1 == bus1].values)

    forbidden_buses = np.append(
        forbidden_buses, network.links.bus1[network.links.bus0 == bus1].values)

    x0 = network.buses.x[network.buses.index.isin(bus1_index)]

    y0 = network.buses.y[network.buses.index.isin(bus1_index)]

    comparable_buses = network.buses[~network.buses.index.isin(
            forbidden_buses)]

    x1 = comparable_buses.x

    y1 = comparable_buses.y

    distance = (x1.values - x0.values)*(x1.values - x0.values) + \
        (y1.values - y0.values)*(y1.values - y0.values)

    min_distance = distance.min()

    bus0 = comparable_buses[(((x1.values - x0.values)*(x1.values - x0.values
        ) + (y1.values - y0.values)*(y1.values - y0.values)) == min_distance)]
    bus0 = bus0.index[bus0.index == bus0.index.max()]
    bus0 = ''.join(bus0.values)

    return bus0