code: def _deg3_column(d, i, j, k, interaction_only):
      """Compute the index of the column for a degree 3 expansion
  
      d is the dimensionality of the input data, i, j and k are the indices
      for the columns involved in the expansion.
      """
      if interaction_only:
          return int(
              (
                  3 * d**2 * i
                  - 3 * d * i**2
                  + i**3
                  + 11 * i
                  - 3 * j**2
                  - 9 * j
              )
              / 6
              + i**2
              - 2 * d * i
              + d * j
              - d
              + k
          )
      else:
          return int(
              (
                  3 * d**2 * i
                  - 3 * d * i**2
                  + i**3
                  - i
                  - 3 * j**2
                  - 3 * j
              )
              / 6
              + d * j
              + k
          )
  
file_path: cuml/python/cuml/thirdparty_adapters/sparsefuncs_fast.py
imports: from math import ceil
  from cuml.internals.safe_imports import gpu_only_import_from
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 10 for calling a global function with example usage: _deg3_column(d, i, j, k, interaction_only) and returns: int, int