class_docstr: Plugin which implements the --lf (run last-failing) option 
class_docstr_tok: ["Plugin","which","implements","the","--","lf","(","run","last-failing",")","option"]
code: def pytest_sessionfinish(self, session):
      config = self.config
      if config.getoption("cacheshow") or hasattr(config, "slaveinput"):
          return
  
      saved_lastfailed = config.cache.get("cache/lastfailed", {})
      if saved_lastfailed != self.lastfailed:
          config.cache.set("cache/lastfailed", self.lastfailed)
  
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 8 for calling the LFPlugin obj's underlying member method code with example usage: obj.pytest_sessionfinish(session) without return types