code: def _get_by_index(self, index, path=None):
          
          left_size = 2 ** ((self.size-1).bit_length() - 1)
          if index < 0 or self.size <= index:
              return (None, self, index)
          if index < left_size:
              if self.prune is self.LEFT_NODE:
                  return (None, self, index)
              if isinstance(self.left, numbers.Integral):
                  return (self.left, self, index)
              if path is not None:
                  path.append((node, index, self.LEFT_NODE))
              return self.left._get_by_index(index, path)
          else:
              if self.prune is self.RIGHT_NODE:
                  return (None, self, index)
              if isinstance(self.right, numbers.Integral):
                  return (self.right, self, index)
              if path is not None:
                  path.append((node, index, self.RIGHT_NODE))
              return self.right._get_by_index(index-left_size, path)
docs: Returns the 2-tuple (node, idx) where node is either a terminal leaf
          node containing the value of that index in either it's left or right slot,
          or is the most specific node on the path which would contain the index if
          it were not pruned.