Saravanan666/pypi-org huggingface dataset:
Package: r7insight-python
Rapid7 Insight LoggerThis is a plugin library to enable logging to Rapid7 Insight from the Python Logger.
Additionally this plugin allows the user to get an overview of methods being executed,
their execution time, as well as CPU and Memory statistics.
More info athttps://www.rapid7.com/solutions/it-operations/. Note that this plugin isasynchronous.SetupTo use this library, you must first create an account on Rapid7 Insight.
This will only take a few moments.InstallTo install this library, use the following command:pip install r7insight_pythonUsage#!/usr/bin/env pythonimportloggingfromr7insightimportR7InsightHandlerlog=logging.getLogger('r7insight')log.setLevel(logging.INFO)test=R7InsightHandler(TOKEN,REGION)log.addHandler(test)log.warn("Warning message")log.info("Info message")sleep(10)Usage with metric functionalityimporttimeimportloggingfromr7insightimportR7InsightHandler,metricsTEST=metrics.Metric(TOKEN,REGION)@TEST.metric()deffunction_one(t):"""A dummy function that takes some time."""time.sleep(t)if__name__=='__main__':function_one(1)Metric.Time()This decorator function is used to log the execution time of given function. In the above example@TEST.time()will wrapfunction_oneand send log message containing the name and execution time of this function.ConfigureThe parameterTOKENneeds to be filled in to point to a
file in your Insight account.The parameterREGIONneeds to be filled with the region your log is located in. i.e: ‘eu’, ‘us’In your R7Insight account, create a logfile, selectingToken TCPas
the source_type. This will print a Token UUID. This
is the value to use forTOKEN.The appender will attempt to send your log data over TLS over port 443. You can also choose to not
use TLS, in which case it will be sent over port 80.
If theallow_plaintext_fallbackoption in the constructor is set toTrue, then the library
will automatically fall back to an insecure connection on port 80 if TLS is not supported on the
host system.You are now ready to start logging.Contact SupportPlease email our support team atsupport@rapid7.comif you need any help.
Package: ra
# `Ra`[![Build Status](https://travis-ci.org/ramses-tech/ra.svg?branch=master)](https://travis-ci.org/ramses-tech/ra)[![Documentation](https://readthedocs.org/projects/ra/badge/?version=stable)](http://ra.readthedocs.org)Ra is a test suite generator and helper library for testing APIs describedin [RAML](http://raml.org/).Out of the box, Ra provides a basic, automated test suite to test the routesdeclared in the RAML document. It provides test helpers for augmenting thesewith custom tests to test application-specific logic, side effects, etc.Ra is primarily designed to provide testing support for[ramses](http://github.com/ramses-tech/ramses) and[nefertari](http://github.com/ramses-tech/nefertari) applications, but canbe used with any WSGI-conformant, RAML-described API.It currently depends on pytest but may be adapted for other test frameworksin the future. It works best using WebTest but doesn't require it.## NameRa was the god of the sun, the most important god in ancient Egypt.## Try it (dev)Run the test suite:```bash$ pip install -r requirements.txt$ py.test```Check out the example:```bash$ cd examples/ramses-test$ pip install -r requirements.txt$ py.test```The example RAML at `examples/ramses-test/api.raml` and the test file`examples/ramses-test/tests/test_api.py` should be helpful to reference.See the docs in `docs/`, and the `api.raml` and `tests/test_api.py` in`tests/apps/ramses_test`
Package: ra2ce
This is the repository of RA2CE (just say race!) - the Resilience Assessment and Adaptation for Critical infrastructurE Toolkit Python Package developed by Deltares. RA2CE helps to quantify resilience of critical infrastructure networks, prioritize interventions and adaptation measures and select the most appropriate action perspective to increase resilience considering future conditions.ContactMargreet van Marle (Margreet.vanMarle@Deltares.nl)Find more about the following topics in ourofficial documentation page:ContributingInstallationNetwork user guideAnalysis user guideDistributionRa2ce is shared withGPL3 license, you may use and/or extend it by using the same license. For specific agreements we urge you to contact us.UsageIf you wish to run ra2ce locally we recommend to have a look at theinstallation section.
On the other hand, if you wish to run a preinstalled environment, you may use ourexamples in binder.Third-party NoticesThis project incorporates components from the projects listed below.NetworkX: NetworkX is distributed with the3-clause BSD license.Copyright (C) 2004-2022, NetworkX Developers
Aric Hagberghagberg@lanl.govDan Schultdschult@colgate.eduPieter Swartswart@lanl.govAll rights reserved.OSMnx: OSMnx is distributed under theMIT License.Boeing, G. 2017.OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street NetworksComputers, Environment and Urban Systems 65, 126-139. doi:10.1016/j.compenvurbsys.2017.05.004
Package: ra2mix
ra2mixA python library for working with Red Alert 2 / Yuri's Revenge *.mix filesMix files are archive files used to store most game files from the gamesCommand And Conquer Red Alert 2and its expansion packYuri's Revenge.This library allows you to interact with the mix files much like you'd interact with
zip files using a program like 7-zip -- except programmatically, of course 😎.  You can
create mix files by archiving a list of several files, or read existing mix files
and do something with the archived files contained within it.Table of ContentsInstallationUsageReading a*.mixfileCreating a*.mixfileInstallationpipinstallra2mixUsageImport the packageimportra2mixReading a*.mixfileRead:Thera2mix.readfunction can take a*.mixfilepath and return adict[str, bytes]object. The keys are filenames and the values are file data as
bytes.importra2mixmix_filepath="path/to/mixfile.mix"filemap=ra2mix.read(mix_filepath)print(f"filenames:{list(filemap.keys())}")forfilename,file_datainfilemap.items():# do something with the file dataExtract:Thera2mix.extractfunction takes a*.mixfilepath and an extraction folder
path.  The files contained in the mix file will be written to the folder.importra2mixmix_filepath="path/to/mixfile.mix"extract_folder="extract/to/folder"ra2mix.extract(mix_filepath,extract_folder)Creating a*.mixfileThera2mix.writefunction supports three methods for specifying files to include in a
new*.mixfile:filemap: Adict[str, bytes]object consisting of filenames and file datafolder_path: A path to a folder; all files in the folder are added to the mixfilepaths: Alist[str]containing exact filepaths to include in the miximportra2mixmix_filepath="path/to/mixfile.mix"target_folder="read/from/folder"mix_data=ra2mix.write(mix_filepath,folder_path=target_folder)# Optionally do something with mix_data if you want; file is already written to# `mix_filepath`
Package: raas
Raas=================This API SDK was automatically generated by APIMATIC v2.0This SDK uses the Requests library and will work for Python ```2 >=2.7.9``` and Python ```3 >=3.4```.How to configure:=================The generated code might need to be configured with your API credentials.To do that, open the file "Configuration.py" and edit its contents.How to resolve dependencies:===========================The generated code uses Python packages named requests, jsonpickle and dateutil.You can resolve these dependencies using pip ( https://pip.pypa.io/en/stable/ ).1. From terminal/cmd navigate to the root directory of the SDK.2. Invoke ```pip install -r requirements.txt```Note: You will need internet access for this step.How  to test:=============You can test the generated SDK and the server with automatically generated testcases. unittest is used as the testing framework and nose is used as the testrunner. You can run the tests as follows:1. From terminal/cmd navigate to the root directory of the SDK.2. Invoke ```pip install -r test-requirements.txt```3. Invoke ```nosetests```How to use:===========After having resolved the dependencies, you can easily use the SDK following these steps.1. Create a "raas_test.py" file in the root directory.2. Use any controller as follows:```pythonfrom __future__ import print_functionfrom raas.raas_client import RaasClientapi_client = RaasClient()controller = api_client.statusresponse = controller.get_system_status(<required parameters if any>)print(response.status)# Or you can print more informationprint(vars(response))```
Package: raaSAFT
raaSAFT (pronounced “raw saft”) is a Python framework that makes it easy to set up coarse-grained molecular dynamics simulations.raaSAFT runs with HOOMD-blue as a backend, so you can use GPU power. Initial support for using GROMACS has been added.raaSAFT uses the SAFT-gamma Mie force field, a powerful coarse-graining method
that gives accuracy comparable to atomistic models, with runtimes that are
orders of magnitude shorter.Raasaft is a Norwegian word meaning “pure fruit syrup”. Apart from the obvious saft <-> SAFT pun, “raa” means crude/raw/coarse, so it is twice as punny.InstallationDependencies:raaSAFT uses HOOMD-blue, see theHOOMD-blue install guide.For now this is a dependency even if you want to run with GROMACS. The non-GPU version of HOOMD-blue is sufficient.Note that HOOMD-blue runs on Linux or Mac OSX. Windows is not supported.Simple installation:pipinstallraasaft# or to upgradepipinstall--upgraderaasaft# To start using raaSAFT:mkdirraasaft&&cdraasaftraasaft_init# You now have the helpful directories tutorials/ replication/ and mysaft/ls# Read the "Running simulations" section below.Installation for advanced users / contributors:Install dependencies. This includes HOOMD-blue and the Python packagesfutureandrequests.Clone the repo athttp://bitbucket.org/asmunder/raasaftThemaintbranch should be as stable as the version on PyPiThemasterbranch changes frequently and may not always be stableYou probably want to add the repo directory to your PYTHONPATH.Running simulations with raaSAFTLook at the README.txt file inraasaft/tutorials/for examples of how to use raaSAFT.Inraasaft/replication/we include setups that can be used to replicate the findings of various papers.Inraasaft/mysaft/you find an example of how to add your own models for new molecules.You can use these user-defined models with e.g.frommysaft.exampleimportExampleex=Example(count=1e3)If you want to use these models in jobscripts in different directories, add the full path to theraasaftfolder to yourPYTHONPATHshell variable (put this in your.bashrcfile to make it permanent), e.g.:export PYTHONPATH=$PYTHONPATH:”/path/to/raasaft”Contributions to raaSAFT with new models are always welcome, assuming the model has seen at least some level of validation.Bottled SAFTYou can get models (force field parameters) for 6000+ molecules from our database called Bottled SAFT:http://www.bottledsaft.orgThis web application provides scripts that implement the search result in raaSAFT for you!LicenseThe code is Free and Open Source software under the MIT license.ContributeAll contributions are welcome!ContactEmail Aasmund ataaervik@gmail.com
Package: rab
Rest API BaseQuickstartInstall Remotely from GitHub:pip install git+https://github.com/JHibbard/rest-api-base --upgradeRunning Test Matrixnote: you can add-sflag to print to stderr/stdout during pytest-ingtoxComplexity MetricsCyclomatic complexity (cc):radon cc ./src/*Maintainability index:radon mi ./src/*Building DistributionBuilding Wheel:python setup.py bdist_wheel sdistInstalling Wheel:pip install /path/to/wheel/..
Package: rabbit
# Rabbit Command Line HopperRabbit is a simple yaml based tool for command line actions. It will read a rabbit.yaml configuration file from the current directory and provide a list available commands.## InstallationYou will need to have Python and Pip [installed](http://python-packaging-user-guide.readthedocs.org/en/latest/installing/#requirements-for-installing-packages) then run the following command in your cli.$ pip install rabbit## Usage- Enter 'rabbit' or 'rab' in your command line- Rabbit must be able to find a rabbit.yaml file in the current directory.- 'rabbit --help' will display a list of all available rabbit commands## ConfigurationRabbit will look for the closest rabbit.yaml file. This [yaml](http://docs.ansible.com/YAMLSyntax.html) file must contain a commands property. The commands property is a list of all commands to be proxied by rabbit. Simple as that!```yamlcommands:- hop: npm installto: docker run -it --rm node npm installdescription: Runs 'npm install' on the current directory- hop: run nodeto: echo "Run Node"description: echos 'run node' to the command line```### Command- A command's 'hop' property represents the rabbit command to be entered.- A command's 'to' property defines the actual command to be run in terminal.- All arguments provided after the rabbit 'hop' decleration will be appended to the proxied command.- Commands that share a similar hop will be grouped for convinience.### [Contributing](CONTRIBUTING.md)
Package: rabbitbus
RabbitBusFeel RabbitMQ like HTTPCustom CorrelationManagersRegexp routesInstallationRabbitBus requires Python 3.6 >, aioamqp.Install the dependencies and library.$pipinstallrabbitbusExample:importasynciofromrabbitbus.managerimportDatabusApp,Configurationfromrabbitbus.acks.requestsimportAmqpRequestfromrabbitbus.acks.responsesimportAckResponseasyncdefmy_view(request:AmqpRequest):# Write your code herereturnAckResponse(request)defserve():loop=asyncio.get_event_loop()# Inherit from CorrelationManager for custom correlation storagesapp=DatabusApp(conf=Configuration())app.add_route(r'^CASH_REGISTER_EQUIPMENTS[a-zA-Z_]{4}$',my_view)app.start(loop)if__name__=='__main__':serve()If message has reply_to property, you can make response like:fromrabbitbus.acks.requestsimportAmqpRequestfromrabbitbus.acks.responsesimportAckResponseasyncdefmy_view(request:AmqpRequest):# Write your code herereturnAckResponse(request,data={"result":1})"reply_to" will be converted to the "routing_key" and message will be published to the app exchange.
More about RPC you can readin RabbitMQ documentationSometimes you may need to pause consuming.
Three method are to your needs:app.pause_consuming()app.continue_consuming()app.is_paused()#bool to test if your app is pausedTo send message from any view you can also use:asyncdefmy_view(request:AmqpRequest):# Write your code hererequest.app.send_message(data={"test":True},routing_key="TEST")returnAckResponse(request)
Package: rabbit-client
rabbit-clientasyncio rabbit client powered byaioamqp.rabbit-client provides a simple and automatic configuration to work with:pub/sub andDead Letter Exchangeswithrabbitmq;polling publisher patternout-of-box;connection and reconnection management with broker;automatic channel configuration;concurrent task execution[optional];publisher confirms[optional];automatic qos configuration;different strategies to delay error events.InstallingInstall and update using pip:pipinstall-Urabbit-clientLinksLicense:Apache LicenseCode:https://github.com/amenezes/rabbit-clientIssue Tracker:https://github.com/amenezes/rabbit-client/issuesDocumentation:https://rabbit-client.amenezes.net
Package: rabbitgetapi
rabbitgetapi- Get RabbitMQ queue messages via APIDescriptionTo get messages from a queue or anything else (coming soon) available in the Rabbitmq API.RequirementsPython 3EnvironmentlinuxInstallpip install rabbitgetapiUsage❯ rabbitgetapi getqueue -h
usage: rabbitgetapi getqueue [-h] [-f CONFIGFILE] [--url URL] [-v VHOST] [--user USER] [--password PASSWORD] [--outputfile OUTPUTFILE]
                             [--separator SEPARATOR] [--mode MODE] [-q QUEUE] [-c COUNT]

optional arguments:
  -h, --help            show this help message and exit
  -f CONFIGFILE, --configfile CONFIGFILE
                        Configuration file (full or relative path)
  --url URL             RabbitMQ server url without slash, default = http://127.0.0.1:15672.
  -v VHOST, --vhost VHOST
                        RabbitMQ virtual server, default = '/'.
  --user USER, -u USER  RabbitMQ user, default = guest.
  --password PASSWORD, -p PASSWORD
                        RabbitMQ password, default = guest.
  --outputfile OUTPUTFILE, -o OUTPUTFILE
                        file for output messages.
  --separator SEPARATOR, -s SEPARATOR
                        Character for line separator.
  --mode MODE, -m MODE  full = whole message, payload = just payload
  -q QUEUE, --queue QUEUE
                        The queue from where the messages will be obtained.
  -c COUNT, --count COUNT
                        controls the maximum number of messages to get. Default=10.Authors:Sidon Duarte,Version:0.0.1 at 2021/09/12
Package: rabbithole
Rabbit HoleStore messages from an AMQP server into a SQL databaseFeaturesGet messages from multiple AMQP exchangesGroup messages in batchesWrite message batches to a SQL databaseCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2016-11-25)First release on PyPI.0.2.0 (2016-11-28)Make batcher size/time limit configurable.Added test cases and documentation.0.3.0 (2017-05-04)Added new flexible configuration format based on the blocks and flows concept.Added query parameters support to SQL block.Update AMQP block to use a connnection URL instead of just the server address.
Package: rabbitleap
RabbitLeapRabbitLeap is a simple RabbitMQ consuming framework. It’s built on top of Pika, a RabbitMQ client library for Python.FeaturesAutomatically recovers from connection failuresConfigurable retry policy for handing failuresAutomatically route messages to handlers, based on custom logic and different message propertiesInstallation$pipinstallrabbitleapHello, worldfromrabbitleap.consumerimportConsumerfromrabbitleap.handlingimportMessageHandlerclassRabbitEatHandler(MessageHandler):defhandle(self):print('rabbit eat:{}'.format(self.envelope.payload.decode('utf-8')))consumer_queue_name='consumer_queue'amqp_url=r'amqp://guest:guest@localhost:5672/%2f'consumer=Consumer(amqp_url=amqp_url,queue_name=consumer_queue_name)# route message of type `rabbit.eat` to RabbitEatHandlerconsumer.add_handler(r'rabbit\.eat',RabbitEatHandler)try:consumer.start()exceptKeyboardInterrupt:consumer.stop()DocumentationDocumentation and resources are available athttps://rabbitleap.readthedocs.io
Package: rabbit-library
Biblioteca para trabalhar com o RabbitAo instanciar a classe do Rabbit já deve ser passado os parametros de conexão e de reconexão se assim desejar.Os parametros de conexão são:host, port, virtualhost, username e passwordOs parametros opcionais são:reconnect: bool = FalseSe deseja que o fluxo faça um reconnect automatico em alguns casos para se recuperar de erros.reconnect_delay: int = 300Quanto tempo em segundos deseja que ele tenta ficar se reconectando.Valor default se nao informado é 300continue_execution: bool = FalseSe deseja que a execução codigo continue após a conexão ser estabelecida, caso for definida como True, a reconexão em caso de falha não será possivel.Nesta biblioteca pode ser encontrado os metodos:getMessagesPegar as mensagens de uma fila e passa a mesma para a função de callback passada para a função getMessages, exemplo:class example():
        def process_message(self, channel, method, properties, body):
            pass
        def example(self):
            self.queue.getMessages('name_queue', 'name_exchange', self.process_message, 1)Parametros:queue: strNome da fila que ficará escutando para ler as mensagens.exchange: strNome da exchange que a fila está vinculada.message_handler: typing.CallableFunção de processamento da mensagem recebida, serve para fazer o processamento da mensagem que está entrando na fila.limit_get_messages: intQuantidade de mensagens que deseja pegar por vez do rabbit, por padrão se nao informada será atribuido 1.postMessageEnviar uma mensagem para uma fila do rabbit.Parametros:queue: strNome da fila que será colocado a mensagem.exchange: strNome da exchange que a fila está vinculada.message: strConteúdo da mensagem que será colocado na fila.close_connectionRealizar o fechamento da conexão com o rabbit.Requerimentos(DEV):Para poder iniciar é preciso ter instalado as dependências abaixo:PythonPipPoetryGitpoethepoetComo montar a biblioteca e fazer uploud para o pypi.orgVideo de auxlilio pode ser encontradoaquiUrl dabiblioteca do pypi.O arquivo de LICENCE é necessário para dizer de quem é esta biblioteca, alterar de acordo com as regras e necessidade.Como estamos utilizando o poetry é muito simples para fazer o build e uploud para o pipy:poetry publish --build -u USERNAME -p PASSWORDTestesTodos os testes foram desenvolvidos com o pytest, para executar os mesmos pode ser executado o comandopoetry run coverage run -m pytestou se caso tenha instalado opoethepoetpode ser executadopoe cove_tests
Package: rabbitman
Python client for theRabbitMQ management plugin.>>> from rabbitman import Client
>>> client = Client('http://localhost:15672', 'guest', 'guest')
>>> client.get_vhosts()
[{
    'name': '/',
    'messages': 48,
    'tracing': False,
    # ...
},
# ...
]Installingpip install rabbitmanWhy not pyrabbitThe code for this client is auto-generated from the api documentation, and so
has complete support for all endpoints. We are also based onrequestsinstead
ofhttplib2, which in our experience is more stable.LicenseThis package is licensed under MIT. The api enpoint documentation is generated
from documentation athttps://www.rabbitmq.com/management.html,
licensed under the MPL.
Package: rabbitmonitor
Rabbit MonitorRabbit Monitor is a simple program that fetches your computer data every 5 seconds (By default) and create /metrics API endpoint for other programs to collect data from it.Required packages:quartpsutilargparseAPI Endpoints:/metrics (Support Prometheus)Installation (Python and PIP required)# Install Python modules
pip install quart psutil argparse
# Install Rabbit Monitor
pip install rabbitmonitor
# Start monitoring with
python3 -m rabbitmonitorDaemonizing (using systemd)Running Rabbit Monitor in the background is a simple task, just make sure that it runs without errors before doing this. Place the contents below in a file calledrabbitmonitor.servicein the/etc/systemd/systemdirectory.WARNING: Make sure to change the User to the one that have installed pip packages.[Unit]
Description=Rabbit Monitor 
After=network.target

[Service]
Type=simple
User=root
ExecStart=python3 -m rabbitmonitor
TimeoutStartSec=0
RemainAfterExit=yes

[Install]
WantedBy=multi-user.targetThen, run the commands below to reload systemd and start Rabbit Monitor.systemctl enable --now rabbitmonitorGrafana DashboardRabbit Monitor has a pre-made Grafana dashboard that looks like this:It can be installed from official Grafana website:https://grafana.com/grafana/dashboards/16275
Package: rabbitmq
rabbitmq========Python bindings to librabbitmq using CFFIThis is fairly rudimentary so far but does allow using librabbitmq on Python 3 to a basic degree, which was my primary motivation for this work.Currently tested against librabbitmq 0.8.0 on Python 3.6 and 2.7. It is in production on Python 3.6 on two fairly heavily-loaded message queues.Available [on PyPI](https://pypi.python.org/pypi/rabbitmq), just `pip install rabbitmq`.Proper documentation coming soon. Example usage:```pythonimport rabbitmqconn = rabbitmq.Connection()conn.open(AMQP_BROKER_HOST, AMQP_BROKER_PORT)conn.login(AMQP_BROKER_VHOST, 0, AMQP_BROKER_USER, AMQP_BROKER_PASSWORD)conn.open_channel(1)conn.declare_exchange(1, "queuename", "direct")conn.declare_queue(1, "queuename")conn.bind_queue(1, "queuename", "queuename", "queuename")conn.consume(1, "queuename")publish_conn = rabbitmq.Connection()publish_conn.open(AMQP_BROKER_HOST, AMQP_BROKER_PORT)publish_conn.login(AMQP_BROKER_VHOST, 0, AMQP_BROKER_USER, AMQP_BROKER_PASSWORD)publish_conn.open_channel(1)publish_conn.declare_exchange(1, "exchangename", "direct")while True:envelope = conn.consume_message()conn.ack(1, envelope.delivery_tag)props = rabbitmq.Properties(content_type="...", delivery_mode=1)body = b"..."if len(body) > 8192:# example of compressing large message bodiesfrom bz2 import compressbody = compress(body)props.content_encoding = "bzip2"publish_conn.publish(1, "exchangename", envelope.message.properties.reply_to, body, props)```