code: def index_drop_duplicates(index, keep="first", method="auto"):
      """
      Return Index with duplicate values removed.
  
      Parameters
      ----------
      keep : {'first', 'last', ``False``}, default 'first'
          - 'first' : Drop duplicates except for the first occurrence.
          - 'last' : Drop duplicates except for the last occurrence.
          - ``False`` : Drop all duplicates.
  
      Returns
      -------
      deduplicated : Index
  
      See Also
      --------
      Series.drop_duplicates : Equivalent method on Series.
      DataFrame.drop_duplicates : Equivalent method on DataFrame.
      Index.duplicated : Related method on Index, indicating duplicate
          Index values.
  
      Examples
      --------
      Generate an pandas.Index with duplicate values.
  
      >>> import mars.dataframe as md
  
      >>> idx = md.Index(['lame', 'cow', 'lame', 'beetle', 'lame', 'hippo'])
  
      The `keep` parameter controls  which duplicate values are removed.
      The value 'first' keeps the first occurrence for each
      set of duplicated entries. The default value of keep is 'first'.
  
      >>> idx.drop_duplicates(keep='first').execute()
      Index(['lame', 'cow', 'beetle', 'hippo'], dtype='object')
  
      The value 'last' keeps the last occurrence for each set of duplicated
      entries.
  
      >>> idx.drop_duplicates(keep='last').execute()
      Index(['cow', 'beetle', 'lame', 'hippo'], dtype='object')
  
      The value ``False`` discards all sets of duplicated entries.
  
      >>> idx.drop_duplicates(keep=False).execute()
      Index(['cow', 'beetle', 'hippo'], dtype='object')
      """
      if method not in ("auto", "tree", "shuffle", None):
          raise ValueError(
              "method could only be one of 'auto', 'tree', 'shuffle' or None"
          )
      op = DataFrameDropDuplicates(keep=keep, method=method)
      return op(index)
  
imports: import numpy
  import pandas
  from ...None import opcodes
  from ...core.operand import OperandStage
  from ...serialization.serializables import BoolField
  from ...utils import lazy_import, calc_nsplits
  from ..operands import OutputType
  from ..utils import parse_index, hash_dataframe_on, gen_unknown_index_value, standardize_range_index
  from ._duplicate import DuplicateOperand, validate_subset
label_desc: Use image node_id 3 for calling a global function with example usage: index_drop_duplicates(index, keep, method) and returns: op