code: def test_pivot_wide_long_wide():
      """
      Test that transformation from pivot_longer to wider and
      back to longer returns the same source dataframe.
      """
      df = pd.DataFrame(
          {
              "name": ["Wilbur", "Petunia", "Gregory"],
              "a": [67, 80, 64],
              "b": [56, 90, 50],
          }
      )
  
      result = df.pivot_longer(
          column_names=["a", "b"],
          names_to="drug",
          values_to="heartrate",
      )
  
      result = result.pivot_wider(
          index="name", names_from="drug", values_from="heartrate"
      )
  
      assert_frame_equal(result, df)
  
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
label_desc: Use image node_id 20 for calling a global function with example usage: test_pivot_wide_long_wide() without return types