code: def df_to_excel(df: pd.DataFrame, **kwargs: Any) -> Any:
      output = io.BytesIO()
  
      # timezones are not supported
      for column in df.select_dtypes(include=["datetimetz"]).columns:
          df[column] = df[column].astype(str)
  
      # pylint: disable=abstract-class-instantiated
      with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
          df.to_excel(writer, **kwargs)
  
      return output.getvalue()
  
imports: import io
  from typing import Any
  import pandas
label_desc: Use image node_id 1 for calling a global function with example usage: df_to_excel(df) and returns: output