@ OptIn ( ObsoleteDescriptorBasedAPI :: class ) <EOL> internal fun serializablePropertiesForIrBackend ( irClass : IrClass , serializationDescriptorSerializer : SerializationDescriptorSerializerPlugin ? = null , typeReplacement : Map < IrProperty , IrSimpleType > ? = null ) : IrSerializableProperties

{ <EOL> val properties = irClass . properties . toList ( ) <EOL> val primaryConstructorParams = irClass . primaryConstructor ? . valueParameters . orEmpty ( ) <EOL> val primaryParamsAsProps = properties . associateBy { it . name } . let { namesMap -> <EOL> primaryConstructorParams . mapNotNull { <EOL> if ( it . name !in namesMap ) null else namesMap . getValue ( it . name ) to it . hasDefaultValue ( ) <EOL> } . toMap ( ) <EOL> } <EOL> fun isPropSerializable ( it : IrProperty ) = <EOL> if ( irClass . isInternalSerializable ) ! it . annotations . hasAnnotation ( SerializationAnnotations . serialTransientFqName ) <EOL> else ! DescriptorVisibilities . isPrivate ( it . visibility ) && ( ( it . isVar && ! it . annotations . hasAnnotation ( SerializationAnnotations . serialTransientFqName ) ) || primaryParamsAsProps . contains ( it ) ) && it . getter ? . returnType != null <EOL> val ( primaryCtorSerializableProps , bodySerializableProps ) = properties <EOL> . asSequence ( ) <EOL> . filter { ! it . isFakeOverride && ! it . isDelegated && it . origin != IrDeclarationOrigin . DELEGATED_MEMBER } <EOL> . filter ( :: isPropSerializable ) <EOL> . map { <EOL> val isConstructorParameterWithDefault = primaryParamsAsProps [ it ] ? : false <EOL> val ( isPropertyFromAnotherModuleDeclaresDefaultValue , isPropertyWithBackingFieldFromAnotherModule ) = it . analyzeIfFromAnotherModule ( ) <EOL> val hasBackingField = when ( it . origin ) { <EOL> IrDeclarationOrigin . IR_EXTERNAL_DECLARATION_STUB -> isPropertyWithBackingFieldFromAnotherModule <EOL> else -> it . backingField != null <EOL> } <EOL> IrSerializableProperty ( it , isConstructorParameterWithDefault , hasBackingField , it . backingField ? . initializer . let { init -> init != null && ! init . expression . isInitializePropertyFromParameter ( ) } || isConstructorParameterWithDefault || isPropertyFromAnotherModuleDeclaresDefaultValue , typeReplacement ? . get ( it ) ? : it . getter ! ! . returnType as IrSimpleType ) <EOL> } <EOL> . filterNot { it . transient } <EOL> . partition { primaryParamsAsProps . contains ( it . ir ) } <EOL> var serializableProps = run { <EOL> val supers = irClass . getSuperClassNotAny ( ) <EOL> if ( supers == null || ! supers . isInternalSerializable ) { <EOL> primaryCtorSerializableProps + bodySerializableProps <EOL> } else { <EOL> val originalToTypeFromFO = typeReplacement ? : buildMap < IrProperty , IrSimpleType > { <EOL> irClass . properties . filter { it . isFakeOverride } . forEach { prop -> <EOL> val orig = prop . resolveFakeOverride ( ) <EOL> val type = prop . getter ? . returnType as? IrSimpleType <EOL> if ( orig != null && type != null ) put ( orig , type ) <EOL> } <EOL> } <EOL> serializablePropertiesForIrBackend ( supers , serializationDescriptorSerializer , originalToTypeFromFO ) . serializableProperties + primaryCtorSerializableProps + bodySerializableProps <EOL> } <EOL> } <EOL> serializableProps = restoreCorrectOrderFromClassProtoExtension ( irClass . descriptor , serializableProps ) <EOL> val isExternallySerializable = <EOL> irClass . isInternallySerializableEnum ( ) || primaryConstructorParams . size == primaryParamsAsProps . size <EOL> return IrSerializableProperties ( serializableProps , isExternallySerializable , primaryCtorSerializableProps , bodySerializableProps ) <EOL> }

/**
 * typeReplacement should be populated from FakeOverrides and is used when we want to determine the type for property
 * accounting for generic substitutions performed in subclasses:
 *
 * ```
 * @Serializable
 * sealed class TypedSealedClass<T>(val a: T) {
 * @Serializable
 * data class Child(val y: Int) : TypedSealedClass<String>("10")
 * }
 * ```
 * In this case, serializableProperties for TypedSealedClass is a listOf(IrSerProp(val a: T)),
 * but for Child is a listOf(IrSerProp(val a: String), IrSerProp(val y: Int)).
 *
 * Using this approach, we can correctly deserialize parent's properties in Child.Companion.deserialize()
 */


public actual fun addLast ( node : Node )

{ <EOL> while ( true ) { <EOL> if ( prevNode . addNext ( node , this ) ) return <EOL> } <EOL> }


public actual inline fun addLastIf ( node : Node , crossinline condition : ( ) -> Boolean ) : Boolean

{ <EOL> val condAdd = makeCondAddOp ( node , condition ) <EOL> while ( true ) { <EOL> val prev = prevNode <EOL> when ( prev . tryCondAddNext ( node , this , condAdd ) ) { <EOL> SUCCESS -> return true <EOL> FAILURE -> return false <EOL> } <EOL> } <EOL> }

/**
 * Adds last item to this list atomically if the [condition] is true.
 */


@ PublishedApi <EOL> internal fun addNext ( node : Node , next : Node ) : Boolean

{ <EOL> node . _prev . lazySet ( this ) <EOL> node . _next . lazySet ( next ) <EOL> if ( ! _next . compareAndSet ( next , node ) ) return false <EOL> node . finishAdd ( next ) <EOL> return true <EOL> }


public actual open fun remove ( ) : Boolean

= <EOL> removeOrNext ( ) == null

/**
 * Removes this node from the list. Returns `true` when removed successfully, or `false` if the node was already
 * removed or if it was not added to any list in the first place.
 *
 * **Note**: Invocation of this operation does not guarantee that remove was actually complete if result was `false`.
 * In particular, invoking [nextNode].[prevNode] might still return this node even though it is "already removed".
 */


{ <EOL> next . _prev . loop { nextPrev -> <EOL> if ( this . next !== next ) return <EOL> if ( next . _prev . compareAndSet ( nextPrev , this ) ) { <EOL> if ( isRemoved ) next . correctPrev ( null ) <EOL> return <EOL> } <EOL> } <EOL> }


private tailrec fun correctPrev ( op : OpDescriptor ? ) : Node ?

{ <EOL> val oldPrev = _prev . value <EOL> var prev : Node = oldPrev <EOL> var last : Node ? = null <EOL> while ( true ) { <EOL> val prevNext : Any = prev . _next . value <EOL> when { <EOL> prevNext === this -> { <EOL> if ( oldPrev === prev ) return prev <EOL> if ( ! this . _prev . compareAndSet ( oldPrev , prev ) ) { <EOL> return correctPrev ( op ) <EOL> } <EOL> return prev <EOL> } <EOL> this . isRemoved -> return null <EOL> prevNext === op -> return prev <EOL> prevNext is OpDescriptor -> { <EOL> prevNext . perform ( prev ) <EOL> return correctPrev ( op ) <EOL> } <EOL> prevNext is Removed -> { <EOL> if ( last !== null ) { <EOL> if ( ! last . _next . compareAndSet ( prev , prevNext . ref ) ) { <EOL> return correctPrev ( op ) <EOL> } <EOL> prev = last <EOL> last = null <EOL> } else { <EOL> prev = prev . _prev . value <EOL> } <EOL> } <EOL> else -> { <EOL> last = prev <EOL> prev = prevNext as Node <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * Returns the corrected value of the previous node while also correcting the `prev` pointer
 * (so that `this.prev.next === this`) and helps complete node removals to the left ot this node.
 *
 * It returns `null` in two special cases:
 *
 * - When this node is removed. In this case there is no need to waste time on corrections, because
 * remover of this node will ultimately call [correctPrev] on the next node and that will fix all
 * the links from this node, too.
 */


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

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

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


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ ExperimentalStdlibApi <EOL> public fun < E : Element > Element . getPolymorphicElement ( key : Key < E > ) : E ?

{ <EOL> if ( key is AbstractCoroutineContextKey < * , * > ) { <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> return if ( key . isSubKey ( this . key ) ) key . tryCast ( this ) as? E else null <EOL> } <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> return if ( this . key === key ) this as E else null <EOL> }

/**
 * Returns the current element if it is associated with the given [key] in a polymorphic manner or `null` otherwise.
 * This method returns non-null value if either [Element.key] is equal to the given [key] or if the [key] is associated
 * with [Element.key] via [AbstractCoroutineContextKey].
 * See [AbstractCoroutineContextKey] for the example of usage.
 */


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ ExperimentalStdlibApi <EOL> public fun Element . minusPolymorphicKey ( key : Key < * > ) : CoroutineContext

{ <EOL> if ( key is AbstractCoroutineContextKey < * , * > ) { <EOL> return if ( key . isSubKey ( this . key ) && key . tryCast ( this ) != null ) EmptyCoroutineContext else this <EOL> } <EOL> return if ( this . key === key ) EmptyCoroutineContext else this <EOL> }

/**
 * Returns empty coroutine context if the element is associated with the given [key] in a polymorphic manner
 * or `null` otherwise.
 * This method returns empty context if either [Element.key] is equal to the given [key] or if the [key] is associated
 * with [Element.key] via [AbstractCoroutineContextKey].
 * See [AbstractCoroutineContextKey] for the example of usage.
 */


private fun lowerHeader ( variable : IrVariable , loopHeader : ForLoopHeader ) : IrStatement

{ <EOL> return IrCompositeImpl ( variable . startOffset , variable . endOffset , context . irBuiltIns . unitType , null , loopHeader . loopInitStatements ) <EOL> }

/**
 * Lowers the "header" statement that stores the iterator into the loop variable
 * (e.g., `val it = someIterable.iterator()`) and gather information for building the for-loop
 * (as a [ForLoopHeader]).
 *
 * Returns null if the for-loop cannot be lowered.
 */


private fun specializeIteratorIfPossible ( irForLoopBlock : IrContainerExpression )

{ <EOL> val statements = irForLoopBlock . statements <EOL> val iterator = statements [ <NUM_LIT:0> ] as IrVariable <EOL> val initializer = iterator . initializer as? IrCall ? : return <EOL> if ( ! initializer . symbol . owner . hasEqualFqName ( STDLIB_ITERATOR_FUNCTION_FQ_NAME ) ) return <EOL> val receiverType = initializer . extensionReceiver ? . type ? : return <EOL> if ( ! receiverType . isStrictSubtypeOfClass ( context . irBuiltIns . iteratorClass ) ) return <EOL> val receiverClass = receiverType . getClass ( ) ? : return <EOL> val next = receiverClass . functions . singleOrNull { <EOL> it . name == OperatorNameConventions . NEXT && <EOL> it . dispatchReceiverParameter != null && <EOL> it . extensionReceiverParameter == null && <EOL> it . valueParameters . isEmpty ( ) <EOL> } ? : return <EOL> iterator . apply { <EOL> this . type = receiverType <EOL> this . initializer = initializer . extensionReceiver <EOL> } <EOL> val loop = statements [ <NUM_LIT:1> ] as IrWhileLoop <EOL> val loopVariable = ( loop . body as? IrBlock ) ? . statements ? . firstOrNull ( ) as? IrVariable ? : return <EOL> val loopCondition = loop . condition as? IrCall ? : return <EOL> loopCondition . dispatchReceiver ? . type = receiverType <EOL> val nextCall = loopVariable . initializer <EOL> if ( nextCall is IrCall ) { <EOL> nextCall . symbol = next . symbol <EOL> nextCall . dispatchReceiver ? . type = receiverType <EOL> } <EOL> }

/**
 * This optimization is for the stdlib extension function in package `kotlin.collections`:
 * ```
 * @kotlin.internal.InlineOnly
 * public inline operator fun <T> Iterator<T>.iterator(): Iterator<T> = this
 * ```
 * Let's say we have an instance of `MyIterator`, which directly implements [kotlin.collections.Iterator],
 * when it is used in a for-loop like:
 *
 * ```
 * val iterator = MyIterator()
 * for (x in iterator)
 * println(x)
 * ```
 * Without this optimization, receiver type of call of `next` would be Iterator<T> instead of MyIterator, which means that
 * a less specific method would be called, which could lead to unnecessary boxing of primitives or inline classes.
 */


public fun getDirectKotlinInheritors ( ktClass : KtClass , scope : GlobalSearchScope , includeLocalInheritors : Boolean ) : Iterable < KtClassOrObject >

/**
 * Returns all direct inheritors of [ktClass] that can be found in the given [scope]. If [includeLocalInheritors] is `false`, only
 * non-local inheritors will be returned.
 *
 * The implementor of [getDirectKotlinInheritors] is allowed to lazy-resolve symbols up to the `SUPER_TYPES` phase. This is required to
 * check subtyping for potential inheritors. Hence, if [getDirectKotlinInheritors] is invoked during lazy resolution, it requires a
 * phase of `SEALED_CLASS_INHERITORS` or later.
 */


public fun breaks ( breaks : List < DomainType > ? = null , format : String ? = null )

{ <EOL> this . breaks = breaks <EOL> this . format = format <EOL> }

/**
 * Sets axis breaks with formatting.
 *
 * @param breaks list of breaks.
 * @param format format string.
 */


public fun breaksLabeled ( vararg breaksToLabels : Pair < DomainType , String > )

{ <EOL> breaks = breaksToLabels . map { it . first } <EOL> labels = breaksToLabels . map { it . second } <EOL> }

/**
 * Sets axis breaks with labels.
 *
 * @param breaksToLabels list of breaks with corresponding labels.
 */


public fun breaksLabeled ( breaks : List < DomainType > , labels : List < String > )

{ <EOL> this . breaks = breaks <EOL> this . labels = labels <EOL> }

/**
 * Sets legend breaks with labels.
 *
 * @param breaks list of breaks.
 * @param labels list of corresponding labels.
 */


public fun expand ( multiplicative : Double = <NUM_LIT:0.0> , additive : Double = <NUM_LIT> )

{ <EOL> expand = listOf ( multiplicative , additive ) <EOL> }

/**
 * Sets multiplicative and additive expansion constants.
 */


private fun isUsed ( psiElement : PsiElement ) : Boolean

{ <EOL> return when ( psiElement ) { <EOL> is KtFunctionLiteral -> <EOL> doesParentUseChild ( psiElement . parent , psiElement ) <EOL> is KtNamedFunction -> <EOL> doesParentUseChild ( psiElement . parent , psiElement ) <EOL> is KtDeclaration -> <EOL> false <EOL> is KtThrowExpression -> <EOL> false <EOL> is KtReturnExpression -> <EOL> false <EOL> is KtBreakExpression -> <EOL> false <EOL> is KtContinueExpression -> <EOL> false <EOL> is KtLoopExpression -> <EOL> false <EOL> is KtConstructorDelegationReferenceExpression -> <EOL> false <EOL> is KtEnumEntrySuperclassReferenceExpression -> <EOL> false <EOL> is KtConstructorCalleeExpression -> <EOL> false <EOL> is KtLabelReferenceExpression -> <EOL> false <EOL> is KtOperationReferenceExpression -> <EOL> false <EOL> else -> <EOL> doesParentUseChild ( psiElement . parent , psiElement ) <EOL> } <EOL> }

/**
 * [isUsed] and [doesParentUseChild] are defined in mutual recursion,
 * climbing up the syntax tree, passing control back and forth between the
 * two.
 *
 * Whether an expression is used is defined by the context in which it
 * appears. E.g. a "statement" in a block is considered used if it is the
 * last expression in that block AND the block itself is used -- a
 * recursive call to `isUsed`, one level higher in the syntax tree.
 *
 * The methods are _conservative_, erring on the side of answering `true`.
 */


private fun doesDoubleColonUseLHS ( lhs : PsiElement ) : Boolean

{ <EOL> val reference = when ( val inner = lhs . unwrapParenthesesLabelsAndAnnotations ( ) ) { <EOL> is KtReferenceExpression -> <EOL> inner . mainReference <EOL> is KtDotQualifiedExpression -> <EOL> ( inner . selectorExpression as? KtReferenceExpression ) ? . mainReference ? : return true <EOL> else -> <EOL> return true <EOL> } <EOL> val resolution = reference . resolve ( ) <EOL> return resolution != null && resolution !is KtClass <EOL> }

/**
 * The left hand side of a `::` is regarded as used unless it refers to a type.
 * We decide that the LHS is a type reference by checking if the left hand
 * side is a (qualified) name, and, in case it _is_, resolving that name.
 *
 * If it resolves to a non-class declaration, it does _not_ refer to a type.
 */


private fun doesCallExpressionUseCallee ( callee : PsiElement ) : Boolean

{ <EOL> return callee !is KtReferenceExpression || <EOL> analyze ( callee ) { <EOL> isSimpleVariableAccessCall ( callee ) <EOL> } <EOL> }

/**
 * Invocations of _statically named_ callables is not considered a use. E.g.
 * consider
 *
 * 1) fun f() { 54 }; f()
 * 2) val f = { 54 }; f()
 *
 * in which the `f` in 2) is regarded as used and `f` in 1) is not.
 */


private fun doesPropertyAccessorUseBody ( propertyAccessor : KtPropertyAccessor , body : PsiElement ) : Boolean

{ <EOL> return propertyAccessor . isSetter || ( propertyAccessor . isGetter && body !is KtBlockExpression ) <EOL> }

/**
 * The body of setters are always used. The body of getters are only used if they are expression bodies.
 */


private fun doesNamedFunctionUseBody ( namedFunction : KtNamedFunction , body : PsiElement ) : Boolean

= when { <EOL> namedFunction . bodyBlockExpression == body -> <EOL> false <EOL> ! returnsUnit ( namedFunction ) -> <EOL> true <EOL> namedFunction . bodyExpression == body -> <EOL> analyze ( namedFunction ) { <EOL> ( body as KtExpression ) . getKtType ( ) ? . isUnit == true <EOL> } <EOL> else -> <EOL> false <EOL> }

/**
 * Returns whether the function uses its body as an expression (i.e., the function uses the result value of the expression) or not.
 *
 * Named functions do not consider their bodies used if
 * - the function body is a block e.g., `fun foo(): Int { return bar }` or
 * - the function itself returns Unit
 */


@ Test <EOL> fun testNoAccessPrivateTopLevel ( )

{ <EOL> val javaClass = Class . forName ( "<STR_LIT>" ) <EOL> checkDeclarations ( javaClass , listOf ( FieldDesc ( PRIVATE or STATIC or FINAL , true , "<STR_LIT>" , "<STR_LIT>" ) ) ) <EOL> val refVolatileClass = Class . forName ( "<STR_LIT>" ) <EOL> checkClassModifiers ( refVolatileClass , <NUM_LIT:0> , true ) <EOL> checkDeclarations ( refVolatileClass , listOf ( FieldDesc ( VOLATILE , false , "<STR_LIT>" , "<STR_LIT:a>" ) ) ) <EOL> }

/**
 * Test [bytecode_test.NoAccessPrivateTopLevel]
 */


@ Test <EOL> fun testPrivateTopLevel ( )

{ <EOL> val javaClass = Class . forName ( "<STR_LIT>" ) <EOL> checkDeclarations ( javaClass , listOf ( FieldDesc ( STATIC or FINAL , true , "<STR_LIT>" , "<STR_LIT>" ) , FieldDesc ( STATIC or FINAL , true , AFU_TYPE , "<STR_LIT>" ) ) ) <EOL> val refVolatileClass = Class . forName ( "<STR_LIT>" ) <EOL> checkClassModifiers ( refVolatileClass , <NUM_LIT:0> , true ) <EOL> checkDeclarations ( refVolatileClass , listOf ( FieldDesc ( VOLATILE , false , "<STR_LIT>" , "<STR_LIT:b>" ) ) ) <EOL> }

/**
 * Test [bytecode_test.PrivateTopLevel]
 */


@ Test <EOL> fun testPublicTopLevelReflectionTest ( )

{ <EOL> val javaClass = Class . forName ( "<STR_LIT>" ) <EOL> checkDeclarations ( javaClass , listOf ( FieldDesc ( PUBLIC or STATIC or FINAL , true , "<STR_LIT>" , "<STR_LIT>" ) , FieldDesc ( PUBLIC or STATIC or FINAL , true , AFU_TYPE , "<STR_LIT>" ) ) ) <EOL> val refVolatileClass = Class . forName ( "<STR_LIT>" ) <EOL> checkClassModifiers ( refVolatileClass , PUBLIC , true ) <EOL> checkDeclarations ( refVolatileClass , listOf ( FieldDesc ( PUBLIC or VOLATILE , false , "<STR_LIT>" , "<STR_LIT>" ) ) ) <EOL> }

/**
 * Test [bytecode_test.PublicTopLevel]
 */


@ Test <EOL> fun testPackagePrivateTopLevelReflectionTest ( )

{ <EOL> val javaClass = Class . forName ( "<STR_LIT>" ) <EOL> checkDeclarations ( javaClass , listOf ( FieldDesc ( STATIC or FINAL , true , "<STR_LIT>" , "<STR_LIT>" ) , FieldDesc ( STATIC or FINAL , true , AFU_TYPE , "<STR_LIT>" ) ) ) <EOL> val refVolatileClass = Class . forName ( "<STR_LIT>" ) <EOL> checkClassModifiers ( refVolatileClass , <NUM_LIT:0> , true ) <EOL> checkDeclarations ( refVolatileClass , listOf ( FieldDesc ( VOLATILE , false , "<STR_LIT>" , "<STR_LIT:d>" ) ) ) <EOL> }

/**
 * Test [bytecode_test.PackagePrivateTopLevel]
 */


internal fun commonRelu ( tf : Ops , input : Operand < Float > , alpha : Float = <NUM_LIT:0.0f> , maxValue : Float ? = null , threshold : Float = <NUM_LIT:0.0f> ) : Operand < Float >

{ <EOL> var input2 = input <EOL> var negativePart : Operand < Float > = tf . nn . relu ( input2 ) <EOL> if ( alpha != <NUM_LIT:0.0f> ) { <EOL> if ( maxValue == null && threshold == <NUM_LIT:0.0f> ) { <EOL> val greaterThanZero = tf . math . greater ( input2 , tf . constant ( <NUM_LIT:0.0f> ) ) <EOL> val negativeActivation = tf . math . mul ( tf . constant ( alpha ) , input2 ) <EOL> return tf . where3 ( greaterThanZero , input2 , negativeActivation ) <EOL> } <EOL> negativePart = if ( threshold != <NUM_LIT:0.0f> ) <EOL> tf . nn . relu ( tf . math . add ( tf . math . mul ( input2 , tf . constant ( - <NUM_LIT> ) ) , tf . constant ( threshold ) ) ) <EOL> else <EOL> tf . nn . relu ( tf . math . mul ( input2 , tf . constant ( - <NUM_LIT> ) ) ) <EOL> } <EOL> var clipMax = false <EOL> if ( maxValue != null ) clipMax = true <EOL> when { <EOL> threshold != <NUM_LIT:0.0f> -> { <EOL> input2 = tf . math . mul ( input2 , tf . dtypes . cast ( tf . math . greater ( input , tf . constant ( threshold ) ) , getDType ( ) ) ) <EOL> } <EOL> maxValue == <NUM_LIT> -> { <EOL> input2 = tf . nn . relu6 ( input2 ) <EOL> clipMax = false <EOL> } <EOL> else -> input2 = tf . nn . relu ( input2 ) <EOL> } <EOL> if ( clipMax ) { <EOL> input2 = tf . math . minimum ( tf . constant ( maxValue ! ! ) as Operand < Float > , tf . math . maximum ( input2 , tf . constant ( <NUM_LIT:0.0f> ) ) ) <EOL> } <EOL> if ( alpha != <NUM_LIT:0.0f> ) input2 = tf . math . sub ( input2 , tf . math . mul ( tf . constant ( alpha ) , negativePart ) ) <EOL> return input2 <EOL> }

/**
 * Rectified linear unit.
 *
 * With default values, it returns element-wise `max(x, 0)`.
 * Otherwise, it follows:
 * `f(x) = max_value` for `x >= max_value`,
 * `f(x) = x` for `threshold <= x < max_value`,
 * `f(x) = alpha * (x - threshold)` otherwise.
 *
 * @param [tf] Namespace to build ops.
 * @param [input] A tensor or variable.
 * @param [alpha] A scalar, slope of negative section.
 * @param [maxValue] Saturation threshold.
 * @param [threshold] Threshold value for the activation.
 *
 * @return TensorFlow Operand.
 */


internal fun CArrayPointer < ByteVar > . getBytes ( size : Long )

= <EOL> ( <NUM_LIT:0> .. size - <NUM_LIT:1> ) . map { this [ it ] } . toByteArray ( )

/**
 * Reads [size] bytes contained in this array.
 */


public fun detectPoses ( imageFile : File , confidence : Float = <NUM_LIT> ) : MultiPoseDetectionResult

{ <EOL> return detectPoses ( ImageConverter . toBufferedImage ( imageFile ) , confidence ) <EOL> }

/**
 * Detects poses for the given [imageFile] with the given [confidence].
 * @param [imageFile] file containing an input image
 * @param [confidence] confidence value to use
 */


public fun reshape ( vararg dims : Long )

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

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


internal fun Type . isStret ( target : KonanTarget ) : Boolean

{ <EOL> val unwrappedType = this . unwrapTypedefs ( ) <EOL> val abiInfo : ObjCAbiInfo = when ( target . architecture ) { <EOL> Architecture . ARM64 -> DarwinArm64AbiInfo ( ) <EOL> Architecture . X64 -> DarwinX64AbiInfo ( ) <EOL> Architecture . X86 -> DarwinX86AbiInfo ( ) <EOL> Architecture . ARM32 -> DarwinArm32AbiInfo ( target ) <EOL> else -> error ( "<STR_LIT>" ) <EOL> } <EOL> return abiInfo . shouldUseStret ( unwrappedType ) <EOL> }

/**
 * objc_msgSend*_stret functions must be used when return value is returned through memory
 * pointed by implicit argument, which is passed on the register that would otherwise be used for receiver.
 *
 * The entire implementation is just the real ABI approximation which is enough for practical cases.
 */


fun clear ( )

/**
 * Removes all recorded data except diagnostics.
 */


inline fun < reified P : DokkaPlugin , reified T : ConfigurableBlock > pluginConfiguration ( block : T . ( ) -> Unit )

{ <EOL> val instance = T :: class . createInstance ( ) . apply ( block ) <EOL> val pluginConfiguration = PluginConfigurationImpl ( fqPluginName = P :: class . qualifiedName ! ! , serializationFormat = DokkaConfiguration . SerializationFormat . JSON , values = instance . toCompactJsonString ( ) ) <EOL> pluginsConfiguration . add ( pluginConfiguration ) <EOL> }

/**
 * Type-safe configuration for a Dokka plugin.
 *
 * Note: this is available in Kotlin DSL only, if Dokka Gradle plugin was applied through `plugins` block
 * and the configured plugin can be found on classpath, which may require adding a classpath dependency
 * to `buildscript` block in case of external plugins. Some Dokka plugins, such as
 * [org.jetbrains.dokka.base.DokkaBase], are on classpath by default.
 *
 * Example:
 *
 * ```kotlin
 * import org.jetbrains.dokka.base.DokkaBase
 * import org.jetbrains.dokka.base.DokkaBaseConfiguration
 *
 * tasks.dokkaHtml {
 * pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
 * footerMessage = "Test"
 * }
 * }
 * ```
 *
 * @param P Plugin class that extends [DokkaPlugin]
 * @param T Plugin configuration class that extends [ConfigurableBlock]
 */


private fun getClassSnapshotGranularity ( classpathEntryDirOrJar : File , gradleUserHomeDir : File ) : ClassSnapshotGranularity

{ <EOL> return if ( classpathEntryDirOrJar . startsWith ( gradleUserHomeDir ) || classpathEntryDirOrJar . name == "<STR_LIT>" ) CLASS_LEVEL <EOL> else CLASS_MEMBER_LEVEL <EOL> }

/**
 * Determines the [ClassSnapshotGranularity] when taking a snapshot of the given [classpathEntryDirOrJar].
 *
 * As mentioned in [ClassSnapshotGranularity]'s kdoc, we will take [CLASS_LEVEL] snapshots for classes that are infrequently changed
 * (e.g., external libraries which are typically stored/transformed inside the Gradle user home, or a few hard-coded cases), and take
 * [CLASS_MEMBER_LEVEL] snapshots for the others.
 */


fun getResolver ( allClasses : Iterable < AccessibleClassSnapshot > ) : ImpactedSymbolsResolver

/** Provides an [ImpactedSymbolsResolver] to compute the set of [ProgramSymbol]s impacted by a given set of [ProgramSymbol]s. */


fun getReverseResolver ( allClasses : Iterable < AccessibleClassSnapshot > ) : ImpactingClassesResolver

/**
 * Provides an [ImpactingClassesResolver] to compute the set of classes impacting a given set of classes (the reverse of [getResolver]).
 */


fun < T > findReachableNodes ( nodes : Iterable < T > , edgesProvider : ( T ) -> Iterable < T > ) : Set < T >

{ <EOL> val visitedAndToVisitNodes = nodes . toMutableSet ( ) <EOL> val nodesToVisit = ArrayDeque ( nodes . toSet ( ) ) <EOL> while ( nodesToVisit . isNotEmpty ( ) ) { <EOL> val nodeToVisit = nodesToVisit . removeFirst ( ) <EOL> val nextNodesToVisit = edgesProvider . invoke ( nodeToVisit ) - visitedAndToVisitNodes <EOL> visitedAndToVisitNodes . addAll ( nextNodesToVisit ) <EOL> nodesToVisit . addAll ( nextNodesToVisit ) <EOL> } <EOL> return visitedAndToVisitNodes <EOL> }

/**
 * Finds the set of nodes that are *transitively* reachable from the given set of nodes.
 *
 * The returned set is *inclusive* (it contains the given set + the directly/transitively reachable ones).
 */


protected fun buildFieldForSupertypeDelegate ( entry : KtDelegatedSuperTypeEntry , type : FirTypeRef ? , fieldOrd : Int , ) : FirField

{ <EOL> val delegateSource = entry . toFirSourceElement ( KtFakeSourceElementKind . ClassDelegationField ) <EOL> val delegateExpression = buildOrLazyExpression ( delegateSource ) { <EOL> { entry . delegateExpression } <EOL> . toFirExpression ( "<STR_LIT>" ) <EOL> } <EOL> return buildField { <EOL> source = delegateSource <EOL> moduleData = baseModuleData <EOL> origin = FirDeclarationOrigin . Synthetic . DelegateField <EOL> name = NameUtils . delegateFieldName ( fieldOrd ) <EOL> symbol = FirFieldSymbol ( CallableId ( this @ PsiRawFirBuilder . context . currentClassId , name ) ) <EOL> returnTypeRef = type ? : withContainerSymbol ( symbol ) { <EOL> entry . typeReference . toFirOrErrorType ( ) <EOL> } <EOL> isVar = false <EOL> status = FirDeclarationStatusImpl ( Visibilities . Private , Modality . FINAL ) <EOL> initializer = delegateExpression <EOL> dispatchReceiverType = currentDispatchReceiverType ( ) <EOL> } <EOL> }

/**
 * @param type the return type for new field.
 * In the case of null will be calculated inside [withContainerSymbol],
 * so it is crucial to decide to whom type annotation will be belonged
 */


protected fun KtPrimaryConstructor ? . toFirConstructor ( superTypeCallEntry : KtSuperTypeCallEntry ? , delegatedSuperTypeRef : FirTypeRef ? , delegatedSelfTypeRef : FirTypeRef , owner : KtClassOrObject , ownerTypeParameters : List < FirTypeParameterRef > , allSuperTypeCallEntries : List < Pair < KtSuperTypeCallEntry , FirTypeRef > > , containingClassIsExpectClass : Boolean , copyConstructedTypeRefWithImplicitSource : Boolean , isErrorConstructor : Boolean = false , isImplicitlyActual : Boolean = false , isKotlinAny : Boolean = false , ) : FirConstructor

{ <EOL> val constructorSymbol = FirConstructorSymbol ( callableIdForClassConstructor ( ) ) <EOL> withContainerSymbol ( constructorSymbol ) { <EOL> val constructorSource = this ? . toFirSourceElement ( ) <EOL> ? : owner . toKtPsiSourceElement ( KtFakeSourceElementKind . ImplicitConstructor ) <EOL> fun buildDelegatedCall ( superTypeCallEntry : KtSuperTypeCallEntry ? , delegatedTypeRef : FirTypeRef , ) : FirDelegatedConstructorCall ? { <EOL> val constructorCall = superTypeCallEntry ? . toFirSourceElement ( ) <EOL> val constructedTypeRef = if ( copyConstructedTypeRefWithImplicitSource ) { <EOL> delegatedTypeRef . copyWithNewSourceKind ( KtFakeSourceElementKind . ImplicitTypeRef ) <EOL> } else { <EOL> delegatedTypeRef <EOL> } <EOL> return buildOrLazyDelegatedConstructorCall ( isThis = false , constructedTypeRef ) { <EOL> buildDelegatedConstructorCall { <EOL> source = constructorCall ? : constructorSource . fakeElement ( KtFakeSourceElementKind . DelegatingConstructorCall ) <EOL> this . constructedTypeRef = constructedTypeRef <EOL> isThis = false <EOL> calleeReference = buildExplicitSuperReference { <EOL> source = <EOL> superTypeCallEntry ? . calleeExpression ? . toFirSourceElement ( KtFakeSourceElementKind . DelegatingConstructorCall ) <EOL> ? : this@buildDelegatedConstructorCall . source ? . fakeElement ( KtFakeSourceElementKind . DelegatingConstructorCall ) <EOL> superTypeRef = this@buildDelegatedConstructorCall . constructedTypeRef <EOL> } <EOL> superTypeCallEntry ? . extractArgumentsTo ( this ) <EOL> } <EOL> } <EOL> } <EOL> val firDelegatedCall = runUnless ( containingClassIsExpectClass || isKotlinAny ) { <EOL> if ( allSuperTypeCallEntries . size <= <NUM_LIT:1> ) { <EOL> buildDelegatedCall ( superTypeCallEntry , delegatedSuperTypeRef ! ! ) <EOL> } else { <EOL> buildMultiDelegatedConstructorCall { <EOL> allSuperTypeCallEntries . mapTo ( delegatedConstructorCalls ) { ( superTypeCallEntry , delegatedTypeRef ) -> <EOL> buildDelegatedCall ( superTypeCallEntry , delegatedTypeRef ) ! ! <EOL> } <EOL> } <EOL> } <EOL> } <EOL> fun defaultVisibility ( ) = when { <EOL> owner is KtObjectDeclaration || owner . hasModifier ( ENUM_KEYWORD ) || owner is KtEnumEntry -> Visibilities . Private <EOL> owner . hasModifier ( SEALED_KEYWORD ) -> Visibilities . Protected <EOL> else -> Visibilities . Unknown <EOL> } <EOL> val explicitVisibility = this ? . getVisibility ( ) ? . takeUnless { it == Visibilities . Unknown } <EOL> val status = FirDeclarationStatusImpl ( explicitVisibility ? : defaultVisibility ( ) , Modality . FINAL ) . apply { <EOL> isExpect = this@toFirConstructor ? . hasExpectModifier ( ) == true || this@PsiRawFirBuilder . context . containerIsExpect <EOL> isActual = this@toFirConstructor ? . hasActualModifier ( ) == true || isImplicitlyActual <EOL> isInner = owner . parent . parent !is KtScript && owner . hasModifier ( INNER_KEYWORD ) <EOL> isFromSealedClass = owner . hasModifier ( SEALED_KEYWORD ) && explicitVisibility !== Visibilities . Private <EOL> isFromEnumClass = owner . hasModifier ( ENUM_KEYWORD ) <EOL> } <EOL> val builder = when { <EOL> this ? . modifierList != null && <EOL> getConstructorKeyword ( ) == null -> createErrorConstructorBuilder ( ConeMissingConstructorKeyword ) <EOL> isErrorConstructor -> createErrorConstructorBuilder ( ConeNoConstructorError ) <EOL> else -> FirPrimaryConstructorBuilder ( ) <EOL> } <EOL> builder . apply { <EOL> source = constructorSource <EOL> moduleData = baseModuleData <EOL> origin = FirDeclarationOrigin . Source <EOL> returnTypeRef = delegatedSelfTypeRef <EOL> this . status = status <EOL> dispatchReceiverType = owner . obtainDispatchReceiverForConstructor ( ) <EOL> symbol = constructorSymbol <EOL> delegatedConstructor = firDelegatedCall <EOL> typeParameters += constructorTypeParametersFromConstructedClass ( ownerTypeParameters ) <EOL> this . contextReceivers . addAll ( convertContextReceivers ( owner . contextReceivers ) ) <EOL> this@toFirConstructor ? . extractAnnotationsTo ( this ) <EOL> this@toFirConstructor ? . extractValueParametersTo ( this , symbol , ValueParameterDeclaration . PRIMARY_CONSTRUCTOR ) <EOL> this . body = null <EOL> } <EOL> return builder . build ( ) . apply { <EOL> containingClassForStaticMemberAttr = currentDispatchReceiverType ( ) ! ! . lookupTag <EOL> } <EOL> } <EOL> }

/**
 * @param delegatedSuperTypeRef can be null if containingClassIsExpectClass is true
 */


protected fun buildAnonymousInitializer ( initializer : KtAnonymousInitializer , containingDeclarationSymbol : FirBasedSymbol < * > ? , allowLazyBody : Boolean = true , isLocal : Boolean = false , )

= buildAnonymousInitializer { <EOL> withContainerSymbol ( symbol , isLocal ) { <EOL> source = initializer . toFirSourceElement ( ) <EOL> moduleData = baseModuleData <EOL> origin = FirDeclarationOrigin . Source <EOL> body = if ( allowLazyBody ) { <EOL> buildOrLazyBlock { <EOL> withForcedLocalContext { <EOL> initializer . body . toFirBlock ( ) <EOL> } <EOL> } <EOL> } else { <EOL> withForcedLocalContext { <EOL> initializer . body . toFirBlock ( ) <EOL> } <EOL> } <EOL> this . containingDeclarationSymbol = containingDeclarationSymbol <EOL> initializer . extractAnnotationsTo ( this ) <EOL> } <EOL> }

/**
 * Builds [FirAnonymousInitializer] from [KtAnonymousInitializer]
 *
 * @param initializer Source [KtAnonymousInitializer]
 * @param containingDeclarationSymbol containing declaration symbol, if any
 * @param allowLazyBody if `true`, [FirLazyBlock] is used in the IDE mode
 * @param isLocal if `true`, the initializer is not used as a containing declaration for the contents of the initializer
 */


@ ExperimentalBCVApi <EOL> public fun klib ( block : KlibValidationSettings . ( ) -> Unit )

{ <EOL> block ( this . klib ) <EOL> }

/**
 * Configure KLib ABI validation settings.
 */


public fun < C > frameCol ( frameCol : ColumnAccessor < DataFrame < C > > ) : ColumnAccessor < DataFrame < C > >

= <EOL> frameCol . ensureIsFrameColumn ( )

/**
 * @include [FrameColReferenceDocs] {@set [CommonFrameColDocs.ReceiverArg]}
 */


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

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

/**
 * @include [FrameColReferenceDocs] {@set [CommonFrameColDocs.ReceiverArg] myColumnGroup.}
 */


public fun < C > AnyColumnGroupAccessor . frameCol ( frameCol : ColumnAccessor < DataFrame < C > > ) : ColumnAccessor < DataFrame < C > >

= <EOL> this . ensureIsColumnGroup ( ) . frameColumn < C > ( frameCol . path ( ) ) . ensureIsFrameColumn ( )


public fun < C > String . frameCol ( frameCol : ColumnAccessor < DataFrame < C > > ) : ColumnAccessor < DataFrame < C > >

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

/**
 * @include [FrameColReferenceDocs] {@set [CommonFrameColDocs.ReceiverArg] "myColumnGroup".}
 */


public fun < C > KProperty < * > . frameCol ( frameCol : ColumnAccessor < DataFrame < C > > ) : ColumnAccessor < DataFrame < C > >

/**
 * @include [FrameColReferenceDocs] {@set [CommonFrameColDocs.ReceiverArg] Type::myColumnGroup.}
 */


public fun < C > ColumnPath . frameCol ( frameCol : ColumnAccessor < DataFrame < C > > ) : ColumnAccessor < DataFrame < C > >

/**
 * @include [FrameColReferenceDocs] {@set [CommonFrameColDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 */


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

= frameColumn < Any ? > ( name ) . ensureIsFrameColumn ( )

/**
 * @include [FrameColNameDocs] {@set [CommonFrameColDocs.ReceiverArg]}
 */


public fun < C > frameCol ( name : String ) : ColumnAccessor < DataFrame < C > >

= frameColumn < C > ( name ) . ensureIsFrameColumn ( )

/**
 * @include [FrameColNameDocs] {@set [CommonFrameColDocs.ReceiverArg]}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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

/**
 * @include [FrameColNameDocs] {@set [CommonFrameColDocs.ReceiverArg] myColumnGroup.}
 */


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

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

/**
 * @include [FrameColNameDocs] {@set [CommonFrameColDocs.ReceiverArg] myColumnGroup.}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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


public fun < C > AnyColumnGroupAccessor . frameCol ( name : String ) : ColumnAccessor < DataFrame < C > >

= <EOL> this . ensureIsColumnGroup ( ) . frameColumn < C > ( name ) . ensureIsFrameColumn ( )


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

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

/**
 * @include [FrameColNameDocs] {@set [CommonFrameColDocs.ReceiverArg] "myColumnGroup".}
 */


public fun < C > String . frameCol ( name : String ) : ColumnAccessor < DataFrame < C > >

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

/**
 * @include [FrameColNameDocs] {@set [CommonFrameColDocs.ReceiverArg] "myColumnGroup".}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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

/**
 * @include [FrameColNameDocs] {@set [CommonFrameColDocs.ReceiverArg] Type::myColumnGroup.}
 */


public fun < C > KProperty < * > . frameCol ( name : String ) : ColumnAccessor < DataFrame < C > >

/**
 * @include [FrameColNameDocs] {@set [CommonFrameColDocs.ReceiverArg] Type::myColumnGroup.}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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

/**
 * @include [FrameColNameDocs] {@set [CommonFrameColDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 */


public fun < C > ColumnPath . frameCol ( name : String ) : ColumnAccessor < DataFrame < C > >

/**
 * @include [FrameColNameDocs] {@set [CommonFrameColDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

= frameColumn < Any ? > ( path ) . ensureIsFrameColumn ( )

/**
 * @include [FrameColPathDocs] {@set [CommonFrameColDocs.ReceiverArg]}
 */


public fun < C > frameCol ( path : ColumnPath ) : ColumnAccessor < DataFrame < C > >

= frameColumn < C > ( path ) . ensureIsFrameColumn ( )

/**
 * @include [FrameColPathDocs] {@set [CommonFrameColDocs.ReceiverArg]}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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

/**
 * @include [FrameColPathDocs] {@set [CommonFrameColDocs.ReceiverArg] myColumnGroup.}
 */


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

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

/**
 * @include [FrameColPathDocs] {@set [CommonFrameColDocs.ReceiverArg] myColumnGroup.}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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


public fun < C > AnyColumnGroupAccessor . frameCol ( path : ColumnPath ) : ColumnAccessor < DataFrame < C > >

= <EOL> this . ensureIsColumnGroup ( ) . frameColumn < C > ( path ) . ensureIsFrameColumn ( )


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

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

/**
 * @include [FrameColPathDocs] {@set [CommonFrameColDocs.ReceiverArg] "myColumnGroup".}
 */


public fun < C > String . frameCol ( path : ColumnPath ) : ColumnAccessor < DataFrame < C > >

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

/**
 * @include [FrameColPathDocs] {@set [CommonFrameColDocs.ReceiverArg] "myColumnGroup".}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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

/**
 * @include [FrameColPathDocs] {@set [CommonFrameColDocs.ReceiverArg] Type::myColumnGroup.}
 */


public fun < C > KProperty < * > . frameCol ( path : ColumnPath ) : ColumnAccessor < DataFrame < C > >

/**
 * @include [FrameColPathDocs] {@set [CommonFrameColDocs.ReceiverArg] Type::myColumnGroup.}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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

/**
 * @include [FrameColPathDocs] {@set [CommonFrameColDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 */


public fun < C > ColumnPath . frameCol ( path : ColumnPath ) : ColumnAccessor < DataFrame < C > >

/**
 * @include [FrameColPathDocs] {@set [CommonFrameColDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

= <EOL> frameColumn ( property ) . ensureIsFrameColumn ( )

/**
 * @include [FrameColKPropertyDocs] {@set [CommonFrameColDocs.ReceiverArg]}
 */


public fun < C > frameCol ( property : KProperty < List < C > > ) : SingleColumn < DataFrame < C > >


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

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

/**
 * @include [FrameColKPropertyDocs] {@set [CommonFrameColDocs.ReceiverArg] myColumnGroup.}
 */


public fun < C > SingleColumn < DataRow < * > > . frameCol ( property : KProperty < List < C > > ) : SingleColumn < DataFrame < C > >


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

= <EOL> this . ensureIsColumnGroup ( ) . frameColumn ( property ) . ensureIsFrameColumn ( )


public fun < C > AnyColumnGroupAccessor . frameCol ( property : KProperty < List < C > > ) : ColumnAccessor < DataFrame < C > >


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

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

/**
 * @include [FrameColKPropertyDocs] {@set [CommonFrameColDocs.ReceiverArg] "myColumnGroup".}
 */


public fun < C > String . frameCol ( property : KProperty < List < C > > ) : ColumnAccessor < DataFrame < C > >


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

/**
 * @include [FrameColKPropertyDocs] {@set [CommonFrameColDocs.ReceiverArg] Type::myColumnGroup.}
 */


public fun < C > KProperty < * > . frameCol ( property : KProperty < List < C > > ) : ColumnAccessor < DataFrame < C > >


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

/**
 * @include [FrameColKPropertyDocs] {@set [CommonFrameColDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 */


public fun < C > ColumnPath . frameCol ( property : KProperty < List < C > > ) : ColumnAccessor < DataFrame < C > >


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

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

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg] `[colsOf][ColumnsSelectionDsl.colsOf]`<`[Int][Int]`>().}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 * {@set [CommonFrameColDocs.ExampleArg] {@include [CommonFrameColDocs.SingleExample]}}
 */


public fun ColumnSet < * > . frameCol ( index : Int ) : SingleColumn < DataFrame < * > >

= <EOL> getAt ( index ) . cast < DataFrame < * > > ( ) . ensureIsFrameColumn ( )


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

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

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg]}
 */


public fun < C > ColumnsSelectionDsl < * > . frameCol ( index : Int ) : SingleColumn < DataFrame < C > >

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

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg]}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg] myColumnGroup.}
 */


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

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

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg] myColumnGroup.}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg] "myColumnGroup".}
 */


public fun < C > String . frameCol ( index : Int ) : SingleColumn < DataFrame < C > >

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

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg] "myColumnGroup".}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg] Type::myColumnGroup.}
 */


public fun < C > KProperty < * > . frameCol ( index : Int ) : SingleColumn < DataFrame < C > >

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg] Type::myColumnGroup.}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


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

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

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 */


public fun < C > ColumnPath . frameCol ( index : Int ) : SingleColumn < DataFrame < C > >

/**
 * @include [FrameColIndexDocs] {@set [CommonFrameColDocs.ReceiverArg] "pathTo"["myColumnGroup"].}
 * @include [CommonFrameColDocs.FrameColumnTypeParam]
 */


internal fun < C > SingleColumn < DataFrame < C > > . ensureIsFrameColumn ( ) : SingleColumn < DataFrame < C > >

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

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


internal fun < C > ColumnAccessor < DataFrame < C > > . ensureIsFrameColumn ( ) : ColumnAccessor < DataFrame < C > >

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


fun FirElementWithResolveState . collectDesignationWithOptionalFile ( providedFile : FirFile ? = null ) : FirDesignation

= <EOL> tryCollectDesignationWithOptionalFile ( providedFile ) ? : errorWithAttachment ( "<STR_LIT>" ) { <EOL> providedFile ? . let { withFirEntry ( "<STR_LIT>" , it ) } <EOL> }

/**
 * Consider using this function only if [collectDesignation] is not applicable.
 *
 * This extension function can be used in the case there your [FirElementWithResolveState] probably
 * doesn't have [getContainingFile] and it doesn't matter for your purposes.
 * Potentially, this function can become obsolete if we support all possible cases in [getContainingFile]
 *
 * @return [FirDesignation] where [FirDesignation.fileOrNull] can be null or throws an exception.
 *
 * @see collectDesignation
 * @see tryCollectDesignation
 * @see tryCollectDesignationWithOptionalFile
 */


fun FirElementWithResolveState . collectDesignation ( providedFile : FirFile ? = null ) : FirDesignation

= <EOL> tryCollectDesignation ( providedFile ) ? : errorWithAttachment ( "<STR_LIT>" ) { <EOL> withFirEntry ( "<STR_LIT>" , this @ collectDesignation ) <EOL> }

/**
 * @return [FirDesignation] where [FirDesignation.fileOrNull] not null or throws an exception.
 *
 * @see collectDesignationWithOptionalFile
 * @see tryCollectDesignation
 * @see tryCollectDesignationWithOptionalFile
 */


fun FirElementWithResolveState . tryCollectDesignationWithOptionalFile ( providedFile : FirFile ? = null ) : FirDesignation ?

= <EOL> tryCollectDesignation ( providedFile = providedFile , target = this )

/**
 * Consider using this function only if [tryCollectDesignation] is not applicable.
 *
 * This extension function can be used in the case there your [FirElementWithResolveState] probably
 * doesn't have [getContainingFile] and it doesn't matter for your purposes.
 * Potentially, this function can become obsolete if we support all possible cases in [getContainingFile]
 *
 * @return [FirDesignation] where [FirDesignation.fileOrNull] can be null or null.
 *
 * @see collectDesignationWithOptionalFile
 * @see collectDesignation
 * @see tryCollectDesignation
 */


fun FirElementWithResolveState . tryCollectDesignation ( providedFile : FirFile ? = null ) : FirDesignation ?

= when ( this ) { <EOL> is FirSyntheticProperty , is FirSyntheticPropertyAccessor -> unexpectedElementError < FirElementWithResolveState > ( this ) <EOL> is FirDeclaration -> { <EOL> val designation = tryCollectDesignation ( providedFile = providedFile , target = this ) <EOL> designation ? . takeIf { it . fileOrNull != null } <EOL> } <EOL> else -> unexpectedElementError < FirElementWithResolveState > ( this ) <EOL> }

/**
 * @return [FirDesignation] with not-null [FirDesignation.file] or null.
 *
 * @see collectDesignation
 * @see tryCollectDesignationWithOptionalFile
 * @see collectDesignationWithOptionalFile
 */


fun printlnMultiLine ( s : String ) : SmartPrinter

{ <EOL> printer . printlnWithNoIndent ( s . replaceIndent ( currentIndent ) . lines ( ) . joinToString ( separator = "<STR_LIT:\n>" ) { it . ifBlank { "<STR_LIT>" } } ) <EOL> notFirstPrint = false <EOL> return this <EOL> }

/**
 * Prints the multi-line string literal [s] while respecting [currentIndent].
 * Whitespace-only lines are made empty.
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> @ InlineOnly <EOL> public inline fun UByteArray . toHexString ( format : HexFormat = HexFormat . Default ) : String

= storage . toHexString ( format )

/**
 * Formats bytes in this array using the specified [format].
 *
 * Note that only [HexFormat.upperCase] and [HexFormat.BytesHexFormat] affect formatting.
 *
 * @param format the [HexFormat] to use for formatting, [HexFormat.Default] by default.
 *
 * @throws IllegalArgumentException if the result length is more than [String] maximum capacity.
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> @ InlineOnly <EOL> public inline fun UByteArray . toHexString ( startIndex : Int = <NUM_LIT:0> , endIndex : Int = size , format : HexFormat = HexFormat . Default ) : String

= storage . toHexString ( startIndex , endIndex , format )

/**
 * Formats bytes in this array using the specified [HexFormat].
 *
 * Note that only [HexFormat.upperCase] and [HexFormat.BytesHexFormat] affect formatting.
 *
 * @param startIndex the beginning (inclusive) of the subrange to format, 0 by default.
 * @param endIndex the end (exclusive) of the subrange to format, size of this array by default.
 * @param format the [HexFormat] to use for formatting, [HexFormat.Default] by default.
 *
 * @throws IndexOutOfBoundsException when [startIndex] or [endIndex] is out of range of this array indices.
 * @throws IllegalArgumentException when `startIndex > endIndex`.
 * @throws IllegalArgumentException if the result length is more than [String] maximum capacity.
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ ExperimentalUnsignedTypes <EOL> @ InlineOnly <EOL> public inline fun String . hexToUByteArray ( format : HexFormat = HexFormat . Default ) : UByteArray

= <EOL> hexToByteArray ( format ) . asUByteArray ( )

/**
 * Parses bytes from this string using the specified [HexFormat].
 *
 * Note that only [HexFormat.BytesHexFormat] affects parsing,
 * and parsing is performed in case-insensitive manner.
 * Also, any of the char sequences CRLF, LF and CR is considered a valid line separator.
 *
 * @param format the [HexFormat] to use for parsing, [HexFormat.Default] by default.
 *
 * @throws IllegalArgumentException if this string does not comply with the specified [format].
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ InlineOnly <EOL> public inline fun UByte . toHexString ( format : HexFormat = HexFormat . Default ) : String

= data . toHexString ( format )

/**
 * Formats this `UByte` value using the specified [format].
 *
 * Note that only [HexFormat.upperCase] and [HexFormat.NumberHexFormat] affect formatting.
 *
 * @param format the [HexFormat] to use for formatting, [HexFormat.Default] by default.
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ InlineOnly <EOL> public inline fun String . hexToUByte ( format : HexFormat = HexFormat . Default ) : UByte

= hexToByte ( format ) . toUByte ( )

/**
 * Parses an `UByte` value from this string using the specified [format].
 *
 * Note that only [HexFormat.NumberHexFormat] affects parsing,
 * and parsing is performed in case-insensitive manner.
 *
 * @param format the [HexFormat] to use for parsing, [HexFormat.Default] by default.
 *
 * @throws IllegalArgumentException if this string does not comply with the specified [format].
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ InlineOnly <EOL> public inline fun UShort . toHexString ( format : HexFormat = HexFormat . Default ) : String

= data . toHexString ( format )

/**
 * Formats this `UShort` value using the specified [format].
 *
 * Note that only [HexFormat.upperCase] and [HexFormat.NumberHexFormat] affect formatting.
 *
 * @param format the [HexFormat] to use for formatting, [HexFormat.Default] by default.
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ InlineOnly <EOL> public inline fun String . hexToUShort ( format : HexFormat = HexFormat . Default ) : UShort

= hexToShort ( format ) . toUShort ( )

/**
 * Parses an `UShort` value from this string using the specified [format].
 *
 * Note that only [HexFormat.NumberHexFormat] affects parsing,
 * and parsing is performed in case-insensitive manner.
 *
 * @param format the [HexFormat] to use for parsing, [HexFormat.Default] by default.
 *
 * @throws IllegalArgumentException if this string does not comply with the specified [format].
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ InlineOnly <EOL> public inline fun UInt . toHexString ( format : HexFormat = HexFormat . Default ) : String

= data . toHexString ( format )

/**
 * Formats this `UInt` value using the specified [format].
 *
 * Note that only [HexFormat.upperCase] and [HexFormat.NumberHexFormat] affect formatting.
 *
 * @param format the [HexFormat] to use for formatting, [HexFormat.Default] by default.
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ InlineOnly <EOL> public inline fun String . hexToUInt ( format : HexFormat = HexFormat . Default ) : UInt

= hexToInt ( format ) . toUInt ( )

/**
 * Parses an `UInt` value from this string using the specified [format].
 *
 * Note that only [HexFormat.NumberHexFormat] affects parsing,
 * and parsing is performed in case-insensitive manner.
 *
 * @param format the [HexFormat] to use for parsing, [HexFormat.Default] by default.
 *
 * @throws IllegalArgumentException if this string does not comply with the specified [format].
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ InlineOnly <EOL> public inline fun ULong . toHexString ( format : HexFormat = HexFormat . Default ) : String

= data . toHexString ( format )

/**
 * Formats this `ULong` value using the specified [format].
 *
 * Note that only [HexFormat.upperCase] and [HexFormat.NumberHexFormat] affect formatting.
 *
 * @param format the [HexFormat] to use for formatting, [HexFormat.Default] by default.
 */


@ ExperimentalStdlibApi <EOL> @ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ InlineOnly <EOL> public inline fun String . hexToULong ( format : HexFormat = HexFormat . Default ) : ULong

= hexToLong ( format ) . toULong ( )

/**
 * Parses an `ULong` value from this string using the specified [format].
 *
 * Note that only [HexFormat.NumberHexFormat] affects parsing,
 * and parsing is performed in case-insensitive manner.
 *
 * @param format the [HexFormat] to use for parsing, [HexFormat.Default] by default.
 *
 * @throws IllegalArgumentException if this string does not comply with the specified [format].
 */


@ Throws ( RemoteException :: class ) <EOL> fun report ( category : Int , severity : Int , message : String ? , attachment : Serializable ? )

/**
 * Reports different kind of diagnostic messages from compile daemon to compile daemon clients (jps, gradle, ...)
 */


override fun toString ( ) : String

/**
 * Returns a string representation of this path.
 *
 * Note that the returned value will represent the same path as the value
 * passed to [Path], but it may not be identical to it.
 */


override fun hashCode ( ) : Int

/**
 * Returns hash code of this Path.
 * The hash code is calculated for the path's string representations ([toString]).
 */


override fun equals ( other : Any ? ) : Boolean

/**
 * Compares two paths for equality using its string representation ([toString]).
 */


public expect fun Path ( path : String ) : Path

/**
 * Returns Path for the given string without much of a validation.
 */


public fun Path ( base : String , vararg parts : String ) : Path

{ <EOL> return Path ( path = buildString { <EOL> append ( base ) <EOL> parts . forEach { <EOL> if ( isNotEmpty ( ) && ! endsWith ( SystemPathSeparator ) ) { <EOL> append ( SystemPathSeparator ) <EOL> } <EOL> append ( it ) <EOL> } <EOL> } ) <EOL> }

/**
 * Returns Path for the given [base] path concatenated with [parts] using [SystemPathSeparator].
 */


public fun Path ( base : Path , vararg parts : String ) : Path

{ <EOL> return Path ( base . toString ( ) , * parts ) <EOL> }


@ Deprecated ( message = "<STR_LIT>" , replaceWith = ReplaceWith ( expression = "<STR_LIT>" , imports = arrayOf ( "<STR_LIT>" ) ) , level = DeprecationLevel . WARNING ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun Path . source ( ) : Source

= SystemFileSystem . source ( this ) . buffered ( )

/**
 * Returns [RawSource] for the given file or throws if path is not a file or does not exist
 *
 * Use of this method is deprecated with warning since kotlinx-io 0.3.0. The method will be removed in 0.4.0.
 */


@ Deprecated ( message = "<STR_LIT>" , replaceWith = ReplaceWith ( expression = "<STR_LIT>" , imports = arrayOf ( "<STR_LIT>" ) ) , level = DeprecationLevel . WARNING ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun Path . sink ( ) : Sink

= SystemFileSystem . sink ( this ) . buffered ( )

/**
 * Returns [RawSink] for the given path, creates file if it doesn't exist, throws if it's a directory,
 * overwrites contents.
 *
 * Use of this method is deprecated with warning since kotlinx-io 0.3.0. The method will be removed in 0.4.0.
 */


abstract fun consume ( storage : Receiver , input : String ) : NumberConsumptionError ?

/**
 * Wholly consumes the given [input]. Should be called with a string consisting of [length] digits, or,
 * if [length] is `null`, with a string consisting of any number of digits. [consume] itself does not
 * necessarily check the length of the input string, instead expecting to be passed a valid one.
 *
 * Returns `null` on success and a `NumberConsumptionError` on failure.
 */


private fun retainOrRemoveAllInternal ( rangeOffset : Int , rangeLength : Int , elements : Collection < E > , retain : Boolean ) : Int

{ <EOL> var i = <NUM_LIT:0> <EOL> var j = <NUM_LIT:0> <EOL> while ( i < rangeLength ) { <EOL> if ( elements . contains ( backing [ rangeOffset + i ] ) == retain ) { <EOL> backing [ rangeOffset + j ++ ] = backing [ rangeOffset + i ++ ] <EOL> } else { <EOL> i ++ <EOL> } <EOL> } <EOL> val removed = rangeLength - j <EOL> backing . copyInto ( backing , startIndex = rangeOffset + rangeLength , endIndex = length , destinationOffset = rangeOffset + j ) <EOL> backing . resetRange ( fromIndex = length - removed , toIndex = length ) <EOL> if ( removed > <NUM_LIT:0> ) registerModification ( ) <EOL> length -= removed <EOL> return removed <EOL> }

/** Retains elements if [retain] == true and removes them it [retain] == false. */


{ <EOL> val removed = <EOL> if ( parent != null ) { <EOL> parent . retainOrRemoveAllInternal ( rangeOffset , rangeLength , elements , retain ) <EOL> } else { <EOL> root . retainOrRemoveAllInternal ( rangeOffset , rangeLength , elements , retain ) <EOL> } <EOL> if ( removed > <NUM_LIT:0> ) registerModification ( ) <EOL> length -= removed <EOL> return removed <EOL> }


private fun < T : DoubleColonLHS > tryResolveLHS ( doubleColonExpression : KtDoubleColonExpression , context : ExpressionTypingContext , criterion : ( KtDoubleColonExpression ) -> Boolean , resolve : ( KtExpression , ExpressionTypingContext ) -> T ? <EOL> ) : LHSResolutionResult < T > ?

{ <EOL> val expression = doubleColonExpression . receiverExpression ? : return null <EOL> if ( ! criterion ( doubleColonExpression ) ) return null <EOL> val traceAndCache = TemporaryTraceAndCache . create ( context , "<STR_LIT>" , doubleColonExpression ) <EOL> val c = context <EOL> . replaceTraceAndCache ( traceAndCache ) <EOL> . replaceExpectedType ( NO_EXPECTED_TYPE ) <EOL> . replaceContextDependency ( ContextDependency . INDEPENDENT ) <EOL> val lhs = resolve ( expression , c ) <EOL> return LHSResolutionResult ( lhs , expression , traceAndCache ) <EOL> }

/**
 * Returns null if the LHS is definitely not an expression. Returns a non-null result if a resolution was attempted and led to
 * either a successful result or not.
 */


public actual fun ComplexDouble ( re : Double , im : Double ) : ComplexDouble

= <EOL> if ( fitsInFloat ( re ) && fitsInFloat ( im ) ) <EOL> ComplexDouble32 ( re , im ) <EOL> else <EOL> ComplexDouble64 ( re , im )

/**
 * Creates a [ComplexDouble] with the given real and imaginary values in floating-point format.
 *
 * @param re the real value of the complex number in double format.
 * @param im the imaginary value of the complex number in double format.
 */


public actual fun ComplexDouble ( re : Number , im : Number ) : ComplexDouble

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

/**
 * Creates a [ComplexDouble] with the given real and imaginary values in number format.
 *
 * @param re the real value of the complex number in number format.
 * @param im the imaginary value of the complex number in number format.
 */


private fun fitsInFloat ( d : Double ) : Boolean

= d . toFloat ( ) . toDouble ( ) == d

/**
 * Determines whether the given double value can be accurately represented as a float value or not.
 *
 * @param d is the double value to be checked.
 * @return this method returns a Boolean value,
 * true if the double value can be accurately represented as a float value, false otherwise.
 */


private fun isComponentNMethod ( method : CallableMemberDescriptor ) : Boolean

{ <EOL> if ( ( method as? FunctionDescriptor ) ? . isOperator != true ) return false <EOL> val parent = method . containingDeclaration <EOL> if ( parent is ClassDescriptor && parent . isData && DataClassResolver . isComponentLike ( method . name ) ) { <EOL> return true <EOL> } <EOL> return false <EOL> }

/**
 * Check that given [method] is a synthetic .componentN() method of a data class.
 */


internal fun ClassDescriptor . isHiddenFromObjC ( ) : Boolean

= when { <EOL> ( this . containingDeclaration as? ClassDescriptor ) ? . isHiddenFromObjC ( ) == true -> true <EOL> else -> annotations . any { annotation -> <EOL> annotation . annotationClass ? . annotations ? . any { it . fqName == KonanFqNames . hidesFromObjC } == true <EOL> } <EOL> }

/**
 * Check if the given class or its enclosing declaration is marked as @HiddenFromObjC.
 */


@ InternalKotlinNativeApi <EOL> fun ObjCExportMapper . isBaseMethod ( descriptor : FunctionDescriptor )

= <EOL> this . isBase ( descriptor )

/**
 * Check that given [descriptor] is a so-called "base method", i.e. method
 * that doesn't override anything in a generated Objective-C interface.
 * Note that it does not mean that it has no "override" keyword.
 * Consider example:
 * ```kotlin
 * private interface I {
 * fun f()
 * }
 *
 * class C : I {
 * override fun f() {}
 * }
 * ```
 * Interface `I` is not exposed to the generated header, so C#f is considered to be a base method even though it has an "override" keyword.
 */


fun String . extFun ( k : String , s : String = "<STR_LIT>" )

= this + k + s

/**
 * val sExtFun = "O"::extFun
 * sExtFun.callBy(mapOf(sExtFun.parameters[0] to "K"))
 */


{ <EOL> val modelHub = ONNXModelHub ( cacheDirectory = File ( "<STR_LIT>" ) ) <EOL> val modelType = ONNXModels . ObjectDetection . SSD <EOL> val model = modelHub . loadModel ( modelType ) <EOL> model . inferAndCloseUsing ( CUDA ( ) ) { <EOL> val preprocessing = pipeline < BufferedImage > ( ) <EOL> . resize { <EOL> outputHeight = <NUM_LIT> <EOL> outputWidth = <NUM_LIT> <EOL> } <EOL> . convert { colorMode = ColorMode . RGB } <EOL> . toFloatArray { } <EOL> . call ( modelType . preprocessor ) <EOL> . fileLoader ( ) <EOL> for ( i in <NUM_LIT:1> .. <NUM_LIT:6> ) { <EOL> val inputData = preprocessing . load ( getFileFromResource ( "<STR_LIT>" ) ) <EOL> val start = System . currentTimeMillis ( ) <EOL> val yhat = it . predictRaw ( inputData ) <EOL> val end = System . currentTimeMillis ( ) <EOL> println ( "<STR_LIT>" ) <EOL> println ( yhat . values . toTypedArray ( ) . contentDeepToString ( ) ) <EOL> } <EOL> } <EOL> }

/**
 * This example demonstrates how to infer SSD model using [inferAndCloseUsing] scope function:
 * - Model is obtained from [ONNXModelHub].
 * - Model performs classification of a few images located in resources using CUDA execution provider.
 * - Internal onnx session is closed automatically after inference lambda is executed.
 */


fun take ( ) : Segment

/** Return a segment for the caller's use. */


fun recycle ( segment : Segment )

/** Recycle a segment that the caller no longer needs. */


infix fun < T1 , T2 > T1 . X ( other : T2 ) : Tuple2 < T1 , T2 >

= Tuple2 < T1 , T2 > ( this , other )

/**
 * Returns a new Tuple2 of the given arguments.
 * @see tupleOf
 * @see t
 **/


@ PublishedApi <EOL> @ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> internal fun getProgressionLastElement ( start : UInt , end : UInt , step : Int ) : UInt

= when { <EOL> step > <NUM_LIT:0> -> if ( start >= end ) end else end - differenceModulo ( end , start , step . toUInt ( ) ) <EOL> step < <NUM_LIT:0> -> if ( start <= end ) end else end + differenceModulo ( start , end , ( - step ) . toUInt ( ) ) <EOL> else -> throw kotlin . IllegalArgumentException ( "<STR_LIT>" ) <EOL> }

/**
 * Calculates the final element of a bounded arithmetic progression, i.e. the last element of the progression which is in the range
 * from [start] to [end] in case of a positive [step], or from [end] to [start] in case of a negative
 * [step].
 *
 * No validation on passed parameters is performed. The given parameters should satisfy the condition:
 *
 * - either `step > 0` and `start <= end`,
 * - or `step < 0` and `start >= end`.
 *
 * @param start first element of the progression
 * @param end ending bound for the progression
 * @param step increment, or difference of successive elements in the progression
 * @return the final element of the progression
 * @suppress
 */


@ PublishedApi <EOL> @ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> internal fun getProgressionLastElement ( start : ULong , end : ULong , step : Long ) : ULong

= when { <EOL> step > <NUM_LIT:0> -> if ( start >= end ) end else end - differenceModulo ( end , start , step . toULong ( ) ) <EOL> step < <NUM_LIT:0> -> if ( start <= end ) end else end + differenceModulo ( start , end , ( - step ) . toULong ( ) ) <EOL> else -> throw kotlin . IllegalArgumentException ( "<STR_LIT>" ) <EOL> }


{ <EOL> val jsonConfigFile = getVGG19JSONConfigFile ( ) <EOL> val model = Sequential . loadModelConfiguration ( jsonConfigFile ) <EOL> val imageNetClassLabels = Imagenet . V1k . labels ( ) <EOL> model . use { <EOL> it . compile ( optimizer = Adam ( ) , loss = Losses . MAE , metric = Metrics . ACCURACY ) <EOL> it . logSummary ( ) <EOL> val hdfFile = getVGG19WeightsFile ( ) <EOL> it . loadWeights ( hdfFile ) <EOL> val inputStreamLoader = pipeline < BufferedImage > ( ) <EOL> . convert { colorMode = ColorMode . BGR } <EOL> . toFloatArray { } <EOL> . call ( InputType . CAFFE . preprocessing ( ) ) <EOL> . inputStreamLoader ( ) <EOL> for ( i in <NUM_LIT:1> .. <NUM_LIT:8> ) { <EOL> val inputStream = OnHeapDataset :: class . java . classLoader . getResourceAsStream ( "<STR_LIT>" ) <EOL> val inputData = inputStreamLoader . load ( inputStream ) <EOL> val res = it . predictLabel ( inputData ) <EOL> println ( "<STR_LIT>" ) <EOL> val top5 = it . predictTop5Labels ( inputData , imageNetClassLabels ) <EOL> println ( top5 . toString ( ) ) <EOL> } <EOL> } <EOL> }

/**
 * This example demonstrates the inference concept on VGG'19 model:
 * - Weights are loaded from .h5 file, configuration is loaded from .json file.
 * - Model predicts on a few images located in resources.
 * - Special preprocessing (used in VGG'19 during training on ImageNet dataset) is applied to each image before prediction.
 * - No additional training.
 * - No new layers are added.
 *
 * @see
 * Very Deep Convolutional Networks for Large-Scale Image Recognition (ICLR 2015).
 * @see
 * Detailed description of VGG'19 model and an approach to build it in Keras.
 */


private fun getVGG19JSONConfigFile ( ) : File

{ <EOL> val properties = Properties ( ) <EOL> val reader = FileReader ( "<STR_LIT>" ) <EOL> properties . load ( reader ) <EOL> val vgg19JSONModelPath = properties [ "<STR_LIT>" ] as String <EOL> return File ( vgg19JSONModelPath ) <EOL> }

/** Returns JSON file with model configuration, saved from Keras 2.x. */


private fun getVGG19WeightsFile ( ) : HdfFile

{ <EOL> val properties = Properties ( ) <EOL> val reader = FileReader ( "<STR_LIT>" ) <EOL> properties . load ( reader ) <EOL> val vgg19h5WeightsPath = properties [ "<STR_LIT>" ] as String <EOL> return HdfFile ( File ( vgg19h5WeightsPath ) ) <EOL> }

/** Returns .h5 file with model weights, saved from Keras 2.x. */


private fun FirFunctionSymbol < * > . isArrayLambdaConstructor ( ) : Boolean

{ <EOL> return this is FirConstructorSymbol && <EOL> valueParameterSymbols . size == <NUM_LIT:2> && <EOL> resolvedReturnType . isArrayOrPrimitiveArray <EOL> }

/**
 * @return true if the symbol is the constructor of one of 9 array classes (`Array<T>`,
 * `IntArray`, `FloatArray`, ...) which takes the size and an initializer lambda as parameters.
 * Such constructors are marked as `inline` but they are not loaded as such because the `inline`
 * flag is not stored for constructors in the binary metadata. Therefore, we pretend that they
 * are inline.
 */


public actual operator fun contains ( char : Char ) : Boolean

= Character . getType ( char ) == this . value

/**
 * Returns `true` if [char] character belongs to this category.
 */


public fun valueOf ( category : Int ) : CharCategory

= <EOL> when ( category ) { <EOL> in <NUM_LIT:0> .. <NUM_LIT:16> -> entries [ category ] <EOL> in <NUM_LIT> .. <NUM_LIT> -> entries [ category - <NUM_LIT:1> ] <EOL> else -> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> }

/**
 * Returns the [CharCategory] corresponding to the specified [category] that represents a Java general category constant.
 *
 * @throws IllegalArgumentException if the [category] does not represent a Java general category constant.
 */


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

{ <EOL> if ( ! ignoreCase ) <EOL> return nativeStartsWith ( prefix , <NUM_LIT:0> ) <EOL> else <EOL> return regionMatches ( <NUM_LIT:0> , prefix , <NUM_LIT:0> , prefix . length , ignoreCase ) <EOL> }

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


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

{ <EOL> if ( ! ignoreCase ) <EOL> return nativeStartsWith ( prefix , startIndex ) <EOL> else <EOL> return regionMatches ( startIndex , prefix , <NUM_LIT:0> , prefix . length , ignoreCase ) <EOL> }

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


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

{ <EOL> if ( ! ignoreCase ) <EOL> return nativeEndsWith ( suffix ) <EOL> else <EOL> return regionMatches ( length - suffix . length , suffix , <NUM_LIT:0> , suffix . length , ignoreCase ) <EOL> }

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


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

{ <EOL> if ( this == null ) return other == null <EOL> if ( other == null ) return false <EOL> if ( ! ignoreCase ) return this == other <EOL> if ( this . length != other . length ) return false <EOL> for ( index in <NUM_LIT:0> until this . length ) { <EOL> val thisChar = this [ index ] <EOL> val otherChar = other [ index ] <EOL> if ( ! thisChar . equals ( otherChar , ignoreCase ) ) { <EOL> return false <EOL> } <EOL> } <EOL> return true <EOL> }

/**
 * Returns `true` if this string is equal to [other], optionally ignoring character case.
 *
 * Two strings are considered to be equal if they have the same length and the same character at the same index.
 * If [ignoreCase] is true, the result of `Char.uppercaseChar().lowercaseChar()` on each character is compared.
 *
 * @param ignoreCase `true` to ignore character case when comparing strings. By default `false`.
 */


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

= regionMatchesImpl ( thisOffset , other , otherOffset , length , ignoreCase )

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


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

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


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

{ <EOL> return if ( isNotEmpty ( ) ) substring ( <NUM_LIT:0> , <NUM_LIT:1> ) . uppercase ( ) + substring ( <NUM_LIT:1> ) else this <EOL> }

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


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

{ <EOL> return if ( isNotEmpty ( ) ) substring ( <NUM_LIT:0> , <NUM_LIT:1> ) . lowercase ( ) + substring ( <NUM_LIT:1> ) else this <EOL> }

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


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

{ <EOL> require ( n >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return when ( n ) { <EOL> <NUM_LIT:0> -> "<STR_LIT>" <EOL> <NUM_LIT:1> -> this . toString ( ) <EOL> else -> { <EOL> var result = "<STR_LIT>" <EOL> if ( ! isEmpty ( ) ) { <EOL> var s = this . toString ( ) <EOL> var count = n <EOL> while ( true ) { <EOL> if ( ( count and <NUM_LIT:1> ) == <NUM_LIT:1> ) { <EOL> result += s <EOL> } <EOL> count = count ushr <NUM_LIT:1> <EOL> if ( count == <NUM_LIT:0> ) { <EOL> break <EOL> } <EOL> s += s <EOL> } <EOL> } <EOL> return result <EOL> } <EOL> } <EOL> }

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


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

= <EOL> nativeReplace ( RegExp ( Regex . escape ( oldValue ) , if ( ignoreCase ) "<STR_LIT>" else "<STR_LIT>" ) , Regex . nativeEscapeReplacement ( newValue ) )

/**
 * Returns a new string obtained by replacing all occurrences of the [oldValue] substring in this string
 * with the specified [newValue] string.
 *
 * @sample samples.text.Strings.replace
 */


@ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun String . replace ( oldChar : Char , newChar : Char , ignoreCase : Boolean = false ) : String

= <EOL> nativeReplace ( RegExp ( Regex . escape ( oldChar . toString ( ) ) , if ( ignoreCase ) "<STR_LIT>" else "<STR_LIT>" ) , newChar . toString ( ) )

/**
 * Returns a new string with all occurrences of [oldChar] replaced with [newChar].
 *
 * @sample samples.text.Strings.replace
 */


fun asyncFetch ( )

/**
 * Starts the async query to fetch the stats.
 */


fun asyncTryClickAndFetch ( ) : Boolean

/**
 * Starts the async query to submit a click and fetch the stats.
 *
 * @return `true` on success, or `false` if the call should be retried later.
 */


fun getMostRecentFetched ( ) : Stats ?

/**
 * @return the [Stats] fetched most recently.
 */


fun explicitApi ( )

/**
 * Sets [explicitApi] option to report issues as errors.
 */


fun explicitApiWarning ( )

/**
 * Sets [explicitApi] option to report issues as warnings.
 */


@ Deprecated ( "<STR_LIT>" , level = DeprecationLevel . ERROR ) <EOL> @ Suppress ( "<STR_LIT:DEPRECATION_ERROR>" ) <EOL> fun toCompilerArg ( )

= "<STR_LIT>"


override fun dispatch ( context : CoroutineContext , block : Runnable ) : Unit

= Platform . runLater ( block )


override fun scheduleResumeAfterDelay ( timeMillis : Long , continuation : CancellableContinuation < Unit > )

{ <EOL> val timeline = schedule ( timeMillis ) { <EOL> with ( continuation ) { resumeUndispatched ( Unit ) } <EOL> } <EOL> continuation . invokeOnCancellation { timeline . stop ( ) } <EOL> }


override fun invokeOnTimeout ( timeMillis : Long , block : Runnable , context : CoroutineContext ) : DisposableHandle

{ <EOL> val timeline = schedule ( timeMillis ) { <EOL> block . run ( ) <EOL> } <EOL> return DisposableHandle { timeline . stop ( ) } <EOL> }


public suspend fun awaitPulse ( ) : Long

= suspendCancellableCoroutine { cont -> <EOL> pulseTimer . onNext ( cont ) <EOL> }

/**
 * Suspends coroutine until next JavaFx pulse and returns time of the pulse on resumption.
 * If the [Job] of the current coroutine is completed while this suspending function is waiting, this function
 * immediately resumes with [CancellationException][kotlinx.coroutines.CancellationException].
 */


= PlatformInitializer . success

/** @return true if initialized successfully, and false if no display is detected */


fun IrProperty . isJvmOptimizableDelegate ( ) : Boolean

= <EOL> isDelegated && ! isFakeOverride && backingField != null && <EOL> ( getPropertyReferenceForOptimizableDelegatedProperty ( ) != null || getSingletonOrConstantForOptimizableDelegatedProperty ( ) != null )

/** Returns true if a delegate is optimizable on the JVM, omitting a `$delegate` auxiliary property */


internal fun addDefaultLlvmFunctionAttributes ( context : Context , llvmFunction : LLVMValueRef )

{ <EOL> if ( shouldEnforceFramePointer ( context ) ) { <EOL> enforceFramePointer ( llvmFunction , context ) <EOL> } <EOL> }

/**
 * Mimics parts of clang's `CodeGenModule::getDefaultFunctionAttributes`
 * that are required for Kotlin/Native compiler.
 */


internal fun addTargetCpuAndFeaturesAttributes ( context : Context , llvmFunction : LLVMValueRef )

{ <EOL> context . config . platform . targetCpu ? . let { <EOL> LLVMAddTargetDependentFunctionAttr ( llvmFunction , "<STR_LIT>" , it ) <EOL> } <EOL> context . config . platform . targetCpuFeatures ? . let { <EOL> LLVMAddTargetDependentFunctionAttr ( llvmFunction , "<STR_LIT>" , it ) <EOL> } <EOL> }

/**
 * Set target cpu and its features to make LLVM generate correct machine code.
 */


{ <EOL> gradleNoKeyValue ( ) <EOL> gradleKeyValue ( ) <EOL> kspNoKeyValue ( ) <EOL> kspKeyValue ( ) <EOL> }

/**
 * In this file we'll demonstrate how to use the jsonOption `keyValuePaths`
 * both using the Gradle- and KSP plugin and what it does.
 */


{ <EOL> val df = MetricsNoKeyValue . readJson ( "<STR_LIT>" ) <EOL> df . print ( columnTypes = true , title = true , borders = true ) <EOL> }

/**
 * Gradle example of reading a JSON file with no key-value pairs.
 * Ctrl+Click on [MetricsNoKeyValue] to see the generated code.
 */


{ <EOL> val df = MetricsKeyValue . readJson ( "<STR_LIT>" ) <EOL> df . print ( columnTypes = true , title = true , borders = true ) <EOL> }

/**
 * Gradle example of reading a JSON file with key-value pairs.
 * Ctrl+Click on [MetricsKeyValue] to see the generated code.
 */


{ <EOL> val df = APIsNoKeyValue . readJson ( "<STR_LIT>" ) <EOL> df . print ( columnTypes = true , title = true , borders = true ) <EOL> }

/**
 * KSP example of reading a JSON file with no key-value pairs.
 * Ctrl+Click on [APIsNoKeyValue] to see the generated code.
 *
 * Note the many generated interfaces. You can imagine larger files crashing the code generator.
 */


{ <EOL> val df = APIsKeyValue . readJson ( "<STR_LIT>" ) <EOL> . value . first ( ) <EOL> df . print ( columnTypes = true , title = true , borders = true ) <EOL> }

/**
 * KSP example of reading a JSON file with key-value pairs.
 * Ctrl+Click on [APIsKeyValue] to see the generated code.
 */


fun < H : Any > Collection < H > . selectMostSpecificInEachOverridableGroup ( descriptorByHandle : H . ( ) -> CallableDescriptor ) : Collection < H >

{ <EOL> if ( size <= <NUM_LIT:1> ) return this <EOL> val queue = LinkedList < H > ( this ) <EOL> val result = SmartSet . create < H > ( ) <EOL> while ( queue . isNotEmpty ( ) ) { <EOL> val nextHandle : H = queue . first ( ) <EOL> val conflictedHandles = SmartSet . create < H > ( ) <EOL> val overridableGroup = <EOL> OverridingUtil . extractMembersOverridableInBothWays ( nextHandle , queue , descriptorByHandle ) { conflictedHandles . add ( it ) } <EOL> if ( overridableGroup . size == <NUM_LIT:1> && conflictedHandles . isEmpty ( ) ) { <EOL> result . add ( overridableGroup . single ( ) ) <EOL> continue <EOL> } <EOL> val mostSpecific = OverridingUtil . selectMostSpecificMember ( overridableGroup , descriptorByHandle ) <EOL> val mostSpecificDescriptor = mostSpecific . descriptorByHandle ( ) <EOL> overridableGroup . filterNotTo ( conflictedHandles ) { <EOL> OverridingUtil . isMoreSpecific ( mostSpecificDescriptor , it . descriptorByHandle ( ) ) <EOL> } <EOL> if ( conflictedHandles . isNotEmpty ( ) ) { <EOL> result . addAll ( conflictedHandles ) <EOL> } <EOL> result . add ( mostSpecific ) <EOL> } <EOL> return result <EOL> }

/**
 * @param <H> is something that handles CallableDescriptor inside
 */


actual fun < T > CoroutineScope . asyncWithDealy ( delay : Long , block : suspend ( ) -> T ) : Deferred < T >

{ <EOL> TODO ( "<STR_LIT:NotU+0020yetU+0020implemented>" ) <EOL> }

/**
 * MacOS actual implementation for `asyncWithDelay`
 */


fun `test sample 3 - with dependencies` ( )

{ <EOL> fun InlineSourceBuilder . ModuleBuilder . commonDependencies ( ) { <EOL> source ( """<STR_LIT>""" . trimIndent ( ) , "<STR_LIT>" ) <EOL> } <EOL> fun InlineSourceBuilder . ModuleBuilder . targetDependencies ( ) { <EOL> dependency { commonDependencies ( ) } <EOL> source ( """<STR_LIT>""" . trimIndent ( ) , "<STR_LIT>" ) <EOL> } <EOL> val root = createCirTreeRoot { <EOL> dependency { commonDependencies ( ) } <EOL> dependency { targetDependencies ( ) } <EOL> source ( """<STR_LIT>""" . trimIndent ( ) ) <EOL> } <EOL> val classifiers = CirKnownClassifiers ( classifierIndices = TargetDependent ( target to CirClassifierIndex ( root ) ) , commonDependencies = createCirProvidedClassifiers { commonDependencies ( ) } , targetDependencies = TargetDependent ( target to createCirProvidedClassifiers { targetDependencies ( ) } ) , commonizedNodes = CirCommonizedClassifierNodes . default ( ) ) <EOL> val idOfX = CirEntityId . create ( "<STR_LIT:X>" ) <EOL> val idOfY = CirEntityId . create ( "<STR_LIT>" ) <EOL> val idOfZ = CirEntityId . create ( "<STR_LIT:Z>" ) <EOL> val idOfA = CirEntityId . create ( "<STR_LIT:A>" ) <EOL> val idOfB = CirEntityId . create ( "<STR_LIT:B>" ) <EOL> val idOfC = CirEntityId . create ( "<STR_LIT:C>" ) <EOL> val idOfD = CirEntityId . create ( "<STR_LIT:D>" ) <EOL> val idOfE = CirEntityId . create ( "<STR_LIT>" ) <EOL> val typeX = mockClassType ( "<STR_LIT:X>" ) <EOL> val typeY = mockClassType ( "<STR_LIT>" ) <EOL> val typeZ = mockClassType ( "<STR_LIT:Z>" ) <EOL> val typeA = mockTAType ( "<STR_LIT:A>" ) { typeX } <EOL> val typeB = mockTAType ( "<STR_LIT:B>" ) { typeY } <EOL> val typeC = mockTAType ( "<STR_LIT:C>" ) { typeA } <EOL> val typeD = mockTAType ( "<STR_LIT:D>" ) { typeC } <EOL> val typeE = mockTAType ( "<STR_LIT>" ) { typeZ } <EOL> assertEquals ( CirTypeDistance ( <NUM_LIT:1> ) , typeDistance ( classifiers , target , typeA , idOfX ) ) <EOL> assertEquals ( CirTypeDistance ( - <NUM_LIT:1> ) , typeDistance ( classifiers , target , typeX , idOfA ) ) <EOL> assertEquals ( CirTypeDistance ( <NUM_LIT:1> ) , typeDistance ( classifiers , target , typeB , idOfY ) ) <EOL> assertEquals ( CirTypeDistance ( - <NUM_LIT:1> ) , typeDistance ( classifiers , target , typeY , idOfB ) ) <EOL> assertEquals ( CirTypeDistance ( <NUM_LIT:2> ) , typeDistance ( classifiers , target , typeC , idOfX ) ) <EOL> assertEquals ( CirTypeDistance ( - <NUM_LIT:2> ) , typeDistance ( classifiers , target , typeX , idOfC ) ) <EOL> assertEquals ( CirTypeDistance ( <NUM_LIT:3> ) , typeDistance ( classifiers , target , typeD , idOfX ) ) <EOL> assertEquals ( CirTypeDistance ( - <NUM_LIT:3> ) , typeDistance ( classifiers , target , typeX , idOfD ) ) <EOL> assertEquals ( CirTypeDistance ( <NUM_LIT:2> ) , typeDistance ( classifiers , target , typeD , idOfA ) ) <EOL> assertEquals ( CirTypeDistance ( - <NUM_LIT:2> ) , typeDistance ( classifiers , target , typeA , idOfD ) ) <EOL> assertEquals ( CirTypeDistance ( <NUM_LIT:1> ) , typeDistance ( classifiers , target , typeE , idOfZ ) ) <EOL> assertEquals ( CirTypeDistance ( - <NUM_LIT:1> ) , typeDistance ( classifiers , target , typeZ , idOfE ) ) <EOL> }

/**
 * Type Alias Chains:
 * E -> Z
 * B -> Y
 * D -> C -> A -> X
 */


fun assertVersion ( message : String = "<STR_LIT>" , condition : ( Int ) -> Boolean , )

/**
 * Does nothing if [condition] returns true for current JRE version, throws [AssertionError] otherwise
 *
 * @param message Exception message
 * @param condition Condition to check
 */


fun assertVersionAtLeast ( minVersion : Int )

/**
 * Does nothing if current JRE version is higher or equal than [minVersion], throws [AssertionError] otherwise
 *
 * @param minVersion Minimal accepted version
 */


fun assertVersionInRange ( minVersion : Int , maxVersion : Int , )

/**
 * Does nothing if current JRE version is between [minVersion] and [maxVersion], throws [AssertionError] otherwise
 *
 * @param minVersion Minimal accepted version
 * @param maxVersion Maximal accepted version
 */


fun use ( jdkHomeLocation : File , jdkVersion : JavaVersion )

/**
 * Configures the JVM toolchain to use the JDK located under the [jdkHomeLocation] absolute path.
 * The major JDK version from [javaVersion] is used as a task input so that Gradle avoids using task outputs
 * in the [build cache](https://docs.gradle.org/current/userguide/build_cache.html) that use different JDK versions.
 *
 * **Note**: The project build fails if the JRE version instead of the JDK version is provided.
 *
 * @param jdkHomeLocation The path to the JDK location on the machine
 * @param jdkVersion The JDK version located in the configured [jdkHomeLocation] path
 */


fun use ( jdkHomeLocation : String , jdkVersion : Any )

= use ( File ( jdkHomeLocation ) , JavaVersion . toVersion ( jdkVersion ) )

/**
 * Configures the JVM toolchain to use the JDK located under the [jdkHomeLocation] absolute path.
 * The major JDK version from [javaVersion] is used as a task input so that Gradle avoids using task outputs
 * in the [build cache](https://docs.gradle.org/current/userguide/build_cache.html) that use different JDK versions.
 *
 * **Note**: The project build fails if the JRE version instead of the JDK version is provided.
 *
 * @param jdkHomeLocation The path to the JDK location on the machine
 * @param jdkVersion JDK version located in the configured [jdkHomeLocation] path.
 * Accepts any type that is accepted by [JavaVersion.toVersion].
 * @throws IllegalArgumentException if the given [jdkVersion] value cannot be converted
 */


fun use ( javaLauncher : Provider < JavaLauncher > )

/**
 * Configures the JVM toolchain for a task using the [JavaLauncher] obtained from [org.gradle.jvm.toolchain.JavaToolchainService] via
 * the [org.gradle.api.plugins.JavaPluginExtension] extension.
 */


private fun collectReturnExpressions ( ) : ReturnedExpressionsInfo

{ <EOL> val instructions = pseudocode . instructions . toHashSet ( ) <EOL> val exitInstruction = pseudocode . exitInstruction <EOL> val returnedExpressions = arrayListOf < KtElement > ( ) <EOL> var hasReturnsInInlinedLambda = false <EOL> for ( previousInstruction in exitInstruction . previousInstructions ) { <EOL> previousInstruction . accept ( object : InstructionVisitor ( ) { <EOL> override fun visitReturnValue ( instruction : ReturnValueInstruction ) { <EOL> if ( instructions . contains ( instruction ) ) { <EOL> returnedExpressions . add ( instruction . element ) <EOL> } <EOL> if ( instruction . owner . isInlined ) { <EOL> hasReturnsInInlinedLambda = true <EOL> } <EOL> } <EOL> override fun visitReturnNoValue ( instruction : ReturnNoValueInstruction ) { <EOL> if ( instructions . contains ( instruction ) ) { <EOL> returnedExpressions . add ( instruction . element ) <EOL> } <EOL> if ( instruction . owner . isInlined ) { <EOL> hasReturnsInInlinedLambda = true <EOL> } <EOL> } <EOL> override fun visitUnconditionalJump ( instruction : UnconditionalJumpInstruction ) { <EOL> redirectToPrevInstructions ( instruction ) <EOL> } <EOL> override fun visitConditionalJump ( instruction : ConditionalJumpInstruction ) { <EOL> redirectToPrevInstructions ( instruction ) <EOL> } <EOL> private fun redirectToPrevInstructions ( instruction : Instruction ) { <EOL> for ( redirectInstruction in instruction . previousInstructions ) { <EOL> redirectInstruction . accept ( this ) <EOL> } <EOL> } <EOL> override fun visitNondeterministicJump ( instruction : NondeterministicJumpInstruction ) { <EOL> redirectToPrevInstructions ( instruction ) <EOL> } <EOL> override fun visitMarkInstruction ( instruction : MarkInstruction ) { <EOL> redirectToPrevInstructions ( instruction ) <EOL> } <EOL> override fun visitInstruction ( instruction : Instruction ) { <EOL> if ( instruction is KtElementInstruction ) { <EOL> returnedExpressions . add ( instruction . element ) <EOL> } else { <EOL> throw IllegalStateException ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } ) <EOL> } <EOL> return ReturnedExpressionsInfo ( returnedExpressions , hasReturnsInInlinedLambda ) <EOL> }

/**
 * Collects returned expressions from current pseudocode.
 *
 * "Returned expression" here == "last expression" in *control-flow terms*. Intuitively,
 * it considers all execution paths, takes last expression on each path and returns them.
 *
 * More specifically, this function starts from EXIT instruction, and performs DFS-search
 * on reversed control-flow edges in a following manner:
 * - if the current instruction is a Return-instruction, then add it's expression to result
 * - if the current instruction is a Element-instruction, then add it's element to result
 * - if the current instruction is a Jump-instruction, then process it's predecessors
 * recursively
 *
 * NB. The second case (Element-instruction) means that notion of "returned expression"
 * here differs from what the language treats as "returned expression" (notably in the
 * presence of Unit-coercion). Example:
 *
 * fun foo() {
 * val x = 42
 * x.inc() // This call will be in a [returnedExpressions], even though this expression
 * // isn't actually returned
 * }
 */