semvec/pypi-packages huggingface dataset:
sydney-magic 0.27
An IPython magic extension for interacting with Sydney.py
Keywords: ipython magic sydney

# Sydney Magic for IPython

Sydney Magic is an IPython extension that provides line and cell magics for interacting with [Sydney.py](https://github.com/vsakkas/sydney.py), an unofficial Python client for Copilot (formerly named Bing Chat), also known as Sydney. This extension allows users to easily use Copilot's capabilities directly within IPython notebooks or shells.

## Features

- Ask questions or make requests to Copilot with `%sydney ask "<prompt>"`.
- Compose content with specific formats and tones using `%sydney compose "<prompt>"`.
- Supports streaming responses for real-time interaction.
- Automatically handles conversation limits by resetting the conversation.

## Installation

To install Sydney Magic, follow these steps:

1. Clone this repository or download the source code.
2. Navigate to the directory containing `setup.py`.
3. Install the module using pip:

```bash
pip install .
```

This command installs Sydney Magic and its dependencies.

## Setting Up the Cookie Environment Variable

Sydney Magic requires a cookie from the Copilot web page to authenticate requests to the Copilot API. To set up this cookie:

1. Go to the [Copilot web page](https://copilot.microsoft.com/).
2. Open the developer tools in your browser (usually by pressing `F12` or right-clicking on the chat dialog and selecting `Inspect`).
3. Select the `Network` tab to view all requests sent to Copilot.
4. Write a message on the chat dialog that appears on the web page.
5. Find a request named `create?bundleVersion=XYZ` and click on it.
6. Scroll down to the requests headers section and copy the entire value after the `Cookie:` field.

Then, set it as an environment variable in your shell:

```bash
export BING_COOKIES="<your-cookies>"
```

Alternatively, you can set the cookie within your IPython notebook or script using the `helper_set_cookie("<your-cookies>")` function provided by Sydney Magic.

## Usage

After installation, load the extension in your IPython environment:

```python
%load_ext sydney_magic
```

### Examples

Ask Copilot a question:

```python
%sydney ask "What is the weather like today?"
```

Compose content with specific formatting:

```python
%sydney compose "Write a short story about a robot" --format=blogpost --tone=enthusiastic
```

For more information on commands and options, use:

```python
%sydney help
```

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/yourusername/sydney_magic/LICENSE) file for details.
ubergraph 0.0.2
A wrapper around pygraphviz to implement an ubergraph
Requires Python: >=3.8

# Ubergraph

This is a package used to wrap [pygraphviz](https://pypi.org/project/pygraphviz/) to create ubergraphs.

Ubergraphs are based upon [the paper](https://arxiv.org/pdf/1704.05547.pdf).

# Importing ubergraph

from ubergraph import ubergraph

# Functions

## Create an ubergraph

You can create an ubergraph which is simply a directed graph in pygraphviz.

```python
u = ubergraph.ubergraph()
```

## Add a node to the ubergraph

You can add nodes to your ubergraph.

```python
u = ubergraph.add_node(u, "node")
```

## Add an edge to the ubergraph

You can add edges to your ubergraph.
The lists may be empty.
Any undefined nodes or edges will be added to the ubergraph.

```python
u = ubergraph.add_edge(u, "edge", list_of_from_nodes, list_of_to_nodes, list_of_from_edges, list_of_to_edges)
```

## Get the nodes in the ubergraph

You can get the nodes in your ubergraph.

```python
nodes = ubergraph.get_nodes(u)
```

## Get the edges in the ubergraph

You can get the edges in your ubergraph.

```python
edges = ubergraph.get_edges(u)
```

## MAY BE BUGGY: Get the nodes and edges from a node or edge

```python
froms = get_from(u, node_or_edge)
```

## MAY BE BUGGY: Get the nodes and edges to a node or edge

```python
tos = get_to(u, node_or_edge)
```

## MAY BE BUGGY: Get the edges that a node or edge is in

```python
in_edges = get_in_edges(u, node_or_edge)
```

## MAY BE BUGGY: Get the edges that is in a node or edge

```python
out_edges = get_out_edges(u, node_or_edge)
```

## View our ubergraph

Because our ubergraph, u, is a pygraphviz object we can view it by setting the layout (one of https://graphviz.org/docs/layouts/) and then drawing it:
```python
u.layout("circo") # could be other layouts from https://graphviz.org/docs/layouts/
u.draw("filename.png")
```
ICPy 0.0.6
Invariant Causal Prediction for python
Requires Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7
Keywords: statistics, casual-inference

## ICPy
[![CI](https://github.com/jan-glx/ICPy/actions/workflows/ci.yml/badge.svg)](https://github.com/jan-glx/ICPy/actions/workflows/ci.yml) [![Coverage badge](https://raw.githubusercontent.com/jan-glx/ICPy/python-coverage-comment-action-data/badge.svg)](https://htmlpreview.github.io/?https://github.com/jan-glx/ICPy/blob/python-coverage-comment-action-data/htmlcov/index.html)
[![PyPI version](https://img.shields.io/pypi/v/ICPy.svg)](https://pypi.org/project/ICPy/)

This packages provides a simple python implementation of Invariant Causal Prediction (ICP) [1].<br>
The source code for the actual algorithm resides in [./src/icp/ICP.py](./src/icpy/ICP.py). <br>
See also the original implementation in the R package [InvariantCausalPrediction](https://cran.r-project.org/web/packages/InvariantCausalPrediction/index.html).
### Installation
``` bash
pip install ICPy
```
### Usage
``` python
import icpy as icpy
import numpy as np

np.random.seed(seed=1)
n = 100
noise = 0.1
E = np.repeat([0, 1, 2], np.ceil(n / 3.0))[0:n]                       # "Environment"
A = np.random.normal(scale=noise, size=[n]) + np.equal(E, 1)          # Node A
B = A + np.random.normal(scale=noise, size=[n]) / 3 + np.equal(E, 2)  # Node B
C = B + np.random.normal(scale=noise, size=[n])                       # Node C

#  /--->---\
# E -> A -> B -> C

icpy.invariant_causal_prediction(X=np.column_stack((A, B)), y=C, z=E) # test if A or B are parents of C
```
Output

``` python
ICP(S_hat=array([1], dtype=int64),                         # Column 1 = Node B was (correctly) identified as parent of C
    p_values=array([  1.51508232e-01,   4.59577055e-37]),  # error levels at which A and B would/are indentied as parent of C
    p_value=0.16416488336322549)                           # p-value for testing against violation of the model assumptions (e.g. a direct effect of E on C)
```

### News
v0.0.003 (2020-05-15)
* fix failing import (thanks to [@lgmoneda](https://github.com/lgmoneda), [#1](https://github.com/jan-glx/ICPy/pull/1))
* fix issues when environments are not subsequent whole numbers starting at 0 (thanks to [@lgmoneda](https://github.com/lgmoneda), [#1](https://github.com/jan-glx/ICPy/pull/1))

### References
[1] J. Peters, P. Bühlmann, N. Meinshausen, Causal inference by using invariant prediction: identification and confidence intervals, J. R. Stat. Soc. Ser. B Stat. Methodol. 78 (2016) 947-1012. doi:10.1111/rssb.12167.
toastypy 0.0.3
Simple python package for keeping your lambda functions warm using an eventbridge schedule
Requires Python: >=3.8

# 🍞 Toasty - The Lambda Warmer

Toasty is a simple Python library designed to keep your AWS Lambda functions warm using an EventBridge schedule. It provides a decorator `@toasty` for your Lambda functions and a CDK construct `LambdaWarmer` for setting up the warming schedule.

## Installation

You can install the Toasty library using pip:

```bash
pip install toastypy
```

## Usage

### Toasty Wrapper

The `@toasty` wrapper can be used to decorate your Lambda functions. Here's an example:

```py
from toastypy.toastypy import toasty

@toasty
def my_lambda_function(event, context):
    # Your function logic here
    pass
```

### LambdaWarmer CDK Constuct

The `LambdaWarmer` construct can be used in your CDK stack to set up the warming schedule for your Lambda functions. Here's an example:

```py
from aws_cdk import aws_lambda as _lambda
from toastypy.constructs.lambda_warmer import LambdaWarmer

# Assuming `app` and `stack_id` are your CDK app and stack ID
my_lambda = _lambda.Function(
    app, "MyLambdaFunction",
    # Lambda function properties here
)

LambdaWarmer(
    app, "MyLambdaWarmer",
    lambda_to_warm_arn=my_lambda.function_arn,
    concurrency=20,
    environment="nonprod",
)
```

In this example, LambdaWarmer is set up to warm my_lambda function. The concurrency parameter specifies how many concurrent executions to use for warming, and environment is an optional parameter for specifying the environment.

Please refer to the LambdaWarmer and toasty in the source code for more details.