

def __getitem__(self, getitem_args):
    '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(traversal, six.string_types):
                val()
                if (val._embedded and (arg in val._embedded)):
                    val = val._embedded[arg]
                else:
                    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__/VarMisuse@54/86 `arg`->`traversal`