code: def _init_primitive_options(primitive_options, es):
      # Flatten all tuple keys, convert value lists into sets, check for
      # conflicting keys
      flattened_options = {}
      for primitive_keys, options in primitive_options.items():
          if not isinstance(primitive_keys, tuple):
              primitive_keys = (primitive_keys,)
          if isinstance(options, list):
              for primitive_key in primitive_keys:
                  if isinstance(primitive_key, str):
                      primitive = (
                          primitives.get_aggregation_primitives().get(
                              primitive_key,
                          )
                          or primitives.get_transform_primitives().get(
                              primitive_key
                          )
                      )
                      if not primitive:
                          msg = (
                              "Unknown primitive with name '{}'".format(
                                  primitive_key
                              )
                          )
                          raise ValueError(msg)
                  else:
                      primitive = primitive_key
                  assert (
                      len(primitive.input_types[0]) == len(options)
                      if isinstance(primitive.input_types[0], list)
                      else len(primitive.input_types) == len(options)
                  ), (
                      "Number of options does not match number of inputs for primitive %s"
                      % (primitive_key)
                  )
              options = [
                  _init_option_dict(primitive_keys, option, es)
                  for option in options
              ]
          else:
              options = [_init_option_dict(primitive_keys, options, es)]
  
          for primitive in primitive_keys:
              if isinstance(primitive, type):
                  primitive = primitive.name
  
              # if primitive is specified more than once, raise error
              if primitive in flattened_options:
                  raise KeyError(
                      "Multiple options found for primitive %s"
                      % (primitive)
                  )
  
              flattened_options[primitive] = options
      return flattened_options
  
file_path: featuretools/featuretools/primitives/options_utils.py
imports: import logging
  import warnings
  from itertools import permutations
  from featuretools import primitives
  from featuretools.feature_base import IdentityFeature
label_desc: Use image node_id 5 for calling a global function with example usage: _init_primitive_options(primitive_options, es) and returns: flattened_options