code: def series_map(
      series,
      arg,
      na_action=None,
      dtype=None,
      memory_scale=None,
      skip_infer=False,
  ):
      """
      Map values of Series according to input correspondence.
  
      Used for substituting each value in a Series with another value,
      that may be derived from a function, a ``dict`` or
      a :class:`Series`.
  
      Parameters
      ----------
      arg : function, collections.abc.Mapping subclass or Series
          Mapping correspondence.
      na_action : {None, 'ignore'}, default None
          If 'ignore', propagate NaN values, without passing them to the
          mapping correspondence.
      dtype : np.dtype, default None
          Specify return type of the function. Must be specified when
          we cannot decide the return type of the function.
      memory_scale : float
          Specify the scale of memory uses in the function versus
          input size.
      skip_infer: bool, default False
          Whether infer dtypes when dtypes or output_type is not specified
  
      Returns
      -------
      Series
          Same index as caller.
  
      See Also
      --------
      Series.apply : For applying more complex functions on a Series.
      DataFrame.apply : Apply a function row-/column-wise.
      DataFrame.applymap : Apply a function elementwise on a whole DataFrame.
  
      Notes
      -----
      When ``arg`` is a dictionary, values in Series that are not in the
      dictionary (as keys) are converted to ``NaN``. However, if the
      dictionary is a ``dict`` subclass that defines ``__missing__`` (i.e.
      provides a method for default values), then this default is used
      rather than ``NaN``.
  
      Examples
      --------
      >>> import mars.tensor as mt
      >>> import mars.dataframe as md
      >>> s = md.Series(['cat', 'dog', mt.nan, 'rabbit'])
      >>> s.execute()
      0      cat
      1      dog
      2      NaN
      3   rabbit
      dtype: object
  
      ``map`` accepts a ``dict`` or a ``Series``. Values that are not found
      in the ``dict`` are converted to ``NaN``, unless the dict has a default
      value (e.g. ``defaultdict``):
  
      >>> s.map({'cat': 'kitten', 'dog': 'puppy'}).execute()
      0   kitten
      1    puppy
      2      NaN
      3      NaN
      dtype: object
  
      It also accepts a function:
  
      >>> s.map('I am a {}'.format).execute()
      0       I am a cat
      1       I am a dog
      2       I am a nan
      3    I am a rabbit
      dtype: object
  
      To avoid applying the function to missing values (and keep them as
      ``NaN``) ``na_action='ignore'`` can be used:
  
      >>> s.map('I am a {}'.format, na_action='ignore').execute()
      0     I am a cat
      1     I am a dog
      2            NaN
      3  I am a rabbit
      dtype: object
      """
      op = DataFrameMap(
          arg=arg, na_action=na_action, memory_scale=memory_scale
      )
      return op(series, dtype=dtype, skip_infer=skip_infer)
  
imports: import inspect
  from collections.abc import MutableMapping
  import numpy
  import pandas
  from ...None import opcodes
  from ...core import OutputType, recursive_tile
  from ...core.custom_log import redirect_custom_log
  from ...serialization.serializables import KeyField, AnyField, StringField
  from ...utils import has_unknown_shape, enter_current_session, quiet_stdio
  from ..core import SERIES_TYPE
  from ..operands import DataFrameOperand, DataFrameOperandMixin
  from ..utils import build_series
label_desc: Use image node_id 1 for calling a global function with example usage: series_map(series, arg, na_action, dtype, memory_scale, skip_infer) and returns: op