semvec/pypi-packages huggingface dataset:
kasami 0.0.7
A set of utilities for training probabilistic context-free grammars and scoring new sentences with them.
License: MIT

A library for training and applying probabilistic context-free grammars to
text.

* Kasami, T. (1965). An efficient recognition and syntax analysis algorithm
  for context-free languages. (No. Scientific-2). Hawaii University, Dept. of
  Electrical Engineering.

# Example use

```python
>>> from bllipparser import RerankingParser
>>>
>>> from kasami import TreeScorer
>>> from kasami.normalizers import bllip
>>>
>>> # Loading WSJ-PTB3 treebank into bllip's RerankingParser
... bllip_rrp = RerankingParser.fetch_and_load('WSJ-PTB3')
>>> bllip_parse = lambda s: bllip.normalize_tree(bllip_rrp.parse(s)[0].ptb_parse)
>>>
>>> tree = bllip_parse("I am a little teapot")
>>> print(tree)
(S1 (S (NP (PRP 'I')) (VP (VBP 'am') (NP (DT 'a') (JJ 'little') (NN 'teapot')))))
>>> print(tree.format(depth=1))
	(S1
		(S
			(NP
				(PRP 'I')
			)
			(VP
				(VBP 'am')
				(NP
					(DT 'a')
					(JJ 'little')
					(NN 'teapot')
				)
			)
		)
	)
>>>
>>> for production in tree:
...     print(str(production))
...
(S1 S)
(S NP VP)
(NP PRP)
(PRP 'I')
(VP VBP NP)
(VBP 'am')
(NP DT JJ NN)
(DT 'a')
(JJ 'little')
(NN 'teapot')
>>> sentences = ["I am a little teapot",
...              "Here is my handle",
...              "Here is my spout",
...              "When I get all steamed up I just shout tip me over and pour me out",
...              "I am a very special pot",
...              "It is true",
...              "Here is an example of what I can do",
...              "I can turn my handle into a spout",
...              "Tip me over and pour me out"]
>>>
>>>
>>> teapot_grammar = TreeScorer.from_tree_bank(bllip_parse(s) for s in sentences)
>>>
>>> teapot_grammar.score(bllip_parse("Here is a little teapot"))
-9.392661928770137
>>> teapot_grammar.score(bllip_parse("It is my handle"))
-10.296301543090733
>>> teapot_grammar.score(bllip_parse("I am a spout"))
-10.40166205874856
>>> teapot_grammar.score(bllip_parse("Your teapot is gay"))
-12.96352974967269
>>> teapot_grammar.score(bllip_parse("Your mom's teapot is asldasnldansldal"))
-19.424997926026403

```

# Author
* Aaron Halfaker -- https://github.com/halfak

... and substantially informed by https://github.com/aetilley
mihome 0.1
Xiaomi Mi Home Python bindings
License: MIT
Keywords: xiaomi udp paquet iot mi home aqara

Library to use the Xiaomi Mi Home zigbee hub (receive paquets, events for now).


Example of usage as a simple mqtt relay:

```python
import paho.mqtt.client as mqtt

MQTT_SERVER = "192.168.0.149"
MQTT_PORT = 1883

PATH_FMT = "xiaomi/{model}/{sid}/{prop}" # short_id or sid ?

def prepare_mqtt():
  client = mqtt.Client()
  client.connect(MQTT_SERVER, MQTT_PORT, 60)

  return client

def push_data(client, model, sid, cmd, data):
  for key, value in data.items():
      path = PATH_FMT.format(model=model,
                             sid=sid,
                             cmd=cmd,
                             prop=key)
      client.publish(path, payload=value, qos=0)

client = prepare_mqtt()
cb = lambda m, s, c, d: push_data(client, m, s, c, d)
connector = XiaomiConnector(data_callback=cb)

while True:
    connector.check_incoming()
```

For more information on the protocol and devices, see my notes: https://notes.jmsinfor.com/blog/post/admin/Xiaomi-Hub
JSONRPCBase 0.2.0
Simple JSON-RPC service without transport layer
License: MIT

JSONRPCBase
===========

.. image:: https://ci.appveyor.com/api/projects/status/mgn5i4m1wx2nu70y?svg=true
    :target: https://ci.appveyor.com/project/level12/jsonrpcbase

.. image:: https://circleci.com/gh/level12/jsonrpcbase.svg?style=shield
    :target: https://circleci.com/gh/level12/jsonrpcbase

.. image:: https://codecov.io/gh/level12/jsonrpcbase/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/level12/jsonrpcbase

Intro
---------------

Simple JSON-RPC service without transport layer

This library is intended as an auxiliary library for easy an implementation of JSON-RPC services with Unix/TCP socket
like transport protocols that do not have complex special requirements. You need to utilize some suitable transport
protocol with this library to actually provide a working JSON-RPC service.

Features
---------

- Easy to use, small size, well tested.
- Supports JSON-RPC v2.0. Compatible with v1.x style calls with the exception of v1.0 class-hinting.
- Optional argument type validation that significantly eases development of jsonrpc method_data.

Example
--------

Example usage::

    import jsonrpcbase

    chat_service = jsonrpcbase.JSONRPCService()

    def login(username, password, timelimit=0):
        (...)
        return True

    def receive_message(**kwargs):
        (...)
        return chat_message

    def send_message(msg):
        (...)

    if __name__ == '__main__':

        # Adds the method login to the service as a 'login'.
        chat_service.add(login, types=[basestring, basestring, int])

        # Adds the method receive_message to the service as a 'recv_msg'.
        chat_service.add(receive_message, name='recv_msg', types={"msg": basestring, "id": int})

        # Adds the method send_message as a 'send_msg' to the service.
        chat_service.add(send_message, 'send_msg')

        (...)

        # Receive a JSON-RPC call.
        jsonmsg = my_socket.recv()

        # Process the JSON-RPC call.
        result = chat_service.call(jsonmsg)

        # Send back results.
        my_socket.send(result)

Questions & Comments
---------------------

Please visit: http://groups.google.com/group/blazelibs

Current Status
---------------

Seems stable, but hasn't been widely used to my knowledge.

The `development version <https://github.com/level12/jsonrpcbase/archive/master.zip#egg=JSONRPCBase-dev>`_
is installable with ``easy_install JSONRPCBase==dev``.

Credits
---------

This project was originally developed by:

Juhani Åhman
http://bitbucket.org/fuzzybyte/jsonrpcbase/src


Changelog
---------

0.2.0 released 2016-11-30
=========================

* add Python 3 support (3.4 and 3.5)
* set up continuous integration testing on CircleCI and AppVeyor
* test coverage is on CodeCov

0.1.2 released 2012-03-08
=========================

- fixed argument validation logic when using instance methods and no arguments
    (mlewellyn)