code: def try_remote_windowspec(f: FuncT) -> FuncT:
      """Mark API supported from Spark Connect."""
  
      @functools.wraps(f)
      def wrapped(*args: Any, **kwargs: Any) -> Any:
          if (
              is_remote()
              and "PYSPARK_NO_NAMESPACE_SHARE" not in os.environ
          ):
              from pyspark.sql.connect.window import WindowSpec
  
              return getattr(WindowSpec, f.__name__)(*args, **kwargs)
          else:
              return f(*args, **kwargs)
  
      return cast(FuncT, wrapped)
  
imports: import inspect
  import functools
  import os
  from typing import Any, Callable, Optional, Sequence, TYPE_CHECKING, cast, TypeVar, Union, Type
  from py4j.java_collections import JavaArray
  from py4j.java_gateway import JavaClass, JavaGateway, JavaObject
  from pyspark import SparkContext
  from pyspark.errors import AnalysisException, ParseException, IllegalArgumentException, StreamingQueryException, QueryExecutionException, PythonException, UnknownException, SparkUpgradeException, PySparkNotImplementedError, PySparkRuntimeError
  from pyspark.errors.exceptions.captured import CapturedException
  from pyspark.find_spark_home import _find_spark_home
label_desc: Use image node_id 11 for calling a global function with example usage: try_remote_windowspec(f) and returns: cast, getattr, f