index
int64
0
731k
package
stringlengths
2
98
name
stringlengths
1
76
docstring
stringlengths
0
281k
code
stringlengths
4
8.19k
signature
stringlengths
2
42.8k
embed_func_code
listlengths
768
768
4,791
optbinning.binning.multidimensional.binning_2d
_prebinning_matrices
null
def _prebinning_matrices(self, splits_x, splits_y, x_clean, y_clean, z_clean, x_missing, y_missing, z_missing, x_special, y_special, z_special): z0 = z_clean == 0 z1 = ~z0 # Compute n_nonevent and n_event for special and missing special_target_info = tar...
(self, splits_x, splits_y, x_clean, y_clean, z_clean, x_missing, y_missing, z_missing, x_special, y_special, z_special)
[ -0.007884339429438114, -0.011549824848771095, -0.02739417925477028, 0.036721065640449524, -0.0031996136531233788, -0.03836698457598686, -0.047220904380083084, 0.02580501325428486, -0.06390713900327682, -0.000551300763618201, -0.03698592633008957, 0.029229285195469856, -0.006058692000806332, ...
4,798
optbinning.binning.multidimensional.binning_2d
fit
Fit the optimal binning 2D according to the given training data. Parameters ---------- x : array-like, shape = (n_samples,) Training vector x, where n_samples is the number of samples. y : array-like, shape = (n_samples,) Training vector y, where n_samples is th...
def fit(self, x, y, z, check_input=False): """Fit the optimal binning 2D according to the given training data. Parameters ---------- x : array-like, shape = (n_samples,) Training vector x, where n_samples is the number of samples. y : array-like, shape = (n_samples,) Training vector ...
(self, x, y, z, check_input=False)
[ -0.004627235699445009, 0.007977068424224854, -0.012175525538623333, -0.0124524449929595, -0.025333669036626816, -0.02127813920378685, -0.06460264325141907, 0.027281038463115692, -0.01164848543703556, -0.007691216189414263, 0.0012193392030894756, -0.020527776330709457, -0.05213233083486557, ...
4,799
optbinning.binning.multidimensional.binning_2d
fit_transform
Fit the optimal binning 2D according to the given training data, then transform it. Parameters ---------- x : array-like, shape = (n_samples,) Training vector x, where n_samples is the number of samples. y : array-like, shape = (n_samples,) Training vect...
def fit_transform(self, x, y, z, metric="woe", metric_special=0, metric_missing=0, show_digits=2, check_input=False): """Fit the optimal binning 2D according to the given training data, then transform it. Parameters ---------- x : array-like, shape = (n_samples,) Training v...
(self, x, y, z, metric='woe', metric_special=0, metric_missing=0, show_digits=2, check_input=False)
[ -0.0027713519521057606, 0.02086988463997841, 0.029188521206378937, 0.0175534226000309, -0.007471198681741953, -0.056764617562294006, -0.04815281555056572, 0.004397517070174217, -0.018497057259082794, 0.012597054243087769, -0.026385104283690453, 0.001300932141020894, -0.014136185869574547, ...
4,808
optbinning.binning.multidimensional.binning_2d
transform
Transform given data to Weight of Evidence (WoE) or event rate using bins from the fitted optimal binning 2D. Parameters ---------- x : array-like, shape = (n_samples,) Training vector x, where n_samples is the number of samples. y : array-like, shape = (n_samples,)...
def transform(self, x, y, metric="woe", metric_special=0, metric_missing=0, show_digits=2, check_input=False): """Transform given data to Weight of Evidence (WoE) or event rate using bins from the fitted optimal binning 2D. Parameters ---------- x : array-like, shape = (n_samples,) ...
(self, x, y, metric='woe', metric_special=0, metric_missing=0, show_digits=2, check_input=False)
[ 0.0045403181575238705, -0.013824534602463245, 0.03730730339884758, 0.008834445849061012, -0.02246013469994068, -0.08302295953035355, -0.04431426152586937, 0.002653647679835558, -0.016106529161334038, 0.004360409453511238, -0.0041710324585437775, 0.0032312481198459864, 0.04719279333949089, ...
4,809
optbinning.binning.distributed.binning_sketch
OptimalBinningSketch
Optimal binning over data streams of a numerical or categorical variable with respect to a binary target. Parameters ---------- name : str, optional (default="") The variable name. dtype : str, optional (default="numerical") The variable data type. Supported data types are "numeric...
class OptimalBinningSketch(BaseSketch, BaseEstimator): """Optimal binning over data streams of a numerical or categorical variable with respect to a binary target. Parameters ---------- name : str, optional (default="") The variable name. dtype : str, optional (default="numerical") ...
(name='', dtype='numerical', sketch='gk', eps=0.0001, K=25, solver='cp', divergence='iv', max_n_prebins=20, min_n_bins=None, max_n_bins=None, min_bin_size=None, max_bin_size=None, min_bin_n_nonevent=None, max_bin_n_nonevent=None, min_bin_n_event=None, max_bin_n_event=None, monotonic_trend='auto', min_event_rate_diff=0,...
[ 0.02684129774570465, -0.029402337968349457, -0.05832820385694504, 0.031030286103487015, -0.010244163684546947, -0.039428118616342545, -0.07432974874973297, -0.0505061075091362, -0.04697227105498314, -0.06543558835983276, -0.0454634390771389, 0.0473296232521534, 0.001986543880775571, -0.008...
4,811
optbinning.binning.distributed.binning_sketch
__init__
null
def __init__(self, name="", dtype="numerical", sketch="gk", eps=1e-4, K=25, solver="cp", divergence="iv", max_n_prebins=20, min_n_bins=None, max_n_bins=None, min_bin_size=None, max_bin_size=None, min_bin_n_nonevent=None, max_bin_n_nonevent=None, min_bin_n_event=None, ...
(self, name='', dtype='numerical', sketch='gk', eps=0.0001, K=25, solver='cp', divergence='iv', max_n_prebins=20, min_n_bins=None, max_n_bins=None, min_bin_size=None, max_bin_size=None, min_bin_n_nonevent=None, max_bin_n_nonevent=None, min_bin_n_event=None, max_bin_n_event=None, monotonic_trend='auto', min_event_rate_d...
[ 0.03478506952524185, -0.022482575848698616, -0.05923980474472046, 0.04252343624830246, -0.03482263535261154, -0.05724886432290077, -0.09308575093746185, -0.03835373371839523, -0.045303236693143845, -0.06325924396514893, -0.055182795971632004, 0.04244830459356308, -0.009090699255466461, -0....
4,818
optbinning.binning.distributed.binning_sketch
_compute_cat_prebins
null
def _compute_cat_prebins(self, splits, categories, n_nonevent, n_event): self._n_refinements = 0 mask_remove = (n_nonevent == 0) | (n_event == 0) if self.cat_heuristic and len(categories) > self.max_n_prebins: n_records = n_nonevent + n_event mask_size = n_records < self._bsketch.n / self.ma...
(self, splits, categories, n_nonevent, n_event)
[ -0.07567933946847916, 0.03391086310148239, -0.048268210142850876, -0.016430383548140526, 0.003908439539372921, -0.04949935898184776, -0.012193788774311543, -0.010863062925636768, -0.013696512207388878, -0.06941497325897217, -0.040193334221839905, 0.055329203605651855, -0.020929502323269844, ...
4,819
optbinning.binning.distributed.binning_sketch
_compute_prebins
null
def _compute_prebins(self, splits): self._n_refinements = 0 n_event, n_nonevent = self._bsketch.bins(splits) mask_remove = (n_nonevent == 0) | (n_event == 0) if np.any(mask_remove): if self.divergence in ("hellinger", "triangular"): self._flag_min_n_event_nonevent = True else...
(self, splits)
[ -0.016894346103072166, 0.016957655549049377, -0.05097245052456856, 0.01219142321497202, -0.009668124839663506, -0.03744250163435936, 0.022031385451555252, -0.02429240569472313, -0.019300073385238647, -0.01892022043466568, -0.01809721067547798, 0.03773191198706627, -0.021452564746141434, -0...
4,820
optbinning.binning.distributed.binning_sketch
_fit_optimizer
null
def _fit_optimizer(self, splits, n_nonevent, n_event): if self.verbose: logger.info("Optimizer started.") time_init = time.perf_counter() if len(n_nonevent) <= 1: self._status = "OPTIMAL" self._splits_optimal = splits self._solution = np.zeros(len(splits)).astype(bool) ...
(self, splits, n_nonevent, n_event)
[ -0.0303324144333601, -0.005066440440714359, -0.04688940942287445, -0.004143979400396347, -0.04454304650425911, -0.06191369891166687, -0.06505479663610458, -0.04556484892964363, -0.08651266247034073, -0.030937928706407547, -0.05264178290963173, 0.034419625997543335, 0.007285078056156635, -0...
4,825
optbinning.binning.distributed.binning_sketch
_prebinning_data
null
def _prebinning_data(self): self._n_nonevent_missing = self._bsketch._count_missing_ne self._n_nonevent_special = self._bsketch._count_special_ne self._n_event_missing = self._bsketch._count_missing_e self._n_event_special = self._bsketch._count_special_e self._t_n_nonevent = self._bsketch.n_noneven...
(self)
[ -0.035076629370450974, -0.01008521020412445, -0.07720838487148285, 0.027804426848888397, -0.019754348322749138, -0.026031600311398506, -0.0082626361399889, -0.026140140369534492, -0.02168998494744301, -0.037374068051576614, -0.04565931856632233, 0.03205559030175209, -0.01751117967069149, -...
4,828
optbinning.binning.distributed.binning_sketch
_update_streaming_stats
null
def _update_streaming_stats(self): self._binning_table.build() if self.divergence == "iv": dv = self._binning_table.iv elif self.divergence == "js": dv = self._binning_table.js elif self.divergence == "hellinger": dv = self._binning_table.hellinger elif self.divergence == "tr...
(self)
[ -0.005368589423596859, -0.03584888577461243, -0.10009709000587463, 0.004682214464992285, -0.029186241328716278, 0.0036592097021639347, -0.054490309208631516, 0.0029772063717246056, -0.038227155804634094, -0.007982934825122356, -0.06361865997314453, -0.0053554740734398365, -0.0309524536132812...
4,831
optbinning.binning.distributed.binning_sketch
add
Add new data x, y to the binning sketch. Parameters ---------- x : array-like, shape = (n_samples,) Training vector, where n_samples is the number of samples. y : array-like, shape = (n_samples,) Target vector relative to x. check_input : bool (default=...
def add(self, x, y, check_input=False): """Add new data x, y to the binning sketch. Parameters ---------- x : array-like, shape = (n_samples,) Training vector, where n_samples is the number of samples. y : array-like, shape = (n_samples,) Target vector relative to x. check_input ...
(self, x, y, check_input=False)
[ -0.03539695218205452, -0.028615789487957954, -0.06632046401500702, 0.06340917944908142, -0.033319998532533646, -0.01920737326145172, -0.09706646203994751, 0.06411924958229065, 0.01081080362200737, -0.023183761164546013, -0.0013358177384361625, -0.0019981791265308857, 0.008764917030930519, ...
4,834
optbinning.binning.distributed.binning_sketch
information
Print overview information about the options settings, problem statistics, and the solution of the computation. Parameters ---------- print_level : int (default=1) Level of details.
def information(self, print_level=1): """Print overview information about the options settings, problem statistics, and the solution of the computation. Parameters ---------- print_level : int (default=1) Level of details. """ self._check_is_solved() if not isinstance(print_level...
(self, print_level=1)
[ 0.018262283876538277, -0.012360502034425735, -0.009890198707580566, 0.01705857180058956, 0.027721300721168518, -0.043118029832839966, -0.06331164389848709, -0.08422388881444931, -0.0649285688996315, -0.03966858983039856, -0.046064428985118866, -0.0010431419359520078, -0.02146918699145317, ...
4,835
optbinning.binning.distributed.binning_sketch
merge
Merge current instance with another OptimalBinningSketch instance. Parameters ---------- optbsketch : object OptimalBinningSketch instance.
def merge(self, optbsketch): """Merge current instance with another OptimalBinningSketch instance. Parameters ---------- optbsketch : object OptimalBinningSketch instance. """ if not self.mergeable(optbsketch): raise Exception("optbsketch does not share signature.") self._bsk...
(self, optbsketch)
[ -0.016024015843868256, -0.07750498503446579, -0.03194272518157959, 0.09610898792743683, -0.09821510314941406, -0.06198994815349579, -0.06581605225801468, 0.0074547650292515755, -0.020675016567111015, 0.003701056120917201, -0.00986363273113966, -0.04324553534388542, -0.02167542092502117, 0....
4,836
optbinning.binning.distributed.binning_sketch
mergeable
Check whether two OptimalBinningSketch instances can be merged. Parameters ---------- optbsketch : object OptimalBinningSketch instance. Returns ------- mergeable : bool
def mergeable(self, optbsketch): """Check whether two OptimalBinningSketch instances can be merged. Parameters ---------- optbsketch : object OptimalBinningSketch instance. Returns ------- mergeable : bool """ return self.get_params() == optbsketch.get_params()
(self, optbsketch)
[ 0.028615934774279594, -0.058924492448568344, -0.03468117117881775, 0.08251544833183289, -0.06312078982591629, -0.038895104080438614, -0.04552454873919487, -0.008925950154662132, -0.03952983766794205, 0.012536000460386276, 0.006188658531755209, -0.029056722298264503, 0.013708495534956455, 0...
4,837
optbinning.binning.distributed.binning_sketch
plot_progress
Plot divergence measure progress.
def plot_progress(self): """Plot divergence measure progress.""" self._check_is_solved() df = pd.DataFrame.from_dict(self._solve_stats).T plot_progress_divergence(df, self.divergence)
(self)
[ 0.04126972705125809, 0.02598719298839569, -0.0384816974401474, 0.05083852261304855, 0.012752655893564224, 0.014052015729248524, 0.005610480438917875, -0.03244096785783768, -0.00007757973071420565, 0.008592123165726662, 0.02913663536310196, -0.022614020854234695, 0.031563252210617065, -0.06...
4,840
optbinning.binning.distributed.binning_sketch
solve
Solve optimal binning using added data. Returns ------- self : OptimalBinningSketch Current fitted optimal binning.
def solve(self): """Solve optimal binning using added data. Returns ------- self : OptimalBinningSketch Current fitted optimal binning. """ time_init = time.perf_counter() # Check if data was added if not self._n_add: raise NotFittedError("No data was added. Add data befo...
(self)
[ 0.00857535656541586, -0.07021445035934448, -0.07662422209978104, 0.0388248935341835, -0.05999544635415077, -0.04105915501713753, -0.0714964047074318, -0.04248761758208275, -0.037799328565597534, -0.054611239582300186, -0.04823809489607811, -0.0012510496890172362, -0.03177414461970329, -0.0...
4,841
optbinning.binning.distributed.binning_sketch
transform
Transform given data to Weight of Evidence (WoE) or event rate using bins from the current fitted optimal binning. Parameters ---------- x : array-like, shape = (n_samples,) Training vector, where n_samples is the number of samples. metric : str (default="woe") ...
def transform(self, x, metric="woe", metric_special=0, metric_missing=0, show_digits=2, check_input=False): """Transform given data to Weight of Evidence (WoE) or event rate using bins from the current fitted optimal binning. Parameters ---------- x : array-like, shape = (n_samples,) ...
(self, x, metric='woe', metric_special=0, metric_missing=0, show_digits=2, check_input=False)
[ 0.0024237027391791344, -0.012558765709400177, 0.023560430854558945, 0.014366116374731064, -0.009611395187675953, -0.07711360603570938, -0.03731482848525047, -0.016321761533617973, 0.008647475391626358, 0.004673622082918882, -0.008267467841506004, 0.007627944462001324, 0.06017085537314415, ...
4,842
optbinning.binning.piecewise.binning
OptimalPWBinning
Optimal Piecewise binning of a numerical variable with respect to a binary target. Parameters ---------- name : str, optional (default="") The variable name. estimator : object or None (default=None) An esimator to compute probability estimates. If None, it uses `sklearn.li...
class OptimalPWBinning(BasePWBinning): """Optimal Piecewise binning of a numerical variable with respect to a binary target. Parameters ---------- name : str, optional (default="") The variable name. estimator : object or None (default=None) An esimator to compute probability e...
(name='', estimator=None, objective='l2', degree=1, continuous=True, continuous_deriv=True, prebinning_method='cart', max_n_prebins=20, min_prebin_size=0.05, min_n_bins=None, max_n_bins=None, min_bin_size=None, max_bin_size=None, monotonic_trend='auto', n_subsamples=None, max_pvalue=None, max_pvalue_policy='consecutive...
[ 0.04436391964554787, -0.01798594370484352, -0.03818586468696594, 0.0067262789234519005, -0.009999805130064487, -0.06258180737495422, -0.08004061132669449, -0.04246622323989868, -0.05541272833943367, -0.04811714217066765, -0.007385201286524534, 0.03458024188876152, 0.025871925055980682, -0....
4,844
optbinning.binning.piecewise.binning
__init__
null
def __init__(self, name="", estimator=None, objective="l2", degree=1, continuous=True, continuous_deriv=True, prebinning_method="cart", max_n_prebins=20, min_prebin_size=0.05, min_n_bins=None, max_n_bins=None, min_bin_size=None, max_bin_size=None, monotonic_trend="aut...
(self, name='', estimator=None, objective='l2', degree=1, continuous=True, continuous_deriv=True, prebinning_method='cart', max_n_prebins=20, min_prebin_size=0.05, min_n_bins=None, max_n_bins=None, min_bin_size=None, max_bin_size=None, monotonic_trend='auto', n_subsamples=None, max_pvalue=None, max_pvalue_policy='conse...
[ 0.019824514165520668, -0.001925810007378459, -0.02354397065937519, 0.02986893616616726, -0.030019979923963547, -0.07148153334856033, -0.06589291244745255, -0.053998202085494995, -0.0693669244647026, -0.02265658788383007, -0.02067413739860058, 0.06192800775170326, -0.01372611615806818, 0.01...
4,851
optbinning.binning.piecewise.binning
_fit
null
def _fit(self, x, y, lb, ub, check_input): time_init = time.perf_counter() if self.verbose: logger.info("Optimal piecewise binning started.") logger.info("Options: check parameters.") _check_parameters(**self.get_params(deep=False), problem_type=self._problem_type) ...
(self, x, y, lb, ub, check_input)
[ -0.026450715959072113, -0.030845968052744865, -0.05626716464757919, 0.030568789690732956, -0.05824700742959976, -0.0680670365691185, -0.07000727951526642, -0.02118433080613613, -0.06169193610548973, -0.04312100261449814, -0.03173689916729927, 0.024668855592608452, 0.02734164521098137, -0.0...
4,863
optbinning.binning.piecewise.binning
fit_transform
Fit the optimal piecewise binning according to the given training data, then transform it. Parameters ---------- x : array-like, shape = (n_samples,) Training vector, where n_samples is the number of samples. y : array-like, shape = (n_samples,) Target v...
def fit_transform(self, x, y, metric="woe", metric_special=0, metric_missing=0, lb=None, ub=None, check_input=False): """Fit the optimal piecewise binning according to the given training data, then transform it. Parameters ---------- x : array-like, shape = (n_samples,) Tra...
(self, x, y, metric='woe', metric_special=0, metric_missing=0, lb=None, ub=None, check_input=False)
[ -0.006335424259305, -0.017682120203971863, 0.002257078420370817, 0.02535953000187874, -0.034115880727767944, -0.06445101648569107, -0.026982396841049194, -0.005073689389973879, -0.022238630801439285, 0.0030629390385001898, -0.007570408284664154, -0.023593993857502937, 0.030691808089613914, ...
4,869
sklearn.utils._metadata_requests
set_transform_request
Request metadata passed to the ``transform`` method. Note that this method is only relevant if ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`). Please see :ref:`User Guide <metadata_routing>` on how the routing mechanism works. The options for each par...
def __get__(self, instance, owner): # we would want to have a method which accepts only the expected args def func(**kw): """Updates the request for provided parameters This docstring is overwritten below. See REQUESTER_DOC for expected functionality """ if not _routing_e...
(self: optbinning.binning.piecewise.binning.OptimalPWBinning, *, check_input: Union[bool, NoneType, str] = '$UNCHANGED$', lb: Union[bool, NoneType, str] = '$UNCHANGED$', metric: Union[bool, NoneType, str] = '$UNCHANGED$', metric_missing: Union[bool, NoneType, str] = '$UNCHANGED$', metric_special: Union[bool, NoneType, ...
[ 0.04379432275891304, -0.0583290159702301, -0.019072027876973152, 0.00474898237735033, -0.0030296463519334793, -0.017302753403782845, -0.011557363905012608, 0.010016381740570068, 0.05707339942455292, 0.01092955656349659, -0.021440574899315834, 0.006496855523437262, 0.051366060972213745, -0....
4,870
optbinning.binning.piecewise.binning
transform
Transform given data to Weight of Evidence (WoE) or event rate using bins from the fitted optimal piecewise binning. Parameters ---------- x : array-like, shape = (n_samples,) Training vector, where n_samples is the number of samples. metric : str (default="woe") ...
def transform(self, x, metric="woe", metric_special=0, metric_missing=0, lb=None, ub=None, check_input=False): """Transform given data to Weight of Evidence (WoE) or event rate using bins from the fitted optimal piecewise binning. Parameters ---------- x : array-like, shape = (n_sample...
(self, x, metric='woe', metric_special=0, metric_missing=0, lb=None, ub=None, check_input=False)
[ -0.006162506062537432, -0.01750151813030243, 0.0058794873766601086, 0.02079731784760952, -0.03047473356127739, -0.08684112131595612, -0.03801581636071205, -0.02141813188791275, -0.01470784842967987, -0.00633596908301115, -0.004555689636617899, 0.0018989648669958115, 0.05255020037293434, -0...
4,871
optbinning.binning.uncertainty.binning_scenarios
SBOptimalBinning
Scenario-based stochastic optimal binning of a numerical variable with respect to a binary target. Extensive form of the stochastic optimal binning given a finite number of scenarios. The goal is to maximize the expected IV obtaining a solution feasible for all scenarios. Parameters ----------...
class SBOptimalBinning(OptimalBinning): """Scenario-based stochastic optimal binning of a numerical variable with respect to a binary target. Extensive form of the stochastic optimal binning given a finite number of scenarios. The goal is to maximize the expected IV obtaining a solution feasible fo...
(name='', prebinning_method='cart', max_n_prebins=20, min_prebin_size=0.05, min_n_bins=None, max_n_bins=None, min_bin_size=None, max_bin_size=None, monotonic_trend=None, min_event_rate_diff=0, max_pvalue=None, max_pvalue_policy='consecutive', class_weight=None, user_splits=None, user_splits_fixed=None, special_codes=No...
[ 0.03190378472208977, -0.04288378730416298, -0.06316989660263062, 0.0003300477401353419, -0.035809557884931564, -0.05926411971449852, -0.09198492765426636, -0.022657467052340508, -0.03969540446996689, -0.06436553597450256, -0.04910114035010338, 0.05093446373939514, 0.02243826538324356, -0.0...
4,873
optbinning.binning.uncertainty.binning_scenarios
__init__
null
def __init__(self, name="", prebinning_method="cart", max_n_prebins=20, min_prebin_size=0.05, min_n_bins=None, max_n_bins=None, min_bin_size=None, max_bin_size=None, monotonic_trend=None, min_event_rate_diff=0, max_pvalue=None, max_pvalue_policy="consecutive", class_w...
(self, name='', prebinning_method='cart', max_n_prebins=20, min_prebin_size=0.05, min_n_bins=None, max_n_bins=None, min_bin_size=None, max_bin_size=None, monotonic_trend=None, min_event_rate_diff=0, max_pvalue=None, max_pvalue_policy='consecutive', class_weight=None, user_splits=None, user_splits_fixed=None, special_co...
[ 0.019438665360212326, -0.0140884043648839, -0.040765658020973206, 0.004288076888769865, -0.03080565668642521, -0.057057108730077744, -0.09026946127414703, -0.05042945221066475, -0.028972867876291275, -0.05416908115148544, -0.03545242175459862, 0.06375882029533386, -0.00392707297578454, -0....
4,880
optbinning.binning.uncertainty.binning_scenarios
_compute_prebins
null
def _compute_prebins(self, splits_prebinning, x, y): n_splits = len(splits_prebinning) if not n_splits: return splits_prebinning, np.array([]), np.array([]) n_bins = n_splits + 1 n_nonevent = np.empty((n_bins, self._n_scenarios), dtype=np.int64) n_event = np.empty((n_bins, self._n_scenarios)...
(self, splits_prebinning, x, y)
[ -0.010432052426040173, 0.009144258685410023, -0.07382112741470337, 0.010256023146212101, -0.012303521856665611, -0.04161703214049339, -0.015157048590481281, 0.017538076266646385, 0.00013860859326086938, -0.03285262733697891, 0.0083891861140728, 0.03809644654393196, -0.01443440280854702, -0...
4,881
optbinning.binning.uncertainty.binning_scenarios
_fit
null
def _fit(self, X, Y, weights, check_input): time_init = time.perf_counter() # Check parameters and input arrays _check_parameters(**self.get_params()) _check_X_Y_weights(X, Y, weights) self._n_scenarios = len(X) if self.verbose: logger.info("Optimal binning started.") logger.info...
(self, X, Y, weights, check_input)
[ -0.0015359681565314531, -0.022906066849827766, -0.06941702961921692, 0.01875191554427147, -0.04852980002760887, -0.06545699387788773, -0.07877357304096222, -0.022789593786001205, -0.03150554746389389, -0.03364085778594017, -0.04049326479434967, 0.01731543242931366, 0.025623735040426254, -0...
4,882
optbinning.binning.uncertainty.binning_scenarios
_fit_optimizer
null
def _fit_optimizer(self, splits, n_nonevent, n_event, weights): time_init = time.perf_counter() if not len(n_nonevent): self._status = "OPTIMAL" self._splits_optimal = splits self._solution = np.zeros(len(splits), dtype=bool) if self.verbose: logger.warning("Optimizer...
(self, splits, n_nonevent, n_event, weights)
[ -0.02867705002427101, -0.03487992286682129, -0.04505622759461403, -0.022707907482981682, -0.06084208935499191, -0.05163666605949402, -0.05426165089011192, -0.03437650203704834, -0.08450290560722351, -0.0047869994305074215, -0.04397746920585632, 0.04814867675304413, -0.008796392939984798, -...
4,883
optbinning.binning.uncertainty.binning_scenarios
_fit_prebinning
null
def _fit_prebinning(self, weights, x_clean, y_clean, y_missing, y_special, class_weight=None): x = [] y = [] for s in range(self._n_scenarios): x.extend(x_clean[s]) y.extend(y_clean[s]) x = np.array(x) y = np.array(y) min_bin_size = int(np.ceil(self.min_prebin...
(self, weights, x_clean, y_clean, y_missing, y_special, class_weight=None)
[ 0.010571414604783058, -0.03320910409092903, -0.023291127756237984, -0.017642894759774208, -0.02816060185432434, -0.029306361451745033, -0.011135343462228775, -0.008919911459088326, 0.026710500940680504, 0.013346299529075623, -0.005035072565078735, 0.0036453926004469395, 0.010043291375041008,...
4,888
optbinning.binning.uncertainty.binning_scenarios
_prebinning_refinement
null
def _prebinning_refinement(self, splits_prebinning, x, y, y_missing, y_special): self._n_nonevent_special = [] self._n_event_special = [] self._n_nonevent_missing = [] self._n_event_missing = [] for s in range(self._n_scenarios): s_n_nonevent, s_n_event = target_in...
(self, splits_prebinning, x, y, y_missing, y_special)
[ 0.01889748126268387, -0.031000563874840736, -0.049608152359724045, 0.013036181218922138, -0.042795635759830475, -0.052325908094644547, 0.008583586663007736, -0.004420887213200331, -0.012266149744391441, -0.026996400207281113, 0.002285182010382414, 0.005236214492470026, -0.024550417438149452,...
4,893
optbinning.binning.uncertainty.binning_scenarios
binning_table_scenario
Return the instantiated binning table corresponding to ``scenario_id``. Please refer to :ref:`Binning table: binary target`. Parameters ---------- scenario_id : int Scenario identifier. Returns ------- binning_table : BinningTable
def binning_table_scenario(self, scenario_id): """Return the instantiated binning table corresponding to ``scenario_id``. Please refer to :ref:`Binning table: binary target`. Parameters ---------- scenario_id : int Scenario identifier. Returns ------- binning_table : BinningTable...
(self, scenario_id)
[ 0.01358066312968731, -0.02497934363782406, -0.026515459641814232, -0.07827209681272507, -0.06511037796735764, -0.030722321942448616, -0.017167843878269196, 0.062317438423633575, -0.06455178558826447, -0.035138655453920364, -0.09593743085861206, 0.04322072118520737, -0.07073116302490234, -0...
4,894
optbinning.binning.uncertainty.binning_scenarios
fit
Fit the optimal binning given a list of scenarios. Parameters ---------- X : array-like, shape = (n_scenarios,) Lit of training vectors, where n_scenarios is the number of scenarios. Y : array-like, shape = (n_scenarios,) List of target vectors relat...
def fit(self, X, Y, weights=None, check_input=False): """Fit the optimal binning given a list of scenarios. Parameters ---------- X : array-like, shape = (n_scenarios,) Lit of training vectors, where n_scenarios is the number of scenarios. Y : array-like, shape = (n_scenarios,) ...
(self, X, Y, weights=None, check_input=False)
[ 0.02259211614727974, -0.062459517270326614, -0.06676951050758362, -0.0692424550652504, -0.08386815339326859, -0.02974599227309227, -0.02898644469678402, 0.014263591729104519, -0.005493470001965761, 0.04200473427772522, -0.02441149763762951, 0.002183698583394289, 0.010112578049302101, -0.04...
4,895
optbinning.binning.uncertainty.binning_scenarios
fit_transform
Fit the optimal binning given a list of scenarios, then transform it. Parameters ---------- x : array-like, shape = (n_samples,) Training vector, where n_samples is the number of samples. X : array-like, shape = (n_scenarios,) Lit of training vectors, wh...
def fit_transform(self, x, X, Y, weights=None, metric="woe", metric_special=0, metric_missing=0, show_digits=2, check_input=False): """Fit the optimal binning given a list of scenarios, then transform it. Parameters ---------- x : array-like, shape = (n_samples,) ...
(self, x, X, Y, weights=None, metric='woe', metric_special=0, metric_missing=0, show_digits=2, check_input=False)
[ 0.019463742151856422, -0.0416502021253109, 0.0015234793536365032, -0.019022220745682716, -0.04418895021080971, -0.052725035697221756, -0.03695903345942497, -0.0005898452363908291, -0.0023777775932103395, 0.03313251584768295, -0.03131123632192612, 0.00914777535945177, 0.039516180753707886, ...
4,900
sklearn.utils._metadata_requests
set_fit_request
Request metadata passed to the ``fit`` method. Note that this method is only relevant if ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`). Please see :ref:`User Guide <metadata_routing>` on how the routing mechanism works. The options for each parameter...
def __get__(self, instance, owner): # we would want to have a method which accepts only the expected args def func(**kw): """Updates the request for provided parameters This docstring is overwritten below. See REQUESTER_DOC for expected functionality """ if not _routing_e...
(self: optbinning.binning.uncertainty.binning_scenarios.SBOptimalBinning, *, check_input: Union[bool, NoneType, str] = '$UNCHANGED$', weights: Union[bool, NoneType, str] = '$UNCHANGED$') -> optbinning.binning.uncertainty.binning_scenarios.SBOptimalBinning
[ 0.04383700713515282, -0.05829713121056557, -0.019093072041869164, 0.004713810048997402, -0.0029419693164527416, -0.017276043072342873, -0.011530046351253986, 0.010045981034636497, 0.05700333043932915, 0.010883145965635777, -0.021461868658661842, 0.006516568828374147, 0.051295388489961624, ...
4,904
optbinning.binning.uncertainty.binning_scenarios
transform
Transform given data to Weight of Evidence (WoE) or event rate using bins from the fitted optimal binning. Parameters ---------- x : array-like, shape = (n_samples,) Training vector, where n_samples is the number of samples. metric : str (default="woe") ...
def transform(self, x, metric="woe", metric_special=0, metric_missing=0, show_digits=2, check_input=False): """Transform given data to Weight of Evidence (WoE) or event rate using bins from the fitted optimal binning. Parameters ---------- x : array-like, shape = (n_samples,) T...
(self, x, metric='woe', metric_special=0, metric_missing=0, show_digits=2, check_input=False)
[ 0.002805061172693968, -0.010776976123452187, 0.021738646551966667, 0.012032904662191868, -0.009451786987483501, -0.0774981826543808, -0.037807147949934006, -0.014904918149113655, 0.007775675971060991, 0.004037903156131506, -0.008676066063344479, 0.008371318690478802, 0.06050620973110199, -...
4,905
optbinning.scorecard.scorecard
Scorecard
Scorecard development given a binary or continuous target dtype. Parameters ---------- binning_process : object A ``BinningProcess`` instance. estimator : object A supervised learning estimator with a ``fit`` and ``predict`` method that provides information about feature coeffi...
class Scorecard(Base, BaseEstimator): """Scorecard development given a binary or continuous target dtype. Parameters ---------- binning_process : object A ``BinningProcess`` instance. estimator : object A supervised learning estimator with a ``fit`` and ``predict`` method t...
(binning_process, estimator, scaling_method=None, scaling_method_params=None, intercept_based=False, reverse_scorecard=False, rounding=False, verbose=False)
[ 0.011749513447284698, -0.015034873969852924, -0.05625028535723686, 0.013018624857068062, 0.012772990390658379, -0.05997573956847191, -0.05674155429005623, 0.018504461273550987, 0.01026547234505415, -0.02814561128616333, -0.04220818355679512, 0.03281266614794731, 0.03254656121134758, 0.0444...
4,907
optbinning.scorecard.scorecard
__init__
null
def __init__(self, binning_process, estimator, scaling_method=None, scaling_method_params=None, intercept_based=False, reverse_scorecard=False, rounding=False, verbose=False): self.binning_process = binning_process self.estimator = estimator self.scaling_method = scaling_method ...
(self, binning_process, estimator, scaling_method=None, scaling_method_params=None, intercept_based=False, reverse_scorecard=False, rounding=False, verbose=False)
[ 0.028398629277944565, -0.02436797507107258, -0.010647185146808624, 0.024110306054353714, -0.032153211534023285, -0.049214474856853485, -0.05510401353240013, 0.010785221122205257, -0.047852516174316406, 0.004053660202771425, -0.027754459530115128, 0.10336143523454666, 0.0031426220666617155, ...
4,914
optbinning.scorecard.scorecard
_fit
null
def _fit(self, X, y, sample_weight, metric_special, metric_missing, show_digits, check_input): # Store the metrics for missing and special bins for predictions self._metric_special = metric_special self._metric_missing = metric_missing time_init = time.perf_counter() if self.verbose: ...
(self, X, y, sample_weight, metric_special, metric_missing, show_digits, check_input)
[ -0.006374640855938196, -0.022126853466033936, -0.03972297161817551, 0.0008370009018108249, -0.03767887130379677, -0.05474815517663956, -0.0533573254942894, 0.01836528815329075, -0.016869090497493744, -0.03430715948343277, -0.05723479390144348, 0.051081422716379166, 0.02035670541226864, 0.0...
4,921
optbinning.scorecard.scorecard
_transform
null
def _transform(self, X, metric, metric_special, metric_missing): self._check_is_fitted() X_t = self.binning_process_.transform( X=X[self.binning_process_.variable_names], metric=metric, metric_special=metric_special, metric_missing=metric_missing) return X_t
(self, X, metric, metric_special, metric_missing)
[ 0.0018621019553393126, -0.021981779485940933, 0.019336959347128868, 0.04935828968882561, -0.011577654629945755, -0.021578926593065262, -0.0186013150960207, -0.015474822372198105, 0.04011017829179764, 0.00038506428245455027, 0.004746663384139538, 0.007991383783519268, 0.04186171665787697, -...
4,924
optbinning.scorecard.scorecard
decision_function
Predict confidence scores for samples. The confidence score for a sample is proportional to the signed distance of that sample to the hyperplane. Parameters ---------- X : pandas.DataFrame (n_samples, n_features) The data matrix for which we want to get the confidenc...
def decision_function(self, X): """Predict confidence scores for samples. The confidence score for a sample is proportional to the signed distance of that sample to the hyperplane. Parameters ---------- X : pandas.DataFrame (n_samples, n_features) The data matrix for which we want to get...
(self, X)
[ -0.0051068710163235664, -0.017482902854681015, 0.04222617670893669, -0.026123272255063057, 0.06360296159982681, -0.021763533353805542, -0.005256297532469034, 0.02389066480100155, 0.06592346727848053, 0.048625148832798004, -0.006851645652204752, 0.016498446464538574, 0.04117140173912048, -0...
4,925
optbinning.scorecard.scorecard
fit
Fit scorecard. Parameters ---------- X : pandas.DataFrame (n_samples, n_features) Training vector, where n_samples is the number of samples. y : array-like of shape (n_samples,) Target vector relative to x. sample_weight : array-like of shape (n_samples...
def fit(self, X, y, sample_weight=None, metric_special=0, metric_missing=0, show_digits=2, check_input=False): """Fit scorecard. Parameters ---------- X : pandas.DataFrame (n_samples, n_features) Training vector, where n_samples is the number of samples. y : array-like of shape (n_sa...
(self, X, y, sample_weight=None, metric_special=0, metric_missing=0, show_digits=2, check_input=False)
[ 0.00721325445920229, -0.02667928673326969, 0.020696884021162987, -0.0078402915969491, 0.028016967698931694, -0.02881585992872715, 0.01241069845855236, 0.01805868186056614, 0.037622254341840744, 0.018876152113080025, -0.027831178158521652, -0.0017266756622120738, 0.04340028762817383, 0.0246...
4,928
optbinning.scorecard.scorecard
information
Print overview information about the options settings and statistics. Parameters ---------- print_level : int (default=1) Level of details.
def information(self, print_level=1): """Print overview information about the options settings and statistics. Parameters ---------- print_level : int (default=1) Level of details. """ self._check_is_fitted() if not isinstance(print_level, numbers.Integral) or print_level < 0: ...
(self, print_level=1)
[ 0.03551528975367546, 0.013181117363274097, -0.004248348064720631, -0.013558749109506607, 0.06880076229572296, -0.029886791482567787, -0.031649067997932434, -0.06872882694005966, -0.030893806368112564, -0.02618241123855114, -0.07703670859336853, -0.0039988416247069836, -0.004228117875754833, ...
4,929
optbinning.scorecard.scorecard
predict
Predict using the fitted underlying estimator and the reduced dataset. Parameters ---------- X : pandas.DataFrame (n_samples, n_features) Training vector, where n_samples is the number of samples. Returns ------- pred: array of shape (n_samples) ...
def predict(self, X): """Predict using the fitted underlying estimator and the reduced dataset. Parameters ---------- X : pandas.DataFrame (n_samples, n_features) Training vector, where n_samples is the number of samples. Returns ------- pred: array of shape (n_samples) T...
(self, X)
[ 0.04217499867081642, -0.005910617299377918, 0.005969093646854162, 0.013035744428634644, 0.041923098266124725, -0.044298142194747925, 0.007422007620334625, -0.010903604328632355, 0.0993199571967125, 0.017084112390875816, 0.0007551330490969121, -0.008757969364523888, 0.014646095223724842, -0...
4,930
optbinning.scorecard.scorecard
predict_proba
Predict class probabilities using the fitted underlying estimator and the reduced dataset. Parameters ---------- X : pandas.DataFrame (n_samples, n_features) Training vector, where n_samples is the number of samples. Returns ------- p: array of shape...
def predict_proba(self, X): """Predict class probabilities using the fitted underlying estimator and the reduced dataset. Parameters ---------- X : pandas.DataFrame (n_samples, n_features) Training vector, where n_samples is the number of samples. Returns ------- p: array of shap...
(self, X)
[ 0.04201111942529678, 0.015490722842514515, -0.02299019880592823, 0.0028715794906020164, 0.03528442233800888, -0.05124935135245323, -0.0009281041566282511, -0.030788250267505646, 0.1105777695775032, 0.018476463854312897, -0.0033501761499792337, -0.010090045630931854, 0.026713592931628227, 0...
4,931
optbinning.scorecard.scorecard
save
Save scorecard to pickle file. Parameters ---------- path : str Pickle file path.
def save(self, path): """Save scorecard to pickle file. Parameters ---------- path : str Pickle file path. """ if not isinstance(path, str): raise TypeError("path must be a string.") with open(path, "wb") as f: pickle.dump(self, f)
(self, path)
[ 0.005669437348842621, 0.011700575239956379, -0.07671404629945755, 0.04602843150496483, 0.009126616641879082, -0.06998474895954132, -0.06103477627038956, 0.045893844217061996, 0.04707147181034088, -0.018051354214549065, 0.007536818739026785, 0.01968321017920971, -0.0254367645829916, 0.01832...
4,932
optbinning.scorecard.scorecard
score
Score of the dataset. Parameters ---------- X : pandas.DataFrame (n_samples, n_features) Training vector, where n_samples is the number of samples. Returns ------- score: array of shape (n_samples) The score of the input samples.
def score(self, X): """Score of the dataset. Parameters ---------- X : pandas.DataFrame (n_samples, n_features) Training vector, where n_samples is the number of samples. Returns ------- score: array of shape (n_samples) The score of the input samples. """ X_t = self....
(self, X)
[ 0.013617042452096939, -0.025578079745173454, -0.0196380615234375, 0.0031432597897946835, 0.06854421645402908, -0.013428041711449623, -0.010071031749248505, 0.024390075355768204, 0.08020824939012527, 0.00947702955454588, -0.05022015795111656, -0.0176580548286438, 0.017163053154945374, -0.00...
4,933
sklearn.utils._metadata_requests
set_fit_request
Request metadata passed to the ``fit`` method. Note that this method is only relevant if ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`). Please see :ref:`User Guide <metadata_routing>` on how the routing mechanism works. The options for each parameter...
def __get__(self, instance, owner): # we would want to have a method which accepts only the expected args def func(**kw): """Updates the request for provided parameters This docstring is overwritten below. See REQUESTER_DOC for expected functionality """ if not _routing_e...
(self: optbinning.scorecard.scorecard.Scorecard, *, check_input: Union[bool, NoneType, str] = '$UNCHANGED$', metric_missing: Union[bool, NoneType, str] = '$UNCHANGED$', metric_special: Union[bool, NoneType, str] = '$UNCHANGED$', sample_weight: Union[bool, NoneType, str] = '$UNCHANGED$', show_digits: Union[bool, NoneTyp...
[ 0.04383700713515282, -0.05829713121056557, -0.019093072041869164, 0.004713810048997402, -0.0029419693164527416, -0.017276043072342873, -0.011530046351253986, 0.010045981034636497, 0.05700333043932915, 0.010883145965635777, -0.021461868658661842, 0.006516568828374147, 0.051295388489961624, ...
4,935
optbinning.scorecard.scorecard
table
Scorecard table. Parameters ---------- style : str, optional (default="summary") Scorecard's style. Supported styles are "summary" and "detailed". Summary only includes columns variable, bin description and points. Detailed contained additional columns with b...
def table(self, style="summary"): """Scorecard table. Parameters ---------- style : str, optional (default="summary") Scorecard's style. Supported styles are "summary" and "detailed". Summary only includes columns variable, bin description and points. Detailed contained additiona...
(self, style='summary')
[ -0.03372861072421074, 0.03999902680516243, -0.04581241309642792, -0.10193535685539246, 0.013546288013458252, -0.013793082907795906, -0.022138400003314018, 0.008624104782938957, 0.012028957717120647, 0.012467703782022, -0.057621996849775314, 0.033856578171253204, -0.04255837947130203, 0.011...
4,945
cerberus.validator
DocumentError
Raised when the target document is missing or has the wrong format
class DocumentError(Exception): """Raised when the target document is missing or has the wrong format""" pass
null
[ -0.011498646810650826, 0.00682838773354888, -0.0022839484736323357, 0.03667965903878212, -0.0051607429049909115, -0.024003852158784866, -0.007144003175199032, 0.024549780413508415, 0.03957991302013397, 0.01423682551831007, 0.070493184030056, 0.0046745240688323975, 0.05008906126022339, -0.0...
4,946
cerberus.schema
SchemaError
Raised when the validation schema is missing, has the wrong format or contains errors.
class SchemaError(Exception): """ Raised when the validation schema is missing, has the wrong format or contains errors.""" pass
null
[ 0.025201085954904556, 0.006041123066097498, 0.026475584134459496, 0.008449926041066647, -0.00044793315464630723, -0.06450662016868591, 0.0002979140554089099, -0.002927098423242569, 0.05917071923613548, -0.00031331423087976873, 0.004741134587675333, -0.005837203469127417, 0.05798118934035301,...
4,947
cerberus.utils
TypeDefinition
TypeDefinition(name, included_types, excluded_types)
from cerberus.utils import TypeDefinition
(name, included_types, excluded_types)
[ 0.02241486683487892, -0.0026374575681984425, 0.03203465789556503, -0.013236608356237411, 0.0027407952584326267, -0.007571828085929155, -0.003384306561201811, -0.025308318436145782, -0.02594713307917118, -0.016167638823390007, 0.0036543936002999544, 0.035228729248046875, -0.022020304575562477...
4,949
namedtuple_TypeDefinition
__new__
Create new instance of TypeDefinition(name, included_types, excluded_types)
from builtins import function
(_cls, name, included_types, excluded_types)
[ 0.009995887987315655, -0.03442486375570297, 0.019422905519604683, 0.011466828174889088, 0.012417656369507313, 0.061470650136470795, -0.0008345144451595843, 0.005786237772554159, -0.012442036531865597, -0.024786552414298058, -0.015253888443112373, 0.03676536679267883, 0.0068711573258042336, ...
4,952
collections
_replace
Return a new TypeDefinition object replacing specified fields with new values
def namedtuple(typename, field_names, *, rename=False, defaults=None, module=None): """Returns a new subclass of tuple with named fields. >>> Point = namedtuple('Point', ['x', 'y']) >>> Point.__doc__ # docstring for the new class 'Point(x, y)' >>> p = Point(11, y=22) #...
(self, /, **kwds)
[ 0.05418593809008598, 0.0013482100330293179, -0.015411057509481907, -0.03564321994781494, -0.03286181390285492, -0.03329447656869888, 0.0028432165272533894, 0.021509550511837006, 0.021004777401685715, -0.04619196802377701, -0.04223618656396866, 0.05707035958766937, 0.00448630703613162, 0.06...
4,953
cerberus.validator
Validator
Validator class. Normalizes and/or validates any mapping against a validation-schema which is provided as an argument at class instantiation or upon calling the :meth:`~cerberus.Validator.validate`, :meth:`~cerberus.Validator.validated` or :meth:`~cerberus.Validator.normalized` method. An instance ...
from cerberus.validator import Validator
(*args, **kwargs)
[ 0.03349393978714943, -0.0012503106845542789, 0.021528193727135658, 0.04359797388315201, -0.03811438009142876, -0.03002438135445118, 0.005686692427843809, -0.034154005348682404, 0.030379800125956535, 0.008301555179059505, 0.013268949463963509, -0.009790927171707153, -0.0037170827854424715, ...
4,954
cerberus.validator
__get_rule_handler
null
def __get_rule_handler(self, domain, rule): methodname = '_{0}_{1}'.format(domain, rule.replace(' ', '_')) result = getattr(self, methodname, None) if result is None: raise RuntimeError( "There's no handler for '{}' in the '{}' " "domain.".format(rule, domain) ) r...
(self, domain, rule)
[ 0.007070539519190788, 0.05171594396233559, 0.001127202995121479, 0.021284688264131546, 0.017596831545233727, -0.010754097253084183, 0.0610688291490078, -0.0076078143902122974, 0.009473233483731747, -0.017476482316851616, -0.0008499691030010581, 0.029709160327911377, 0.044219885021448135, -...
4,955
cerberus.validator
__init_error_handler
null
@staticmethod def __init_error_handler(kwargs): error_handler = kwargs.pop('error_handler', errors.BasicErrorHandler) if isinstance(error_handler, tuple): error_handler, eh_config = error_handler else: eh_config = {} if isinstance(error_handler, type) and issubclass( error_handle...
(kwargs)
[ -0.04253673553466797, -0.05223745480179787, 0.025349991396069527, -0.024965621531009674, -0.02987089194357395, 0.018230028450489044, 0.05055355653166771, 0.0440375991165638, 0.019071977585554123, -0.021561220288276672, 0.062487270683050156, 0.01996883749961853, 0.026905765756964684, -0.011...
4,956
cerberus.validator
__init_processing
null
def __init_processing(self, document, schema=None): self._errors = errors.ErrorList() self.recent_error = None self.document_error_tree = errors.DocumentErrorTree() self.schema_error_tree = errors.SchemaErrorTree() self.document = copy(document) if not self.is_child: self._is_normalized ...
(self, document, schema=None)
[ 0.008171436376869678, 0.028995711356401443, -0.006823850329965353, 0.028073202818632126, -0.022194471210241318, 0.024346990510821342, 0.052166953682899475, 0.03445840999484062, 0.026083476841449738, 0.024871554225683212, 0.03536282852292061, 0.02461831644177437, 0.022936096414923668, -0.03...
4,957
cerberus.validator
__normalize_coerce
null
def __normalize_coerce(self, processor, field, value, nullable, error): if isinstance(processor, _str_type): processor = self.__get_rule_handler('normalize_coerce', processor) elif isinstance(processor, Iterable): result = value for p in processor: result = self.__normalize_c...
(self, processor, field, value, nullable, error)
[ -0.007018923293799162, -0.0007324046455323696, 0.022516150027513504, 0.03856933116912842, -0.0032162824645638466, -0.024878954514861107, 0.055595431476831436, -0.04597046971321106, 0.056047141551971436, -0.05722854658961296, 0.04381614923477173, 0.010728180408477783, 0.04569249600172043, -...
4,958
cerberus.validator
__normalize_containers
null
def __normalize_containers(self, mapping, schema): for field in mapping: rules = set(schema.get(field, ())) # TODO: This check conflates validation and normalization if isinstance(mapping[field], Mapping): if 'keysrules' in rules: self.__normalize_mapping_per_keys...
(self, mapping, schema)
[ 0.04066808894276619, 0.0013358843280002475, -0.051554515957832336, 0.0011733679566532373, -0.050098370760679245, -0.0005081344279460609, 0.015809589996933937, -0.058488547801971436, 0.07585829496383667, 0.01138047780841589, -0.03806782886385918, 0.02842952497303486, 0.0192419346421957, -0....
4,959
cerberus.validator
__normalize_default_fields
null
def __normalize_default_fields(self, mapping, schema): empty_fields = [ x for x in schema if x not in mapping or ( mapping[x] is None # noqa: W503 and not schema[x].get('nullable', False) ) # noqa: W503 ] try: fields_with_default = [x...
(self, mapping, schema)
[ 0.02761891856789589, -0.001167004695162177, -0.0065933759324252605, 0.04999976605176926, -0.04644666984677315, -0.04128186032176018, 0.04347965121269226, -0.00859428197145462, 0.041025448590517044, 0.012490784749388695, -0.014148285612463951, -0.0032509006559848785, 0.03556760028004646, 0....
4,960
cerberus.validator
__normalize_mapping
null
def __normalize_mapping(self, mapping, schema): if isinstance(schema, _str_type): schema = self._resolve_schema(schema) schema = schema.copy() for field in schema: schema[field] = self._resolve_rules_set(schema[field]) self.__normalize_rename_fields(mapping, schema) if self.purge_unk...
(self, mapping, schema)
[ 0.051900602877140045, 0.02572343312203884, 0.011168926022946835, 0.0070678358897566795, -0.04519924521446228, -0.026665810495615005, 0.0276779942214489, -0.043733324855566025, 0.056088950484991074, 0.0002775870671030134, -0.03804415464401245, 0.021168604493141174, 0.008005850948393345, 0.0...
4,961
cerberus.validator
__normalize_mapping_per_keysrules
null
def __normalize_mapping_per_keysrules(self, field, mapping, property_rules): schema = dict(((k, property_rules) for k in mapping[field])) document = dict(((k, k) for k in mapping[field])) validator = self._get_child_validator( document_crumb=field, schema_crumb=(field, 'keysrules'), schema=schema ...
(self, field, mapping, property_rules)
[ 0.009787620045244694, 0.025609184056520462, -0.06300561130046844, 0.04553523287177086, -0.03715085610747337, -0.017338821664452553, -0.0017748831305652857, -0.04307955875992775, 0.03971177712082863, -0.0004086396947968751, 0.0010321509325876832, -0.004411444999277592, 0.0635669082403183, 0...
4,962
cerberus.validator
__normalize_mapping_per_schema
null
def __normalize_mapping_per_schema(self, field, mapping, schema): rules = schema.get(field, {}) if not rules and isinstance(self.allow_unknown, Mapping): rules = self.allow_unknown validator = self._get_child_validator( document_crumb=field, schema_crumb=(field, 'schema'), sc...
(self, field, mapping, schema)
[ 0.05257426202297211, 0.017237890511751175, -0.001273500151000917, 0.056364335119724274, -0.028234325349330902, -0.015847036615014076, 0.04103017598390579, -0.05212223157286644, 0.025817716494202614, -0.011283298954367638, -0.023244637995958328, 0.008119107224047184, 0.01822018064558506, 0....
4,963
cerberus.validator
__normalize_mapping_per_valuesrules
null
def __normalize_mapping_per_valuesrules(self, field, mapping, value_rules): schema = dict(((k, value_rules) for k in mapping[field])) validator = self._get_child_validator( document_crumb=field, schema_crumb=(field, 'valuesrules'), schema=schema ) mapping[field] = validator.normalized( m...
(self, field, mapping, value_rules)
[ 0.040322642773389816, 0.004788747522979975, -0.04892851039767265, 0.016214074566960335, -0.06187200918793678, -0.004125089850276709, -0.011754987761378288, -0.0417453870177269, 0.023423222824931145, -0.010202114470303059, 0.00814173836261034, 0.05829779803752899, 0.05420307070016861, 0.003...
4,964
cerberus.validator
__normalize_purge_readonly
null
@staticmethod def __normalize_purge_readonly(mapping, schema): for field in [x for x in mapping if schema.get(x, {}).get('readonly', False)]: mapping.pop(field) return mapping
(mapping, schema)
[ 0.08353064954280853, 0.0029892183374613523, -0.008548996411263943, -0.003587899263948202, -0.05107627809047699, -0.03741127997636795, 0.00790844950824976, -0.0429040752351284, 0.08125314861536026, -0.007590269669890404, -0.011019079014658928, 0.026057275012135506, 0.006480826064944267, 0.0...
4,965
cerberus.validator
__normalize_rename_fields
null
def __normalize_rename_fields(self, mapping, schema): for field in tuple(mapping): if field in schema: self._normalize_rename(mapping, schema, field) self._normalize_rename_handler(mapping, schema, field) elif ( isinstance(self.allow_unknown, Mapping) ...
(self, mapping, schema)
[ 0.03309352323412895, 0.008255945518612862, -0.0019887934904545546, 0.04662385955452919, -0.07532351464033127, -0.04341563582420349, 0.06210702657699585, 0.013835464604198933, 0.05603929981589317, -0.006320549175143242, -0.03000735305249691, -0.005575160495936871, 0.038010478019714355, -0.0...
4,966
cerberus.validator
__normalize_sequence_per_items
null
def __normalize_sequence_per_items(self, field, mapping, schema): rules, values = schema[field]['items'], mapping[field] if len(rules) != len(values): return schema = dict(((k, v) for k, v in enumerate(rules))) document = dict((k, v) for k, v in enumerate(values)) validator = self._get_child...
(self, field, mapping, schema)
[ 0.047255173325538635, 0.04635705053806305, -0.051365822553634644, 0.008091758005321026, -0.015768995508551598, -0.001997031969949603, 0.008389693684875965, -0.053472958505153656, 0.06950102746486664, -0.014309544116258621, -0.012470114976167679, 0.04884416237473488, 0.04041561111807823, 0....
4,967
cerberus.validator
__normalize_sequence_per_schema
null
def __normalize_sequence_per_schema(self, field, mapping, schema): schema = dict( ((k, schema[field]['schema']) for k in range(len(mapping[field]))) ) document = dict((k, v) for k, v in enumerate(mapping[field])) validator = self._get_child_validator( document_crumb=field, schema_crumb=(...
(self, field, mapping, schema)
[ 0.043654654175043106, 0.04730401933193207, -0.009140623733401299, 0.035942792892456055, -0.011628043837845325, 0.01484705787152052, 0.014829844236373901, -0.029780186712741852, 0.048405714333057404, -0.010999733582139015, -0.030692527070641518, 0.03573622182011604, 0.02706037648022175, 0.0...
4,968
cerberus.validator
__store_config
Assign args to kwargs and store configuration.
def __store_config(self, args, kwargs): """Assign args to kwargs and store configuration.""" signature = ( 'schema', 'ignore_none_values', 'allow_unknown', 'require_all', 'purge_unknown', 'purge_readonly', ) for i, p in enumerate(signature[: len(args)]): ...
(self, args, kwargs)
[ -0.020752940326929092, 0.008389005437493324, 0.03328438475728035, -0.023831475526094437, -0.012395626865327358, 0.021205665543675423, -0.035855866968631744, 0.015238743275403976, 0.03904305398464203, -0.055920664221048355, -0.011508284136652946, 0.012540498748421669, -0.028123313561081886, ...
4,969
cerberus.validator
__validate_definitions
Validate a field's value against its defined rules.
def __validate_definitions(self, definitions, field): """Validate a field's value against its defined rules.""" def validate_rule(rule): validator = self.__get_rule_handler('validate', rule) return validator(definitions.get(rule, None), field, value) definitions = self._resolve_rules_set(def...
(self, definitions, field)
[ 0.025690225884318352, 0.01729559898376465, -0.046014998108148575, 0.02373592182993889, 0.011699180118739605, 0.013715667650103569, 0.022119179368019104, -0.07938031107187271, -0.041218068450689316, -0.01844153180718422, 0.03332978114485741, 0.035870376974344254, 0.03407597169280052, -0.044...
4,970
cerberus.validator
__validate_dependencies_mapping
null
def __validate_dependencies_mapping(self, dependencies, field): validated_dependencies_counter = 0 error_info = {} for dependency_name, dependency_values in dependencies.items(): if not isinstance(dependency_values, Sequence) or isinstance( dependency_values, _str_type ): ...
(self, dependencies, field)
[ 0.03825874999165535, 0.0024794070050120354, -0.043729327619075775, 0.04803520068526268, -0.001020218594931066, 0.021952899172902107, 0.014320560730993748, 0.003824992571026087, 0.0613410584628582, -0.045564617961645126, 0.039529334753751755, 0.03695286810398102, 0.06547045707702637, -0.084...
4,971
cerberus.validator
__validate_dependencies_sequence
null
def __validate_dependencies_sequence(self, dependencies, field): for dependency in dependencies: if self._lookup_field(dependency)[0] is None: self._error(field, errors.DEPENDENCIES_FIELD, dependency)
(self, dependencies, field)
[ -0.022907955572009087, 0.050717465579509735, -0.03383433446288109, 0.06351596862077713, 0.009905222803354263, 0.010262628085911274, 0.03043047897517681, 0.012373019009828568, 0.061371538788080215, -0.02803076058626175, 0.04462456330657005, 0.02569911815226078, 0.0746806189417839, -0.086049...
4,972
cerberus.validator
__validate_logical
Validates value against all definitions and logs errors according to the operator.
def __validate_logical(self, operator, definitions, field, value): """ Validates value against all definitions and logs errors according to the operator. """ valid_counter = 0 _errors = errors.ErrorList() for i, definition in enumerate(definitions): schema = {field: definition.copy()...
(self, operator, definitions, field, value)
[ 0.05284488946199417, -0.03520582988858223, 0.0041815959848463535, 0.039868611842393875, -0.01950055919587612, -0.007414369378238916, -0.014638974331319332, -0.0796649381518364, -0.04243495315313339, -0.01764809712767601, 0.06509825587272644, 0.017874006181955338, 0.06506210565567017, -0.07...
4,973
cerberus.validator
__validate_readonly_fields
null
def __validate_readonly_fields(self, mapping, schema): for field in ( x for x in schema if x in mapping and self._resolve_rules_set(schema[x]).get('readonly') ): self._validate_readonly(schema[field]['readonly'], field, mapping[field])
(self, mapping, schema)
[ 0.05613388121128082, 0.0023674003314226866, -0.018494781106710434, 0.0659453421831131, -0.024597031995654106, -0.012700204737484455, 0.048510339111089706, -0.03273336961865425, 0.03791259229183197, -0.013700153678655624, -0.0037946777883917093, 0.032887205481529236, 0.06379161030054092, -0...
4,974
cerberus.validator
__validate_required_fields
Validates that required fields are not missing. :param document: The document being validated.
def __validate_required_fields(self, document): """ Validates that required fields are not missing. :param document: The document being validated. """ try: required = set( field for field, definition in self.schema.items() if self._resolve_rules_set(defini...
(self, document)
[ 0.01144399307668209, 0.03756069391965866, -0.03619745746254921, 0.03282524645328522, -0.01052022259682417, 0.0006737696239724755, 0.05983881279826164, -0.04821544513106346, -0.011165965348482132, -0.0012354310601949692, 0.01939021423459053, -0.017632359638810158, 0.09571339935064316, -0.03...
4,975
cerberus.validator
__validate_schema_mapping
null
def __validate_schema_mapping(self, field, schema, value): schema = self._resolve_schema(schema) field_rules = self._resolve_rules_set(self.schema[field]) validator = self._get_child_validator( document_crumb=field, schema_crumb=(field, 'schema'), schema=schema, allow_unknown...
(self, field, schema, value)
[ 0.08869904279708862, -0.005574834533035755, -0.013712402433156967, 0.057981837540864944, -0.014682325534522533, -0.003049919381737709, 0.052891965955495834, -0.013240788131952286, 0.019416263327002525, -0.011959421448409557, -0.010882717557251453, 0.02003915049135685, 0.056166570633649826, ...
4,976
cerberus.validator
__validate_schema_sequence
null
def __validate_schema_sequence(self, field, schema, value): schema = dict(((i, schema) for i in range(len(value)))) validator = self._get_child_validator( document_crumb=field, schema_crumb=(field, 'schema'), schema=schema, allow_unknown=self.allow_unknown, ) validator( ...
(self, field, schema, value)
[ 0.06988900154829025, 0.050937213003635406, -0.051108259707689285, 0.02066224068403244, 0.018011042848229408, 0.038450926542282104, 0.023621320724487305, 0.011383047327399254, 0.06722070276737213, -0.020456986501812935, -0.024801531806588173, 0.062123559415340424, 0.062123559415340424, -0.0...
4,977
cerberus.validator
__validate_unknown_fields
null
def __validate_unknown_fields(self, field): if self.allow_unknown: value = self.document[field] if isinstance(self.allow_unknown, (Mapping, _str_type)): # validate that unknown fields matches the schema # for unknown_fields schema_crumb = 'allow_unknown' if self.i...
(self, field)
[ 0.03174640238285065, -0.0035468877758830786, 0.0029389127157628536, 0.10465075075626373, -0.031149400398135185, -0.0010930384742096066, 0.07304482161998749, -0.030657753348350525, 0.02163250371813774, -0.04273824393749237, 0.021808091551065445, 0.022229505702853203, 0.03388858214020729, -0...
4,978
cerberus.validator
validate
Normalizes and validates a mapping against a validation-schema of defined rules. :param document: The document to normalize. :type document: any :term:`mapping` :param schema: The validation schema. Defaults to :obj:`None`. If not provided here, the schema must h...
def validate(self, document, schema=None, update=False, normalize=True): """ Normalizes and validates a mapping against a validation-schema of defined rules. :param document: The document to normalize. :type document: any :term:`mapping` :param schema: The validation schema. Defaults to :obj:`None`....
(self, document, schema=None, update=False, normalize=True)
[ 0.05996138975024223, 0.03673716261982918, -0.03960190340876579, 0.03711552545428276, -0.00991849321871996, -0.04234052449464798, 0.00878340657800436, -0.03985414654016495, 0.02855733223259449, -0.00967526063323021, -0.05084466561675072, -0.03165629878640175, 0.06633949279785156, 0.01617948...
4,979
cerberus.validator
__init__
The arguments will be treated as with this signature: __init__(self, schema=None, ignore_none_values=False, allow_unknown=False, require_all=False, purge_unknown=False, purge_readonly=False, error_handler=errors.BasicErrorHandler)
def __init__(self, *args, **kwargs): """ The arguments will be treated as with this signature: __init__(self, schema=None, ignore_none_values=False, allow_unknown=False, require_all=False, purge_unknown=False, purge_readonly=False, error_handler=errors.BasicErrorHandle...
(self, *args, **kwargs)
[ -0.011680773459374905, 0.005465703085064888, 0.01942736655473709, 0.041589923202991486, -0.01186811551451683, -0.01805976964533329, -0.013085839338600636, -0.04451245814561844, 0.008931529708206654, -0.04233929142355919, -0.0028241807594895363, 0.010931406170129776, 0.008608365431427956, 0...
4,980
cerberus.validator
_drop_nodes_from_errorpaths
Removes nodes by index from an errorpath, relatively to the basepaths of self. :param errors: A list of :class:`errors.ValidationError` instances. :param dp_items: A list of integers, pointing at the nodes to drop from the :attr:`document_path`. :param sp_items...
def _drop_nodes_from_errorpaths(self, _errors, dp_items, sp_items): """ Removes nodes by index from an errorpath, relatively to the basepaths of self. :param errors: A list of :class:`errors.ValidationError` instances. :param dp_items: A list of integers, pointing at the nodes to drop from ...
(self, _errors, dp_items, sp_items)
[ -0.03707510605454445, 0.015461650677025318, -0.025246119126677513, 0.015461650677025318, -0.08061233907938004, -0.0017661331221461296, 0.02398655191063881, 0.007662370800971985, 0.10127655416727066, 0.01863795332610607, 0.032383669167757034, 0.0011546037858352065, 0.044468220323324203, 0.0...
4,981
cerberus.validator
_drop_remaining_rules
Drops rules from the queue of the rules that still need to be evaluated for the currently processed field. If no arguments are given, the whole queue is emptied.
def _drop_remaining_rules(self, *rules): """ Drops rules from the queue of the rules that still need to be evaluated for the currently processed field. If no arguments are given, the whole queue is emptied. """ if rules: for rule in rules: try: self._remaining...
(self, *rules)
[ -0.026869287714362144, 0.09419732540845871, -0.06719042360782623, -0.02981080487370491, -0.06141060218214989, -0.017993133515119553, -0.028417455032467842, -0.04844040796160698, 0.038360122591257095, -0.0758257508277893, 0.005010038614273071, 0.03571103885769844, -0.008527816273272038, -0....
4,982
cerberus.validator
_error
Creates and adds one or multiple errors. :param args: Accepts different argument's signatures. *1. Bulk addition of errors:* - :term:`iterable` of :class:`~cerberus.errors.ValidationError`-instances The errors wil...
def _error(self, *args): """ Creates and adds one or multiple errors. :param args: Accepts different argument's signatures. *1. Bulk addition of errors:* - :term:`iterable` of :class:`~cerberus.errors.ValidationError`-instances The errors...
(self, *args)
[ -0.040931325405836105, 0.01844485104084015, 0.021951552480459213, 0.06617164611816406, -0.016503287479281425, -0.04047565162181854, -0.004170398693531752, -0.03140181675553322, 0.0454484298825264, -0.08994589000940323, 0.04853908345103264, -0.004970303270965815, 0.08114942163228989, -0.010...
4,983
cerberus.validator
_get_child_validator
Creates a new instance of Validator-(sub-)class. All initial parameters of the parent are passed to the initialization, unless a parameter is given as an explicit *keyword*-parameter. :param document_crumb: Extends the :attr:`~cerberus.Validator.document_...
def _get_child_validator(self, document_crumb=None, schema_crumb=None, **kwargs): """ Creates a new instance of Validator-(sub-)class. All initial parameters of the parent are passed to the initialization, unless a parameter is given as an explicit *keyword*-parameter. :param document_crumb: Extends...
(self, document_crumb=None, schema_crumb=None, **kwargs)
[ 0.01409387681633234, 0.004319681786000729, -0.006388003937900066, 0.03307485207915306, -0.06552737206220627, 0.03880392014980316, 0.05531388893723488, 0.008168041706085205, 0.026906492188572884, 0.007371829356998205, 0.07134795933961868, 0.012098769657313824, 0.017745472490787506, -0.00143...
4,984
cerberus.validator
_lookup_field
Searches for a field as defined by path. This method is used by the ``dependency`` evaluation logic. :param path: Path elements are separated by a ``.``. A leading ``^`` indicates that the path relates to the document root, otherwise it relates to the ...
def _lookup_field(self, path): """ Searches for a field as defined by path. This method is used by the ``dependency`` evaluation logic. :param path: Path elements are separated by a ``.``. A leading ``^`` indicates that the path relates to the document root, otherwise i...
(self, path)
[ 0.08425664901733398, 0.03371342644095421, -0.00713203102350235, 0.06434079259634018, 0.0482286773622036, 0.0009733652696013451, 0.06871869415044785, -0.022678961977362633, 0.02748747728765011, -0.036960966885089874, 0.04772629588842392, 0.01037957239896059, 0.010020728223025799, -0.0623671...
4,985
cerberus.validator
_normalize_coerce
{'oneof': [ {'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string'}]}}, {'type': 'string'} ]}
def _normalize_coerce(self, mapping, schema): """ {'oneof': [ {'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string'}]}}, {'type': 'string'} ]} """ error = errors.COERCION_FAILED for field...
(self, mapping, schema)
[ 0.021173300221562386, 0.0016149127623066306, 0.02390754409134388, 0.03356284275650978, -0.056940626353025436, -0.026727233082056046, 0.06353698670864105, -0.022420799359679222, 0.06770671159029007, -0.02453983761370182, -0.01937895268201828, 0.006972321774810553, 0.030555173754692078, -0.0...
4,986
cerberus.validator
_normalize_default
{'nullable': True}
def _normalize_default(self, mapping, schema, field): """{'nullable': True}""" mapping[field] = schema[field]['default']
(self, mapping, schema, field)
[ 0.06952306628227234, 0.003803629195317626, 0.06055343896150589, 0.036183133721351624, -0.03987252712249756, -0.028228936716914177, 0.056728653609752655, -0.00880884937942028, 0.054528556764125824, -0.011922833509743214, -0.030412109568715096, -0.010035826824605465, 0.005263308994472027, -0...
4,987
cerberus.validator
_normalize_default_setter
{'oneof': [ {'type': 'callable'}, {'type': 'string'} ]}
def _normalize_default_setter(self, mapping, schema, field): """ {'oneof': [ {'type': 'callable'}, {'type': 'string'} ]} """ if 'default_setter' in schema[field]: setter = schema[field]['default_setter'] if isinstance(setter, _str_type): setter = self.__ge...
(self, mapping, schema, field)
[ 0.020886128768324852, -0.0031409459188580513, 0.05741995573043823, 0.03464123234152794, -0.055392175912857056, -0.029081737622618675, 0.058298662304878235, 0.03572271764278412, 0.04450976103544235, -0.012631376273930073, 0.00766754150390625, 0.006463547237217426, 0.03418498486280441, 0.016...
4,988
cerberus.validator
_normalize_purge_unknown
{'type': 'boolean'}
@staticmethod def _normalize_purge_unknown(mapping, schema): """{'type': 'boolean'}""" for field in [x for x in mapping if x not in schema]: mapping.pop(field) return mapping
(mapping, schema)
[ 0.0636417344212532, 0.00220346893183887, -0.01431939098984003, -0.03035609796643257, -0.045727767050266266, -0.031130574643611908, -0.0007555351476185024, -0.020658310502767563, 0.0489940345287323, -0.014294136315584183, -0.038016676902770996, 0.02059096470475197, -0.031147411093115807, -0...
4,989
cerberus.validator
_normalize_rename
{'type': 'hashable'}
def _normalize_rename(self, mapping, schema, field): """{'type': 'hashable'}""" if 'rename' in schema[field]: mapping[schema[field]['rename']] = mapping[field] del mapping[field]
(self, mapping, schema, field)
[ 0.032790642231702805, -0.005290325731039047, -0.0037279531825333834, 0.03591112419962883, -0.05299704149365425, -0.03415478765964508, 0.04655145853757858, 0.011893641203641891, 0.047642771154642105, -0.036729611456394196, -0.012984957545995712, -0.012874120846390724, 0.05528198555111885, 0...
4,990
cerberus.validator
_normalize_rename_handler
{'oneof': [ {'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string'}]}}, {'type': 'string'} ]}
def _normalize_rename_handler(self, mapping, schema, field): """ {'oneof': [ {'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string'}]}}, {'type': 'string'} ]} """ if 'rename_handler' not in sc...
(self, mapping, schema, field)
[ -0.005596854258328676, -0.009884905070066452, 0.002830716548487544, 0.041502825915813446, -0.0493556410074234, -0.02288682758808136, 0.07770155370235443, 0.053557589650154114, 0.06747222691774368, -0.03953962028026581, -0.012993311509490013, -0.01705748960375786, 0.05772509053349495, -0.00...
4,991
cerberus.validator
_resolve_rules_set
null
def _resolve_rules_set(self, rules_set): if isinstance(rules_set, Mapping): return rules_set elif isinstance(rules_set, _str_type): return self.rules_set_registry.get(rules_set) return None
(self, rules_set)
[ -0.006747129838913679, -0.004786610137671232, -0.0012940294109284878, 0.023578166961669922, -0.04237838089466095, 0.02170853316783905, 0.024201378226280212, 0.005630542524158955, 0.01611694134771824, -0.026157569140195847, -0.01023105438798666, 0.013070128858089447, -0.01923299767076969, 0...
4,992
cerberus.validator
_resolve_schema
null
def _resolve_schema(self, schema): if isinstance(schema, Mapping): return schema elif isinstance(schema, _str_type): return self.schema_registry.get(schema) return None
(self, schema)
[ 0.060493260622024536, -0.024279842153191566, 0.021081505343317986, 0.012879321351647377, 0.004707228392362595, 0.011477899737656116, 0.10743658244609833, -0.0036862543784081936, 0.055712953209877014, -0.004427804145962, -0.026859145611524582, 0.011185579001903534, -0.031381525099277496, -0...
4,993
cerberus.validator
_validate_allof
{'type': 'list', 'logical': 'allof'}
def _validate_allof(self, definitions, field, value): """{'type': 'list', 'logical': 'allof'}""" valids, _errors = self.__validate_logical('allof', definitions, field, value) if valids < len(definitions): self._error(field, errors.ALLOF, _errors, valids, len(definitions))
(self, definitions, field, value)
[ 0.028904009610414505, -0.02371177263557911, -0.012515486218035221, 0.016650671139359474, -0.012422465719282627, 0.004359279293566942, 0.00608861492946744, -0.08706719428300858, -0.06234065443277359, -0.018232019618153572, -0.0002122030418831855, -0.017673896625638008, -0.010122322477400303, ...
4,994
cerberus.validator
dummy
{'oneof': [{'type': 'boolean'}, {'type': ['dict', 'string'], 'check_with': 'bulk_schema'}]}
def dummy_for_rule_validation(rule_constraints): def dummy(self, constraint, field, value): raise RuntimeError( 'Dummy method called. Its purpose is to hold just' 'validation constraints for a rule in its ' 'docstring.' ) f = dummy f.__doc__ = rule_constr...
(self, constraint, field, value)
[ 0.005268426612019539, 0.017147865146398544, 0.03739741072058678, 0.018184712156653404, -0.058240704238414764, -0.011892731301486492, 0.008649258874356747, -0.012530790641903877, 0.059623170644044876, -0.035305991768836975, 0.007754202466458082, 0.024175386875867844, 0.04831532761454582, -0...
4,995
cerberus.validator
_validate_allowed
{'type': 'container'}
def _validate_allowed(self, allowed_values, field, value): """{'type': 'container'}""" if isinstance(value, Iterable) and not isinstance(value, _str_type): unallowed = tuple(x for x in value if x not in allowed_values) if unallowed: self._error(field, errors.UNALLOWED_VALUES, unallow...
(self, allowed_values, field, value)
[ 0.08211896568536758, -0.02810555510222912, -0.042917702347040176, -0.003977749031037092, -0.04423989728093147, 0.035538431257009506, 0.03502027317881584, -0.06046357378363609, 0.038450829684734344, -0.03139317408204079, 0.03532401844859123, 0.05853388458490372, 0.00933576188981533, -0.0867...
4,996
cerberus.validator
_validate_anyof
{'type': 'list', 'logical': 'anyof'}
def _validate_anyof(self, definitions, field, value): """{'type': 'list', 'logical': 'anyof'}""" valids, _errors = self.__validate_logical('anyof', definitions, field, value) if valids < 1: self._error(field, errors.ANYOF, _errors, valids, len(definitions))
(self, definitions, field, value)
[ 0.04015229642391205, -0.03915107622742653, -0.013352450914680958, 0.014509029686450958, -0.04008324444293976, 0.030088327825069427, 0.020835692062973976, -0.10170993953943253, -0.018815994262695312, -0.001902098418213427, 0.038184382021427155, 0.023010751232504845, -0.003331639338284731, -...
4,997
cerberus.validator
_validate_check_with
{'oneof': [ {'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string'}]}}, {'type': 'string'} ]}
def _validate_check_with(self, checks, field, value): """ {'oneof': [ {'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string'}]}}, {'type': 'string'} ]} """ if isinstance(checks, _str_type): ...
(self, checks, field, value)
[ 0.03714064508676529, -0.05482666566967964, -0.018888670951128006, 0.06809118390083313, -0.06844490766525269, 0.011575501412153244, 0.04421505331993103, 0.00254236557520926, 0.02479580231010914, -0.04028875753283501, 0.025467870756983757, -0.009842270985245705, 0.07859668135643005, -0.06614...
4,998
cerberus.validator
_validate_contains
{'empty': False }
def _validate_contains(self, expected_values, field, value): """{'empty': False }""" if not isinstance(value, Iterable): return if not isinstance(expected_values, Iterable) or isinstance( expected_values, _str_type ): expected_values = set((expected_values,)) else: ex...
(self, expected_values, field, value)
[ 0.05610508844256401, -0.05959855392575264, -0.05163344740867615, 0.0170131865888834, -0.05289109796285629, 0.01572933793067932, 0.020821066573262215, -0.028628965839743614, 0.05718806013464928, -0.04586922749876976, 0.013327578082680702, 0.03940631076693535, 0.04712687432765961, -0.0966293...