code: def test_automatic_zmax_from_dtype():
      dtypes_dict = {
          np.uint8: 2**8 - 1,
          np.uint16: 2**16 - 1,
          float: 1,
          bool: 255,
      }
      for key, val in dtypes_dict.items():
          img = np.array([0, 1], dtype=key)
          img = np.dstack((img,) * 3)
          fig = px.imshow(img, binary_string=False)
          # For uint8 in "infer" mode we don't pass zmin/zmax unless specified
          if key in [np.uint8, bool]:
              assert fig.data[0]["zmax"] is None
          else:
              assert fig.data[0]["zmax"] == (val, val, val, 255)
  
imports: import plotly.express
  import numpy
  import pytest
  import xarray
  from PIL import Image
  from io import BytesIO
  import base64
  import datetime
  from plotly.express.imshow_utils import rescale_intensity
label_desc: Use image node_id 4 for calling a global function with example usage: test_automatic_zmax_from_dtype() without return types