## dist_cpan-HANENKAMP-HTTP-Request-FormData.md
# NAME

HTTP::Request::FormData - handler to expedite the handling of multipart/form-data requests

# SYNOPSIS

```
use HTTP::UserAgent;
use HTTP::Request::Common;

my $ua = HTTP::UserAgent.new;

my $fd = HTTP::Request::FormData.new;
$fd.add-part('username', 'alice');
$fd.add-part('avatar', 'alice.png'.IO, content-type => 'image/png');

my $req = POST(
    'http://example.com/',
    Content-Type => $fd.content-type,
    content => $fd.content,
);

my $res = $ua.request($req);

```

# DESCRIPTION

This provides a structured object for use with [HTTP::Request](http::Request) that serializes into a nice neat content buffer.

I wrote this as an expedient work-around to some encoding issues I have with the way [HTTP::Request](http::Request) works. This may be a better way to solve that problem than the API ported form LWP in Perl 5, but I am not making a judgement in that regard. I was merely attempting to expedite a solution and sharing it with the hope that it might be useful to someone else as well.

That said, this module aims at correctly rendering multipart/form-data content according to the specification laid out in RFC 7578.

# METHODS

## method new

```
multi method new() returns HTTP::Request::FormData:D

```

Constructs a new, empty form data object.

## method add-part

```
multi method add-part(Str:D $name, IO::Path $file, Str :$content-type, Str :$filename)
multi method add-part(Str:D $name, IO::Handle $file, Str :$content-type, Str :$filename)
multi method add-part(Str:D $name, $value, Str :$content-type, Str :$filename)

```

These methods append a new part to the end of the object. Three methods of adding parts are provided.

Passing an IO::Path will result in the given file being slurped automatically. The part will be read as binary data unless you specify a `$content-type` that starts with "text/".

Similarly, an IO::Handle may be passed and the contents will be slurped from here as well. This allows you control over whether to set the binary flag or not yourself.

Finally, you can pass an explicit value, which can be pretty much any string, blob, or other cool value you like.

In each case, you can specify the `$filename` to use for that part. Note that the `$filename` will be inferred from the given path if an IO::Path is passed.

## method parts

```
method parts() returns Seq:D

```

Returns a <Seq> of the parts. Each part is returned as a HTTP::Request::FormData::Part object, which provides the following accessors:

* * `name` This is the name of the part.
* * `filename` This is the filename of the part (if it is a file).
* * `content-type` This is the content type to use (if any).
* * `value` This is the value that was set when the part was added.
* * `content` This is the content that will be rendered with the part (derived from the `value` with headers at the top).

## method boundary

```
method boundary() returns Str:D

```

This is an accessor that allows you to see what the boundary will be used to separate the parts when rendered. This boundary meets the requirements of RFC 7578, which stipulates that the boundary must not be found in the content contained within any of the parts. This means that if you add a new part, the boundary may have to change.

For this reason, the `add-part` method will throw an exception if you attempt to add a part after calling this method to select a boundary.

## method content-type

```
method content-type() returns Str:D

```

This is a handy helper for generating a MIME type with the boundary parameter like this:

```
use HTTP::Request::Common;

my $fd = HTTP::Request::FormData.new;
$fd.add-part('name', 'alice');

my $req = POST(
    'http://example.com/',
    Content-Type => $fd.content-type,
    content => $fd.content,
);

```

It is essentially equivalent to:

```
qq<multipart/formdata; boundary=$fd.boundary()>

```

As this calls `boundary()`, calls to `add-part` will throw an exception after the first call to this method is made.

## method content

```
method content() returns Blob:D

```

This will return the serialized data associated with this form data object. Each part will have it's headers and content rendered in order and separated by the boundary as specified in RFC 7578.


## rmdir.md
rmdir

Combined from primary sources listed below.

# [In IO::Path](#___top "go to top of document")[§](#(IO::Path)_routine_rmdir "direct link")

See primary documentation
[in context](/type/IO/Path#routine_rmdir)
for **routine rmdir**.

```raku
sub    rmdir(*@dirs --> List:D)
method rmdir(IO::Path:D: --> True)
```

Remove the invocant, or in sub form, all of the provided directories in the given list, which can contain any [`Cool`](/type/Cool) object. Only works on empty directories.

Method form returns `True` on success and returns a [`Failure`](/type/Failure) of type [`X::IO::Rmdir`](/type/X/IO/Rmdir) if the directory cannot be removed (e.g. the directory is not empty, or the path is not a directory). Subroutine form returns a list of directories that were successfully deleted.

To delete non-empty directory, see [rmtree in `File::Directory::Tree` module](https://github.com/labster/p6-file-directory-tree).


## dist_zef-raku-community-modules-Test-Class.md
[![Actions Status](https://github.com/raku-community-modules/Test-Class/workflows/test/badge.svg)](https://github.com/raku-community-modules/Test-Class/actions)

# NAME

Test::Class - Raku version of Perl's Test::Class

# SYNOPSIS

```
use Dest::Class;

```

# DESCRIPTION

Some people at work are enamored of Perl's Test::Class, so I thought I'd have a look at it. This module is an attempt to recreate much of the same functionality for Raku.

There are no docs yet. See the programs in examples/ for how to use it.

Random things that come to mind though:

* * this Test::Class is a role that you can compose into your own classes
* * Instead of running Test::Class.run-tests, you execute YourClass.run-tests or Test::Class.run-tests(YourClass)
* * where in Perl you'd say "sub foo : Test", here you'd say "method foo is test"
* * instead of ": Test(no\_plan)", you say "is test(\*)" or "is tests"
* * this Test::Class will also export the Test routines so that you don't have to (i.e., in Perl you'd need to say "use Test::Class; use Test::More;" if you wanted to use the is(), ok(), etc. routines. For this version of Test::Class, you just say "use Test::Class;" and you've automatically got those routines in your lexical scope)

# AUTHOR

Jonathan Scott Duff

# COPYRIGHT AND LICENSE

Copyright 2015 - 2017 Jonathan Scott Duff

Copyright 2018 - 2022 Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-jnthn-Spreadsheet-XLSX.md
# Spreadsheet::XLSX

A Raku module for working with Excel spreadsheets (XLSX format), both
reading existing files, creating new files, or modifying existing files
and saving the changes. Of note, it:

* Knows how to lazily load sheet content, so if you don't look at a sheet
  then time won't be spent deserializing it (down to a cell level, even)
* In the modification scenario, tries to leave as much intact as it can,
  meaning that it's possible to poke data into a sheet more complex than
  could be produced by the module from scratch
* Only depends on the Raku LibXML and Libarchive modules (and their
  respective native dependencies)

This module is currently in development, and supports the subset of XLSX
format features that were immediately needed for the use-case it was built
for. That isn't so much, for now, but it will handle the most common needs:

* Enumerating worksheets
* Reading text and numbers from cells on a worksheet
* Creating new workbooks with worksheets with text and number cells
* Setting basic styles and number formats on cells in newly created
  worksheets
* Reading a workbook, making modifications, and saving it again
* Reading and writing column properties (such as column width)

## Synopsis

### Reading existing workbooks

```
use Spreadsheet::XLSX;

# Read a workbook from an existing file (can pass IO::Path or a
# Blob in the case it was uploaded).
my $workbook = Spreadsheet::XLSX.load('accounts.xlsx');

# Get worksheets.
say "Workbook has {$workbook.worksheets.elems} sheets";

# Get the name of a worksheet.
say $workbook.worksheets.name;

# Get cell values (indexing is zero-based, done as a multi-dimensional array
# indexing operation [row ; column].
my $cells = $workbook.worksheets[0].cells;
say .value with $cells[0;0];      # A1
say .value with $cells[0;1];      # B1
say .value with $cells[1;0];      # A2
say .value with $cells[1;1];      # B2

```

### Creating new workbooks

```
use Spreadsheet::XLSX;

# Create a new workbook and add some worksheets to it.
my $workbook = Spreadsheet::XLSX.new;
my $sheet-a = $workbook.create-worksheet('Ingredients');
my $sheet-b = $workbook.create-worksheet('Matching Drinks');

# Put some data into a worksheet and style it. This is how the model
# actually works (useful if you want to add styles later).
$sheet-a.cells[0;0] = Spreadsheet::XLSX::Cell::Text.new(value => 'Ingredient');
$sheet-a.cells[0;0].style.bold = True;
$sheet-a.cells[0;1] = Spreadsheet::XLSX::Cell::Text.new(value => 'Quantity');
$sheet-a.cells[0;1].style.bold = True;
$sheet-a.cells[1;0] = Spreadsheet::XLSX::Cell::Text.new(value => 'Eggs');
$sheet-a.cells[1;1] = Spreadsheet::XLSX::Cell::Number.new(value => 6);
$sheet-a.cells[1;1].style.number-format = '#,###';

# However, there is a convenience form too.
$sheet-a.set(0, 0, 'Ingredient', :bold);
$sheet-a.set(0, 1, 'Quantity', :bold);
$sheet-a.set(1, 0, 'Eggs');
$sheet-a.set(1, 1, 6, :number-format('#,###'));

# Save it to a file (string or IO::Path name).
$workbook.save("foo.xlsx");

# Or get it as a blob, e.g. for a HTTP response.
my $blob = $workbook.to-blob();

```

## Credits

Thanks goes to [Agrammon](https://agrammon.ch/) for making the development of
this module possible. If you need further development on the module and are
willing to fund it (or other Raku ecosystem work), you can get in contact with
[Edument](https://www.edument.se/en) or [Oetiker+Partner](https://www.oetiker.ch/en/).


## dist_zef-lizmat-DirHandle.md
[![Actions Status](https://github.com/lizmat/DirHandle/actions/workflows/linux.yml/badge.svg)](https://github.com/lizmat/DirHandle/actions) [![Actions Status](https://github.com/lizmat/DirHandle/actions/workflows/macos.yml/badge.svg)](https://github.com/lizmat/DirHandle/actions) [![Actions Status](https://github.com/lizmat/DirHandle/actions/workflows/windows.yml/badge.svg)](https://github.com/lizmat/DirHandle/actions)

# NAME

Raku port of Perl's DirHandle module

# SYNOPSIS

```
use DirHandle;
with Dirhandle.new(".") -> $d {
    while $d.read -> $entry { something($entry) }
    $d->rewind;
    while $d.read(Mu) { something_else($_) }
    $d.close;
}

```

# DESCRIPTION

This module tries to mimic the behaviour of Perl's `DirHandle` module as closely as possible in the Raku Programming Language.

The DirHandle object provides an alternative interface to the `opendir`, `closedir`, `readdir`, `telldir`, `seekdir` and `rewinddir` functions.

The only objective benefit to using DirHandle is that it avoids namespace pollution.

# PORTING CAVEATS

## Handling void context

Since Raku does not have a concept like void context, one needs to specify `Mu` as the only positional parameter with `read` to mimic the behaviour of `DirHandle.read` of Perl in void context.

Please note that due to optimizations in Raku from version `6.d` onwards, it is no longer possible to (always) assign to `$_` in the caller's scope. So this either locks your code into `6.c`, or you will need to change your code to do explicit assignment with the `read` method.

## Extra methods

The Perl version of `DirHandle` for some mysterious reason does not contain methods for performing a `telldir` or a `seekdir`. The Raku version **does** contain equivalent methods `tell` and `seek`.

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

Source can be located at: <https://github.com/lizmat/DirHandle> . Comments and Pull Requests are welcome.

# COPYRIGHT AND LICENSE

Copyright 2018, 2019, 2020, 2021, 2023, 2024 Elizabeth Mattijsen

Re-imagined from Perl as part of the CPAN Butterfly Plan.

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## copy.md
copy

Combined from primary sources listed below.

# [In Parameter](#___top "go to top of document")[§](#(Parameter)_method_copy "direct link")

See primary documentation
[in context](/type/Parameter#method_copy)
for **method copy**.

```raku
method copy(Parameter:D: --> Bool:D)
```

Returns `True` for [`is copy`](/language/signatures#Parameter_traits_and_modifiers) parameters.

```raku
my Signature $sig = :(Str $x, Bool :$is-named is copy);
say $sig.params[0].copy;                           # OUTPUT: «False␤»
say $sig.params[1].copy;                           # OUTPUT: «True␤»
```

# [In IO::Path](#___top "go to top of document")[§](#(IO::Path)_routine_copy "direct link")

See primary documentation
[in context](/type/IO/Path#routine_copy)
for **routine copy**.

```raku
method copy(IO::Path:D: IO() $to, :$createonly --> Bool:D)
sub    copy(IO() $from, IO() $to, :$createonly --> Bool:D)
```

Copies a file. Returns `True` on success; [fails](/routine/fail) with [`X::IO::Copy`](/type/X/IO/Copy) if `:$createonly` is `True` and the `$to` path already exists or if the operation failed for some other reason, such as when `$to` and `$from` are the same file.


## dist_cpan-KAIEPI-Kind.md
[![Build Status](https://travis-ci.com/Kaiepi/p6-Kind.svg?branch=master)](https://travis-ci.com/Kaiepi/p6-Kind)

# NAME

Kind - Typechecking based on kinds

# SYNOPSIS

```
use Kind;

my constant Class = Kind[Metamodel::ClassHOW];

proto sub is-class(Mu --> Bool:D)             {*}
multi sub is-class(Mu $ where Class --> True) { }
multi sub is-class(Mu --> False)              { }

say Str.&is-class;  # OUTPUT: True
say Blob.&is-class; # OUTPUT: False

```

# DESCRIPTION

Kind is an uninstantiable parametric type that can be used to typecheck values based off their kind. If parameterized, it may be used in a `where` clause or on the right-hand side of a smartmatch to typecheck a value's HOW against its type parameter.

Kind is documented. You can view the documentation for it and its methods at any time using `WHY`.

For examples of how to use Kind with any of Rakudo's kinds, see `t/01-kind.t`.

# METAMETHODS

## method parameterize

```
method ^parameterize(Kind:U $this is raw, Mu \K --> Kind:U) { }

```

Mixes in `kind` and `ACCEPTS` methods. See below.

Some useful values with which to parameterize Kind are:

* a metaclass or metarole

```
# Smartmatches any class.
Kind[Metamodel::ClassHOW]

```

* a junction of metaclasses or metaroles

```
# Smartmatches any type that supports naming, versioning, and documenting.
Kind[Metamodel::Naming & Metamodel::Versioning & Metamodel::Documenting]

```

* a block

```
# Smartmatches any parametric type.
Kind[{ use nqp; nqp::hllbool(nqp::can($_, 'parameterize')) }]

```

* a metaobject

```
# This class' metamethods ensure they can only be called with itself or its
# subclasses.
class Configurable {
    my Map:D %CONFIGURATIONS{ObjAt:D};

    method ^configure(Configurable:_ $this where Kind[self], %configuration --> Map:D) {
        %CONFIGURATIONS{$this.WHAT.WHICH} := %configuration.Map
    }
    method ^configuration(Configurable:_ $this where Kind[self] --> Map:D) {
        %CONFIGURATIONS{$this.WHAT.WHICH} // Map.new
    }
}

```

# METHODS

## method ACCEPTS

```
method ACCEPTS(Kind:U: Mu $checker is raw) { }

```

Returns `True` if the HOW of `$checker` typechecks against `Kind`'s type parameter, otherwise returns `False`.

If `Kind`'s type parameter has an `ACCEPTS` method, this will smartmatch the HOW of `$checker` against it; otherwise, `Metamodel::Primitives.is_type` will be called with `$checker`'s HOW and it. Most of the time, the former will be the case; the latter behaviour exists because it's not guaranteed `K` will actually have `Mu`'s methods (this is case with Rakudo's metaroles).

## method kind

```
method kind(Kind:U: --> Mu) { }

```

Returns `Kind`'s type parameter.

# AUTHOR

Ben Davies (Kaiepi)

# COPYRIGHT AND LICENSE

Copyright 2020 Ben Davies

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_cpan-ALOREN-pack6.md
An tools can easily create CPAN tarball for you!

# Usage:

```
pack6 [module@*] [OPTIONs]

```

## Example

```
pack6 . -md -ex .idea -ex raku-pack6.iml

```

This command will create a tarball for pack6.

## Options

* `-d`

  ```
  Print debug message

  ```
* `-ex=<array>`

  ```
  Exclude file from module source, in default are .precomp and .git.

  ```
* `-h`

  ```
  Print the help message.

  ```
* `-md`

  ```
  Require module CPAN::Convert wrap the &*pack6-hook, convert all the asciidoc to markdown.

  ```
* `-out=<string>`

  ```
  Set the pack output directory, in default is current directory.

  ```
* `-pp=<array>`

  ```
  User can create a module like CPAN::Convert hook the &*pack6-hook.
  Pack6 will call &*pack6-hook on output directory, in default do nothing.

  ```
* `-v`

  ```
  Print the version information.

  ```
* `-ver=<string>`

  ```
  Using ver instead of version info in META6.json.

  ```

# Installation

* install with zef

  ```
  zef install pack6

  ```

# Lincese

The MIT License (MIT).


## dist_cpan-FRITH-Math-Libgsl-Statistics.md
[![Actions Status](https://github.com/frithnanth/raku-Math-Libgsl-Statistics/workflows/test/badge.svg)](https://github.com/frithnanth/raku-Math-Libgsl-Statistics/actions)

# NAME

Math::Libgsl::Statistics - An interface to libgsl, the Gnu Scientific Library - Statistics

# SYNOPSIS

```
use Math::Libgsl::Statistics;

my @data = ^10;
say "mean = { mean(@data) }, variance = { variance(@data) }";

```

# DESCRIPTION

Math::Libgsl::Statistics is an interface to the Statistics functions of libgsl, the Gnu Scientific Library.

The functions in this module come in 10 data types:

* Math::Libgsl::Statistics (default: num64)
* Math::Libgsl::Statistics::Num32
* Math::Libgsl::Statistics::Int8
* Math::Libgsl::Statistics::Int16
* Math::Libgsl::Statistics::Int32
* Math::Libgsl::Statistics::Int64
* Math::Libgsl::Statistics::UInt8
* Math::Libgsl::Statistics::UInt16
* Math::Libgsl::Statistics::UInt32
* Math::Libgsl::Statistics::UInt64

All the following functions are available for the classes correspondig to each datatype, except where noted.

### mean(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the arithmetic mean of @data.

### variance(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the estimated variance of @data. This function computes the mean, if you already computed the mean, use the next function.

### variance-m(@data!, Num() $mean!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride)

This function returns the sample variance of @data relative to the given value of $mean.

### sd(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the estimated standard deviation of @data.

### sd-m(@data!, Num() $mean!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the sample standard deviation of @data relative to the given value of $mean.

### tss(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

These functions return the total sum of squares (TSS) of @data.

### tss-m(@data!, Num() $mean!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

These functions return the total sum of squares (TSS) of @data relative to the given value of $mean.

### variance-with-fixed-mean(@data!, Num() $mean!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes an unbiased estimate of the variance of @data when the population mean $mean of the underlying distribution is known a priori.

### sd-with-fixed-mean(@data!, Num() $mean!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function calculates the standard deviation of @data for a fixed population mean $mean.

### absdev(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the absolute deviation from the mean of @data.

### absdev-m(@data!, Num() $mean!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the absolute deviation of the dataset @data relative to the given value of $mean.

### skew(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the skewness of @data.

### skew-m-sd(@data!, Num() $mean!, Num() $sd!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the skewness of the dataset @data using the given values of the mean $mean and standard deviation $sd,

### kurtosis(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the kurtosis of @data.

### kurtosis-m-sd(@data!, Num() $mean!, Num() $sd!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the kurtosis of the dataset @data using the given values of the mean $mean and standard deviation $sd,

### autocorrelation(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the lag-1 autocorrelation of the dataset @data.

### autocorrelation-m(@data!, Num() $mean!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the lag-1 autocorrelation of the dataset @data using the given value of the mean $mean.

### covariance(@data1!, @data2! where \*.elems == @data1.elems, Int() :$stride1? = 1, Int() :$stride2? = 1, Int() :$n? = (@data1.elems / $stride1).Int --> Num)

This function computes the covariance of the datasets @data1 and @data2.

### covariance-m(@data1!, @data2! where \*.elems == @data1.elems, Num() $mean1!, Num() $mean2!, Int() :$stride1? = 1, Int() :$stride2? = 1, Int() :$n? = (@data1.elems / $stride1).Int --> Num)

This function computes the covariance of the datasets @data1 and @data2 using the given values of the means, $mean1 and $mean2.

### correlation(@data1!, @data2! where \*.elems == @data1.elems, Int() :$stride1? = 1, Int() :$stride2? = 1, Int() :$n? = (@data1.elems / $stride1).Int --> Num)

This function efficiently computes the Pearson correlation coefficient between the datasets @data1 and @data2.

### spearman(@data1!, @data2! where \*.elems == @data1.elems, Int() :$stride1? = 1, Int() :$stride2? = 1, Int() :$n? = (@data1.elems / $stride1).Int --> Num)

This function computes the Spearman rank correlation coefficient between the datasets @data1 and @data2.

### wmean(@w!, @data!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the weighted mean of the dataset @data using the set of weights @w. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wvariance(@w!, @data!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the estimated variance of the dataset @data using the set of weights @w. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wvariance-m(@w!, @data!, Num() $wmean!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the estimated variance of the weighted dataset @data using the given weighted mean $wmean. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wsd(@w!, @data!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the standard deviation of the weighted dataset @data. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wsd-m(@w!, @data!, Num() $wmean!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the standard deviation of the weighted dataset @data using the given weighted mean $wmean. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wvariance-with-fixed-mean(@w!, @data!, Num() $mean!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes an unbiased estimate of the variance of the weighted dataset @data when the population mean $mean of the underlying distribution is known a priori. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wsd-with-fixed-mean(@w!, @data!, Num() $mean!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes an unbiased estimate of the standard deviation of the weighted dataset @data when the population mean $mean of the underlying distribution is known a priori. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wtss(@w!, @data!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

These functions return the weighted total sum of squares (TSS) of @data. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wtss-m(@w!, @data!, Num() $wmean!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

These functions return the weighted total sum of squares (TSS) of @data when the population mean $mean of the underlying distribution is known a priori. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wabsdev(@w!, @data!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the weighted absolute deviation from the weighted mean of @data. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wabsdev-m(@w!, @data!, Num() $wmean!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the absolute deviation of the weighted dataset @data about the given weighted mean $wmean. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wskew(@w!, @data!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the weighted skewness of the dataset @data. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wskew-m-sd(@w!, @data!, Num() $wmean!, Num() $wsd!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the weighted skewness of the dataset @data using the given values of the weighted mean and weighted standard deviation, $wmean and $wsd. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wkurtosis(@w!, @data!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the weighted kurtosis of the dataset @data. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### wkurtosis-m-sd(@w!, @data!, Num() $wmean!, Num() $wsd!, Int() :$wstride? = 1, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function computes the weighted kurtosis of the dataset @data using the given values of the weighted mean and weighted standard deviation, $wmean and $wsd. This function is available only for Numeric types, so only when using Math::Libgsl::Statistics or Math::Libgsl::Statistics::Num32.

### smax(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the maximum value in @data.

### smin(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the minimum value in @data.

### sminmax(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> List)

This function returns both the minimum and maximum values in @data in a single pass.

### smax-index(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Int)

This function returns the index of the maximum value in @data.

### smin-index(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Int)

This function returns the index of the minimum value in @data.

### sminmax-index(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> List)

This function returns the indexes of the minimum and maximum values in @data in a single pass.

### median-from-sorted-data(@sorted-data! where { [<] @sorted-data }, Int() :$stride? = 1, Int() :$n? = (@sorted-data.elems / $stride).Int --> Num)

This function returns the median value of @sorted-data.

### median(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function returns the median value of @data.

### quantile-from-sorted-data(@sorted-data! where { [<] @sorted-data }, Num() $percentile!, Int() :$stride? = 1, Int() :$n? = (@sorted-data.elems / $stride).Int --> Num)

This function returns a quantile value of @sorted-data. The quantile is determined by the $percentile, a fraction between 0 and 1. For example, to compute the value of the 75th percentile $percentile should have the value 0.75.

### select(@data!, Int() $k, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

This function finds the k-th smallest element of the input array @data.

### trmean-from-sorted-data(Num() $alpha, @sorted-data! where { [<] @sorted-data }, Int() :$stride? = 1, Int() :$n? = (@sorted-data.elems / $stride).Int --> Num)

This function returns the trimmed mean of @sorted-data.

### gastwirth-from-sorted-data(@sorted-data! where { [<] @sorted-data }, Int() :$stride? = 1, Int() :$n? = (@sorted-data.elems / $stride).Int --> Num)

This function returns the Gastwirth location estimator of @sorted-data.

### mad0(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

### mad(@data!, Int() :$stride? = 1, Int() :$n? = (@data.elems / $stride).Int --> Num)

These functions return the median absolute deviation of @data. The mad0 function calculates the MAD statistic without the bias correction scale factor.

### Sn0-from-sorted-data(@sorted-data! where { [<] @sorted-data }, Int() :$stride? = 1, Int() :$n? = (@sorted-data.elems / $stride).Int --> Num)

### Sn-from-sorted-data(@sorted-data! where { [<] @sorted-data }, Int() :$stride? = 1, Int() :$n? = (@sorted-data.elems / $stride).Int --> Num)

These functions return the Sₙ statistic of @sorted-data. The Sn0 function calculates the Sₙ statistic without the bias correction scale factors.

### Qn0-from-sorted-data(@sorted-data! where { [<] @sorted-data }, Int() :$stride? = 1, Int() :$n? = (@sorted-data.elems / $stride).Int --> Num)

### Qn-from-sorted-data(@sorted-data! where { [<] @sorted-data }, Int() :$stride? = 1, Int() :$n? = (@sorted-data.elems / $stride).Int --> Num)

These functions return the Qₙ statistic of @sorted-data. The Qn0 function calculates the Qₙ statistic without the bias correction scale factors.

# C Library Documentation

For more details on libgsl see <https://www.gnu.org/software/gsl/>. The excellent C Library manual is available here <https://www.gnu.org/software/gsl/doc/html/index.html>, or here <https://www.gnu.org/software/gsl/doc/latex/gsl-ref.pdf> in PDF format.

# Prerequisites

This module requires the libgsl library to be installed. Please follow the instructions below based on your platform:

## Debian Linux and Ubuntu 20.04

```
sudo apt install libgsl23 libgsl-dev libgslcblas0

```

That command will install libgslcblas0 as well, since it's used by the GSL.

## Ubuntu 18.04

libgsl23 and libgslcblas0 have a missing symbol on Ubuntu 18.04. I solved the issue installing the Debian Buster version of those three libraries:

* <http://http.us.debian.org/debian/pool/main/g/gsl/libgslcblas0_2.5+dfsg-6_amd64.deb>
* <http://http.us.debian.org/debian/pool/main/g/gsl/libgsl23_2.5+dfsg-6_amd64.deb>
* <http://http.us.debian.org/debian/pool/main/g/gsl/libgsl-dev_2.5+dfsg-6_amd64.deb>

# Installation

To install it using zef (a module management tool):

```
$ zef install Math::Libgsl::Statistics

```

# AUTHOR

Fernando Santagata [nando.santagata@gmail.com](mailto:nando.santagata@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2020 Fernando Santagata

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_github-ugexe-Text-Table-Simple.md
## Text::Table::Simple

Create basic tables from a two dimensional array

## Synopsis

```
use Text::Table::Simple;

my @columns = <id name email>;
my @rows    = (
    [1,"John Doe",'johndoe@cpan.org'],
    [2,'Jane Doe','mrsjanedoe@hushmail.com'],
);

my @table = lol2table(@columns,@rows);
.say for @table;

# O----O----------O-------------------------O
# | id | name     | email                   |
# O====O==========O=========================O
# | 1  | John Doe | johndoe@cpan.org        |
# | 2  | Jane Doe | mrsjanedoe@hushmail.com |
# -------------------------------------------

```

## Exports

#### lol2table(@body, \*%options --> Str @rows)

#### lol2table(@header, @body, @footer?, \*%options --> Str @rows)

Create a an array of strings that can be printed line by line to create a table view of the data.

```
> my @cols = <XXX XXXX>;
> my @rows = ([1,2],[3,4]);
> say lol2table(@cols, @rows).join("\n");

O-----O------O
| XXX | XXXX |
O=====O======O
| 1   | 2    |
| 3   | 4    |
--------------

```

##### Options

```
# default values
%options = %(
    rows => {
        column_separator     => '|',
        corner_marker        => '-',
        bottom_border        => '-',
    },
    headers => {
        top_border           => '-',
        column_separator     => '|',
        corner_marker        => 'O',
        bottom_border        => '=',
    },
    footers => {
        column_separator     => 'I',
        corner_marker        => '%',
        bottom_border        => '*',
    },
);

```

You can replace any of the default options by passing in a replacement.
C<corner\_marker> is used when more specific corner markers are not set.

```
> my %options =
    rows => {
        column_separator           => '│',
        bottom_left_corner_marker  => '└',
        bottom_right_corner_marker => '┘',
        bottom_corner_marker       => '┴',
        bottom_border              => '─',
    },
    headers => {
        top_border                 => '═',
        column_separator           => '│',
        top_corner_marker          => '╤',
        top_left_corner_marker     => '╒',
        top_right_corner_marker    => '╕',
        bottom_left_corner_marker  => '╞',
        bottom_right_corner_marker => '╡',
        bottom_corner_marker       => '╪',
        bottom_border              => '═',
    };
> my @columns = <id name email>;
> my @rows    = (
    [1,"John Doe",'johndoe@cpan.org'],
    [2,'Jane Doe','mrsjanedoe@hushmail.com'],
);

> .put for lol2table(@columns, @rows, |%options);

╒════╤══════════╤═════════════════════════╕
│ id │ name     │ email                   │
╞════╪══════════╪═════════════════════════╡
│ 1  │ John Doe │ johndoe@cpan.org        │
│ 2  │ Jane Doe │ mrsjanedoe@hushmail.com │
└────┴──────────┴─────────────────────────┘

```

## Examples

Showing your Benchmark output:

```
use Text::Table::Simple;

use Text::Levenshtein::Damerau;
use Benchmark;

my $str1 = "lsd";
my $str2 = "lds";

my %results = timethese(1000, {
    'dld' => sub { Text::Levenshtein::Damerau::{"&dld($str1,$str2)"} },
    'ld ' => sub { Text::Levenshtein::Damerau::{"&ld($str1,$str2)"}  },
});

my @headers = ['func','start','end','diff','avg'];
my @rows    = %results.map: {.key, .value.Slip}
my @table   = lol2table(@headers,@rows);

.say for @table;

```

Also see the [examples](https://github.com/ugexe/Raku-Text--Table--Simple/tree/main/examples) directory.


## dist_zef-ulisesb-ERK.md
# ERK

ERK (Embedded RaKu) is a templating engine for evaluating Raku code embedded in
arbitrary text files. Heavily inspired by
[ESH](https://github.com/jirutka/esh) (Embedded SHell), which is itself
like [ERB](https://github.com/ruby/erb) (Embedded RuBy).

See `lib/ERK.rakumod` and `bin/erk` for more information.


## spec.md
class IO::Spec

Platform specific operations on file and directory paths

```raku
class IO::Spec { }
```

Objects of this class are not used directly but as a sub-class specific to the platform Raku is running on via the `$*SPEC` variable which will contain an object of the appropriate type.

The sub-classes are documented separately, with the platform-specific differences documented in [`IO::Spec::Cygwin`](/type/IO/Spec/Cygwin), [`IO::Spec::QNX`](/type/IO/Spec/QNX), [`IO::Spec::Unix`](/type/IO/Spec/Unix) and [`IO::Spec::Win32`](/type/IO/Spec/Win32).

# [About sub-classes IO::Spec::\*](#class_IO::Spec "go to top of document")[§](#About_sub-classes_IO::Spec::* "direct link")

The `IO::Spec::*` classes provide low-level path operations. Unless you're creating your own high-level path manipulation routines, you don't need to use `IO::Spec::*`. Use [`IO::Path`](/type/IO/Path) instead.

Beware that no special validation is done by these classes (e.g. check whether path contains a null character). It is the job of higher-level classes, like [`IO::Path`](/type/IO/Path), to do that.

# [Methods](#class_IO::Spec "go to top of document")[§](#Methods "direct link")


## dist_zef-jonathanstowe-LibraryCheck.md
# LibraryCheck

Determine whether a shared library is available to be loaded by Raku

![Build Status](https://github.com/jonathanstowe/LibraryCheck/workflows/CI/badge.svg)

## Synopsis

```
use LibraryCheck;

if !library-exists('sndfile', v1) {
    die "Cannot load libsndfile";
}

```

## Description

This module provides a mechanism that will determine whether a named
shared library is available and can be used by NativeCall.

It exports a single function `library-exists` that returns a boolean to
indicate whether the named shared library can be loaded and used. The
library name should be supplied without any (OS-dependent) "lib" prefix
and no extension (for example, `'crypt'` for `libcrypt.so`).

This can be used in a builder to determine whether a module has a chance
of working (and possibly aborting the build), or in tests to cause the
tests that may rely on a missing library to be skipped.

The second positional argument is a <Version> object that
indicates the version of the library that is required, it defaults to
`v1`, if you don't care which version exists then it possible to pass a
new Version object without any version parts (i.e., `Version.new()`).
Many systems require that the version is specified, so if portability is
a concern, an actual version number should be given.

If the `:exception` adverb is passed to `library-exists` then an
exception (`X::NoLibrary`) will be thrown if the library isn't available
rather than returning `False`. So the case above can be more simply
written as:

```
library-check('sndfile', v1, :exception);

```

The implementation is somewhat of a hack currently and definitely
shouldn't be taken as an example of nice Raku code.

## Installation

Assuming you have a working Rakudo installation you should be able to
install this with *zef*:

```
# From the source directory

zef install .

# Remote installation

zef install LibraryCheck

```

Other install mechanisms may be become available in the future.

## Support

Suggestions/patches are welcomed via github at <https://github.com/jonathanstowe/LibraryCheck/issues>

I'd be particularly interested in having it work properly on all the platforms that rakudo will work on.

## Licence

Please see the <LICENCE> file in the distribution.

© Jonathan Stowe 2015 - 2021


## dist_zef-raku-community-modules-Testo.md
# NAME [Test in a Raku container](https://github.com/raku-community-modules/Testo/actions/workflows/test.yaml)

Testo - Raku Testing Done Right

# SYNOPSIS

```
use Testo;
plan 10;

# `is` uses smart match semantics:
is 'foobar', *.contains('foo');    # test passes
is (1, 2, (3, 4)), [1, 2, [3, 4]]; # test passes
is (1, 2, (3, 4)), '1 2 3 4';      # test fails; unlike Test's `is`
is 'foobar', /foo/;   # no more Test's `like`;    just use a regex
is 'foobar', Str;     # no more Test's `isa-ok`;  just use a type object
is 'foobar', Stringy; # no more Test's `does-ok`; just use a type object

ok $number < 0;
nok $io-path.e, 'path does not exist';

# uses `eqv` semantics and works right with Seqs
is-eqv (1, 2).Seq, (1, 2); # test fails; unlike Test's `is-deeply`

# execute a program with some args and STDIN input and smartmatch its
# STDERR, STDOUT, and exit status:
is-run $*EXECUTABLE, :in<hi!>, :args['-e', 'say $*IN.uc'],
    :out(/'HI!'/), 'can say hi';

# run a bunch of tests as a group; like Test's `subtest`
group 'a bunch of test' => 3 => {
    is 1, 1;
    is 4, 4;
    is 'foobar', /foo/;
}

```

# FEATURES

* Tests routines designed for testing Raku code
* Configurable output: TAP, JSON, or even a custom type!
* Easy to extend with your own custom test routines!

# BETA-WARE

Note this module is still in fleshing-out stage. JSON output type, more
test functions, and docs for the classes under the hood and customization
are yet to be made, but will be made soon!

# DESCRIPTION

Testo is the New and Improved version of `Test` that you can use
*instead* of `Test` to test all of your code and generate output in
[TAP](https://testanything.org/tap-specification.html),
JSON, or any other custom format!

# EXPORTED ROUTINES

## `plan`

Defined as:

```
sub plan (Int $number-of-tests);

```

Specifies the number of tests you plan to run.

```
plan 5;

```

## `is`

Defined as:

```
sub is (Mu $expected, Mu $got, Str $desc?);

```

Testo's workhorse you'll use for most testing. Performs the test using
[smartmatch](https://docs.raku.org/routine/~~.html) semantics; i.e. it's
equivalent to doing `($expected ~~ $got).Bool`, with the test passing if the
result is `True`. An optional description of the test can be specified

```
is 'foobar', *.contains('foo');    # test passes
is (1, 2, (3, 4)), [1, 2, [3, 4]]; # test passes
is (1, 2, (3, 4)), '1 2 3 4';      # test fails; unlike Test's `is`
is 'foobar', /foo/;      # no more Test's `like`;    just use a regex
is 'foobar', none /foo/; # no more Test's `unlike`;  just use a none  Junction
is 'foobar', Str;        # no more Test's `isa-ok`;  just use a type object
is 'foobar', Stringy;    # no more Test's `does-ok`; just use a type object

is 1, 2, 'some description'; # you can provide optional description too

```

Note that Testo does not provide several of [Test's
tests](https://docs.raku.org/language/testing), such as `isnt`, `like`,
`unlike`, `isa-ok` or `does-ok`, as those are replaced by `is` with Regex/type
objects/`none` Junctions as arguments.

## `is-eqv`

Defined as:

```
sub is-eqv (Mu $expected, Mu $got, Str $desc?);

```

Uses [`eqv`](https://docs.raku.org/routine/eqv) semantics to perform the test.
An optional description of the test can be specified.

```
is-eqv (1, 2).Seq, (1, 2); # fails; types do not match
is-eqv 1.0, 1; # fails; types do not match
is-eqv 1, 1;   # succeeds; types and values match

```

## `ok` and `nok`

```
ok $number < 0;
nok $io-path.e, 'path does not exist';

```

## `is-run`

```
is-run $*EXECUTABLE, :in<hi!>, :args['-e', 'say $*IN.uc'],
    :out(/'HI!'/), 'can say hi';

is-run $*EXECUTABLE, :args['-e', '$*ERR.print: 42'],
    :err<42>, 'can err 42';

is-run $*EXECUTABLE, :args['-e', 'die 42'],
    :err(*), :42status, 'can exit with exit code 42';

```

**NOTE:** due to [a Rakudo bug
RT#130781](https://github.com/Raku/old-issue-tracker/issues/6072)
exit code is currently always reported as `0`

Runs an executable (via [&run](https://docs.raku.org/routine/run)), optionally
supplying extra args given as `:args[...]` or feeding STDIN with a `Str` or
`Blob` data given via C<:in>.

Runs three `is` tests on STDOUT, STDERR, and exit code expected values for
which are provided via `:out`, `:err` and `:status` arguments respectively.
If omitted, `:out` and `:err` default to empty string (`''`) and `:status`
defaults to `0`. Use the [Whatever star](https://docs.raku.org/type/Whatever)
(`*`) as the value for any of the three arguments (see `:err` in last
example above).

## `group`

```
plan 1;

# run a bunch of tests as a group; like Test's `subtest`
group 'a bunch of tests' => 4 => {
    is 1, 1;
    is 4, 4;
    is 'foobar', /foo/;

    group 'nested bunch of tests; with manual `plan`' => {
        plan 2;
        is 1, 1;
        is 4, 4;
    }
}

```

Similar to `Test`'s `subtest`. Groups a number of tests into a... group
with its own plan. The entire group counts as 1 test towards the planned/ran
number of tests.

Takes a `Pair` as the argument that is either `Str:D $desc => &group-code`
or `Str:D $desc => UInt:D $plan where .so => &group-code` (see code example
above), the latter form lets you specify the plan for the group, while the
former would require you to manually use `&plan` inside of the `&group-code`.

Groups can be nested for any (reasonable) number of levels.

---

#### REPOSITORY

Fork this module on GitHub:
<https://github.com/raku-community-modules/Testo>

#### BUGS

To report bugs or request features, please use
<https://github.com/raku-community-modules/Testo/issues>

#### AUTHOR

Zoffix Znet

#### LICENSE

You can use and distribute this module under the terms of the
The Artistic License 2.0. See the `LICENSE` file included in this
distribution for complete details.

Some portions of this software may be based on or re-use code
of `Test` module shipped with
[Rakudo 2107.04.03](http://rakudo.org/downloads/rakudo/), © 2017 by The Raku
Foundation, under The Artistic License 2.0.

The `META6.json` file of this distribution may be distributed and modified
without restrictions or attribution.


## positionalbindfailover.md
role PositionalBindFailover

Failover for binding to a Positional

```raku
role PositionalBindFailover { ... }
```

This role provides an interface by which an object can be coerced into a [`Positional`](/type/Positional) when binding to [`Positional`](/type/Positional) parameters.

For example, [`Seq`](/type/Seq) type is not [`Positional`](/type/Positional), but you can still write the following, because it [does](/routine/does) `PositionalBindFailover` role:

```raku
sub fifths(@a) {        # @a is constraint to Positional
    @a[4];
}
my $seq := gather {     # a Seq, which is not Positional
    take $_ for 1..*;
}
say fifths($seq);       # OUTPUT: «5␤»
```

The invocation of `fifths` in the example above would ordinarily give a type error, because `$seq` is of type [`Seq`](/type/Seq), which doesn't do the [`Positional`](/type/Positional) interface that the `@`-sigil implies.

But the signature binder recognizes that [`Seq`](/type/Seq) does the `PositionalBindFailover` role, and calls its `cache` method to coerce it to a [`List`](/type/List), which does the [`Positional`](/type/Positional) role.

The same happens with custom classes that do the role; they simply need to provide an `iterator` method that produces an [`Iterator`](/type/Iterator):

```raku
class Foo does PositionalBindFailover {
    method iterator {
        class :: does Iterator {
            method pull-one {
                return 42 unless $++;
                IterationEnd
            }
        }.new
    }
}

sub first-five (@a) { @a[^5].say }
first-five Foo.new; # OUTPUT: # OUTPUT: «(42 Nil Nil Nil Nil)␤»
```

# [Methods](#role_PositionalBindFailover "go to top of document")[§](#Methods "direct link")

## [method cache](#role_PositionalBindFailover "go to top of document")[§](#method_cache "direct link")

```raku
method cache(PositionalBindFailover:D: --> List:D)
```

Returns a [`List`](/type/List) based on the `iterator` method, and caches it. Subsequent calls to `cache` always return the same [`List`](/type/List) object.

## [method list](#role_PositionalBindFailover "go to top of document")[§](#method_list "direct link")

```raku
multi method list(::?CLASS:D:)
```

Returns a [`List`](/type/List) based on the `iterator` method without caching it.

## [method iterator](#role_PositionalBindFailover "go to top of document")[§](#method_iterator "direct link")

```raku
method iterator(PositionalBindFailover:D:) { ... }
```

This method stub ensure that a class implementing role `PositionalBindFailover` provides an `iterator` method.

# [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")

Type relations for `PositionalBindFailover`

raku-type-graph

PositionalBindFailover
PositionalBindFailover

Sequence
Sequence

Sequence->PositionalBindFailover

Mu
Mu

Any
Any

Any->Mu

Iterable
Iterable

RaceSeq
RaceSeq

RaceSeq->Sequence

RaceSeq->Any

RaceSeq->Iterable

Cool
Cool

Cool->Any

Seq
Seq

Seq->Sequence

Seq->Iterable

Seq->Cool

HyperSeq
HyperSeq

HyperSeq->Sequence

HyperSeq->Any

HyperSeq->Iterable

[Expand chart above](/assets/typegraphs/PositionalBindFailover.svg)


## dist_cpan-MOZNION-Object-Container.md
[![Build Status](https://travis-ci.org/moznion/p6-Object-Container.svg?branch=master)](https://travis-ci.org/moznion/p6-Object-Container)

# NAME

Object::Container - A simple container for object for perl6

# SYNOPSIS

## Instance method

```
use Object::Container;

my $container = Object::Container.new;

$container.register('obj1', $obj1);
$container.register('obj2', $obj2);

$container.get('obj1');        # <= equals $obj1
$container.get('obj2');        # <= equals $obj2
$container.get('not-existed'); # <= equals Nil

```

## Class method (singleton)

```
use Object::Container;

Object::Container.register('obj1', $obj1);
Object::Container.register('obj2', $obj2);

Object::Container.get('obj1');        # <= equals $obj1
Object::Container.get('obj2');        # <= equals $obj2
Object::Container.get('not-existed'); # <= equals Nil

```

# DESCRIPTION

Object::Container is a simple container for object. A simple DI mechanism can be implemented easily by using this module. This module provides following features;

* Register object to container
* Find object from container
* Remove registered object from container
* Clear container

# METHODS

## `register(Str:D $name, Any:D $object)`

Registers the instantiated object with name in the container.

## `register(Str:D $name, Callable:D $initializer)`

Registers the `Callable` as initializer to instantiate the object with the name in the container. This method instantiates the object with calling `Callable`. This is a **lazy** way to instantiate; it means it defers instantiation (i.e. calling `Callable`) until `get(...)` is invoked.

```
my $container = Object::Container.new;
my $initializer = sub {
    # Reach here when `$container.get()` is called (only at once)
    return $something;
};
$container.register('obj-name', $initializer);

```

## `get(Str:D $name) returns Any`

Finds the registered object from the container by the name and return it. If the object is missing, it returns `Nil`.

## `remove(Str:D $name) returns Bool`

Removes the registered object from the container by the name. It returns whether the registered object was existed in the container or not.

## `clear()`

Clears the container. In other words, it rewinds the container to its initial state.

# Singleton pattern

If you use this module with class method (e.g. `Object::Container.register(...)`), this module handles the container as singleton object.

# AUTHOR

moznion [moznion@gmail.com](mailto:moznion@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2017- moznion

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## stash.md
class Stash

Table for "our"-scoped symbols

```raku
class Stash is Hash { }
```

A `Stash` is a hash that is used for symbol tables at the package scoping level in Raku.

To get a Stash, you can call the `.WHO` pseudo-method on a package (because it answers the question *who lives here?*), or if you write the package name as a literal, append two colons:

```raku
class Boring {
    class Nested { };
    our sub package_sub { }
    my sub lexical { };
    method a_method() { }
}
say Boring::.^name;             # OUTPUT: «Stash␤»
say Boring.WHO === Boring::;    # OUTPUT: «True␤»
```

Since it inherits from [`Hash`](/type/Hash), you can use all the usual hash functionality:

```raku
say Boring::.keys.sort;         # OUTPUT: «(&package_sub Nested)␤»
say Boring::<Nested>;           # OUTPUT: «(Nested)␤»

```

As the example above shows only "our"-scoped things appear in the `Stash` (nested classes are "our" by default, but can be excluded with "my".) Lexicals and methods are not included in a Stash, since they do not live in the package table. Lexicals live in a separate lexical pad, which is only visible from inside the scope. Methods (in the case that the package is also a class) have a separate method table, and are accessible through introspection on the class itself, via `.can` and `.^methods`.

# [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")

Type relations for `Stash`

raku-type-graph

Stash
Stash

Hash
Hash

Stash->Hash

Mu
Mu

Any
Any

Any->Mu

Cool
Cool

Cool->Any

Iterable
Iterable

Associative
Associative

Map
Map

Map->Cool

Map->Iterable

Map->Associative

Hash->Map

[Expand chart above](/assets/typegraphs/Stash.svg)


## dist_zef-2colours-Ddt.md
# NAME

Ddt - Distribution Development Tool

# SYNOPSIS

```
$ ddt --license-name=LGPL new Foo::Bar # create Foo-Bar distribution
$ cd Foo-Bar
$ ddt build        # build the distribution and re-generate
                   # README.md & META6.json
$ ddt -C test      # Run tests when files change

```

# DESCRIPTION

**Ddt** is an authoring and distribution development tool for Raku. It provides scaffolding for generating new distributions, packages, modules, grammers, classes and roles.

# WARNING

This project is a technology preview. It may change at any point. The only API which can be considered stable up to the `v1.0` is the command line interface.

# USAGE

```
ddt [--license-name=«NAME»] new <module> -- Create new module
ddt build                                -- Build the distribution and
                                            update README.md
ddt [-C|--continues] test [<tests> …]    -- Run distribution tests
ddt release                              -- Make release
ddt hack <identity> [<dir>]              -- Checkout a Distribution and
                                            start hacking on it
ddt generate class <name>                -- Generate a class
ddt generate role <name>                 -- Generate a role
ddt generate package <name>              -- Generate a package
ddt generate grammar <name>              -- Generate a grammar
ddt generate module <name>               -- Generate a module
ddt generate test <name> [<description>] -- Generate stub test file
ddt [-v] deps distri                     -- Show all the modules used
ddt [-u|--update] deps                   -- Update META6.json dependencies
ddt watch [<cmd>…]                       -- Watch lib/, bin/ & t/ for
                                            changes respecting .gitignore
                                            and execute given cmd

```

# INSTALLATION

```
# with zef
> zef install Ddt

```

# Differences to Mi6

* Support for different licenses via `License::Software`
* META6 is generated using `META6`
* Meta test
* Use prove for tests
* Run tests on changes
* Extended .gitignore
* Support for different licenses
* Support for Distributions with a hyphen in the name

# FAQ

* How can I manage depends, build-depends, test-depends?

Use `ddt -u deps`

* Where is the spec of META6.json?

The documentation site describes the current practices pretty well at <https://docs.raku.org/language/modules#Distributing_modules>. The original design document of META6.json is available at <http://design.perl6.org/S22.html>.

# SEE ALSO

* <https://github.com/skaji/mi6>
* <https://github.com/tokuhirom/Minilla>
* <https://github.com/rjbs/Dist-Zilla>

# AUTHOR

* Bahtiar `kalkin-` Gadimov [bahtiar@gadimov.de](mailto:bahtiar@gadimov.de)
* Shoichi Kaji [skaji@cpan.org](mailto:skaji@cpan.org)

# COPYRIGHT AND LICENSE

* Copyright © 2015 Shoichi Kaji
* Copyright © 2016-2017 Bahtiar `kalkin-` Gadimov

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-antononcube-DSL-Bulgarian.md
# Raku DSL::Bulgarian

## In brief

This Raku package facilitates the specification computational workflows using
natural language commands in Bulgarian.

Using the Domain Specific Languages (DSLs) executable code is generated for different
programming languages: Julia, Python, R, Raku, Wolfram Language.

Translation to other natural languages is also done: English, Korean, Russian, Spanish.

---

## Data query (wrangling) workflows

Translate Bulgarian data wrangling specifications to different natural and programming languages:

```
use DSL::English::DataQueryWorkflows;

my $command = '
зареди данните iris;
вземи елементите от 1 до 120;
филтрирай чрез Sepal.Width е по-голямо от 2.4 и Petal.Length е по-малко от 5.5;
групирай с колоната Species;
покажи размерите
';
for <English Python::pandas Raku::Reshapers Spanish Russian> -> $t {
   say '=' x 60, "\n", $t, "\n", '-' x 60;
   say ToDataQueryWorkflowCode($command, $t, language => 'Bulgarian', format => 'code');
}

```

```
# ============================================================
# English
# ------------------------------------------------------------
# load the data table: "iris"
# take elements from 1 to 120
# filter with the predicate: ((Sepal.Width greater than 2.4) и (Petal.Length less than 5.5))
# group by the columns: Species
# show the count(s)
# ============================================================
# Python::pandas
# ------------------------------------------------------------
# obj = example_dataset('iris')
# obj = obj.iloc[1-1:120]
# obj = obj[((obj["Sepal.Width"]> 2.4) & (obj["Petal.Length"]< 5.5))]
# obj = obj.groupby(["Species"])
# print(obj.size())
# ============================================================
# Raku::Reshapers
# ------------------------------------------------------------
# my $obj = example-dataset('iris') ;
# $obj = $obj[ (1 - 1) ... (120 - 1 ) ] ;
# $obj = $obj.grep({ $_{"Sepal.Width"} > 2.4 and $_{"Petal.Length"} < 5.5 }).Array ;
# $obj = group-by($obj, "Species") ;
# say "counts: ", $obj>>.elems
# ============================================================
# Spanish
# ------------------------------------------------------------
# cargar la tabla: "iris"
# tomar los elementos de 1 a 120
# filtrar con la condicion: ((Sepal.Width más grande 2.4) y (Petal.Length menos 5.5))
# agrupar con columnas: "Species"
# mostrar recuentos
# ============================================================
# Russian
# ------------------------------------------------------------
# загрузить таблицу: "iris"
# взять элементы с 1 по 120
# фильтровать с предикатом: ((Sepal.Width больше 2.4) и (Petal.Length меньше 5.5))
# групировать с колонками: Species
# показать число

```

---

## Classification workflows

```
use DSL::English::ClassificationWorkflows;

my $command = '
използвай dfTitanic;
раздели данните с цепещо съотношение 0.82;
направи gradient boosted trees класификатор;
покажи TruePositiveRate и FalsePositiveRate;
';

for <English Russian WL::ClCon> -> $t {
    say '=' x 60, "\n", $t, "\n", '-' x 60;
    say ToClassificationWorkflowCode($command, $t, language => 'Bulgarian', format => 'code');
}

```

```
# ============================================================
# English
# ------------------------------------------------------------
# use the data: dfTitanic
# split into training and testing data with the proportion 0.82
# train classifier with method: gradient boosted trees
# ============================================================
# Russian
# ------------------------------------------------------------
# использовать данные: dfTitanic
# разделить данные на пропорцию 0.82
# обучить классификатор методом: gradient boosted trees
# ============================================================
# WL::ClCon
# ------------------------------------------------------------
# ClConUnit[ dfTitanic ] \[DoubleLongRightArrow]
# ClConSplitData[ 0.82 ] \[DoubleLongRightArrow]
# ClConMakeClassifier[ "GradientBoostedTrees" ] \[DoubleLongRightArrow]
# ClConClassifierMeasurements[ {"Recall", "FalsePositiveRate"} ] \[DoubleLongRightArrow] ClConEchoValue[]

```

---

## Latent Semantic Analysis

```
use DSL::English::LatentSemanticAnalysisWorkflows;

my $command = '
създай със textHamlet;
направи документ-термин матрица със автоматични стоп думи;
приложи LSI функциите IDF, TermFrequency, и Cosine;
извади 12 теми чрез NNMF и максимален брой стъпки 12;
покажи таблица  на темите с 12 термина;
покажи текущата лентова стойност
';

for <English Python::LSAMon R::LSAMon Russian> -> $t {
    say '=' x 60, "\n", $t, "\n", '-' x 60;
    say ToLatentSemanticAnalysisWorkflowCode($command, $t, language => 'Bulgarian', format => 'code');
}

```

```
#ERROR: Possible misspelling of 'термини' as 'термина'.
#ERROR: Possible misspelling of 'термини' as 'термина'.
#ERROR: Possible misspelling of 'термини' as 'термина'.
#ERROR: Possible misspelling of 'термини' as 'термина'.
# ============================================================
# English
# ------------------------------------------------------------
# create LSA object with the data: textHamlet
# make the document-term matrix with the parameters: use the stop words: NULL
# apply the latent semantic analysis (LSI) functions: global weight function : "IDF", local weight function : "None", normalizer function : "Cosine"
# extract 12 topics using the parameters: method : Non-Negative Matrix Factorization (NNMF), max number of steps : 12
# show topics table using the parameters: numberOfTerms = 12
# show the pipeline value
# ============================================================
# Python::LSAMon
# ------------------------------------------------------------
# LatentSemanticAnalyzer(textHamlet).make_document_term_matrix( stop_words = None).apply_term_weight_functions(global_weight_func = "IDF", local_weight_func = "None", normalizer_func = "Cosine").extract_topics(number_of_topics = 12, method = "NNMF", max_steps = 12).echo_topics_table(numberOfTerms = 12).echo_value()
# ============================================================
# R::LSAMon
# ------------------------------------------------------------
# LSAMonUnit(textHamlet) %>%
# LSAMonMakeDocumentTermMatrix( stopWords = NULL) %>%
# LSAMonApplyTermWeightFunctions(globalWeightFunction = "IDF", localWeightFunction = "None", normalizerFunction = "Cosine") %>%
# LSAMonExtractTopics( numberOfTopics = 12, method = "NNMF",  maxSteps = 12) %>%
# LSAMonEchoTopicsTable(numberOfTerms = 12) %>%
# LSAMonEchoValue()
# ============================================================
# Russian
# ------------------------------------------------------------
# создать латентный семантический анализатор с данных: textHamlet
# сделать матрицу документов-терминов с параметрами: стоп-слова: null
# применять функции латентного семантического индексирования (LSI): глобальная весовая функция: "IDF", локальная весовая функция: "None", нормализующая функция: "Cosine"
# извлечь 12 тем с параметрами: метод: Разложение Неотрицательных Матричных Факторов (NNMF), максимальное число шагов: 12
# показать таблицу темы по параметрам: numberOfTerms = 12
# показать текущее значение конвейера

```

---

## Quantile Regression Workflows

```
use DSL::English::QuantileRegressionWorkflows;

my $command = '
създай с dfTemperatureData;
премахни липсващите стойности;
покажи данново обобщение;
премащабирай двете оси;
изчисли квантилна регресия с 20 възела и вероятности от 0.1 до 0.9 със стъпка 0.1;
покажи диаграма с дати;
покажи чертеж на абсолютните грешки;
покажи текущата лентова стойност
';

for <English R::QRMon Russian WL::QRMon> -> $t {
    say '=' x 60, "\n", $t, "\n", '-' x 60;
    say ToQuantileRegressionWorkflowCode($command, $t, language => 'Bulgarian', format => 'code');
}

```

```
#ERROR: Possible misspelling of 'възли' as 'възела'.
#ERROR: Possible misspelling of 'възли' as 'възела'.
#ERROR: Possible misspelling of 'възли' as 'възела'.
#ERROR: Possible misspelling of 'възли' as 'възела'.
# ============================================================
# English
# ------------------------------------------------------------
# create quantile regression object with the data: dfTemperatureData
# delete missing values
# show data summary
# rescale: over both regressor and value axes
# compute quantile regression with parameters: degrees of freedom (knots): 20, automatic probabilities
# show plot with parameters: use date axis
# show plot of relative errors
# show the pipeline value
# ============================================================
# R::QRMon
# ------------------------------------------------------------
# QRMonUnit( data = dfTemperatureData) %>%
# QRMonDeleteMissing() %>%
# QRMonEchoDataSummary() %>%
# QRMonRescale(regressorAxisQ = TRUE, valueAxisQ = TRUE) %>%
# QRMonQuantileRegression(df = 20, probabilities = seq(0.1, 0.9, 0.1)) %>%
# QRMonPlot( datePlotQ = TRUE) %>%
# QRMonErrorsPlot( relativeErrorsQ = TRUE) %>%
# QRMonEchoValue()
# ============================================================
# Russian
# ------------------------------------------------------------
# создать объект квантильной регрессии с данными: dfTemperatureData
# удалить пропущенные значения
# показать сводку данных
# перемасштабировать: по осям регрессии и значений
# рассчитать квантильную регрессию с параметрами: степени свободы (узлы): 20, автоматическими вероятностями
# показать диаграмму с параметрами: использованием оси дат
# показать диаграму на относительных ошибок
# показать текущее значение конвейера
# ============================================================
# WL::QRMon
# ------------------------------------------------------------
# QRMonUnit[dfTemperatureData] \[DoubleLongRightArrow]
# QRMonDeleteMissing[] \[DoubleLongRightArrow]
# QRMonEchoDataSummary[] \[DoubleLongRightArrow]
# QRMonRescale["Axes"->{True, True}] \[DoubleLongRightArrow]
# QRMonQuantileRegression["Knots" -> 20, "Probabilities" -> Range[0.1, 0.9, 0.1]] \[DoubleLongRightArrow]
# QRMonDateListPlot[] \[DoubleLongRightArrow]
# QRMonErrorPlots[ "RelativeErrors" -> True] \[DoubleLongRightArrow]
# QRMonEchoValue[]

```

---

## Recommender workflows

```
use DSL::English::RecommenderWorkflows;

my $command = '
създай чрез dfTitanic;
препоръчай със профила "male" и "died";
покажи текущата лентова стойност
';

for <English Python::SMRMon R::SMRMon Russian> -> $t {
    say '=' x 60, "\n", $t, "\n", '-' x 60;
    say ToRecommenderWorkflowCode($command, $t, language => 'Bulgarian', format => 'code');
}

```

```
# ============================================================
# English
# ------------------------------------------------------------
# create with data table: dfTitanic
# recommend with the profile: ["male", "died"]
# show the pipeline value
# ============================================================
# Python::SMRMon
# ------------------------------------------------------------
# obj = SparseMatrixRecommender().create_from_wide_form(data = dfTitanic).recommend_by_profile( profile = ["male", "died"]).echo_value()
# ============================================================
# R::SMRMon
# ------------------------------------------------------------
# SMRMonCreate(data = dfTitanic) %>%
# SMRMonRecommendByProfile( profile = c("male", "died")) %>%
# SMRMonEchoValue()
# ============================================================
# Russian
# ------------------------------------------------------------
# создать с таблицу: dfTitanic
# рекомендуй с профилю: ["male", "died"]
# показать текущее значение конвейера

```

---

## Implementation notes

The rules in the file
["DataQueryPhrases.rakumod"](./lib/DSL/Bulgarian/DataQueryWorkflows/Grammar/DataQueryPhrases.rakumod)
are derived from file
["DataQueryPhrases-template"](./lib/DSL/Bulgarian/DataQueryWorkflows/Grammar/DataQueryPhrases-template)
using the package
["Grammar::TokenProcessing"](https://github.com/antononcube/Raku-Grammar-TokenProcessing)
, [AAp3].

In order to have Bulgarian commands parsed and interpreted into code the steps taken were
split into four phases:

1. Utilities preparation
2. Bulgarian words and phrases addition and preparation
3. Preliminary functionality experiments
4. Packages code refactoring

### Utilities preparation

Since the beginning of the work on translation of the computational DSLs into programming code
it was clear that some the required code transformations have to be automated.

While doing the preparation work -- and in general, while the DSL-translation work matured --
it became clear that there are several directives to follow:

1. Make and use Command Line Interface (CLI) scripts that do code transformation or generation.
2. Adhere to of the [Eric Raymond's 17 Unix Rules](https://en.wikipedia.org/wiki/Unix_philosophy), [Wk1]:

   * *Make data complicated when required, not the program*
   * *Write abstract programs that generate code instead of writing code by hand*

In order to facilitate the "from Bulgarian" project the package "Grammar::TokenProcessing", [AAp3],
was "finalized." The initial versions of that package were used from the very beginning of the
DSLs grammar development in order to facilitate handling of misspellings.

### (Current) recipe

This sub-section lists the steps for endowing a certain already developed workflows DSL package
with Bulgarian translations.

Denote the DSL workflows we focus on as DOMAIN (workflows.)
For example, DOMAIN can stand for `DataQueryWorkflows`, or `RecommenderWorkflows`.

*Remark:* In the recipe steps below DOMAIN would be
`DataQueryWorkflows`

It is assumed that:

* DOMAIN in English are already developed.
* Since both English and Bulgarian are analytical, non-agglutinative languages "just" replacing
  English words with Bulgarian words in DOMAIN would produce good enough parsers of Bulgarian.

Here are the steps:

1. Add global Bulgarian words (*optional*)

   1. Add Bulgarian words and phrases in the
      [DSL::Shared](https://github.com/antononcube/Raku-DSL-Shared) file
      ["Roles/Bulgarian/CommonSpeechParts-template"](https://github.com/antononcube/Raku-DSL-Shared/blob/master/lib/DSL/Shared/Roles/Bulgarian/CommonSpeechParts-template).
   2. Generate the file
      [Roles/Bulgarian/CommonSpeechParts.rakumod](https://github.com/antononcube/Raku-DSL-Shared/blob/master/lib/DSL/Shared/Roles/Bulgarian/CommonSpeechParts.rakumod)
      using the CLI script
      [`AddFuzzyMatching`](https://github.com/antononcube/Raku-Grammar-TokenProcessing/blob/main/bin/AddFuzzyMatching)
   3. Consider translating, changing, or refactoring global files, like,
      [Roles/English/TimeIntervalSpec.rakumod](https://github.com/antononcube/Raku-DSL-Shared/blob/master/lib/DSL/Shared/Roles/English/TimeIntervalSpec.rakumod)
2. Translate DOMAIN English words and phrases into Bulgarian

   1. Take the file
      [DOMAIN/Grammar/DOMAIN-template](https://github.com/antononcube/Raku-DSL-English-DataQueryWorkflows/blob/master/lib/DSL/English/DataQueryWorkflows/Grammar/DataQueryPhrases-template)
      and translate its words into Bulgarian
3. Add the corresponding files into [DSL::Bulgarian](https://github.com/antononcube/Raku-DSL-Bulgarian), [AAp1].

   1. Use the `DOMAIN/Grammarish.rakumod` role.

      * The English DOMAIN package should have such rule. If do not do the corresponding code refactoring.
   2. Test with implemented DOMAIN languages.
   3. See the example grammar and role in
      [DataQueryWorkflows in DSL::Bulgarian](https://github.com/antononcube/Raku-DSL-Bulgarian/tree/main/lib/DSL/Bulgarian/DataQueryWorkflows).

---

## References

### Articles

[AA1] Anton Antonov,
["Introduction to data wrangling with Raku"](https://rakuforprediction.wordpress.com/2021/12/31/introduction-to-data-wrangling-with-raku),
(2021),
[RakuForPrediction at WordPress](https://rakuforprediction.wordpress.com).

[Wk1] Wikipedia entry,
[UNIX-philosophy rules](https://en.wikipedia.org/wiki/Unix_philosophy).

### Packages

[AAp1] Anton Antonov,
[DSL::Bulgarian, Raku package](https://github.com/antononcube/Raku-DSL-Bulgarian),
(2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp2] Anton Antonov,
[DSL::Shared, Raku package](https://github.com/antononcube/Raku-DSL-Shared),
(2018-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp3] Anton Antonov,
[Grammar::TokenProcessing, Raku project](https://github.com/antononcube/Raku-Grammar-TokenProcessing)
(2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp4] Anton Antonov,
[DSL::English::ClassificationWorkflows, Raku package](https://github.com/antononcube/Raku-DSL-General-ClassificationWorkflows),
(2018-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp5] Anton Antonov,
[DSL::English::DataQueryWorkflows, Raku package](https://github.com/antononcube/Raku-DSL-English-DataQueryWorkflows),
(2020-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp6] Anton Antonov,
[DSL::English::LatentSemanticAnalysisWorkflows, Raku package](https://github.com/antononcube/Raku-DSL-General-LatentSemanticAnalysisWorkflows),
(2018-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp7] Anton Antonov,
[DSL::English::QuantileRegressionWorkflows, Raku package](https://github.com/antononcube/Raku-DSL-General-QuantileRegressionWorkflows),
(2018-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp8] Anton Antonov,
[DSL::English::QuantileRegressionWorkflows, Raku package](https://github.com/antononcube/Raku-DSL-General-RecommenderWorkflows),
(2018-2022),
[GitHub/antononcube](https://github.com/antononcube).


## dist_github-thundergnat-Base-Any.md
# NAME

Base::Any - Convert numbers to or from pretty much any base

[![Build Status](https://travis-ci.org/thundergnat/Base-Any.svg?branch=master)](https://travis-ci.org/thundergnat/Base-Any)

# SYNOPSIS

```
use Base::Any;

# Regular positive and negative bases

say 123456789.&to-base(1391); # À୧Ꮣ

say 'À୧Ꮣ'.&from-base(1391); # 123456789

say 6576148.249614.&to-base( 62, :precision(-3) ); # Raku.FTW

say 99999.&to-base(-10); # 1900019

say '1900019'.&from-base(-10); # 99999

say (2**256).&to-base(1000); # õѶÛŰǄņȳΖՀ8ЍӱһƐԿϷϝΐdɕΥ7ӷĄϜԎ

# Imaginary bases

say (5+5i).&to-base(-3i); # 1085.6

say (227.65625+10.859375i).&to-base(37i, :precision(-6)); # 1ŧ.Ԯɣ২Άí೭ÂႬ௫ǚȣᎴ

say 'Rakudo'.&from-base(6i).round(1e-8); # 11904+205710i

# Hash encoded

say (2**256).&to-base-hash(10000);
#`{
    whole    => [11 5792 892 3731 6195 4235 7098 5008 6879 785 3269 9846 6564 564 394 5758 4007 9131 2963 9936],
    fraction => [0],
    base     => 10000
  }

# Array encoded

say (-2**256).&to-base-array(10000);
# ( [-11 -5792 -892 -3731 -6195 -4235 -7098 -5008 -6879 -785 -3269 -9846 -6564 -564 -394 -5758 -4007 -9131 -2963 -9936], [0], 10000 )

# Set a custom digit set

set-digits('ABCDEFGHIJ');

# or

set-digits('A'..'J');

# Reset to default digit set

reset-digits();

```

# DESCRIPTION

Rakudo has built-in operators .base and .parse-base to do base conversions, but they only handle bases 2 through 36.

Base::Any provides convenient tools to transform numbers to and from nearly any positional, non-streaming base. (A streaming base is one where characters are packed so that one glyph does not necessarily correspond to one character. E.G. MIME Base32, Base64, Base85, etc.) Nor does it handle some specialized bases with customized glyph sets and attached checksums: e.g. Bitcoin Base58check. (It could be used in calculating Base58 with the correct mapped glyph set, but doesn't do it by default.)

For general base conversion, handles positive bases 2 through 4516, negative bases -4516 through -2, imaginary bases -67i through -2i and 2i through 67i.

The rather arbitrary threshold of 4516 was chosen because that is how many unique and discernible digit and letter glyphs are in the basic and first Unicode planes. (Under Unicode 12.1) (There's 4517 actually, but one of them needs to represent zero... and conveniently enough, it's 0) Punctuation, symbols, white-space and combining characters as digit glyphs are problematic when trying to round-trip an encoded number. Font coverage tends to get spotty in the higher Unicode planes as well.

If 4516 bases is not enough, also provides array encoded numbers to nearly any imaginable magnitude integer base.

You may also choose to map the arrays to your own selection of glyphs to enumerate a custom base definition. The default glyph set is enumerated in the file `Base::Any::Digits`.

#### BASIC USAGE:

```
sub to-base(Real $number, Integer $radix, :$precision = -15)

```

* Where $radix is ±2 through ±4516.

Works with any Real type value, though Rats and Nums will have limited precision in the least significant digits. You may set a precision parameter if desired. Defaults to -15 (1e-15). Converting a Rat or Num to a base and back likely will not return the exact same number. Some rounding will likely be necessary if that is critical.

Negative base numbers are encoded to always produce a positive result. Technically, there is no such thing as a negative Negative based number.

--

```
sub from-base(Str $number, Integer $radix)

```

* Where $radix is ±2 through ±4516. Takes a String of the encoded number. Returns the number encoded in base 10.

##### CASE INSENSITIVITY

As long as the default digit set is loaded Base::Any mimics the built-in operators, in that bases with an absolute magnitude 36 (-36) and below ignore case when converting `from-base()`.

```
'raku'.&from-base(36) == 'RAKU'.&from-base(36); # 76999005259948

```

and

```
'raku'.&from-base(-36) == 'RAKU'.&from-base(-36); # 75428091766540

```

A consequence to be aware of: `.&from-base().&to-base()` in radicies ±11 through ±36 may not round-trip to the same string.

If a custom digit set is loaded, Base::Any makes no assumptions about case equivalence.

##### UNDERSCORE SEPARATORS

Raku allows underscores in numeric values as a visual aid to keep track of orders of magnitude. Since the numbers fed to the `to-base()` routine are standard Raku numerics, Base::Any will automatically allow them as well. The `from-base()` routines take strings however, and normally underscores would be disallowed; this module has code to specifically allow (and ignore) underscores in numeric strings. Something like this would be valid:

```
say 'Raku_Rocks'.&from-base(62); # 6024625501917586

```

equivalent to:

```
say 'RakuRocks'.&from-base(62); # 6024625501917586

```

##### IMAGINARY BASES

`sub to-base()` will also handle converting to imaginary bases. The radix must be imaginary, not Complex, (any Real portion must be zero,) and it will only handle radicies ±2i through ±67i. The number to convert may be any positive or negative Complex number. Imaginary base encoded numbers never produce a negative or complex result.

There is no support at this time for imaginary radices in the `to-base-hash` or `to-base-array` routines. The imaginary bases in general seem to be more of a curiosity than of any great use.

#### CUSTOM DIGIT SETS

If you want to use a custom, non-standard digit set, you may easily load a replacement set of glyphs to use for digits.

`sub set-digits(String)` or `sub set-digits(List)` will alter the standard table of digits to whatever you pass in. There are some caveats.

* The string (or list) may not have any repeated glyphs. Repeated glyphs would hinder reversibility.
* Each element (for lists) must have only one character.
* Custom digit sets disable imaginary base number routines. They are too fiddly to deal with possibly "out-of-order" characters.

There is some error trapping but you are given a lot of leeway to shoot yourself in the foot.

The digit set order determines which character represents which number.

Note that the digit set may be larger than the base you are converting to. You may load 'A' .. 'Z', but then convert to base 8 which would only use 'A' through 'H'. 'A' .. 'Z' will support any base from 2 to 26.

The custom characters can be any valid Unicode character, even multibyte characters, as long as they are detected as a single character by Raku. They may be in any order, and from any Unicode block, as long as they are unique and discernable. It is highly recommended that the characters be restricted to printable, standalone characters (no white-space, control, or combining characters) but it isn't forbidden. Do not be suprised if the standard routines do not deal well with them though.

```
set-digits < 😟 😀 >;

say 1234.5678.&to-base(2);

# 😀😟😟😀😀😟😀😟😟😀😟.😀😟😟😀😟😟😟😀😟😀😟😀😀😟😀

```

You may change back to the standard digit set at any time with:

`sub reset-digits();` This will revert back to the default digit set and re-enable any routines disabled while custom digits were loaded.

#### HASH ENCODED

```
sub to-base-hash(Real $number, Integer $radix, :$precision = -15)

```

* Where $radix is any non ±1 or 0 Integer. Returns a hash with 3 elements:

  * :base(the base)
  * :whole(An array of the whole portion positive orders of magnitude in base 10)
  * :fraction(An array of the fractional portion negative orders of magnitude in base 10)

For illustration, using base 10 to make it easier to follow:

```
my %hash = 123456789.987654321.&to-base-hash(10);

```

yields:

```
{base => 10, fraction => [0 9 8 7 6 5 4 3 2 1], whole => [1 2 3 4 5 6 7 8 9]}

```

The 'whole' array is in reverse order, the most significant 'digit' is to the left, the least significant to the right. Each 'digit' is the value in that position (order-of-magnitude) encoded in base 10. To convert it to a number, reverse the array, multiply each element by the corresponding order of magnitude then sum the values.

```
sum %hash<whole>.reverse.kv.map( { $^value * (%hash<base> ** $^key) } );

123456789

```

Do the same thing with the fractional portion. The 'fraction' array is not reversed. The most significant is to the left, least significant to the right. The first element is always zero so you don't need to worry about skipping it. Do the same operation but with negative powers of the radix.

```
sum %hash<fraction>.kv.map( { $^value * (%hash<base> ** -$^key) } );

0.987654321

```

Add the whole and fractional parts together and you get the original number back.

```
123456789 + 0.987654321 == 123456789.987654321

```

There is a provided sub `from-base-hash()` that does exactly this operation, so you don't need to do it manually. This was exposition to make it easier to understand what is going on behind the scenes.

```
sub from-base-hash( { :whole(@whole), :fraction(@fraction), :base($base) } )

```

Round trip:

```
say 123456789.987654321.&to-base-hash(10).&from-base-hash;

123456789.987654321

```

#### ARRAY ENCODED

In the same vein, there is a set of subs that work with arrays.

```
sub to-base-array( Real $number, Integer $radix, :$precision = -15 )

```

and

```
sub from-base-array( [ @whole, @fraction, $base ] )

```

They do very nearly the same thing except `to-base-array()` returns the 'whole' Array, the 'fraction' Array and the base as a list of three positionals rather than a hash of named values, and `from-base-array()` takes an array of those three positionals. They work pretty much identically internally though. (And in fact, use the exact same code path.)

Note that both the `to-base-hash()` and `to-base-array()` include the base as part of the encoded number so it is already include when round-tripping.

Be aware. There are about twenty-two thousand tests done during install to exercise the module. Testing takes a while. Theoretically, the tests are highly parallelizable but the present ecosystem tooling doesn't seem to like it.

# AUTHOR

Steve Schulze (thundergnat)

# COPYRIGHT AND LICENSE

Copyright 2020 Steve Schulze

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-Garlandg-Universal-Errno.md
# NAME

Universal::Errno - Errno wrapper for Linux, Unix, and Windows

# SYNOPSIS

```
use Universal::Errno;

  set_errno(2);

  say errno;
  say "failed: {errno}";
  say +errno;              #2

```

# DESCRIPTION

Universal::Errno is an extension of and wrapper around lizmat´s `Unix::errno`, and exports the same `errno` and `set_errno` interface. It works on Linux, Windows, and Macos. BSD support is untested, but should work.

One added feature is the `strerror` method, which gets the string for the error in a thread-safe way. On platforms that support it, it uses POSIX `strerror_l`. This allows getting the error string that corresponds to the user´s set locale. On platforms that do not support it, strerror\_r (XSI) is used. On Windows, this is done using `GetLastError()` and `FormatMessageW`. Windows also has a `SetLastError` function which is used instead of masking the value.

This module provides an Exception class, X::Errno. To check the type of error in a portable way, use the `symbol` method and smartmatch against an entry in the Errno enum.

It also provides a trait: error-model. Mark a sub or method with `is error-model<errno>` and the trait will automatically box the errno for you and reset errno to 0.

Important note: With a native sub, the `is native` trait must come before `is error-model`.

For calls that return `-errno`, there is also the trait `is error-model<neg-errno>`.

If high-performance is needed for a native sub that can return errno, use the `check-errno` and/or `check-neg-errno` subs. These subs are interchangeable with the traits, but cannot be directly applied to a nativecall subroutine.

As an example of a real-world scenario, this code sets up a socket using socket(2) and handles the errors with a CATCH block.

```
use NativeCall;
use Constants::Sys::Socket;
use Universal::Errno;

sub socket(int32, int32, int32) returns int32 is native is error-model<errno> { ... }
my int32 $socket;

try {
  $socket = socket(AF::INET, SOCK_DGRAM, 0);

  # Do something with $socket

  CATCH {
    when X::Errno {
      given .symbol {
        when Errno::EINVAL {
          die "Invalid socket type"
        }
        when Errno::EACCES {
          die "Permission denied"
        }
        ...
      }
    }
  }
}

```

## class X::Errno

Base exception class for errno

### method message

```
method message() returns Mu

```

Get the Str message for this errno value.

### method symbol

```
method symbol() returns Mu

```

Get the symbol of this errno value.

### method Int

```
method Int() returns Mu

```

Get the integer that corresponds to this errno value.

### method Numeric

```
method Numeric() returns Mu

```

Get the numeric value of this errno value.

### multi method new

```
multi method new() returns Mu

```

Get a new Errno exception from errno. This resets errno to 0.

# Subs

### multi sub trait\_mod:

```
multi sub trait_mod:<is>(
    Routine $s,
    :$error-model where { ... }
) returns Mu

```

Trait to check return value of subroutine and throw X::Errno if return value is less than 1.

### multi sub trait\_mod:

```
multi sub trait_mod:<is>(
    Routine $s,
    :$error-model where { ... }
) returns Mu

```

Trait to check return value of subroutine and throw abs(return value) as X::Errno if return value is less than 1.

### sub check-neg-errno

```
sub check-neg-errno(
    Int $result
) returns Mu

```

Check the result against the negative errno form.

### sub check-errno

```
sub check-errno(
    Int $result
) returns Mu

```

Check the result against the errno() form.

# AUTHOR

Travis Gibson [TGib.Travis@protonmail.com](mailto:TGib.Travis@protonmail.com)

## CREDIT

Uses a heavily-modified `Unix::errno` module for Unix-like OSes. The Windows version module borrows its structure and interface from lizmat's `Unix::errno`.

Universal::Errno::Unix contains all of the modified code, and this README also borrows the SYNOPSIS example above. The original README and COPYRIGHT information for lizmat's `Unix::errno` has been preserved in `Universal::Errno::Unix`.

lizmat's `Unix::errno` can be found at <https://github.com/lizmat/Unix-errno>

# COPYRIGHT AND LICENSE

Copyright 2021 Travis Gibson

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-raku-community-modules-CoreHackers-Q.md
[![Actions Status](https://github.com/raku-community-modules/CoreHackers-Q/workflows/test/badge.svg)](https://github.com/raku-community-modules/CoreHackers-Q/actions)

# CoreHackers::Q

QAST tree visualizer

# DESCRIPTION

Installs `q` command line script that parses out QAST trees from a program and makes an HTML file from them.

The HTML page provides these extra features unavailable in plain `raku --target=ast` and `raku --target=optimize` output:

* Control-click on individual tree nodes to collapse/expand them
* Color coding: of sunk nodes, `QAST::Want` alternatives, static and non-static

calls, etc.

Example output:

[An example](example.png)

# USAGE

```
    Usage:
      q a '[<args> ...]'
      q o '[<args> ...]'

```

## `a` command

```
$ q a raku -e 'say "hello"' > out.html; google-chrome out.html

```

`a` stands for `--target=ast` and the args that follow is a `raku` invocation to run the script (the `--target=ast` argument will be inserted automatically).

The script will parse QAST generated by the given `raku` program and output an HTML file to STDOUT. View the file in any browser to examine the QAST tree.

## `o` command

```
$ q o raku -e 'say "hello"' > out.html; google-chrome out.html

```

`o` stands for `--target=optimize` . Same as `a` , except parses `--target=optimize` QAST. Once again, you don't need to manually specify `--target` parameter.

## `z` command

```
$ q z raku -e 'say "hello"'

```

Just runs the raku command as is. Mnemonic: "zero". This command exists simply to easily switch between `a`/`o` runs and plain raku runs.

---

## Meta

### REPOSITORY

Fork this module on GitHub: <https://github.com/raku-community-modules/CoreHackers-Q>

### BUGS

To report bugs or request features, please use <https://github.com/raku-community-modules/CoreHackers-Q/issues>

### AUTHOR

Originally Zoffix Znet, now maintained by the Raku Community Adoption Center.

### LICENSE

You can use and distribute this module under the terms of the The Artistic License 2.0. See the `LICENSE` file included in this distribution for complete details.

The `META6.json` file of this distribution may be distributed and modified without restrictions or attribution.


## dist_zef-lizmat-Test-Assertion.md
[![Actions Status](https://github.com/lizmat/Test-Assertion/workflows/test/badge.svg)](https://github.com/lizmat/Test-Assertion/actions)

# NAME

provide 'is test-assertion' trait for older Rakus

# SYNOPSIS

```
use Test;
use Test::Assertion;

sub foo-test() is test-assertion {  # will never be compile-time error
    subtest "we do many tests" => {
        flunk "failed this one";    # <-- points here if doesn't work
    }
}

foo-test();  # <-- points here if test-assertion *does* work

```

# DESCRIPTION

Test::Assertion is a module that provides the `is test-assertion` trait for subroutines, which was introduced in Rakudo 2020.10, to older versions of Raku. This allows module authors to use the `is test-assertion` trait in a module without having to worry whether the version of Raku actually supports that trait.

If a distribution does not use any external testing functionality, then this module should probably be added as a dependency to the "test-depends" section of the META information of a module, as it will (most likely) only be needed during testing.

If this module is used by a distribution that is geared towards offering additional testing facilities, then clearly this module must be listed in the "depends" section.

Please note that this does **not** actually implement the `is test-assertion` error reporting logic: it merely makes sure that the use of the trait will not be a compile time error in the test-file where it is being used.

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

Source can be located at: <https://github.com/lizmat/Test-Assertion> . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

# COPYRIGHT AND LICENSE

Copyright 2020, 2021, 2024 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_cpan-JNTHN-OO-Monitors.md
# OO::Monitors

[![Build Status](https://travis-ci.org/jnthn/oo-monitors.svg?branch=master)](https://travis-ci.org/jnthn/oo-monitors)

A monitor provides per-instance mutual exclusion for objects. This means that
for a given object instance, only one thread can ever be inside its methods at
a time. This is achieved by a lock being associated with each object. The lock
is acquired automatically at the entry to each method in the monitor. Condition
variables are also supported.

## Basic Usage

A monitor looks like a normal class, but declared with the `monitor` keyword.

```
use OO::Monitors;

monitor IPFilter {
    has %!active;
    has %!blacklist;
    has $.limit = 10;
    has $.blocked = 0;

    method should-start-request($ip) {
        if %!blacklist{$ip} || (%!active{$ip} // 0) == $.limit {
            $!blocked++;
            return False;
        }
        else {
            %!active{$ip}++;
            return True;
        }
    }

    method end-request($ip) {
        %!active{$ip}--;
    }
}

```

That's about all there is to it. The monitor meta-object enforces mutual
exclusion.

## Conditions

Condition variables are declared with the `conditioned` trait on the monitor.
To wait on a condition, use `wait-condition`. To signal that a condition has
been met, use `meet-condition`. Here is an example of a bounded queue.

```
monitor BoundedQueue is conditioned(< not-full not-empty >) {
    has @!tasks;
    has $.limit = die "Must specify a limit";

    method add-task($task) {
        while @!tasks.elems == $!limit {
            wait-condition <not-full>;
        }
        @!tasks.push($task);
        meet-condition <not-empty>;
    }

    method take-task() {
        until @!tasks {
            wait-condition <not-empty>;
        }
        meet-condition <not-full>;
        return @!tasks.shift;
    }
}

```

When `wait-conditon` is used, the lock is released and the thread blocks until
the condition is met by some other thread. By contrast, `meet-condition` just
marks a waiting thread as unblocked, but retains the lock until the method
is over.

## Circular waiting

Monitors are vulnerable to deadlock, if you set up a circular dependency. Keep
object graphs involving monitors simple and cycle-free, so far as is possible.


## dist_zef-lizmat-UNICODE-VERSION.md
[![Actions Status](https://github.com/lizmat/UNICODE-VERSION/actions/workflows/test.yml/badge.svg)](https://github.com/lizmat/UNICODE-VERSION/actions)

# NAME

UNICODE-VERSION - Provide $?UNICODE-VERSION for older Raku versions

# SYNOPSIS

```
use UNICODE-VERSION;

say $?UNICODE-VERSION;  # v13.0  e.g.

```

# DESCRIPTION

UNICODE-VERSION checks the unicode database at compile time for certain marker codepoints that got added at certain unicode versions and exports a `%?UNICODE-VERSION` `Version` constant that indicates the version of Unicode that is currently being supported, as determined by those codepoints.

Algorithm suggested by Stephen Schulze

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

Source can be located at: <https://github.com/lizmat/UNICODE-VERSION> . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

# COPYRIGHT AND LICENSE

Copyright 2023 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.