semvec/pypi-packages huggingface dataset:
hawksoft.trafficLights 1.0.0
Knowledge base using pyknow for controlling traffic lights
License: MIT
Keywords: pyknow,traffic lights,production system

# hawksoft.trafficLights package

- [hawksoft.trafficLights package](#hawksofttrafficlights-package)
  - [Installation:](#installation)
  - [usage:](#usage)

Knowledge base using pyknow for controlling traffic lights.

## Installation:

```
pip install hawksoft.trafficLights
```
## usage:

To test the knowledge library, type command as follows:
```
trafficLights
```
devpi-lockdown 2.0.0
devpi-lockdown: tools to enable authentication for read access
License: MIT
Requires Python: >=3.6

devpi-lockdown: tools to enable authentication for read access
==============================================================

This plugin adds some views to allow locking down read access to devpi.

Only tested with nginx so far.


Installation
------------

``devpi-lockdown`` needs to be installed alongside ``devpi-server``.

You can install it with::

    pip install devpi-lockdown


Usage
-----

To lock down read access to devpi, you need a proxy in front of devpi which can use the provided views to limit access.


The views are:

/+authcheck

  This returns ``200`` when the user is authenticated or ``401`` if not.
  It uses the regular devpi credential checks and an additional credential check using a cookie provided by ``devpi-lockdown`` to allow login with a browser.

/+login

  A plain login form to allow access via browsers for use with ``devpi-web``.

/+logout

  Drops the authentication cookie.


For nginx the `auth_request`_ module is required.
You should use the ``devpi-genconfig`` script to generate your nginx configuration.
With devpi-server 6.0.0 or newer an ``nginx-devpi-lockdown.conf`` should have been generated.
If not, then you need to add the following to your server block before the first location block:

.. code-block:: nginx

        # this redirects to the login view when not logged in
        recursive_error_pages on;
        error_page 401 = @error401;
        location @error401 {
            return 302 /+login?goto_url=$request_uri;
        }

        # lock down everything by default
        auth_request /+authcheck;

        # the location to check whether the provided infos authenticate the user
        location = /+authcheck {
            internal;

            proxy_pass_request_body off;
            proxy_set_header Content-Length "";
            proxy_set_header X-Original-URI $request_uri;
            proxy_set_header X-outside-url $scheme://$http_host;  # copy the value from your existing configuration
            proxy_set_header X-Real-IP $remote_addr;  # copy the value from your existing configuration
            proxy_pass http://localhost:3141;  # copy the value from your existing configuration
        }

.. _auth_request: http://nginx.org/en/docs/http/ngx_http_auth_request_module.html


Changelog
=========

2.0.0 - 2021-05-16
------------------

.. note:: The nginx configuration has changed from 1.x.

- Dropped Python 2.7, 3.4 and 3.5 support.

- Support for devpi-server 6.0.0.

- Redirect back to original URL after login.

- With devpi-server 6.0.0 the ``devpi-gen-config`` script
  creates a ``nginx-devpi-lockdown.conf``.

- Automatically allow locations required for login page.

- Show error message for invalid credentials.

- Support Pyramid 2.0.


1.0.1 - 2018-11-16
------------------

- Fix import for Pyramid >= 1.10.0.

- Add /+static to configuration

- Lock down everything by default in the configuration and only allow the
  necessary locations


1.0.0 - 2017-03-10
------------------

- initial release
object-trace 0.1.2
Trace every use of selected objects
License: MIT

Trace every use of selected objects.

# Install
```
pip install object-trace
```

# Example result
Given the following [script](example.py)
```
from object_trace import trace, print_traces

def producer_of_X(cache):
    cache["X"] = trace(42.42, "X")

def inscrutable_user_of_X(cache):
    cache["Y"] = cache["X"] + 1
    cache["X"] = 15.1

with print_traces():
    d = {}
    producer_of_X(d)
    inscrutable_user_of_X(d)
    print(d["X"])
```

running `python3.9 example.py` prints:
```
# Trace for label=`X`
_   : call `<module>`                   | 
  [/mnt/c/Users/alexv/repos/object_trace/example.py:1]
  15  : call `producer_of_X`              | producer_of_X(d)
    [/mnt/c/Users/alexv/repos/object_trace/example.py:4]
    5   : use                               | cache["X"] = trace(42.42, "X")
    5   : Ref count 6->3                    | cache["X"] = trace(42.42, "X")
  16  : call `inscrutable_user_of_X`      | inscrutable_user_of_X(d)
    [/mnt/c/Users/alexv/repos/object_trace/example.py:8]
    9   : use                               | cache["Y"] = cache["X"] + 1
    10  : Ref count 3->2                    | cache["X"] = 15.1
--------------------------------------------------------------------------------
```