code: def is_optional(attr):
      
      return isinstance(attr.validator, _OptionalValidator) or (attr.default is not None and attr.default is not NOTHING)
docs: Helper method to find if an attribute is mandatory
  
      :param attr:
      :return: