semvec/pypi-packages huggingface dataset:
normcl 2021.6.8
angular power spectra conversions for normal random fields
License: MIT
Requires Python: >=3.6

normcl
======

**angular power spectra conversions for normal random fields**

This is a minimal Python package for working with the angular power spectra of
spherical random fields constructed from normals.  It can currently convert
between the power spectra of lognormal random fields and their constituent
normal random fields.

The package can be installed using pip:

    pip install normcl

Then import the `lognormal` and `lognormal_normal` functions from the package:

    from normcl import lognormal, lognormal_normal

For more information, please see the [documentation].

Current functionality covers the absolutely minimal use case.  Please open an
issue on GitHub if you would like to see anything added.

[documentation]: https://cltools.readthedocs.io/normcl/
multiple-permissions 0.2.2
Use multiple permission classes in django class based views.
License: MIT
Keywords: django multiple permissions use many permission python rest framework

Django multiple permissions
===========================

[![Python](https://img.shields.io/pypi/pyversions/multiple-permissions)](https://img.shields.io/pypi/pyversions/multiple-permissions)
[![License](https://img.shields.io/github/license/aram2726/django_multiple_permissions)](https://img.shields.io/github/license/aram2726/django_multiple_permissions)

Usage
------

* Install the package.

```shell script
$ pip install multiple-permissions
```

* Add `multiple_permissions` to installed apps.

```python
INSTALLED_APPS = [
    ...,
    "multiple_permissions",
    ...,
]
```

* Add `PermissionMiddleware` to MIDDLEWARE list.

```python
MIDDLEWARE = [
    ...,
    "multiple_permissions.middlewares.PermissionMiddleware",
]
```

* Set `permission_classes` attribute to view classes.
* Set `exception_class` attribute to view classes.

```python
from django.views.generic import ListView, CreateView

from multiple_permissions.permissions import IsAuthenticated, IsSuperuser, IsManager


class PollsListView(ListView):
    multiple_permissions = (IsAuthenticated,)
    # if exception_class is missing will raise django.core.exceptions.PermissionDenied
    ...


class PollsCreateView(CreateView):
    multiple_permissions = (IsSuperuser, IsManager)
    exception_class = PermissionError
    ...
```

#### Creating new permissions

* create new file in your apps named `permissions.py` and write the followng code

* **note that your user should have `is_manager` attribute or model field otherwise you'll catch AttributeError**

```python
from multiple_permissions.permissions import BasePermission


class IsManager(BasePermission):
    def has_permission(self, request, view=None):
        if request.user.is_authenticated and request.user.is_active and request.user.is_manager:
            return True
        return False

```