Saravanan666/pypi-org huggingface dataset:
Package: range-ops
ABOUTThis package implementsintrangeandfloatrangeclasses and arangelistclass to manage them.intrangeobjects are similar to standard range objects.
They have the option to beclosedor not.
in addition several methods are overloaded to allow arithmetic operationsa=intrange(1,20)b=intrange(4,8)a-bevaluates to[intrange(1,3,closed=True,group=(1,)), intrange(9,20,closed=True,group=(1,))]b-aevaluates to[]b*a = a*bthe intersection ofaandba-1 =  intrange(0,19,closed=True,group=(1,))thegroupproperty allow otherwise overlapping ranges to be treated as distinct.Theattributesproperty allows other metadata to accompany the range object.
It is however, up to the user to decide how to interpret those attributes after
adding the ranges.Example usageThe following are some sample operationsa: intrange(1,20,closed=True)b: intrange(4,8,closed=True)c: intrange(2,8,closed=True)d: intrange(2,8,closed=False)e: intrange(7,40,closed=True)a-b: [intrange(1,3,closed=True,group=(1,)), intrange(9,20,closed=True,group=(1,))]1 in a: True8 in b: True12 in b: Falsea + b: [intrange(1,20,closed=True,group=(1,))]b + a: [intrange(1,20,closed=True,group=(1,))]a - b: [intrange(1,3,closed=True,group=(1,)), intrange(9,20,closed=True,group=(1,))]b - a: []a * b: intrange(4,8,closed=True)b * a: intrange(4,8,closed=True)a // b : [intrange(1,3,closed=True,group=(1,)), intrange(9,20,closed=True,group=(1,))]b // a: []b // 6: [intrange(4,5,closed=True,group=(1,)), intrange(7,8,closed=True,group=(1,))]b - c: []b-d: [intrange(8,8,closed=True,group=(1,))]rangelist((a,e)) : [intrange(1,20,closed=True,group=(1,)), intrange(7,40,closed=True,group=(1,))]
Package: range-regex
Python numeric range regular expression generator=========================Another like packages generates incorrect or excessive patterns.Installation=========================::pip install range-regexor::git clone git://github.com/dimka665/range-regex.gitUsage=========================::from range_regex import regex_for_rangefrom range_regex import bounded_regex_for_rangeregex_for_range(12, 34)bounded_regex_for_range(12, 34)generates"1[2-9]|2\d|3[0-4]""\b(1[2-9]|2\d|3[0-4])\b"
Package: rangeset
OverviewRangeset is a package that allows for easy manipulation of sets of
ranges. These ranges can contain any ordered elements, be they numbers,
tuples, or even datetime objects.InstallationUse either:python setup.py installor:pip install rangesetDocumentationSeehttps://github.com/axiak/py-rangesetBasic Usageimportrangeset# Create a rangeset>>>r=RangeSet(1,3)|(5,6)# negate>>>(~r)&(0,10)<RangeSet0--1,3--5,6--10># "measure" - How much distance is in the ranges, minus the gaps>>>((~r)&(0,10)).measure()7# range - Total distance between start and end>>>((~r)&(0,10)).range()10For more usage examples, see the doctests athttps://github.com/axiak/py-rangeset/tree/master/python2/rangeset/testLicenseIt’s licensed under the MIT License. Please see the license file for
more:https://github.com/axiak/py-rangeset/blob/master/LICENSE
Package: range-set
License: Your choice of MIT or Apache License 2.0RationalePython Sets are nice to work with, but very inefficient if you need a large
set with mostly-consecutive integers. The RangeSet class provides efficient
handling and storage for these sets.Non-integers?RangeSet works with any class whose instances arecomparablestep-able, i.e. you can add 1 to them / subtract 1 from them.discrete, i.e. there is no value betweennandn+1.RangeSet doesn’t add or subtract any other values, nor does it try to
subtract two instances from each other.The requirement to subtract 1 is an optimization that could be removed if
necessary.
Package: range-typed-integers
This package provides integer types that have a specific range of valid values.UsageThe package provides some types (asNewType) that represent their respectiveRust integer type:u8,u16,u32,u64,i8,i16,i32andi64:from range_typed_integers import u8, i8

# u8 is an unsigned 8-bit integer so its range is 0-255:
a: u8 = 12  # valid
a: u8 = -12  # invalid - The type checker should mark this as an error.
a: u8 = 900  # invalid - The type checker should mark this as an error.The types are defined asNewTypesofValueRangeannotated integers. This is also how
you can define your own custom ranged integer types. As an example this is literally howrange_typed_integers.i8is defined:from typing import Annotated, NewType
from range_typed_integers import ValueRange

i8 = NewType('i8', Annotated[int, ValueRange(-128, 127)])To cast values to typed integers, you can:use the NewType’s constructor:i8(12)Use the “checked constructors”:i8_checked(12).
These will raise aIntegerBoundErrorif the value is out of range (subclass ofOverflowError).use thecastfunction:cast(i8, 12)Runtime checkingYou can use the functioncheck_intto check if an integer fits into any integer type.:>>> from range_typed_integers import check_int, u8
>>>
>>> class A
...     field: u8
...
>>> # You can use this directly with a type.
>>> check_int(u8, 0)
True
>>> check_int(u8, -1)
False
>>> # Or have the function look up the type annotations for an attribute on an object.
>>> check_int((A, 'field'), 0)
True
>>> check_int((A, 'field'), 256)
False
>>> # You can also use this with non-ranged integers (will always return True).
>>> check_int(int, 1234567)
True
>>> # Or even arbitrary types (will always return True and do no type validation).
>>> check_int(str, 1234)
TrueFor ease-of-use the types shipped with this package, also have “checked constructors” (eg.u8_checked),
that will cast a value to their type and raise anIntegerBoundErrorif the value is out of range.MyPy and Python SupportThis is only truly supported in Python 3.9+, due to the lack of theAnnotatedtype in earlier versions.However 3.8 is also supported viatyping_extensions. Note however, that MyPy with Python 3.8 will not acceptAnnotatedas a type to use withNewType.
Package: rangev2
rangev2rangev2 is next version of popular range class of python, which enables you to produce lists even by using *,/,// and % operators along with +,- operators.The syntax is nearly similar to the privious versionsLittle modification is that step (third parametr) is now string containing operand and operatorExample :>>>new_range(8,100,'*9')>>>[8,72]New Features!print(new_range(begin,end,step)) will now print the entire listexample>>>print(new_range(100,1,'//3')>>>[100,33,11,3]the default values for begin and step are 0 and '+1' respectively.in operator is overloaded:>>>3innew_range(4)>>>True.the list generated can also be accessed via list argumentexample :>>>new_range(6).list
>>>[0,1,2,3,4,5]Installationpipinstallrangev2LicenseMITContributeAll ways welcome good contributions, keeping the target to make it core functionality of python
Package: rangify
READMEThis repo contains function that takes cisco config and turns its interface configurations
and makes ranged interfaces as it's much more compact. It compares every interface config block to others and extracts similar ones only. It also shortens the cisco interface names. ex: it printsGigabitEthernet1/0/1asGi1/0/1InstallationRun the following to install:pipinstallrangifyUsagefromrangifyimportrangerranger("cisco_config.txt")# or ranger(interfaces_dict)It can accept 2 types of inputs.Text config from fileLet's saytest_config.txtcontains following text(abbreviated, for full text please check thetest_config.txtfile)!
interface GigabitEthernet1/0/1
 ...any text config block..
!
interface GigabitEthernet1/0/2
 ...any text config block..
!
interface GigabitEthernet1/0/3
 ...any text config block..
!Then following function will print to screen more compact ranged version of configuration:ranger("filename.txt")Output:interface range Gi1/0/1-3
 ...any text config block...Interfaces as dictionary of dictionariesThis takes dictionary of dictionaries as an input. Key for dictionary is interface name and the value is the configuration dictionary.  And returns same dictionary structure but this time the keys are in collapsed/ranged form. Example below.# input dictionarysample_ints={"GigabitEthernet1/0/1":{},"GigabitEthernet1/0/2":{},"GigabitEthernet1/0/4":{"mode":"access"},"GigabitEthernet3/4/2":{"mode":"access"},"GigabitEthernet3/4/3":{"mode":"access"},"GigabitEthernet3/5/3":{"mode":"trunk"},"GigabitEthernet3/6/3":{"mode":"trunk"},}# range them allprint(ranger(interfaces))Output:{'range Gi1/0/1-2':{},'range Gi1/0/4, Gi3/4/2-3':{'mode':'access'},'range Gi3/5/3, Gi3/6/3':{'mode':'trunk'}}
Package: rango
Rango=====Rango is a bit of spice for Django.Why?----I beleive that short and plain imports are better than longnested ones.In Django you should write in your ``views.py``:from django.core.urlresolvers import reversefrom django.shortcuts import get_object_or_404, redirectfrom django.contrib.auth.decorators import login_requiredIn Rango:from rango.urls import reversefrom rango.views import get_object_or_404, login_requiredActually that is experimental project tending to build cleanerAPI for Django.Core features-------------### New ``reverse`` methodIt works like that:from rango.urls import reversereverse('url_name', pk=8)Django ``reverse`` works so:from django.core.urlresolvers import reversereverse('url_name', kwargs={'pk': 8})### Base model classIt has shorcuts for ``all``, ``get``, ``filter`` and ``exclude``methods and some extra magic:from rango import modelsclass MyModel(models.RangoModel):class MyModel(RangoModel):title = models.CharField(max_length=100)is_active = models.BooleanField()@classmethoddef active(cls, _queryset=None):return cls.filter(_queryset, is_active=True)all_objects = MyModel.all()start_with_a = MyModel.filter(title__startswith="a")active_objects = start_with_a.active()**Note!** Now you can define filter methods in model classand chain them in queries. Magic!### Shortcuts ``rango.views``from rango.views import render_to, ajax_request, render_to_response, \render, redirect, get_object_or_404, login_required### Mailing shortcutIf you need to compose E-mail message body from template andsend it you may use a shortcut:from rango.mail import send_templatesend_template(subject='Subject', template='mail.html',recipient_list=[to@example.com],context={})Full method signature:def send_template(subject=None, template=None, recipient_list=[],context={}, from_email=None, **kwargs)### Other shortcuts and stufffrom rango.crypto import random_tokenrandom_token(20)  # creates rangom string# Yes! that's replacement for# from django.conf import settingsfrom rango import settingssettings.has_setting('CUSTOM_SETTINGS')settings.get_setting('CUSTOM_SETTINGS', default='Some value')from rango.utils import safe_upload_tofrom rango import modelsclass MyFile(models.Model):file = models.FileField(upload_to=safe_upload_to('files'))# files will be uploaded to# files/<instance id>/<random>_<filename>Documentation-------------It's not ready yet, I'm working on it.If you're brave, watch in the source :)
Package: rankade.py
Rankade.pyUnofficial Python async wrapper for the Rankade API.Installationpippip3installrankade.pyUsageAccess the Rankade APISelect the group on Rankade you wish to use.From the "Group Manager" screen select "APIs".This should bring you to the "Credentials and status" page.Copy your key.Generate a secret.Sample Projectimportasyncioimportrankadeasyncdefmain():rankade=rankade.Rankade(key="rankade-key",secret="rankade-secret")result=rankade.get_games()print(result)if__name__=='__main__'asyncio.run(main())ExamplesSeeDocumentationorExamplesfor more.DocumentationDocumentation
Package: rank-bm25
Rank-BM25: A two line search engineA collection of algorithms for querying a set of documents and returning the ones most relevant to the query. The most common use case for these algorithms is, as you might have guessed, to create search engines.So far the algorithms that have been implemented are:Okapi BM25BM25LBM25+BM25-AdptBM25TThese algorithms were taken fromthis paper, which gives a nice overview of each method, and also benchmarks them against each other. A nice inclusion is that they compare different kinds of preprocessing like stemming vs no-stemming, stopword removal or not, etc. Great read if you're new to the topic.InstallationThe easiest way to install this package is throughpip, usingpipinstallrank_bm25If you want to be sure you're getting the newest version, you can install it directly from github withpipinstallgit+ssh://git@github.com/dorianbrown/rank_bm25.gitUsageFor this example we'll be using theBM25Okapialgorithm, but the others are used in pretty much the same way.InitalizingFirst thing to do is create an instance of the BM25 class, which reads in a corpus of text and does some indexing on it:fromrank_bm25importBM25Okapicorpus=["Hello there good man!","It is quite windy in London","How is the weather today?"]tokenized_corpus=[doc.split(" ")fordocincorpus]bm25=BM25Okapi(tokenized_corpus)# <rank_bm25.BM25Okapi at 0x1047881d0>Note that this package doesn't do any text preprocessing. If you want to do things like lowercasing, stopword removal, stemming, etc, you need to do it yourself.The only requirements is that the class receives a list of lists of strings, which are the document tokens.Ranking of documentsNow that we've created our document indexes, we can give it queries and see which documents are the most relevant:query="windy London"tokenized_query=query.split(" ")doc_scores=bm25.get_scores(tokenized_query)# array([0.        , 0.93729472, 0.        ])Good to note that we also need to tokenize our query, and apply the same preprocessing steps we did to the documents in order to have an apples-to-apples comparisonInstead of getting the document scores, you can also just retrieve the best documents withbm25.get_top_n(tokenized_query,corpus,n=1)# ['It is quite windy in London']And that's pretty much it!
Package: ranked
FeaturesA common interface for ranking algorithmsElo (Chess & Generic)Glicko2NoSkill (similar to Trueskill, i.e bayesian inference on a bipartite graph)Synthetics benchmarksBasic match makerMatchup replay to calibrate and experiment on real dataModel calibration using black-box optimizer OrionNoteFor team based games; When benchmarking ranking algorithm against real data you have
to keep in mind that the matchmaking algorithm that created the groups
was based on its own external ranking system so any measure
that would come out of such benchmarks would end up being biased.NoteSimilarly, matchmaking or the team building algorithm can impact the performance
of the ranking algorithm. It is up to the matchmaking algorithm to make sure
the teams it builds are as fair as possible.The ranking algorithm only provide an estimate of each player’skill to help
the matchmaker to make the best decision possible.Examplesranker=ChessElo()p1=ranker.new_player((1613-sub)/div)p2=ranker.new_player((1609-sub)/div)m1=Match((p1,0),(p2,1)),# p1 lost (lower score)win_prob=ranker.win(m)ranker.update(m)# P1 lost so its skill got updated downnew_skill=p1.skill()# 1603.19WIPNoSkill2Dota2 extracted matchespipinstallranked
Package: ranker
RankerRankeris a CLI tool that processes results from games and generates a ranking table into stdout.1. Tarantulas, 6 pts
2. Lions, 5 pts
3. FC Awesome, 1 pt
4. Snakes, 1 pt
5. Grouches, 0 ptsThe rulesA draw (tie) is worth 1 point and a win is worth 3 points. A loss is worth 0 points. If two or more teams have the same number of points, they should have the same rank and be printed in alphabetical order (as in the tie for 3rd place in the sample data).Installation & RequirementsRankerhas been tested in Python versions 3.7 - 3.9. It is recomended to have at least Python 3.7 withPIPinstalled.Run the following command:# Install package from PyPI$pipinstallrankerUsageFormatThe input must contain results of games one per line and must have this format:Lions 3, Snakes 3
Tarantulas 1, FC Awesome 0
Lions 1, FC Awesome 1
Tarantulas 3, Snakes 1
Lions 4, Grouches 0File$rankerpath/to/fileRankeraccepts a file path as an optional argument to process the information inside the file and returns the ranking table.Stdin$rankerIf no argument is provided toRanker, it will read the input from stdin and stop when it finds an empty line then returns the result.TestsThe tests can be run from the project root directory using the following command:$python-munittestReferencesThis CLI uses theargparselibrary for command-line parsing, and theunittestframework for testing, both of which come by default in the Pythonstandard librarybeing this the main reason I decided to use them in the project.The project was built usingsetuptools, and distributed to thePython Package Index (PyPI)usingtwine.For a detailed Python Packaging Guide visit:https://packaging.python.org/en/latest/
Package: rankerEval
A fast numpy/numba-based implementation of ranking metrics for information retrieval and recommendation.
Coded with efficiency in mind and support for edge cases.Find the fulldocumentation here.FeaturesWide array of evaluation metrics for information retrieval and top-N recommender systems:Binary labels: Recall, Precision, MAP, HitRate, MRR, MeanRanks, F1Numeric and binary labels: DCG, nDCGMinimal dependencies: Numpy and Numba (required), SciPy (optional)Flexible input formats: Supports arrays, lists and sparse matricesBuilt-in support for confidence intervals via bootstrappingUsagefromrankerevalimportBinaryLabels,Rankings,Recally_true=BinaryLabels.from_positive_indices([[0,2],[0,1,2]])y_pred=Rankings.from_ranked_indices([[2,1],[1]])recall_at_3=Recall(3).mean(y_true,y_pred)print(recall_at_3["score"])To get confidence intervals (95% by default), specifyconf_interval=True:recall_at_3=Recall(3).mean(y_true,y_pred,conf_interval=True)print(recall_at_3["conf_interval"])Input formatsRankerEval allows for a variety of input formats, e.g.,# specify all labels as listsy_true=BinaryLabels.from_dense([[1,0,1],[1,1,1]])# specify labels as numpy arrayy_true=BinaryLabels.from_dense(np.asarray([[1,0,1],[1,1,1]]))# or use a sparse matriximportscipy.sparseasspy_true=BinaryLabels.from_sparse(sp.coo_matrix([[1,0,1],[1,1,1]]))InstallationTo install (requires Numpy 1.18 or newer):pipinstallrankerevalLicenceThis project is licensed underMIT.AuthorsRankerEvalwas written byTobias Schnabel.ContributingThis project welcomes contributions and suggestions.  Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visithttps://cla.opensource.microsoft.com.When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.This project has adopted theMicrosoft Open Source Code of Conduct.
For more information see theCode of Conduct FAQor
contactopencode@microsoft.com <mailto:opencode@microsoft.com>with any additional questions or comments.
Package: rankerNN2pmml
rankerNN2pmmlPython library for converting pairwise Learning-To-Rank Neural Network models (RankNet NN, LambdaRank NN) into pmml.Supported model structureIt supports pairwise Learning-To-Rank (LTR) algorithms such as Ranknet and LambdaRank, where the underlying model (hidden layers) is a neural network (NN) model.Installationpip install rankerNN2pmmlExampleExample on a RankNet model.fromkeras.layersimportActivation,Dense,Input,Subtractfromkeras.modelsimportModelimportrandomimportnumpyasnpimportpandasaspdfromsklearn.preprocessingimportStandardScaler,MinMaxScalerfromrankerNN2pmmlimportrankerNN2pmml# generate dummy data.INPUT_DIM=3X1=2*np.random.uniform(size=(50,INPUT_DIM))X2=np.random.uniform(size=(50,INPUT_DIM))Y=[random.randint(0,1)for_inrange(50)]# data transformationmms=MinMaxScaler()mms.fit(np.concatenate((X1,X2),axis=0))X1=mms.transform(X1)X2=mms.transform(X2)defRankNet_model(input_shape):# Neural network structureh1=Dense(4,activation="relu",name='Relu_layer1')h2=Dense(2,activation='relu',name='Relu_layer2')h3=Dense(1,activation='linear',name='Identity_layer')# document 1 scoreinput1=Input(shape=(input_shape,),name='Input_layer1')x1=h1(input1)x1=h2(x1)x1=h3(x1)# document 2 scoreinput2=Input(shape=(input_shape,),name='Input_layer2')x2=h1(input2)x2=h2(x2)x2=h3(x2)# Subtract layersubtracted=Subtract(name='Subtract_layer')([x1,x2])# sigmoidout=Activation('sigmoid',name='Activation_layer')(subtracted)# build modelmodel=Model(inputs=[input1,input2],outputs=out)returnmodel# build modelmodel=RankNet_model(INPUT_DIM)model.compile(optimizer="adam",loss="binary_crossentropy")# train modelmodel.fit([X1,X2],Y,batch_size=10,epochs=5,verbose=1)params={'feature_names':['Feature1','Feature2','Feature3'],'target_name':'score'}rankerNN2pmml(estimator=model,transformer=mms,file='model.pmml',**params)Params explainedestimator: Keras model to be exported as PMML (see supported model structure above).transformer: if provided then scaling is applied to data fields.file: name of the file where PMML will be exported.feature_names: when provided and have same shape as input layer, features will have custom names, otherwise generic names (x0,..., xn-1) will be used.target_name: when provided target variable will have custom name, otherwise generic namescorewill be used.What is supported?Models (estimators)keras.models.Model (see supported model structure above)Activation functionstanhlogistic (sigmoid)identityrectifier (Relu)Transformerssklearn.preprocessing.StandardScalersklearn.preprocessing.MinMaxScaler
Package: rankhub
rankhub - is a Python package to generate GitHub users rankingsIntroductionThis project is intended to be a Python package in order to retrieve data from GitHub using
its public API with an application token. Currently, as this project is under-development,
a simple use-case is proposed in order to retrieve data from Salamanca (Spain) GitHub users
as to generate a ranking with the most active users in public repositories throughout 2019.Top GitHub Users from Salamanca (Spain) sorted by Public Contributions throughout 2019As already mentioned, this ranking contains all the GitHub users from Salamanca sorted by the
amount of public contributions just between 01/01/2019 until the current date 21/09/2019.RankUserAvatarPublic ContributionsMost Used LanguageUsed Languages1Emirodgar2187HTMLHTML, JavaScript, CSS2tomhendra851JavaScriptJavaScript, CSS, HTML3cbjuan360PythonJavaScript, HTML, Jupyter Notebook, Python, Shell4alvarob96293Jupyter NotebookJupyter Notebook, Python5JParzival216Jupyter NotebookJavaScript, Python, Jupyter Notebook, Java, TypeScript, R, PHP, HTMLThis is just the leading Top 5 GitHub users from the generated ranking, so the complete ranking
can be found insalamanca/in both
JSON and Markdown format.Note that both the ranking and the package will be updated in order to create a 2019 ranking resume
at the end of the year! So make sure to watch and star the repo in order to get tuned for updates!ContributeAs this is an open source project it is open to contributions, bug reports, bug fixes, documentation improvements,
enhancements and ideas.Also there is an open tab ofissueswhere anyone can contribute opening
new issues if needed or navigate through them in order to solve them or contribute to its solving.DisclaimerThis project is made with research purposes only, so to create a Python package to make it
usable with Python in order to retrieve GitHub stats that can further be used for data analysis.As the use case is just an approach, note that it can have somer errors related to data retrieval
from GitHub. Also the generated ranking has no intention of generating any kind of competition
between the involved people in the generated ranking/s.
Package: ranking
This library providesRankingiterator to assign rank to each values and
variousstrategies for assigning rankings.>>> sorted_scores = [100, 90, 90, 80, 70]
>>> for rank, score in Ranking(sorted_scores):
...     print '%d. %d' % (rank + 1, score)
1. 100
2. 90
2. 90
4. 80
5. 70
>>> for rank, score in Ranking(sorted_scores, DENSE):
...     print '%d. %d' % (rank + 1, score)
1. 100
2. 90
2. 90
3. 80
4. 70LinksGitHub repositorydevelopment version