code: def dark_mode_middleware():
      def f(upstream):
          def app(env, start_resp):
              if env["PATH_INFO"] == "/":
                  return _style_tb_for_dark_mode(
                      upstream, env, start_resp
                  )
              if env["PATH_INFO"] == "/index.js":
                  return _disable_dark_mode_toggle(
                      upstream, env, start_resp
                  )
              return upstream(env, start_resp)
  
          return app
  
      return f
  
imports: import logging
  import os
  import socket
  import time
  import warnings
  from guild import util
label_desc: Use image node_id 25 for calling a global function with example usage: dark_mode_middleware() and returns: f, app, upstream, _style_tb_for_dark_mode, _disable_dark_mode_toggle