docs: def set_q_foreign_loads(network, cos_phi=1):
      """Set reative power timeseries of loads in neighbouring countries
      
      Parameters
      ----------
      network : :class:`pypsa.Network
          Overall container of PyPSA
      cos_phi: float
          Choose ration of active and reactive power of foreign loads
  
      Returns
      -------
      network : :class:`pypsa.Network
          Overall container of PyPSA
  
      """
      foreign_buses = network.buses[network.buses.country_code != 'DE']
  
      network.loads_t['q_set'][network.loads.index[
          network.loads.bus.astype(str).isin(foreign_buses.index)]] = \
          network.loads_t['p_set'][network.loads.index[
              network.loads.bus.astype(str).isin(
                  foreign_buses.index)]] * math.tan(math.acos(cos_phi))
  
      network.generators.control[network.generators.control == 'PQ'] = 'PV'
  
      return network