SDSC/open-pulse-hackathon-data-analysis huggingface dataset:
Repository: hassan11196/cocosplit
Description: Simple tool to split COCO annotations into train/test datasets.
Primary language: Python

Simple tool to split a multi-label coco annotation dataset with preserving class distributions among train and test sets.

The code is an updated version from [akarazniewicz/cocosplit](https://github.com/akarazniewicz/cocosplit)  original repo, where the functionality of splitting multi-class data while preserving distributions is added.


## Installation

``cocosplit`` requires python 3 and basic set of dependencies:

specifically, in addition to the requirements of the original repo, (``scikit-multilearn``) is required, it is included the requirements.txt file

```
pip install -r requirements
```


## Usage

The same as the original repo, with adding an argument (``--multi-class``) to preserve class distributions
The argument is optional to ensure backward compatibility

```
$ python cocosplit.py -h
usage: cocosplit.py [-h] -s SPLIT [--having-annotations]
                    coco_annotations train test

Splits COCO annotations file into training and test sets.

positional arguments:
  coco_annotations      Path to COCO annotations file.
  train                 Where to store COCO training annotations
  test                  Where to store COCO test annotations

optional arguments:
  -h, --help            show this help message and exit
  -s SPLIT              A percentage of a split; a number in (0, 1)
  --having-annotations  Ignore all images without annotations. Keep only these
                        with at least one annotation
  --multi-class         Split a multi-class dataset while preserving class
                        distributions in train and test sets
```

# Running

```
$ python cocosplit.py --having-annotations --multi-class -s 0.8 /path/to/your/coco_annotations.json train.json test.json
```

will split ``coco_annotation.json`` into ``train.json`` and ``test.json`` with ratio 80%/20% respectively. It will skip all
images (``--having-annotations``) without annotations.
Repository: hassan11196/dep_graph
Description: A simple Python package for generating resolved dependency graphs from JSON files.
Primary language: Python

# dep_graph

[![PyPI version](https://badge.fury.io/py/dep-graph-hassan.svg)](https://pypi.org/project/dep-graph-hassan/)
[![GitHub release](https://img.shields.io/github/release/hassan11196/dep_graph.svg)](https://github.com/hassan11196/dep_graph)

A simple Python package for generating resolved dependency graphs from JSON files.

## Running the Module

To run the module, use the following command:

    python -m dep_graph

By default, the module will read the dependencies from `/tmp/deps.json`.

To specify a different path to the dependencies, use the following command:

    python -m dep_graph  --path ./some_fir/deps.json

## Creating a Dummy Dependency JSON File

To create a dummy dependency JSON file, use the following command:

    python dep_graph/helper/create_dummy_file.py --path ./tests test_file.json

 By default it outputs to `/tmp/deps.json`
  
## Running Tests

To run the tests, use the following command:

    python -m unittest discover tests/

## Building the Package

You can build the package using either poetry or setup.py.

### Method 1: Using Poetry

To build the package using poetry, use the following commands:

1. Create a virtual environment:

        poetry install

2. Build the package:

        poetry build

### Method 2: Using setup.py

To build the package using setup.py, use the following command:

        python setup.py sdist bdist_wheel

## Installing Pre-commit Hooks

To install pre-commit hooks, use the following command:

    pre-commit install