code: def none(value,
           allow_empty = False,
           **kwargs):
      
      if value is not None and not value and allow_empty:
          pass
      elif (value is not None and not value) or value:
          raise errors.NotNoneError('value was not None')
  
      return None
docs: Validate that ``value`` is :obj:`None <python:None>`.
  
      :param value: The value to validate.
  
      :param allow_empty: If ``True``, returns :obj:`None <python:None>` if ``value``
        is empty but **not** :obj:`None <python:None>`. If  ``False``, raises a
        :class:`NotNoneError` if ``value`` is empty but **not**
        :obj:`None <python:None>`. Defaults to ``False``.
      :type allow_empty: :class:`bool <python:bool>`
  
      :returns: :obj:`None <python:None>`
  
      :raises NotNoneError: if ``allow_empty`` is ``False`` and ``value`` is empty
        but **not** :obj:`None <python:None>` and