class_docstr: These tests are separate from the rest of the JIT tests because we need
  run a new subprocess and `import torch` with the correct environment
  variables set.
class_docstr_tok: ["These","tests","are","separate","from","the","rest","of","the","JIT","tests","because","we","need","run","a","new","subprocess","and","`","import","torch","`","with","the","correct","environment","variables","set","."]
docstr: Runs the script in `src` with PYTORCH_JIT enabled and disabled and
  compares their stdout for equality.
docstr_tok: ["Runs","the","script","in","`","src","`","with","PYTORCH_JIT","enabled","and","disabled","and","compares","their","stdout","for","equality","."]
code: def compare_enabled_disabled(self, src):
      """
      Runs the script in `src` with PYTORCH_JIT enabled and disabled and
      compares their stdout for equality.
      """
      # Write `src` out to a temporary so our source inspection logic works
      # correctly.
      with TemporaryFileName() as fname:
          with open(fname, "w") as f:
              f.write(src)
              with _jit_disabled():
                  out_disabled = subprocess.check_output(
                      [sys.executable, fname]
                  )
              out_enabled = subprocess.check_output(
                  [sys.executable, fname]
              )
              self.assertEqual(out_disabled, out_enabled)
  
file_path: pytorch/test/test_jit_disabled.py
imports: import sys
  import os
  import contextlib
  import subprocess
  from torch.testing._internal.common_utils import TestCase, run_tests, TemporaryFileName
label_desc: Use image node_id 1 for calling the TestJitDisabled obj's underlying member method code with example usage: obj.compare_enabled_disabled(src) without return types