@ kotlin . internal . InlineOnly <EOL> public actual inline fun ShortArray . asList ( ) : List < Short >

{ <EOL> return this . unsafeCast < Array < Short > > ( ) . asList ( ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun IntArray . asList ( ) : List < Int >

{ <EOL> return this . unsafeCast < Array < Int > > ( ) . asList ( ) <EOL> }

/**
 * Returns a [List] that wraps the original array.
 */


@ kotlin . internal . InlineOnly <EOL> public actual inline fun LongArray . asList ( ) : List < Long >

{ <EOL> return this . unsafeCast < Array < Long > > ( ) . asList ( ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun FloatArray . asList ( ) : List < Float >

{ <EOL> return this . unsafeCast < Array < Float > > ( ) . asList ( ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun DoubleArray . asList ( ) : List < Double >

{ <EOL> return this . unsafeCast < Array < Double > > ( ) . asList ( ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun BooleanArray . asList ( ) : List < Boolean >

{ <EOL> return this . unsafeCast < Array < Boolean > > ( ) . asList ( ) <EOL> }


public actual fun CharArray . asList ( ) : List < Char >

{ <EOL> return object : AbstractList < Char > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Char ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Char { <EOL> AbstractList . checkElementIndex ( index , size ) <EOL> return this@asList [ index ] <EOL> } <EOL> override fun indexOf ( element : Char ) : Int { <EOL> @ Suppress ( "<STR_LIT>" ) <EOL> if ( ( element as Any ? ) !is Char ) return - <NUM_LIT:1> <EOL> return this@asList . indexOf ( element ) <EOL> } <EOL> override fun lastIndexOf ( element : Char ) : Int { <EOL> @ Suppress ( "<STR_LIT>" ) <EOL> if ( ( element as Any ? ) !is Char ) return - <NUM_LIT:1> <EOL> return this@asList . lastIndexOf ( element ) <EOL> } <EOL> } <EOL> }


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public actual infix fun < T > Array < out T > . contentDeepEquals ( other : Array < out T > ) : Boolean

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

/**
 * Checks if the two specified arrays are *deeply* equal to one another.
 *
 * Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal.
 * That is, if two corresponding elements are nested arrays, they are also compared deeply.
 * Elements of other types are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * If any of the arrays contain themselves at any nesting level, the behavior is undefined.
 *
 * @param other the array to compare deeply with this array.
 * @return `true` if the two arrays are deeply equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.contentDeepEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun < T > Array < out T > ? . contentDeepEquals ( other : Array < out T > ? ) : Boolean

{ <EOL> return contentDeepEqualsImpl ( other ) <EOL> }

/**
 * Checks if the two specified arrays are *deeply* equal to one another.
 *
 * Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal.
 * That is, if two corresponding elements are nested arrays, they are also compared deeply.
 * Elements of other types are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * The arrays are also considered deeply equal if both are `null`.
 *
 * If any of the arrays contain themselves at any nesting level, the behavior is undefined.
 *
 * @param other the array to compare deeply with this array.
 * @return `true` if the two arrays are deeply equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.contentDeepEquals
 */


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public actual fun < T > Array < out T > . contentDeepHashCode ( ) : Int

{ <EOL> return this . contentDeepHashCode ( ) <EOL> }

/**
 * Returns a hash code based on the contents of this array as if it is [List].
 * Nested arrays are treated as lists too.
 *
 * If any of arrays contains itself on any nesting level the behavior is undefined.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentDeepHashCode ( ) : Int

{ <EOL> return contentDeepHashCodeInternal ( ) <EOL> }


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public actual fun < T > Array < out T > . contentDeepToString ( ) : String

{ <EOL> return this . contentDeepToString ( ) <EOL> }

/**
 * Returns a string representation of the contents of this array as if it is a [List].
 * Nested arrays are treated as lists too.
 *
 * If any of arrays contains itself on any nesting level that reference
 * is rendered as `"[...]"` to prevent recursion.
 *
 * @sample samples.collections.Arrays.ContentOperations.contentDeepToString
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentDeepToString ( ) : String

{ <EOL> return contentDeepToStringImpl ( ) <EOL> }


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun < T > Array < out T > ? . contentEquals ( other : Array < out T > ? ) : Boolean

{ <EOL> return contentEqualsInternal ( other ) <EOL> }

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * If the arrays contain nested arrays, use [contentDeepEquals] to recursively compare their elements.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.arrayContentEquals
 */


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

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.intArrayContentEquals
 */


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


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


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


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

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * This means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.doubleArrayContentEquals
 */


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


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

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.booleanArrayContentEquals
 */


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

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.charArrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentHashCode ( ) : Int

{ <EOL> return contentHashCodeInternal ( ) <EOL> }

/**
 * Returns a hash code based on the contents of this array as if it is [List].
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ByteArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ShortArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun IntArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun LongArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun FloatArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun DoubleArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun BooleanArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun CharArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentToString ( ) : String

{ <EOL> return this ? . joinToString ( "<STR_LIT:U+002CU+0020>" , "<STR_LIT:[>" , "<STR_LIT:]>" ) ? : "<STR_LIT:null>" <EOL> }

/**
 * Returns a string representation of the contents of the specified array as if it is [List].
 *
 * @sample samples.collections.Arrays.ContentOperations.contentToString
 */


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


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ShortArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun IntArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun LongArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun FloatArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun DoubleArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun BooleanArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun CharArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual inline fun < T > Array < out T > . copyInto ( destination : Array < T > , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : Array < T >

{ <EOL> arrayCopy ( this , destination , destinationOffset , startIndex , endIndex ) <EOL> return destination <EOL> }

/**
 * Copies this array or its subrange into the [destination] array and returns that array.
 *
 * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.
 *
 * @param destination the array to copy to.
 * @param destinationOffset the position in the [destination] array to copy to, 0 by default.
 * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.
 * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.
 *
 * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array 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.
 *
 * @return the [destination] array.
 */


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual inline fun ByteArray . copyInto ( destination : ByteArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : ByteArray

{ <EOL> arrayCopy ( this . unsafeCast < Array < Byte > > ( ) , destination . unsafeCast < Array < Byte > > ( ) , destinationOffset , startIndex , endIndex ) <EOL> return destination <EOL> }


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual inline fun ShortArray . copyInto ( destination : ShortArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : ShortArray

{ <EOL> arrayCopy ( this . unsafeCast < Array < Short > > ( ) , destination . unsafeCast < Array < Short > > ( ) , destinationOffset , startIndex , endIndex ) <EOL> return destination <EOL> }


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual inline fun IntArray . copyInto ( destination : IntArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : IntArray

{ <EOL> arrayCopy ( this . unsafeCast < Array < Int > > ( ) , destination . unsafeCast < Array < Int > > ( ) , destinationOffset , startIndex , endIndex ) <EOL> return destination <EOL> }


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual inline fun LongArray . copyInto ( destination : LongArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : LongArray

{ <EOL> arrayCopy ( this . unsafeCast < Array < Long > > ( ) , destination . unsafeCast < Array < Long > > ( ) , destinationOffset , startIndex , endIndex ) <EOL> return destination <EOL> }


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual inline fun FloatArray . copyInto ( destination : FloatArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : FloatArray

{ <EOL> arrayCopy ( this . unsafeCast < Array < Float > > ( ) , destination . unsafeCast < Array < Float > > ( ) , destinationOffset , startIndex , endIndex ) <EOL> return destination <EOL> }


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual inline fun DoubleArray . copyInto ( destination : DoubleArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : DoubleArray

{ <EOL> arrayCopy ( this . unsafeCast < Array < Double > > ( ) , destination . unsafeCast < Array < Double > > ( ) , destinationOffset , startIndex , endIndex ) <EOL> return destination <EOL> }


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual inline fun BooleanArray . copyInto ( destination : BooleanArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : BooleanArray

{ <EOL> arrayCopy ( this . unsafeCast < Array < Boolean > > ( ) , destination . unsafeCast < Array < Boolean > > ( ) , destinationOffset , startIndex , endIndex ) <EOL> return destination <EOL> }


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

{ <EOL> arrayCopy ( this . unsafeCast < Array < Char > > ( ) , destination . unsafeCast < Array < Char > > ( ) , destinationOffset , startIndex , endIndex ) <EOL> return destination <EOL> }


@ Suppress ( "<STR_LIT>" , "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline fun < T > Array < out T > . copyOf ( ) : Array < T >

{ <EOL> return this . asDynamic ( ) . slice ( ) <EOL> }

/**
 * Returns new array which is a copy of the original array.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.copyOf
 */


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline fun ByteArray . copyOf ( ) : ByteArray


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline fun ShortArray . copyOf ( ) : ShortArray


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline fun IntArray . copyOf ( ) : IntArray


public actual fun LongArray . copyOf ( ) : LongArray

{ <EOL> return withType ( "<STR_LIT>" , this . asDynamic ( ) . slice ( ) ) <EOL> }


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline fun FloatArray . copyOf ( ) : FloatArray


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline fun DoubleArray . copyOf ( ) : DoubleArray


public actual fun BooleanArray . copyOf ( ) : BooleanArray


public actual fun CharArray . copyOf ( ) : CharArray


public actual fun ByteArray . copyOf ( newSize : Int ) : ByteArray

{ <EOL> require ( newSize >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return fillFrom ( this , ByteArray ( newSize ) ) <EOL> }

/**
 * Returns new array which is a copy of the original array, resized to the given [newSize].
 * The copy is either truncated or padded at the end with zero values if necessary.
 *
 * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].
 * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf
 */


public actual fun ShortArray . copyOf ( newSize : Int ) : ShortArray

{ <EOL> require ( newSize >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return fillFrom ( this , ShortArray ( newSize ) ) <EOL> }


public actual fun IntArray . copyOf ( newSize : Int ) : IntArray

{ <EOL> require ( newSize >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return fillFrom ( this , IntArray ( newSize ) ) <EOL> }


public actual fun LongArray . copyOf ( newSize : Int ) : LongArray

{ <EOL> require ( newSize >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return withType ( "<STR_LIT>" , arrayCopyResize ( this , newSize , <NUM_LIT:0L> ) ) <EOL> }


public actual fun FloatArray . copyOf ( newSize : Int ) : FloatArray

{ <EOL> require ( newSize >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return fillFrom ( this , FloatArray ( newSize ) ) <EOL> }


public actual fun DoubleArray . copyOf ( newSize : Int ) : DoubleArray

{ <EOL> require ( newSize >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return fillFrom ( this , DoubleArray ( newSize ) ) <EOL> }


public actual fun BooleanArray . copyOf ( newSize : Int ) : BooleanArray

{ <EOL> require ( newSize >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return withType ( "<STR_LIT>" , arrayCopyResize ( this , newSize , false ) ) <EOL> }

/**
 * Returns new array which is a copy of the original array, resized to the given [newSize].
 * The copy is either truncated or padded at the end with `false` values if necessary.
 *
 * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].
 * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `false` values.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf
 */


public actual fun CharArray . copyOf ( newSize : Int ) : CharArray

{ <EOL> require ( newSize >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return withType ( "<STR_LIT>" , fillFrom ( this , CharArray ( newSize ) ) ) <EOL> }

/**
 * Returns new array which is a copy of the original array, resized to the given [newSize].
 * The copy is either truncated or padded at the end with null char (`\u0000`) values if necessary.
 *
 * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].
 * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with null char (`\u0000`) values.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf
 */


@ Suppress ( "<STR_LIT>" ) <EOL> public actual fun < T > Array < out T > . copyOf ( newSize : Int ) : Array < T ? >

{ <EOL> require ( newSize >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return arrayCopyResize ( this , newSize , null ) <EOL> }

/**
 * Returns new array which is a copy of the original array, resized to the given [newSize].
 * The copy is either truncated or padded at the end with `null` values if necessary.
 *
 * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].
 * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `null` values.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.resizingCopyOf
 */


@ Suppress ( "<STR_LIT>" ) <EOL> public actual fun < T > Array < out T > . copyOfRange ( fromIndex : Int , toIndex : Int ) : Array < T >

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> return this . asDynamic ( ) . slice ( fromIndex , toIndex ) <EOL> }

/**
 * Returns a new array which is a copy of the specified range of the original array.
 *
 * @param fromIndex the start of the range (inclusive) to copy.
 * @param toIndex the end of the range (exclusive) to copy.
 *
 * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 */


public actual fun ByteArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : ByteArray


public actual fun ShortArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : ShortArray


public actual fun IntArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : IntArray


public actual fun LongArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : LongArray

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> return withType ( "<STR_LIT>" , this . asDynamic ( ) . slice ( fromIndex , toIndex ) ) <EOL> }


public actual fun FloatArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : FloatArray


public actual fun DoubleArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : DoubleArray


public actual fun BooleanArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : BooleanArray


public actual fun CharArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : CharArray


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun < T > Array < T > . fill ( element : T , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> nativeFill ( element , fromIndex , toIndex ) <EOL> }

/**
 * Fills this array or its subrange with the specified [element] value.
 *
 * @param fromIndex the start of the range (inclusive) to fill, 0 by default.
 * @param toIndex the end of the range (exclusive) to fill, size of this array by default.
 *
 * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 */


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ByteArray . fill ( element : Byte , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ShortArray . fill ( element : Short , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun IntArray . fill ( element : Int , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun LongArray . fill ( element : Long , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun FloatArray . fill ( element : Float , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun DoubleArray . fill ( element : Double , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun BooleanArray . fill ( element : Boolean , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun CharArray . fill ( element : Char , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> nativeFill ( element . code , fromIndex , toIndex ) <EOL> }


@ Suppress ( "<STR_LIT>" , "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun < T > Array < out T > . plus ( element : T ) : Array < T >

{ <EOL> return this . asDynamic ( ) . concat ( arrayOf ( element ) ) <EOL> }

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun ByteArray . plus ( element : Byte ) : ByteArray

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


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun ShortArray . plus ( element : Short ) : ShortArray

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


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun IntArray . plus ( element : Int ) : IntArray

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


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun LongArray . plus ( element : Long ) : LongArray

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


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun FloatArray . plus ( element : Float ) : FloatArray

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


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun DoubleArray . plus ( element : Double ) : DoubleArray

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


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun BooleanArray . plus ( element : Boolean ) : BooleanArray

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


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun CharArray . plus ( element : Char ) : CharArray

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


@ Suppress ( "<STR_LIT>" ) <EOL> public actual operator fun < T > Array < out T > . plus ( elements : Collection < T > ) : Array < T >

{ <EOL> return arrayPlusCollection ( this , elements ) <EOL> }

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */


public actual operator fun ByteArray . plus ( elements : Collection < Byte > ) : ByteArray

{ <EOL> var index = size <EOL> val result = this . copyOf ( size + elements . size ) <EOL> for ( element in elements ) result [ index ++ ] = element <EOL> return result <EOL> }


public actual operator fun ShortArray . plus ( elements : Collection < Short > ) : ShortArray


public actual operator fun IntArray . plus ( elements : Collection < Int > ) : IntArray


public actual operator fun LongArray . plus ( elements : Collection < Long > ) : LongArray


public actual operator fun FloatArray . plus ( elements : Collection < Float > ) : FloatArray


public actual operator fun DoubleArray . plus ( elements : Collection < Double > ) : DoubleArray


public actual operator fun BooleanArray . plus ( elements : Collection < Boolean > ) : BooleanArray


public actual operator fun CharArray . plus ( elements : Collection < Char > ) : CharArray


@ Suppress ( "<STR_LIT>" , "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun < T > Array < out T > . plus ( elements : Array < out T > ) : Array < T >

{ <EOL> return this . asDynamic ( ) . concat ( elements ) <EOL> }

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun ByteArray . plus ( elements : ByteArray ) : ByteArray

{ <EOL> return primitiveArrayConcat ( this , elements ) <EOL> }


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun ShortArray . plus ( elements : ShortArray ) : ShortArray


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun IntArray . plus ( elements : IntArray ) : IntArray


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun LongArray . plus ( elements : LongArray ) : LongArray


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun FloatArray . plus ( elements : FloatArray ) : FloatArray


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun DoubleArray . plus ( elements : DoubleArray ) : DoubleArray


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun BooleanArray . plus ( elements : BooleanArray ) : BooleanArray


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline operator fun CharArray . plus ( elements : CharArray ) : CharArray


@ Suppress ( "<STR_LIT>" , "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> public actual inline fun < T > Array < out T > . plusElement ( element : T ) : Array < T >


public actual fun IntArray . sort ( ) : Unit

{ <EOL> nativeSort ( ) <EOL> }

/**
 * Sorts the array in-place.
 *
 * @sample samples.collections.Arrays.Sorting.sortArray
 */


public actual fun LongArray . sort ( ) : Unit

{ <EOL> @ Suppress ( "<STR_LIT:DEPRECATION>" ) <EOL> if ( size > <NUM_LIT:1> ) sort { a : Long , b : Long -> a . compareTo ( b ) } <EOL> }


public actual fun ByteArray . sort ( ) : Unit

{ <EOL> nativeSort ( ) <EOL> }


public actual fun ShortArray . sort ( ) : Unit

{ <EOL> nativeSort ( ) <EOL> }


public actual fun DoubleArray . sort ( ) : Unit

{ <EOL> nativeSort ( ) <EOL> }


public actual fun FloatArray . sort ( ) : Unit

{ <EOL> nativeSort ( ) <EOL> }


public actual fun CharArray . sort ( ) : Unit

{ <EOL> nativeSort ( :: primitiveCompareTo ) <EOL> }


public actual fun < T : Comparable < T > > Array < out T > . sort ( ) : Unit

{ <EOL> if ( size > <NUM_LIT:1> ) sortArray ( this ) <EOL> }

/**
 * Sorts the array in-place according to the natural order of its elements.
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 *
 * @sample samples.collections.Arrays.Sorting.sortArrayOfComparable
 */


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.6>" ) <EOL> public fun < T > Array < out T > . sort ( comparison : ( a : T , b : T ) -> Int ) : Unit

{ <EOL> if ( size > <NUM_LIT:1> ) sortArrayWith ( this , comparison ) <EOL> }

/**
 * Sorts the array in-place according to the order specified by the given [comparison] function.
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun < T : Comparable < T > > Array < out T > . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> sortArrayWith ( this , fromIndex , toIndex , naturalOrder ( ) ) <EOL> }

/**
 * Sorts a range in the array in-place.
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 *
 * @param fromIndex the start of the range (inclusive) to sort, 0 by default.
 * @param toIndex the end of the range (exclusive) to sort, size of this array by default.
 *
 * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 *
 * @sample samples.collections.Arrays.Sorting.sortRangeOfArrayOfComparable
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ByteArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> val subarray = this . asDynamic ( ) . subarray ( fromIndex , toIndex ) . unsafeCast < ByteArray > ( ) <EOL> subarray . sort ( ) <EOL> }

/**
 * Sorts a range in the array in-place.
 *
 * @param fromIndex the start of the range (inclusive) to sort, 0 by default.
 * @param toIndex the end of the range (exclusive) to sort, size of this array by default.
 *
 * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 *
 * @sample samples.collections.Arrays.Sorting.sortRangeOfArray
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ShortArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> val subarray = this . asDynamic ( ) . subarray ( fromIndex , toIndex ) . unsafeCast < ShortArray > ( ) <EOL> subarray . sort ( ) <EOL> }


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun IntArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> val subarray = this . asDynamic ( ) . subarray ( fromIndex , toIndex ) . unsafeCast < IntArray > ( ) <EOL> subarray . sort ( ) <EOL> }


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun LongArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> sortArrayWith ( this . unsafeCast < Array < Long > > ( ) , fromIndex , toIndex , naturalOrder ( ) ) <EOL> }


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun FloatArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> val subarray = this . asDynamic ( ) . subarray ( fromIndex , toIndex ) . unsafeCast < FloatArray > ( ) <EOL> subarray . sort ( ) <EOL> }


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun DoubleArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> val subarray = this . asDynamic ( ) . subarray ( fromIndex , toIndex ) . unsafeCast < DoubleArray > ( ) <EOL> subarray . sort ( ) <EOL> }


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun CharArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> sortArrayWith ( this . unsafeCast < Array < Char > > ( ) , fromIndex , toIndex , naturalOrder ( ) ) <EOL> }


@ Deprecated ( "<STR_LIT>" ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.6>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun ByteArray . sort ( noinline comparison : ( a : Byte , b : Byte ) -> Int ) : Unit

{ <EOL> nativeSort ( comparison ) <EOL> }

/**
 * Sorts the array in-place according to the order specified by the given [comparison] function.
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.6>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun ShortArray . sort ( noinline comparison : ( a : Short , b : Short ) -> Int ) : Unit


@ Deprecated ( "<STR_LIT>" ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.6>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun IntArray . sort ( noinline comparison : ( a : Int , b : Int ) -> Int ) : Unit


@ Deprecated ( "<STR_LIT>" ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.6>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun LongArray . sort ( noinline comparison : ( a : Long , b : Long ) -> Int ) : Unit


@ Deprecated ( "<STR_LIT>" ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.6>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun FloatArray . sort ( noinline comparison : ( a : Float , b : Float ) -> Int ) : Unit


@ Deprecated ( "<STR_LIT>" ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.6>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun DoubleArray . sort ( noinline comparison : ( a : Double , b : Double ) -> Int ) : Unit


@ Deprecated ( "<STR_LIT>" ) <EOL> @ DeprecatedSinceKotlin ( warningSince = "<STR_LIT:1.6>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun CharArray . sort ( noinline comparison : ( a : Char , b : Char ) -> Int ) : Unit


public actual fun < T > Array < out T > . sortWith ( comparator : Comparator < in T > ) : Unit

{ <EOL> if ( size > <NUM_LIT:1> ) sortArrayWith ( this , comparator ) <EOL> }

/**
 * Sorts the array in-place according to the order specified by the given [comparator].
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun < T > Array < out T > . sortWith ( comparator : Comparator < in T > , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> sortArrayWith ( this , fromIndex , toIndex , comparator ) <EOL> }

/**
 * Sorts a range in the array in-place with the given [comparator].
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 *
 * @param fromIndex the start of the range (inclusive) to sort, 0 by default.
 * @param toIndex the end of the range (exclusive) to sort, size of this array by default.
 *
 * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 */


public actual fun ByteArray . toTypedArray ( ) : Array < Byte >

{ <EOL> return js ( "<STR_LIT>" ) . slice . call ( this ) <EOL> }

/**
 * Returns a *typed* object array containing all of the elements of this primitive array.
 */


public actual fun ShortArray . toTypedArray ( ) : Array < Short >


public actual fun IntArray . toTypedArray ( ) : Array < Int >


public actual fun LongArray . toTypedArray ( ) : Array < Long >


public actual fun FloatArray . toTypedArray ( ) : Array < Float >


public actual fun DoubleArray . toTypedArray ( ) : Array < Double >


public actual fun BooleanArray . toTypedArray ( ) : Array < Boolean >


public actual fun CharArray . toTypedArray ( ) : Array < Char >

{ <EOL> return Array ( size ) { index -> this [ index ] } <EOL> }


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> public actual fun < T , K > Grouping < T , K > . eachCount ( ) : Map < K , Int >

= <EOL> fold ( <NUM_LIT:0> ) { acc , _ -> acc + <NUM_LIT:1> }

/**
 * Groups elements from the [Grouping] source by key and counts elements in each group.
 *
 * @return a [Map] associating the key of each group with the count of elements in the group.
 *
 * @sample samples.collections.Grouping.groupingByEachCount
 */


fun canBeEvaluatedAtCompileTime ( expression : FirExpression ? , session : FirSession , allowErrors : Boolean , calledOnCheckerStage : Boolean , ) : Boolean

{ <EOL> val result = computeConstantExpressionKind ( expression , session , calledOnCheckerStage ) <EOL> return result == ConstantArgumentKind . VALID_CONST || allowErrors && result == ConstantArgumentKind . RESOLUTION_ERROR <EOL> }

/**
 * See the documentation to [computeConstantExpressionKind] function below
 */


fun computeConstantExpressionKind ( expression : FirExpression ? , session : FirSession , calledOnCheckerStage : Boolean ) : ConstantArgumentKind

{ <EOL> if ( expression == null ) return ConstantArgumentKind . RESOLUTION_ERROR <EOL> return expression . accept ( FirConstCheckVisitor ( session , calledOnCheckerStage ) , null ) <EOL> }

/**
 * This function computes if given [expression] can be counted as a constant expression or not
 * It returns a [ConstantArgumentKind], which can be used to understand why exactly the expression is not constant
 *
 * Precise computation of this [ConstantArgumentKind] may require resolution of initializer of non-const properties, which is allowed
 * to do only on BODY_RESOLVE phase and checkers phase. Without it, the result may be less precise but still correct (it may return
 * the general [ConstantArgumentKind.NOT_CONST] instead more specific [ConstantArgumentKind.NOT_KCLASS_LITERAL] for example)
 *
 * So, to allow using this function not only from checkers there is a @param [calledOnCheckerStage], which should be set to [true] ONLY
 * if this method is called from checkers
 */


public inline fun < reified T : Node > forEach ( block : ( T ) -> Unit )

{ <EOL> var cur : Node = _next <EOL> while ( cur != this ) { <EOL> if ( cur is T ) block ( cur ) <EOL> cur = cur . _next <EOL> } <EOL> }

/**
 * Iterates over all elements in this list of a specified type.
 */


{ <EOL> val ( train , _ ) = mnist ( ) <EOL> val inferenceModel = TensorFlowInferenceModel . load ( File ( PATH_TO_MODEL ) , loadOptimizerState = true ) <EOL> var copiedInferenceModel : TensorFlowInferenceModel <EOL> inferenceModel . use { <EOL> var accuracy = <NUM_LIT:0.0> <EOL> val amountOfTestSet = <NUM_LIT> <EOL> for ( imageId in <NUM_LIT:0> .. amountOfTestSet ) { <EOL> val prediction = it . predict ( train . getX ( imageId ) ) <EOL> if ( prediction == train . getY ( imageId ) . toInt ( ) ) <EOL> accuracy += ( <NUM_LIT:1.0> / amountOfTestSet ) <EOL> } <EOL> println ( "<STR_LIT>" ) <EOL> copiedInferenceModel = inferenceModel . copy ( "<STR_LIT>" ) <EOL> } <EOL> copiedInferenceModel . use { <EOL> var accuracy = <NUM_LIT:0.0> <EOL> val amountOfTestSet = <NUM_LIT> <EOL> for ( imageId in <NUM_LIT:0> .. amountOfTestSet ) { <EOL> val prediction = it . predict ( train . getX ( imageId ) ) <EOL> if ( prediction == train . getY ( imageId ) . toInt ( ) ) <EOL> accuracy += ( <NUM_LIT:1.0> / amountOfTestSet ) <EOL> } <EOL> println ( "<STR_LIT>" ) <EOL> } <EOL> }

/**
 * Inference model is used here,
 * separately from model training code to illustrate the ability
 * to load model graph and weights to start prediction process.
 *
 * After loading and evaluation, the Inference model is copied and evaluated again.
 *
 * NOTE: The example requires the saved model in the appropriate directory (run [lenetOnMnistDatasetExportImportToTxt] firstly).
 */


fun getSmartCastVariantsExcludingReceiver ( context : ResolutionContext < * > , receiverToCast : ReceiverValue ) : Collection < KotlinType >

{ <EOL> return getSmartCastVariantsExcludingReceiver ( context . trace . bindingContext , context . scope . ownerDescriptor , context . dataFlowInfo , receiverToCast , context . languageVersionSettings , context . dataFlowValueFactory ) <EOL> }

/**
 * @return variants @param receiverToCast may be cast to according to context dataFlowInfo, receiverToCast itself is NOT included
 */


private fun getSmartCastVariantsExcludingReceiver ( bindingContext : BindingContext , containingDeclarationOrModule : DeclarationDescriptor , dataFlowInfo : DataFlowInfo , receiverToCast : ReceiverValue , languageVersionSettings : LanguageVersionSettings , dataFlowValueFactory : DataFlowValueFactory ) : Collection < KotlinType >

{ <EOL> val dataFlowValue = dataFlowValueFactory . createDataFlowValue ( receiverToCast , bindingContext , containingDeclarationOrModule ) <EOL> return dataFlowInfo . getCollectedTypes ( dataFlowValue , languageVersionSettings ) <EOL> }

/**
 * @return variants @param receiverToCast may be cast to according to @param dataFlowInfo, @param receiverToCast itself is NOT included
 */


private fun initFragmentedScript ( charSeq : CharSequence = "<STR_LIT:abc>" , randomCharPool : Boolean , lines : Int = charSeq . length ) : FragmentedText

{ <EOL> val generateFragment : FragmentedText . ( Int ) -> FragmentedText = when { <EOL> randomCharPool -> { _ -> addRandomFragment ( ) } <EOL> else -> { line : Int -> <EOL> val index = line % charSeq . length <EOL> addFragment ( charSeq [ index ] . toString ( ) . repeat ( <NUM_LIT:3> ) ) <EOL> } <EOL> } <EOL> return ( <NUM_LIT:1> .. lines ) . fold ( FragmentedText ( ) ) { frag , line -> <EOL> frag . generateFragment ( line ) <EOL> } <EOL> }

/**
 * Generates text
 * if randomCharPool is false from charSequence
 * - for each char in [charSeq] it adds line of length of 3 to the generated text
 * if randomCharPool is true
 * - picks characters randomly, line count is [lines], line length is 28, some number bigger than alphabet size
 */


internal suspend fun getCommonSourceSetsForMetadataCompilation ( project : Project ) : Set < KotlinSourceSet >

{ <EOL> if ( ! project . shouldCompileIntermediateSourceSetsToMetadata ) <EOL> return setOf ( project . multiplatformExtension . awaitSourceSets ( ) . getByName ( KotlinSourceSet . COMMON_MAIN_SOURCE_SET_NAME ) ) <EOL> val compilationsBySourceSet : Map < KotlinSourceSet , Set < KotlinCompilation < * > > > = <EOL> project . kotlinExtension . awaitSourceSets ( ) . associateWith { it . internal . awaitPlatformCompilations ( ) } <EOL> val sourceSetsUsedInMultipleTargets = compilationsBySourceSet . filterValues { compilations -> <EOL> compilations . map { it . target . platformType } . distinct ( ) . run { <EOL> size > <NUM_LIT:1> || singleOrNull ( ) == KotlinPlatformType . native && compilations . map { it . target } . distinct ( ) . size > <NUM_LIT:1> <EOL> } <EOL> } <EOL> val publishedCompilations = getPublishedPlatformCompilations ( project ) . values <EOL> return sourceSetsUsedInMultipleTargets <EOL> . filterValues { compilations -> compilations . any { it in publishedCompilations } } <EOL> . keys <EOL> }

/**
 * @return All common source sets that can potentially be published. Right now, not all combinations of platforms actually
 * support metadata compilation (see [KotlinMetadataTargetConfigurator.isMetadataCompilationSupported].
 * Those compilations will be created but the corresponding tasks will be disabled.
 */


fun createStandaloneAnalysisApiSession ( tempDir : File , kotlinSourceModuleName : String = defaultKotlinSourceModuleName , kotlinSources : Map < String , String > , dependencyKlibs : List < Path > = emptyList ( ) , ) : StandaloneAnalysisAPISession

{ <EOL> val testModuleRoot = tempDir . resolve ( "<STR_LIT>" ) <EOL> testModuleRoot . mkdirs ( ) <EOL> kotlinSources . forEach { ( fileName , sourceCode ) -> <EOL> testModuleRoot . resolve ( fileName ) . apply { <EOL> writeText ( sourceCode ) <EOL> } <EOL> } <EOL> return createStandaloneAnalysisApiSession ( kotlinSourceModuleName , listOf ( testModuleRoot ) , dependencyKlibs ) <EOL> }

/**
 * Creates a standalone analysis session from Kotlin source code passed as [kotlinSources]
 */


fun createStandaloneAnalysisApiSession ( kotlinSourceModuleName : String = defaultKotlinSourceModuleName , kotlinFiles : List < File > , dependencyKlibs : List < Path > = emptyList ( ) , ) : StandaloneAnalysisAPISession

{ <EOL> val currentArchitectureTarget = HostManager . host <EOL> val nativePlatform = NativePlatforms . nativePlatformByTargets ( listOf ( currentArchitectureTarget ) ) <EOL> return buildStandaloneAnalysisAPISession { <EOL> @ OptIn ( KtAnalysisApiInternals :: class ) <EOL> registerProjectService ( KtLifetimeTokenProvider :: class . java , KtAlwaysAccessibleLifetimeTokenProvider ( ) ) <EOL> buildKtModuleProvider { <EOL> platform = nativePlatform <EOL> val stdlibModule = addModule ( buildKtLibraryModule { <EOL> addBinaryRoot ( Path ( kotlinNativeStdlibPath ) ) <EOL> platform = nativePlatform <EOL> libraryName = "<STR_LIT>" <EOL> } ) <EOL> val dependencyKlibModules = dependencyKlibs . map { klib -> <EOL> buildKtLibraryModule { <EOL> addBinaryRoot ( klib ) <EOL> platform = nativePlatform <EOL> libraryName = klib . nameWithoutExtension <EOL> addRegularDependency ( stdlibModule ) <EOL> } <EOL> } <EOL> addModule ( buildKtSourceModule { <EOL> addSourceRoots ( kotlinFiles . map { it . toPath ( ) } ) <EOL> addRegularDependency ( stdlibModule ) <EOL> dependencyKlibModules . forEach { dependencyKlibModule -> <EOL> addRegularDependency ( dependencyKlibModule ) <EOL> } <EOL> platform = nativePlatform <EOL> moduleName = kotlinSourceModuleName <EOL> } ) <EOL> } <EOL> } <EOL> }

/**
 * Creates a standalone analysis session from [kotlinFiles] on disk.
 * The Kotlin/Native stdlib will be provided as dependency
 */


public fun merge ( providers : List < P > ) : P

/**
 * Merges the given [providers] into a single provider. When possible, mergers will try to create a provider that is more efficient
 * compared to the naive sequential composite provider. Not all providers might be mergeable, or there might be multiple separate sets
 * of providers that can be merged individually, so the resulting provider may be a composite provider.
 */


private fun CharSequence . findLineTerminator ( from : Int , to : Int ) : Int

= <EOL> ( from until to ) . firstOrNull { lineTerminator . isLineTerminator ( this [ it ] ) } ? : to

/**
 * Find the first line terminator between [from] (inclusive) and [to] (exclusive) indices.
 * Returns [to] if no terminator found.
 */


private fun findBackLineTerminator ( from : Int , to : Int , testString : CharSequence ) : Int

= <EOL> ( from until to ) . lastOrNull { lineTerminator . isLineTerminator ( testString [ it ] ) } ? : from - <NUM_LIT:1>

/**
 * Find the first line terminator between [from] (inclusive) and [to] (exclusive) indices.
 * Returns [from - 1] if no terminator found.
 */


internal fun tzdbPaths ( defaultTzdbPath : Path ? )

= sequence { <EOL> defaultTzdbPath ? . let { yield ( it ) } <EOL> yieldAll ( listOf ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) . map { Path . fromString ( it ) } ) <EOL> pathToSystemDefault ( ) ? . first ? . let { yield ( it ) } <EOL> }

/** The directories checked for a valid timezone database. */


private fun findResultTypeForInnerVariableIfNeeded ( provideDelegate : FirFunctionCall , candidate : Candidate ) : Pair < TypeConstructorMarker , ConeKotlinType > ?

{ <EOL> val returnTypeBasedOnVariable = <EOL> components . typeFromCallee ( provideDelegate ) . type <EOL> . let ( candidate . substitutor :: substituteOrSelf ) <EOL> . unwrapTopLevelVariableType ( ) ? : return null <EOL> val typeVariable = returnTypeBasedOnVariable . typeConstructor <EOL> val candidateSystem = candidate . system <EOL> val candidateStorage = candidateSystem . currentStorage ( ) <EOL> val variableWithConstraints = <EOL> candidateSystem . notFixedTypeVariables [ typeVariable ] ? : error ( "<STR_LIT>" ) <EOL> var resultType : ConeKotlinType ? = null <EOL> candidateSystem . withTypeVariablesThatAreCountedAsProperTypes ( candidateSystem . outerTypeVariables . orEmpty ( ) ) { <EOL> resultType = inferenceComponents . resultTypeResolver . findResultTypeOrNull ( candidateSystem , variableWithConstraints , TypeVariableDirectionCalculator . ResolveDirection . UNKNOWN ) as? ConeKotlinType ? : return@withTypeVariablesThatAreCountedAsProperTypes <EOL> check ( ! candidateStorage . hasContradiction ) { "<STR_LIT>" } <EOL> candidateSystem . addEqualityConstraint ( returnTypeBasedOnVariable , resultType ! ! , ProvideDelegateFixationPosition ) <EOL> check ( ! candidateStorage . hasContradiction ) { <EOL> "<STR_LIT>" + <EOL> "<STR_LIT>" <EOL> } <EOL> } <EOL> return resultType ? . let { <EOL> typeVariable to it <EOL> } <EOL> }

/**
 * For supporting the case when `provideDelegate` has a signature with type variable as a return type, like
 * fun <K> K.provideDelegate(receiver: Any?, property: kotlin.reflect.KProperty<*>): K = this
 *
 * Here, if delegate expression returns something like `Delegate<Tv>` where Tv is a variable and the `Delegate` class contains
 * the member `getValue`, we need to fix `K` into `Delegate<Tv>`, so that resulting `provideDelegate()` expression would have the type,
 * so we could look into its member scope (as we can't look into the member scope of `K` type variable).
 *
 * On another hand, we can't just actually fix `K` variable (or just run FULL completion there) as the current result might refer
 * other not fixed yet type variables, and we would break the contract that fixation results should not contain other type variables.
 *
 * Thus, to support exactly the case when we had to look into the member scope of `K`, we just pretend like we fixing it
 *
 * @see compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateResolutionWithStubTypes.kt
 *
 * In K1, it was working because we used stub types that are not counted as actual type variables, and we've been completing
 * `provideDelegate` FULLy in the context where outer type variables were stubs (thus counted as proper types).
 *
 * But in K2, we decided to get rid of the stub type concept and just stick to the type variables.
 *
 * @return K to Delegate<Tv> or null in case return type of `provideDelegate` is not a type variable.
 *
 * TODO: reconsider the place where the function belong and it necessity after PCLA is implemented (KT-61740 for tracking)
 */


private fun FirProperty . resolveAccessors ( mayResolveSetterBody : Boolean , shouldResolveEverything : Boolean = true , )

{ <EOL> resolveGetter ( shouldResolveEverything ) <EOL> if ( returnTypeRef is FirImplicitTypeRef ) { <EOL> storeVariableReturnType ( this ) <EOL> getter ? . transformTypeWithPropertyType ( returnTypeRef , forceUpdateForNonImplicitTypes = true ) <EOL> } <EOL> resolveSetter ( mayResolveSetterBody , shouldResolveEverything ) <EOL> }

/**
 * Note that this function updates the return type of the property using type from setter, if the property itself had
 * an implicit return type
 *
 * In IDE there's a need to resolve setter's parameter types on the implicit-resolution stage
 * See ad183434137939a0c9eeea2f7df9ef522672a18e commit.
 * But for delegate inference case, we don't need both body of the setter and its parameter resolved (SKIP mode)
 */


private fun graph ( vararg edges : Pair < Fun , Fun > )

{ <EOL> for ( ( from , to ) in edges ) { <EOL> from . overriddenFunctions . add ( to ) <EOL> } <EOL> fun findAllReachableDeclarations ( from : Fun ) : MutableSet < Fun > { <EOL> val handler = object : DFS . NodeHandlerWithListResult < Fun , Fun > ( ) { <EOL> override fun afterChildren ( current : Fun ) { <EOL> if ( current . isDeclaration ) { <EOL> result . add ( current ) <EOL> } <EOL> } <EOL> } <EOL> DFS . dfs ( listOf ( from ) , { it . getOverridden ( ) } , handler ) <EOL> val result = HashSet ( handler . result ( ) ) <EOL> result . remove ( from ) <EOL> return result <EOL> } <EOL> val vertices = edges . flatMapTo ( HashSet ( ) ) { pair -> listOf ( pair . first , pair . second ) } <EOL> for ( vertex in vertices ) { <EOL> val directConcreteSuperFunctions = vertex . overriddenFunctions . filter { ! it . isAbstract } <EOL> assert ( directConcreteSuperFunctions . size <= <NUM_LIT:1> ) { <EOL> "<STR_LIT>" + <EOL> "<STR_LIT>" + <EOL> "<STR_LIT>" <EOL> } <EOL> if ( vertex . isDeclaration ) continue <EOL> val superDeclarations = findAllReachableDeclarations ( vertex ) <EOL> assert ( superDeclarations . isNotEmpty ( ) ) { "<STR_LIT>" } <EOL> val toRemove = HashSet < Fun > ( ) <EOL> for ( superDeclaration in superDeclarations ) { <EOL> toRemove . addAll ( findAllReachableDeclarations ( superDeclaration ) ) <EOL> } <EOL> superDeclarations . removeAll ( toRemove ) <EOL> val concreteDeclarations = superDeclarations . filter { ! it . isAbstract } <EOL> if ( ! vertex . isAbstract ) { <EOL> assert ( concreteDeclarations . isNotEmpty ( ) ) { <EOL> "<STR_LIT>" <EOL> } <EOL> assert ( concreteDeclarations . size == <NUM_LIT:1> ) { <EOL> "<STR_LIT>" + <EOL> "<STR_LIT>" <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * Constructs a graph out of the given pairs of vertices. First vertex should be a function in the derived class,
 * second -- the corresponding overridden function in a superclass.
 *
 * Checks that the graph satisfies the following conditions:
 * 1. Each fake override should have a super-declaration
 * 2. Each concrete fake override should have exactly one concrete super-declaration. More accurately, for each concrete
 * fake override F there is a concrete declaration D in supertypes such that every other concrete super-declaration of F
 * is either reachable from D or is reachable from any abstract super-declaration of F (or both). This condition is effectively
 * equivalent to the compiler guarantee that each class inherits not more than one implementation of each function.
 *
 * NOTE: the graph validation procedure probably doesn't cover all the possible cases compared to the analogous code in the compiler.
 * There may be bugs here and they should be fixed accordingly.
 *
 * TODO: also verify that no abstract fake override has a concrete super-declaration.
 * This was previously possible via traits with required classes.
 */


fun findJvmAgentJar ( classpath : FileCollection , archiveOperations : ArchiveOperations ) : File

/**
 * Find jar-file with JVM online instrumentation agent in classpath, loaded from [jvmAgentDependency].
 */


fun jvmAgentArgs ( jarFile : File , tempDir : File , binReportFile : File , excludedClasses : Set < String > ) : List < String >

/**
 * Generate additional JVM argument for test task.
 */


fun xmlReport ( xmlFile : File , title : String , context : ReportContext )


fun binaryReport ( binary : File , context : ReportContext )

/**
 * Generate binary report in IntelliJ format (Kover-only).
 */


fun htmlReport ( htmlDir : File , title : String , charset : String ? , context : ReportContext )


fun verify ( rules : List < VerificationRule > , context : ReportContext ) : List < RuleViolations >


fun collectCoverage ( request : CoverageRequest , outputFile : File , context : ReportContext )

/**
 * Calculate coverage according to the specified parameters [request], for each grouped entity.
 */


private fun DocTag . firstParagraph ( ) : P ?

{ <EOL> val firstChildParagraph = children . mapNotNull { it . firstParagraph ( ) } . firstOrNull ( ) <EOL> return if ( firstChildParagraph == null && this is P ) this <EOL> else firstChildParagraph <EOL> }

/**
 * @return The very first, most inner paragraph. If any [P] is wrapped inside another [P], the inner one
 * is preferred.
 */


@ JvmStatic <EOL> fun doMain ( compiler : CLITool < * > , args : Array < String > )

{ <EOL> if ( System . getProperty ( "<STR_LIT>" ) == null ) { <EOL> System . setProperty ( "<STR_LIT>" , "<STR_LIT:true>" ) <EOL> } <EOL> if ( CompilerSystemProperties . KOTLIN_COLORS_ENABLED_PROPERTY . value == null ) { <EOL> CompilerSystemProperties . KOTLIN_COLORS_ENABLED_PROPERTY . value = "<STR_LIT:true>" <EOL> } <EOL> setupIdeaStandaloneExecution ( ) <EOL> val exitCode = doMainNoExit ( compiler , args ) <EOL> if ( exitCode != ExitCode . OK ) { <EOL> exitProcess ( exitCode . code ) <EOL> } <EOL> }

/**
 * Useful main for derived command line tools
 */


fun tryConsumeNull ( doConsume : Boolean = true ) : Boolean

{ <EOL> var current = skipWhitespaces ( ) <EOL> current = prefetchOrEof ( current ) <EOL> val len = source . length - current <EOL> if ( len < <NUM_LIT:4> || current == - <NUM_LIT:1> ) return false <EOL> for ( i in <NUM_LIT:0> .. <NUM_LIT:3> ) { <EOL> if ( NULL [ i ] != source [ current + i ] ) return false <EOL> } <EOL> if ( len > <NUM_LIT:4> && charToTokenClass ( source [ current + <NUM_LIT:4> ] ) == TC_OTHER ) return false <EOL> if ( doConsume ) { <EOL> currentPosition = current + <NUM_LIT:4> <EOL> } <EOL> return true <EOL> }

/**
 * Tries to consume `null` token from input.
 * Returns `false` if the next 4 chars in input are not `null`,
 * `true` otherwise and consumes it if [doConsume] is `true`.
 */


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

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

/**
 * Maps the `upper` 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 > upper ( column : KProperty < T > ) : PositionalMapping < T >

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

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


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

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

/**
 * Maps the `upper` 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 > upper ( values : Iterable < T > ) : PositionalMapping < T >

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

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


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

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

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


= UtcOffset ( seconds = totalSeconds )

/**
 * Converts this offset to a [UtcOffset].
 *
 * @throws IllegalArgumentException if the offset is not in the range [-18 hours, +18 hours].
 */


fun readIfPresent ( reader : BinaryDataReader ) : PosixTzString ?

= reader . readPosixTzString ( )

/**
 * Reads a POSIX TZ string from the [reader] if it is present, or returns `null` if it is not.
 *
 * The string format is described in https://pubs.opengroup.org/onlinepubs/9699919799/, section 8.3,
 * with additional extensions in https://datatracker.ietf.org/doc/html/rfc8536#section-3.3.1
 *
 * @throws IllegalArgumentException if the string is invalid
 * @throws IllegalStateException if the string is invalid
 */


public abstract fun compile ( optimizer : Optimizer , loss : Losses , metric : Metrics )

/**
 * Configures the model for training.
 *
 * NOTE: Set up [isModelCompiled] to True.
 *
 * @param [optimizer] Optimizer instance.
 * @param [loss] Loss function.
 * @param [metric] Metric to evaluate during training.
 */


public abstract fun compile ( optimizer : Optimizer , loss : LossFunction , metric : Metric )


public abstract fun compile ( optimizer : Optimizer , loss : Losses , metric : Metric )


public abstract fun compile ( optimizer : Optimizer , loss : LossFunction , metric : Metrics )


public abstract fun compile ( optimizer : Optimizer , loss : LossFunction , metrics : List < Metric > )

/**
 * Configures the model for training.
 *
 * NOTE: Set up [isModelCompiled] to True.
 *
 * @param [optimizer] Optimizer instance.
 * @param [loss] Loss function.
 * @param [metrics] Metrics to evaluate during training.
 */


public fun fit ( dataset : Dataset , epochs : Int = <NUM_LIT:5> , batchSize : Int = <NUM_LIT> , callback : Callback ) : TrainingHistory

{ <EOL> return fit ( dataset , epochs , batchSize , listOf ( callback ) ) <EOL> }

/**
 * Trains the model for a fixed number of [epochs] (iterations over a dataset).
 *
 * @param [dataset] The train dataset that combines input data (X) and target data (Y).
 * @param [epochs] Number of epochs to train the model. An epoch is an iteration over the entire x and y data provided.
 * @param [batchSize] Number of samples per gradient update.
 * True (default) = Weights are initialized at the beginning of the training phase.
 * False = Weights are not initialized during training phase. It should be initialized before (via transfer learning or init() method call).
 * @param [callback] Callback to be used during training phase.
 *
 * @return A [TrainingHistory] object. Its [TrainingHistory.batchHistory] attribute is a record of training loss values and metrics values per each batch and epoch.
 */


public abstract fun fit ( dataset : Dataset , epochs : Int = <NUM_LIT:5> , batchSize : Int = <NUM_LIT> , callbacks : List < Callback > = listOf ( ) ) : TrainingHistory

/**
 * Trains the model for a fixed number of [epochs] (iterations over a dataset).
 *
 * @param [dataset] The train dataset that combines input data (X) and target data (Y).
 * @param [epochs] Number of epochs to train the model. An epoch is an iteration over the entire x and y data provided.
 * @param [batchSize] Number of samples per gradient update.
 * True (default) = Weights are initialized at the beginning of the training phase.
 * False = Weights are not initialized during training phase. It should be initialized before (via transfer learning or init() method call).
 * @param [callbacks] Callbacks to be used during training phase.
 *
 * @return A [TrainingHistory] object. Its [TrainingHistory.batchHistory] attribute is a record of training loss values and metrics values per each batch and epoch.
 */


public fun fit ( trainingDataset : Dataset , validationDataset : Dataset , epochs : Int = <NUM_LIT:5> , trainBatchSize : Int = <NUM_LIT> , validationBatchSize : Int = <NUM_LIT> , callback : Callback ) : TrainingHistory

{ <EOL> return fit ( trainingDataset , validationDataset , epochs , trainBatchSize , validationBatchSize , listOf ( callback ) ) <EOL> }

/**
 * Trains the model for a fixed number of [epochs] (iterations over a dataset).
 *
 * @param [trainingDataset] The train dataset that combines input data (X) and target data (Y).
 * @param [validationDataset] The validation dataset that combines input data (X) and target data (Y).
 * @param [epochs] Number of epochs to train the model. An epoch is an iteration over the entire x and y data provided.
 * @param [trainBatchSize] Number of samples per gradient update.
 * @param [validationBatchSize] Number of samples per validation batch.
 * True (default) = optimizer variables are initialized at the beginning of the training phase.
 * False = optimizer variables are not initialized during training phase. It should be initialized before (via transfer learning).
 * @param [callback] Callback to be used during training phase.
 *
 * @return A [TrainingHistory] object. It contains records with training/validation loss values and metrics per each batch and epoch.
 */


public abstract fun fit ( trainingDataset : Dataset , validationDataset : Dataset , epochs : Int = <NUM_LIT:5> , trainBatchSize : Int = <NUM_LIT> , validationBatchSize : Int = <NUM_LIT> , callbacks : List < Callback > = listOf ( ) ) : TrainingHistory

/**
 * Trains the model for a fixed number of [epochs] (iterations over a dataset).
 *
 * @param [trainingDataset] The train dataset that combines input data (X) and target data (Y).
 * @param [validationDataset] The validation dataset that combines input data (X) and target data (Y).
 * @param [epochs] Number of epochs to train the model. An epoch is an iteration over the entire x and y data provided.
 * @param [trainBatchSize] Number of samples per gradient update.
 * @param [validationBatchSize] Number of samples per validation batch.
 * True (default) = optimizer variables are initialized at the beginning of the training phase.
 * False = optimizer variables are not initialized during training phase. It should be initialized before (via transfer learning).
 * @param [callbacks] Callbacks to be used during training phase.
 *
 * @return A [TrainingHistory] object. It contains records with training/validation loss values and metrics per each batch and epoch.
 */


public fun evaluate ( dataset : Dataset , batchSize : Int = <NUM_LIT> , callback : Callback ) : EvaluationResult

{ <EOL> return evaluate ( dataset , batchSize , listOf ( callback ) ) <EOL> }

/**
 * Returns the metrics and loss values for the model in test (evaluation) mode.
 *
 * @param [dataset] The train dataset that combines input data (X) and target data (Y).
 * @param [batchSize] Number of samples per batch of computation.
 * @param [callback] Callback to be used during evaluation phase.
 *
 * @return Value of calculated metric and loss values.
 */


public abstract fun evaluate ( dataset : Dataset , batchSize : Int = <NUM_LIT> , callbacks : List < Callback > = listOf ( ) ) : EvaluationResult

/**
 * Returns the metrics and loss values for the model in test (evaluation) mode.
 *
 * @param [dataset] The train dataset that combines input data (X) and target data (Y).
 * @param [batchSize] Number of samples per batch of computation.
 * @param [callbacks] Callbacks to be used during evaluation phase.
 *
 * @return Value of calculated metric and loss values.
 */


public fun predict ( dataset : Dataset , batchSize : Int , callback : Callback ) : IntArray

{ <EOL> return predict ( dataset , batchSize , listOf ( callback ) ) <EOL> }

/**
 * Generates output predictions for the input samples.
 *
 * @param [dataset] Data to predict on.
 * @param [batchSize] Number of samples per batch of computation.
 * @param [callback] Callback to be used during prediction phase.
 *
 * @return Array of labels. The length is equal to the Number of samples on the [dataset].
 */


public abstract fun predict ( dataset : Dataset , batchSize : Int , callbacks : List < Callback > = listOf ( ) ) : IntArray

/**
 * Generates output predictions for the input samples.
 *
 * @param [dataset] Data to predict on.
 * @param [batchSize] Number of samples per batch of computation.
 * @param [callbacks] Callbacks to be used during prediction phase.
 *
 * @return Array of labels. The length is equal to the Number of samples on the [dataset].
 */


public fun predictSoftly ( dataset : Dataset , batchSize : Int , callback : Callback ) : Array < FloatArray >

{ <EOL> return predictSoftly ( dataset , batchSize , listOf ( callback ) ) <EOL> }

/**
 * Generates output predictions for the input samples.
 * Each prediction is a vector of probabilities instead of specific class in [predict] method.
 *
 * @param [dataset] Data to predict on.
 * @param [batchSize] Number of samples per batch of computation.
 * @param [callback] Callback to be used during prediction phase.
 *
 * @return Array of labels. All labels are vectors that represents the probability distributions of a list of potential outcomes. The length is equal to the Number of samples on the [dataset].
 */


public abstract fun predictSoftly ( dataset : Dataset , batchSize : Int , callbacks : List < Callback > = listOf ( ) ) : Array < FloatArray >

/**
 * Generates output predictions for the input samples.
 * Each prediction is a vector of probabilities instead of specific class in [predict] method.
 *
 * @param [dataset] Data to predict on.
 * @param [batchSize] Number of samples per batch of computation.
 * @param [callbacks] Callbacks to be used during prediction phase.
 *
 * @return Array of labels. All labels are vectors that represents the probability distributions of a list of potential outcomes. The length is equal to the Number of samples on the [dataset].
 */


public abstract fun predict ( inputData : FloatData , predictionTensorName : String ) : Int

/**
 * Generates output prediction for the input sample using output of the [predictionTensorName] tensor.
 *
 * @param [inputData] Unlabeled input data to define label.
 * @param [predictionTensorName] Name of output tensor to make prediction.
 */


public abstract fun predictAndGetActivations ( inputData : FloatData , predictionTensorName : String = "<STR_LIT>" ) : Pair < Int , List < * > >

/**
 * Predicts and returns not only prediction but list of activations values from intermediate model layers
 * (for visualisation or debugging purposes).
 *
 * @param [inputData] Unlabeled input data to define label.
 * @param [predictionTensorName] Name of output tensor to make prediction.
 * @return Label (class index) and list of activations from intermediate model layers.
 */


protected abstract fun predictSoftlyAndGetActivations ( inputData : FloatData , predictionTensorName : String ) : Pair < FloatArray , List < * > >


public abstract fun save ( modelDirectory : File , savingFormat : SavingFormat = SavingFormat . TfGraphCustomVariables , saveOptimizerState : Boolean = false , writingMode : WritingMode = WritingMode . FAIL_IF_EXISTS )

/**
 * Saves the model as graph and weights.
 *
 * @param [modelDirectory] Path to model directory.
 * @param [savingFormat] One of approaches to store model configurations and weights.
 * @param [saveOptimizerState] Saves internal optimizer states (variables) if true.
 * @param [writingMode] Default behaviour of handling different edge cases with existing directory before model saving.
 * @throws [FileNotFoundException] If [modelDirectory] does not contain all required files.
 */


public open fun loadWeights ( modelDirectory : File , loadOptimizerState : Boolean = false )

{ <EOL> loadVariablesFromTxt ( modelDirectory . absolutePath , loadOptimizerState ) <EOL> }

/**
 * Loads variable data from .txt files.
 *
 * @param [modelDirectory] Path to directory with TensorFlow graph and variable data.
 * @param [loadOptimizerState] Loads optimizer internal variables data, if true.
 * @throws [FileNotFoundException] If file with weights is not found.
 */


public fun fit ( dataset : OnHeapDataset , validationRate : Double , epochs : Int , trainBatchSize : Int , validationBatchSize : Int , callback : Callback ) : TrainingHistory

{ <EOL> require ( validationRate > <NUM_LIT:0.0> && validationRate < <NUM_LIT:1.0> ) { <EOL> "<STR_LIT>" + <EOL> "<STR_LIT>" <EOL> } <EOL> val ( validation , train ) = dataset . split ( validationRate ) <EOL> return fit ( train , validation , epochs , trainBatchSize , validationBatchSize , listOf ( callback ) ) <EOL> }

/**
 * Trains the model for a fixed number of [epochs] (iterations on a dataset).
 *
 * @param [dataset] The dataset that combines input data (X) and target data (Y). It will be split on train and validation sub-datasets.
 * @param [validationRate] Number between 0.0 and 1.0. The proportion of validation data from initially passed [dataset].
 * @param [epochs] Number of epochs to train the model. An epoch is an iteration over the entire x and y data provided.
 * @param [trainBatchSize] Number of samples per gradient update.
 * @param [validationBatchSize] Number of samples per validation batch.
 * @param [callback] Callback to be used during training phase.
 *
 * @return A [TrainingHistory] object. It contains records with training/validation loss values and metrics per each batch and epoch.
 */


public fun fit ( dataset : OnHeapDataset , validationRate : Double , epochs : Int , trainBatchSize : Int , validationBatchSize : Int , callbacks : List < Callback > = listOf ( ) ) : TrainingHistory

{ <EOL> require ( validationRate > <NUM_LIT:0.0> && validationRate < <NUM_LIT:1.0> ) { <EOL> "<STR_LIT>" + <EOL> "<STR_LIT>" <EOL> } <EOL> val ( validation , train ) = dataset . split ( validationRate ) <EOL> return fit ( train , validation , epochs , trainBatchSize , validationBatchSize , callbacks ) <EOL> }

/**
 * Trains the model for a fixed number of [epochs] (iterations on a dataset).
 *
 * @param [dataset] The dataset that combines input data (X) and target data (Y). It will be split on train and validation sub-datasets.
 * @param [validationRate] Number between 0.0 and 1.0. The proportion of validation data from initially passed [dataset].
 * @param [epochs] Number of epochs to train the model. An epoch is an iteration over the entire x and y data provided.
 * @param [trainBatchSize] Number of samples per gradient update.
 * @param [validationBatchSize] Number of samples per validation batch.
 * @param [callbacks] Callbacks to be used during training phase.
 *
 * @return A [TrainingHistory] object. It contains records with training/validation loss values and metrics per each batch and epoch.
 */


public inline fun plot ( dataset : Map < String , List < * > > = mapOf ( ) , block : DataFramePlotContext < * > . ( ) -> Unit ) : Plot

{ <EOL> return plot ( dataset . toDataFrame ( ) , block ) <EOL> }

/**
 * Returns a new [Plot].
 *
 * Creates a [DataFramePlotContext] plotting context, in which you can configure a plot.
 * Possible configuration parameters depend on the engine.
 *
 * @param dataset plot dataset.
 */


@ JvmName ( "<STR_LIT>" ) <EOL> public inline fun Map < String , List < * > > . plot ( block : DataFramePlotContext < * > . ( ) -> Unit ) : Plot

{ <EOL> return plot ( this , block ) <EOL> }

/**
 * Returns a new [Plot].
 *
 * Creates a [DataFramePlotContext] plotting context, in which you can configure a plot.
 * Possible configuration parameters depend on the engine.
 *
 * @receiver plot dataset.
 */


public inline fun < T > DataFrame < T > . plot ( block : DataFramePlotContext < T > . ( ) -> Unit ) : Plot


@ JvmName ( "<STR_LIT>" ) <EOL> public inline fun < T > plot ( dataframe : DataFrame < T > , block : DataFramePlotContext < T > . ( ) -> Unit ) : Plot

{ <EOL> return DataFramePlotContext ( dataframe ) . apply ( block ) . toPlot ( ) <EOL> }

/**
 * Returns a new [Plot].
 *
 * Creates a [DataFramePlotContext] plotting context, in which you can configure a plot.
 * Possible configuration parameters depend on the engine.
 *
 * @param dataframe plot dataset.
 */


public inline fun < T , G > GroupBy < T , G > . plot ( block : GroupByPlotContext < T , G > . ( ) -> Unit ) : Plot

{ <EOL> return GroupByPlotContext ( this ) . apply ( block ) . toPlot ( ) <EOL> }

/**
 * Returns a new [Plot].
 *
 * Creates a [GroupByPlotContext] plotting context, in which you can configure a plot.
 * Possible configuration parameters depend on the engine.
 *
 * @receiver plot dataset.
 */


@ JvmName ( "<STR_LIT>" ) <EOL> public inline fun < T , G > plot ( groupedDataframe : GroupBy < T , G > , block : GroupByPlotContext < T , G > . ( ) -> Unit ) : Plot

{ <EOL> return GroupByPlotContext ( groupedDataframe ) . apply ( block ) . toPlot ( ) <EOL> }

/**
 * Returns a new [Plot].
 *
 * Creates a [GroupByPlotContext] plotting context, in which you can configure a plot.
 * Possible configuration parameters depend on the engine.
 *
 * @param groupedDataframe plot dataset.
 */


{ <EOL> }


internal fun isHostSpecificKonanTargetsSet ( konanTargets : Iterable < KonanTarget > ) : Boolean

= <EOL> konanTargets . none { target -> target in targetsEnabledOnAllHosts }

/**
 * The set of konanTargets is considered 'host specific' if the shared compilation of said set can *not* be built
 * on *all* potential hosts. e.g. a set like (iosX64, macosX64) can only be built on macos hosts, and is therefore considered
 * 'host specific'.
 */


internal suspend fun getHostSpecificMainSharedSourceSets ( project : Project ) : Set < KotlinSourceSet >

{ <EOL> fun KotlinSourceSet . testOnly ( ) : Boolean = internal . compilations . all { it . isTest ( ) } <EOL> fun KotlinSourceSet . isCompiledToSingleTarget ( ) : Boolean { <EOL> return internal <EOL> . compilations <EOL> . distinctBy { ( it . target as? KotlinNativeTarget ) ? . konanTarget ? : return false } <EOL> . size == <NUM_LIT:1> <EOL> } <EOL> return getHostSpecificSourceSets ( project ) <EOL> . filterNot { it . testOnly ( ) } <EOL> . filterNot { it . isCompiledToSingleTarget ( ) } <EOL> . toSet ( ) <EOL> }

/**
 * Returns all host-specific source sets that will be compiled to two or more targets
 */


@ ExperimentalCoroutinesApi <EOL> @ Deprecated ( "<STR_LIT>" ) <EOL> public fun cleanupTestCoroutines ( )

/**
 * Called after the test completes.
 *
 * - It checks that there were no uncaught exceptions caught by its [CoroutineExceptionHandler].
 * If there were any, then the first one is thrown, whereas the rest are suppressed by it.
 * - It runs the tasks pending in the scheduler at the current time. If there are any uncompleted tasks afterwards,
 * it fails with [UncompletedCoroutinesError].
 * - It checks whether some new child [Job]s were created but not completed since this [TestCoroutineScope] was
 * created. If so, it fails with [UncompletedCoroutinesError].
 *
 * For backward compatibility, if the [CoroutineExceptionHandler] is an [UncaughtExceptionCaptor], its
 * [TestCoroutineExceptionHandler.cleanupTestCoroutines] behavior is performed.
 * Likewise, if the [ContinuationInterceptor] is a [DelayController], its [DelayController.cleanupTestCoroutines]
 * is called.
 *
 * @throws Throwable the first uncaught exception, if there are any uncaught exceptions.
 * @throws AssertionError if any pending tasks are active.
 * @throws IllegalStateException if called more than once.
 */


fun reportException ( throwable : Throwable ) : Boolean

= <EOL> synchronized ( lock ) { <EOL> if ( cleanedUp ) { <EOL> false <EOL> } else { <EOL> exceptions . add ( throwable ) <EOL> true <EOL> } <EOL> }

/**
 * Reports an exception so that it is thrown on [cleanupTestCoroutines].
 *
 * If several exceptions are reported, only the first one will be thrown, and the other ones will be suppressed by
 * it.
 *
 * Returns `false` if [cleanupTestCoroutines] was already called.
 */


@ Deprecated ( "<STR_LIT>" + "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" , "<STR_LIT>" ) , level = DeprecationLevel . WARNING ) <EOL> public fun TestCoroutineScope ( context : CoroutineContext = EmptyCoroutineContext ) : TestCoroutineScope

{ <EOL> val scheduler = context [ TestCoroutineScheduler ] ? : TestCoroutineScheduler ( ) <EOL> return createTestCoroutineScope ( TestCoroutineDispatcher ( scheduler ) + TestCoroutineExceptionHandler ( ) + context ) <EOL> }

/**
 * A coroutine scope for launching test coroutines using [TestCoroutineDispatcher].
 *
 * [createTestCoroutineScope] is a similar function that defaults to [StandardTestDispatcher].
 */


@ ExperimentalCoroutinesApi <EOL> @ Deprecated ( "<STR_LIT>" + "<STR_LIT>" , level = DeprecationLevel . WARNING ) <EOL> public fun createTestCoroutineScope ( context : CoroutineContext = EmptyCoroutineContext ) : TestCoroutineScope

{ <EOL> val ctxWithDispatcher = context . withDelaySkipping ( ) <EOL> var scope : TestCoroutineScopeImpl ? = null <EOL> val ownExceptionHandler = <EOL> object : AbstractCoroutineContextElement ( CoroutineExceptionHandler ) , TestCoroutineScopeExceptionHandler { <EOL> override fun handleException ( context : CoroutineContext , exception : Throwable ) { <EOL> if ( ! scope ! ! . reportException ( exception ) ) <EOL> throw exception <EOL> } <EOL> } <EOL> val exceptionHandler = when ( val exceptionHandler = ctxWithDispatcher [ CoroutineExceptionHandler ] ) { <EOL> is UncaughtExceptionCaptor -> exceptionHandler <EOL> null -> ownExceptionHandler <EOL> is TestCoroutineScopeExceptionHandler -> ownExceptionHandler <EOL> else -> throw IllegalArgumentException ( "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" ) <EOL> } <EOL> val job : Job = ctxWithDispatcher [ Job ] ? : Job ( ) <EOL> return TestCoroutineScopeImpl ( ctxWithDispatcher + exceptionHandler + job ) . also { <EOL> scope = it <EOL> } <EOL> }

/**
 * A coroutine scope for launching test coroutines.
 *
 * This is a function for aiding in migration from [TestCoroutineScope] to [TestScope].
 * Please see the
 * [migration guide](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/MIGRATION.md)
 * for an instruction on how to update the code for the new API.
 *
 * It ensures that all the test module machinery is properly initialized.
 * - If [context] doesn't define a [TestCoroutineScheduler] for orchestrating the virtual time used for delay-skipping,
 * a new one is created, unless either
 * - a [TestDispatcher] is provided, in which case [TestDispatcher.scheduler] is used;
 * - at the moment of the creation of the scope, [Dispatchers.Main] is delegated to a [TestDispatcher], in which case
 * its [TestCoroutineScheduler] is used.
 * - If [context] doesn't have a [ContinuationInterceptor], a [StandardTestDispatcher] is created.
 * - A [CoroutineExceptionHandler] is created that makes [TestCoroutineScope.cleanupTestCoroutines] throw if there were
 * any uncaught exceptions, or forwards the exceptions further in a platform-specific manner if the cleanup was
 * already performed when an exception happened. Passing a [CoroutineExceptionHandler] is illegal, unless it's an
 * [UncaughtExceptionCaptor], in which case the behavior is preserved for the time being for backward compatibility.
 * If you need to have a specific [CoroutineExceptionHandler], please pass it to [launch] on an already-created
 * [TestCoroutineScope] and share your use case at
 * [our issue tracker](https://github.com/Kotlin/kotlinx.coroutines/issues).
 * - If [context] provides a [Job], that job is used for the new scope; otherwise, a [CompletableJob] is created.
 *
 * @throws IllegalArgumentException if [context] has both [TestCoroutineScheduler] and a [TestDispatcher] linked to a
 * different scheduler.
 * @throws IllegalArgumentException if [context] has a [ContinuationInterceptor] that is not a [TestDispatcher].
 * @throws IllegalArgumentException if [context] has an [CoroutineExceptionHandler] that is not an
 * [UncaughtExceptionCaptor].
 */


@ ExperimentalCoroutinesApi <EOL> @ Deprecated ( "<STR_LIT>" + "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) , DeprecationLevel . ERROR ) <EOL> public fun TestCoroutineScope . advanceTimeBy ( delayTimeMillis : Long ) : Unit

= <EOL> when ( val controller = coroutineContext . delayController ) { <EOL> null -> { <EOL> testScheduler . advanceTimeBy ( delayTimeMillis ) <EOL> testScheduler . runCurrent ( ) <EOL> } <EOL> else -> { <EOL> controller . advanceTimeBy ( delayTimeMillis ) <EOL> Unit <EOL> } <EOL> }

/**
 * Advances the [testScheduler][TestCoroutineScope.testScheduler] by [delayTimeMillis] and runs the tasks up to that
 * moment (inclusive).
 *
 * @see TestCoroutineScheduler.advanceTimeBy
 */


@ ExperimentalCoroutinesApi <EOL> public fun TestCoroutineScope . advanceUntilIdle ( )

{ <EOL> coroutineContext . delayController ? . advanceUntilIdle ( ) ? : testScheduler . advanceUntilIdle ( ) <EOL> }

/**
 * Advances the [testScheduler][TestCoroutineScope.testScheduler] to the point where there are no tasks remaining.
 * @see TestCoroutineScheduler.advanceUntilIdle
 */


@ ExperimentalCoroutinesApi <EOL> public fun TestCoroutineScope . runCurrent ( )

{ <EOL> coroutineContext . delayController ? . runCurrent ( ) ? : testScheduler . runCurrent ( ) <EOL> }

/**
 * Run any tasks that are pending at the current virtual time, according to
 * the [testScheduler][TestCoroutineScope.testScheduler].
 *
 * @see TestCoroutineScheduler.runCurrent
 */


internal inline fun < reified T : Any > automagicTypedProxy ( targetClassLoader : ClassLoader , delegate : Any ) : T

= <EOL> automagicProxy ( targetClassLoader , T :: class . java , delegate ) as T

/**
 * Warning! Hard reflection magic used here.
 *
 * Creates [java.lang.reflect.Proxy] with pass through invocation algorithm,
 * to create access proxy for [delegate] into [targetClassLoader].
 */


private fun automagicProxy ( targetClassLoader : ClassLoader , targetType : Class < * > , delegate : Any ) : Any

= <EOL> Proxy . newProxyInstance ( targetClassLoader , arrayOf ( targetType ) , DelegatedInvocationHandler ( delegate ) )

/**
 * Warning! Hard reflection magic used here.
 *
 * Creates [java.lang.reflect.Proxy] with pass through invocation algorithm,
 * to create access proxy for [delegate] into [targetClassLoader].
 *
 */


fun addIdleTask ( id : Int , priority : Int , queue : Packet ? , count : Int )

{ <EOL> this . addRunningTask ( id , priority , queue , IdleTask ( this , <NUM_LIT:1> , count ) ) <EOL> }

/**
 * Add an idle task to this scheduler.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 * @param {int} count the number of times to schedule the task
 */


fun addWorkerTask ( id : Int , priority : Int , queue : Packet ? )

{ <EOL> this . addTask ( id , priority , queue , WorkerTask ( this , ID_HANDLER_A , <NUM_LIT:0> ) ) <EOL> }

/**
 * Add a work task to this scheduler.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 */


fun addHandlerTask ( id : Int , priority : Int , queue : Packet ? )

{ <EOL> this . addTask ( id , priority , queue , HandlerTask ( this ) ) <EOL> }

/**
 * Add a handler task to this scheduler.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 */


fun addDeviceTask ( id : Int , priority : Int , queue : Packet ? )

{ <EOL> this . addTask ( id , priority , queue , DeviceTask ( this ) ) <EOL> }


fun addRunningTask ( id : Int , priority : Int , queue : Packet ? , task : Task )

{ <EOL> this . addTask ( id , priority , queue , task ) <EOL> this . currentTcb ! ! . setRunning ( ) <EOL> }

/**
 * Add the specified task and mark it as running.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 * @param {Task} task the task to add
 */


fun addTask ( id : Int , priority : Int , queue : Packet ? , task : Task )

{ <EOL> this . currentTcb = TaskControlBlock ( this . list , id , priority , queue , task ) <EOL> this . list = this . currentTcb <EOL> this . blocks [ id ] = this . currentTcb <EOL> }

/**
 * Add the specified task to this scheduler.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 * @param {Task} task the task to add
 */


{ <EOL> this . currentTcb = this . list <EOL> while ( this . currentTcb != null ) { <EOL> if ( this . currentTcb ! ! . isHeldOrSuspended ( ) ) { <EOL> this . currentTcb = this . currentTcb ! ! . link <EOL> } else { <EOL> this . currentId = this . currentTcb ! ! . id <EOL> this . currentTcb = this . currentTcb ! ! . run ( ) <EOL> } <EOL> } <EOL> }

/**
 * Execute the tasks managed by this scheduler.
 */


fun release ( id : Int ) : TaskControlBlock ?

{ <EOL> val tcb = this . blocks [ id ] <EOL> if ( tcb == null ) return tcb <EOL> tcb . markAsNotHeld ( ) <EOL> if ( tcb . priority > this . currentTcb ! ! . priority ) { <EOL> return tcb <EOL> } else { <EOL> return this . currentTcb <EOL> } <EOL> }

/**
 * Release a task that is currently blocked and return the next block to run.
 * @param {int} id the id of the task to suspend
 */


fun holdCurrent ( ) : TaskControlBlock ?

{ <EOL> this . holdCount ++ <EOL> this . currentTcb ! ! . markAsHeld ( ) <EOL> return this . currentTcb ! ! . link <EOL> }

/**
 * Block the currently executing task and return the next task control block
 * to run. The blocked task will not be made runnable until it is explicitly
 * released, even if new work is added to it.
 */


fun suspendCurrent ( ) : TaskControlBlock ?

{ <EOL> this . currentTcb ! ! . markAsSuspended ( ) <EOL> return this . currentTcb <EOL> }

/**
 * Suspend the currently executing task and return the next task control block
 * to run. If new work is added to the suspended task it will be made runnable.
 */


fun queue ( packet : Packet ) : TaskControlBlock ?

{ <EOL> val t = this . blocks [ packet . id ] <EOL> if ( t == null ) return t <EOL> this . queueCount ++ <EOL> packet . link = null <EOL> packet . id = this . currentId <EOL> return t . checkPriorityAdd ( this . currentTcb ! ! , packet ) <EOL> }

/**
 * Add the specified packet to the end of the work list used by the task
 * associated with the packet and make the task runnable if it is currently
 * suspended.
 * @param {Packet} packet the packet to add
 */


{ <EOL> val packet : Packet ? <EOL> if ( this . state == STATE_SUSPENDED_RUNNABLE ) { <EOL> packet = this . queue <EOL> this . queue = packet ? . link <EOL> if ( this . queue == null ) { <EOL> this . state = STATE_RUNNING <EOL> } else { <EOL> this . state = STATE_RUNNABLE <EOL> } <EOL> } else { <EOL> packet = null <EOL> } <EOL> return this . task . run ( packet ) <EOL> }

/**
 * Runs this task, if it is ready to be run, and returns the next task to run.
 */


fun checkPriorityAdd ( task : TaskControlBlock , packet : Packet ) : TaskControlBlock

{ <EOL> if ( this . queue == null ) { <EOL> this . queue = packet <EOL> this . markAsRunnable ( ) <EOL> if ( this . priority > task . priority ) return this <EOL> } else { <EOL> this . queue = packet . addTo ( this . queue ) <EOL> } <EOL> return task <EOL> }

/**
 * Adds a packet to the work list of this block's task, marks this as runnable if
 * necessary, and returns the next runnable object to run (the one
 * with the highest priority).
 */


{ <EOL> this . link = null <EOL> if ( queue == null ) return this <EOL> var next : Packet = queue <EOL> var peek = next . link <EOL> while ( peek != null ) { <EOL> next = peek <EOL> peek = next . link <EOL> } <EOL> next . link = this <EOL> return queue <EOL> }

/**
 * Add this packet to the end of a work list, and return the work list.
 * @param {Packet} queue the work list to add this packet to
 */


= ComplexFloat ( re , - im )

/**
 * Returns the complex conjugate value of the current complex number.
 *
 * @return a new ComplexFloat object representing the complex conjugate of the current complex number.
 * It has the same real part as the current number, but an opposite sign of its imaginary part.
 */


= hypot ( re , im )

/**
 * Returns the absolute value of the complex number.
 *
 * @return the absolute value of the complex number.
 */


= atan2 ( im , re )

/**
 * Returns the angle of the complex number.
 *
 * @return the angle of the complex number as a Float.
 */


public operator fun plus ( other : Byte ) : ComplexFloat

= ComplexFloat ( re + other , im )

/**
 * Adds the other byte value to this value.
 *
 * @param other the [Byte] value to add to this one.
 * @return a new [ComplexFloat] with the result of the addition.
 */


public operator fun plus ( other : Short ) : ComplexFloat

= ComplexFloat ( re + other , im )

/**
 * Adds the other short value to this value.
 *
 * @param other the [Short] value to add to this one.
 * @return a new [ComplexFloat] with the result of the addition.
 */


public operator fun plus ( other : Int ) : ComplexFloat

= ComplexFloat ( re + other , im )

/**
 * Adds the other integer value to this value.
 *
 * @param other the [Int] value to add to this one.
 * @return a new [ComplexFloat] with the result of the addition.
 */


public operator fun plus ( other : Long ) : ComplexFloat

= ComplexFloat ( re + other , im )

/**
 * Adds the other long value to this value.
 *
 * @param other the [Long] value to add to this one.
 * @return a new [ComplexFloat] with the result of the addition.
 */


public operator fun plus ( other : Float ) : ComplexFloat

= ComplexFloat ( re + other , im )

/**
 * Adds the other float value to this value.
 *
 * @param other the [Float] value to add to this one.
 * @return a new [ComplexFloat] with the result of the addition.
 */


public operator fun plus ( other : Double ) : ComplexDouble

= ComplexDouble ( re + other , im . toDouble ( ) )

/**
 * Adds the other double value to this value.
 *
 * @param other the [Double] value to add to this one.
 * @return a new [ComplexDouble] with the result of the addition.
 */


public operator fun plus ( other : ComplexFloat ) : ComplexFloat

= ComplexFloat ( re + other . re , im + other . im )

/**
 * Adds the other ComplexFloat value to this value.
 *
 * @param other the [ComplexFloat] value to add to this one.
 * @return a new [ComplexFloat] with the result of the addition.
 */


public operator fun plus ( other : ComplexDouble ) : ComplexDouble

= ComplexDouble ( re + other . re , im + other . im )

/**
 * Adds the other ComplexDouble value to this value.
 *
 * @param other the [ComplexDouble] value to add to this one.
 * @return a new [ComplexDouble] with the result of the addition.
 */