code: def test_gantt_index(self):
      # validate the index used for gantt
  
      df = [
          {
              "Task": "Job A",
              "Start": "2009-02-01",
              "Finish": "2009-08-30",
              "Complete": 50,
          }
      ]
  
      pattern = (
          "In order to use an indexing column and assign colors to "
          "the values of the index, you must choose an actual "
          "column name in the dataframe or key if a list of "
          "dictionaries is being used."
      )
  
      self.assertRaisesRegex(
          PlotlyError, pattern, ff.create_gantt, df, index_col="foo"
      )
  
      df = [
          {
              "Task": "Job A",
              "Start": "2009-02-01",
              "Finish": "2009-08-30",
              "Complete": "a",
          },
          {
              "Task": "Job A",
              "Start": "2009-02-01",
              "Finish": "2009-08-30",
              "Complete": 50,
          },
      ]
  
      pattern2 = (
          "Error in indexing column. Make sure all entries of each "
          "column are all numbers or all strings."
      )
  
      self.assertRaisesRegex(
          PlotlyError,
          pattern2,
          ff.create_gantt,
          df,
          index_col="Complete",
      )
  
imports: import math
  from unittest import TestCase
  import datetime
  import plotly.figure_factory
  import plotly.io
  from plotly.exceptions import PlotlyError
  from plotly.tests.test_optional.optional_utils import NumpyTestUtilsMixin
  from plotly.graph_objs import graph_objs
  from plotly.tests.utils import TestCaseNoTemplate
label_desc: Use image node_id 2 for calling the TestGantt obj's underlying member method code with example usage: obj.test_gantt_index() without return types