semvec/pypi-packages huggingface dataset:
while-machine 1.0.2
While Abstract Machine implemented in python.
License: MIT
Requires Python: >=3.8

# while-machine
While Abstract Machine implemented in python.

While Machine is an abstract machine that is turing complete and can compute any partial recursive function. Find out more here https://en.wikipedia.org/wiki/Abstract_machine

Its simpler brother is called Random Access Machine and you can find its implementation here https://github.com/GabrieleMaurina/random-access-machine

### Install

Run inside terminal:

```python -m pip install while-machine```

### Usage

To execute a ram source file:

```python -m while_machine <while source file> <integer input>```

To import it in your script:

```python
from while_machine import WhileMachine

data = 4
program = 'begin inc 0 inc 0 end'

wm = WhileMachine()
result = wm.compute(program, data)

print(result) # 2
```

### How it works

A while machine has 21 registers numbered from 0, 1, 2..., the input is loaded on register 1 before the execution starts, the output is taken from register 0 when the execution ends.

### Instructions:

A while machine supports only 4 basic instructions:

Increment register k by 1:

```inc k```

Decrement register k by 1:

```dec k```

Set register k to zero:

```zero k```

While register k is not zero, do the following command:

```while k```

Commands can be grouped with:

```
begin
	...
	...

end
```

### Example

An example program that will double whatever input you give to the machine:

```
while 1
begin
	inc 0
	inc 0
	dec 1
end
```

### RAM compiler

It is possible to compile a While program into a Ram program using the method compile_ram of the class WhileMachine. You can find an implementation of the ram machine here https://github.com/GabrieleMaurina/random-access-machine

Here is an example of how to compile from While to RAM:

```python
from while_machine import WhileMachine
import sys

def main():
	wm = WhileMachine()
	with open(sys.argv[1],'r') as while_prog, open(sys.argv[2],'w') as ram_prog:
		while_prog = while_prog.read()
		compiled = wm.compile_ram(while_prog)
		ram_prog.write(compiled)

if __name__ == '__main__':
	main()
```
random-access-machine 1.0.1
Random Access Machine implemented in python.
License: MIT
Requires Python: >=3.8

# random-access-machine
Random Access Machine implemented in python.

RAM is an abstract machine that is turing complete and can compute any partial recursive function. Find out more here https://en.wikipedia.org/wiki/Random-access_machine

Its more advanced brother is called While Machine and you can find its implementation here https://github.com/GabrieleMaurina/while-machine

### Install

Run inside terminal:

```python -m pip install random-access-machine```

### Usage

To execute a ram source file:

```python -m ram <ram source file> <integer input>```

To import it in your script:

```python
from ram import RAM

data = 4
program = 'inc 0'

ram = RAM()
result = ram.compute(program, data)

print(result) # 1
```

### How it works

A ram machine has infinite registers numbered from 0, 1, 2..., the input is loaded on register 1 before the execution starts, the output is taken from register 0 when the execution ends.

### Instructions:

 A ram machine supports only 3 basic instructions:

Increment register k by 1:

```inc k```

Decrement register k by 1:

```dec k```

Jump to instruction i if register k is zero:

```jz k i```

### Example

An example program that will double whatever input you give to the machine:

```
jz 1 6
inc 0
inc 0
dec 1
jz 2 1
dec 1
```

### Compile While

It is possible to compile a While program into a Ram program using the method compile_ram of the class WhileMachine. You can find an implementation of the while machine here https://github.com/GabrieleMaurina/while-machine
xontrib-termcolors 0.2.0
Set terminal colors based on selected xonsh theme.
License: MIT
Requires Python: >=3.6

<p align="center">
Set terminal colors based on selected xonsh theme.
</p>

<p align="center">  
If you like the idea click ⭐ on the repo and <a href="https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/dyuri/xontrib-termcolors" target="_blank">tweet</a>.
</p>


## Installation

To install use pip:

```bash
xpip install xontrib-termcolors
# or: xpip install -U git+https://github.com/dyuri/xontrib-termcolors
```

## Usage

This xontrib sets the colors of your (xterm compatible) terminal based on your xonsh theme.

```bash
$ xontrib load termcolors
```

If you change your theme and want to update the terminal colors use the `termcolors` command:

```bash
$ $XONSH_COLOR_STYLE="monokai"
$ termcolors
```

## Colors

The main 16 colors will be used directly from the pygments/ptk theme. The following special colors can be set by adding the tokens to your theme:

- `Token.Terminal.Foreground` - foreground color
- `Token.Terminal.Background` - background color
- `Token.Terminal.Curson` - cursor color

## Example

To replace all colors in xonsh and terminal to green add this to your `.xonshrc`:
```python
from xonsh.tools import register_custom_style
from xonsh import style_tools
from pygments.token import Token

mystyle = {k: '#00ff00' for k,c in style_tools.DEFAULT_STYLE_DICT.items()}
mystyle[Token.Terminal.Foreground] = '#00ff00'
mystyle[Token.Terminal.Curson] = '#00ff00'
mystyle[Token.Terminal.Background] = '#000000'

register_custom_style("green", mystyle, base=__xonsh__.env['XONSH_COLOR_STYLE'])
$XONSH_COLOR_STYLE="green"

xontrib load termcolors
```

## Credits

This package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).
btbpug 2.1.1
A feature rich API to interact with the BttesToBits API
License: MIT
Keywords: API,BtbAPI,py,python,APIWrapper,btb.py,btb,BytesToBits

# Welcome to btbpug

btbpug is a feature rich way to interact with the [BytesToBits API](https://api.bytestobits.dev/)

## Getting started

A guide on how to get btbpug up and running

### Installing


To install btbpug from PyPI use

`python3 -m pip install -U discord.py`


### Usage


Now that you have installed btbpug, lets start writing some code to see what we can do with it

Lets start simple by just returning a word

```
  import btbpug as btb
  print(btb.word())
  #citifications
```

Great, that all worked! For information on what you can do with this library look though the rest of the documentations. For more examples of using this library check out [Examples](https://github.com/Pug234/btb.py/tree/main/examples), you can also vist the rest of the [documentation](https://github.com/Pug234/btb.py/blob/main/docs/documentaion.md)