Saravanan666/pypi-org huggingface dataset:
Package: py-params
A type safe dict utility class in python.LICENSEMIT. SeeLicense File.Installparamsis on the Python Package Index (PyPI):pip install py-paramsUsageParamsrepresents a set of parameters modeled as adictwith a fixed set of keys.
Default values are provided as class level attributes inParamssubclasses.
Parameter values can then be specified when constructing aParamsinstance overriding the default values.
The parameter values can then be accessed both as attributes anddictitems,
however theParamsinstance key set is closed for modification
thus an exception is raised when a parameter name is misspelled.Accessing parameters not defined as class level attributes would raise anAttributeError.>>>importparamsaspp>>>classTestParams(pp.Params):...param_a=1...param_b=True>>>params=TestParams()## using the defaults>>>params{'param_a':1,'param_b':True}>>>TestParams(param_a=2)## setting a value for param_a{'param_a':2,'param_b':True}>>>params.param_a=3## access as attribute or key>>>params["param_a"]=4>>>params.param_a==params["param_a"]True>>>params.param_cAttributeError:'TestParams'objecthasnoattribute'test_c'>>>params.param_c=3AttributeError:Settingunexpectedparameter'param_c'inParamsinstance'TestParams'>>>params["param_d"]=4AttributeError:Settingunexpectedparameter'param_d'inParamsinstance'TestParams'Paramsinstances can be used to generate CLI parser withargparse:>>>importparamsaspp>>>classTestParams(pp.Params):...number_of_things=pp.Param(None,doc="Specifies the number of things",dtype=int,required=True)...use_feature_x=pp.Param(True,doc="whether to use feature X")>>>parser=TestParams.to_argument_parser()>>>parser.print_help()usage:pydevconsole.py[-h]--number-of-thingsNUMBER_OF_THINGS[--use-feature-x[USE_FEATURE_X]]optionalarguments:-h,--helpshowthishelpmessageandexit--number-of-thingsNUMBER_OF_THINGSSpecifiesthenumberofthings--use-feature-x[USE_FEATURE_X]whethertousefeatureX>>>args=parser.parse_known_args(["--number-of-things","7"])>>>TestParams(args._get_kwargs()){'number_of_things':7,'use_feature_x':True}NEWS05.Feb.2021- v0.10.2 - passing anykwargstoargparseradd_argument()fromParam.__init__10.Jan.2021- v0.10.1 - YAML (de)serialization added; support for positional argument in argparse.04.Apr.2020-WithParamsmixin added.31.Mar.2020- support for generatingargparseCLI parser. Hierarchy aggregation refactored.ResourcesAs an illustration of howParamscould be used to reduce boilerplate code check:kpe/params-flow- utilities for reducing keras boilerplate code in custom layerskpe/bert-for-tf2- BERT implementation using the TensorFlow 2 Keras API
Package: pyparasol
ParasolParasol is a JavaScript library for visualization of multi-objective optimization problems
such as hyper-parameter tuning and is based on parallel coordinates.Parallel coordinates make it easy to visualize different parameter configurationsFor an interactive example, check out the original authors site for the javascript library:https://parasoljs.github.io/demo/lrgv.htmlPyParasolPyParasol is a Command line interface and API written in python that makes it easy to use Parasol
without the need to write javascript code. It creates all HTML and javascript automatically and
includes a HTTP server to let you view your data with ease.Quickstart:PyParasol requires a python version of at least 3.6. Download python athttps://www.python.org/downloads/Install pyparasolpip install --user pyparasolUse command line interface to view a csv file$pyparasoldata\lrgv.csv# replace with path to your csv file(s)*ServingFlaskapp"lrgv"(lazyloading)*Environment:productionWARNING:Thisisadevelopmentserver.Donotuseitinaproductiondeployment.UseaproductionWSGIserverinstead.*Debugmode:off*Runningonhttp://localhost:5000/(PressCTRL+Ctoquit)Now navigate tohttp://localhost:5000/API usage example:For an example how to use the API, have a look at theexample.pyscript.AcknowledgementsThe original implementation PyParasol which this fork based on and Parasol itself were created by the
Kasprzyk Research Group at the University of Colorado Boulder.For more information about parasol, refer tohttps://github.com/ParasolJS/parasol-es
Package: pyparaspace
pyparaspace: a Python wrapper for theParaSpace timelines planner-- a simple, flexible and extensible solver for timeline-based planning problems using theZ3 Theorem Prover.InstallingInstall using Pip.pip install pyparaspaceSee the filetestPyParaspace.pyfor example usage.Building locallyRequirements: Rust, Cargo, Clang/LLVM/LibClang, CMake.Create a virtual environmentpython3 -m venv env
source env/bin/activateInstall maturinpip install maturinBuild packagematurin developBuilding and releasingThis section is intended for package maintainers. Thepyparaspacepackage is
released on PyPi with Python wheel packages that make it convenient to useparaspacewithout needing to set up Rust and C++ compilers and tools.
Through thez3-syspackage's static link option, we get the whole planner,
including the Z3 solver, statically linked. This greatly increases the
convenience for users of the library.Windows and Manylinux platforms are currently supported.WindowsIf building and installing the local package works, then usingmaturin build --releaseshould also correctly build a wheel package, which can be uploaded to PyPi usingmaturin publish.Because the z3-rs feature "static-link-z3" is used, the Z3 library is built
during the building of paraspace. To make sure that C++ compiler paths are
correctly set up, use the "x64 Native Tools Command Prompt" that is installed
by Visual Studio. If you get compilation errors after trying to build in a
different environment, the z3-rs package doesn't always correctly rebuild the
right parts, so it might be necessary to explicitly clean the build cache
(cargo clean or git clean).Note that building paraspace with the statically linked Z3 can take some time,
typically 10-20 minutes.When in the correct environment, publishing a new release should be possible with:maturin publish --skip-existingManylinuxparaspacerequires an Rust version 1.60 and Clang version 3.5 (to compile the Z3 solver),
which makes it requires a bit of setup to correcly build the manylinux wheel.
There is a Dockerfile available that can be used to build a Docker image with
an up-to-date Rust version and version 7 of the LLVM/Clang toolchain.The builds should work using the following commands.docker build -t mybuild .
docker run --rm -v $(pwd):/io mybuild publish --skip-existing --compatibility manylinux2014 -i python3.10
Package: pyparc
PyPARC - A Python Package for Piecewise Affine Regression and ClassificationContentsPackage descriptionInstallationBasic usageContributorsCiting PARCLicensePackage descriptionPyPARCis a package for solving multivariate regression and classification problems using piecewise linear (affine) predictors over a polyhedral partition of the feature space. The underlying algorithm is called PARC (Piecewise Affine Regression and Classification) and is described in the following paper:[1] A. Bemporad, "A piecewise linear regression and classification algorithm with application to learning and model predictive control of hybrid systems,"IEEE Transactions on Automatic Control, vol. 68, pp. 3194–3209, June 2023. [bib entry]The algorithm alternates between:Solving ridge regression problems (for numeric targets) and softmax regression problems (for categorical targets), and either softmax regression or cluster centroid computation for piecewise linear separationAssigning the training points to different clusters on the basis of a criterion that balances prediction accuracy and piecewise-linear separability.For earlier Python versions of the code, seehere.InstallationpipinstallpyparcBasic usageSay we want to fit a piecewise affine model on a dataset of 1000 samples $(x,y)$, where $x=(x_1,x_2)$ has two numeric components randomly generated between 0 and 1, and $y$ is obtained by the following nonlinear function of $x$$$y(x_1,x_2)=\sin\left(4x_{1}-5\left(x_{2}-\frac{1}{2}\right)^2\right)+2x_2$$We use 80% of the data for training (X_train,Y_train) and 20% for testing the model (X_test,Y_test).We want to train a piecewise affine model on a polyhedral partition with maximum 10 regions, with $\ell_2$-regularization coefficient $\alpha=10^{-4}$ and maximum 15 block-coordinate descent iterations of the algorithm:fromparc.parcimportPARCpredictor=PARC(K=10,alpha=1.0e-4,maxiter=15)# initialize PARC objectcategorical=False# targets are numeric# fit piecewise linear predictorpredictor.fit(X_train,Y_train)# make predictions on test dataYhtest,_=predictor.predict(X_test)# compute R2 scoresscore_train=predictor.score(X_train,Y_train)score_test=predictor.score(X_test,Y_test)The resulting PWA model leads to the following partitionand PWA functionContributorsThis package was coded by Alberto Bemporad.This software is distributed without any warranty. Please cite the above papers if you use this software.Citing PARC@article{Bem23,
    author={A. Bemporad},
    title={A Piecewise Linear Regression and Classification Algorithm with Application to Learning and Model Predictive Control of Hybrid Systems},
    journal={IEEE Transactions on Automatic Control},
    year=2023,
    month=jun,
    volume=68,
    number=6,
    pages={3194--3209},
}LicenseApache 2.0(C) 2021-2023 A. Bemporad
Package: pyparcel
pyparcelpyparcel is the simple and secure way to convert python objects tobytestrings. pyparcel extends the usage ofstructand provides a simpler way to load classes andbuilt-in types.InstallationUse the package managerpipto install pyparcel:pipinstallpyparcelor usingpipenv:pipenvinstallpyparcelUsageimportpyparcelfoo:Foo=Foo(8,5.7,"Hello World")# Foo(int, float, str)data:bytes=pyparcel.load(foo)# b'\x08\x00\x00\x00ff\xb6@\x0b\x00\x00\x00Hello World'# ...bar:Foo=Foo()pyparcel.unload(data,bar)# foo == bar# orbaz:Foo=pyparcel.unload(data,Foo())# foo == bazContributingThis repository follows a "fork-and-pull" workflow. If you would like to contribute perform the following:Forkthe repostiory to your Github.Cloneyour fork to your local machine.Checkouta new branch with a meaningful name.Commityour changes to your fork.Submit a pull requestwith a description of changes and enhancements made for further review.Check out some issues to work on in theissuessection.Documentation is available athttps://najaco.github.io/pyparcel/LicenseMIT
Package: pyparcels
Parcel Fabric Python API UtilsHelper functions for simplifying parcel fabric workflows with the ArcGIS Python APIInstall arcgis moduleconda install -c esri arcgisInstallpyparcelspip install pyparcelsUtilsBasic functions to write json to a file, get a server token and a simple timer decoratorFeaturesfeatures/feature_utilsFunctions for getting and querying FeatureLayer and FeatureLayerCollection objects.Simplifies and shortens return values for basic feature layer info.Versioningversioning/versioning_utilsFunctions for creating and deleting versions.Start and stop edit sessions for branch versioned editing.Parcelsparcels/parcels_utilsFunctions to query parcel featuresReturns dicts with correct format for submission to Parcel Fabric REST methods.Create parcel records for record driven workflows.Copy external line features into a parcel type.
Package: pypardiso
PyPardisoPyPardiso is a python package to solve large sparse linear systems of equations with theIntel oneAPI Math Kernel Library PARDISO solver, a shared-memory multiprocessing parallel direct sparse solver.PyPardiso provides the same functionality as SciPy'sscipy.sparse.linalg.spsolvefor solving the sparse linear systemAx=b. However in many cases it is significantly faster than SciPy's built-in single-threaded SuperLU solver.PyPardiso is not a python interface to the PARDISO Solver from thePARDISO 7.2 Solver Projectand it also doesn't currently support complex numbers. Check outJuliaSparse/Pardiso.jlfor these more advanced use cases.InstallationPyPardiso runs on Linux, Windows and MacOS. It can be installed withcondaorpip. It is recommended to install PyPardiso using a virtual environment.conda-forgePyPIconda install -c conda-forge pypardisopip install pypardisoBasic usageHow to solve the sparse linear systemAx=bforx, whereAis a square, sparse matrix in CSR (or CSC) format andbis a vector (or matrix):In[1]:importpypardisoIn[2]:importnumpyasnpIn[3]:importscipy.sparseasspIn[4]:A=sp.rand(10,10,density=0.5,format='csr')In[5]:AOut[5]:<10x10sparsematrixoftype'<class 'numpy.float64'>'with50storedelementsinCompressedSparseRowformat>In[6]:b=np.random.rand(10)In[7]:x=pypardiso.spsolve(A,b)In[8]:xOut[8]:array([0.02918389,0.59629935,0.33407289,-0.48788966,3.44508841,0.52565687,-0.48420646,0.22136413,-0.95464127,0.58297397])
Package: pypare
A very simple pypi cache.featuresusesaiohttp,aiofiles,inotipyqueries metadata via pypi JSON APIfilesystem is the databaseserve releases while downloadingtodoprivate channels with user, groups and permissionsusepython-libaiofor file stuffnice uirunning the cache# pypare --help
Usage: pypare [OPTIONS] COMMAND [ARGS]...

Options:
  --log-level [NOTSET|DEBUG|INFO|WARNING|ERROR|CRITICAL]
                                  The logging level.  [default: INFO]
  --loop [asyncio|uvloop]         Use a different loop policy.  [default:
                                  asyncio]
  --version                       Show the version and exit.
  --help                          Show this message and exit.

Commands:
  pypi  Run a simple pypi caching proxy.# pypare pypi --help
Usage: pypare pypi [OPTIONS]

  Run a simple pypi caching proxy.

Options:
  -p, --port INTEGER              The port to run the server  [default: 3141]
  -h, --host TEXT                 The server host IP.  [default: 0.0.0.0]
  -b, --base-path PATH            The base path for this application.
                                  [default: /pypi]
  -c, --cache-root DIRECTORY      The cache directory, where files are stored.
                                  [default: ~/.cache/pypare]
  -u, --upstream-channel TEXT     The name of the upstream channel.
  --upstream-channel-url TEXT     The base API URL of the upstream channel.
  --upstream-channel-timeout INTEGER
                                  The timeout upstream is asked for new
                                  metadata.
  --plugin LIST                   A plugin in pkg_resources notation to load.
  --help                          Show this message and exit.Run from virtual environment:pipinstallpyparepyparepypi--cache-root/tmp/pypi-dataRun in docker:dockerrun-itdiefans/pypare:latestpypiRun as zipapp:shivpypare-cpypare-o~/.local/bin/pypare-p~/.pyenv/versions/3.7.0/bin/pythonpyparepypi--cache-root/tmp/pypi-dataUsing the cachePIP_INDEX_URL=http://localhost:3141/pypi/pypipipinstalltensorflow
Package: pypareto
# pypareto
Pypareto is a Python library for pareto front seaching.
## Usage
ComparisonChain.split_by_pareto performs the pareto front split fronts.Currently this works only for unique rows. You can add id as the last row (and not sort by it) to work around this restriction.Here the None means just inferior value:>>> values = [(0,None,None), (2,2,2), (0,1,1), (0,0,1), (None,0,1), (0,1,0), (None,1,1), (1,0,0), (0,0,0)]
>>> chain = Comparison(by_value, MaxMinList(MaxMin.MAX, MaxMin.MAX, MaxMin.MAX)).as_chain()
>>> chain.split_by_pareto(values)
[[(2, 2, 2)], [(0, 1, 1), (1, 0, 0)], [(0, 0, 1), (0, 1, 0), (None, 1, 1)], [(None, 0, 1), (0, 0, 0)], [(0, None, None)]]Here one extra None means that the whole row is inferior:>>> values = [(0,None,None), (2,2,2), (0,1,1), (0,0,1), (None,0,1), (0,1,0), (None,1,1), (1,0,0), (0,0,0), (None, 0, None)]
>>> chain = GroupNones(MaxMinList(MaxMin.MIN, MaxMin.MIN, MaxMin.MIN)).and_then(
...    Comparison(by_value, MaxMinList(MaxMin.MAX, MaxMin.MAX, MaxMin.MAX)))
>>> chain.split_by_pareto(values)
[[(2, 2, 2)], [(0, 1, 1), (1, 0, 0)], [(0, 0, 1), (0, 1, 0)], [(0, 0, 0)], [(None, 1, 1)], [(None, 0, 1)], [(0, None, None), (None, 0, None)]]
Package: pyparis
paris: Hierarchical graph clustering algorithm and dendrogram processing=========================paris is a Python module that provides an implementation of the hierarchical clustering algorithm for graphs, paris.It provides four algorithms able to process dendrograms in order to extract best clusters, clusterings or distances.Installation------------Install the latest version of cylouvain using ``pip`` ::$ pip install pyparisDependencies------------cylouvain requires:- Python (>= 2.7 or >= 3.4)- NumPy- NetworkXSimple example--------------Build a simple graph with NetworkX::>>> import networkx as nx>>> graph = nx.Graph()>>> graph.add_nodes_from(['a', 'b', 'c', 'd', 'e', 'f'])>>> graph.add_edges_from([('a', 'b'), ('a', 'c'), ('b', 'c'),('c', 'd'),('d', 'e'), ('d', 'f'), ('f', 'e')])Compute a partition of the nodes using cylouvain::>>> from paris import paris>>> dendrogram = paris(graph)Compute the best clusters, clusterings and distances::>>> best_cluster = best_cluster_cut(dendrogram)>>> best_homogneous_clustering = best_homogeneous_cut(dendrogram)>>> best_heterogneous_clustering = best_heterogeneous_cut(dendrogram)>>> best_distance = best_distanceLicense-------Released under the MIT license::Copyright (C) 2018 Bertrand Charpentier <bercha@kth.se>
Package: pyparlaclarin
PyparlaclarinThis module includes functionality for reading, creating, and modifying Parla-Clarin XML files.For instance, you can loop over all paragraphs in a Parla-Clarin file with a simple function:frompyparlaclarin.readimportparagraph_iteratorforparagraphinparagraph_iterator(root):print(paragraph)or get all speeches by a speakerfrompyparlaclarin.readimportspeeches_with_nameforspeechinspeeches_with_name(root,name="barack_obama_1961"):print(speech)Further documentation is available onGitHub pages.
Package: pyparma
These are Python bindings to theParma Polyhedra
Library. They were extracted from
thesagemathproject, in order to be used
in non-sage projects. This is GPL-licensed, as is Sagemath.To build it you need to have both thepplandgmplibraries
installed in a place where distutils can find it. Then,python setup.py build && python setup.py installIf you have trouble, try adding the desired paths to library_dirs in
setup.py as a keyword argument to the Extension constructor.To use it, simply import the module, create a matrix of Fractions or
integers, and compute the double description !frompyparmaimportPolyhedronimportnumpyasnpfromfractionsimportFractionfractionize=np.vectorize(lambdax:Fraction(str(x)))A=fractionize(np.random.rand(50,3))poly=Polyhedron(hrep=A)printpoly.hrep()Both H-representation and V-representation follow the CDD format i.e.:H_rep = [b | A] where the polyhedron is defined by b + A x >= 0V_rep = [t | V] where V are the stacked vertices (Horizontal
vectors) and t is the type: 1 for points, 0 for rays/lines.To run the tests, simply run:nosetestsFrom the top-level directory. To run the tests, you need to have theCDD libraryinstalled. I assume that you installed the version that comes with thepycddlibbindings.
Package: pyparquetloaders
PyTorch Parquet Data LoaderThis library holds a number of classes which help reading data from Parquet files into the PyTorch ecosystem easily!
Although this library is intended to be used for natural language processing projects and with NLP libraries, it is extremely flexible.
Feel free to use, modify or fork this library in any way!Supported LibrariesLibraryRequirementsUsage NotesPyTorch-LightningRequiresPyArrowand (optionally)PetastormThe more basicPyArrowimplementation is far easier to understand, but not battle tested.TransformersCan be used with either PyTorch-Lightning implementation, but Petastorm casts data types from one format to another several times midway, which can impare performanceAllenNLPPyArrowNot implemented yetPlease lookherefor further information on using Petastorm with Hugging Face Transformers.Difference from PetastormPetastorm is a great (albeit complex) library for using Parquet files in a large variety of situations.
Although they have basic PyTorch support, their solution is tough to understand.
This can make it difficult to debug and modify for personal use.Alternatively,PyParquetLoadersis focused on providing Python classes which are easy to use, understand and modify.
This means anyone can get started with their PyTorch models reasonably quickly, even if they're doing something slightly different/unique.
Currently PyParquetLoaders supports PyTorch-Lightning and Hugging Face Transformers, with AllenNLP support comming soon!Usage GuideTo use a Parquet file for training a PyTorch model simply choose and import the right data set/loader (for your library of choice).
Then you can simply try and use it just as you would for any other (simple) text/image file (look at your libraries relavent docs).
Some examples are included in theTests.pyscript.Developer/Contributor GuideTo help develop/extend this library please use the following workflow:Fork and clone the repositoryMake your modificationsTest your modifications (run tests withpython -m pytestand install in test mode withpip install -e .)Commit (git commit -m "description of changes") and push (git push) your changesCreate a pull requestFeel free to add any feature you see fit, or fix/report any bug you find (with GitHub Issues).
When creating a pull request please ensure you've carefully described what you're doing, why and a brief overview of your changes.
The commits should be small, only changing one feature at a time.
Package: pyparrm
PyPARRMA Python signal processing package for identifying and removing stimulation
artefacts from electrophysiological data using the Period-based Artefact
Reconstruction and Removal Method (PARRM) of Dastin-van Rijnet al.(2021;
DOI:10.1016/j.crmeth.2021.100010).View the documentation here:pyparrm.readthedocs.ioAll credit for PARRM goes to its original authors. PyPARRM is based on the
original MATLAB implementation of the method (github.com/neuromotion/PARRM).
Package: pyparsebluray
pyparseblurayParse and extract binary data from bluray filesInstallationpython -m pip install pyparseblurayor from Github:python -m pip install git+https://github.com/Ichunjo/pyparsebluray.gitExampleimportosfrompyparseblurayimportmplswithopen('/BD-ROM/BDMV/PLAYLIST/00001.mpls','rb')asmpls_file:print('_____________Header_____________')header=mpls.load_movie_playlist(mpls_file)print(header)print('_____________AppInfo_____________')appinfo=mpls.load_app_info_playlist(mpls_file)print(appinfo)print('_____________Playlist_____________')mpls_file.seek(header.playlist_start_address,os.SEEK_SET)pls=mpls.load_playlist(mpls_file)print(pls)print('_____________Playlist Mark_____________')mpls_file.seek(header.playlist_mark_start_address,os.SEEK_SET)marks=mpls.load_playlist_mark(mpls_file)print(marks)print('_____________Extension_____________')ifheader.extension_data_start_address!=0:mpls_file.seek(header.extension_data_start_address,os.SEEK_SET)extension=mpls.load_extention_data(mpls_file)print(extension)TODOAdd clpi, index table and movie objectCreditsPyGuymer2PyGuymer3lw
Package: pyparsec
PyParsecPyParsec is a Haskell combinator library, PyParsec is a parsec library for python 3+Installationpip install pyparsecUsageJust like this:>>> from parsec.state import BasicState
>>> from parsec.combinator import many
>>> from parsec.atom import eq
>>> simple = "It is a simple string."
>>> st = BasicState(simple)
>>> p = eq("I").many
>>> p(st)
['I']What's New0.6.1add built in combinators decoratoradd ahead0.7.0add result class0.7.2document0.7.3documentsfixed bugs builtin combinators0.7.4uniform result status checker0.7.5typo0.7.6fixed bug in ahead0.8.0uniform functions as python style0.8.1 ~ 0.8.4uniform functions as python stylefixed buildin methods nameadd sep_xxx methods to builtin0.8.5fixed bug in skip parser
Package: pyparsedvd
pyparsedvdParse and extract binary data from dvd filesInstallationpython -m pip install pyparsedvdor from Github:python -m pip install git+https://github.com/Ichunjo/pyparsedvd.gitExamplefrompyparsedvdimportload_vts_pgciwithopen('DVD/VIDEO_TS/VTS_01_0.IFO','rb')asifo_file:vts_pgci=load_vts_pgci(ifo_file)print(vts_pgci)TODOMaybe one day add the sectors leftCreditsChapterToolDVD Video Information