private fun generateTestLauncher ( isStandaloneTest : Boolean , entryPointFunctionFQN : String )

{ <EOL> val fileText = buildString { <EOL> if ( ! isStandaloneTest ) { <EOL> append ( "<STR_LIT>" ) . appendLine ( testDataFileSettings . nominalPackageName ) <EOL> appendLine ( ) <EOL> } <EOL> append ( generateBoxFunctionLauncher ( entryPointFunctionFQN ) ) <EOL> } <EOL> structure . addFileToMainModule ( fileName = LAUNCHER_FILE_NAME , text = fileText ) <EOL> }

/** Adds a wrapper to run it as Kotlin test. */


{ <EOL> if ( ! processUnconfinedEvent ( ) ) return Long . MAX_VALUE <EOL> return <NUM_LIT:0> <EOL> }

/**
 * Processes next event in this event loop.
 *
 * The result of this function is to be interpreted like this:
 * - `<= 0` -- there are potentially more events for immediate processing;
 * - `> 0` -- a number of nanoseconds to wait for next scheduled event;
 * - [Long.MAX_VALUE] -- no more events.
 *
 * **NOTE**: Must be invoked only from the event loop's thread
 * (no check for performance reasons, may be added in the future).
 */


open fun shouldBeProcessedFromContext ( ) : Boolean

= false

/**
 * Returns `true` if the invoking `runBlocking(context) { ... }` that was passed this event loop in its context
 * parameter should call [processNextEvent] for this event loop (otherwise, it will process thread-local one).
 * By default, event loop implementation is thread-local and should not processed in the context
 * (current thread's event loop should be processed instead).
 */


fun dispatchUnconfined ( task : DispatchedTask < * > )

{ <EOL> val queue = unconfinedQueue ? : <EOL> ArrayDeque < DispatchedTask < * > > ( ) . also { unconfinedQueue = it } <EOL> queue . addLast ( task ) <EOL> }

/**
 * Dispatches task whose dispatcher returned `false` from [CoroutineDispatcher.isDispatchNeeded]
 * into the current event loop.
 */


internal expect inline fun platformAutoreleasePool ( crossinline block : ( ) -> Unit )

/**
 * Used by Darwin targets to wrap a [Runnable.run] call in an Objective-C Autorelease Pool. It is a no-op on JVM, JS and
 * non-Darwin native targets.
 *
 * Coroutines on Darwin targets can call into the Objective-C world, where a callee may push a to-be-returned object to
 * the Autorelease Pool, so as to avoid a premature ARC release before it reaches the caller. This means the pool must
 * be eventually drained to avoid leaks. Since Kotlin Coroutines does not use [NSRunLoop], which provides automatic
 * pool management, it must manage the pool creation and pool drainage manually.
 */


public fun createDummyLogger ( ) : SwiftExportLogger

= object : SwiftExportLogger { <EOL> override fun report ( severity : SwiftExportLogger . Severity , message : String ) { <EOL> println ( "<STR_LIT>" ) <EOL> } <EOL> }

/**
 * Primitive implementation of [SwiftExportLogger] which should be sufficient for testing purposes.
 */


public fun runSwiftExport ( input : InputModule , config : SwiftExportConfig = SwiftExportConfig ( ) , output : SwiftExportOutput , )

{ <EOL> val stableDeclarationsOrder = config . settings . containsKey ( STABLE_DECLARATIONS_ORDER ) <EOL> val renderDocComments = config . settings [ RENDER_DOC_COMMENTS ] != "<STR_LIT:false>" <EOL> val bridgeModuleName = config . settings . getOrElse ( BRIDGE_MODULE_NAME ) { <EOL> config . logger . report ( SwiftExportLogger . Severity . Warning , "<STR_LIT>" ) <EOL> DEFAULT_BRIDGE_MODULE_NAME <EOL> } <EOL> val module = buildSwiftModule ( input , config . distribution , bridgeModuleName = bridgeModuleName ) <EOL> val bridgeRequests = module . buildFunctionBridges ( ) <EOL> module . dumpResultToFiles ( bridgeRequests , output , stableDeclarationsOrder = stableDeclarationsOrder , renderDocComments = renderDocComments ) <EOL> }

/**
 * A root function for running Swift Export from build tool
 */


abstract fun intercept ( callInfo : CallInfo , symbol : FirNamedFunctionSymbol ) : CallReturnType ?

/**
 * Allows a call to be completed with a more specific type than the declared return type of function
 * ```
 * interface Container<out T> { }
 * fun Container<T>.add(item: String): Container<Any>
 * ```
 * at call site `Container<Any>` can be modified to become `Container<NewLocalType>`
 * ```
 * container.add("A")
 * ```
 * this `NewLocalType` can be created in [intercept]. It must be later saved into FIR tree in [transform]
 * Generated declarations should be local because this [FirExtension] works at body resolve stage and thus cannot create new top level declarations
 *
 * When [intercept] returns non-null value, a copy will be created from FirFunction that [symbol]
 * points to. Copy will be used in call completion instead of original function.
 *
 * @return null if plugin is not interested in a [symbol]
 */


abstract fun transform ( call : FirFunctionCall , originalSymbol : FirNamedFunctionSymbol ) : FirFunctionCall

/**
 * @param call to a function that was created with modified [FirResolvedTypeRef] as a result of [intercept].
 * This function doesn't exist in FIR, it is needed to complete the call.
 * @param originalSymbol [intercept] is called with symbol to a declaration that exists somewhere in FIR: library, project code.
 * The same symbol is [originalSymbol].
 * [transform] needs to generate call to [let] with the same return type as [call]
 * and put all generated declarations used in [FirResolvedTypeRef] in statements.
 */


fun PropertyDescriptor . toAccessorBaseName ( config : Accessors ) : String ?

{ <EOL> val isPrimitiveBoolean = type . isPrimitiveBoolean ( ) <EOL> return if ( config . prefix . isEmpty ( ) ) { <EOL> val prefixes = if ( isPrimitiveBoolean ) listOf ( AccessorNames . IS ) else emptyList ( ) <EOL> toPropertyName ( name . identifier , prefixes ) <EOL> } else { <EOL> val id = name . identifier <EOL> val name = toPropertyName ( id , config . prefix ) <EOL> name . takeIf { it . length != id . length } <EOL> } <EOL> }

/**
 * Make property name from variable name
 * Returns null in case getter/setter shouldn't be generated at all
 */


fun analyzeSpecialSerializers ( moduleDescriptor : ModuleDescriptor , annotations : Annotations ) : ClassDescriptor ?

= when { <EOL> annotations . hasAnnotation ( SerializationAnnotations . contextualFqName ) || annotations . hasAnnotation ( SerializationAnnotations . contextualOnPropertyFqName ) -> <EOL> moduleDescriptor . getClassFromSerializationPackage ( SpecialBuiltins . contextSerializer ) <EOL> annotations . hasAnnotation ( SerializationAnnotations . polymorphicFqName ) -> <EOL> moduleDescriptor . getClassFromSerializationPackage ( SpecialBuiltins . polymorphicSerializer ) <EOL> else -> null <EOL> }

/**
 * Returns class descriptor for ContextSerializer or PolymorphicSerializer
 * if [annotations] contains @Contextual or @Polymorphic annotation
 */


fun report ( filePath : String , importedFqName : String )

/**
 * Report import directives, where FqName is [importedFqName].
 * Format of [importedFqName] class is "package.Outer.Inner"
 */


@ Test <EOL> fun testProcessNextEventInCurrentThreadSimple ( )

= runTest { <EOL> expect ( <NUM_LIT:1> ) <EOL> val event = EventSync ( ) <EOL> launch { <EOL> expect ( <NUM_LIT:3> ) <EOL> event . fireEvent ( ) <EOL> } <EOL> expect ( <NUM_LIT:2> ) <EOL> event . blockingAwait ( ) <EOL> finish ( <NUM_LIT:4> ) <EOL> }

/**
 * Simple test for [processNextEventInCurrentThread] API use-case.
 */


@ Test <EOL> fun testProcessNextEventInCurrentThreadDelay ( )

= runTest { <EOL> expect ( <NUM_LIT:1> ) <EOL> val event = EventSync ( ) <EOL> launch { <EOL> expect ( <NUM_LIT:3> ) <EOL> delay ( <NUM_LIT:100> ) <EOL> event . fireEvent ( ) <EOL> } <EOL> expect ( <NUM_LIT:2> ) <EOL> event . blockingAwait ( ) <EOL> finish ( <NUM_LIT:4> ) <EOL> }

/**
 * Test for [processNextEventInCurrentThread] API use-case with delay.
 */


public operator fun get ( index : Int ) : T

/**
 * Returns the value at [index].
 *
 * Note: Indexing takes place according to the initial data, so if you did any manipulations with the ndarray
 * (ex. reshape), then `get` from the ndarray with the same index will return another value.
 */


public override fun iterator ( ) : Iterator < T >


public fun copyOf ( ) : ImmutableMemoryView < T >

/**
 * Returns a new instance with a copied primitive array.
 */


public fun copyInto ( destination : MemoryView < T > , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : MemoryView < T >


public fun getByteArray ( ) : ByteArray

/**
 * Returns [ByteArray] if it is [MemoryViewByteArray].
 */


public fun getShortArray ( ) : ShortArray

/**
 * Returns [ShortArray] if it is [MemoryViewShortArray].
 */


public fun getIntArray ( ) : IntArray

/**
 * Returns [IntArray] if it is [MemoryViewIntArray].
 */


public fun getLongArray ( ) : LongArray

/**
 * Returns [LongArray] if it is [MemoryViewLongArray].
 */


public fun getFloatArray ( ) : FloatArray

/**
 * Returns [FloatArray] if it is [MemoryViewFloatArray].
 *
 * Note: For [MemoryViewComplexFloatArray], an array will be returned storing real and imaginary parts continuously.
 */


public fun getDoubleArray ( ) : DoubleArray

/**
 * Returns [DoubleArray].
 *
 * Note: For [MemoryViewComplexDoubleArray], an array will be returned storing real and imaginary parts continuously.
 */


public fun getComplexFloatArray ( ) : ComplexFloatArray

/**
 * Returns [ComplexFloatArray] if it is [MemoryViewFloatArray].
 */


public fun getComplexDoubleArray ( ) : ComplexDoubleArray

/**
 * Returns [ComplexDoubleArray] if it is [MemoryViewComplexDoubleArray].
 */


public abstract operator fun set ( index : Int , value : T )

/**
 * Replaces the element at the given [index] with the specified [value].
 *
 * Note: Indexing takes place according to the initial data.
 */


public fun < T > initMemoryView ( size : Int , dataType : DataType ) : MemoryView < T >

{ <EOL> val t = when ( dataType ) { <EOL> DataType . ByteDataType -> MemoryViewByteArray ( ByteArray ( size ) ) <EOL> DataType . ShortDataType -> MemoryViewShortArray ( ShortArray ( size ) ) <EOL> DataType . IntDataType -> MemoryViewIntArray ( IntArray ( size ) ) <EOL> DataType . LongDataType -> MemoryViewLongArray ( LongArray ( size ) ) <EOL> DataType . FloatDataType -> MemoryViewFloatArray ( FloatArray ( size ) ) <EOL> DataType . DoubleDataType -> MemoryViewDoubleArray ( DoubleArray ( size ) ) <EOL> DataType . ComplexFloatDataType -> MemoryViewComplexFloatArray ( ComplexFloatArray ( size ) ) <EOL> DataType . ComplexDoubleDataType -> MemoryViewComplexDoubleArray ( ComplexDoubleArray ( size ) ) <EOL> } <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> return t as MemoryView < T > <EOL> }

/**
 * Creates a [MemoryView] based [size] and [dataType].
 */


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> public fun < T > initMemoryView ( size : Int , dataType : DataType , init : ( Int ) -> T ) : MemoryView < T >

{ <EOL> val t = when ( dataType ) { <EOL> DataType . ByteDataType -> MemoryViewByteArray ( ByteArray ( size , init as ( Int ) -> Byte ) ) <EOL> DataType . ShortDataType -> MemoryViewShortArray ( ShortArray ( size , init as ( Int ) -> Short ) ) <EOL> DataType . IntDataType -> MemoryViewIntArray ( IntArray ( size , init as ( Int ) -> Int ) ) <EOL> DataType . LongDataType -> MemoryViewLongArray ( LongArray ( size , init as ( Int ) -> Long ) ) <EOL> DataType . FloatDataType -> MemoryViewFloatArray ( FloatArray ( size , init as ( Int ) -> Float ) ) <EOL> DataType . DoubleDataType -> MemoryViewDoubleArray ( DoubleArray ( size , init as ( Int ) -> Double ) ) <EOL> DataType . ComplexFloatDataType -> MemoryViewComplexFloatArray ( ComplexFloatArray ( size , init as ( Int ) -> ComplexFloat ) ) <EOL> DataType . ComplexDoubleDataType -> MemoryViewComplexDoubleArray ( ComplexDoubleArray ( size , init as ( Int ) -> ComplexDouble ) ) <EOL> } <EOL> return t as MemoryView < T > <EOL> }

/**
 * Create a [MemoryView] based [size] and [dataType], where each elements will be initialized according
 * to the given [init] function.
 */


public operator fun < T > Set < T > . minus ( element : T ) : Set < T >

{ <EOL> val result = LinkedHashSet < T > ( mapCapacity ( size ) ) <EOL> var removed = false <EOL> return this . filterTo ( result ) { if ( ! removed && it == element ) { removed = true ; false } else true } <EOL> }

/**
 * Returns a set containing all elements of the original set except the given [element].
 *
 * The returned set preserves the element iteration order of the original set.
 */


public operator fun < T > Set < T > . minus ( elements : Array < out T > ) : Set < T >

{ <EOL> val result = LinkedHashSet < T > ( this ) <EOL> result . removeAll ( elements ) <EOL> return result <EOL> }

/**
 * Returns a set containing all elements of the original set except the elements contained in the given [elements] array.
 *
 * The returned set preserves the element iteration order of the original set.
 */


public operator fun < T > Set < T > . minus ( elements : Iterable < T > ) : Set < T >

{ <EOL> val other = elements . convertToListIfNotCollection ( ) <EOL> if ( other . isEmpty ( ) ) <EOL> return this . toSet ( ) <EOL> if ( other is Set ) <EOL> return this . filterNotTo ( LinkedHashSet < T > ( ) ) { it in other } <EOL> val result = LinkedHashSet < T > ( this ) <EOL> result . removeAll ( other ) <EOL> return result <EOL> }

/**
 * Returns a set containing all elements of the original set except the elements contained in the given [elements] collection.
 *
 * The returned set preserves the element iteration order of the original set.
 */


public operator fun < T > Set < T > . minus ( elements : Sequence < T > ) : Set < T >

/**
 * Returns a set containing all elements of the original set except the elements contained in the given [elements] sequence.
 *
 * The returned set preserves the element iteration order of the original set.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun < T > Set < T > . minusElement ( element : T ) : Set < T >

{ <EOL> return minus ( element ) <EOL> }


public operator fun < T > Set < T > . plus ( element : T ) : Set < T >

{ <EOL> val result = LinkedHashSet < T > ( mapCapacity ( size + <NUM_LIT:1> ) ) <EOL> result . addAll ( this ) <EOL> result . add ( element ) <EOL> return result <EOL> }

/**
 * Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set.
 *
 * The returned set preserves the element iteration order of the original set.
 */


public operator fun < T > Set < T > . plus ( elements : Array < out T > ) : Set < T >

{ <EOL> val result = LinkedHashSet < T > ( mapCapacity ( this . size + elements . size ) ) <EOL> result . addAll ( this ) <EOL> result . addAll ( elements ) <EOL> return result <EOL> }

/**
 * Returns a set containing all elements of the original set and the given [elements] array,
 * which aren't already in this set.
 *
 * The returned set preserves the element iteration order of the original set.
 */


public operator fun < T > Set < T > . plus ( elements : Iterable < T > ) : Set < T >

{ <EOL> val result = LinkedHashSet < T > ( mapCapacity ( elements . collectionSizeOrNull ( ) ? . let { this . size + it } ? : this . size * <NUM_LIT:2> ) ) <EOL> result . addAll ( this ) <EOL> result . addAll ( elements ) <EOL> return result <EOL> }

/**
 * Returns a set containing all elements of the original set and the given [elements] collection,
 * which aren't already in this set.
 * The returned set preserves the element iteration order of the original set.
 */


public operator fun < T > Set < T > . plus ( elements : Sequence < T > ) : Set < T >

{ <EOL> val result = LinkedHashSet < T > ( mapCapacity ( this . size * <NUM_LIT:2> ) ) <EOL> result . addAll ( this ) <EOL> result . addAll ( elements ) <EOL> return result <EOL> }

/**
 * Returns a set containing all elements of the original set and the given [elements] sequence,
 * which aren't already in this set.
 *
 * The returned set preserves the element iteration order of the original set.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun < T > Set < T > . plusElement ( element : T ) : Set < T >

{ <EOL> return plus ( element ) <EOL> }


{ <EOL> val id = dri . toString ( ) <EOL> driMap [ id ] = dri <EOL> return id <EOL> }

/**
 * @return key of the stored DRI
 */


public fun store ( documentationNode : DocumentationNode ) : String

{ <EOL> val id = UUID . randomUUID ( ) . toString ( ) <EOL> inheritDocSections [ id ] = documentationNode <EOL> return id <EOL> }

/**
 * @return key of the stored documentation node
 */


{ <EOL> assertSame ( Dispatchers . JavaFx , Dispatchers . Main ) <EOL> }

/** Tests that the Main dispatcher is in fact the JavaFx one. */


{ <EOL> val rnd = Random ( SEED ) <EOL> val data = Array ( <NUM_LIT> ) { doubleArrayOf ( <NUM_LIT:0.0> , <NUM_LIT:0.0> , <NUM_LIT:0.0> , <NUM_LIT:0.0> , <NUM_LIT:0.0> ) } <EOL> for ( i in data . indices ) { <EOL> data [ i ] [ <NUM_LIT:1> ] = <NUM_LIT:2> * ( rnd . nextDouble ( ) - <NUM_LIT> ) <EOL> data [ i ] [ <NUM_LIT:2> ] = <NUM_LIT:2> * ( rnd . nextDouble ( ) - <NUM_LIT> ) <EOL> data [ i ] [ <NUM_LIT:3> ] = <NUM_LIT:2> * ( rnd . nextDouble ( ) - <NUM_LIT> ) <EOL> data [ i ] [ <NUM_LIT:4> ] = <NUM_LIT:2> * ( rnd . nextDouble ( ) - <NUM_LIT> ) <EOL> data [ i ] [ <NUM_LIT:0> ] = data [ i ] [ <NUM_LIT:1> ] - <NUM_LIT:2> * data [ i ] [ <NUM_LIT:2> ] + <NUM_LIT> * data [ i ] [ <NUM_LIT:3> ] - <NUM_LIT> * data [ i ] [ <NUM_LIT:4> ] + rnd . nextDouble ( <NUM_LIT> ) <EOL> } <EOL> data . shuffle ( ) <EOL> fun extractX ( ) : Array < FloatArray > { <EOL> val init : ( index : Int ) -> FloatArray = { index -> <EOL> floatArrayOf ( data [ index ] [ <NUM_LIT:1> ] . toFloat ( ) , data [ index ] [ <NUM_LIT:2> ] . toFloat ( ) , data [ index ] [ <NUM_LIT:3> ] . toFloat ( ) , data [ index ] [ <NUM_LIT:4> ] . toFloat ( ) ) <EOL> } <EOL> return Array ( data . size , init = init ) <EOL> } <EOL> fun extractY ( ) : FloatArray { <EOL> val labels = FloatArray ( data . size ) { <NUM_LIT:0.0f> } <EOL> for ( i in labels . indices ) { <EOL> labels [ i ] = data [ i ] [ <NUM_LIT:0> ] . toFloat ( ) <EOL> } <EOL> return labels <EOL> } <EOL> val dataset = OnHeapDataset . create ( extractX ( ) , extractY ( ) ) <EOL> val ( train , test ) = dataset . split ( <NUM_LIT> ) <EOL> model . use { <EOL> it . compile ( optimizer = Adam ( ) , loss = Losses . MSE , metric = Metrics . MAE ) <EOL> it . logSummary ( ) <EOL> it . fit ( dataset = train , epochs = EPOCHS , batchSize = TRAINING_BATCH_SIZE ) <EOL> repeat ( <NUM_LIT:100> ) { id -> <EOL> val xReal = test . getX ( id ) <EOL> val yReal = test . getY ( id ) <EOL> val yPred = it . predictSoftly ( xReal ) <EOL> println ( "<STR_LIT>" ) <EOL> } <EOL> val mae = it . evaluate ( dataset = test , batchSize = TEST_BATCH_SIZE ) . metrics [ Metrics . MAE ] <EOL> println ( "<STR_LIT>" + it . getLayer ( "<STR_LIT>" ) . weights [ "<STR_LIT>" ] . contentDeepToString ( ) ) <EOL> println ( "<STR_LIT>" + it . getLayer ( "<STR_LIT>" ) . weights [ "<STR_LIT>" ] . contentDeepToString ( ) ) <EOL> println ( "<STR_LIT>" ) <EOL> repeat ( <NUM_LIT:100> ) { id -> <EOL> val xReal = test . getX ( id ) <EOL> val yReal = test . getY ( id ) <EOL> val yPred = it . predictSoftly ( xReal ) <EOL> println ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> }

/**
 * This example shows how to do regression from scratch, starting from generated dataset, using simple Dense-based [model] with 1 neuron.
 *
 * It includes:
 * - dataset creation
 * - dataset splitting
 * - model compilation
 * - model training
 * - model evaluation
 * - model weights printing
 */


= linearRegression ( )


abstract fun perform ( affected : Any ? ) : Any ?

/**
 * Returns `null` is operation was performed successfully or some other
 * object that indicates the failure reason.
 */


fun getSingleTestRun ( testCaseId : TestCaseId , settings : Settings ) : TestRun

= withTestExecutable ( testCaseId , settings ) { testCase , executable -> <EOL> createSingleTestRun ( testCase , executable ) <EOL> }

/**
 * Produces a single [TestRun] per [TestCase]. So-called "one test case/one test run" mode.
 *
 * If [TestCase] contains multiple functions annotated with [kotlin.test.Test], then all these functions will be executed
 * in one shot. If either function fails, the whole JUnit test will be considered as failed.
 *
 * Example:
 * ```
 * //+++ testData file (foo.kt): +++//
 * @kotlin.test.Test
 * fun one() { /* ... */ }
 *
 * @kotlin.test.Test
 * fun two() { /* ... */ }
 *
 * //+++ generated JUnit test suite: +++//
 * public class MyTestSuiteGenerated {
 * @org.junit.jupiter.api.Test
 * @org.jetbrains.kotlin.test.TestMetadata("foo.kt")
 * public void testFoo() {
 * // Compiles foo.kt with test-runner, probably together with other testData files (bar.kt, qux.kt, ...).
 * // Then executes FooKt.one() and FooKt.two() test functions one after another in one shot.
 * // If either of test functions fails, the whole "testFoo()" JUnit test is marked as failed.
 * }
 * }
 * ```
 */


fun getTestRuns ( testCaseId : TestCaseId , settings : Settings ) : Collection < TreeNode < TestRun > >

= withTestExecutable ( testCaseId , settings ) { testCase , executable -> <EOL> fun createTestRun ( testRunName : String , testName : TestName ? ) = createTestRun ( testCase , executable , testRunName , testName ) <EOL> when ( testCase . kind ) { <EOL> TestKind . STANDALONE_NO_TR , TestKind . STANDALONE_LLDB -> { <EOL> val testRunName = ( testCase . extras < NoTestRunnerExtras > ( ) . entryPoint ? : "<STR_LIT:main>" ) . substringAfterLast ( '<CHAR_LIT:.>' ) <EOL> val testRun = createTestRun ( testRunName , testName = null ) <EOL> TreeNode . oneLevel ( testRun ) <EOL> } <EOL> TestKind . REGULAR , TestKind . STANDALONE -> { <EOL> val testNames = executable . testNames . filterIrrelevant ( testCase ) <EOL> testNames . buildTree ( TestName :: packageName ) { testName -> <EOL> createTestRun ( testName . functionName , testName ) <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * Produces at least one [TestRun] per [TestCase]. So-called "one test function/one test run" mode.
 *
 * If [TestCase] contains multiple functions annotated with [kotlin.test.Test], then a separate [TestRun] will be produced
 * for each such function.
 *
 * This allows having a better granularity in tests. So that every test method inside [TestCase] will be considered
 * as an individual JUnit test, and will be presented as a separate row in JUnit test report.
 *
 * Example:
 * ```
 * //+++ testData file (foo.kt): +++//
 * @kotlin.test.Test
 * fun one() { /* ... */ }
 *
 * @kotlin.test.Test
 * fun two() { /* ... */ }
 *
 * //+++ generated JUnit test suite: +++//
 * public class MyTestSuiteGenerated {
 * @org.junit.jupiter.api.TestFactory
 * @org.jetbrains.kotlin.test.TestMetadata("foo.kt")
 * public Collection<org.junit.jupiter.api.DynamicNode> testFoo() {
 * // Compiles foo.kt with test-runner, probably together with other testData files (bar.kt, qux.kt, ...).
 * // Then produces two instances of DynamicTest for FooKt.one() and FooKt.two() functions.
 * // Each DynamicTest is executed as a separate JUnit test.
 * // So if FooKt.one() fails and FooKt.two() succeeds, then "testFoo.one" JUnit test will be presented as failed
 * // in the test report, and "testFoo.two" will be presented as passed.
 * }
 * }
 * ```
 */


{ <EOL> return functions . callUDF ( udfName ) <EOL> }

/**
 * Calls the [functions.callUDF] for the UDF with the [udfName] and the given columns.
 */


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified R > UDFRegistration . register ( name : String , noinline func : ( ) -> R ) : UDFWrapper0

{ <EOL> register ( name , UDF0 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper0 ( name ) <EOL> }

/**
 * Registers the [func] with its [name] in [this].
 */


operator fun invoke ( param0 : Column ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 ) -> R ) : UDFWrapper1

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF1 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper1 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 ) -> R , ) : UDFWrapper2

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF2 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper2 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 ) -> R , ) : UDFWrapper3

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF3 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper3 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 ) -> R , ) : UDFWrapper4

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF4 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper4 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 ) -> R , ) : UDFWrapper5

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF5 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper5 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 ) -> R , ) : UDFWrapper6

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF6 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper6 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ) -> R , ) : UDFWrapper7

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF7 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper7 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ) -> R , ) : UDFWrapper8

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF8 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper8 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ) -> R , ) : UDFWrapper9

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF9 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper9 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ) -> R , ) : UDFWrapper10

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF10 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper10 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ) -> R , ) : UDFWrapper11

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF11 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper11 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ) -> R , ) : UDFWrapper12

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF12 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper12 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , param12 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 , param12 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified T12 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ) -> R , ) : UDFWrapper13

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T12 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF13 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper13 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , param12 : Column , param13 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 , param12 , param13 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified T12 , reified T13 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ) -> R , ) : UDFWrapper14

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T12 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T13 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF14 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper14 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , param12 : Column , param13 : Column , param14 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 , param12 , param13 , param14 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified T12 , reified T13 , reified T14 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ) -> R , ) : UDFWrapper15

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T12 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T13 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T14 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF15 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper15 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , param12 : Column , param13 : Column , param14 : Column , param15 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 , param12 , param13 , param14 , param15 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified T12 , reified T13 , reified T14 , reified T15 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 ) -> R , ) : UDFWrapper16

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T12 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T13 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T14 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T15 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF16 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper16 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , param12 : Column , param13 : Column , param14 : Column , param15 : Column , param16 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 , param12 , param13 , param14 , param15 , param16 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified T12 , reified T13 , reified T14 , reified T15 , reified T16 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 ) -> R , ) : UDFWrapper17

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T12 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T13 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T14 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T15 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T16 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF17 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper17 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , param12 : Column , param13 : Column , param14 : Column , param15 : Column , param16 : Column , param17 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 , param12 , param13 , param14 , param15 , param16 , param17 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified T12 , reified T13 , reified T14 , reified T15 , reified T16 , reified T17 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 ) -> R , ) : UDFWrapper18

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T12 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T13 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T14 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T15 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T16 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T17 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF18 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper18 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , param12 : Column , param13 : Column , param14 : Column , param15 : Column , param16 : Column , param17 : Column , param18 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 , param12 , param13 , param14 , param15 , param16 , param17 , param18 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified T12 , reified T13 , reified T14 , reified T15 , reified T16 , reified T17 , reified T18 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 ) -> R , ) : UDFWrapper19

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T12 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T13 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T14 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T15 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T16 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T17 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T18 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF19 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper19 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , param12 : Column , param13 : Column , param14 : Column , param15 : Column , param16 : Column , param17 : Column , param18 : Column , param19 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 , param12 , param13 , param14 , param15 , param16 , param17 , param18 , param19 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified T12 , reified T13 , reified T14 , reified T15 , reified T16 , reified T17 , reified T18 , reified T19 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 ) -> R , ) : UDFWrapper20

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T12 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T13 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T14 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T15 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T16 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T17 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T18 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T19 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF20 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper20 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , param12 : Column , param13 : Column , param14 : Column , param15 : Column , param16 : Column , param17 : Column , param18 : Column , param19 : Column , param20 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 , param12 , param13 , param14 , param15 , param16 , param17 , param18 , param19 , param20 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified T12 , reified T13 , reified T14 , reified T15 , reified T16 , reified T17 , reified T18 , reified T19 , reified T20 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 ) -> R , ) : UDFWrapper21

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T12 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T13 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T14 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T15 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T16 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T17 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T18 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T19 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T20 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF21 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper21 ( name ) <EOL> }


operator fun invoke ( param0 : Column , param1 : Column , param2 : Column , param3 : Column , param4 : Column , param5 : Column , param6 : Column , param7 : Column , param8 : Column , param9 : Column , param10 : Column , param11 : Column , param12 : Column , param13 : Column , param14 : Column , param15 : Column , param16 : Column , param17 : Column , param18 : Column , param19 : Column , param20 : Column , param21 : Column , ) : Column

{ <EOL> return functions . callUDF ( udfName , param0 , param1 , param2 , param3 , param4 , param5 , param6 , param7 , param8 , param9 , param10 , param11 , param12 , param13 , param14 , param15 , param16 , param17 , param18 , param19 , param20 , param21 ) <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> @ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . HIDDEN ) <EOL> inline fun < reified T0 , reified T1 , reified T2 , reified T3 , reified T4 , reified T5 , reified T6 , reified T7 , reified T8 , reified T9 , reified T10 , reified T11 , reified T12 , reified T13 , reified T14 , reified T15 , reified T16 , reified T17 , reified T18 , reified T19 , reified T20 , reified T21 , reified R > UDFRegistration . register ( name : String , noinline func : ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ) -> R , ) : UDFWrapper22

{ <EOL> T0 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T1 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T2 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T3 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T4 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T5 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T6 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T7 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T8 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T9 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T10 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T11 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T12 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T13 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T14 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T15 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T16 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T17 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T18 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T19 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T20 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> T21 :: class . checkForValidType ( "<STR_LIT>" ) <EOL> register ( name , UDF22 ( func ) , schema ( typeOf < R > ( ) ) . unWrap ( ) ) <EOL> return UDFWrapper22 ( name ) <EOL> }


public fun < C > columns ( selector : ColumnsSelector < T , C > ) : List < DataColumn < C > >

= dataFrame . get ( selector )

/**
 * Fetches the specified columns from the dataframe.
 *
 * @param selector a selector to determine the columns to be fetched.
 * @return a list of selected data columns.
 */


public fun < C > columns ( vararg columns : String ) : List < AnyCol >

= dataFrame . getColumns ( * columns )

/**
 * Fetches the specified columns from the dataframe by their names.
 *
 * @param columns names of the desired columns.
 * @return a list of selected data columns.
 */


public inline fun groupBy ( columns : Iterable < String > , block : GroupedContext < T , T > . ( ) -> Unit )

{ <EOL> val groupBy = dataFrame . groupBy ( * columns . toList ( ) . toTypedArray ( ) ) <EOL> GroupedContext ( groupBy , datasetHandler . buffer , this ) . apply ( block ) <EOL> }

/**
 * Creates and initializes a new context with the dataframe grouped by the specified column names.
 *
 * @param columns the column names to group the dataframe by.
 * @param block a lambda with receiver block that configures the new grouped context.
 */


public inline fun groupBy ( vararg columns : String , block : GroupedContext < T , T > . ( ) -> Unit ) : Unit

= groupBy ( columns . toList ( ) , block )


public inline fun groupBy ( vararg columnReferences : ColumnReference < * > , block : GroupedContext < T , T > . ( ) -> Unit ) : Unit

= groupBy ( columnReferences . map { it . name ( ) } , block )

/**
 * Creates and initializes a new context with the dataframe grouped by the given column references.
 *
 * @param columnReferences references to the columns to group by.
 * @param block a lambda with receiver block that configures the new grouped context.
 */


public inline fun groupBy ( columnReferences : List < ColumnReference < * > > , block : GroupedContext < T , T > . ( ) -> Unit ) : Unit

/**
 * Creates and initializes a new context with the dataframe grouped by the given column references.
 *
 * @param columnReferences a list of references to the columns to group by.
 * @param block a lambda with receiver block that configures the new grouped context.
 */


inline fun < T > Iterator < T > . stopAfter ( crossinline predicate : ( T ) -> Boolean ) : Iterator < T >

= iterator { <EOL> for ( element in this @ stopAfter ) { <EOL> yield ( element ) <EOL> if ( predicate ( element ) ) { <EOL> break <EOL> } <EOL> } <EOL> }

/**
 * _Example_
 * The following will print `1`, `2` and `3` when executed:
 * ```
 * arrayOf(1, 2, 3, 4, 5)
 * .iterator()
 * .stopAfter { it == 3 }
 * .forEach(::println)
 * ```
 * @return an iterator, which stops [this] Iterator after first element for which [predicate] returns `true`
 */


@ Test <EOL> fun testTimeoutCancellationFailRace ( )

{ <EOL> repeat ( <NUM_LIT:10> * stressTestMultiplier ) { <EOL> runBlocking { <EOL> withTimeoutOrNull ( <NUM_LIT:10> ) { <EOL> while ( true ) { <EOL> var caught = false <EOL> try { <EOL> CompletableFuture . supplyAsync { <EOL> throw TestException ( ) <EOL> } . await ( ) <EOL> } catch ( ignored : TestException ) { <EOL> caught = true <EOL> } <EOL> assertTrue ( caught ) <EOL> } <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * See [https://github.com/Kotlin/kotlinx.coroutines/issues/892]
 */


@ Test <EOL> fun testConsistentExceptionUnwrapping ( )

= runTest { <EOL> expect ( <NUM_LIT:1> ) <EOL> val fFast = CompletableFuture . supplyAsync { <EOL> expect ( <NUM_LIT:2> ) <EOL> throw TestException ( ) <EOL> } <EOL> fFast . checkFutureException < TestException > ( ) <EOL> expect ( <NUM_LIT:3> ) <EOL> val dFast = fFast . asDeferred ( ) <EOL> assertFailsWith < TestException > { fFast . await ( ) } <EOL> assertFailsWith < TestException > { dFast . await ( ) } <EOL> expect ( <NUM_LIT:4> ) <EOL> val barrier = CyclicBarrier ( <NUM_LIT:2> ) <EOL> val fSlow = CompletableFuture . supplyAsync { <EOL> barrier . await ( ) <EOL> expect ( <NUM_LIT:6> ) <EOL> throw TestException ( ) <EOL> } <EOL> val dSlow = fSlow . asDeferred ( ) <EOL> launch ( start = CoroutineStart . UNDISPATCHED ) { <EOL> expect ( <NUM_LIT:5> ) <EOL> assertFailsWith < TestException > { fSlow . await ( ) } <EOL> assertFailsWith < TestException > { dSlow . await ( ) } <EOL> finish ( <NUM_LIT:7> ) <EOL> } <EOL> barrier . await ( ) <EOL> fSlow . checkFutureException < TestException > ( ) <EOL> }

/**
 * Tests that both [CompletionStage.await] and [CompletionStage.asDeferred] consistently unwrap
 * [CompletionException] both in their slow and fast paths.
 * See [issue #1479](https://github.com/Kotlin/kotlinx.coroutines/issues/1479).
 */


@ Test <EOL> fun testCompletedStageAwait ( )

= runTest { <EOL> val stage = CompletableFuture . completedStage ( "<STR_LIT:OK>" ) <EOL> assertEquals ( "<STR_LIT:OK>" , stage . await ( ) ) <EOL> }

/**
 * https://github.com/Kotlin/kotlinx.coroutines/issues/2456
 */


@ Test <EOL> fun testCompletedStageAsDeferredAwait ( )

= runTest { <EOL> val stage = CompletableFuture . completedStage ( "<STR_LIT:OK>" ) <EOL> val deferred = stage . asDeferred ( ) <EOL> assertEquals ( "<STR_LIT:OK>" , deferred . await ( ) ) <EOL> }


protected fun irEqual ( lhs : IrExpression , rhs : IrExpression ) : IrExpression

{ <EOL> return irCall ( context . irBuiltIns . eqeqSymbol , null , null , null , lhs , rhs ) <EOL> }

/** Compare [lhs] and [rhs] using structural equality (`==`). */


protected fun irNotEqual ( lhs : IrExpression , rhs : IrExpression ) : IrExpression

{ <EOL> return irNot ( irEqual ( lhs , rhs ) ) <EOL> }

/** Compare [lhs] and [rhs] using structural inequality (`!=`). */


@ Test <EOL> fun testChannelBroadcastLazyCancel ( )

= runTest { <EOL> expect ( <NUM_LIT:1> ) <EOL> val a = produce { <EOL> expect ( <NUM_LIT:3> ) <EOL> assertFailsWith < CancellationException > { send ( "<STR_LIT>" ) } <EOL> expect ( <NUM_LIT:5> ) <EOL> } <EOL> expect ( <NUM_LIT:2> ) <EOL> yield ( ) <EOL> val b = a . broadcast ( ) <EOL> b . cancel ( ) <EOL> expect ( <NUM_LIT:4> ) <EOL> yield ( ) <EOL> assertTrue ( a . isClosedForReceive ) <EOL> finish ( <NUM_LIT:6> ) <EOL> }

/**
 * See https://github.com/Kotlin/kotlinx.coroutines/issues/1713
 */


internal fun convTransposeOutputLength ( inputLength : Long , filterSize : Int , padding : ConvPadding , outputPaddingStart : Int ? , outputPaddingEnd : Int ? , stride : Int , dilation : Int ) : Long

{ <EOL> val dilatedFilterSize = dilatedFilterSize ( filterSize , dilation ) <EOL> if ( outputPaddingEnd == null || outputPaddingStart == null ) { <EOL> return when ( padding ) { <EOL> ConvPadding . VALID -> inputLength * stride + max ( dilatedFilterSize - stride , <NUM_LIT:0> ) <EOL> ConvPadding . SAME -> inputLength * stride <EOL> ConvPadding . FULL -> inputLength * stride - ( stride + dilatedFilterSize - <NUM_LIT:2> ) <EOL> } <EOL> } <EOL> val totalPadding = convTransposePadding ( padding , outputPaddingStart , outputPaddingEnd , filterSize , dilation ) . sum ( ) <EOL> return ( inputLength - <NUM_LIT:1> ) * stride + dilatedFilterSize + totalPadding <EOL> }

/**
 * Calculates output length after applying transposed convolution operation on a single axis.
 */


fun KtClassOrObject . toLightClass ( ) : KtLightClass ?

= KotlinAsJavaSupport . getInstance ( project ) . getLightClass ( this )

/**
 * Can be null in scripts and for elements from non-jvm modules.
 */


fun < T > Product1 < T > . first ( ) : T

= this . _1 ( )

/** Returns the first value of this Tuple or Product. */


= this . _1 ( )

/** Returns the last value of this Tuple or Product. */


fun < T > Product2 < T , * > . first ( ) : T

= this . _1 ( )


fun < T > Product2 < * , T > . last ( ) : T

= this . _2 ( )


fun < T > Product3 < T , * , * > . first ( ) : T

= this . _1 ( )


fun < T > Product3 < * , * , T > . last ( ) : T

= this . _3 ( )


fun < T > Product4 < T , * , * , * > . first ( ) : T

= this . _1 ( )


fun < T > Product4 < * , * , * , T > . last ( ) : T

= this . _4 ( )


fun < T > Product5 < T , * , * , * , * > . first ( ) : T

= this . _1 ( )


fun < T > Product5 < * , * , * , * , T > . last ( ) : T

= this . _5 ( )


= this . _1 ( )


= this . _6 ( )


= this . _7 ( )


= this . _8 ( )


= this . _9 ( )


= this . _10 ( )


= this . _11 ( )


= this . _12 ( )


= this . _13 ( )


= this . _14 ( )


= this . _15 ( )


= this . _16 ( )


= this . _17 ( )


= this . _18 ( )


= this . _19 ( )


= this . _20 ( )


= this . _21 ( )


= this . _1 ( )


= this . _22 ( )


fun replaceVariables ( str : String , mapping : Map < String , String > , )

= mapping . asSequence ( ) . fold ( str ) { s , template -> <EOL> s . replace ( "<STR_LIT>" , template . value ) <EOL> }

/**
 * Replace all $<name> substrings in [str] with corresponding
 * [mapping] values
 */


public fun useLogger ( logger : KotlinLogger ) : JvmCompilationConfiguration

/**
 * @see [JvmCompilationConfiguration.logger]
 */


public fun useKotlinScriptFilenameExtensions ( kotlinScriptExtensions : Collection < String > ) : JvmCompilationConfiguration

/**
 * @see [JvmCompilationConfiguration.kotlinScriptFilenameExtensions]
 */


public fun makeClasspathSnapshotBasedIncrementalCompilationConfiguration ( ) : ClasspathSnapshotBasedIncrementalJvmCompilationConfiguration

/**
 * Provides a default [ClasspathSnapshotBasedIncrementalJvmCompilationConfiguration] allowing to use it as is or customizing for specific requirements.
 * Could be used as an overview to default values of the options (as they are implementation-specific).
 * @see [useIncrementalCompilation]
 */


public fun < P : IncrementalCompilationApproachParameters > useIncrementalCompilation ( workingDirectory : File , sourcesChanges : SourcesChanges , approachParameters : P , options : IncrementalJvmCompilationConfiguration < P > , )

{ <EOL> error ( "<STR_LIT>" ) <EOL> }

/**
 * Configures usage of incremental compilation.
 * @param workingDirectory a working directory for incremental compilation internal state
 * @param sourcesChanges an instance of [SourcesChanges]
 * @param approachParameters an object representing mandatory parameters specific for the selected incremental compilation approach
 * @param options an object representing optional parameters and handles specific for the selected incremental compilation approach
 * @see [makeClasspathSnapshotBasedIncrementalCompilationConfiguration]
 */


public fun setRootProjectDir ( rootProjectDir : File ) : IncrementalJvmCompilationConfiguration < P >

/**
 * @see [IncrementalJvmCompilationConfiguration.rootProjectDir]
 */


public fun setBuildDir ( buildDir : File ) : IncrementalJvmCompilationConfiguration < P >

/**
 * @see [IncrementalJvmCompilationConfiguration.buildDir]
 */


public fun usePreciseJavaTracking ( value : Boolean ) : IncrementalJvmCompilationConfiguration < P >

/**
 * @see [IncrementalJvmCompilationConfiguration.preciseJavaTrackingEnabled]
 */


public fun usePreciseCompilationResultsBackup ( value : Boolean ) : IncrementalJvmCompilationConfiguration < P >

/**
 * @see [IncrementalJvmCompilationConfiguration.preciseCompilationResultsBackupEnabled]
 */


public fun keepIncrementalCompilationCachesInMemory ( value : Boolean ) : IncrementalJvmCompilationConfiguration < P >

/**
 * @see [IncrementalJvmCompilationConfiguration.incrementalCompilationCachesKeptInMemory]
 */


public fun forceNonIncrementalMode ( value : Boolean = true ) : IncrementalJvmCompilationConfiguration < P >

/**
 * @see [forcedNonIncrementalMode]
 */


public fun useOutputDirs ( outputDirs : Collection < File > ) : IncrementalJvmCompilationConfiguration < P >

/**
 * @see [IncrementalJvmCompilationConfiguration.outputDirs]]
 */


public fun assureNoClasspathSnapshotsChanges ( value : Boolean = true ) : ClasspathSnapshotBasedIncrementalJvmCompilationConfiguration

/**
 * @see [assuredNoClasspathSnapshotsChanges]
 */


internal fun PhaseEngine < NativeGenerationState > . compileModule ( module : IrModuleFragment , bitcodeFile : java . io . File , cExportFiles : CExportFiles ? )

{ <EOL> runBackendCodegen ( module , cExportFiles ) <EOL> val checkExternalCalls = context . config . checkStateAtExternalCalls <EOL> if ( checkExternalCalls ) { <EOL> runPhase ( CheckExternalCallsPhase ) <EOL> } <EOL> newEngine ( context as BitcodePostProcessingContext ) { it . runBitcodePostProcessing ( ) } <EOL> if ( checkExternalCalls ) { <EOL> runPhase ( RewriteExternalCallsCheckerGlobals ) <EOL> } <EOL> if ( context . config . produce . isFullCache ) { <EOL> runPhase ( SaveAdditionalCacheInfoPhase ) <EOL> } <EOL> runPhase ( WriteBitcodeFilePhase , WriteBitcodeFileInput ( context . llvm . module , bitcodeFile ) ) <EOL> }

/**
 * 1. Runs IR lowerings
 * 2. Runs LTO.
 * 3. Translates IR to LLVM IR.
 * 4. Optimizes it.
 * 5. Serializes it to a bitcode file.
 */


private fun PhaseEngine < NativeGenerationState > . runCodegen ( module : IrModuleFragment )

{ <EOL> val optimize = context . shouldOptimize ( ) <EOL> module . files . forEach { <EOL> runPhase ( ReturnsInsertionPhase , it ) <EOL> } <EOL> val moduleDFG = runPhase ( BuildDFGPhase , module , disable = ! optimize ) <EOL> val devirtualizationAnalysisResults = runPhase ( DevirtualizationAnalysisPhase , DevirtualizationAnalysisInput ( module , moduleDFG ) , disable = ! optimize ) <EOL> val dceResult = runPhase ( DCEPhase , DCEInput ( module , moduleDFG , devirtualizationAnalysisResults ) , disable = ! optimize ) <EOL> runPhase ( RemoveRedundantCallsToStaticInitializersPhase , RedundantCallsInput ( moduleDFG , devirtualizationAnalysisResults , module ) , disable = ! optimize ) <EOL> runPhase ( DevirtualizationPhase , DevirtualizationInput ( module , devirtualizationAnalysisResults ) , disable = ! optimize ) <EOL> module . files . forEach { <EOL> runPhase ( PropertyAccessorInlinePhase , it , disable = ! optimize ) <EOL> runPhase ( InlineClassPropertyAccessorsPhase , it , disable = ! optimize ) <EOL> runPhase ( RedundantCoercionsCleaningPhase , it ) <EOL> runPhase ( UnboxInlinePhase , it , disable = ! optimize ) <EOL> } <EOL> runPhase ( CreateLLVMDeclarationsPhase , module ) <EOL> runPhase ( GHAPhase , module , disable = ! optimize ) <EOL> runPhase ( RTTIPhase , RTTIInput ( module , dceResult ) ) <EOL> val lifetimes = runPhase ( EscapeAnalysisPhase , EscapeAnalysisInput ( module , moduleDFG , devirtualizationAnalysisResults ) , disable = ! optimize ) <EOL> runPhase ( CodegenPhase , CodegenInput ( module , lifetimes ) ) <EOL> }

/**
 * Compile lowered [module] to object file.
 * @return absolute path to object file.
 */


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> fun KType . withNullability ( nullable : Boolean ) : KType

{ <EOL> return ( this as KTypeImpl ) . makeNullableAsSpecified ( nullable ) <EOL> }

/**
 * Returns a new type with the same classifier, arguments and annotations as the given type, and with the given nullability.
 */


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> fun KType . isSubtypeOf ( other : KType ) : Boolean

{ <EOL> return ( this as KTypeImpl ) . type . isSubtypeOf ( ( other as KTypeImpl ) . type ) <EOL> }

/**
 * Returns `true` if `this` type is the same or is a subtype of [other], `false` otherwise.
 */


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> fun KType . isSupertypeOf ( other : KType ) : Boolean

{ <EOL> return other . isSubtypeOf ( this ) <EOL> }

/**
 * Returns `true` if `this` type is the same or is a supertype of [other], `false` otherwise.
 */


{ <EOL> plotFeatures [ CoordFlip . FEATURE_NAME ] = CoordFlip <EOL> }

/**
 * Flip the axes of the default coordinate system.
 *
 * After applying this function, the horizontal axis (typically the x-axis) will become vertical,
 * and the vertical axis (typically the y-axis) will become horizontal.
 *
 * > **Warning**: The API `coordFlip` will be revised in future releases.
 *
 * ### Example
 *
 * ```kotlin
 * plot {
 * bars {
 * x(listOf("a", "b", "c"))
 * y(listOf(4, 3, 5))
 * }
 * coordFlip()
 * }
 * ```
 */


{ <EOL> val out = PrintWriter ( Files . newOutputStream ( TEST_KT ) ) <EOL> out . println ( GENERATED_COMMENT ) <EOL> out . println ( "<STR_LIT>" ) <EOL> out . println ( ) <EOL> out . println ( "<STR_LIT>" ) <EOL> out . println ( ) <EOL> out . println ( "<STR_LIT>" ) <EOL> val cases = ArrayList < Pair < TestCaseType , Path > > ( ) <EOL> for ( type in TestCaseType . values ( ) ) { <EOL> Files . newDirectoryStream ( TEST_DATA_DIR , "<STR_LIT>" ) . use { <EOL> for ( path in it ) cases += type to path <EOL> } <EOL> } <EOL> cases . sortedBy { it . second . fileName } . forEachIndexed { index , ( type , inFile ) -> <EOL> if ( index > <NUM_LIT:0> ) out . println ( ) <EOL> writeTest ( out , type , inFile ) <EOL> } <EOL> out . println ( "<STR_LIT:}>" ) <EOL> out . close ( ) <EOL> }

/**
 * Writes [TestDataTest] based on the contents of `testdata` directory.
 */


fun applyToCompilation ( kotlinCompilation : KotlinCompilation < * > ) : Provider < List < SubpluginOption > >

/**
 * Configures the compiler plugin to be incorporated into a specific [kotlinCompilation].
 * This function is only called on [kotlinCompilation]s approved by [isApplicable].
 * The [Provider] returned from this function may never get queried if the compilation is avoided in the current build.
 */


fun getPluginArtifactForNative ( ) : SubpluginArtifact ?

= null

/**
 * Legacy Kotlin/Native-specific plugin artifact.
 *
 * It is used only if Gradle is configured not to use Kotlin/Native embeddable compiler jar
 * (with `kotlin.native.useEmbeddableCompilerJar=false` project property).
 *
 * Otherwise, [getPluginArtifact] is used by default.
 */


@ GCUnsafeCall ( "<STR_LIT>" ) <EOL> external public actual fun Char . isHighSurrogate ( ) : Boolean

/**
 * Returns `true` if this character is a Unicode high-surrogate code unit (also known as leading-surrogate code unit).
 */


@ GCUnsafeCall ( "<STR_LIT>" ) <EOL> external public actual fun Char . isLowSurrogate ( ) : Boolean

/**
 * Returns `true` if this character is a Unicode low-surrogate code unit (also known as trailing-surrogate code unit).
 */


@ GCUnsafeCall ( "<STR_LIT>" ) <EOL> external public actual fun Char . isISOControl ( ) : Boolean

/**
 * Returns `true` if this character is an ISO control character.
 *
 * A character is considered to be an ISO control character if its [category] is [CharCategory.CONTROL],
 * meaning the Char is in the range `'\u0000'..'\u001F'` or in the range `'\u007F'..'\u009F'`.
 *
 * @sample samples.text.Chars.isISOControl
 */


@ ExperimentalNativeApi <EOL> public fun Char . Companion . toCodePoint ( high : Char , low : Char ) : Int

= <EOL> ( ( ( high - MIN_HIGH_SURROGATE ) shl <NUM_LIT:10> ) or ( low - MIN_LOW_SURROGATE ) ) + <NUM_LIT>

/**
 * Converts a surrogate pair to a unicode code point. Doesn't validate that the characters are a valid surrogate pair.
 *
 * Note that this function is unstable.
 * In the future it could be deprecated in favour of an overload that would return a `CodePoint` type.
 */


@ ExperimentalNativeApi <EOL> public fun Char . Companion . isSupplementaryCodePoint ( codepoint : Int ) : Boolean

= <EOL> codepoint in MIN_SUPPLEMENTARY_CODE_POINT .. MAX_CODE_POINT

/**
 * Checks if the codepoint specified is a supplementary codepoint or not.
 *
 * Note that this function is unstable.
 * In the future it could be deprecated in favour of an overload that would accept a `CodePoint` type.
 */


@ ExperimentalNativeApi <EOL> public fun Char . Companion . isSurrogatePair ( high : Char , low : Char ) : Boolean

= high . isHighSurrogate ( ) && low . isLowSurrogate ( )

/**
 * Checks if the specified [high] and [low] chars are [Char.isHighSurrogate] and [Char.isLowSurrogate] correspondingly.
 */


@ ExperimentalNativeApi <EOL> @ Suppress ( "<STR_LIT:DEPRECATION>" ) <EOL> public fun Char . Companion . toChars ( codePoint : Int ) : CharArray

= <EOL> when { <EOL> codePoint in <NUM_LIT:0> until MIN_SUPPLEMENTARY_CODE_POINT -> charArrayOf ( codePoint . toChar ( ) ) <EOL> codePoint in MIN_SUPPLEMENTARY_CODE_POINT .. MAX_CODE_POINT -> { <EOL> val low = ( ( codePoint - <NUM_LIT> ) and <NUM_LIT> ) + MIN_LOW_SURROGATE . toInt ( ) <EOL> val high = ( ( ( codePoint - <NUM_LIT> ) ushr <NUM_LIT:10> ) and <NUM_LIT> ) + MIN_HIGH_SURROGATE . toInt ( ) <EOL> charArrayOf ( high . toChar ( ) , low . toChar ( ) ) <EOL> } <EOL> else -> throw IllegalArgumentException ( ) <EOL> }

/**
 * Converts the codepoint specified to a char array. If the codepoint is not supplementary, the method will
 * return an array with one element otherwise it will return an array A with a high surrogate in A[0] and
 * a low surrogate in A[1].
 *
 *
 * Note that this function is unstable.
 * In the future it could be deprecated in favour of an overload that would accept a `CodePoint` type.
 */


= <EOL> Throwable ( ) . stackTrace . lastOrNull ( ) ? . className

/** Must be called on the main thread, otherwise returns the root class of the worker thread. */


= super < AbstractMap > . hashCode ( )

/**
 * We provide [equals], so as a matter of style, we should also provide [hashCode].
 * However, the implementation from [AbstractMap] is enough.
 */


{ <EOL> throw Error ( msg ) <EOL> }

/**
 * A JavaScript implementation of the DeltaBlue constraint-solving
 * algorithm, as described in:
 *
 * "The DeltaBlue Algorithm: An Incremental Constraint Hierarchy Solver"
 * Bjorn N. Freeman-Benson and John Maloney
 * January 1990 Communications of the ACM,
 * also available as University of Washington TR 89-08-06.
 *
 * Beware: this benchmark is written in a grotesque style where
 * the constraint model is built by side-effects from constructors.
 * I've kept it this way to avoid deviating too much from the original
 * implementation.
 */


fun satisfy ( mark : Int , planner : Planner ) : Constraint ?

{ <EOL> chooseMethod ( mark ) <EOL> if ( ! isSatisfied ( ) ) { <EOL> if ( strength == Strength . REQUIRED ) alert ( "<STR_LIT>" ) <EOL> return null <EOL> } <EOL> markInputs ( mark ) <EOL> val out = this . output ( ) <EOL> val overridden = out . determinedBy <EOL> if ( overridden != null ) overridden . markUnsatisfied ( ) <EOL> out . determinedBy = this <EOL> if ( ! planner . addPropagate ( this , mark ) ) <EOL> alert ( "<STR_LIT>" ) <EOL> out . mark = mark <EOL> return overridden <EOL> }

/**
 * Attempt to find a way to enforce this constraint. If successful,
 * record the solution, perhaps modifying the current dataflow
 * graph. Answer the constraint that this constraint overrides, if
 * there is one, or nil, if there isn't.
 * Assume: I am not already satisfied.
 */


= false

/**
 * Normal constraints are not input constraints. An input constraint
 * is one that depends on external state, such as the mouse, the
 * keybord, a clock, or some arbitraty piece of imperative code.
 */


{ <EOL> myOutput . addConstraint ( this ) <EOL> satisfied = false <EOL> }

/**
 * Adds this constraint to the constraint graph
 */


override fun chooseMethod ( mark : Int )

{ <EOL> satisfied = ( myOutput . mark != mark ) <EOL> && Strength . stronger ( strength , myOutput . walkStrength ) <EOL> }

/**
 * Decides if this constraint can be satisfied and records that
 * decision.
 */


= satisfied

/**
 * Returns true if this constraint is satisfied in the current solution.
 */


= myOutput

/**
 * Returns the current output variable.
 */


{ <EOL> myOutput . walkStrength = strength <EOL> myOutput . stay = ! isInput ( ) <EOL> if ( myOutput . stay ) execute ( ) <EOL> }

/**
 * Calculate the walkabout strength, the stay flag, and, if it is
 * 'stay', the value for the current output of this constraint. Assume
 * this constraint is satisfied.
 */


{ <EOL> this . satisfied = false <EOL> }

/**
 * Records that this constraint is unsatisfied
 */


= true

/**
 * Edits indicate that a variable is to be changed by imperative code.
 */


{ <EOL> if ( v1 . mark == mark ) { <EOL> direction = if ( v2 . mark != mark && Strength . stronger ( strength , v2 . walkStrength ) ) <EOL> Direction . FORWARD else Direction . NONE <EOL> } <EOL> if ( v2 . mark == mark ) { <EOL> direction = if ( v1 . mark != mark && Strength . stronger ( strength , v1 . walkStrength ) ) <EOL> Direction . BACKWARD else Direction . NONE <EOL> } <EOL> if ( Strength . weaker ( v1 . walkStrength , v2 . walkStrength ) ) { <EOL> direction = if ( Strength . stronger ( strength , v1 . walkStrength ) ) <EOL> Direction . BACKWARD else Direction . NONE <EOL> } else { <EOL> direction = if ( Strength . stronger ( strength , v2 . walkStrength ) ) <EOL> Direction . FORWARD else Direction . BACKWARD <EOL> } <EOL> }


{ <EOL> v1 . addConstraint ( this ) <EOL> v2 . addConstraint ( this ) <EOL> direction = Direction . NONE <EOL> }


= direction != Direction . NONE


= if ( direction == Direction . FORWARD ) v1 else v2

/**
 * Returns the current input variable
 */


= if ( direction == Direction . FORWARD ) v2 else v1


{ <EOL> val ihn = input ( ) <EOL> val out = output ( ) <EOL> out . walkStrength = Strength . weakestOf ( this . strength , ihn . walkStrength ) <EOL> out . stay = ihn . stay <EOL> if ( out . stay ) execute ( ) <EOL> }


{ <EOL> direction = Direction . NONE <EOL> }


{ <EOL> super . addToGraph ( ) <EOL> scale . addConstraint ( this ) <EOL> offset . addConstraint ( this ) <EOL> }


{ <EOL> val ihn = input ( ) <EOL> val out = output ( ) <EOL> out . walkStrength = Strength . weakestOf ( strength , ihn . walkStrength ) <EOL> out . stay = ihn . stay && scale . stay && offset . stay <EOL> if ( out . stay ) execute ( ) <EOL> }


= constraints . add ( c )

/**
 * Add the given constraint to the set of all constraints that refer
 * this variable.
 */


{ <EOL> constraints . remove ( c ) <EOL> if ( determinedBy == c ) determinedBy = null <EOL> }

/**
 * Removes all traces of c from this variable.
 */


{ <EOL> c . addToGraph ( ) <EOL> incrementalAdd ( c ) <EOL> }

/**
 * Activate the constraint and attempt to satisfy it.
 */


{ <EOL> val mark = newMark ( ) <EOL> var overridden = c . satisfy ( mark , this ) <EOL> while ( overridden != null ) <EOL> overridden = overridden . satisfy ( mark , this ) <EOL> }

/**
 * Attempt to satisfy the given constraint and, if successful,
 * incrementally update the dataflow graph. Details: If satifying
 * the constraint is successful, it may override a weaker constraint
 * on its output. The algorithm attempts to resatisfy that
 * constraint using some other method. This process is repeated
 * until either a) it reaches a variable that was not previously
 * determined by any constraint or b) it reaches a constraint that
 * is too weak to be satisfied using any of its methods. The
 * variables of constraints that have been processed are marked with
 * a unique mark value so that we know where we've been. This allows
 * the algorithm to avoid getting into an infinite loop even if the
 * constraint graph has an inadvertent cycle.
 */


fun incrementalRemove ( c : Constraint )

{ <EOL> val out = c . output ( ) <EOL> c . markUnsatisfied ( ) <EOL> c . removeFromGraph ( ) <EOL> var unsatisfied = removePropagateFrom ( out ) <EOL> var strength = Strength . REQUIRED <EOL> do { <EOL> for ( u in unsatisfied ) { <EOL> if ( u . strength == strength ) <EOL> this . incrementalAdd ( u ) <EOL> } <EOL> strength = strength . nextWeaker ( ) <EOL> } while ( strength != Strength . WEAKEST ) <EOL> }

/**
 * Entry point for retracting a constraint. Remove the given
 * constraint and incrementally update the dataflow graph.
 * Details: Retracting the given constraint may allow some currently
 * unsatisfiable downstream constraint to be satisfied. We therefore collect
 * a list of unsatisfied downstream constraints and attempt to
 * satisfy each one in turn. This list is traversed by constraint
 * strength, strongest first, as a heuristic for avoiding
 * unnecessarily adding and then overriding weak constraints.
 * Assume: c is satisfied.
 */


= ++ currentMark

/**
 * Select a previously unused mark value.
 */


fun makePlan ( sources : OrderedCollection < Constraint > ) : Plan

{ <EOL> var mark = this . newMark ( ) <EOL> var plan = Plan ( ) <EOL> var todo = sources <EOL> while ( todo . size ( ) > <NUM_LIT:0> ) { <EOL> var c = todo . removeFirst ( ) <EOL> if ( c . output ( ) . mark != mark && c . inputsKnown ( mark ) ) { <EOL> plan . addConstraint ( c ) <EOL> c . output ( ) . mark = mark <EOL> addConstraintsConsumingTo ( c . output ( ) , todo ) <EOL> } <EOL> } <EOL> return plan <EOL> }

/**
 * Extract a plan for resatisfaction starting from the given source
 * constraints, usually a set of input constraints. This method
 * assumes that stay optimization is desired the plan will contain
 * only constraints whose output variables are not stay. Constraints
 * that do no computation, such as stay and edit constraints, are
 * not included in the plan.
 * Details: The outputs of a constraint are marked when it is added
 * to the plan under construction. A constraint may be appended to
 * the plan when all its input variables are known. A variable is
 * known if either a) the variable is marked (indicating that has
 * been computed by a constraint appearing earlier in the plan), b)
 * the variable is 'stay' (i.e. it is a constant at plan execution
 * time), or c) the variable is not determined by any
 * constraint. The last provision is for past states of history
 * variables, which are not stay but which are also not computed by
 * any constraint.
 * Assume: sources are all satisfied.
 */


fun extractPlanFromConstraints ( constraints : OrderedCollection < Constraint > ) : Plan

{ <EOL> val sources = OrderedCollection < Constraint > ( ) <EOL> for ( c in constraints ) { <EOL> if ( c . isInput ( ) && c . isSatisfied ( ) ) <EOL> sources . add ( c ) <EOL> } <EOL> return makePlan ( sources ) <EOL> }

/**
 * Extract a plan for resatisfying starting from the output of the
 * given constraints, usually a set of input constraints.
 */


fun addPropagate ( c : Constraint , mark : Int ) : Boolean

{ <EOL> val todo = OrderedCollection < Constraint > ( ) <EOL> todo . add ( c ) <EOL> while ( todo . size ( ) > <NUM_LIT:0> ) { <EOL> var d = todo . removeFirst ( ) <EOL> if ( d . output ( ) . mark == mark ) { <EOL> incrementalRemove ( c ) <EOL> return false <EOL> } <EOL> d . recalculate ( ) <EOL> addConstraintsConsumingTo ( d . output ( ) , todo ) <EOL> } <EOL> return true <EOL> }

/**
 * Recompute the walkabout strengths and stay flags of all variables
 * downstream of the given constraint and recompute the actual
 * values of all variables whose stay flag is true. If a cycle is
 * detected, remove the given constraint and answer
 * false. Otherwise, answer true.
 * Details: Cycles are detected when a marked variable is
 * encountered downstream of the given constraint. The sender is
 * assumed to have marked the inputs of the given constraint with
 * the given mark. Thus, encountering a marked node downstream of
 * the output constraint means that there is a path from the
 * constraint's output to one of its inputs.
 */


fun removePropagateFrom ( out : Variable ) : OrderedCollection < Constraint >

{ <EOL> out . determinedBy = null <EOL> out . walkStrength = Strength . WEAKEST <EOL> out . stay = true <EOL> val unsatisfied = OrderedCollection < Constraint > ( ) <EOL> val todo = OrderedCollection < Variable > ( ) <EOL> todo . add ( out ) <EOL> while ( todo . size ( ) > <NUM_LIT:0> ) { <EOL> var v = todo . removeFirst ( ) <EOL> for ( c in v . constraints ) { <EOL> if ( ! c . isSatisfied ( ) ) <EOL> unsatisfied . add ( c ) <EOL> } <EOL> var determining = v . determinedBy <EOL> for ( next in v . constraints ) { <EOL> if ( next != determining && next . isSatisfied ( ) ) { <EOL> next . recalculate ( ) <EOL> todo . add ( next . output ( ) ) <EOL> } <EOL> } <EOL> } <EOL> return unsatisfied <EOL> }

/**
 * Update the walkabout strengths and stay flags of all variables
 * downstream of the given constraint. Answer a collection of
 * unsatisfied constraints sorted in order of decreasing strength.
 */


= v . add ( c )


{ <EOL> val planner = Planner ( ) <EOL> val variables = ( <NUM_LIT:0> .. n ) . map { Variable ( "<STR_LIT>" ) } . toList ( ) <EOL> var first = variables . first ( ) <EOL> var last = variables . last ( ) <EOL> variables . windowed ( <NUM_LIT:2> ) { <EOL> ( v1 , v2 ) -> planner . add ( EqualityConstraint ( v1 , v2 , Strength . REQUIRED ) ) <EOL> } <EOL> planner . add ( StayConstraint ( last , Strength . STRONG_DEFAULT ) ) <EOL> val edit = EditConstraint ( first , Strength . PREFERRED ) <EOL> planner . add ( edit ) <EOL> val edits = OrderedCollection < Constraint > ( ) <EOL> edits . add ( edit ) <EOL> val plan = planner . extractPlanFromConstraints ( edits ) <EOL> for ( i in <NUM_LIT:0> until <NUM_LIT:100> ) { <EOL> first . value = i <EOL> plan . execute ( ) <EOL> if ( last . value != i ) <EOL> alert ( "<STR_LIT>" ) <EOL> } <EOL> }

/**
 * This is the standard DeltaBlue benchmark. A long chain of equality
 * constraints is constructed with a stay constraint on one end. An
 * edit constraint is then added to the opposite end and the time is
 * measured for adding and removing this constraint, and extracting
 * and executing a constraint satisfaction plan. There are two cases.
 * In case 1, the added constraint is stronger than the stay
 * constraint and values must propagate down the entire length of the
 * chain. In case 2, the added constraint is weaker than the stay
 * constraint so it cannot be accomodated. The cost in this case is,
 * of course, very low. Typical situations lie somewhere between these
 * two extremes.
 */


{ <EOL> val planner = Planner ( ) <EOL> var scale = Variable ( "<STR_LIT>" , <NUM_LIT:10> ) <EOL> var offset = Variable ( "<STR_LIT>" , <NUM_LIT> ) <EOL> var src : Variable ? = null <EOL> var dst : Variable ? = null <EOL> var dests = OrderedCollection < Variable > ( ) <EOL> for ( i in <NUM_LIT:0> until n ) { <EOL> src = Variable ( "<STR_LIT>" , i ) <EOL> dst = Variable ( "<STR_LIT>" , i ) <EOL> dests . add ( dst ) <EOL> planner . add ( StayConstraint ( src , Strength . NORMAL ) ) <EOL> planner . add ( ScaleConstraint ( src , scale , offset , dst , Strength . REQUIRED ) ) <EOL> } <EOL> planner . change ( src ! ! , <NUM_LIT> ) <EOL> if ( dst ! ! . value != <NUM_LIT> ) alert ( "<STR_LIT>" ) <EOL> planner . change ( dst , <NUM_LIT> ) <EOL> if ( src . value != <NUM_LIT:5> ) alert ( "<STR_LIT>" ) <EOL> planner . change ( scale , <NUM_LIT:5> ) <EOL> for ( i in <NUM_LIT:0> until n - <NUM_LIT:1> ) { <EOL> if ( dests . at ( i ) . value != i * <NUM_LIT:5> + <NUM_LIT> ) <EOL> alert ( "<STR_LIT>" ) <EOL> } <EOL> planner . change ( offset , <NUM_LIT> ) <EOL> for ( i in <NUM_LIT:0> until n - <NUM_LIT:1> ) { <EOL> if ( dests . at ( i ) . value != i * <NUM_LIT:5> + <NUM_LIT> ) <EOL> alert ( "<STR_LIT>" ) <EOL> } <EOL> }

/**
 * This test constructs a two sets of variables related to each
 * other by a simple linear transformation (scale and offset). The
 * time is measured to change a variable on either side of the
 * mapping and to change the scale and offset factors.
 */


fun IrFunctionSymbol . findAnnotatedFunction ( testAnnotation : FqName ) : IrFunctionSymbol ?

{ <EOL> val owner = this . owner <EOL> val parent = owner . parent <EOL> if ( parent is IrClass && parent . isInterface ) { <EOL> return null <EOL> } <EOL> if ( hasAnnotation ( testAnnotation ) ) { <EOL> return this <EOL> } <EOL> return ( owner as? IrSimpleFunction ) <EOL> ? . overriddenSymbols <EOL> ? . firstNotNullOfOrNull { <EOL> it . findAnnotatedFunction ( testAnnotation ) <EOL> } <EOL> }

/**
 * Checks if [this] or any of its parent functions has the annotation with the given [testAnnotation].
 * If [this] contains the given annotation, returns [this].
 * If one of the parent functions contains the given annotation, returns the [IrFunctionSymbol] for it.
 * If the annotation isn't found or found only in interface methods, returns null.
 */


private fun buildObjectGetter ( objectSymbol : IrClassSymbol , owner : IrClass , getterName : Name ) : IrSimpleFunction

= <EOL> context . irFactory . createSimpleFunction ( owner . startOffset , owner . endOffset , TEST_SUITE_GENERATED_MEMBER , getterName , DescriptorVisibilities . PROTECTED , isInline = false , isExpect = false , objectSymbol . starProjectedType , Modality . FINAL , IrSimpleFunctionSymbolImpl ( ) , isTailrec = false , isSuspend = false , isOperator = false , isInfix = false , ) . apply { <EOL> parent = owner <EOL> val superFunction = baseClassSuite . simpleFunctions ( ) <EOL> . single { it . name == getterName && it . valueParameters . isEmpty ( ) } <EOL> createDispatchReceiverParameter ( ) <EOL> overriddenSymbols += superFunction . symbol <EOL> body = context . createIrBuilder ( symbol , symbol . owner . startOffset , symbol . owner . endOffset ) . irBlockBody { <EOL> + irReturn ( irGetObjectValue ( objectSymbol . typeWithArguments ( emptyList ( ) ) , objectSymbol ) ) <EOL> } <EOL> }

/**
 * Builds a method in `[owner]` class with name `[getterName]`
 * returning a reference to an object represented by `[objectSymbol]`.
 */


private fun buildInstanceGetter ( classSymbol : IrClassSymbol , owner : IrClass , getterName : Name ) : IrSimpleFunction

= <EOL> context . irFactory . createSimpleFunction ( owner . startOffset , owner . endOffset , TEST_SUITE_GENERATED_MEMBER , getterName , DescriptorVisibilities . PROTECTED , isInline = false , isExpect = false , classSymbol . starProjectedType , Modality . FINAL , IrSimpleFunctionSymbolImpl ( ) , isTailrec = false , isSuspend = false , isOperator = false , isInfix = false , ) . apply { <EOL> parent = owner <EOL> val superFunction = baseClassSuite . simpleFunctions ( ) <EOL> . single { it . name == getterName && it . valueParameters . isEmpty ( ) } <EOL> createDispatchReceiverParameter ( ) <EOL> overriddenSymbols += superFunction . symbol <EOL> body = context . createIrBuilder ( symbol , symbol . owner . startOffset , symbol . owner . endOffset ) . irBlockBody { <EOL> val constructor = classSymbol . owner . constructors . single { it . valueParameters . isEmpty ( ) } <EOL> + irReturn ( irCall ( constructor ) ) <EOL> } <EOL> }

/**
 * Builds a method in `[testSuite]` class with name `[getterName]`
 * returning a new instance of class referenced by [classSymbol].
 */