code: def to_orc(
      df,
      path,
      engine="pyarrow",
      write_index=True,
      storage_options=None,
      compute=True,
      compute_kwargs=None,
  ):
      """Store Dask.dataframe to ORC files
  
      Notes
      -----
      Each partition will be written to a separate file.
  
      Parameters
      ----------
      df : dask.dataframe.DataFrame
      path : string or pathlib.Path
          Destination directory for data.  Prepend with protocol like ``s3://``
          or ``hdfs://`` for remote data.
      engine: 'pyarrow' or ORCEngine
          Backend ORC engine to use for I/O. Default is "pyarrow".
      write_index : boolean, default True
          Whether or not to write the index. Defaults to True.
      storage_options : dict, default None
          Key/value pairs to be passed on to the file-system backend, if any.
      compute : bool, default True
          If True (default) then the result is computed immediately. If False
          then a ``dask.delayed`` object is returned for future computation.
      compute_kwargs : dict, default True
          Options to be passed in to the compute method
  
      Examples
      --------
      >>> df = dd.read_csv(...)  # doctest: +SKIP
      >>> df.to_orc('/path/to/output/', ...)  # doctest: +SKIP
  
      See Also
      --------
      read_orc: Read ORC data to dask.dataframe
      """
  
      # Get engine
      engine = _get_engine(engine)
  
      if hasattr(path, "name"):
          path = stringify_path(path)
      fs, _, _ = get_fs_token_paths(
          path, mode="wb", storage_options=storage_options
      )
      # Trim any protocol information from the path before forwarding
      path = fs._strip_protocol(path)
  
      if not write_index:
          # Not writing index - might as well drop it
          df = df.reset_index(drop=True)
  
      # Use df.npartitions to define file-name list
      fs.mkdirs(path, exist_ok=True)
      filenames = [f"part.{i}.orc" for i in range(df.npartitions)]
  
      # Construct IO graph
      dsk = {}
      name = "to-orc-" + tokenize(
          df,
          fs,
          path,
          engine,
          write_index,
          storage_options,
      )
      final_name = name + "-final"
      for d, filename in enumerate(filenames):
          dsk[(name, d)] = (
              apply,
              engine.write_partition,
              [
                  (df._name, d),
                  path,
                  fs,
                  filename,
              ],
          )
      part_tasks = list(dsk.keys())
      dsk[(final_name, 0)] = (lambda x: None, part_tasks)
      graph = HighLevelGraph.from_collections(
          (final_name, 0), dsk, dependencies=[df]
      )
  
      # Compute or return future
      if compute:
          if compute_kwargs is None:
              compute_kwargs = dict()
          return compute_as_if_collection(
              DataFrame, graph, part_tasks, **compute_kwargs
          )
      return Scalar(graph, final_name, "")
  
imports: from __future__ import annotations
  import copy
  from typing import TYPE_CHECKING, Literal
  from fsspec.core import get_fs_token_paths
  from fsspec.utils import stringify_path
  from dask.base import compute_as_if_collection, tokenize
  from dask.dataframe.backends import dataframe_creation_dispatch
  from dask.dataframe.core import DataFrame, Scalar
  from dask.dataframe.io.io import from_map
  from dask.dataframe.io.orc.utils import ORCEngine
  from dask.dataframe.io.utils import DataFrameIOFunction
  from dask.highlevelgraph import HighLevelGraph
  from dask.utils import apply
label_desc: Use image node_id 3 for calling a global function with example usage: to_orc(df, path, engine, write_index, storage_options, compute, compute_kwargs) and returns: Scalar, compute_as_if_collection