code: def series_reset_index(
      series,
      level=None,
      drop=False,
      name=no_default,
      inplace=False,
      incremental_index=False,
  ):
      """
      Generate a new DataFrame or Series with the index reset.
  
      This is useful when the index needs to be treated as a column, or
      when the index is meaningless and needs to be reset to the default
      before another operation.
  
      Parameters
      ----------
      level : int, str, tuple, or list, default optional
          For a Series with a MultiIndex, only remove the specified levels
          from the index. Removes all levels by default.
      drop : bool, default False
          Just reset the index, without inserting it as a column in
          the new DataFrame.
      name : object, optional
          The name to use for the column containing the original Series
          values. Uses ``self.name`` by default. This argument is ignored
          when `drop` is True.
      inplace : bool, default False
          Modify the Series in place (do not create a new object).
      incremental_index: bool, default False
          Ensure RangeIndex incremental, when output Series has multiple chunks,
          ensuring index incremental costs more computation,
          so by default, each chunk will have index which starts from 0,
          setting incremental_index=True，reset_index will guarantee that
          output Series's index is from 0 to n - 1.
  
      Returns
      -------
      Series or DataFrame
          When `drop` is False (the default), a DataFrame is returned.
          The newly created columns will come first in the DataFrame,
          followed by the original Series values.
          When `drop` is True, a `Series` is returned.
          In either case, if ``inplace=True``, no value is returned.
  
      See Also
      --------
      DataFrame.reset_index: Analogous function for DataFrame.
  
      Examples
      --------
      >>> import mars.tensor as mt
      >>> import mars.dataframe as md
      >>> s = md.Series([1, 2, 3, 4], name='foo',
      ...               index=md.Index(['a', 'b', 'c', 'd'], name='idx'))
  
      Generate a DataFrame with default index.
  
      >>> s.reset_index().execute()
        idx  foo
      0   a    1
      1   b    2
      2   c    3
      3   d    4
  
      To specify the name of the new column use `name`.
  
      >>> s.reset_index(name='values').execute()
        idx  values
      0   a       1
      1   b       2
      2   c       3
      3   d       4
  
      To generate a new Series with the default set `drop` to True.
  
      >>> s.reset_index(drop=True).execute()
      0    1
      1    2
      2    3
      3    4
      Name: foo, dtype: int64
  
      To update the Series in place, without generating a new one
      set `inplace` to True. Note that it also requires ``drop=True``.
  
      >>> s.reset_index(inplace=True, drop=True)
      >>> s.execute()
      0    1
      1    2
      2    3
      3    4
      Name: foo, dtype: int64
  
      The `level` parameter is interesting for Series with a multi-level
      index.
  
      >>> import numpy as np
      >>> import pandas as pd
      >>> arrays = [np.array(['bar', 'bar', 'baz', 'baz']),
      ...           np.array(['one', 'two', 'one', 'two'])]
      >>> s2 = md.Series(
      ...     range(4), name='foo',
      ...     index=pd.MultiIndex.from_arrays(arrays,
      ...                                     names=['a', 'b']))
  
      To remove a specific level from the Index, use `level`.
  
      >>> s2.reset_index(level='a').execute()
             a  foo
      b
      one  bar    0
      two  bar    1
      one  baz    2
      two  baz    3
  
      If `level` is not set, all levels are removed from the Index.
  
      >>> s2.reset_index().execute()
           a    b  foo
      0  bar  one    0
      1  bar  two    1
      2  baz  one    2
      3  baz  two    3
      """
      if name is no_default:
          name = series.name if series.name is not None else 0
  
      op = DataFrameResetIndex(
          level=level,
          drop=drop,
          name=name,
          incremental_index=incremental_index,
          output_types=[OutputType.series],
      )
      ret = op(series)
      if not inplace:
          return ret
      elif ret.ndim == 2:
          raise TypeError(
              "Cannot reset_index inplace on a Series to create a DataFrame"
          )
      else:
          series.data = ret.data
  
imports: import pandas
  import numpy
  from ...None import opcodes
  from ...core import OutputType
  from ...serialization.serializables import AnyField, BoolField
  from ...utils import no_default, calc_nsplits
  from ..core import IndexValue
  from ..operands import DataFrameOperandMixin, DataFrameOperand, DATAFRAME_TYPE
  from ..utils import parse_index, build_empty_df, build_empty_series, standardize_range_index
label_desc: Use image node_id 2 for calling a global function with example usage: series_reset_index(series, level, drop, name, inplace, incremental_index) and returns: ret