docstr: Get latest index composition.
  The repo indicated on README has implemented a script
  to get the latest index composition from B3 website using
  selenium. Therefore, this method will download the file
  containing such composition
  
  Parameters
  ----------
  self: is used to represent the instance of the class.
  
  Returns
  ----------
  pd.DataFrame:
      symbol      start_date  end_date
      RRRP3           2020-11-13  2022-03-02
      ALPA4           2008-01-02  2022-03-02
      dtypes:
          symbol: str
          start_date: pd.Timestamp
          end_date: pd.Timestamp
docstr_tok: ["Get","latest","index","composition",".","The","repo","indicated","on","README","has","implemented","a","script","to","get","the","latest","index","composition","from","B3","website","using","selenium",".","Therefore",",","this","method","will","download","the","file","containing","such","composition","Parameters","--","--","--","--","--","self",":","is","used","to","represent","the","instance","of","the","class",".","Returns","--","--","--","--","--","pd.DataFrame",":","symbol","start_date","end_date","RRRP3","2020-11-13","2022-03-02","ALPA4","2008-01-02","2022-03-02","dtypes",":","symbol",":","str","start_date",":","pd.Timestamp","end_date",":","pd.Timestamp"]
code: def get_new_companies(self):
      """
      Get latest index composition.
      The repo indicated on README has implemented a script
      to get the latest index composition from B3 website using
      selenium. Therefore, this method will download the file
      containing such composition
  
      Parameters
      ----------
      self: is used to represent the instance of the class.
  
      Returns
      ----------
      pd.DataFrame:
          symbol      start_date  end_date
          RRRP3	    2020-11-13	2022-03-02
          ALPA4	    2008-01-02	2022-03-02
          dtypes:
              symbol: str
              start_date: pd.Timestamp
              end_date: pd.Timestamp
      """
      logger.info(
          "Getting new companies in {} index ...".format(
              self.index_name
          )
      )
  
      try:
          ## Get index composition
  
          df_index = pd.read_csv(
              self.ibov_index_composition.format(
                  self.year + "_" + self.current_4_month_period
              ),
              on_bad_lines="skip",
          )
          df_date_first_added = pd.read_csv(
              self.ibov_index_composition.format(
                  "date_first_added_"
                  + self.year
                  + "_"
                  + self.current_4_month_period
              ),
              on_bad_lines="skip",
          )
          df = df_index.merge(df_date_first_added, on="symbol")[
              ["symbol", "Date First Added"]
          ]
          df[self.START_DATE_FIELD] = df["Date First Added"].map(
              self.format_quarter
          )
  
          # end_date will be our current quarter + 1, since the IBOV index updates itself every quarter
          df[self.END_DATE_FIELD] = (
              self.year
              + "-"
              + quarter_dict[self.current_4_month_period]
          )
          df = df[
              ["symbol", self.START_DATE_FIELD, self.END_DATE_FIELD]
          ]
          df["symbol"] = df["symbol"].astype(str) + ".SA"
  
          return df
  
      except Exception as E:
          logger.error(
              "An error occured while getting new companies - {}".format(
                  E
              )
          )
  
imports: from functools import partial
  import sys
  from pathlib import Path
  import datetime
  import fire
  import pandas
  from tqdm import tqdm
  from loguru import logger
  from data_collector.index import IndexBase
  from data_collector.utils import get_instruments
label_desc: Use image node_id 8 for calling the IBOVIndex obj's underlying member method code with example usage: obj.get_new_companies() and returns: df