def __getitem__(self, getitem_args):
        r'''Rel selector and traversor for navigators'''
        traversal = utils.normalize_getitem_args(getitem_args)
        intermediates = [self]
        val = self
        for i, arg in enumerate(traversal):
            try:
                if isinstance(arg, six.string_types):
                    val()  # fetch the resource if necessary
                    if val._embedded and arg in val._embedded:
                        val = val._embedded[arg]
                    else:
                        # We're hoping it's in links, otherwise we're
                        # off the tracks
                        val = val.links()[arg]
                elif isinstance(arg, tuple):
                    val = val.get_by(*arg, raise_exc=True)
                elif isinstance(arg, int) and isinstance(val, list):
                    val = val[arg]
                else:
                    raise TypeError("{0!r} doesn't accept a traversor of {1!r}"
                                    .format(val, arg))
            except Exception as e:
                raise exc.OffTheRailsException(
                    traversal, i, intermediates, e)
            intermediates.append(val)
        return val
dataset/ETHPy150Open deontologician/restnavigator/restnavigator/halnav.py/HALNavigatorBase.__getitem__/original