def calc_cv(
        G: Optional[np.ndarray] = None, 
        H: Optional[np.ndarray] = None, 
        config: Optional[dict] = None,
    ) -> np.ndarray:
    """
    Calculate the constraint violation(s) for a set of inequality constraint(s), 
    equality constraint(s), and a scoring configuration.

    Parameters
    ----------
    G : np.ndarray, None
        A vector of inequality constraint(s).
    H : np.ndarray, None
        A vector of equality constraint(s).
    config : dict, None
        A dictionary of constraint violation scoring configuration settings.
    
    Returns
    -------
    out : np.ndarray
        An array of constraint violations for each objective.
    """
    if G is None:
        G = np.array([])

    if H is None:
        H = np.array([])

    if config is None:
        config = Individual.default_config()

    if G is None:
        ieq_cv = [0.0]
    elif G.ndim == 1:
        ieq_cv = constr_to_cv(G, **config["cv_ieq"])
    else:
        ieq_cv = [constr_to_cv(g, **config["cv_ieq"]) for g in G]

    if H is None:
        eq_cv = [0.0]
    elif H.ndim == 1:
        eq_cv = constr_to_cv(np.abs(H), **config["cv_eq"])
    else:
        eq_cv = [constr_to_cv(np.abs(h), **config["cv_eq"]) for h in H]

    return np.array(ieq_cv) + np.array(eq_cv)

    Calculate the constraint violation(s) for a set of inequality constraint(s), 
    equality constraint(s), and a scoring configuration.

    Parameters
    ----------
    G : np.ndarray, None
        A vector of inequality constraint(s).
    H : np.ndarray, None
        A vector of equality constraint(s).
    config : dict, None
        A dictionary of constraint violation scoring configuration settings.
    
    Returns
    -------
    out : np.ndarray
        An array of constraint violations for each objective.
    
pymoo/core/individual.py