Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if mark < parse.constraintScores[constraint]:
containsLesserViolation = True
if containsGreaterViolation:
if containsLesserViolation:
return Bounding.unequal # contains both greater and lesser violations
else:
return Bounding.bounded # contains only greater violations
else:
if containsLesserViolation:
return Bounding.bounds # contains only lesser violations
else:
return Bounding.equal # contains neither greater nor lesser violations
#print str(mark)+"\t"+str(mark2)
if mark > parse.constraintScores[constraint]:
containsGreaterViolation = True
if mark < parse.constraintScores[constraint]:
containsLesserViolation = True
if containsGreaterViolation:
if containsLesserViolation:
return Bounding.unequal # contains both greater and lesser violations
else:
return Bounding.bounded # contains only greater violations
else:
if containsLesserViolation:
return Bounding.bounds # contains only lesser violations
else:
return Bounding.equal # contains neither greater nor lesser violations
#print str(mark)+"\t"+str(mark2)
if mark > parse.constraintScores[constraint]:
containsGreaterViolation = True
if mark < parse.constraintScores[constraint]:
containsLesserViolation = True
if containsGreaterViolation:
if containsLesserViolation:
return Bounding.unequal # contains both greater and lesser violations
else:
##logging.debug('Parse1: %s\nViols1: %s\n--bounds-->\nParse2: %s\nViols2: %s',parse,str([(k,v) for k,v in sorted(parse.constraintCounts.items()) if v]),self,str([(k,v) for k,v in sorted(self.constraintCounts.items()) if v]))
return Bounding.bounded # contains only greater violations
else:
if containsLesserViolation:
##logging.debug('Parse1: %s\nViols1: %s\n--bounds-->\nParse2: %s\nViols2: %s',self,str([(k,v) for k,v in sorted(self.constraintCounts.items()) if v]),parse,str([(k,v) for k,v in sorted(parse.constraintCounts.items()) if v]))
return Bounding.bounds # contains only lesser violations
else:
return Bounding.equal # contains neither greater nor lesser violations
for constraint in self.constraints:
mark = self.constraintScores[constraint]
mark2 = parse.constraintScores[constraint]
#print str(mark)+"\t"+str(mark2)
if mark > parse.constraintScores[constraint]:
containsGreaterViolation = True
if mark < parse.constraintScores[constraint]:
containsLesserViolation = True
if containsGreaterViolation:
if containsLesserViolation:
return Bounding.unequal # contains both greater and lesser violations
else:
return Bounding.bounded # contains only greater violations
else:
if containsLesserViolation:
return Bounding.bounds # contains only lesser violations
else:
return Bounding.equal # contains neither greater nor lesser violations
if containsGreaterViolation:
if containsLesserViolation:
return Bounding.unequal # contains both greater and lesser violations
else:
return Bounding.bounded # contains only greater violations
else:
if containsLesserViolation:
return Bounding.bounds # contains only lesser violations
else:
return Bounding.equal # contains neither greater nor lesser violations
if containsLesserViolation:
return Bounding.unequal # contains both greater and lesser violations
else:
##logging.debug('Parse1: %s\nViols1: %s\n--bounds-->\nParse2: %s\nViols2: %s',parse,str([(k,v) for k,v in sorted(parse.constraintCounts.items()) if v]),self,str([(k,v) for k,v in sorted(self.constraintCounts.items()) if v]))
return Bounding.bounded # contains only greater violations
else:
if containsLesserViolation:
##logging.debug('Parse1: %s\nViols1: %s\n--bounds-->\nParse2: %s\nViols2: %s',self,str([(k,v) for k,v in sorted(self.constraintCounts.items()) if v]),parse,str([(k,v) for k,v in sorted(parse.constraintCounts.items()) if v]))
return Bounding.bounds # contains only lesser violations
else:
return Bounding.equal # contains neither greater nor lesser violations
for constraint in self.constraints:
mark = self.constraintScores[constraint]
mark2 = parse.constraintScores[constraint]
#print str(mark)+"\t"+str(mark2)
if mark > parse.constraintScores[constraint]:
containsGreaterViolation = True
if mark < parse.constraintScores[constraint]:
containsLesserViolation = True
if containsGreaterViolation:
if containsLesserViolation:
return Bounding.unequal # contains both greater and lesser violations
else:
##logging.debug('Parse1: %s\nViols1: %s\n--bounds-->\nParse2: %s\nViols2: %s',parse,str([(k,v) for k,v in sorted(parse.constraintCounts.items()) if v]),self,str([(k,v) for k,v in sorted(self.constraintCounts.items()) if v]))
return Bounding.bounded # contains only greater violations
else:
if containsLesserViolation:
##logging.debug('Parse1: %s\nViols1: %s\n--bounds-->\nParse2: %s\nViols2: %s',self,str([(k,v) for k,v in sorted(self.constraintCounts.items()) if v]),parse,str([(k,v) for k,v in sorted(parse.constraintCounts.items()) if v]))
return Bounding.bounds # contains only lesser violations
else:
return Bounding.equal # contains neither greater nor lesser violations
containsLesserViolation = True
if containsGreaterViolation:
if containsLesserViolation:
return Bounding.unequal # contains both greater and lesser violations
else:
##logging.debug('Parse1: %s\nViols1: %s\n--bounds-->\nParse2: %s\nViols2: %s',parse,str([(k,v) for k,v in sorted(parse.constraintCounts.items()) if v]),self,str([(k,v) for k,v in sorted(self.constraintCounts.items()) if v]))
return Bounding.bounded # contains only greater violations
else:
if containsLesserViolation:
##logging.debug('Parse1: %s\nViols1: %s\n--bounds-->\nParse2: %s\nViols2: %s',self,str([(k,v) for k,v in sorted(self.constraintCounts.items()) if v]),parse,str([(k,v) for k,v in sorted(parse.constraintCounts.items()) if v]))
return Bounding.bounds # contains only lesser violations
else:
return Bounding.equal # contains neither greater nor lesser violations