code: def partitionBy(*cols):
          
          sc = SparkContext._active_spark_context
          jspec = sc._jvm.org.apache.spark.sql.expressions.Window.partitionBy(_to_java_cols(cols))
          return WindowSpec(jspec)
docs: Creates a :class:`WindowSpec` with the partitioning defined.