docstr: The meaning of instrument, such as CSI500:
  
      CSI500 composition changes:
  
          date            add         remove
          2005-01-01      SH600000
          2005-01-01      SH600001
          2005-01-01      SH600002
          2005-02-01      SH600003    SH600000
          2005-02-15      SH600000    SH600002
  
      Calendar:
          pd.date_range(start="2020-01-01", stop="2020-03-01", freq="1D")
  
      Instrument:
          symbol      start_time      end_time
          SH600000    2005-01-01      2005-01-31 (2005-02-01 Last trading day)
          SH600000    2005-02-15      2005-03-01
          SH600001    2005-01-01      2005-03-01
          SH600002    2005-01-01      2005-02-14 (2005-02-15 Last trading day)
          SH600003    2005-02-01      2005-03-01
  
      InstrumentStorage:
          {
              "SH600000": [(2005-01-01, 2005-01-31), (2005-02-15, 2005-03-01)],
              "SH600001": [(2005-01-01, 2005-03-01)],
              "SH600002": [(2005-01-01, 2005-02-14)],
              "SH600003": [(2005-02-01, 2005-03-01)],
          }
docstr_tok: ["The","meaning","of","instrument",",","such","as","CSI500",":","CSI500","composition","changes",":","date","add","remove","2005-01-01","SH600000","2005-01-01","SH600001","2005-01-01","SH600002","2005-02-01","SH600003","SH600000","2005-02-15","SH600000","SH600002","Calendar",":","pd.date_range","(","start=","''","2020-01-01","''",",","stop=","''","2020-03-01","''",",","freq=","''","1D","''",")","Instrument",":","symbol","start_time","end_time","SH600000","2005-01-01","2005-01-31","(","2005-02-01","Last","trading","day",")","SH600000","2005-02-15","2005-03-01","SH600001","2005-01-01","2005-03-01","SH600002","2005-01-01","2005-02-14","(","2005-02-15","Last","trading","day",")","SH600003","2005-02-01","2005-03-01","InstrumentStorage",":","{","``","SH600000","''",":","[","(","2005-01-01",",","2005-01-31",")",",","(","2005-02-15",",","2005-03-01",")","]",",","``","SH600001","''",":","[","(","2005-01-01",",","2005-03-01",")","]",",","``","SH600002","''",":","[","(","2005-01-01",",","2005-02-14",")","]",",","``","SH600003","''",":","[","(","2005-02-01",",","2005-03-01",")","]",",","}"]
code: def test_instrument_storage(self):
      """
      The meaning of instrument, such as CSI500:
  
          CSI500 composition changes:
  
              date            add         remove
              2005-01-01      SH600000
              2005-01-01      SH600001
              2005-01-01      SH600002
              2005-02-01      SH600003    SH600000
              2005-02-15      SH600000    SH600002
  
          Calendar:
              pd.date_range(start="2020-01-01", stop="2020-03-01", freq="1D")
  
          Instrument:
              symbol      start_time      end_time
              SH600000    2005-01-01      2005-01-31 (2005-02-01 Last trading day)
              SH600000    2005-02-15      2005-03-01
              SH600001    2005-01-01      2005-03-01
              SH600002    2005-01-01      2005-02-14 (2005-02-15 Last trading day)
              SH600003    2005-02-01      2005-03-01
  
          InstrumentStorage:
              {
                  "SH600000": [(2005-01-01, 2005-01-31), (2005-02-15, 2005-03-01)],
                  "SH600001": [(2005-01-01, 2005-03-01)],
                  "SH600002": [(2005-01-01, 2005-02-14)],
                  "SH600003": [(2005-02-01, 2005-03-01)],
              }
  
      """
  
      instrument = InstrumentStorage(
          market="csi300", provider_uri=self.provider_uri, freq="day"
      )
  
      for inst, spans in instrument.data.items():
          assert isinstance(inst, str) and isinstance(
              spans, Iterable
          ), f"{instrument.__class__.__name__} value is not Iterable"
          for s_e in spans:
              assert (
                  isinstance(s_e, tuple) and len(s_e) == 2
              ), f"{instrument.__class__.__name__}.__getitem__(k) TypeError"
  
      print(f"instrument['SH600000']: {instrument['SH600000']}")
  
      instrument = InstrumentStorage(
          market="csi300", provider_uri="not_found", freq="day"
      )
      with self.assertRaises(ValueError):
          print(instrument.data)
  
      with self.assertRaises(ValueError):
          print(instrument["sSH600000"])
  
file_path: qlib/tests/storage_tests/test_storage.py
imports: from pathlib import Path
  from collections.abc import Iterable
  import numpy
  from qlib.tests import TestAutoData
  from qlib.data.storage.file_storage import FileCalendarStorage, FileInstrumentStorage, FileFeatureStorage
label_desc: Use image node_id 2 for calling the TestStorage obj's underlying member method code with example usage: obj.test_instrument_storage() without return types