code: def test_log_summary_writer_class(ex, tf):
      """
      Tests whether logdir is stored into the info dictionary when creating a new FileWriter object,
      but this time on a method of a class.
      """
      TEST_LOG_DIR = "/tmp/sacred_test1"
      TEST_LOG_DIR2 = "/tmp/sacred_test2"
  
      class FooClass:
          def __init__(self):
              pass
  
          @LogFileWriter(ex)
          def hello(self, argument):
              with tf.Session() as s:
                  tf.summary.FileWriter(argument, s.graph)
  
      @ex.main
      def run_experiment(_run):
          assert _run.info.get("tensorflow", None) is None
          foo = FooClass()
          with tf.Session() as s:
              swr = tf.summary.FileWriter(TEST_LOG_DIR, s.graph)
              assert swr is not None
              # Because FileWriter was not called in an annotated function
              assert _run.info.get("tensorflow", None) is None
          foo.hello(TEST_LOG_DIR2)
          # Because foo.hello was anotated
          assert _run.info["tensorflow"]["logdirs"] == [TEST_LOG_DIR2]
  
          with tf.Session() as s:
              swr = tf.summary.FileWriter(TEST_LOG_DIR, s.graph)
              # Nothing should be added, because FileWriter was again not called in an annotated function
              assert _run.info["tensorflow"]["logdirs"] == [
                  TEST_LOG_DIR2
              ]
  
      ex.run()
  
file_path: sacred/tests/test_stflow/test_method_interception.py
imports: import pytest
  from sacred import Experiment
  from sacred.stflow import LogFileWriter
  import sacred.optional
label_desc: Use image node_id 6 for calling a global function with example usage: test_log_summary_writer_class(ex, tf) without return types