semvec/pypi-packages huggingface dataset:
openspace-train-environment 0.0.3
The OpenSpace train environment

# OpenSpace
## Train Environment

This is the repository of the train environment of the OpenSpace project. This project is written in Python 3.6 and will be running on the computers present on the train.

The project follows the [PEP008 style guide](https://www.python.org/dev/peps/pep-0008/), every collaborator should make sure his code is according to the standards.

Tests are very important in this project and should be written for each functional unit. The project uses the [unittest](https://docs.python.org/3.6/library/unittest.html#test-discovery) library for unit tests and [nose](https://nose.readthedocs.io/) for test discovery. 

Documentation is key to working in team, so make sure your code is well documented, also following the PEP008 style rules.

![alt text](https://i.imgur.com/opw2vug.png "Logo Title Text 2")

### Camera Handler

The camera handler uses a pubsub pattern to let subscribers know when frames are published. These frames will be transformed in the requested codec for each subscriber. These frames are sent to the broker to be redistributed amongst the components.

### Vision Container

The vision container will wrap the CV-ML service in the train environment. This will be done by importing their python script into our service and expose our broker as a singleton. This way, the vision container can publish messages and subscribe to messages through the broker. The init script should contain the setup logic for their container, as our service will not call any methods from within their service (except the registered callbacks).

### Broker

The broker (previously carriage communicator) is responsible for the internal routing of messages using a broker pattern.
Exposed methods:
* Broker.get_instance()
* self.subscribe('message', callback)
* self.publish('message', \*args, \*\*kwargs)

### Election Component
The election component is responsible for the election procedure amongst the different carriages as well as initiating the (physical) TUDA at an election win.

### Virtualized TUDA Module

Virtualized TUDA present on every carriage. This component has to transfer the connections to the TUDA by a HTTP connection.

### Train Unit Data Aggregator

The train unit data aggregator is the central point within the current sequence of carriages. This component has to buffer the received information and needs to communicate with the internal API and the transfer module.

#### Main TUDA Module

This module has to make sure the data is timestamped and routed to the other transfer modules (internal API & transfer module).

#### Internal API Module

This module has to buffer/store the data and respond to API calls that originate from the internal network on the train.

#### Transfer Module

This module is responsible for the connection to the wayside (backend). This module has to transfer the data to the AMQP module already present on the train (not part of our service).

### Test Simulations

To simulate the AMQP communication and the internal API, we need to create simple simulations of these components.
spacy-langdetect 0.1.2
Fully customizable language detection pipeline for spaCy

# spacy-langdetect
Fully customizable language detection pipeline for [spaCy](https://github.com/explosion/spaCy)

## Installation
`pip install spacy-langdetect`

## NOTE:
Requires spaCy >= 2.0. This dependency is removed in `pip install spacy-langdetect` so that it can be used with `nightly` versions also

## Basic usage
Out of the box, under the hood it uses [langdetect](https://github.com/Mimino666/langdetect) to detect languages on spaCy's Doc and Span objects.

```python
import spacy
from spacy_langdetect import LanguageDetector
nlp = spacy.load("en")
nlp.add_pipe(LanguageDetector(), name="language_detector", last=True)
text = "This is English text. Er lebt mit seinen Eltern und seiner Schwester in Berlin. Yo me divierto todos los días en el parque. Je m'appelle Angélica Summer, j'ai 12 ans et je suis canadienne."
doc = nlp(text)
# document level language detection. Think of it like average language of document!
print(doc._.language)
# sentence level language detection
for i, sent in enumerate(doc.sents):
    print(sent, sent._.language)
```

## Using your own language detector
Suppose you are not happy with the accuracy of the out of the box language detector or you have your own language detector which you want to use with spaCy pipeline. How do you do it? That's where the `language_detection_function` argument comes in. The function takes in a Spacy Doc or Span object and can return any python object which is stored in `doc._.language` and `span._.language`. For example, let's say you want to use [googletrans](https://pypi.org/project/googletrans/) as your language detection module:

```python
import spacy
from spacy.tokens import Doc, Span
from spacy_langdetect import LanguageDetector
# install using pip install googletrans
from googletrans import Translator
nlp = spacy.load("en")

def custom_detection_function(spacy_object):
    # custom detection function should take a Spacy Doc or a
    assert isinstance(spacy_object, Doc) or isinstance(
        spacy_object, Span), "spacy_object must be a spacy Doc or Span object but it is a {}".format(type(spacy_object))
    detection = Translator().detect(spacy_object.text)
    return {'language':detection.lang, 'score':detection.confidence}

nlp.add_pipe(LanguageDetector(language_detection_function=custom_detection_function), name="language_detector", last=True)
text = "This is English text. Er lebt mit seinen Eltern und seiner Schwester in Berlin. Yo me divierto todos los días en el parque. Je m'appelle Angélica Summer, j'ai 12 ans et je suis canadienne."
doc = nlp(text)
# document level language detection. Think of it like average language of document!
print(doc._.language)
# sentence level language detection
for i, sent in enumerate(doc.sents):
    print(sent, sent._.language)
```
Similarly you can also use [pycld2](https://pypi.org/project/pycld2/) and other language detectors with spaCy
pi7447 1.0.1
7447 lib for raspberry pi

# Pi7447
7447 lib for raspberry pi

## Installation
`pip install pi7447`

## Usage example
```
import pi7447
import time
import RPi.GPIO as gpio
gpio.setmode(gpio.BCM)

IC7447_INPUT_A = 2
IC7447_INPUT_B = 3
IC7447_INPUT_C = 4
IC7447_INPUT_D = 17

sevenSegmentSisplay = pi7447.IC7447(IC7447_INPUT_A,IC7447_INPUT_B,IC7447_INPUT_C,IC7447_INPUT_D)

#show 1 to 9
for i in range(10):
    sevenSegmentSisplay.show(i)
    time.sleep(0.5)

#turn off display
sevenSegmentSisplay.off()
```