code: def test_has_duplicates(self, index_flat):
      # MultiIndex tested separately in:
      #   tests/indexes/multi/test_unique_and_duplicates.
      index = index_flat
      holder = type(index)
      if not len(index) or isinstance(index, RangeIndex):
          # MultiIndex tested separately in:
          #   tests/indexes/multi/test_unique_and_duplicates.
          # RangeIndex is unique by definition.
          pytest.skip(
              "Skip check for empty Index, MultiIndex, and RangeIndex"
          )
  
      idx = holder([index[0]] * 5)
      assert idx.is_unique is False
      assert idx.has_duplicates is True
  
imports: from copy import copy, deepcopy
  import re
  import numpy
  import pytest
  from pandas.compat import IS64
  from pandas.compat.numpy import np_version_gte1p25
  from pandas.core.dtypes.common import is_integer_dtype, is_numeric_dtype
  import pandas
  from pandas import CategoricalIndex, MultiIndex, PeriodIndex, RangeIndex
  import pandas._testing
label_desc: Use image node_id 17 for calling the TestCommon obj's underlying member method code with example usage: obj.test_has_duplicates(index_flat) without return types