Saravanan666/pypi-org huggingface dataset:
Package: rkd-harbor
docker-composebased framework for building production-like environments - developing and testing on your local computer, deploying to your server or cluster from shell or from CI.Demo:https://asciinema.org/a/348698HarborIs Kubernetes or OKD too big overhead or not suitable for your environment?Is standard docker-compose too primitive to use in production?Harbor fits perfectly, while providing some of Kubernetes-like solutions in docker-compose!Features:Service discovery (pins containers into WWW domains by labelling)Deployment strategies: compose’s standard, recreation, androlling-updates (zero-downtime updates)Automatic Letsencrypt SSLStandardized directory structures and design patternsReady to use snippets of code and solutions (one command to install database, Wordpress or other application from our repository)Ansible integration to prepare your production/testing server and deploy updates in extremely intuitive wayRoadmap:Harbor 2.1Init containers support (basing on Kubernetes idea) (#5)delayed-request update strategy (minimum-downtime deployment with holding all HTTP requests waiting for new application) (#11)Webhook handling update daemon to trigger container and git updates (#10)Read documentation for more:https://environment.docs.riotkit.org/en/latest/?badge=latestChangelogHarbor 2.0Service upgrade strategies: Compose-native, recreation, rolling-updatesRewrite from Makefile to PythonContainers startup priorityMaintenance mode is now not only global, but also per domainDevelopment mode now supports not only .localhost domains, but also *.xip.ioFrom authorsWe are grassroot activists for social change, so we created this software while we were helping those fantastic initiatives:RiotKit (https://riotkit.org)International Workers Association (https://iwa-ait.org)Anarchistyczne FAQ (http://anarchizm.info) a translation of Anarchist FAQ (https://theanarchistlibrary.org/library/the-anarchist-faq-editorial-collective-an-anarchist-faq)Federacja Anarchistyczna (http://federacja-anarchistyczna.pl)Związek Syndykalistów Polski (https://zsp.net.pl) (Polish section of IWA-AIT)Komitet Obrony Praw Lokatorów (https://lokatorzy.info.pl)Solidarity Federation (https://solfed.org.uk)Priama Akcia (https://priamaakcia.sk)Special thanks toWorking Class Historyfor very powerful samples that we could use in our unit tests.
Package: rke-score
RKE scorePaper: An Information-Theoretic Evaluation of Generative Models in Learning Multi-modal DistributionsMohammad Jalai1*,Cheuk Ting Li2,Farzan Farnia21Isfahan University of Technology (IUT),2The Chinese University of Hong Kong (CUHK)* Work done during an internship at CUHK1. BackgroundAbstractThe evaluation of generative models has received significant attention in the machine learning community.
When applied to a multi-modal distribution which is common among image datasets, an intuitive evaluation criterion is the number of modes captured by the generative model.
While several scores have been proposed to evaluate the quality and diversity of a model's generated data, the correspondence between existing scores and the number of modes in the distribution is unclear.
In this work, we propose an information-theoretic diversity evaluation method for multi-modal underlying distributions. We define theR'enyi Kernel Entropy (RKE)as an evaluation score based on quantum information theory to measure the number of modes in generated samples. To interpret the proposed evaluation method, we show that the RKE score can output the number of modes of a mixture of sub-Gaussian components. We also prove estimation error bounds for estimating the RKE score from limited data, suggesting a fast convergence of the empirical RKE score to the score for the underlying data distribution. Utilizing the RKE score, we conduct an extensive evaluation of state-of-the-art generative models over standard image datasets. The numerical results indicate that while the recent algorithms for training generative models manage to improve the mode-based diversity over the earlier architectures, they remain incapable of capturing the full diversity of real data. Our empirical results provide a ranking of widely-used generative models based on the RKE score of their generated samples.R'enyi Kernel Entropy Mode Count (RKE) and Relative R'enyi Kernel Entropy (RRKE)FormulationToy example: Gaussian DistributionsEvaluation of Generative Models2. UsageInstallationUsing PyPipipinstallrke-scoreManuallygitclonehttps://github.com/mjalali/renyi-kernel-entropy-scorecdrenyi-kernel-entropy-score
pipinstall-e.Exampleimportnumpyasnpfromrke_scoreimportRKEnum_real_samples=num_fake_samples=10000feature_dim=1000real_features=np.random.normal(loc=0.0,scale=1.0,size=[num_real_samples,feature_dim])fake_features=np.random.normal(loc=0.0,scale=1.0,size=[num_fake_samples,feature_dim])kernel=RKE(kernel_bandwidth=[0.2,0.3,0.4])print(kernel.compute_rke_mc(fake_features))print(kernel.compute_rrke(real_features,fake_features))Guide to evaluate your modelYou can evaluate your model using different feature extractors (mostly used: inceptionV3)3. Cite our work@inproceedings{
    jalali2023rke,
    title={An Information-Theoretic Evaluation of Generative Models in Learning Multi-modal Distributions},
    author={Mohammad Jalali and Cheuk Ting Li and Farzan Farnia},
    booktitle={Thirty-seventh Conference on Neural Information Processing Systems},
    year={2023},
    url={https://openreview.net/forum?id=PdZhf6PiAb}
}
Package: rkgb
rk-GraphBuilder# Example of how to use rkgbimporttorchimportrkgbfrommodels.GPTimportGPT2device=torch.device("cuda")model=GPT2(nlayers=12,dropout=0.1)model.to(device)sample=torch.randint(5400,(100,20),device=device)rkgb_result=rkgb.make_all_graphs(model,sample)rkgb.print_all_graphs(rkgb_result,name="GPT2_12",render_format="pdf")# To render the graphs in pdf you need Graphviz# You can also try:rkgb_result=rkgb.test_rkgb(model,sample)Tests provided:You can run the Python Notebook :test_rkgb.ipynb,
which include some tests over GPT2, Resnet101, Regnetx32, MLP_Mixer and nn.transformer.
rk-GB works on these modules, but Rockmate fails on nn.transformer Rockmate.rk-GB graphs:B_graphstands for Basic Graph, object built by processingtorch.jit.trace_moduleoutput. It just a raw graph, consisting simply in a list of operations. Therefore, it cannot be rendered. Everything concerning this structure, and the way it's computed is inBtools.py.D_graphis the first useful DAG graph, data-flow of the forward computation. Each node consists of one assignment, defining one variable using one primitive operation. To generate it you need aB_graphviaB_to_D. SeeDtools.py.In particular, each operation is run to collect basic information (dtype, shape, views etc).S_graphis the simplified forward graph, where each node consist of one real operation, and a body code (shapes, viewing or in-place operations). You need aD_graphto generate it, seeStools.py. Note that you can manually apply each simplification step one by one, and print intermediate results usingrkgb.stools.print_S_graph, check the code ofD_to_S.TheS_graphcan be cut usingStools.cutto obtain the sequence of blocks, as needed byrk-Rotor.Atools.pyhandle anonymization stuff, to recognize equivalent blocks.Finally, you can generateK_graphs, which are graphs containing bacKward nodes, and everything you need for rk-Checkmate, seeKtools.py.Thus the main function ofrkgb(rkgb.make_all_graphs) runs :bg=Btools.make_B(model,samples,device)dg=Dtools.B_to_D(bg,model,samples,device)sg=Stools.D_to_S(dg,model,device)kg=Ktools.S_to_K(sg,model,device)# For sequential graphs:list_sg=Stools.cut(sg)equivalent_classes,list_kg,list_ano_sg=Atools.S_list_to_K_list_eco(list_sg,model,device)# You can print each graph using their respective function. Example:Stools.print_S_graph(sg)# Or the general functionrkgb.print_graph(sg)
Package: rki-covid19csv-parser
rki-covid19csv-parserA small python module to work with the RKI_Covid19.csv files issued by the German RKI (Robert Koch Institut) on a daily basis.Installation:pip install rki-covid19csv-parserUsage:First steps:Initialize the parser and load data from the RKI_Covid19.csv file.   Because of the daily increasing file size this process can take a while.import rki_covid19csv_parser

covid_cases = rki_covid19csv_parser.covid_cases()

covid_cases.load_rki_csv('path/to/csv')Speeding up the loading process:Once you have loaded the csv file it's possible to save the processed data to a file.
This can speed up the process of loading the data significantly if you whish to run your script more than once.#save file.
covid_cases.save_toFile('desired/path')

#load file.
covid_cases.load_fromFile('path/to/saved/file')Get the covid19 data:Supported methods:A description of the parameters can be found below.methoddescriptionreturnscumCases(date, region_id, date_type)cumulated covid19 casesFilter objectcumDeaths(date, region_id, date_type)cumulated covid19 deathsFilter objectnewCases(date, region_id, date_type)new covid19 casesFilter objectnewDeaths(date, region_id, date_type)new covid19 deathsFilter objectnewCasesTimespan(date, region_id, date_type, timespan)new covid19 cases in periodFilter objectnewDeathsTimespan(date, region_id, date_type, timespan)new covid19 deaths in periodFilter objectactiveCases(date, region_id, date_type, days_infectious)active covid19 casesFilter objectsevenDayCaserate(date, region_id, date_type)new covid19 cases in 7-daysFilter objectsevenDayIncidence(date, region_id, date_type)new covid19 cases per 100k people in 7-daysFilter objectdeathRate(date, region_id, days_infectious)death rate (activeCases/newDeaths)Filter objectParameters:parametertypedescriptionexampledatestr in  iso-format, datetime.date obj, datetime.datetime objThe desired date.'2020-06-01 00:00:00'region_idstrA list of region-ids can be found here.'0'date_typestrThe date type to use. Meldedatum or Refdatum'Meldedatum'timespanintNumber of last days to be included in calculation.3days_infectiousintNumber of days a case is considered as active.14Get your covid19 data in shape:Each of the methods mentioned above returns an objct of the class Filter. You can use the following methods to get the data into your desired shape.methoddescriptionreturnsvalues()raw datandarrayby_cases(raw, decimals)absolute number of casesdictby_age(frequency, decimals)cases sorted into agegroupsdictby_gender(frequency, decimals)cases sorted by genderdictby_ageandgener(frequency, decimals)cases sorted by age and genderdictparameterinput typedescriptionexamplefrequencystrweather you want the absolute or relative number of cases'absolute'decimalsintnumber of decimals3rawboolTrue to get raw valuesTrueExamples:cases = covid_cases.cumCases(date='2021-04-29 00:00:00', region_id='01001', date_type='Meldedatum').by_gender(frequency='absolute')
print(cases)
>>> {'M': 1200, 'W': 1400, 'unbekannt': 130}Example values!
Package: rki-covid-parser
Robert-Koch Institut COVID numbers parserPython parser for the latest covid numbers from German RKI (Robert-Koch Institut).Installationpip install rki-covid-parserUsageInitialize the parser with anaiohttp.sessionand load the latest data.parser = RkiCovidParser(session)        
await parser.load_data()


for district in parser.districts:
    # work with districts
    pass

for state in parser.states:
    # work with states
    pass

# work with the country
parser.country.casesfinished loading data, the parser contains a dictionary of districts, each with these properties:PropertyTypeDescriptionidstringUnique district identifiernamestringName of the  districtcountystringCounty of the districtstatestringState of the districtpopulationintegerPopulationcasesintegerActive casesdeathsintegerCurrently tracked deathscasesPerWeekintegerCases per weekdeathsPerWeekintegerDeaths per weekrecoveredintegerRecovered casesweekIncidencefloatWeek incidencecasesPer100kfloatCases per 100k populationnewCasesintegerNew cases since last daynewDeathsintegerNew deaths since last daynewRecoveredintegerNew recovered since last daylast_updatestringTimestamp of the last updatehospitalizationCasesMergedfloatHospitalization cases for people in germany summarizedhospitalizationIncidenceMergedfloatHospitalization incidence for people in germany summarizedhospitalizationCasesBabyfloatHospitalization cases for people between 00-04hospitalizationIncidenceBabyfloatHospitalization incidence for people between 00-04hospitalizationCasesChildrenfloatHospitalization cases for people between 05-14hospitalizationIncidenceChildrenfloatHospitalization incidence for people between 05-14hospitalizationCasesTeenfloatHospitalization cases for people between 15-34hospitalizationIncidenceTeenfloatHospitalization incidence for people between 15-34hospitalizationCasesGrownfloatHospitalization cases for people between 35-59hospitalizationIncidenceGrownfloatHospitalization incidence for people between 35-59hospitalizationCasesSeniorfloatHospitalization cases for people between 60-79hospitalizationIncidenceSeniorfloatHospitalization incidence for people between 60-79hospitalizationCasesOldfloatHospitalization cases for people older than 80hospitalizationIncidenceOldfloatHospitalization incidence for people older than 80ContributionSeeContributionfor details.
Package: rki-scraper
(yet another) RKI ScraperThe RKI is the abbreviation for the German Robert Koch Institut. They are the
central science organisation consulting the German government in health issues.They also track (count) all sick and deceased persons.This package shall provide sick and deceased person counts for all German States
(Bundesländer) and Counties (Landkreise).It downloads the current version of the RKI csv file and parses it into a pandas
dataframe. That's about it, but I haven't found anything similar on the web last
summer.To try it, do the following:~$pipinstallrki_scraper
~$python>>>fromrki_scraperimportRKI>>>r=RKI()# wait a while to download and parse a >>100 MB csv file>>>r.df.head()If you need help, or find a bug just drop a mail!
Package: rkkpy
python-package-exampleThis is a minimal python package, for use alongside the lesson:https://github.com/BillMills/pythonPackageLessonContributing:Please do! Guidelines:This lesson is for beginners. Yes there are plenty of super fancy things we don’t cover here; someday, we’ll make a different, super fancy lesson to teach those things.Max 100 lines per PR please.Open an issue or empty PR first to talk about controversial changes.
Package: rkn
This module provide only one function: it check if domain is listed onhttp://blocklist.rkn.gov.rurkn can be obtained directly from PyPI, and can be installed with pip:pip install rknYou need anti-captcha.com API key for using this module.Example usage:>>> from rkn import check_rkn
>>> result, found_in_reestr, success = check_rkn.query("domain.name", "YOUR_API_KEY_HERE")
>>> if found_in_reestr:
>>>     print (result)If success if False - this mean request was unsuccessful. Rkn reestr ban some IP addresses and did not response to them.
Package: rknfind
RknFind projectDisclaimerThis application provides tools for browsing and exporting
RKN (RosKomNadzor, a Russian communications managing autority)
dump of sites blocked in Russia.Please note that visiting sites exposed from RKN dump by
this application may be illegal in some countries.End user takes full responsibility for any actions made using this application,
which include, but not limited by:Downloading a copy of RKN dump file from Zapret-Info Github repositoryRetrieving a human-readable list of blocked sites/URLs/IP addressesExporting list of blocked resources to SQLite databaseFeaturesWhat can this application do?Retrieve and auto-update RKN dump fileProcess RKN dump file and print out human-readable/JSON-formatted list of
blocked sitesExport list of blocked sites to SQLite databaseUsageInstallationApplication is available at PyPI and can be retrieved usingpip:$pipinstallrknfindYou can installgitandgitpythonmodule to slightly improve performance
on dump file download:Git downloads -https://git-scm.com/downloadsGitPython installation:$pipinstallrknfind[git]You can also installpeeweeto be able to export data into SQLite database:$pipinstallrknfind[db]LaunchingOnce you've installedrknfind, just run it in terminal:$rknfindWith no filter parameters provided,rknfindwill exit. Userknfind -f <field> <occurence>to add filter. You can use-fflag multiple times!List of fields:FieldDescriptionaddrList of IP addresses of entrydateIssue date of entrydecreeDecree of entryissuerIssuing authority of entrydomainList of domain names of entryurlList of URLs of entryFor info related to other flags, userknfind -h
Package: rknntools
rknntoolsrknn模型转换可能会用到的工具RKNNTOOLKIT2版本 >= 1.5.2代码说明op_limit.py 包括函数check_op_limit，输入onnx模型，输出算子匹配情况其他说明目前算子已经匹配实例中的模型，以及conformer、zipformer等，后续可能有补充目前依赖onnx库，测试1.13.1可行TODOONNX模型输入输出信息打印读取ONNX模型并初始化全0输入，保存输出至文件供精度比对修复ONNX模型的输入shape，满足rknntoolkits的要求提供PT->ONNX代码，返回其中不支持算子在代码中的具体位置
Package: rkquery
rkQuery is a library for programmatically building Riak search queries.
It aims to be easy to use, powerful, and protect from injection attacks
that would be possible with simple string interpolation.ExampleJust start playing around with theqobject:>>> from rkquery import q
>>> q("some literal")
<q: "some literal">
>>> q(field="literal value")
<q: field:"literal value">
>>> q.not_(blocked="yes")
<q: NOT blocked:"yes">You can provide multiple arguments, too. The default query combinator isAND:>>> q("word1", "word2")
<q: "word1" AND "word2">
>>> q(username='foo', password='s3cr3t')
<q: username:"foo" AND password:"s3cr3t">This is just a synonym forq.all():>>> q.all("word1", "word2")
<q: "word1" AND "word2">
>>> q.all(username='foo', password='s3cr3t')
<q: username:"foo" AND password:"s3cr3t">Of course you can constructORqueries, usingq.any():>>> q.any("word1", "word2")
<q: "word1" OR "word2">
>>> q.any(username='foo', email='foo@example.com')
<q: username:"foo" OR email:"foo@example.com">
>>> q(field=q.any("string1", "string2"))
<q: field:("string1" OR "string2")>Or by combining existingqobjects:>>> q.any("word1", "word2") & q("word3")
<q: ("word1" OR "word2") AND "word3">
>>> q.any(email="foo@example.com", username="foo") & q(password="s3cr3t")
<q: (email:"foo@example.com" OR username:"foo") AND password:"s3cr3t">There are helpers for negation as well (note that ‘none’ means ‘not
any’):>>> q.none(blocked="yes", cheque_bounced="yes")
<q: NOT (blocked:"yes" OR cheque_bounced:"yes")>
>>> ~q.any(blocked="yes", cheque_bounced="yes")
<q: NOT (blocked:"yes" OR cheque_bounced:"yes")>You can do range queries withq.range():>>> q.range("red", "rum")
<q: ["red" TO "rum"]>
>>> q(field=q.range("red", "rum"))
<q: field:["red" TO "rum"]>Note that the default is aninclusiverange (square brackets). The
full set of range queries:>>> q.range_inclusive("red", "rum")
<q: ["red" TO "rum"]>
>>> q.range_exclusive("red", "rum")
<q: {"red" TO "rum"}>
>>> q.between("red", "rum")
<q: {"red" TO "rum"}>Term boosting is a simple unary operation:>>> q("red").boost(5)
<q: "red"^5>As is proximity:>>> q("See spot run").proximity(20)
<q: "See spot run"~20>
Package: rkrizzle
Rkrizzle is an Apache2 Licensed HTTP library, written in Python, for people.
It is a fork of the amazing requests library with two major differences:No vendored librariesHonors and uses OS System CA BundlesRkrizzle aims to be easy to be used both from an OS distro perspective, and
for direct python developers working from PyPI, and to do what people expect
of a key system library - such as playing nicely with the rest of the system.If you’re curious as to why we forked and didn’t just patch requests itself,
please seeKenneth’s Viewson the subject of vendoring. The disagreement is intractable.Rkrizzle has every intention of maintaining API compatibility with requests.
It is a completely fair choice for the requests authors to choose to bundle
libraries and CA Bundles. That doesn’t work for us, so we’re doing this.
Hopefully we can all get along.UsingMost existing Python modules for sending HTTP requests are extremely
verbose and cumbersome. Python’s builtin urllib2 module provides most of
the HTTP capabilities you should need, but the api is thoroughly broken.
It requires an enormous amount of work (even method overrides) to
perform the simplest of tasks.Things shouldn’t be this way. Not in Python.>>>r=rkrizzle.get('https://api.github.com',auth=('user','pass'))>>>r.status_code204>>>r.headers['content-type']'application/json'>>>r.text...Seethe same code, without Rkrizzle.Rkrizzle allow you to send HTTP/1.1 requests. You can add headers, form data,
multipart files, and parameters with simple Python dictionaries, and access the
response data in the same way. It’s powered by httplib andurllib3, but it does all the hard work and
crazy hacks for you.FeaturesInternational Domains and URLsKeep-Alive & Connection PoolingRkrizzle with Cookie PersistenceBrowser-style SSL VerificationBasic/Digest AuthenticationElegant Key/Value CookiesAutomatic DecompressionUnicode Response BodiesMultipart File UploadsConnection TimeoutsThread-safetyHTTP(S) proxy supportInstallationTo install Rkrizzle, simply:$pipinstallrkrizzleDocumentationDocumentation is available athttp://rkrizzle.readthedocs.org/.
Package: rkt
rktRacket runtime in PythonWARNING: This repo is in development. It was automatically generated withmkpylib. If you're reading this message, it means that I use this repo for my own purposes right now. It might not do anything at all; the default functionality isprint('TODO').If you really want to try it out, feel free. I recommend reading through thetestsand commit history to see if it does what you need, orask mefor status updates.Stay tuned!Installpip3 install -U rktOr develop locally:git clone https://github.com/shawwn/rkt ~/rkt
cd ~/rkt
python3 setup.py developUsageimportrktprint('TODO')LicenseMIT. SeeLICENSEfile.ContactA library byShawn Presser. If you found it useful, please considerjoining my patreon!My Twitter DMs are always open; you shouldsend me one! It's the best way to reach me, and I'm always happy to hear from you.Twitter:@theshawwnPatreon:https://www.patreon.com/shawwnHN:sillysaurusxWebsite:shawwn.com