code: def _tempfile(contents: bytes):
      with tempfile.NamedTemporaryFile() as f:
          f.write(contents)
          f.flush()
  
          yield f
  
file_path: superset/tests/unit_tests/forms_tests.py
imports: import contextlib
  import tempfile
  from typing import Optional
  import pytest
  from flask_wtf.file import FileField
  from wtforms import Form, ValidationError
  from superset.forms import FileSizeLimit
label_desc: Use image node_id 2 for calling a global function with example usage: _tempfile(contents) without return types