code: def threadsafe_generator(generator_func):
      
      def decoration(*args, **keyword_args):
          """A thread-safe decoration for a generator function."""
          return ThreadSafeIter(generator_func(*args, **keyword_args))
      return decoration
docs: A decorator that takes a generator function and makes it thread-safe.