code: def sk_repr_kwargs(def_kwargs, nndef_kwargs):
      """Given the non-default arguments, and the default
      keywords arguments, build the string that will appear
      in the __repr__ of the estimator, depending on the
      version of scikit-learn.
      """
      if SKLEARN_AT_LEAST_0_22:
          def_kwargs = {}
      def_kwargs.update(nndef_kwargs)
      args_str = ",".join(
          f"{key}={repr(value)}" for key, value in def_kwargs.items()
      )
      return args_str
  
imports: from numpy.core.numeric import array_equal
  import pytest
  import re
  import unittest
  import metric_learn
  import numpy
  from sklearn import clone
  from test.test_utils import ids_metric_learners, metric_learners, remove_y
  from metric_learn.sklearn_shims import set_random_state, SKLEARN_AT_LEAST_0_22
label_desc: Use image node_id 2 for calling a global function with example usage: sk_repr_kwargs(def_kwargs, nndef_kwargs) and returns: args_str