class_docstr: Plugin which implements the --nf (run new-first) option 
class_docstr_tok: ["Plugin","which","implements","the","--","nf","(","run","new-first",")","option"]
code: def pytest_collection_modifyitems(self, session, config, items):
      if self.active:
          new_items = OrderedDict()
          other_items = OrderedDict()
          for item in items:
              if item.nodeid not in self.cached_nodeids:
                  new_items[item.nodeid] = item
              else:
                  other_items[item.nodeid] = item
  
          items[:] = self._get_increasing_order(
              six.itervalues(new_items)
          ) + self._get_increasing_order(six.itervalues(other_items))
      self.cached_nodeids = [
          x.nodeid for x in items if isinstance(x, pytest.Item)
      ]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  import os
  from collections import OrderedDict
  import attr
  import py
  import six
  import pytest
  from .compat import _PY2
  from .pathlib import Path
  from .pathlib import resolve_from_str
  from .pathlib import rm_rf
label_desc: Use image node_id 2 for calling the NFPlugin obj's underlying member method code with example usage: obj.pytest_collection_modifyitems(session, config, items) without return types