code: def lowess(data, xseq, **params):
      """
      Lowess fitting
      """
      import statsmodels.api as sm
  
      for k in ("is_sorted", "return_sorted"):
          with suppress(KeyError):
              del params["method_args"][k]
              warnings.warn(
                  f"Smoothing method argument: {k}, has been ignored."
              )
  
      result = sm.nonparametric.lowess(
          data["y"],
          data["x"],
          frac=params["span"],
          is_sorted=True,
          **params["method_args"],
      )
      data = pd.DataFrame({"x": result[:, 0], "y": result[:, 1]})
  
      if params["se"]:
          warnings.warn(
              "Confidence intervals are not yet implemented"
              " for lowess smoothings.",
              PlotnineWarning,
          )
  
      return data
  
imports: from __future__ import annotations
  import warnings
  from contextlib import suppress
  from typing import TYPE_CHECKING
  import numpy
  import pandas
  from .._utils import get_valid_kwargs
  from ..exceptions import PlotnineError, PlotnineWarning
label_desc: Use image node_id 10 for calling a global function with example usage: lowess(data, xseq) and returns: data