code: def test_resample_after_pivot():
      df = pd.DataFrame(
          data={
              "__timestamp": pd.to_datetime(
                  [
                      "2022-01-13",
                      "2022-01-13",
                      "2022-01-13",
                      "2022-01-11",
                      "2022-01-11",
                      "2022-01-11",
                  ]
              ),
              "city": ["Chicago", "LA", "NY", "Chicago", "LA", "NY"],
              "val": [6.0, 5.0, 4.0, 3.0, 2.0, 1.0],
          }
      )
      pivot_df = pp.pivot(
          df=df,
          index=["__timestamp"],
          columns=["city"],
          aggregates={
              "val": {"operator": "sum"},
          },
      )
      """
                      val
      city        Chicago   LA   NY
      __timestamp
      2022-01-11      3.0  2.0  1.0
      2022-01-13      6.0  5.0  4.0
      """
      resample_df = pp.resample(
          df=pivot_df,
          rule="1D",
          method="asfreq",
          fill_value=0,
      )
      """
                      val
      city        Chicago   LA   NY
      __timestamp
      2022-01-11      3.0  2.0  1.0
      2022-01-12      0.0  0.0  0.0
      2022-01-13      6.0  5.0  4.0
      """
      flat_df = pp.flatten(resample_df)
      """
        __timestamp  val, Chicago  val, LA  val, NY
      0  2022-01-11           3.0      2.0      1.0
      1  2022-01-12           0.0      0.0      0.0
      2  2022-01-13           6.0      5.0      4.0
      """
      assert flat_df.equals(
          pd.DataFrame(
              data={
                  "__timestamp": pd.to_datetime(
                      ["2022-01-11", "2022-01-12", "2022-01-13"]
                  ),
                  "val, Chicago": [3.0, 0, 6.0],
                  "val, LA": [2.0, 0, 5.0],
                  "val, NY": [1.0, 0, 4.0],
              }
          )
      )
  
file_path: superset/tests/unit_tests/pandas_postprocessing/test_resample.py
imports: import numpy
  import pandas
  import pytest
  from pandas import to_datetime
  from superset.exceptions import InvalidPostProcessingError
  from superset.utils import pandas_postprocessing
  from tests.unit_tests.fixtures.dataframes import categories_df, timeseries_df
label_desc: Use image node_id 4 for calling a global function with example usage: test_resample_after_pivot() without return types