@staticmethod
    def _required(field):
        """
            Determine whether field is required

            @param field: the Field or a Storage with field information
            @return: True if field is required, else False
        """

        required = False
        validators = field.requires
        if isinstance(validators, IS_EMPTY_OR):
            required = False
        else:
            required = field.required or field.notnull
        if not required and validators:
            if not isinstance(validators, (list, tuple)):
                validators = [validators]
            for v in validators:
                if hasattr(v, "options"):
                    if hasattr(v, "zero") and v.zero is None:
                        continue
                if hasattr(v, "mark_required"):
                    if v.mark_required:
                        required = True
                        break
                    else:
                        continue
                try:
                    val, error = v("")
                except __HOLE__:
                    # default validator takes no args
                    pass
                else:
                    if error:
                        required = True
                        break
        return required

# =============================================================================
dataset/ETHPy150Open sahana/eden/modules/s3/s3xforms.py/S3XFormsField._required