docstr: Returns data, based on the given args, from this buffer.
  
  Args:
      indices: A single int is interpreted as an index, from which to return the
          individual data stored at this index.
          A list of ints is interpreted as a list of indices from which to gather
          individual data in a batch of size len(indices).
          A slice object is interpreted as a range of data to be returned.
          Thereby, negative indices by default are interpreted as "before the end"
          unless the `neg_indices_left_of_zero=True` option is used, in which case
          negative indices are interpreted as "before ts=0", meaning going back
          into the lookback buffer.
      neg_indices_left_of_zero: If True, negative values in `indices` are
          interpreted as "before ts=0", meaning going back into the lookback
          buffer. For example, an buffer with data [4, 5, 6,  7, 8, 9],
          where [4, 5, 6] is the lookback buffer range (ts=0 item is 7), will
          respond to `get(-1, neg_indices_left_of_zero=True)` with `6` and to
          `get(slice(-2, 1), neg_indices_left_of_zero=True)` with `[5, 6,  7]`.
      fill: An optional float value to use for filling up the returned results at
          the boundaries. This filling only happens if the requested index range's
          start/stop boundaries exceed the buffer's boundaries (including the
          lookback buffer on the left side). This comes in very handy, if users
          don't want to worry about reaching such boundaries and want to zero-pad.
          For example, a buffer with data [10, 11,  12, 13, 14] and lookback
          buffer size of 2 (meaning `10` and `11` are part of the lookback buffer)
          will respond to `get(slice(-7, -2), fill=0.0)`
          with `[0.0, 0.0, 10, 11, 12]`.
      one_hot_discrete: If True, will return one-hot vectors (instead of
          int-values) for those sub-components of a (possibly complex) space
          that are Discrete or MultiDiscrete. Note that if `fill=0` and the
          requested `indices` are out of the range of our data, the returned
          one-hot vectors will actually be zero-hot (all slots zero).
docstr_tok: ["Returns","data",",","based","on","the","given","args",",","from","this","buffer",".","Args",":","indices",":","A","single","int","is","interpreted","as","an","index",",","from","which","to","return","the","individual","data","stored","at","this","index",".","A","list","of","ints","is","interpreted","as","a","list","of","indices","from","which","to","gather","individual","data","in","a","batch","of","size","len","(","indices",")",".","A","slice","object","is","interpreted","as","a","range","of","data","to","be","returned",".","Thereby",",","negative","indices","by","default","are","interpreted","as","``","before","the","end","''","unless","the","`","neg_indices_left_of_zero=True","`","option","is","used",",","in","which","case","negative","indices","are","interpreted","as","``","before","ts=0","''",",","meaning","going","back","into","the","lookback","buffer",".","neg_indices_left_of_zero",":","If","True",",","negative","values","in","`","indices","`","are","interpreted","as","``","before","ts=0","''",",","meaning","going","back","into","the","lookback","buffer",".","For","example",",","an","buffer","with","data","[","4",",","5",",","6",",","7",",","8",",","9","]",",","where","[","4",",","5",",","6","]","is","the","lookback","buffer","range","(","ts=0","item","is","7",")",",","will","respond","to","`","get","(","-1",",","neg_indices_left_of_zero=True",")","`","with","`","6","`","and","to","`","get","(","slice","(","-2",",","1",")",",","neg_indices_left_of_zero=True",")","`","with","`","[","5",",","6",",","7","]","`",".","fill",":","An","optional","float","value","to","use","for","filling","up","the","returned","results","at","the","boundaries",".","This","filling","only","happens","if","the","requested","index","range's","start\/stop","boundaries","exceed","the","buffer","'s","boundaries","(","including","the","lookback","buffer","on","the","left","side",")",".","This","comes","in","very","handy",",","if","users","do","n't","want","to","worry","about","reaching","such","boundaries","and","want","to","zero-pad",".","For","example",",","a","buffer","with","data","[","10",",","11",",","12",",","13",",","14","]","and","lookback","buffer","size","of","2","(","meaning","`","10","`","and","`","11","`","are","part","of","the","lookback","buffer",")","will","respond","to","`","get","(","slice","(","-7",",","-2",")",",","fill=0.0",")","`","with","`","[","0.0",",","0.0",",","10",",","11",",","12","]","`",".","one_hot_discrete",":","If","True",",","will","return","one-hot","vectors","(","instead","of","int-values",")","for","those","sub-components","of","a","(","possibly","complex",")","space","that","are","Discrete","or","MultiDiscrete",".","Note","that","if","`","fill=0","`","and","the","requested","`","indices","`","are","out","of","the","range","of","our","data",",","the","returned","one-hot","vectors","will","actually","be","zero-hot","(","all","slots","zero",")","."]
code: def get(
      self,
      indices: Optional[Union[int, slice, List[int]]] = None,
      *,
      neg_indices_left_of_zero: bool = False,
      fill: Optional[float] = None,
      one_hot_discrete: bool = False,
  ):
      """Returns data, based on the given args, from this buffer.
  
      Args:
          indices: A single int is interpreted as an index, from which to return the
              individual data stored at this index.
              A list of ints is interpreted as a list of indices from which to gather
              individual data in a batch of size len(indices).
              A slice object is interpreted as a range of data to be returned.
              Thereby, negative indices by default are interpreted as "before the end"
              unless the `neg_indices_left_of_zero=True` option is used, in which case
              negative indices are interpreted as "before ts=0", meaning going back
              into the lookback buffer.
          neg_indices_left_of_zero: If True, negative values in `indices` are
              interpreted as "before ts=0", meaning going back into the lookback
              buffer. For example, an buffer with data [4, 5, 6,  7, 8, 9],
              where [4, 5, 6] is the lookback buffer range (ts=0 item is 7), will
              respond to `get(-1, neg_indices_left_of_zero=True)` with `6` and to
              `get(slice(-2, 1), neg_indices_left_of_zero=True)` with `[5, 6,  7]`.
          fill: An optional float value to use for filling up the returned results at
              the boundaries. This filling only happens if the requested index range's
              start/stop boundaries exceed the buffer's boundaries (including the
              lookback buffer on the left side). This comes in very handy, if users
              don't want to worry about reaching such boundaries and want to zero-pad.
              For example, a buffer with data [10, 11,  12, 13, 14] and lookback
              buffer size of 2 (meaning `10` and `11` are part of the lookback buffer)
              will respond to `get(slice(-7, -2), fill=0.0)`
              with `[0.0, 0.0, 10, 11, 12]`.
          one_hot_discrete: If True, will return one-hot vectors (instead of
              int-values) for those sub-components of a (possibly complex) space
              that are Discrete or MultiDiscrete. Note that if `fill=0` and the
              requested `indices` are out of the range of our data, the returned
              one-hot vectors will actually be zero-hot (all slots zero).
      """
      if fill is not None and self.space is None:
          raise ValueError(
              f"Cannot use `fill` argument in `{type(self).__name__}.get()` if a "
              "gym.Space was NOT provided during construction!"
          )
  
      if indices is None:
          data = self._get_all_data(one_hot_discrete=one_hot_discrete)
      elif isinstance(indices, slice):
          data = self._get_slice(
              indices,
              fill=fill,
              neg_indices_left_of_zero=neg_indices_left_of_zero,
              one_hot_discrete=one_hot_discrete,
          )
      elif isinstance(indices, list):
          data = [
              self._get_int_index(
                  idx,
                  fill=fill,
                  neg_indices_left_of_zero=neg_indices_left_of_zero,
                  one_hot_discrete=one_hot_discrete,
              )
              for idx in indices
          ]
          if self.finalized:
              data = batch(data)
      else:
          assert isinstance(indices, int)
          data = self._get_int_index(
              indices,
              fill=fill,
              neg_indices_left_of_zero=neg_indices_left_of_zero,
              one_hot_discrete=one_hot_discrete,
          )
  
      return data
  
imports: import logging
  from typing import List, Optional, Type, Union
  import gymnasium
  import numpy
  import tree
  from ray.rllib.env.env_context import EnvContext
  from ray.rllib.env.multi_agent_env import MultiAgentEnv
  from ray.rllib.env.wrappers.multi_agent_env_compatibility import MultiAgentEnvCompatibility
  from ray.rllib.utils.error import ERR_MSG_INVALID_ENV_DESCRIPTOR, ERR_MSG_OLD_GYM_API, EnvError
  from ray.rllib.utils.gym import check_old_gym_env
  from ray.rllib.utils.numpy import one_hot, one_hot_multidiscrete
  from ray.rllib.utils.spaces.space_utils import batch, get_dummy_batch_for_space, get_base_struct_from_space
  from ray.util import log_once
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 6 for calling the BufferWithInfiniteLookback obj's underlying member method code with example usage: obj.get(indices) and returns: data