semvec/pypi-packages huggingface dataset:
bigot 1.0.2
Benchmarking library with Space and Time Complexity estimation

![Example complexity graph](https://raw.githubusercontent.com/arnaudsm/bigot/master/images/graph.png)
# Bigot
Benchmarking library with Space and Time Complexity estimation.  
*Pull requests are welcome !*

## Installation
`pip install bigot`

## Usage
### Provide a benchmark function with a single dimension parameter
```python
def on(n):
    x = 10000000*"-"*int(n)
    sleep(0.001*n)
    
import bigot
print("Function has a space complexity of", bigot.Space(on2),
      "and a time complexity of", bigot.Time(on2))
```
```
Function has a space complexity of O(n^2) and a time complexity of O(n^2)
```

### You can test our fancy options. See docstrings for reference.
```python
bench = bigot.Time(
    on2,
    plot=True,
    duration=1,
    verbose=True,
    name="My fancy function"
)
```

### And check the number of iterations, useful when comparing functions
```python
print(bench.iterations, "iterations in", bench.duration, "seconds")
```
```
8 iterations in 8 seconds
```
### You can also compare multiple functions
```python
def on2(n):
    x = 10000000*"-"*int(n**2)
    sleep(0.001*n**2)

print(bigot.Compare([on, on2]).space())
```
```
  Name  Duration  Iterations Space complexity
0   On       1.0        49.0             O(n)
1  On2       1.0         8.0           O(n^2)
```

## Testing
`pytest .`
rockblox 0.0.1
Roblox wrapper, with support for the game client
Requires Python: >=3.6

# rockblox
Python Roblox wrapper, primarily focused on the game client.

Since this module doesn't directly hook into the client, it is limited by the following things:
- It can only interact with one client at a time
- Keystrokes may fail to register in time, causing chat messages to cut off

DM me if you know of a way to send keystrokes to the client, without focusing the window.

# Setup
```bash
pip install -U git+https://github.com/h0nde/rockblox.git
```

# Usage
```python
import rockblox
from time import sleep

mutex = rockblox.ClientMutex() # allows multiple clients to be open at once

# create new session using cookie.txt
with open("cookie.txt") as f:
  session = rockblox.Session(f.read().strip())

with rockblox.Client(session, 1818) as client:
  client.wait_for(15) # wait up to 15 seconds for game to load
  print(f"joined game with {session.name}!")
  client.chat_message("burger")
  sleep(1)
  client.screenshot().show()
```

# Documentation
### Session(ROBLOSECURITY, requests_session=None, user_agent=DEFAULT, proxy_url=None, host="roblox.com")
Creates a new session instance.

### ClientMutex()
Takes control of the client mutex, so that multiple client instances can be open at the same time. Won't work if an instance is already open before it is called.

### Client(session, place_id, job_id=None, client_path=default)
Creates a new client instance.

### Client.wait_for(timeout=15, check_interval=0.25, ignore_colors=\[(45, 45, 45)])
Waits until the client is past the loading screen. This uses the screenshot method and therefore may not be 100% reliable.

### Client.ping(match_place_id=True, match_job_id=False) -> bool
Checks if the user is currently in-game using the presence web-api, can be used as a kind of "ping" to check if the client has disconnected from the game.

### Client.screenshot() -> PIL.Image
Returns a `PIL.Image` screenshot of the client in it's current window size.

### Client.chat_message(message)
Attempts to write and send a chat message by simulating keystrokes on the client.

### Client.close()
Kills the client process.