code: def test_image_type(assets_path):
      class_labels = {1: "tree", 2: "car", 3: "road"}
      wb_type = data_types._ImageFileType()
      image_simple = data_types.Image(np.random.rand(10, 10))
      wb_type_simple = data_types._ImageFileType.from_obj(image_simple)
      im_path = assets_path("test.png")
      image_annotated = data_types.Image(
          np.random.rand(10, 10),
          boxes={
              "box_predictions": {
                  "box_data": [
                      {
                          "position": {
                              "minX": 0.1,
                              "maxX": 0.2,
                              "minY": 0.3,
                              "maxY": 0.4,
                          },
                          "class_id": 1,
                          "box_caption": "minMax(pixel)",
                          "scores": {"acc": 0.1, "loss": 1.2},
                      }
                  ],
                  "class_labels": class_labels,
              },
              "box_ground_truth": {
                  "box_data": [
                      {
                          "position": {
                              "minX": 0.1,
                              "maxX": 0.2,
                              "minY": 0.3,
                              "maxY": 0.4,
                          },
                          "class_id": 1,
                          "box_caption": "minMax(pixel)",
                          "scores": {"acc": 0.1, "loss": 1.2},
                      }
                  ],
                  "class_labels": class_labels,
              },
          },
          masks={
              "mask_predictions": {
                  "mask_data": np.random.randint(0, 4, size=(30, 30)),
                  "class_labels": class_labels,
              },
              "mask_ground_truth": {
                  "path": im_path,
                  "class_labels": class_labels,
              },
          },
      )
      wb_type_annotated = data_types._ImageFileType.from_obj(
          image_annotated
      )
      image_annotated_differently = data_types.Image(
          np.random.rand(10, 10),
          boxes={
              "box_predictions": {
                  "box_data": [
                      {
                          "position": {
                              "minX": 0.1,
                              "maxX": 0.2,
                              "minY": 0.3,
                              "maxY": 0.4,
                          },
                          "class_id": 1,
                          "box_caption": "minMax(pixel)",
                          "scores": {"acc": 0.1, "loss": 1.2},
                      }
                  ],
                  "class_labels": class_labels,
              },
          },
          masks={
              "mask_predictions": {
                  "mask_data": np.random.randint(0, 4, size=(30, 30)),
                  "class_labels": class_labels,
              },
              "mask_ground_truth_2": {
                  "path": im_path,
                  "class_labels": class_labels,
              },
          },
      )
      assert wb_type.assign(image_simple) == wb_type_simple
      assert wb_type.assign(image_annotated) == wb_type_annotated
      # OK to assign Images with disjoint class set
      assert wb_type_annotated.assign(image_simple) == wb_type_annotated
      # Merge when disjoint
      assert wb_type_annotated.assign(
          image_annotated_differently
      ) == data_types._ImageFileType(
          box_layers={
              "box_predictions": {1, 2, 3},
              "box_ground_truth": {1, 2, 3},
          },
          box_score_keys={"loss", "acc"},
          mask_layers={
              "mask_ground_truth_2": set(),
              "mask_ground_truth": set(),
              "mask_predictions": {1, 2, 3},
          },
          class_map={"1": "tree", "2": "car", "3": "road"},
      )
  
imports: import datetime
  import numpy
  import pytest
  import wandb
  from wandb import data_types
  from wandb.sdk.data_types._dtypes import AnyType, BooleanType, ConstType, InvalidType, ListType, NoneType, NumberType, OptionalType, StringType, TimestampType, TypedDictType, TypeRegistry, UnionType, UnknownType
label_desc: Use image node_id 16 for calling a global function with example usage: test_image_type(assets_path) without return types