Saravanan666/pypi-org huggingface dataset:
Package: paired
pairedPaired is a Python package for pairwise alignment of arbitrary sequences.Python has lots of great packages for sequence alignment and warping, but mostly for biological or numerical data. Paired performs global alignment on lists of arbitrary Python objects, and lets you define how element pairs are matched and scored.Basic usageimportpairedseq_1='The quick brown fox jumped over the lazy dog'.split(' ')seq_2='The brown fox leaped over the lazy dog'.split(' ')alignment=paired.align(seq_1,seq_2)print(alignment)# [(0, 0), (1, None), (2, 1), (3, 2), (4, 3), (5, 4), (6, 5), (7, 6), (8, 7)]fori_1,i_2inalignment:print((seq_1[i_1]ifi_1isnotNoneelse'').ljust(15),end='')print(seq_2[i_2]ifi_2isnotNoneelse'')# The            The# quick# brown          brown# fox            fox# jumped         leaped# over           over# the            the# lazy           lazy# dog            dogCustom scoresPaired uses theNeedleman-Wunsch algorithm.  The scoring for the different operations (match, mismatch, gap) can be specified:alignment=paired.align(seq_1,seq_2,match_score=5,mismatch_score=-1,gap_score=-5)Custom similarityBy default, two elements are said to match ifelement_1 == element_2. Paired also allows you to pass a function to return a match/mismatch score for a given pair of elements. For example, you could give different scores to case-sensitive and case-insensitive matches of strings:defscorer(a,b):ifa==b:return2elifa.lower()==b.lower():return1else:return-1alignment=paired.align(seq_1,seq_2,scorer=scorer,gap_score=-3)InstallationPaired is onPyPiand can be installed with pip. It has no dependencies.pipinstallpairedAPIpairwise.align(x, y, match_score=1, mismatch_score=-1, gap_score=-1, scorer=None)Get the global alignment of two sequences.Arguments:x,y(list): Sequences of objects to align.match_score(numeric): Score when matching elements are paired.mismatch_score(numeric): Score when mismatching elements are paired.gap_score(numeric): Score for an insertion/deletion, when an element is paired with no other element.scorer(callable): Function that takes two elements as inputs, and returns a numerical score based on how well they match.  IfNoneis passed, the default function used is equivalent tolamdba a, b: match_score if a==b else mismatch_score.Returns:alignment(list of tuples): The aligned sequence, as a list of pairs of indices intoxandyrespectively.  A gap is represented byNoneinstead of an integer index.
Package: pairef
Automatic PAIRed REFinement protocolPAIREFis a tool for macromolecular crystallographers that performs thePAIRed REFinement protocol[1]automatically to estimate the optimal high-resolution cutoff. It is developed in Python and can be installed as a module into theComputational Crystallography Toolbox. It provides graphical and command-line interface that executes all the needed calculations. Parameters of refinement can be specified in detail to put all the calculations under full control of the user. Obtained results are presented as plots and tables in HTML log file.PAIREFsupportsREFMAC5(part of theCCP4 Software Suite) andphenix.refine(part of thePHENIX) for structure model refinement.[1]P.A. Karplus, K. Diederichs: “Linking crystallographic model and data quality.” (2012) Science, 336(6084):1030-3.Installation and system requirementsPAIREFdepends on theCCP4 Software SuiteorPHENIX. Both contain theComputational Crystallography Toolboxwith Python andpip).PAIREFworks with both Python 2 and Python 3.PAIREFcan be easily installed running commandcctbx.python -m pip install pairef --user --no-depsin terminal (GNU/Linux, macOS) or CCP4Console (Windows). More information are available indocumentation. Check also thePAIREFhomepage athttps://pairef.fjfi.cvut.cz/andPyPI repository.ExampleTo run paired refinement of a model (previously refined at 1.81 Å) for a series of cutoffs (1.7, 1.6, and 1.5 Å), execute a following command:cctbx.python -m pairef --XYZIN model_1-81A.pdb --HKLIN data_1-5A.mtz --HKLIN_UNMERGED data_1-5A_unmerged.mtz -i 1.81 -r 1.7,1.6,1.5For detailed information about other program parameters, read the documentation available athttp://pairef.fjfi.cvut.cz/docs.Credits and contactPlease refer: M. Maly, K. Diederichs, J. Dohnalek, P. Kolenko:Paired refinement under the control of PAIREF(2020)IUCrJ7PAIREFis developed by Martin Malý in collaboration of Czech Technical University, Czech Academy of Sciences, and University of Konstanz. In case of any questions or problems, please do not hesitate and write us:martin.maly@fjfi.cvut.cz.
Package: pai-repl
pai: A Python REPL with a built in AI agent.It's like OpenAI's Code Interpreter running in your Python REPL.A fully functional Python REPL with a built in AI agent that can generate and run code using the history as context.FeaturesFull Python REPLBuilt-in AI agent that can generate and run code in the REPLREPL history is used for LLM context.Edit and approve all generated code before it is executedRuns locally on your machine, so it has full system and internet accessSupports OpenAI and llama.cppDemoInstallationpip install pai-replUsageOpenAI modelsThe default model is OpenAI GPT-4. You will need to set your OpenAI API key.$ export OPENAI_API_KEY=<your key>
$ paiSpecify OpenAI model$ pai --openai gpt-3.5-turbollama.cpp compatible modelsllama-cpp-pythonis an optional dependency because it requires native libraries to be installed so it must be installed using thellamaextra.$ pip install pai-repl[llama]
$ pai --llama <path to model>Starting the REPLWhen you invokepai, it will start an interactive Python REPL.$ pai
INP> print('howdy')
OUT> howdyStart the agentStart the agent withpai: <prompt>.This will generate code using the prompt and REPL history. You can accept, edit or cancel the code. Immediately after the generated code is run, the LLM is called again with the new REPL history. This loop continues until the task is complete or you cancel the agent withCtrl+C.INP> pai: list files in the current directory
LLM>
import os
os.listdir()

OK?> import os
    ...> os.listdir()One off code generationGenerate code withgen: <prompt>.The generated code will be displayed and you can accept, edit or cancel it. Unlike thepaicommand, the LLM is not called again after the code is run.INP> nums = [1,2,3]
INP> gen: average nums
LLM>
# to find the average of the numbers, we sum all the elements and then divide by the number of elements

average_nums = sum(nums) / len(nums)
average_nums

OK?> # to find the average of the numbers, we sum all the elements and then
    ...> divide by the number of elements
    ...>
    ...> average_nums = sum(nums) / len(nums)
    ...> average_nums
OUT> 2.0
INP>REPL featuresreset()will reset the REPL state and history. This is useful if you want to start a new task or want to start over. No previous history will be used for LLM context.INP> a = 1
INP> reset()
INP> a
OUT> Traceback (most recent call last):
  File "<console>", line 1, in <module>
NameError: name 'a' is not defined
INP>Run shell commands with!INP> !ls
OUT> README.md
     assets
     setup.py
     ...Quickstart from the command lineYou can prompt pai from the command line$ pai "find the largest file in the current directory"
Package: pairing-functions
pairing-functionsA pairing function is a function thatreversiblymaps two non-negative integers onto a single non-negative integer.This package currently supports the following pairing functions:Szudzik pairing functionCantor pairing functionInstallSimply:$pipinstallpairing-functionsUsagefrompairing_functionsimportcantor,szudzikszudzik.pair(3,4)//19szudzik.unpair(19)//(3,4)cantor.pair(3,4)//32cantor.unpair(32)//(3,4)You can also work with more than 2 integers:frompairing_functionsimportcantor,szudzikszudzik.pair(1,2,3,4)//1126cantor.pair(1,2,3,4)//2705# by default, unpairing will result in two integersszudzik.unpair(1126)//(33,4)cantor.unpair(2705)//(69,4)# but going back to the initial integers is also possible# just specify how many integers you expectszudzik.unpair(1126,n=4)//(1,2,3,4)cantor.unpair(2705,n=4)//(1,2,3,4)DocumentationYou can find more about pairing functions in thedocs.How to contributeIf you wish to contribute, you can start fromhere!TestYou can run the available tests withpytest- code coverage metrics are also available viapytest-cov.
Package: pairinteraction
Pairinteraction - A Rydberg Interaction CalculatorThepairinteractionsoftware calculates properties of Rydberg systems. Visit the official website athttps://pairinteraction.github.io/for documentation and tutorials.
Binary builds are available throughGitHub Releases.For using pairinteraction as a Python 3 library, we recommend the installation via pip by callingpip install pairinteraction. If pairinteraction was installed from the command line, the graphical user interface can be started by executingstart_pairinteraction_gui.Please cite usSebastian Weber, Christoph Tresp, Henri Menke, Alban Urvoy, Ofer Firstenberg, Hans Peter Büchler, Sebastian Hofferberth,Tutorial: Calculation of Rydberg interaction potentials,J. Phys. B: At. Mol. Opt. Phys. 50, 133001 (2017),arXiv:1612.08053LicenseThe pairinteraction library is licensed under theLGPL v3. The extension for calculating
radial wave functions using Whittaker functions and the graphical user interface are licensed under theGPL v3.
The GPL v3 also applies to the combined work and all provided binary builds.
Package: pairlist
pairlistGenerates the pair list of atoms that are closer to each other than the
given threshold under the periodic boundary conditions.version 0.5.1.1UsageSeepairlist.hfor the function definition andpairlist-test.cfor usage.Python API is served in pairlist.py. The API document ishere.To find the neighbors in a face-centered cubic lattice of size 10x10x10 on a MacBook Air 2021 (Apple Silicon),$pythonbenchmark.py
INFOcrude:Neighboringpairlistbyacrudedoubleloop.
INFOcrude:18024ms
INFOcrude:end.24000pairs
INFOnumpyish:Neighboringpairlistbynumpyfancyarray.
INFOnumpyish:741ms
INFOnumpyish:end.24000.0pairs
INFOpairlist_py:Neighboringpairlistbypairlistinpurepython.
INFOpairlist_py:125ms
INFOpairlist_py:end.24000pairs
INFOpairlist_c:Neighboringpairlistbypairlistinc.
INFOpairlist_c:end.
INFOpairlist_c:16ms24000pairsimportpairlistasplfromfccimportFaceCenteredCubicfromloggingimportgetLogger,basicConfig,INFO,DEBUGfromdecoratorimporttimeit,bannerimportnumpyasnpfrompairlistimportpairs_py,pairs2_pybasicConfig(level=INFO,format="%(levelname)s%(message)s")logger=getLogger()logger.debug("Debug mode.")@banner@timeitdefcrude(lattice,cell,rc=1.1):"Neighboring pair list by a crude double loop."rc2=rc**2count=0foriinrange(len(lattice)):forjinrange(i):d=lattice[i]-lattice[j]d-=np.floor(d+0.5)d=d@cellifd@d<rc2:count+=1returncount@banner@timeitdefnumpyish(lattice,cell,rc=1.1):"Neighboring pair list by numpy fancy array."# cross-differencesM=lattice[:,None,:]-lattice[None,:,:]# wrapM-=np.floor(M+0.5)# in absolute coordinateM=M@celld=(M*M).sum(2)returnd[(d<rc**2)&(0<d)].shape[0]/2@banner@timeitdefpairlist_py(lattice,cell,rc=1.1):"Neighboring pair list by pairlist in pure python."count=0fori,j,dinpl.pairs_iter(lattice,maxdist=rc,cell=cell,_engine=(pairs_py,pairs2_py)):count+=1returncount@timeit@bannerdefpairlist_c(lattice,cell,rc=1.1):"Neighboring pair list by pairlist in c."count=0fori,j,dinpl.pairs_iter(lattice,maxdist=rc,cell=cell):count+=1returncountlattice,cell=FaceCenteredCubic(10)print(crude(lattice,cell),"pairs")print(numpyish(lattice,cell),"pairs")print(pairlist_py(lattice,cell),"pairs")print(pairlist_c(lattice,cell),"pairs")AlgorithmA simple cell division algorithm is implemented.DemoIt requiresGenIceto make the test data.%maketestRequirementspythonnumpyBugs
Package: pairplotr
<img src="https://github.com/JaggedParadigm/pairplotr/blob/master/pairplot_demo.png" width="500" /># How## InstallationUse:pip install pairplotr## UseSee the [demo](https://nbviewer.jupyter.org/github/JaggedParadigm/pairplotr/blob/master/pairplotr_demo.ipynb) for use of pairplotr.# WhatPairplotr is a Python library used to graph combinations of numerical and categorical data in a pair plot,similar to Seaborn's pairplot(), given a cleaned Pandas dataframe with a mixture of categorical and numericalvalues.Here are the formats for Row feature|Column feature combinations in either on- or off-diagonal cells:- On-diagonal:- Categorical|Categorical:- Value counts of feature values ordered by ascending value count and colored by feature values- Numerical|Numerical:- Histogram of feature w/ no coloring (or by desired label)- Off-diagonal:- Categorical|Categorical:- Stacked value count of row feature values colored by column feature values- Categorical|Numerical:- Histograms of column feature for each row feature value colored by row feature value- Numerical|Numerical:- Scatter plot of row feature values vs column feature values w/ no coloring (or by desired label)# WhyThe available tools I've found don't seem to be able to combine numerical and categorical feature datain a quick and easy way and I wanted to customize the comparisons as the plot types I find most useful.
Package: pairsnp
pairsnp-pythonInstallationThis is a Python3 version of pairsnp written with the help of Simon Frostgit clone https://github.com/gtonkinhill/pairsnp-python
cd pairsnp-python
pip3 install .Quick StartThe python version can be run from the python interpreter asfrom pairsnp import calculate_snp_matrix, calculate_distance_matrix

sparse_matrix, consensus, seq_names = calculate_snp_matrix(fasta.file.name)
d = calculate_distance_matrix(sparse_matrix, consensus, "dist", False)alternatively if installed using pip it can be used at the command line aspairsnp -f /path/to/msa.fasta -o /path/to/output.csvadditional options includeProgram to calculate pairwise SNP distance and similarity matrices.

optional arguments:
  -h, --help            show this help message and exit
  -t {sim,dist}, --type {sim,dist}
                        either sim (similarity) or dist (distance) (default).
  -n, --inc_n           flag to indicate differences to gaps should be
                        counted.
  -f FILENAME, --file FILENAME
                        location of a multiple sequence alignment. Currently
                        only DNA alignments are supported.
  -z, --zipped          Alignment is gzipped.
  -c, --csv             Output csv-delimited table (default tsv).
  -o OUTPUT, --out OUTPUT
                        location of output file.
Package: pairwiseAlignment
Using Python to implement Needleman Wunsch and Smith Waterman algorithmsIntroductionYuque BlogInstall$pipinstallpairwiseAlignmentHelpUsage: pairwiseAlignment [OPTIONS]  

  Using Python to implement Needleman Wunsch and Smith Waterman algorithms
  for pairwise sequence alignment

Options:
  -1, --seq1 TEXT        The first sequence.
  -2, --seq2 TEXT        The second sequence.
  -m, --match FLOAT      The match score.  [default: 1.0]
  -d, --mismatch FLOAT   The mismatch penalty.  [default: -1.0]
  -g, --gap FLOAT        The gap open penalty.  [default: -2.0]
  -e, --extension FLOAT  The gap extension penalty.  [default: -1.0]
  -o, --output TEXT      The output directory.  [default: output]
  -G, --global           Choose global alignment.[default]
  -L, --local            Choose local alignment.
  -n, --nosave           Do not save the alignment result.
  --help                 Show this message and exit
Package: pairwise-correlation-miner
pairwise_correlation_minerPairwise Correlation MinerLast Update: 12/21/23SummaryThePairwise_Correlation_Minerpackage provides theexecute_feature_target_pair_analysisfunction, designed to analyze statistical relationships between multiple features and targets in a dataframe, outputting the results in CSV format.InstallationAvailable as a package at PyPi.org.https://pypi.org/project/pairwise-correlation-miner/.
Install via pip: pip install pairwise-correlation-minerFunction Usageexecute_feature_target_pair_analysis(dataframe, feature_list, target_list, export_file_path)dataframe: DataFrame containing non-null, numeric feature and target values.feature_list: List of column names to be treated as features.target_list: List of column names to be treated as targets.export_file_path: File path for exporting results (e.g.,"data.csv").Function returnsdataloader_df: The results of the analysis in a dataframeExports a CSV file to the path and file you define when submitting the function.Example# Example usage of the functionimportpairwise_correlation_mineraspcmdataframe=...feature_list=['feature1','feature2']target_list=['target1','target2']export_file_path="results.csv"pcm.execute_feature_target_pair_analysis(dataframe,feature_list,target_list,export_file_path)Analysis OverviewThe function loops through all of the possible feature-target pairs and performs 3 analyses:Linear Regression: Uses scikit-learn's linear regression, with an m-test for p-value calculation.Polynomial Regression: 2nd degree polynomial regression, also with m-test based p-value calculation.Autobucketed Welches t Test: Buckets data points for binary and non-binary targets to perform a t-test.
The m-test is a way to generate a p value for the probability that a given feature predicts a target, baed on a regression equation. For each data point, we calculate an estimate of the probability that the datapoint is as close to the regression line as it actually is, and the probability that it is as close to the null hypothesis line as it actually is. Once we have these 2 probability values for each datapoint, we run a t test to compare whether the prediction probabilities are different than the null probabilities. The null hypothesis line is set at y = (target mean + target median) / 2.LicenseThis project is licensed under the MIT License.
Package: pairwisedist
pairwisedistUseful links:Documentation|Source code|Bug reports|||What ispairwisedist?Calculate the pairwise-distance matrix for an array ofnsamples bypfeatures, using a selection of distance metrics. Currently supports theJackknife-correlation dissimilarity, theSon and Baek dissimilaritiesYS1andYR1, the Pearson correlation dissimilarity and the Spearman correlation dissimilarity.How do I installpairwisedist?You can installpairwisedistvia PyPI.
Use the following command in the python prompt:$pipinstallpairwisedistHistory1.3.1 (2023-01-13)ChangedAdded support for Python 3.11.Updated required versions for numpy and scipy.FixedFixed bug where setup.py would install a directory named tests into site-packages folder (thanks toBipin Kumar)New ContributorsBipin Kumar1.3.0 (2022-12-27)AddedAdded sharpened_cosine_distance().ChangedAdded support for Python 3.8-3.10, and relinquished support for Python <=3.7.Updated versions of requirements and developer requirements.1.2.0 (2020-06-21)AddedUpdated API to make imports easier (for example: ‘from pairwisedist import jackknife_distance’ instead of ‘from pairwisedist.pairwisedist import jackknife_distance’).Added pearson_distance() and spearman_distance().1.1.0 (2020-06-21)AddedAdded jackknife_distance().1.0.0 (2020-06-18)First release on PyPI.AddedAdded ys1_distance() and yr1_distance().
Package: pairwise-ranking
pairwise-rankingModels for ranking competitors and measuring the nature of hierarchiesMaximilian Jerdee, Mark NewmanPaired comparisons may arise from records of sports matches, social interactions, or from any set of preferences between pairs of objects. In these settings we can model the "strengths" of each participant, predict future contests, and infer the "depth-of-competition" and "luck" present in the hierarchies considered.The models implemented in this package are based on this paper:M. Jerdee, M. E. J. Newman, Luck, skill, and depth of competition in games and social hierarchies, Preprintarxiv:2312.04711(2023).Installationpairwise-rankingmay be installed through pip:pipinstallpairwise-rankingTypical usageOnce installed, the package can be imported asimportrankingNote that this is notimport pairwise-ranking.Files can be in a .gml network format, or read from a .txt file of a list of matches or one of an adjacency matrix of head-to-head records. See the/datadirectory for examples of properly formatted data.Once a match_list has been loaded from a data set, the package may be used to rank participants, make predictions, and compute the depth and luck:# Load data setmatch_list=ranking.read_match_list("data/gml_files/dogs.gml")# Find scores (requires sampling, which can take a while)scores=ranking.scores(match_list)print(scores)# Get ranks (uses cached samples when possible)ranks=ranking.ranks(match_list)print(ranks)# Find probability (and error) of an outcome betwen a pairplayer1='MER'player2='STE'probability,probability_error=ranking.probability(match_list,player1,player2)print(f"Probability{probability:.4f}+/-{probability_error:.4f}that{player1}beats{player2}")# Infer the depth and luck of the hierarchyparams=ranking.depth_and_luck(match_list)print(f"Depth:{params['depth']:.3f}, Luck:{params['luck']:.3f}")See the fileexample.pyfor examples of more advanced usage options and ourreadthedocs pagefor further documentation anddata set sources.
Package: pait
Pait(π tool) -Python Modern API Tools, easier to use web frameworks/write API routingDocumentation:https://so1n.me/pait/中文文档:https://so1n.me/pait-zh-doc/paitPait is an api tool that can be used in any python web framework, the features provided are as follows:Integrate into the Type Hints ecosystem to provide a safe and efficient API interface coding method.Automatic verification and type conversion of request parameters (depends onPydanticandinspect, currently supportsPydanticV1 and V2 versions).Automatically generate openapi files and support UI components such asSwagger,Redoc,RapiDocandElements.TestClient support, response result verification of test cases。Plugin expansion, such as parameter relationship dependency verification, Mock response, etc.。gRPC GateWay (After version 1.0, this feature has been migrated togrpc-gateway)Automated API testingWebSocket supportSSE supportNote:mypy check 100%python version >= 3.8 (support postponed annotations)InstallationpipinstallpaitSimple ExamplefromtypingimportTypeimportuvicorn# type: ignorefromstarlette.applicationsimportStarlettefromstarlette.responsesimportJSONResponsefromstarlette.routingimportRoutefrompait.app.starletteimportpaitfrompait.fieldimportBodyfrompait.openapi.doc_routeimportadd_doc_routefrompait.model.responseimportJsonResponseModelfrompydanticimportBaseModel,FieldclassDemoResponseModel(JsonResponseModel):"""demo post api response model"""classResponseModel(BaseModel):uid:int=Field()user_name:str=Field()description:str="demo response"response_data:Type[BaseModel]=ResponseModel@pait(response_model_list=[DemoResponseModel])asyncdefdemo_post(uid:int=Body.i(description="user id",gt=10,lt=1000),user_name:str=Body.i(description="user name",min_length=2,max_length=4))->JSONResponse:returnJSONResponse({'uid':uid,'user_name':user_name})app=Starlette(routes=[Route('/api',demo_post,methods=['POST'])])add_doc_route(app)uvicorn.run(app)Seedocumentationfor more featuresSupport Web frameworkFrameworkDescriptionFlaskAll features supportedSanicAll features supportedStarletteAll features supportedTornadoAll features supportedDjangoComing soonIf the web framework is not supported(which you are using).Can be modified sync web framework according topait.app.flaskCan be modified async web framework according topait.app.starlettePerformanceThe main operating principle ofPaitis to convert the function signature of the route function intoPydantic Modelthrough the reflection mechanism when the program is started,
and then verify and convert the request parameters throughPydantic Modelwhen the request hits the route.These two stages are all automatically handled internally byPait.
The first stage only slightly increases the startup time of the program, while the second stage increases the response time of the routing, but it only consumes 0.00005(s) more than manual processing.
The specific benchmark data and subsequent optimization are described in#27.ExampleFor more complete examples, please refer toexample