internal fun resolveCacheBinaries ( cachedLibraries : CachedLibraries , dependenciesTrackingResult : DependenciesTrackingResult , ) : ResolvedCacheBinaries

{ <EOL> val staticCaches = mutableListOf < String > ( ) <EOL> val dynamicCaches = mutableListOf < String > ( ) <EOL> dependenciesTrackingResult . allCachedBitcodeDependencies . forEach { dependency -> <EOL> val library = dependency . library <EOL> val cache = cachedLibraries . getLibraryCache ( library ) <EOL> ? : error ( "<STR_LIT>" ) <EOL> val list = when ( cache . kind ) { <EOL> CachedLibraries . Kind . DYNAMIC -> dynamicCaches <EOL> CachedLibraries . Kind . STATIC -> staticCaches <EOL> CachedLibraries . Kind . HEADER -> error ( "<STR_LIT>" ) <EOL> } <EOL> list += if ( dependency . kind is DependenciesTracker . DependencyKind . CertainFiles && cache is CachedLibraries . Cache . PerFile ) <EOL> dependency . kind . files . map { cache . getFileBinaryPath ( it ) } <EOL> else cache . binariesPaths <EOL> } <EOL> return ResolvedCacheBinaries ( static = staticCaches , dynamic = dynamicCaches ) <EOL> }

/**
 * Find binary files for compiler caches that are actually required for the linkage.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . absolute ( ) : Path

= toAbsolutePath ( )

/**
 * Converts this possibly relative path to an absolute path.
 *
 * If this path is already [absolute][Path.isAbsolute], returns this path unchanged.
 * Otherwise, resolves this path, usually against the default directory of the file system.
 *
 * May throw an exception if the file system is inaccessible or getting the default directory path is prohibited.
 *
 * See [Path.toAbsolutePath] for further details about the function contract and possible exceptions.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . absolutePathString ( ) : String

= toAbsolutePath ( ) . toString ( )

/**
 * Converts this possibly relative path to an absolute path and returns its string representation.
 *
 * Basically, this method is a combination of calling [absolute] and [pathString].
 *
 * May throw an exception if the file system is inaccessible or getting the default directory path is prohibited.
 *
 * See [Path.toAbsolutePath] for further details about the function contract and possible exceptions.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> public fun Path . relativeTo ( base : Path ) : Path

= try { <EOL> PathRelativizer . tryRelativeTo ( this , base ) <EOL> } catch ( e : IllegalArgumentException ) { <EOL> throw IllegalArgumentException ( e . message + "<STR_LIT>" , e ) <EOL> }

/**
 * Calculates the relative path for this path from a [base] path.
 *
 * Note that the [base] path is treated as a directory.
 * If this path matches the [base] path, then a [Path] with an empty path will be returned.
 *
 * @return the relative path from [base] to this.
 *
 * @throws IllegalArgumentException if this and base paths have different roots.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> public fun Path . relativeToOrSelf ( base : Path ) : Path

= <EOL> relativeToOrNull ( base ) ? : this

/**
 * Calculates the relative path for this path from a [base] path.
 *
 * Note that the [base] path is treated as a directory.
 * If this path matches the [base] path, then a [Path] with an empty path will be returned.
 *
 * @return the relative path from [base] to this, or `this` if this and base paths have different roots.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> public fun Path . relativeToOrNull ( base : Path ) : Path ?

= try { <EOL> PathRelativizer . tryRelativeTo ( this , base ) <EOL> } catch ( e : IllegalArgumentException ) { <EOL> null <EOL> }

/**
 * Calculates the relative path for this path from a [base] path.
 *
 * Note that the [base] path is treated as a directory.
 * If this path matches the [base] path, then a [Path] with an empty path will be returned.
 *
 * @return the relative path from [base] to this, or `null` if this and base paths have different roots.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . copyTo ( target : Path , overwrite : Boolean = false ) : Path

{ <EOL> val options = if ( overwrite ) arrayOf < CopyOption > ( StandardCopyOption . REPLACE_EXISTING ) else emptyArray ( ) <EOL> return Files . copy ( this , target , * options ) <EOL> }

/**
 * Copies a file or directory located by this path to the given [target] path.
 *
 * Unlike `File.copyTo`, 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.copyTo(destinationPath.createParentDirectories())
 * ```
 *
 * If the [target] path already exists, this function will fail unless [overwrite] argument is set to `true`.
 *
 * When [overwrite] is `true` and [target] is a directory, it is replaced only if it is empty.
 *
 * If this path is a directory, it is copied without its content, i.e. an empty [target] directory is created.
 * If you want to copy directory including its contents, use [copyToRecursively].
 *
 * The operation doesn't preserve copied file attributes such as creation/modification date, permissions, etc.
 *
 * @param overwrite `true` if destination overwrite is allowed.
 * @return the [target] path.
 * @throws NoSuchFileException if the source path doesn't exist.
 * @throws FileAlreadyExistsException if the destination path already exists and [overwrite] argument is set to `false`.
 * @throws DirectoryNotEmptyException if the destination path point to an existing directory and [overwrite] argument is `true`,
 * when the directory being replaced is not empty.
 * @throws IOException if any errors occur while copying.
 *
 * @see Files.copy
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . copyTo ( target : Path , vararg options : CopyOption ) : Path

{ <EOL> return Files . copy ( this , target , * options ) <EOL> }

/**
 * Copies a file or directory located by this path to the given [target] path.
 *
 * Unlike `File.copyTo`, 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.copyTo(destinationPath.createParentDirectories())
 * ```
 *
 * If the [target] path already exists, this function will fail unless the
 * [REPLACE_EXISTING][StandardCopyOption.REPLACE_EXISTING] is option is used.
 *
 * When [REPLACE_EXISTING][StandardCopyOption.REPLACE_EXISTING] is used and [target] is a directory,
 * it is replaced only if it is empty.
 *
 * If this path is a directory, it is copied *without* its content, i.e. an empty [target] directory is created.
 * If you want to copy a directory including its contents, use [copyToRecursively].
 *
 * The operation doesn't preserve copied file attributes such as creation/modification date,
 * permissions, etc. unless [COPY_ATTRIBUTES][StandardCopyOption.COPY_ATTRIBUTES] is used.
 *
 * @param options options to control how the path is copied.
 * @return the [target] path.
 * @throws NoSuchFileException if the source path doesn't exist.
 * @throws FileAlreadyExistsException if the destination path already exists and [REPLACE_EXISTING][StandardCopyOption.REPLACE_EXISTING] is not used.
 * @throws DirectoryNotEmptyException if the destination path point to an existing directory and [REPLACE_EXISTING][StandardCopyOption.REPLACE_EXISTING] is used,
 * when the directory being replaced is not empty.
 * @throws IOException if any errors occur while copying.
 *
 * @see Files.copy
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . exists ( vararg options : LinkOption ) : Boolean

= Files . exists ( this , * options )

/**
 * Checks if the file located by this path exists.
 *
 * @return `true`, if the file definitely exists, `false` otherwise,
 * including situations when the existence cannot be determined.
 *
 * @param options options to control how symbolic links are handled.
 *
 * @see Files.exists
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . notExists ( vararg options : LinkOption ) : Boolean

= Files . notExists ( this , * options )

/**
 * Checks if the file located by this path does not exist.
 *
 * @return `true`, if the file definitely does not exist, `false` otherwise,
 * including situations when the existence cannot be determined.
 *
 * @param options options to control how symbolic links are handled.
 *
 * @see Files.notExists
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . isRegularFile ( vararg options : LinkOption ) : Boolean

= Files . isRegularFile ( this , * options )

/**
 * Checks if the file located by this path is a regular file.
 *
 * @param options options to control how symbolic links are handled.
 *
 * @see Files.isRegularFile
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . isDirectory ( vararg options : LinkOption ) : Boolean

= Files . isDirectory ( this , * options )

/**
 * Checks if the file located by this path is a directory.
 *
 * By default, symbolic links in the path are followed.
 *
 * @param options options to control how symbolic links are handled.
 *
 * @see Files.isDirectory
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . isSymbolicLink ( ) : Boolean

= Files . isSymbolicLink ( this )

/**
 * Checks if the file located by this path exists and is a symbolic link.
 *
 * @see Files.isSymbolicLink
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . isExecutable ( ) : Boolean

= Files . isExecutable ( this )

/**
 * Checks if the file located by this path exists and is executable.
 *
 * @see Files.isExecutable
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . isHidden ( ) : Boolean

= Files . isHidden ( this )

/**
 * Checks if the file located by this path is considered hidden.
 *
 * This check is dependant on the current filesystem. For example, on UNIX-like operating systems, a
 * path is considered hidden if its name begins with a dot. On Windows, file attributes are checked.
 *
 * @see Files.isHidden
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . isReadable ( ) : Boolean

= Files . isReadable ( this )

/**
 * Checks if the file located by this path exists and is readable.
 *
 * @see Files.isReadable
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . isWritable ( ) : Boolean

= Files . isWritable ( this )

/**
 * Checks if the file located by this path exists and is writable.
 *
 * @see Files.isWritable
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . isSameFileAs ( other : Path ) : Boolean

= Files . isSameFile ( this , other )

/**
 * Checks if the file located by this path points to the same file or directory as [other].
 *
 * @see Files.isSameFile
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> public fun Path . listDirectoryEntries ( glob : String = "<STR_LIT:*>" ) : List < Path >

{ <EOL> return Files . newDirectoryStream ( this , glob ) . use { it . toList ( ) } <EOL> }

/**
 * Returns a list of the entries in this directory optionally filtered by matching against the specified [glob] pattern.
 *
 * @param glob the globbing pattern. The syntax is specified by the [FileSystem.getPathMatcher] method.
 *
 * @throws java.util.regex.PatternSyntaxException if the glob pattern is invalid.
 * @throws NotDirectoryException If this path does not refer to a directory.
 * @throws IOException If an I/O error occurs.
 *
 * @see Files.newDirectoryStream
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun < T > Path . useDirectoryEntries ( glob : String = "<STR_LIT:*>" , block : ( Sequence < Path > ) -> T ) : T

{ <EOL> return Files . newDirectoryStream ( this , glob ) . use { block ( it . asSequence ( ) ) } <EOL> }

/**
 * Calls the [block] callback with a sequence of all entries in this directory
 * optionally filtered by matching against the specified [glob] pattern.
 *
 * @param glob the globbing pattern. The syntax is specified by the [FileSystem.getPathMatcher] method.
 *
 * @throws java.util.regex.PatternSyntaxException if the glob pattern is invalid.
 * @throws NotDirectoryException If this path does not refer to a directory.
 * @throws IOException If an I/O error occurs.
 * @return the value returned by [block].
 *
 * @see Files.newDirectoryStream
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . forEachDirectoryEntry ( glob : String = "<STR_LIT:*>" , action : ( Path ) -> Unit )

{ <EOL> return Files . newDirectoryStream ( this , glob ) . use { it . forEach ( action ) } <EOL> }

/**
 * Performs the given [action] on each entry in this directory optionally filtered by matching against the specified [glob] pattern.
 *
 * @param glob the globbing pattern. The syntax is specified by the [FileSystem.getPathMatcher] method.
 *
 * @throws java.util.regex.PatternSyntaxException if the glob pattern is invalid.
 * @throws NotDirectoryException If this path does not refer to a directory.
 * @throws IOException If an I/O error occurs.
 *
 * @see Files.newDirectoryStream
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . fileSize ( ) : Long

= <EOL> Files . size ( this )

/**
 * Returns the size of a regular file as a [Long] value of bytes or throws an exception if the file doesn't exist.
 *
 * @throws IOException if an I/O error occurred.
 * @see Files.size
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . deleteExisting ( )

{ <EOL> Files . delete ( this ) <EOL> }

/**
 * Deletes the existing file or empty directory specified by this path.
 *
 * @throws NoSuchFileException if the file or directory does not exist.
 * @throws DirectoryNotEmptyException if the directory exists but is not empty.
 *
 * @see Files.delete
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . deleteIfExists ( ) : Boolean

= <EOL> Files . deleteIfExists ( this )

/**
 * Deletes the file or empty directory specified by this path if it exists.
 *
 * @return `true` if the existing file was successfully deleted, `false` if the file does not exist.
 *
 * @throws DirectoryNotEmptyException if the directory exists but is not empty
 *
 * @see Files.deleteIfExists
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . createDirectory ( vararg attributes : FileAttribute < * > ) : Path

= <EOL> Files . createDirectory ( this , * attributes )

/**
 * Creates a new directory or throws an exception if there is already a file or directory located by this path.
 *
 * Note that the parent directory where this directory is going to be created must already exist.
 * If you need to create all non-existent parent directories, use [Path.createDirectories].
 *
 * @param attributes an optional list of file attributes to set atomically when creating the directory.
 *
 * @throws FileAlreadyExistsException if there is already a file or directory located by this path
 * (optional specific exception, some implementations may throw more general [IOException]).
 * @throws IOException if an I/O error occurs or the parent directory does not exist.
 * @throws UnsupportedOperationException if the [attributes ]array contains an attribute that cannot be set atomically
 * when creating the directory.
 *
 * @see Files.createDirectory
 * @see Path.createDirectories
 * @see Path.createParentDirectories
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . createDirectories ( vararg attributes : FileAttribute < * > ) : Path

= <EOL> Files . createDirectories ( this , * attributes )

/**
 * Creates a directory ensuring that all nonexistent parent directories exist by creating them first.
 *
 * If the directory already exists, this function does not throw an exception, unlike [Path.createDirectory].
 *
 * @return the path of this directory if it already exists or has been created successfully.
 * The returned path can be converted [Path.toAbsolutePath][to absolute path] if it was relative.
 *
 * @param attributes an optional list of file attributes to set atomically when creating the directory.
 *
 * @throws FileAlreadyExistsException if there is already a file located by this path or one of its parent paths
 * (optional specific exception, some implementations may throw more general [IOException]).
 * @throws IOException if an I/O error occurs.
 * @throws UnsupportedOperationException if the [attributes] array contains an attribute that cannot be set atomically
 * when creating the directory.
 *
 * @see Files.createDirectories
 * @see Path.createDirectory
 * @see Path.createParentDirectories
 */


@ SinceKotlin ( "<STR_LIT:1.9>" ) <EOL> @ Throws ( IOException :: class ) <EOL> public fun Path . createParentDirectories ( vararg attributes : FileAttribute < * > ) : Path

= also { <EOL> val parent = it . parent <EOL> if ( parent != null && ! parent . isDirectory ( ) ) { <EOL> try { <EOL> parent . createDirectories ( * attributes ) <EOL> } catch ( e : FileAlreadyExistsException ) { <EOL> if ( ! parent . isDirectory ( ) ) throw e <EOL> } <EOL> } <EOL> }

/**
 * Ensures that all parent directories of this path exist, creating them if required.
 *
 * If the parent directory already exists, this function does nothing.
 *
 * Note that the [parent][Path.getParent] directory is not always the directory that contains the entry specified by this path.
 * For example, the parent of the path `x/y/.` is `x/y`, which is logically the same directory,
 * and the parent of `x/y/..` (which means just `x/`) is also `x/y`.
 * Use the function [Path.normalize] to eliminate redundant name elements from the path.
 *
 * @param attributes an optional list of file attributes to set atomically when creating the missing parent directories.
 *
 * @return this path unchanged if all parent directories already exist or have been created successfully.
 *
 * @throws FileAlreadyExistsException if there is already a file located by the [parent][Path.getParent] path or one of its parent paths
 * (optional specific exception, some implementations may throw more general [IOException]).
 * @throws IOException if an I/O error occurs.
 * @throws UnsupportedOperationException if the [attributes] array contains an attribute that cannot be set atomically
 * when creating the directory.
 *
 * @see Path.getParent
 * @see Path.createDirectories
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . moveTo ( target : Path , vararg options : CopyOption ) : Path

= <EOL> Files . move ( this , target , * options )

/**
 * Moves or renames the file located by this path to the [target] path.
 *
 * @param options options specifying how the move should be done, see [StandardCopyOption], [LinkOption].
 *
 * @throws FileAlreadyExistsException if the target file exists but cannot be replaced because the
 * [StandardCopyOption.REPLACE_EXISTING] option is not specified (optional specific exception).
 * @throws DirectoryNotEmptyException the [StandardCopyOption.REPLACE_EXISTING] option is specified but the file
 * cannot be replaced because it is a non-empty directory, or the
 * source is a non-empty directory containing entries that would
 * be required to be moved (optional specific exception).
 *
 * @see Files.move
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . moveTo ( target : Path , overwrite : Boolean = false ) : Path

{ <EOL> val options = if ( overwrite ) arrayOf < CopyOption > ( StandardCopyOption . REPLACE_EXISTING ) else emptyArray ( ) <EOL> return Files . move ( this , target , * options ) <EOL> }

/**
 * Moves or renames the file located by this path to the [target] path.
 *
 * @param overwrite allows to overwrite the target if it already exists.
 *
 * @throws FileAlreadyExistsException if the target file exists but cannot be replaced because the
 * `overwrite = true` option is not specified (optional specific exception).
 * @throws DirectoryNotEmptyException the `overwrite = true` option is specified but the file
 * cannot be replaced because it is a non-empty directory, or the
 * source is a non-empty directory containing entries that would
 * be required to be moved (optional specific exception).
 *
 * @see Files.move
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . fileStore ( ) : FileStore

= <EOL> Files . getFileStore ( this )

/**
 * Returns the [FileStore] representing the file store where a file is located.
 *
 * @see Files.getFileStore
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . getAttribute ( attribute : String , vararg options : LinkOption ) : Any ?

= <EOL> Files . getAttribute ( this , attribute , * options )

/**
 * Reads the value of a file attribute.
 *
 * The attribute name is specified with the [attribute] parameter optionally prefixed with the attribute view name:
 * ```
 * [view_name:]attribute_name
 * ```
 * When the view name is not specified, it defaults to `basic`.
 *
 * @throws UnsupportedOperationException if the attribute view is not supported.
 * @throws IllegalArgumentException if the attribute name is not specified or is not recognized.
 * @see Files.getAttribute
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . setAttribute ( attribute : String , value : Any ? , vararg options : LinkOption ) : Path

= <EOL> Files . setAttribute ( this , attribute , value , * options )

/**
 * Sets the value of a file attribute.
 *
 * The attribute name is specified with the [attribute] parameter optionally prefixed with the attribute view name:
 * ```
 * [view_name:]attribute_name
 * ```
 * When the view name is not specified, it defaults to `basic`.
 *
 * @throws UnsupportedOperationException if the attribute view is not supported.
 * @throws IllegalArgumentException if the attribute name is not specified or is not recognized, or
 * the attribute value is of the correct type but has an inappropriate value.
 * @throws ClassCastException if the attribute value is not of the expected type
 * @see Files.setAttribute
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun < reified V : FileAttributeView > Path . fileAttributesViewOrNull ( vararg options : LinkOption ) : V ?

= <EOL> Files . getFileAttributeView ( this , V :: class . java , * options )

/**
 * Returns a file attributes view of a given type [V]
 * or `null` if the requested attribute view type is not available.
 *
 * The returned view allows to read and optionally to modify attributes of a file.
 *
 * @param V the reified type of the desired attribute view.
 *
 * @see Files.getFileAttributeView
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun < reified V : FileAttributeView > Path . fileAttributesView ( vararg options : LinkOption ) : V

= <EOL> Files . getFileAttributeView ( this , V :: class . java , * options ) ? : fileAttributeViewNotAvailable ( this , V :: class . java )

/**
 * Returns a file attributes view of a given type [V]
 * or throws an [UnsupportedOperationException] if the requested attribute view type is not available..
 *
 * The returned view allows to read and optionally to modify attributes of a file.
 *
 * @param V the reified type of the desired attribute view, a subtype of [FileAttributeView].
 *
 * @see Files.getFileAttributeView
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun < reified A : BasicFileAttributes > Path . readAttributes ( vararg options : LinkOption ) : A

= <EOL> Files . readAttributes ( this , A :: class . java , * options )

/**
 * Reads a file's attributes of the specified type [A] in bulk.
 *
 * @param A the reified type of the desired attributes, a subtype of [BasicFileAttributes].
 *
 * @throws UnsupportedOperationException if the given attributes type [A] is not supported.
 * @see Files.readAttributes
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . readAttributes ( attributes : String , vararg options : LinkOption ) : Map < String , Any ? >

= <EOL> Files . readAttributes ( this , attributes , * options )

/**
 * Reads the specified list of attributes of a file in bulk.
 *
 * The list of [attributes] to read is specified in the following string form:
 * ```
 * [view:]attribute_name1[,attribute_name2...]
 * ```
 * So the names are comma-separated and optionally prefixed by the attribute view type name, `basic` by default.
 * The special `*` attribute name can be used to read all attributes of the specified view.
 *
 * @return a [Map<String, Any?>][Map] having an entry for an each attribute read, where the key is the attribute name and the value is the attribute value.
 * @throws UnsupportedOperationException if the attribute view is not supported.
 * @throws IllegalArgumentException if no attributes are specified or an unrecognized attribute is specified.
 * @see Files.readAttributes
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . getLastModifiedTime ( vararg options : LinkOption ) : FileTime

= <EOL> Files . getLastModifiedTime ( this , * options )

/**
 * Returns the last modified time of the file located by this path.
 *
 * If the file system does not support modification timestamps, some implementation-specific default is returned.
 *
 * @see Files.getLastModifiedTime
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . setLastModifiedTime ( value : FileTime ) : Path

= <EOL> Files . setLastModifiedTime ( this , value )

/**
 * Sets the last modified time attribute for the file located by this path.
 *
 * If the file system does not support modification timestamps, the behavior of this method is not defined.
 *
 * @see Files.setLastModifiedTime
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . getOwner ( vararg options : LinkOption ) : UserPrincipal ?

= <EOL> Files . getOwner ( this , * options )

/**
 * Returns the owner of a file.
 *
 * @throws UnsupportedOperationException if the associated file system does not support the [FileOwnerAttributeView].
 *
 * @see Files.getOwner
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . setOwner ( value : UserPrincipal ) : Path

= <EOL> Files . setOwner ( this , value )

/**
 * Sets the file owner to the specified [value].
 *
 * @throws UnsupportedOperationException if the associated file system does not support the [FileOwnerAttributeView].
 *
 * @see Files.setOwner
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . getPosixFilePermissions ( vararg options : LinkOption ) : Set < PosixFilePermission >

= <EOL> Files . getPosixFilePermissions ( this , * options )

/**
 * Returns the POSIX file permissions of the file located by this path.
 *
 * @throws UnsupportedOperationException if the associated file system does not support the [PosixFileAttributeView].
 *
 * @see Files.getPosixFilePermissions
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . setPosixFilePermissions ( value : Set < PosixFilePermission > ) : Path

= <EOL> Files . setPosixFilePermissions ( this , value )

/**
 * Sets the POSIX file permissions for the file located by this path.
 *
 * @throws UnsupportedOperationException if the associated file system does not support the [PosixFileAttributeView].
 *
 * @see Files.setPosixFilePermissions
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . createLinkPointingTo ( target : Path ) : Path

= <EOL> Files . createLink ( this , target )

/**
 * Creates a new link (directory entry) located by this path for the existing file [target].
 *
 * Calling this function may require the process to be started with implementation specific privileges to create hard links
 * or to create links to directories.
 *
 * @throws FileAlreadyExistsException if a file with this name already exists
 * (optional specific exception, some implementations may throw a more general one).
 * @throws UnsupportedOperationException if the implementation does not support creating a hard link.
 *
 * @see Files.createLink
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . createSymbolicLinkPointingTo ( target : Path , vararg attributes : FileAttribute < * > ) : Path

= <EOL> Files . createSymbolicLink ( this , target , * attributes )

/**
 * Creates a new symbolic link located by this path to the given [target].
 *
 * Calling this function may require the process to be started with implementation specific privileges to
 * create symbolic links.
 *
 * @throws FileAlreadyExistsException if a file with this name already exists
 * (optional specific exception, some implementations may throw a more general one).
 * @throws UnsupportedOperationException if the implementation does not support symbolic links or the
 * [attributes] array contains an attribute that cannot be set atomically when creating the symbolic link.
 *
 * @see Files.createSymbolicLink
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . readSymbolicLink ( ) : Path

= <EOL> Files . readSymbolicLink ( this )

/**
 * Reads the target of a symbolic link located by this path.
 *
 * @throws UnsupportedOperationException if symbolic links are not supported by this implementation.
 * @throws NotLinkException if the target is not a symbolic link
 * (optional specific exception, some implementations may throw a more general one).
 *
 * @see Files.readSymbolicLink
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path . createFile ( vararg attributes : FileAttribute < * > ) : Path

= <EOL> Files . createFile ( this , * attributes )

/**
 * Creates a new and empty file specified by this path, failing if the file already exists.
 *
 * @param attributes an optional list of file attributes to set atomically when creating the file.
 *
 * @throws FileAlreadyExistsException if a file specified by this path already exists
 * (optional specific exception, some implementations may throw more general [IOException]).
 * @throws UnsupportedOperationException if the [attributes] array contains an attribute that cannot be set atomically
 * when creating the file.
 *
 * @see Files.createFile
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun createTempFile ( prefix : String ? = null , suffix : String ? = null , vararg attributes : FileAttribute < * > ) : Path

= <EOL> Files . createTempFile ( prefix , suffix , * attributes )

/**
 * Creates an empty file in the default temp directory, using
 * the given [prefix] and [suffix] to generate its name.
 *
 * @param attributes an optional list of file attributes to set atomically when creating the file.
 * @return the path to the newly created file that did not exist before.
 *
 * @throws UnsupportedOperationException if the array contains an attribute that cannot be set atomically
 * when creating the file.
 *
 * @see Files.createTempFile
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> public fun createTempFile ( directory : Path ? , prefix : String ? = null , suffix : String ? = null , vararg attributes : FileAttribute < * > ) : Path

= <EOL> if ( directory != null ) <EOL> Files . createTempFile ( directory , prefix , suffix , * attributes ) <EOL> else <EOL> Files . createTempFile ( prefix , suffix , * attributes )

/**
 * Creates an empty file in the specified [directory], using
 * the given [prefix] and [suffix] to generate its name.
 *
 * @param directory the parent directory in which to create a new file.
 * It can be `null`, in that case the new file is created in the default temp directory.
 * @param attributes an optional list of file attributes to set atomically when creating the file.
 * @return the path to the newly created file that did not exist before.
 *
 * @throws UnsupportedOperationException if the array contains an attribute that cannot be set atomically
 * when creating the file.
 *
 * @see Files.createTempFile
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun createTempDirectory ( prefix : String ? = null , vararg attributes : FileAttribute < * > ) : Path

= <EOL> Files . createTempDirectory ( prefix , * attributes )

/**
 * Creates a new directory in the default temp directory, using the given [prefix] to generate its name.
 *
 * @param attributes an optional list of file attributes to set atomically when creating the directory.
 * @return the path to the newly created directory that did not exist before.
 *
 * @throws UnsupportedOperationException if the array contains an attribute that cannot be set atomically
 * when creating the directory.
 *
 * @see Files.createTempDirectory
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ Throws ( IOException :: class ) <EOL> public fun createTempDirectory ( directory : Path ? , prefix : String ? = null , vararg attributes : FileAttribute < * > ) : Path

= <EOL> if ( directory != null ) <EOL> Files . createTempDirectory ( directory , prefix , * attributes ) <EOL> else <EOL> Files . createTempDirectory ( prefix , * attributes )

/**
 * Creates a new directory in the specified [directory], using the given [prefix] to generate its name.
 *
 * @param directory the parent directory in which to create a new directory.
 * It can be `null`, in that case the new directory is created in the default temp directory.
 * @param attributes an optional list of file attributes to set atomically when creating the directory.
 * @return the path to the newly created directory that did not exist before.
 *
 * @throws UnsupportedOperationException if the array contains an attribute that cannot be set atomically
 * when creating the directory.
 *
 * @see Files.createTempDirectory
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline operator fun Path . div ( other : Path ) : Path

= <EOL> this . resolve ( other )

/**
 * Resolves the given [other] path against this path.
 *
 * This operator is a shortcut for the [Path.resolve] function.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline operator fun Path . div ( other : String ) : Path

= <EOL> this . resolve ( other )

/**
 * Resolves the given [other] path string against this path.
 *
 * This operator is a shortcut for the [Path.resolve] function.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path ( path : String ) : Path

= <EOL> Paths . get ( path )

/**
 * Converts the provided [path] string to a [Path] object of the [default][FileSystems.getDefault] filesystem.
 *
 * @see Paths.get
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun Path ( base : String , vararg subpaths : String ) : Path

= <EOL> Paths . get ( base , * subpaths )

/**
 * Converts the name sequence specified with the [base] path string and a number of [subpaths] additional names
 * to a [Path] object of the [default][FileSystems.getDefault] filesystem.
 *
 * @see Paths.get
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalPathApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun URI . toPath ( ) : Path

= <EOL> Paths . get ( this )

/**
 * Converts this URI to a [Path] object.
 *
 * @see Paths.get
 */


@ ExperimentalPathApi <EOL> @ SinceKotlin ( "<STR_LIT:1.7>" ) <EOL> public fun Path . walk ( vararg options : PathWalkOption ) : Sequence < Path >

= PathTreeWalk ( this , options )

/**
 * Returns a sequence of paths for visiting this directory and all its content.
 *
 * By default, only files are visited, in depth-first order, and symbolic links are not followed.
 * If encountered, symbolic links are included in the sequence as-is, and the content of the directory they point to is not visited.
 * The combination of [options] overrides the default behavior. See [PathWalkOption].
 *
 * The order in which sibling files are visited is unspecified.
 *
 * If after calling this function new files get added or deleted from the file tree rooted at this directory,
 * the changes may or may not appear in the returned sequence.
 *
 * If the file located by this path does not exist, an empty sequence is returned.
 * If the file located by this path is not a directory, a sequence containing only this path is returned.
 *
 * When iterating the returned sequence, the following exceptions could be thrown:
 * * [FileSystemException] if the traversal reaches an entry with an illegal name such as "." or "..".
 * * [FileSystemLoopException] if the traversal reaches a cycle.
 * * [SecurityException] if a security manager is installed and the traversal reaches an entry whose access is not permitted.
 * * [IOException] if any errors arise while opening a directory.
 */


@ ExperimentalPathApi <EOL> @ SinceKotlin ( "<STR_LIT:1.7>" ) <EOL> public fun Path . visitFileTree ( visitor : FileVisitor < Path > , maxDepth : Int = Int . MAX_VALUE , followLinks : Boolean = false ) : Unit

{ <EOL> val options = if ( followLinks ) setOf ( FileVisitOption . FOLLOW_LINKS ) else setOf ( ) <EOL> Files . walkFileTree ( this , options , maxDepth , visitor ) <EOL> }

/**
 * Visits this directory and all its content with the specified [visitor].
 *
 * The traversal is in depth-first order and starts at this directory. The specified [visitor] is invoked on each file encountered.
 *
 * @param visitor the [FileVisitor] that receives callbacks.
 * @param maxDepth the maximum depth to traverse. By default, there is no limit.
 * @param followLinks specifies whether to follow symbolic links, `false` by default.
 *
 * @see Files.walkFileTree
 */


@ ExperimentalPathApi <EOL> @ SinceKotlin ( "<STR_LIT:1.7>" ) <EOL> public fun Path . visitFileTree ( maxDepth : Int = Int . MAX_VALUE , followLinks : Boolean = false , builderAction : FileVisitorBuilder . ( ) -> Unit ) : Unit

{ <EOL> contract { callsInPlace ( builderAction , InvocationKind . EXACTLY_ONCE ) } <EOL> visitFileTree ( fileVisitor ( builderAction ) , maxDepth , followLinks ) <EOL> }

/**
 * Visits this directory and all its content with the [FileVisitor] defined in [builderAction].
 *
 * This function works the same as [Path.visitFileTree]. It is introduced to streamline
 * the cases when a [FileVisitor] is created only to be immediately used for a file tree traversal.
 * The trailing lambda [builderAction] is passed to [fileVisitor] to get the file visitor.
 *
 * Example:
 *
 * ``` kotlin
 * projectDirectory.visitFileTree {
 * onPreVisitDirectory { directory, _ ->
 * if (directory.name == "build") {
 * directory.toFile().deleteRecursively()
 * FileVisitResult.SKIP_SUBTREE
 * } else {
 * FileVisitResult.CONTINUE
 * }
 * }
 *
 * onVisitFile { file, _ ->
 * if (file.extension == "class") {
 * file.deleteExisting()
 * }
 * FileVisitResult.CONTINUE
 * }
 * }
 * ```
 *
 * @param maxDepth the maximum depth to traverse. By default, there is no limit.
 * @param followLinks specifies whether to follow symbolic links, `false` by default.
 * @param builderAction the function that defines [FileVisitor].
 *
 * @see Path.visitFileTree
 * @see fileVisitor
 */


@ ExperimentalPathApi <EOL> @ SinceKotlin ( "<STR_LIT:1.7>" ) <EOL> public fun fileVisitor ( builderAction : FileVisitorBuilder . ( ) -> Unit ) : FileVisitor < Path >

{ <EOL> contract { callsInPlace ( builderAction , InvocationKind . EXACTLY_ONCE ) } <EOL> return FileVisitorBuilderImpl ( ) . apply ( builderAction ) . build ( ) <EOL> }

/**
 * Builds a [FileVisitor] whose implementation is defined in [builderAction].
 *
 * By default, the returned file visitor visits all files and re-throws I/O errors, that is:
 * * [FileVisitor.preVisitDirectory] returns [FileVisitResult.CONTINUE].
 * * [FileVisitor.visitFile] returns [FileVisitResult.CONTINUE].
 * * [FileVisitor.visitFileFailed] re-throws the I/O exception that prevented the file from being visited.
 * * [FileVisitor.postVisitDirectory] returns [FileVisitResult.CONTINUE] if the directory iteration completes without an I/O exception;
 * otherwise it re-throws the I/O exception that caused the iteration of the directory to terminate prematurely.
 *
 * To override a function provide its implementation to the corresponding
 * function of the [FileVisitorBuilder] that was passed as a receiver to [builderAction].
 * Note that each function can be overridden only once.
 * Repeated override of a function throws [IllegalStateException].
 *
 * The builder is valid only inside [builderAction] function.
 * Using it outside the function throws [IllegalStateException].
 *
 * Example:
 *
 * ``` kotlin
 * val cleanVisitor = fileVisitor {
 * onPreVisitDirectory { directory, _ ->
 * if (directory.name == "build") {
 * directory.toFile().deleteRecursively()
 * FileVisitResult.SKIP_SUBTREE
 * } else {
 * FileVisitResult.CONTINUE
 * }
 * }
 *
 * onVisitFile { file, _ ->
 * if (file.extension == "class") {
 * file.deleteExisting()
 * }
 * FileVisitResult.CONTINUE
 * }
 * }
 * ```
 */


fun url ( @ Language ( "<STR_LIT>" ) value : String ) : Unit

= <EOL> url . set ( URI ( value ) )

/**
 * Set the value of [url].
 *
 * @param[value] will be converted to a [URI]
 */


fun url ( value : Provider < String > ) : Unit

= <EOL> url . set ( value . map ( :: URI ) )


fun packageListUrl ( @ Language ( "<STR_LIT>" ) value : String ) : Unit

= <EOL> packageListUrl . set ( URI ( value ) )

/**
 * Set the value of [packageListUrl].
 *
 * @param[value] will be converted to a [URI]
 */


fun packageListUrl ( value : Provider < String > ) : Unit

= <EOL> packageListUrl . set ( value . map ( :: URI ) )


{ <EOL> val charCode = line . char . hexToInt ( ) <EOL> val equivalent = mappingEquivalent ( line ) ? . hexToInt ( ) ? : return <EOL> val mapping = equivalent - charCode <EOL> check ( ( charCode > Char . MAX_VALUE . code ) == ( equivalent > Char . MAX_VALUE . code ) ) { "<STR_LIT>" } <EOL> if ( patterns . isEmpty ( ) ) { <EOL> patterns . add ( createPattern ( charCode , line . categoryCode , mapping ) ) <EOL> return <EOL> } <EOL> val lastPattern = patterns . last ( ) <EOL> if ( ! lastPattern . append ( charCode , line . categoryCode , mapping ) ) { <EOL> val newLastPattern = evolveLastPattern ( lastPattern , charCode , line . categoryCode , mapping ) <EOL> if ( newLastPattern != null ) { <EOL> patterns [ patterns . lastIndex ] = newLastPattern <EOL> } else { <EOL> patterns . add ( createPattern ( charCode , line . categoryCode , mapping ) ) <EOL> } <EOL> } <EOL> }

/**
 * Appends a line from the UnicodeData.txt file.
 */


{ <EOL> return patterns <EOL> }

/**
 * Returns the resulting mapping patterns.
 */


abstract fun mappingEquivalent ( line : UnicodeDataLine ) : String ?

/**
 * Returns the mapping equivalent this builder is responsible for.
 */


protected open fun evolveLastPattern ( lastPattern : MappingPattern , charCode : Int , categoryCode : String , mapping : Int ) : MappingPattern ?

{ <EOL> return null <EOL> }

/**
 * Appends the [charCode] with the specified [categoryCode] and [mapping] to the [lastPattern] and returns the resulting pattern,
 * or returns `null` if the [charCode] can't be appended to the [lastPattern].
 * The [lastPattern] can be transformed to another pattern type to accommodate the [charCode].
 */


public actual fun < T > listOf ( element : T ) : List < T >

= java . util . Collections . singletonList ( element )

/**
 * Returns a new read-only list containing only the specified object [element].
 *
 * The returned list is serializable.
 *
 * @sample samples.collections.Collections.Lists.singletonReadOnlyList
 */


@ kotlin . internal . InlineOnly <EOL> public inline fun < T > java . util . Enumeration < T > . toList ( ) : List < T >

= java . util . Collections . list ( this )

/**
 * Returns a list containing the elements returned by this enumeration
 * in the order they are returned by the enumeration.
 * @sample samples.collections.Collections.Lists.listFromEnumeration
 */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> public actual fun < T > Iterable < T > . shuffled ( ) : List < T >

= toMutableList ( ) . apply { shuffle ( ) }

/**
 * Returns a new list with the elements of this collection randomly shuffled.
 */


@ SinceKotlin ( "<STR_LIT:1.2>" ) <EOL> public fun < T > Iterable < T > . shuffled ( random : java . util . Random ) : List < T >

= toMutableList ( ) . apply { shuffle ( random ) }

/**
 * Returns a new list with the elements of this list randomly shuffled
 * using the specified [random] instance as the source of randomness.
 */


fun ktFile ( pathFromSrc : String , fqPackageName : String = filePathToPackageName ( pathFromSrc ) , fillFile : KotlinTestDataFile . ( ) -> Unit )

/**
 * Creates a `.kt` file.
 *
 * By default, the package of this file is deduced automatically from the [pathFromSrc] param.
 * For example, for a path `org/jetbrains/dokka/test` the package will be `org.jetbrains.dokka.test`.
 * The package can be overridden by setting [fqPackageName].
 *
 * @param pathFromSrc path relative to the source code directory of the project.
 * Must contain packages (if any) and end in `.kt`.
 * Example: `org/jetbrains/dokka/test/File.kt`
 * @param fqPackageName package name to be used in the `package` statement of this file.
 * This value overrides the automatically deduced package.
 */


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

= <EOL> async ( context , start , block ) . asPromise ( )

/**
 * Starts new coroutine and returns its result as an implementation of [Promise].
 *
 * Coroutine context is inherited from a [CoroutineScope], additional context elements can be specified with [context] argument.
 * If the context does not have any dispatcher nor any other [ContinuationInterceptor], then [Dispatchers.Default] is used.
 * The parent job is inherited from a [CoroutineScope] as well, but it can also be overridden
 * with corresponding [context] element.
 *
 * By default, the coroutine is immediately scheduled for execution.
 * Other options can be specified via `start` parameter. See [CoroutineStart] for details.
 *
 * @param context additional to [CoroutineScope.coroutineContext] context of the coroutine.
 * @param start coroutine start option. The default value is [CoroutineStart.DEFAULT].
 * @param block the coroutine code.
 */


public fun < T > Deferred < T > . asPromise ( ) : Promise < T >

{ <EOL> val promise = Promise < T > { resolve , reject -> <EOL> invokeOnCompletion { <EOL> val e = getCompletionExceptionOrNull ( ) <EOL> if ( e != null ) { <EOL> reject ( e ) <EOL> } else { <EOL> resolve ( getCompleted ( ) ) <EOL> } <EOL> } <EOL> } <EOL> promise . asDynamic ( ) . deferred = this <EOL> return promise <EOL> }

/**
 * Converts this deferred value to the instance of [Promise].
 */


public fun < T > Promise < T > . asDeferred ( ) : Deferred < T >

{ <EOL> val deferred = asDynamic ( ) . deferred <EOL> @ Suppress ( "<STR_LIT>" ) <EOL> return deferred ? : GlobalScope . async ( start = CoroutineStart . UNDISPATCHED ) { await ( ) } <EOL> }

/**
 * Converts this promise value to the instance of [Deferred].
 */


public suspend fun < T > Promise < T > . await ( ) : T

= suspendCancellableCoroutine { cont : CancellableContinuation < T > -> <EOL> this@await . then ( onFulfilled = { cont . resume ( it ) } , onRejected = { cont . resumeWithException ( it ) } ) <EOL> }

/**
 * Awaits for completion of the promise without blocking.
 *
 * This suspending function is cancellable: if the [Job] of the current coroutine is cancelled while this
 * suspending function is waiting on the promise, this function immediately resumes with [CancellationException].
 * There is a **prompt cancellation guarantee**: even if this function is ready to return the result, but was cancelled
 * while suspended, [CancellationException] will be thrown. See [suspendCancellableCoroutine] for low-level details.
 */


private fun < Data , Context : PhaseContext > createLlvmDumperAction ( ) : Action < Data , Context >

= <EOL> fun ( state : ActionState , data : Data , context : Context ) { <EOL> if ( state . phase . name in context . config . configuration . getList ( KonanConfigKeys . SAVE_LLVM_IR ) ) { <EOL> val llvmModule = findLlvmModule ( data , context ) <EOL> if ( llvmModule == null ) { <EOL> context . messageCollector . report ( CompilerMessageSeverity . WARNING , "<STR_LIT>" ) <EOL> return <EOL> } <EOL> val moduleName : String = llvmModule . getName ( ) <EOL> val output = File ( context . config . saveLlvmIrDirectory , "<STR_LIT>" ) <EOL> if ( LLVMPrintModuleToFile ( llvmModule , output . absolutePath , null ) != <NUM_LIT:0> ) { <EOL> error ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> }

/**
 * Create action that searches context and data for LLVM IR and dumps it.
 */


private fun < Data , Context : PhaseContext > createLlvmVerifierAction ( ) : Action < Data , Context >

= <EOL> fun ( actionState : ActionState , data : Data , context : Context ) { <EOL> if ( ! context . config . configuration . getBoolean ( KonanConfigKeys . VERIFY_BITCODE ) ) { <EOL> return <EOL> } <EOL> val llvmModule = findLlvmModule ( data , context ) <EOL> if ( llvmModule == null ) { <EOL> context . messageCollector . report ( CompilerMessageSeverity . WARNING , "<STR_LIT>" ) <EOL> return <EOL> } <EOL> verifyModule ( llvmModule ) <EOL> }


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> private fun < Data , Context : PhaseContext > findLlvmModule ( data : Data , context : Context ) : LLVMModuleRef ?

= when { <EOL> data is CPointer < * > -> data as LLVMModuleRef <EOL> data is LlvmIrHolder -> data . llvmModule <EOL> context is LlvmIrHolder -> context . llvmModule <EOL> else -> null <EOL> }


internal fun < Data , Context : PhaseContext > getDefaultLlvmModuleActions ( ) : Set < Action < Data , Context > >

= <EOL> setOf ( createLlvmDumperAction ( ) , createLlvmVerifierAction ( ) )

/**
 * Default set of dump and validate actions for LLVM phases.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . toJavaPairRDD ( ) : JavaPairRDD < K , V >

= <EOL> JavaPairRDD . fromJavaRDD ( this )

/** Utility method to convert [JavaRDD]<[Tuple2]> to [JavaPairRDD]. */


fun < K , V > JavaPairRDD < K , V > . toTupleRDD ( ) : JavaRDD < Tuple2 < K , V > >

= <EOL> JavaPairRDD . toRDD ( this ) . toJavaRDD ( )

/** Utility method to convert [JavaPairRDD] to [JavaRDD]<[Tuple2]>. */


fun < K , V , C > JavaRDD < Tuple2 < K , V > > . combineByKey ( createCombiner : ( V ) -> C , mergeValue : ( C , V ) -> C , mergeCombiners : ( C , C ) -> C , partitioner : Partitioner , mapSideCombine : Boolean = true , serializer : Serializer ? = null , ) : JavaRDD < Tuple2 < K , C > >

= toJavaPairRDD ( ) <EOL> . combineByKey ( createCombiner , mergeValue , mergeCombiners , partitioner , mapSideCombine , serializer ) <EOL> . toTupleRDD ( )

/**
 * Generic function to combine the elements for each key using a custom set of aggregation
 * functions. This method is here for backward compatibility. It does not provide combiner
 * classtag information to the shuffle.
 */


fun < K , V , C > JavaRDD < Tuple2 < K , V > > . combineByKey ( createCombiner : ( V ) -> C , mergeValue : ( C , V ) -> C , mergeCombiners : ( C , C ) -> C , numPartitions : Int , ) : JavaRDD < Tuple2 < K , C > >

= toJavaPairRDD ( ) <EOL> . combineByKey ( createCombiner , mergeValue , mergeCombiners , numPartitions ) <EOL> . toTupleRDD ( )

/**
 * Simplified version of combineByKeyWithClassTag that hash-partitions the output RDD.
 * This method is here for backward compatibility. It does not provide combiner
 * classtag information to the shuffle.
 */


fun < K , V , U > JavaRDD < Tuple2 < K , V > > . aggregateByKey ( zeroValue : U , partitioner : Partitioner , seqFunc : ( U , V ) -> U , combFunc : ( U , U ) -> U , ) : JavaRDD < Tuple2 < K , U > >

= toJavaPairRDD ( ) <EOL> . aggregateByKey ( zeroValue , partitioner , seqFunc , combFunc ) <EOL> . toTupleRDD ( )

/**
 * Aggregate the values of each key, using given combine functions and a neutral "zero value".
 * This function can return a different result type, [U], than the type of the values in this RDD,
 * [V]. Thus, we need one operation for merging a [V] into a [U] and one operation for merging two [U]'s,
 * as in scala.TraversableOnce. The former operation is used for merging values within a
 * partition, and the latter is used for merging values between partitions. To avoid memory
 * allocation, both of these functions are allowed to modify and return their first argument
 * instead of creating a new [U].
 */


fun < K , V , U > JavaRDD < Tuple2 < K , V > > . aggregateByKey ( zeroValue : U , numPartitions : Int , seqFunc : ( U , V ) -> U , combFunc : ( U , U ) -> U , ) : JavaRDD < Tuple2 < K , U > >

= toJavaPairRDD ( ) <EOL> . aggregateByKey ( zeroValue , numPartitions , seqFunc , combFunc ) <EOL> . toTupleRDD ( )


fun < K , V , U > JavaRDD < Tuple2 < K , V > > . aggregateByKey ( zeroValue : U , seqFunc : ( U , V ) -> U , combFunc : ( U , U ) -> U , ) : JavaRDD < Tuple2 < K , U > >

= toJavaPairRDD ( ) <EOL> . aggregateByKey ( zeroValue , seqFunc , combFunc ) <EOL> . toTupleRDD ( )


fun < K , V > JavaRDD < Tuple2 < K , V > > . foldByKey ( zeroValue : V , partitioner : Partitioner , func : ( V , V ) -> V , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . foldByKey ( zeroValue , partitioner , func ) <EOL> . toTupleRDD ( )

/**
 * Merge the values for each key using an associative function and a neutral "zero value" which
 * may be added to the result an arbitrary number of times, and must not change the result
 * (e.g., [emptyList] for list concatenation, 0 for addition, or 1 for multiplication.).
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . foldByKey ( zeroValue : V , numPartitions : Int , func : ( V , V ) -> V , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . foldByKey ( zeroValue , numPartitions , func ) <EOL> . toTupleRDD ( )


fun < K , V > JavaRDD < Tuple2 < K , V > > . foldByKey ( zeroValue : V , func : ( V , V ) -> V , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . foldByKey ( zeroValue , func ) <EOL> . toTupleRDD ( )


fun < K , V > JavaRDD < Tuple2 < K , V > > . sampleByKey ( withReplacement : Boolean , fractions : Map < K , Double > , seed : Long = Random . nextLong ( ) , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . sampleByKey ( withReplacement , fractions , seed ) <EOL> . toTupleRDD ( )

/**
 * Return a subset of this RDD sampled by key (via stratified sampling).
 *
 * Create a sample of this RDD using variable sampling rates for different keys as specified by
 * [fractions], a key to sampling rate map, via simple random sampling with one pass over the
 * RDD, to produce a sample of size that's approximately equal to the sum of
 * math.ceil(numItems * samplingRate) over all key values.
 *
 * @param withReplacement whether to sample with or without replacement
 * @param fractions map of specific keys to sampling rates
 * @param seed seed for the random number generator
 * @return RDD containing the sampled subset
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . sampleByKeyExact ( withReplacement : Boolean , fractions : Map < K , Double > , seed : Long = Random . nextLong ( ) , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . sampleByKeyExact ( withReplacement , fractions , seed ) <EOL> . toTupleRDD ( )

/**
 * Return a subset of this RDD sampled by key (via stratified sampling) containing exactly
 * math.ceil(numItems * samplingRate) for each stratum (group of pairs with the same key).
 *
 * This method differs from [sampleByKey] in that we make additional passes over the RDD to
 * create a sample size that's exactly equal to the sum of math.ceil(numItems * samplingRate)
 * over all key values with a 99.99% confidence. When sampling without replacement, we need one
 * additional pass over the RDD to guarantee sample size; when sampling with replacement, we need
 * two additional passes.
 *
 * @param withReplacement whether to sample with or without replacement
 * @param fractions map of specific keys to sampling rates
 * @param seed seed for the random number generator
 * @return RDD containing the sampled subset
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . reduceByKey ( partitioner : Partitioner , func : ( V , V ) -> V , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . reduceByKey ( partitioner , func ) <EOL> . toTupleRDD ( )

/**
 * Merge the values for each key using an associative and commutative reduce function. This will
 * also perform the merging locally on each mapper before sending results to a reducer, similarly
 * to a "combiner" in MapReduce.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . reduceByKey ( numPartitions : Int , func : ( V , V ) -> V , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . reduceByKey ( func , numPartitions ) <EOL> . toTupleRDD ( )

/**
 * Merge the values for each key using an associative and commutative reduce function. This will
 * also perform the merging locally on each mapper before sending results to a reducer, similarly
 * to a "combiner" in MapReduce. Output will be hash-partitioned with numPartitions partitions.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . reduceByKey ( func : ( V , V ) -> V , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . reduceByKey ( func ) <EOL> . toTupleRDD ( )

/**
 * Merge the values for each key using an associative and commutative reduce function. This will
 * also perform the merging locally on each mapper before sending results to a reducer, similarly
 * to a "combiner" in MapReduce. Output will be hash-partitioned with the existing partitioner/
 * parallelism level.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . reduceByKeyLocally ( func : ( V , V ) -> V , ) : Map < K , V >

= toJavaPairRDD ( ) <EOL> . reduceByKeyLocally ( func )

/**
 * Merge the values for each key using an associative and commutative reduce function, but return
 * the results immediately to the master as a Map. This will also perform the merging locally on
 * each mapper before sending results to a reducer, similarly to a "combiner" in MapReduce.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . countByKey ( ) : Map < K , Long >

= <EOL> toJavaPairRDD ( ) <EOL> . countByKey ( )

/**
 * Count the number of elements for each key, collecting the results to a local Map.
 *
 * This method should only be used if the resulting map is expected to be small, as
 * the whole thing is loaded into the driver's memory.
 * To handle very large results, consider using `rdd.mapValues { 1L }.reduceByKey(Long::plus)`, which
 * returns an [RDD<T, Long>] instead of a map.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . countByKeyApprox ( timeout : Long , confidence : Double = <NUM_LIT> , ) : PartialResult < Map < K , BoundedDouble > >

= toJavaPairRDD ( ) <EOL> . countByKeyApprox ( timeout , confidence )

/**
 * Approximate version of countByKey that can return a partial result if it does
 * not finish within a timeout.
 *
 * The confidence is the probability that the error bounds of the result will
 * contain the true value. That is, if countApprox were called repeatedly
 * with confidence 0.9, we would expect 90% of the results to contain the
 * true count. The confidence must be in the range <0,1> or an exception will
 * be thrown.
 *
 * @param timeout maximum time to wait for the job, in milliseconds
 * @param confidence the desired statistical confidence in the result
 * @return a potentially incomplete result, with error bounds
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . groupByKey ( partitioner : Partitioner , ) : JavaRDD < Tuple2 < K , Iterable < V > > >

= toJavaPairRDD ( ) <EOL> . groupByKey ( partitioner ) <EOL> . toTupleRDD ( )

/**
 * Group the values for each key in the RDD into a single sequence. Allows controlling the
 * partitioning of the resulting key-value pair RDD by passing a Partitioner.
 * The ordering of elements within each group is not guaranteed, and may even differ
 * each time the resulting RDD is evaluated.
 *
 * Note: This operation may be very expensive. If you are grouping in order to perform an
 * aggregation (such as a sum or average) over each key, using [aggregateByKey]
 * or [reduceByKey] will provide much better performance.
 *
 * Note: As currently implemented, groupByKey must be able to hold all the key-value pairs for any
 * key in memory. If a key has too many values, it can result in an [OutOfMemoryError].
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . groupByKey ( numPartitions : Int , ) : JavaRDD < Tuple2 < K , Iterable < V > > >

= toJavaPairRDD ( ) <EOL> . groupByKey ( numPartitions ) <EOL> . toTupleRDD ( )

/**
 * Group the values for each key in the RDD into a single sequence. Hash-partitions the
 * resulting RDD with into [numPartitions] partitions. The ordering of elements within
 * each group is not guaranteed, and may even differ each time the resulting RDD is evaluated.
 *
 * Note: This operation may be very expensive. If you are grouping in order to perform an
 * aggregation (such as a sum or average) over each key, using [aggregateByKey]
 * or [reduceByKey] will provide much better performance.
 *
 * Note: As currently implemented, groupByKey must be able to hold all the key-value pairs for any
 * key in memory. If a key has too many values, it can result in an [OutOfMemoryError].
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . partitionBy ( partitioner : Partitioner , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . partitionBy ( partitioner ) <EOL> . toTupleRDD ( )

/**
 * Return a copy of the RDD partitioned using the specified partitioner.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . join ( other : JavaRDD < Tuple2 < K , W > > , partitioner : Partitioner , ) : JavaRDD < Tuple2 < K , Tuple2 < V , W > > >

= toJavaPairRDD ( ) <EOL> . join ( other . toJavaPairRDD ( ) , partitioner ) <EOL> . toTupleRDD ( )

/**
 * Return an RDD containing all pairs of elements with matching keys in [this] and [other]. Each
 * pair of elements will be returned as a (k, (v1, v2)) tuple, where (k, v1) is in [this] and
 * (k, v2) is in [other]. Uses the given Partitioner to partition the output RDD.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . leftOuterJoin ( other : JavaRDD < Tuple2 < K , W > > , partitioner : Partitioner , ) : JavaRDD < Tuple2 < K , Tuple2 < V , Optional < W > > > >

= toJavaPairRDD ( ) <EOL> . leftOuterJoin ( other . toJavaPairRDD ( ) , partitioner ) <EOL> . toTupleRDD ( )

/**
 * Perform a left outer join of [this] and [other]. For each element (k, v) in [this], the
 * resulting RDD will either contain all pairs (k, (v, Some(w))) for w in [other], or the
 * pair (k, (v, None)) if no elements in [other] have key k. Uses the given Partitioner to
 * partition the output RDD.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . rightOuterJoin ( other : JavaRDD < Tuple2 < K , W > > , partitioner : Partitioner , ) : JavaRDD < Tuple2 < K , Tuple2 < Optional < V > , W > > >

= toJavaPairRDD ( ) <EOL> . rightOuterJoin ( other . toJavaPairRDD ( ) , partitioner ) <EOL> . toTupleRDD ( )

/**
 * Perform a right outer join of [this] and [other]. For each element (k, w) in [other], the
 * resulting RDD will either contain all pairs (k, (Some(v), w)) for v in [this], or the
 * pair (k, (None, w)) if no elements in [this] have key k. Uses the given Partitioner to
 * partition the output RDD.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . fullOuterJoin ( other : JavaRDD < Tuple2 < K , W > > , partitioner : Partitioner , ) : JavaRDD < Tuple2 < K , Tuple2 < Optional < V > , Optional < W > > > >

= toJavaPairRDD ( ) <EOL> . fullOuterJoin ( other . toJavaPairRDD ( ) , partitioner ) <EOL> . toTupleRDD ( )

/**
 * Perform a full outer join of [this] and [other]. For each element (k, v) in [this], the
 * resulting RDD will either contain all pairs (k, (Some(v), Some(w))) for w in [other], or
 * the pair (k, (Some(v), None)) if no elements in [other] have key k. Similarly, for each
 * element (k, w) in [other], the resulting RDD will either contain all pairs
 * (k, (Some(v), Some(w))) for v in [this], or the pair (k, (None, Some(w))) if no elements
 * in [this] have key k. Uses the given Partitioner to partition the output RDD.
 */


fun < K , V , C > JavaRDD < Tuple2 < K , V > > . combineByKey ( createCombiner : ( V ) -> C , mergeValue : ( C , V ) -> C , mergeCombiners : ( C , C ) -> C , ) : JavaRDD < Tuple2 < K , C > >

= toJavaPairRDD ( ) <EOL> . combineByKey ( createCombiner , mergeValue , mergeCombiners ) <EOL> . toTupleRDD ( )

/**
 * Simplified version of combineByKeyWithClassTag that hash-partitions the resulting RDD using the
 * existing partitioner/parallelism level. This method is here for backward compatibility. It
 * does not provide combiner classtag information to the shuffle.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . groupByKey ( ) : JavaRDD < Tuple2 < K , Iterable < V > > >

= <EOL> toJavaPairRDD ( ) <EOL> . groupByKey ( ) <EOL> . toTupleRDD ( )

/**
 * Group the values for each key in the RDD into a single sequence. Hash-partitions the
 * resulting RDD with the existing partitioner/parallelism level. The ordering of elements
 * within each group is not guaranteed, and may even differ each time the resulting RDD is
 * evaluated.
 *
 * Note: This operation may be very expensive. If you are grouping in order to perform an
 * aggregation (such as a sum or average) over each key, using [aggregateByKey]
 * or [reduceByKey] will provide much better performance.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . join ( other : JavaRDD < Tuple2 < K , W > > ) : JavaRDD < Tuple2 < K , Tuple2 < V , W > > >

= <EOL> toJavaPairRDD ( ) <EOL> . join ( other . toJavaPairRDD ( ) ) <EOL> . toTupleRDD ( )

/**
 * Return an RDD containing all pairs of elements with matching keys in [this] and [other]. Each
 * pair of elements will be returned as a (k, (v1, v2)) tuple, where (k, v1) is in [this] and
 * (k, v2) is in [other]. Performs a hash join across the cluster.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . join ( other : JavaRDD < Tuple2 < K , W > > , numPartitions : Int , ) : JavaRDD < Tuple2 < K , Tuple2 < V , W > > >

= <EOL> toJavaPairRDD ( ) <EOL> . join ( other . toJavaPairRDD ( ) , numPartitions ) <EOL> . toTupleRDD ( )


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . leftOuterJoin ( other : JavaRDD < Tuple2 < K , W > > , ) : JavaRDD < Tuple2 < K , Tuple2 < V , Optional < W > > > >

= <EOL> toJavaPairRDD ( ) <EOL> . leftOuterJoin ( other . toJavaPairRDD ( ) ) <EOL> . toTupleRDD ( )

/**
 * Perform a left outer join of [this] and [other]. For each element (k, v) in [this], the
 * resulting RDD will either contain all pairs (k, (v, Some(w))) for w in [other], or the
 * pair (k, (v, None)) if no elements in [other] have key k. Hash-partitions the output
 * using the existing partitioner/parallelism level.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . leftOuterJoin ( other : JavaRDD < Tuple2 < K , W > > , numPartitions : Int , ) : JavaRDD < Tuple2 < K , Tuple2 < V , Optional < W > > > >

= toJavaPairRDD ( ) <EOL> . leftOuterJoin ( other . toJavaPairRDD ( ) , numPartitions ) <EOL> . toTupleRDD ( )

/**
 * Perform a left outer join of [this] and [other]. For each element (k, v) in [this], the
 * resulting RDD will either contain all pairs (k, (v, Some(w))) for w in [other], or the
 * pair (k, (v, None)) if no elements in [other] have key k. Hash-partitions the output
 * into [numPartitions] partitions.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . rightOuterJoin ( other : JavaRDD < Tuple2 < K , W > > , ) : JavaRDD < Tuple2 < K , Tuple2 < Optional < V > , W > > >

= <EOL> toJavaPairRDD ( ) <EOL> . rightOuterJoin ( other . toJavaPairRDD ( ) ) <EOL> . toTupleRDD ( )

/**
 * Perform a right outer join of [this] and [other]. For each element (k, w) in [other], the
 * resulting RDD will either contain all pairs (k, (Some(v), w)) for v in [this], or the
 * pair (k, (None, w)) if no elements in [this] have key k. Hash-partitions the resulting
 * RDD using the existing partitioner/parallelism level.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . rightOuterJoin ( other : JavaRDD < Tuple2 < K , W > > , numPartitions : Int , ) : JavaRDD < Tuple2 < K , Tuple2 < Optional < V > , W > > >

= toJavaPairRDD ( ) <EOL> . rightOuterJoin ( other . toJavaPairRDD ( ) , numPartitions ) <EOL> . toTupleRDD ( )

/**
 * Perform a right outer join of [this] and [other]. For each element (k, w) in [other], the
 * resulting RDD will either contain all pairs (k, (Some(v), w)) for v in [this], or the
 * pair (k, (None, w)) if no elements in [this] have key k. Hash-partitions the resulting
 * RDD into the given number of partitions.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . fullOuterJoin ( other : JavaRDD < Tuple2 < K , W > > , ) : JavaRDD < Tuple2 < K , Tuple2 < Optional < V > , Optional < W > > > >

= <EOL> toJavaPairRDD ( ) <EOL> . fullOuterJoin ( other . toJavaPairRDD ( ) ) <EOL> . toTupleRDD ( )

/**
 * Perform a full outer join of [this] and [other]. For each element (k, v) in [this], the
 * resulting RDD will either contain all pairs (k, (Some(v), Some(w))) for w in [other], or
 * the pair (k, (Some(v), None)) if no elements in [other] have key k. Similarly, for each
 * element (k, w) in [other], the resulting RDD will either contain all pairs
 * (k, (Some(v), Some(w))) for v in [this], or the pair (k, (None, Some(w))) if no elements
 * in [this] have key k. Hash-partitions the resulting RDD using the existing partitioner/
 * parallelism level.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . fullOuterJoin ( other : JavaRDD < Tuple2 < K , W > > , numPartitions : Int , ) : JavaRDD < Tuple2 < K , Tuple2 < Optional < V > , Optional < W > > > >

= <EOL> toJavaPairRDD ( ) <EOL> . fullOuterJoin ( other . toJavaPairRDD ( ) , numPartitions ) <EOL> . toTupleRDD ( )

/**
 * Perform a full outer join of [this] and [other]. For each element (k, v) in [this], the
 * resulting RDD will either contain all pairs (k, (Some(v), Some(w))) for w in [other], or
 * the pair (k, (Some(v), None)) if no elements in [other] have key k. Similarly, for each
 * element (k, w) in [other], the resulting RDD will either contain all pairs
 * (k, (Some(v), Some(w))) for v in [this], or the pair (k, (None, Some(w))) if no elements
 * in [this] have key k. Hash-partitions the resulting RDD into the given number of partitions.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . collectAsMap ( ) : Map < K , V >

= toJavaPairRDD ( ) . collectAsMap ( )

/**
 * Return the key-value pairs in this RDD to the master as a Map.
 *
 * Warning: this doesn't return a multimap (so if you have multiple values to the same key, only
 * one value per key is preserved in the map returned)
 *
 * Note: this method should only be used if the resulting data is expected to be small, as
 * all the data is loaded into the driver's memory.
 */


fun < K , V , U > JavaRDD < Tuple2 < K , V > > . mapKeys ( f : ( K ) -> U ) : JavaRDD < Tuple2 < U , V > >

= <EOL> mapPartitions ( { <EOL> it . map { ( _1 , _2 ) -> <EOL> tupleOf ( f ( _1 ) , _2 ) <EOL> } <EOL> } , true )

/**
 * Pass each key in the key-value pair RDD through a map function without changing the values;
 * this also retains the original RDD's partitioning.
 */


fun < K , V , U > JavaRDD < Tuple2 < K , V > > . mapValues ( f : ( V ) -> U ) : JavaRDD < Tuple2 < K , U > >

= <EOL> toJavaPairRDD ( ) . mapValues ( f ) . toTupleRDD ( )

/**
 * Pass each value in the key-value pair RDD through a map function without changing the keys;
 * this also retains the original RDD's partitioning.
 */


fun < K , V , U > JavaRDD < Tuple2 < K , V > > . flatMapValues ( f : ( V ) -> Iterator < U > ) : JavaRDD < Tuple2 < K , U > >

= <EOL> toJavaPairRDD ( ) . flatMapValues ( f ) . toTupleRDD ( )

/**
 * Pass each value in the key-value pair RDD through a flatMap function without changing the
 * keys; this also retains the original RDD's partitioning.
 */


fun < K , V , W1 , W2 , W3 > JavaRDD < Tuple2 < K , V > > . cogroup ( other1 : JavaRDD < Tuple2 < K , W1 > > , other2 : JavaRDD < Tuple2 < K , W2 > > , other3 : JavaRDD < Tuple2 < K , W3 > > , partitioner : Partitioner , ) : JavaRDD < Tuple2 < K , Tuple4 < Iterable < V > , Iterable < W1 > , Iterable < W2 > , Iterable < W3 > > > >

= <EOL> toJavaPairRDD ( ) . cogroup ( other1 . toJavaPairRDD ( ) , other2 . toJavaPairRDD ( ) , other3 . toJavaPairRDD ( ) , partitioner ) <EOL> . toTupleRDD ( )

/**
 * For each key k in [this] or [other1] or [other2] or [other3],
 * return a resulting RDD that contains a tuple with the list of values
 * for that key in [this], [other1], [other2] and [other3].
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . cogroup ( other : JavaRDD < Tuple2 < K , W > > , partitioner : Partitioner , ) : JavaRDD < Tuple2 < K , Tuple2 < Iterable < V > , Iterable < W > > > >

= toJavaPairRDD ( ) <EOL> . cogroup ( other . toJavaPairRDD ( ) , partitioner ) <EOL> . toTupleRDD ( )

/**
 * For each key k in [this] or [other], return a resulting RDD that contains a tuple with the
 * list of values for that key in [this] as well as [other].
 */


fun < K , V , W1 , W2 > JavaRDD < Tuple2 < K , V > > . cogroup ( other1 : JavaRDD < Tuple2 < K , W1 > > , other2 : JavaRDD < Tuple2 < K , W2 > > , partitioner : Partitioner , ) : JavaRDD < Tuple2 < K , Tuple3 < Iterable < V > , Iterable < W1 > , Iterable < W2 > > > >

= <EOL> toJavaPairRDD ( ) <EOL> . cogroup ( other1 . toJavaPairRDD ( ) , other2 . toJavaPairRDD ( ) , partitioner ) <EOL> . toTupleRDD ( )

/**
 * For each key k in [this] or [other1] or [other2], return a resulting RDD that contains a
 * tuple with the list of values for that key in [this], [other1] and [other2].
 */


fun < K , V , W1 , W2 , W3 > JavaRDD < Tuple2 < K , V > > . cogroup ( other1 : JavaRDD < Tuple2 < K , W1 > > , other2 : JavaRDD < Tuple2 < K , W2 > > , other3 : JavaRDD < Tuple2 < K , W3 > > , ) : JavaRDD < Tuple2 < K , Tuple4 < Iterable < V > , Iterable < W1 > , Iterable < W2 > , Iterable < W3 > > > >

= <EOL> toJavaPairRDD ( ) <EOL> . cogroup ( other1 . toJavaPairRDD ( ) , other2 . toJavaPairRDD ( ) , other3 . toJavaPairRDD ( ) ) <EOL> . toTupleRDD ( )


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . cogroup ( other : JavaRDD < Tuple2 < K , W > > , ) : JavaRDD < Tuple2 < K , Tuple2 < Iterable < V > , Iterable < W > > > >

= <EOL> toJavaPairRDD ( ) . cogroup ( other . toJavaPairRDD ( ) ) . toTupleRDD ( )


fun < K , V , W1 , W2 > JavaRDD < Tuple2 < K , V > > . cogroup ( other1 : JavaRDD < Tuple2 < K , W1 > > , other2 : JavaRDD < Tuple2 < K , W2 > > , ) : JavaRDD < Tuple2 < K , Tuple3 < Iterable < V > , Iterable < W1 > , Iterable < W2 > > > >

= <EOL> toJavaPairRDD ( ) <EOL> . cogroup ( other1 . toJavaPairRDD ( ) , other2 . toJavaPairRDD ( ) ) <EOL> . toTupleRDD ( )


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . cogroup ( other : JavaRDD < Tuple2 < K , W > > , numPartitions : Int , ) : JavaRDD < Tuple2 < K , Tuple2 < Iterable < V > , Iterable < W > > > >

= <EOL> toJavaPairRDD ( ) . cogroup ( other . toJavaPairRDD ( ) , numPartitions ) . toTupleRDD ( )


fun < K , V , W1 , W2 > JavaRDD < Tuple2 < K , V > > . cogroup ( other1 : JavaRDD < Tuple2 < K , W1 > > , other2 : JavaRDD < Tuple2 < K , W2 > > , numPartitions : Int , ) : JavaRDD < Tuple2 < K , Tuple3 < Iterable < V > , Iterable < W1 > , Iterable < W2 > > > >

= <EOL> toJavaPairRDD ( ) <EOL> . cogroup ( other1 . toJavaPairRDD ( ) , other2 . toJavaPairRDD ( ) , numPartitions ) <EOL> . toTupleRDD ( )


fun < K , V , W1 , W2 , W3 > JavaRDD < Tuple2 < K , V > > . cogroup ( other1 : JavaRDD < Tuple2 < K , W1 > > , other2 : JavaRDD < Tuple2 < K , W2 > > , other3 : JavaRDD < Tuple2 < K , W3 > > , numPartitions : Int , ) : JavaRDD < Tuple2 < K , Tuple4 < Iterable < V > , Iterable < W1 > , Iterable < W2 > , Iterable < W3 > > > >

= <EOL> toJavaPairRDD ( ) <EOL> . cogroup ( other1 . toJavaPairRDD ( ) , other2 . toJavaPairRDD ( ) , other3 . toJavaPairRDD ( ) , numPartitions ) <EOL> . toTupleRDD ( )


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . groupWith ( other : JavaRDD < Tuple2 < K , W > > , ) : JavaRDD < Tuple2 < K , Tuple2 < Iterable < V > , Iterable < W > > > >

= <EOL> toJavaPairRDD ( ) . groupWith ( other . toJavaPairRDD ( ) ) . toTupleRDD ( )


fun < K , V , W1 , W2 > JavaRDD < Tuple2 < K , V > > . groupWith ( other1 : JavaRDD < Tuple2 < K , W1 > > , other2 : JavaRDD < Tuple2 < K , W2 > > , ) : JavaRDD < Tuple2 < K , Tuple3 < Iterable < V > , Iterable < W1 > , Iterable < W2 > > > >

= <EOL> toJavaPairRDD ( ) . groupWith ( other1 . toJavaPairRDD ( ) , other2 . toJavaPairRDD ( ) ) . toTupleRDD ( )


fun < K , V , W1 , W2 , W3 > JavaRDD < Tuple2 < K , V > > . groupWith ( other1 : JavaRDD < Tuple2 < K , W1 > > , other2 : JavaRDD < Tuple2 < K , W2 > > , other3 : JavaRDD < Tuple2 < K , W3 > > , ) : JavaRDD < Tuple2 < K , Tuple4 < Iterable < V > , Iterable < W1 > , Iterable < W2 > , Iterable < W3 > > > >

= <EOL> toJavaPairRDD ( ) . groupWith ( other1 . toJavaPairRDD ( ) , other2 . toJavaPairRDD ( ) , other3 . toJavaPairRDD ( ) ) . toTupleRDD ( )


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . subtractByKey ( other : JavaRDD < Tuple2 < K , W > > ) : JavaRDD < Tuple2 < K , V > >

= <EOL> toJavaPairRDD ( ) . subtractByKey ( other . toJavaPairRDD ( ) ) . toTupleRDD ( )

/**
 * Return an RDD with the pairs from [this] whose keys are not in [other].
 *
 * Uses [this] partitioner/partition size, because even if [other] is huge, the resulting
 * RDD will be less than or equal to us.
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . subtractByKey ( other : JavaRDD < Tuple2 < K , W > > , numPartitions : Int , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . subtractByKey ( other . toJavaPairRDD ( ) , numPartitions ) <EOL> . toTupleRDD ( )

/**
 * Return an RDD with the pairs from [this] whose keys are not in [other].
 */


fun < K , V , W > JavaRDD < Tuple2 < K , V > > . subtractByKey ( other : JavaRDD < Tuple2 < K , W > > , p : Partitioner , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . subtractByKey ( other . toJavaPairRDD ( ) , p ) <EOL> . toTupleRDD ( )


fun < K , V > JavaRDD < Tuple2 < K , V > > . lookup ( key : K ) : List < V >

= toJavaPairRDD ( ) . lookup ( key )

/**
 * Return the list of values in the RDD for key [key]. This operation is done efficiently if the
 * RDD has a known partitioner by only searching the partition that the key maps to.
 */


fun < K , V , F : OutputFormat < * , * > > JavaRDD < Tuple2 < K , V > > . saveAsHadoopFile ( path : String , keyClass : Class < * > , valueClass : Class < * > , outputFormatClass : Class < F > , conf : JobConf , ) : Unit

= toJavaPairRDD ( ) . saveAsHadoopFile ( path , keyClass , valueClass , outputFormatClass , conf )

/** Output the RDD to any Hadoop-supported file system. */


fun < K , V , F : OutputFormat < * , * > > JavaRDD < Tuple2 < K , V > > . saveAsHadoopFile ( path : String , keyClass : Class < * > , valueClass : Class < * > , outputFormatClass : Class < F > , ) : Unit

= toJavaPairRDD ( ) . saveAsHadoopFile ( path , keyClass , valueClass , outputFormatClass )


fun < K , V , F : OutputFormat < * , * > > JavaRDD < Tuple2 < K , V > > . saveAsHadoopFile ( path : String , keyClass : Class < * > , valueClass : Class < * > , outputFormatClass : Class < F > , codec : Class < CompressionCodec > , ) : Unit

= toJavaPairRDD ( ) . saveAsHadoopFile ( path , keyClass , valueClass , outputFormatClass , codec )

/** Output the RDD to any Hadoop-supported file system, compressing with the supplied codec. */


fun < K , V , F : NewOutputFormat < * , * > > JavaRDD < Tuple2 < K , V > > . saveAsNewAPIHadoopFile ( path : String , keyClass : Class < * > , valueClass : Class < * > , outputFormatClass : Class < F > , conf : Configuration , ) : Unit

= toJavaPairRDD ( ) . saveAsNewAPIHadoopFile ( path , keyClass , valueClass , outputFormatClass , conf )


fun < K , V > JavaRDD < Tuple2 < K , V > > . saveAsNewAPIHadoopDataset ( conf : Configuration ) : Unit

= <EOL> toJavaPairRDD ( ) . saveAsNewAPIHadoopDataset ( conf )

/**
 * Output the RDD to any Hadoop-supported storage system, using
 * a Configuration object for that storage system.
 */


fun < K , V , F : NewOutputFormat < * , * > > JavaRDD < Tuple2 < K , V > > . saveAsNewAPIHadoopFile ( path : String , keyClass : Class < * > , valueClass : Class < * > , outputFormatClass : Class < F > , ) : Unit

= toJavaPairRDD ( ) . saveAsNewAPIHadoopFile ( path , keyClass , valueClass , outputFormatClass )


fun < K , V > JavaRDD < Tuple2 < K , V > > . saveAsHadoopDataset ( conf : JobConf ) : Unit

= <EOL> toJavaPairRDD ( ) . saveAsHadoopDataset ( conf )

/**
 * Output the RDD to any Hadoop-supported storage system, using a Hadoop JobConf object for
 * that storage system. The JobConf should set an OutputFormat and any output paths required
 * (e.g. a table name to write to) in the same way as it would be configured for a Hadoop
 * MapReduce job.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . repartitionAndSortWithinPartitions ( partitioner : Partitioner ) : JavaRDD < Tuple2 < K , V > >

= <EOL> toJavaPairRDD ( ) . repartitionAndSortWithinPartitions ( partitioner ) . toTupleRDD ( )

/**
 * Repartition the RDD according to the given partitioner and, within each resulting partition,
 * sort records by their keys.
 *
 * This is more efficient than calling [JavaRDD.repartition] and then sorting within each partition
 * because it can push the sorting down into the shuffle machinery.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . repartitionAndSortWithinPartitions ( partitioner : Partitioner , comp : Comparator < K > , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) . repartitionAndSortWithinPartitions ( partitioner , comp ) . toTupleRDD ( )


fun < K , V > JavaRDD < Tuple2 < K , V > > . sortByKey ( ascending : Boolean = true ) : JavaRDD < Tuple2 < K , V > >

= <EOL> toJavaPairRDD ( ) . sortByKey ( ascending ) . toTupleRDD ( )

/**
 * Sort the RDD by key, so that each partition contains a sorted range of the elements. Calling
 * [JavaRDD.collect] or `save` on the resulting RDD will return or output an ordered list of records
 * (in the `save` case, they will be written to multiple `part-X` files in the filesystem, in
 * order of the keys).
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . sortByKey ( ascending : Boolean , numPartitions : Int ) : JavaRDD < Tuple2 < K , V > >

= <EOL> toJavaPairRDD ( ) . sortByKey ( ascending , numPartitions ) . toTupleRDD ( )


fun < K , V > JavaRDD < Tuple2 < K , V > > . sortByKey ( comp : Comparator < K > , ascending : Boolean = true ) : JavaRDD < Tuple2 < K , V > >

= <EOL> toJavaPairRDD ( ) . sortByKey ( comp , ascending ) . toTupleRDD ( )


fun < K , V > JavaRDD < Tuple2 < K , V > > . sortByKey ( comp : Comparator < K > , ascending : Boolean , numPartitions : Int , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) . sortByKey ( comp , ascending , numPartitions ) . toTupleRDD ( )


fun < K , V > JavaRDD < Tuple2 < K , V > > . filterByRange ( lower : K , upper : K ) : JavaRDD < Tuple2 < K , V > >

= <EOL> toJavaPairRDD ( ) . filterByRange ( lower , upper ) . toTupleRDD ( )

/**
 * Return a RDD containing only the elements in the inclusive range [lower] to [upper].
 * If the RDD has been partitioned using a [RangePartitioner], then this operation can be
 * performed efficiently by only scanning the partitions that might contain matching elements.
 * Otherwise, a standard [filter] is applied to all partitions.
 *
 * @since 3.1.0
 */


fun < K : Comparable < K > , V > JavaRDD < Tuple2 < K , V > > . filterByRange ( range : ClosedRange < K > ) : JavaRDD < Tuple2 < K , V > >

= <EOL> filterByRange ( range . start , range . endInclusive )

/**
 * Return a RDD containing only the elements in the range [range].
 * If the RDD has been partitioned using a [RangePartitioner], then this operation can be
 * performed efficiently by only scanning the partitions that might contain matching elements.
 * Otherwise, a standard [filter] is applied to all partitions.
 *
 * @since 3.1.0
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . filterByRange ( comp : Comparator < K > , lower : K , upper : K , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . filterByRange ( comp , lower , upper ) <EOL> . toTupleRDD ( )


fun < K : Comparable < K > , V > JavaRDD < Tuple2 < K , V > > . filterByRange ( comp : Comparator < K > , range : ClosedRange < K > , ) : JavaRDD < Tuple2 < K , V > >

= toJavaPairRDD ( ) <EOL> . filterByRange ( comp , range . start , range . endInclusive ) <EOL> . toTupleRDD ( )

/**
 * Return a RDD containing only the elements in the inclusive range [range].
 * If the RDD has been partitioned using a [RangePartitioner], then this operation can be
 * performed efficiently by only scanning the partitions that might contain matching elements.
 * Otherwise, a standard [filter] is applied to all partitions.
 *
 * @since 3.1.0
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . keys ( ) : JavaRDD < K >

= toJavaPairRDD ( ) . keys ( )

/**
 * Return an RDD with the keys of each tuple.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . values ( ) : JavaRDD < V >

= toJavaPairRDD ( ) . values ( )

/**
 * Return an RDD with the values of each tuple.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . countApproxDistinctByKey ( relativeSD : Double , partitioner : Partitioner , ) : JavaRDD < Tuple2 < K , Long > >

= toJavaPairRDD ( ) . countApproxDistinctByKey ( relativeSD , partitioner ) . toTupleRDD ( )

/**
 * Return approximate number of distinct values for each key in this RDD.
 *
 * The algorithm used is based on streamlib's implementation of "HyperLogLog in Practice:
 * Algorithmic Engineering of a State of The Art Cardinality Estimation Algorithm", available
 * here.
 *
 * @param relativeSD Relative accuracy. Smaller values create counters that require more space.
 * It must be greater than 0.000017.
 * @param partitioner partitioner of the resulting RDD.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . countApproxDistinctByKey ( relativeSD : Double , numPartitions : Int , ) : JavaRDD < Tuple2 < K , Long > >

= toJavaPairRDD ( ) . countApproxDistinctByKey ( relativeSD , numPartitions ) . toTupleRDD ( )

/**
 * Return approximate number of distinct values for each key in this RDD.
 *
 * The algorithm used is based on streamlib's implementation of "HyperLogLog in Practice:
 * Algorithmic Engineering of a State of The Art Cardinality Estimation Algorithm", available
 * [here](https://doi.org/10.1145/2452376.2452456).
 *
 * @param relativeSD Relative accuracy. Smaller values create counters that require more space.
 * It must be greater than 0.000017.
 * @param numPartitions number of partitions of the resulting RDD.
 */


fun < K , V > JavaRDD < Tuple2 < K , V > > . countApproxDistinctByKey ( relativeSD : Double ) : JavaRDD < Tuple2 < K , Long > >

= <EOL> toJavaPairRDD ( ) . countApproxDistinctByKey ( relativeSD ) . toTupleRDD ( )

/**
 * Return approximate number of distinct values for each key in this RDD.
 *
 * The algorithm used is based on streamlib's implementation of "HyperLogLog in Practice:
 * Algorithmic Engineering of a State of The Art Cardinality Estimation Algorithm", available
 * [here](https://doi.org/10.1145/2452376.2452456).
 *
 * @param relativeSD Relative accuracy. Smaller values create counters that require more space.
 * It must be greater than 0.000017.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline operator fun < V > KProperty0 < V > . getValue ( thisRef : Any ? , property : KProperty < * > ) : V

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

/**
 * An extension operator that allows delegating a read-only property of type [V]
 * to a property reference to a property of type [V] or its subtype.
 *
 * @receiver A property reference to a read-only or mutable property of type [V] or its subtype.
 * The reference is without a receiver, i.e. it either references a top-level property or
 * has the receiver bound to it.
 *
 * Example:
 *
 * ```
 * class Login(val username: String)
 * val defaultLogin = Login("Admin")
 * val defaultUsername by defaultLogin::username
 * // equivalent to
 * val defaultUserName get() = defaultLogin.username
 * ```
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline operator fun < V > KMutableProperty0 < V > . setValue ( thisRef : Any ? , property : KProperty < * > , value : V )

{ <EOL> set ( value ) <EOL> }

/**
 * An extension operator that allows delegating a mutable property of type [V]
 * to a property reference to a mutable property of the same type [V].
 *
 * @receiver A property reference to a mutable property of type [V].
 * The reference is without a receiver, i.e. it either references a top-level property or
 * has the receiver bound to it.
 *
 * Example:
 *
 * ```
 * class Login(val username: String, var incorrectAttemptCounter: Int = 0)
 * val defaultLogin = Login("Admin")
 * var defaultLoginAttempts by defaultLogin::incorrectAttemptCounter
 * // equivalent to
 * var defaultLoginAttempts: Int
 * get() = defaultLogin.incorrectAttemptCounter
 * set(value) { defaultLogin.incorrectAttemptCounter = value }
 * ```
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline operator fun < T , V > KProperty1 < T , V > . getValue ( thisRef : T , property : KProperty < * > ) : V

{ <EOL> return get ( thisRef ) <EOL> }

/**
 * An extension operator that allows delegating a read-only member or extension property of type [V]
 * to a property reference to a member or extension property of type [V] or its subtype.
 *
 * @receiver A property reference to a read-only or mutable property of type [V] or its subtype.
 * The reference has an unbound receiver of type [T].
 *
 * Example:
 *
 * ```
 * class Login(val username: String)
 * val Login.user by Login::username
 * // equivalent to
 * val Login.user get() = this.username
 * ```
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline operator fun < T , V > KMutableProperty1 < T , V > . setValue ( thisRef : T , property : KProperty < * > , value : V )

{ <EOL> set ( thisRef , value ) <EOL> }

/**
 * An extension operator that allows delegating a mutable member or extension property of type [V]
 * to a property reference to a member or extension mutable property of the same type [V].
 *
 * @receiver A property reference to a read-only or mutable property of type [V] or its subtype.
 * The reference has an unbound receiver of type [T].
 *
 * Example:
 *
 * ```
 * class Login(val username: String, var incorrectAttemptCounter: Int)
 * var Login.attempts by Login::incorrectAttemptCounter
 * // equivalent to
 * var Login.attempts: Int
 * get() = this.incorrectAttemptCounter
 * set(value) { this.incorrectAttemptCounter = value }
 * ```
 */


fun Project . configureCommonPublicationSettingsForGradle ( signingRequired : Boolean , sbom : Boolean = true , )

{ <EOL> plugins . withId ( "<STR_LIT>" ) { <EOL> extensions . configure < PublishingExtension > { <EOL> publications <EOL> . withType < MavenPublication > ( ) <EOL> . configureEach { <EOL> configureKotlinPomAttributes ( project ) <EOL> if ( sbom && project . name !in internalPlugins ) { <EOL> if ( name == "<STR_LIT>" ) { <EOL> val sbomTask = configureSbom ( target = "<STR_LIT>" ) <EOL> artifact ( sbomTask ) { <EOL> extension = "<STR_LIT>" <EOL> builtBy ( sbomTask ) <EOL> } <EOL> } else if ( name == "<STR_LIT>" ) { <EOL> val sbomTask = configureSbom ( ) <EOL> artifact ( sbomTask ) { <EOL> extension = "<STR_LIT>" <EOL> builtBy ( sbomTask ) <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> configureDefaultPublishing ( signingRequired ) <EOL> }

/**
 * Configures common pom configuration parameters
 */


fun Configuration . excludeGradleCommonDependencies ( )

{ <EOL> dependencies <EOL> . withType < ModuleDependency > ( ) <EOL> . configureEach { <EOL> exclude ( group = "<STR_LIT>" , module = "<STR_LIT>" ) <EOL> exclude ( group = "<STR_LIT>" , module = "<STR_LIT>" ) <EOL> exclude ( group = "<STR_LIT>" , module = "<STR_LIT>" ) <EOL> exclude ( group = "<STR_LIT>" , module = "<STR_LIT>" ) <EOL> exclude ( group = "<STR_LIT>" , module = "<STR_LIT>" ) <EOL> exclude ( group = "<STR_LIT>" , module = "<STR_LIT>" ) <EOL> } <EOL> }

/**
 * These dependencies will be provided by Gradle, and we should prevent version conflict
 */


fun Project . excludeGradleCommonDependencies ( sourceSet : SourceSet )

{ <EOL> configurations [ sourceSet . implementationConfigurationName ] . excludeGradleCommonDependencies ( ) <EOL> configurations [ sourceSet . apiConfigurationName ] . excludeGradleCommonDependencies ( ) <EOL> configurations [ sourceSet . runtimeOnlyConfigurationName ] . excludeGradleCommonDependencies ( ) <EOL> }

/**
 * Exclude Gradle runtime from given SourceSet configurations.
 */