def __getitem__(self, index):
    if isinstance(index, (slice, int)):
        return super(LabeledVector, self).__getitem__(index)
    elif isinstance(index, Dimension):
        for d in index._defines:
            if (d in self.labels):
                i = self.labels.index(d)
                return super(LabeledVector, self).__getitem__(i)
        return None
    else:
        raise TypeError(('Indices must be integers, slices, or Dimensions, not %s' % type(index)))
def __getitem__(self, index):
    if isinstance(index, (slice, int)):
        return super(LabeledVector, self).__getitem__(index)
    elif isinstance(index, Dimension):
        for d in index._defines:
            if (d in self.labels):
                i = self.labels.index(d)
                return super(LabeledVector, self).__getitem__(i)
        return None
    else:
        raise TypeError(('Indices must be integers, slices, or Dimensions, not %s' % type(index)))