code: def test_format_inference_file():
      with tempfile.NamedTemporaryFile(
          suffix=".gif", delete=False
      ) as f:
          img = Image.from_file(f)
  
          assert img.format == "gif"
  
imports: import io
  import os
  from ipywidgets import Image
  import hashlib
  import pkgutil
  import tempfile
  from contextlib import contextmanager
label_desc: Use image node_id 12 for calling a global function with example usage: test_format_inference_file() without return types