code: def execute_sort_values(data, op, inplace=None, by=None):
      if inplace is None:
          inplace = op.inplace
      # ignore_index is new in Pandas version 1.0.0.
      ignore_index = getattr(op, "ignore_index", False)
      if isinstance(data, (pd.DataFrame, pd.Series)):
          kwargs = dict(
              axis=op.axis,
              ascending=op.ascending,
              ignore_index=ignore_index,
              na_position=op.na_position,
              kind=op.kind,
          )
          if isinstance(data, pd.DataFrame):
              kwargs["by"] = by if by is not None else op.by
          if inplace:
              kwargs["inplace"] = True
              try:
                  data.sort_values(**kwargs)
              except TypeError:  # pragma: no cover
                  kwargs.pop("ignore_index", None)
                  data.sort_values(**kwargs)
              return data
          else:
              try:
                  return data.sort_values(**kwargs)
              except TypeError:  # pragma: no cover
                  kwargs.pop("ignore_index", None)
                  return data.sort_values(**kwargs)
  
      else:  # pragma: no cover
          # cudf doesn't support axis and kind
          if isinstance(data, cudf.DataFrame):
              return data.sort_values(
                  op.by,
                  ascending=op.ascending,
                  na_position=op.na_position,
              )
          else:
              return data.sort_values(
                  ascending=op.ascending, na_position=op.na_position
              )
  
imports: import os
  import numpy
  import pandas
  from ...None import opcodes
  from ...core.operand import OperandStage, MapReduceOperand
  from ...utils import lazy_import, calc_nsplits
  from ...serialization.serializables import AnyField, Int32Field, ListField, StringField, BoolField
  from ...tensor.base.psrs import PSRSOperandMixin
  from ..core import IndexValue, OutputType
  from ..utils import standardize_range_index, parse_index, is_cudf
  from ..operands import DataFrameOperandMixin, DataFrameOperand, DataFrameShuffleProxy
label_desc: Use image node_id 1 for calling a global function with example usage: execute_sort_values(data, op, inplace, by) and returns: data, data, data, data, data