Generalized restraints.py classes.