code: def import_generators(network, data_source=None, file=None):
      
  
      if data_source == 'oedb':
          logging.warning('Right now only solar and wind generators can be '
                          'imported from the oedb.')
          _import_genos_from_oedb(network=network)
          network.mv_grid._weather_cells = None
          if network.pypsa is not None:
              pypsa_io.update_pypsa_generator_import(network)
      elif data_source == 'pypsa':
          _import_genos_from_pypsa(network=network, file=file)
      else:
          logger.error("Invalid option {} for generator import. Must either be "
                       "'oedb' or 'pypsa'.".format(data_source))
          raise ValueError('The option you specified is not supported.')
docs: Import generator data from source.
  
      The generator data include
  
          * nom. capacity
          * type   ToDo: specify!
          * timeseries
  
      Additional data which can be processed (e.g. used in OEDB data) are
  
          * location
          * type
          * subtype
          * capacity
  
      Parameters
      ----------
      network: :class:`~.grid.network.Network`
          The eDisGo container object
      data_source: :obj:`str`
          Data source. Supported sources:
  
              * 'oedb'
  
      file: :obj:`str`
          File to import data from, required when using file-based sources.
  
      Returns
      -------
      :pandas:`pandas.DataFrame<dataframe>`
          List of generators