pypet/naturalnaming.py
def f_iter_nodes(self, recursive=True, with_links=True, max_depth=None, predicate=None):
        """Iterates recursively (default) over nodes hanging below this group.

        :param recursive: Whether to iterate the whole sub tree or only immediate children.

        :param with_links: If links should be considered

        :param max_depth: Maximum depth in search tree relative to start node (inclusive)

        :param predicate:

            A predicate function that is applied for each node and only returns the node
            if it evaluates to ``True``. If ``False``
            and you iterate recursively also the children are spared.

            Leave to `None` if you don't want to filter and simply iterate over all nodes.


            For example, to iterate only over groups you could use:

            >>> traj.f_iter_nodes(recursive=True, predicate=lambda x: x.v_is_group)

            To blind out all runs except for a particular set, you can simply pass a tuple
            of run indices with -1 referring to the ``run_ALL`` node.

            For instance

            >>> traj.f_iter_nodes(recursive=True, predicate=(0,3,-1))

            Will blind out all nodes hanging below a group named ``run_XXXXXXXXX``
            (including the group) except ``run_00000000``, ``run_00000003``, and ``run_ALL``.


        :return: Iterator over nodes

        """
        return self._nn_interface._iter_nodes(self, recursive=recursive, with_links=with_links,
                                              max_depth=max_depth,
                                              predicate=predicate)
def f_iter_nodes(self, recursive=True, with_links=True, max_depth=None, predicate=None):
        """Iterates recursively (default) over nodes hanging below this group.

        :param recursive: Whether to iterate the whole sub tree or only immediate children.

        :param with_links: If links should be considered

        :param max_depth: Maximum depth in search tree relative to start node (inclusive)

        :param predicate:

            A predicate function that is applied for each node and only returns the node
            if it evaluates to ``True``. If ``False``
            and you iterate recursively also the children are spared.

            Leave to `None` if you don't want to filter and simply iterate over all nodes.


            For example, to iterate only over groups you could use:

            >>> traj.f_iter_nodes(recursive=True, predicate=lambda x: x.v_is_group)

            To blind out all runs except for a particular set, you can simply pass a tuple
            of run indices with -1 referring to the ``run_ALL`` node.

            For instance

            >>> traj.f_iter_nodes(recursive=True, predicate=(0,3,-1))

            Will blind out all nodes hanging below a group named ``run_XXXXXXXXX``
            (including the group) except ``run_00000000``, ``run_00000003``, and ``run_ALL``.


        :return: Iterator over nodes

        """
        return self._nn_interface._iter_nodes(self, recursive=recursive, with_links=with_links,
                                              max_depth=max_depth,
                                              predicate=predicate)
Iterates recursively (default) over nodes hanging below this group.

        :param recursive: Whether to iterate the whole sub tree or only immediate children.

        :param with_links: If links should be considered

        :param max_depth: Maximum depth in search tree relative to start node (inclusive)

        :param predicate:

            A predicate function that is applied for each node and only returns the node
            if it evaluates to ``True``. If ``False``
            and you iterate recursively also the children are spared.

            Leave to `None` if you don't want to filter and simply iterate over all nodes.


            For example, to iterate only over groups you could use:

            >>> traj.f_iter_nodes(recursive=True, predicate=lambda x: x.v_is_group)

            To blind out all runs except for a particular set, you can simply pass a tuple
            of run indices with -1 referring to the ``run_ALL`` node.

            For instance

            >>> traj.f_iter_nodes(recursive=True, predicate=(0,3,-1))

            Will blind out all nodes hanging below a group named ``run_XXXXXXXXX``
            (including the group) except ``run_00000000``, ``run_00000003``, and ``run_ALL``.


        :return: Iterator over nodes