code: def _to_iso_calendar(arg):
      formats = ["%G", "%V", "%u"]
      if not isinstance(
          arg, (cudf.Index, cudf.core.series.DatetimeProperties)
      ):
          raise AttributeError(
              "Can only use .isocalendar accessor with series or index"
          )
      if isinstance(arg, cudf.Index):
          iso_params = [
              arg._column.as_string_column(arg._values.dtype, fmt)
              for fmt in formats
          ]
          index = arg._column
      elif isinstance(arg.series, cudf.Series):
          iso_params = [arg.strftime(fmt) for fmt in formats]
          index = arg.series.index
  
      data = dict(zip(["year", "week", "day"], iso_params))
      return cudf.DataFrame(data, index=index, dtype=np.int32)
  
imports: import math
  import re
  import warnings
  from typing import Sequence, Union
  import cupy
  import numpy
  import pandas
  import pandas.tseries.offsets
  from pandas.core.tools.datetimes import _unit_map
  from typing_extensions import Self
  import cudf
  from cudf import _lib
  from cudf._lib.strings.convert.convert_integers import is_integer
  from cudf.api.types import is_integer, is_scalar
  from cudf.core import column
  from cudf.core.index import as_index
label_desc: Use image node_id 10 for calling a global function with example usage: _to_iso_calendar(arg) and returns: cudf