code: def test_encode_scalar_bool():
      codec = ScalarCodec(BooleanType())
      field = UnischemaField(
          name="field_bool",
          numpy_dtype=np.bool,
          shape=(),
          codec=codec,
          nullable=False,
      )
  
      encoded = codec.encode(field, np.bool_(True))
      assert isinstance(codec.encode(field, encoded), bool)
      assert encoded
  
      encoded = codec.encode(field, np.bool_(False))
      assert not encoded
  
file_path: petastorm/petastorm/tests/test_codec_scalar.py
imports: from decimal import Decimal
  import numpy
  import pytest
  from pyspark.sql.types import StringType, ByteType, ShortType, IntegerType, LongType, DecimalType, BooleanType, FloatType
  from petastorm.codecs import ScalarCodec
  from petastorm.unischema import UnischemaField
label_desc: Use image node_id 7 for calling a global function with example usage: test_encode_scalar_bool() without return types