code: def decode_image_string(image_string):
      """
      Converts image string to numpy array.
      """
      if "png" in image_string[:22]:
          return np.asarray(
              Image.open(BytesIO(base64.b64decode(image_string[22:])))
          )
      elif "jpeg" in image_string[:23]:
          return np.asarray(
              Image.open(BytesIO(base64.b64decode(image_string[23:])))
          )
      else:
          raise ValueError("image string format not recognized")
  
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 1 for calling a global function with example usage: decode_image_string(image_string) and returns: np, np