semvec/pypi-packages huggingface dataset:
sockfilter 1.4
Block socket creation by host/port.
License: MIT

Usage
-----

The intended use is for making sure your unit tests don't make network
connections. Activate ``sockfilter`` with a predicate like:

.. code:: python

    # only allow http connections to localhost
    def socket_address_allowed(address):
        return (address.host in ['localhost', '127.0.0.1'] and
                address.port == 80)

    sockfilter.enable(socket_address_allowed)

Any subsequent attempts to open a connection at an address not satisfying
the predicate will raise ``sockfilter.SockFilterError``.


``with_sockfiltering`` decorator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from sockfilter import with_sockfiltering

    @with_sockfiltering(socket_address_allowed)
    def test_foo():
        foo()


``sockfiltering`` context manager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from sockfilter import sockfiltering

    def test_foo():
        with sockfiltering(socket_address_allowed):
            foo()


``enable`` and ``disable``
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    import sockfilter
    from unittest import TestCase

    class FooTest(TestCase):

        def setUp(self):
            sockfilter.enable(socket_address_allowed)

        def tearDown(self):
            sockfilter.disable()

        def test_foo(self):
            foo()


Under the hood
--------------

Sockfilter works by monkey-patching Python's ``socket`` library,
inspired by HTTPretty_.

.. _HTTPretty: https://github.com/gabrielfalcao/HTTPretty
qualisys 0.2.0
Import data from Qualisys Track Manager into pandas.
License: MIT
Keywords: qualisys qtm motion-capture import biomechanics

===============
python-qualisys
===============

+--------------------+-------------------+
| | |travis-badge|   | | |version-badge| |
| | |coverage-badge| | | |license-badge| |
+--------------------+-------------------+

.. |travis-badge| image:: http://img.shields.io/travis/hsharrison/python-qualisys.png?style=flat
    :alt: Travis-CI Build Status
    :target: https://travis-ci.org/hsharrison/python-qualisys
.. |coverage-badge| image:: http://img.shields.io/coveralls/hsharrison/python-qualisys.png?style=flat
    :alt: Coverage Status
    :target: https://coveralls.io/r/hsharrison/python-qualisys
.. |version-badge| image:: http://img.shields.io/pypi/v/qualisys.png?style=flat
    :alt: PYPI Package
    :target: https://pypi.python.org/pypi/python-qualisys
.. |license-badge| image:: http://img.shields.io/badge/license-MIT-blue.png?style=flat
    :alt: License
    :target: https://pypi.python.org/pypi/python-qualisys

Load data from a .txt file exported from QTM into `pandas <http://pandas.pydata.org>`_::

    pip install qualisys

.. code-block:: python

    In [1]: from qualisys import load_qtm_data

    In [2]: data, metadata = load_qtm_data('example_data.txt')

    In [3]: metadata
    Out[3]:
    {'analog_frequency': 0,
     'description': '--',
     'events': [],
     'no_of_frames': 720,
     'pc_on_time': 912.56663253,
     'no_of_cameras': 7,
     'marker_names': ['RIGHT_KNEE', 'right_ankle'],
     'frequency': 120,
     'no_of_markers': 2,
     'no_of_analog': 0,
     'data_included': '3D',
     'time_stamp': numpy.datetime64('2014-06-17T08:53:44-0400')}

    In [4]: data
    Out[4]:
    <class 'pandas.core.panel.Panel'>
    Dimensions: 2 (items) x 720 (major_axis) x 3 (minor_axis)
    Items axis: RIGHT_KNEE to right_ankle
    Major_axis axis: 0.00833 to 6.0
    Minor_axis axis: x to z

    In [5]: data['right_ankle'].head()
    Out[5]:
    dim             x         y        z
    t
    0.00833  1501.102  2073.985  102.815
    0.01667  1501.187  2074.183  103.058
    0.02500  1501.052  2073.905  102.775
    0.03333  1501.557  2073.970  103.195
    0.04167  1501.425  2073.629  102.974
smartcompose 0.1.2
Easy delegation with composition
License: MIT
Keywords: composition delegation delegate compose

``smartcompose``: Easy delegation with composition
==================================================

Decorate a class with ``@delegate(attribute_name, method_names)``
to delegate the methods in ``method_names`` to the attribute ``attribute_name``:

.. code:: python

    In [1]: from smartcompose import delegate

    In [2]: @delegate('_n', ('__add__', '__mul__'))
       ...: class NumberWrapper:
       ...:     def __init__(self, n):
       ...:         self._n = n
       ...:             

    In [3]: n = NumberWrapper(10)    

    In [4]: n + 2
    Out[4]: 12    

    In [5]: n * 3
    Out[5]: 30


For now, only compatible with Python 3.

::

    pip install smartcompose