Saravanan666/pypi-org huggingface dataset:
Package: queue_engine
What is engine?engine is a collection of tools for processing a queue. It provides an API to
defer a callable and run it later. engine also provides process helpers to
set up a safe environment for clearing different kind of queues.How to use engine?The basic usage of engine is to defer something to execute later. However, the
internals are written in such way to allow for planning. You can plan your
code to use a queue, but a queue doesn’t even need to be present. Lets take a
look at an example:>>> import engine
>>> def hello_world():
...     print "hello world"

>>> engine.defer(hello_world)
hello worldAs you can see above, the functionhello_worldwas executed immediately.
This is because, by default, engine will use theDummyQueuewhich will
execute the given callable when put on the queue.If you have a queue such as stompserver, ActiveMQ or any STOMP compliant
queue you can useStompQueue. Lets take a look at an example:>>> import engine
>>> def hello_world():
...     print "hello world"

>>> engine.defer(hello_world, queue=engine.StompQueue())The above code will now defer the call tohello_worldby sending it to the
queue.You can define the default queue used by engine. To do this you should useengine.configure. Here is an example changing the default queue fromDummyQueuetoStompQueue:>>> import engine
>>> engine.configure(queue=engine.StompQueue())Now all calls toengine.deferwill use theStompQueueinstance.
Package: queue-front
Queue FrontA lowest-common-denominator API for interacting with lightweight queues.
A fork ofhttps://code.google.com/p/queues/. This main reason for this
fork was to add python 3.0+ compatibility. Although you should be aware
that the backend libraries may not be python 3.0+ compatible.BackendsAmazon sqsboto, MITmemcached*pylibmc, 3-clause BSD
(a python wrapper aroundTangentOrg‘slibmemcachedlibrary.)bmemcached,
MIT (a pure python module)beanstalkdbeanstalkc,
APL-2.0redisredis-py, MIT*memcached backends must use a queueing server such as MemcacheQ.Example$ export QUEUE_BACKEND=redisd
$ export QUEUE_REDIS_CONNECTION=localhost:6379
$ python
>>> from queue_front import queues
>>> q = queues.Queue('myname')
>>> q.write('test')
True
>>> len(q)
1
>>> q.read()
test
>>> queues.get_list()
['myname']AdvancedPackages SecurityThis module, when packaged, is signed with the following key:Mario Rosa’s Key with id 0x8EBBFA6F (full fingerprint F261 96E4 8EF2
ED4A 26F8 58E9 04AA 48D1 8EBB FA6F) and his email ismario@dwaiter.comYou can find this key on servers likepgp.mit.edu.
Package: queue-helpers
queue_helpersThis package is a helper that is used to manage queues in RabbitMQ.Installingpipinstallqueue_helpersUsage>>>fromqueue_helpersimportRpcClient>>>defsend_rpc_message(queue_name,request,rabbit_username,rabbit_password,rabbitserver,vhost):...client=RpcClient(rabbit_server_host=rabbitserver,...virtual_host=vhost,...server_queue_name=queue_name,...username=rabbit_username,...password=rabbit_password)...resp=client.call(json.dumps(request))...response=json.loads(resp.decode("utf-8"))...returnresponse
Package: queueing-rnn
Queueing Recurrent Neural Network (Q-RNN)Queueing Recurrent Neural Network (Q-RNN)is a new kind of Artificial Neural Network that has been designed to use in time-series forecasting applications. According to experiments that have been run, QRNN has a potential to outperform the LSTM, Simple RNN and GRU, in the cases where the dataset has highly non-linear characteristics.Table of contentsWhat is Q-RNN?ComparisonInstallationUsageLicenseWhat is Q-RNN? 🤔(Look of a Random Neuron [4])It is a compose ofSimple RNNandRandom Neural Network. Queueing RNN uses the fundamental math of Queueing Theory and G-Queues while combining it with the powerful architecture of Recurrent Neural Networks. For more detailed explanation about the theoretical background of QRNN check themathematical-modelfolder and references section.Comparison 📊In order to evaluate the performance of QRNN, it has been compared with LSTM, GRU and Simple RNN using Keras with TensorFlow backend. During the experiments, 4 different data sets (google stock price,bike sharing,pm2.5 concentration,traffic volume) and 10 different optimization algorithms have been used. The mean square error distribution on the test set is given in the image below. As it seems QRNN manages to reach 3 lowest rms error out of 4.Check thetest_resultsfolder to see detailed results 🔎.Installation 🛠Installing viapippackage manager:pipinstallqueueing-rnnInstalling via GitHub:gitclonehttps://github.com/bilkosem/queueing-rnncdqueueing-rnn
pythonsetup.pyinstallUsage 👩‍💻fromqueueing_rnnimportQRNNdata=data.reshape((samples,timesteps,features))qrnn=QRNN([features,hiddenneurons,outputneurons])# Shape of the networkforsinrange(samples):qrnn.feedforward()# Calculate Lossqrnn.backpropagation()Check theexamplesfolder to see detailed use 🔎.References 📚[1]Gelenbe, Erol. (1989). Random Neural Networks with Negative and Positive Signals and Product Form Solution. Neural Computation - NECO. 1. 502-510. 10.1162/neco.1989.1.4.502.[2]Gelenbe, Erol. (1993). Learning in the Recurrent Random Neural Network. Neural Computation. 5. 154-164. 10.1162/neco.1993.5.1.154.[3]Basterrech, S., & Rubino, G. (2015). Random Neural Network Model for Supervised Learning Problems. Neural Network World, 25, 457-499.[4]Hossam Abdelbaki (2020). rnnsimv2.zip (https://www.mathworks.com/matlabcentral/fileexchange/91-rnnsimv2-zip), MATLAB Central File Exchange. Retrieved September 22, 2020.License
Package: queueing-systems
queueing_systemsPython Package for Queueing System Parameter Estimation using Queueing TheoryThis Python package is designed to assist with estimating parameters in queueing systems using queueing theory. It provides a set of tools and algorithms to analyze and model queueing systems, allowing users to estimate various parameters such as arrival rates, service rates, queue lengths, and waiting times. With this package, users can leverage the power of queueing theory to optimize and improve the performance of their systems.
Package: queueing-tool
Queueing-tool is a package for simulating and analyzing networks. It is an
event based simulator that usesqueuesto simulate congestion
and waiting on the network that includes tools for
visualizing network dynamics.DocumentationThe package documentation can be found athttp://queueing-tool.readthedocs.org/.FeaturesFast simulation. Queueing-tool is designed to run very quickly;
the core algorithms were written incython.Visualizations. There are several tools that allow you to easily
view congestion and movement within your network. This includes ready
made functions for animating network dynamics while your simulations
take place.Full documentation. Every function and class is fully documented
bothonlineand in the
docstrings.Fast setup. The network is represented as anetworkx graph.
Queueing-tool networks allow for probabilistic routing, finite
capacity queues, and different blocking protocols for analyzingloss networks.InstallationPrerequisites:Queueing-tool runs on Python 2.7 and 3.4-3.10, but
changes going forward are only tested against Python 3.6-3.10. Queueing-tool
requiresnetworkxandnumpy, and depends onmatplotlibif you want to plot.Installation: To install fromPyPIuse:pipinstallqueueing-toolThe above will automatically install networkx and numpy. If you want to plot use:pipinstallqueueing-tool[plotting]Note thatqueueing-toolusesnetworkx’s pagerank implementation. As of
networkx 2.8.6, they have several versions of the pagerank algorithm andqueueing-tooldefaults to using the version that requiresscipy. Ifscipyis not installed then it trys thenumpybased implementation.After installation, import queueing-tool with something like:importqueueing_toolasqtBugs and issuesThe issue tracker is athttps://github.com/djordon/queueing-tool/issues. Please report any bugs or issue that you find there. Of course, pull requests are always welcome.Copyright and licenseCode and documentation Copyright 2014-2022 Daniel Jordon. Code released
under theMIT
license.
Package: queuelink
The QueueLink library simplifies several queue patterns including linking queues together with one-to-many or many-to-one relationships, and supports reading and writing to text-based files.Interaction PatternA QueueLink is a one-way process that connects queues together. When two or more queues are linked, a sub-process is started to read from the “source” queue and write into the “destination” queue.Circular references are not allowed, making QueueLink a ‘directed acyclic graph’, or DAG.Users create each queue, which must be instances ofmultiprocessing.Manager.JoinableQueue. Those queues can then be added to a QueueLink instance as either the source or destination.from multiprocessing import Manager
from queuelink import QueueLink

# Create the multiprocessing.Manager
manager = Manager()

# Source and destination queues
source_q = manager.JoinableQueue()
dest_q = manager.JoinableQueue()

# Create the QueueLink
queue_link = QueueLink(name="my link")

# Connect queues to the QueueLink
source_id = queue_link.register_queue(queue_proxy=source_q,
                                      direction="source")
dest_id = queue_link.register_queue(queue_proxy=dest_q,
                                    direction="destination")

# Text to send
text_in = "a😂" * 10

# Add text to the source queue
source_q.put(text_in)

# Retrieve the text from the destination queue!
text_out = dest_q.get()
print(text_out)
Package: queue-logger
Set following Environment variables:QUEUE_HOST=QUEUE_BROKER_HOSTQUEUE_PORT=QUEUE_BROKER_PORTQUEUE_USER=QUEUE_BROKER_USERQUEUE_PASS=QUEUE_BROKER_PASSimportloggingfromQLGRimportcreate_loggerlogger=create_logger(__name__,logging.NOTSET)logger.info('This is an informational message.')logger.error('This is an error message.')Check your message broker (rabbitmq in this case), there must be 2 messages onlogsqueue.
Package: queueManager
How to use this package?
see the following example
from queueManager import queueManager
qm = queueManager()
qm.connect() #if no server is open,it will fail in seconds
a = qm.read() #blocks, until something in the queue can be read.
print(a)
data = ‘test data’
qm.write(data)#write some data to the queue, notice that, the write and read queue are two different queues;
Package: queuepipeio
This Python package provides two classes,QueuePipeIOandLimitedQueuePipeIO, that represent queue-based I/O objects. These
classes are ideal for multi-threaded or asynchronous programming where
data is produced in one thread or coroutine and consumed in another.InstallationYou can install this package from PyPI:pip install queuepipeioUsageHere’s a basic example of how to useQueuePipeIOandLimitedQueuePipeIO:fromqueuepipeioimportQueuePipeIO,LimitedQueuePipeIO# Define MB as a constantMB=1024*1024# Create a QueuePipeIO objectqpio=QueuePipeIO(chunk_size=8*MB)# Write data to the queueqpio.write(b'Hello, world!')# Close the writerqpio.close()# Read data from the queuedata=qpio.read()print(data)# Outputs: b'Hello, world!'# Create a LimitedQueuePipeIO object with a memory limitlqpio=LimitedQueuePipeIO(memory_limit=16*MB,chunk_size=8*MB)# Write data to the queuelqpio.write(b'Hello, again!')# Close the writerlqpio.close()# Read data from the queuedata=lqpio.read()print(data)# Outputs: b'Hello, again!'ContributingContributions are welcome! Please feel free to submit a Pull Request.
Package: queueplus
QueuePlus ➕1️⃣ version: 0.7.0✍️ author: Mitchell LisleA Python library that adds functionality to asyncio queuesInstallpipinstallqueueplusUsageYou can use AioQueue with all the same functionality as a regularasyncio.Queue.fromqueueplusimportAioQueueq=AioQueue()awaitq.put("hello world")message=awaitq.get()# hello worldWith a few extra capabilitiesIterate over a queue (can be async or not)fromqueueplusimportAioQueueq=AioQueue()[awaitq.put(i)foriinrange(10)]# in non-async mode you would call q.put_nowaitasyncforrowinq:print(row)Collect all values into a listfromqueueplusimportAioQueueq=AioQueue()[awaitq.put(i)foriinrange(10)]messages=q.collect()# [0, 1, 2, 3, 4 ,5 ,6 ,7, 8, 9]Create a callback everytime a message is addedfromqueueplusimportAioQueueinq=AioQueue()outq=AioQueue()asyncdefcopy_to_q(message:str):awaitoutq.put(message)inq.add_consumer(copy_to_q)inq.put("hello world")awaitinq.wait_for_consumer()Enforce a type on a queue, error if violatedfromqueueplusimportTypedAioQueue,RaiseOnViolationq=TypedAioQueue(int,violations_strategy=RaiseOnViolation)[awaitq.put(i)foriinrange(10)]messages=q.collect()# [0, 1, 2, 3, 4 ,5 ,6 ,7, 8, 9]awaitq.put("hello")# Raises a ViolationErrorEnforce a type on a queue, ignore if violatedfromqueueplusimportTypedAioQueue,DiscardOnViolationq=TypedAioQueue(int,violations_strategy=DiscardOnViolation)[awaitq.put(i)foriinrange(10)]awaitq.put("hello")messages=q.collect()# [0, 1, 2, 3, 4 ,5 ,6 ,7, 8, 9]Full examplefromqueueplusimportAioQueueimportasyncioasyncdefmain():q=AioQueue()awaitq.put("hello")awaitq.put("world")asyncforiteminq:print(item)if__name__=="__main__":asyncio.run(main())
Package: queuepool
The main problem with psycopg2.pool (https://github.com/psycopg/psycopg2/blob/master/lib/pool.py), for example, is that the pool raises an exception (instead of blocking) when there are no more connections in the pool, and you either have to match the number of connections to the number of workers, or implement retry logic. Also, it doesn’t implement connection recycling (on timeout or usage count), and therefore, doesn’t fully address issue with stale connections and suited less (scales worse) for large production installations.This implementation is based on synchronized queue (https://docs.python.org/3/library/queue.html), and thus multithred safe. This is a streamlined port from Java version that was implemented about ten years ago and that has since then been running in heavy production evironment of one of our financial clients.This implementation features:A pool of generic resources that can be extended for specific resources like psycopg2 connections. Psycopg2 connection pool implementation is provided.On-demand lazy resource opening.Idle and open timeout recycling. Requires user code to executepool.recycle()method periodically (or start recycler thread bypool.startRecycler()), for example, once a minute. If this method isn’t executed periodically, then the recycling is performed only when the resource are either taken or returned back to the pool, and therefore, the pool can accumulate a number of idle connections that exceed the idle or open timeouts.Usage count recycling.Recycling on exception.Recycling on a resource status.Context manager allows to use the pool with “with” context manager so that the resources could be returned safely to the pool.LIFO queue helps the pool keep number of open resources to the minimum.This pool can be utilized successfully in large production installations as it tries to keep the number of open resources to the minimum, yet providing sufficient number of “hot” (open) resources to avoid open/close cost.LicenseOSI Approved 3 clause BSD LicensePrerequisitesPython 3.7+ (with queue)For psycopg2 connections: psycopg2 2.8.2+InstallationIf prerequisites are met, you can installqueuepoollike any other Python package, using pip to download it from PyPI:$ pip install queuepoolor usingsetup.pyif you have downloaded the source package locally:$ python setup.py build
$ sudo python setup.py install
Package: queuepy
PyQueueA simple module lib to queue your lists!Usage:# List: The list you are going to transform into a queue# Length: The maximum size of the queue# Input: The input from the user (can be a input('')) or an strQueue(list,length,input)# Returns the simple queueQueue(list,length,input).input()# Returns the element that was addedQueue(list,length,input).output()# Returns the element that was removedQueue(list,length,input).infos()# or .info()# Returns the queue, the input and the output of the queue.How it worksInsert the wanted string onto the list if the maximum size of the list is less than the wanted size.If the size of the list is greater than the wanted size, pop out the last queue element and insert the wanted string.TODO:Add.create()functionwill create 2 buffers for temporary usage.e.g:Queue(q, 3, in).create(1)creates a new bufferinsidetheQueueclassitselfcan use.input(),.output()and.infos()cannot be referenced outside theQueueclass.Double-ReferencereturnMethodsallows the user to referenceQueuewithout needing toprint()it.also allows the user to referenceQueuewithprint().graph TD
    A[Read the input] -->|Verify if the size is less than the wanted|B(Insert string on the first position)
    B --> C{Check the queue}
    C -->|If the size is less|D[Insert at 0 and move the rest]
    C -->|If size is greater|E[Insert at 0 and pop the last]
    E --> F
    D --> F
    F{Rest of args}
    F --> |.input|H(print the new element)
    F --> |.output|G(print the removed element)
    F --> |info / infos|I(print the queue, the input and the output)
Package: queuery-client
queuery_client_pythonQueuery Redshift HTTP API Client for PythonInstallationpip install queuery-clientUsagePrerequisitesSet the following envronment variables to connect Queuery server:QUEUERY_TOKEN: Specify Queuery access tokenQUEUERY_TOKEN_SECRET:  Specify Queuery secret access tokenQUEUERY_ENDPOINT: Specify a Queuery endpoint URL via environment variables if you don't set theendpointargument ofQueueryClientin you codeBasic Usagefromqueuery_clientimportQueueryClientclient=QueueryClient(endpoint="https://queuery.example.com")response=client.run("select column_a, column_b from the_great_table")# (a) iterate `response` naivelyforelemsinresponse:print(response)# (b) invoke `read()` to fetch all recordsprint(response.read())# (c) invoke `read()` with `use_pandas=True` (returns `pandas.DataFrame`)print(response.read(use_pandas=True))Type CastBy default,QueueryClientreturns all values asstrregardless of their definitions on Redshift.
You can use theenable_castoption to automatically convert types of the returned values into appropreate ones based on their definitions.fromqueuery_clientimportQueueryClientclient=QueueryClient(endpoint="https://queuery.example.com",enable_cast=True,# Cast types of the returned values automatically!)sql="select 1, 1.0, 'hoge', true, date '2021-01-01', timestamp '2021-01-01', null"response=client.run(sql)response.read()# => [[1, 1.0, 'hoge', True, datetime.date(2021, 1, 1), datetime.datetime(2021, 1, 1, 0, 0), None]]
Package: queuetools
This package provides the following scripts, which can configure AMQP brokers
such as RabbitMQ:mkq - declares queues (queue.declare)mkx - declares exchanges (exchange.declare)bindq - binds queues to exchanges (queue.bind)unbindq - unbinds queues from exchanges (queue.unbind)rmq - removes queues (queue.delete)rmx - removes exchanges (exchange.delete)qcat - prints messages to stdout (channel.basic_consume)qpurge - purges all messages from a queue (channel.queue_purge)hammer - submits messages from the command line (channel.basic_publish)
Package: queueup
QueueUp - A simple and easy queue interface for all of your needsQueueUp-- Is an entirely integrated queue interface over kombu to completely include all settings inside of a single object.The reason we usekombuand AMQP as a whole is to allow for complex objects and delivery guaruntees we normally wouldn't get with much newer platforms.Differences from QueueUp and QueueYou'd use theQueueUplibrary in the exact way you'd use thequeue.Queuelibrary. Let's look at the difference.An example for python'squeueimporttimeimportrandomimportthreadingfromqueueimportQueue# We're starting two threading daemons,# 1. one that pushes information into a queue,# 2. the other that reads information from the queue then publishes itdefqueue_pusher(q):whileTrue:q.put(random.randint(0,1000))time.sleep(0.05)defqueue_reciever(q):whileTrue:qitem=q.get(block=True)print(f"Printing{item}")time.sleep(0.05)if__name__=="__main__":common_queue=Queue()threading.Thread(target=queue_pusher,daemon=True,args=(common_queue,)).start()threading.Thread(target=queue_reciever,daemon=True,args=(common_queue,)).start()# Now the two queues will communicate with each other.whileTrue:time.sleep(5)An example forQueueUpimporttimeimportrandomimportthreadingfromqueueupimportQueue# We're starting two threading daemons,# 1. one that pushes information into a queue,# 2. the other that reads information from the queue then publishes itdefqueue_pusher(q):whileTrue:q.put(random.randint(0,1000))time.sleep(0.05)defqueue_reciever(q):whileTrue:qitem=q.get(block=True)print(f"Printing{item}")time.sleep(0.05)if__name__=="__main__":common_queue=Queue()# w/o parameters it returns a multiprocessing.Queue()threading.Thread(target=queue_pusher,daemon=True,args=(common_queue,)).start()threading.Thread(target=queue_reciever,daemon=True,args=(common_queue,)).start()# Now the two queues will communicate with each other.whileTrue:time.sleep(5)
Package: queue-util
queue_utilA set of utilities for consuming (and producing) from a rabbitmq queueEnd of lifeThis project is not actively developed any more.Kombu has provided the ConsumerMixin utility for a very long time now. That abstraction allows to
code Consumers very similar to the one provided here with very little code, and much better
handling of errors, disconnections and the full range of features that Kombu has on offer.If you are still actively using this library and need support for it, please get in touch
with a GitHub issue or an email.DevelopmentTestingYou will need to have:a localDockerservicetoxinstalled (globally available)All supported versions of python installed (Pyenvis highly
recommended)tox [-p auto]ReleaseUpdateCHANGELOGto add new version and document itIn GitHub, create a new releaseName the releasev<version>(for examplev1.2.3)Title the release with a highlight of the changesCopy changes in the release fromCHANGELOG.mdinto the release descriptionTravisCIwill package the release and publish it toPypi
Package: queuey-py
queuey-py: Python client library for QueueyThis is a Python client library used for interacting with messages from aMozilla Services message queue(http://queuey.readthedocs.org/).DocumentationYou can read the documentation athttp://queuey-py.readthedocs.org/Changelog0.2 (2012-08-28)Test against a Queuey 0.8 release.Documentation tweaks and updates.0.1 (2012-07-10)Changesinceargument of themessagesmethod to deal with message ids
rather than imprecise timestamps.Code extracted from qdo.
Package: queuing
queuingMultithreating producent-consumer solutionExampleimportqueuingimporttimeimportlogginglogging.basicConfig(level=logging.DEBUG,format='%(asctime)s[%(levelname)5s]%(name)s%(message)s')@queuing.consumer(instances=5)defm1(no):time.sleep(1)print("m1{}".format(no))queuing.broker.send('m2',{'no':no,'sqno':no*no,})[queuing.broker.send('m3',{'no':no,})foriinrange(0,10)]@queuing.consumer(instances=2)defm2(no,sqno):time.sleep(2)print("m2{}{}".format(no,sqno))@queuing.consumer(instances=1)defm3(no):print("m3{}".format(no))if__name__=='__main__':foriinrange(0,10):queuing.broker.send('m1',{'no':i})queuing.broker.loop()
Package: queuing-hub
queuing-hubMulti-cloud Queuing Hub for PythonDescriptionThis is a wrapper tool for AWS SQS and Google Cloud PubSub(Topic and pull subscription) with transparent interface.Easy messaging redundancy.Improve fault tolerance by avoiding queues becoming SPOFsDuplicate production messages to test environment for debuggingInstallRequirementspython = "^3.6"google-cloud-pubsub = "^2.4.0"google-cloud-monitoring = "^2.0.1"boto3 = "^1.17.18"UsagePublisherfromqueuing_hub.publisherimportPublisherpub=Publisher()# Send a message to all queues accessible by defaultresponse=pub.push(topic_list=pub.topic_list,body='Hello world!')Subscriberfromqueuing_hub.subscriberimportSubscribersub=Subscriber()# Receive messages with list ascending priority from queues accessible by defaultresponse=sub.pull(sub_list=sub.sub_list,max_num=1,ack=True)Forwarderfromqueuing_hub.forwarderimportForwarderfwd=Forwarder(sub=sub.sub_list[0],topic=pub.topic_list[0],max_num=1)# copy messageresponse_0=fwd.pass_through()# move messageresponse_1=fwd.transport()