docstr: save new companies
  
  Examples
  -------
      $ python collector.py save_new_companies --index_name CSI300 --qlib_dir ~/.qlib/qlib_data/cn_data
docstr_tok: ["save","new","companies","Examples","--","--","--","-","$","python","collector.py","save_new_companies","--","index_name","CSI300","--","qlib_dir","~\/.qlib\/qlib_data\/cn_data"]
code: def save_new_companies(self):
      """save new companies
  
      Examples
      -------
          $ python collector.py save_new_companies --index_name CSI300 --qlib_dir ~/.qlib/qlib_data/cn_data
      """
      df = self.get_new_companies()
      if df is None or df.empty:
          raise ValueError(
              f"get new companies error: {self.index_name}"
          )
      df = df.drop_duplicates([self.SYMBOL_FIELD_NAME])
      df.loc[:, self.INSTRUMENTS_COLUMNS].to_csv(
          self.instruments_dir.joinpath(
              f"{self.index_name.lower()}_only_new.txt"
          ),
          sep="\t",
          index=False,
          header=None,
      )
  
file_path: qlib/scripts/data_collector/index.py
imports: import sys
  import abc
  from pathlib import Path
  from typing import List
  import pandas
  from tqdm import tqdm
  from loguru import logger
  from data_collector.utils import get_trading_date_by_shift
label_desc: Use image node_id 7 for calling the IndexBase obj's underlying member method code with example usage: obj.save_new_companies() without return types