code: def _dynamic_max_trials(
      n_inliers, n_samples, min_samples, probability
  ):
      """Determine number trials such that at least one outlier-free subset is
      sampled for the given inlier/outlier ratio.
  
      Parameters
      ----------
      n_inliers : int
          Number of inliers in the data.
  
      n_samples : int
          Total number of samples in the data.
  
      min_samples : int
          Minimum number of samples chosen randomly from original data.
  
      probability : float
          Probability (confidence) that one outlier-free sample is generated.
  
      Returns
      -------
      trials : int
          Number of trials.
  
      """
      inlier_ratio = n_inliers / float(n_samples)
      nom = max(_EPSILON, 1 - probability)
      denom = max(_EPSILON, 1 - inlier_ratio**min_samples)
      if nom == 1:
          return 0
      if denom == 1:
          return float("inf")
      return abs(float(np.ceil(np.log(nom) / np.log(denom))))
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/linear_model/ransac.py
imports: import numpy
  import warnings
  from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone
  from ..utils import check_random_state, check_array, check_consistent_length
  from ..utils.random import sample_without_replacement
  from ..utils.validation import check_is_fitted
  from .base import LinearRegression
  from ..utils.validation import has_fit_parameter
label_desc: Use image node_id 1 for calling a global function with example usage: _dynamic_max_trials(n_inliers, n_samples, min_samples, probability) and returns: abs, int, float