code: def generate_all_primitive_options(
      all_primitives,
      primitive_options,
      ignore_dataframes,
      ignore_columns,
      es,
  ):
      dataframe_dict = {
          dataframe.ww.name: [col for col in dataframe.columns]
          for dataframe in es.dataframes
      }
  
      primitive_options = _init_primitive_options(
          primitive_options, dataframe_dict
      )
      global_ignore_dataframes = ignore_dataframes
      global_ignore_columns = ignore_columns.copy()
      # for now, only use primitive names as option keys
      for primitive in all_primitives:
          if (
              primitive in primitive_options
              and primitive.name in primitive_options
          ):
              msg = (
                  "Options present for primitive instance and generic "
                  "primitive class (%s), primitive instance will not use generic "
                  "options" % (primitive.name)
              )
              warnings.warn(msg)
          if (
              primitive in primitive_options
              or primitive.name in primitive_options
          ):
              options = primitive_options.get(
                  primitive,
                  primitive_options.get(primitive.name),
              )
              # Reconcile global options with individually-specified options
              included_dataframes = set().union(
                  *[
                      option.get("include_dataframes", set()).union(
                          option.get("include_columns", {}).keys(),
                      )
                      for option in options
                  ]
              )
              global_ignore_dataframes = (
                  global_ignore_dataframes.difference(
                      included_dataframes,
                  )
              )
              for option in options:
                  # don't globally ignore a column if it's included for a primitive
                  if "include_columns" in option:
                      for dataframe, include_cols in option[
                          "include_columns"
                      ].items():
                          global_ignore_columns[
                              dataframe
                          ] = global_ignore_columns[
                              dataframe
                          ].difference(
                              include_cols
                          )
                  option["ignore_dataframes"] = option[
                      "ignore_dataframes"
                  ].union(
                      ignore_dataframes.difference(included_dataframes),
                  )
              for dataframe, ignore_cols in ignore_columns.items():
                  # if already ignoring columns for this dataframe, add globals
                  for option in options:
                      if dataframe in option["ignore_columns"]:
                          option["ignore_columns"][dataframe] = option[
                              "ignore_columns"
                          ][dataframe].union(ignore_cols)
                      # if no ignore_columns and dataframe is explicitly included, don't ignore the column
                      elif dataframe in included_dataframes:
                          continue
                      # Otherwise, keep the global option
                      else:
                          option["ignore_columns"][
                              dataframe
                          ] = ignore_cols
          else:
              # no user specified options, just use global defaults
              primitive_options[primitive] = [
                  {
                      "ignore_dataframes": ignore_dataframes,
                      "ignore_columns": ignore_columns,
                  },
              ]
      return (
          primitive_options,
          global_ignore_dataframes,
          global_ignore_columns,
      )
  
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 4 for calling a global function with example usage: generate_all_primitive_options(all_primitives, primitive_options, ignore_dataframes, ignore_columns, es) and returns: primitive_options,  global_ignore_dataframes,  global_ignore_columns