semvec/pypi-packages huggingface dataset:
types-firebase-admin 0.1.1
Type stubs for firebase-admin package
Requires Python: >=3.7
Keywords: admin, firebase, stubs, types, typing

# types-firebase-admin

Type stubs for the `firebase-admin` Python package.

## Installation

```bash
pip install types-firebase-admin
```

## Usage

These stubs provide type information for the `firebase-admin` package. They will be automatically used by type checkers like mypy when you import `firebase-admin`.

```python
from firebase_admin import credentials, initialize_app

cred = credentials.Certificate('path/to/serviceAccount.json')
app = initialize_app(cred)
```

## Development

This package contains type stubs for the `firebase-admin` package. The stubs are manually curated to provide accurate type information for the Firebase Admin SDK.

## License

MIT
gpu-scheduler 0.1.1
A simple tool to schedule gpu resources.
Requires Python: >=3.10

# GPU Scheduler

A simple tool to schedule gpu resources.

Let's say you have a server with 4 GPUs and you want to run 10 jobs (each job requires 1 GPU). They can finish any time and you don't want to sit in front of the server to run one after another, You can use this tool to schedule the jobs and it will run the jobs as soon as needed gpu is available.

## Installation

```bash
pip install gpu-scheduler
```

## Usage

```python
import time
from gpu_scheduler import GPUScheduler

def hf_with_given_gpu_ids(model_id, gpu_ids: list):
    device_map = {str(i): f"cuda:{gpu_id}" for i, gpu_id in enumerate(gpu_ids)}
    model = AutoModel.from_pretrained(model_id, device_map=device_map)
    # ...
    return model

def func(model_id, gpu_ids: list):
    """
    The function must accept gpu_ids as an argument
    This is the list of GPU IDs that the job will run on
    You have to manually set the GPU IDs in your code, i.e., above `hf_with_given_gpu_ids` function
    """
    time.sleep(4)  # Simulate job running
    return model_id, gpu_ids

if __name__ == "__main__":
    # Initialize scheduler with available GPUs
    scheduler = GPUScheduler([0, 1, 2, 3])  # 4 GPUs numbered 0-3

    # Add example model training jobs with different GPU requirements
    scheduler.add_job(0, func, num_gpus=1, model_id="model_small")
    scheduler.add_job(1, func, num_gpus=2, model_id="model_medium")
    scheduler.add_job(2, func, num_gpus=4, model_id="model_large")
    scheduler.add_job(3, func, num_gpus=1, model_id="model_small_2")
    scheduler.add_job(4, func, num_gpus=2, model_id="model_medium_2")
    scheduler.add_job(5, func, num_gpus=3, model_id="model_large_2")

    # This job will fail because it requires more GPUs than are available
    scheduler.add_job(999, func, num_gpus=5, model_id="model_too_big")

    # Start processing jobs
    scheduler.start_scheduler()

    print("Job results:")
    for job_id, result in scheduler.results:
        print(f"{job_id=}: {result=}")
```

### Output
```
Job results:
job_id=999: result='Error: Job 999 requires 5 GPUs, but only 4 are available in total'
job_id=1: result=('model_medium', [1, 2])
job_id=0: result=('model_small', [0])
job_id=3: result=('model_small_2', [3])
job_id=5: result=('model_large_2', [1, 2, 0])
job_id=2: result=('model_large', [3, 1, 2, 0])
job_id=4: result=('model_medium_2', [3, 1])
```
api-security-tester 0.2.0
A machine learning based mobile app security testing framework
Requires Python: >=3.8

# API Security Tester

A machine learning-based framework for testing and assessing mobile application security vulnerabilities.

## Features

- Vulnerability detection using machine learning
- Security risk assessment
- Detailed security reports generation
- Advanced metrics calculation (ROC-AUC, PR-AUC)
- Support for multiple security features analysis

## Installation

```bash
pip install api-security-tester
```

## Quick Start

```python
from api_security_tester import MobileAppSecurityFramework

# Initialize the framework
framework = MobileAppSecurityFramework()

# Example security features to analyze
app_features = {
    'storage_encryption_level': 0.8,
    'api_security_score': 0.7,
    'data_transmission_security': 0.9,
    'authentication_strength': 0.8,
    'input_validation_score': 0.7,
    'network_communication_security': 0.8,
    'third_party_library_risk': 0.2,
    'runtime_permissions_management': 0.7,
    'code_obfuscation_level': 0.6,
    'certificate_pinning_implementation': 0.8
}

# Detect vulnerabilities
results = framework.detect_vulnerabilities(app_features)

# Generate security report
report = framework.generate_security_report(results)
print(report)
```

## Security Features

The framework analyzes the following security aspects:

1. Storage Encryption Level
2. API Security
3. Data Transmission Security
4. Authentication Strength
5. Input Validation
6. Network Communication Security
7. Third-party Library Risk
8. Runtime Permissions Management
9. Code Obfuscation
10. Certificate Pinning

## Advanced Usage

### Training Custom Models

```python
# Generate and train with custom dataset
framework.generate_dataset(n_samples=1000)
framework.load_dataset('mobile_app_vulnerabilities.csv')
framework.build_ml_model()
framework.train_model()

# Save trained model
framework.save_model('custom_model.h5')
```

### Calculating Advanced Metrics

```python
# Get model performance metrics
metrics = framework.calculate_advanced_metrics()
print(f"ROC-AUC Score: {metrics['roc_auc']}")
print(f"PR-AUC Score: {metrics['pr_auc']}")
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Support

For support, please open an issue in the GitHub repository or contact contact@ashinno.com
expiring-dict 1.1.2
Python dict with TTL support for auto-expiring caches

# py-expiring-dict
Python dict with TTL support for auto-expiring caches


# Install
```bash
pip install expiring-dict
```

# Usage
## Class Level TTL
```python
from time import sleep
from expiring_dict import ExpiringDict

cache = ExpiringDict(1)  # Keys will exist for 1 second

cache["abc123"] = "some value"
assert "abc123" in cache
sleep(1)
assert "abc123" not in cache
```

## Key Level TTL
```python
from time import sleep
from expiring_dict import ExpiringDict

cache = ExpiringDict()  # No TTL set, keys set via [] will not expire

cache["abc"] = "persistent"
cache.ttl("123", "expired", 1)  # This will expire after 1 second
assert "abc" in cache
assert "123" in cache
sleep(1)
assert "abc" in cache
assert "123" not in cache
```
pietro-settings-manager 1.0.4
A Python settings manager package that allows you to make settings handling easy.
Requires Python: >=3.8

[![CD](https://github.com/P1etrodev/settings-manager/actions/workflows/publish.yml/badge.svg)](https://github.com/P1etrodev/settings-manager/actions/workflows/publish.yml)

# SettingsManager

A simple Python class for managing configuration settings using an INI file. The class provides methods to load, save, get, and set configuration values, with support for default settings and type conversion.

## Features

- Load and save settings from/to an INI file.
- Apply default settings if the configuration file does not exist.
- Get configuration values with optional type conversion (`bool`, `int`, `float`).
- Set configuration values, ensuring the section exists before setting the key-value pair.
- Uses Python's `configparser` module for parsing INI files.

## Usage

```py
# Define default configuration values
default_config = {
	"general": {
		"theme": "light",  # Default theme
		"language": "en",  # Default language
		"notifications_enabled": True  # Enable notifications by default
	},
	"user": {
		"username": "default_user",  # Default username
		"email": "user@example.com"  # Default email address
	}
}

# Create an instance of SettingsManager with a specific config file and default values
settings_manager = SettingsManager(file_name="my_config.ini", defaults=default_config)

# Load configuration from the file (if it exists) or apply the default values
settings_manager.load()

# Retrieve configuration values using the 'get' method
theme = settings_manager.get("general", "theme")  # Get the theme value
language = settings_manager.get("general", "language")  # Get the language value
notifications_enabled = settings_manager.get("general", "notifications_enabled", "bool")  # Get notifications status as a boolean

# Print the retrieved configuration values
print(f"Theme: {theme}")
print(f"Language: {language}")
print(f"Notifications enabled: {notifications_enabled}")

# Change some configuration values
settings_manager.set("general", "theme", "dark")  # Change theme to dark
settings_manager.set("user", "username", "new_user")  # Change username

# Save the changes to the configuration file
settings_manager.save()
```
simulinkRunner 1.0.1
A python wrapper for running the simulink model with multiple batch
Requires Python: >=3.7

# SimulinkRunner
`SimulinkRunner` is an automation tool designed to streamline the process of running and managing Simulink models. This provides a simple API to simulate the model multiple times for further recording and testing, helpful for control system design and analysis.

## Prerequisite
To enable this library, the [Matlab engine for Python](https://github.com/mathworks/matlab-engine-for-python) should be manually installed on your PC, according to your MATLAB version.

## Installation
The package can be installed via `pip`
```sh
pip install simulinkRunner
```
And it can also be installed from source code:
```sh
git clone git@github.com:PACRian/SimulinkRunner.git
cd simulinkRunner
pip install -e .
```

## Quickstart
Firstly, import related utiltis from `simulinkRunner` and initialize the `matlab.engine` object
```python
import matlab.engine
from simulinkRunner import Model, Runner, OutputPortProcessor, HDF5Recorder

eng = matlab.engine.start_matlab()
``` 

Two main classes should be utilized, one is `Model` used to initialize a Simulink model reference object:
```python
model = Model(eng, MODEL_NAME)
```

Then you need to introduce a `Runner` instance to construct the simulation framework, for parameter management, data processing, recording, etc.
```python
runner = Runner(model, 
        model_path=MODEL_PATH,
        model_args=MODEL_MULTI_ARGS,
        sim_args=SIM_ARGS,
        rec_path=HDF5_PATH,
        rec_cls=HDF5Recorder,
        proc_cls=OutputPortProcessor)
```
Call `runner` to perform the simulation, and close the content by calling `close()`:
```python
runner()
runner.close()
```

Check the simple demo [`run_batch_test.py`](https://github.com/PACRian/SimulinkRunner/blob/master/run_batch_test.py) along with a simple Simulink model [`test.slx`](https://github.com/PACRian/SimulinkRunner/tree/master/tests/simulink_model)(located in `tests/simulink_model`), execute the script to run the Simulink model multi-batch.
```bash
python .\run_batch_test.py
```

## Command line tool
[TODO]