Helper function which implements single index requests for __getitem__.

def _get_single_index_request(self, index, set_to_value=False, value=None):
        '''
        Helper function which implements single index requests for __getitem__.
        '''
        adjusted_index = index
        # Multiply by step length
        if self.range.step:
            step = self.range.step
            adjusted_index *= self.range.step
        else:
            step = 1

        # Adjust for negative indicies
        adjusted_index = get_non_negative_index(adjusted_index, self._length)
        # Push forward by start length
        if self.range.start != None:
            adjusted_index += self.range.start
        # Push forward by start length
        stop_index = self.range.stop if self.range.stop != None else self._length*step
        if adjusted_index > stop_index:
            raise IndexError(index)
        elem = self._data[adjusted_index]
        # Check if we have further dimension requirements
        # NOTE: if we're given dimensions for non-dimensional data,
        # this will blow up with an IndexError -- user should
        # not define this dimension with any restrictions
        if len(self._dim_ranges) > 1:
            if not has_len(elem):
                # We throw an IndexError instead of an AttributeError
                # because if can be caused by either sublist requests
                # or a bad constructor, and it's usually the former.
                raise IndexError("Element restricted by dimension_ranges "+
                                 str(self._dim_ranges[1:])+" is not subscriptable: "+
                                 "Dimension cannot be applied to elements with no len()")
            return self.builder(elem, *self._dim_ranges[1:])
        else:
            if set_to_value:
                self._data[adjusted_index] = value
            return elem