class_docstr: Base class for data series.
  
  .. note::
      This is a base class and should not be used directly.
class_docstr_tok: ["Base","class","for","data","series",".","..","note",":",":","This","is","a","base","class","and","should","not","be","used","directly","."]
docstr: Returns the value at a given position/slice. It raises IndexError if the position is invalid,
  or TypeError if the key type is invalid.
docstr_tok: ["Returns","the","value","at","a","given","position\/slice",".","It","raises","IndexError","if","the","position","is","invalid",",","or","TypeError","if","the","key","type","is","invalid","."]
code: def __getitem__(self, key):
      """Returns the value at a given position/slice. It raises IndexError if the position is invalid,
      or TypeError if the key type is invalid."""
      if isinstance(key, slice):
          return [self[i] for i in xrange(*key.indices(len(self)))]
      elif isinstance(key, int):
          if key < 0:
              key += len(self)
          if key >= len(self) or key < 0:
              raise IndexError("Index out of range")
          return self.getValueAbsolute(key)
      else:
          raise TypeError("Invalid argument type")
  
imports: import abc
  import six
  from six.moves import xrange
  from pyalgotrade import observer
  from pyalgotrade.utils import collections
label_desc: Use image node_id 2 for calling the DataSeries obj's underlying member method code with example usage: obj.__getitem__(key) and returns: unknown, self