code: def test_new_from_file(fx_asset):
      """Opens an image from the file object."""
      fpath = fx_asset.joinpath("mona-lisa.jpg")
      with open(fpath, "rb") as f:
          with Image(file=f) as img:
              assert img.width == 402
          with raises(ClosedImageError):
              img.wand
  
      with open(fpath, "rb") as f:
          strio = io.BytesIO(f.read())
          with Image(file=strio) as img:
              assert img.width == 402
          strio.close()
          with raises(ClosedImageError):
              img.wand
          with raises(TypeError):
              Image(file="not file object")
  
imports: import codecs
  import io
  import os
  import os.path
  import shutil
  import struct
  import sys
  import tempfile
  from pytest import mark, raises
  from wand.image import ClosedImageError, Image
  from wand.color import Color
  from wand.font import Font
label_desc: Use image node_id 10 for calling a global function with example usage: test_new_from_file(fx_asset) without return types