code: def img():
      import PIL.Image
  
      images = {}
      digits = list(range(10))
      for digit in digits:
          img_path = f"samples/{digit}.png"
          with open(img_path, "rb") as f:
              img_bytes = f.read()
          im = PIL.Image.open(io.BytesIO(img_bytes))
          arr = np.array(im)
          images[digit] = {
              "bytes": img_bytes,
              "pil": im,
              "array": arr,
          }
  
      return images
  
file_path: BentoML/examples/flax/MNIST/tests/test_endpoints.py
imports: from __future__ import annotations
  import io
  import typing
  import numpy
  import pytest
  import bentoml
  from bentoml.testing.grpc import async_client_call
  from bentoml.testing.grpc import create_channel
label_desc: Use image node_id 1 for calling a global function with example usage: img() and returns: images