docs: def foreign_links(network):
      """Change transmission technology of foreign lines from AC to DC (links).
      
      Parameters
      ----------
      network : :class:`pypsa.Network
          Overall container of PyPSA
  
      Returns
      -------
      network : :class:`pypsa.Network
          Overall container of PyPSA
  
      """
      foreign_buses = network.buses[network.buses.country_code != 'DE']
  
      foreign_lines = network.lines[network.lines.bus0.astype(str).isin(
              foreign_buses.index) | network.lines.bus1.astype(str).isin(
              foreign_buses.index)]
          
      foreign_links = network.links[network.links.bus0.astype(str).isin(
              foreign_buses.index) | network.links.bus1.astype(str).isin(
              foreign_buses.index)]
      
      network.links = network.links.drop(
              network.links.index[network.links.index.isin(foreign_links.index) 
              & network.links.bus0.isin(network.links.bus1) & 
              (network.links.bus0 > network.links.bus1)])
          
      foreign_links = network.links[network.links.bus0.astype(str).isin(
              foreign_buses.index) | network.links.bus1.astype(str).isin(
              foreign_buses.index)]
      
      network.links.loc[foreign_links.index, 'p_min_pu'] = -1
  
      network.links.loc[foreign_links.index, 'efficiency'] = 1
          
      network.import_components_from_dataframe(
          foreign_lines.loc[:, ['bus0', 'bus1', 'capital_cost', 'length']]
          .assign(p_nom=foreign_lines.s_nom).assign(p_min_pu=-1)
          .set_index('N' + foreign_lines.index),
          'Link')
  
      network.lines = network.lines.drop(foreign_lines.index)
  
      return network