Saravanan666/pypi-org huggingface dataset:
Package: thor
ThorAbout ThorThor is yet anotherPython 3library for evented IO.There are many such libraries for Python already available. Thor focuses on making it easy to build
high-performance HTTP intermediaries like proxies, load balancers, content transformation engines
and service aggregators. Of course, you can use it just as a client or server too.It aims to be as fast as possible, to implement the protocols correctly, and to be simple. You can
help meet these goals by contributing issues, patches and tests.Thor’s EventEmitter API is influenced by^H^H^H copied from NodeJS; if you’re familiar with Node, it
shouldn’t be too hard to use Thor. However, Thor is nothing like Twisted; this is considered a
feature.Currently, Thor has an event loop as well as TCP, UDP and HTTP APIs (client and server). New APIs
(e.g., DNS) and capabilities should be arriving soon, along with a framework for intermediation.RequirementsThor just requires Python 3.8 or greater.Currently, it will run on most Posix platforms; specifically, those that offer one ofpoll,epollorkqueue.InstallationIf you have setuptools, you can install from the repository:easy_install thoror using pip:pip install thorOn some operating systems, that might bepip3. Otherwise, download a tarball and install using:python setup.py installUsing ThorThedocumentationis a good starting point; see
also the docstrings for the various modules, as well as the tests, to give an idea of how to use
Thor.For example, a very simple HTTP server looks like this:importthor,thor.httpdeftest_handler(exch):@thor.events.on(exch)defrequest_start(*args):exch.response_start(200,"OK",[('Content-Type','text/plain')])exch.response_body('Hello, world!')exch.response_done([])if__name__=="__main__":demo_server=thor.http.HttpServer('127.0.0.1',8000)demo_server.on('exchange',test_handler)thor.run()Support and ContributionsSeeThor's GitHubto give feedback, view andreport
issues, and contribute code.All helpful input is welcome, particularly code contributions via a pull request (with test cases).Why Thor?Thor is not only “a hammer-wielding god associated with thunder, lightning, storms, oak trees,
strength, destruction, fertility, healing, and the protection of mankind”, he’s also my Norwegian
Forest Cat.Thor (the software program) grew out of nbhttp, which itself came from earlier work on evented
Python inredbot.Thor (the cat) now rules our house with a firm but benevolent paw. He gets sick if we give him any
milk, though.
Package: thorcam
ThorCamA Python interface to the Thor scientific Cameras using.Net.This library doesnotsupport theDCx cameras, only thescientific cameras.See thedocsfor more information
and to get started.To install inAnacondaornative Pythonsee theinstallation instructions.Basic exampleFirst create a subclass that prints the camera results:fromthorcam.cameraimportThorCamclassMyThorCam(ThorCam):defreceived_camera_response(self,msg,value):super(MyThorCam,self).received_camera_response(msg,value)ifmsg=='image':returnprint('Received "{}" with value "{}"'.format(msg,value))defgot_image(self,image,count,queued_count,t):print('Received image "{}" with time "{}" and counts "{}", "{}"'.format(image,t,count,queued_count))Then use the camera:>>># create camera>>>cam=MyThorCam()<__main__.MyThorCamat0x25a72f6a748>>>># start the server etc.>>>cam.start_cam_process()>>># get list of attached cams>>>cam.refresh_cameras()Received"serials"withvalue"['03756']">>># open the camera>>>cam.open_camera('03756')Received"settings"withvalue"{'binning_x': 1, 'binning_x_range': [1, 24], ..."Received"cam_open"withvalue"None">>>cam.exposure_range[0.0,1000000.0]>>>cam.exposure_ms241.948>>># update the exposure value>>>cam.set_setting('exposure_ms',150)Received"settings"withvalue"{'exposure_ms': 150.0}">>>cam.exposure_ms150.0>>># now play the camera>>>cam.play_camera()Received"playing"withvalue"True"Receivedimage"<ffpyplayer.pic.Image object at 0x000001D1D8D67900>"withtime"2e-07"andcounts"1","1"Receivedimage"<ffpyplayer.pic.Image object at 0x000001D1D8D67990>"withtime"0.2310473"andcounts"2","1"Receivedimage"<ffpyplayer.pic.Image object at 0x000001D1D8D67A68>"withtime"0.4735178"andcounts"3","1"Receivedimage"<ffpyplayer.pic.Image object at 0x000001D1D8D67B40>"withtime"0.7157285"andcounts"4","1"Receivedimage"<ffpyplayer.pic.Image object at 0x000001D1D8D67C18>"withtime"0.9583721"andcounts"5","1">>># now stop playing>>>cam.stop_playing_camera()Received"playing"withvalue"False">>># close the camera>>>cam.close_camera()Received"cam_closed"withvalue"None">>># close the server and everything>>>cam.stop_cam_process(join=True)
Package: thorlabs-apt-device
This is a python interface to Thorlabs equipment which communicates using the APT protocol.
Because there are a large variety of these devices, such as translation and rotation stages,
flip mounts and laser diode drivers, this package has been kept as general as possible.
A hierarchical class structure is designed such that basic functionality is handled transparently
at low levels, allowing a minimal amount of code to be used to implement device-specific features.In its current state, this package should be able to perform device discovery, communications and
message encoding/decoding for every APT-compatible device.
Classes for a small number of specific motion controllers are provided which give essentially
feature complete functionality for these particular devices.
To use a new, unsupported device, a subclass can be created which describes the specifics of
the device control and implement its new functionality.
If the device is very similar to something already implemented, then the amount of coding required
can be very small.
For example, theTDC001is a relatively simple DC motor driven
motion controller, and the class to implement it is only a few lines of code since it is able to
be derived from theAPTDevice_Motorclass.The code has no dependence on the Thorlabs software or libraries, and so is platform-agnostic.
It has been tested on Linux and Windows, but should work on all other operating systems supported
by the pyserial library.SupportDocumentation can be found online athttps://thorlabs-apt-device.readthedocs.io/en/latest/.Bug reports, feature requests and suggestions can be submitted to theissue tracker.LicenseAll original work is free and open source, licensed under the GNU Public License.
See theLICENSEfor details.A fork of thethorlabs-apt-protocollibrary is
included under theprotocoldirectory, which remains under an MIT license.
SeeLICENSEfor details.
Package: thorlabs-apt-protocol
Thorlabs APT protocolA functional implementation of theThorlabs APT protocolOutgoing messagesOutgoing messages are python functions in the top level namespace.
Each function has parameters relevant to the particular message, all messages have source and dest parameters.
The function names are lower-cased from the names in the documentation and the "MGMSG_" has been omitted.
These functions return bytes, they do not send the message over the transport layerFor example:>>>importthorlabs_apt_protocolasapt>>>>>>apt.mot_move_home(source=1,dest=0x50,chan_ident=1)b'C\x04\x01\x00P\x01'>>>apt.mot_move_absolute(source=1,dest=0x50,chan_ident=1,position=2048)b'S\x04\x06\x00\xd0\x01\x01\x00\x00\x08\x00\x00'Incoming messagesFunctions which allow for parsing bytes into dictionaries are also provided, but are not imported into the top level namespace by default.
The recommended way of parsing is to use the providedUnpackerobject.This object takes a file-like object (such as a pyserialSerialinstance) and provides a generator to parse the incomming messages.
If no file object is provided, and internalBytesIOinstance is used, and can be provided with bytes via thefeedmethod.
The generator yieldsnamedtupleinstances.Usage with pyserial:>>>importthorlabs_apt_protocolasapt>>>importserial>>>>>>port=serial.Serial("/dev/ttyUSB0",115200,rtscts=True,timeout=0.1)>>>port.rts=True>>>port.reset_input_buffer()>>>port.reset_output_buffer()>>>port.rts=False>>>port.write(apt.hw_no_flash_programming(source=1,dest=0x50))>>>unpacker=apt.Unpacker(port)>>>formsginunpacker:...print(msg)...>>>On Windows, you must toggle a driver setting to make the COM port appear:Within Device Manager, right click on the APT device (under USB devices), and go toProperties.
On theAdvancedtab, check the box that saysLoad VCP(VCP stands for Virtual COM Port).
Unplug and replug the USB cable to make it load the COM Port.If theAdvancedtab does not appear, I was able to use FTDI'sFT_PROG.
With all other Thorlabs programs not running, clickDevices > Scan for devices.
Review over the provided ID information to ensure that you are editing the correct device, FTDI provides serial communication for many different devices from several manufacturers, it is very possible you have multiple devices which show up.
Under theHardware Specific, uncheck theLoad D2XXbox.
This box is a bit of a misnomer, as it really means "LoadonlyD2XX", as when unchecked the D2XX driver (which the Thorlabs provided programs use) is still loaded, but the VCP driver is also loaded.
ClickDevices > Program.Upon reconnecting (unplug and replug USB) theAdvancedtab should appear as above, but theLoad VCPdriver option may not be checked yet.
Package: thorlabs-elliptec
This is a python interface to Thorlabs Elliptec series of piezoelectric motion stages and mounts. It
should support all models including:Thorlabs Elliptec ELL6 shutterThorlabs Elliptec ELL7 linear stageThorlabs Elliptec ELL8 rotation stageThorlabs Elliptec ELL9 multi-position filter mountThorlabs Elliptec ELL10 linear stageThorlabs Elliptec ELL14 rotation mountThorlabs Elliptec ELL17 linear stageThorlabs Elliptec ELL18 rotation stageThorlabs Elliptec ELL20 linear stageAs of version 1.0, all basic functionality is implemented. However, the “multi-drop” capability
which allow multiple devices to share a single serial port device is not yet implemented. This means
that to control more than one device, each device must be connected via its own serial port (such as
a dedicated USB to serial adaptor). The multi-drop feature is planned, and hopefully will be
implemented soon in a future release.SupportDocumentation can be found online athttps://thorlabs-elliptec.readthedocs.io/en/latest.Source code is hosted athttps://gitlab.com/ptapping/thorlabs-elliptec.Bug reports, feature requests and suggestions can be submitted to theissue tracker.LicenseThis software is free and open source, licensed under the GNU Public License.
See theLICENSEfor details.
Package: thorlabs-mc2000b
This is an interface to the Thorlabs MC2000B optical chopper unit, communicating over the USB
serial port.Usage is quite straightforward. For example:fromthorlabs_mc2000bimportMC2000B,Blade# Initialise the first detected devicechopper=MC2000B()# We'll assume the default MC1F10HP is installedprint(chopper.get_blade_string())# Set up to use external reference source and the inner part of the bladechopper.set_inref_string("external-inner")# Apply a 1/2 divider to the input frequencychopper.nharmonic=1chopper.dharmonic=2# Start it up!chopper.enable=True# If a different chopper blade is installed, it can be configured by# using the Blade enum, for example for the MC1F60 model:chopper.blade=Blade.MC1F60# This may change the available input and/or output reference sources.# To check which are available for a blade model:print(Blade.MC1F60.inrefs)print(Blade.MC1F60.outrefs)Information about the unit can be found on theproduct webpage,
and details of the commands and how they apply to the different models of chopper blades can be
found in theuser manual.SupportDocumentation can be found online athttps://thorlabs-mc2000b.readthedocs.io/en/latest/.Bug reports, feature requests and suggestions can be submitted to theissue tracker.LicenseAll original work is free and open source, licensed under the GNU Public License.
See theLICENSE.txtfor details.
Package: thorml
THOR: Time-Varying High-dimensional Ordinal RegressionTHOR is a new autoML tool for temporal tabular datasets and time series. It handles high dimensional datasets with distribution shifts better than other tools. Inspired by the Numerai competiton, THOR has evolved from a specific tool for Numerai competition into a general ML pipeline which has many applications in finance and healthcare.Gradient Boosting Decision TreesCustomised LightGBM-based Gradient Boosting Decision Trees models for temporal tabular datasets.Deep Learning ModelsA novel deep learning model for temporal tabular datasets, which complements well with the above GBDT-based models.TimeSeries HybridA new method which combines classical and machine learning techniques for feature engineering and sequence modelling. A hybrid approach which demonstrate robust performances for high dimensional time-series.Dynamic HyperoptApply dynamic hyper-parameter optimisation methods under incremental learning framework for temporal tabular and multi-variate timeseries datasets.Portfolio OptimisationA new method to combine predictions from machine learning model using well-known theories from finance. Using the best research results from both finance and reinforcement learning, the method can maximise the portfolio return (or minimise the given loss function) within required risk metrics.Trend FollowerAn enhanced implementation of trend following strategies with improved robustness and lower risks than the standard implementation of moving averages. Offer a better way to replicate trend following strategies and build new strategies that are less correlated to existing ones.DockerAs this packages used various machine learning and CUDA libaries for GPU support, we recommend to use docker to manage the dependencies.The image is now uploaded onDocker Hub.dockerpullthomaswong2023/thor-public
dockerrun--gpusdevice=all-it-d--rm--namethor-public-examplethomaswong2023/thor:publicbashPyPIThis project is also onPyPI.Install the package with the following command. Dependencies are not installed with the packagepipinstallthorml-rrequirements.txtCitationIf you are using this package in your scientific work, we would appreciate citations to the following preprint on arxiv.Robust machine learning pipelines for trading market-neutral stock portfoliosBibtex entry:@misc{https://doi.org/10.48550/arxiv.2301.00790,
  doi = {10.48550/ARXIV.2301.00790},
  
  url = {https://arxiv.org/abs/2301.00790},
  
  author = {Wong, Thomas and Barahona, Mauricio},
  
  keywords = {Computational Finance (q-fin.CP), Computational Engineering, Finance, and Science (cs.CE), Machine Learning (cs.LG), FOS: Economics and business, FOS: Economics and business, FOS: Computer and information sciences, FOS: Computer and information sciences},
  
  title = {Robust machine learning pipelines for trading market-neutral stock portfolios},
  
  publisher = {arXiv},
  
  year = {2023},
  
  copyright = {Creative Commons Attribution 4.0 International}
}
Package: thornbed
ThornbedThornbed is a simple oEmbed wrapper to help you get metadata from different servicesIt currently supports imgur, youtube, flickr, quickmeme, vimeoIt is very easy to add new services to it, since it uses oEmbed libAnd even you can add a service that doesn’t provide oEmbed suppert like imgur, quickmeme, etc…Getting startedDownload and install this package.use it:import thornbed

res = thornbed.embed('http://youtu.be/a1Y73sPHKxw')Have fun !
Package: thorndyke
Lightweight username enumeration tool that checks the availability of a specified username on over 200 websites.Installation & UsageInstall from Pypi:$ pip install thorndyke$ thorndyke [username]Clone from Github:$ git clone https://github.com/rly0nheart/thorndyke.git$ cd thorndyke$ pip install -r requirements.txt$ python thorndyke -v [username]Optional ArgsFlagUsage--found--not-foundGithubGithub repositoryLICENSE
Package: thorne
Thorne Library for pythonThis is the Thorne library for python made by the thorne team
in Cis.DocumentationFile Structure├── README.MD                                       - README
├── docs                                            * DOCUMENTATION FOLDER
│   └── Lib.md                                          - MAIN DOCUMENTATION FILE
├── lib                                             * SOURCE FOLDER
│   ├── __init__.py                                     - MAIN LIBRARY SOURCE FILE
│   └── __pycache__                                     * PYC FOLDER
│       └── __init__.cpython-38.pyc                         - PYC OF __init__.py
├── tasks                                           * TODO FOLDER
│   ├── done.list                                       - FINISHED TASKS
│   └── todo.list                                       - TODOS
└── test.py                                         - TEST
Package: thornfield
thornfield: Advanced caching in pythonInstallationpip install thornfieldUsageChoose the cache storage you want to use - in-memory, redis and postgresql are currently implemented.
You can use a different storage by implementing theCacheinterface.Then, use thecacheddecorator to annotate the function being cached:cacher = Cacher(cache_factory_func)

@cacher.cached
def foo():
    ...The decorator supports:Setting an expiration time for the cached values.Caching only values that match a constraint (e.g. notNone).Using only some of the function parameters as keys for the cache.Caching async functions.Caching only some parametersIn case you don't want to use all the parameters of the function as cache key,
you can theCachedorNotCachedtypes:from thornfield.typing import Cached, NotCached

@cached
def request(url: str, token: str, timeout: NotCached[int]):
    ...


@cached
async def request_async(url: Cached[str], timeout: int, callback):
    ...Caching abstract methodsIn order to avoid adding the same decorator to all implementations of an
abstract method, you can usecache_methodas follows:class Base(ABC):
    def __init__(self):
        cacher.cache_method(do_something)

    @abstractmethod
    def do_something(self):
        passCache FactoriesIn thecache_factoriespackage you can find cache factories for Redis and PostgreSQL.
They both cache each function to a different table (in PostgreSQL, db in Redis).Theircreatemethod can be passed ascache_implto the constructor ofCacher.
Package: thorn.py-remast
Thorn RemasteredThorn Remasteredis an enhanced version of the original Thorn.py project, designed to simplify web scraping tasks by providing a versatile set of tools.FeaturesScrapes a wide range of content types, including HTML, JSON, CSS, and more.Image scraping capabilities for downloading images from websites.User-friendly and interactive command-line interface.Flexible and extensible architecture for adding new scraping functionality.Built-in error handling to ensure robust scraping.InstallationYou can install Thorn Remastered via pip:pipinstallthorn.py-remastUsageHere are some examples of how to use Thorn Remastered:Scraping HTMLfromthornimportThornthorn=Thorn()html_content=thorn.scrape_html("https://example.com")print(html_content)Scraping JSONfromthornimportThornthorn=Thorn()json_data=thorn.scrape_json("https://api.example.com/data.json")print(json_data)Scraping ImagesfromthornimportImageThornimage_thorn=ImageThorn()image_thorn.scrape_images("https://example.com",output_folder="./example_images")Scraping Python CodefromthornimportThornthorn=Thorn()python_code=thorn.scrape_python("https://raw.githubusercontent.com/example/repo/main/script.py")print(python_code)ContributingContributions are welcome! Feel free to open issues, submit pull requests, or suggest improvements.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.AcknowledgmentsSpecial thanks to the original Thorn.py project for inspiration.Note:Always ensure compliance with website terms of service and legal regulations when performing web scraping.Table of ContentsFeaturesInstallationUsageScraping HTMLScraping JSONScraping ImagesScraping Python CodeContributingLicenseAcknowledgments
Package: thorns
__|________|_____|_|_|___|_____|____||_____|_____|_____|____|_____|___||______
_|_______________________|______|_________|_______|_____|____|__|________|_|__
_____|___|__|_____|_______|____|_________________________|__|_________|_______
___|_______|_____|______|_____|_______|__|___|________|______|___|____________
__|__|_______|_____|__|___|______|________|______|______|_____|_______THORNS__Withthornsyou can analyze and displayspike trainsgenerated by
neurons.  It can be useful for the analysis of experimental and
simulation data using Python.  For example, you can easily calculate
peristimulus time histogram (PSTH), interspike time histogram (ISIH),
vector strength (VS), entrainment and visualize action potentials with
raster plot.wavesis a submodule with some useful signal processing and
generation functions, e.g. generate ramped tone, amplitude modulation
tone, FFT filter, set level (dB_SPL).The software was originally developed during my PhD in the group ofWerner Hemmertat the TUM.  It is oriented towards auditory
research, but it could be easily extended.UsageDon’t forget to check our IPython NotebookDEMOand scripts in theexamplesdirectory!Initialize and load spike trains:import thorns as th
from thorns.datasets import load_anf_zilany2014

spike_trains = load_anf_zilany2014()Calculate vector strength:th.vector_strength(spike_trains, freq=1000)Raster plot:th.plot_raster(spike_trains)
th.show()Generate and plot AM tone:import thorns.waves as wv

sound = wv.amplitude_modulated_tone(
    fs=48e3,
    fm=100,
    fc=1e3,
    m=0.7,
    duration=0.1,
)

wv.plot_signal(sound, fs=48e3)

wv.show()You can also browse the API documentation athttps://pythonhosted.org/thorns/FeaturesAnalyzes and displays spike trainsUses pandas.DataFrame as the main data container (spike trains,
results)Handy signal processing and generating functions:thorns.wavesMap implementation with various backend (also parallel) and caching:thorns.util.map()Dumpdb: quickly dumpmap()’s results in one script and load from
another one:thorns.util.dumpdb(),thorns.util.loaddb()Pure PythonInstallationIn order to usethorns, you’ll need to install the following
dependencies first:Python (2.7)NumpyScipyPandasPyTables / tablesMatplotlibpy-notify (optional, enables notifications)Next, type in your command line:pip install thornsContributeOpen tasks:TODO.org(best viewed in Emacs org-mode)Issue Tracker:https://github.com/mrkrd/thorns/issuesSource Code:https://github.com/mrkrd/thornsLicenseThe project is licensed under the GNU General Public License v3 or
later (GPLv3+).
Package: thorod
thorodthorodis a CLI utility for torrent creation and manipulation.What's a thorod?Thorod means torrent (of water) in the Tolkien Elvish language of Sindarin.Why use thorod?There are many CLI torrent utilities out there, so here are some unique or notable features of thorod:All torrents are unique; a random salt is added to all created/xseeded torrents.Supports trackers on the same tier.Type less with tracker abbreviations.Includes a number of open public trackers by default.Includes auto generated open and random abbreviations to help balance load between open public trackers.Users can list/add/remove their own tracker abbreviations directly from CLI as well as manually editing config file.Generate magnet links on creation or on command.Has an xseed command to generate a cross-seedable torrent without re-hashing files.View information about a torrent file in the terminal, rather than adding it to a torrent client.Simple automatic piece size calculation from 16 KiB to 32 MiB on by default. Users can set manually by option.Supports source key in info dict used by private trackers.Installationpip install -U thorodUsageFor the release version, see thestable docs.For the development version, see thelatest docs.AppreciationShowing appreciation is always welcome.ThankGet your own thanks inbox atSayThanks.io.ContributeContributeby submitting bug reports, feature requests, or code.Help Others/Stay InformedDiscourse forumReferrals/Donations