semvec/pypi-packages huggingface dataset:
python-common-tools 2.6.1
python common tools
Requires Python: >3.5.0

## 一些常用的python工具箱

#### 安装
```bash
pip3 install python_common_tools
```

#### 使用
```python


import time

# 使得函数使用缓存
from python_common_tools.cache import cache_function,cache_daily_function

@cache_function('.')
def f(self, a, b, c):
    time.sleep(3)
    return a + b + c

@cache_daily_function('.')
def f2(self, a, b, c):
    time.sleep(3)
    return a + b + c

# 快速设置日志
from python_common_tools.log import setup_logger

logger = setup_logger("test.log")


# 搞定异常处理的网络请求
from python_common_tools.network import secure_requests, secure_requests_json

resp = secure_requests("https://www.gethtml.com/test", retry_times=3,log_err=True)
j = secure_requests_json("https://www.getjson.com/test",timeout=10)

# linux系统相关的获取命令执行结果  获取最新版本号 打开远程服务器上的文件
from python_common_tools.linux import get_bash_output, get_latest_commit_id, open_remote_file

dirfiles = get_bash_output(["ls", "-l"])
commit_id = get_latest_commit_id()



```
cicd-test-ziyan 0.1.1
Facebook Private Computation Service
Requires Python: >=3.8

# FBPCS (Facebook Private Computation Service)
[Secure multi-party computation](https://en.wikipedia.org/wiki/Secure_multi-party_computation) (also known as secure computation, multi-party computation (MPC), or privacy-preserving computation) is a subfield of cryptography with the goal of creating methods for parties to jointly compute a function over their inputs while keeping those inputs private.

FBPCS (Facebook Private Computation Service) is a secure, privacy safe and scalable architecture to deploy MPC (Multi Party Computation) applications in a distributed way on virtual private clouds. [FBPCF](https://github.com/facebookresearch/fbpcf) (Facebook Private Computation Framework) is for scaling MPC computation up via threading, while FBPCS is for scaling MPC computation out via [Private Scaling](https://github.com/facebookresearch/FBPCS/blob/main/docs/PrivateScaling.md) architecture. FBPCS consists of various services, interfaces that enalbe various private measurement solutions, e.g. [Private Lift](https://github.com/facebookresearch/fbpcf/blob/master/docs/PrivateLift.md).

[Private Scaling](https://github.com/facebookresearch/FBPCS/blob/main/docs/PrivateScaling.md) resembles the map/reduce architecture and is secure against a semi-honest adversary who tries to learn the inputs of the computation. The goal is to secure the intermediate output of each shard to prevent potential privacy leak.

## Installation Requirements:
### Prerequisites for working on Ubuntu 18.04:
* An AWS account (Access Key ID, Secret Access Key) to use AWS SDK (boto3 API) in FBPCS
* python >= 3.8
* python3-pip

## Installing prerequisites on Ubuntu 18.04:
* python3.8
```sh
sudo apt-get install -y python3.8
```
* python3-pip
```sh
sudo apt-get install -y python3-pip
```
## Installing fbpcs
```sh
git clone https://github.com/facebookresearch/FBPCS.git
cd FBPCS
sudo python3 -m pip install -e . --user
```

## Architecture
<img src="https://github.com/facebookresearch/FBPCS/blob/main/docs/PCSArch.jpg?raw=true" alt="Figure 1: Architecture of FBPCS" width="50%" height="50%">

### Services:

* MPCService is the public interface that provides APIs to distribute a MPC application with large dataset to multiple MPC workers on cloud.


### [Other components](https://github.com/facebookresearch/FBPCS/blob/main/docs/FBPCSComponents.md)

## Join the FBPCS community
* Website: https://github.com/facebookresearch/fbpcs
* See the [CONTRIBUTING](https://github.com/facebookresearch/FBPCS/blob/main/CONTRIBUTING.md) file for how to help out.

## License
FBPCS is [MIT](https://github.com/facebookresearch/FBPCS/blob/main/LICENSE) licensed, as found in the LICENSE file.
mlservicewrapper-host-http 0.5.1
Host an mlservicewrapper service using HTTP
Requires Python: >=3.6

[![Release](https://github.com/ml-service-wrapper/ml-service-wrapper-host-http/workflows/Create%20Release/badge.svg)](https://github.com/ml-service-wrapper/ml-service-wrapper-host-http/releases/latest)
[![PyPI Latest Release](https://img.shields.io/pypi/v/mlservicewrapper-host-http.svg)](https://pypi.org/project/mlservicewrapper-host-http/)

Host an [`mlservicewrapper.core.services.Service`](https://github.com/ml-service-wrapper/ml-service-wrapper-core) as an HTTP API.

# Testing locally

Using the development server is sufficient for testing, but should not be used in production.

## Command Line Arguments

| Parameter | Required? | Description | Format |
| --------------- | --------------- | --------------- | --------------- |
| --config | **Yes** | Path to service configuration file. | `--config <path>` |
| --host | No | Host to bind to. Defaults to 127.0.0.1. | `--host <host name>` |
| --port | No | Port to bind to. Defaults to 5000. | `--host <host name>` |


# Deployment

Use [gunicorn](https://docs.gunicorn.org/en/stable/deploy.html) to run in production:

```bash
export SERVICE_CONFIG_PATH=/path/to/config.json
gunicorn -w 4 -k uvicorn.workers.UvicornWorker mlservicewrapper.host.http
```
PointInPolygon 1.0.2
This python package is used to check point inside/outside of polygon/multipolygon. It is supported polygon to array, convert multipolygon dataframe to polygon, find the min and max item in 2D array.

# PointInPolygon

[![Build Status](https://travis-ci.com/Iceloof/PointInPolygon.svg)](https://travis-ci.com/Iceloof/PointInPolygon)
[![Coverage Status](https://coveralls.io/repos/github/Iceloof/PointInPolygon/badge.svg)](https://coveralls.io/github/Iceloof/PointInPolygon)
[![PyPI](https://img.shields.io/pypi/v/PointInPolygon)](https://pypi.org/project/PointInPolygon/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/PointInPolygon)](https://pypistats.org/packages/pointinpolygon)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/PointInPolygon)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/PointInPolygon)
![GitHub contributors](https://img.shields.io/github/contributors/Iceloof/PointInPolygon)
![GitHub issues](https://img.shields.io/github/issues-raw/Iceloof/PointInPolygon)
![GitHub Action](https://github.com/Iceloof/PointInPolygon/workflows/GitHub%20Action/badge.svg)
![GitHub](https://img.shields.io/github/license/Iceloof/PointInPolygon)

This package is used to check point inside/outside of polygon/multipolygon. It is supported polygon to array, convert multipolygon dataframe to polygon, find the min and max item in 2D array.

## Install
```
pip install PointInPolygon
```
or
```
pip install --upgrade PointInPolygon
```
## Usage
- Import package
```
import PointInPolygon as pnp
```
- Geometry Polygon to Array (skip steps to simplify the data and reduce the size of array, if it is multipolygon, it needs to convert to polygon first)
```
pnp.Geo2Array(geo, skip=0)
```
- Convert df multipolygon to polygon (the column name should be geometry)
```
pnp.MultiPolygon2Polygon(df)
```
- Check point in polygon (list or 2D tuple)
```
pnp.PointInPolygon(point, polygon)
```
- Get min value from array based on index
```
pnp.minValue(array, index)
```
- Get max value from array based on index
```
pnp.maxValue(array, index)
```
nwc-pattern-miner 0.2
Mines sequence patterns co-occuring with non-compliant windows in a target feature.
Requires Python: >=3.7

# nwc-pattern-mining
Non-compliant Window Co-occurrence pattern mining in temporal data

- A Python library to find sequential association patterns in time-series data, co-occurring with target anomalous windows.
- Anomalous windows are sequences in which a target variable defies expected behavior (e.g. Emissions from a vehicle).
- The patterns are found in co-occurrence with a specific non-compliant feature (to decipher the reason behinds it's irregular behavior).
- The package uses various pruning methodologies to speed up pattern mining, and hashing for quick support count.
- The algorithm is based on research: (Discovering non-compliant window co-occurrence patterns)[https://link.springer.com/article/10.1007/s10707-016-0289-3]

# API-description:
`from nwc_pattern_miner import mine_sequence_patterns`

## API Parameters: 
- **series_df**: `pd.DataFrame`; Input DataFrame (Only features [discretized] and Target [binarized] columns)  
- **nc_window_col**: `str`; Column Name with Binary Target (Anomalous Windows)
- **support_threshold**: `float`; Support threshold for sequence co-occurrence patterns
- **crossk_threshold**: `float`; Ripley's Cross-k threshold for sequence co-occurrence patterns
- **pattern_length**: `int`; length of feature sequences co-occurring with anomalous windows
- **confidence_threshold**: `float, default=-1`; Confidence threshold for sequence co-occurrence patterns
- **lag**: `int, default= 0`; lag consideration between sequence patterns and anomalous windows
- **invalid_seq_indexes**: `list, default=list()`; list of indexes across which sequence patterns would be invalidated
- **output_metric**: `{'crossk', 'support'}, default='crossk'`; Metric used to sort patterns mined
- **output_type**: `{'topk', 'threshold'}, default='topk';` Type of output for sequence patterns mined
- **output_threshold**: `float, default= -1`; Threshold cutoff used to get output sequence patterns, if `output_type='threshold'`
- **topk**: `int, default=100`; Top-k sequence patterns obtained based on `output_metric`, if `output_type='topk'`
- **pruning_type**: `str, default=apriori`; Between `[apriori, br-dr]`, both have same run-time, 'br-dr' does more enumerations but enumeration speed is much faster due to UB pruning. 

## Sample Input DataFrame:
| engrpm      | EGRkgph     | MSPhum      | EngTq       | NCWindow    |
| ----------- | ----------- | ----------- | ----------- | ----------- |
| 9           | 11          | 5           | 3           | 1           |
| 3           | 1           | 5           | 4           | 0           |


## Sample Output DataFrame:
| engrpm | EGRkgph | MSPhum | EngTq | Count | Support | Kvalue | Confidence | First Occurrence Index |
| -------| --------| -------| ------| ------| --------|--------|------------|------------------------|
|        | 4 4 4   | 5 5 5  | 2 2 2 | 146   | 0.00528 | 2.377  | 1.0        | 47167                  |
|        | 4 4 4   |        | 7 7 7 | 250   | 0.00643 | 2.357  | 1.0        | 41984                  |