code: def test_int_subclass_with_index(self):
      # __index__ should be used when computing indices, even for int
      # subclasses.  See issue #17576.
      class MyInt(int):
          def __index__(self):
              return int(str(self)) + 1
  
      my_int = MyInt(7)
      direct_index = my_int.__index__()
      operator_index = operator.index(my_int)
      self.assertEqual(direct_index, 8)
      self.assertEqual(operator_index, 7)
      # Both results should be of exact type int.
      self.assertIs(type(direct_index), int)
  
imports: import unittest
  from test import support
  import operator
label_desc: Use image node_id 7 for calling the BaseTestCase obj's underlying member method code with example usage: obj.test_int_subclass_with_index() and returns: unknown