Saravanan666/pypi-org huggingface dataset:
Package: tornado-smtpclient
Non-blocking smtp client to work with tornado web framework 4.0 and aboveThis library is a port of Python smtplib to tornado non-blocking IOstream implementation.The below example was taken and modified from Python docs’ example:#!/usr/bin/env python3

from tornado_smtpclient import client

from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText

# create SMTP client
s = client.SMTPAsync()
yield s.connect('your.email.host',587)
yield s.starttls()
yield s.login('username', 'password')

# me == my email address
# you == recipient's email address
me = "my@email.com"
you = "your@email.com"

# Create message container - the correct MIME type is multipart/alternative.
msg = MIMEMultipart('alternative')
msg['Subject'] = "Link"
msg['From'] = me
msg['To'] = you

# Create the body of the message (a plain-text and an HTML version).
text = "Hi!\nHow are you?\nHere is the link you wanted:\nhttp://www.python.org"
html = """\
<html>
<head></head>
<body>
<p>Hi!<br>
How are you?<br>
Here is the <a href="http://www.python.org">link</a> you wanted.
</p>
</body>
</html>
"""

# Record the MIME types of both parts - text/plain and text/html.
part1 = MIMEText(text, 'plain')
part2 = MIMEText(html, 'html')

# Attach parts into message container.
# According to RFC 2046, the last part of a multipart message, in this case
# the HTML message, is best and preferred.
msg.attach(part1)
msg.attach(part2)

# sendmail function takes 3 arguments: sender's address, recipient's address
# and message to send - here it is sent as one string.
yield s.sendmail(me, you, msg.as_string())
yield s.quit()
Package: tornado-stub-client
## Tornado Stub Client[![Build Status](https://travis-ci.org/venmo/tornado-stub-client.png?branch=master)](https://travis-ci.org/venmo/tornado-stub-client)A library for stubbing async calls to external services in tornado.  It stubs out AsyncHTTPClient.fetch, to be precise (but there's no need to be precise, that's the only asynchronous method in all of Tornado).  It works well but it's brand new, I have a couple more features to add.Similar to [HTTPretty](https://github.com/gabrielfalcao/HTTPretty) but this just patches the `fetch()` method directly rather than the python socket.  Writing a new library was easier than trying to get HTTPretty to work with the tornado async client.  If there's interest it would be easy enough to make this work with other http libs, e.g. requests or grequests, but you should probably just use HTTPretty.### Usage```pythonimport tornadofrom tornado_stub_client import stub, reset, AsyncHTTPStubClientclass MyAppTest(tornado.testing.AsyncTestCase):def test_basic(self):client = AsyncHTTPStubClient()with stub("http://example.com").and_return(body="hello there"):client.fetch("http://example.com", self.stop)response = self.wait()self.assertEquals(response.code, 200)self.assertEquals(response.body, "hello there")def test_an_async_library(self):""" For this example, SomeRestLib is some async library that wraps aREST api. It has an AsyncHTTPClient as an instance variable.Let's say it has a method get_user(id, callback) that sends a GET to/user/:id and returns just json, and we want to unit test it"""mylib = SomeRestLib()mylib.http_client = AsyncHTTPStubClient()with stub("http://api.example.com/user/10").and_return(body_json={'name': 'Danny Cosson','twitter_handle': '@dannycosson'}):mylib.get_user(10, self.stop)response_dict = self.wait()self.assertEquals(response_dict.get('name'), 'Danny Cosson')def test_can_queue_stub_responses(self):""" A stub supports round-robin responses, i.e., a stub will cycle throughqueued responses. Handy for testing endpoints that handle state."""client = AsyncHTTPStubClient()with stub("/hello").and_return(body="hello")\.and_return(body="world"):client.fetch("/hello", self.stop)response = self.wait()self.assertEqual(response.code, 200)self.assertEqual(response.body, "hello")client.fetch("/hello", self.stop)response = self.wait()self.assertEqual(response.code, 200)self.assertEqual(response.body, "world")```See `tests/test_integration.py` for working tests/example code.Note that you don't have to use `stub().and_return()` in a `with` statement, but if you don't the stub you create won't get deleted between tests so you should add setUp or tearDown method that calls `reset()` to clear out the data.### TestsIt would be strange to write an untested testing library.  To run the tests (probably in a virtualenv is best):$ cd tornado-stub-client$ pip install -r requirements.txt$ pip install nose$ nosetests tests
Package: tornado_testing
This is a simple testlayer that can be used to test tornado web applications
using thezope testrunner.First lets create a simple sample application:>>> from tornado.web import Application, RequestHandler
>>> class HelloWorldHandler(RequestHandler):
...     def get(self):
...         return self.write('Hello World')Importing the layer:>>> from tornado_testing.layer import TornadoLayerCreate the layer using the sample application created earlier:>>> my_app = Application(handlers=[(r'/', HelloWorldHandler)])
>>> tornado_layer = TornadoLayer(my_app, port=None)
>>> type(tornado_layer.port)
<class 'int'>NoteIf the port is None the next free port will be used.Set up the layer:>>> tornado_layer.setUp()Now the layer should be running and therefore tornado will serve requests:>>> from urllib.request import urlopen
>>> url = 'http://localhost:{}/'.format(tornado_layer.port)
>>> f = urlopen(url)
>>> f.read()
b'Hello World'

>>> f.close()
>>> tornado_layer.tearDown()PatchesThe testlayer supports patches which can be used to mock out any modules that
are used inside a tornado application.Here is an example of a tornado application that uses theosmoduleslistdirmethod:>>> import json
>>> class ListDirHandler(RequestHandler):
...     def get(self):
...         import os
...         return self.write(json.dumps(os.listdir('.')))

>>> my_app = Application(handlers=[(r'/', ListDirHandler)], debug=True)NoteUsually the import also works outside the method on module level. But since
this example is executable using doctest it had to be put inside the method
as otherwise the patch wouldn’t work.Now define the fakelistdirmethod:>>> def fake_listdir(path):
...     return ['fake_file']Create the monkey patch:>>> from unittest.mock import patch
>>> listdir_patch = patch('os.listdir', fake_listdir)Create the test layer using the patch:>>> tornado_layer = TornadoLayer(my_app, port=None, patches=[listdir_patch])
>>> tornado_layer.setUp()

>>> url = 'http://localhost:{}/'.format(tornado_layer.port)
>>> f = urlopen(url)
>>> f.read()
b'["fake_file"]'

>>> f.close()
>>> tornado_layer.tearDown()
Package: tornadotools
Tornado ToolsThis is a small project collecting my personalbest practicesandgoodiesfor my work withTornado.Basically there are two types of code in here:Libraries. Some are simply collected (likeadisp), some are selfwritten(like theMonrel2 Handler)Python decorators. Mostly they are little code snippets doing somethinguseful and enhancingTornadoin a (hopefully) useful way.Detailed usage is can be found in thedocumentation.Getting started with the codeTo get an idea of the code, have a look and thedocumentation. Then you should
know whatbuildoutis and does. Finally you should be familiar with some kind
of editor…LicenseCurrently everything is licensed under theApache License, Version 2. Maybe
I should use theBSDorMITlicense, but then I had to change all code
headers…
Package: tornado-torexpress
Express Extension for Tornado======================**A RESTful extension for tornado.***Note: It's under very basic development now, every thing can be changed in the next commit.*Features----------------------1. XXX1. XXXX1. XXXX1. XXXX1. XXXXQuick Start----------------------# -*- coding: utf-8 -*-from torexpress.application import ExpressApplicationfrom torexpress.handler import ExpressHandlerfrom sqlalchemy.ext.declarative import declarative_basefrom sqlalchemy import Column, Integer, String, Sequence, MetaData, ForeignKeyfrom sqlalchemy.orm import relationship, backreffrom sqlalchemy.orm.query import QueryBase = declarative_base()class User(Base):__tablename__ = 'users'id = Column(Integer, Sequence('user_id_seq'), primary_key=True)name = Column(String(50), nullable=False, unique=True)fullname = Column(String(50), nullable=True)password = Column(String(40), nullable=True)class UserHandler(ExpressHandler):"""UserHandler to process User table."""class Meta:table = User@encoder('password')def password_encoder(self, passwd, inst=None):import hashlibreturn hashlib.new('md5', passwd).hexdigest()if __name__ == "__main__":import tornado.ioloopapplication = ExpressApplication([UserHandler.route_to('/users'), ],dburi='sqlite:///:memory:', loglevel='DEBUG', debug=True)Base.metadata.create_all(application.db_engine)application.listen(8888)tornado.ioloop.IOLoop.instance().start()Requirements----------------------- Tornado >= 3.1.1- SQLAlchemy >= 0.8- Simplejson- PyYAML
Package: tornado-whois
Asynchronous Whois client for tornado frameworkInstallationpip install tornado-whoisExamplefrom tornado import ioloop
from tornadowhois import AsyncWhoisClient
from tornado.platform.caresresolver import CaresResolver

async def main():
    whois = AsyncWhoisClient(CaresResolver())
    is_available = await whois.check_domain("tornadoweb.org")
    if is_available:
        print("tornadoweb.org is available")

    read_result = await whois.whois_query("tornadoweb.org")
    print(read_result)

ioloop.IOLoop.current().spawn_callback(main)
Package: tornado-wtforms
Candango Tornado WTFormsWTForms extensions for Tornado forked fromWTForms-Tornado.We will derive the amazing work developed by the original project and add
further improvements.The projectWTForms-Tornadowill continue to be matained. Check the original project to see if it fit the
needs your project/application needs.Usageimporttornado.ioloopimporttornado.webfromwtforms.fieldsimportIntegerFieldfromwtforms.validatorsimportDataRequiredfromtornado_wtforms.formimportTornadoFormclassSumForm(TornadoForm):a=IntegerField(validators=[DataRequired()])b=IntegerField(validators=[DataRequired()])classSumHandler(tornado.web.RequestHandler):defget(self):self.write("Hello, world")defpost(self):form=SumForm(self.request.arguments)ifform.validate():self.write(str(form.data['a']+form.data['b']))else:self.set_status(400)self.write(""%form.errors)application=tornado.web.Application([(r"/",SumHandler),])if__name__=="__main__":application.listen(8888)tornado.ioloop.IOLoop.instance().start()Backwards CompatibilityWe'll keep a backwards compatibility with the WTForms-Tornado but a
depreciation warning will be logged.This still works after the instalation:fromwtforms_tornadoimportFormclassLegacyForm(Form):passThetornado_wtforms.from.Formclass is extendingwtforms.form.TornadoFormand is available to be imported atwtforms_tornadomodule.Just changing wtforms_tornado by tornado_wtforms and keep importing Form won't
work,from tornado_wtforms import Form, because Form is not
referenced in tornado_wtforms module. Either you dofrom tornado_wtforms.form import TornadoFormorfrom tornado_wtforms.form import Form. The second option will still trigger
a depreciation after instantiating a Form instance.InstallationYou can to use pip_ to install Tornado-WTForms:$pipinstalltornado-wtformsOr using last source:$pipinstallgit+git://github.com/puentesarrin/tornado-wtforms.gitOr manually, download the latest source from PyPI:$tarxvzftornado-wtforms-$VERSION.tar.gz
$cdtornado-wtforms-$VERSION$pythonsetup.pybuild
$sudopythonsetup.pyinstallSupportTornado WTForms is a fork fromWTForms Tornadoand now is one ofCandango Open Source Groupinitiatives and is available underApache License, Version 2.0.WTForms Tornadois maintained byJorge Puente Sarrínand is available underApache License, Version 2.0.This web site and all documentation is licensed underCreative
Commons 3.0.Copyright (c) 2022 Flávio Gonçalves GarciaCopyright (c) 2013-2022 Jorge Puente Sarrín
Package: tornadox
tornadoxLightweight, probabilistic ODE solvers. Fast like the wind. 🌪️ Powered by JAX.InstallationInstalltornadoxviapip install tornadoxOr get the most recent version from source:pip install git+https://github.com/pnkraemer/tornadox.gitUsageUsetornadoxas follows.importjax.numpyasjnpfromtornadoximportek0,ek1,init,step,ivp# Create a solver. Any of the following work.# The signatures of all solvers coincide.solver1=ek0.KroneckerEK0()solver2=ek0.ReferenceEK0(num_derivatives=6)solver3=ek1.ReferenceEK1(initialization=init.TaylorMode())solver4=ek1.DiagonalEK1(initialization=init.RungeKutta())solver5=ek1.ReferenceEK1(num_derivatives=5,steprule=step.AdaptiveSteps())# Solve an IVPvdp=ivp.vanderpol(t0=0.,tmax=1.,stiffness_constant=1.0)forsolverin[solver1,solver2,solver3,solver4,solver5]:# Full solveprint(solver)solver.solve(vdp)solver.solve(vdp,stop_at=jnp.array([1.2,1.3]))# Only solve for the final statesolver.simulate_final_state(vdp)# Or go straight to the generatorforstate,infoinsolver.solution_generator(vdp):passprint(info)print()CitationThe efficient implementation of ODE filters is explained in the paper (link)@InProceedings{pmlr-v162-kramer22b,
  title = 	 {Probabilistic {ODE} Solutions in Millions of Dimensions},
  author =       {Kr{\"a}mer, Nicholas and Bosch, Nathanael and Schmidt, Jonathan and Hennig, Philipp},
  booktitle = 	 {Proceedings of the 39th International Conference on Machine Learning},
  pages = 	 {11634--11649},
  year = 	 {2022},
  editor = 	 {Chaudhuri, Kamalika and Jegelka, Stefanie and Song, Le and Szepesvari, Csaba and Niu, Gang and Sabato, Sivan},
  volume = 	 {162},
  series = 	 {Proceedings of Machine Learning Research},
  month = 	 {17--23 Jul},
  publisher =    {PMLR},
  pdf = 	 {https://proceedings.mlr.press/v162/kramer22b/kramer22b.pdf},
  url = 	 {https://proceedings.mlr.press/v162/kramer22b.html}
}Please consider citing it if you use this repository for your research.
Package: tornado-xmlrpc
XML-RPC server and client implementation based on tornado. Using lxml and AsyncHttpClient.Example:fromtornado_xmlrpcimporthandler,clientfromtornado.testingimport*classXMLRPCTestHandler(handler.XMLRPCHandler):defrpc_test(self):returnNonedefrpc_args(self,*args):returnlen(args)defrpc_kwargs(self,**kwargs):returnlen(kwargs)defrpc_args_kwargs(self,*args,**kwargs):returnlen(args)+len(kwargs)defrpc_exception(self):raiseException("YEEEEEE!!!")classTestSimple(tornado.testing.AsyncHTTPTestCase):defsetUp(self):super(TestSimple,self).setUp()self.server=client.ServerProxy("http://localhost:%d"%self.get_http_port())deftearDown(self):super(TestSimple,self).tearDown()self.server=Nonedefget_app(self):returnApplication(handlers=[('/',XMLRPCTestHandler),])@gen_testdeftest_00_test(self):result=yieldself.server.test()self.assertIsNone(result)@gen_testdeftest_10_args(self):result=yieldself.server.args(1,2,3,4,5)self.assertEqual(result,5)@gen_testdeftest_20_kwargs(self):result=yieldself.server.kwargs(foo=1,bar=2)self.assertEqual(result,2)@gen_testdeftest_20_kwargs(self):result=yieldself.server.args_kwargs(1,2,3,4,5,foo=1,bar=2)self.assertEqual(result,7)@gen_testdeftest_30_exception(self):try:yieldself.server.exception()exceptclient.RemoteServerExceptionase:self.assertIn("YEEEEEE!!!",e.message)else:raiseRuntimeError("No exception")
Package: tornado_xstatic
XStaticis a means of
packaging static files, especially JS libraries, for Python applications.Tornadois a Python web framework.This integration provides:XStaticFileHandlerto serve static files from XStatic packages.xstatic_urlui method to build URLs for XStatic files, including
the?v=...tag  that Tornado uses for cache invalidation.To use these:importtornado.ioloopimporttornado.webfromtornado_xstaticimportXStaticFileHandler,xstatic_urlclassMyHandler(tornado.web.RequestHandler):defget(self):self.render("mytemplate.html")if__name__=="__main__":application=tornado.web.Application([(r"/",MyHandler),(r"/xstatic/(.*)",XStaticFileHandler,{"allowed_modules":["jquery","bootstrap"]}),],ui_methods={'xstatic_url':xstatic_url('/xstatic/')})application.listen(8888)tornado.ioloop.IOLoop.instance().start()Passingallowed_modulesis optional: if it is not provided, files from any
XStatic module may be served.In your template, you can then do this:<script src="{{ xstatic_url('jquery', 'jquery.min.js') }}"></script>
<script src="{{ xstatic_url('bootstrap', 'js/bootstrap.min.js') }}"></script>

<link href="{{ xstatic_url('bootstrap', 'css/bootstrap.min.css') }}" rel="stylesheet">
Package: tornaduv
tornaduv is aTornadoIOLoop implementation
which usespyuvas the networking library instead
of the builtin epoll and kqueue pollers included in Tornado.pyuv is a Python interface for libuv, a high performance asynchronous
networking library used as the platform layer for NodeJS.Installationtornaduv requires pyuv >= 1.0.0 and Tornado >= 3.0.pip install git+https://github.com/saghul/tornaduv.gitNOTE:If you are using Tornado 2.4.x you need to use the ‘tornado24’ branch
or the 0.2.x versions of tornaduv.Using itIn order to use tornaduv, Tornado needs to be instructed to use
our IOLoop. In order to do that add the following lines at the beginning
of your project:from tornado.ioloop import IOLoop
from tornaduv import UVLoop
IOLoop.configure(UVLoop)TestingIf you want to run the Tornado test suite using tornaduv run the following command:python -m tornado.test.runtests --ioloop='tornaduv.UVLoop' --verboseAuthorSaúl Ibarra Corretgé <saghul@gmail.com>Licensetornaduv uses the MIT license, check LICENSE file.
Package: tornamona
tornamonaA series of fixes for Data originating from Northern IrelandThis is very much a work in progress and I'll only really add to it as things annoy me,
but if you have a data set that's messy, and you can use similar workflows as demonstrated
in this repo, please feel free to use this and PR the crap out of it.I make no claims of liability, credit, or property over any of this, and make no promises
that anything will ever work or be fixed.Current DatasetsNISRA Weekly Deaths DatasetsSource:https://www.nisra.gov.uk/publications/weekly-deathsWhat is this data?Weekly death registrations in Northern Ireland, from 2009 - 2020Also includes tracking of 2020 COVID outbreakWhat is wrong with the data as presented?The Usual Boilerplate (i.e. non numerical footers, non-merged multi row headers, overly complex column headers, inconsistent structure)a typo in the 2014 Week Start date (Which actually inspired me to make this repo in the first place)(This was fixed)How do I use the new onefromtornamona.fixesimportnisradataset=nisra.WeeklyDeaths().get().clean()dataset.data.head().to_markdown()WeekWeek StartWeek EndTotal DeathsAverage Deaths for previous 5 yearsMin 5 year deathsMax 5 year deathsRespiratory DeathsAverage Respiratory Deaths for previous 5 yearsCOVID19 Deaths012008-12-27 00:00:002009-01-02 00:00:00373332.4309364nannannan122009-01-03 00:00:002009-01-09 00:00:00454329.2302377nannannan232009-01-10 00:00:002009-01-16 00:00:00388310.2290340nannannan342009-01-17 00:00:002009-01-23 00:00:00402324281367nannannan452009-01-24 00:00:002009-01-30 00:00:00353305.6272333nannannanProposed DatasetsEverything that has ever pissed me off about open dataCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.=======
History0.1.2 (2020-04-27)Reflect upstream data fix from NISRA0.1.1 (2020-04-26)Instrumentation, Testing and Documentation FixesSecurity updates0.1.0 (2020-04-25)First release on PyPI.
Package: tornasess
Environmentpython version: >= 3.4backend: redis,memcache,diskrequired: tornadis, tornado, asyncmcInstallation$python3.xsetup.pyinstallor$pip3.xinstalltornasessQuickstartedcreate session instancefromtornadoimportioloop,genfromtornasessimportSessionCacheFactoryconfig={"host":"localhost","port":6379,}sess_fac=SessionCacheFactory("redis",config)# or# config = {#      "host":["192.168.0.1","192.168.0.2"],#      "port":[4000,5000]# }# sess_fac = SessionCacheFactory("memcache", config)### or# config = {"root":"/tmp"}# sess_fac = SessionCacheFactory("disk", config)#session=sess_fac.get_session()set session datayieldsession.start()session['name']='xxxxx'session.set("age",100)session.multi_set({"address":"xxxx","sex":"xxx"})yieldsession.end(expires=3600)get session datasession_id="GU3ZTM2YTA5ZWViNDE4MTgzM2Q3MzhhMjdjY2IyOWU="yieldsession.start(session_id)session['name']session.get('name')session.multi_get(['address','age','name'])session.all()#check session field existenceprint('name'insession)#get session idsession.session_id#Note here!!#   if you don't make change to session data,#   it's not necessary to call 'session.end()'delete session datasession_id="GU3ZTM2YTA5ZWViNDE4MTgzM2Q3MzhhMjdjY2IyOWU="yieldsession.start(session_id)session.delete("name")delsession['age']yieldsession.end()destroy sessionsession_id="GU3ZTM2YTA5ZWViNDE4MTgzM2Q3MzhhMjdjY2IyOWU="yieldsession.start(session_id)session.destroy()yieldsession.end()cache session instance# after you used session ,you can cache it to cache factorysess_fac.cache(session)Version0.1LICENSEMIT LICENSE
Package: tornaSession
Torndsession SessionTorndsessionis a session extension forTornadoweb framework.
Torndsession support application memory, file, redis or memcached to save session data for request, and it’s easy to extend for developer.Quick linksDocumentationSource (github)Torndsession LicenseExamplesHello, SessionHere is a simple “Hello, Session” example web app for Tornado with Torndsession.:import tornado.web
import tornado.httpserver
import tornado.ioloop
import torndsession


class Application(tornado.web.Application):
    def __init__(self):
        handlers = [
            (r"/", MainHandler),
        ]
        settings = dict(
            debug=True,
        )
        # sid_name, lifetime added in 1.1.5.0
        # sid_name: the name of session id in cookies.
        # lifetime: session default expires seconds.
        session_settings = dict(
            driver='memory',
            driver_settings={'host': self},
            force_persistence=True,
            sid_name='torndsessionID',
            session_lifetime=1800
        ),
        settings.update(session=session_settings)
        tornado.web.Application.__init__(self, handlers, **settings)


class MainHandler(torndsession.sessionhandler.SessionBaseHandler):
    def get(self):
        self.write("Hello, Session.<br/>")
        if 'data' in self.session:
            data = self.session['data']
        else:
            data = 0
        self.write('data=%s' % data)
        self.session["data"] = data + 1


def main():
    http_server = tornado.httpserver.HTTPServer(Application())
    http_server.listen(8000)
    tornado.ioloop.IOLoop.instance().start()


if __name__ == "__main__":
    main()In this example, Request handler obtain memory session feature, it just inherit from SessionBaseHandler. more session example seetorndsession demos.InstallationAutomatic installation:pip install torndsessionTorndsession is listed inPyPIand can be installed withpiporeasy_install. Note that this installation can not install demos applicatinos which be included in source code.The another way is usegit+install torndsession from github.pip install git+https://github.com/mitchellchu/torndsessionManual installation:In this way, you need download the source fromPyPI.:tar xvzf torndsession.tar.gz
cd torndsession
python setup.py build
sudo python setup.py installThe Torndsession source code is hosted onGitHub.UpdatedTorndsession 1.1.5:fixed bug in 1.1.4default session id value generator changed. see#ISSUE 12#.added two custom key in settings.sid_name: session’s cookie name.session_lifetime: default expired seconds for session.Torndsession 1.1.4:fixed bugTorndsession 1.1.3 fixed some bug and supported python 3.x.RequiresTornadoRedis (Optional)Memcached (Optional)LICENSETorndsession is licensed under MIT.