code: def orderBy(
      self, *cols: Union["ColumnOrName", List["ColumnOrName"]]
  ) -> "WindowSpec":
      _cols: List[ColumnOrName] = []
      for col in cols:
          if isinstance(col, (str, Column)):
              _cols.append(col)
          elif isinstance(col, list):
              for c in col:
                  if isinstance(c, (str, Column)):
                      _cols.append(c)
                  else:
                      raise PySparkTypeError(
                          error_class="NOT_COLUMN_OR_LIST_OR_STR",
                          message_parameters={
                              "arg_name": "cols",
                              "arg_type": type(c).__name__,
                          },
                      )
          else:
              raise PySparkTypeError(
                  error_class="NOT_COLUMN_OR_LIST_OR_STR",
                  message_parameters={
                      "arg_name": "cols",
                      "arg_type": type(col).__name__,
                  },
              )
  
      newOrderSpec: List[SortOrder] = []
      for c in _cols:
          if isinstance(c, Column):
              if isinstance(c._expr, SortOrder):
                  newOrderSpec.append(c._expr)
              else:
                  newOrderSpec.append(SortOrder(c._expr))
          else:
              newOrderSpec.append(SortOrder(ColumnReference(c)))
  
      return WindowSpec(
          partitionSpec=self._partitionSpec,
          orderSpec=newOrderSpec,
          frame=self._frame,
      )
  
imports: from pyspark.sql.connect.utils import check_dependencies
  import sys
  from typing import TYPE_CHECKING, Union, Sequence, List, Optional
  from pyspark.sql.connect.column import Column
  from pyspark.sql.connect.expressions import ColumnReference, Expression, SortOrder
  from pyspark.sql.connect.types import JVM_LONG_MIN, JVM_LONG_MAX
  from pyspark.sql.window import Window, WindowSpec
  from pyspark.errors import PySparkTypeError
label_desc: Use image node_id 3 for calling the WindowSpec obj's underlying member method code with example usage: obj.orderBy() and returns: WindowSpec