Update constraint_lib.py

copied from dd