A disciplinary action taken against a permit facility. The action may
         be applicable to one or more violations.

         >>> PCS().enforcement_action('ea_code', '09')
770570
def enforcement_action(self, column=None, value=None, **kwargs):
        
        return self._resolve_call('PCS_ENFOR_ACTION', column, value, **kwargs)
155473
def no_intersection(to_validate, constraint, violation_cfg):
    
    if len(constraint) == 0 or len(set(constraint).intersection(to_validate)) > 0:
        return None
    else:
        violation_cfg[Check.CFG_KEY_VIOLATION_MSG] = violation_cfg[Check.CFG_KEY_VIOLATION_MSG].format(constraint)
        return violation_cfg
836641
protected void violation(final Receiver<Void> receiver,
      final Set<ConstraintViolation<?>> errors) {
    this.reuse();
    Set<Throwable> causes = null;
    for (final AbstractRequest<?, ?> request : new ArrayList<>(this.state.invocations)) {
      try {
        request.onViolation(errors);
      } catch (final Throwable t) {
        if (causes == null) {
          causes = new HashSet<>();
        }
        causes.add(t);
      }
    }
    if (receiver != null) {
      try {
        receiver.onConstraintViolation(errors);
      } catch (final Throwable t) {
        if (causes == null) {
          causes = new HashSet<>();
        }
        causes.add(t);
      }
    }

    if (causes != null) {
      throw new UmbrellaException(causes);
    }
  }
772494
private AbstractRule processConstraint(RulesTextProvider textProvider)
    	throws ParserException
    {
    	log.debug("processConstraint");
        Constraint rule = new Constraint();
        int start = textProvider.getPos();
        LoadCommonRuleData(rule,textProvider);
        textProvider.addTOCElement(null, rule.getDescription(), start, textProvider.getPos(), TYPE_CONSTRAINT);
        exactOrError("{",textProvider);
        Expression condition = processAction(textProvider);
        if (condition.isAssign())
        {
            throw new ParserException("Found an assignment in a condition ",textProvider);
        }
        exactOrError("}",textProvider);
        rule.addCondition(condition);

        return rule;
    }
1018643
def get_one(cls, enforcement_id):
        

        qry = db.Enforcements.filter(enforcement_id == Enforcements.enforcement_id)
        return qry
633671
def _process_dupe_code_violation(self, lines, current_line, message):
        
        src_paths = []
        message_match = self.dupe_code_violation_regex.match(message)
        if message_match:
            for _ in range(int(message_match.group(1))):
                current_line += 1
                match = self.multi_line_violation_regex.match(
                    lines[current_line]
                )
                src_path, l_number = match.groups()
                src_paths.append(('%s.py' % src_path, l_number))
        return src_paths
747025
def compliance_rules_for_shipment(shipment_key)
      shipment = shipment_compliance_rules.select { |s| s[:key] == shipment_key }.first
      ShipmentCompliance.new(shipment)
    end
562678
def _has_desired_permit(permits, acategory, astatus):
    
    if permits is None:
        return False
    for permit in permits:
        if permit.category_code == acategory and\
           permit.status_code == astatus:
            return True
    return False
304884
protected void handleViolation(HttpComplianceSection section, String reason) {
        if (_complianceHandler != null)
            _complianceHandler.onComplianceViolation(_compliance, section, reason);
    }
1056108
def enforce(self, rule, target, creds, exc=None, *args, **kwargs):
        """"""

        self.load_rules()

        if isinstance(rule, checks.BaseCheck):
            result = rule(target, creds, self, rule)
        elif not self.rules:
            # No rules means we're going to fail closed.
            result = False
        else:
            try:
                # Evaluate the rule
                result = self.rules[rule](target, creds, self, rule)
            except KeyError:
                LOG.debug('Rule [%s] does not exist', rule)
                # If the rule doesn't exist, fail closed
                result = False

        if self.raise_error and not result:
            if exc:
                raise exc(*args, **kwargs)
            else:
                raise PolicyNotAuthorized(rule, target, creds)

        return result
1272160
def _validate_granttype(self, path, obj, _):
        
        errs = []

        if not obj.implicit and not obj.authorization_code:
            errs.append('Either implicit or authorization_code should be defined.')

        return path, obj.__class__.__name__, errs
416435
def enforce_csrf(self, request):
        
        reason = CSRFCheck().process_view(request, None, (), {})
        if reason:
            # CSRF failed, bail with explicit error message
            raise exceptions.PermissionDenied('CSRF Failed: %s' % reason)
645109
protected void processConstraintViolation(final Set<ConstraintViolation<Object>> violations,
            final SheetBindingErrors<?> errors) {
        
        for(ConstraintViolation<Object> violation : violations) {
            
            final String fieldName = violation.getPropertyPath().toString();
            final Optional<FieldError> fieldError = errors.getFirstFieldError(fieldName);
            
            if(fieldError.isPresent() && fieldError.get().isConversionFailure()) {
                // 型変換エラーが既存のエラーにある場合は、処理をスキップする。
                continue;
            }
            
            final ConstraintDescriptor<?> cd = violation.getConstraintDescriptor();
            
            /*
             * エラーメッセージのコードは、後から再変換できるよう、BeanValidationの形式のエラーコードも付けておく。
             */
            final String[] errorCodes = new String[]{
                    cd.getAnnotation().annotationType().getSimpleName(),
                    cd.getAnnotation().annotationType().getCanonicalName(),
                    cd.getAnnotation().annotationType().getCanonicalName() + ".message"
                    };
            
            final Map<String, Object> errorVars = createVariableForConstraint(cd);
            
            final String nestedPath = errors.buildFieldPath(fieldName);
            if(Utils.isEmpty(nestedPath)) {
                // オブジェクトエラーの場合
                errors.createGlobalError(errorCodes)
                    .variables(errorVars)
                    .defaultMessage(violation.getMessage())
                    .buildAndAddError();
                
            } else {
                // フィールドエラーの場合
                
                // 親のオブジェクトから、セルの座標を取得する
                final Object parentObj = violation.getLeafBean();
                final Path path = violation.getPropertyPath();
                Optional<CellPosition> cellAddress = Optional.empty();
                Optional<String> label = Optional.empty();
                if(path instanceof PathImpl) {
                    final PathImpl pathImpl = (PathImpl) path;
                    cellAddress = new PositionGetterFactory().create(parentObj.getClass(), pathImpl.getLeafNode().getName())
                            .map(getter -> getter.get(parentObj)).orElse(Optional.empty());
                    
                    label = new LabelGetterFactory().create(parentObj.getClass(), pathImpl.getLeafNode().getName())
                            .map(getter -> getter.get(parentObj)).orElse(Optional.empty());
                    
                }
                
                // フィールドフォーマッタ
                Class<?> fieldType = errors.getFieldType(nestedPath);
                if(fieldType != null) {
                    FieldFormatter<?> fieldFormatter = errors.findFieldFormatter(nestedPath, fieldType);
                    if(fieldFormatter != null) {
                        errorVars.putIfAbsent("fieldFormatter", fieldFormatter);
                    }
                }
                
                // 実際の値を取得する
                errorVars.putIfAbsent("validatedValue", violation.getInvalidValue());
                
                errors.createFieldError(fieldName, errorCodes)
                    .variables(errorVars)
                    .address(cellAddress)
                    .label(label)
                    .defaultMessage(violation.getMessage())
                    .buildAndAddError();
                
            }
            
        }
        
    }
454568
public PenaltyCause[] processOperands(INDArray... operands) {
        if (operands == null)
            return new PenaltyCause[] {NONE};

        List<PenaltyCause> causes = new ArrayList<>();
        for (int e = 0; e < operands.length - 1; e++) {
            if (operands[e] == null && operands[e + 1] == null)
                continue;

            PenaltyCause lc[] = processOperands(operands[e], operands[e + 1]);

            for (PenaltyCause cause : lc) {
                if (cause != NONE && !causes.contains(cause))
                    causes.add(cause);
            }
        }
        if (causes.isEmpty())
            causes.add(NONE);

        return causes.toArray(new PenaltyCause[0]);
    }
75837
def AgregarEmisor(self, tipo_cbte, pto_vta, nro_cbte, cod_caracter=None,
                      fecha_inicio_act=None, iibb=None, nro_ruca=None,
                      nro_renspa=None, cuit_autorizado=None, **kwargs):
        ""
        # cod_caracter y fecha_inicio_act no es requerido para ajustes
        d = {'tipoComprobante': tipo_cbte, 'puntoVenta': pto_vta,
             'nroComprobante': nro_cbte, 
             'codCaracter': cod_caracter,
             'fechaInicioActividades': fecha_inicio_act,
             'iibb': iibb,
             'nroRUCA': nro_ruca,
             'nroRenspa': nro_renspa,
             'cuitAutorizado': cuit_autorizado}
        self.solicitud['emisor'].update(d)
        return True
709630
public static void illegalCode(Class<?> destination, Class<?> source, String path, Throwable e){
		String additionalInformation = e.getMessage().split(",")[1];
		throw new IllegalCodeException(MSG.INSTANCE.message(illegalCodePath,destination.getSimpleName(),source.getSimpleName(),path,additionalInformation));
	}
1003128
@Override
    public boolean permit(ReqContext context, String operation, Map params) {
        if ("execute".equals(operation)) {
            return permitClientRequest(context, operation, params);
        } else if ("failRequest".equals(operation) || "fetchRequest".equals(operation) || "result".equals(operation)) {
            return permitInvocationRequest(context, operation, params);
        }
        // Deny unsupported operations.
        LOG.warn("Denying unsupported operation \"" + operation + "\" from " + context.remoteAddress());
        return false;
    }