def _validate_constraints(supported_constraints, model):
 message = u'Optimizer cannot handle {0} constraints.'
 if (any(six.itervalues(model.fixed)) and (u'fixed' not in supported_constraints)):
  raise UnsupportedConstraintError(message.format(u'fixed parameter'))
 if (any(six.itervalues(model.tied)) and (u'tied' not in supported_constraints)):
  raise UnsupportedConstraintError(message.format(u'tied parameter'))
 if (any(((tuple(b) != (None, None)) for b in six.itervalues(model.bounds))) and (u'bounds' not in supported_constraints)):
  raise UnsupportedConstraintError(message.format(u'bound parameter'))
 if (model.eqcons and (u'eqcons' not in supported_constraints)):
  raise UnsupportedConstraintError(message.format(u'equality'))
 if (model.ineqcons and (u'ineqcons' not in supported_constraints)):
  raise UnsupportedConstraintError(message.format(u'inequality'))

def _validate_constraints ( supported_constraints , model ) : message = u'Optimizer cannot handle {0} constraints.' if ( any ( six . itervalues ( model . fixed ) ) and ( u'fixed' not in supported_constraints ) ) : raise UnsupportedConstraintError ( message . format ( u'fixed parameter' ) ) if ( any ( six . itervalues ( model . tied ) ) and ( u'tied' not in supported_constraints ) ) : raise UnsupportedConstraintError ( message . format ( u'tied parameter' ) ) if ( any ( ( ( tuple ( b ) != ( None , None ) ) for b in six . itervalues ( model . bounds ) ) ) and ( u'bounds' not in supported_constraints ) ) : raise UnsupportedConstraintError ( message . format ( u'bound parameter' ) ) if ( model . eqcons and ( u'eqcons' not in supported_constraints ) ) : raise UnsupportedConstraintError ( message . format ( u'equality' ) ) if ( model . ineqcons and ( u'ineqcons' not in supported_constraints ) ) : raise UnsupportedConstraintError ( message . format ( u'inequality' ) )
make sure model constraints are supported by the current fitter .