def jenks_breaks(values, nb_class):
if not isinstance(values, Iterable) or isinstance(values, (str, bytes)):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if isinstance(nb_class, float) and int(nb_class) == nb_class:<EOL><INDENT>nb_class = int(nb_class)<EOL><DEDENT>if not isinstance(nb_class, int):<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>.format(type(nb_class)))<EOL><DEDENT>nb_values = len(values)<EOL>if np and isinstance(values, np.ndarray):<EOL><INDENT>values = values[np.argwhere(np.isfinite(values)).reshape(-<NUM_LIT:1>)]<EOL><DEDENT>else:<EOL><INDENT>values = [i for i in values if isfinite(i)]<EOL><DEDENT>if len(values) != nb_values:<EOL><INDENT>warnings.warn('<STR_LIT>')<EOL>nb_values = len(values)<EOL><DEDENT>if nb_class >= nb_values or nb_class < <NUM_LIT:2>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>return jenks._jenks_breaks(values, nb_class)<EOL>
Compute jenks natural breaks on a sequence of `values`, given `nb_class`,
the number of desired class.

Parameters
----------
values : array-like
    The Iterable sequence of numbers (integer/float) to be used.
nb_class : int
    The desired number of class (as some other functions requests
    a `k` value, `nb_class` is like `k` + 1). Have to be lesser than
    the length of `values` and greater than 2.

Returns
-------
breaks : tuple of floats
    The computed break values, including minimum and maximum, in order
    to have all the bounds for building `nb_class` class,
    so the returned tuple has a length of `nb_class` + 1.


Examples
--------
Using nb_class = 3, expecting 4 break values , including min and max :

>>> jenks_breaks(
        [1.3, 7.1, 7.3, 2.3, 3.9, 4.1, 7.8, 1.2, 4.3, 7.3, 5.0, 4.3],
        nb_class = 3)  # Should output (1.2, 2.3, 5.0, 7.8)