docstr: Rebase the start_index and end_index of the FeatureStorage.
  
  start_index and end_index are closed intervals: [start_index, end_index]
  
  Examples
  ---------
  
      .. code-block::
  
              feature:
                  3   4
                  4   5
                  5   6
  
  
          >>> self.rebase(start_index=4)
  
              feature:
                  4   5
                  5   6
  
          >>> self.rebase(start_index=3)
  
              feature:
                  3   np.nan
                  4   5
                  5   6
  
          >>> self.write([3], index=3)
  
              feature:
                  3   3
                  4   5
                  5   6
  
          >>> self.rebase(end_index=4)
  
              feature:
                  3   3
                  4   5
  
          >>> self.write([6, 7, 8], index=4)
  
              feature:
                  3   3
                  4   6
                  5   7
                  6   8
  
          >>> self.rebase(start_index=4, end_index=5)
  
              feature:
                  4   6
                  5   7
docstr_tok: ["Rebase","the","start_index","and","end_index","of","the","FeatureStorage",".","start_index","and","end_index","are","closed","intervals",":","[","start_index",",","end_index","]","Examples","--","--","--","--","-","..","code-block",":",":","feature",":","3","4","4","5","5","6",">",">",">","self.rebase","(","start_index=4",")","feature",":","4","5","5","6",">",">",">","self.rebase","(","start_index=3",")","feature",":","3","np.nan","4","5","5","6",">",">",">","self.write","(","[","3","]",",","index=3",")","feature",":","3","3","4","5","5","6",">",">",">","self.rebase","(","end_index=4",")","feature",":","3","3","4","5",">",">",">","self.write","(","[","6",",","7",",","8","]",",","index=4",")","feature",":","3","3","4","6","5","7","6","8",">",">",">","self.rebase","(","start_index=4",",","end_index=5",")","feature",":","4","6","5","7"]
code: def rebase(self, start_index: int = None, end_index: int = None):
      """Rebase the start_index and end_index of the FeatureStorage.
  
      start_index and end_index are closed intervals: [start_index, end_index]
  
      Examples
      ---------
  
          .. code-block::
  
                  feature:
                      3   4
                      4   5
                      5   6
  
  
              >>> self.rebase(start_index=4)
  
                  feature:
                      4   5
                      5   6
  
              >>> self.rebase(start_index=3)
  
                  feature:
                      3   np.nan
                      4   5
                      5   6
  
              >>> self.write([3], index=3)
  
                  feature:
                      3   3
                      4   5
                      5   6
  
              >>> self.rebase(end_index=4)
  
                  feature:
                      3   3
                      4   5
  
              >>> self.write([6, 7, 8], index=4)
  
                  feature:
                      3   3
                      4   6
                      5   7
                      6   8
  
              >>> self.rebase(start_index=4, end_index=5)
  
                  feature:
                      4   6
                      5   7
  
      """
      storage_si = self.start_index
      storage_ei = self.end_index
      if storage_si is None or storage_ei is None:
          raise ValueError(
              "storage.start_index or storage.end_index is None, storage may not exist"
          )
  
      start_index = storage_si if start_index is None else start_index
      end_index = storage_ei if end_index is None else end_index
  
      if start_index is None or end_index is None:
          logger.warning(
              "both start_index and end_index are None, or storage does not exist; rebase is ignored"
          )
          return
  
      if start_index < 0 or end_index < 0:
          logger.warning(
              "start_index or end_index cannot be less than 0"
          )
          return
      if start_index > end_index:
          logger.warning(
              f"start_index({start_index}) > end_index({end_index}), rebase is ignored; "
              f"if you need to clear the FeatureStorage, please execute: FeatureStorage.clear"
          )
          return
  
      if start_index <= storage_si:
          self.write([np.nan] * (storage_si - start_index), start_index)
      else:
          self.rewrite(self[start_index:].values, start_index)
  
      if end_index >= self.end_index:
          self.write([np.nan] * (end_index - self.end_index))
      else:
          self.rewrite(self[: end_index + 1].values, start_index)
  
imports: import re
  from typing import Iterable, overload, Tuple, List, Text, Union, Dict
  import numpy
  import pandas
  from qlib.log import get_module_logger
label_desc: Use image node_id 7 for calling the FeatureStorage obj's underlying member method code with example usage: obj.rebase(start_index, end_index) without return types