Saravanan666/pypi-org huggingface dataset:
Package: pypogo
Thepypogomodule.The goal is a Python module to run Pokemon Go calculations and simulations.
This module interfaces withhttps://pogoapi.net/api/v1/to obtain data like
pokemon stats and stuff. It can currently do CP calculations, and check the
rank of IVs based on the stats product of the mons at various levels.I’m currently working on a battle simulator, and I plan to train agents to play
PVP using neural networks and reinforcement learning. But it will be a while
before that’s done.In the meantime, there are still useful things you can do with this package.The main way to interface is using thePokemonclass.You can find IVs and levels to maximize CP under constraints:>>>frompypogo.pokemonimportPokemon>>>base=Pokemon('eevee')>>>print('base ={}'.format(base))>>>#>>>max_cp=1500>>>#>>>formoninbase.family():>>>mon.maximize(max_cp,ivs='maximize',max_level=51)>>>print('mon ={}'.format(mon))base=<Pokemon(eevee,None,None,None,None)>mon=<Pokemon(leafeon,1497,19.0,[1,15,14],None)>mon=<Pokemon(espeon,1498,17.5,[0,15,15],None)>mon=<Pokemon(umbreon,1497,27.5,[0,15,14],None)>mon=<Pokemon(flareon,1500,18.5,[0,15,13],None)>mon=<Pokemon(glaceon,1500,18.0,[0,15,12],None)>mon=<Pokemon(jolteon,1500,19.5,[0,12,15],None)>mon=<Pokemon(vaporeon,1500,18.0,[1,15,15],None)>You can do purification and evolution operations.>>>frompypogo.pokemonimportPokemon>>>self=Pokemon('ralts',ivs=[6,13,15],level=20,>>>shadow=True,shiny=True)>>>new=self.purify()>>>print('self ={}'.format(self))>>>print('new  ={}'.format(new))>>>evos=new.evolved()[0].evolved()>>>print(evos[0])>>>print(evos[1])self=<Pokemon(ralts(😈,✨),274,20,[6,13,15],None)>new=<Pokemon(ralts(👼,✨),285,20,(8,15,15),None)><Pokemon(gallade(👼,✨),1718,20,(8,15,15),None)><Pokemon(gardevoir(👼,✨),1718,20,(8,15,15),None)>You can do build a table of league rankings for different IV combinations>>>frompypogo.pokemonimportPokemon>>>self=Pokemon('beedrill')>>>beedrill_df=self.league_ranking_table(max_cp=1500)>>>print(beedrill_df)ivaivdivscplevelattackdefensestaminastat_product_krankpercentrank101314149932.5126.206025106.7897141321779.0307021100.000000201413150032.5126.206025107.5364951311777.899723299.316671301415149632.0125.700414107.1056791321777.146120398.861349401514149732.0125.700414107.8494681311775.930690498.126996511315150032.0126.444204106.3618891321775.247460597.714193....................................40921421148932.0136.11346798.1802051211617.00141940922.10312040931502149032.0136.85725696.6926261221614.43667940930.55352340941500149332.5137.40774497.0815581211614.11069640940.35656740951513148831.5136.30454697.0429111221613.74156440950.13354040961511149232.0136.85725697.4364161211613.52054240960.000000...[4096rowsx11columns]This module is being developed mainly for fun and personal use. Features as
added as I need them to answer questions mostly to do with my own personal
min-maxing. Feel free to fork, contribute, or use as you’d like.Read the docshttps://pypogo.readthedocs.ioGithubhttps://github.com/Erotemic/pypogoPypihttps://pypi.org/project/pypogo
Package: pypoi
PyPoiAn image processing GUI application written in Python under Apache
License 2.0. PyPoi stands for "Python Program forPoisson Image Editing".It enables you to try the Poisson Image Editing method interactively.
Some examples are already ready for you, but you can also load arbitrary images and try it.Installationpip install pypoiRunpypoicommand to open the GUI.What is Poisson Image Editing?Poisson Image Editing is a technique to blend two imagesseamlessly.This method is firstly introduced by Patrick Pérez and others in ACM SIGGRAPH 2003.
The original theses is availablehere (pdf).ResourcesThere are many resources about Poisson Image Editing and I'll leave explanations to them.EnglishOriginal theses (pdf)Simple introduction and examplesDetailed introduction by Chris TralieWith many funny examples.Hot discussion including technical details at the bottom too.Also contains Java implementation. Please see the chapter below.JapaneseIntroduction in Japanese 1 (pdf)Introduction in Japanese 2 in OpenCV.jpIntroduction in Japanese 3Implementation in other languagesThere have already been several implementation in other language.Javaby Chris TraliePythonby paroskyAs of v0.1.0, core calculation is the copy of this implementation.JavaScriptby takutiIntroduction in Japanese is available tooMATLAB and Cby Toshihiko Yamasaki (pdf)Found issues?Please raise an issue fromgithub issue page.What's next?I know there are a lot of space to improve.
Main enhancements are listed inthe issue tracker, for example,#8  Gradient mixture support#3  Add tests#12 Calculation speed improvementIt's more than welcome if you can pick up one/some of them.LicensePyPoi is provided under Apache License 2.0. Please refer toLICENSEAcknowledgementThe core function is fromparosky/poissonblending/
Package: pypoints2grid
pypoints2gridPython library wrapping the points2grid algorithm for generate Digital Elevation Models (DEMs)
from pointclouds. The original points2grid software was developed by the San Diego Supercomputer Center.AcknowledgementsOriginal C++ implementationInformation about points2grid algorithmInstallationpipinstallpypoints2gridUsageNote unlike the original C++ version of points2grid, pypoints2grid isn't a command line tool and doesn't read or write data
from/to file or handle point cloud classification filtering. Use other libraries, likelaspyandrasteriofor handeling IO and preparing your data.frompypoints2gridimportpoints2griddem=points2grid(pts,cell_size,bounds=None,radius=0,window_size=3,grid_data=['idw'],verbose=False)Parameterspts: list of lists or numpy array of shape (n, 3) containing x, y, z coordinates of pointscell_size: size of the grid cells in metersbounds: list of 4 floats containing the bounds of the grid in the form (xmin, ymin, xmax, ymax).
points outside these bounds will be ignored. If None, all points will be included.radius: radius of the search circle in meters. If 0, the radius will be computed from the cell size.window_size: size of the window used for the moving average filter. If 0, no moving average filter will be applied.
For more information aboutradiusandwindow_sizesee the original points2griddocumentationgrid_data: list of strings containing the data interpolations you want returned. Possible values are'idw' (inverse distance weighted interpolation)'min' (minimum of the points in the cell)'max' (maximum of the points in the cell)'mean' (mean of the points in the cell)'std' (standard deviation of the points in the cell)verbose: if True, print progress informationReturnsAn (n,m) or (n, m, k) dimensional numpy array containing the interpolated data. n and m are the number of cells in the x and y
directions, and k is the number of data interpolations requested. The order of the data interpolations is the same as
the order in thegrid_dataparameter. If k = 1 then the returned array will be 2 dimensional.ExampleA complete script for generating a DEM from a point cloud using laspy and rasterio:importlaspyimportrasterioimportnumpyasnpfromtimeimporttimefrompypoints2gridimportpoints2gridlas=laspy.read("pointcloud.las")crs=las.header.parse_crs()# filter out only ground (classififation 2) and water (classification 9)ground=las.points[(las.classification==2)|(las.classification==9)]pts=np.vstack((ground.x,ground.y,ground.z)).Tx_min,y_min,z_min=pts.min(axis=0)x_max,y_max,z_max=pts.max(axis=0)print(f"loaded{pts.shape[0]}points")print(f"with bounds: ({x_min},{y_min}), ({x_max},{y_max})")cell_size=0.5print("creating grid")start_time=time()dem=points2grid(pts,cell_size)print(f"grid created in{round(time()-start_time,2)}seconds")transform=rasterio.transform.from_origin(x_min,y_max,cell_size,cell_size)withrasterio.open("dem.tif","w",driver="GTiff",height=dem.shape[0],width=dem.shape[1],count=1,dtype=dem.dtype,crs=crs,transform=transform,)asdst:dst.write(dem,1)Licensepypoins2grid is licensed under the MIT license.
The original points2grid software is licensed under theBSD 4-clauselicense.
Package: pypoker
pypokeris a cliff based app for evaluating poker hands.InstallationTo installpypoker:$ pip install pypoker==0.0.2aUsageOnce installed, usepypokerby running the following in a terminal.$ pypoker evaluate -e As Ks Qs Js 10sOr enter the pypoker interactive shell by simply typing “pypoker” at the command line once installed.
Package: pypolar
by Scott PrahlCode to model and visualize the polarization state of light as it travels
through polarizers and birefringent elements.  Some ellipsometry
support is also included.There are four numeric modules:pypolar.fresnel- reflection and transmission calculationspypolar.jones- management of polarization using the Jones calculuspypolar.mueller- management of polarization using the  Mueller calculuspypolar.ellipsometry- ellipsometry supportA module for visualization:pypolar.visualization- Routines to support visualizationand three modules that support symbolic algebra:pypolar.sym_fresnel- Fresnel reflection and transmissionpypolar.sym_jones- Jones calculuspypolar.sym_mueller- Mueller calculusDetailed documentation is available atRead the Docs.InstallationUsepip:pip install pypolarUsageCreate an optical isolator:import pypolar.mueller as mueller

# Optical Isolator example, no light returning

A = mueller.stokes_right_circular()       # incident light
B = mueller.op_linear_polarizer(np.pi/4)  # polarizer at 45°
C = mueller.op_quarter_wave_plate(0)      # QWP with fast axis horizontal
D = mueller.op_mirror()                   # first surface mirror
E = mueller.op_quarter_wave_plate(0)      # QWP still has fast axis horizontal
F = mueller.op_linear_polarizer(-np.pi/4) # now at -45° because travelling backwards

F @ E @ D @ C @ B @ ALicensepypolar is licensed under the terms of the MIT license.
Package: pypolish
Function: polish_file(input_file, output_file, exceptions='')This function takes in an input file and an output file, both with supported file extensions (.csv, .json, or .txt), and an optional list of exceptions.Parametersinput_file(str): The path to the input file to be polished.output_file(str): The path to the output file to be written with the polished data.exceptions(str, optional): An optional string of characters to be excluded from the polishing process.ReturnsNoneRaisesException: If the input and output files do not have the same supported file extension.Exception: If the file format is not supported.Supported file extensions.csv: Comma-separated values file.json: JavaScript Object Notation file.txt: Text fileDescriptionThis function cleans the input file by removing impurities, such as special characters, except for those included in the optional exceptions list. The cleaned data is then written to the output file with the same format as the input file.Note:This function does not check if the input file exists or if the output file can be written to. It is the responsibility of the calling code to ensure that the necessary file permissions and file paths are valid.# Import the functionfrompypolishimportpolish# Define the input and output filesinput_file="data/input.json"output_file="data/output.json"# Define any exceptions to the cleaning processexceptions=['(','.','@']polish.polish_file(input_file,output_file,exceptions)# Check the output file to see if the cleaning process was successfulwithopen(output_file,'r')asf:print(f.read())##Github Repohttps://github.com/huntert1004/pypolish
Package: pypollution
#pypollution-----------pollution is a python library for ploating real time COM port data. This library is project dependent library made for pollution detection and analysis. for more details http://https://github.com/Pamelabanerjee11/pollutionMonitor*This library is based on specified Hardware*Ex:---import pypollution as plotimport serial.tools.list_ports as portsimport osprint("Available ports : \nPort\t Hardwere")for i in range(len(ports.comports())):print(ports.comports()[i])inputPort = input("\nEnter Ardiuno Port Number : ")try:p = plot.pyAnalysis(inputPort, os.path.dirname(__file__))p.genrateLineAnalysis()except:print("An error is occurred while plotting the graph. Probable reason may be :")print("1. You are running app in read only memory.")print("2. Check your hardware port(COM port).")print("3. Wrong port assignment.")
Package: pypolo
PyPoloPyPolo is a Python library forinformative planning and learning.I am still completing the documentation. If you feel like building PyPolo together, please don't hesitate to drop me an email:chenweiz@iu.edu!FeaturesMinimum dependency→ painless algorithm prototyping and education →Robot Operating System (ROS).Readable code, detailed documentation, interactive tutorials→ easier understanding of the algorithms.Modular implementation→ develop new algorithm in the module of your interest.InstallationRequirements:Python >= 3.6PyTorch >= 1.10.2 (NumPy included)Matplotlibcondacreate-npypolopython=3.8
condaactivatepypolo
pipinstall-e.
Package: pypolyhedralcubature
pypolyhedralcubatureMultiple integration over a convex polytope.This package allows to evaluate a multiple integral whose integration
bounds are some linear combinations of the variables, e.g.$$\int_{-5}^4\int_{-5}^{3-x}\int_{-10}^{6-x-y} f(x, y, z)\,\text{d}z\,\text{d}y\,\text{d}x.$$In other words, the domain of integration is given by a set of linear
inequalities:$$\left{\begin{matrix} -5  & \leq & x & \leq & 4 \\ -5  & \leq & y & \leq & 3-x \\ -10 & \leq & z & \leq & 6-x-y \end{matrix}\right..$$These linear inequalities define a convex polytope (in dimension 3, a
polyhedron).
In order to use the package, one has to get thematrix-vector representationof these inequalities, of the form$$A {(x,y,z)}' \leqslant b.$$The matrix $A$ and the vector $b$ appear when one rewrites the linear
inequalities above as:$$\left{\begin{matrix} -x & \leq & 5 \\ x & \leq & 4 \\ -y & \leq & 5 \\ x+y & \leq & 3 \\ -z & \leq & 10 \\ x+y+z & \leq & 6 \end{matrix}\right..$$The matrix $A$ is given by the coefficients of $x$, $y$, $z$ at the
left-hand sides, and the vector $b$ is made of the upper bounds at the
right-hand sides:importnumpyasnpA=np.array([[-1,0,0],# -x[1,0,0],# x[0,-1,0],# -y[1,1,0],# x+y[0,0,-1],# -z[1,1,1]# x+y+z])b=np.array([5,4,5,3,10,6])The functiongetAbprovided by the package allows to get $A$ and $b$ in a
user-friendly way:frompypolyhedralcubature.polyhedralcubatureimportgetAbfromsympy.abcimportx,y,z# linear inequalities defining the integral boundsi1=(x>=-5)&(x<=4)i2=(y>=-5)&(y<=3-x)i3=(z>=-10)&(z<=6-x-y)# get the matrix-vector representation of these inequalitiesA,b=getAb([i1,i2,i3],[x,y,z])Now assume for example that $f(x,y,z) = x(x+1) - yz^2$. Once we have $A$ and
$b$, here is how to evaluate the integral of $f$ over the convex polytope:frompypolyhedralcubature.polyhedralcubatureimportintegrateOnPolytope# function to integratef=lambdax,y,z:x*(x+1)-y*z**2# integral of f over the polytope defined by the linear inequalitiesg=lambdav:f(v[0],v[1],v[2])I_f=integrateOnPolytope(g,A,b)I_f["integral"]# 57892.275000000016In the case when the function to be integrated is, as in our current example,
a polynomial function, it is better to use theintegratePolynomialOnPolytopefunction provided by the package. This function implements a procedure
calculating the exact value of the integral. Here is how to use it:frompypolyhedralcubature.polyhedralcubatureimportintegratePolynomialOnPolytopefromsympyimportPolyfromsympy.abcimportx,y,z# polynomial to integrateP=Poly(x*(x+1)-y*z**2,domain="RR")# integral of P over the polytopeintegratePolynomialOnPolytope(P,A,b)# 57892.2750000001Actually the exact value of the integral is $57892.275$, so there is a slight
numerical error in the procedure. We can get this exact value by using the
field of rational numbers as the domain of the polynomial:# polynomial to integrateP=Poly(x*(x+1)-y*z**2,domain="QQ")# integral of P over the polytopeintegratePolynomialOnPolytope(P,A,b)# 2315691/40AcknowledgmentsI am grateful to the StackOverflow user @Davide_sd for the help he provided
regarding thegetAbfunction.
Package: pypolyline
Fast GooglePolylineEncoding and DecodingInstallationpip install pypolylinePlease use a recent (>= 8.1.2) version ofpip.Supported Python VersionsPython 3.7Python 3.8Python 3.9Python 3.10Supported PlatformsLinux (manylinux*-compatible, x86_64 and aarch64)macOS (x86_64 and arm64)Windows 64-bitUsageCoordinates must be in (Longitude, Latitude) orderfrompypolyline.cutilimportencode_coordinates,decode_polylinecoords=[[52.64125,23.70162],[52.64938,23.70154],[52.64957,23.68546],[52.64122,23.68549],[52.64125,23.70162]]# precision is 5 for Google Polyline, 6 for OSRM / Valhallapolyline=encode_coordinates(coords,5)# polyline is 'ynh`IcftoCyq@Ne@ncBds@EEycB'decoded_coords=decode_polyline(polyline,5)Cython Module 🔥If you're comfortable with a lack of built-in exceptions, you should use the compiled Cython version of the functions, giving a 3x speedup over thectypesfunctions:frompypolyline.cutilimportencode_coordinates,decode_polylineLongitude errors will return strings beginning withLongitude error:Latitude errors will return strings beginning withLatitude error:Polyline errors will return[[nan, nan]]Otherwise, import fromutilinstead, for a slower,ctypes-based interface. Attempts to decode an invalid Polyline will throwutil.EncodingErrorAttempts to encode invalid coordinates will throwutil.DecodingErrorHow it WorksFFI and aRust binaryIs It Fast…Yes.You can verify this by installing thepolylinepackage, then runningbenchmarks.py, a calibrated benchmark usingcProfile.On a 1.8 GHz Intel Core i7, The pure-Python test runs in ~5000 ms and The Rust + Cython benchmark runs in around 300 ms (177 % faster).LicenseMITCitingPypolylineIf Pypolyline has been significant in your research, and you would like to acknowledge the project in your academic publication, we suggest citing it as follows (example in APA style, 7th edition):Hügel, S. (2021). Pypolyline (Version X.Y.Z) [Computer software].https://doi.org/10.5281/zenodo.5774925In Bibtex format:@software{Hugel_Pypolyline_2021,
author = {Hügel, Stephan},
doi = {10.5281/zenodo.5774925},
license = {MIT},
month = {12},
title = {{Pypolyline}},
url = {https://github.com/urschrei/simplification},
version = {X.Y.Z},
year = {2021}
}
Package: pypolymake
What is it?The Python module pypolymake provides wrappers forPolymake.
It needs a recent enough version of polymake (tested with polymake
3.5). It is compatible with both Python 2 and Python 3. When used insideSageMathyou have access to
special converters from pypolymake objects to SageMath objects.The language has been kept as close as possible as the original perl
interface of Polymake. The following polymake construction:polytope> $c = cube(5);
polytope> print $c->F_VECTOR;
32 80 80 40 10
polytope> $g = $c->GRAPH;
polytope> print $g->DIAMETER;
5is translated in Python as:>>> from polymake import *
>>> c = cube(5)
>>> print(c.F_VECTOR)
(32, 80, 80, 40, 10)
>>> g = c.GRAPH
>>> print(g.DIAMETER)
5As pypolymake is under development, many things are not working! Do not hesitate
to make a bug report on thedevelopment page.Installation and source codeThe pypolymake package is available on PyPI, seehttps://pypi.org/project/pypolymake/. To install
it within your system Python, just run the following
command:$ pip install pypolymake [--user] [--upgrade]To install polymake and pypolymake inside SageMath run:$ sage -i polymake
$ sage -pip install pypolymake [--user] [--upgrade]If polymake headers or libraries are installed in a non standard location you
may need to set the environment variables CFLAGS, CXXFLAGS, LDFLAGS. For example,
on OS X, you need to update LDFLAGS as:$ export LDFLAGS="-L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/ $LDFLAGS"For SageMath usersIf pypolymake is used inside SageMath then conversion from and to SageMath objects
are available. Most polymake objects have a.sage()method and you can usepolymake.polymakeas a generic convertor. For example:sage: import polymake
sage: p = polymake.polymake(polytopes.dodecahedron())
sage: p
Polytope<QuadraticExtension<Rational>>
sage: p.VERTICES
1 3-1r5 3-1r5 3-1r5
1 -1+1r5 -4+2r5 0
...
1 -3+1r5 -3+1r5 -3+1r5
1 1-1r5 4-2r5 0
sage: print(p.VERTICES.sage())
[           1   -sqrt5 + 3   -sqrt5 + 3   -sqrt5 + 3]
[           1    sqrt5 - 1  2*sqrt5 - 4            0]
...
[           1    sqrt5 - 3    sqrt5 - 3    sqrt5 - 3]
[           1   -sqrt5 + 1 -2*sqrt5 + 4            0]Warning: the cohabitation between sage and polymake is not perfect. If you do
use polymake in sagealwaysimport sage first and then polymake. More precisely,
if you launch a simple python console and do ‘import polymake’ followed by
‘import sage.all’ it is most likely to end up with a (not yet identified)
SEGFAULT.LicenseThe library pypolymake is distributed under the terms of the GNU General Public
License (GPL) as published by the Free Software Foundation; either version 3 of
the License, or (at your option) any later version (seehttp://www.gnu.org/licenses/)AuthorsThis project has been started by Burcin Erocal in 2011 and continued
by Vincent Delecroix since 2016.
Package: py-polymorphic-list
py-polymorphic-listPython implementation of a polymorphic listView on PyPI/Documentation/GitHub Source CodeWhat is a Polymorphic List?A polymorphic list is a data abstraction similar to LinkedLists where objects of two classes,NonEmptyList, andEmptyList, are employed to cleanly handle edge cases where a LinkedList would benull. In a LinkedList, the last node'snextreference isnull; however, for a PolymorphicList, the last node'snextreference is anEmptyList, allowing the EmptyList object to override methods defined in a PolymorphicList.This means that every method is overridden to have a version for a NonEmptyList and for an EmptyList.Installationpipinstallpy-polymorphic-listOr install withpip3, accordingly.DocumentationCheck out thedocumentationfor full details on usage.
Package: py-polynomial
Python package defining single-variable polynomials and operations with themInstallationpip install py-polynomialDocumentationClick here for code-derived documentation and helpQuick examplesFlexible initialization>>>frompolynomialimportPolynomial>>>a=Polynomial(1,2,3,4)>>>str(a)x^3 + 2x^2 + 3x + 4>>>b=Polynomial([4-xforxinrange(4)])>>>str(b)4x^3 + 3x^2 + 2x + 1First derivative>>>b.derivativePolynomial(12, 6, 2)>>>str(b.derivative)12x^2 + 6x + 2Second or higher derivative>>>str(b.nth_derivative(2))24x + 6Addition>>>str(a+b)5x^3 + 5x^2 + 5x + 5Calculating value for a given x>>>(a+b).calculate(5)780>>>а(2)#  equivalent to a.calculate(2)26Multiplication>>>p=Polynomial(1,2)*Polynomial(1,2)>>>pPolynomial(1, 4, 4)Accessing coefficient by degree>>>p[0]=-4>>>pPolynomial(1, 4, -4)Slicing>>>p[1:]=[4,-1]>>>pPolynomial(-1, 4, -4)Accessing coefficients by name convention>>>(p.a,p.b,p.c)(-1, 4, -4)>>>p.a,p.c=1,4>>>(p.A,p.B,p.C)(1, 4, 4)Division and remainder>>>q,remainder=divmod(p,Polynomial(1,2))>>>qPolynomial(1.0, 2.0)>>>remainderPolynomial()>>>p//Polynomial(1,2)Polynomial(1.0, 2.0)>>>P(1,2,3)%Polynomial(1,2)Polynomial(3)Check whether it contains given terms>>>Polynomial(2,1)inPolynomial(4,3,2,1)TrueDefinite integral>>>Polynomial(3,2,1).integral(0,1)3Misc>>>str(Polynomial("abc"))ax^2 + bx + cRoots and discriminants>>>frompolynomialimportQuadraticTrinomial,Monomial>>>y=QuadraticTrinomial(1,-2,1)>>>str(y)x^2 - 2x + 1>>>y.discriminant0>>>y.real_roots(1, 1)>>>y.real_factors(1, Polynomial(1, -1), Polynomial(1, -1))>>>str(Monomial(5,3))5x^3>>>y+=Monomial(9,2)>>>yPolynomial(10, -2, 1)>>>str(y)10x^2 - 2x + 1>>>(y.a,y.b,y.c)(10, -2, 1)>>>(y.A,y.B,y.C)(10, -2, 1)>>>y.complex_roots((0.1 + 0.3j), (0.1 - 0.3j))