code: def series_duplicated(series, keep="first", method="auto"):
      """
      Indicate duplicate Series values.
  
      Duplicated values are indicated as ``True`` values in the resulting
      Series. Either all duplicates, all except the first or all except the
      last occurrence of duplicates can be indicated.
  
      Parameters
      ----------
      keep : {'first', 'last', False}, default 'first'
          Method to handle dropping duplicates:
  
          - 'first' : Mark duplicates as ``True`` except for the first
            occurrence.
          - 'last' : Mark duplicates as ``True`` except for the last
            occurrence.
          - ``False`` : Mark all duplicates as ``True``.
  
      Returns
      -------
      Series
          Series indicating whether each value has occurred in the
          preceding values.
  
      See Also
      --------
      Index.duplicated : Equivalent method on pandas.Index.
      DataFrame.duplicated : Equivalent method on pandas.DataFrame.
      Series.drop_duplicates : Remove duplicate values from Series.
  
      Examples
      --------
      By default, for each set of duplicated values, the first occurrence is
      set on False and all others on True:
  
      >>> import mars.dataframe as md
  
      >>> animals = md.Series(['lame', 'cow', 'lame', 'beetle', 'lame'])
      >>> animals.duplicated().execute()
      0    False
      1    False
      2     True
      3    False
      4     True
      dtype: bool
  
      which is equivalent to
  
      >>> animals.duplicated(keep='first').execute()
      0    False
      1    False
      2     True
      3    False
      4     True
      dtype: bool
  
      By using 'last', the last occurrence of each set of duplicated values
      is set on False and all others on True:
  
      >>> animals.duplicated(keep='last').execute()
      0     True
      1    False
      2     True
      3    False
      4    False
      dtype: bool
  
      By setting keep on ``False``, all duplicates are True:
  
      >>> animals.duplicated(keep=False).execute()
      0     True
      1    False
      2     True
      3    False
      4     True
      dtype: bool
      """
      if method not in ("auto", "tree", "shuffle", None):
          raise ValueError(
              "method could only be one of 'auto', 'tree', 'shuffle' or None"
          )
      op = DataFrameDuplicated(keep=keep, method=method)
      return op(series)
  
imports: import numpy
  from ...None import opcodes
  from ...core import OutputType
  from ...core.operand import OperandStage
  from ..utils import gen_unknown_index_value, hash_dataframe_on
  from ._duplicate import DuplicateOperand, validate_subset
label_desc: Use image node_id 2 for calling a global function with example usage: series_duplicated(series, keep, method) and returns: op