class_docstr: BlockSelector is used to prepare the effective window to compute explanation
  from the user provided parameters. This is used while computing timeseries perturbations.
class_docstr_tok: ["BlockSelector","is","used","to","prepare","the","effective","window","to","compute","explanation","from","the","user","provided","parameters",".","This","is","used","while","computing","timeseries","perturbations","."]
code: def select_start_point(
      self, x, n: int = 1, margin: int = None, block_length: int = 5
  ):
      start, end = self._start, self._end
      x = np.array(x)
      t = x.shape[0]
  
      if (margin is not None) and (margin < 0):
          margin = t - margin
  
      if margin is None:
          margin = t
  
      if margin < 0:
          raise ValueError(
              f"Error: margin should be a valid point with in data length!"
          )
  
      if start < 0:
          start = t + start
          if start < 0:
              start = 0
  
      if (end is not None) and (end < 0):
          end = t + end
          if end < 0:
              raise ValueError(
                  f"Error: end must be within the index range!"
              )
      elif end is None:
          end = t
  
      end = min(end, margin)
  
      return np.random.randint(low=start, high=end, size=n)
  
file_path: AIX360/aix360/algorithms/tsutils/tsperturbers/tsperturber.py
imports: import numpy
  import pandas
  from typing import Union
  from abc import ABC, abstractmethod
label_desc: Use image node_id 2 for calling the BlockSelector obj's underlying member method code with example usage: obj.select_start_point(x, n, margin, block_length) and returns: np