semvec/pypi-packages huggingface dataset:
orm-mysql 1.0.6
An ORM for MySql.
License: MIT

# MySql ORM

A simple Object Relational Mapper for MySql. Works with existing tables and the schema of the tables are automatically inferred.
### Install
```bash
pip install orm-mysql
```

## Connect to MySql
```python
from orm import Table

Table.connect(config_dict={
    'host': '<host_here>',
    'port': 3306,
    'user': '<user>',
    'password': '<password>',
    'database': '<database>'
})
```

## Create a class for a table
Create a class that inherits from `Table`. Initialize the class variable `table_name` with the name of the table, here 'student'
```python
from orm import Table
Table.connect(config_dict=CONFIG)

class Student(Table):
    table_name = 'student'
```

#### OR use `get_table()`
```python
from orm import Table, get_table
Table.connect(config_dict=CONFIG)

Student = get_table('student')
```

# Insert data
### Using `save()`
```python
new_student = Student(name='hrushi', age=19, gender='M')
new_student.age = 20
new_student.save()
```

### Using `create()`
```python
new_student = Student.create(name='hrushi', age=19, gender='M')
```

# Query data
### Using `where()`
```python
students = Student.where(age=19, gender='F')

for stu in students:
    print(stu.name)
```

### Using `find()`
Find a single record based on PRIMARY KEY.
```python
# find student where id(PK) = 2
student = Student.find(2)

print(student.name)
```

## Delete a record
```python
student = Student.find(2)
student.destroy()
```

## Relations
`has_many` and `belongs_to` can be used to show relationships between tables.
```python
from orm import Table, has_many, belongs_to

class Article(Table):
    table_name = 'articles'

    relations = [
        belongs_to(name='author', _class='Author', foreign_key='author_id', primary_key='id')
    ]

class Author(Table):
    table_name = 'authors'
    
    relations = [
        has_many(name='articles', _class='Article', foreign_key='author_id')
    ]

```

#### Get all the books written a Author
```python
auth = Author.find(2)
articles = auth.articles()
for art in articles:
    print(art.title)
```

#### Get Author of a book
```python
art = Article.find(5)
author = art.author()
print(author.name)
```
dcm2niixpy 1.1.0
Python package of dcm2niix
License: MIT
Requires Python: >=3.7.0,<4.0

# dcm2niixpy

Python package of dcm2niix



## Installation

```bash
pip install dcm2niixpy
```

## License

[MIT](https://github.com/Svdvoort/dcm2niixpy/blob/master/LICENSE)
survival-distributions 0.0.3
Extended functionality for univariate probability distributions in PyTorch
License: MIT
Requires Python: >=3.7

# survival_distributions

This package extends the functionality of univariate distributions in [`torch.distributions`](https://pytorch.org/docs/stable/distributions.html)
by implementing several new methods:
- `sf`: survival function (complementary CDF)
- `logsf`: logarithm of the survival function (negative cumulative hazard function)
- `logcdf`: logarithm of the CDF
- `log_hazard`: logarithm of the hazard function (logarithm of the failure rate)
- `isf`: inverse of the survival function
- `sample_cond`: instead of sampling from the full support of the distribution, 
generate samples between `lower_bound` and `upper_bound`
 
This is especially useful when working with
[temporal point processes](https://shchur.github.io/blog/2020/tpp1-conditional-intensity/)
or [survival analysis](https://en.wikipedia.org/wiki/Survival_analysis).

Naive implementation based on existing PyTorch functionality (e.g., 
`torch.log(1.0 - dist.cdf(x))` for `logsf`) will often not be as accurate and numerically 
stable as the implementation provided by `survival_distributions`.
Hopefully, these methods will be implemented in PyTorch [sometime in the future](https://github.com/pytorch/pytorch/issues/52973), 
but this package provides an alternative for the time being.

See [`DISTRIBUTIONS.md`](https://github.com/shchur/survival_distributions/blob/main/DISTRIBUTIONS.md) for more details about the implemented functions and supported distributions.

## Installation
1. Install the latest version of [PyTorch](https://pytorch.org/get-started/locally/).
2. Install `survival_distributions`
    ```bash
    pip install survival_distributions
    ```

## Supported distributions

### Numerically stable implementation
For these distributions we provide a numerically stable implementation of `logsf`.
- `Exponential`
- `Logistic`
- `LogLogistic`
- `MixtureSameFamily`
- `TransformedDistribution`
- `Uniform`
- `Weibull`

### Naive implementation 
For these distributions we implement `logsf(x)` as `log(1.0 - dist.cdf(x))`, which is less 
numerically stable.
- `LogNormal`
- `Normal`


## Usage
The package provides a drop-in replacement for `torch.distributions`, so you can just modify your code as follows.

**Old code**
```python
import torch

dist = torch.distributions.Exponential(rate=torch.tensor(2.0))
x = torch.tensor(1.5)

log_survival_proba = torch.log(1.0 - dist.cdf(x))
```
**New code**
```python
import torch
import survival_distributions as sd

dist = sd.Exponential(rate=torch.tensor(2.0))
x = torch.tensor(1.5)

log_survival_proba = dist.logsf(x)
```