semvec/pypi-packages huggingface dataset:
curvanato 1.2.0
Anatomical curvature processing for medical images.
Keywords: curvanato, caudate, medical image processing

# curvanato

local curvature quantification for anatomical data


### **Installation & Testing**

To install the package locally, navigate to the package root and run:

```bash
python3 -m pip install curvanato 
```

if you want to see some examples of different things the package can do, clone the source package and investigate the contents of the `tests` directory.

## Usage

```python
import ants
import antspynet
import antspyt1w
import curvanato
import re
import os  # For checking file existence
import pandas as pd
import numpy as np
os.environ["ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS"] = "32"
ctype='fs'
tcaudR=curvanato.load_labeled_caudate( option='hmt', binarize=False, label=[2,4,6] )
caudseg=curvanato.load_labeled_caudate( option=ctype )
# this step is important - fs caudate segmentations look pretty terrible in comparison to what i am used to ....
caudseg=ants.threshold_image( caudseg, 50, 50 ).resample_image( [0.5,0.5,0.5], interp_type=0 ).threshold_image(0.5,1)
fn='/tmp/cc_example.nii.gz'
vlab=None
gr=0
subd=0
ccfn = [
        re.sub( ".nii.gz", "_"+ctype+"Rkappa.nii.gz" , fn ), 
        re.sub( ".nii.gz", "_"+ctype+"R.nii.gz" , fn ),
        re.sub( ".nii.gz", "_"+ctype+"Rthk.nii.gz" , fn ),
        re.sub( ".nii.gz", "_"+ctype+"Rkappa.csv" , fn ),
        re.sub( ".nii.gz", "_"+ctype+"Rkappa.png" , fn ),
        re.sub( ".nii.gz", "_"+ctype+"Rthk.png" , fn ) ]
pcaud=[3,4]
plabs=[4]
mytl=1
xx = curvanato.t1w_caudcurv(  caudseg, target_label=mytl, ventricle_label=vlab, 
        prior_labels=pcaud, prior_target_label=plabs, subdivide=subd, grid=gr,
        priorparcellation=tcaudR,  plot=True, smoothing=0.5,
        verbose=True )
ants.plot( xx[0], xx[1], crop=True, axis=2, nslices=21, ncol=7, filename=ccfn[4] )
ants.plot( xx[0], xx[2], crop=True, axis=2, nslices=21, ncol=7, filename=ccfn[5] )
for j in range(3):
    ants.image_write( xx[j], ccfn[j] )
xx[3].to_csv( ccfn[3] )
```


## Example data

this package has been tested on [ANTPD data from openneuro](https://openneuro.org/datasets/ds001907/versions/2.0.3).

could also try data [here](https://openneuro.org/datasets/ds004560/versions/1.0.1) which included repeated T1w acquisitions on same subjects but with different parameters.    however, last time i tried this, the link was not working.


```
rm -r -f build/ curvanato.egg-info/ dist/
python3 -m  build .
python3 -m pip install --upgrade twine
python3 -m twine upload --repository curvanato dist/*
```
ailibrary 0.1.5
AI Library REST API for any Python 3.9+ application.
Requires Python: >=3.9

# AI Library Python API Library

The AI Library Python library provides convenient access to the AI Library REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients.

## Installation

```
pip install ailibrary
```

## Usage

```
import os
import ailibrary as ai
client = ai.AILibrary(
    api_key=os.environ.get("AI_LIBRARY_KEY"),
    domain="https://api.ailibrary.ai/" // only required for self-hosted AI Library instances
)
```

## Creating your first agent

Initialise your agent
```
sales_agent = client.agent.create(
    title = "Sales Agent"
    instructions="You are a sales agent trying to qualify a lead. You are receiving this "
    )
```
Add training files
```
client.files.upload(
    files = ['/local/path/to/file.pdf'], //txt, pdf, pptx, docx, xlsx
    knowledge_id = sales_agent.knowledge_id
)
```
Check status of the agent knowledge
```
print(client.knowledge_base.get_status())
```

Chat with agent

```
completion = agent.chat(
    messages = [
        {
            "role": "assistant",
            "content": "Hey, are you looking to buy?"
        },
        {
            "role": "user",
            "content": "Yes, I want to know more first"
        }
    ]
)

```
NeuraForge 0.3.0
A basic AI library built off of google gemini api
Requires Python: >=3.9

## NeuraForge  

NeuraForge  is a basic AI library made to simplify the usage of the genai library by providing basic functions for chat at a higher level.


## Installation

To install NeuraForge , you can simply use:

```bash
pip install NeuraForge  
```

## Usage
```python
#Set your api (does not return in a variable)
API(your_api_key)
#Make the model, settings can be altered (returns the model in a variable), code example provides default settings
model = Model(model = "gemini-1.5-pro", temperature = 1, top_p = 0.95, top_k = 40, max_output_tokens = 8192)

#Uses model created above to make a chat (returns chat in a variable)
chat = Chat(model)

#Sends a message to your chat, replace chat with the varible you have named your chat
#Note that images are optional
response = Send(chat, "Hello, how are you?", path=your_image_path)
#
print(response)
```

# Bugs

If you are finding bugs in the code, please report them to me @aaroh.charne@gmail.com.
Please include a snippet of your code as well the problem. Thank You


```
fast-censor 0.3.2
A fast and flexible utility for censoring and filtering text

# Fast Censor

## fast_censor

* A fast and flexible package for filtering out profanity or other strings from text, ~100 times faster than alternatives
* the fastest string utility for profanity detection / censoring
* Allows for detection with repeated characters and character substitution
* Zero-dependency and works for python 3.6 -- 3.11

## Installation

### From source
```
cd fast-censor  # enter into project directory
python setup.py install 
# or with pip locally
pip install -e . 
```

### From GitHub
`pip install git+https://github.com/mbuchove/fast_censor.git`


## Uses
```
from fast_censor import FastCensor

# to load default (encoded) profanity word list
censor = FastCensor()

# load alternate path, example is a plain text word list without encoding
censor_clean = fast_censor.FastCensor(
    wordlist=fast_censor.WordListHandler.get_default_wordlist_path("clean_wordlist_decoded.txt"), 
    wordlist_encoded=False,
)
censor_clean.add_words(['bat', 'rick'])

# censor texts or simply get the indices of matches
matches = censor_clean.check_text("this bat is for riii1ick")
# >>> [(5, 9), (17, 25)]
censored_text = censor_clean.censor("fuuudge you")
# >>> "******* you"
```

###  Character substitutions
FastCensor's profanity matcher allows the flexibility to match words when specified characters are substituted for others, 
as is customary in 1337 speak. A default is set for commonly used substitutions.

To set your own, for example, you would pass the following into `FastCensor`

`substitutions = {'a': '@4'}`

* all matching is case-insensitive

### Character repititon
By default, words will still match even if a matching character is repeated any number of times.
This includes any valid substitute for that character

For example, `"baaa@@aatt"` will match `"bat"` 

You can turn this off by passing `allow_repititions=False` to `censor_text` or `check_text`

### Delimiters
Use the `delimiters` parameter of `FastCensor` to set the delimiter characters, which determine the boundaries of a word. 
Profanity matches will not extend across any delimiting character.

For example, if `'_'` is a delimiter, "ba_t" would not match "bat"


## Editing and saving wordlist
`censor.add_word('new_word')  # to add a new word`
`censor.write_words_file("word_lists/new_wordlist_encoded.txt", encode=True)`

### Encoding
By default, the word lists are base64-encoded, so you can avoid displaying vulgar or offensive words. 
If you would like to save a word list in plain text, set `encode=False` in `write_words_file`


## Benchmarks

See: [This Gist](https://gist.github.com/mbuchove/02752cd868b6cc207b0b1261b015be3a) for performance measures of filtering compared to other packages