code: def get_optimal_n_bins(X, upper_bound=None, epsilon=1):
      """Determine optimal number of bins for a histogram using the Birge
      Rozenblac method (see :cite:`birge2006many` for details.)
  
      See  https://doi.org/10.1051/ps:2006001
  
      Parameters
      ----------
      X : array-like of shape (n_samples, n_features)
          The samples to determine the optimal number of bins for.
  
      upper_bound :  int, default=None
          The maximum value of n_bins to be considered.
          If set to None, np.sqrt(X.shape[0]) will be used as upper bound.
  
      epsilon : float, default = 1
          A stabilizing term added to the logarithm to prevent division by zero.
  
      Returns
      -------
      optimal_n_bins : int
          The optimal value of n_bins according to the Birge Rozenblac method
      """
      if upper_bound is None:
          upper_bound = int(np.sqrt(X.shape[0]))
  
      n = X.shape[0]
      maximum_likelihood = np.zeros((upper_bound - 1, 1))
  
      for i, b in enumerate(range(1, upper_bound)):
          histogram, _ = np.histogram(X, bins=b)
  
          maximum_likelihood[i] = np.sum(
              histogram * np.log(b * histogram / n + epsilon)
              - (b - 1 + np.power(np.log(b), 2.5))
          )
  
      return np.argmax(maximum_likelihood) + 1
  
imports: from __future__ import division
  from __future__ import print_function
  import numbers
  import numpy
  import sklearn
  from numpy import percentile
  from sklearn.metrics import precision_score
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils import check_array
  from sklearn.utils import check_consistent_length
  from sklearn.utils import check_random_state
  from sklearn.utils import column_or_1d
  from sklearn.utils.random import sample_without_replacement
label_desc: Use image node_id 15 for calling a global function with example usage: get_optimal_n_bins(X, upper_bound, epsilon) and returns: unknown