code: def find_rare_class(classes, verbose=0):
      ######### Print the % count of each class in a Target variable  #####
      """
      Works on Multi Class too. Prints class percentages count of target variable.
      It returns the name of the Rare class (the one with the minimum class member count).
      This can also be helpful in using it as pos_label in Binary and Multi Class problems.
      """
      counts = OrderedDict(Counter(classes))
      total = sum(counts.values())
      if verbose >= 1:
          print(" Class  -> Counts -> Percent")
          for cls in counts.keys():
              print(
                  "%6s: % 7d  ->  % 5.1f%%"
                  % (cls, counts[cls], counts[cls] / total * 100)
              )
      if type(pd.Series(counts).idxmin()) == str:
          return pd.Series(counts).idxmin()
      else:
          return int(pd.Series(counts).idxmin())
  
imports: import pandas
  import numpy
  import warnings
  from sklearn.model_selection import cross_val_score, StratifiedShuffleSplit, TimeSeriesSplit
  from sklearn.model_selection import ShuffleSplit, StratifiedKFold, KFold
  from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
  from sklearn.ensemble import BaggingRegressor, RandomForestClassifier
  from sklearn.ensemble import ExtraTreesClassifier, ExtraTreesRegressor
  from sklearn.linear_model import LogisticRegressionCV, LinearRegression, Ridge
  from sklearn.svm import LinearSVC, SVR, LinearSVR
  from sklearn.ensemble import AdaBoostClassifier, AdaBoostRegressor
  from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier
  from sklearn.linear_model import Lasso, LassoCV, Ridge, RidgeCV, LassoLarsCV
  from sklearn.model_selection import cross_val_predict
  from sklearn.ensemble import ExtraTreesRegressor, ExtraTreesClassifier
  from sklearn.linear_model import LogisticRegression, LogisticRegressionCV, LinearRegression
  from sklearn.model_selection import GridSearchCV, StratifiedShuffleSplit, ShuffleSplit
  from sklearn.naive_bayes import GaussianNB, MultinomialNB
  from sklearn.tree import DecisionTreeClassifier
  import time
  import pdb
  import time
  import copy
  from collections import Counter
  from collections import defaultdict
  from collections import OrderedDict
label_desc: Use image node_id 1 for calling a global function with example usage: find_rare_class(classes, verbose) and returns: pd, int