{ <EOL> return dims [ i ] <EOL> }

/**
 * Get the size of a target dimension.
 *
 * @param i Target dimension.
 * @return The size of dimension i
 */


public fun concatenate ( vararg dims : Long ) : TensorShape

{ <EOL> this . dims = concatenate ( this . dims , * dims ) <EOL> return this <EOL> }

/**
 * Augment this TensorShape by appending more dimensions to it.
 *
 * @param dims The new dimensions to incorporate
 * @return The new changed TensorShape
 */


{ <EOL> return dims [ <NUM_LIT:0> ] <EOL> }


{ <EOL> return dims . copyOfRange ( <NUM_LIT:1> , dims . size ) <EOL> }


{ <EOL> return TensorShape ( dims ) <EOL> }

/** Makes a copy of TensorShape object. */


public fun almostEqual ( tensorShape : TensorShape , except : Int ) : Boolean

{ <EOL> var almostEqual = true <EOL> for ( i in <NUM_LIT:0> until tensorShape . numDimensions ( ) ) { <EOL> if ( i == except ) continue <EOL> if ( this [ i ] != tensorShape [ i ] ) almostEqual = false <EOL> } <EOL> return almostEqual <EOL> }

/** Check the fact that two shapes has the same values at the same dimensions except one with index [except]. */


= this [ <NUM_LIT:0> ]

/** Returns first dimension from all dimensions of this array. */


public fun LongArray . tail ( ) : LongArray

= copyOfRange ( <NUM_LIT:1> , size )

/** Returns last dimensions (except first) from this array. */


public fun getDimsOfArray ( data : Array < * > ) : LongArray

{ <EOL> fun appendPrimitiveArraySize ( size : Int , acc : MutableList < Long > ) : LongArray { <EOL> acc += size . toLong ( ) <EOL> return acc . toLongArray ( ) <EOL> } <EOL> tailrec fun collectDims ( data : Array < * > , acc : MutableList < Long > ) : LongArray { <EOL> val firstElem = data [ <NUM_LIT:0> ] ? : return acc . toLongArray ( ) <EOL> acc += data . size . toLong ( ) <EOL> return when ( firstElem ) { <EOL> is Array < * > -> collectDims ( firstElem , acc ) <EOL> is BooleanArray -> appendPrimitiveArraySize ( firstElem . size , acc ) <EOL> is ByteArray -> appendPrimitiveArraySize ( firstElem . size , acc ) <EOL> is CharArray -> appendPrimitiveArraySize ( firstElem . size , acc ) <EOL> is ShortArray -> appendPrimitiveArraySize ( firstElem . size , acc ) <EOL> is IntArray -> appendPrimitiveArraySize ( firstElem . size , acc ) <EOL> is LongArray -> appendPrimitiveArraySize ( firstElem . size , acc ) <EOL> is FloatArray -> appendPrimitiveArraySize ( firstElem . size , acc ) <EOL> is DoubleArray -> appendPrimitiveArraySize ( firstElem . size , acc ) <EOL> else -> acc . toLongArray ( ) <EOL> } <EOL> } <EOL> return collectDims ( data , mutableListOf ( ) ) <EOL> }

/**
 * Get shape of array of arrays (of arrays...) of Array of elements of any type.
 * If the most inner array does not have any elements its size is skipped in the result.
 */


public fun IntArray . toTensorShape ( ) : TensorShape

= TensorShape ( this . map ( Int :: toLong ) . toLongArray ( ) )

/**
 * Wraps an IntArray to TensorShape.
 */


@ Test <EOL> @ DisplayName ( "<STR_LIT>" ) <EOL> fun testSyncingIntoNonEmptyFile ( )

{ <EOL> val initialContent = mapOf ( "<STR_LIT>" to PropertyValue . Configured ( "<STR_LIT>" ) , "<STR_LIT>" to PropertyValue . Configured ( "<STR_LIT>" ) , ) <EOL> fillInitialLocalPropertiesFile ( initialContent ) <EOL> modifier . applySetup ( setupFile ) <EOL> localPropertiesFile . propertiesFileContentAssertions { fileContents , properties -> <EOL> assertContainsMarkersOnce ( fileContents ) <EOL> val expectedProperties = setupFile . properties + initialContent . mapValues { it . value . value } <EOL> assertEquals ( expectedProperties . size , properties . size ) <EOL> for ( ( key , value ) in expectedProperties ) { <EOL> assertEquals ( value , properties [ key ] ) <EOL> } <EOL> } <EOL> }

/**
 * Checks that a file like
 * ```
 * a=1
 * b=2
 * c=3
 * ```
 * is being transformed into
 * ```
 * a=1
 * b=2
 * c=3
 * #header
 * d=4
 * f=5
 * #footer
 * ```
 */


@ Test <EOL> @ DisplayName ( "<STR_LIT>" ) <EOL> fun testSyncingDoesNotOverrideValues ( )

{ <EOL> val initialContent = mapOf ( "<STR_LIT>" to PropertyValue . Configured ( "<STR_LIT>" ) , "<STR_LIT>" to PropertyValue . Configured ( "<STR_LIT>" ) , "<STR_LIT>" to PropertyValue . Configured ( "<STR_LIT>" ) , ) <EOL> fillInitialLocalPropertiesFile ( initialContent ) <EOL> modifier . applySetup ( setupFile ) <EOL> localPropertiesFile . propertiesFileContentAssertions { fileContents , properties -> <EOL> assertContainsMarkersOnce ( fileContents ) <EOL> val expectedProperties = setupFile . properties + initialContent . mapValues { it . value . value } <EOL> assertEquals ( expectedProperties . size , properties . size ) <EOL> for ( ( key , value ) in expectedProperties ) { <EOL> assertEquals ( value , properties [ key ] ) <EOL> } <EOL> assertContainsExactTimes ( fileContents , "<STR_LIT>" , <NUM_LIT:1> ) <EOL> } <EOL> }

/**
 * Checks that a file like
 * ```
 * a=1
 * b=2
 * f=3
 * ```
 * is being transformed into
 * ```
 * a=1
 * b=2
 * c=3
 * #header
 * d=4
 * #footer
 * ```
 */


@ Test <EOL> @ DisplayName ( "<STR_LIT>" ) <EOL> fun testSyncingOverrideAutomaticallySetValues ( )

{ <EOL> val initialContent = mapOf ( "<STR_LIT>" to PropertyValue . Configured ( "<STR_LIT>" ) , "<STR_LIT>" to PropertyValue . Configured ( "<STR_LIT>" ) , "<STR_LIT>" to PropertyValue . Configured ( "<STR_LIT>" ) , ) <EOL> fillInitialLocalPropertiesFile ( initialContent ) <EOL> modifier . applySetup ( setupFile ) <EOL> val newProperties = mapOf ( "<STR_LIT>" to PropertyValue . Configured ( "<STR_LIT:5>" ) , "<STR_LIT>" to PropertyValue . Configured ( "<STR_LIT:5>" ) , ) <EOL> fillInitialLocalPropertiesFile ( newProperties ) <EOL> val anotherSetupFile = SetupFile ( mapOf ( "<STR_LIT>" to "<STR_LIT:other>" , "<STR_LIT>" to "<STR_LIT>" , "<STR_LIT>" to "<STR_LIT>" , ) ) <EOL> modifier . applySetup ( anotherSetupFile ) <EOL> localPropertiesFile . propertiesFileContentAssertions { fileContents , properties -> <EOL> assertContainsMarkersOnce ( fileContents ) <EOL> val expectedProperties = <EOL> anotherSetupFile . properties + initialContent . mapValues { it . value . value } + newProperties . mapValues { it . value . value } <EOL> assertEquals ( expectedProperties . size , properties . size ) <EOL> for ( ( key , value ) in expectedProperties ) { <EOL> assertEquals ( value , properties [ key ] ) <EOL> } <EOL> } <EOL> }

/**
 * Checks that a file like
 * ```
 * a=1
 * b=2
 * c=3
 * #header
 * d=4
 * #footer
 * e=5
 * ```
 * is being transformed into
 * ```
 * a=1
 * b=2
 * c=3
 * e=5
 * #header
 * d=10
 * #footer
 * ```
 */


private fun appendImports ( rawImports : String ) : Boolean

{ <EOL> if ( rawImports . isEmpty ( ) ) { <EOL> return false <EOL> } <EOL> var hasNewImports = false <EOL> for ( rawImport in rawImports . split ( IMPORT_SEPARATOR ) ) { <EOL> val importDirectiveString = if ( rawImport . startsWith ( "<STR_LIT>" ) ) rawImport else "<STR_LIT>" <EOL> if ( importDirectiveStrings . add ( importDirectiveString ) && ! hasNewImports ) { <EOL> hasNewImports = true <EOL> } <EOL> } <EOL> return hasNewImports <EOL> }

/**
 * Parses raw [rawImports] and appends them to the list of code fragment imports.
 *
 * Import strings must be separated by the [IMPORT_SEPARATOR].
 * Each import must be either a qualified name to import (e.g., 'foo.bar'), or a complete text representation of an import directive
 * (e.g., 'import foo.bar as baz').
 *
 * Note that already present import directives will be ignored.
 *
 * @return `true` if new import directives were added.
 */


{ <EOL> val modelHub = ONNXModelHub ( cacheDirectory = File ( "<STR_LIT>" ) ) <EOL> val model = ONNXModels . ObjectDetection . SSDMobileNetV1 . pretrainedModel ( modelHub ) <EOL> model . printSummary ( ) <EOL> model . use { detectionModel -> <EOL> println ( detectionModel ) <EOL> val file = getFileFromResource ( "<STR_LIT>" ) <EOL> val image = ImageConverter . toBufferedImage ( file ) <EOL> val detectedObjects = detectionModel . detectObjects ( image , topK = <NUM_LIT> ) <EOL> detectedObjects . forEach { <EOL> println ( "<STR_LIT>" ) <EOL> } <EOL> val displayedImage = pipeline < BufferedImage > ( ) <EOL> . resize { outputWidth = <NUM_LIT> ; outputHeight = ( ( <NUM_LIT> / image . width ) * image . height ) . toInt ( ) } <EOL> . apply ( image ) <EOL> showFrame ( "<STR_LIT>" , createDetectedObjectsPanel ( displayedImage , detectedObjects ) ) <EOL> } <EOL> }

/**
 * This examples demonstrates the light-weight inference API with [SSDObjectDetectionModel] on SSD model:
 * - Model is obtained from [ONNXModelHub].
 * - Model predicts rectangles for the detected objects on a few images located in resources.
 * - The detected rectangles related to the objects are drawn on the images used for prediction.
 */


public abstract fun nextByte ( ) : Byte

/** Returns the next value in the sequence without boxing. */


public abstract fun nextChar ( ) : Char


public abstract fun nextShort ( ) : Short


public abstract fun nextInt ( ) : Int


public abstract fun nextLong ( ) : Long


public abstract fun nextFloat ( ) : Float


public abstract fun nextDouble ( ) : Double


public abstract fun nextBoolean ( ) : Boolean


{ <EOL> val lengthStack = mutableListOf < Int > ( ) <EOL> skipOverTags ( ) <EOL> do { <EOL> if ( isEof ( ) ) throw CborDecodingException ( "<STR_LIT>" ) <EOL> if ( isIndefinite ( ) ) { <EOL> lengthStack . add ( LENGTH_STACK_INDEFINITE ) <EOL> } else if ( isEnd ( ) ) { <EOL> if ( lengthStack . removeLastOrNull ( ) != LENGTH_STACK_INDEFINITE ) <EOL> throw CborDecodingException ( "<STR_LIT>" , curByte ) <EOL> prune ( lengthStack ) <EOL> } else { <EOL> val header = curByte and <NUM_LIT> <EOL> val length = elementLength ( ) <EOL> if ( header == HEADER_ARRAY || header == HEADER_MAP ) { <EOL> if ( length > <NUM_LIT:0> ) lengthStack . add ( length ) <EOL> skipOverTags ( ) <EOL> } else { <EOL> input . skip ( length ) <EOL> prune ( lengthStack ) <EOL> } <EOL> } <EOL> readByte ( ) <EOL> } while ( lengthStack . isNotEmpty ( ) ) <EOL> }

/**
 * Skips the current value element. Bytes are processed to determine the element type (and corresponding length), to
 * determine how many bytes to skip.
 *
 * For primitive (finite length) elements (e.g. unsigned integer, text string), their length is read and
 * corresponding number of bytes are skipped.
 *
 * For elements that contain children (e.g. array, map), the child count is read and added to a "length stack"
 * (which represents the "number of elements" at each depth of the CBOR data structure). When a child element has
 * been skipped, the "length stack" is [pruned][prune]. For indefinite length elements, a special marker is added to
 * the "length stack" which is only popped from the "length stack" when a CBOR [break][isEnd] is encountered.
 */


private fun prune ( lengthStack : MutableList < Int > )

{ <EOL> for ( i in lengthStack . lastIndex downTo <NUM_LIT:0> ) { <EOL> when ( lengthStack [ i ] ) { <EOL> LENGTH_STACK_INDEFINITE -> break <EOL> <NUM_LIT:1> -> lengthStack . removeAt ( i ) <EOL> else -> { <EOL> lengthStack [ i ] = lengthStack [ i ] - <NUM_LIT:1> <EOL> break <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * Removes an item from the top of the [lengthStack], cascading the removal if the item represents the last item
 * (i.e. a length value of `1`) at its stack depth.
 *
 * For example, pruning a [lengthStack] of `[3, 2, 1, 1]` would result in `[3, 1]`.
 */


{ <EOL> val majorType = curByte and <NUM_LIT> <EOL> val value = curByte and <NUM_LIT> <EOL> return value == ADDITIONAL_INFORMATION_INDEFINITE_LENGTH && <EOL> ( majorType == HEADER_ARRAY || majorType == HEADER_MAP || majorType == HEADER_BYTE_STRING . toInt ( ) || majorType == HEADER_STRING . toInt ( ) ) <EOL> }

/**
 * Determines if [curByte] represents an indefinite length CBOR item.
 *
 * Per [RFC 7049: 2.2. Indefinite Lengths for Some Major Types](https://tools.ietf.org/html/rfc7049#section-2.2):
 * > Four CBOR items (arrays, maps, byte strings, and text strings) can be encoded with an indefinite length
 */


{ <EOL> val majorType = curByte and <NUM_LIT> <EOL> val additionalInformation = curByte and <NUM_LIT> <EOL> return when ( majorType ) { <EOL> HEADER_BYTE_STRING . toInt ( ) , HEADER_STRING . toInt ( ) , HEADER_ARRAY -> readNumber ( ) . toInt ( ) <EOL> HEADER_MAP -> readNumber ( ) . toInt ( ) * <NUM_LIT:2> <EOL> else -> when ( additionalInformation ) { <EOL> <NUM_LIT> -> <NUM_LIT:1> <EOL> <NUM_LIT> -> <NUM_LIT:2> <EOL> <NUM_LIT> -> <NUM_LIT:4> <EOL> <NUM_LIT> -> <NUM_LIT:8> <EOL> else -> <NUM_LIT:0> <EOL> } <EOL> } <EOL> }

/**
 * Determines the length of the CBOR item represented by [curByte]; length has specific meaning based on the type:
 *
 * | Major type | Length represents number of... |
 * |---------------------|--------------------------------|
 * | 0. unsigned integer | bytes |
 * | 1. negative integer | bytes |
 * | 2. byte string | bytes |
 * | 3. string | bytes |
 * | 4. array | data items (values) |
 * | 5. map | sub-items (keys + values) |
 * | 6. tag | bytes |
 */


private fun readIndefiniteLengthBytes ( ) : ByteArray

{ <EOL> val byteStrings = mutableListOf < ByteArray > ( ) <EOL> do { <EOL> byteStrings . add ( readBytes ( ) ) <EOL> readByte ( ) <EOL> } while ( ! isEnd ( ) ) <EOL> return byteStrings . flatten ( ) <EOL> }

/**
 * Indefinite-length byte sequences contain an unknown number of fixed-length byte sequences (chunks).
 *
 * @return [ByteArray] containing all of the concatenated bytes found in the buffer.
 */


private fun MemScope . readHistoricDataFromRegistry ( tzHKey : HKEY ) : List < Pair < Int , PerYearZoneRulesData > >

{ <EOL> return withRegistryKey ( tzHKey , "<STR_LIT>" , { emptyList ( ) } ) { dynDstHKey -> <EOL> val firstEntry = getRegistryValue < DWORDVar > ( dynDstHKey , "<STR_LIT>" ) . value . toInt ( ) <EOL> val lastEntry = getRegistryValue < DWORDVar > ( dynDstHKey , "<STR_LIT>" ) . value . toInt ( ) <EOL> ( firstEntry .. lastEntry ) . map { year -> <EOL> year to getRegistryValue < REG_TZI_FORMAT > ( dynDstHKey , year . toString ( ) ) . toZoneRules ( ) <EOL> } <EOL> } <EOL> }

/**
 * Reads the historic data in the "Dynamic DST" subkey, if present.
 *
 * [tzHKey] is an open registry key pointing to the timezone record.
 *
 * Returns pairs of years and the corresponding rules in effect for those years.
 *
 * @throws IllegalStateException if the 'Dynamic DST' key is present but malformed.
 */


fun createInstanceFromBox ( scope : IrBlockBuilder , typeArguments : TypeArguments , receiver : IrExpression ? , accessType : AccessType , saveVariable : ( IrVariable ) -> Unit , ) : ReceiverBasedMfvcNodeInstance

/**
 * Create instance-specific [ReceiverBasedMfvcNodeInstance] from instance-agnostic [MfvcNode] using a boxed [receiver] as data source.
 */


fun MfvcNode . createInstanceFromBox ( scope : IrBlockBuilder , receiver : IrExpression , accessType : AccessType , saveVariable : ( IrVariable ) -> Unit )

= <EOL> createInstanceFromBox ( scope , makeTypeArgumentsFromType ( receiver . type as IrSimpleType ) , receiver , accessType , saveVariable )


fun MfvcNode . createInstanceFromValueDeclarationsAndBoxType ( scope : IrBuilderWithScope , type : IrSimpleType , name : Name , saveVariable : ( IrVariable ) -> Unit , isVar : Boolean , origin : IrDeclarationOrigin , ) : ValueDeclarationMfvcNodeInstance

= <EOL> createInstanceFromValueDeclarations ( scope , makeTypeArgumentsFromType ( type ) , name , saveVariable , isVar , origin )

/**
 * Create instance-specific [ValueDeclarationMfvcNodeInstance] from instance-agnostic [MfvcNode] using new flattened variables as data source.
 */


fun MfvcNode . createInstanceFromValueDeclarations ( scope : IrBuilderWithScope , typeArguments : TypeArguments , name : Name , saveVariable : ( IrVariable ) -> Unit , isVar : Boolean , origin : IrDeclarationOrigin , ) : ValueDeclarationMfvcNodeInstance

{ <EOL> val valueDeclarations = mapLeaves { <EOL> scope . savableStandaloneVariable ( type = it . type , name = listOf ( name , it . fullFieldName ) . joinToString ( "<STR_LIT:->" ) , origin = origin , saveVariable = saveVariable , isVar = isVar , ) <EOL> } <EOL> return ValueDeclarationMfvcNodeInstance ( this , typeArguments , valueDeclarations ) <EOL> }


fun MfvcNode . createInstanceFromValueDeclarationsAndBoxType ( type : IrSimpleType , fieldValues : List < IrValueDeclaration > ) : ValueDeclarationMfvcNodeInstance

= <EOL> ValueDeclarationMfvcNodeInstance ( this , makeTypeArgumentsFromType ( type ) , fieldValues )

/**
 * Create instance-specific [ValueDeclarationMfvcNodeInstance] from instance-agnostic [MfvcNode] using flattened [fieldValues] as data source.
 */


operator fun get ( name : Name ) : NameableMfvcNode ?

= mapping [ name ]


fun MfvcNodeWithSubnodes . makeBoxedExpression ( scope : IrBuilderWithScope , typeArguments : TypeArguments , valueArguments : List < IrExpression > , registerPossibleExtraBoxCreation : ( ) -> Unit , ) : IrExpression

= scope . irCall ( boxMethod ) . apply { <EOL> val resultType = type . substitute ( typeArguments ) as IrSimpleType <EOL> require ( resultType . erasedUpperBound == type . erasedUpperBound ) { "<STR_LIT>" } <EOL> for ( ( index , typeArgument ) in resultType . arguments . withIndex ( ) ) { <EOL> putTypeArgument ( index , typeArgument . typeOrNull ? : resultType . erasedUpperBound . typeParameters [ index ] . defaultType ) <EOL> } <EOL> for ( ( index , valueArgument ) in valueArguments . withIndex ( ) ) { <EOL> putValueArgument ( index , valueArgument ) <EOL> } <EOL> registerPossibleExtraBoxCreation ( ) <EOL> }

/**
 * Creates a box expression for the given [MfvcNodeWithSubnodes] by calling box methods with the given [typeArguments] and [valueArguments].
 */


operator fun MfvcNodeWithSubnodes . get ( names : List < Name > ) : MfvcNode ?

{ <EOL> var cur : MfvcNode = this <EOL> for ( name in names ) { <EOL> cur = ( cur as? MfvcNodeWithSubnodes ) ? . get ( name ) ? : return null <EOL> } <EOL> return cur <EOL> }

/**
 * A shortcut to get children by name several times.
 */


public actual inline fun < reified T > Array < out T > ? . orEmpty ( ) : Array < out T >

= this ? : emptyArray < T > ( )

/**
 * Returns the array if it's not `null`, or an empty array otherwise.
 * @sample samples.collections.Arrays.Usage.arrayOrEmpty
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun ByteArray . toString ( charset : Charset ) : String

= String ( this , charset )

/**
 * Converts the contents of this byte array to a string using the specified [charset].
 * @sample samples.text.Strings.stringToByteArray
 */


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> public actual inline fun < reified T > Collection < T > . toTypedArray ( ) : Array < T >

{ <EOL> @ Suppress ( "<STR_LIT>" ) <EOL> val thisCollection = this as java . util . Collection < T > <EOL> return thisCollection . toArray ( arrayOfNulls < T > ( <NUM_LIT:0> ) ) as Array < T > <EOL> }

/**
 * Returns a *typed* array containing all the elements of this collection.
 *
 * Allocates an array of runtime type `T` having its size equal to the size of this collection
 * and populates the array with the elements of this collection.
 * @sample samples.collections.Collections.Collections.collectionToTypedArray
 */


internal actual fun < T > arrayOfNulls ( reference : Array < T > , size : Int ) : Array < T >

{ <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> return java . lang . reflect . Array . newInstance ( reference . javaClass . componentType , size ) as Array < T > <EOL> }

/** Internal unsafe construction of array based on reference array type */


public abstract fun convertSqlTypeToColumnSchemaValue ( tableColumnMetadata : TableColumnMetadata ) : ColumnSchema ?

/**
 * Returns a [ColumnSchema] produced from [tableColumnMetadata].
 */


public abstract fun isSystemTable ( tableMetadata : TableMetadata ) : Boolean

/**
 * Checks if the given table name is a system table for the specified database type.
 *
 * @param [tableMetadata] the table object representing the table from the database.
 * @param [dbType] the database type to check against.
 * @return True if the table is a system table for the specified database type, false otherwise.
 */


public abstract fun buildTableMetadata ( tables : ResultSet ) : TableMetadata

/**
 * Builds the table metadata based on the database type and the ResultSet from the query.
 *
 * @param [tables] the ResultSet containing the table's meta-information.
 * @return the TableMetadata object representing the table metadata.
 */


public abstract fun convertSqlTypeToKType ( tableColumnMetadata : TableColumnMetadata ) : KType ?

/**
 * Converts SQL data type to a Kotlin data type.
 *
 * @param [tableColumnMetadata] The metadata of the table column.
 * @return The corresponding Kotlin data type, or null if no mapping is found.
 */


fun toLocalDate ( year : Int ) : LocalDate

/**
 * Converts this date-time to an [Instant] in the given [year],
 * using the knowledge of the offset that's in effect at the resulting date-time.
 */


internal fun JulianDayOfYearSkippingLeapDate ( dayOfYear : Int ) : DateOfYear

{ <EOL> require ( dayOfYear in <NUM_LIT:1> .. <NUM_LIT> ) { <EOL> "<STR_LIT>" <EOL> } <EOL> val date = LocalDate ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) . plusDays ( dayOfYear - <NUM_LIT:1> ) <EOL> return MonthDayOfYear ( date . month , MonthDayOfYear . TransitionDay . ExactlyDayOfMonth ( date . dayOfMonth ) ) <EOL> }

/**
 * The day of year, in the 1..365 range. During leap years, 29th February is skipped.
 */


fun Nth ( dayOfWeek : DayOfWeek , n : Int ) : TransitionDay

= <EOL> First ( dayOfWeek , ( n - <NUM_LIT:1> ) * <NUM_LIT:7> + <NUM_LIT:1> )

/**
 * The [n]th given [dayOfWeek] in the month.
 */


fun toInstant ( year : Int , effectiveOffset : UtcOffset ) : Instant

{ <EOL> val localDateTime = time . resolve ( date . toLocalDate ( year ) ) <EOL> return when ( this . offset ) { <EOL> is OffsetResolver . WallClockOffset -> localDateTime . toInstant ( effectiveOffset ) <EOL> is OffsetResolver . FixedOffset -> localDateTime . toInstant ( this . offset . offset ) <EOL> } <EOL> }

/**
 * Converts this [MonthDayTime] to an [Instant] in the given [year],
 * using the knowledge of the offset that's in effect at the resulting date-time.
 */


@ kotlin . jvm . JvmName ( "<STR_LIT>" ) <EOL> @ PublishedApi <EOL> internal fun < K , V > Map < K , V > . getOrImplicitDefault ( key : K ) : V

{ <EOL> if ( this is MapWithDefault ) <EOL> return this . getOrImplicitDefault ( key ) <EOL> return getOrElseNullable ( key , { throw NoSuchElementException ( "<STR_LIT>" ) } ) <EOL> }

/**
 * Returns the value for the given key, or the implicit default value for this map.
 * By default no implicit value is provided for maps and a [NoSuchElementException] is thrown.
 * To create a map with implicit default value use [withDefault] method.
 *
 * @throws NoSuchElementException when the map doesn't contain a value for the specified key and no implicit default was provided for that map.
 */


public fun < K , V > Map < K , V > . withDefault ( defaultValue : ( key : K ) -> V ) : Map < K , V >

= <EOL> when ( this ) { <EOL> is MapWithDefault -> this . map . withDefault ( defaultValue ) <EOL> else -> MapWithDefaultImpl ( this , defaultValue ) <EOL> }

/**
 * Returns a wrapper of this read-only map, having the implicit default value provided with the specified function [defaultValue].
 *
 * This implicit default value is used when the original map doesn't contain a value for the key specified
 * and a value is obtained with [Map.getValue] function, for example when properties are delegated to the map.
 *
 * When this map already has an implicit default value provided with a former call to [withDefault], it is being replaced by this call.
 */


@ kotlin . jvm . JvmName ( "<STR_LIT>" ) <EOL> public fun < K , V > MutableMap < K , V > . withDefault ( defaultValue : ( key : K ) -> V ) : MutableMap < K , V >

= <EOL> when ( this ) { <EOL> is MutableMapWithDefault -> this . map . withDefault ( defaultValue ) <EOL> else -> MutableMapWithDefaultImpl ( this , defaultValue ) <EOL> }

/**
 * Returns a wrapper of this mutable map, having the implicit default value provided with the specified function [defaultValue].
 *
 * This implicit default value is used when the original map doesn't contain a value for the key specified
 * and a value is obtained with [Map.getValue] function, for example when properties are delegated to the map.
 *
 * When this map already has an implicit default value provided with a former call to [withDefault], it is being replaced by this call.
 */


public fun < T : HttpClientEngineConfig > NotebookHttpClient ( engineFactory : HttpClientEngineFactory < T > , block : HttpClientConfig < T > . ( ) -> Unit = { } ) : NotebookHttpClient

= NotebookHttpClient ( HttpClient ( engineFactory , block ) )

/**
 * Creates an asynchronous [NotebookHttpClient] with the specified [HttpClientEngineFactory] and optional [block]
 * configuration.
 * Note that a specific platform may require a specific engine for processing requests.
 * You can learn more about available engines from [Engines](https://ktor.io/docs/http-client-engines.html).
 */


public fun NotebookHttpClient . config ( block : HttpClientConfig < * > . ( ) -> Unit ) : NotebookHttpClient

{ <EOL> return NotebookHttpClient ( ktorClient . config ( block ) ) <EOL> }

/**
 * Returns a new [NotebookHttpClient] by copying this client's configuration
 * and additionally configured by the [block] parameter.
 */


fun getReplacementFunction ( function : IrFunction )

= getReplacementFunctionImpl ( function )

/**
 * Get a replacement for a function or a constructor.
 */


{ <EOL> val modelHub = <EOL> ONNXModelHub ( cacheDirectory = File ( "<STR_LIT>" ) ) <EOL> val model = ONNXModels . CV . EfficientNetB0 . pretrainedModel ( modelHub ) <EOL> model . printSummary ( ) <EOL> model . use { <EOL> for ( i in <NUM_LIT:1> .. <NUM_LIT:8> ) { <EOL> val imageFile = getFileFromResource ( "<STR_LIT>" ) <EOL> val recognizedObject = it . predictObject ( imageFile = imageFile ) <EOL> println ( recognizedObject ) <EOL> val top5 = it . predictTopKObjects ( imageFile = imageFile , topK = <NUM_LIT:5> ) <EOL> println ( top5 . toString ( ) ) <EOL> } <EOL> } <EOL> }

/**
 * This examples demonstrates the light-weight inference API with [ImageRecognitionModel] on EfficientNetB0 model:
 * - Model is obtained from [ONNXModelHub].
 * - Model predicts on a few images located in resources.
 */


= efficientNetB0EasyPrediction ( )


private fun FirNamedReference . getCorrespondingTypeIfPossible ( ) : ConeKotlinType ?

= <EOL> findOuterPropertyAccessExpression ( ) ? . resolvedType

/**
 * It only makes sense to provide type for the references which reference some actual properties/variables.
 *
 * In cases when the name reference references a function (a REAL function, not a functional type variable), it does not
 * make sense to provide any type for it.
 *
 * ---
 *
 * Why not just always provide null for name references? In such case, the following case would be a problem:
 *
 * ```kt
 * fun usage(action: String.(Int) -> String) {
 * "hello".<expr>action</expr>(10)
 * }
 * ```
 *
 * The user might want to know the type of the `action` callback. If we always return null for the named references,
 * we won't be able to handle this request, and just return null. So the user will only be able to see the type
 * of the whole expression instead, and that is not what he wants.
 */


private fun FirNamedReference . findOuterPropertyAccessExpression ( ) : FirExpression ?

{ <EOL> val referenceExpression = psi as? KtExpression ? : return null <EOL> val outerExpression = referenceExpression . getOutermostParenthesizerOrThis ( ) . parent as? KtElement ? : return null <EOL> return when ( val outerFirElement = outerExpression . getOrBuildFir ( firResolveSession ) ) { <EOL> is FirVariableAssignment -> outerFirElement . lValue <EOL> is FirPropertyAccessExpression -> outerFirElement <EOL> is FirImplicitInvokeCall -> outerFirElement . explicitReceiver <EOL> is FirSafeCallExpression -> { <EOL> if ( outerFirElement . selector is FirPropertyAccessExpression ) outerFirElement else null <EOL> } <EOL> else -> null <EOL> } <EOL> }

/**
 * Finds an outer expression for [this] named reference in cases when it is a part of a property access.
 *
 * Otherwise, return null.
 */


private fun getExpectedTypeOfIndexingParameter ( expression : PsiElement ) : KtType ?

{ <EOL> val arrayAccessExpression = expression . unwrapQualified < KtArrayAccessExpression > { arrayAccessExpression , currentExpression -> <EOL> currentExpression in arrayAccessExpression . indexExpressions <EOL> } ? : return null <EOL> val firCall = arrayAccessExpression . getOrBuildFirSafe < FirFunctionCall > ( firResolveSession ) ? : return null <EOL> val firArgument = firCall . argumentList . arguments . firstOrNull { it . psi == expression } ? : return null <EOL> val argumentsToParameters = firCall . argumentsToSubstitutedValueParameters ( substituteWithErrorTypes = false ) ? : return null <EOL> return argumentsToParameters [ firArgument ] ? . substitutedType ? . asKtType ( ) <EOL> }

/**
 * Expected type of the indexing parameter in array access, for example, in the following code:
 * ```
 * val map = mapOf<Int, String>()
 * map[k] = v
 * ```
 * `k` is indexing parameter and its expected type is `Int`.
 */


public fun < T > Flow < T > . drop ( count : Int ) : Flow < T >

{ <EOL> require ( count >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return flow { <EOL> var skipped = <NUM_LIT:0> <EOL> collect { value -> <EOL> if ( skipped >= count ) emit ( value ) else ++ skipped <EOL> } <EOL> } <EOL> }

/**
 * Returns a flow that ignores first [count] elements.
 * Throws [IllegalArgumentException] if [count] is negative.
 */


public fun < T > Flow < T > . dropWhile ( predicate : suspend ( T ) -> Boolean ) : Flow < T >

= flow { <EOL> var matched = false <EOL> collect { value -> <EOL> if ( matched ) { <EOL> emit ( value ) <EOL> } else if ( ! predicate ( value ) ) { <EOL> matched = true <EOL> emit ( value ) <EOL> } <EOL> } <EOL> }

/**
 * Returns a flow containing all elements except first elements that satisfy the given predicate.
 */


public fun < T > Flow < T > . take ( count : Int ) : Flow < T >

{ <EOL> require ( count > <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return flow { <EOL> val ownershipMarker = Any ( ) <EOL> var consumed = <NUM_LIT:0> <EOL> try { <EOL> collect { value -> <EOL> if ( ++ consumed < count ) { <EOL> return@collect emit ( value ) <EOL> } else { <EOL> return@collect emitAbort ( value , ownershipMarker ) <EOL> } <EOL> } <EOL> } catch ( e : AbortFlowException ) { <EOL> e . checkOwnership ( owner = ownershipMarker ) <EOL> } <EOL> } <EOL> }

/**
 * Returns a flow that contains first [count] elements.
 * When [count] elements are consumed, the original flow is cancelled.
 * Throws [IllegalArgumentException] if [count] is not positive.
 */


public fun < T > Flow < T > . takeWhile ( predicate : suspend ( T ) -> Boolean ) : Flow < T >

= flow { <EOL> return@flow collectWhile { value -> <EOL> if ( predicate ( value ) ) { <EOL> emit ( value ) <EOL> true <EOL> } else { <EOL> false <EOL> } <EOL> } <EOL> }

/**
 * Returns a flow that contains first elements satisfying the given [predicate].
 *
 * Note, that the resulting flow does not contain the element on which the [predicate] returned `false`.
 * See [transformWhile] for a more flexible operator.
 */


public fun < T , R > Flow < T > . transformWhile ( @ BuilderInference transform : suspend FlowCollector < R > . ( value : T ) -> Boolean ) : Flow < R >

= <EOL> safeFlow { <EOL> return@safeFlow collectWhile { value -> <EOL> transform ( value ) <EOL> } <EOL> }

/**
 * Applies [transform] function to each value of the given flow while this
 * function returns `true`.
 *
 * The receiver of the `transformWhile` is [FlowCollector] and thus `transformWhile` is a
 * flexible function that may transform emitted element, skip it or emit it multiple times.
 *
 * This operator generalizes [takeWhile] and can be used as a building block for other operators.
 * For example, a flow of download progress messages can be completed when the
 * download is done but emit this last message (unlike `takeWhile`):
 *
 * ```
 * fun Flow<DownloadProgress>.completeWhenDone(): Flow<DownloadProgress> =
 * transformWhile { progress ->
 * emit(progress) // always emit progress
 * !progress.isDone() // continue while download is not done
 * }
 * ```
 */


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) ) <EOL> public fun FlowContent . buildBreakableDotSeparatedHtml ( name : String )

{ <EOL> buildBreakableCharSeparatedHtml ( name , '<CHAR_LIT:.>' ) <EOL> }

/**
 * Makes [name] breakable by inserting `<wbr>` element after each occurrence of `.`.
 */


public fun FlowContent . buildBreakableCharSeparatedHtml ( name : String , breakableChar : Char )

{ <EOL> val phrases = name . split ( breakableChar ) <EOL> phrases . forEachIndexed { i , e -> <EOL> val elementWithOptionalChar = e . takeIf { i == phrases . lastIndex } ? : "<STR_LIT>" <EOL> if ( e . length > <NUM_LIT:10> ) { <EOL> buildTextBreakableAfterCapitalLetters ( elementWithOptionalChar , hasLastElement = i == phrases . lastIndex ) <EOL> } else { <EOL> buildBreakableHtmlElement ( elementWithOptionalChar , i == phrases . lastIndex ) <EOL> } <EOL> } <EOL> }

/**
 * Makes [name] breakable by inserting `<wbr>` element after each occurrence of [breakableChar].
 */


public fun < C > colGroup ( colGroup : ColumnAccessor < DataRow < C > > ) : ColumnAccessor < DataRow < C > >

= <EOL> colGroup . ensureIsColumnGroup ( )

/**
 * @include [ColGroupReferenceDocs] {@set [CommonColGroupDocs.ReceiverArg]}
 */


public fun < C > SingleColumn < DataRow < * > > . colGroup ( colGroup : ColumnAccessor < DataRow < C > > ) : SingleColumn < DataRow < C > >

= <EOL> this . ensureIsColumnGroup ( ) . transformSingle { <EOL> val child = it . getCol ( colGroup ) <EOL> ? : throw IllegalStateException ( "<STR_LIT>" ) <EOL> child . data . ensureIsColumnGroup ( ) <EOL> listOf ( child ) <EOL> } . singleImpl ( )

/**
 * @include [ColGroupReferenceDocs] {@set [CommonColGroupDocs.ReceiverArg] myColumnGroup.}
 */


public fun < C > AnyColumnGroupAccessor . colGroup ( colGroup : ColumnAccessor < DataRow < C > > ) : ColumnAccessor < DataRow < C > >

= <EOL> this . ensureIsColumnGroup ( ) . columnGroup < C > ( colGroup . path ( ) ) . ensureIsColumnGroup ( )


public fun < C > String . colGroup ( colGroup : ColumnAccessor < DataRow < C > > ) : ColumnAccessor < DataRow < C > >

= <EOL> columnGroup ( this ) . ensureIsColumnGroup ( ) . columnGroup < C > ( colGroup . path ( ) ) . ensureIsColumnGroup ( )

/**
 * @include [ColGroupReferenceDocs] {@set [CommonColGroupDocs.ReceiverArg] "myColumnGroup".}
 */


public fun < C > KProperty < * > . colGroup ( colGroup : ColumnAccessor < DataRow < C > > ) : ColumnAccessor < DataRow < C > >

/**
 * @include [ColGroupReferenceDocs] {@set [CommonColGroupDocs.ReceiverArg] Type::myColumnGroup.}
 */


public fun < C > ColumnPath . colGroup ( colGroup : ColumnAccessor < DataRow < C > > ) : ColumnAccessor < DataRow < C > >

/**
 * @include [ColGroupReferenceDocs] {@set [CommonColGroupDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun colGroup ( name : String ) : ColumnAccessor < DataRow < * > >

= columnGroup < Any ? > ( name ) . ensureIsColumnGroup ( )

/**
 * @include [ColGroupNameDocs] {@set [CommonColGroupDocs.ReceiverArg]}
 */


public fun < C > colGroup ( name : String ) : ColumnAccessor < DataRow < C > >

= columnGroup < C > ( name ) . ensureIsColumnGroup ( )

/**
 * @include [ColGroupNameDocs] {@set [CommonColGroupDocs.ReceiverArg]}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun SingleColumn < DataRow < * > > . colGroup ( name : String ) : SingleColumn < DataRow < * > >

= <EOL> colGroup < Any ? > ( name )

/**
 * @include [ColGroupNameDocs] {@set [CommonColGroupDocs.ReceiverArg] myColumnGroup.}
 */


public fun < C > SingleColumn < DataRow < * > > . colGroup ( name : String ) : SingleColumn < DataRow < C > >

= <EOL> this . ensureIsColumnGroup ( ) . transformSingle { <EOL> val child = it . getCol ( name ) ? . cast < DataRow < C > > ( ) <EOL> ? : throw IllegalStateException ( "<STR_LIT>" ) <EOL> child . data . ensureIsColumnGroup ( ) <EOL> listOf ( child ) <EOL> } . singleImpl ( )

/**
 * @include [ColGroupNameDocs] {@set [CommonColGroupDocs.ReceiverArg] myColumnGroup.}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun AnyColumnGroupAccessor . colGroup ( name : String ) : ColumnAccessor < DataRow < * > >

= <EOL> colGroup < Any ? > ( name )


public fun < C > AnyColumnGroupAccessor . colGroup ( name : String ) : ColumnAccessor < DataRow < C > >

= <EOL> this . ensureIsColumnGroup ( ) . columnGroup < C > ( name ) . ensureIsColumnGroup ( )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun String . colGroup ( name : String ) : ColumnAccessor < DataRow < * > >

= <EOL> colGroup < Any ? > ( name )

/**
 * @include [ColGroupNameDocs] {@set [CommonColGroupDocs.ReceiverArg] "myColumnGroup".}
 */


public fun < C > String . colGroup ( name : String ) : ColumnAccessor < DataRow < C > >

= <EOL> columnGroup ( this ) . ensureIsColumnGroup ( ) . columnGroup < C > ( name ) . ensureIsColumnGroup ( )

/**
 * @include [ColGroupNameDocs] {@set [CommonColGroupDocs.ReceiverArg] "myColumnGroup".}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun KProperty < * > . colGroup ( name : String ) : ColumnAccessor < DataRow < * > >

= <EOL> colGroup < Any ? > ( name )

/**
 * @include [ColGroupNameDocs] {@set [CommonColGroupDocs.ReceiverArg] Type::myColumnGroup.}
 */


public fun < C > KProperty < * > . colGroup ( name : String ) : ColumnAccessor < DataRow < C > >

/**
 * @include [ColGroupNameDocs] {@set [CommonColGroupDocs.ReceiverArg] Type::myColumnGroup.}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnPath . colGroup ( name : String ) : ColumnAccessor < DataRow < * > >

= <EOL> colGroup < Any ? > ( name )

/**
 * @include [ColGroupNameDocs] {@set [CommonColGroupDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 */


public fun < C > ColumnPath . colGroup ( name : String ) : ColumnAccessor < DataRow < C > >

/**
 * @include [ColGroupNameDocs] {@set [CommonColGroupDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun colGroup ( path : ColumnPath ) : ColumnAccessor < DataRow < * > >

= columnGroup < Any ? > ( path ) . ensureIsColumnGroup ( )

/**
 * @include [ColGroupPathDocs] {@set [CommonColGroupDocs.ReceiverArg]}
 */


public fun < C > colGroup ( path : ColumnPath ) : ColumnAccessor < DataRow < C > >

= columnGroup < C > ( path ) . ensureIsColumnGroup ( )

/**
 * @include [ColGroupPathDocs] {@set [CommonColGroupDocs.ReceiverArg]}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun SingleColumn < DataRow < * > > . colGroup ( path : ColumnPath ) : SingleColumn < DataRow < * > >

= <EOL> colGroup < Any ? > ( path )

/**
 * @include [ColGroupPathDocs] {@set [CommonColGroupDocs.ReceiverArg] myColumnGroup.}
 */


public fun < C > SingleColumn < DataRow < * > > . colGroup ( path : ColumnPath ) : SingleColumn < DataRow < C > >

= <EOL> this . ensureIsColumnGroup ( ) <EOL> . transformSingle { <EOL> val child = it . getCol ( path ) ? . cast < DataRow < C > > ( ) <EOL> ? : throw IllegalStateException ( "<STR_LIT>" ) <EOL> child . data . ensureIsColumnGroup ( ) <EOL> listOf ( child ) <EOL> } . singleImpl ( )

/**
 * @include [ColGroupPathDocs] {@set [CommonColGroupDocs.ReceiverArg] myColumnGroup.}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun AnyColumnGroupAccessor . colGroup ( path : ColumnPath ) : ColumnAccessor < DataRow < * > >

= <EOL> colGroup < Any ? > ( path )


public fun < C > AnyColumnGroupAccessor . colGroup ( path : ColumnPath ) : ColumnAccessor < DataRow < C > >

= <EOL> this . ensureIsColumnGroup ( ) . columnGroup < C > ( path ) . ensureIsColumnGroup ( )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun String . colGroup ( path : ColumnPath ) : ColumnAccessor < DataRow < * > >

= <EOL> colGroup < Any ? > ( path )

/**
 * @include [ColGroupPathDocs] {@set [CommonColGroupDocs.ReceiverArg] "myColumnGroup".}
 */


public fun < C > String . colGroup ( path : ColumnPath ) : ColumnAccessor < DataRow < C > >

= <EOL> columnGroup ( this ) . ensureIsColumnGroup ( ) . columnGroup < C > ( path ) . ensureIsColumnGroup ( )

/**
 * @include [ColGroupPathDocs] {@set [CommonColGroupDocs.ReceiverArg] "myColumnGroup".}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun KProperty < * > . colGroup ( path : ColumnPath ) : ColumnAccessor < DataRow < * > >

= <EOL> colGroup < Any ? > ( path )

/**
 * @include [ColGroupPathDocs] {@set [CommonColGroupDocs.ReceiverArg] Type::myColumnGroup.}
 */


public fun < C > KProperty < * > . colGroup ( path : ColumnPath ) : ColumnAccessor < DataRow < C > >

/**
 * @include [ColGroupPathDocs] {@set [CommonColGroupDocs.ReceiverArg] Type::myColumnGroup.}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnPath . colGroup ( path : ColumnPath ) : ColumnAccessor < DataRow < * > >

= <EOL> colGroup < Any ? > ( path )

/**
 * @include [ColGroupPathDocs] {@set [CommonColGroupDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 */


public fun < C > ColumnPath . colGroup ( path : ColumnPath ) : ColumnAccessor < DataRow < C > >

/**
 * @include [ColGroupPathDocs] {@set [CommonColGroupDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > colGroup ( property : KProperty < DataRow < C > > ) : SingleColumn < DataRow < C > >

= <EOL> columnGroup ( property ) . ensureIsColumnGroup ( )

/**
 * @include [ColGroupKPropertyDocs] {@set [CommonColGroupDocs.ReceiverArg]}
 */


public fun < C > colGroup ( property : KProperty < C > ) : SingleColumn < DataRow < C > >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > SingleColumn < DataRow < * > > . colGroup ( property : KProperty < DataRow < C > > ) : SingleColumn < DataRow < C > >

= <EOL> colGroup < C > ( property . name )

/**
 * @include [ColGroupKPropertyDocs] {@set [CommonColGroupDocs.ReceiverArg] myColumnGroup.}
 */


public fun < C > SingleColumn < DataRow < * > > . colGroup ( property : KProperty < C > ) : SingleColumn < DataRow < C > >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > AnyColumnGroupAccessor . colGroup ( property : KProperty < DataRow < C > > ) : ColumnAccessor < DataRow < C > >

= <EOL> this . ensureIsColumnGroup ( ) . columnGroup ( property ) . ensureIsColumnGroup ( )


public fun < C > AnyColumnGroupAccessor . colGroup ( property : KProperty < C > ) : ColumnAccessor < DataRow < C > >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > String . colGroup ( property : KProperty < DataRow < C > > ) : ColumnAccessor < DataRow < C > >

= <EOL> columnGroup ( this ) . ensureIsColumnGroup ( ) . columnGroup ( property ) . ensureIsColumnGroup ( )

/**
 * @include [ColGroupKPropertyDocs] {@set [CommonColGroupDocs.ReceiverArg] "myColumnGroup".}
 */


public fun < C > String . colGroup ( property : KProperty < C > ) : ColumnAccessor < DataRow < C > >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > KProperty < * > . colGroup ( property : KProperty < DataRow < C > > ) : ColumnAccessor < DataRow < C > >

/**
 * @include [ColGroupKPropertyDocs] {@set [CommonColGroupDocs.ReceiverArg] Type::myColumnGroup.}
 */


public fun < C > KProperty < * > . colGroup ( property : KProperty < C > ) : ColumnAccessor < DataRow < C > >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > ColumnPath . colGroup ( property : KProperty < DataRow < C > > ) : ColumnAccessor < DataRow < C > >

/**
 * @include [ColGroupKPropertyDocs] {@set [CommonColGroupDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 */


public fun < C > ColumnPath . colGroup ( property : KProperty < C > ) : ColumnAccessor < DataRow < C > >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun < C > ColumnSet < DataRow < C > > . colGroup ( index : Int ) : SingleColumn < DataRow < C > >

= <EOL> getAt ( index ) . ensureIsColumnGroup ( )

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg] `[colsOf][ColumnsSelectionDsl.colsOf]`<`[Int][Int]`>().}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 * {@set [CommonColGroupDocs.ExampleArg] {@include [CommonColGroupDocs.SingleExample]}}
 */


public fun ColumnSet < * > . colGroup ( index : Int ) : SingleColumn < DataRow < * > >

= <EOL> getAt ( index ) . cast < DataRow < * > > ( ) . ensureIsColumnGroup ( )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnsSelectionDsl < * > . colGroup ( index : Int ) : SingleColumn < DataRow < * > >

= <EOL> colGroup < Any ? > ( index )

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg]}
 */


public fun < C > ColumnsSelectionDsl < * > . colGroup ( index : Int ) : SingleColumn < DataRow < C > >

= <EOL> asSingleColumn ( ) . colGroup < C > ( index )

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg]}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun SingleColumn < DataRow < * > > . colGroup ( index : Int ) : SingleColumn < DataRow < * > >

= <EOL> colGroup < Any ? > ( index )

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg] myColumnGroup.}
 */


public fun < C > SingleColumn < DataRow < * > > . colGroup ( index : Int ) : SingleColumn < DataRow < C > >

= <EOL> this . ensureIsColumnGroup ( ) <EOL> . allColumnsInternal ( ) <EOL> . getAt ( index ) <EOL> . cast < DataRow < C > > ( ) <EOL> . ensureIsColumnGroup ( )

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg] myColumnGroup.}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun String . colGroup ( index : Int ) : SingleColumn < DataRow < * > >

= <EOL> colGroup < Any ? > ( index )

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg] "myColumnGroup".}
 */


public fun < C > String . colGroup ( index : Int ) : SingleColumn < DataRow < C > >

= <EOL> columnGroup ( this ) . colGroup < C > ( index )

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg] "myColumnGroup".}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun KProperty < * > . colGroup ( index : Int ) : SingleColumn < DataRow < * > >

= <EOL> colGroup < Any ? > ( index )

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg] Type::myColumnGroup.}
 */


public fun < C > KProperty < * > . colGroup ( index : Int ) : SingleColumn < DataRow < C > >

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg] Type::myColumnGroup.}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnPath . colGroup ( index : Int ) : SingleColumn < DataRow < * > >

= <EOL> colGroup < Any ? > ( index )

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 */


public fun < C > ColumnPath . colGroup ( index : Int ) : SingleColumn < DataRow < C > >

/**
 * @include [ColGroupIndexDocs] {@set [CommonColGroupDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 * @include [CommonColGroupDocs.ColumnGroupTypeParam]
 */


@ PublishedApi <EOL> internal fun < C > SingleColumn < DataRow < C > > . ensureIsColumnGroup ( ) : SingleColumn < DataRow < C > >

= <EOL> onResolve { col : ColumnWithPath < * > ? -> <EOL> require ( col ? . isColumnGroup ( ) != false ) { <EOL> "<STR_LIT>" <EOL> } <EOL> }

/**
 * Checks the validity of this [SingleColumn],
 * by adding a check to see it's a [ColumnGroup] (so, a [SingleColumn]<*>)
 * and throwing an [IllegalArgumentException] if it's not.
 */


internal fun < C > ColumnAccessor < DataRow < C > > . ensureIsColumnGroup ( ) : ColumnAccessor < DataRow < C > >

/** @include [SingleColumn.ensureIsColumnGroup] */


public fun filters ( config : Action < KoverReportFiltersConfig > )

/**
 * Specify common filters for all report variants, these filters will be inherited in HTML/XML/verification reports.
 * They can be redefined in the settings of a specific report variant.
 * ```
 * filters {
 * excludes {
 * // ...
 * }
 *
 * includes {
 * // ...
 * }
 * }
 * ```
 */


public fun verify ( config : Action < KoverVerificationRulesConfig > )

/**
 * Specify common verification rules for all report variants: JVM and Android build variants.
 * They can be overridden in the settings for a specific report set for particular variant.
 * ```
 * verify {
 * rule {
 * // verification rule
 * }
 *
 * rule("custom rule name") {
 * // named verification rule
 * }
 *
 * // fail on verification error
 * warningInsteadOfFailure = false
 * }
 * ```
 */


public fun total ( config : Action < KoverReportSetConfig > )

/**
 * Configure reports for all code of current project and `kover` dependencies.
 *
 * example:
 * ```
 * kover {
 * reports {
 * total {
 * filters {
 * // override report filters for total reports
 * }
 * html {
 * // configure HTML report for all code of current project and `kover` dependencies.
 * }
 * xml {
 * // configure XML report for all code of current project and `kover` dependencies.
 * }
 * verify {
 * // configure coverage verification all code of current project and `kover` dependencies.
 * }
 * }
 * }
 * }
 * ```
 */


public fun variant ( variant : String , config : Action < KoverReportSetConfig > )

/**
 * Configure reports for classes of specified named Kover report variant.
 *
 * example:
 * ```
 * kover {
 * reports {
 * variant("debug") {
 * filters {
 * // override report filters for reports of 'debug' variant
 * }
 *
 * html {
 * // configure HTML report for 'debug' variant
 * }
 *
 * xml {
 * // configure XML report for 'debug' variant
 * }
 *
 * verify {
 * // configure coverage verification for 'debug' variant
 * }
 * }
 * }
 * }
 * ```
 */


public fun filtersAppend ( config : Action < KoverReportFiltersConfig > )

/**
 * Specify common report filters, these filters will be inherited in HTML/XML/verification and other reports.
 *
 * Using this block will add additional filters to those that were inherited and specified earlier.
 * In order to clear the existing filters, use [filters].
 *
 * ```
 * filtersAppend {
 * excludes {
 * // ...
 * }
 *
 * includes {
 * // ...
 * }
 * }
 * ```
 */


public fun html ( config : Action < KoverHtmlTaskConfig > )

/**
 * Configure HTML report for current report variant.
 * ```
 * html {
 * title = "Custom title"
 *
 * // Generate an HTML report when running the `check` task
 * onCheck = false
 *
 * // Specify HTML report directory
 * htmlDir = layout.buildDirectory.dir("my-html-report")
 * }
 * ```
 */


public fun xml ( config : Action < KoverXmlTaskConfig > )

/**
 * Configure XML report for current report variant.
 * ```
 * xml {
 * // Generate an XML report when running the `check` task
 * onCheck = true
 *
 * // XML report title (the location depends on the library)
 * title = "Custom XML report title"
 *
 * // Specify file to generate XML report
 * xmlFile = layout.buildDirectory.file("my-xml-report.xml")
 * }
 * ```
 */


public fun binary ( config : Action < KoverBinaryTaskConfig > )

/**
 * Configure Kover binary report for current report variant.
 * ```
 * binary {
 * // Generate binary report when running the `check` task
 * onCheck = true
 *
 * // Specify file to generate binary report
 * file = layout.buildDirectory.file("my-project-report/report.bin")
 * }
 * ```
 *
 * Kover binary report is compatible with IntelliJ Coverage report (ic)
 */


public fun verify ( config : Action < KoverVerifyTaskConfig > )

/**
 * Configure coverage verification for current report variant.
 *
 * Using this block clears all the bounds specified earlier.
 * In order not to clear the existing bounds, but to add new ones, use [verifyAppend].
 *
 * ```
 * verify {
 * onCheck = true
 *
 * rule {
 * // ...
 * }
 *
 * rule("Custom Name") {
 * // ...
 * }
 *
 * // fail on verification error
 * warningInsteadOfFailure = false
 * }
 * ```
 */


public fun verifyAppend ( config : Action < KoverVerifyTaskConfig > )

/**
 * Configure coverage verification for current report variant.
 *
 * Using this block will add additional bounds to those that were inherited and specified earlier.
 * In order to clear the existing bounds, use [verify].
 *
 * ```
 * verifyAppend {
 * onCheck = true
 *
 * rule {
 * // ...
 * }
 *
 * rule("Custom Name") {
 * // ...
 * }
 * }
 * ```
 */


public fun log ( config : Action < KoverLogTaskConfig > )

/**
 * Configure coverage printing to the log for current report variant.
 * ```
 * log {
 * onCheck = true
 *
 * filters {
 * // ...
 * }
 * header = null
 * format = "<entity> line coverage: <value>%"
 * groupBy = GroupingEntityType.APPLICATION
 * coverageUnits = CoverageUnit.LINE
 * aggregationForGroup = AggregationType.COVERED_PERCENTAGE
 * }
 * ```
 */


public fun excludes ( config : Action < KoverReportFilter > )

/**
 * Configures class filter in order to exclude classes and functions.
 *
 * Example:
 * ```
 * excludes {
 * classes("com.example.FooBar?", "com.example.*Bar")
 * packages("com.example.subpackage")
 * annotatedBy("*Generated*")
 * }
 * ```
 * Excludes have priority over includes.
 */


public fun includes ( config : Action < KoverReportFilter > )

/**
 * Configures class filter in order to include classes.
 *
 * Example:
 * ```
 * includes {
 * classes("com.example.FooBar?", "com.example.*Bar")
 * packages("com.example.subpackage")
 * }
 * ```
 * Excludes have priority over includes.
 */


public fun classes ( vararg names : String )

/**
 * Add specified classes to current filters.
 *
 * It is acceptable to use `*` and `?` wildcards,
 * `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
 *
 * Example:
 * ```
 * classes("*.foo.Bar", "*.M?Class")
 * ```
 */


public fun classes ( names : Iterable < String > )

/**
 * Add specified classes to current filters.
 *
 * It is acceptable to use `*` and `?` wildcards,
 * `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
 *
 * Example for Groovy:
 * ```
 * def someClasses = ["*.foo.Bar", "*.M?Class"]
 * ...
 * classes(someClasses)
 * ```
 *
 * Example for Kotlin:
 * ```
 * val someClasses = listOf("*.foo.Bar", "*.M?Class")
 * ...
 * classes(someClasses)
 * ```
 */


public fun classes ( vararg names : Provider < String > )

/**
 * Add specified classes to current filters.
 *
 * Used for lazy setup.
 *
 * It is acceptable to use `*` and `?` wildcards,
 * `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
 *
 * Example:
 * ```
 * val excludedClass: Provider<String> = ...
 * ...
 * classes(excludedClass)
 * ```
 */


public fun classes ( names : Provider < Iterable < String > > )

/**
 * Add specified classes to current filters.
 *
 * Used for lazy setup.
 *
 * It is acceptable to use `*` and `?` wildcards,
 * `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
 *
 * Example:
 * ```
 * val someClasses: Provider<List<String>> = ...
 * ...
 * classes(someClasses)
 * ```
 */


public fun packages ( vararg names : String )

/**
 * Add all classes in specified package and its subpackages to current filters.
 *
 * It is acceptable to use `*` and `?` wildcards,
 * `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
 *
 * Example:
 * ```
 * packages("foo.b?r", "com.*.example")
 * ```
 */


public fun packages ( names : Iterable < String > )

/**
 * Add all classes in specified package and its subpackages to current filters.
 *
 * It is acceptable to use `*` and `?` wildcards,
 * `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
 *
 * Example for Groovy:
 * ```
 * def somePackages = ["foo.b?r", "com.*.example"]
 *
 * packages(somePackages)
 * ```
 *
 * Example for Kotlin:
 * ```
 * val somePackages = listOf("foo.b?r", "com.*.example")
 * ...
 * packages(somePackages)
 * ```
 */


public fun packages ( vararg names : Provider < String > )

/**
 * Add all classes in specified package and its subpackages to current filters.
 *
 * Used for lazy setup.
 *
 * It is acceptable to use `*` and `?` wildcards,
 * `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
 *
 * Example:
 * ```
 * val classA: Provider<String> = ...
 * val classB: Provider<String> = ...
 * packages(classA, classB)
 * ```
 */


public fun packages ( names : Provider < Iterable < String > > )

/**
 * Add all classes in specified package and its subpackages to current filters.
 *
 * Used for lazy setup.
 *
 * It is acceptable to use `*` and `?` wildcards,
 * `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
 *
 * Example:
 * ```
 * val somePackages: Provider<List<String>> = ...
 * ...
 * packages(somePackages)
 * ```
 */


public fun annotatedBy ( vararg annotationName : String )

/**
 * Add to filters all classes and functions marked by specified annotations.
 *
 * It is acceptable to use `*` and `?` wildcards,
 * `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
 *
 * Example:
 * ```
 * annotatedBy("*Generated*", "com.example.KoverExclude")
 * ```
 */


public fun annotatedBy ( vararg annotationName : Provider < String > )

/**
 * Add to filters all classes and functions marked by specified annotations.
 *
 * Used for lazy setup.
 *
 * It is acceptable to use `*` and `?` wildcards,
 * `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
 *
 * Example:
 * ```
 * val annotation: Provider<String> = ...
 * annotatedBy(annotation)
 * ```
 */


{ <EOL> classes ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> }

/**
 * Add all classes generated by Android plugin to filters.
 *
 * It is shortcut for:
 * ```
 * classes(
 * "*Fragment",
 * "*Fragment\$*",
 * "*Activity",
 * "*Activity\$*",
 * "*.databinding.*",
 * "*.BuildConfig"
 * )
 * ```
 */


@ Deprecated ( message = "<STR_LIT>" , replaceWith = ReplaceWith ( "<STR_LIT>" ) , level = DeprecationLevel . ERROR ) <EOL> public fun setReportFile ( xmlFile : Any )

{ <EOL> throw KoverDeprecationException ( "<STR_LIT>" ) <EOL> }

/**
 * Specify file to generate XML report.
 */


public fun rule ( config : Action < KoverVerifyRule > )

/**
 * Add new coverage verification rule to check after test task execution.
 */


public fun rule ( name : String , config : Action < KoverVerifyRule > )

/**
 * Add new named coverage verification rule to check after test task execution.
 *
 * The name will be displayed in case of a verification error if Kover Tool was used.
 */


public fun bound ( config : Action < KoverVerifyBound > )

/**
 * Specifies the set of verification rules that control the
 * coverage conditions required for the verification task to pass.
 *
 * An example of bound configuration:
 * ```
 * // At least 75% of lines should be covered in order for build to pass
 * bound {
 * aggregationForGroup = AggregationType.COVERED_PERCENTAGE // Default aggregation
 * coverageUnits = CoverageUnit.LINE
 * minValue = 75
 * }
 * ```
 *
 * @see KoverVerifyBound
 */


public fun minBound ( minValue : Int )

/**
 * A shortcut for
 * ```
 * bound {
 * minValue = min
 * }
 * ```
 *
 * @see bound
 */


public fun minBound ( minValue : Provider < Int > )


public fun maxBound ( maxValue : Int )

/**
 * A shortcut for
 * ```
 * bound {
 * maxValue = maxValue
 * }
 * ```
 *
 * @see bound
 */


public fun maxBound ( maxValue : Provider < Int > )

/**
 * A shortcut for
 * ```
 * bound {
 * maxValue = max
 * }
 * ```
 *
 * @see bound
 */


public fun minBound ( minValue : Int , coverageUnits : CoverageUnit = CoverageUnit . LINE , aggregationForGroup : AggregationType = AggregationType . COVERED_PERCENTAGE )

/**
 * A shortcut for
 * ```
 * bound {
 * minValue = minValue
 * coverageUnits = coverageUnits
 * aggregationForGroup = aggregationForGroup
 * }
 * ```
 *
 * @see bound
 */


public fun maxBound ( maxValue : Int , coverageUnits : CoverageUnit = CoverageUnit . LINE , aggregationForGroup : AggregationType = AggregationType . COVERED_PERCENTAGE )

/**
 * A shortcut for
 * ```
 * bound {
 * maxValue = maxValue
 * coverageUnits = coverageUnits
 * aggregationForGroup = aggregation
 * }
 * ```
 *
 * @see bound
 */


public fun bound ( minValue : Int , maxValue : Int , coverageUnits : CoverageUnit = CoverageUnit . LINE , aggregationForGroup : AggregationType = AggregationType . COVERED_PERCENTAGE )

/**
 * A shortcut for
 * ```
 * bound {
 * maxValue = maxValue
 * minValue = minValue
 * coverageUnits = coverageUnits
 * aggregationForGroup = aggregation
 * }
 * ```
 *
 * @see bound
 */


@ Test <EOL> fun testCancellationExceptionOnExternalCancellation ( )

= runTest { <EOL> expect ( <NUM_LIT:1> ) <EOL> val result = future ( NonCancellable + Dispatchers . Unconfined ) { <EOL> try { <EOL> delay ( Long . MAX_VALUE ) <EOL> } finally { <EOL> expect ( <NUM_LIT:2> ) <EOL> throw TestCancellationException ( ) <EOL> } <EOL> } <EOL> assertTrue ( result . cancel ( true ) ) <EOL> finish ( <NUM_LIT:3> ) <EOL> }

/** This test ensures that we never pass [CancellationException] to [CoroutineExceptionHandler]. */


fun configure ( configuration : CO . ( ) -> Unit )

{ <EOL> configuration ( options ) <EOL> }


fun configure ( configuration : Action < @ UnsafeVariance CO > )

{ <EOL> configuration . execute ( options ) <EOL> }


fun FirMemberDeclaration . setLazyPublishedVisibility ( session : FirSession )

{ <EOL> setLazyPublishedVisibility ( annotations , null , session ) <EOL> }

/**
 * Published visibility depends on the published visibility of the containing class.
 * However, the published visibility of deserialized classes can't be eagerly determined because it depends on their annotations, which
 * are loaded later to prevent endless loops.
 * To break up this dependency, the published visibility can be computed lazily when containing classes are fully deserialized.
 */


fun availableFor ( configurables : AppleConfigurables ) : Boolean

{ <EOL> return HostManager . host is KonanTarget . MACOS_ARM64 && configurables . target is KonanTarget . MACOS_X64 <EOL> }

/**
 * Returns `true` if running via Rosetta 2 can be made available for given [configurables].
 *
 * This does not check that Rosetta 2 is installed.
 */


fun checkIsInstalled ( hostExecutor : Executor = HostExecutor ( ) ) : Boolean

{ <EOL> if ( HostManager . host !is KonanTarget . MACOS_ARM64 ) { <EOL> return false <EOL> } <EOL> return hostExecutor . execute ( ExecuteRequest ( "<STR_LIT>" ) . apply { <EOL> this . args . addAll ( listOf ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> } ) . exitCode == <NUM_LIT:0> <EOL> }

/**
 * Return `true` if Rosetta 2 is installed.
 *
 * @param [hostExecutor] executor in which to run the check. By default [HostExecutor].
 */


{ <EOL> return stub ? . let { getTypeText ( typeElement ) } ? : text <EOL> }

/**
 * Returns presentable text for the underlying type based on stubs when provided.
 * No decompilation happens if [KtTypeReference] represents compiled code.
 */


fun Project . nativeTest ( taskName : String , tag : String ? , requirePlatformLibs : Boolean = false , customCompilerDependencies : List < Configuration > = emptyList ( ) , customTestDependencies : List < Configuration > = emptyList ( ) , compilerPluginDependencies : List < Configuration > = emptyList ( ) , allowParallelExecution : Boolean = true , body : Test . ( ) -> Unit = { } , )

= projectTest ( taskName , jUnitMode = JUnitMode . JUnit5 , maxHeapSizeMb = <NUM_LIT> ) { <EOL> group = "<STR_LIT>" <EOL> if ( kotlinBuildProperties . isKotlinNativeEnabled ) { <EOL> workingDir = rootDir <EOL> outputs . upToDateWhen { <EOL> false <EOL> } <EOL> jvmArgs ( "<STR_LIT>" ) <EOL> jvmArgs ( "<STR_LIT>" ) <EOL> val availableCpuCores : Int = if ( allowParallelExecution ) Runtime . getRuntime ( ) . availableProcessors ( ) else <NUM_LIT:1> <EOL> if ( ! kotlinBuildProperties . isTeamcityBuild && minOf ( kotlinBuildProperties . junit5NumberOfThreadsForParallelExecution ? : <NUM_LIT:16> , availableCpuCores ) > <NUM_LIT:4> ) { <EOL> logger . info ( "<STR_LIT>" ) <EOL> jvmArgs ( "<STR_LIT>" ) <EOL> } <EOL> val computedTestProperties = ComputedTestProperties { <EOL> compute ( KOTLIN_NATIVE_HOME ) { <EOL> val testTarget = readFromGradle ( TEST_TARGET ) <EOL> if ( testTarget != null ) { <EOL> dependsOn ( "<STR_LIT>" ) <EOL> if ( requirePlatformLibs ) dependsOn ( "<STR_LIT>" ) <EOL> } else { <EOL> dependsOn ( "<STR_LIT>" ) <EOL> if ( requirePlatformLibs ) dependsOn ( "<STR_LIT>" ) <EOL> } <EOL> project ( "<STR_LIT>" ) . projectDir . resolve ( "<STR_LIT>" ) . absolutePath <EOL> } <EOL> computeLazy ( COMPILER_CLASSPATH ) { <EOL> val customNativeHome = readFromGradle ( KOTLIN_NATIVE_HOME ) <EOL> val kotlinNativeCompilerEmbeddable = if ( customNativeHome == null ) <EOL> configurations . detachedConfiguration ( dependencies . project ( "<STR_LIT>" ) , dependencies . create ( commonDependency ( "<STR_LIT>" ) ) ) . also { dependsOn ( it ) } <EOL> else <EOL> null <EOL> customCompilerDependencies . forEach ( :: dependsOn ) <EOL> lazyClassPath { <EOL> if ( customNativeHome == null ) { <EOL> addAll ( kotlinNativeCompilerEmbeddable ! ! . files ) <EOL> } else { <EOL> this += file ( customNativeHome ) . resolve ( "<STR_LIT>" ) <EOL> this += file ( customNativeHome ) . resolve ( "<STR_LIT>" ) <EOL> } <EOL> customCompilerDependencies . flatMapTo ( this ) { it . files } <EOL> } <EOL> } <EOL> computeLazy ( COMPILER_PLUGINS ) { <EOL> compilerPluginDependencies . forEach ( :: dependsOn ) <EOL> lazyClassPath { compilerPluginDependencies . flatMapTo ( this ) { it . files } } <EOL> } <EOL> computeLazy ( CUSTOM_KLIBS ) { <EOL> customTestDependencies . forEach ( :: dependsOn ) <EOL> lazyClassPath { customTestDependencies . flatMapTo ( this ) { it . files } } <EOL> } <EOL> compute ( TEST_KIND ) { <EOL> readFromGradle ( FORCE_STANDALONE ) ? . let { "<STR_LIT>" } <EOL> } <EOL> compute ( TEST_TARGET ) <EOL> compute ( TEST_MODE ) <EOL> compute ( COMPILE_ONLY ) <EOL> compute ( OPTIMIZATION_MODE ) <EOL> compute ( USE_THREAD_STATE_CHECKER ) <EOL> compute ( GC_TYPE ) <EOL> compute ( GC_SCHEDULER ) <EOL> compute ( ALLOCATOR ) <EOL> compute ( CACHE_MODE ) <EOL> compute ( EXECUTION_TIMEOUT ) <EOL> compute ( SANITIZER ) <EOL> compute ( SHARED_TEST_EXECUTION ) <EOL> compute ( EAGER_GROUP_CREATION ) <EOL> computePrivate ( TEAMCITY ) { kotlinBuildProperties . isTeamcityBuild . toString ( ) } <EOL> } <EOL> environment ( "<STR_LIT>" , path ) <EOL> useJUnitPlatform { <EOL> tag ? . let { includeTags ( it ) } <EOL> } <EOL> if ( ! allowParallelExecution ) { <EOL> systemProperty ( "<STR_LIT>" , "<STR_LIT:false>" ) <EOL> } <EOL> doFirst { <EOL> logger . info ( buildString { <EOL> appendLine ( "<STR_LIT>" ) <EOL> append ( "<STR_LIT>" ) <EOL> systemProperties . filterKeys { it . startsWith ( "<STR_LIT>" ) } . toSortedMap ( ) . forEach { ( key , value ) -> <EOL> append ( "<STR_LIT>" ) <EOL> } <EOL> } ) <EOL> computedTestProperties . resolveAndApplyToTask ( ) <EOL> } <EOL> } else <EOL> doFirst { <EOL> throw GradleException ( """<STR_LIT>""" . trimIndent ( ) ) <EOL> } <EOL> body ( ) <EOL> }

/**
 * @param taskName Name of Gradle task.
 * @param tag Optional JUnit test tag. See https://junit.org/junit5/docs/current/user-guide/#writing-tests-tagging-and-filtering
 * @param requirePlatformLibs Where platform KLIBs from the Kotlin/Native distribution are required for running this test.
 * @param customCompilerDependencies The [Configuration]s that provide additional JARs to be added to the compiler's classpath.
 * @param customTestDependencies The [Configuration]s that provide KLIBs to be added to Kotlin/Native compiler dependencies list
 * along with Kotlin/Native stdlib KLIB and Kotlin/Native platform KLIBs (the latter only if [requirePlatformLibs] is `true`).
 * @param compilerPluginDependencies The [Configuration]s that provide compiler plugins to be enabled for the Kotlin/Native compiler
 * for the duration of test execution.
 * @param allowParallelExecution if false, force junit to execute test sequentially
 */


fun sourceSetTrees ( vararg tree : KotlinSourceSetTree )

/**
 * Defines the trees that the described hierarchy is applied to.
 * ### Example 1: Only apply a hierarchy for the "main" and "test" [KotlinSourceSetTree]
 *
 * ```kotlin
 * applyHierarchyTemplate {
 * sourceSetTrees(KotlinSourceSetTree.main, KotlinSourceSetTree.test)
 * common {
 * withJvm()
 * group("ios") {
 * withIos()
 * }
 * }
 * }
 *```
 *
 * Will create the following trees given an iosX64(), iosArm64() and jvm() target:
 * ```
 * "main" "test"
 * commonMain commonTest
 * | |
 * +----+-----+ +----+-----+
 * | | | |
 * iosMain jvmMain iosTest jvmTest
 * | |
 * +---+----+ +---+----+
 * | | | |
 * iosX64Main iosArm64Main iosX64Test iosArm64Test
 * ```
 *
 * ### Example 2:
 * Using a different hierarchy for "main" and "test"
 *```kotlin
 * applyHierarchyTemplate {
 * sourceSetTrees(SourceSetTree.main) // ! <- only applied to the "main" tree
 * common {
 * withJvm()
 * group("ios") {
 * withIos()
 * }
 * }
 * }
 *
 * applyHierarchyTemplate {
 * sourceSetTrees(SourceSetTree.test) // ! <- only applied to the "test" tree
 * common {
 * withJvm()
 * withIos()
 * }
 * }
 * ```
 *
 * Will create the following trees given an iosX64(), iosArm64() and jvm() target:
 * ```
 * "main" "test"
 * commonMain commonTest
 * | |
 * +----+-----+ +-----------+-----------+
 * | | | | |
 * iosMain jvmMain iosX64Test iosArm64Test jvmTest
 * |
 * +---+----+
 * | |
 * iosX64Main iosArm64Main
 * ```
 */


fun withSourceSetTree ( vararg tree : KotlinSourceSetTree )

/**
 * Will add the given [tree]s into for this descriptor.
 * @see sourceSetTrees
 */


fun excludeSourceSetTree ( vararg tree : KotlinSourceSetTree )

/**
 * Will remove the given [tree]s from this descriptor
 * @see sourceSetTrees
 */


fun common ( build : KotlinHierarchyBuilder . ( ) -> Unit )

= group ( "<STR_LIT:common>" , build )

/**
 * Shortcut for `group("common") { }`:
 * Most hierarchies should attach their nodes/groups to 'common'
 *
 * e.g.
 * ```
 * common {
 * group("native") {
 * withIos()
 * withMacos()
 * }
 * }
 * ```
 * applying the shown hierarchy to the main compilations will create a 'nativeMain' source set which will
 * depend on the usual 'commonMain'
 *
 */


private fun descriptionFrom ( token : String ) : String

{ <EOL> val fqName = FqName ( token ) <EOL> val cls = callContext . moduleDescriptor . findClassAcrossModuleDependencies ( ClassId . topLevel ( fqName ) ) <EOL> return cls ? . let { <EOL> it . annotations . findAnnotation ( ComposeFqNames . ComposableTargetMarker ) ? . let { marker -> <EOL> marker . allValueArguments . firstNotNullOfOrNull { entry -> <EOL> val name = entry . key <EOL> if ( ! name . isSpecial && name . identifier == ComposeFqNames . ComposableTargetMarkerDescription ) { <EOL> ( entry . value as? StringValue ) ? . value <EOL> } else null <EOL> } <EOL> } <EOL> } ? : token <EOL> }

/**
 * Find the `description` value from ComposableTargetMarker if the token refers to an
 * annotation with the marker or just return [token] if it cannot be found.
 */


fun getStart ( group : Int = <NUM_LIT:0> ) : Int

{ <EOL> checkGroup ( group ) <EOL> return groupBounds [ group * <NUM_LIT:2> ] <EOL> }

/**
 * Returns the index of the first character of the text that matched a given group.
 *
 * @param group the group, ranging from 0 to groupCount() - 1, with 0 representing the whole pattern.
 * @return the character index.
 */


fun getEnd ( group : Int = <NUM_LIT:0> ) : Int

{ <EOL> checkGroup ( group ) <EOL> return groupBounds [ group * <NUM_LIT:2> + <NUM_LIT:1> ] <EOL> }

/**
 * Returns the index of the first character following the text that matched a given group.
 *
 * @param group the group, ranging from 0 to groupCount() - 1, with 0 representing the whole pattern.
 * @return the character index.
 */


fun group ( group : Int = <NUM_LIT:0> ) : String ?

{ <EOL> val start = getStart ( group ) <EOL> val end = getEnd ( group ) <EOL> if ( start < <NUM_LIT:0> || end < <NUM_LIT:0> ) { <EOL> return null <EOL> } <EOL> return input . subSequence ( getStart ( group ) , getEnd ( group ) ) . toString ( ) <EOL> }

/**
 * Returns the text that matched a given group of the regular expression.
 *
 * @param group the group, ranging from 0 to groupCount() - 1, with 0 representing the whole pattern.
 * @return the text that matched the group.
 */


{ <EOL> return groupCount - <NUM_LIT:1> <EOL> }

/**
 * Returns the number of groups in the result, which is always equal to
 * the number of groups in the original regular expression.
 *
 * @return the number of groups.
 */


private tailrec fun findStartDestination ( graph : NavDestination ) : NavDestination

{ <EOL> return if ( graph is NavGraph ) findStartDestination ( graph . startDestination ! ! ) else graph <EOL> }

/**
 * Copied from similar function in NavigationUI.kt
 *
 * https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/navigation-ui/src/main/java/androidx/navigation/ui/NavigationUI.kt
 */


@ Composable <EOL> @ ReadOnlyComposable <EOL> private fun resources ( ) : Resources

{ <EOL> LocalConfiguration . current <EOL> return LocalContext . current . resources <EOL> }

/**
 * A composable function that returns the [Resources]. It will be recomposed when `Configuration`
 * gets updated.
 */


@ kotlin . internal . InlineOnly <EOL> public inline operator fun BigInteger . plus ( other : BigInteger ) : BigInteger

= this . add ( other )

/**
 * Enables the use of the `+` operator for [BigInteger] instances.
 */


@ kotlin . internal . InlineOnly <EOL> public inline operator fun BigInteger . minus ( other : BigInteger ) : BigInteger

= this . subtract ( other )

/**
 * Enables the use of the `-` operator for [BigInteger] instances.
 */


@ kotlin . internal . InlineOnly <EOL> public inline operator fun BigInteger . times ( other : BigInteger ) : BigInteger

= this . multiply ( other )

/**
 * Enables the use of the `*` operator for [BigInteger] instances.
 */


@ kotlin . internal . InlineOnly <EOL> public inline operator fun BigInteger . div ( other : BigInteger ) : BigInteger

= this . divide ( other )

/**
 * Enables the use of the `/` operator for [BigInteger] instances.
 */


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline operator fun BigInteger . rem ( other : BigInteger ) : BigInteger

= this . remainder ( other )

/**
 * Enables the use of the `%` operator for [BigInteger] instances.
 */


@ kotlin . internal . InlineOnly <EOL> public inline operator fun BigInteger . unaryMinus ( ) : BigInteger

= this . negate ( )

/**
 * Enables the use of the unary `-` operator for [BigInteger] instances.
 */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline operator fun BigInteger . inc ( ) : BigInteger

= this . add ( BigInteger . ONE )

/**
 * Enables the use of the `++` operator for [BigInteger] instances.
 */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline operator fun BigInteger . dec ( ) : BigInteger

= this . subtract ( BigInteger . ONE )

/**
 * Enables the use of the `--` operator for [BigInteger] instances.
 */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun BigInteger . inv ( ) : BigInteger

= this . not ( )

/** Inverts the bits including the sign bit in this value. */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline infix fun BigInteger . and ( other : BigInteger ) : BigInteger

= this . and ( other )

/** Performs a bitwise AND operation between the two values. */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline infix fun BigInteger . or ( other : BigInteger ) : BigInteger

= this . or ( other )

/** Performs a bitwise OR operation between the two values. */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline infix fun BigInteger . xor ( other : BigInteger ) : BigInteger

= this . xor ( other )

/** Performs a bitwise XOR operation between the two values. */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline infix fun BigInteger . shl ( n : Int ) : BigInteger

= this . shiftLeft ( n )

/** Shifts this value left by the [n] number of bits. */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline infix fun BigInteger . shr ( n : Int ) : BigInteger

= this . shiftRight ( n )

/** Shifts this value right by the [n] number of bits, filling the leftmost bits with copies of the sign bit. */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Int . toBigInteger ( ) : BigInteger

= BigInteger . valueOf ( this . toLong ( ) )

/**
 * Returns the value of this [Int] number as a [BigInteger].
 */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Long . toBigInteger ( ) : BigInteger

= BigInteger . valueOf ( this )

/**
 * Returns the value of this [Long] number as a [BigInteger].
 */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun BigInteger . toBigDecimal ( ) : BigDecimal

= BigDecimal ( this )

/**
 * Returns the value of this [BigInteger] number as a [BigDecimal].
 */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun BigInteger . toBigDecimal ( scale : Int = <NUM_LIT:0> , mathContext : MathContext = MathContext . UNLIMITED ) : BigDecimal

= <EOL> BigDecimal ( this , scale , mathContext )

/**
 * Returns the value of this [BigInteger] number as a [BigDecimal]
 * scaled according to the specified [scale] and rounded according to the settings specified with [mathContext].
 *
 * @param scale the scale of the resulting [BigDecimal], i.e. number of decimal places of the fractional part.
 * By default 0.
 */


{ <EOL> val project = element . project <EOL> val nextInlineFunctions = HashSet < KtDeclarationWithBody > ( ) <EOL> val collector = InlineFunctionsCollector ( project , analyzeOnlyReifiedInlineFunctions ) { declaration -> <EOL> if ( ! analyzedElements . contains ( declaration ) ) { <EOL> nextInlineFunctions . add ( declaration ) <EOL> } <EOL> } <EOL> val propertyAccessor = InlineDelegatedPropertyAccessorsAnalyzer ( analysisContext , collector ) <EOL> element . accept ( object : KtTreeVisitorVoid ( ) { <EOL> override fun visitExpression ( expression : KtExpression ) { <EOL> super . visitExpression ( expression ) <EOL> val bindingContext = analysisContext . analyze ( expression ) <EOL> val call = bindingContext . get ( BindingContext . CALL , expression ) ? : return <EOL> val resolvedCall = bindingContext . get ( BindingContext . RESOLVED_CALL , call ) <EOL> collector . checkResolveCall ( resolvedCall ) <EOL> } <EOL> override fun visitDestructuringDeclaration ( destructuringDeclaration : KtDestructuringDeclaration ) { <EOL> super . visitDestructuringDeclaration ( destructuringDeclaration ) <EOL> val bindingContext = analysisContext . analyze ( destructuringDeclaration ) <EOL> for ( entry in destructuringDeclaration . entries ) { <EOL> val resolvedCall = bindingContext . get ( BindingContext . COMPONENT_RESOLVED_CALL , entry ) <EOL> collector . checkResolveCall ( resolvedCall ) <EOL> } <EOL> } <EOL> override fun visitForExpression ( expression : KtForExpression ) { <EOL> super . visitForExpression ( expression ) <EOL> val bindingContext = analysisContext . analyze ( expression ) <EOL> collector . checkResolveCall ( bindingContext . get ( BindingContext . LOOP_RANGE_ITERATOR_RESOLVED_CALL , expression . loopRange ) ) <EOL> collector . checkResolveCall ( bindingContext . get ( BindingContext . LOOP_RANGE_HAS_NEXT_RESOLVED_CALL , expression . loopRange ) ) <EOL> collector . checkResolveCall ( bindingContext . get ( BindingContext . LOOP_RANGE_NEXT_RESOLVED_CALL , expression . loopRange ) ) <EOL> } <EOL> override fun visitProperty ( property : KtProperty ) { <EOL> super . visitProperty ( property ) <EOL> propertyAccessor . visitProperty ( property ) <EOL> } <EOL> } ) <EOL> analyzedElements . add ( element ) <EOL> if ( nextInlineFunctions . isNotEmpty ( ) ) { <EOL> for ( inlineFunction in nextInlineFunctions ) { <EOL> if ( inlineFunction . bodyExpression != null ) { <EOL> inlineFunctionsWithBody . add ( inlineFunction ) <EOL> analyze ( inlineFunction ) <EOL> } <EOL> } <EOL> analyzedElements . addAll ( nextInlineFunctions ) <EOL> } <EOL> }

/**
 * Collects all inline function calls in an [element] (usually a file) and follows each transitively.
 */


= analyzedElements . mapTo ( mutableSetOf ( ) ) { it . containingKtFile } . toList ( )

/**
 * Returns the list of files that contain all reached inline functions.
 */


fun inlineObjectDeclarations ( ) : Set < KtObjectDeclaration >

{ <EOL> val results = mutableSetOf < KtObjectDeclaration > ( ) <EOL> inlineFunctionsWithBody . forEach { inlineFunction -> <EOL> val body = inlineFunction . bodyExpression ? : return@forEach <EOL> body . accept ( object : KtTreeVisitorVoid ( ) { <EOL> override fun visitObjectLiteralExpression ( expression : KtObjectLiteralExpression ) { <EOL> super . visitObjectLiteralExpression ( expression ) <EOL> results . add ( expression . objectDeclaration ) <EOL> } <EOL> } ) <EOL> } <EOL> return results <EOL> }

/**
 * Returns the set of [KtObjectDeclaration]s which are defined as an object literal in one of the reached inline functions.
 */


public fun createVariant ( variantName : String , block : Action < KoverVariantCreateConfig > )

/**
 * Create custom report variant with name [variantName].
 * In it is acceptable to add information from other variants of the current project, as well as `kover` dependencies.
 */


public fun providedVariant ( variantName : String , block : Action < KoverVariantConfig > )

/**
 * Configure the variant with name [variantName] that is automatically created in the current project.
 * For example, `"jvm"` for JVM target or `"debug"` for Android build variant.
 */


public fun totalVariant ( block : Action < KoverVariantConfig > )

/**
 * Configure the variant for all the code that is available in the current project.
 * This variant always exists for any type of project.
 */


public fun instrumentation ( block : Action < KoverProjectInstrumentation > )

/**
 * Instrumentation settings for the current Gradle project.
 *
 * Instrumentation is the modification of classes when they are loaded into the JVM, which helps to determine which code was called and which was not.
 * Instrumentation changes the bytecode of the class, so it may disable some JVM optimizations, slow down performance and concurrency tests, and may also be incompatible with other instrumentation libraries.
 *
 * For this reason, it may be necessary to fine-tune the instrumentation, for example, disabling instrumentation for problematic classes. Note that such classes would be marked as uncovered because of that.
 *
 * Example:
 * ```
 * instrumentation {
 * // disable instrumentation of test tasks of all classes
 * disabledForAll = true
 *
 * // disable instrumentation of test task `test2`
 * disabledForTasks.add("test2")
 *
 * // The coverage of the test1 and test2 tasks will no longer be taken into account in the reports
 * // as well as these tasks will not be called when generating the report.
 * // These tasks will not be instrumented even if you explicitly run them
 * disabledForTestTasks.addAll("test1", "test2")
 *
 * // disable instrumentation of specified classes in test tasks
 * excludedClasses.addAll("foo.bar.*Biz", "*\$Generated")
 * }
 * ```
 */


public fun sources ( block : Action < KoverVariantSources > )

/**
 * Limit the classes that will be included in the reports.
 * These settings do not affect the instrumentation of classes.
 *
 * The settings specified here affect all reports in any projects that use the current project depending on.
 * However, these settings should be used to regulate classes specific only to the project in which this setting is specified.
 *
 * Example:
 * ```
 * sources {
 * // exclude classes compiled by Java compiler from all reports
 * excludeJava = true
 *
 * // exclude source classes of specified source sets from all reports
 * excludedSourceSets.addAll(excludedSourceSet)
 * ```
 */


public fun add ( vararg variantNames : String , optional : Boolean = false )

/**
 * Add to created variant classes, tests and instrumented classes from report variant with name [variantNames].
 * This variant is taken only from the current project.
 *
 * If [optional] is `false` and a variant with given name is not found in the current project, an error [KoverIllegalConfigException] is thrown.
 */


public fun addWithDependencies ( vararg variantNames : String , optional : Boolean = false )

/**
 * Add to created variant classes, tests and instrumented classes from report variant with name [variantNames].
 * This variant is taken from the current project and all `kover(project("name"))` dependency projects.
 *
 * If [optional] is `false` and a variant with given name is not found in the current project, an error [KoverIllegalConfigException] is thrown.
 *
 * If [optional] is `true` and a variant with given name is not found in the current project - in this case, the variant will not be searched even in dependencies.
 */


public fun add ( variantNames : Iterable < String > , optional : Boolean = false )

/**
 * Add to created variant classes, tests and instrumented classes from report variant with name [variantNames].
 * These variants are taken only from the current project.
 *
 * If [optional] is `false` and a variant with given name is not found in the current project, an error [KoverIllegalConfigException] is thrown.
 */


public fun addWithDependencies ( variantNames : Iterable < String > , optional : Boolean = false )

/**
 * Add to created variant classes, tests and instrumented classes from report variant with name [variantNames].
 * These variants are taken from the current project and all `kover(project("name"))` dependency projects.
 *
 * If [optional] is `false` and a variant with given name is not found in the current project, an error [KoverIllegalConfigException] is thrown.
 *
 * If [optional] is `true` and a variant with given name is not found in the current project - in this case, the variant will not be searched even in dependencies.
 */


public actual fun < T > lazy ( initializer : ( ) -> T ) : Lazy < T >

= SynchronizedLazyImpl ( initializer )

/**
 * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer]
 * and the default thread-safety mode [LazyThreadSafetyMode.SYNCHRONIZED].
 *
 * If the initialization of a value throws an exception, it will attempt to reinitialize the value at next access.
 *
 * Note that the returned instance uses itself to synchronize on. Do not synchronize from external code on
 * the returned instance as it may cause accidental deadlock. Also this behavior can be changed in the future.
 */


public actual fun < T > lazy ( mode : LazyThreadSafetyMode , initializer : ( ) -> T ) : Lazy < T >

= <EOL> when ( mode ) { <EOL> LazyThreadSafetyMode . SYNCHRONIZED -> SynchronizedLazyImpl ( initializer ) <EOL> LazyThreadSafetyMode . PUBLICATION -> SafePublicationLazyImpl ( initializer ) <EOL> LazyThreadSafetyMode . NONE -> UnsafeLazyImpl ( initializer ) <EOL> }

/**
 * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer]
 * and thread-safety [mode].
 *
 * If the initialization of a value throws an exception, it will attempt to reinitialize the value at next access.
 *
 * Note that when the [LazyThreadSafetyMode.SYNCHRONIZED] mode is specified the returned instance uses itself
 * to synchronize on. Do not synchronize from external code on the returned instance as it may cause accidental deadlock.
 * Also this behavior can be changed in the future.
 */


public actual fun < T > lazy ( lock : Any ? , initializer : ( ) -> T ) : Lazy < T >

= SynchronizedLazyImpl ( initializer , lock )

/**
 * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer]
 * and the default thread-safety mode [LazyThreadSafetyMode.SYNCHRONIZED].
 *
 * If the initialization of a value throws an exception, it will attempt to reinitialize the value at next access.
 *
 * The returned instance uses the specified [lock] object to synchronize on.
 * When the [lock] is not specified the instance uses itself to synchronize on,
 * in this case do not synchronize from external code on the returned instance as it may cause accidental deadlock.
 * Also this behavior can be changed in the future.
 */


private fun buildNullableArgToString ( argument : IrExpression ) : IrExpression

= <EOL> if ( argument . type . isNullable ( ) ) { <EOL> builder . irBlock { <EOL> nullableArgToStringType ( argument , context . irBuiltIns . stringType , irString ( "<STR_LIT:null>" ) ) <EOL> } <EOL> } else buildNonNullableArgToString ( argument )

/** Builds snippet of type String
 * - "if(argument==null) "null" else argument.toString()", if argument's type is nullable. Note: fortunately, all "null" string structures are unified
 * - "argument.toString()", otherwise
 * Note: should side effects are possible, temporary val is introduced
 */


private fun buildArgForAppend ( argument : IrExpression ) : IrExpression

= <EOL> if ( argument . type . isNullable ( ) ) { <EOL> builder . irBlock { <EOL> nullableArgToStringType ( argument , context . irBuiltIns . stringType . makeNullable ( ) , irNull ( ) ) <EOL> } <EOL> } else { <EOL> buildNonNullableArgToString ( argument ) <EOL> }

/** Builds snippet of type String?
 * - "if(argument==null) null else argument.toString()" (that is similar to "argument?.toString()"), if argument's type is nullable.
 * - "argument.toString()", otherwise
 * Note: should side effects are possible, temporary val is introduced
 */


private fun IrBlockBuilder . nullableArgToStringType ( argument : IrExpression , stringType : IrType , ifNull : IrExpression )

{ <EOL> val ( firstExpression , secondExpression ) = twoExpressionsForSubsequentUsages ( argument ) <EOL> + irIfThenElse ( stringType , condition = irEqeqeq ( firstExpression , irNull ( ) ) , thenPart = ifNull , elsePart = buildNonNullableArgToString ( secondExpression ) , origin = null ) <EOL> }

/** Builds snippet of type String:
 * val arg = argument
 * if (arg==null) ifNull else arg.toString()
 * In case "argument" is IrGetValue => temporary val is omitted due to side effect absence
 */


private fun buildNonNullableArgToString ( argument : IrExpression ) : IrExpression

{ <EOL> return if ( argument . type . isString ( ) || argument . type . isNullableString ( ) ) <EOL> argument <EOL> else { <EOL> val calleeOrNull = argument . type . classOrNull ? . owner ? . functions ? . singleOrNull { <EOL> it . name == OperatorNameConventions . TO_STRING && it . valueParameters . isEmpty ( ) <EOL> } ? . symbol <EOL> val callee = calleeOrNull ? : context . ir . symbols . memberToString <EOL> builder <EOL> . irCall ( callee , callee . owner . returnType , valueArgumentsCount = <NUM_LIT:0> , typeArgumentsCount = <NUM_LIT:0> ) <EOL> . apply { dispatchReceiver = argument } <EOL> } <EOL> }

/** Builds snippet of type String
 * - "argument", in case argument's type is String, since String.toString() is no-op
 * - "argument", in case argument's type is String?, due to smart-cast and no-op
 * - "argument.toString()", otherwise
 */


private fun IrBlockBuilder . twoExpressionsForSubsequentUsages ( argument : IrExpression ) : Pair < IrExpression , IrExpression >

= <EOL> if ( argument is IrGetValue ) <EOL> Pair ( argument , argument . shallowCopy ( ) ) <EOL> else <EOL> createTmpVariable ( argument ) . let { Pair ( irGet ( it ) , irGet ( it ) ) }

/**
 * This function returns two expressions based on the parameter:
 * - <original [argument] and its shallow copy>, should its second usage be idempotent and have runtime cost not greater than local val read.
 * This reduces excessive local variable usage without performance degradation.
 * - <two [IrGetValue] nodes for newly-created temporary val, initialized with original expression>, otherwise.
 */


override fun transformWhenExpression ( whenExpression : FirWhenExpression , data : Any ? ) : FirStatement

{ <EOL> processExhaustivenessCheck ( whenExpression ) <EOL> bodyResolveComponents . session . enumWhenTracker ? . reportEnumUsageInWhen ( bodyResolveComponents . file . sourceFile ? . path , getSubjectType ( bodyResolveComponents . session , whenExpression ) ) <EOL> return whenExpression <EOL> }

/**
 * The synthetic call for the whole [whenExpression] might be not completed yet
 */


@ JvmName ( "<STR_LIT>" ) <EOL> public fun < D : Dimension > MultiArray < ComplexDouble , D > . conj ( ) : MultiArray < ComplexDouble , D >

= this . map { it . conjugate ( ) }

/**
 * Transforms this [MultiArray] of [ComplexDouble] to an [NDArray] of the conjugated value.
 * Dimensions are preserved.
 *
 * @param D dimension.
 * @return [NDArray] of conjugated [ComplexDouble]
 */


@ JvmName ( "<STR_LIT>" ) <EOL> public fun < D : Dimension > MultiArray < ComplexFloat , D > . conj ( ) : MultiArray < ComplexFloat , D >

= this . map { it . conjugate ( ) }

/**
 * Transforms this [MultiArray] of [ComplexFloat] to an [NDArray] of the conjugated value.
 * Dimensions are preserved.
 *
 * @param D dimension.
 * @return [NDArray] of conjugated [ComplexFloat]
 */


@ kotlin . internal . InlineOnly <EOL> public actual inline fun < T > Collection < T > . toTypedArray ( ) : Array < T >

= copyToArray ( this )

/**
 * Returns a *typed* array containing all the elements of this collection.
 *
 * Allocates an array of runtime type `T` having its size equal to the size of this collection
 * and populates the array with the elements of this collection.
 * @sample samples.collections.Collections.Collections.collectionToTypedArray
 */


public fun convert ( activationType : Activations ) : Activation

{ <EOL> return when ( activationType ) { <EOL> Sigmoid -> SigmoidActivation ( ) <EOL> Linear -> LinearActivation ( ) <EOL> Tanh -> TanhActivation ( ) <EOL> TanhShrink -> TanhShrinkActivation ( ) <EOL> Relu -> ReluActivation ( ) <EOL> Relu6 -> Relu6Activation ( ) <EOL> Elu -> EluActivation ( ) <EOL> Selu -> SeluActivation ( ) <EOL> Softmax -> SoftmaxActivation ( ) <EOL> LogSoftmax -> LogSoftmaxActivation ( ) <EOL> Exponential -> ExponentialActivation ( ) <EOL> SoftPlus -> SoftPlusActivation ( ) <EOL> SoftSign -> SoftSignActivation ( ) <EOL> HardSigmoid -> HardSigmoidActivation ( ) <EOL> Swish -> SwishActivation ( ) <EOL> Mish -> MishActivation ( ) <EOL> HardShrink -> HardShrinkActivation ( ) <EOL> SoftShrink -> SoftShrinkActivation ( ) <EOL> LiSHT -> LishtActivation ( ) <EOL> Snake -> SnakeActivation ( ) <EOL> Gelu -> GeluActivation ( ) <EOL> Sparsemax -> SparsemaxActivation ( ) <EOL> } <EOL> }

/**
 * Converts [activationType] to the appropriate [Activation] subclass.
 */


public actual fun append ( value : Char ) : Appendable

/**
 * Appends the specified character [value] to this Appendable and returns this instance.
 *
 * @param value the character to append.
 */


public actual fun append ( value : CharSequence ? ) : Appendable

/**
 * Appends the specified character sequence [value] to this Appendable and returns this instance.
 *
 * @param value the character sequence to append. If [value] is `null`, then the four characters `"null"` are appended to this Appendable.
 */


public actual fun append ( value : CharSequence ? , startIndex : Int , endIndex : Int ) : Appendable

/**
 * Appends a subsequence of the specified character sequence [value] to this Appendable and returns this instance.
 *
 * @param value the character sequence from which a subsequence is appended. If [value] is `null`,
 * then characters are appended as if [value] contained the four characters `"null"`.
 * @param startIndex the beginning (inclusive) of the subsequence to append.
 * @param endIndex the end (exclusive) of the subsequence to append.
 *
 * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.
 */


fun register ( source : String , destination : String , configure : DokkaTemplateProjectSpec . ( ) -> Unit = { } , )

{ <EOL> val name = source . toAlphaNumericCamelCase ( ) <EOL> templateProjects . register ( name ) { <EOL> this . sourcePath . set ( source ) <EOL> this . destinationPath . set ( destination ) <EOL> configure ( ) <EOL> } <EOL> }

/**
 * Copy a directory from the Dokka source project into a local directory.
 *
 * @param[source] Source dir, relative to [templateProjectsDir]
 * @param[destination] Destination dir, relative to [destinationBaseDir]
 */


private fun Project . copyCInteropFileForIdeIfNecessary ( file : File ) : File

{ <EOL> if ( ! file . exists ( ) ) return file <EOL> val newFileName = "<STR_LIT>" <EOL> val outputFile = kotlinCInteropLibraryDirectoryForIde . resolve ( newFileName ) <EOL> if ( ! outputFile . exists ( ) ) { <EOL> file . copyTo ( outputFile ) <EOL> } <EOL> return outputFile <EOL> }

/**
 * Copies the file into a directory specifically for the IDE, so it survives ./gradlew clean
 */