class_docstr: Subclass of IntradayProcessedData. Used to handle pickle-styled data.
class_docstr_tok: ["Subclass","of","IntradayProcessedData",".","Used","to","handle","pickle-styled","data","."]
code: def __init__(
      self,
      data_dir: Path | str,
      stock_id: str,
      date: pd.Timestamp,
      feature_dim: int,
      time_index: pd.Index,
  ) -> None:
      proc = _read_pickle(
          (data_dir if isinstance(data_dir, Path) else Path(data_dir))
          / stock_id
      )
  
      # We have to infer the names here because,
      # unfortunately they are not included in the original data.
      cnames = _infer_processed_data_column_names(feature_dim)
  
      time_length: int = len(time_index)
  
      try:
          # new data format
          proc = proc.loc[pd.IndexSlice[stock_id, :, date]]
          assert (
              len(proc) == time_length
              and len(proc.columns) == feature_dim * 2
          )
          proc_today = proc[cnames]
          proc_yesterday = proc[[f"{c}_1" for c in cnames]].rename(
              columns=lambda c: c[:-2]
          )
      except (IndexError, KeyError):
          # legacy data
          proc = proc.loc[pd.IndexSlice[stock_id, date]]
          assert time_length * feature_dim * 2 == len(proc)
          proc_today = proc.to_numpy()[
              : time_length * feature_dim
          ].reshape((time_length, feature_dim))
          proc_yesterday = proc.to_numpy()[
              time_length * feature_dim :
          ].reshape((time_length, feature_dim))
          proc_today = pd.DataFrame(
              proc_today, index=time_index, columns=cnames
          )
          proc_yesterday = pd.DataFrame(
              proc_yesterday, index=time_index, columns=cnames
          )
  
      self.today: pd.DataFrame = proc_today
      self.yesterday: pd.DataFrame = proc_yesterday
      assert (
          len(self.today.columns)
          == len(self.yesterday.columns)
          == feature_dim
      )
      assert len(self.today) == len(self.yesterday) == time_length
  
imports: from __future__ import annotations
  from functools import lru_cache
  from pathlib import Path
  from typing import List, Sequence, cast
  import cachetools
  import numpy
  import pandas
  from cachetools.keys import hashkey
  from qlib.backtest.decision import Order, OrderDir
  from qlib.rl.data.base import BaseIntradayBacktestData, BaseIntradayProcessedData, ProcessedDataProvider
  from qlib.typehint import Literal
label_desc: Use image node_id 1 to create a new PickleIntradayProcessedData object from inherited base classes: BaseIntradayProcessedData with example: obj = PickleIntradayProcessedData(data_dir, stock_id, date, feature_dim, time_index)