Mask Functions

class masks.All[source]

Always returns 1, regardless of the input parameters.

Return type:

int

Returns:

1

class masks.Custom(vector)[source]

Initializes the Custom class with a specific vector.

Parameters:

vector (list) – The vector to be used in the apply method.

Return type:

int

Returns:

Either 0 or 1

class masks.EveryOther(is_eo=1)[source]

Initializes the EveryOther class with a specific state.

Parameters:

is_eo (int) – The state of the class.

Return type:

int

Returns:

Either 0 or 1

class masks.Odds[source]

Returns 1 if the given section is odd, None otherwise.

Return type:

int

Returns:

Either 0 or 1

class masks.Pairs[source]

Returns 1 if the given section is even, None otherwise.

Return type:

int

Returns:

Either 0 or 1

class masks.Percentage(percentage=0.2)[source]

Initializes the Percentage class with a specific percentage.

Parameters:

percentage (float) – The percentage at which the section will be evaluated.

Return type:

int

Returns:

Either 0 or 1

class masks.Quantity(qty=1)[source]

Initializes the Quantity class with a specific quantity.

Parameters:

qty (int) – The quantity at which the section will be evaluated.

Return type:

int

Returns:

Either 0 or 1

class masks.RandomMask[source]

Returns a random integer between 0 and 1.

Return type:

int

Returns:

Either 0 or 1