@ JvmStatic <EOL> public fun loadDefaultModelConfiguration ( modelDirectory : File , inputShape : IntArray ? = null ) : Sequential

{ <EOL> require ( modelDirectory . isDirectory ) { "<STR_LIT>" } <EOL> val configuration = File ( "<STR_LIT>" ) <EOL> if ( ! configuration . exists ( ) ) throw FileNotFoundException ( "<STR_LIT>" + "<STR_LIT>" ) <EOL> return loadSequentialModelConfiguration ( configuration , inputShape ) <EOL> }

/**
 * Loads a [Sequential] model from json file with name 'modelConfig.json' with model configuration located in [modelDirectory].
 *
 * @param [modelDirectory] Directory, containing file 'modelConfig.json'.
 * @throws [FileNotFoundException] If 'modelConfig.json' file is not found.
 * @return Non-compiled and non-trained Sequential model.
 */


@ JvmStatic <EOL> public fun loadModelLayersFromDefaultConfiguration ( modelDirectory : File , inputShape : IntArray ? = null ) : Pair < Input , List < Layer > >

{ <EOL> require ( modelDirectory . isDirectory ) { "<STR_LIT>" } <EOL> val configuration = File ( "<STR_LIT>" ) <EOL> if ( ! configuration . exists ( ) ) throw FileNotFoundException ( "<STR_LIT>" + "<STR_LIT>" ) <EOL> val config = loadSerializedModel ( configuration ) <EOL> return loadSequentialModelLayers ( config , inputShape ) <EOL> }

/**
 * Loads a [Sequential] model layers from json file with name 'modelConfig.json' with model configuration located in [modelDirectory].
 *
 * @param [modelDirectory] Directory, containing file 'modelConfig.json'.
 * @throws [FileNotFoundException] If 'modelConfig.json' file is not found.
 * @return Pair of <input layer; list of layers>.
 */


= buildString { <EOL> val sign = if ( allNonpositive ( ) ) { append ( '<CHAR_LIT:->' ) ; - <NUM_LIT:1> } else <NUM_LIT:1> <EOL> append ( '<CHAR_LIT>' ) <EOL> if ( years != <NUM_LIT:0> ) append ( years * sign ) . append ( '<CHAR_LIT>' ) <EOL> if ( months != <NUM_LIT:0> ) append ( months * sign ) . append ( '<CHAR_LIT>' ) <EOL> if ( days != <NUM_LIT:0> ) append ( days * sign ) . append ( '<CHAR_LIT>' ) <EOL> var t = "<STR_LIT:T>" <EOL> if ( hours != <NUM_LIT:0> ) append ( t ) . append ( hours * sign ) . append ( '<CHAR_LIT>' ) . also { t = "<STR_LIT>" } <EOL> if ( minutes != <NUM_LIT:0> ) append ( t ) . append ( minutes * sign ) . append ( '<CHAR_LIT>' ) . also { t = "<STR_LIT>" } <EOL> if ( seconds or nanoseconds != <NUM_LIT:0> ) { <EOL> append ( t ) <EOL> append ( when { <EOL> seconds != <NUM_LIT:0> -> seconds * sign <EOL> nanoseconds * sign < <NUM_LIT:0> -> "<STR_LIT>" <EOL> else -> "<STR_LIT:0>" <EOL> } ) <EOL> if ( nanoseconds != <NUM_LIT:0> ) append ( '<CHAR_LIT:.>' ) . append ( ( nanoseconds . absoluteValue ) . toString ( ) . padStart ( <NUM_LIT:9> , '<CHAR_LIT:0>' ) ) <EOL> append ( '<CHAR_LIT>' ) <EOL> } <EOL> if ( length == <NUM_LIT:1> ) append ( "<STR_LIT>" ) <EOL> }

/**
 * Converts this period to the ISO-8601 string representation for durations.
 *
 * @see DateTimePeriod.parse
 */


public fun parse ( text : String ) : DateTimePeriod

{ <EOL> fun parseException ( message : String , position : Int ) : Nothing = <EOL> throw DateTimeFormatException ( "<STR_LIT>" ) <EOL> val START = <NUM_LIT:0> <EOL> val AFTER_P = <NUM_LIT:1> <EOL> val AFTER_YEAR = <NUM_LIT:2> <EOL> val AFTER_MONTH = <NUM_LIT:3> <EOL> val AFTER_WEEK = <NUM_LIT:4> <EOL> val AFTER_DAY = <NUM_LIT:5> <EOL> val AFTER_T = <NUM_LIT:6> <EOL> val AFTER_HOUR = <NUM_LIT:7> <EOL> val AFTER_MINUTE = <NUM_LIT:8> <EOL> val AFTER_SECOND_AND_NANO = <NUM_LIT:9> <EOL> var state = START <EOL> var i = <NUM_LIT:0> <EOL> var sign = <NUM_LIT:1> <EOL> var years = <NUM_LIT:0> <EOL> var months = <NUM_LIT:0> <EOL> var weeks = <NUM_LIT:0> <EOL> var days = <NUM_LIT:0> <EOL> var hours = <NUM_LIT:0> <EOL> var minutes = <NUM_LIT:0> <EOL> var seconds = <NUM_LIT:0> <EOL> var nanoseconds = <NUM_LIT:0> <EOL> while ( true ) { <EOL> if ( i >= text . length ) { <EOL> if ( state == START ) <EOL> parseException ( "<STR_LIT>" , i ) <EOL> if ( state == AFTER_T ) <EOL> parseException ( "<STR_LIT>" , i ) <EOL> val daysTotal = when ( val n = days . toLong ( ) + weeks * <NUM_LIT:7> ) { <EOL> in Int . MIN_VALUE .. Int . MAX_VALUE -> n . toInt ( ) <EOL> else -> parseException ( "<STR_LIT>" , <NUM_LIT:0> ) <EOL> } <EOL> return DateTimePeriod ( years , months , daysTotal , hours , minutes , seconds , nanoseconds . toLong ( ) ) <EOL> } <EOL> if ( state == START ) { <EOL> if ( i + <NUM_LIT:1> >= text . length && ( text [ i ] == '<CHAR_LIT>' || text [ i ] == '<CHAR_LIT:->' ) ) <EOL> parseException ( "<STR_LIT>" , i ) <EOL> when ( text [ i ] ) { <EOL> '<CHAR_LIT>' , '<CHAR_LIT:->' -> { <EOL> if ( text [ i ] == '<CHAR_LIT:->' ) <EOL> sign = - <NUM_LIT:1> <EOL> if ( text [ i + <NUM_LIT:1> ] != '<CHAR_LIT>' ) <EOL> parseException ( "<STR_LIT>" , i + <NUM_LIT:1> ) <EOL> i += <NUM_LIT:2> <EOL> } <EOL> '<CHAR_LIT>' -> { i += <NUM_LIT:1> } <EOL> else -> parseException ( "<STR_LIT>" , i ) <EOL> } <EOL> state = AFTER_P <EOL> continue <EOL> } <EOL> var localSign = sign <EOL> val iStart = i <EOL> when ( text [ i ] ) { <EOL> '<CHAR_LIT>' , '<CHAR_LIT:->' -> { <EOL> if ( text [ i ] == '<CHAR_LIT:->' ) localSign *= - <NUM_LIT:1> <EOL> i += <NUM_LIT:1> <EOL> if ( i >= text . length || text [ i ] !in '<CHAR_LIT:0>' .. '<CHAR_LIT:9>' ) <EOL> parseException ( "<STR_LIT>" , i ) <EOL> } <EOL> in '<CHAR_LIT:0>' .. '<CHAR_LIT:9>' -> { } <EOL> '<CHAR_LIT>' -> { <EOL> if ( state >= AFTER_T ) <EOL> parseException ( "<STR_LIT>" , i ) <EOL> state = AFTER_T <EOL> i += <NUM_LIT:1> <EOL> continue <EOL> } <EOL> } <EOL> var number = <NUM_LIT:0L> <EOL> while ( i < text . length && text [ i ] in '<CHAR_LIT:0>' .. '<CHAR_LIT:9>' ) { <EOL> try { <EOL> number = safeAdd ( safeMultiply ( number , <NUM_LIT:10> ) , ( text [ i ] - '<CHAR_LIT:0>' ) . toLong ( ) ) <EOL> } catch ( e : ArithmeticException ) { <EOL> parseException ( "<STR_LIT>" , iStart ) <EOL> } <EOL> i += <NUM_LIT:1> <EOL> } <EOL> number *= localSign <EOL> if ( i == text . length ) <EOL> parseException ( "<STR_LIT>" , i ) <EOL> val wrongOrder = "<STR_LIT>" <EOL> fun Long . toIntThrowing ( component : Char ) : Int { <EOL> if ( this < Int . MIN_VALUE || this > Int . MAX_VALUE ) <EOL> parseException ( "<STR_LIT>" , iStart ) <EOL> return toInt ( ) <EOL> } <EOL> when ( text [ i ] . uppercaseChar ( ) ) { <EOL> '<CHAR_LIT>' -> { <EOL> if ( state >= AFTER_YEAR ) <EOL> parseException ( wrongOrder , i ) <EOL> state = AFTER_YEAR <EOL> years = number . toIntThrowing ( '<CHAR_LIT>' ) <EOL> } <EOL> '<CHAR_LIT>' -> { <EOL> if ( state >= AFTER_T ) { <EOL> if ( state >= AFTER_MINUTE ) <EOL> parseException ( wrongOrder , i ) <EOL> state = AFTER_MINUTE <EOL> minutes = number . toIntThrowing ( '<CHAR_LIT>' ) <EOL> } else { <EOL> if ( state >= AFTER_MONTH ) <EOL> parseException ( wrongOrder , i ) <EOL> state = AFTER_MONTH <EOL> months = number . toIntThrowing ( '<CHAR_LIT>' ) <EOL> } <EOL> } <EOL> '<CHAR_LIT>' -> { <EOL> if ( state >= AFTER_WEEK ) <EOL> parseException ( wrongOrder , i ) <EOL> state = AFTER_WEEK <EOL> weeks = number . toIntThrowing ( '<CHAR_LIT>' ) <EOL> } <EOL> '<CHAR_LIT>' -> { <EOL> if ( state >= AFTER_DAY ) <EOL> parseException ( wrongOrder , i ) <EOL> state = AFTER_DAY <EOL> days = number . toIntThrowing ( '<CHAR_LIT>' ) <EOL> } <EOL> '<CHAR_LIT>' -> { <EOL> if ( state >= AFTER_HOUR || state < AFTER_T ) <EOL> parseException ( wrongOrder , i ) <EOL> state = AFTER_HOUR <EOL> hours = number . toIntThrowing ( '<CHAR_LIT>' ) <EOL> } <EOL> '<CHAR_LIT>' -> { <EOL> if ( state >= AFTER_SECOND_AND_NANO || state < AFTER_T ) <EOL> parseException ( wrongOrder , i ) <EOL> state = AFTER_SECOND_AND_NANO <EOL> seconds = number . toIntThrowing ( '<CHAR_LIT>' ) <EOL> } <EOL> '<CHAR_LIT:.>' , '<CHAR_LIT:U+002C>' -> { <EOL> i += <NUM_LIT:1> <EOL> if ( i >= text . length ) <EOL> parseException ( "<STR_LIT>" , i ) <EOL> val iStartFraction = i <EOL> while ( i < text . length && text [ i ] in '<CHAR_LIT:0>' .. '<CHAR_LIT:9>' ) <EOL> i += <NUM_LIT:1> <EOL> val fractionLength = i - iStartFraction <EOL> if ( fractionLength > <NUM_LIT:9> ) <EOL> parseException ( "<STR_LIT>" , iStartFraction ) <EOL> val fractionalPart = text . substring ( iStartFraction , i ) + "<STR_LIT:0>" . repeat ( <NUM_LIT:9> - fractionLength ) <EOL> nanoseconds = fractionalPart . toInt ( <NUM_LIT:10> ) * localSign <EOL> if ( text [ i ] != '<CHAR_LIT>' ) <EOL> parseException ( "<STR_LIT>" , i ) <EOL> if ( state >= AFTER_SECOND_AND_NANO || state < AFTER_T ) <EOL> parseException ( wrongOrder , i ) <EOL> state = AFTER_SECOND_AND_NANO <EOL> seconds = number . toIntThrowing ( '<CHAR_LIT>' ) <EOL> } <EOL> else -> parseException ( "<STR_LIT>" , i ) <EOL> } <EOL> i += <NUM_LIT:1> <EOL> } <EOL> }

/**
 * Parses a ISO-8601 duration string as a [DateTimePeriod].
 * If the time components are absent or equal to zero, returns a [DatePeriod].
 *
 * Additionally, we support the `W` signifier to represent weeks.
 *
 * Examples of durations in the ISO-8601 format:
 * - `P1Y40D` is one year and 40 days
 * - `-P1DT1H` is minus (one day and one hour)
 * - `P1DT-1H` is one day minus one hour
 * - `-PT0.000000001S` is minus one nanosecond
 *
 * @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [DateTimePeriod] are
 * exceeded.
 */


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . WARNING ) <EOL> public fun String . toDateTimePeriod ( ) : DateTimePeriod

= DateTimePeriod . parse ( this )


public fun parse ( text : String ) : DatePeriod

= <EOL> when ( val period = DateTimePeriod . parse ( text ) ) { <EOL> is DatePeriod -> period <EOL> else -> throw DateTimeFormatException ( "<STR_LIT>" ) <EOL> }

/**
 * Parses the ISO-8601 duration representation as a [DatePeriod].
 *
 * This function is equivalent to [DateTimePeriod.parse], but will fail if any of the time components are not
 * zero.
 *
 * @throws IllegalArgumentException if the text cannot be parsed, the boundaries of [DatePeriod] are exceeded,
 * or any time components are not zero.
 *
 * @see DateTimePeriod.parse
 */


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . WARNING ) <EOL> public fun String . toDatePeriod ( ) : DatePeriod

= DatePeriod . parse ( this )


public fun DateTimePeriod ( years : Int = <NUM_LIT:0> , months : Int = <NUM_LIT:0> , days : Int = <NUM_LIT:0> , hours : Int = <NUM_LIT:0> , minutes : Int = <NUM_LIT:0> , seconds : Int = <NUM_LIT:0> , nanoseconds : Long = <NUM_LIT:0> ) : DateTimePeriod

= buildDateTimePeriod ( totalMonths ( years , months ) , days , totalNanoseconds ( hours , minutes , seconds , nanoseconds ) )

/**
 * Constructs a new [DateTimePeriod]. If all the time components are zero, returns a [DatePeriod].
 *
 * It is recommended to always explicitly name the arguments when constructing this manually,
 * like `DateTimePeriod(years = 1, months = 12)`.
 *
 * The passed numbers are not stored as is but are normalized instead for human readability, so, for example,
 * `DateTimePeriod(months = 24)` becomes `DateTimePeriod(years = 2)`.
 *
 * @throws IllegalArgumentException if the total number of months in [years] and [months] overflows an [Int].
 * @throws IllegalArgumentException if the total number of months in [hours], [minutes], [seconds] and [nanoseconds]
 * overflows a [Long].
 */


public fun Duration . toDateTimePeriod ( ) : DateTimePeriod

= buildDateTimePeriod ( totalNanoseconds = inWholeNanoseconds )

/**
 * Constructs a [DateTimePeriod] from a [Duration].
 *
 * If the duration value is too big to be represented as a [Long] number of nanoseconds,
 * the result will be [Long.MAX_VALUE] nanoseconds.
 */


public operator fun DateTimePeriod . plus ( other : DateTimePeriod ) : DateTimePeriod

= buildDateTimePeriod ( safeAdd ( totalMonths , other . totalMonths ) , safeAdd ( days , other . days ) , safeAdd ( totalNanoseconds , other . totalNanoseconds ) , )

/**
 * Adds two [DateTimePeriod] instances.
 *
 * @throws DateTimeArithmeticException if arithmetic overflow happens.
 */


public operator fun DatePeriod . plus ( other : DatePeriod ) : DatePeriod

= DatePeriod ( safeAdd ( totalMonths , other . totalMonths ) , safeAdd ( days , other . days ) , )

/**
 * Adds two [DatePeriod] instances.
 *
 * @throws DateTimeArithmeticException if arithmetic overflow happens.
 */


private fun computeNonTrivialTypeArgumentForScopeSubstitutor ( typeParameterSymbol : FirTypeParameterSymbol , originalTypeArgument : ConeTypeProjection , session : FirSession , capturedTypeArgument : ConeKotlinType ) : ConeKotlinType ?

{ <EOL> if ( typeParameterSymbol . variance != Variance . OUT_VARIANCE ) return null <EOL> return when ( originalTypeArgument . kind ) { <EOL> ProjectionKind . OUT -> originalTypeArgument . type ! ! <EOL> ProjectionKind . STAR -> session . typeApproximator . approximateToSuperType ( capturedTypeArgument , TypeApproximatorConfiguration . FinalApproximationAfterResolutionAndInference ) <EOL> else -> null <EOL> } <EOL> }

/**
 * Returns null if `capturedTypeArgument` should be used
 */


private fun KotlinPackageEntry . matchesImportPath ( importPath : ImportPath , ignoreAlias : Boolean ) : Boolean

{ <EOL> if ( ! ignoreAlias && importPath . hasAlias ( ) ) { <EOL> return this == ALL_OTHER_ALIAS_IMPORTS_ENTRY <EOL> } <EOL> if ( this == KotlinPackageEntry . ALL_OTHER_IMPORTS_ENTRY ) return true <EOL> return matchesPackageName ( importPath . pathStr ) <EOL> }

/**
 * In current implementation we assume that aliased import can be matched only by
 * [ALL_OTHER_ALIAS_IMPORTS_ENTRY] which is always present.
 */


inline fun < T : Flow < Int > > CoroutineScope . testSubscriptionByFirstSuspensionInCollect ( flow : T , emit : T . ( Int ) -> Unit )

{ <EOL> var received = <NUM_LIT:0> <EOL> val job = launch ( start = CoroutineStart . UNDISPATCHED ) { <EOL> flow . collect { <EOL> received = it <EOL> } <EOL> } <EOL> flow . emit ( <NUM_LIT:1> ) <EOL> assertEquals ( <NUM_LIT:1> , received ) <EOL> job . cancel ( ) <EOL> }

/**
 * Check that, by the time [SharedFlow.collect] suspends for the first time, its subscription is already active.
 */


public fun detectObjects ( image : I , topK : Int = <NUM_LIT:5> ) : List < DetectedObject >

{ <EOL> val objects = predict ( image ) . sortedByDescending { it . probability } <EOL> if ( topK > <NUM_LIT:0> ) { <EOL> return objects . take ( topK ) <EOL> } <EOL> return objects <EOL> }

/**
 * Returns the detected object for the given image sorted by the score.
 *
 * @param [image] Input image.
 * @param [topK] The number of the detected objects with the highest score to be returned.
 * @return List of [DetectedObject] sorted by score.
 */


public fun reshape ( vararg dims : Long )

{ <EOL> inputShape = longArrayOf ( * dims ) <EOL> }

/**
 * Setter for input shape of the internal model. Images are going to be resized to this shape.
 *
 * @param dims The input shape.
 */


fun findImplementationFromInterface ( descriptor : CallableMemberDescriptor ) : CallableMemberDescriptor ?

{ <EOL> val overridden = OverridingUtil . getOverriddenDeclarations ( descriptor ) <EOL> val filtered = OverridingUtil . filterOutOverridden ( overridden ) <EOL> val result = filtered . firstOrNull { it . modality != Modality . ABSTRACT } ? : return null <EOL> if ( DescriptorUtils . isClassOrEnumClass ( result . containingDeclaration ) ) return null <EOL> return result <EOL> }

/**
 * Given a fake override, returns an overridden non-abstract function from an interface which is the actual implementation of this function
 * that should be called when the given fake override is called.
 */


@ JvmOverloads <EOL> fun findInterfaceImplementation ( descriptor : CallableMemberDescriptor , returnImplNotDelegate : Boolean = false ) : CallableMemberDescriptor ?

{ <EOL> if ( descriptor . kind . isReal ) return null <EOL> if ( isOrOverridesSynthesized ( descriptor ) ) return null <EOL> val implementation = findImplementationFromInterface ( descriptor ) ? : return null <EOL> val immediateConcreteSuper = firstSuperMethodFromKotlin ( descriptor , implementation ) ? : return null <EOL> if ( ! DescriptorUtils . isInterface ( immediateConcreteSuper . containingDeclaration ) ) { <EOL> return null <EOL> } <EOL> return if ( returnImplNotDelegate ) implementation else immediateConcreteSuper <EOL> }

/**
 * Given a fake override in a class, returns an overridden declaration with implementation in trait, such that a method delegating to that
 * trait implementation should be generated into the class containing the fake override; or null if the given function is not a fake
 * override of any trait implementation or such method was already generated into the superclass or is a method from Any.
 */


fun firstSuperMethodFromKotlin ( descriptor : CallableMemberDescriptor , implementation : CallableMemberDescriptor ) : CallableMemberDescriptor ?

{ <EOL> return descriptor . overriddenDescriptors . firstOrNull { overridden -> <EOL> overridden . modality != Modality . ABSTRACT && <EOL> ( overridden == implementation || OverridingUtil . overrides ( overridden , implementation , overridden . module . isTypeRefinementEnabled ( ) , true ) ) <EOL> } <EOL> }

/**
 * Given a fake override and its implementation (non-abstract declaration) somewhere in supertypes,
 * returns the first immediate super function of the given fake override which overrides that implementation.
 * The returned function should be called from TImpl-bridges generated for the given fake override.
 */


fun IrFunction . varargParameterIndex ( )

= valueParameters . indexOfFirst { it . varargElementType != null }

/**
 * Returns the index of the vararg parameter of the function if there is one, otherwise returns -1.
 */


private fun IrDeclarationWithName . originalNameForUseInSourceMap ( policy : SourceMapNamesPolicy ) : String ?

{ <EOL> if ( policy == SourceMapNamesPolicy . NO ) return null <EOL> when ( this ) { <EOL> is IrField -> correspondingPropertySymbol ? . let { <EOL> return it . owner . originalNameForUseInSourceMap ( policy ) <EOL> } <EOL> is IrFunction -> if ( policy == SourceMapNamesPolicy . FULLY_QUALIFIED_NAMES ) { <EOL> fqNameWhenAvailable ? . let { <EOL> return it . asString ( ) <EOL> } <EOL> } <EOL> is IrValueDeclaration -> if ( origin !in nameMappingOriginAllowList ) { <EOL> return null <EOL> } <EOL> } <EOL> return name . asString ( ) <EOL> }

/**
 * Returns a name of the original Kotlin declaration, or null, if it is a compiler generated declaration.
 */


public infix fun < C > ColumnSet < C > . except ( selector : ( ) -> ColumnsResolver < * > ) : ColumnSet < C >

= <EOL> except ( selector ( ) )

/**
 * @include [ColumnSetInfixDocs]
 * @set [CommonExceptDocs.ParamArg] @param [selector\] A lambda in which you specify the columns that need to be
 * excluded from the [ColumnSet]. The scope of the selector is the same as the outer scope.
 * @set [ColumnSetInfixDocs.ArgumentArg1] `{ "age" `[and][ColumnsSelectionDsl.and]` height }`
 * @set [ColumnSetInfixDocs.ArgumentArg2] `{ name.firstName }`
 */


public infix fun < C > ColumnSet < C > . except ( other : ColumnsResolver < * > ) : ColumnSet < C >

= <EOL> exceptInternal ( other )

/**
 * @include [ColumnSetInfixDocs]
 * @set [CommonExceptDocs.ParamArg] @param [other\] A [ColumnsResolver] containing the columns that need to be
 * excluded from the [ColumnSet].
 * @set [ColumnSetInfixDocs.ArgumentArg1] `"age" `[and][ColumnsSelectionDsl.and]` height`
 * @set [ColumnSetInfixDocs.ArgumentArg2] `name.firstName`
 */


public fun < C > ColumnSet < C > . except ( vararg others : ColumnsResolver < * > ) : ColumnSet < C >

= <EOL> except ( others . toColumnSet ( ) )

/**
 * @include [ColumnSetVarargDocs]
 * @set [CommonExceptDocs.ParamArg] @param [others\] Any number of [ColumnsResolvers][ColumnsResolver] containing
 * the columns that need to be excluded from the [ColumnSet].
 * @set [ColumnSetVarargDocs.ArgumentArg1] `(age, userData.height)`
 * @set [ColumnSetVarargDocs.ArgumentArg2] `(name.firstName, name.middleName)`
 */


public infix fun < C > ColumnSet < C > . except ( other : String ) : ColumnSet < C >

= <EOL> except ( column < Any ? > ( other ) )

/**
 * @include [ColumnSetInfixDocs]
 * @set [CommonExceptDocs.ParamArg] @param [other\] A [String] referring to
 * the column (relative to the current scope) that needs to be excluded from the [ColumnSet].
 * @set [ColumnSetInfixDocs.ArgumentArg1] `"age"`
 * @set [ColumnSetInfixDocs.ArgumentArg2] `"name"`
 */


public fun < C > ColumnSet < C > . except ( vararg others : String ) : ColumnSet < C >

/**
 * @include [ColumnSetVarargDocs]
 * @set [CommonExceptDocs.ParamArg] @param [others\] Any number of [Strings][String] referring to
 * the columns (relative to the current scope) that need to be excluded from the [ColumnSet].
 * @set [ColumnSetVarargDocs.ArgumentArg1] `("age", "height")`
 * @set [ColumnSetVarargDocs.ArgumentArg2] `("name")`
 */


public infix fun < C > ColumnSet < C > . except ( other : KProperty < C > ) : ColumnSet < C >

= <EOL> except ( column ( other ) )

/**
 * @include [ColumnSetInfixDocs]
 * @set [CommonExceptDocs.ParamArg] @param [other\] A [KProperty] referring to
 * the column (relative to the current scope) that needs to be excluded from the [ColumnSet].
 * @set [ColumnSetInfixDocs.ArgumentArg1] `Person::age`
 * @set [ColumnSetInfixDocs.ArgumentArg2] `Person::name`
 */


public fun < C > ColumnSet < C > . except ( vararg others : KProperty < C > ) : ColumnSet < C >

/**
 * @include [ColumnSetVarargDocs]
 * @set [CommonExceptDocs.ParamArg] @param [others\] Any number of [KProperties][KProperty] referring to
 * the columns (relative to the current scope) that need to be excluded from the [ColumnSet].
 * @set [ColumnSetVarargDocs.ArgumentArg1] `(Person::age, Person::height)`
 * @set [ColumnSetVarargDocs.ArgumentArg2] `(Person::name)`
 */


public infix fun < C > ColumnSet < C > . except ( other : ColumnPath ) : ColumnSet < C >

/**
 * @include [ColumnSetInfixDocs]
 * @set [CommonExceptDocs.ParamArg] @param [other\] A [ColumnPath] referring to
 * the column (relative to the current scope) that needs to be excluded from the [ColumnSet].
 * @set [ColumnSetInfixDocs.ArgumentArg1] `"userdata"["age"]`
 * @set [ColumnSetInfixDocs.ArgumentArg2] `pathOf("name", "firstName")`
 */


public fun < C > ColumnSet < C > . except ( vararg others : ColumnPath ) : ColumnSet < C >

/**
 * @include [ColumnSetVarargDocs]
 * @set [CommonExceptDocs.ParamArg] @param [others\] Any number of [ColumnPaths][ColumnPath] referring to
 * the columns (relative to the current scope) that need to be excluded from the [ColumnSet].
 * @set [ColumnSetVarargDocs.ArgumentArg1] `(pathOf("age"), "userdata"["height"])`
 * @set [ColumnSetVarargDocs.ArgumentArg2] `("name"["firstName"], "name"["middleName"])`
 */


public fun < C > ColumnsSelectionDsl < C > . allExcept ( selector : ColumnsSelector < C , * > ) : ColumnSet < * >

= <EOL> this . asSingleColumn ( ) . allColsExcept ( selector )

/**
 * @include [ColumnsSelectionDslDocs]
 * @set [CommonExceptDocs.ParamArg] @param [selector\] A lambda in which you specify the columns that need to be
 * excluded from the current selection. The scope of the selector is the same as the outer scope.
 * @set [ColumnsSelectionDslDocs.ArgumentArg1] ` { "age" `[and][ColumnsSelectionDsl.and]` height }`
 * @set [ColumnsSelectionDslDocs.ArgumentArg2] ` { name.firstName }`
 */


public fun ColumnsSelectionDsl < * > . allExcept ( vararg others : ColumnsResolver < * > ) : ColumnSet < * >

= <EOL> asSingleColumn ( ) . allColsExceptInternal ( others . toColumnSet ( ) )

/**
 * {@comment No scoping issues, this function can exist for legacy purposes}
 * @include [ColumnsSelectionDslDocs]
 * @set [CommonExceptDocs.ParamArg] @param [others\] A [ColumnsResolver] containing the columns that need to be
 * excluded from the current selection.
 * @set [ColumnsSelectionDslDocs.ArgumentArg1] `(age, height)`
 * @set [ColumnsSelectionDslDocs.ArgumentArg2] `(name.firstName, name.middleName)`
 */


public fun ColumnsSelectionDsl < * > . allExcept ( vararg others : String ) : ColumnSet < * >

/**
 * @include [ColumnsSelectionDslDocs]
 * @set [CommonExceptDocs.ParamArg] @param [others\] Any number of [Strings][String] referring to
 * the columns (relative to the current scope) that need to be excluded from the current selection.
 * @set [ColumnsSelectionDslDocs.ArgumentArg1] `("age", "height")`
 * @set [ColumnsSelectionDslDocs.ArgumentArg2] `("name")`
 */


public fun ColumnsSelectionDsl < * > . allExcept ( vararg others : KProperty < * > ) : ColumnSet < * >

/**
 * @include [ColumnsSelectionDslDocs]
 * @set [CommonExceptDocs.ParamArg] @param [others\] Any number of [KProperties][KProperty] referring to
 * the columns (relative to the current scope) that need to be excluded from the current selection.
 * @set [ColumnsSelectionDslDocs.ArgumentArg1] `(Person::age, Person::height)`
 * @set [ColumnsSelectionDslDocs.ArgumentArg2] `(Person::name)`
 */


public fun ColumnsSelectionDsl < * > . allExcept ( vararg others : ColumnPath ) : ColumnSet < * >

/**
 * @include [ColumnsSelectionDslDocs]
 * @set [CommonExceptDocs.ParamArg] @param [others\] Any number of [ColumnPaths][ColumnPath] referring to
 * the columns (relative to the current scope) that need to be excluded from the current selection.
 * @set [ColumnsSelectionDslDocs.ArgumentArg1] `(pathOf("age"), "userdata"["height"])`
 * @set [ColumnsSelectionDslDocs.ArgumentArg2] `("name"["firstName"], "name"["middleName"])`
 */


public fun < C > SingleColumn < DataRow < C > > . allColsExcept ( selector : ColumnsSelector < C , * > ) : ColumnSet < * >

= <EOL> allColsExceptInternal ( selector . toColumns ( ) )

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.SingleColumnReceiverArgs]
 * @include [ColumnGroupDocs.SelectorArgs]
 */


public fun SingleColumn < DataRow < * > > . allColsExcept ( vararg others : String ) : ColumnSet < * >

= <EOL> allColsExceptInternal ( others . toColumnSet ( ) )

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.SingleColumnReceiverArgs]
 * @include [ColumnGroupDocs.StringArgs]
 */


public fun SingleColumn < DataRow < * > > . allColsExcept ( vararg others : KProperty < * > ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.SingleColumnReceiverArgs]
 * @include [ColumnGroupDocs.KPropertyArgs]
 */


public fun SingleColumn < DataRow < * > > . allColsExcept ( vararg other : ColumnPath ) : ColumnSet < * >

= <EOL> allColsExceptInternal ( other . toColumnSet ( ) )

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.SingleColumnReceiverArgs]
 * @include [ColumnGroupDocs.ColumnPathArgs]
 */


public fun String . allColsExcept ( selector : ColumnsSelector < * , * > ) : ColumnSet < * >

= <EOL> columnGroup ( this ) . allColsExcept ( selector )

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.StringReceiverArgs]
 * @include [ColumnGroupDocs.SelectorArgs]
 */


public fun String . allColsExcept ( vararg others : String ) : ColumnSet < * >

= <EOL> columnGroup ( this ) . allColsExceptInternal ( others . toColumnSet ( ) )

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.StringReceiverArgs]
 * @include [ColumnGroupDocs.StringArgs]
 */


public fun String . allColsExcept ( vararg others : KProperty < * > ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.StringReceiverArgs]
 * @include [ColumnGroupDocs.KPropertyArgs]
 */


public fun String . allColsExcept ( vararg others : ColumnPath ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.StringReceiverArgs]
 * @include [ColumnGroupDocs.ColumnPathArgs]
 */


@ OptIn ( ExperimentalTypeInference :: class ) <EOL> @ OverloadResolutionByLambdaReturnType <EOL> public fun < C > KProperty < C > . allColsExcept ( selector : ColumnsSelector < C , * > ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * ## NOTE: {@comment TODO fix warning}
 * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you
 * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler
 * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)).
 * @include [ColumnGroupDocs.KPropertyReceiverArgs]
 * @include [ColumnGroupDocs.SelectorArgs]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > KProperty < DataRow < C > > . allColsExcept ( selector : ColumnsSelector < C , * > ) : ColumnSet < * >


public fun KProperty < * > . allColsExcept ( vararg others : String ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.KPropertyReceiverArgs]
 * @include [ColumnGroupDocs.StringArgs]
 */


public fun KProperty < * > . allColsExcept ( vararg others : KProperty < * > ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.KPropertyReceiverArgs]
 * @include [ColumnGroupDocs.KPropertyArgs]
 */


public fun KProperty < * > . allColsExcept ( vararg others : ColumnPath ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.KPropertyReceiverArgs]
 * @include [ColumnGroupDocs.ColumnPathArgs]
 */


public fun ColumnPath . allColsExcept ( selector : ColumnsSelector < * , * > ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.ColumnPathReceiverArgs]
 * @include [ColumnGroupDocs.SelectorArgs]
 */


public fun ColumnPath . allColsExcept ( vararg others : String ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.ColumnPathReceiverArgs]
 * @include [ColumnGroupDocs.StringArgs]
 */


public fun ColumnPath . allColsExcept ( vararg others : KProperty < * > ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.ColumnPathReceiverArgs]
 * @include [ColumnGroupDocs.KPropertyArgs]
 */


public fun ColumnPath . allColsExcept ( vararg others : ColumnPath ) : ColumnSet < * >

/**
 * @include [ColumnGroupDocs]
 * @include [ColumnGroupDocs.ColumnPathReceiverArgs]
 * @include [ColumnGroupDocs.ColumnPathArgs]
 */


@ ExperimentalExceptCsDsl <EOL> public infix fun < C > SingleColumn < DataRow < C > > . exceptNew ( selector : ColumnsSelector < C , * > ) : SingleColumn < DataRow < C > >

= <EOL> exceptExperimentalInternal ( selector . toColumns ( ) )

/**
 * @include [ExperimentalExceptDocs]
 */


@ ExperimentalExceptCsDsl <EOL> public infix fun < C > SingleColumn < DataRow < C > > . exceptNew ( other : String ) : SingleColumn < DataRow < C > >

= <EOL> exceptExperimentalInternal ( column < Any ? > ( other ) )


@ ExperimentalExceptCsDsl <EOL> public fun < C > SingleColumn < DataRow < C > > . exceptNew ( vararg others : String ) : SingleColumn < DataRow < C > >

= <EOL> exceptExperimentalInternal ( others . toColumnSet ( ) )


@ ExperimentalExceptCsDsl <EOL> public infix fun < C > SingleColumn < DataRow < C > > . exceptNew ( other : KProperty < C > ) : SingleColumn < DataRow < C > >

= <EOL> exceptExperimentalInternal ( column ( other ) )


@ ExperimentalExceptCsDsl <EOL> public fun < C > SingleColumn < DataRow < C > > . exceptNew ( vararg others : KProperty < * > ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> public infix fun < C > SingleColumn < DataRow < C > > . exceptNew ( other : ColumnPath ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> public fun < C > SingleColumn < DataRow < C > > . exceptNew ( vararg others : ColumnPath ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> public infix fun String . exceptNew ( selector : ColumnsSelector < * , * > ) : SingleColumn < DataRow < * > >

= <EOL> columnGroup ( this ) . exceptNew ( selector )


@ ExperimentalExceptCsDsl <EOL> public infix fun String . exceptNew ( other : String ) : SingleColumn < DataRow < * > >

= <EOL> columnGroup ( this ) . exceptExperimentalInternal ( column < Any ? > ( other ) )


@ ExperimentalExceptCsDsl <EOL> public fun String . exceptNew ( vararg others : String ) : SingleColumn < DataRow < * > >

= <EOL> columnGroup ( this ) . exceptExperimentalInternal ( others . toColumnSet ( ) )


@ ExperimentalExceptCsDsl <EOL> public infix fun String . exceptNew ( other : KProperty < * > ) : SingleColumn < DataRow < * > >

= <EOL> columnGroup ( this ) . exceptExperimentalInternal ( column ( other ) )


@ ExperimentalExceptCsDsl <EOL> public fun String . exceptNew ( vararg others : KProperty < * > ) : SingleColumn < DataRow < * > >


@ ExperimentalExceptCsDsl <EOL> public infix fun String . exceptNew ( other : ColumnPath ) : SingleColumn < DataRow < * > >


@ ExperimentalExceptCsDsl <EOL> public fun String . exceptNew ( vararg others : ColumnPath ) : SingleColumn < DataRow < * > >


@ ExperimentalExceptCsDsl <EOL> @ OptIn ( ExperimentalTypeInference :: class ) <EOL> @ OverloadResolutionByLambdaReturnType <EOL> public infix fun < C > KProperty < C > . exceptNew ( selector : ColumnsSelector < C , * > ) : SingleColumn < DataRow < C > >

= <EOL> columnGroup ( this ) . exceptExperimentalInternal ( selector . toColumns ( ) )


@ ExperimentalExceptCsDsl <EOL> @ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public infix fun < C > KProperty < DataRow < C > > . exceptNew ( selector : ColumnsSelector < C , * > ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> public infix fun < C > KProperty < C > . exceptNew ( other : String ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> public fun < C > KProperty < C > . exceptNew ( vararg others : String ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> @ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public infix fun < C > KProperty < DataRow < C > > . exceptNew ( other : String ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> @ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > KProperty < DataRow < C > > . exceptNew ( vararg others : String ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> public infix fun < C > KProperty < C > . exceptNew ( other : KProperty < * > ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> public fun < C > KProperty < C > . exceptNew ( vararg others : KProperty < * > ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> @ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public infix fun < C > KProperty < DataRow < C > > . exceptNew ( other : KProperty < * > ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> @ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > KProperty < DataRow < C > > . exceptNew ( vararg others : KProperty < * > ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> public infix fun < C > KProperty < C > . exceptNew ( other : ColumnPath ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> public fun < C > KProperty < C > . exceptNew ( vararg others : ColumnPath ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> @ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public infix fun < C > KProperty < DataRow < C > > . exceptNew ( other : ColumnPath ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> @ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > KProperty < DataRow < C > > . exceptNew ( vararg others : ColumnPath ) : SingleColumn < DataRow < C > >


@ ExperimentalExceptCsDsl <EOL> public infix fun ColumnPath . exceptNew ( selector : ColumnsSelector < * , * > ) : SingleColumn < DataRow < * > >

= <EOL> columnGroup ( this ) . exceptExperimentalInternal ( selector . toColumns < Any ? , Any ? > ( ) )


@ ExperimentalExceptCsDsl <EOL> public infix fun ColumnPath . exceptNew ( other : String ) : SingleColumn < DataRow < * > >


@ ExperimentalExceptCsDsl <EOL> public fun ColumnPath . exceptNew ( vararg others : String ) : SingleColumn < DataRow < * > >


@ ExperimentalExceptCsDsl <EOL> public infix fun ColumnPath . exceptNew ( other : KProperty < * > ) : SingleColumn < DataRow < * > >


@ ExperimentalExceptCsDsl <EOL> public infix fun ColumnPath . exceptNew ( other : ColumnPath ) : SingleColumn < DataRow < * > >


@ ExperimentalExceptCsDsl <EOL> public fun ColumnPath . exceptNew ( vararg others : ColumnPath ) : SingleColumn < DataRow < * > >


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> internal fun < C > ColumnSet < C > . exceptInternal ( other : ColumnsResolver < * > ) : ColumnSet < C >

= <EOL> createColumnSet { context -> <EOL> val resolvedCols = this . resolve ( context ) <EOL> val resolvedColsToExcept = other . resolve ( context ) <EOL> resolvedCols . allColumnsExceptKeepingStructure ( resolvedColsToExcept ) <EOL> } as ColumnSet < C >

/**
 * Removes the columns in the "other" ColumnsResolver from the current ColumnSet while keeping the structure intact.
 * Returns a new ColumnSet with the remaining columns.
 *
 * @param other The ColumnsResolver containing the columns to be removed.
 * @return The new ColumnSet with the remaining columns.
 */


internal fun SingleColumn < DataRow < * > > . allColsExceptInternal ( other : ColumnsResolver < * > ) : ColumnSet < Any ? >

= <EOL> selectInternal { all ( ) . exceptInternal ( other ) }

/**
 * Returns a new ColumnSet that contains all columns from inside the receiver column group
 * except those specified in the "other" ColumnsResolver.
 *
 * @param other The ColumnsResolver containing the columns to be removed.
 * @return The new ColumnSet with the remaining columns.
 */


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> internal fun < C > SingleColumn < DataRow < C > > . exceptExperimentalInternal ( other : ColumnsResolver < * > ) : SingleColumn < DataRow < C > >

= <EOL> this . ensureIsColumnGroup ( ) . transformSingle { singleCol -> <EOL> val columnsToExcept = singleCol . asColumnGroup ( ) <EOL> . getColumnsWithPaths { other } <EOL> . map { it . changePath ( singleCol . path + it . path ) } <EOL> val newCols = listOf ( singleCol ) . allColumnsExceptKeepingStructure ( columnsToExcept ) <EOL> newCols as List < ColumnWithPath < DataRow < * > > > <EOL> } . singleInternal ( ) as SingleColumn < DataRow < C > >

/**
 * Returns a new SingleColumn<DataRow<C>> that has the same structure as the receiver, but excludes columns
 * specified in the "other" ColumnsResolver.
 *
 * @param other The [ColumnsResolver] to use for excluding columns.
 * @return A new [SingleColumn] with the filtered columns excluded.
 */


@ SinceKotlin ( "<STR_LIT:1.7>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class ) <EOL> public operator fun < T , R > DeepRecursiveFunction < T , R > . invoke ( value : T ) : R

= <EOL> DeepRecursiveScopeImpl < T , R > ( block , value ) . runCallLoop ( )

/**
 * Initiates a call to this deep recursive function, forming a root of the call tree.
 *
 * This operator should not be used from inside of [DeepRecursiveScope] as it uses the call stack slot for
 * initial recursive invocation. From inside of [DeepRecursiveScope] use
 * [callRecursive][DeepRecursiveScope.callRecursive].
 */


public abstract suspend fun callRecursive ( value : T ) : R

/**
 * Makes recursive call to this [DeepRecursiveFunction] function putting the call activation frame on the heap,
 * as opposed to the actual call stack that is used by a regular recursive call.
 */


public abstract suspend fun < U , S > DeepRecursiveFunction < U , S > . callRecursive ( value : U ) : S

/**
 * Makes call to the specified [DeepRecursiveFunction] function putting the call activation frame on the heap,
 * as opposed to the actual call stack that is used by a regular call.
 */


expect fun getCurrentDate ( ) : String


{ <EOL> return "<STR_LIT>" <EOL> }


private fun getProvider ( gradle : Gradle ) : Provider < VariantImplementationFactories >

{ <EOL> val configProvider = VariantImplementationFactoriesConfigurator . getProvider ( gradle ) <EOL> return gradle . sharedServices <EOL> . registerIfAbsent ( "<STR_LIT>" , VariantImplementationFactories :: class . java ) { <EOL> it . parameters . factories . value ( configProvider . get ( ) . factories ) <EOL> } <EOL> }

/**
 * Please don't change the visibility modifier. This method isn't intended to be used directly.
 * This method doesn't declare the service usage from Gradle tasks.
 */


@ Test <EOL> fun testResettingExceptionHandler ( )

= withExceptionHandler ( handler ) { <EOL> withFixedThreadPool ( <NUM_LIT:4> ) { dispatcher -> <EOL> val flow = rxFlowable < Unit > ( dispatcher ) { <EOL> if ( ( <NUM_LIT:0> .. <NUM_LIT:1> ) . random ( ) == <NUM_LIT:0> ) { <EOL> Thread . sleep ( <NUM_LIT:100> ) <EOL> } <EOL> throw TestException ( ) <EOL> } . asFlow ( ) <EOL> runBlocking { <EOL> combine ( flow , flow ) { _ , _ -> Unit } <EOL> . catch { } <EOL> . collect { } <EOL> } <EOL> } <EOL> }

/**
 * This test doesn't test much and was added to display a problem with straighforward use of
 * [withExceptionHandler].
 *
 * If one was to remove `dispatcher` and launch `rxFlowable` with an empty coroutine context,
 * this test would fail fairly often, while other tests were also vulnerable, but the problem is
 * much more difficult to reproduce. Thus, this test is a justification for adding `dispatcher`
 * to other tests.
 *
 * See the commit that introduced this test for a better explanation.
 */


private fun withFixedThreadPool ( numberOfThreads : Int , block : ( CoroutineDispatcher ) -> Unit )

{ <EOL> val pool = Executors . newFixedThreadPool ( numberOfThreads ) <EOL> val dispatcher = pool . asCoroutineDispatcher ( ) <EOL> block ( dispatcher ) <EOL> pool . shutdown ( ) <EOL> while ( ! pool . awaitTermination ( <NUM_LIT:10> , TimeUnit . SECONDS ) ) { <EOL> } <EOL> }

/**
 * Run in a thread pool, then wait for all the tasks to finish.
 */


/**
 * [Foo.<caret_1>nonExtFun]
 * [test.Foo.<caret_2>nonExtFun]
 *
 * [Foo.<caret_3>nonExtProp]
 * [test.Foo.<caret_4>nonExtProp]
 */


inline fun < T > withChildClassName ( name : Name , isExpect : Boolean , forceLocalContext : Boolean = false , l : ( ) -> T , )

= when { <EOL> forceLocalContext -> withForcedLocalContext { <EOL> withChildClassNameRegardlessLocalContext ( name , isExpect , l ) <EOL> } <EOL> else -> { <EOL> withChildClassNameRegardlessLocalContext ( name , isExpect , l ) <EOL> } <EOL> }


inline fun < T > withContainerSymbol ( symbol : FirBasedSymbol < * > , isLocal : Boolean = false , block : ( ) -> T , ) : T

{ <EOL> if ( ! isLocal ) { <EOL> context . pushContainerSymbol ( symbol ) <EOL> } <EOL> return try { <EOL> block ( ) <EOL> } finally { <EOL> if ( ! isLocal ) { <EOL> context . popContainerSymbol ( symbol ) <EOL> } <EOL> } <EOL> }

/**
 * @param isLocal if true [symbol] will be ignored
 *
 * @see Context.containerSymbol
 * @see Context.pushContainerSymbol
 * @see Context.popContainerSymbol
 */


protected fun dispatchReceiverForInnerClassConstructor ( ) : ConeClassLikeType ?

{ <EOL> val dispatchReceivers = context . dispatchReceiverTypesStack <EOL> return dispatchReceivers . getOrNull ( dispatchReceivers . lastIndex - <NUM_LIT:1> ) <EOL> }

/**
 * @return second from the end dispatch receiver. For the inner class constructor it would be the outer class.
 */


fun < T > MutableList < T > . removeLast ( ) : T

{ <EOL> return removeAt ( size - <NUM_LIT:1> ) <EOL> }


private fun generateIncrementOrDecrementBlockForArrayAccess ( wholeExpression : T , operationReference : T ? , receiver : T , callName : Name , prefix : Boolean , convert : T . ( ) -> FirExpression , ) : FirExpression

{ <EOL> val array = receiver . arrayExpression <EOL> val isInc = when ( callName ) { <EOL> OperatorNameConventions . INC -> true <EOL> OperatorNameConventions . DEC -> false <EOL> else -> error ( "<STR_LIT>" ) <EOL> } <EOL> val sourceKind = sourceKindForIncOrDec ( callName , prefix ) <EOL> return buildBlockPossiblyUnderSafeCall ( array , convert , receiver . toFirSourceElement ( ) , ) { arrayReceiver -> <EOL> val baseSource = wholeExpression ? . toFirSourceElement ( ) <EOL> val desugaredSource = baseSource ? . fakeElement ( sourceKind ) <EOL> source = desugaredSource <EOL> val indices = receiver . indexExpressions <EOL> requireNotNull ( indices ) { "<STR_LIT>" } <EOL> val arrayVariable = generateTemporaryVariable ( baseModuleData , array ? . toFirSourceElement ( KtFakeSourceElementKind . ArrayAccessNameReference ) , name = SpecialNames . ARRAY , initializer = arrayReceiver , ) . also { statements += it } <EOL> val indexVariables = indices . mapIndexed { i , index -> <EOL> generateTemporaryVariable ( baseModuleData , index . toFirSourceElement ( KtFakeSourceElementKind . ArrayIndexExpressionReference ) , name = SpecialNames . subscribeOperatorIndex ( i ) , index . convert ( ) ) . also { statements += it } <EOL> } <EOL> fun buildGetCall ( sourceKind : KtFakeSourceElementKind ) = <EOL> buildFunctionCall { <EOL> val fakeSource = receiver ? . toFirSourceElement ( sourceKind ) <EOL> source = fakeSource <EOL> calleeReference = buildSimpleNamedReference { <EOL> source = fakeSource <EOL> name = OperatorNameConventions . GET <EOL> } <EOL> explicitReceiver = generateResolvedAccessExpression ( arrayVariable . source , arrayVariable ) <EOL> argumentList = buildArgumentList { <EOL> for ( indexVar in indexVariables ) { <EOL> arguments += generateResolvedAccessExpression ( indexVar . source , indexVar ) <EOL> } <EOL> } <EOL> origin = FirFunctionCallOrigin . Operator <EOL> } <EOL> fun buildSetCall ( argumentExpression : FirExpression , sourceElementKind : KtFakeSourceElementKind ) = buildFunctionCall { <EOL> source = desugaredSource <EOL> calleeReference = buildSimpleNamedReference { <EOL> source = receiver . toFirSourceElement ( sourceElementKind ) <EOL> name = OperatorNameConventions . SET <EOL> } <EOL> explicitReceiver = generateResolvedAccessExpression ( arrayVariable . source , arrayVariable ) <EOL> argumentList = buildArgumentList { <EOL> for ( indexVar in indexVariables ) { <EOL> arguments += generateResolvedAccessExpression ( indexVar . source , indexVar ) <EOL> } <EOL> arguments += argumentExpression <EOL> } <EOL> origin = FirFunctionCallOrigin . Operator <EOL> } <EOL> fun buildIncDecCall ( kind : KtFakeSourceElementKind , receiver : FirExpression ) = buildFunctionCall { <EOL> source = desugaredSource <EOL> calleeReference = buildSimpleNamedReference { <EOL> source = operationReference ? . toFirSourceElement ( kind ) <EOL> name = callName <EOL> } <EOL> explicitReceiver = receiver <EOL> origin = FirFunctionCallOrigin . Operator <EOL> } <EOL> if ( prefix ) { <EOL> statements += buildSetCall ( buildIncDecCall ( sourceKind , buildGetCall ( sourceKind ) , ) , sourceKind ) <EOL> statements += buildGetCall ( if ( isInc ) { <EOL> KtFakeSourceElementKind . DesugaredPrefixIncSecondGetReference <EOL> } else { <EOL> KtFakeSourceElementKind . DesugaredPrefixDecSecondGetReference <EOL> } ) <EOL> } else { <EOL> val initialValueVar = generateTemporaryVariable ( baseModuleData , desugaredSource , SpecialNames . UNARY , buildGetCall ( sourceKind ) ) <EOL> statements += initialValueVar <EOL> statements += buildSetCall ( buildIncDecCall ( sourceKind , generateResolvedAccessExpression ( null , initialValueVar ) ) , sourceKind ) <EOL> statements += generateResolvedAccessExpression ( null , initialValueVar ) <EOL> } <EOL> } <EOL> }

/**
 * given:
 * a[b, c]++
 *
 * result:
 * {
 * val <array> = a
 * val <index0> = b
 * val <index1> = c
 * val <unary> = <array>.get(<index0>, <index1>)
 * <array>.set(<index0>, <index1>, <unary>.inc())
 * ^<unary>
 * }
 *
 * given:
 * ++a[b, c]
 *
 * result:
 * {
 * val <array> = a
 * val <index0> = b
 * val <index1> = c
 * <array>.set(b, c, <array>.get(<index0>, <index1>).inc())
 * ^<array>.get(<index0>, <index1>)
 * }
 *
 */


fun List < FirAnnotationCall > . filterConstructorPropertyRelevantAnnotations ( isVar : Boolean )

= filter { <EOL> it . useSiteTarget == null || it . useSiteTarget == AnnotationUseSiteTarget . PROPERTY <EOL> || ! isVar && ( it . useSiteTarget == AnnotationUseSiteTarget . SETTER_PARAMETER || it . useSiteTarget == AnnotationUseSiteTarget . PROPERTY_SETTER ) <EOL> }

/**
 * Not the same as [filterStandalonePropertyRelevantAnnotations], because on
 * primary constructor value parameters annotations should go to the
 * [FirValueParameter] first.
 */


inline fun copying ( block : ExecuteRequest . ( ) -> Unit ) : ExecuteRequest

= copy ( ) . apply ( block )

/**
 * Create a copy of this [ExecuteRequest], modify the copy by running [block] on it, and return that copy.
 */


{ <EOL> check ( exitCode == <NUM_LIT:0> ) { <EOL> if ( exitCode == null ) { <EOL> "<STR_LIT>" <EOL> } else { <EOL> "<STR_LIT>" <EOL> } <EOL> } <EOL> return this <EOL> }

/**
 * Checks that [exitCode] is `0`.
 *
 * @throws IllegalStateException if [exitCode] is not 0.
 */


fun execute ( request : ExecuteRequest ) : ExecuteResponse

/**
 * Run the process and wait for its completion.
 */


private fun BodyGenerator . createBinaryTable ( selectorLocal : WasmLocal , intBranches : List < ExtractedWhenBranch < Int > > )

{ <EOL> val sortedCaseToBranchIndex = mutableListOf < Pair < Int , Int > > ( ) <EOL> intBranches . flatMapIndexedTo ( sortedCaseToBranchIndex ) { index , branch -> branch . conditions . map { it . const . value to index } } <EOL> sortedCaseToBranchIndex . sortBy { it . first } <EOL> val location = SourceLocation . NoLocation ( "<STR_LIT>" ) <EOL> val thenBody = { result : Int -> <EOL> body . buildConstI32 ( result , location ) <EOL> } <EOL> val elseBody : ( ) -> Unit = { <EOL> body . buildConstI32 ( intBranches . size , location ) <EOL> } <EOL> createBinaryTable ( selectorLocal , WasmI32 , sortedCaseToBranchIndex , <NUM_LIT:0> , sortedCaseToBranchIndex . size , thenBody , elseBody ) <EOL> }

/**
 * Create binary search for when that emit branches index in leafs
 * when (a) {
 * 123 -> expr1
 * 456 -> expr2
 * else -> elseExpr
 * }
 * crates binary search linked to index of branch
 * IF (a < 456) {
 * IF (a == 123)
 * #expr1
 * ELSE
 * #else
 * END IF
 * ELSE
 * IF (1 == 456)
 * #expr2
 * ELSE
 * #else
 * END IF
 * END IF
 * }
 */


private fun BodyGenerator . createBinaryTable ( selectorLocal : WasmLocal , intBranches : List < ExtractedWhenBranch < Int > > , elseExpression : IrExpression ? , resultType : WasmType ? , expectedType : IrType , )

{ <EOL> val sortedCaseToBranchIndex = mutableListOf < Pair < Int , IrExpression > > ( ) <EOL> intBranches . mapTo ( sortedCaseToBranchIndex ) { branch -> branch . conditions [ <NUM_LIT:0> ] . const . value to branch . expression } <EOL> sortedCaseToBranchIndex . sortBy { it . first } <EOL> body . buildBlock ( "<STR_LIT>" , resultType ) { currentBlock -> <EOL> val thenBody = { result : IrExpression -> <EOL> generateWithExpectedType ( result , expectedType ) <EOL> body . buildBr ( currentBlock , SourceLocation . NoLocation ( "<STR_LIT>" ) ) <EOL> } <EOL> createBinaryTable ( selectorLocal = selectorLocal , resultType = null , sortedCases = sortedCaseToBranchIndex , fromIncl = <NUM_LIT:0> , toExcl = sortedCaseToBranchIndex . size , thenBody = thenBody , elseBody = { } ) <EOL> if ( elseExpression != null ) { <EOL> generateWithExpectedType ( elseExpression , expectedType ) <EOL> } else { <EOL> if ( resultType != null ) { <EOL> if ( expectedType . isUnit ( ) ) { <EOL> body . buildGetUnit ( ) <EOL> } else { <EOL> error ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * Create binary search for when that emit when expressions in leafs
 * when (a) {
 * 123 -> expr1
 * 456 -> expr2
 * else -> elseExpr
 * }
 * crates binary search linked to index of branch
 * BLOCK
 * IF (a < 456) {
 * IF (a == 123)
 * #expr1
 * GOTO END BLOCK
 * END IF
 * ELSE
 * IF (1 == 456)
 * #expr2
 * GOTO END BLOCK
 * END IF
 * END IF
 * elseExpr
 * END BLOCK
 * }
*/


private fun BodyGenerator . genTableIntSwitch ( selectorLocal : WasmLocal , resultType : WasmType ? , branches : List < ExtractedWhenBranch < Int > > , elseExpression : IrExpression ? , shift : Int , brTable : List < Int > , expectedType : IrType , )

{ <EOL> val location = SourceLocation . NoLocation ( "<STR_LIT>" ) <EOL> val baseBlockIndex = body . numberOfNestedBlocks <EOL> repeat ( branches . size + <NUM_LIT:2> ) { <EOL> body . buildBlock ( resultType ) <EOL> } <EOL> if ( resultType != null && resultType !is WasmUnreachableType ) { <EOL> generateDefaultInitializerForType ( resultType , body ) <EOL> } <EOL> body . buildGetLocal ( selectorLocal , location ) <EOL> if ( shift != <NUM_LIT:0> ) { <EOL> body . buildConstI32 ( shift , location ) <EOL> body . buildInstr ( WasmOp . I32_SUB , location ) <EOL> } <EOL> body . buildInstr ( WasmOp . BR_TABLE , location , WasmImmediate . LabelIdxVector ( brTable ) , WasmImmediate . LabelIdx ( branches . size ) ) <EOL> body . buildEnd ( ) <EOL> for ( expression in branches ) { <EOL> if ( resultType != null && resultType !is WasmUnreachableType ) { <EOL> body . buildDrop ( location ) <EOL> } <EOL> generateWithExpectedType ( expression . expression , expectedType ) <EOL> body . buildBr ( baseBlockIndex + <NUM_LIT:1> , location ) <EOL> body . buildEnd ( ) <EOL> } <EOL> if ( elseExpression != null ) { <EOL> if ( resultType != null && resultType !is WasmUnreachableType ) { <EOL> body . buildDrop ( location ) <EOL> } <EOL> generateWithExpectedType ( elseExpression , expectedType ) <EOL> } <EOL> body . buildEnd ( ) <EOL> check ( baseBlockIndex == body . numberOfNestedBlocks ) <EOL> }

/**
 * Create table switch with expressions
 * when (a) {
 * 0 -> expr1
 * 1 -> expr2
 * else -> elseExpr
 * }
 * crates binary search linked to index of branch
 * BLOCK FOR ELSE
 * BLOCK1
 * BLOCK2
 * BLOCK FOR BRTABLE
 * BRTABLE 0 1 2
 * END BLOCK FOR BRTABLE
 * expr1
 * GOTO END BLOCK FOR ELSE
 * END BLOCK1
 * expr2
 * GOTO END BLOCK FOR ELSE
 * END BLOCK2
 * elseExpr
 * END BLOCK FOR ELSE
 */


= <NUM_LIT:42>

/**
 * The ultimate answer to life, universe, and everything can be printed like this:
 * ```kotlin
 * fun main() {
 * println(theAnswer())
 * }
 * ```
 * <!--- KNIT example-kdoc-num.kt -->
 */


private fun invalidate ( module : KtModule )

{ <EOL> ApplicationManager . getApplication ( ) . assertWriteAccessAllowed ( ) <EOL> sessionInvalidationEventPublisher . collectSessionsAndPublishInvalidationEvent { <EOL> val didSessionExist = sessionCache . removeSession ( module ) <EOL> if ( ! didSessionExist ) return@collectSessionsAndPublishInvalidationEvent <EOL> KotlinModuleDependentsProvider . getInstance ( project ) . getTransitiveDependents ( module ) . forEach ( sessionCache :: removeSession ) <EOL> if ( module is KtScriptModule || module is KtScriptDependencyModule || module is KtLibraryModule ) { <EOL> sessionCache . removeAllScriptSessions ( ) <EOL> } <EOL> if ( module is KtDanglingFileModule ) { <EOL> sessionCache . removeContextualDanglingFileSessions ( module ) <EOL> } else { <EOL> sessionCache . removeAllDanglingFileSessions ( ) <EOL> } <EOL> } <EOL> }

/**
 * Invalidates the session(s) associated with [module].
 *
 * Per the contract of [LLFirSessionInvalidationService], [invalidate] may only be called from a write action.
 */


fun report ( filePath : String , owner : String , name : String , constType : String )

/**
 * Report Java constant, which is defined as [name] in [owner] java class.
 * This constant is used in Kotlin file [filePath].
 * [constType] is one of Kotlin's [Byte, Short, Int, Long, Float, Double, Boolean, Char, String],
 * that correspond to the eight primitive Java types or String
 * Format of [owner] class is "package.Outer$Inner"
 */


fun isExported ( module : KtModule ) : Boolean

/**
 * Will return true if the module is considered 'exported' in the build.
 * e.g. the Gradle project building the framework should always be considered as 'exported'.
 * However, dependencies of such a Gradle project (e.g. a 'utils' module) can either be declared
 * as 'exported' or not exported.
 *
 * Exported modules will get their full API surface includced in the final framework.
 * Non-exported modules will get an additional module 'string' attached to exported classifiers.
 */


internal fun KtObjCExportSession . isExported ( module : KtModule ) : Boolean

= cached ( IsExportedCacheKey ( module ) ) { <EOL> internal . moduleClassifier . isExported ( module ) <EOL> }

/**
 * See [KtObjCExportDefaultModuleClassifier.isExported]:
 * Note: This method will be cached.
 */


public fun expectedLocationForDri ( dri : DRI ) : String

= <EOL> ( listOf ( dri . packageName ) + dri . classNames ? . split ( "<STR_LIT:.>" ) ? . map { identifierToFilename ( it ) } . orEmpty ( ) + listOf ( dri . callable ? . let { identifierToFilename ( it . name ) } ? : "<STR_LIT>" ) ) . filterNotNull ( ) . joinToString ( "<STR_LIT:/>" )

/**
 * This method should return guessed filesystem location for a given [DRI]
 * It is used to decide if a [DRI] should be present in the relocation list of the
 * generated package-list so it is ok if the path differs from the one returned by [resolve]
 * @return Path to a giver [DRI] or null if path should not be considered for relocations
 */


public fun < T > CoroutineScope . future ( context : CoroutineContext = EmptyCoroutineContext , start : CoroutineStart = CoroutineStart . DEFAULT , block : suspend CoroutineScope . ( ) -> T ) : ListenableFuture < T >

{ <EOL> require ( ! start . isLazy ) { "<STR_LIT>" } <EOL> val newContext = newCoroutineContext ( context ) <EOL> val coroutine = ListenableFutureCoroutine < T > ( newContext ) <EOL> coroutine . start ( start , coroutine , block ) <EOL> return coroutine . future <EOL> }

/**
 * Starts [block] in a new coroutine and returns a [ListenableFuture] pointing to its result.
 *
 * The coroutine is started immediately. Passing [CoroutineStart.LAZY] to [start] throws
 * [IllegalArgumentException], because Futures don't have a way to start lazily.
 *
 * When the created coroutine [isCompleted][Job.isCompleted], it will try to
 * *synchronously* complete the returned Future with the same outcome. This will
 * succeed, barring a race with external cancellation of returned [ListenableFuture].
 *
 * Cancellation is propagated bidirectionally.
 *
 * `CoroutineContext` is inherited from this [CoroutineScope]. Additional context elements can be
 * added/overlaid by passing [context].
 *
 * If the context does not have a [CoroutineDispatcher], nor any other [ContinuationInterceptor]
 * member, [Dispatchers.Default] is used.
 *
 * The parent job is inherited from this [CoroutineScope], and can be overridden by passing
 * a [Job] in [context].
 *
 * See [newCoroutineContext][CoroutineScope.newCoroutineContext] for a description of debugging
 * facilities.
 *
 * Note that the error and cancellation semantics of [future] are _different_ than [async]'s.
 * In contrast to [Deferred], [Future] doesn't have an intermediate `Cancelling` state. If
 * the returned `Future` is successfully cancelled, and `block` throws afterward, the thrown
 * error is dropped, and getting the `Future`'s value will throw a `CancellationException` with
 * no cause. This is to match the specification and behavior of
 * `java.util.concurrent.FutureTask`.
 *
 * @param context added overlaying [CoroutineScope.coroutineContext] to form the new context.
 * @param start coroutine start option. The default value is [CoroutineStart.DEFAULT].
 * @param block the code to execute.
 */


public fun < T > ListenableFuture < T > . asDeferred ( ) : Deferred < T >

{ <EOL> if ( this is InternalFutureFailureAccess ) { <EOL> val t : Throwable ? = InternalFutures . tryInternalFastPathGetFailure ( this ) <EOL> if ( t != null ) { <EOL> return CompletableDeferred < T > ( ) . also { <EOL> it . completeExceptionally ( t ) <EOL> } <EOL> } <EOL> } <EOL> if ( isDone ) { <EOL> return try { <EOL> CompletableDeferred ( Uninterruptibles . getUninterruptibly ( this ) ) <EOL> } catch ( e : CancellationException ) { <EOL> CompletableDeferred < T > ( ) . also { it . cancel ( e ) } <EOL> } catch ( e : ExecutionException ) { <EOL> CompletableDeferred < T > ( ) . also { it . completeExceptionally ( e . nonNullCause ( ) ) } <EOL> } <EOL> } <EOL> val deferred = CompletableDeferred < T > ( ) <EOL> Futures . addCallback ( this , object : FutureCallback < T > { <EOL> override fun onSuccess ( result : T ) { <EOL> runCatching { deferred . complete ( result ) } <EOL> . onFailure { handleCoroutineException ( EmptyCoroutineContext , it ) } <EOL> } <EOL> override fun onFailure ( t : Throwable ) { <EOL> runCatching { deferred . completeExceptionally ( t ) } <EOL> . onFailure { handleCoroutineException ( EmptyCoroutineContext , it ) } <EOL> } <EOL> } , MoreExecutors . directExecutor ( ) ) <EOL> deferred . invokeOnCompletion { <EOL> cancel ( false ) <EOL> } <EOL> return object : Deferred < T > by deferred { } <EOL> }

/**
 * Returns a [Deferred] that is completed or failed by `this` [ListenableFuture].
 *
 * Completion is non-atomic between the two promises.
 *
 * Cancellation is propagated bidirectionally.
 *
 * When `this` `ListenableFuture` completes (either successfully or exceptionally) it will try to
 * complete the returned `Deferred` with the same value or exception. This will succeed, barring a
 * race with cancellation of the `Deferred`.
 *
 * When `this` `ListenableFuture` is [successfully cancelled][java.util.concurrent.Future.cancel],
 * it will cancel the returned `Deferred`.
 *
 * When the returned `Deferred` is [cancelled][Deferred.cancel], it will try to propagate the
 * cancellation to `this` `ListenableFuture`. Propagation will succeed, barring a race with the
 * `ListenableFuture` completing normally. This is the only case in which the returned `Deferred`
 * will complete with a different outcome than `this` `ListenableFuture`.
 */


private fun ExecutionException . nonNullCause ( ) : Throwable

{ <EOL> return this . cause ! ! <EOL> }

/**
 * Returns the cause from an [ExecutionException] thrown by a [Future.get] or similar.
 *
 * [ExecutionException] _always_ wraps a non-null cause when Future.get() throws. A Future cannot
 * fail without a non-null `cause`, because the only way a Future _can_ fail is an uncaught
 * [Exception].
 *
 * If this !! throws [NullPointerException], a Future is breaking its interface contract and losing
 * state - a serious fundamental bug.
 */


public fun < T > Deferred < T > . asListenableFuture ( ) : ListenableFuture < T >

{ <EOL> val listenableFuture = JobListenableFuture < T > ( this ) <EOL> invokeOnCompletion { throwable -> <EOL> if ( throwable == null ) { <EOL> listenableFuture . complete ( getCompleted ( ) ) <EOL> } else { <EOL> listenableFuture . completeExceptionallyOrCancel ( throwable ) <EOL> } <EOL> } <EOL> return listenableFuture <EOL> }

/**
 * Returns a [ListenableFuture] that is completed or failed by `this` [Deferred].
 *
 * Completion is non-atomic between the two promises.
 *
 * When either promise successfully completes, it will attempt to synchronously complete its
 * counterpart with the same value. This will succeed barring a race with cancellation.
 *
 * When either promise completes with an Exception, it will attempt to synchronously complete its
 * counterpart with the same Exception. This will succeed barring a race with cancellation.
 *
 * Cancellation is propagated bidirectionally.
 *
 * When the returned [Future] is successfully cancelled - meaning [Future.cancel] returned true -
 * [Deferred.cancel] will be synchronously called on `this` [Deferred]. This will attempt to cancel
 * the `Deferred`, though cancellation may not succeed and the `Deferred` may complete in a
 * non-cancelled terminal state.
 *
 * When `this` `Deferred` reaches its "cancelled" state with a successful cancellation - meaning it
 * completes with [kotlinx.coroutines.CancellationException] - `this` `Deferred` will synchronously
 * cancel the returned `Future`. This can only race with cancellation of the returned `Future`, so
 * the returned `Future` will always _eventually_ reach its cancelled state when either promise is
 * successfully cancelled, for their different meanings of "successfully cancelled".
 *
 * This is inherently a race. See [Future.cancel] for a description of `Future` cancellation
 * semantics. See [Job] for a description of coroutine cancellation semantics. See
 * [JobListenableFuture.cancel] for greater detail on the overlapped cancellation semantics and
 * corner cases of this method.
 */


public suspend fun < T > ListenableFuture < T > . await ( ) : T

{ <EOL> try { <EOL> if ( isDone ) return Uninterruptibles . getUninterruptibly ( this ) <EOL> } catch ( e : ExecutionException ) { <EOL> throw e . nonNullCause ( ) <EOL> } <EOL> return suspendCancellableCoroutine { cont : CancellableContinuation < T > -> <EOL> addListener ( ToContinuation ( this , cont ) , MoreExecutors . directExecutor ( ) ) <EOL> cont . invokeOnCancellation { <EOL> cancel ( false ) <EOL> } <EOL> } <EOL> }

/**
 * Awaits completion of `this` [ListenableFuture] without blocking a thread.
 *
 * This suspend function is cancellable.
 *
 * If the [Job] of the current coroutine is cancelled while this suspending function is waiting, this function
 * stops waiting for the future and immediately resumes with [CancellationException][kotlinx.coroutines.CancellationException].
 *
 * This method is intended to be used with one-shot Futures, so on coroutine cancellation, the Future is cancelled as well.
 * If cancelling the given future is undesired, use [Futures.nonCancellationPropagating] or
 * [kotlinx.coroutines.NonCancellable].
 */


= auxFuture . set ( result )

/**
 * When the attached coroutine [isCompleted][Job.isCompleted] successfully
 * its outcome should be passed to this method.
 *
 * This should succeed barring a race with external cancellation.
 */


fun completeExceptionallyOrCancel ( t : Throwable ) : Boolean

= <EOL> if ( t is CancellationException ) auxFuture . set ( Cancelled ( t ) ) <EOL> else auxFuture . setException ( t ) . also { if ( it ) auxFutureIsFailed = true }

/**
 * When the attached coroutine [isCompleted][Job.isCompleted] [exceptionally][Job.isCancelled]
 * its outcome should be passed to this method.
 *
 * This method will map coroutine's exception into corresponding Future's exception.
 *
 * This should succeed barring a race with external cancellation.
 */


{ <EOL> return auxFuture . isCancelled || isDone && ! auxFutureIsFailed && try { <EOL> Uninterruptibles . getUninterruptibly ( auxFuture ) is Cancelled <EOL> } catch ( e : CancellationException ) { <EOL> true <EOL> } catch ( e : ExecutionException ) { <EOL> auxFutureIsFailed = true <EOL> false <EOL> } <EOL> }

/**
 * Returns cancellation _in the sense of [Future]_. This is _not_ equivalent to
 * [Job.isCancelled].
 *
 * When done, this Future is cancelled if its [auxFuture] is cancelled, or if [auxFuture]
 * contains [CancellationException].
 *
 * See [cancel].
 */


{ <EOL> return getInternal ( auxFuture . get ( ) ) <EOL> }

/**
 * Waits for [auxFuture] to complete by blocking, then uses its `result`
 * to get the `T` value `this` [ListenableFuture] is pointing to or throw a [CancellationException].
 * This establishes happens-after ordering for completion of the entangled coroutine.
 *
 * [SettableFuture.get] can only throw [CancellationException] if it was cancelled externally.
 * Otherwise it returns [Cancelled] that encapsulates outcome of the entangled coroutine.
 *
 * [auxFuture] _must be complete_ in order for the [isDone] and [isCancelled] happens-after
 * contract of [Future] to be correctly followed.
 */


override fun get ( timeout : Long , unit : TimeUnit ) : T

{ <EOL> return getInternal ( auxFuture . get ( timeout , unit ) ) <EOL> }


private fun getInternal ( result : Any ? ) : T

= if ( result is Cancelled ) { <EOL> throw CancellationException ( ) . initCause ( result . exception ) <EOL> } else { <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> result as T <EOL> }


override fun cancel ( mayInterruptIfRunning : Boolean ) : Boolean

{ <EOL> return if ( auxFuture . cancel ( mayInterruptIfRunning ) ) { <EOL> jobToCancel . cancel ( ) <EOL> true <EOL> } else { <EOL> false <EOL> } <EOL> }

/**
 * Tries to cancel [jobToCancel] if `this` future was cancelled. This is fundamentally racy.
 *
 * The call to `cancel()` will try to cancel [auxFuture]: if and only if cancellation of [auxFuture]
 * succeeds, [jobToCancel] will have its [Job.cancel] called.
 *
 * This arrangement means that [jobToCancel] _might not successfully cancel_, if the race resolves
 * in a particular way. [jobToCancel] may also be in its "cancelling" state while this
 * ListenableFuture is complete and cancelled.
 */


fun resolveWithDependencies ( unresolvedLibraries : List < UnresolvedLibrary > , noStdLib : Boolean = false , noDefaultLibs : Boolean = false , noEndorsedLibs : Boolean = false , ) : KotlinLibraryResolveResult

= <EOL> resolveWithoutDependencies ( unresolvedLibraries , noStdLib , noDefaultLibs , noEndorsedLibs ) . resolveDependencies ( )

/**
 * Given the list of Kotlin/Native library names, ABI version and other parameters
 * resolves libraries and evaluates dependencies between them.
 */


@ JvmStatic <EOL> fun disposeApplicationEnvironment ( )

{ <EOL> synchronized ( APPLICATION_LOCK ) { <EOL> val environment = ourApplicationEnvironment ? : return <EOL> ourApplicationEnvironment = null <EOL> Disposer . dispose ( environment . parentDisposable ) <EOL> resetApplicationManager ( environment . application ) <EOL> ZipHandler . clearFileAccessorCache ( ) <EOL> } <EOL> }

/**
 * This method is also used in Gradle after configuration phase finished.
 */


@ JvmStatic <EOL> fun resetApplicationManager ( applicationToReset : Application ? = null )

{ <EOL> val currentApplication = ApplicationManager . getApplication ( ) ? : return <EOL> if ( applicationToReset != null && applicationToReset != currentApplication ) { <EOL> return <EOL> } <EOL> try { <EOL> val ourApplicationField = ApplicationManager :: class . java . getDeclaredField ( "<STR_LIT>" ) <EOL> ourApplicationField . isAccessible = true <EOL> ourApplicationField . set ( null , null ) <EOL> } catch ( exception : Exception ) { <EOL> if ( currentApplication . isUnitTestMode ) { <EOL> throw exception <EOL> } <EOL> } <EOL> }

/**
 * Resets the application managed by [ApplicationManager] to `null`. If [applicationToReset] is specified, [resetApplicationManager]
 * will only reset the application if it's the expected one. Otherwise, the application will already have been changed to another
 * application. For example, application disposal can trigger one of the disposables registered via
 * [ApplicationManager.setApplication], which reset the managed application to the previous application.
 */


= InlineClassAbi . unboxType ( this ) ? : this

/**
 * Replace inline classes by their underlying types.
 */


fun unboxType ( type : IrType ) : IrType ?

{ <EOL> val klass = type . classOrNull ? . owner ? : return null <EOL> val representation = klass . inlineClassRepresentation ? : return null <EOL> var underlyingType = representation . underlyingType . unboxInlineClass ( ) <EOL> if ( ! underlyingType . isNullable ( ) && underlyingType . isTypeParameter ( ) ) { <EOL> underlyingType = underlyingType . erasedUpperBound . defaultType <EOL> } <EOL> if ( ! type . isNullable ( ) ) <EOL> return underlyingType <EOL> if ( underlyingType . isNullable ( ) || underlyingType . isPrimitiveType ( ) ) <EOL> return null <EOL> return underlyingType . makeNullable ( ) <EOL> }

/**
 * Unwraps inline class types to their underlying representation.
 * Returns null if the type cannot be unboxed.
 */


fun mangledNameFor ( context : JvmBackendContext , irFunction : IrFunction , mangleReturnTypes : Boolean , useOldMangleRules : Boolean ) : Name

{ <EOL> if ( irFunction is IrConstructor ) { <EOL> assert ( irFunction . constructedClass . isValue ) { <EOL> "<STR_LIT>" <EOL> } <EOL> return Name . identifier ( "<STR_LIT>" ) <EOL> } <EOL> if ( irFunction . isAlreadyMangledMfvcFunction ( context ) ) { <EOL> return irFunction . name <EOL> } <EOL> val suffix = hashSuffix ( irFunction , mangleReturnTypes , useOldMangleRules ) <EOL> if ( suffix == null && ( ( irFunction . parent as? IrClass ) ? . isValue != true || irFunction . origin == IrDeclarationOrigin . IR_BUILTINS_STUB ) ) { <EOL> return irFunction . name <EOL> } <EOL> val base = when { <EOL> irFunction . isGetter -> <EOL> JvmAbi . getterName ( irFunction . propertyName . asString ( ) ) <EOL> irFunction . isSetter -> <EOL> JvmAbi . setterName ( irFunction . propertyName . asString ( ) ) <EOL> irFunction . name . isSpecial -> <EOL> error ( "<STR_LIT>" ) <EOL> else -> <EOL> irFunction . name . asString ( ) <EOL> } <EOL> return Name . identifier ( "<STR_LIT>" ) <EOL> }

/**
 * Returns a mangled name for a function taking inline class arguments
 * to avoid clashes between overloaded methods.
 */


fun accepts ( value : Any ? , fieldInfo : FieldInfo , ) : Boolean

/**
 * Tells if this handler accepts the given property
 * Called for each variable in the cells executed by users,
 * except those names are starting from [TEMP_PROPERTY_PREFIX]
 * or those that have been already consumed by another handler
 *
 * @param value Property value
 * @param fieldInfo Property runtime information
 */


@ InternalCoroutinesApi <EOL> public operator fun < R , T > invoke ( block : suspend R . ( ) -> T , receiver : R , completion : Continuation < T > ) : Unit

= <EOL> when ( this ) { <EOL> DEFAULT -> block . startCoroutineCancellable ( receiver , completion ) <EOL> ATOMIC -> block . startCoroutine ( receiver , completion ) <EOL> UNDISPATCHED -> block . startCoroutineUndispatched ( receiver , completion ) <EOL> LAZY -> Unit <EOL> }

/**
 * Starts the corresponding block with receiver as a coroutine with this coroutine start strategy.
 *
 * - [DEFAULT] uses [startCoroutineCancellable].
 * - [ATOMIC] uses [startCoroutine].
 * - [UNDISPATCHED] uses [startCoroutineUndispatched].
 * - [LAZY] does nothing.
 *
 * @suppress **This an internal API and should not be used from general code.**
 */


public fun KtSymbolWithMembers . getMemberScope ( ) : KtScope

= <EOL> withValidityAssertion { analysisSession . scopeProvider . getMemberScope ( this ) }

/**
 * Returns a [KtScope] containing *non-static* callable members (functions, properties, and constructors) and all classifier members
 * (classes and objects) of the given [KtSymbolWithMembers]. The scope includes members inherited from the symbol's supertypes, in
 * addition to members which are declared explicitly inside the symbol's body.
 *
 * The member scope doesn't include synthetic Java properties. To get such properties, use [getSyntheticJavaPropertiesScope].
 *
 * @see getStaticMemberScope
 */


public fun KtSymbolWithMembers . getStaticMemberScope ( ) : KtScope

= <EOL> withValidityAssertion { analysisSession . scopeProvider . getStaticMemberScope ( this ) }

/**
 * Returns a [KtScope] containing the *static* members of the given [KtSymbolWithMembers].
 *
 * The behavior of the scope differs based on whether the given [KtSymbolWithMembers] is a Kotlin or Java class:
 *
 * - **Kotlin class:** The scope contains static callables (functions and properties) and classifiers (classes and objects) declared
 * directly in the [KtSymbolWithMembers]. Hence, the static member scope for Kotlin classes is equivalent to [getDeclaredMemberScope].
 * - **Java class:** The scope contains static callables (functions and properties) declared in the [KtSymbolWithMembers] or any of its
 * superclasses (excluding static callables from super-interfaces), and classes declared directly in the [KtSymbolWithMembers]. This
 * follows Kotlin's rules about static inheritance in Java classes, where static callables are propagated from superclasses, but
 * nested classes are not.
 *
 * #### Kotlin Example
 *
 * ```kotlin
 * abstract class A {
 * class C1
 * inner class D1
 * object O1
 *
 * // There is no way to declare a static callable in an abstract class, as only enum classes define additional static callables.
 * }
 *
 * class B : A() {
 * class C2
 * inner class D2
 * object O2
 * companion object {
 * val baz: String = ""
 * }
 * }
 * ```
 *
 * The static member scope of `B` contains the following symbols:
 *
 * ```
 * class C2
 * inner class D2
 * object O2
 * companion object
 * ```
 *
 * #### Java Example
 *
 * ```java
 * // SuperInterface.java
 * public interface SuperInterface {
 * public static void fromSuperInterface() { }
 * }
 *
 * // SuperClass.java
 * public abstract class SuperClass implements SuperInterface {
 * static class NestedSuperClass { }
 * class InnerSuperClass { }
 * public static void fromSuperClass() { }
 * }
 *
 * // FILE: JavaClass.java
 * public class JavaClass extends SuperClass {
 * static class NestedClass { }
 * class InnerClass { }
 * public static void fromJavaClass() { }
 * }
 * ```
 *
 * The static member scope of `JavaClass` contains the following symbols:
 *
 * ```
 * public static void fromSuperClass()
 * public static void fromJavaClass()
 * static class NestedClass
 * class InnerClass
 * ```
 *
 * @see getMemberScope
 */


public fun KtSymbolWithMembers . getCombinedMemberScope ( ) : KtScope

= <EOL> withValidityAssertion { analysisSession . scopeProvider . getCombinedMemberScope ( this ) }

/**
 * Returns a [KtScope] containing all members from [getMemberScope] and [getStaticMemberScope].
 */


public fun KtSymbolWithMembers . getDeclaredMemberScope ( ) : KtScope

= <EOL> withValidityAssertion { analysisSession . scopeProvider . getDeclaredMemberScope ( this ) }

/**
 * Returns a [KtScope] containing the *non-static* callables (functions, properties, and constructors) and inner classes explicitly
 * declared in the given [KtSymbolWithMembers].
 *
 * The declared member scope does not contain classifiers (including the companion object) except for inner classes. To retrieve the
 * classifiers declared in this [KtSymbolWithMembers], please use the *static* declared member scope provided by
 * [getStaticDeclaredMemberScope].
 *
 * @see getStaticDeclaredMemberScope
 */


public fun KtSymbolWithMembers . getStaticDeclaredMemberScope ( ) : KtScope

= <EOL> withValidityAssertion { analysisSession . scopeProvider . getStaticDeclaredMemberScope ( this ) }

/**
 * Returns a [KtScope] containing the *static* callables (functions and properties) and all classifiers (classes and objects) explicitly
 * declared in the given [KtSymbolWithMembers].
 *
 * It is worth noting that, while Java classes may contain declarations of static callables freely, in Kotlin only enum classes define
 * static callables. Hence, for non-enum Kotlin classes, it is not expected that the static declared member scope will contain any
 * callables.
 *
 * @see getDeclaredMemberScope
 */


public fun KtSymbolWithMembers . getCombinedDeclaredMemberScope ( ) : KtScope

= <EOL> withValidityAssertion { analysisSession . scopeProvider . getCombinedDeclaredMemberScope ( this ) }

/**
 * Returns a [KtScope] containing *all* members explicitly declared in the given [KtSymbolWithMembers].
 *
 * In contrast to [getDeclaredMemberScope] and [getStaticDeclaredMemberScope], this scope contains both static and non-static members.
 */


public fun KtType . getTypeScope ( ) : KtTypeScope ?

= <EOL> withValidityAssertion { analysisSession . scopeProvider . getTypeScope ( this ) }

/**
 * Return a [KtTypeScope] for a given [KtType].
 * The type scope will include all members which are declared and callable on a given type.
 *
 * Comparing to the [KtScope], in the [KtTypeScope] all use-site type parameters are substituted.
 *
 * Consider the following code
 * ```
 * fun foo(list: List<String>) {
 * list // get KtTypeScope for it
 * }
 *```
 *
 * Inside the `LIST_KT_ELEMENT.getKtType().getTypeScope()` would contain the `get(i: Int): String` method with substituted type `T = String`
 *
 * @return type scope for the given type if given `KtType` is not error type, `null` otherwise.
 * Returned [KtTypeScope] includes synthetic Java properties.
 *
 * @see KtTypeScope
 * @see KtTypeProviderMixIn.getKtType
 */


public fun KtType . getSyntheticJavaPropertiesScope ( ) : KtTypeScope ?

= <EOL> withValidityAssertion { analysisSession . scopeProvider . getSyntheticJavaPropertiesScope ( this ) }

/**
 * Returns a [KtTypeScope] with synthetic Java properties created for a given [KtType].
 */


public fun KtFile . getScopeContextForPosition ( positionInFakeFile : KtElement ) : KtScopeContext

= <EOL> withValidityAssertion { analysisSession . scopeProvider . getScopeContextForPosition ( this , positionInFakeFile ) }

/**
 * For each scope in [KtScopeContext] an index is calculated. The indexes are relative to position, and they are only known for
 * scopes obtained with [getScopeContextForPosition].
 *
 * Scopes with [KtScopeKind.TypeScope] include synthetic Java properties.
 */


public fun KtFile . getImportingScopeContext ( ) : KtScopeContext

= <EOL> withValidityAssertion { analysisSession . scopeProvider . getImportingScopeContext ( this ) }

/**
 * Returns a [KtScopeContext] formed by all imports in the [KtFile].
 *
 * By default, this will also include default importing scopes, which can be filtered by [KtScopeKind]
 */


public fun KtScopeContext . getCompositeScope ( filter : ( KtScopeKind ) -> Boolean = { true } ) : KtScope

= withValidityAssertion { <EOL> val subScopes = scopes . filter { filter ( it . kind ) } . map { it . scope } <EOL> subScopes . asCompositeScope ( ) <EOL> }

/**
 * Returns single scope, containing declarations from all scopes that satisfy [filter]. The order of declarations corresponds to the
 * order of their containing scopes, which are sorted according to their indexes in scope tower.
 */


public fun KtSymbol . getContainingSymbol ( ) : KtDeclarationSymbol ?

= <EOL> withValidityAssertion { analysisSession . containingDeclarationProvider . getContainingDeclaration ( this ) }

/**
 * Returns containing declaration for symbol:
 * for top-level declarations returns null
 * for class members returns containing class
 * for local declaration returns declaration it was declared it
 */


public fun KtSymbol . getContainingFileSymbol ( ) : KtFileSymbol ?

= <EOL> withValidityAssertion { analysisSession . containingDeclarationProvider . getContainingFileSymbol ( this ) }

/**
 * Returns containing [KtFile] as [KtFileSymbol]
 *
 * Caveat: returns `null` if the given symbol is already [KtFileSymbol], since there is no containing file.
 * Similarly, no containing file for libraries and Java, hence `null`.
 */


public fun KtCallableSymbol . getContainingJvmClassName ( ) : String ?

= <EOL> withValidityAssertion { analysisSession . containingDeclarationProvider . getContainingJvmClassName ( this ) }

/**
 * Returns containing JVM class name for [KtCallableSymbol]
 *
 * even for deserialized callables! (which is useful to look up the containing facade in [PsiElement])
 * for regular, non-local callables from source, it is a mere conversion of [ClassId] inside [CallableId]
 *
 * The returned JVM class name is of fully qualified name format, e.g., foo.bar.Baz.Companion
 *
 * Note that this API is applicable for common or JVM modules only, and returns `null` for non-JVM modules.
 */


private fun mapArgument ( arg : IrExpression ) : Pair < IrExpression , IrVariable >

{ <EOL> var saveToTmp = arg <EOL> var rootIntrinsicCall : IrCall ? = null <EOL> var lastIntrinsicCall : IrCall ? = null <EOL> while ( saveToTmp is IrCall && ( saveToTmp . symbol == boxIntrinsic || saveToTmp . symbol == unboxIntrinsic ) ) { <EOL> if ( lastIntrinsicCall == null ) { <EOL> lastIntrinsicCall = JsIrBuilder . buildCall ( saveToTmp . symbol , saveToTmp . type , saveToTmp . typeArguments . filterNotNull ( ) ) <EOL> rootIntrinsicCall = lastIntrinsicCall <EOL> } else { <EOL> val nextCall = JsIrBuilder . buildCall ( saveToTmp . symbol , saveToTmp . type , saveToTmp . typeArguments . filterNotNull ( ) ) <EOL> lastIntrinsicCall . putValueArgument ( <NUM_LIT:0> , nextCall ) <EOL> lastIntrinsicCall = nextCall <EOL> } <EOL> saveToTmp = saveToTmp . getValueArgument ( <NUM_LIT:0> ) ? : error ( "<STR_LIT>" ) <EOL> } <EOL> val irTempVar = makeTempVar ( saveToTmp . type , saveToTmp ) <EOL> val irGetTempVar = JsIrBuilder . buildGetValue ( irTempVar . symbol ) <EOL> val newArg = lastIntrinsicCall ? . let { <EOL> it . putValueArgument ( <NUM_LIT:0> , irGetTempVar ) <EOL> rootIntrinsicCall <EOL> } ? : irGetTempVar <EOL> return newArg to irTempVar <EOL> }

/**
 * Move the passing argument and store it in a temporary variable.
 * However, the box and unbox intrinsics should be preserved in the call.
 * They can be used later for optimizations, for example, in [EqualityAndComparisonCallsTransformer].
 * Example:
 * foo(boxIntrinsic(<expr>))
 * should be transformed to:
 * var tmp = <expr>
 * foo(boxIntrinsic(tmp))
 */


private fun resolveExpressionOrNull ( expression : IrElement ? ) : InferenceNode ?

= <EOL> when ( expression ) { <EOL> is IrGetValue -> <EOL> inferenceParameterOrNull ( expression ) ? : variableDeclarations [ expression . symbol ] <EOL> is IrCall -> <EOL> variableDeclarations [ expression . symbol ] <EOL> else -> null <EOL> }

/**
 * Resolve references to local variables and parameters.
 */


open fun recordScheme ( scheme : Scheme )

/**
 * Record a scheme for the function in metrics (if applicable).
 */


abstract fun updateScheme ( scheme : Scheme )

/**
 * The scheme has changed so the corresponding attributes should be updated to match the
 * scheme provided.
 */


abstract fun toDeclaredScheme ( defaultTarget : Item = Open ( <NUM_LIT:0> ) ) : Scheme

/**
 * Return a declared scheme for the function.
 */


= false

/**
 * Return true if this is a type with overly wide parameter types such as Any or
 * unconstrained or insufficiently constrained type parameters.
 */


open fun parameterIndex ( node : InferenceNode ) : Int

= - <NUM_LIT:1>

/**
 * [node] is one of the parameters of this container node then return its index. -1 indicates
 * that [node] is not a parameter of this container (or this is not a container).
 */


= function ? . isOverlyWide ( ) == true


private fun IrFunction . hasOverlyWideParameters ( ) : Boolean

= <EOL> valueParameters . any { <EOL> it . type . isAny ( ) || it . type . isNullableAny ( ) <EOL> }

/**
 * A function with overly wide parameters should be ignored for traversal as well as when
 * it is called.
 */


public fun PageContentBuilder . DocumentableContentBuilder . parametersBlock ( function : DFunction , paramBuilder : PageContentBuilder . DocumentableContentBuilder . ( DParameter ) -> Unit )

{ <EOL> group ( kind = SymbolContentKind . Parameters , styles = emptySet ( ) ) { <EOL> function . parameters . dropLast ( <NUM_LIT:1> ) . forEach { <EOL> group ( kind = SymbolContentKind . Parameter ) { <EOL> paramBuilder ( it ) <EOL> punctuation ( "<STR_LIT:U+002CU+0020>" ) <EOL> } <EOL> } <EOL> group ( kind = SymbolContentKind . Parameter ) { <EOL> paramBuilder ( function . parameters . last ( ) ) <EOL> } <EOL> } <EOL> }

/**
 * Builds a distinguishable [function] parameters block, so that it
 * can be processed or custom rendered down the road.
 *
 * Resulting structure:
 * ```
 * SymbolContentKind.Parameters(style = wrapped) {
 * SymbolContentKind.Parameter(style = indented) { param, }
 * SymbolContentKind.Parameter(style = indented) { param, }
 * SymbolContentKind.Parameter(style = indented) { param }
 * }
 * ```
 * Wrapping and indentation of parameters is applied conditionally, see [shouldWrapParams]
 */


internal fun MutableMap < String , Any > . toBufferedImage ( scale : Number = <NUM_LIT:1> , dpi : Number ? = null ) : BufferedImage

{ <EOL> val byteArray = PlotImageExport . buildImageFromRawSpecs ( this , PlotImageExport . Format . PNG , scale . toDouble ( ) , dpi ? . toDouble ( ) ? : Double . NaN ) . bytes <EOL> return ImageIO . read ( ByteArrayInputStream ( byteArray ) ) <EOL> }

/**
 * Convert plot spec to `BufferedImage`
 *
 * @receiver the plot spec represented as `MutableMap`
 */


public fun Plot . toBufferedImage ( scale : Number = <NUM_LIT:1> , dpi : Number ? = null , ) : BufferedImage

= this . toLetsPlot ( ) . toSpec ( ) . toBufferedImage ( scale , dpi )

/**
 * Exports the current plot as a [BufferedImage].
 *
 * The parameters [scale] and [dpi] influence the quality and size of the rasterized image.
 *
 * @receiver [Plot] - the plot to export.
 * @param scale the scaling is applied to the plot when converting to a raster format (PNG).
 * It affects the resolution and size of the resulting [BufferedImage].
 * The default value is 1.
 * @param dpi the resolution of the exported image in dots per inch (DPI).
 * This parameter influences the quality of the rasterized image, with a higher value resulting in better quality.
 * By default, no specific DPI value is assigned, and it utilizes the system's default settings.
 * @return [BufferedImage] the created image representing the plot.
 */


public fun Plot . toJPG ( scale : Number = <NUM_LIT:1> , dpi : Number ? = null , ) : ByteArray

{ <EOL> val bufferedImage = this . toLetsPlot ( ) . toSpec ( ) . toBufferedImage ( scale , dpi ) <EOL> val outputStream = ByteArrayOutputStream ( ) <EOL> ImageIO . write ( bufferedImage , "<STR_LIT>" , outputStream ) <EOL> return outputStream . toByteArray ( ) <EOL> }

/**
 * Exports the current plot grid as a [ByteArray] in the JPG format.
 *
 * The parameters [scale] and [dpi] influence the quality and size of the rasterized image.
 *
 * @receiver [Plot] - the plot grid to export.
 * @param scale the scaling is applied to the plot when converting to a raster format (PNG).
 * It affects the resolution and size of the resulting [BufferedImage].
 * The default value is 1.
 * @param dpi the resolution of the exported image in dots per inch (DPI).
 * This parameter influences the quality of the rasterized image, with a higher value resulting in better quality.
 * By default, no specific DPI value is assigned, and it utilizes the system's default settings.
 * @return [ByteArray] the created image representing the plot grid.
 */


public fun Plot . toPNG ( scale : Number = <NUM_LIT:1> , dpi : Number ? = null , ) : ByteArray

/**
 * Exports the current plot grid as a [ByteArray] in the PNG format.
 *
 * The parameters [scale] and [dpi] influence the quality and size of the rasterized image.
 *
 * @receiver [Plot] - the plot grid to export.
 * @param scale the scaling is applied to the plot when converting to a raster format (PNG).
 * It affects the resolution and size of the resulting [BufferedImage].
 * The default value is 1.
 * @param dpi the resolution of the exported image in dots per inch (DPI).
 * This parameter influences the quality of the rasterized image, with a higher value resulting in better quality.
 * By default, no specific DPI value is assigned, and it utilizes the system's default settings.
 * @return [ByteArray] the created image representing the plot grid.
 */


public fun PlotGrid . toBufferedImage ( scale : Number = <NUM_LIT:1> , dpi : Number ? = null , ) : BufferedImage

= this . wrap ( ) . toSpec ( ) . toBufferedImage ( scale , dpi )

/**
 * Exports the current plot grid as a [BufferedImage].
 *
 * The parameters [scale] and [dpi] influence the quality and size of the rasterized image.
 *
 * @receiver [PlotGrid] - the plot grid to export.
 * @param scale the scaling is applied to the plot when converting to a raster format (PNG).
 * It affects the resolution and size of the resulting [BufferedImage].
 * The default value is 1.
 * @param dpi the resolution of the exported image in dots per inch (DPI).
 * This parameter influences the quality of the rasterized image, with a higher value resulting in better quality.
 * By default, no specific DPI value is assigned, and it utilizes the system's default settings.
 * @return [BufferedImage] the created image representing the plot grid.
 */


public fun PlotGrid . toJPG ( scale : Number = <NUM_LIT:1> , dpi : Number ? = null , ) : ByteArray

{ <EOL> val bufferedImage = this . wrap ( ) . toSpec ( ) . toBufferedImage ( scale , dpi ) <EOL> val outputStream = ByteArrayOutputStream ( ) <EOL> ImageIO . write ( bufferedImage , "<STR_LIT>" , outputStream ) <EOL> return outputStream . toByteArray ( ) <EOL> }

/**
 * Exports the current plot grid as a [ByteArray] in the JPG format.
 *
 * The parameters [scale] and [dpi] influence the quality and size of the rasterized image.
 *
 * @receiver [PlotGrid] - the plot grid to export.
 * @param scale the scaling is applied to the plot when converting to a raster format (PNG).
 * It affects the resolution and size of the resulting [BufferedImage].
 * The default value is 1.
 * @param dpi the resolution of the exported image in dots per inch (DPI).
 * This parameter influences the quality of the rasterized image, with a higher value resulting in better quality.
 * By default, no specific DPI value is assigned, and it utilizes the system's default settings.
 * @return [ByteArray] the created image representing the plot grid.
 */


public fun PlotGrid . toPNG ( scale : Number = <NUM_LIT:1> , dpi : Number ? = null , ) : ByteArray

/**
 * Exports the current plot grid as a [ByteArray] in the PNG format.
 *
 * The parameters [scale] and [dpi] influence the quality and size of the rasterized image.
 *
 * @receiver [PlotGrid] - the plot grid to export.
 * @param scale the scaling is applied to the plot when converting to a raster format (PNG).
 * It affects the resolution and size of the resulting [BufferedImage].
 * The default value is 1.
 * @param dpi the resolution of the exported image in dots per inch (DPI).
 * This parameter influences the quality of the rasterized image, with a higher value resulting in better quality.
 * By default, no specific DPI value is assigned, and it utilizes the system's default settings.
 * @return [ByteArray] the created image representing the plot grid.
 */


public fun PlotBunch . toBufferedImage ( scale : Number = <NUM_LIT:1> , dpi : Number ? = null , ) : BufferedImage

/**
 * Exports the current plot bunch as a [BufferedImage].
 *
 * The parameters [scale] and [dpi] influence the quality and size of the rasterized image.
 *
 * @receiver [PlotBunch] - the plot bunch to export.
 * @param scale the scaling is applied to the plot when converting to a raster format (PNG).
 * It affects the resolution and size of the resulting [BufferedImage].
 * The default value is 1.
 * @param dpi the resolution of the exported image in dots per inch (DPI).
 * This parameter influences the quality of the rasterized image, with a higher value resulting in better quality.
 * By default, no specific DPI value is assigned, and it utilizes the system's default settings.
 * @return [BufferedImage] the created image representing the plot bunch.
 */


public fun PlotBunch . toJPG ( scale : Number = <NUM_LIT:1> , dpi : Number ? = null , ) : ByteArray

/**
 * Exports the current plot grid as a [ByteArray] in the JPG format.
 *
 * The parameters [scale] and [dpi] influence the quality and size of the rasterized image.
 *
 * @receiver [PlotBunch] - the plot grid to export.
 * @param scale the scaling is applied to the plot when converting to a raster format (PNG).
 * It affects the resolution and size of the resulting [BufferedImage].
 * The default value is 1.
 * @param dpi the resolution of the exported image in dots per inch (DPI).
 * This parameter influences the quality of the rasterized image, with a higher value resulting in better quality.
 * By default, no specific DPI value is assigned, and it utilizes the system's default settings.
 * @return [ByteArray] the created image representing the plot grid.
 */


public fun PlotBunch . toPNG ( scale : Number = <NUM_LIT:1> , dpi : Number ? = null , ) : ByteArray

/**
 * Exports the current plot grid as a [ByteArray] in the PNG format.
 *
 * The parameters [scale] and [dpi] influence the quality and size of the rasterized image.
 *
 * @receiver [PlotBunch] - the plot grid to export.
 * @param scale the scaling is applied to the plot when converting to a raster format (PNG).
 * It affects the resolution and size of the resulting [BufferedImage].
 * The default value is 1.
 * @param dpi the resolution of the exported image in dots per inch (DPI).
 * This parameter influences the quality of the rasterized image, with a higher value resulting in better quality.
 * By default, no specific DPI value is assigned, and it utilizes the system's default settings.
 * @return [ByteArray] the created image representing the plot grid.
 */


@ Test <EOL> fun testFailWithModulesNotInAnyScope ( )

= parametrizedTest { mode -> <EOL> val json = Json { serializersModule = BaseAndDerivedModule } <EOL> checkNotRegisteredMessage ( "<STR_LIT>" , "<STR_LIT:kotlin.Any>" , assertFailsWith < SerializationException > { <EOL> json . encodeToString ( MyPolyData . serializer ( ) , MyPolyData ( mapOf ( "<STR_LIT:a>" to PolyDerived ( "<STR_LIT:foo>" ) ) ) , mode ) <EOL> } ) <EOL> }

/**
 * This test should fail because PolyDerived registered in the scope of PolyBase, not kotlin.Any
 */


@ Test <EOL> fun testFailWithModulesNotInParticularScope ( )

= parametrizedTest { mode -> <EOL> val json = Json { serializersModule = baseAndDerivedModuleAtAny } <EOL> checkNotRegisteredMessage ( "<STR_LIT>" , "<STR_LIT>" , assertFailsWith { <EOL> json . encodeToString ( MyPolyDataWithPolyBase . serializer ( ) , MyPolyDataWithPolyBase ( mapOf ( "<STR_LIT:a>" to PolyDerived ( "<STR_LIT:foo>" ) ) , PolyDerived ( "<STR_LIT:foo>" ) ) , mode ) <EOL> } ) <EOL> }

/**
 * This test should fail because PolyDerived registered in the scope of kotlin.Any, not PolyBase
 */


fun FirConstructorSymbol . getObjCInitMethod ( session : FirSession ) : FirFunctionSymbol < * > ?

{ <EOL> this . annotations . getAnnotationByClassId ( NativeStandardInteropNames . objCConstructorClassId , session ) ? . let { annotation -> <EOL> val initSelector : String = annotation . constStringArgument ( "<STR_LIT>" ) <EOL> val classSymbol = containingClassLookupTag ( ) ? . toSymbol ( session ) as FirClassSymbol < * > <EOL> val initSelectors = mutableListOf < FirFunctionSymbol < * > > ( ) <EOL> session . declaredMemberScope ( classSymbol , memberRequiredPhase = null ) <EOL> . processAllFunctions { <EOL> if ( it . decodeObjCMethodAnnotation ( session ) ? . selector == initSelector ) <EOL> initSelectors . add ( it ) <EOL> } <EOL> return initSelectors . singleOrNull ( ) <EOL> ? : error ( "<STR_LIT>" ) <EOL> } <EOL> return null <EOL> }

/**
 * mimics ConstructorDescriptor.getObjCInitMethod()
 */


internal fun List < FirAnnotation > . decodeObjCMethodAnnotation ( session : FirSession ) : ObjCMethodInfo ?

= <EOL> getAnnotationByClassId ( NativeStandardInteropNames . objCMethodClassId , session ) ? . let { <EOL> ObjCMethodInfo ( selector = it . constStringArgument ( "<STR_LIT>" ) , encoding = it . constStringArgument ( "<STR_LIT>" ) , isStret = it . constBooleanArgumentOrNull ( "<STR_LIT>" ) ? : false , directSymbol = getAnnotationByClassId ( NativeStandardInteropNames . objCDirectClassId , session ) ? . constStringArgument ( "<STR_LIT>" ) , ) <EOL> }

/**
 * mimics FunctionDescriptor.decodeObjCMethodAnnotation()
 */


internal fun FirFunction . isObjCClassMethod ( session : FirSession )

= <EOL> getContainingClass ( session ) . let { it is FirClass && it . symbol . isObjCClass ( session ) }

/**
 * almost mimics FunctionDescriptor.isObjCClassMethod(), apart from `it.isObjCClass()` changed to `it.symbol.isObjCClass(session)` for simplicity
 */