class_docstr: Constraint prepared from a user defined constraint.
  
  On creation it will check whether a constraint definition is valid and
  the initial point is feasible. If created successfully, it will contain
  the attributes listed below.
  
  Parameters
  ----------
  constraint : {NonlinearConstraint, LinearConstraint`, Bounds}
      Constraint to check and prepare.
  x0 : array_like
      Initial vector of independent variables.
  sparse_jacobian : bool or None, optional
      If bool, then the Jacobian of the constraint will be converted
      to the corresponded format if necessary. If None (default), such
      conversion is not made.
  finite_diff_bounds : 2-tuple, optional
      Lower and upper bounds on the independent variables for the finite
      difference approximation, if applicable. Defaults to no bounds.
  
  Attributes
  ----------
  fun : {VectorFunction, LinearVectorFunction, IdentityVectorFunction}
      Function defining the constraint wrapped by one of the convenience
      classes.
  bounds : 2-tuple
      Contains lower and upper bounds for the constraints --- lb and ub.
      These are converted to ndarray and have a size equal to the number of
      the constraints.
  keep_feasible : ndarray
       Array indicating which components must be kept feasible with a size
       equal to the number of the constraints.
class_docstr_tok: ["Constraint","prepared","from","a","user","defined","constraint",".","On","creation","it","will","check","whether","a","constraint","definition","is","valid","and","the","initial","point","is","feasible",".","If","created","successfully",",","it","will","contain","the","attributes","listed","below",".","Parameters","--","--","--","--","--","constraint",":","{","NonlinearConstraint",",","LinearConstraint","`",",","Bounds","}","Constraint","to","check","and","prepare",".","x0",":","array_like","Initial","vector","of","independent","variables",".","sparse_jacobian",":","bool","or","None",",","optional","If","bool",",","then","the","Jacobian","of","the","constraint","will","be","converted","to","the","corresponded","format","if","necessary",".","If","None","(","default",")",",","such","conversion","is","not","made",".","finite_diff_bounds",":","2-tuple",",","optional","Lower","and","upper","bounds","on","the","independent","variables","for","the","finite","difference","approximation",",","if","applicable",".","Defaults","to","no","bounds",".","Attributes","--","--","--","--","--","fun",":","{","VectorFunction",",","LinearVectorFunction",",","IdentityVectorFunction","}","Function","defining","the","constraint","wrapped","by","one","of","the","convenience","classes",".","bounds",":","2-tuple","Contains","lower","and","upper","bounds","for","the","constraints","--","-","lb","and","ub",".","These","are","converted","to","ndarray","and","have","a","size","equal","to","the","number","of","the","constraints",".","keep_feasible",":","ndarray","Array","indicating","which","components","must","be","kept","feasible","with","a","size","equal","to","the","number","of","the","constraints","."]
docstr: How much the constraint is exceeded by.
  
  Parameters
  ----------
  x : array-like
      Vector of independent variables
  
  Returns
  -------
  excess : array-like
      How much the constraint is exceeded by, for each of the
      constraints specified by `PreparedConstraint.fun`.
docstr_tok: ["How","much","the","constraint","is","exceeded","by",".","Parameters","--","--","--","--","--","x",":","array-like","Vector","of","independent","variables","Returns","--","--","--","-","excess",":","array-like","How","much","the","constraint","is","exceeded","by",",","for","each","of","the","constraints","specified","by","`","PreparedConstraint.fun","`","."]
code: def violation(self, x):
      """How much the constraint is exceeded by.
  
      Parameters
      ----------
      x : array-like
          Vector of independent variables
  
      Returns
      -------
      excess : array-like
          How much the constraint is exceeded by, for each of the
          constraints specified by `PreparedConstraint.fun`.
      """
      with catch_warnings():
          # Ignore the following warning, it's not important when
          # figuring out total violation
          # UserWarning: delta_grad == 0.0. Check if the approximated
          # function is linear
          filterwarnings("ignore", "delta_grad", UserWarning)
          ev = self.fun.fun(np.asarray(x))
  
      excess_lb = np.maximum(self.bounds[0] - ev, 0)
      excess_ub = np.maximum(ev - self.bounds[1], 0)
  
      return excess_lb + excess_ub
  
imports: import numpy
  from ._hessian_update_strategy import BFGS
  from ._differentiable_functions import VectorFunction, LinearVectorFunction, IdentityVectorFunction
  from ._optimize import OptimizeWarning
  from warnings import warn, catch_warnings, simplefilter, filterwarnings
  from scipy.sparse import issparse
label_desc: Use image node_id 2 for calling the PreparedConstraint obj's underlying member method code with example usage: obj.violation(x) and returns: unknown