semvec/pypi-packages huggingface dataset:
maxcutpy 0.1.1
A Python Implementation of Graph Max Cut Solutions
License: MIT
Requires Python: >=3.8,<4.0

# maxcutpy
 A Python Implementation of Graph Max Cut Solutions

## Problem Statement
The goal of this script is to provide simple python libraries for solving the [Maximum cut problem](https://en.wikipedia.org/wiki/Maximum_cut).

## Current Solvers

### Universal
The Structure of all Solvers is the same, from an API point of view.
This allows for quick testing of multiple different solvers, to find the best one.

In general, the flow will look like this:

    from maxcutpy import RandomMaxCut
    import numpy as np

    matrix = np.array([[0,1,1],[1,0,5],[1,5,0]])
    random_max_cut = RandomMaxCut(matrix=matrix, seed=12345)

    best_cut_vector = random_cut.batch_split()

`best_cut_vector` will be a numpy array of shape `(1,n)` where n is the number of rows in the input matrix. Each number inside of `best_cut_vector` will be an integer 0 or 1, depending on if it belongs to the 0th Slice or the 1st Slice.

You can then generally check the score of this `best_cut_vector` by using the same object again:

    best_cut_score = random_cut.best_cut_score

At this time, a single Solver Object is Single-Use only, meaning it gets created for a specific matrix, and provides a batch split for this matrix only. Once the result is calculated, it will be stored, and repeated calls to `batch_split()` will only return the cached result.

For now, the matrix must be in the form of a numpy adjacency matrix, but support will be added soon for networkx Graph objects, as well as helper functions to transform between the two.

### RandomMaxCut
This solve provides a method to compare against, as all this Solver does is select a random set of vertices to cut, giving each vertex a 50% chance of occurring in a different slice of the graph.

    from maxcutpy import RandomMaxCut
    import numpy as np

    matrix = np.array([[0,1,1],[1,0,5],[1,5,0]])
    random_max_cut = RandomMaxCut(matrix=matrix, seed=12345)

    best_cut_vector = random_cut.batch_split()

`best_cut_vector` will be a numpy array of shape `(1,n)` where each entry is a random integer 0 or 1, with 50% probability for either event. This means this could lead to the case where no cuts are made at all, yielding a score of 0.
syncP 1.0.4
A mpv syncing tool among clients and host for local media files
License: MIT
Requires Python: >=3.4

# syncP

A tool to sync mpv player between host and clients. Great help from [jaseg/python-mpv](https://github.com/jaseg/python-mpv), please check it out.

## How to use

### Requirements
- libmpv_32bit
- python3

### Steps

Install the wheel package manually by downloading it from [releases](https://github.com/lawRathod/syncP/releases/download/v0.1-alpha/syncP_lawRathod-0.0.1-py3-none-any.whl) or using **pip install syncP**.

[For Windows]
- You will need to download the libmpv zip from [Official Mpv Project](https://sourceforge.net/projects/mpv-player-windows/files/libmpv/), please use the lastest 32 bit version of libmpv.
- After extracting to a folder, add the path of the folder in your system path variable.
- To test if the path is set right, execute **syncp test** and check if the test video plays, you can press **q** to exit.
- Assuming the test works, you can now either host a connection or join, I have explained the step below.

[For Linux]
- Install mpv for you distribution and then try executing **syncp test** in your terminal.
- Assuming the test works, you can now either host a connection or join, I have explained the step below.

### Using the tool
[For Host]
- Navigate to the directory with your media file you wanna sync and run **syncp host**. Follow the instructions on the terminal and this will open a port on your system for communication.
- You will need to port forward using [ngrok](https://ngrok.com/) or config your router, I would suggest use [ngrok](https://ngrok.com/) tcp feature for this purpose.
- Optionally you can specify port and limit for number of clients you want to add using the options **--limit** and **--port**. The default port is 3456 and limit is 5. Example: **syncp host --port 1234 --limit 20**

[For Client]
- Nagigate to the directory with your media file you wanna sync and run **syncp client**. Follow the instructions where it will ask you for the host url and port.
- Upon entering the details you can choose the media.

If everything went well you will be connected and the media will begin to play in your own respective mpv windows. 

### Keybindings
Not all events are synced, for now you can use **space** to sync pause and play and the host can use **s** to sync the location of the mediaplayback. I would suggest you better pause before syncing the location. No on screen controls are avaible for now. Default mpv keybindings work and you can find them [here](https://defkey.com/mpv-media-player-shortcuts). 

#### Disclaimer
This project is in no way perfect and could have multiple bugs I will try to fix along with adding some more features. For now it just works and my gf and I enjoy watching movies together. 😁