code: def pytest_sessionfinish(session):
      assertstate = getattr(session.config, "_assertstate", None)
      if assertstate:
          if assertstate.hook is not None:
              assertstate.hook.set_session(None)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  import six
  from _pytest.assertion import rewrite
  from _pytest.assertion import truncate
  from _pytest.assertion import util
label_desc: Use image node_id 7 for calling a global function with example usage: pytest_sessionfinish(session) without return types