# loki.batch.sfilter module

class SFilter(sgraph, item_filter=None, reverse=False, exclude_ignored=False, include_external=False, mode=None)

  Bases: `object`

  Filtered iterator over a `SGraph`

  This class allows to change the iteration behaviour over the dependency graph stored in `SGraph`.

  Example use:

      items = scheduler.items
      reversed_items = as_tuple(SFilter(scheduler.sgraph, reverse=True))
      procedure_bindings = as_tuple(SFilter(scheduler.sgraph, item_filter=ProcedureBindingItem))

  Parameters:

    - sgraph (`SGraph`) – The graph over which to iterate

    - item_filter (list of `Item` subclasses, optional) – Only include items that match the provided list of types

    - reverse (bool, optional) – Iterate over the dependency graph in reverse direction

    - exclude_ignored (bool, optional) – Exclude `Item` objects that have the `is_ignored` property

    - include_external (bool, optional) – Do not skip `ExternalItem` in the iterator

    - mode (str, optional) – Only include items having corresponding mode.