code: def test_insert_explicit_nulls():
      TestSchema = Unischema(
          "TestSchema",
          [
              UnischemaField(
                  "nullable",
                  np.int32,
                  (),
                  ScalarCodec(StringType()),
                  True,
              ),
              UnischemaField(
                  "not_nullable",
                  np.int32,
                  (),
                  ScalarCodec(ShortType()),
                  False,
              ),
          ],
      )
  
      # Insert_explicit_nulls to leave the dictionary as is.
      row_dict = {"nullable": 0, "not_nullable": 1}
      insert_explicit_nulls(TestSchema, row_dict)
      assert len(row_dict) == 2
      assert row_dict["nullable"] == 0
      assert row_dict["not_nullable"] == 1
  
      # Insert_explicit_nulls to leave the dictionary as is.
      row_dict = {"nullable": None, "not_nullable": 1}
      insert_explicit_nulls(TestSchema, row_dict)
      assert len(row_dict) == 2
      assert row_dict["nullable"] is None
      assert row_dict["not_nullable"] == 1
  
      # We are missing a nullable field here. insert_explicit_nulls should add a None entry.
      row_dict = {"not_nullable": 1}
      insert_explicit_nulls(TestSchema, row_dict)
      assert len(row_dict) == 2
      assert row_dict["nullable"] is None
      assert row_dict["not_nullable"] == 1
  
      # We are missing a not_nullable field here. Should raise an ValueError.
      row_dict = {"nullable": 0}
      with pytest.raises(ValueError):
          insert_explicit_nulls(TestSchema, row_dict)
  
imports: from __future__ import division
  from decimal import Decimal
  import numpy
  import pyarrow
  import pyarrow.parquet
  import pytest
  from pyspark import Row
  from pyspark.sql.types import StringType, IntegerType, DecimalType, ShortType, LongType
  from petastorm.codecs import ScalarCodec, NdarrayCodec
  from petastorm.unischema import Unischema, UnischemaField, dict_to_spark_row, insert_explicit_nulls, match_unischema_fields, _new_gt_255_compatible_namedtuple, _fullmatch
  from unittest import mock
label_desc: Use image node_id 11 for calling a global function with example usage: test_insert_explicit_nulls() without return types