code: def test_union_duplicates(self):
      # GH#36289
      idx = period_range("2011-01-01", periods=2)
      idx_dup = idx.append(idx)
  
      idx2 = period_range("2011-01-02", periods=2)
      idx2_dup = idx2.append(idx2)
      result = idx_dup.union(idx2_dup)
  
      expected = PeriodIndex(
          [
              "2011-01-01",
              "2011-01-01",
              "2011-01-02",
              "2011-01-02",
              "2011-01-03",
              "2011-01-03",
          ],
          freq="D",
      )
      tm.assert_index_equal(result, expected)
  
file_path: pandas/pandas/tests/indexes/period/test_setops.py
imports: import numpy
  import pytest
  import pandas
  from pandas import PeriodIndex, date_range, period_range
  import pandas._testing
label_desc: Use image node_id 8 for calling the TestPeriodIndex obj's underlying member method code with example usage: obj.test_union_duplicates() without return types