code: def write(
      self, data_array: Union[List, np.ndarray], index: int = None
  ) -> None:
      if len(data_array) == 0:
          logger.info(
              "len(data_array) == 0, write"
              "if you need to clear the FeatureStorage, please execute: FeatureStorage.clear"
          )
          return
      if not self.uri.exists():
          # write
          index = 0 if index is None else index
          with self.uri.open("wb") as fp:
              np.hstack([index, data_array]).astype("<f").tofile(fp)
      else:
          if index is None or index > self.end_index:
              # append
              index = 0 if index is None else index
              with self.uri.open("ab+") as fp:
                  np.hstack(
                      [
                          [np.nan] * (index - self.end_index - 1),
                          data_array,
                      ]
                  ).astype("<f").tofile(fp)
          else:
              # rewrite
              with self.uri.open("rb+") as fp:
                  _old_data = np.fromfile(fp, dtype="<f")
                  _old_index = _old_data[0]
                  _old_df = pd.DataFrame(
                      _old_data[1:],
                      index=range(
                          _old_index, _old_index + len(_old_data) - 1
                      ),
                      columns=["old"],
                  )
                  fp.seek(0)
                  _new_df = pd.DataFrame(
                      data_array,
                      index=range(index, index + len(data_array)),
                      columns=["new"],
                  )
                  _df = pd.concat(
                      [_old_df, _new_df], sort=False, axis=1
                  )
                  _df = _df.reindex(
                      range(_df.index.min(), _df.index.max() + 1)
                  )
                  _df["new"].fillna(_df["old"]).values.astype(
                      "<f"
                  ).tofile(fp)
  
imports: import struct
  from pathlib import Path
  from typing import Iterable, Union, Dict, Mapping, Tuple, List
  import numpy
  import pandas
  from qlib.utils.time import Freq
  from qlib.utils.resam import resam_calendar
  from qlib.config import C
  from qlib.data.cache import H
  from qlib.log import get_module_logger
  from qlib.data.storage import CalendarStorage, InstrumentStorage, FeatureStorage, CalVT, InstKT, InstVT
label_desc: Use image node_id 4 for calling the FileFeatureStorage obj's underlying member method code with example usage: obj.write(data_array, index) without return types