6c2b0bc69e167dafec15ec3e66066be8ed41bf22,dino/validation/acl.py,AclValidator,is_acl_valid,#AclValidator#Any#Any#,169

Before Change


    }

    def is_acl_valid(self, acl_type, acl_value):
        validator = AclValidator.ACL_VALIDATORS.get(acl_type, None)
        if validator is None:
            return False
        if not callable(validator):
            return False

After Change


        all_acls = environ.env.config.get(ConfigKeys.ACL)
        all_validators = all_acls["validation"]

        if acl_type not in all_validators:
            logger.warn("acl type "%s" does not have a validator" % acl_type)
            return False

        validator_func = all_validators[acl_type]["value"]
        if not callable(validator_func):
            logger.error("validator for acl type "%s" is not callable" % acl_type)
            return False
        if not isinstance(validator_func, BaseAclValidator):
            logger.error(
                    "validator for acl type "%s" is not of instance BaseAclValidator but "%s"" %
                    (acl_type, str(type(validator_func))))
            return False

        // blank means we"re removing it
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: thenetcircle/dino
Commit Name: 6c2b0bc69e167dafec15ec3e66066be8ed41bf22
Time: 2016-11-02
Author: oscar.eriks@gmail.com
File Name: dino/validation/acl.py
Class Name: AclValidator
Method Name: is_acl_valid


Project Name: pantsbuild/pants
Commit Name: 1e3f7071cf4095abfface461164703106563c459
Time: 2016-02-22
Author: stuhood@gmail.com
File Name: src/python/pants/engine/exp/mapper.py
Class Name: AddressMapper
Method Name: resolve


Project Name: azavea/raster-vision
Commit Name: 221617f6e125bf6ab920bf7fc9b8c23c3aa9d147
Time: 2019-03-18
Author: lewfish@gmail.com
File Name: rastervision/data/label_source/chip_classification_label_source_config.py
Class Name: ChipClassificationLabelSourceConfigBuilder
Method Name: validate