private suspend fun visitPropertyDescriptor ( originalDescriptor : PropertyDescriptor , implicitAccessors : DescriptorAccessorHolder ? , parent : DRIWithPlatformInfo ) : DProperty

{ <EOL> val ( dri , _ ) = originalDescriptor . createDRI ( ) <EOL> val inheritedFrom = dri . getInheritedFromDRI ( parent ) <EOL> val descriptor = originalDescriptor . getConcreteDescriptor ( ) <EOL> val isExpect = descriptor . isExpect <EOL> val isActual = descriptor . isActual <EOL> val actual = originalDescriptor . createSources ( ) <EOL> suspend fun getDescriptorGetter ( ) = <EOL> descriptor . accessors <EOL> . firstIsInstanceOrNull < PropertyGetterDescriptor > ( ) <EOL> ? . let { <EOL> visitPropertyAccessorDescriptor ( it , descriptor , dri , inheritedFrom ) <EOL> } <EOL> suspend fun getImplicitAccessorGetter ( ) = <EOL> implicitAccessors ? . getter ? . let { visitFunctionDescriptor ( it , parent ) } <EOL> suspend fun getDescriptorSetter ( ) = <EOL> descriptor . accessors <EOL> . firstIsInstanceOrNull < PropertySetterDescriptor > ( ) <EOL> ? . let { <EOL> visitPropertyAccessorDescriptor ( it , descriptor , dri , inheritedFrom ) <EOL> } <EOL> suspend fun getImplicitAccessorSetter ( ) = <EOL> implicitAccessors ? . setter ? . let { visitFunctionDescriptor ( it , parent ) } <EOL> return coroutineScope { <EOL> val generics = async { descriptor . typeParameters . parallelMap { it . toVariantTypeParameter ( ) } } <EOL> val getter = getDescriptorGetter ( ) ? : getImplicitAccessorGetter ( ) <EOL> val setter = getDescriptorSetter ( ) ? : getImplicitAccessorSetter ( ) <EOL> DProperty ( dri = dri , name = descriptor . name . asString ( ) , receiver = descriptor . extensionReceiverParameter ? . let { <EOL> visitReceiverParameterDescriptor ( it , DRIWithPlatformInfo ( dri , actual ) ) <EOL> } , sources = actual , getter = getter , setter = setter , visibility = descriptor . getVisibility ( implicitAccessors ) . toSourceSetDependent ( ) , documentation = descriptor . getDocumentation ( ) , modifier = descriptor . modifier ( ) . toSourceSetDependent ( ) , type = descriptor . returnType ! ! . toBound ( ) , expectPresentInSet = sourceSet . takeIf { isExpect } , sourceSets = setOf ( sourceSet ) , generics = generics . await ( ) , isExpectActual = ( isExpect || isActual ) , extra = PropertyContainer . withAll ( listOfNotNull ( ( descriptor . additionalExtras ( ) + descriptor . getAnnotationsWithBackingField ( ) . toAdditionalExtras ( ) ) . toSet ( ) . toSourceSetDependent ( ) . toAdditionalModifiers ( ) , ( descriptor . getAnnotationsWithBackingField ( ) + descriptor . fileLevelAnnotations ( ) ) . toSourceSetDependent ( ) . toAnnotations ( ) , descriptor . getDefaultValue ( ) ? . let { DefaultValue ( it . toSourceSetDependent ( ) ) } , inheritedFrom ? . let { InheritedMember ( it . toSourceSetDependent ( ) ) } , takeIf { descriptor . isVar ( getter , setter ) } ? . let { IsVar } , takeIf { descriptor . findPsi ( ) is KtParameter } ? . let { IsAlsoParameter ( listOf ( sourceSet ) ) } ) ) ) <EOL> } <EOL> }

/**
 * @param implicitAccessors getters/setters that are not part of the property descriptor, for instance
 * average methods inherited from java sources that access the property
 */


private fun DRI . getInheritedFromDRI ( parent : DRIWithPlatformInfo ) : DRI ?

{ <EOL> return this . copy ( callable = null ) <EOL> . takeIf { parent . dri . classNames != this . classNames || parent . dri . packageName != this . packageName } <EOL> }

/**
 * `createDRI` returns the DRI of the exact element and potential DRI of an element that is overriding it
 * (It can be also FAKE_OVERRIDE which is in fact just inheritance of the symbol)
 *
 * Looking at what PSIs do, they give the DRI of the element within the classnames where it is actually
 * declared and inheritedFrom as the same DRI but truncated callable part.
 * Therefore, we set callable to null and take the DRI only if it is indeed coming from different class.
 */


private fun SourceSetDependent < DocumentationNode > . mapInheritedTagWrappers ( ) : SourceSetDependent < DocumentationNode >

{ <EOL> return this . mapValues { ( _ , value ) -> <EOL> val mappedChildren = value . children . map { <EOL> when ( it ) { <EOL> is Property -> Description ( it . root ) <EOL> else -> it <EOL> } <EOL> } <EOL> value . copy ( children = mappedChildren ) <EOL> } <EOL> }

/**
 * Workaround for a problem with inheriting parent TagWrappers of the wrong type.
 *
 * For instance, if you annotate a class with `@property`, kotlin compiler will propagate
 * this tag to the property and its getters and setters. In case of getters and setters,
 * it's more correct to display propagated docs as description instead of property
 */


fun < T > run ( block : suspend NodeJsInspectorClientContext . ( ) -> T ) : T

= runBlocking { <EOL> val context = NodeJsInspectorClientContextImpl ( this @ NodeJsInspectorClient ) <EOL> try { <EOL> runWithContext ( context , block ) <EOL> } catch ( e : Throwable ) { <EOL> val nodeExitCode = try { <EOL> context . nodeProcess . exitValue ( ) <EOL> } catch ( _ : IllegalThreadStateException ) { <EOL> throw e <EOL> } <EOL> throw NodeExitedException ( nodeExitCode , e ) <EOL> } finally { <EOL> context . release ( ) <EOL> } <EOL> }

/**
 * Creates a Node process and provides a context for communicating with it.
 * After [block] returns, the Node process is destroyed.
 */


fun onEvent ( receiveEvent : ( CDPEvent ) -> Unit )

{ <EOL> onDebuggerEventCallback = receiveEvent <EOL> }

/**
 * Installs a listener for Chrome DevTools Protocol events.
 */


suspend fun listenForMessages ( receiveMessage : ( String ) -> Boolean )

{ <EOL> val session = webSocketSession ? : error ( "<STR_LIT>" ) <EOL> do { <EOL> val message = when ( val frame = session . incoming . receive ( ) ) { <EOL> is Frame . Text -> frame . readText ( ) <EOL> else -> error ( "<STR_LIT>" ) <EOL> } <EOL> logger . finer { <EOL> "<STR_LIT>" <EOL> } <EOL> } while ( ! receiveMessage ( message ) ) <EOL> }

/**
 * Starts a loop that waits for incoming Chrome DevTools Protocol messages and invokes [receiveMessage] when one is received.
 * The loop stops as soon as at least one message is received *and* [receiveMessage] returns `true`.
 */


{ <EOL> logger . fine { "<STR_LIT>" } <EOL> webSocketSession ? . close ( ) <EOL> webSocketSession = null <EOL> webSocketClient . close ( ) <EOL> nodeProcess . destroy ( ) <EOL> }

/**
 * Releases all the resources and destroys the Node.js process.
 */


public actual fun < T > MutableList < T > . reverse ( ) : Unit

{ <EOL> val midPoint = ( size / <NUM_LIT:2> ) - <NUM_LIT:1> <EOL> if ( midPoint < <NUM_LIT:0> ) return <EOL> var reverseIndex = lastIndex <EOL> for ( index in <NUM_LIT:0> .. midPoint ) { <EOL> val tmp = this [ index ] <EOL> this [ index ] = this [ reverseIndex ] <EOL> this [ reverseIndex ] = tmp <EOL> reverseIndex -- <EOL> } <EOL> }

/**
 * Reverses elements in the list in-place.
 */


@ ExperimentalPathApi <EOL> @ SinceKotlin ( "<STR_LIT:1.8>" ) <EOL> public fun Path . copyToRecursively ( target : Path , onError : ( source : Path , target : Path , exception : Exception ) -> OnErrorResult = { _ , _ , exception -> throw exception } , followLinks : Boolean , overwrite : Boolean ) : Path

{ <EOL> return if ( overwrite ) { <EOL> copyToRecursively ( target , onError , followLinks ) { src , dst -> <EOL> val options = LinkFollowing . toLinkOptions ( followLinks ) <EOL> val dstIsDirectory = dst . isDirectory ( LinkOption . NOFOLLOW_LINKS ) <EOL> val srcIsDirectory = src . isDirectory ( * options ) <EOL> if ( ( srcIsDirectory && dstIsDirectory ) . not ( ) ) { <EOL> if ( dstIsDirectory ) <EOL> dst . deleteRecursively ( ) <EOL> src . copyTo ( dst , * options , StandardCopyOption . REPLACE_EXISTING ) <EOL> } <EOL> CopyActionResult . CONTINUE <EOL> } <EOL> } else { <EOL> copyToRecursively ( target , onError , followLinks ) <EOL> } <EOL> }

/**
 * Recursively copies this directory and its content to the specified destination [target] path.
 * Note that if this function throws, partial copying may have taken place.
 *
 * Unlike `File.copyRecursively`, if some directories on the way to the [target] are missing, then they won't be created automatically.
 * You can use the [createParentDirectories] function to ensure that required intermediate directories are created:
 * ```
 * sourcePath.copyToRecursively(
 * destinationPath.createParentDirectories(),
 * followLinks = false
 * )
 * ```
 *
 * If the entry located by this path is a directory, this function recursively copies the directory itself and its content.
 * Otherwise, this function copies only the entry.
 *
 * If an exception occurs attempting to read, open or copy any entry under the source subtree,
 * further actions will depend on the result of the [onError] invoked with
 * the source and destination paths, that caused the error, and the exception itself as arguments.
 * If [onError] throws, this function ends immediately with the exception.
 * By default [onError] rethrows the exception. See [OnErrorResult] for available options.
 *
 * This function performs "directory merge" operation. If an entry in the source subtree is a directory
 * and the corresponding entry in the target subtree already exists and is also a directory, it does nothing.
 * Otherwise, [overwrite] determines whether to overwrite existing destination entries.
 * Attributes of a source entry, such as creation/modification date, are not copied.
 *
 * [followLinks] impacts only symbolic links in the source subtree and
 * determines whether to copy a symbolic link itself or the entry it points to.
 * Symbolic links in the target subtree are not followed, i.e.,
 * no entry is copied to the location a symbolic link points to.
 * If a copy destination is a symbolic link, it is overwritten or an exception is thrown depending on [overwrite].
 * Note that symbolic links on the way to the roots of the source and target subtrees are always followed.
 *
 * To provide a custom logic for copying use the overload that takes a `copyAction` lambda.
 *
 * @param target the destination path to copy recursively this entry to.
 * @param onError the function that determines further actions if an error occurs. By default, rethrows the exception.
 * @param followLinks `false` to copy a symbolic link itself, not its target.
 * `true` to recursively copy the target of a symbolic link.
 * @param overwrite `false` to throw if a destination entry already exists.
 * `true` to overwrite existing destination entries.
 * @throws NoSuchFileException if the entry located by this path does not exist.
 * @throws FileSystemException if [target] is an entry inside the source subtree.
 * @throws FileAlreadyExistsException if a destination entry already exists and [overwrite] is `false`.
 * This exception is passed to [onError] for handling.
 * @throws IOException if any errors occur while copying.
 * This exception is passed to [onError] for handling.
 * @throws FileSystemException if the source subtree contains an entry with an illegal name such as "." or "..".
 * This exception is passed to [onError] for handling.
 * @throws FileSystemLoopException if the recursive copy reaches a cycle.
 * This exception is passed to [onError] for handling.
 * @throws SecurityException if a security manager is installed and access is not permitted to an entry in the source or target subtree.
 * This exception is passed to [onError] for handling.
 */


@ ExperimentalPathApi <EOL> @ SinceKotlin ( "<STR_LIT:1.8>" ) <EOL> public fun Path . copyToRecursively ( target : Path , onError : ( source : Path , target : Path , exception : Exception ) -> OnErrorResult = { _ , _ , exception -> throw exception } , followLinks : Boolean , copyAction : CopyActionContext . ( source : Path , target : Path ) -> CopyActionResult = { src , dst -> <EOL> src . copyToIgnoringExistingDirectory ( dst , followLinks ) <EOL> } ) : Path

{ <EOL> if ( ! this . exists ( * LinkFollowing . toLinkOptions ( followLinks ) ) ) <EOL> throw NoSuchFileException ( this . toString ( ) , target . toString ( ) , "<STR_LIT>" ) <EOL> if ( this . exists ( ) && ( followLinks || ! this . isSymbolicLink ( ) ) ) { <EOL> val targetExistsAndNotSymlink = target . exists ( ) && ! target . isSymbolicLink ( ) <EOL> if ( targetExistsAndNotSymlink && this . isSameFileAs ( target ) ) { <EOL> } else { <EOL> val isSubdirectory = when { <EOL> this . fileSystem != target . fileSystem -> <EOL> false <EOL> targetExistsAndNotSymlink -> <EOL> target . toRealPath ( ) . startsWith ( this . toRealPath ( ) ) <EOL> else -> <EOL> target . parent ? . let { it . exists ( ) && it . toRealPath ( ) . startsWith ( this . toRealPath ( ) ) } ? : false <EOL> } <EOL> if ( isSubdirectory ) <EOL> throw FileSystemException ( this . toString ( ) , target . toString ( ) , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> val normalizedTarget = target . normalize ( ) <EOL> fun destination ( source : Path ) : Path { <EOL> val relativePath = source . relativeTo ( this @ copyToRecursively ) <EOL> val destination = target . resolve ( relativePath . pathString ) <EOL> if ( ! destination . normalize ( ) . startsWith ( normalizedTarget ) ) { <EOL> throw IllegalFileNameException ( source , destination , "<STR_LIT>" ) <EOL> } <EOL> return destination <EOL> } <EOL> fun error ( source : Path , exception : Exception ) : FileVisitResult { <EOL> return onError ( source , destination ( source ) , exception ) . toFileVisitResult ( ) <EOL> } <EOL> val stack = arrayListOf < Path > ( ) <EOL> @ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> fun copy ( source : Path , attributes : BasicFileAttributes ) : FileVisitResult { <EOL> return try { <EOL> if ( stack . isNotEmpty ( ) ) { <EOL> source . checkFileName ( ) <EOL> source . checkNotSameAs ( stack . last ( ) ) <EOL> } <EOL> DefaultCopyActionContext . copyAction ( source , destination ( source ) ) . toFileVisitResult ( ) <EOL> } catch ( exception : Exception ) { <EOL> error ( source , exception ) <EOL> } <EOL> } <EOL> visitFileTree ( followLinks = followLinks ) { <EOL> onPreVisitDirectory { directory , attributes -> <EOL> copy ( directory , attributes ) . also { <EOL> if ( it == FileVisitResult . CONTINUE ) stack . add ( directory ) <EOL> } <EOL> } <EOL> onVisitFile ( :: copy ) <EOL> onVisitFileFailed ( :: error ) <EOL> onPostVisitDirectory { directory , exception -> <EOL> stack . removeLast ( ) <EOL> if ( exception == null ) { <EOL> FileVisitResult . CONTINUE <EOL> } else { <EOL> error ( directory , exception ) <EOL> } <EOL> } <EOL> } <EOL> return target <EOL> }

/**
 * Recursively copies this directory and its content to the specified destination [target] path.
 * Note that if this function throws, partial copying may have taken place.
 *
 * Unlike `File.copyRecursively`, if some directories on the way to the [target] are missing, then they won't be created automatically.
 * You can use the [createParentDirectories] function to ensure that required intermediate directories are created:
 * ```
 * sourcePath.copyToRecursively(
 * destinationPath.createParentDirectories(),
 * followLinks = false
 * )
 * ```
 *
 * If the entry located by this path is a directory, this function recursively copies the directory itself and its content.
 * Otherwise, this function copies only the entry.
 *
 * If an exception occurs attempting to read, open or copy any entry under the source subtree,
 * further actions will depend on the result of the [onError] invoked with
 * the source and destination paths, that caused the error, and the exception itself as arguments.
 * If [onError] throws, this function ends immediately with the exception.
 * By default [onError] rethrows the exception. See [OnErrorResult] for available options.
 *
 * Copy operation is performed using [copyAction].
 * By default [copyAction] performs "directory merge" operation. If an entry in the source subtree is a directory
 * and the corresponding entry in the target subtree already exists and is also a directory, it does nothing.
 * Otherwise, the entry is copied using `sourcePath.copyTo(destinationPath, *followLinksOption)`,
 * which doesn't copy attributes of the source entry and throws if the destination entry already exists.
 *
 * [followLinks] impacts only symbolic links in the source subtree and
 * determines whether to copy a symbolic link itself or the entry it points to.
 * Symbolic links in the target subtree are not followed, i.e.,
 * no entry is copied to the location a symbolic link points to.
 * If a copy destination is a symbolic link, an exception is thrown.
 * Note that symbolic links on the way to the roots of the source and target subtrees are always followed.
 *
 * If a custom implementation of [copyAction] is provided, consider making it consistent with [followLinks] value.
 * See [CopyActionResult] for available options.
 *
 * If [copyAction] throws an exception, it is passed to [onError] for handling.
 *
 * @param target the destination path to copy recursively this entry to.
 * @param onError the function that determines further actions if an error occurs. By default, rethrows the exception.
 * @param followLinks `false` to copy a symbolic link itself, not its target.
 * `true` to recursively copy the target of a symbolic link.
 * @param copyAction the function to call for copying source entries to their destination path rooted in [target].
 * By default, performs "directory merge" operation.
 * @throws NoSuchFileException if the entry located by this path does not exist.
 * @throws FileSystemException if [target] is an entry inside the source subtree.
 * @throws IOException if any errors occur while copying.
 * This exception is passed to [onError] for handling.
 * @throws FileSystemException if the source subtree contains an entry with an illegal name such as "." or "..".
 * This exception is passed to [onError] for handling.
 * @throws FileSystemLoopException if the recursive copy reaches a cycle.
 * This exception is passed to [onError] for handling.
 * @throws SecurityException if a security manager is installed and access is not permitted to an entry in the source or target subtree.
 * This exception is passed to [onError] for handling.
 */


@ ExperimentalPathApi <EOL> @ SinceKotlin ( "<STR_LIT:1.8>" ) <EOL> public fun Path . deleteRecursively ( ) : Unit

{ <EOL> val suppressedExceptions = this . deleteRecursivelyImpl ( ) <EOL> if ( suppressedExceptions . isNotEmpty ( ) ) { <EOL> throw FileSystemException ( "<STR_LIT>" ) . apply { <EOL> suppressedExceptions . forEach { addSuppressed ( it ) } <EOL> } <EOL> } <EOL> }

/**
 * Recursively deletes this directory and its content.
 * Note that if this function throws, partial deletion may have taken place.
 *
 * If the entry located by this path is a directory, this function recursively deletes its content and the directory itself.
 * Otherwise, this function deletes only the entry.
 * Symbolic links are not followed to their targets.
 * This function does nothing if the entry located by this path does not exist.
 *
 * If the underlying platform supports [SecureDirectoryStream],
 * traversal of the file tree and removal of entries are performed using it.
 * Otherwise, directories in the file tree are opened with the less secure [Files.newDirectoryStream].
 * Note that on a platform that supports symbolic links and does not support [SecureDirectoryStream],
 * it is possible for a recursive delete to delete files and directories that are outside the directory being deleted.
 * This can happen if, after checking that an entry is a directory (and not a symbolic link), that directory is replaced
 * by a symbolic link to an outside directory before the call that opens the directory to read its entries.
 *
 * If an exception occurs attempting to read, open or delete any entry under the given file tree,
 * this method skips that entry and continues. Such exceptions are collected and, after attempting to delete all entries,
 * an [IOException] is thrown containing those exceptions as suppressed exceptions.
 * Maximum of `64` exceptions are collected. After reaching that amount, thrown exceptions are ignored and not collected.
 *
 * @throws IOException if any entry in the file tree can't be deleted for any reason.
 */


{ <EOL> val fileName = this . name <EOL> if ( fileName == "<STR_LIT>" || fileName == "<STR_LIT>" || fileName == "<STR_LIT>" || fileName == "<STR_LIT:.>" || fileName == "<STR_LIT>" || fileName == "<STR_LIT>" ) throw IllegalFileNameException ( this ) <EOL> }

/**
 * Checks whether the name of this file is legal for traversal to prevent cycles.
 *
 * Some names are considered illegal as they may cause traversal cycles.
 * This function is intended for use with entries whose parent directories have already been traversed.
 * The file being checked is not the starting point of traversal.
 *
 * For instance, "/a/b/.." is a valid starting path for traversal. However, if traversal begins from "/a"
 * and reaches "a/b/..", it will result in a cycle.
 *
 * @throws IllegalFileNameException if the file name is "..", "../", , "..\", ".", "./", or ".\" since these may lead to traversal cycles.
 *
 * See KT-63103 for more details on the issue.
 */


private fun Path . checkNotSameAs ( parent : Path )

{ <EOL> if ( ! isSymbolicLink ( ) && isSameFileAs ( parent ) ) <EOL> throw FileSystemLoopException ( this . toString ( ) ) <EOL> }

/**
 * Checks that this entry is not the same as the specified [parent] path to prevent traversal cycles.
 *
 * When reading entries of a directory, there are cases where the directory itself is returned,
 * such as when a zip entry name is '/'. Including the directory itself in the list of its entries can lead to traversal cycles.
 *
 * Unfortunately, [Files.walkFileTree], utilized in [copyToRecursively], may not detect such cycles when links are not followed.
 * Similarly, [deleteRecursively] lacks cycle detection capabilities as it never follows links.
 *
 * This function is intended for use with entries whose parent directories have already been traversed.
 * The file being checked is not the starting point of traversal.
 *
 * For instance, "/a/b/.." is a valid starting path for traversal. However, if traversal begins from "/a"
 * and reaches "a/b/..", it will result in a cycle.
 *
 * @throws FileSystemLoopException if this entry is the same as the [parent] path, indicating a potential traversal cycle.
 *
 * See KT-63103 for more details on the issue.
 */


private fun IrBlockBuilder . createSimpleBucketSelectors ( stringConstantToMatchedCase : Map < String ? , MatchedCase > , buckets : Map < Int , List < String ? > > , transformedWhen : IrWhen , ) : List < BucketSelector >

= buckets . entries . map { bucket -> <EOL> val selector = if ( bucket . value . size == <NUM_LIT:1> ) { <EOL> val bucketCase = bucket . value [ <NUM_LIT:0> ] <EOL> val matchedCase = stringConstantToMatchedCase . getValue ( bucketCase ) <EOL> irIfThen ( type = transformedWhen . type , condition = matchedCase . condition , thenPart = transformedWhen . branches [ matchedCase . branchIndex ] . result , ) <EOL> } else { <EOL> val bucketBranches = mutableListOf < IrBranch > ( ) <EOL> bucket . value . mapTo ( bucketBranches ) { bucketCase -> <EOL> val matchedCase = stringConstantToMatchedCase . getValue ( bucketCase ) <EOL> irBranch ( matchedCase . condition , transformedWhen . branches [ matchedCase . branchIndex ] . result ) <EOL> } <EOL> irWhen ( transformedWhen . type , bucketBranches ) <EOL> } <EOL> BucketSelector ( bucket . key , selector ) <EOL> }


private fun IrBlockBuilder . createBucketSelectors ( stringConstantToMatchedCase : Map < String ? , MatchedCase > , buckets : Map < Int , List < String ? > > , elseBranchIndex : Int , ) : List < BucketSelector >

= buckets . entries . map { bucket -> <EOL> val selector = if ( bucket . value . size == <NUM_LIT:1> ) { <EOL> val bucketCase = bucket . value [ <NUM_LIT:0> ] <EOL> val matchedCase = stringConstantToMatchedCase . getValue ( bucketCase ) <EOL> irIfThenElse ( type = intType , condition = matchedCase . condition , thenPart = matchedCase . branchIndex . toIrConst ( intType ) , elsePart = elseBranchIndex . toIrConst ( intType ) ) <EOL> } else { <EOL> val bucketBranches = mutableListOf < IrBranch > ( ) <EOL> bucket . value . mapTo ( bucketBranches ) { bucketCase -> <EOL> val matchedCase = stringConstantToMatchedCase . getValue ( bucketCase ) <EOL> irBranch ( matchedCase . condition , matchedCase . branchIndex . toIrConst ( intType ) ) <EOL> } <EOL> bucketBranches . add ( irElseBranch ( elseBranchIndex . toIrConst ( intType ) ) ) <EOL> irWhen ( intType , bucketBranches ) <EOL> } <EOL> BucketSelector ( bucket . key , selector ) <EOL> }


fun valueDescription ( value : TResult ? )

= value ? . let { <EOL> if ( it is List < * > && it . isNotEmpty ( ) ) <EOL> "<STR_LIT>" <EOL> else if ( it !is List < * > ) <EOL> "<STR_LIT>" <EOL> else null <EOL> }

/**
 * Provide text description of value.
 *
 * @param value value got getting text description for.
 */


public fun CV < * > . createPreprocessing ( model : InferenceModel < * > ) : Operation < BufferedImage , FloatData >

{ <EOL> return createPreprocessing ( model , channelsFirst , inputColorMode , preprocessor ) <EOL> }

/**
 * Creates a preprocessing [Operation] which converts given [BufferedImage] to [FloatData] suitable for this [model].
 */


public fun CVnoTop < * > . createPreprocessing ( model : InferenceModel < * > ) : Operation < BufferedImage , FloatData >

{ <EOL> return createPreprocessing ( model , baseModelType . channelsFirst , baseModelType . inputColorMode , preprocessor ) <EOL> }


private fun TaskProvider < CheckKotlinGradlePluginConfigurationErrors > . addDependsOnFromTasksThatShouldFailWhenErrorsReported ( tasks : TaskContainer )

{ <EOL> tasks . withType < KotlinCompileTool > ( ) . configureEach { it . dependsOn ( this ) } <EOL> }

/**
 * Adds dependsOn from some selection of the [tasks] to the [this]-task, effectively causing them to fail
 * if the ERROR-diagnostics were reported.
 *
 * Currently, we're doing it conservatively and instrumenting only [KotlinCompileTool]-tasks.
 * The intuition here is that if the build manages to do something useful for a user without compiling any .kt-sources,
 * then it's OK for KGP to let that build pass even if it reported ERROR-diagnostics.
 */


fun fromString ( tripleString : String ) : TargetTriple

{ <EOL> val components = tripleString . split ( '<CHAR_LIT:->' ) <EOL> require ( components . size == <NUM_LIT:3> || components . size == <NUM_LIT:4> ) { <EOL> "<STR_LIT>" <EOL> } <EOL> return TargetTriple ( architecture = components [ <NUM_LIT:0> ] , vendor = components [ <NUM_LIT:1> ] , os = components [ <NUM_LIT:2> ] , environment = components . getOrNull ( <NUM_LIT:3> ) ) <EOL> }

/**
 * Parse <arch>-<vendor>-<os>-<environment?> [tripleString].
 *
 * TODO: Support normalization like LLVM's Triple::normalize.
 */


fun TargetTriple . withOSVersion ( osVersion : String ) : TargetTriple

= <EOL> copy ( os = "<STR_LIT>" )

/**
 * Appends version to OS part of triple.
 *
 * Useful for precise target specification in Clang and Swift.
 */


fun TargetTriple . withoutVendor ( ) : String

{ <EOL> val envSuffix = environment ? . let { "<STR_LIT>" } <EOL> ? : "<STR_LIT>" <EOL> return "<STR_LIT>" <EOL> }

/**
 * Triple without vendor (second) component.
 *
 * TODO: Actually, this method should return [TargetTriple],
 * but this class is not that flexible yet.
 */


{ <EOL> val modelHub = TFModelHub ( cacheDirectory = File ( "<STR_LIT>" ) ) <EOL> val modelType = TFModels . CV . VGG19 ( ) <EOL> val model = modelHub . loadModel ( modelType ) <EOL> val imageNetClassLabels = modelHub . loadClassLabels ( ) <EOL> model . use { <EOL> it . compile ( optimizer = Adam ( ) , loss = Losses . MAE , metric = Metrics . ACCURACY ) <EOL> it . logSummary ( ) <EOL> val hdfFile = modelHub . loadWeights ( modelType ) <EOL> it . loadWeights ( hdfFile ) <EOL> val fileDataLoader = modelType . createPreprocessing ( it ) . fileLoader ( ) <EOL> for ( i in <NUM_LIT:1> .. <NUM_LIT:8> ) { <EOL> val inputData = fileDataLoader . load ( getFileFromResource ( "<STR_LIT>" ) ) <EOL> val res = it . predictLabel ( inputData ) <EOL> println ( "<STR_LIT>" ) <EOL> val top5 = it . predictTop5Labels ( inputData , imageNetClassLabels ) <EOL> println ( top5 . toString ( ) ) <EOL> } <EOL> } <EOL> }

/**
 * This example demonstrates the inference concept on VGG'19 model:
 * - Model configuration, model weights and labels are obtained from [TFModelHub].
 * - Weights are loaded from .h5 file, configuration is loaded from .json file.
 * - Model predicts on a few images located in resources.
 * - Special preprocessing (used in 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.
 */


= vgg19prediction ( )


{ <EOL> val str = "<STR_LIT>" <EOL> val regex = Regex ( "<STR_LIT>" ) <EOL> assertFalse ( regex . containsMatchIn ( str ) ) <EOL> }


@ Test fun testGeneralPunctuationCategory ( )

{ <EOL> val s = arrayOf ( "<STR_LIT:U+002C>" , "<STR_LIT:!>" , "<STR_LIT>" , "<STR_LIT:#>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:(>" , "<STR_LIT:)>" , "<STR_LIT:->" , "<STR_LIT:.>" , "<STR_LIT:/>" ) <EOL> val regexp = "<STR_LIT>" <EOL> for ( i in s . indices ) { <EOL> val regex = Regex ( regexp ) <EOL> assertTrue ( regex . containsMatchIn ( s [ i ] ) ) <EOL> } <EOL> }

/**
 * Regression test for HARMONY-3360
 */


{ <EOL> fun testMatches ( pattern : String , input : String ) { <EOL> assertTrue ( Regex ( pattern ) . matches ( input ) , "<STR_LIT>" ) <EOL> } <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT>" ) <EOL> testMatches ( "<STR_LIT>" , input = "<STR_LIT:b>" ) <EOL> }

/**
 * Regression test for https://github.com/JetBrains/kotlin-native/issues/2297
 */


public fun < T > Flow < T > . shareIn ( scope : CoroutineScope , started : SharingStarted , replay : Int = <NUM_LIT:0> ) : SharedFlow < T >

{ <EOL> val config = configureSharing ( replay ) <EOL> val shared = MutableSharedFlow < T > ( replay = replay , extraBufferCapacity = config . extraBufferCapacity , onBufferOverflow = config . onBufferOverflow ) <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> val job = scope . launchSharing ( config . context , config . upstream , shared , started , NO_VALUE as T ) <EOL> return ReadonlySharedFlow ( shared , job ) <EOL> }

/**
 * Converts a _cold_ [Flow] into a _hot_ [SharedFlow] that is started in the given coroutine [scope],
 * sharing emissions from a single running instance of the upstream flow with multiple downstream subscribers,
 * and replaying a specified number of [replay] values to new subscribers. See the [SharedFlow] documentation
 * for the general concepts of shared flows.
 *
 * The starting of the sharing coroutine is controlled by the [started] parameter. The following options
 * are supported.
 *
 * - [Eagerly][SharingStarted.Eagerly] — the upstream flow is started even before the first subscriber appears. Note
 * that in this case all values emitted by the upstream beyond the most recent values as specified by
 * [replay] parameter **will be immediately discarded**.
 * - [Lazily][SharingStarted.Lazily] — starts the upstream flow after the first subscriber appears, which guarantees
 * that this first subscriber gets all the emitted values, while subsequent subscribers are only guaranteed to
 * get the most recent [replay] values. The upstream flow continues to be active even when all subscribers
 * disappear, but only the most recent [replay] values are cached without subscribers.
 * - [WhileSubscribed()][SharingStarted.WhileSubscribed] — starts the upstream flow when the first subscriber
 * appears, immediately stops when the last subscriber disappears, keeping the replay cache forever.
 * It has additional optional configuration parameters as explained in its documentation.
 * - A custom strategy can be supplied by implementing the [SharingStarted] interface.
 *
 * The `shareIn` operator is useful in situations when there is a _cold_ flow that is expensive to create and/or
 * to maintain, but there are multiple subscribers that need to collect its values. For example, consider a
 * flow of messages coming from a backend over the expensive network connection, taking a lot of
 * time to establish. Conceptually, it might be implemented like this:
 *
 * ```
 * val backendMessages: Flow<Message> = flow {
 * connectToBackend() // takes a lot of time
 * try {
 * while (true) {
 * emit(receiveMessageFromBackend())
 * }
 * } finally {
 * disconnectFromBackend()
 * }
 * }
 * ```
 *
 * If this flow is directly used in the application, then every time it is collected a fresh connection is
 * established, and it will take a while before messages start flowing. However, we can share a single connection
 * and establish it eagerly like this:
 *
 * ```
 * val messages: SharedFlow<Message> = backendMessages.shareIn(scope, SharingStarted.Eagerly)
 * ```
 *
 * Now a single connection is shared between all collectors from `messages`, and there is a chance that the connection
 * is already established by the time it is needed.
 *
 * ### Upstream completion and error handling
 *
 * **Normal completion of the upstream flow has no effect on subscribers**, and the sharing coroutine continues to run. If a
 * strategy like [SharingStarted.WhileSubscribed] is used, then the upstream can get restarted again. If a special
 * action on upstream completion is needed, then an [onCompletion] operator can be used before the
 * `shareIn` operator to emit a special value in this case, like this:
 *
 * ```
 * backendMessages
 * .onCompletion { cause -> if (cause == null) emit(UpstreamHasCompletedMessage) }
 * .shareIn(scope, SharingStarted.Eagerly)
 * ```
 *
 * Any exception in the upstream flow terminates the sharing coroutine without affecting any of the subscribers,
 * and will be handled by the [scope] in which the sharing coroutine is launched. Custom exception handling
 * can be configured by using the [catch] or [retry] operators before the `shareIn` operator.
 * For example, to retry connection on any `IOException` with 1 second delay between attempts, use:
 *
 * ```
 * val messages = backendMessages
 * .retry { e ->
 * val shallRetry = e is IOException // other exception are bugs - handle them
 * if (shallRetry) delay(1000)
 * shallRetry
 * }
 * .shareIn(scope, SharingStarted.Eagerly)
 * ```
 *
 * ### Initial value
 *
 * When a special initial value is needed to signal to subscribers that the upstream is still loading the data,
 * use the [onStart] operator on the upstream flow. For example:
 *
 * ```
 * backendMessages
 * .onStart { emit(UpstreamIsStartingMessage) }
 * .shareIn(scope, SharingStarted.Eagerly, 1) // replay one most recent message
 * ```
 *
 * ### Buffering and conflation
 *
 * The `shareIn` operator runs the upstream flow in a separate coroutine, and buffers emissions from upstream as explained
 * in the [buffer] operator's description, using a buffer of [replay] size or the default (whichever is larger).
 * This default buffering can be overridden with an explicit buffer configuration by preceding the `shareIn` call
 * with [buffer] or [conflate], for example:
 *
 * - `buffer(0).shareIn(scope, started, 0)` — overrides the default buffer size and creates a [SharedFlow] without a buffer.
 * Effectively, it configures sequential processing between the upstream emitter and subscribers,
 * as the emitter is suspended until all subscribers process the value. Note, that the value is still immediately
 * discarded when there are no subscribers.
 * - `buffer(b).shareIn(scope, started, r)` — creates a [SharedFlow] with `replay = r` and `extraBufferCapacity = b`.
 * - `conflate().shareIn(scope, started, r)` — creates a [SharedFlow] with `replay = r`, `onBufferOverflow = DROP_OLDEST`,
 * and `extraBufferCapacity = 1` when `replay == 0` to support this strategy.
 *
 * ### Operator fusion
 *
 * Application of [flowOn][Flow.flowOn], [buffer] with [RENDEZVOUS][Channel.RENDEZVOUS] capacity,
 * or [cancellable] operators to the resulting shared flow has no effect.
 *
 * ### Exceptions
 *
 * This function throws [IllegalArgumentException] on unsupported values of parameters or combinations thereof.
 *
 * @param scope the coroutine scope in which sharing is started.
 * @param started the strategy that controls when sharing is started and stopped.
 * @param replay the number of values replayed to new subscribers (cannot be negative, defaults to zero).
 */


public fun < T > Flow < T > . stateIn ( scope : CoroutineScope , started : SharingStarted , initialValue : T ) : StateFlow < T >

{ <EOL> val config = configureSharing ( <NUM_LIT:1> ) <EOL> val state = MutableStateFlow ( initialValue ) <EOL> val job = scope . launchSharing ( config . context , config . upstream , state , started , initialValue ) <EOL> return ReadonlyStateFlow ( state , job ) <EOL> }

/**
 * Converts a _cold_ [Flow] into a _hot_ [StateFlow] that is started in the given coroutine [scope],
 * sharing the most recently emitted value from a single running instance of the upstream flow with multiple
 * downstream subscribers. See the [StateFlow] documentation for the general concepts of state flows.
 *
 * The starting of the sharing coroutine is controlled by the [started] parameter, as explained in the
 * documentation for [shareIn] operator.
 *
 * The `stateIn` operator is useful in situations when there is a _cold_ flow that provides updates to the
 * value of some state and is expensive to create and/or to maintain, but there are multiple subscribers
 * that need to collect the most recent state value. For example, consider a
 * flow of state updates coming from a backend over the expensive network connection, taking a lot of
 * time to establish. Conceptually it might be implemented like this:
 *
 * ```
 * val backendState: Flow<State> = flow {
 * connectToBackend() // takes a lot of time
 * try {
 * while (true) {
 * emit(receiveStateUpdateFromBackend())
 * }
 * } finally {
 * disconnectFromBackend()
 * }
 * }
 * ```
 *
 * If this flow is directly used in the application, then every time it is collected a fresh connection is
 * established, and it will take a while before state updates start flowing. However, we can share a single connection
 * and establish it eagerly like this:
 *
 * ```
 * val state: StateFlow<State> = backendMessages.stateIn(scope, SharingStarted.Eagerly, State.LOADING)
 * ```
 *
 * Now, a single connection is shared between all collectors from `state`, and there is a chance that the connection
 * is already established by the time it is needed.
 *
 * ### Upstream completion and error handling
 *
 * **Normal completion of the upstream flow has no effect on subscribers**, and the sharing coroutine continues to run. If a
 * a strategy like [SharingStarted.WhileSubscribed] is used, then the upstream can get restarted again. If a special
 * action on upstream completion is needed, then an [onCompletion] operator can be used before
 * the `stateIn` operator to emit a special value in this case. See the [shareIn] operator's documentation for an example.
 *
 * Any exception in the upstream flow terminates the sharing coroutine without affecting any of the subscribers,
 * and will be handled by the [scope] in which the sharing coroutine is launched. Custom exception handling
 * can be configured by using the [catch] or [retry] operators before the `stateIn` operator, similarly to
 * the [shareIn] operator.
 *
 * ### Operator fusion
 *
 * Application of [flowOn][Flow.flowOn], [conflate][Flow.conflate],
 * [buffer] with [CONFLATED][Channel.CONFLATED] or [RENDEZVOUS][Channel.RENDEZVOUS] capacity,
 * [distinctUntilChanged][Flow.distinctUntilChanged], or [cancellable] operators to a state flow has no effect.
 *
 * @param scope the coroutine scope in which sharing is started.
 * @param started the strategy that controls when sharing is started and stopped.
 * @param initialValue the initial value of the state flow.
 * This value is also used when the state flow is reset using the [SharingStarted.WhileSubscribed] strategy
 * with the `replayExpirationMillis` parameter.
 */


public suspend fun < T > Flow < T > . stateIn ( scope : CoroutineScope ) : StateFlow < T >

{ <EOL> val config = configureSharing ( <NUM_LIT:1> ) <EOL> val result = CompletableDeferred < StateFlow < T > > ( ) <EOL> scope . launchSharingDeferred ( config . context , config . upstream , result ) <EOL> return result . await ( ) <EOL> }

/**
 * Starts the upstream flow in a given [scope], suspends until the first value is emitted, and returns a _hot_
 * [StateFlow] of future emissions, sharing the most recently emitted value from this running instance of the upstream flow
 * with multiple downstream subscribers. See the [StateFlow] documentation for the general concepts of state flows.
 *
 * @param scope the coroutine scope in which sharing is started.
 */


public fun < T > MutableSharedFlow < T > . asSharedFlow ( ) : SharedFlow < T >

= <EOL> ReadonlySharedFlow ( this , null )

/**
 * Represents this mutable shared flow as a read-only shared flow.
 */


public fun < T > MutableStateFlow < T > . asStateFlow ( ) : StateFlow < T >

= <EOL> ReadonlyStateFlow ( this , null )

/**
 * Represents this mutable state flow as a read-only state flow.
 */


public fun < T > SharedFlow < T > . onSubscription ( action : suspend FlowCollector < T > . ( ) -> Unit ) : SharedFlow < T >

= <EOL> SubscribedSharedFlow ( this , action )

/**
 * Returns a flow that invokes the given [action] **after** this shared flow starts to be collected
 * (after the subscription is registered).
 *
 * The [action] is called before any value is emitted from the upstream
 * flow to this subscription but after the subscription is established. It is guaranteed that all emissions to
 * the upstream flow that happen inside or immediately after this `onSubscription` action will be
 * collected by this subscription.
 *
 * The receiver of the [action] is [FlowCollector], so `onSubscription` can emit additional elements.
 */


internal fun Map < SourceFile , MutableList < CallableMemberDescriptor > > . makeFilesOrderStable ( )

= <EOL> this . entries . sortedBy { it . key . name }

/**
 * Sort order of files. Order of declarations will be stabilized in the corresponding functions later.
 */


internal fun Map < ClassDescriptor , MutableList < CallableMemberDescriptor > > . makeCategoriesOrderStable ( )

= <EOL> this . entries . sortedBy { it . key . classId . toString ( ) }

/**
 * Sort order of categories. Order of extensions will be stabilized in the corresponding functions later.
 */


internal fun IdeJvmAndAndroidPlatformBinaryDependencyResolver ( project : Project ) : IdeDependencyResolver

= <EOL> IdeBinaryDependencyResolver ( binaryType = IdeaKotlinBinaryDependency . KOTLIN_COMPILE_BINARY_TYPE , artifactResolutionStrategy = IdeBinaryDependencyResolver . ArtifactResolutionStrategy . PlatformLikeSourceSet ( setupPlatformResolutionAttributes = { <EOL> attributes . setAttribute ( Usage . USAGE_ATTRIBUTE , project . usageByName ( Usage . JAVA_API ) ) <EOL> attributes . setAttribute ( Category . CATEGORY_ATTRIBUTE , project . objects . named ( Category . LIBRARY ) ) <EOL> attributes . setAttribute ( KotlinPlatformType . attribute , KotlinPlatformType . jvm ) <EOL> attributes . setAttribute ( TargetJvmEnvironment . TARGET_JVM_ENVIRONMENT_ATTRIBUTE , project . objects . named ( TargetJvmEnvironment . STANDARD_JVM ) ) <EOL> } , componentFilter = { identifier -> identifier !is ProjectComponentIdentifier } , dependencySubstitution = :: substituteStdlibCommonWithAndroidJvm , ) )

/**
 * Resolves dependencies of jvm and Android source sets from the perspective jvm
 */


internal fun substituteStdlibCommonWithAndroidJvm ( dependencySubstitutions : DependencySubstitutions )

{ <EOL> dependencySubstitutions . all { dependency -> <EOL> val requested = dependency . requested <EOL> if ( requested is ModuleComponentSelector && requested . group == KOTLIN_MODULE_GROUP && requested . module == KOTLIN_STDLIB_COMMON_MODULE_NAME ) dependency . useTarget ( "<STR_LIT>" ) <EOL> } <EOL> }

/**
 * This is a replacement for propagation of stdlib-jvm in non-KGP-based IDE import for JVM+Android source sets.
 * It's possible to resolve regular dependencies of the source set with platform attributes to get the correct JVM variants.
 * But stdlib is a special case, kotlin-stdlib-common is not a common variant for the JVM stdlib w.r.t. publication.
 * Substituting kotlin-stdlib-common with the Android-JVM stdlib in requests workarounds the issue.
 */


private fun AbstractKotlinCompile < * > . createAndroidSourceSet ( androidTarget : KotlinAndroidTarget ) : SourceSet

{ <EOL> val variantName = sourceSetName . get ( ) <EOL> val compilation = androidTarget . compilations . getByName ( variantName ) <EOL> val sources = compilation . allKotlinSourceSets . flatMap { <EOL> it . kotlin . srcDirs <EOL> } . distinctBy { it . absolutePath } <EOL> val resources = compilation . allKotlinSourceSets . flatMap { <EOL> it . resources . srcDirs <EOL> } . distinctBy { it . absolutePath } <EOL> return SourceSetImpl ( sourceSetName . get ( ) , if ( sourceSetName . get ( ) . contains ( "<STR_LIT:test>" , true ) ) SourceSet . SourceSetType . TEST else SourceSet . SourceSetType . PRODUCTION , friendSourceSets . get ( ) , sources , resources , destinationDirectory . get ( ) . asFile , compilation . output . resourcesDir , buildCompilerArguments ( ) ) <EOL> }

/**
 * Constructs the Android [SourceSet] that should be returned to the IDE for each compile task/variant.
 */


private fun tryDownload ( url : URL , tmpFile : File )

{ <EOL> val connection = url . openConnection ( ) <EOL> ( connection as? HttpURLConnection ) ? . checkHTTPResponse ( HttpURLConnection . HTTP_OK , url ) <EOL> if ( connection is HttpURLConnection && tmpFile . exists ( ) ) { <EOL> resumeDownload ( url , connection , tmpFile ) <EOL> } else { <EOL> connection . connect ( ) <EOL> val totalBytes = connection . contentLengthLong <EOL> doDownload ( url , connection , tmpFile , <NUM_LIT:0> , totalBytes , false ) <EOL> } <EOL> }

/** Performs an attempt to download a specified file into the specified location */


fun download ( source : URL , destination : File , replace : ReplacingMode = ReplacingMode . RETURN_EXISTING ) : File

{ <EOL> if ( destination . exists ( ) ) { <EOL> when ( replace ) { <EOL> ReplacingMode . RETURN_EXISTING -> return destination <EOL> ReplacingMode . THROW -> throw FileAlreadyExistsException ( destination ) <EOL> ReplacingMode . REPLACE -> Unit <EOL> } <EOL> } <EOL> val tmpFile = File ( "<STR_LIT>" ) <EOL> check ( ! tmpFile . isDirectory ) { <EOL> "<STR_LIT>" <EOL> } <EOL> check ( ! destination . isDirectory ) { <EOL> "<STR_LIT>" <EOL> } <EOL> var attempt = <NUM_LIT:1> <EOL> var waitTime = <NUM_LIT:0L> <EOL> val handleException = { e : Exception -> <EOL> if ( attempt >= maxAttempts ) { <EOL> throw e <EOL> } <EOL> attempt ++ <EOL> waitTime += attemptIntervalMs <EOL> println ( "<STR_LIT>" + "<STR_LIT>" ) <EOL> Thread . sleep ( waitTime ) <EOL> } <EOL> while ( true ) { <EOL> try { <EOL> tryDownload ( source , tmpFile ) <EOL> break <EOL> } catch ( e : HTTPResponseException ) { <EOL> if ( e . responseCode >= <NUM_LIT> ) { <EOL> handleException ( e ) <EOL> } else { <EOL> throw e <EOL> } <EOL> } catch ( e : IOException ) { <EOL> handleException ( e ) <EOL> } <EOL> } <EOL> Files . move ( tmpFile . toPath ( ) , destination . toPath ( ) , StandardCopyOption . REPLACE_EXISTING ) <EOL> println ( "<STR_LIT>" ) <EOL> return destination <EOL> }

/** Downloads a file from [source] url to [destination]. Returns [destination]. */


public fun < S : KtCallableSymbol > S . substitute ( substitutor : KtSubstitutor ) : KtCallableSignature < S >

= <EOL> withValidityAssertion { analysisSession . signatureSubstitutor . substitute ( this , substitutor ) }

/**
 * Applies a [substitutor] to the given symbol and return a signature with substituted types.
 *
 * @see KtSubstitutor.substitute
 */


public fun < S : KtFunctionLikeSymbol > S . substitute ( substitutor : KtSubstitutor ) : KtFunctionLikeSignature < S >


public fun < S : KtVariableLikeSymbol > S . substitute ( substitutor : KtSubstitutor ) : KtVariableLikeSignature < S >

/**
 * Applies a [substitutor] to the given symbols and return a signature with substituted types.
 *
 * @see KtSubstitutor.substitute
 */


public fun < S : KtCallableSymbol > S . asSignature ( ) : KtCallableSignature < S >

= <EOL> withValidityAssertion { analysisSession . signatureSubstitutor . asSignature ( this ) }

/**
 * Creates a new [KtCallableSignature] by given symbol and leave all types intact
 */


public fun < S : KtFunctionLikeSymbol > S . asSignature ( ) : KtFunctionLikeSignature < S >


public fun < S : KtVariableLikeSymbol > S . asSignature ( ) : KtVariableLikeSignature < S >


override fun visitElement ( element : FirElement , data : T )

{ <EOL> if ( element is FirElementWithResolveState ) return <EOL> element . acceptChildren ( this , data ) <EOL> }

/**
 * Skip all [FirElementWithResolveState] without explicit override
 */


override fun visitArgumentList ( argumentList : FirArgumentList , data : T )

/**
 * Skip argument list as the compiler do not support annotations inside annotation arguments
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun require ( value : Boolean ) : Unit

{ <EOL> contract { <EOL> returns ( ) implies value <EOL> } <EOL> require ( value ) { "<STR_LIT>" } <EOL> }

/**
 * Throws an [IllegalArgumentException] if the [value] is false.
 *
 * @sample samples.misc.Preconditions.failRequireWithLazyMessage
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun require ( value : Boolean , lazyMessage : ( ) -> Any ) : Unit

{ <EOL> contract { <EOL> returns ( ) implies value <EOL> } <EOL> if ( ! value ) { <EOL> val message = lazyMessage ( ) <EOL> throw IllegalArgumentException ( message . toString ( ) ) <EOL> } <EOL> }

/**
 * Throws an [IllegalArgumentException] with the result of calling [lazyMessage] if the [value] is false.
 *
 * @sample samples.misc.Preconditions.failRequireWithLazyMessage
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun < T : Any > requireNotNull ( value : T ? ) : T

{ <EOL> contract { <EOL> returns ( ) implies ( value != null ) <EOL> } <EOL> return requireNotNull ( value ) { "<STR_LIT>" } <EOL> }

/**
 * Throws an [IllegalArgumentException] if the [value] is null. Otherwise returns the not null value.
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun < T : Any > requireNotNull ( value : T ? , lazyMessage : ( ) -> Any ) : T

{ <EOL> contract { <EOL> returns ( ) implies ( value != null ) <EOL> } <EOL> if ( value == null ) { <EOL> val message = lazyMessage ( ) <EOL> throw IllegalArgumentException ( message . toString ( ) ) <EOL> } else { <EOL> return value <EOL> } <EOL> }

/**
 * Throws an [IllegalArgumentException] with the result of calling [lazyMessage] if the [value] is null. Otherwise
 * returns the not null value.
 *
 * @sample samples.misc.Preconditions.failRequireNotNullWithLazyMessage
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun check ( value : Boolean ) : Unit

{ <EOL> contract { <EOL> returns ( ) implies value <EOL> } <EOL> check ( value ) { "<STR_LIT>" } <EOL> }

/**
 * Throws an [IllegalStateException] if the [value] is false.
 *
 * @sample samples.misc.Preconditions.failCheckWithLazyMessage
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun check ( value : Boolean , lazyMessage : ( ) -> Any ) : Unit

{ <EOL> contract { <EOL> returns ( ) implies value <EOL> } <EOL> if ( ! value ) { <EOL> val message = lazyMessage ( ) <EOL> throw IllegalStateException ( message . toString ( ) ) <EOL> } <EOL> }

/**
 * Throws an [IllegalStateException] with the result of calling [lazyMessage] if the [value] is false.
 *
 * @sample samples.misc.Preconditions.failCheckWithLazyMessage
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun < T : Any > checkNotNull ( value : T ? ) : T

{ <EOL> contract { <EOL> returns ( ) implies ( value != null ) <EOL> } <EOL> return checkNotNull ( value ) { "<STR_LIT>" } <EOL> }

/**
 * Throws an [IllegalStateException] if the [value] is null. Otherwise
 * returns the not null value.
 *
 * @sample samples.misc.Preconditions.failCheckWithLazyMessage
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun < T : Any > checkNotNull ( value : T ? , lazyMessage : ( ) -> Any ) : T

{ <EOL> contract { <EOL> returns ( ) implies ( value != null ) <EOL> } <EOL> if ( value == null ) { <EOL> val message = lazyMessage ( ) <EOL> throw IllegalStateException ( message . toString ( ) ) <EOL> } else { <EOL> return value <EOL> } <EOL> }

/**
 * Throws an [IllegalStateException] with the result of calling [lazyMessage] if the [value] is null. Otherwise
 * returns the not null value.
 *
 * @sample samples.misc.Preconditions.failCheckWithLazyMessage
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun error ( message : Any ) : Nothing

= throw IllegalStateException ( message . toString ( ) )

/**
 * Throws an [IllegalStateException] with the given [message].
 *
 * @sample samples.misc.Preconditions.failWithError
 */


= ! isSuccessful ( ) && filterConstraintsOut ( TYPE_BOUND_POSITION ) . status . isSuccessful ( )

/**
 * All hacks were removed. This comment is left for information.
 *
 * Hacks above are needed for the following example:
 *
 * @kotlin.jvm.JvmName("containsAny")
 * @kotlin.internal.LowPriorityInOverloadResolution
 * public operator fun <T> Iterable<T>.contains(element: T): Boolean
 *
 * public operator fun <@kotlin.internal.OnlyInputTypes T> Iterable<T>.contains(element: T): Boolean
 *
 * fun test() = listOf(1).contains("")
 *
 * When we resolve call `contains`, we should choose candidate before we complete inference.
 * Because of this we can't check OnlyInputTypes when we trying choose candidate.
 * Now we do this check in this moment, but it is incorrect and we should remove it later.
 *
 * Call !satisfyInitialConstraints() in hasTypeInferenceIncorporationError() is needed for this example:
 * @kotlin.jvm.JvmName("containsAny")
 * @kotlin.internal.LowPriorityInOverloadResolution
 * public operator fun <T> Iterable<T>.contains(element: T): Boolean
 *
 * public operator fun <T> Iterable<T>.contains(element: @kotlin.internal.NoInfer T)
 *
 * fun test() = listOf(1).contains("")
 *
 * It is also incorrect, because we can get additional constraints on T after we resolve call `contains`.
 */


public actual fun todo ( block : ( ) -> Unit )

{ <EOL> println ( "<STR_LIT>" + block ) <EOL> }

/**
 * Takes the given [block] of test code and _doesn't_ execute it.
 *
 * This keeps the code under test referenced, but doesn't actually test it until it is implemented.
 */


@ Suppress ( "<STR_LIT:NOTHING_TO_INLINE>" ) <EOL> internal actual inline fun AssertionErrorWithCause ( message : String ? , cause : Throwable ? ) : AssertionError

= <EOL> AssertionError ( message , cause )

/** Platform-specific construction of AssertionError with cause */


internal actual fun lookupAsserter ( ) : Asserter

= DefaultWasmAsserter

/**
 * Provides the JS implementation of asserter
 */


public inline fun LayerCollectorContext . bars ( block : BarsContext . ( ) -> Unit )

{ <EOL> addLayer ( BarsContext ( this ) . apply { <EOL> position = Position . dodge ( ) <EOL> } . apply ( block ) ) <EOL> }

/**
 * Adds a new `bars` layer to the plot.
 *
 * The `bars` layer is used to create bar charts, which are useful for comparing quantities among discrete categories.
 *
 * This function creates a context where you can set aesthetic mappings (`aes`) or aesthetic constants.
 * - Mappings are specified by calling methods that correspond to aesthetic names (`aes`).
 * - Constants are directly assigned using properties with the names corresponding to aesthetics.
 * For positional aesthetics, you can use the `.constant()` method.
 *
 * ## Bars Aesthetics
 * * **`x`** - The X-coordinate specifying the categories.
 * * **`y`** - The Y-coordinate specifying the height of the bars.
 * * **`fillColor`** - The fill color of the bars.
 * * **`alpha`** - The transparency of the bars.
 * * **`width`** - The width of the bars.
 * * **`borderLine.color`** - Color of the bars' borderline.
 * * **`borderLine.width`** - Width of the bars' borderline.
 * * **`borderLine.type`** - Type of the bars' borderline, such as dashed or dotted.
 *
 * ## Example Usage
 *
 * ```kotlin
 * plot {
 * bars {
 * // Positional mapping
 * x(listOf("Apple", "Banana", "Cherry", "Orange", "Strawberry"))
 * y(listOf(5.0, 7.5, 3.0, 4.5, 6.0)) {
 * axis.breaks((0..16).map { it / 2.0 })
 * }
 *
 * // Non-positional settings
 * alpha = 0.7
 * width = 0.4
 *
 * // BorderLine settings
 * borderLine {
 * color = Color.BLACK
 * width = 2.5
 * type = LineType.DASHED
 * }
 *
 * // Non-positional mapping
 * fillColor(listOf("a", "b", "b", "c", "a"))
 * }
 * }
 * ```
 */


public inline fun LayerCollectorContext . barsH ( block : BarsContext . ( ) -> Unit )

{ <EOL> addLayer ( BarsContext ( this ) . apply { <EOL> position = Position . dodge ( ) <EOL> reversed = true <EOL> } . apply ( block ) ) <EOL> }

/**
 * Adds a new `barsH` layer to the plot.
 *
 * The `barsH` layer is designed to visualize data using horizontal bars.
 * It serves a similar purpose as `bars`, but the orientation of the bars is horizontal rather than vertical.
 *
 * This function creates a context where you can set aesthetic mappings (`aes`) or aesthetic constants.
 * - Mappings are specified by calling methods that correspond to aesthetic names (`aes`).
 * - Constants are directly assigned using properties with the names corresponding to aesthetics.
 * For positional aesthetics, you can use the `.constant()` method.
 *
 * ## BarsH Aesthetics
 * * **`x`** - The X-coordinate specifying the length of the bars.
 * * **`y`** - The Y-coordinate specifying the categories.
 * * **`fillColor`** - The fill color of the bars.
 * * **`alpha`** - The transparency of the bars.
 * * **`width`** - The width of the bars.
 * * **`borderLine.color`** - Color of the bars' borderline.
 * * **`borderLine.width`** - Width of the bars' borderline.
 * * **`borderLine.type`** - Type of the bars' borderline, such as dashed or dotted.
 *
 * ## Example
 *
 * ```kotlin
 * plot {
 * barsH {
 * // Positional mapping
 * y(listOf("Apple", "Banana", "Cherry", "Orange", "Strawberry"))
 * x(listOf(5.0, 7.5, 3.0, 4.5, 6.0)) {
 * axis.breaks((0..16).map { it / 2.0 })
 * }
 *
 * // Non-positional settings
 * alpha = 0.7
 * width = 0.4
 *
 * // BorderLine settings
 * borderLine {
 * color = Color.BLACK
 * width = 2.5
 * type = LineType.DASHED
 * }
 *
 * // Non-positional mapping
 * fillColor(listOf("a", "b", "b", "c", "a"))
 * }
 * }
 * ```
 */


@ HtmlTagMarker <EOL> public inline fun FlowOrPhrasingContent . strike ( classes : String ? = null , crossinline block : STRIKE . ( ) -> Unit = { } ) : Unit

= STRIKE ( attributesMapOf ( "<STR_LIT:class>" , classes ) , consumer ) . visit ( block )

/**
 * Work-around until next version of kotlinx.html doesn't come out
 */


internal fun Collection < LookupSymbol > . toProgramSymbolSet ( allClasses : Iterable < AccessibleClassSnapshot > ) : ProgramSymbolSet

{ <EOL> val lookupSymbols = LookupSymbolSet ( this ) <EOL> val collector = ProgramSymbolSet . Collector ( ) <EOL> allClasses . forEach { clazz -> <EOL> when ( clazz ) { <EOL> is RegularKotlinClassSnapshot , is JavaClassSnapshot -> { <EOL> if ( ClassSymbol ( clazz . classId ) . toLookupSymbol ( ) in lookupSymbols ) { <EOL> collector . addClass ( clazz . classId ) <EOL> } <EOL> val lookupNamesInScope = lookupSymbols . getLookupNamesInScope ( clazz . classId . asSingleFqName ( ) ) <EOL> collector . addClassMembers ( clazz . classId , lookupNamesInScope ) <EOL> } <EOL> is PackageFacadeKotlinClassSnapshot , is MultifileClassKotlinClassSnapshot -> { <EOL> val lookupNamesInScope = lookupSymbols . getLookupNamesInScope ( clazz . classId . packageFqName ) <EOL> if ( lookupNamesInScope . isEmpty ( ) ) return@forEach <EOL> val packageMemberNames = when ( clazz ) { <EOL> is PackageFacadeKotlinClassSnapshot -> clazz . packageMemberNames <EOL> else -> ( clazz as MultifileClassKotlinClassSnapshot ) . constantNames <EOL> } <EOL> collector . addPackageMembers ( clazz . classId . packageFqName , packageMemberNames . intersect ( lookupNamesInScope ) ) <EOL> } <EOL> } <EOL> } <EOL> return collector . getResult ( ) <EOL> }

/**
 * Converts [LookupSymbol]s to [ProgramSymbol]s.
 *
 * Since [LookupSymbol]s are ambiguous, we need to use the given classes to disambiguate them.
 *
 * A [LookupSymbol] may be converted to more than one [ProgramSymbol]. For example, given this class:
 * class Foo {
 * class Bar
 * fun Bar(x: Int) {}
 * }
 * LookupSymbol(scope = "Foo", name = "Bar") will be converted to both ClassSymbol("Foo.Bar") and ClassMember("Foo", "Bar").
 *
 * If a [LookupSymbol] does not refer to any symbols in the given classes, it will be ignored.
 *
 * Note: It's okay to over-approximate the result.
 */


@ Suppress ( "<STR_LIT>" ) <EOL> public fun PreMergeDocumentableTransformer . sourceSet ( documentable : Documentable ) : DokkaSourceSet

{ <EOL> return documentable . sourceSets . single ( ) <EOL> }

/**
 * It is fair to assume that a given [Documentable] is not merged when seen by the [PreMergeDocumentableTransformer].
 * Therefore, it can also be assumed, that there is just a single source set connected to the given [documentable]
 * @return the single source set associated with this [documentable].
 */


public fun PreMergeDocumentableTransformer . perPackageOptions ( documentable : Documentable ) : PackageOptions ?

{ <EOL> val packageName = documentable . dri . packageName ? : return null <EOL> return sourceSet ( documentable ) . perPackageOptions <EOL> . sortedByDescending { packageOptions -> packageOptions . matchingRegex . length } <EOL> . firstOrNull { packageOptions -> Regex ( packageOptions . matchingRegex ) . matches ( packageName ) } <EOL> }

/**
 * @return The [PackageOptions] associated with this documentable, or null
 */


public fun < T > strongCachedValue ( vararg dependencies : ModificationTracker , compute : ( ) -> T , ) : StrongRefModificationTrackerBasedCache < T >

= StrongRefModificationTrackerBasedCache ( dependencies . toList ( ) , compute )

/**
 * Create modification tracker which will be invalidated when dependencies change.
 * The cached value is hold on the strong reference.
 * So, the value will not be garbage collected until modification tracker changes.
 */


protected abstract fun paddingArrayToTfFormat ( inputShape : Shape ) : Array < IntArray >

/**
 * This function helps in computing the padding operand i.e. normalizing the padding array
 * into a tensorflow format. This method will then be called in [build] method that will be
 * further passed to tf.pad().
 */


fun cartesianProductOf ( first : Iterable < Any ? > , second : Iterable < Any ? > , vararg rest : Iterable < Any ? > , ) : Sequence < List < Any ? > >

{ <EOL> var result : Sequence < Pair < Any ? , Any ? > > = first x second <EOL> for ( restItem in rest ) { result = result x restItem } <EOL> return result . flattenPairs <EOL> }

/**
 * Cartesian product of two and more collections.
 * Returns a sequence of all possible combinations between given elements.
 * Combination is represented as a list with indexes matching order of inputs
 * i.e.
 * ```
 * cartesianProductOf(listOf("a", "b"), listOf(1, 2), listOf(4.3, 6.3)).map { list ->
 * list[0] // will contain elements of the first argument e.g. "a"
 * list[1] // will contain elements of the second argument e.g. 2
 * list[2] // will contain elements of the second argument e.g. 4.3
 * // and so on
 * }
 * ```
 */


infix fun < A , B > Iterable < A > . x ( that : Iterable < B > ) : Sequence < Pair < A , B > >

= sequence { <EOL> for ( a in this @ x ) { <EOL> for ( b in that ) { <EOL> yield ( a to b ) <EOL> } <EOL> } <EOL> }

/**
 * Cartesian product of two collections.
 * Returns a sequence of all possible pairs between elements from [this] and [that]
 */


infix fun < A , B > Sequence < A > . x ( that : Iterable < B > ) : Sequence < Pair < A , B > >

/**
 * Cartesian product of a sequence and a collection.
 * Returns a sequence of all possible pairs between elements from [this] and [that]
 */


@ Composable <EOL> fun mirroringIcon ( ltrIcon : ImageVector , rtlIcon : ImageVector ) : ImageVector

= <EOL> if ( LocalLayoutDirection . current == LayoutDirection . Ltr ) ltrIcon else rtlIcon

/**
 * Returns the correct icon based on the current layout direction.
 */


@ Composable <EOL> fun mirroringBackIcon ( )

= mirroringIcon ( ltrIcon = Icons . Outlined . ArrowBack , rtlIcon = Icons . Outlined . ArrowForward )

/**
 * Returns the correct back navigation icon based on the current layout direction.
 */


private fun dumpDokkaConfigurationJson ( dokkaConfiguration : DokkaConfiguration , )

{ <EOL> val destFile = dokkaConfigurationJsonFile . asFile . orNull ? : return <EOL> destFile . parentFile . mkdirs ( ) <EOL> destFile . createNewFile ( ) <EOL> val compactJson = dokkaConfiguration . toPrettyJsonString ( ) <EOL> val json = jsonMapper . decodeFromString ( JsonElement . serializer ( ) , compactJson ) <EOL> val prettyJson = jsonMapper . encodeToString ( JsonElement . serializer ( ) , json ) <EOL> destFile . writeText ( prettyJson ) <EOL> logger . info ( "<STR_LIT>" ) <EOL> }

/**
 * Dump the [DokkaConfiguration] JSON to a file ([dokkaConfigurationJsonFile]) for debugging
 * purposes.
 */


fun GradleDokkaSourceSetBuilder . dependsOn ( sourceSet : KotlinSourceSet )

{ <EOL> dependsOn ( DokkaSourceSetID ( sourceSet . name ) ) <EOL> }

/**
 * Convenient override to **append** source sets to [GradleDokkaSourceSetBuilder.dependentSourceSets]
 */


fun GradleDokkaSourceSetBuilder . dependsOn ( @ Suppress ( "<STR_LIT:DEPRECATION>" ) sourceSet : com . android . build . gradle . api . AndroidSourceSet )


fun GradleDokkaSourceSetBuilder . dependsOn ( @ Suppress ( "<STR_LIT>" ) sourceSet : com . android . build . api . dsl . AndroidSourceSet )


fun GradleDokkaSourceSetBuilder . kotlinSourceSet ( kotlinSourceSet : KotlinSourceSet )

{ <EOL> configureWithKotlinSourceSet ( kotlinSourceSet ) <EOL> }

/**
 * Extension allowing configuration of Dokka source sets via Kotlin Gradle plugin source sets.
 */


private fun runInIdeSyncMode ( block : ( ) -> Unit )

= synchronized ( System . getProperties ( ) ) { <EOL> val isIdeaSyncActiveKey = "<STR_LIT>" <EOL> val previousValue = System . getProperty ( isIdeaSyncActiveKey ) <EOL> try { <EOL> System . setProperty ( isIdeaSyncActiveKey , "<STR_LIT:true>" ) <EOL> block ( ) <EOL> } finally { <EOL> if ( previousValue != null ) { <EOL> System . setProperty ( isIdeaSyncActiveKey , previousValue ) <EOL> } else { <EOL> System . clearProperty ( isIdeaSyncActiveKey ) <EOL> } <EOL> } <EOL> }

/**
 * Will swap out the System property 'idea.sync.active' to emulate IDE sync.
 * This method will enter the 'System properties monitor' to block any other thread from reading
 * System properties while this [block] is executing
 */


public fun KtCallableSymbol . isVisibleInClass ( classSymbol : KtClassOrObjectSymbol ) : Boolean

= <EOL> withValidityAssertion { analysisSession . overrideInfoProvider . isVisible ( this , classSymbol ) }

/** Checks if the given symbol (possibly a symbol inherited from a super class) is visible in the given class. */


public fun KtCallableSymbol . getImplementationStatus ( parentClassSymbol : KtClassOrObjectSymbol ) : ImplementationStatus ?

= <EOL> withValidityAssertion { analysisSession . overrideInfoProvider . getImplementationStatus ( this , parentClassSymbol ) }

/**
 * Gets the [ImplementationStatus] of the [this] member symbol in the given [parentClassSymbol]. Or null if this symbol is not a
 * member.
 */


operator fun < T , T1 : T > Product1 < T1 > . iterator ( ) : Iterator < T >

= JavaConverters . asJavaIterator < T > ( productIterator ( ) . map < T > { it as T } )

/** Allows this product to be iterated over. Returns an iterator of type [T]. */


operator fun < T , T1 : T , T2 : T > Product2 < T1 , T2 > . iterator ( ) : Iterator < T >


operator fun < T , T1 : T , T2 : T , T3 : T > Product3 < T1 , T2 , T3 > . iterator ( ) : Iterator < T >


operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T > Product4 < T1 , T2 , T3 , T4 > . iterator ( ) : Iterator < T >


operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T > Product5 < T1 , T2 , T3 , T4 , T5 > . iterator ( ) : Iterator < T >


operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T > Product6 < T1 , T2 , T3 , T4 , T5 , T6 > . iterator ( ) : Iterator < T >


operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T > Product7 < T1 , T2 , T3 , T4 , T5 , T6 , T7 > . iterator ( ) : Iterator < T >


operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T > Product8 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 > . iterator ( ) : Iterator < T >


operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T > Product9 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 > . iterator ( ) : Iterator < T >


operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T > Product10 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 > . iterator ( ) : Iterator < T >


fun < T , T1 : T > Product1 < T1 > . asIterable ( ) : Iterable < T >

= object : Iterable < T > { override fun iterator ( ) : Iterator < T > = JavaConverters . asJavaIterator < T > ( productIterator ( ) . map < T > { it as T } ) }

/** Returns this product as an iterable of type [T]. */


fun < T , T1 : T , T2 : T > Product2 < T1 , T2 > . asIterable ( ) : Iterable < T >


fun < T , T1 : T , T2 : T , T3 : T > Product3 < T1 , T2 , T3 > . asIterable ( ) : Iterable < T >


fun < T , T1 : T , T2 : T , T3 : T , T4 : T > Product4 < T1 , T2 , T3 , T4 > . asIterable ( ) : Iterable < T >


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T > Product5 < T1 , T2 , T3 , T4 , T5 > . asIterable ( ) : Iterable < T >


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T > Product6 < T1 , T2 , T3 , T4 , T5 , T6 > . asIterable ( ) : Iterable < T >


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T > Product7 < T1 , T2 , T3 , T4 , T5 , T6 , T7 > . asIterable ( ) : Iterable < T >


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T > Product8 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 > . asIterable ( ) : Iterable < T >


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T > Product9 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 > . asIterable ( ) : Iterable < T >


fun < T , T1 : T > Product1 < T1 > . toList ( ) : List < T >

= listOf ( this . _1 ( ) )

/** Returns list of type [T] for this product. */


fun < T , T1 : T , T2 : T > Product2 < T1 , T2 > . toList ( ) : List < T >

= listOf ( this . _1 ( ) , this . _2 ( ) )


fun < T , T1 : T , T2 : T , T3 : T > Product3 < T1 , T2 , T3 > . toList ( ) : List < T >

= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T > Product4 < T1 , T2 , T3 , T4 > . toList ( ) : List < T >

= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T > Product5 < T1 , T2 , T3 , T4 , T5 > . toList ( ) : List < T >

= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T > Product6 < T1 , T2 , T3 , T4 , T5 , T6 > . toList ( ) : List < T >

= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) , this . _13 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) , this . _13 ( ) , this . _14 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) , this . _13 ( ) , this . _14 ( ) , this . _15 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) , this . _13 ( ) , this . _14 ( ) , this . _15 ( ) , this . _16 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) , this . _13 ( ) , this . _14 ( ) , this . _15 ( ) , this . _16 ( ) , this . _17 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) , this . _13 ( ) , this . _14 ( ) , this . _15 ( ) , this . _16 ( ) , this . _17 ( ) , this . _18 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) , this . _13 ( ) , this . _14 ( ) , this . _15 ( ) , this . _16 ( ) , this . _17 ( ) , this . _18 ( ) , this . _19 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) , this . _13 ( ) , this . _14 ( ) , this . _15 ( ) , this . _16 ( ) , this . _17 ( ) , this . _18 ( ) , this . _19 ( ) , this . _20 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) , this . _13 ( ) , this . _14 ( ) , this . _15 ( ) , this . _16 ( ) , this . _17 ( ) , this . _18 ( ) , this . _19 ( ) , this . _20 ( ) , this . _21 ( ) )


= listOf ( this . _1 ( ) , this . _2 ( ) , this . _3 ( ) , this . _4 ( ) , this . _5 ( ) , this . _6 ( ) , this . _7 ( ) , this . _8 ( ) , this . _9 ( ) , this . _10 ( ) , this . _11 ( ) , this . _12 ( ) , this . _13 ( ) , this . _14 ( ) , this . _15 ( ) , this . _16 ( ) , this . _17 ( ) , this . _18 ( ) , this . _19 ( ) , this . _20 ( ) , this . _21 ( ) , this . _22 ( ) )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T > Product1 < T1 > . get ( n : Int ) : T

= productElement ( n ) as T

/** The n'th element of this product, 0-based. In other words, for a
 * product `A(x,,1,,, ..., x,,k,,)`, returns `x,,(n+1),,` where `0 <= n < k`.
 *
 * @param n the index of the element to return
 * @throws IndexOutOfBoundsException
 * @return the element `n` elements after the first element
 */


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T > Product2 < T1 , T2 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T > Product3 < T1 , T2 , T3 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T > Product4 < T1 , T2 , T3 , T4 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T > Product5 < T1 , T2 , T3 , T4 , T5 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T > Product6 < T1 , T2 , T3 , T4 , T5 , T6 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T > Product7 < T1 , T2 , T3 , T4 , T5 , T6 , T7 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T > Product8 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T > Product9 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T > Product10 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T > Product11 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T > Product12 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T > Product13 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T , T14 : T > Product14 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T , T14 : T , T15 : T > Product15 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 > . get ( n : Int ) : T

= productElement ( n ) as T


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T , T14 : T , T15 : T , T16 : T > Product16 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 > . get ( n : Int ) : T

= productElement ( n ) as T


= productElement ( n ) as T


fun < T , T1 : T > Product1 < T1 > . getOrNull ( n : Int ) : T ?

= ( if ( n in <NUM_LIT:0> until size ) productElement ( n ) as T else null )

/** The n'th element of this product, 0-based. In other words, for a
 * product `A(x,,1,,, ..., x,,k,,)`, returns `x,,(n+1),,` where `0 <= n < k`.
 *
 * @param n the index of the element to return
 * @return the element `n` elements after the first element, `null` if out of bounds
 */


fun < T , T1 : T , T2 : T > Product2 < T1 , T2 > . getOrNull ( n : Int ) : T ?


fun < T , T1 : T , T2 : T , T3 : T > Product3 < T1 , T2 , T3 > . getOrNull ( n : Int ) : T ?


fun < T , T1 : T , T2 : T , T3 : T , T4 : T > Product4 < T1 , T2 , T3 , T4 > . getOrNull ( n : Int ) : T ?


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T > Product5 < T1 , T2 , T3 , T4 , T5 > . getOrNull ( n : Int ) : T ?


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T > Product6 < T1 , T2 , T3 , T4 , T5 , T6 > . getOrNull ( n : Int ) : T ?


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T > Product7 < T1 , T2 , T3 , T4 , T5 , T6 , T7 > . getOrNull ( n : Int ) : T ?


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T > Product1 < T1 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )

/** The range of n'th elements of this product, 0-based. In other words, for a
 * product `A(x,,1,,, ..., x,,k,,)`, returns `x,,(n+1),,` where `0 <= n < k`.
 *
 * @param indexRange the indices of the elements to return
 * @throws IndexOutOfBoundsException
 * @return the elements in [indexRange]
 */


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T > Product2 < T1 , T2 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T > Product3 < T1 , T2 , T3 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T > Product4 < T1 , T2 , T3 , T4 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T > Product5 < T1 , T2 , T3 , T4 , T5 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T > Product6 < T1 , T2 , T3 , T4 , T5 , T6 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T > Product7 < T1 , T2 , T3 , T4 , T5 , T6 , T7 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T > Product8 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T > Product9 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T > Product10 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T > Product11 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T > Product12 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T > Product13 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T , T14 : T > Product14 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T , T14 : T , T15 : T > Product15 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T , T14 : T , T15 : T , T16 : T > Product16 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T , T14 : T , T15 : T , T16 : T , T17 : T > Product17 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T , T14 : T , T15 : T , T16 : T , T17 : T , T18 : T > Product18 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T , T14 : T , T15 : T , T16 : T , T17 : T , T18 : T , T19 : T > Product19 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


@ Throws ( IndexOutOfBoundsException :: class ) <EOL> operator fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T , T13 : T , T14 : T , T15 : T , T16 : T , T17 : T , T18 : T , T19 : T , T20 : T > Product20 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 > . get ( indexRange : IntRange ) : List < T >

= indexRange . map ( :: get )


= indexRange . map ( :: get )


fun < T , T1 : T > Product1 < T1 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )

/** The range of n'th elements of this product, 0-based. In other words, for a
 * product `A(x,,1,,, ..., x,,k,,)`, returns `x,,(n+1),,` where `0 <= n < k`.
 *
 * @param indexRange the indices of the elements to return
 * @return the elements in [indexRange], `null` if out of bounds
 */


fun < T , T1 : T , T2 : T > Product2 < T1 , T2 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


fun < T , T1 : T , T2 : T , T3 : T > Product3 < T1 , T2 , T3 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T > Product4 < T1 , T2 , T3 , T4 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T > Product5 < T1 , T2 , T3 , T4 , T5 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T > Product6 < T1 , T2 , T3 , T4 , T5 , T6 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T > Product7 < T1 , T2 , T3 , T4 , T5 , T6 , T7 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T > Product8 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T > Product9 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T > Product10 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T > Product11 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


fun < T , T1 : T , T2 : T , T3 : T , T4 : T , T5 : T , T6 : T , T7 : T , T8 : T , T9 : T , T10 : T , T11 : T , T12 : T > Product12 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 > . getOrNull ( indexRange : IntRange ) : List < T ? >

= indexRange . map ( :: getOrNull )


= indexRange . map ( :: getOrNull )


@ GradleTest <EOL> fun `test - shared native klib - does not contain 'depends=' manifest property` ( gradleVersion : GradleVersion )

{ <EOL> project ( "<STR_LIT>" , gradleVersion ) { <EOL> build ( "<STR_LIT>" ) { <EOL> val nativeMainKlib = projectPath . resolve ( "<STR_LIT>" ) <EOL> assertDirectoryExists ( nativeMainKlib ) <EOL> val libraryFile = org . jetbrains . kotlin . library . resolveSingleFileKlib ( org . jetbrains . kotlin . konan . file . File ( nativeMainKlib ) , strategy = ToolingSingleFileKlibResolveStrategy ) <EOL> if ( libraryFile . unresolvedDependencies . isNotEmpty ( ) ) { <EOL> fail ( "<STR_LIT>" ) <EOL> } <EOL> if ( libraryFile . manifestProperties . hasProperty ( KLIB_PROPERTY_DEPENDS ) ) { <EOL> fail ( "<STR_LIT>" + "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * https://youtrack.jetbrains.com/issue/KT-56205/Shared-Native-Compilation-False-positive-w-Could-not-find-warnings-on-metadata-klibs
 * metadata klib should not contain any dependsOn= in their klib manifest.
 */


@ GradleTest <EOL> @ Disabled ( "<STR_LIT>" ) <EOL> fun `test - K2 - shared native compilation - assemble` ( gradleVersion : GradleVersion )

{ <EOL> project ( "<STR_LIT>" , gradleVersion , buildOptions = defaultBuildOptions . copy ( languageVersion = "<STR_LIT:2.0>" ) ) { <EOL> build ( "<STR_LIT:assemble>" ) { <EOL> assertTasksExecuted ( "<STR_LIT>" ) <EOL> assertTasksExecuted ( "<STR_LIT>" ) <EOL> assertTasksExecuted ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> }


fun < T1 > Tuple1 < T1 > . drop0 ( ) : Tuple1 < T1 >

= Tuple1 < T1 > ( this . _1 ( ) )

/**
 * This file contains all functions to drop N items from the beginning or end of a Tuple.
 * If all items are dropped, the result will be [EmptyTuple].
 *
 * For example:
 * ```kotlin
 * tupleOf(1, 2, 3, 4).drop2() == tupleOf(3, 4)
 * tupleOf(1, 2, 3, 4).dropLast2() == tupleOf(1, 2)
 * ```
 */


fun create ( project : Project ) : ExecutorService

{ <EOL> val testTarget = project . testTarget <EOL> val configurables = project . testTargetConfigurables <EOL> val executor = when { <EOL> project . compileOnlyTests -> NoOpExecutor ( explanation = "<STR_LIT>" ) <EOL> testTarget == HostManager . host -> HostExecutor ( ) <EOL> configurables is ConfigurablesWithEmulator && testTarget != HostManager . host -> EmulatorExecutor ( configurables ) <EOL> configurables is AppleConfigurables && configurables . targetTriple . isSimulator -> XcodeSimulatorExecutor ( configurables ) . apply { <EOL> project . findProperty ( "<STR_LIT>" ) ? . toString ( ) ? . let { <EOL> deviceId = it <EOL> } <EOL> } <EOL> configurables is AppleConfigurables && RosettaExecutor . availableFor ( configurables ) -> RosettaExecutor ( configurables ) <EOL> else -> error ( "<STR_LIT>" ) <EOL> } <EOL> return executor . service ( project ) <EOL> }

/**
 * Creates an ExecutorService depending on a test target -Ptest_target
 */


fun runProcess ( executor : ( Action < in ExecSpec > ) -> ExecResult ? , executable : String , args : List < String > , env : Map < String , String > = emptyMap ( ) ) : ProcessOutput

{ <EOL> val outStream = ByteArrayOutputStream ( ) <EOL> val errStream = ByteArrayOutputStream ( ) <EOL> val execResult = executor ( Action { <EOL> this . executable = executable <EOL> this . args = args . toList ( ) <EOL> this . standardOutput = outStream <EOL> this . errorOutput = errStream <EOL> this . isIgnoreExitValue = true <EOL> this . environment ( env ) <EOL> } ) <EOL> checkNotNull ( execResult ) <EOL> val stdOut = outStream . toString ( "<STR_LIT>" ) <EOL> val stdErr = errStream . toString ( "<STR_LIT>" ) <EOL> return ProcessOutput ( stdOut , stdErr , execResult . exitValue ) <EOL> }

/**
 * Runs process using a given executor.
 *
 * @param executor a method that is able to run a given executable, e.g. ExecutorService::execute
 * @param executable a process executable to be run
 * @param args arguments for a process
 */


fun runProcessWithInput ( executor : ( Action < in ExecSpec > ) -> ExecResult ? , executable : String , args : List < String > , input : String ) : ProcessOutput

{ <EOL> val outStream = ByteArrayOutputStream ( ) <EOL> val errStream = ByteArrayOutputStream ( ) <EOL> val inStream = ByteArrayInputStream ( input . toByteArray ( ) ) <EOL> val execResult = executor ( Action { <EOL> this . executable = executable <EOL> this . args = args . toList ( ) <EOL> this . standardOutput = outStream <EOL> this . errorOutput = errStream <EOL> this . isIgnoreExitValue = true <EOL> this . standardInput = inStream <EOL> } ) <EOL> checkNotNull ( execResult ) <EOL> val stdOut = outStream . toString ( "<STR_LIT>" ) <EOL> val stdErr = errStream . toString ( "<STR_LIT>" ) <EOL> return ProcessOutput ( stdOut , stdErr , execResult . exitValue ) <EOL> }

/**
 * Runs process using a given executor.
 *
 * @param executor a method that is able to run a given executable, e.g. ExecutorService::execute
 * @param executable a process executable to be run
 * @param args arguments for a process
 * @param input an input string to be passed through the standard input stream
 */


fun Project . executeAndCheck ( executable : Path , arguments : List < String > = emptyList ( ) )

{ <EOL> val ( stdOut , stdErr , exitCode ) = runProcess ( executor = executor :: execute , executable = executable . toString ( ) , args = arguments ) <EOL> println ( """<STR_LIT>""" . trimMargin ( ) ) <EOL> check ( exitCode == <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> }

/**
 * Executes the [executable] with the given [arguments]
 * and checks that the program finished with zero exit code.
 */


= { a : Action < in ExecSpec > -> project . exec ( a ) }

/**
 * Returns [project]'s process executor.
 * @see Project.exec
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun UByte . toString ( radix : Int ) : String

= this . toInt ( ) . toString ( radix )

/**
 * Returns a string representation of this [Byte] value in the specified [radix].
 *
 * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun UShort . toString ( radix : Int ) : String

= this . toInt ( ) . toString ( radix )

/**
 * Returns a string representation of this [Short] value in the specified [radix].
 *
 * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun UInt . toString ( radix : Int ) : String

= uintToString ( this . toInt ( ) , checkRadix ( radix ) )

/**
 * Returns a string representation of this [Int] value in the specified [radix].
 *
 * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun ULong . toString ( radix : Int ) : String

= ulongToString ( this . toLong ( ) , checkRadix ( radix ) )

/**
 * Returns a string representation of this [Long] value in the specified [radix].
 *
 * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class ) <EOL> public fun String . toUByte ( ) : UByte

= toUByteOrNull ( ) ? : numberFormatError ( this )

/**
 * Parses the string as a signed [UByte] number and returns the result.
 * @throws NumberFormatException if the string is not a valid representation of a number.
 */