code: def _get_params_value(params):
      """
      Given an iterator (k1, k2), returns a function that when called
      with an object obj returns a tuple of the form:
      ((k1, obj.parameters[k1]), (k2, obj.parameters[k2]))
      """
      # sort params for consistency
      ord_params = sorted(params)
  
      def fn(obj):
          keys = []
          for p in ord_params:
              try:
                  keys.append((p, obj.parameters[p]))
              except KeyError:
                  raise ValueError(
                      "{} is not a valid parameter".format(p)
                  )
          return tuple(keys)
  
      return fn
  
imports: from copy import copy
  from inspect import signature, _empty
  import re
  from collections.abc import Iterable
  from collections import defaultdict
  from itertools import product
  from six import string_types
label_desc: Use image node_id 9 for calling a global function with example usage: _get_params_value(params) and returns: fn, tuple