code: def encode_leaf_node(value):
      
      validate_is_bytes(value)
      if value is None or value == b'':
          raise ValidationError("Value of leaf node can not be empty")
      return LEAF_TYPE_PREFIX + value
docs: Serializes a leaf node