code: def _extract_data_and_labels(coeffs):
      """Helper function for creating frequency labels and partitioning data.
  
      Args:
          coeffs (array[complex]): A list of sets of Fourier coefficients.
  
      Returns:
          (list(str), dict[str, array[complex]): The set of frequency labels, and a data
              dictionary split into real and imaginary parts.
      """
      # extract the x ticks: create generator for indices nvec = (n1, ..., nN),
      # ranging from (-d1,...,-dN) to (d1,...,dN).
      nvecs = list(
          product(
              *(
                  np.array(range(-(d // 2), d // 2 + 1))
                  for d in coeffs[0].shape
              )
          )
      )
      nvecs_formatted = [format_nvec(nvec) for nvec in nvecs]
  
      # extract flattened data by real part and imaginary part, and respecting negative indices
      data = {}
      data["real"] = np.array(
          [[c[nvec] for nvec in nvecs] for c in coeffs.real]
      )
      data["imag"] = np.array(
          [[c[nvec] for nvec in nvecs] for c in coeffs.imag]
      )
  
      return nvecs_formatted, data
  
file_path: pennylane/pennylane/fourier/visualize.py
imports: from itertools import product
  import numpy
  from .utils import format_nvec
label_desc: Use image node_id 2 for calling a global function with example usage: _extract_data_and_labels(coeffs) and returns: nvecs_formatted,  data