semvec/pypi-packages huggingface dataset:
module-path 1.0.1
Reliably find a modules path even when running an executable.
License: MIT
Keywords: Module Path

========================
(DEPRECATED) module_path
========================

Python does not use filenames anymore to support reading from a zip file.
This library is deprecated and has been removed from pypi.


Provided functions

  * files - importlib.resources files this function is the standard for retrieving resources for Python 3.9+
  * as_file - context manager for retrieving a true filepath for Python 3.9+.
  * my_dir - Return the directory this module is in. This should exist even in an executable.
  * my_path - Return the path to the module that called this method. This may not exist in an executable


Example
=======

.. code-block:: python

    # my_interface.py
    # sdl2 with sld2.dll in package
    # File Structure:
    #     my_sdl/
    #         sdl2_dll_path/
    #             SDL2.dll
    #         __init__.py
    #         my_interface.py
    import os
    from module_path import files, as_file

    with as_file(files('my_sdl').joinpath('sdl2_dll_path/SDL2.dll')) as sdl_path:
        os.environ.setdefault('PYSDL2_DLL_PATH', os.path.dirname(str(sdl_path)))
        import sdl2

    # Use sdl2
    assert sdl2 is not None


.. code-block::

    check_path/
        __init__.py
        main.py
        check_sub_path
             __init__.py
             fakedata.txt


.. code-block:: python

    # check_path/check_sub_path/__init__.py
    import os
    import module_path

    MY_DIR = module_path.my_dir()
    DATA = os.path.join(MY_DIR, 'fakedata.txt')
    EXISTS = os.path.exists(DATA)


.. code-block:: python

    # check_path/main.py
    import module_path
    try:
        from check_path.check_sub_path import MY_DIR, DATA, EXISTS
    except (ImportError, Exception):
        from check_sub_path import MY_DIR, DATA, EXISTS


    if __name__ == '__main__':
        path = module_path.my_path()
        directory = module_path.my_dir()
        print('path   \t', path, module_path.exists(path))  # Should be false with executable
        print('dir    \t', directory, module_path.exists(directory))

        print('sub_dir\t', MY_DIR, module_path.exists(MY_DIR))
        print('DATA   \t', DATA, EXISTS)

Build the executable with

.. code-block:: sh

    pyinstaller --name check_path -y --add-data "check_path/check_sub_path/fakedata.txt;check_path/check_sub_path/" check_path/main.py

After pyinstaller builds you will have a `dist` directory. The data for this example should be stored in `dist/check_path/check_path/check_sub_path/fakedata.txt`
tf-fastmri-data 0.0.6
Data pipelines for the fastMRI dataset in TensorFlow.
License: MIT
Requires Python: >=3.6

# tf-fastmri-data
[![Build Status](https://travis-ci.com/zaccharieramzi/tf-fastmri-data.svg?branch=master)](https://travis-ci.com/zaccharieramzi/tf-fastmri-data)

Built around the `tf.data` API, `tf-fastmri-data` offers reliable, unit-tested, datasets for the fastMRI dataset.

## Installation

Currently, you need to install the package from source:

```
git clone https://github.com/zaccharieramzi/tf-fastmri-data.git
cd tf-fastmri-data
pip install .
```

## Example use

```python
from tf_fastmri_data.datasets.cartesian import CartesianFastMRIDatasetBuilder

train_dataset = CartesianFastMRIDatasetBuilder(path='/path/to/singlecoil_train').preprocessed_ds
```

## Data

To download the data, you need to consent to the fastMRI terms listed [here](https://fastmri.med.nyu.edu/).
Afterwards, you should receive an email with data download links.

You can then use the environment variable `FASTMRI_DATA_DIR` to indicate where your fastMRI is.
This will allow you to not have to specify the path when instantiating a `FastMRIDatasetBuilder`.

## PyTorch

The PyTorch equivalent of this library is simply the [official fastMRI repository](https://github.com/facebookresearch/fastMRI).
In particular, the [data folder](https://github.com/facebookresearch/fastMRI/tree/master/data) is where you find the data utils.

## Benchmark

You can run the benchmark script with the following command:
```
FASTMRI_DATA_DIR=/path/to/fastmri python benchmark.py
```

Currently the benchmark gives the following output:
```
Multi coil with tfio loading (random slice): 0.369743709564209s per-file.
Single coil with tfio loading (random slice): 0.02855397939682007s per-file.
Multi coil with h5py loading (random slice, without preprocessing): 0.010439331208042165s per-file.
Single coil with h5py loading (random slice, without preprocessing): 0.0015996736497735258s per-file.
Single coil training with tfio loading: 0.04578723907470703s per-step.
```

You can also see the recommendation of TensorBoard regarding the single coil dataset (with a very simple model):

![TensorBoard reco](tensorboard_recommendation.png)

## Citation

If you use the fastMRI data or this code in your research, please consider citing the fastMRI dataset paper:

```
@inproceedings{zbontar2018fastMRI,
  title={{fastMRI}: An Open Dataset and Benchmarks for Accelerated {MRI}},
  author={Jure Zbontar and Florian Knoll and Anuroop Sriram and Matthew J. Muckley and Mary Bruno and Aaron Defazio and Marc Parente and Krzysztof J. Geras and Joe Katsnelson and Hersh Chandarana and Zizhao Zhang and Michal Drozdzal and Adriana Romero and Michael Rabbat and Pascal Vincent and James Pinkerton and Duo Wang and Nafissa Yakubova and Erich Owens and C. Lawrence Zitnick and Michael P. Recht and Daniel K. Sodickson and Yvonne W. Lui},
  journal = {ArXiv e-prints},
  archivePrefix = "arXiv",
  eprint = {1811.08839},
  year={2018}
}
```
get-metadata 0.0.5
Get metadata string. Works on GAE(Google App Engine), GCF(Google Cloud Functions), and the others.
License: MIT
Requires Python: >=3.7
Keywords: GAE GCF GCP metadata

# get_metadata
Get metadata string. Works on GAE(Google App Engine), GCF(Google Cloud Functions), and the others.
For the detail, see https://cloud.google.com/appengine/docs/standard/java/accessing-instance-metadata


## Installation;
~~~console
pip install get_metadata
~~~

## OR Write `get_metadata` in requirements.txt.

~~~
# requirements.txt sample
Flask  # sample
get_metadata
google-cloud-storage  # sample
~~~


## How to use
~~~python
from get_metadata import get_metadata

key = "project_id"
project_id = get_metadata(key)

key2 = "/computeMetadata/v1/instance/service-accounts/default/"
service_accounts = get_metadata(key2)
~~~

key accepts a key of key_list(see below) or metadata endpoint.

~~~python
key_list: dict[str, str] = {
    # The project number assigned to your project.
    "numeric_project_id": "/computeMetadata/v1/project/numeric-project-id",
    # The project ID assigned to your project.
    "project_id": "/computeMetadata/v1/project/project-id",
    # The zone the instance is running in.
    "zone": "/computeMetadata/v1/instance/zone",
    # no description
    "aliases": "/computeMetadata/v1/instance/service-accounts/default/aliases",
    # The default service account email assigned to your project.
    "email": "/computeMetadata/v1/instance/service-accounts/default/email",
    # Lists all the default service accounts for your project.
    "service-accounts": "/computeMetadata/v1/instance/service-accounts/default/",
    # Lists all the supported scopes for the default service accounts.
    "scopes": "/computeMetadata/v1/instance/service-accounts/default/scopes",
    # Returns the auth token that can be used to authenticate your application to other Google Cloud APIs.
    "token": "/computeMetadata/v1/instance/service-accounts/default/token",
}
~~~
get-gcp-secret 0.0.5
Get value from Google Cloud Secret Manager.
License: MIT
Requires Python: >=3.7
Keywords: GAE GCF GCP secret-manager

# get_gcp_secret
Get value from Google Cloud Secret Manager.


## Installation;
~~~console
pip install get_gcp_secret google-cloud-secret-manager
pip install get_metadata  # optional
~~~

## OR Write `get_gcp_secret` in requirements.txt.

~~~
# requirements.txt sample
get_gcp_secret
google-cloud-secret-manager  # required
get_metadata  # optional
~~~


## How to use.
~~~python
import get_gcp_secret

# GCP Project ID will be automatically detected("get_metadata" required).
# OR set GCP project ID manually.
get_gcp_secret.set_project_id("Project ID string")

# get secret text
secret_name = "secret name string"
secret_ver = 2 # or "2"
secret_text = get_gcp_secret.get_secret_text(secret_name, secret_ver)
# when secret_ver is omitted, 'latest' will be used.
# secret_text = get_gcp_secret.get_secret_text(secret_name)

# get secret text(secret name/version from env)
env_secret_name = "secret name env name"
env_secret_ver = "secret ver env name"
secret_text = get_gcp_secret.get_secret_text_from_env(env_secret_name, env_secret_ver)

# when secret_ver is omitted, 'latest' will be used.
# secret_text = get_gcp_secret.get_secret_text_from_env(env_secret_name)
~~~
django-post-request-task 0.5
A celery task class whose execution is delayed until after the request finishes
License: MIT

django-post-request-task
========================

.. image:: https://circleci.com/gh/mozilla/django-post-request-task.svg?style=svg
    :target: https://circleci.com/gh/mozilla/django-post-request-task

A celery task class whose execution is delayed until after the request
finishes, using ``request_started`` and ``request_finished`` signals from django
and thread locals.

This is useful if your views are wrapped in transactions (as they should if
you're making database modifications in them), as you can end up triggering a
celery task too soon before the transaction has been committed (or even trigger
a task when the corresponding transaction has been rolled back).

By listening to the `request_started` and `request_finished` django signals, we
can safely trigger a task after all transactions created from ``@atomic`` or
``ATOMIC_REQUESTS`` have been committed.

Usage
-----

.. code-block:: python

    from celery import Celery
    from post_request_task.task import PostRequestTask


    app = Celery('myapp', task_cls=PostRequestTask)

    @app.task
    def my_task():
        # If .delay() is called on this task inside a django request-response
        # cycle it will be called once the request is finished, and not before.
        pass


Or, if you are using the decorator directly:

.. code-block:: python

    from post_request_task.task import shared_task

    @shared_task
    def my_task():
        pass


That's it. If the task is called from outside the django request-response
cycle, then it will be triggered normally.

As a bonus feature, if the same task is called with the same argument several
times during a request-response cycle, it will only be queued up once.


Running tests
-------------

.. code-block:: sh

    $ make testenv
    $ make test

By default, tests are run with whatever django version is installed. If you want to run tests for other versions
use tox:


.. code-block:: sh

    $ make testenv
    $ tox -e 3.7-2.0.x # or any other environment defined in our tox.ini