Saravanan666/pypi-org huggingface dataset:
Package: correction-helper
Correction HelperProjectThis is just a set of tools to help writing correction bots in Python for Python.It is used forhackinscience, but could
be used elsewhere.Security considerationsRunning student code is probably really unsafe, unless you trust your
students not to drop you a backdoor.This projet doesnothelp with security in any ways, maybe take a
look atfirejailif you have
trust issues (Yes you can usecorrection-helperinsidefirejail).UsageTo install it, run:pip install correction-helper.In your checking code, you can use it like this:Thestudent_codedecoratorThis decorator is aimed to catch most problems that could happen in
student code, use it simply as:withstudent_code():their_function()Find a more complete example in theexamples/directory.Allowed parameters forstudent_code, and their default valuesexception_prefix="I got an exception:"Printed right before the exception, if any.It's allowed to give a list of strings, in which case they'll be
separated by"\n\n", useful to render markdown paragraphs.print_prefix="Your code printed:"Message to display before the student prints (in caseprint_allowedisFalseorNone).It's allowed to give a list of strings, in which case they'll be
separated by"\n\n", useful to render markdown paragraphs.too_slow_message="Your program looks too slow, looks like an infinite loop."Message to display in case the code runs slower than the giventimeout(defaults to 1s).It's allowed to give a list of strings, in which case they'll be
separated by"\n\n", useful to render markdown paragraphs.prefix=()A prefix forprint_prefix,exception_prefix, andtoo_slow_message=, usefull to deduplicate strings, like:withstudent_code(prefix="While calling blahblah('bar')",print_prefix="it printed:",exception_prefix="it raised:",too_slow_message="it took more than 1s, had to kill it.",):blahblah('bar')friendly=FalseTo use, or notfriendly-tracebackinstead of bare Python exceptions.print_allowed=TrueTo allow or deny the student to print to stdout and stderr.True: Prints are allowed (and displayed).None: Prints are allowed (but not displayed).False: Prints are disallowed (and displayed).In all cases you can read what they printed using the value of the
context manager:withstudent_code(print_allowed=None)asrun:their_function()assertrun.err==""assertrun.out=="42"Good practicesWrite the student checking code a you would write unit test for your
own code.
Package: correctionlib
correctionlibIntroductionThe purpose of this library is to provide a well-structured JSON data format for a
wide variety of ad-hoc correction factors encountered in a typical HEP analysis and
a companion evaluation tool suitable for use in C++ and python programs.
Here we restrict our definition of correction factors to a class of functions with
scalar inputs that produce a scalar output.In python, the function signature is:deff(*args:str|int|float)->float:return...In C++, the evaluator implements this currently as:doubleCorrection::evaluate(conststd::vector<std::variant<int,double,std::string>>&values)const;The supported function classes include:multi-dimensional binned lookups;binned lookups pointing to multi-argument formulas with a restricted
math function set (exp,sqrt, etc.);categorical (string or integer enumeration) maps;input transforms (updating one input value in place); andcompositions of the above.Each function type is represented by a "node" in a call graph and holds all
of its parameters in a JSON structure, described by the JSON schema.
Possible future extension nodes might include weigted sums (which, when composed with
the others, could represent a BDT) and perhaps simple MLPs.The tool should provide:standardized, versionedJSON schemas;forward-porting tools (to migrate data written in older schema versions); anda well-optimized C++ evaluator and python bindings (with numpy vectorization support).This tool will definitely not provide:support forTLorentzVectoror other object-type inputs (such tools should be written
as a higher-level tool depending on this library as a low-level tool)Formula support currently includes a mostly-complete subset of the ROOT libraryTFormulaclass,
and is implemented in a threadsafe standalone manner. The parsing grammar is formally defined
and parsed through the use of a header-onlyPEG parser library.
The supported features mirror CMSSW'sreco::formulaEvaluatorand fully passes the test suite for that utility with the purposeful exception of theTMath::namespace.
The python bindings may be able to call intonumexpr,
though, due to the tree-like structure of the corrections, it may prove difficult to exploit vectorization
at levels other than the entrypoint.Detailed instructions for installing and using this package are provided in thedocumentation.Creating new correctionsA demo/tutorial of the features is available in thedocumentationand also available interactively
onbinderThecorrectionlib.schemav2module provides a helpful framework for defining correction objects
andcorrectionlib.convertincludes select conversion routines for common types. Nodes can be type-checked as they are
constructed using theparse_objclass method or by directly constructing them using keyword arguments.DevelopingSee CONTRIBUTING.md
Package: correctionlib-gradients
correctionlib-gradientsAJAX-friendly, auto-differentiable, Python-only implementation ofcorrectionlibcorrection evaluations.Table of ContentsInstallationUsageSupported types of correctionsKnown limitationsLicenseInstallationpip install correctionlib-gradientsUsageconstruct aCorrectionWithGradientobject from acorrectionlib.schemav2.Correctionthere is no point 2: you can useCorrectionWithGradient.evaluateas a normal JAX-friendly, auto-differentiable functionExampleimportjaximportjax.numpyasjnpfromcorrectionlibimportschemav2fromcorrectionlib_gradientsimportCorrectionWithGradient# given a correctionlib schema:formula_schema=schemav2.Correction(name="x squared",version=2,inputs=[schemav2.Variable(name="x",type="real")],output=schemav2.Variable(name="a scale",type="real"),data=schemav2.Formula(nodetype="formula",expression="x * x",parser="TFormula",variables=["x"],),)# construct a CorrectionWithGradientc=CorrectionWithGradient(formula_schema)# use c.evaluate as a JAX-friendly, auto-differentiable functionvalue,grad=jax.value_and_grad(c.evaluate)(3.0)assertjnp.isclose(value,9.0)assertjnp.isclose(grad,6.0)# for Formula corrections, jax.jit and jax.vmap work tooxs=jnp.array([3.0,4.0])values,grads=jax.vmap(jax.jit(jax.value_and_grad(c.evaluate)))(xs)assertjnp.allclose(values,jnp.array([9.0,16.0]))assertjnp.allclose(grads,jnp.array([6.0,8.0]))Supported types of correctionsCurrently the following corrections fromcorrectionlib.schemav2are supported:Formula, including parametrical formulasBinningwith uniform or non-uniform bin edges andflow="clamp"; bin contents can be either:all scalar valuesallFormulaorFormulaRefscalar constantsKnown limitationsOnly the evaluation ofFormulacorrections is fully JAX traceable.For other corrections, e.g.Binning, gradients can be computed (jax.gradworks) but as JAX cannot
trace the computation utilities such asjax.jitandjax.vmapwill not work.np.vectorizecan be used as an alternative tojax.vmapin these cases.Licensecorrectionlib-gradientsis distributed under the terms of theBSD 3-Clauselicense.
Package: corrections
An extendable Python based Twitter bot which will reply to various keyworded tweets.“Isn’t this against the ToS?”, I hear you ask. Well, sort of, but sort of not. Yes, it might be covered by thespammingorunsolicited mentionsrules, but in my opinion, no more than some asshole going around correcting people manually, depending on your settings.Example usageHere’s my favourite use of the Corrections bot (and why I actually wrote this): thea lotcorrection bot:# -*- coding: utf-8 -*-fromcorrectionsimportCorrectfromrandomimportchoiceclassAlot(Correct):auth=(OAUTH_TOKEN,OAUTH_SECRET,CONSUMER_KEY,CONSUMER_SECRET)phrases=["alot"]cooldown=(60*5,60*3)defreply(self,phrase,user):returnchoice(["@{user}: a lot*","@{user}: Surely you mean 'a lot', right?","@{user}: I think you meant 'a lot'!","@{user}: Come on, use 'a lot', lazy..","@{user}: Alot is sad you can't use 'a lot' right..","@{user}: There should be a space in there somewhere.. 'a lot'*",]).format(user=user)if__name__=="__main__":correct=Alot()correct()Just for testingWant to make sure your bot is functional but don’t want to start spamming tweets yet?
Easy! Setdry = Truein your Corrections class and Corrections won’t actually update your status.classAlot(Correct):auth=(OAUTH_TOKEN,OAUTH_SECRET,CONSUMER_KEY,CONSUMER_SECRET)phrases=[...]cooldown=(...)dry=Truedefreply(...):# ...
Package: corregraphe
corregrapheCorrelation graphs are a great way to visualize and understand the relationship between features of tabular datasets.This package leverages NetworkX, Scipy and HoloViews to easily draw correlation graphs on any Pandas DataFrame.Works on numerical columns only for now.InstallationThis project uses Python >= 3.6.pip install corregrapheUsageExample on the Titanic dataset:importpandasaspdfromcorregrapheimportCorrelationGraphdf=pd.read_csv("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/titanic.csv")cg=CorrelationGraph(df)cg.draw()Drawing gives this Bokeh figure:Developer's guidechecked withmypyandflake8formatted withblackandisortbasic functionality is tested withdoctestby runningpython corregraphe/core.pyLicenseThis project is licensed under the MIT License.MIT LicenseCopyright (c) 2019 Théo DelecourPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: correios
A client library for Brazilian Correios APIs (SIGEP and SRO) and services.Installation$ pip install correios  # basic model support
$ pip install correios[pdf]  # label and posting list pdf generation support
$ pip install correios[api]  # support for SIGEP/SRO API client
$ pip install correios[pdf,api]  # full installationUpdate Local WSDL FilesLocal WSDL files are used to increase performance on SOAP requests. Enventually
you’ll want to update them without having to update this lib.If you want to maintain this files on a custom path you can pass the ‘path’
option with the custom path. Don’t use relative paths.Just run on shell$ update-correios-wsdl -p /path/to/your/custom/wsdl/folderArguments:
-p, –path : Custom path where wsdl files will be saved, note that this option
will have higher priority than the value of the envvar ‘CORREIOS_WSDL_PATH’Or you can use the method update_wsdl to do it.from correios.update_wsdl import update_wsdl

update_wsdl(path='/path/to/your/custom/wsdl/folder')ContributingFork this repository, make changes and send us a pull request. We will review
your changes and apply them. Before sending us your pull request please check
if you wrote and ran tests:$ make testAlso, remember to update the WSDL files:$ make update-wsdl
Package: correios_lib
# Correios Webservice Lib
[![Build Status](https://travis-ci.org/trocafone/correios-lib.svg?branch=master)](https://travis-ci.org/trocafone/correios-lib)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/trocafone/correios-lib/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/trocafone/correios-lib/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/trocafone/correios-lib/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/trocafone/correios-lib/?branch=master)
[![License](https://img.shields.io/badge/licence-MIT-blue.svg)]()An easy to use and well tested library to use correios webservices.## Inplemented methodsThis project was developed mainly to for reversal logistics, but feel free to colaborate with any improvement you need, the implemented methods are:#### Logística Reversa ([DOCS](https://github.com/trocafone/correios-lib/blob/master/manuals/Manualde Implementacao do Web Service Logistica Reversa _12_05_2016_Final.pdf)):[x] solicitarPostagemReversa[x] acompanharPedido[x] acompanharPedidoPorData[x] cancelarPedido[x] calcularDigitoVerificador[x] solicitarPostagemSimultanea[x] solicitarRange## RoadmapCheck out the next webservices to be implemented at our [wiki page]()## ContributingYou can find more about it at the [wiki]()## Thanks to …This project was possible thanks to  these really helpfull projects:[Python Zeep](http://docs.python-zeep.org/en/latest/)[Certifi](https://certifi.io/en/latest/)[voluptuous](https://github.com/alecthomas/voluptuous)[Brazilnum](https://github.com/poliquin/brazilnum)
Package: correios-utils
Correios Python 🚚correios-utils- Biblioteca para a realização de cotação de frete de encomendas no serviço dos CorreiosInstalação 📦pipinstallcorreios-utilsExemplo de uso 📚fromcorreios_utilsimport(Cotacao,FormatoEncomenda,SimNao,Servico,realizar_cotacao,get_descricao_servico,)if__name__=='__main__':servicos=realizar_cotacao(cep_origem="70002900",cep_destino="04547000",codigos_servicos=[Servico.PAC,Servico.SEDEX,Servico.SEDEX_10],peso=1,comprimento=20,altura=20,largura=20,diametro=0,formato_encomenda=FormatoEncomenda.CAIXA_PACOTE,valor_declarado=0,mao_propria=SimNao.NAO,aviso_recebimento=SimNao.NAO,codigo_empresa="08082650",senha_empresa="564321",)forservicoinservicos:ifnotservico.erro:print(f"Correios{get_descricao_servico(servico.codigo)}")print(f"Valor: R${servico.valor}")print(f"Prazo:{servico.prazo_entrega}dias","\n")Saída 📋Correios PAC
Valor: R$ 27.8
Prazo: 7 dias 

Correios SEDEX
Valor: R$ 53.1
Prazo: 1 dias
Package: correlacao
correlacaoDescription.
The package correlacao is used to:- Plot correlations between variable and target.
- The methods used are: Spearman e Pearson.InstallationUse the package managerpipto install correlacaopipinstallcorrelacaoUsage:- The module spearman_pearson receive with entry a DataFrame with variables and a Serie as target.
- Ex: ''' from correlacao import spearman_pearson as sp

          sp.start(DataFrame, Target)  '''AuthorNicodemos FreitasLicenseMIT
Package: correlade
Pearson correlation only really detects linear relationships. Distance Correlation is a better measure, detecting more varied dependency relationships between variables.This package aims to give a one-liner that’ll be super useful for preliminary data analysis. A matrix of pairwise distance correlations and also a heatmap of these reults.Because this correlation measure is more computationally expensive, if you feed it more than 2000 observations it will randomly select 2000 rows on which to base the calculation.
Package: correlation
correlationCalculate confidence intervals for correlation coefficients, including Pearson's R, Kendall's tau, Spearman's rho, and customized correlation measures.MethodologyTwo approaches are offered to calculate the confidence intervals, one parametric approach based on normal approximation, and one non-parametric approach based on bootstrapping.Parametric ApproachSay r_hat is the correlation we obtained, then with a transformationz = ln((1+r)/(1-r))/2,z would approximately follow a normal distribution,with a mean equals to z(r_hat),and a variance sigma^2 that equals to 1/(n-3), 0.437/(n-4), (1+r_hat^2/2)/(n-3) for the Pearson's r, Kendall's tau, and Spearman's rho, respectively (read Ref. [1, 2] for more details). n is the array length.The (1-alpha) CI for r would be(T(z_lower), T(z_upper))where T is the inverse of the transformation mentioned earlierT(x) = (exp(2x) - 1) / (exp(2x) + 1),z_lower = z - z_(1-alpha/2) sigma,z_upper = z + z_(1-alpha/2) sigma.This normal approximation works when the absolute values of the Pearson's r, Kendall's tau, and Spearman's rho are less than 1, 0.8, and 0.95, respectively.Nonparametric ApproachFor the nonparametric approach, we simply adopt a naive bootstrap method.We sample a pair (x_i, y_i) with replacement from the original (paired) samples until we have a sample size that equals to n, and calculate a correlation coefficient from the new samples.Repeat this process for a large number of times (by default we use 5000),then we could obtain the (1-alpha) CI for r by taking the alpha/2 and (1-alpha/2) quantiles of the obtained correlation coefficients.References[1] Bonett, Douglas G., and Thomas A. Wright. "Sample size requirements for estimating Pearson, Kendall and Spearman correlations." Psychometrika 65, no. 1 (2000): 23-28.[2] Bishara, Anthony J., and James B. Hittner. "Confidence intervals for correlations when data are not normal." Behavior research methods 49, no. 1 (2017): 294-309.Installation:pip install correlationorconda install -c wangxiangwen correlationExample Usage:>>>importcorrelation>>>a,b=list(range(2000)),list(range(200,0,-1))*10>>>correlation.corr(a,b,method='spearman_rho')(-0.0999987624920335,# correlation coefficient-0.14330929583811683,# lower endpoint of CI-0.056305939127336606,# upper endpoint of CI7.446171861744971e-06)# p-value
Package: correlationHistogramAnalysis
CorrelationHistogramFor in-depth analysis of correlation histograms in atom probe tomography.A unique advantage of straight flight path atom probes is the rich information in correlation histograms of the collected data. The APT datasets contain information regarding the number of ion hits detected in each pulsing window, referred to as multiplicity.For correlation histograms, we focus on events with a multiplicity greater than 1. We preprocess the data to arrange multiple hits with a value greater than two, creating all possible sorted pairs of mass-to-charge values. So, a multiplicity value of 3, corresponding to a detection of triplet $(m_1, m_2, m_3)$ in a pulsing window is processed to 3 sorted pairs { $(m_1, m_2)$, $(m_2, m_3)$, $(m_1, m_3)$ } such that the first mass-to-charge value is always smaller than its partner. The resulting mass-to-charge pairs are plotted on a 2D histogram containing two mass-to-charge axes. As discussed by Saxey, molecular dissociation often leaves a track on the correlation histogram, allowing us to investigate the type of reactions occurring in the analysis of each oxide.InstallationInstall the latest verion usingpip install correlationHistogramAnalysis==0.2.1
Package: correlation-integral
Calculates the correlation integral. Does not take self-distance into account.
Memory complexity islen(data)*len(Rs). Calculations are done with single
precision floating point data, and the theoretical maximum data length is3.037.000.499points divided by the number of Rs that you want to calculateUsageTo import the library run:importcorrelation_integralasciThree methods can be usedci.euclideanci.manhattanci.chebyshevAll three methods take the following arguments:data: one-dimensional float32 numpy array with the datadims: integer specifying the dimension for which to calculate the correlation integralr: one-dimensional float32 numpy array with the distances to calculate the correlation integral forAnd they return the following output:cd: one-dimensional float32 numpy array which contains the correlation-integral for eachrgiven in the inputThe signature looks like this:cd=ci.euclidean(data,dims,r)Installationpipinstallcorrelation-integralExampleimportcorrelation_integralasciimportnumpyasnpimportmatplotlib.pyplotasplt# example Henon map - create & plot dataa=1.4;b=0.3;x=np.zeros(shape=(10000+5000),dtype=np.float32)y=np.zeros(shape=(10000+5000),dtype=np.float32)x[0]=1y[0]=0foriinrange(1,len(x)-1):x[i+1]=1-a*x[i]**2+y[i]y[i+1]=b*x[i]x=x[5000:]y=y[5000:]# correlation integral analysis done only with x-variablenrsteps=10;dims=np.arange(1,16)# calculate for d=1 uptil d=16nrdims=dims.size;rs=np.logspace(-2.5,0.5,nrsteps)Cds=np.zeros((nrsteps,nrdims));print("Start")forjinrange(nrdims):Cds[:,j]=ci.chebyshev(x,dims[j],rs)print("x",end="")print("\nDONE!")# Plot the resultsforiinrange(len(dims)):plt.plot(rs,Cds[:,i])plt.xscale("log")plt.yscale("log")plt.show()
Package: correlation-kit
Correlation KitA toolkit for estimating the correlation values between variablesInstallationpip install correlation-kitCorrelation between two continual variablesimportpandasaspdfromcorrelation_kit.ck_wrapperimportCorrelationKit# set a dataframe or read from a csv filed={'x':[1,2,3.5,4],'y':[3,4,4.5,6]}df=pd.DataFrame(data=d)# set x label and y label for correlationx="x"y="y"# calcdefget_correlation(x,y,corr_type):stat=0p=0ifcorr_type=="pearson":stat,p=CorrelationKit(df).get_pearson(x,y)elifcorr_type=="spearman":stat,p=CorrelationKit(df).get_spearman(x,y)elifcorr_type=="kendalltau":stat,p=CorrelationKit(df).get_kendalltau(x,y)returnstat,p# print resultsprint("pearson = ",get_correlation(x,y,"pearson"))print("spearman = ",get_correlation(x,y,"spearman"))print("kendalltau = ",get_correlation(x,y,"kendalltau"))Estimate correlation between binary and continual variablesimportpandasaspdfromcorrelation_kit.ck_wrapperimportCorrelationKit# set a dataframe or read from a csv filed={'x':['large','large','small','small'],'y':['hot','hot','cold','cold'],'z':[0,1,2.5,3]}df=pd.DataFrame(data=d)# set x label and y label for correlation, which is suitable for binary variablesr_p,r_s,r_k=CorrelationKit(df).get_corr_between_category_and_continual('x','large','z')# large=1; otherewise 0# resultsprint('pearson: ',r_p)print('speraman: ',r_s)print('kendalltau: ',r_k)Estimate F value between multiple-category variable and continual variablesimportpandasaspdfromck_wrapperimportCorrelationKit# set a dataframe or read from a csv filed={'x':['large','large','middle','small','small'],'y':['hot','hot','warm','cold','cold'],'z':[0,1,2,2.5,3]}df=pd.DataFrame(data=d)# set x label and y label for correlation, which is suitable for multiple-category variablesF,p=CorrelationKit(df).get_f_oneway('x',['large','middle','small'],'z')# resultsprint('F: ',F)print('p: ',p)LicenseTheCorrelation-Kitproject is provided byDonghua Chen.
Package: correlation-pearson
Pearson product-moment correlation coefficient. About algorithmhttps://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficientInstallpipinstallcorrelation-pearsonExamplefromcorrelation_pearson.codeimportCorrelationPearsondmitry=[1,2,3,5,7,8]joseph=[1,3,4,5,7,9]correlation=CorrelationPearson()printcorrelation.result(dmitry,joseph)0.981460802132