Saravanan666/pypi-org huggingface dataset:
Package: eventlet
WarningNew usages of eventlet are now heavily discouraged! Please read the
following.Eventlet was created almost 18 years ago, at a time where async
features were absent from the CPython stdlib. With time eventlet evolved and
CPython too, but since several years the maintenance activity of eventlet
dicreased leading to a growing gap between eventlet and the CPython
implementation.This gap is now too high and can lead you to unexpected side effects and bugs
in your applications.Eventlet now follows a new maintenance policy.Only maintenance for
stability and bug fixingwill be provided.No new features will be
accepted, except those related to the asyncio migration.Usages in new
projects are discouraged.Our goal is to plan the retirement of eventletand to give you ways to move away from eventlet.If you are looking for a library to manage async network programming,
and if you do not yet use eventlet, then, we encourage you to useasyncio,
which is the official async library of the CPython stdlib.If you already use eventlet, our goal is to allow you to smoothly migrate
from eventlet to asyncio. We are currently thinking about solutions to
make that kind of migrations possible. Only new features related to the
migration solution will be accepted.If you have questions concerning maintenance goals or concerning
the migration do not hesitate toopen a new issue, we will be happy to
answer them.EventletEventlet is a concurrent networking library for Python that allows you to change how you run your code, not how you write it.It uses epoll or libevent for highly scalable non-blocking I/O.  Coroutines ensure that the developer uses a blocking style of programming that is similar to threading, but provide the benefits of non-blocking I/O.  The event dispatch is implicit, which means you can easily use Eventlet from the Python interpreter, or as a small part of a larger application.It’s easy to get started using Eventlet, and easy to convert existing
applications to use it.  Start off by looking at theexamples,common design patterns, and the list ofbasic API primitives.Getting EventletThe easiest way to get Eventlet is to use pip:pip install -U eventletTo install latest development version once:pip install -U https://github.com/eventlet/eventlet/archive/master.zipBuilding the Docs LocallyTo build a complete set of HTML documentation:tox -e docsThe built html files can be found in doc/build/html afterward.Supported Python versionsPython 3.7-3.12 are currently supported.
Package: eventlet_inotifyx
AboutWrapper around inotifyx to use with eventlet, call toget_eventswill block only current eventlet.
Thanks to Stanis Trendelenburg (@trendels) forgevent_inotifyx.APISeeInotifyxfor more info.Usage::import eventlet_inotifyx as inotifyxfd = inotifyx.init()
fd.add_watch(fd, path)
events = inotifyx.get_events()Install~/yourvirtualenv/python setup.py installpip install eventlet_inotifyxLicenseThe MIT License, in LICENSE file.
Package: eventlet_log
AboutSimple wrapper around logging module compatible with eventlet.APIcreate_loggerfunction takes logger name and optional format and level arguments and return (log, log_exc, logger) tuple.logis just logger.info – prints given message with INFO level.log_exccalls logger.exception and prints given message along with stacktrace.loggeris instance of logging.Logger class.Usagefrom eventlet_log import create_logger
(log, log_exc, _) = create_logger('younameit')

log('Hello world')

try:
    1/0
except ZeroDivisionError:
    log_exc('Smth happens')Install~/yourvirtualenv/python setup.py installpip install eventlet_logLicenseThe MIT License, in LICENSE file.
Package: eventlet-patched
Eventlet is a concurrent networking library for Python that allows you to change how you run your code, not how you write it.It uses epoll or libevent for highly scalable non-blocking I/O.  Coroutines ensure that the developer uses a blocking style of programming that is similar to threading, but provide the benefits of non-blocking I/O.  The event dispatch is implicit, which means you can easily use Eventlet from the Python interpreter, or as a small part of a larger application.It’s easy to get started using Eventlet, and easy to convert existing
applications to use it.  Start off by looking at theexamples,common design patterns, and the list ofbasic API primitives.Quick ExampleHere’s something you can try right on the command line:% python
>>> import eventlet
>>> from eventlet.green import urllib2
>>> gt = eventlet.spawn(urllib2.urlopen, 'http://eventlet.net')
>>> gt2 = eventlet.spawn(urllib2.urlopen, 'http://secondlife.com')
>>> gt2.wait()
>>> gt.wait()Getting EventletThe easiest way to get Eventlet is to use pip:pip install -U eventletTo install latest development version once:pip install -U https://github.com/eventlet/eventlet/archive/master.zipBuilding the Docs LocallyTo build a complete set of HTML documentation, you must have Sphinx, which can be found athttp://sphinx.pocoo.org/(or installed withpip install Sphinx):cd doc
make htmlThe built html files can be found in doc/_build/html afterward.TwistedEventlet had Twisted hub in the past, but community interest to this integration has dropped over time,
now it is not supported, so with apologies for any inconvenience we discontinue Twisted integration.If you have a project that uses Eventlet with Twisted, your options are:use last working release eventlet==0.14start a new project with only Twisted hub code, identify and fix problems. As of eventlet 0.13,EVENTLET_HUBenvironment variable can point to external modules.fork Eventlet, revert Twisted removal, identify and fix problems. This work may be merged back into main project.Apologies for any inconvenience.Flair
Package: eventlet-promise
Eventlet PromiseThis package implements a Javascript-like Promise to use for eventlet threads.fromtypingimportCallableimporteventletashubfromeventlet_promise.promiseimportPromisedefexecutor_(resolveFunc:Callable[[Any],None],rejectFunc:Callable[[Any],None]):t1,t2=5,6# print(t1 := 10 * random())hub.spawn_after(t1,lambda:print('\tResolving')orresolveFunc(t1))hub.spawn_after(t2,lambda:print('\tRejecting')orrejectFunc(TimeoutError("Timed out")))# promise = Promise(None)promise=Promise(executor_)new_promise=promise.then()attached=Promise.resolve(new_promise).then(lambdax:x+1).then(lambdax:x+1)p1=Promise.resolve(1).then(2).then()p2=Promise.reject(1).then(2,2).then().then()p3=p1.then()p_all=Promise.all([p1,p3,new_promise,promise])p_settled=Promise.allSettled([p1,p2,p3,new_promise,promise])p_any=Promise.any([p2,promise.then(),new_promise,promise])p_race=Promise.race([new_promise.then(),new_promise.then()])whileTrue:print(promise)print(new_promise)print(attached)print(p1)print(p2)print(p3)print('all',p_all)print('allSettled',p_settled)print('any',p_any)print('race',p_race)hub.sleep(0)# to allow other eventlet coroutines to work.hub.sleep(2)# so that you don't see all scroll by.
Package: eventlib
# Eventlib[![Build Status](https://secure.travis-ci.org/Yipit/eventlib.png)](http://travis-ci.org/Yipit/eventlib)Long story short, eventlib is an asynchronous event tracking app for
Django. This library was built upon the following values:It must be deadly simple to log an event;It must be possible to track each event in different ways;Each different “event handler” must be completely separate and fail
gracefully;The event system must be asynchronous, so let’s use celery;The library must be extensible;100% of test coverage is enough.To learn how it works, please refer to our tutorial:[First steps to log an event](docs/p1-tutorial.md)[Declaring an event](docs/p2-declaring-an-event.md)[Asynchronous logging](docs/p3-asynchronous-logging.md)
Package: eventlib-pyqs
# Eventlib[![Build Status](https://secure.travis-ci.org/Yipit/eventlib.png)](http://travis-ci.org/Yipit/eventlib)Long story short, eventlib is an asynchronous event tracking app for
Django. This library was built upon the following values:It must be deadly simple to log an event;It must be possible to track each event in different ways;Each different “event handler” must be completely separate and fail
gracefully;The event system must be asynchronous, so let’s use celery;The library must be extensible;100% of test coverage is enough.To learn how it works, please refer to our tutorial:[First steps to log an event](docs/p1-tutorial.md)[Declaring an event](docs/p2-declaring-an-event.md)[Asynchronous logging](docs/p3-asynchronous-logging.md)
Package: eventline
This library is based on the old Eventline SaaS platform, and does not work
with the new open source stand-alone Eventline server.IntroductionThis repository contains the Python SDK for theEventlineplatform.ExamplesTheexamplesdirectory contains scripts demonstrating various use cases for
theeventlinepackage. All of them expect theEVENTLINE_API_KEYto be set.ContactIf you find a bug or have any question, feel free to open a GitHub issue or
contact our support by email.
Package: eventlite
EventliteLight “events” for Python functions.AbstractThe purpose of this library is to provide an “abstract” way for
functions to “report” events, in a way similar to how a logging system
operates.Some example applications:A logging system:emit('log','My message',level='info')Reporting progress on some running operationemit('progress',current=20, total=100)Note that the event structure is not imposed in any way; in fact, any
combination of arguments/keywords can be used, proven that the handler
function is able to handle it.Example usageimporteventlitedefmyfunction(foo):eventlite.emit(foo)defhandler(foo):print('You said:{0}'.format('Hello'))witheventlite.handler(handler):myfunction('Hello')API DocumentationThe library provides two functions:eventlite.emit(*a,**kw)“emits” an “event” (represented by a
variable number of arguments / keywords).eventlite.handler(function)returns a context manager that makes
events to be dispatched to a certain function, while the context is
active.So, in the example above, wheneventlite.emit()is called with one
argument,handler()will be called passing the single argument to
it.InternalsAll the magic is implemented using aLocalStack(borrowed from
werkzeug) which keeps a stack of handlers to be called, for the local
proxy. Theemit()functon simply looks for an handler in the stack
to which to dispatch the event.Note:by default only the handler for the innermost context
manager is called; this might or might not be the desired behavior;
some way to change this will be added in the future.LinksPyPI page:https://pypi.python.org/pypi/eventliteSource code:https://github.com/rshk/eventliteHistoryv0.1aInitial version, with handling of simple events through a
context-manager dispatching to “contexts” in a thread-local stack.
Package: eventlog
eventlogis a simple app that provides an easy and clean
interface for logging diagnostic as well as business intelligence
data about activity that occurs in your site.Out of the box using this does write to the database.For small sites, it should be good enough to use inline but you might at some point want to consider wrapping calls to thelog()method and queue them in
a job manager likeceleryorpyresso that the calls become asynchronous.DocumentationDocumentation can be found athttp://eventlog.rtfd.org/Commercial SupportThis app, and many others like it, have been built in support of many of Eldarion’s
own sites, and sites of our clients. We would love to help you on your next project
so get in touch by dropping us a note atinfo@eldarion.com.
Package: eventlogic
DescriptionEventLogic is a lightweight library for performing logical operations on event-style or timestamp data. Logical operations on event-style data are commonplace in many fields. This library seeks to provide a generalized framework and methods for dealing with this data.InstallationEventLogic can be installed withpip.pipinstall--upgradepip
pipinstalleventlogicExamples#There are 9 flavors of event interactions:Case:   Event:    On Off Times:1        a:            |------|
b: |------|2        a:            |------|
b:     |------|3        a:            |------|
b:       |------|4        a:             |------|
b:             |------|5        a:            |------|
b:                 |------|6        a:            |------|
b:                   |------|7        a:            |------|
b:                      |------|8        a:            |------|
b:             |---|9        a:            |------|
b:          |----------|#If we look at case 1:a = Event(3,4)
b = Event(1,2)
a > b
a < b
a | b#If we look at case 9:a = Event(3,4)
b = Event(2,5)
a in b
a not in b
c = a & b
Package: eventloop
Eventloop uses any of:pyuvorPySide2orPyQt5installed in the system
to provide callback interface for filesystem events. And also timers.Package intended to be a building block for utility scripts for recompiling
or pushing files or restarting tests.pyuvis used preferably as it’s most efficient.uvis a library that
powers nodejs event loop.Installingeventloop can be installed via pip as follows:pip install eventloopAuthorStanislav Doronin <mugisbrows@gmail.com>UsageIn simple case you can useon_file_changeddecorator. It creates event loop, system watch and schedule, then connects them, then starts the loop and calls decorated function on filesystem events.fromeventloopimporton_file_changedif__name__=="__main__":@on_file_changed("/path/to/dir")defyour_handler(file_path):print(file_path)Decorator acceptsincludeandexcludeargs (list of globs or names to include or exclude files from watch) andtimeoutarg (read about timeout below) andlooparg.If you need to watch more than one path you need to create and startEventLoopexplicitly and pass it to decorators.fromeventloopimportEventLoop,on_file_changedif__name__=="__main__":loop=EventLoop()@on_file_changed("/path/to/first/dir",loop=loop)deffirst_handler(file_path):print(file_path)@on_file_changed("/path/to/second/dir",loop=loop)defsecond_handler(file_path):print(file_path)loop.start()For finer control over things you can use classes, first example can be rewriten asfromeventloopimportEventLoop,FileSystemWatch,Schedule,baseclassExecutor(base.Executor):defexecute(self,file_path):print(file_path)if__name__=="__main__":loop=EventLoop()defon_change(file_path,event):schedule.append(file_path,timeout=1)watch=FileSystemWatch()watch.start("/path/to/dir",on_change)executor=Executor()schedule=Schedule(executor)loop.start()Schedulecaches (deduplicates) tasks appended withintimeoutinterval, so for example three immediate consecutivechangedevents on same file end up in just oneExecutor.execute(task)call.on_file_changeddecorator also usesScheduleto cache events.CliYou can use onchange script in command line to execute commandspython-meventloop.onchangeD:\dev\app--echoFILEonchangeD:\dev\app--echoFILEonchangeD:\dev\app-i*.cpp*.ui-ebuild--cwdD:\dev\app\build--ninja^&^&ctestLicenseEventloop is distributed under the terms of MIT license, checkLICENSEfile.
Package: event-metrics
Event MetricsAn embedded, event-time metric collection library built for serving systemMetric systems like prometheus aggregate metric at “processing time”, whenever the scraper is
able to scrape the metric.event_metricscapture and record metrics at event time, when the
event happens.FeaturesComparing to other metric system, theevent_metricslibrary:Write data to sqlite3 database to keep low-memory footprintMinimal dependency (only requires numpy for numeric aggregation)Aggregate with the full data by default (no reservior sampling)Allow select from past duration with timedelta windowingTimestamp all observation by defaultSmall API footprint:observeandqueryis all you need to knowCompute raw timeseries with different aggregation strategies:Scalers: last, min, max, mean, count, sumBuckets for histogramPercentiles for summaryArray and timestamps for native python wranglingMetrics can be labeled with arbitrary key value pair and querying supports
multidimensional label matching.InstallInstall from source:pip install-e.PyPI package is work in progressUsagefromevent_metricsimportMetricConnectionconn=MetricConnection("/tmp/event_metrics_demo")conn.observe("latency",1.2)conn.increment("counter",-1)# labelingconn.observe("latency",2.0,labels={"service":"myapp","other":"label"})# querying(conn.query("latency",labels={"service":"myapp"})# select from past duration using one of the following.from_beginning().from_timestamp(...).from_timedelta(...)# perform aggregation using one of the following.to_scaler(agg="last/min/max/mean/count/sum")# counter, guage.to_buckets(buckets=[1,5,10],cumulative=False)# histogram.to_percentiles(percnetiles=[50,90,99])# summary.to_array()# -> value array.to_timestamps()# -> timestamp array.to_timestamps_array()# -> 2 array, (timestamp, value array))SpeedThe library isfast enough. It can ingest about 34,000 data point
per seconds:You can runpytest tests-kbenchto generate benchmark on local hardware:-------------------------------------------------- benchmark: 1 tests --------------------------------------------------
Name (time in us)            Min       Max     Mean  StdDev   Median     IQR  Outliers  OPS (Kops/s)  Rounds  Iterations
------------------------------------------------------------------------------------------------------------------------
test_bench_ingestion     25.3340  297.9320  28.8541  9.1582  26.8090  0.8650   521;814       34.6571    6496           1
------------------------------------------------------------------------------------------------------------------------
Package: evento
pyeventoPython evento package, making the Observer pattern estúpida sencillo.InstallpipinstalleventoBasic UsagefromeventoimportEvent# observers are simply methodsdefobserver(value:str):print("Received: "+value)# we need to create an instance for every event we want to firedemo_event:Event[str]=Event()# subscribe observer to the eventdemo_event+=observer# trigger notifications for the event (run all observers)demo_event('Hello')# => "Received: Hello"demo_event('World')# => "Received: World"Typical usageThis is how Events are typically used to decouple code into separate classes;fromeventoimportEventclassAction:def__init__(self,name)->None:self.name=nameself.run_event=Event[Action]()defrun(self)->None:self.run_event(self)classActionCounter:def__init__(self,action:Action)->None:self.count=0# Event.add returns an unsubscribe methodself._disconnect=action.run_event.add(self._on_action)def__del__(self)->None:# observers should make sure to unsubscribe from events when they are doneself._disconnect()def_on_action(self,action:Action)->None:self.count+=1print(f"'{action.name}' ran{self.count}times")action=Action('Foo action')counter=ActionCounter(action)action.run()# => "'Foo action' ran 1 times"action.run()# => "'Foo action' ran 2 times"Unsubscribe# setupevent=Event()defhandler(value)->None:print(value)defsetup()->Callable[[],None]:unsubscribe=event.add(handler)returnunsubscribecleanup=setup()# ... do stuff ...# cleanup; all the following lines do the sameevent-=handlerevent.remove(handler)cleanup()Async EventWorks the same asEventbut takes async subscribers and has to be awaited;fromeventoimportAsyncEventevent=AsyncEvent[float]()asyncdefecho_double(value:float)->None:print(f"double:{value*2}")event.append(echo_double)# ...awaitevent(5.0)# using __call__awaitevent.fire(10.0)# using fire (same as __call__)# ...event.remove(echo_double)Signature EventSince version 2.0.0eventois typed andEventandSyncEventare generic classes with a single type; they are 'fired' using a single argument, and all subscribers are expected to take one argument of that type.To support more complex method signatures, theeventandasync_eventdecorator can be used to turn a method into an event;Syncfromeventoimportevent@eventdefmulti_arg_event(id:int,message:str,price:float,**opts:Any)->None:...defobserver(id:int,message:str,price:float,**opts:Any)->None:print(f"observer: id={id}, message={message}, price={price}, opts={opts}")multi_arg_event+=observermulti_arg_event(0,"Hello World!",9.99,demo=True)Asyncfromeventoimportasync_eventasyncdefobserver(id:int,message:str,price:float,**opts:Any)->Any:print(f"observer: id={id}, message={message}, price={price}, opts={opts}")@async_eventasyncdefmulti_arg_event(id:int,message:str,price:float,**opts:Any)->str:return"Done"# the original method is still invoked after all event subscribers have executedresult=awaitmulti_arg_event(1,"Test-12",9.99,feature=True)print(f"Result:{result}")# => Done
Package: eventoolkit
Client-side toolkit for abstract events.DocumentationSimple example# main.pyfromcollections.abcimportSequencefromtypingimportNamedTupleimportpydepotfromeventoolkitimportEvent,EventPublisher,StoreEventHandlerclassChatroom(NamedTuple):users:tuple[str,...]classState(NamedTuple):chatroom:ChatroomclassStateSubscriber:defon_state(self,state:State)->None:print(f"[StoreSubscriber] on_state called with{state}")classJoinUserAction(pydepot.Action):def__init__(self,user:str):self.user:str=userclassJoinUserReducer(pydepot.Reducer[JoinUserAction,State]):@propertydefaction_type(self)->type[JoinUserAction]:returnJoinUserActiondefapply(self,action:JoinUserAction,state:State)->State:returnState(chatroom=Chatroom(users=(*state.chatroom.users,action.user)))classUserJoinedEvent(Event):@propertydefname(self)->str:return"user_joined"def__init__(self,user:str):self.user:str=userclassUserJoinedEventHandler(StoreEventHandler[UserJoinedEvent,State]):@propertydefevent_type(self)->type[UserJoinedEvent]:returnUserJoinedEventdefactions(self,event:UserJoinedEvent)->Sequence[pydepot.Action]:return[JoinUserAction(user=event.user)]defmain()->None:store=pydepot.Store(State(chatroom=Chatroom(users=())))store.register(JoinUserReducer())subscriber=StateSubscriber()store.subscribe(subscriber)handler=UserJoinedEventHandler(store=store)publisher=EventPublisher()publisher.subscribe(handler)publisher.publish(UserJoinedEvent(user="Alice"))publisher.publish(UserJoinedEvent(user="Bob"))if__name__=="__main__":main()$python3main.py[StoreSubscriber]on_statecalledwithState(chatroom=Chatroom(users=('Alice',)))[StoreSubscriber]on_statecalledwithState(chatroom=Chatroom(users=('Alice','Bob')))InstallationEventoolkit is available aseventoolkiton PyPI:pipinstalleventoolkitUsageFor detailed quickstart and API reference, visit theDocumentation.LicenseCopyright (C) 2023 tombartk 

This program is free software: you can redistribute it and/or modify it under the terms
of the GNU Affero General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.
If not, see https://www.gnu.org/licenses/.