@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ByteArray . decodeToString ( ) : String

{ <EOL> return String ( this ) <EOL> }

/**
 * Decodes a string from the bytes in UTF-8 encoding in this array.
 *
 * Malformed byte sequences are replaced by the replacement char `\uFFFD`.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ByteArray . decodeToString ( startIndex : Int = <NUM_LIT:0> , endIndex : Int = this . size , throwOnInvalidSequence : Boolean = false ) : String

{ <EOL> AbstractList . checkBoundsIndexes ( startIndex , endIndex , this . size ) <EOL> if ( ! throwOnInvalidSequence ) { <EOL> return String ( this , startIndex , endIndex - startIndex ) <EOL> } <EOL> val decoder = Charsets . UTF_8 . newDecoder ( ) <EOL> . onMalformedInput ( CodingErrorAction . REPORT ) <EOL> . onUnmappableCharacter ( CodingErrorAction . REPORT ) <EOL> return decoder . decode ( ByteBuffer . wrap ( this , startIndex , endIndex - startIndex ) ) . toString ( ) <EOL> }

/**
 * Decodes a string from the bytes in UTF-8 encoding in this array or its subrange.
 *
 * @param startIndex the beginning (inclusive) of the subrange to decode, 0 by default.
 * @param endIndex the end (exclusive) of the subrange to decode, size of this array by default.
 * @param throwOnInvalidSequence specifies whether to throw an exception on malformed byte sequence or replace it by the replacement char `\uFFFD`.
 *
 * @throws IndexOutOfBoundsException if [startIndex] is less than zero or [endIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [startIndex] is greater than [endIndex].
 * @throws CharacterCodingException if the byte array contains malformed UTF-8 byte sequence and [throwOnInvalidSequence] is true.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun String . encodeToByteArray ( ) : ByteArray

{ <EOL> return this . toByteArray ( Charsets . UTF_8 ) <EOL> }

/**
 * Encodes this string to an array of bytes in UTF-8 encoding.
 *
 * Any malformed char sequence is replaced by the replacement byte sequence.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun String . encodeToByteArray ( startIndex : Int = <NUM_LIT:0> , endIndex : Int = this . length , throwOnInvalidSequence : Boolean = false ) : ByteArray

{ <EOL> AbstractList . checkBoundsIndexes ( startIndex , endIndex , length ) <EOL> if ( ! throwOnInvalidSequence ) { <EOL> return this . substring ( startIndex , endIndex ) . toByteArray ( Charsets . UTF_8 ) <EOL> } <EOL> val encoder = Charsets . UTF_8 . newEncoder ( ) <EOL> . onMalformedInput ( CodingErrorAction . REPORT ) <EOL> . onUnmappableCharacter ( CodingErrorAction . REPORT ) <EOL> val byteBuffer = encoder . encode ( CharBuffer . wrap ( this , startIndex , endIndex ) ) <EOL> return if ( byteBuffer . hasArray ( ) && byteBuffer . arrayOffset ( ) == <NUM_LIT:0> && byteBuffer . remaining ( ) == byteBuffer . array ( ) ! ! . size ) { <EOL> byteBuffer . array ( ) <EOL> } else { <EOL> ByteArray ( byteBuffer . remaining ( ) ) . also { byteBuffer . get ( it ) } <EOL> } <EOL> }

/**
 * Encodes this string or its substring to an array of bytes in UTF-8 encoding.
 *
 * @param startIndex the beginning (inclusive) of the substring to encode, 0 by default.
 * @param endIndex the end (exclusive) of the substring to encode, length of this string by default.
 * @param throwOnInvalidSequence specifies whether to throw an exception on malformed char sequence or replace.
 *
 * @throws IndexOutOfBoundsException if [startIndex] is less than zero or [endIndex] is greater than the length of this string.
 * @throws IllegalArgumentException if [startIndex] is greater than [endIndex].
 * @throws CharacterCodingException if this string contains malformed char sequence and [throwOnInvalidSequence] is true.
 */


@ kotlin . internal . InlineOnly <EOL> public actual inline fun String . toCharArray ( ) : CharArray

= ( this as java . lang . String ) . toCharArray ( )

/**
 * Returns a [CharArray] containing characters of this string.
 */


@ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public actual inline fun String . toCharArray ( destination : CharArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = length ) : CharArray

{ <EOL> ( this as java . lang . String ) . getChars ( startIndex , endIndex , destination , destinationOffset ) <EOL> return destination <EOL> }

/**
 * Copies characters from this string into the [destination] character array and returns that array.
 *
 * @param destination the array to copy to.
 * @param destinationOffset the position in the array to copy to.
 * @param startIndex the start offset (inclusive) of the substring to copy.
 * @param endIndex the end offset (exclusive) of the substring to copy.
 *
 * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this string builder indices or when `startIndex > endIndex`.
 * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],
 * or when that index is out of the [destination] array indices range.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . format ( vararg args : Any ? ) : String

= java . lang . String . format ( this , * args )

/**
 * Uses this string as a format string and returns a string obtained
 * by substituting format specifiers in the format string with the provided arguments,
 * using the default locale.
 *
 * See [java.util.Formatter] class documentation
 * for the syntax of format specifiers for the format string.
 *
 * @sample samples.text.Strings.formatExtension
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . Companion . format ( format : String , vararg args : Any ? ) : String

= java . lang . String . format ( format , * args )

/**
 * Uses the provided [format] as a format string and returns a string obtained
 * by substituting format specifiers in the format string with the provided arguments,
 * using the default locale.
 *
 * See [java.util.Formatter] class documentation
 * for the syntax of format specifiers for the format string.
 *
 * @sample samples.text.Strings.formatStatic
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun String . format ( locale : Locale ? , vararg args : Any ? ) : String

= java . lang . String . format ( locale , this , * args )

/**
 * Uses this string as a format string and returns a string obtained
 * by substituting format specifiers in the format string with the provided arguments,
 * using the specified locale. If [locale] is `null` then no localization is applied.
 *
 * See [java.util.Formatter] class documentation
 * for the syntax of format specifiers for the format string.
 *
 * @sample samples.text.Strings.formatWithLocaleExtension
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun String . Companion . format ( locale : Locale ? , format : String , vararg args : Any ? ) : String

= <EOL> java . lang . String . format ( locale , format , * args )

/**
 * Uses the provided [format] as a format string and returns a string obtained
 * by substituting format specifiers in the format string with the provided arguments,
 * using the specified locale. If [locale] is `null` then no localization is applied.
 *
 * See [java.util.Formatter] class documentation
 * for the syntax of format specifiers for the format string.
 *
 * @sample samples.text.Strings.formatWithLocaleStatic
 */


public fun CharSequence . split ( regex : Pattern , limit : Int = <NUM_LIT:0> ) : List < String >

{ <EOL> requireNonNegativeLimit ( limit ) <EOL> return regex . split ( this , if ( limit == <NUM_LIT:0> ) - <NUM_LIT:1> else limit ) . asList ( ) <EOL> }

/**
 * Splits this char sequence around matches of the given regular expression.
 *
 * This function has two notable differences from the method [Pattern.split]:
 * - the function returns the result as a `List<String>` rather than an `Array<String>`;
 * - when the [limit] is not specified or specified as 0,
 * this function doesn't drop trailing empty strings from the result.

 * @param limit Non-negative value specifying the maximum number of substrings to return.
 * Zero by default means no limit is set.
 */


@ kotlin . internal . InlineOnly <EOL> public actual inline fun String . substring ( startIndex : Int ) : String

= ( this as java . lang . String ) . substring ( startIndex )

/**
 * Returns a substring of this string that starts at the specified [startIndex] and continues to the end of the string.
 */


@ kotlin . internal . InlineOnly <EOL> public actual inline fun String . substring ( startIndex : Int , endIndex : Int ) : String

= ( this as java . lang . String ) . substring ( startIndex , endIndex )

/**
 * Returns the substring of this string starting at the [startIndex] and ending right before the [endIndex].
 *
 * @param startIndex the start index (inclusive).
 * @param endIndex the end index (exclusive).
 */


@ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun String . startsWith ( prefix : String , ignoreCase : Boolean = false ) : Boolean

{ <EOL> if ( ! ignoreCase ) <EOL> return ( this as java . lang . String ) . startsWith ( prefix ) <EOL> else <EOL> return regionMatches ( <NUM_LIT:0> , prefix , <NUM_LIT:0> , prefix . length , ignoreCase ) <EOL> }

/**
 * Returns `true` if this string starts with the specified prefix.
 */


@ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun String . startsWith ( prefix : String , startIndex : Int , ignoreCase : Boolean = false ) : Boolean

{ <EOL> if ( ! ignoreCase ) <EOL> return ( this as java . lang . String ) . startsWith ( prefix , startIndex ) <EOL> else <EOL> return regionMatches ( startIndex , prefix , <NUM_LIT:0> , prefix . length , ignoreCase ) <EOL> }

/**
 * Returns `true` if a substring of this string starting at the specified offset [startIndex] starts with the specified prefix.
 */


@ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun String . endsWith ( suffix : String , ignoreCase : Boolean = false ) : Boolean

{ <EOL> if ( ! ignoreCase ) <EOL> return ( this as java . lang . String ) . endsWith ( suffix ) <EOL> else <EOL> return regionMatches ( length - suffix . length , suffix , <NUM_LIT:0> , suffix . length , ignoreCase = true ) <EOL> }

/**
 * Returns `true` if this string ends with the specified suffix.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String ( bytes : ByteArray , offset : Int , length : Int , charset : Charset ) : String

= <EOL> java . lang . String ( bytes , offset , length , charset ) as String

/**
 * Converts the data from a portion of the specified array of bytes to characters using the specified character set
 * and returns the conversion result as a string.
 *
 * @param bytes the source array for the conversion.
 * @param offset the offset in the array of the data to be converted.
 * @param length the number of bytes to be converted.
 * @param charset the character set to use.
 */


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

= java . lang . String ( bytes , charset ) as String

/**
 * Converts the data from the specified array of bytes to characters using the specified character set
 * and returns the conversion result as a string.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String ( bytes : ByteArray , offset : Int , length : Int ) : String

= <EOL> java . lang . String ( bytes , offset , length , Charsets . UTF_8 ) as String

/**
 * Converts the data from a portion of the specified array of bytes to characters using the UTF-8 character set
 * and returns the conversion result as a string.
 *
 * @param bytes the source array for the conversion.
 * @param offset the offset in the array of the data to be converted.
 * @param length the number of bytes to be converted.
 */


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

= <EOL> java . lang . String ( bytes , Charsets . UTF_8 ) as String

/**
 * Converts the data from the specified array of bytes to characters using the UTF-8 character set
 * and returns the conversion result as a string.
 */


@ kotlin . internal . InlineOnly <EOL> public actual inline fun String ( chars : CharArray ) : String

= <EOL> java . lang . String ( chars ) as String

/**
 * Converts the characters in the specified array to a string.
 */


@ kotlin . internal . InlineOnly <EOL> public actual inline fun String ( chars : CharArray , offset : Int , length : Int ) : String

= <EOL> java . lang . String ( chars , offset , length ) as String

/**
 * Converts the characters from a portion of the specified array to a string.
 *
 * @throws IndexOutOfBoundsException if either [offset] or [length] are less than zero
 * or `offset + length` is out of [chars] array bounds.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String ( codePoints : IntArray , offset : Int , length : Int ) : String

= <EOL> java . lang . String ( codePoints , offset , length ) as String

/**
 * Converts the code points from a portion of the specified Unicode code point array to a string.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String ( stringBuffer : java . lang . StringBuffer ) : String

= <EOL> java . lang . String ( stringBuffer ) as String

/**
 * Converts the contents of the specified StringBuffer to a string.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String ( stringBuilder : java . lang . StringBuilder ) : String

= <EOL> java . lang . String ( stringBuilder ) as String

/**
 * Converts the contents of the specified StringBuilder to a string.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . codePointAt ( index : Int ) : Int

= ( this as java . lang . String ) . codePointAt ( index )

/**
 * Returns the character (Unicode code point) at the specified index.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . codePointBefore ( index : Int ) : Int

= ( this as java . lang . String ) . codePointBefore ( index )

/**
 * Returns the character (Unicode code point) before the specified index.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . codePointCount ( beginIndex : Int , endIndex : Int ) : Int

= <EOL> ( this as java . lang . String ) . codePointCount ( beginIndex , endIndex )

/**
 * Returns the number of Unicode code points in the specified text range of this String.
 */


@ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun String . compareTo ( other : String , ignoreCase : Boolean = false ) : Int

{ <EOL> if ( ignoreCase ) <EOL> return ( this as java . lang . String ) . compareToIgnoreCase ( other ) <EOL> else <EOL> return ( this as java . lang . String ) . compareTo ( other ) <EOL> }

/**
 * Compares two strings lexicographically, optionally ignoring case differences.
 *
 * If [ignoreCase] is true, the result of `Char.uppercaseChar().lowercaseChar()` on each character is compared.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . contentEquals ( charSequence : CharSequence ) : Boolean

= ( this as java . lang . String ) . contentEquals ( charSequence )

/**
 * Returns `true` if this string is equal to the contents of the specified [CharSequence], `false` otherwise.
 *
 * Note that if the [CharSequence] argument is a [StringBuffer] then the comparison may be performed in a synchronized block
 * that acquires that [StringBuffer]'s monitor.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . contentEquals ( stringBuilder : StringBuffer ) : Boolean

= ( this as java . lang . String ) . contentEquals ( stringBuilder )

/**
 * Returns `true` if this string is equal to the contents of the specified [StringBuffer], `false` otherwise.
 *
 * This function compares this string and the specified [StringBuffer] in a synchronized block
 * that acquires that [StringBuffer]'s monitor.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> public actual infix fun CharSequence ? . contentEquals ( other : CharSequence ? ) : Boolean

{ <EOL> return if ( this is String && other != null ) <EOL> contentEquals ( other ) <EOL> else <EOL> contentEqualsImpl ( other ) <EOL> }

/**
 * Returns `true` if the contents of this char sequence are equal to the contents of the specified [other],
 * i.e. both char sequences contain the same number of the same characters in the same order.
 *
 * If this [CharSequence] is a [String] and [other] is not `null`
 * then this function behaves the same as [String.contentEquals].
 *
 * @sample samples.text.Strings.contentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> public actual fun CharSequence ? . contentEquals ( other : CharSequence ? , ignoreCase : Boolean ) : Boolean

{ <EOL> return if ( ignoreCase ) <EOL> contentEqualsIgnoreCaseImpl ( other ) <EOL> else <EOL> contentEquals ( other ) <EOL> }

/**
 * Returns `true` if the contents of this char sequence are equal to the contents of the specified [other], optionally ignoring case difference.
 *
 * If this [CharSequence] is a [String], [other] is not `null` and [ignoreCase] is `false`
 * then this function behaves the same as [String.contentEquals].
 *
 * @param ignoreCase `true` to ignore character case when comparing contents.
 *
 * @sample samples.text.Strings.contentEquals
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . intern ( ) : String

= ( this as java . lang . String ) . intern ( )

/**
 * Returns a canonical representation for this string object.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . offsetByCodePoints ( index : Int , codePointOffset : Int ) : Int

= <EOL> ( this as java . lang . String ) . offsetByCodePoints ( index , codePointOffset )

/**
 * Returns the index within this string that is offset from the given [index] by [codePointOffset] code points.
 */


@ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun CharSequence . regionMatches ( thisOffset : Int , other : CharSequence , otherOffset : Int , length : Int , ignoreCase : Boolean = false ) : Boolean

{ <EOL> if ( this is String && other is String ) <EOL> return this . regionMatches ( thisOffset , other , otherOffset , length , ignoreCase ) <EOL> else <EOL> return regionMatchesImpl ( thisOffset , other , otherOffset , length , ignoreCase ) <EOL> }

/**
 * Returns `true` if the specified range in this char sequence is equal to the specified range in another char sequence.
 * @param thisOffset the start offset in this char sequence of the substring to compare.
 * @param other the string against a substring of which the comparison is performed.
 * @param otherOffset the start offset in the other char sequence of the substring to compare.
 * @param length the length of the substring to compare.
 */


@ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun String . regionMatches ( thisOffset : Int , other : String , otherOffset : Int , length : Int , ignoreCase : Boolean = false ) : Boolean

= <EOL> if ( ! ignoreCase ) <EOL> ( this as java . lang . String ) . regionMatches ( thisOffset , other , otherOffset , length ) <EOL> else <EOL> ( this as java . lang . String ) . regionMatches ( ignoreCase , thisOffset , other , otherOffset , length )

/**
 * Returns `true` if the specified range in this string is equal to the specified range in another string.
 * @param thisOffset the start offset in this string of the substring to compare.
 * @param other the string against a substring of which the comparison is performed.
 * @param otherOffset the start offset in the other string of the substring to compare.
 * @param length the length of the substring to compare.
 */


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.5>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun String . toLowerCase ( locale : java . util . Locale ) : String

= lowercase ( locale )

/**
 * Returns a copy of this string converted to lower case using the rules of the specified locale.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun String . lowercase ( locale : Locale ) : String

= ( this as java . lang . String ) . toLowerCase ( locale )

/**
 * Returns a copy of this string converted to lower case using the rules of the specified [locale].
 *
 * This function supports one-to-many and many-to-one character mapping,
 * thus the length of the returned string can be different from the length of the original string.
 *
 * @sample samples.text.Strings.lowercaseLocale
 */


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.5>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun String . toUpperCase ( locale : java . util . Locale ) : String

= uppercase ( locale )

/**
 * Returns a copy of this string converted to upper case using the rules of the specified locale.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun String . uppercase ( locale : Locale ) : String

= ( this as java . lang . String ) . toUpperCase ( locale )

/**
 * Returns a copy of this string converted to upper case using the rules of the specified [locale].
 *
 * This function supports one-to-many and many-to-one character mapping,
 * thus the length of the returned string can be different from the length of the original string.
 *
 * @sample samples.text.Strings.uppercaseLocale
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . toByteArray ( charset : Charset = Charsets . UTF_8 ) : ByteArray

= ( this as java . lang . String ) . getBytes ( charset )

/**
 * Encodes the contents of this string using the specified character set and returns the resulting byte array.
 * @sample samples.text.Strings.stringToByteArray
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun String . toPattern ( flags : Int = <NUM_LIT:0> ) : java . util . regex . Pattern

{ <EOL> return java . util . regex . Pattern . compile ( this , flags ) <EOL> }

/**
 * Converts the string into a regular expression [Pattern] optionally
 * with the specified [flags] from [Pattern] or'd together
 * so that strings can be split or matched on.
 */


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.5>" ) <EOL> public actual fun String . capitalize ( ) : String

{ <EOL> @ Suppress ( "<STR_LIT:DEPRECATION>" ) <EOL> return capitalize ( Locale . getDefault ( ) ) <EOL> }

/**
 * Returns a copy of this string having its first letter titlecased using the rules of the default locale,
 * or the original string if it's empty or already starts with a title case letter.
 *
 * The title case of a character is usually the same as its upper case with several exceptions.
 * The particular list of characters with the special title case form depends on the underlying platform.
 *
 * @sample samples.text.Strings.capitalize
 */


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.5>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public fun String . capitalize ( locale : Locale ) : String

{ <EOL> if ( isNotEmpty ( ) ) { <EOL> val firstChar = this [ <NUM_LIT:0> ] <EOL> if ( firstChar . isLowerCase ( ) ) { <EOL> return buildString { <EOL> val titleChar = firstChar . titlecaseChar ( ) <EOL> if ( titleChar != firstChar . uppercaseChar ( ) ) { <EOL> append ( titleChar ) <EOL> } else { <EOL> append ( this @ capitalize . substring ( <NUM_LIT:0> , <NUM_LIT:1> ) . uppercase ( locale ) ) <EOL> } <EOL> append ( this @ capitalize . substring ( <NUM_LIT:1> ) ) <EOL> } <EOL> } <EOL> } <EOL> return this <EOL> }

/**
 * Returns a copy of this string having its first letter titlecased using the rules of the specified [locale],
 * or the original string if it's empty or already starts with a title case letter.
 *
 * The title case of a character is usually the same as its upper case with several exceptions.
 * The particular list of characters with the special title case form depends on the underlying platform.
 */


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.5>" ) <EOL> public actual fun String . decapitalize ( ) : String

{ <EOL> @ Suppress ( "<STR_LIT:DEPRECATION>" ) <EOL> return if ( isNotEmpty ( ) && ! this [ <NUM_LIT:0> ] . isLowerCase ( ) ) substring ( <NUM_LIT:0> , <NUM_LIT:1> ) . toLowerCase ( ) + substring ( <NUM_LIT:1> ) else this <EOL> }

/**
 * Returns a copy of this string having its first letter lowercased using the rules of the default locale,
 * or the original string if it's empty or already starts with a lower case letter.
 *
 * @sample samples.text.Strings.decapitalize
 */


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.5>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public fun String . decapitalize ( locale : Locale ) : String

{ <EOL> return if ( isNotEmpty ( ) && ! this [ <NUM_LIT:0> ] . isLowerCase ( ) ) substring ( <NUM_LIT:0> , <NUM_LIT:1> ) . lowercase ( locale ) + substring ( <NUM_LIT:1> ) else this <EOL> }

/**
 * Returns a copy of this string having its first letter lowercased using the rules of the specified [locale],
 * or the original string, if it's empty or already starts with a lower case letter.
 */


public actual fun CharSequence . repeat ( n : Int ) : String

{ <EOL> require ( n >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return when ( n ) { <EOL> <NUM_LIT:0> -> "<STR_LIT>" <EOL> <NUM_LIT:1> -> this . toString ( ) <EOL> else -> { <EOL> when ( length ) { <EOL> <NUM_LIT:0> -> "<STR_LIT>" <EOL> <NUM_LIT:1> -> this [ <NUM_LIT:0> ] . let { char -> String ( CharArray ( n ) { char } ) } <EOL> else -> { <EOL> val sb = StringBuilder ( n * length ) <EOL> for ( i in <NUM_LIT:1> .. n ) { <EOL> sb . append ( this ) <EOL> } <EOL> sb . toString ( ) <EOL> } <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * Returns a string containing this char sequence repeated [n] times.
 * @throws [IllegalArgumentException] when n < 0.
 * @sample samples.text.Strings.repeat
 */


@ InternalCoroutinesApi <EOL> public expect inline fun < T > synchronizedImpl ( lock : SynchronizedObject , block : ( ) -> T ) : T

/**
 * @suppress **This an internal API and should not be used from general code.**
 */


@ OptIn ( ExperimentalContracts :: class ) <EOL> @ InternalCoroutinesApi <EOL> public inline fun < T > synchronized ( lock : SynchronizedObject , block : ( ) -> T ) : T

{ <EOL> contract { <EOL> callsInPlace ( block , InvocationKind . EXACTLY_ONCE ) <EOL> } <EOL> return synchronizedImpl ( lock , block ) <EOL> }


fun Path . modify ( transform : ( currentContent : String ) -> String )

{ <EOL> assert ( Files . isRegularFile ( this ) ) { "<STR_LIT>" } <EOL> val file = toFile ( ) <EOL> file . writeText ( transform ( file . readText ( ) ) ) <EOL> }

/**
 * Modify file content under [Path].
 *
 * @param transform function receiving current file content and outputting new file content
 */


fun Path . append ( textToAppend : String )

{ <EOL> modify { <EOL> """<STR_LIT>""" . trimIndent ( ) <EOL> } <EOL> }

/**
 * Append [textToAppend] to the file content under [Path].
 */


{ <EOL> runImageRecognitionPrediction ( modelType = TFModels . CV . Inception ( ) ) <EOL> }

/**
 * This example demonstrates the inference concept on InceptionV3 model:
 * - Model configuration, model weights and labels are obtained from [TFModelHub].
 * - Weights are loaded from .h5 file, configuration is loaded from .json file.
 * - Model predicts on a few images located in resources.
 * - Special preprocessing (used in InceptionV3 during training on ImageNet dataset) is applied to the images before prediction.
 *
 * NOTE: Input resolution is 299*299
 */


= inceptionV3Prediction ( )


internal fun < T > ProviderFactory . changing ( code : ( ) -> T ) : Provider < T >

{ <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> val adhocValueSourceClass = AdhocValueSource :: class . java as Class < AdhocValueSource < T > > <EOL> return of ( adhocValueSourceClass ) { valueSourceSpec -> <EOL> valueSourceSpec . parameters { <EOL> it . producingLambda . set ( code ) <EOL> } <EOL> } <EOL> }

/**
 * Changing Provider will be evaluated every time it accessed.
 *
 * And its producing [code] will be serilalised to Configuration Cache as is
 * So that it still will be evaluated during Task Execution phase.
 * It is very convenient for Configuration Cache compatibility.
 *
 * It is recommended to use Task Output's and map/flatMap them to other Task Inputs but in cases when TaskOutput's is not available
 * as Gradle's Properties or Providers then this [changing] provider can be used.
 *
 * name `changing` and overall concept is borrowed from Gradle internal API [org.gradle.api.internal.provider.Providers.changing]
 *
 * @see org.gradle.api.internal.provider.ChangingProvider
 */


public fun onModification ( )

/**
 * [onModification] is invoked in a write action before or after global source module state modification.
 *
 * The module structure and source code of all source [KtModule]s in the project should be considered modified when this event is
 * received. This includes source files being moved or removed, and source modules possibly being removed. Thus, all caches related to
 * source module structure and source code should be invalidated.
 *
 * Library modules (including library sources) do not need to be considered modified, so any caches related to library modules and their
 * contents may be kept.
 *
 * @see KotlinTopics
 */


= first > last

/**
 * Checks whether the range is empty.
 *
 * The range is empty if its start value is greater than the end value.
 */


= first > last


public abstract fun preprocessing ( channelsLast : Boolean = true ) : Operation < FloatData , FloatData >

/**
 * Returns preprocessing [Operation] corresponding to this preprocessing type.
 * @param [channelsLast] reflects whether channel dimension is the first or the last.
 */


public fun calculateClasspathSnapshot ( classpathEntry : File , granularity : ClassSnapshotGranularity ) : ClasspathEntrySnapshot

/**
 * Calculates JVM classpath snapshot for [classpathEntry] used for detecting changes in incremental compilation with specified [granularity].
 *
 * The [ClassSnapshotGranularity.CLASS_LEVEL] granularity should be preferred for rarely changing dependencies as more lightweight in terms of the resulting snapshot size.
 *
 * @param classpathEntry path to existent classpath entry
 * @param granularity determines granularity of tracking.
 */


public fun makeCompilerExecutionStrategyConfiguration ( ) : CompilerExecutionStrategyConfiguration

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


public fun makeJvmCompilationConfiguration ( ) : JvmCompilationConfiguration


public fun compileJvm ( projectId : ProjectId , strategyConfig : CompilerExecutionStrategyConfiguration , compilationConfig : JvmCompilationConfiguration , sources : List < File > , arguments : List < String > , ) : CompilationResult

/**
 * Compiles Kotlin code targeting JVM platform and using specified options.
 *
 * The [finishProjectCompilation] must be called with the same [projectId] after the entire project is compiled.
 * @param projectId The unique identifier of the project to be compiled. It may be the same for different modules of the project.
 * @param strategyConfig an instance of [CompilerExecutionStrategyConfiguration] initially obtained from [makeCompilerExecutionStrategyConfiguration]
 * @param compilationConfig an instance of [JvmCompilationConfiguration] initially obtained from [makeJvmCompilationConfiguration]
 * @param sources a list of all sources of the compilation unit
 * @param arguments a list of Kotlin JVM compiler arguments
 */


public fun finishProjectCompilation ( projectId : ProjectId )

/**
 * A finalization function that must be called when all the modules of the project are compiled.
 *
 * May perform cache clean-ups and resource freeing.
 *
 * @param projectId The unique identifier of the compiled project.
 */


public fun getCustomKotlinScriptFilenameExtensions ( classpath : List < File > ) : Collection < String >

/**
 * Retrieves the custom Kotlin script filename extensions based on script definitions from the specified classpath.
 *
 * @param classpath The list of files representing the classpath.
 * @return A collection of strings representing the custom Kotlin script filename extensions.
 */


public fun getCompilerVersion ( ) : String

/**
 * Returns the version of the Kotlin compiler used to run compilation.
 *
 * @return A string representing the version of the Kotlin compiler, for example `2.0.0-Beta4`.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun maxOf ( a : UInt , b : UInt ) : UInt

{ <EOL> return if ( a >= b ) a else b <EOL> }

/**
 * Returns the greater of two values.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun maxOf ( a : ULong , b : ULong ) : ULong


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun maxOf ( a : UByte , b : UByte ) : UByte


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun maxOf ( a : UShort , b : UShort ) : UShort


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun maxOf ( a : UInt , b : UInt , c : UInt ) : UInt

{ <EOL> return maxOf ( a , maxOf ( b , c ) ) <EOL> }

/**
 * Returns the greater of three values.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun maxOf ( a : ULong , b : ULong , c : ULong ) : ULong


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun maxOf ( a : UByte , b : UByte , c : UByte ) : UByte


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun maxOf ( a : UShort , b : UShort , c : UShort ) : UShort


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> public fun maxOf ( a : UInt , vararg other : UInt ) : UInt

{ <EOL> var max = a <EOL> for ( e in other ) max = maxOf ( max , e ) <EOL> return max <EOL> }

/**
 * Returns the greater of the given values.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> public fun maxOf ( a : ULong , vararg other : ULong ) : ULong


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> public fun maxOf ( a : UByte , vararg other : UByte ) : UByte


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> public fun maxOf ( a : UShort , vararg other : UShort ) : UShort


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun minOf ( a : UInt , b : UInt ) : UInt

{ <EOL> return if ( a <= b ) a else b <EOL> }

/**
 * Returns the smaller of two values.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun minOf ( a : ULong , b : ULong ) : ULong


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun minOf ( a : UByte , b : UByte ) : UByte


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun minOf ( a : UShort , b : UShort ) : UShort


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun minOf ( a : UInt , b : UInt , c : UInt ) : UInt

{ <EOL> return minOf ( a , minOf ( b , c ) ) <EOL> }

/**
 * Returns the smaller of three values.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun minOf ( a : ULong , b : ULong , c : ULong ) : ULong


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun minOf ( a : UByte , b : UByte , c : UByte ) : UByte


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun minOf ( a : UShort , b : UShort , c : UShort ) : UShort


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> public fun minOf ( a : UInt , vararg other : UInt ) : UInt

{ <EOL> var min = a <EOL> for ( e in other ) min = minOf ( min , e ) <EOL> return min <EOL> }

/**
 * Returns the smaller of the given values.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> public fun minOf ( a : ULong , vararg other : ULong ) : ULong


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> public fun minOf ( a : UByte , vararg other : UByte ) : UByte


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> public fun minOf ( a : UShort , vararg other : UShort ) : UShort


actual override suspend fun emit ( value : T )

{ <EOL> return suspendCoroutineUninterceptedOrReturn sc @ { uCont -> <EOL> try { <EOL> emit ( uCont , value ) <EOL> } catch ( e : Throwable ) { <EOL> lastEmissionContext = DownstreamExceptionContext ( e , uCont . context ) <EOL> throw e <EOL> } <EOL> } <EOL> }

/**
 * This is a crafty implementation of state-machine reusing.
 *
 * First it checks that it is not used concurrently (which we explicitly prohibit), and
 * then just caches an instance of the completion_ in order to avoid extra allocation on each emit,
 * making it effectively garbage-free on its hot-path.
 *
 * See `emit` overload.
 */


private fun emit ( uCont : Continuation < Unit > , value : T ) : Any ?

{ <EOL> val currentContext = uCont . context <EOL> currentContext . ensureActive ( ) <EOL> val previousContext = lastEmissionContext <EOL> if ( previousContext !== currentContext ) { <EOL> checkContext ( currentContext , previousContext , value ) <EOL> lastEmissionContext = currentContext <EOL> } <EOL> completion_ = uCont <EOL> val result = emitFun ( collector as FlowCollector < Any ? > , value , this as Continuation < Unit > ) <EOL> if ( result != COROUTINE_SUSPENDED ) { <EOL> completion_ = null <EOL> } <EOL> return result <EOL> }

/**
 * Here we use the following trick:
 * - Perform all the required checks
 * - Having a non-intercepted, non-cancellable caller's `uCont`, we leverage our implementation knowledge
 * and invoke `collector.emit(T)` as `collector.emit(value: T, completion: Continuation), passing `this`
 * as the completion. We also setup `this` state, so if the `completion.resume` is invoked, we are
 * invoking `uCont.resume` properly in accordance with `ContinuationImpl`/`BaseContinuationImpl` internal invariants.
 *
 * Note that in such scenarios, `collector.emit` completion is the current instance of SafeCollector and thus is reused.
 */


fun BuildResult . extractProjectsAndTheirDiagnostics ( ) : String

= buildString { <EOL> var diagnosticStarted = false <EOL> var stacktraceStarted = false <EOL> val currentDiagnostic = mutableListOf < String > ( ) <EOL> fun startDiagnostic ( line : String , lineIndex : Int ) { <EOL> require ( ! diagnosticStarted ) { <EOL> printBuildOutput ( ) <EOL> "<STR_LIT>" <EOL> } <EOL> currentDiagnostic += line <EOL> diagnosticStarted = true <EOL> } <EOL> fun continueDiagnostic ( line : String ) { <EOL> when { <EOL> line == KOTLIN_DIAGNOSTIC_STACKTRACE_START -> { <EOL> stacktraceStarted = true <EOL> currentDiagnostic += line <EOL> currentDiagnostic += DIAGNOSTIC_STACKTRACE_REPLACEMENT_STUB <EOL> } <EOL> line == KOTLIN_DIAGNOSTIC_STACKTRACE_END_SEPARATOR -> { <EOL> stacktraceStarted = false <EOL> } <EOL> stacktraceStarted -> return <EOL> else -> currentDiagnostic += line <EOL> } <EOL> } <EOL> fun endDiagnostic ( line : String , lineIndex : Int ) { <EOL> require ( diagnosticStarted ) { <EOL> printBuildOutput ( ) <EOL> "<STR_LIT>" <EOL> } <EOL> currentDiagnostic += line <EOL> if ( KotlinToolingDiagnostics . InternalKotlinGradlePluginPropertiesUsed . id in currentDiagnostic . first ( ) ) { <EOL> val cleanedDiagnostic = filterKgpUtilityPropertiesFromDiagnostic ( currentDiagnostic ) <EOL> if ( cleanedDiagnostic . isNotEmpty ( ) ) appendLine ( cleanedDiagnostic . joinToString ( separator = "<STR_LIT:\n>" , postfix = "<STR_LIT:\n>" ) ) <EOL> } else { <EOL> appendLine ( currentDiagnostic . joinToString ( separator = "<STR_LIT:\n>" , postfix = "<STR_LIT:\n>" ) ) <EOL> } <EOL> currentDiagnostic . clear ( ) <EOL> diagnosticStarted = false <EOL> } <EOL> for ( ( index , line ) in output . lines ( ) . withIndex ( ) ) { <EOL> when { <EOL> line . trim ( ) == VERBOSE_DIAGNOSTIC_SEPARATOR -> endDiagnostic ( line , index ) <EOL> DIAGNOSTIC_START_REGEX . containsMatchIn ( line ) -> startDiagnostic ( line , index ) <EOL> diagnosticStarted -> continueDiagnostic ( line ) <EOL> line . startsWith ( CONFIGURE_PROJECT_PREFIX ) <EOL> || ( line . contains ( ENSURE_NO_KOTLIN_GRADLE_PLUGIN_ERRORS_TASK_NAME ) && line . startsWith ( TASK_EXECUTION_PREFIX ) ) -> { <EOL> appendLine ( ) <EOL> appendLine ( line ) <EOL> } <EOL> } <EOL> } <EOL> } . trim ( )

/**
 * NB: Needs parsable formatting of diagnostics, see [org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.internalDiagnosticsUseParsableFormat]
 * Because this mode is enabled by the 'kotlin.internal'-property, actual output will always contain
 * [org.jetbrains.kotlin.gradle.plugin.diagnostics.KotlinToolingDiagnostics.InternalKotlinGradlePluginPropertiesUsed].
 * For the sake of clarity, this diagnostic is filtered by default.
 */


private fun filterKgpUtilityPropertiesFromDiagnostic ( diagnosticLines : List < String > ) : List < String >

{ <EOL> val diagnosticWithUtilityPropertiesFiltered = diagnosticLines . filter { line -> <EOL> ! utilityInternalProperties . any { line . startsWith ( it ) } <EOL> } <EOL> return if ( diagnosticWithUtilityPropertiesFiltered . none { it . startsWith ( "<STR_LIT>" ) } ) { <EOL> emptyList ( ) <EOL> } else { <EOL> diagnosticWithUtilityPropertiesFiltered <EOL> } <EOL> }

/**
 * Filters from the report all internal utility-properties that KGP uses in tests.
 * If no properties aside from utility-properties were reported, the whole report is hidden
 */


private fun IrFunction . externallyTransformed ( ) : Boolean

= <EOL> decoysEnabled && valueParameters . firstOrNull { <EOL> it . name == KtxNameConventions . COMPOSER_PARAMETER <EOL> } != null

/**
 * With klibs, composable functions are always deserialized from IR instead of being restored
 * into stubs.
 * In this case, we need to avoid transforming those functions twice (because synthetic
 * parameters are being added). We know however, that all the other modules were compiled
 * before, so if the function comes from other [IrModuleFragment], we must skip it.
 *
 * NOTE: [ModuleDescriptor] will not work here, as incremental compilation of the same module
 * can contain some functions that were transformed during previous compilation in a
 * different module fragment with the same [ModuleDescriptor]
 */


private fun commitPendingDiagnosticsOnNestedDeclarations ( element : FirElement )

{ <EOL> val declarationContainer = when ( element ) { <EOL> is FirFile -> element . declarations . singleOrNull ( ) as? FirScript ? : element <EOL> is FirScript , is FirRegularClass -> element <EOL> else -> return <EOL> } <EOL> @ Suppress ( "<STR_LIT>" ) <EOL> ( declarationContainer as FirDeclaration ) . forEachDeclaration { declaration -> <EOL> withAnnotationContainer ( declaration ) { <EOL> declaration . accept ( components . reportCommitter , context ) <EOL> } <EOL> } <EOL> }

/**
 * File and class checkers may report diagnostics on top-level declarations and class members, such as conflicting overload errors.
 * Because we are collecting diagnostics for each structure element separately, this visitor will not visit these nested declarations by
 * default, as the file/class and its nested declarations are different structure elements. Instead, all diagnostics produced during the
 * visitor run will be committed at the end (see [FileStructureElementDiagnosticsCollector.collectForStructureElement]).
 *
 * Skipping nested declarations circumvents error suppression with `@Suppress` on top-level declarations and class members. This is
 * because suppression usually works as such: When a diagnostic is first reported on an element `E`, it is "pending". Once element `E`
 * is visited by the diagnostic visitor, it commits all pending diagnostics for `E`, including those reported by a file/class checker.
 * Diagnostics which are suppressed in the current context are instead removed. Without committing pending diagnostics on each element
 * `E`, suppression cannot take effect.
 *
 * [commitPendingDiagnosticsOnNestedDeclarations] commits pending diagnostics for directly nested elements, allowing the report
 * committer to take suppression into account.
 *
 * It suffices to commit pending diagnostics for directly nested declarations, because checkers can only report diagnostics on directly
 * accessible children. For example, a file checker can report a diagnostic on a top-level class, but not its member function.
 */


public fun < T > xEnd ( column : ColumnReference < T > ) : PositionalMapping < T >

{ <EOL> return addPositionalMapping < T > ( X_END , column . name ( ) , null ) <EOL> }

/**
 * Maps the `xEnd` aesthetic to a data column by [ColumnReference].
 *
 * @param column the data column to be mapped.
 * @return a [PositionalMapping] object representing the mapping.
 */


public fun < T > xEnd ( column : KProperty < T > ) : PositionalMapping < T >

{ <EOL> return addPositionalMapping < T > ( X_END , column . name , null ) <EOL> }

/**
 * Maps the `xEnd` aesthetic to a data column by [KProperty].
 *
 * @param column the data column to be mapped.
 * @return a [PositionalMapping] object representing the mapping.
 */


public fun xEnd ( column : String ) : PositionalMapping < Any ? >

{ <EOL> return addPositionalMapping ( X_END , column , null ) <EOL> }

/**
 * Maps the `xEnd` aesthetic to a data column by [String].
 *
 * @param column the data column to be mapped.
 * @return a [PositionalMapping] object representing the mapping.
 */


public fun < T > xEnd ( values : Iterable < T > ) : PositionalMapping < T >

{ <EOL> return addPositionalMapping < T > ( X_END , values . toList ( ) , null , null ) <EOL> }

/**
 * Maps the `xEnd` aesthetic to iterable of values.
 *
 * @param values the iterable of values to be mapped.
 * @return a [PositionalMapping] object representing the mapping.
 */


public fun < T > xEnd ( values : DataColumn < T > ) : PositionalMapping < T >

{ <EOL> return addPositionalMapping < T > ( X_END , values , null ) <EOL> }

/**
 * Maps the `xEnd` aesthetic to a data column.
 *
 * @param values the data column to be mapped.
 * @return a [PositionalMapping] object representing the mapping.
 */


fun getKotlinName ( decl : StructDecl ) : String

{ <EOL> val spelling = decl . spelling <EOL> if ( decl . isAnonymous ) { <EOL> val names = anonymousStructKotlinNames <EOL> return names . getOrPut ( decl ) { <EOL> "<STR_LIT>" <EOL> } <EOL> } <EOL> val strippedCName = if ( spelling . startsWith ( "<STR_LIT>" ) || spelling . startsWith ( "<STR_LIT>" ) ) { <EOL> spelling . substringAfter ( '<CHAR_LIT:U+0020>' ) <EOL> } else { <EOL> spelling <EOL> } <EOL> return if ( strippedCName !in forbiddenStructNames ) strippedCName else ( strippedCName + "<STR_LIT>" ) <EOL> }

/**
 * The name to be used for this struct in Kotlin
 */


fun addAllAnnotations ( currentRawAnnotations : MutableList < in PsiAnnotation > , foundQualifiers : MutableSet < String > , owner : PsiElement )

/**
 * Adds new annotations to [currentRawAnnotations] and [foundQualifiers].
 * [currentRawAnnotations] and [foundQualifiers] must be consistent with each other.
 * A parent for all new annotations must be [owner].
 *
 * @param currentRawAnnotations a list of already presented annotations
 * @param foundQualifiers a list of already presented qualifiers. Used to optimize computation
 * @param owner an owner for new annotations
 */


fun isSpecialQualifier ( qualifiedName : String ) : Boolean

/**
 * @return **true** if this qualifier should be treated as a **special** in [GranularAnnotationsBox.findAnnotation]
 * (should be processed without [GranularAnnotationsBox.getOrComputeCachedAnnotations] call)
 */


fun findSpecialAnnotation ( annotationsBox : GranularAnnotationsBox , qualifiedName : String , owner : PsiElement ) : PsiAnnotation ?

/**
 * The resulted annotation must be presented among all annotations after [addAllAnnotations]
 *
 * @param annotationsBox an owner of [AdditionalAnnotationsProvider]
 * @param qualifiedName a **special** ([isSpecialQualifier] must be **true** for it) qualified name for a new annotation
 * @param owner an owner for a new annotation
 *
 * @return a new annotation with [qualifiedName]
 */


fun addSimpleAnnotationIfMissing ( qualifier : String , currentRawAnnotations : MutableList < in PsiAnnotation > , foundQualifiers : MutableSet < String > , owner : PsiElement , )

{ <EOL> val isNewQualifier = foundQualifiers . add ( qualifier ) <EOL> if ( ! isNewQualifier ) return <EOL> currentRawAnnotations += SymbolLightSimpleAnnotation ( qualifier , owner ) <EOL> }

/**
 * Adds a new annotation with [qualifier] name to [currentRawAnnotations] and [foundQualifiers] if not already present
 */


public abstract fun createProjectWideOutOfBlockModificationTracker ( ) : ModificationTracker

/**
 * Creates an out-of-block modification tracker which is incremented every time there is an out-of-block change in some source project
 * module.
 *
 * ### Out-of-block Modification (OOBM)
 *
 * Out-of-block modification is a source code modification which may change the resolution of other non-local declarations.
 *
 * #### Example 1
 *
 * ```
 * val x = 10<caret>
 * val z = x
 * ```
 *
 * If we change the initializer of `x` to `"str"` the return type of `x` will become `String` instead of the initial `Int`. This will
 * change the return type of `z` as it does not have an explicit type. So, it is an **OOBM**.
 *
 * #### Example 2
 *
 * ```
 * val x: Int = 10<caret>
 * val z = x
 * ```
 *
 * If we change `10` to `"str"` as in the first example, it would not change the type of `z`, so it is not an **OOBM**.
 *
 * #### Examples of source code modifications which result in an **OOBM**
 *
 * - Modification inside non-local (i.e. accessible outside) declaration without explicit return type specified
 * - Modification of a package
 * - Creation of a new declaration
 * - Moving a declaration to another package
 *
 * Generally, all modifications which happen outside the body of a callable declaration (functions, accessors, or properties) with an
 * explicit type are considered **OOBM**.
 *
 * @see ModificationTracker
 */


public abstract fun createLibrariesWideModificationTracker ( ) : ModificationTracker

/**
 * Creates a modification tracker which is incremented every time libraries in the project are changed.
 *
 * @see ModificationTracker
 */


public fun Project . createProjectWideOutOfBlockModificationTracker ( ) : ModificationTracker

= <EOL> KotlinModificationTrackerFactory . getInstance ( this ) . createProjectWideOutOfBlockModificationTracker ( )

/**
 * Creates an **OOBM** tracker which is incremented every time there is an OOB change in some source project module.
 *
 * See [KotlinModificationTrackerFactory.createProjectWideOutOfBlockModificationTracker] for the definition of **OOBM**.
 * @see ModificationTracker
 */


public fun Project . createAllLibrariesModificationTracker ( ) : ModificationTracker

= <EOL> KotlinModificationTrackerFactory . getInstance ( this ) . createLibrariesWideModificationTracker ( )

/**
 * Creates a modification tracker which is incremented every time libraries in the project are changed.
 *
 * See [KotlinModificationTrackerFactory] for the definition of **OOBM**.
 * @see ModificationTracker
 */


@ K2Only <EOL> override fun < R > withTypeVariablesThatAreCountedAsProperTypes ( typeVariables : Set < TypeConstructorMarker > , block : ( ) -> R ) : R

{ <EOL> checkState ( State . BUILDING ) <EOL> properTypesCache . clear ( ) <EOL> notProperTypesCache . clear ( ) <EOL> require ( typeVariablesThatAreCountedAsProperTypes == null ) { <EOL> "<STR_LIT>" <EOL> } <EOL> typeVariablesThatAreCountedAsProperTypes = typeVariables <EOL> val result = block ( ) <EOL> typeVariablesThatAreCountedAsProperTypes = null <EOL> properTypesCache . clear ( ) <EOL> notProperTypesCache . clear ( ) <EOL> return result <EOL> }

/**
 * @see [org.jetbrains.kotlin.resolve.calls.inference.components.VariableFixationFinder.Context.typeVariablesThatAreNotCountedAsProperTypes]
 * @see [org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirDeclarationsResolveTransformer.fixInnerVariablesForProvideDelegateIfNeeded]
 */


override fun resolveForkPointsConstraints ( )

{ <EOL> if ( constraintsFromAllForkPoints . isEmpty ( ) ) return <EOL> val allForkPointsData = constraintsFromAllForkPoints . toList ( ) <EOL> constraintsFromAllForkPoints . clear ( ) <EOL> for ( ( position , forkPointData ) in allForkPointsData ) { <EOL> if ( ! applyConstraintsFromFirstSuccessfulBranchOfTheFork ( forkPointData , position ) ) { <EOL> addError ( NoSuccessfulFork ( position ) ) <EOL> } <EOL> } <EOL> }

/**
 * This function tries to find the solution (set of constraints) that is consistent with some branch of each fork
 * And those constraints are being immediately applied to the system
 */


fun checkIfForksMightBeSuccessfullyResolved ( ) : ConstraintSystemError ?

{ <EOL> if ( constraintsFromAllForkPoints . isEmpty ( ) ) return null <EOL> val allForkPointsData = constraintsFromAllForkPoints . toList ( ) <EOL> constraintsFromAllForkPoints . clear ( ) <EOL> var result : ConstraintSystemError ? = null <EOL> runTransaction { <EOL> for ( ( position , forkPointData ) in allForkPointsData ) { <EOL> if ( ! applyConstraintsFromFirstSuccessfulBranchOfTheFork ( forkPointData , position ) ) { <EOL> result = NoSuccessfulFork ( position ) <EOL> break <EOL> } <EOL> } <EOL> false <EOL> } <EOL> constraintsFromAllForkPoints . addAll ( allForkPointsData ) <EOL> return result <EOL> }

/**
 * Checks if current state of forked constraints is not contradictory.
 *
 * That function is expected to be pure, i.e. it should leave the system in the same state it was found before the call.
 *
 * @return null if for each fork we found a possible branch that doesn't contradict with all other constraints
 * @return non-nullable error if there's a contradiction we didn't manage to resolve
 */


private fun applyConstraintsFromFirstSuccessfulBranchOfTheFork ( forkPointData : ForkPointData , position : IncorporationConstraintPosition , ) : Boolean

{ <EOL> return forkPointData . any { constraintSetForForkBranch -> <EOL> runTransaction { <EOL> constraintInjector . processGivenForkPointBranchConstraints ( this @ NewConstraintSystemImpl . apply { checkState ( State . BUILDING , State . COMPLETION , State . TRANSACTION ) } , constraintSetForForkBranch , position , ) <EOL> resolveForkPointsConstraints ( ) <EOL> ! hasContradiction <EOL> } <EOL> } <EOL> }

/**
 * @return true if there is a successful constraints set for the fork
 */


public fun FieldType . isNullable ( ) : Boolean

= <EOL> when ( this ) { <EOL> is FieldType . FrameFieldType -> markerName . endsWith ( "<STR_LIT:?>" ) || markerName == "<STR_LIT:*>" <EOL> is FieldType . GroupFieldType -> markerName . endsWith ( "<STR_LIT:?>" ) || markerName == "<STR_LIT:*>" <EOL> is FieldType . ValueFieldType -> typeFqName . endsWith ( "<STR_LIT:?>" ) || typeFqName == "<STR_LIT:*>" <EOL> }

/**
 * Returns whether the column type ends with `?` or not.
 * NOTE: for [FieldType.FrameFieldType], the `nullable` property indicates the nullability of the frame itself, not the type of the column.
 */


public fun FieldType . isNotNullable ( ) : Boolean

= ! isNullable ( )

/**
 * Returns whether the column type doesn't end with `?` or whether it does.
 * NOTE: for [FieldType.FrameFieldType], the `nullable` property indicates the nullability of the frame itself, not the type of the column.
 */


public fun FieldType . toNullable ( ) : FieldType

= <EOL> if ( isNotNullable ( ) ) { <EOL> when ( this ) { <EOL> is FieldType . FrameFieldType -> FieldType . FrameFieldType ( markerName . toNullable ( ) , nullable ) <EOL> is FieldType . GroupFieldType -> FieldType . GroupFieldType ( markerName . toNullable ( ) ) <EOL> is FieldType . ValueFieldType -> FieldType . ValueFieldType ( typeFqName . toNullable ( ) ) <EOL> } <EOL> } else this

/**
 * Returns a new fieldType with the same type but with nullability in the column type.
 * NOTE: for [FieldType.FrameFieldType], the `nullable` property indicates the nullability of the frame itself, not the type of the column.
 */


public fun FieldType . toNotNullable ( ) : FieldType

= <EOL> if ( isNullable ( ) ) { <EOL> when ( this ) { <EOL> is FieldType . FrameFieldType -> FieldType . FrameFieldType ( markerName = markerName . let { <EOL> if ( it == "<STR_LIT:*>" ) "<STR_LIT>" <EOL> else it . removeSuffix ( "<STR_LIT:?>" ) <EOL> } , nullable = nullable , ) <EOL> is FieldType . GroupFieldType -> FieldType . GroupFieldType ( markerName = markerName . let { <EOL> if ( it == "<STR_LIT:*>" ) "<STR_LIT>" <EOL> else it . removeSuffix ( "<STR_LIT:?>" ) <EOL> } , ) <EOL> is FieldType . ValueFieldType -> FieldType . ValueFieldType ( typeFqName = typeFqName . let { <EOL> if ( it == "<STR_LIT:*>" ) "<STR_LIT>" <EOL> else it . removeSuffix ( "<STR_LIT:?>" ) <EOL> } , ) <EOL> } <EOL> } else this

/**
 * Returns a new fieldType with the same type but with nullability disabled in the column type.
 * NOTE: for [FieldType.FrameFieldType], the `nullable` property indicates the nullability of the frame itself, not the type of the column.
 */


= first > last

/**
 * Checks if the range is empty.

 * The range is empty if its start value is greater than the end value.
 */


= if ( step > <NUM_LIT:0> ) first > last else first < last

/**
 * Checks if the progression is empty.

 * Progression with a positive step is empty if its first element is greater than the last element.
 * Progression with a negative step is empty if its first element is less than the last element.
 */


public fun fromClosedRange ( rangeStart : ULong , rangeEnd : ULong , step : Long ) : ULongProgression

= ULongProgression ( rangeStart , rangeEnd , step )

/**
 * Creates ULongProgression within the specified bounds of a closed range.

 * The progression starts with the [rangeStart] value and goes toward the [rangeEnd] value not excluding it, with the specified [step].
 * In order to go backwards the [step] must be negative.
 *
 * [step] must be greater than `Long.MIN_VALUE` and not equal to zero.
 */


{ <EOL> val ( train , test ) = fashionMnist ( ) <EOL> val ( newTrain , validation ) = train . split ( <NUM_LIT> ) <EOL> val sampleIndex = <NUM_LIT:42> <EOL> val x = test . getX ( sampleIndex ) <EOL> val y = test . getY ( sampleIndex ) . toInt ( ) <EOL> lenet5 ( ) . use { <EOL> it . compile ( optimizer = Adam ( ) , loss = Losses . SOFT_MAX_CROSS_ENTROPY_WITH_LOGITS , metric = Metrics . ACCURACY ) <EOL> it . fit ( trainingDataset = newTrain , validationDataset = validation , epochs = EPOCHS , trainBatchSize = TRAINING_BATCH_SIZE , validationBatchSize = TEST_BATCH_SIZE ) <EOL> val fashionPlots = List ( <NUM_LIT:3> ) { imageIndex -> <EOL> flattenImagePlot ( imageIndex , test , predict = it :: predictLabel , labelEncoding = fashionMnistLabelEncoding :: get , plotFeature = PlotFeature . GRAY ) <EOL> } <EOL> columnPlot ( fashionPlots , <NUM_LIT:3> , <NUM_LIT> ) . show ( ) <EOL> val accuracy = it . evaluate ( dataset = test , batchSize = TEST_BATCH_SIZE ) . metrics [ Metrics . ACCURACY ] <EOL> println ( "<STR_LIT>" ) <EOL> val fstConv2D = it . layers [ <NUM_LIT:1> ] as Conv2D <EOL> val sndConv2D = it . layers [ <NUM_LIT:3> ] as Conv2D <EOL> filtersPlot ( fstConv2D , columns = <NUM_LIT:16> ) . show ( ) <EOL> filtersPlot ( sndConv2D , columns = <NUM_LIT:16> ) . show ( ) <EOL> drawFilters ( fstConv2D . weights . values . toTypedArray ( ) [ <NUM_LIT:0> ] , colorCoefficient = <NUM_LIT> ) <EOL> drawFilters ( sndConv2D . weights . values . toTypedArray ( ) [ <NUM_LIT:0> ] , colorCoefficient = <NUM_LIT> ) <EOL> val layersActivations = modelActivationOnLayersPlot ( it , x ) <EOL> val ( prediction , activations ) = it . predictAndGetActivations ( x ) <EOL> println ( "<STR_LIT>" ) <EOL> println ( "<STR_LIT>" ) <EOL> layersActivations [ <NUM_LIT:0> ] . show ( ) <EOL> layersActivations [ <NUM_LIT:1> ] . show ( ) <EOL> drawActivations ( activations ) <EOL> } <EOL> }

/**
 * This examples demonstrates model activations and Conv2D filters visualisation.
 *
 * Model is trained on FashionMnist dataset.
 */


protected abstract fun selectDeserializer ( element : JsonElement ) : DeserializationStrategy < T >

/**
 * Determines a particular strategy for deserialization by looking on a parsed JSON [element].
 */


@ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ WasExperimental ( ExperimentalTime :: class ) <EOL> public inline fun measureTime ( block : ( ) -> Unit ) : Duration

{ <EOL> contract { <EOL> callsInPlace ( block , InvocationKind . EXACTLY_ONCE ) <EOL> } <EOL> return TimeSource . Monotonic . measureTime ( block ) <EOL> }

/**
 * Executes the given function [block] and returns the duration of elapsed time interval.
 *
 * The elapsed time is measured with [TimeSource.Monotonic].
 */


@ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ WasExperimental ( ExperimentalTime :: class ) <EOL> public inline fun TimeSource . measureTime ( block : ( ) -> Unit ) : Duration

{ <EOL> contract { <EOL> callsInPlace ( block , InvocationKind . EXACTLY_ONCE ) <EOL> } <EOL> val mark = markNow ( ) <EOL> block ( ) <EOL> return mark . elapsedNow ( ) <EOL> }

/**
 * Executes the given function [block] and returns the duration of elapsed time interval.
 *
 * The elapsed time is measured with the specified `this` [TimeSource] instance.
 */


@ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ WasExperimental ( ExperimentalTime :: class ) <EOL> public inline fun TimeSource . Monotonic . measureTime ( block : ( ) -> Unit ) : Duration

/**
 * Executes the given function [block] and returns the duration of elapsed time interval.
 *
 * The elapsed time is measured with the specified `this` [TimeSource.Monotonic] instance.
 */


@ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ WasExperimental ( ExperimentalTime :: class ) <EOL> public inline fun < T > measureTimedValue ( block : ( ) -> T ) : TimedValue < T >

{ <EOL> contract { <EOL> callsInPlace ( block , InvocationKind . EXACTLY_ONCE ) <EOL> } <EOL> return TimeSource . Monotonic . measureTimedValue ( block ) <EOL> }

/**
 * Executes the given function [block] and returns an instance of [TimedValue] class, containing both
 * the result of the function execution and the duration of elapsed time interval.
 *
 * The elapsed time is measured with [TimeSource.Monotonic].
 */


@ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ WasExperimental ( ExperimentalTime :: class ) <EOL> public inline fun < T > TimeSource . measureTimedValue ( block : ( ) -> T ) : TimedValue < T >

{ <EOL> contract { <EOL> callsInPlace ( block , InvocationKind . EXACTLY_ONCE ) <EOL> } <EOL> val mark = markNow ( ) <EOL> val result = block ( ) <EOL> return TimedValue ( result , mark . elapsedNow ( ) ) <EOL> }

/**
 * Executes the given function [block] and returns an instance of [TimedValue] class, containing both
 * the result of function execution and the duration of elapsed time interval.
 *
 * The elapsed time is measured with the specified `this` [TimeSource] instance.
 */


@ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ WasExperimental ( ExperimentalTime :: class ) <EOL> public inline fun < T > TimeSource . Monotonic . measureTimedValue ( block : ( ) -> T ) : TimedValue < T >

/**
 * Executes the given function [block] and returns an instance of [TimedValue] class, containing both
 * the result of function execution and the duration of elapsed time interval.
 *
 * The elapsed time is measured with the specified `this` [TimeSource.Monotonic] instance.
 */


public fun exists ( path : Path ) : Boolean

/**
 * Returns `true` if there is a filesystem entity a [path] points to,
 * otherwise returns `false`.
 *
 * @param path the path that should be checked for existence.
 *
 * @throws kotlinx.io.IOException when the attempt to check the existence of the [path] failed.
 */


public fun delete ( path : Path , mustExist : Boolean = true )

/**
 * Deletes a file or directory the [path] points to from a filesystem.
 * If there is no filesystem entity represented by the [path]
 * this method throws [kotlinx.io.files.FileNotFoundException] when [mustExist] is `true`.
 *
 * Note that in the case of a directory, this method will not attempt to delete it recursively,
 * so deletion of non-empty directory will fail.
 *
 * @param path the path to a file or directory to be deleted.
 * @param mustExist the flag indicating whether missing [path] is an error, `true` by default.
 *
 * @throws kotlinx.io.files.FileNotFoundException when [path] does not exist and [mustExist] is `true`.
 * @throws kotlinx.io.IOException if deletion failed.
 */


public fun createDirectories ( path : Path , mustCreate : Boolean = false )

/**
 * Creates a directory tree represented by the [path].
 * If [path] already exists then the method throws [kotlinx.io.IOException] when [mustCreate] is `true`.
 * The call will attempt to create only missing directories.
 * The method is not atomic and if it fails after creating some
 * directories, these directories will not be deleted automatically.
 * Permissions for created directories are platform-specific.
 *
 * @param path the path to be created.
 * @param mustCreate the flag indicating that existence of [path] should be treated as an error,
 * by default it is `false`.
 *
 * @throws kotlinx.io.IOException when [path] already exists and [mustCreate] is `true`.
 * @throws kotlinx.io.IOException when the creation of one of the directories fails.
 * @throws kotlinx.io.IOException when [path] is an existing file and [mustCreate] is `false`.
 */


public fun atomicMove ( source : Path , destination : Path )

/**
 * Atomically renames [source] to [destination] overriding [destination] if it already exists.
 *
 * When the filesystem does not support atomic move of [source] and [destination] corresponds to different
 * filesystems (or different volumes, on Windows) and the operation could not be performed atomically,
 * [UnsupportedOperationException] is thrown.
 *
 * On some platforms, like Wasm-WASI, there is no way to tell if the underlying filesystem supports atomic move.
 * In such cases, the move will be performed and no [UnsupportedOperationException] will be thrown.
 *
 * When [destination] is an existing directory, the operation may fail on some platforms
 * (on Windows, particularly).
 *
 * @param source the path to rename.
 * @param destination desired path name.
 *
 * @throws kotlinx.io.files.FileNotFoundException when the [source] does not exist.
 * @throws kotlinx.io.IOException when the move failed.
 * @throws kotlin.UnsupportedOperationException when the filesystem does not support atomic move.
 */


public fun source ( path : Path ) : RawSource

/**
 * Returns [RawSource] to read from a file the [path] points to.
 *
 * How a source will read the data is implementation-specific and failures caused
 * by the missing file or, for example, lack of permissions may not be reported immediately,
 * but postponed until the source will try to fetch data.
 *
 * If [path] points to a directory, this method will fail with [IOException].
 *
 * @param path the path to read from.
 *
 * @throws kotlinx.io.files.FileNotFoundException when the file does not exist.
 * @throws kotlinx.io.IOException when it's not possible to open the file for reading.
 */


public fun sink ( path : Path , append : Boolean = false ) : RawSink

/**
 * Returns [RawSink] to write into a file the [path] points to.
 * Depending on [append] value, the file will be overwritten or data will be appened to it.
 * File will be created if it does not exist yet.
 *
 * How a sink will write the data is implementation-specific and failures caused,
 * for example, by the lack of permissions may not be reported immediately,
 * but postponed until the sink will try to store data.
 *
 * If [path] points to a directory, this method will fail with [IOException]
 *
 * @param path the path to a file to write data to.
 * @param append the flag indicating whether the data should be appended to an existing file or it
 * should be overwritten, `false` by default, meaning the file will be overwritten.
 *
 * @throws kotlinx.io.IOException when it's not possible to open the file for writing.
 */


public fun metadataOrNull ( path : Path ) : FileMetadata ?

/**
 * Return [FileMetadata] associated with a file or directory the [path] points to.
 * If there is no such file or directory, or it's impossible to fetch metadata,
 * `null` is returned.
 *
 * @param path the path to get the metadata for.
 */


public fun resolve ( path : Path ) : Path

/**
 * Returns an absolute path to the same file or directory the [path] is pointing to.
 * All symbolic links are solved, extra path separators and references to current (`.`) or
 * parent (`..`) directories are removed.
 * If the [path] is a relative path then it'll be resolved against current working directory.
 * If there is no file or directory to which the [path] is pointing to then [FileNotFoundException] will be thrown.
 *
 * @param path the path to resolve.
 * @return a resolved path.
 * @throws FileNotFoundException if there is no file or directory corresponding to the specified path.
 */


fun fixInconsistentValue ( key : K , context : CONTEXT & Any , inconsistencyMessage : String , mapping : ( oldValue : V , newValue : V & Any ) -> V & Any , ) : V & Any

/**
 * Drops the incorrect value from the cache and add a new value instead.
 */


internal fun < KEY : Any , VALUE , CONTEXT > FirCache < KEY , VALUE , CONTEXT > . getNotNullValueForNotNullContext ( key : KEY , context : CONTEXT , ) : VALUE

{ <EOL> val value = getValue ( key , context ) <EOL> @ Suppress ( "<STR_LIT>" ) <EOL> return if ( value != null || context == null || this !is FirCacheWithInvalidation < KEY , VALUE , CONTEXT > ) { <EOL> value <EOL> } else { <EOL> fixInconsistentValue ( key = key , context = context , inconsistencyMessage = "<STR_LIT>" , mapping = { old , new -> old ? : new } , ) <EOL> } <EOL> }

/**
 * Return cached value or created a new one from [context].
 * This method assumes that we can't return null for not-null context.
 * Logs inconsistency error if it is present.
 *
 * @return not-null [VALUE] in case of [FirCacheWithInvalidation] cache.
 */


fun checkUpperBoundViolated ( typeRef : FirTypeRef ? , context : CheckerContext , reporter : DiagnosticReporter , isIgnoreTypeParameters : Boolean = false )

{ <EOL> val type = typeRef ? . coneTypeSafe < ConeClassLikeType > ( ) ? : return <EOL> checkUpperBoundViolated ( typeRef , type , context , reporter , isIgnoreTypeParameters ) <EOL> }

/**
 * Recursively analyzes type parameters and reports the diagnostic on the given source calculated using typeRef
 */


= buildString { serializeTo ( SchemeStringSerializationWriter ( this ) ) }

/**
 * Produce a string serialization of the scheme. This is not necessarily readable, use
 * [toString] for debugging instead.
 */


override fun equals ( other : Any ? ) : Boolean

{ <EOL> val o = other as? Scheme ? : return false <EOL> return this . alphaRename ( ) . simpleEquals ( o . alphaRename ( ) ) <EOL> }

/**
 * Compare to [Scheme] instances for equality. Two [Scheme]s are considered equal if they are
 * [alpha equivalent][https://en.wikipedia.org/wiki/Lambda_calculus#%CE%B1-conversion]. This
 * is accomplished by normalizing both schemes and then comparing them simply for equality.
 * See [alphaRename] for details.
 */


{ <EOL> if ( ( target !is Open || target . index in - <NUM_LIT:1> .. <NUM_LIT:0> ) && parameters . isEmpty ( ) ) return this <EOL> val alphaRenameMap = mutableMapOf < Int , Int > ( ) <EOL> var next = <NUM_LIT:0> <EOL> fun scan ( scheme : Scheme ) { <EOL> val target = scheme . target <EOL> val parameters = scheme . parameters <EOL> val result = scheme . result <EOL> if ( target is Open ) { <EOL> val index = target . index <EOL> if ( index in alphaRenameMap ) { <EOL> if ( index >= <NUM_LIT:0> && alphaRenameMap [ index ] == - <NUM_LIT:1> ) <EOL> alphaRenameMap [ index ] = next ++ <EOL> } else alphaRenameMap [ index ] = - <NUM_LIT:1> <EOL> } <EOL> parameters . forEach { scan ( it ) } <EOL> result ? . let { scan ( it ) } <EOL> } <EOL> scan ( this ) <EOL> if ( alphaRenameMap . isEmpty ( ) ) return this <EOL> fun rename ( scheme : Scheme ) : Scheme { <EOL> val target = scheme . target <EOL> val parameters = scheme . parameters <EOL> val result = scheme . result <EOL> val newTarget = if ( target is Open && target . index != alphaRenameMap [ target . index ] ) <EOL> Open ( alphaRenameMap [ target . index ] ! ! ) <EOL> else target <EOL> val newParameters = parameters . map { rename ( it ) } <EOL> val newResult = result ? . let { rename ( it ) } <EOL> return if ( target !== newTarget || newParameters . zip ( parameters ) . any { ( a , b ) -> <EOL> a !== b <EOL> } || newResult != result ) Scheme ( newTarget , newParameters , newResult ) <EOL> else scheme <EOL> } <EOL> return rename ( this ) <EOL> }

/**
 * Both hashCode and equals are in terms of alpha rename equivalents. That means that the scheme
 * [0, [0]] and [2, [2]] should be treated as equal even though they have different indexes
 * because they are alpha rename equivalent. This method will rename all variables
 * consistently so that if they are alpha equivalent then they will have the same open
 * indexes in the same location. If the scheme is already alpha rename consistent then this is
 * returned.
 */


fun deserializeScheme ( value : String ) : Scheme ?

{ <EOL> val reader = SchemeStringSerializationReader ( value ) <EOL> fun item ( ) : Item = when ( reader . kind ) { <EOL> ItemKind . Token -> Token ( reader . token ( ) ) <EOL> ItemKind . Number -> Open ( reader . number ( ) ) <EOL> else -> schemeParseError ( ) <EOL> } <EOL> fun < T > list ( content : ( ) -> T ) : List < T > { <EOL> if ( reader . kind != ItemKind . Open ) return emptyList ( ) <EOL> val result = mutableListOf < T > ( ) <EOL> while ( reader . kind == ItemKind . Open ) { <EOL> result . add ( content ( ) ) <EOL> } <EOL> return result <EOL> } <EOL> fun < T > delimited ( prefix : ItemKind , postfix : ItemKind , content : ( ) -> T ) = run { <EOL> reader . expect ( prefix ) <EOL> content ( ) . also { <EOL> reader . expect ( postfix ) <EOL> } <EOL> } <EOL> fun < T > optional ( prefix : ItemKind , postfix : ItemKind = ItemKind . Invalid , content : ( ) -> T ) : T ? = <EOL> if ( reader . kind == prefix ) { <EOL> delimited ( prefix , postfix , content ) <EOL> } else null <EOL> fun isItem ( kind : ItemKind ) : Boolean = <EOL> if ( reader . kind == kind ) { <EOL> reader . expect ( kind ) <EOL> true <EOL> } else false <EOL> fun scheme ( ) : Scheme = <EOL> delimited ( ItemKind . Open , ItemKind . Close ) { <EOL> val target = item ( ) <EOL> val anyParameters = isItem ( ItemKind . AnyParameters ) <EOL> val parameters = if ( anyParameters ) emptyList ( ) else list { scheme ( ) } <EOL> val result = optional ( ItemKind . ResultPrefix ) { scheme ( ) } <EOL> Scheme ( target , parameters , result , anyParameters ) <EOL> } <EOL> return try { <EOL> scheme ( ) . also { reader . end ( ) } <EOL> } catch ( _ : SchemeParseError ) { <EOL> null <EOL> } <EOL> }

/**
 * Given a string produce a [Scheme] if the string is a valid serialization of a [Scheme] or null
 * otherwise.
 */


/**
 * Function declared in JVM source set
 *
 * also see the [Foo] class
 * @see org.kotlintestmpp.common.Foo
 */


/**
 * Function declared in JVM source set
 *
 * Function with the same name exists in another source set as well.
 */


fun CoroutineScope . startConnectionPipeline ( input : String ) : Job

= launch { TODO ( ) }

/**
 * Extension declared in JVM source set
 */


= println ( "<STR_LIT>" )


= runTest { <EOL> ReflectionHelpers . setStaticField ( Build . VERSION :: class . java , "<STR_LIT>" , <NUM_LIT> ) <EOL> val mainLooper = shadowOf ( Looper . getMainLooper ( ) ) <EOL> mainLooper . pause ( ) <EOL> val mainMessageQueue = shadowOf ( Looper . getMainLooper ( ) . queue ) <EOL> val job = launch ( Dispatchers . Main ) { <EOL> expect ( <NUM_LIT:2> ) <EOL> } <EOL> val message = mainMessageQueue . head <EOL> assertTrue ( message . isAsynchronous ) <EOL> job . join ( mainLooper ) <EOL> }

/**
 * Because [Dispatchers.Main] is a singleton, we cannot vary its initialization behavior. As a
 * result we only test its behavior on the newest API level and assert that it uses async
 * messages. We rely on the other tests to exercise the variance of the mechanism that the main
 * dispatcher uses to ensure it has correct behavior on all API levels.
 */


public fun CoroutineScope . launch ( context : CoroutineContext = EmptyCoroutineContext , start : CoroutineStart = CoroutineStart . DEFAULT , block : suspend CoroutineScope . ( ) -> Unit ) : Job

{ <EOL> val newContext = newCoroutineContext ( context ) <EOL> val coroutine = if ( start . isLazy ) <EOL> LazyStandaloneCoroutine ( newContext , block ) else <EOL> StandaloneCoroutine ( newContext , active = true ) <EOL> coroutine . start ( start , coroutine , block ) <EOL> return coroutine <EOL> }

/**
 * Launches a new coroutine without blocking the current thread and returns a reference to the coroutine as a [Job].
 * The coroutine is cancelled when the resulting job is [cancelled][Job.cancel].
 *
 * The coroutine context is inherited from a [CoroutineScope]. Additional context elements can be specified with [context] argument.
 * If the context does not have any dispatcher nor any other [ContinuationInterceptor], then [Dispatchers.Default] is used.
 * The parent job is inherited from a [CoroutineScope] as well, but it can also be overridden
 * with a corresponding [context] element.
 *
 * By default, the coroutine is immediately scheduled for execution.
 * Other start options can be specified via `start` parameter. See [CoroutineStart] for details.
 * An optional [start] parameter can be set to [CoroutineStart.LAZY] to start coroutine _lazily_. In this case,
 * the coroutine [Job] is created in _new_ state. It can be explicitly started with [start][Job.start] function
 * and will be started implicitly on the first invocation of [join][Job.join].
 *
 * Uncaught exceptions in this coroutine cancel the parent job in the context by default
 * (unless [CoroutineExceptionHandler] is explicitly specified), which means that when `launch` is used with
 * the context of another coroutine, then any uncaught exception leads to the cancellation of the parent coroutine.
 *
 * See [newCoroutineContext] for a description of debugging facilities that are available for a newly created coroutine.
 *
 * @param context additional to [CoroutineScope.coroutineContext] context of the coroutine.
 * @param start coroutine start option. The default value is [CoroutineStart.DEFAULT].
 * @param block the coroutine code which will be invoked in the context of the provided scope.
 **/


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

{ <EOL> val newContext = newCoroutineContext ( context ) <EOL> val coroutine = if ( start . isLazy ) <EOL> LazyDeferredCoroutine ( newContext , block ) else <EOL> DeferredCoroutine < T > ( newContext , active = true ) <EOL> coroutine . start ( start , coroutine , block ) <EOL> return coroutine <EOL> }

/**
 * Creates a coroutine and returns its future result as an implementation of [Deferred].
 * The running coroutine is cancelled when the resulting deferred is [cancelled][Job.cancel].
 * The resulting coroutine has a key difference compared with similar primitives in other languages
 * and frameworks: it cancels the parent job (or outer scope) on failure to enforce *structured concurrency* paradigm.
 * To change that behaviour, supervising parent ([SupervisorJob] or [supervisorScope]) can be used.
 *
 * Coroutine context is inherited from a [CoroutineScope], additional context elements can be specified with [context] argument.
 * If the context does not have any dispatcher nor any other [ContinuationInterceptor], then [Dispatchers.Default] is used.
 * The parent job is inherited from a [CoroutineScope] as well, but it can also be overridden
 * with corresponding [context] element.
 *
 * By default, the coroutine is immediately scheduled for execution.
 * Other options can be specified via `start` parameter. See [CoroutineStart] for details.
 * An optional [start] parameter can be set to [CoroutineStart.LAZY] to start coroutine _lazily_. In this case,
 * the resulting [Deferred] is created in _new_ state. It can be explicitly started with [start][Job.start]
 * function and will be started implicitly on the first invocation of [join][Job.join], [await][Deferred.await] or [awaitAll].
 *
 * @param block the coroutine code.
 */


public suspend fun < T > withContext ( context : CoroutineContext , block : suspend CoroutineScope . ( ) -> T ) : T

{ <EOL> contract { <EOL> callsInPlace ( block , InvocationKind . EXACTLY_ONCE ) <EOL> } <EOL> return suspendCoroutineUninterceptedOrReturn sc @ { uCont -> <EOL> val oldContext = uCont . context <EOL> val newContext = oldContext . newCoroutineContext ( context ) <EOL> newContext . ensureActive ( ) <EOL> if ( newContext === oldContext ) { <EOL> val coroutine = ScopeCoroutine ( newContext , uCont ) <EOL> return@sc coroutine . startUndispatchedOrReturn ( coroutine , block ) <EOL> } <EOL> if ( newContext [ ContinuationInterceptor ] == oldContext [ ContinuationInterceptor ] ) { <EOL> val coroutine = UndispatchedCoroutine ( newContext , uCont ) <EOL> withCoroutineContext ( coroutine . context , null ) { <EOL> return@sc coroutine . startUndispatchedOrReturn ( coroutine , block ) <EOL> } <EOL> } <EOL> val coroutine = DispatchedCoroutine ( newContext , uCont ) <EOL> block . startCoroutineCancellable ( coroutine , coroutine ) <EOL> coroutine . getResult ( ) <EOL> } <EOL> }

/**
 * Calls the specified suspending block with a given coroutine context, suspends until it completes, and returns
 * the result.
 *
 * The resulting context for the [block] is derived by merging the current [coroutineContext] with the
 * specified [context] using `coroutineContext + context` (see [CoroutineContext.plus]).
 * This suspending function is cancellable. It immediately checks for cancellation of
 * the resulting context and throws [CancellationException] if it is not [active][CoroutineContext.isActive].
 *
 * Calls to [withContext] whose [context] argument provides a [CoroutineDispatcher] that is
 * different from the current one, by necessity, perform additional dispatches: the [block]
 * can not be executed immediately and needs to be dispatched for execution on
 * the passed [CoroutineDispatcher], and then when the [block] completes, the execution
 * has to shift back to the original dispatcher.
 *
 * Note that the result of `withContext` invocation is dispatched into the original context in a cancellable way
 * with a **prompt cancellation guarantee**, which means that if the original [coroutineContext]
 * in which `withContext` was invoked is cancelled by the time its dispatcher starts to execute the code,
 * it discards the result of `withContext` and throws [CancellationException].
 *
 * The cancellation behaviour described above is enabled if and only if the dispatcher is being changed.
 * For example, when using `withContext(NonCancellable) { ... }` there is no change in dispatcher and
 * this call will not be cancelled neither on entry to the block inside `withContext` nor on exit from it.
 */


public suspend inline operator fun < T > CoroutineDispatcher . invoke ( noinline block : suspend CoroutineScope . ( ) -> T ) : T

= withContext ( this , block )

/**
 * Calls the specified suspending block with the given [CoroutineDispatcher], suspends until it
 * completes, and returns the result.
 *
 * This inline function calls [withContext].
 */


fun FirBasedSymbol < * > . getOwnDeprecation ( session : FirSession , callSite : FirElement ? ) : DeprecationInfo ?

{ <EOL> return getOwnDeprecationForCallSite ( session , * getUseSitesForCallSite ( callSite ) ) <EOL> }

/**
 * Returns deprecation that is declared on the
 * corresponding declaration.
 */


fun FirBasedSymbol < * > . getDeprecation ( session : FirSession , callSite : FirElement ? ) : DeprecationInfo ?

{ <EOL> return getDeprecationForCallSite ( session , * getUseSitesForCallSite ( callSite ) ) <EOL> }

/**
 * Returns deprecation that is declared on
 * the corresponding declaration directly
 * or, in case of a typealias, on any of
 * its expansions.
 */


private fun FirBasedSymbol < * > . getOwnDeprecationForCallSite ( session : FirSession , vararg sites : AnnotationUseSiteTarget ) : DeprecationInfo ?

{ <EOL> val deprecations = when ( this ) { <EOL> is FirCallableSymbol < * > -> getDeprecation ( session ) <EOL> is FirClassLikeSymbol < * > -> getOwnDeprecation ( session ) <EOL> else -> null <EOL> } <EOL> return ( deprecations ? : EmptyDeprecationsPerUseSite ) . forUseSite ( * sites ) <EOL> }


fun FirBasedSymbol < * > . getDeprecationForCallSite ( session : FirSession , vararg sites : AnnotationUseSiteTarget , ) : DeprecationInfo ?

{ <EOL> return when ( this ) { <EOL> !is FirTypeAliasSymbol -> getOwnDeprecationForCallSite ( session , * sites ) <EOL> else -> { <EOL> var worstDeprecationInfo = getOwnDeprecationForCallSite ( session , * sites ) <EOL> val visited = mutableMapOf < ConeKotlinType , DeprecationInfo ? > ( ) <EOL> resolvedExpandedTypeRef . type . forEachType { <EOL> val deprecationInfo = visited . getOrPut ( it ) { <EOL> val symbol = it . toSymbol ( session ) ? : return@forEachType <EOL> symbol . getDeprecationForCallSite ( session , * sites ) <EOL> } ? : return@forEachType <EOL> val currentWorstDeprecation = worstDeprecationInfo <EOL> if ( currentWorstDeprecation == null || deprecationInfo > currentWorstDeprecation ) { <EOL> worstDeprecationInfo = deprecationInfo <EOL> } <EOL> } <EOL> worstDeprecationInfo <EOL> } <EOL> } <EOL> }


fun FirCallableSymbol < * > . hiddenStatusOfCall ( isSuperCall : Boolean , isCallToOverride : Boolean ) : CallToPotentiallyHiddenSymbolResult

{ <EOL> val fir = fir <EOL> if ( fir . isHiddenToOvercomeSignatureClash == true ) { <EOL> return CallToPotentiallyHiddenSymbolResult . Hidden <EOL> } <EOL> val status = fir . hiddenEverywhereBesideSuperCallsStatus ? : return CallToPotentiallyHiddenSymbolResult . Visible <EOL> return when ( status ) { <EOL> HiddenEverywhereBesideSuperCallsStatus . HIDDEN -> if ( isSuperCall ) CallToPotentiallyHiddenSymbolResult . Visible else CallToPotentiallyHiddenSymbolResult . Hidden <EOL> HiddenEverywhereBesideSuperCallsStatus . HIDDEN_IN_DECLARING_CLASS_ONLY -> if ( isSuperCall || isCallToOverride ) CallToPotentiallyHiddenSymbolResult . VisibleWithDeprecation else CallToPotentiallyHiddenSymbolResult . Hidden <EOL> HiddenEverywhereBesideSuperCallsStatus . HIDDEN_FAKE -> if ( isCallToOverride ) CallToPotentiallyHiddenSymbolResult . VisibleWithDeprecation else CallToPotentiallyHiddenSymbolResult . Hidden <EOL> } <EOL> }

/**
 * To check whether a symbol is visible and if it's deprecated, the method needs to be called for the symbol and all its
 * overridden symbols.
 * [isSuperCall] must be set to `true` when the receiver is `super`.
 * [isCallToOverride] must be set to `false` for the original symbol and to `true` for all its overridden symbols.
 *
 * Given the following hierarchy
 *
 * ```
 * public class A {
 * public String getX() { return ""; } // HIDDEN
 * public String getY() { return ""; } // HIDDEN_IN_DECLARING_CLASS_ONLY
 * public String getZ() { return ""; } // HIDDEN_FAKE
 * }
 *
 * class B extends A {
 * @Override public String getX() { return super.getX(); }
 * @Override public String getY() { return super.getY(); }
 * @Override public String getZ() { return super.getZ(); }
 * }
 * ```
 *
 * the results will be as follows
 *
 * | Receiver \ Symbol | getX | getY | getZ |
 * |-------------------|---------|------------------------|------------------------|
 * | A | Hidden | Hidden | Hidden |
 * | super | Visible | VisibleWithDeprecation | Hidden |
 * | B | Hidden | VisibleWithDeprecation | VisibleWithDeprecation |
 *
 */


= "<STR_LIT>"

/** Get ID of the Kotlin Compiler plugin */


fun getResolutionFacadeWithForcedPlatform ( elements : List < KtElement > , platform : TargetPlatform ) : ResolutionFacade

/**
 * Provides resolution facade for [elements], guaranteeing that the resolution will be seen from the [platform]-perspective.
 *
 * This allows to get resolution for common sources in MPP from the perspective of given platform (with expects substituted to actuals,
 * declarations resolved from platform-specific artifacts, ModuleDescriptors will contain only platform dependencies, etc.)
 *
 * It is equivalent to usual [getResolutionFacade]-overloads if platform(s) of module(s) containing [elements] are equal to [platform]
 *
 * Doesn't support scripts or any other 'special' files.
 */


public fun fuse ( context : CoroutineContext = EmptyCoroutineContext , capacity : Int = Channel . OPTIONAL_CHANNEL , onBufferOverflow : BufferOverflow = BufferOverflow . SUSPEND ) : Flow < T >

/**
 * This function is called by [flowOn] (with context) and [buffer] (with capacity) operators
 * that are applied to this flow. Should not be used with [capacity] of [Channel.CONFLATED]
 * (it shall be desugared to `capacity = 0, onBufferOverflow = DROP_OLDEST`).
 */


public open fun dropChannelOperators ( ) : Flow < T > ?

= null

/**
 * When this [ChannelFlow] implementation can work without a channel (supports [Channel.OPTIONAL_CHANNEL]),
 * then it should return a non-null value from this function, so that a caller can use it without the effect of
 * additional [flowOn] and [buffer] operators, by incorporating its
 * [context], [capacity], and [onBufferOverflow] into its own implementation.
 */


public open fun produceImpl ( scope : CoroutineScope ) : ReceiveChannel < T >

= <EOL> scope . produce ( context , produceCapacity , onBufferOverflow , start = CoroutineStart . ATOMIC , block = collectToFun )

/**
 * Here we use ATOMIC start for a reason (#1825).
 * NB: [produceImpl] is used for [flowOn].
 * For non-atomic start it is possible to observe the situation,
 * where the pipeline after the [flowOn] call successfully executes (mostly, its `onCompletion`)
 * handlers, while the pipeline before does not, because it was cancelled during its dispatch.
 * Thus `onCompletion` and `finally` blocks won't be executed and it may lead to a different kinds of memory leaks.
 */


{ <EOL> val modelHub = TFModelHub ( cacheDirectory = File ( "<STR_LIT>" ) ) <EOL> val modelType = TFModels . CV . DenseNet121 ( ) <EOL> val model = modelHub . loadModel ( modelType ) <EOL> val imageNetClassLabels = Imagenet . V1k . labels ( ) <EOL> model . use { <EOL> it . compile ( optimizer = Adam ( ) , loss = Losses . MAE , metric = Metrics . ACCURACY ) <EOL> it . logSummary ( ) <EOL> val hdfFile = modelHub . loadWeights ( modelType ) <EOL> val weightPaths = listOf ( LayerConvOrDensePaths ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , LayerBatchNormPaths ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> recursivePrintGroupInHDF5File ( hdfFile , hdfFile ) <EOL> it . loadWeightsByPaths ( hdfFile , weightPaths , missedWeights = MissedWeightsStrategy . LOAD_CUSTOM_PATH ) <EOL> val fileDataLoader = modelType . createPreprocessing ( model ) . fileLoader ( ) <EOL> for ( i in <NUM_LIT:1> .. <NUM_LIT:8> ) { <EOL> val inputData = fileDataLoader . load ( getFileFromResource ( "<STR_LIT>" ) ) <EOL> val res = it . predictLabel ( inputData ) <EOL> println ( "<STR_LIT>" ) <EOL> val top5 = it . predictTop5Labels ( inputData , imageNetClassLabels ) <EOL> println ( top5 . toString ( ) ) <EOL> } <EOL> } <EOL> }

/**
 * This example demonstrates the inference concept on DenseNet121 model:
 * - Model configuration, model weights and labels are obtained from [TFModelHub].
 * - Weights are loaded from .h5 file, configuration is loaded from .json file.
 * - Model predicts on a few images located in resources.
 * - Special preprocessing (used in DenseNet121 during training on ImageNet dataset) is applied to the images before prediction.
 *
 * NOTE: Input resolution is 224*224
 */


= denseNet121Prediction ( )


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public actual inline fun < T > ( suspend ( ) -> T ) . startCoroutineUninterceptedOrReturn ( completion : Continuation < T > ) : Any ?

= startCoroutineUninterceptedOrReturnIntrinsic0 ( this , if ( this !is CoroutineImpl ) createSimpleCoroutineFromSuspendFunction ( completion ) else completion )

/**
 * Starts an unintercepted coroutine without a receiver and with result type [T] and executes it until its first suspension.
 * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends.
 * In the latter case, the [completion] continuation is invoked when the coroutine completes with a result or an exception.
 *
 * The coroutine is started directly in the invoker's thread without going through the [ContinuationInterceptor] that might
 * be present in the completion's [CoroutineContext]. It is the invoker's responsibility to ensure that a proper invocation
 * context is established.
 *
 * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of the suspended
 * coroutine using a reference to the suspending function.
 */


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public actual inline fun < R , T > ( suspend R . ( ) -> T ) . startCoroutineUninterceptedOrReturn ( receiver : R , completion : Continuation < T > ) : Any ?

= startCoroutineUninterceptedOrReturnIntrinsic1 ( this , receiver , if ( this !is CoroutineImpl ) createSimpleCoroutineFromSuspendFunction ( completion ) else completion )

/**
 * Starts an unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension.
 * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends.
 * In the latter case, the [completion] continuation is invoked when the coroutine completes with a result or an exception.
 *
 * The coroutine is started directly in the invoker's thread without going through the [ContinuationInterceptor] that might
 * be present in the completion's [CoroutineContext]. It is the invoker's responsibility to ensure that a proper invocation
 * context is established.
 *
 * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of the suspended
 * coroutine using a reference to the suspending function.
 */


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> public actual fun < T > ( suspend ( ) -> T ) . createCoroutineUnintercepted ( completion : Continuation < T > ) : Continuation < Unit >

{ <EOL> return createCoroutineFromSuspendFunction ( completion ) { <EOL> this . startCoroutineUninterceptedOrReturn ( completion ) <EOL> } <EOL> }

/**
 * Creates unintercepted coroutine without receiver and with result type [T].
 * This function creates a new, fresh instance of suspendable computation every time it is invoked.
 *
 * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance.
 * The [completion] continuation is invoked when coroutine completes with result or exception.
 *
 * This function returns unintercepted continuation.
 * Invocation of `resume(Unit)` starts coroutine immediately in the invoker's call stack without going through the
 * [ContinuationInterceptor] that might be present in the completion's [CoroutineContext].
 * It is the invoker's responsibility to ensure that a proper invocation context is established.
 * Note that [completion] of this function may get invoked in an arbitrary context.
 *
 * [Continuation.intercepted] can be used to acquire the intercepted continuation.
 * Invocation of `resume(Unit)` on intercepted continuation guarantees that execution of
 * both the coroutine and [completion] happens in the invocation context established by
 * [ContinuationInterceptor].
 *
 * Repeated invocation of any resume function on the resulting continuation corrupts the
 * state machine of the coroutine and may result in arbitrary behaviour or exception.
 */