Saravanan666/pypi-org huggingface dataset:
Package: asyncwsgi
asyncwsgiis a simple package for tornado and asyncio(WIP) to enable the
use of the WSGI interface asynchronously. Behind the scenesgreenletis
used to pause and resume each request.UsageDecorate functions that require async withasyncwsgi.coroutineUseasyncwsgi.wrapto wrap the WSGI container.Run the event loop usingasyncwsgi.runExamplesDjango@asyncwsgi.coroutine
def my_view(request):
    http_client = AsyncHTTPClient()
    response = yield http_client.fetch('http://www.google.com/')
    return render(request, 'my_view.html', {'code': response.code})

...
# Patch django to run on tornado's event loop
def run(host, port, app, **options):
    container = asyncwsgi.wrap(WSGIContainer(app))
    http_server = HTTPServer(container)
    http_server.listen(port, host)
    asyncwsgi.run(IOLoop.current())

if __name__ == "__main__":
    ...
    from django.core.management.commands import runserver
    runserver.run = runBottleimport asyncwsgi
import bottle
from tornado.httpclient import AsyncHTTPClient
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop

@bottle.get('/')
@asyncwsgi.coroutine
def index():
    http_client = AsyncHTTPClient()
    response = yield http_client.fetch('http://www.google.com/')
    return 'Status: %d' % response.code

container = asyncwsgi.wrap(WSGIContainer(bottle.default_app()))
http_server = HTTPServer(container)
http_server.listen(8080)
asyncwsgi.run(IOLoop.current())Installationpip install asyncwsgiTodoasyncio not fully supportedLicenseMIT licensed. See LICENSE for details.
Package: async-yandex-checkout
async_yandex_checkoutAsync yandex checkout api wrapper for pythonExample of usagefromasync_yandex_checkout.configurationimportconfigurationfromasync_yandex_checkout.paymentimportPaymentimportasyncioconfiguration.configure("shop_id","secret_key")loop=asyncio.get_event_loop()payment=Payment()loop.run_until_complete(payment.create(1000000,"description","redirect_url"))loop.run_until_complete(payment.update())print(payment.status)
Package: asynczip
AsyncZipis a simpleziplike function working with asynchronous
iterables. It look, in many aspects, likeasyncio.wait.UsageGivennasynchronous iterables,AsyncZip(*aiterables)gives a new
asynchronous iterable iterating over all of them. Likeasyncio.wait,
it’s possible to wait for any iterable to yield something using the
optionFIRST_COMPLETED, or to wait for all of them using the optionALL_COMPLETED.class AsyncZipdef__init__(self,*asynchronous_iterables,loop=None,yield_when=FIRST_COMPLETED):asynchronous_iterables: A collection of asynchronous iterablesloop: Optional named parameter, to give an specific event loopyield_when: Likereturn_whenfromasyncio.wait,FIRST_COMPLETEDorALL_COMPLETED.FIRST_COMPLETED, ALL_COMPLETEDThe two valuesyield_whencan take,FIRST_COMPLETEDandALL_COMPLETEDtell, like forasyncio.wait, whenAsyncZipshould
yield. Defaults to FIRST_COMPLETED.FIRST_COMPLETEDLikeselect, whereAsyncZipyields each time any iterable yields,
as soon as possible.ALL_COMPLETEDIt’s the classicalzipmode, whereAsyncZipwaits for a value for
each iterator before yielding them all in a single loop.Example usageimportasynciofromasynczipimportAsyncZipclassDummyAsyncIterable:def__init__(self,items):self.items=itemsasyncdef__aiter__(self):returnselfasyncdef__anext__(self):try:returnself.items.pop(0)exceptIndexError:raiseStopAsyncIterationasyncdeftest():asyncforitemsinAsyncZip(DummyAsyncIterable(list("foo")),DummyAsyncIterable(list("bar"))):print(items)asyncio.get_event_loop().run_until_complete(test())Gives:[<Task finished coro=<DummyAsyncIterable.__anext__() done, defined at test.py:11> result='f'>,<Task finished coro=<DummyAsyncIterable.__anext__() done, defined at test.py:11> result='b'>]
[<Task finished coro=<DummyAsyncIterable.__anext__() done, defined at test.py:11> result='o'>, <Task finished coro=<DummyAsyncIterable.__anext__() done, defined at test.py:11> result='a'>]
[<Task finished coro=<DummyAsyncIterable.__anext__() done, defined at test.py:11> result='o'>, <Task finished coro=<DummyAsyncIterable.__anext__() done, defined at test.py:11> result='r'>]
Package: asynczipstream
python-zipstream-aiozipstream.py is a zip archive generator based on python 3.3's zipfile.py. It was created to
generate a zip file generator for streaming (ie web apps). This is beneficial for when you
want to provide a downloadable archive of a large collection of regular files, which would be infeasible to
generate the archive prior to downloading or of a very large file that you do not want to store entirely on disk or on memory.The archive is generated as an iterator of strings, which, when joined, form
the zip archive. For example, the following code snippet would write a zip
archive containing files from 'path' to a normal file:importasynczipstreamimportasyncioasyncdefmain():z=asynczipstream.ZipFile()z.write('path/to/files')withopen('zipfile.zip','wb')asf:asyncfordatainz:f.write(data)asyncio.run(main())zipstream also allows to take as input a byte string iterable and to generate
the archive as an iterator.
This avoids storing large files on disk or in memory.
To do so you could use something like this snippet:importasynczipstreamimportasyncioasyncdefmain():asyncdefiterable():for_inrange(10):yieldb'this is a byte string\x01\n'z=asynczipstream.ZipFile()z.write_iter('my_archive_iter',iterable())withopen('zipfile.zip','wb')asf:asyncfordatainz:f.write(data)asyncio.run(main())Of course both approach can be combined:importasynczipstreamimportasyncioasyncdefmain():asyncdefiterable():for_inrange(10):yieldb'this is a byte string\x01\n'z=asynczipstream.ZipFile()z.write('path/to/files','my_archive_files')z.write_iter('my_archive_iter',iterable())withopen('zipfile.zip','wb')asf:asyncfordatainz:f.write(data)asyncio.run(main())If the zlib module is available, asynczipstream.ZipFile can generate compressed zip
archives.Installationpip install asynczipstreamRequirementsPython 3.8+aiohttp Examplefromaiohttpimportweb,hdrsimportasynczipstreamasyncdefhandle_license(request):"""Example with file from disk"""filename="license.zip"response=web.StreamResponse(status=200,headers={hdrs.CONTENT_TYPE:"application/octet-stream",hdrs.CONTENT_DISPOSITION:(f"attachment; "f'filename="{filename}"; '),},)awaitresponse.prepare(request)z=asynczipstream.ZipFile()z.write('LICENSE')asyncfordatainz:awaitresponse.write(data)returnresponseasyncdefhandle_readme(request):"""Example with file from iterable object"""filename="readme.zip"response=web.StreamResponse(status=200,headers={hdrs.CONTENT_TYPE:"application/octet-stream",hdrs.CONTENT_DISPOSITION:(f"attachment; "f'filename="{filename}"; '),},)awaitresponse.prepare(request)asyncdefiterable(filename):withopen(filename,"rb")asf:yieldf.readline()z=asynczipstream.ZipFile()z.write_iter('README.md',iterable("README.md"))asyncfordatainz:awaitresponse.write(data)returnresponseapp=web.Application()app.add_routes([web.get('/license',handle_license),web.get('/readme',handle_readme)])if__name__=='__main__':web.run_app(app)Running testsJust run the following command:python -m unittest discover
Package: asynker
Asynker (IPA: /eɪˈsɪŋkɜːn/) is pretty much the least amount of code you need
to use the “await” syntax. Typically packages like asyncio or curio implement
two concepts at once: a scheduler and an event loop. The scheduler is a piece
of code that decides what to run next and then runs it. The event loop is
a piece of code that tells the scheduler what itcanrun.Asynker only provides the scheduling part. This generally only makes sense if
you are using something else as the event loop, e.g. something callback-based.
Asynker allows you to use a callback-based system and easily convert it into
a coroutine/await-based system.The Future class used in Asynker is unrelated to any of the various Future
classes found in the Python standard library (for now, anyway).FeaturesDoes over 900000 yields per second[citation needed]The API is like asyncio but different enough to probably introduce interesting behaviours
for study in your codeIf all you wanted was to use “await” in your code without loading 500 kB of code,
then this is for you
Package: asynkets
asynketsasynketsis a Python library which provides miscellaneous utilities that are useful when writingasynciocode.Provided utilities include:Switch: A class that allows waiting for state changes of a switch that can be turned on or off. It provides async methods for waiting until it is in a specific state, and for waiting until it switches to a different state.EventfulCounter: A counter that can be incremented or decremented and has optional minimum and maximum values. It also provides async methods for waiting until some threshold (either low or high) is reached, or until some threshold is reached or left, by leveraging Switches.Fuse: Similar to asyncio's Event, but can only be set once.Pulse: A pulse that can be triggered and waited for. It can also be given a function to call when it is triggered and can be used as an async iterator.PeriodicPulse: A pulse that fires periodically at a specified interval and delay. It can be closed and used as an async iterator like the Pulse class.ensure_coroutine_functionandensure_async_iterator: return guaranteed async versions of a sync or async function or iterable, respectively. If the function or iterable is synchronous, it will be wrapped to be async; if it is already async, it will be returned as-is.merge_async_iterables: Merges multiple iterables or async iterables into one, yielding items as they are received.Installationasynketsis available on PyPI and can be installed withpipor your favorite package manager.pipinstallasynketsUsage(todo)LicenseThe library is provided under the MIT license. See theLICENSEfile for more information.
Package: asynmsg
A library based on asyncore, used to build tcp server/client application communicating each other with customized messages.ExamplesServer:import asynmsg

@asynmsg.with_message_handler_config
class ServerSession(asynmsg.SessionS):

    @asynmsg.message_handler_config('Login')
    def on_Login(self, msg_id, msg_data):
        self.send_message('LoginAck', 'login success')

class Server(asynmsg.Server):
    session_class = ServerSession

Server(('127.0.0.1', 12345))
asynmsg.run_forever()Client:import asynmsg

@asynmsg.with_message_handler_config
class ClientSession(asynmsg.SessionC):
    def on_opened(self):
        asynmsg.SessionC.on_opened(self)
        self.send_message('Login', 'test1')

    @asynmsg.message_handler_config('LoginAck')
    def on_LoginAck(self, msg_id, msg_data):
        pass

class Client(asynmsg.ClientBlockConnect):
    session_class = ClientSession

client = Client(('127.0.0.1', 12345))
if client.is_started():
    asynmsg.run_forever()
Package: as-you-wish
As You WishA simple python configuration library that works like Minecraft Forge's Config classes.
I was fed up by the fact that theconfigparserlibrary had little to no support for comments on values
and also support for restoring configurations from a corrupted state.
I also wanted a library that would validate that certain config values where of the correct type, so this is it.BackendsThe only current backend is theconfigparserlibrary, but I would might add support for more,
such as yaml, json, toml, etc.InstallationRunpip install as-you-wishto use this project.UsageExample program usage:fromas_you_wishimportConfigsettings=Config()settings.define('service.api_key','YOUR_API_KEY','needed to connect to the api service')settings.load('settings.ini')print(f"API_KEY={settings.get('service.api_key')}")Also check out thedocsandtestsfor more api usage.ContributingWe'd love the help. Unfortunately we don't have a Contributing.md document yet, but if you find an issue/bug/feature request, feel free to submit it with a PR or under the Issues tab.Thanks for checking us out! (The Kingdom of Florin 🏰 is yours.)
Package: at16k
at16kPronounced asat sixteen k.Try out the interactive demo here.What is at16k?at16k is a Python library to perform automatic speech recognition or speech to text conversion. The goal of this project is to provide the community with a production quality speech-to-text library.InstallationIt is recommended that you install at16k in a virtual environment.PrerequisitesPython >= 3.6Tensorflow = 1.14Scipy (for reading wav files)Install via pip$ pip install at16kInstall from sourceRequires:poetry$ git clone https://github.com/at16k/at16k.git
$ poetry env use python3.6
$ poetry installDownload modelsCurrently, three models are available for speech to text conversion.en_8k (Trained on English audio recorded at 8 KHz, supports offline ASR)en_16k (Trained on English audio recorded at 16 KHz, supports offline ASR)en_16k_rnnt (Trained on English audio recorded at 16 KHz, supports real-time ASR)To download all the models:$ python -m at16k.download allAlternatively, you can download only the model you need. For example:$ python -m at16k.download en_8k
$ python -m at16k.download en_16k
$ python -m at16k.download en_16k_rnntBy default, the models will be downloaded and stored at <HOME_DIR>/.at16k. To override the default, set the environment variable AT16K_RESOURCES_DIR.
For example:$ export AT16K_RESOURCES_DIR=/path/to/my/directoryYou will need to reuse this environment variable while using the API via command-line, library or REST API.Preprocessing audio filesat16k accepts wav files with the following specs:Channels: 1Bits per sample: 16Sample rate: 8000 (en_8k) or 16000 (en_16k)Use ffmpeg to convert your audio/video files to an acceptable format. For example,# For 8 KHz
$ ffmpeg -i <input_file> -ar 8000 -ac 1 -ab 16 <output_file>

# For 16 KHz
$ ffmpeg -i <input_file> -ar 16000 -ac 1 -ab 16 <output_file>Usageat16k supports two modes for performing ASR - offline and real-time. And, it comes with a handy command line utility to quickly try out different models and use cases.Here are a few examples -# Offline ASR, 8 KHz sampling rate
$ at16k-convert -i <path_to_wav_file> -m en_8k

# Offline ASR, 16 KHz sampling rate
$ at16k-convert -i <path_to_wav_file> -m en_16k

# Real-time ASR, 16 KHz sampling rate, from a file, beam decoding
$ at16k-convert -i <path_to_wav_file> -m en_16k_rnnt -d beam

# Real-time ASR, 16 KHz sampling rate, from mic input, greedy decoding (requires pyaudio)
$ at16k-convert -m en_16k_rnnt -d greedyIf theat16k-convertbinary is not available for some reason, replace it with -python -m at16k.bin.speech_to_text ...Library APICheckthis filefor examples on how to use at16k as a library.LimitationsThe max duration of your audio file should be less than30 secondswhen usingen_8k, and less than15 secondswhen usingen_16k. An error will not be thrown if the duration exceeds the limits, however, your transcript may contain errors and missing text.LicenseThis software is distributed under the MIT license.AcknowledgementsWe would like to thankGoogle TensorFlow Research Cloud (TFRC)program for providing access to cloud TPUs.
Package: at89overlord
at89overlordUploader for Arduino based AT89C2051 programmerUsageat89overlord [-h] [-p PORT] [-b BAUD] [-e] [-c] [-V] [-v] (-f FILE | -r FILE)ArgumentDescription-h, --helpshow this help message and exit-p PORT, --port PORTserial port with arduino connected to it-b BAUD, --baud BAUDbaud rate of connected arduino-e, --no-erasedo not erase flash before write-c, --no-confirmdo not confirm chip ID before executing an action-V, --no-verifydo not verify flash content after write-v, --verbosemore verbose output-f FILE, --file FILEintel hex file to be flashed onto the chip-r FILE, --read FILEread flash content from chip and write to intel hex file
Package: atacbot
Telegram-atacbotA telegram bot to query muovi.roma.itFree software: GNU General Public License v3Documentation:https://telegram-atacbot.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2019-03-16)First release on With cookiecutter.
Package: atacnet
AtacNetDescriptionThis repo contains a python package for inferring co-accessibility networks from single-cell ATAC-seq data, usingskggmfor the graphical lasso andscanpyfor data processing.It is based on the pipeline and hypotheses presented in the manuscript "Cicero Predicts cis-Regulatory DNA Interactions from Single-Cell Chromatin Accessibility Data" by Pliner et al. (2018). The original R packageCicerois availablehere.Results may vary between both packages, notably due to the different implementations of graphical lasso.Currently, scores seem proportional but absolute values differs slightly. (cf comparison plots below)InstallationThe package can be installed using pip:pip install atacnetand from githubpip install "git+https://github.com/r-trimbour/atacnet.git"Minimal exampleimport anndata as ad
import atacnet as an

atac = ad.read_h5ad('atac_data.h5ad')
an.add_region_infos(atac)
an.compute_atac_network(atac)
an.extract_atac_links(atac)Comparison to Cicero R packageToy dataset 1:On the same metacells obtained from Cicero code.Pearson correlation coefficient: 0.99Spearman correlation coefficient: 0.98Coming:Add stats on similarity on large datasets.Add stats on runtime, memory usage.This package can be run on multiple cores.UsageIt is currently developped to work with AnnData objects. Check Example1.ipynb for a simple usage example.
Package: atados-analytics-sdk
SDK Oficial para PythonEstá SDK é utilizada para enviar eventos à API de Analytics da AtadosInstalandopip install @atados/analytics-sdkAntes de começar, entenda a função tracktrack(/*** Tipo: String* Use para categorizar esta acao* Ex.:*   category = 'Apply',*   category = 'Notification',*/category:string,/*** Tipo: String* Use para identificar esta ação dentro da categoria* Ex.:*   label = 'Cancel Apply',*   label = 'View Notification',*/label:string,/*** Use para enriquecer esta ação dentro da categoria* Ex.:*   action = ID de inscricao*   action = { notificationId, notificationKind }*/action:any,/*** Use este argumento para sobrepor as configurações de userId* ou meta*/user_id?:number,/*** Use este argumento para sobrepor as configurações de meta*/override_meta?:{}):Promise<void>IniciandofromAnalyticsfromanalyticsdefreport_error(error):print(error.message)analytics=Analytics(api_url=API_URL,api_token=API_TOKEN,meta=mock_meta,on_error=report_error,meta={'channelId':1})track_result=analytics.track(category='Category',label='Label',action={'data':1},# (Opcional)user_id=1,# (Opcional)sessoin_id=1)Utilizandoanalytics.track('Category','Label','Action')
Package: atakama
Atakama Python SDKOverviewThis is a library for programmatically interacting and enhancing the Atakama encrypted file system.However, the best way to interact with Atakama is to use the filesystem itself.It is not necessary to use this SDK for most development efforts, it is provided solely for efficiency and convenience.autodoc documentationFor example:In order to integrate with ssh, so that you have to approve a login on your phone,
the easiest thing to do is create an identity file, secure it with Atakama, and then put a soft link to it.That way when you go to ssh in somewhere, the identity file is unlocked, and you are prompted on your mobile device.Using the atakama command-line or SDK would not be recommended in this case.Plugin System:Atakama supports plugins. This is largely done so that we can have multiple release cycles for 3rd party vendor integrations.Detector Plugins:Atakama runs a file monitoring system. This system will automatically-encrypt files as files are modified. For efficiency,
especially on large systems, it may be desirable to alter the rules used to detect and encrypt files.Example of a detector plugin:This plugin will cause any file with the word "secret" in the name to be encrypted.from atakama import DetectorPlugin

class ExampleDetector(DetectorPlugin):
    @staticmethod
    def name():
        return "example-detector"

    def needs_encryption(self, full_path):
        return "secret" in full_path:Dependencies:Detector plugins run inside a protected namespace within Atakama.   Not all imports are available.Python code is version 3All__builtins__are guaranteed to be availableIn particular,subprocess,sys,requests,os,zipfileandatakamaare explicitly available.If you're concerned about specific package versions and other dependencies, please package your plugin as a subprocess call (or DLL) with its own deps includedAtakama will endeavor to update theATAKAMA_SDK_VERSIONif we ship libraries that have major version changes, or backward breaking python-version changes
Package: atalaya
AtalayaThisframeworkprovides a logger for pytorch models, it allows you to save the parameters, the state of the network, the state of the optimizer and allows also to save and visualize your data using tensorboardX or visdom.InstallExamplesUsageInitLog InformationStore your ParametersStore and Restore (models and optimizers)GrapherInstall$pipinstallatalayaExampleAn example is providedhere.Launch the example doing :$./run.shAn example of logs produced by the logger are given in thelogsfolder of the example.UsageInitfromatalayaimportLoggerlogger=Logger(name="exp",# name of the loggerpath="logs",# path to logsverbose=True,# logger in verbose mode)# by default Logger uses no grapher# you can setup it by specifying if you want visdom or tensorboardXlogger=Logger(name="exp",# name of the loggerpath="logs",# path to logsverbose=True,# logger in verbose modegrapher="visdom",server="http://localhost",port=8097,username="user",# if needed for visdompassword="pwd",# if needed for visdom)# your code here...# to close the loggerlogger.close()Log Information# logs information in console and in log file.logger.info("your","information","here","like","a","print")# same as logger.info but for warning messageslogger.warning("your warning")Store your Parameters# save your parameters into a json filelogger.add_parameters(args)# load the parameters froma previous experimentlogger.restore_parameters(path_to_folder)Store and Restore (models and optimizers)Add the model (or optimizer or whatever that has a state_dict in pytorch)Before starting storing or restoring objects you need to add them to the logger:logger.add("model",model)logger.add("optimizer",optimizer)Store the modelIn training loop we can add this method, it allows us to save checkpoints,
and the best model.The parameter valid_loss is simply the parameter to know when to save the best. It looks if
the new valid_loss is less than the value keep by the logger as lower if it's the case save as best and
update the value keep in memory.The parameter save_every specify how often to save a checkpoint during training.overwrite specify if we want to overwrite the last checkpoint to keep only the last one
or if we want to keep them all (saves a model per epoch --> DANGEROUS)logger.store(valid_loss,save_every=1,overwrite=True)Restore the model
To restore the best after taining simply dologger.restore(best=True)To restore a checkpoint from another exp :logger.restore(folder=path_to_folder)To restore the best from another exp :logger.restore(folder=path_to_folder,best=True)GrapherSome examples of grapher methods.logger.add_scalar("train_mse",scalar_value,global_step=None,save_csv=True)logger.add_text("tag","your text here")# values for each batch size at a given epochvalues={"mse":[10,9,8,7],"acc":[0.3,0.5,0.55,0.6]}logger.register_plots(values,epoch,"train",apply_mean=True,save_csv=True,info=True)