Saravanan666/pypi-org huggingface dataset:
Package: pytopconnect
PyTopConnectInstallationpipinstallpytopconnectDocumentationModule connectionfrompytopconnectimportQueryReadasQRimportosDATA={"mysql":[{"host":"localhost","port":3306,"user":"admin","password":"root","database":""}],"sqlite":[{"dbFile":os.path.dirname(__file__)+"/test.db"}]}DB_MYSQL=QR('mysql',DATA)DB_SQLITE=QR('sqlite',DATA)Getting datacondition={"where":{"id":[">",0],"option":[]}}obj=DB_MYSQL.database_name.table_name.get(tabel=None,condition=condition,columns="*")# [{"id":1,"name":"Ben","age":10},{"id":2,"name":"Poll","age":12}]Parameters for the get method'tabel=None' --- (str) Non-mandatory parameter, needed if the call is not from the current table'condition=None' --- (dict) Non-obligatory parameter, necessary if some conditions are met or an operation in the form of a dictionary'columns="*"' --- (str) Not obligatory parameter, it is necessary in case of selecting some columns from the tableRequest resultLists table data including column names.Adding datavalues=[['Alex',13],['Rick',9]]DB_MYSQL.database_name.table_name.add(values,tabel=None,columns='*')Parameters for the add method'values' --- (list, tuple) Required parameter, needed to add values to tables'tabel=None' --- (str) Non-mandatory parameter, needed if the call is not from the current table'columns="*"' --- (list, tuple) Not obligatory parameter, it is necessary in case of selecting some columns from the tableRequest resultReturns True or False according to the correctness of the request.Data updatecolval={"name":"Keven"}condition={"where":{"id":["==",1],"option":[]}}DB_MYSQL.database_name.table_name.update(colval,condition=condition,tabel=None)Parameters for the update method'colval' --- (dict) Required parameter, needed to change the value in the table'tabel=None' --- (str) Non-mandatory parameter, needed if the call is not from the current table'condition=[]' --- (dict) Non-obligatory parameter, necessary if some conditions are met or an operation in the form of a dictionaryRequest resultReturns True or False according to the correctness of the request.Data deletioncondition={"where":{"id":["!=",5],"option":[]}}DB_MYSQL.database_name.table_name.delet(tabel=None,condition=condition)Parameters for the delet method'tabel=None' --- (str) Non-mandatory parameter, needed if the call is not from the current table'condition=None' --- (dict) Non-obligatory parameter, necessary if some conditions are met or an operation in the form of a dictionaryRequest resultReturns True or False according to the correctness of the request.
Package: pytope
pytopePackage with a limited set of operations for polytopes, zonotopes, and invariant sets.The currently implemented features includeconstructing polytopes from inequalities (halfspace representation), vertices, and upper and lower bounds,linear mapping (multiplying a matrixMand a polytopeP:M P),the Minkowski sum and Pontryagin difference of polytopes,the intersection of polytopes, andsimple plotting.The figures below are generated with pytope.
The first two illustrate the currently implemented operations (seedemo.py);
the third uses pytope to plot a robust MPC trajectory (implemented inCasADi, combining Figures 1 and 2 from Mayne et al. (2005)) (with a rough approximation of the disturbance sequence);
the fourth shows an outerε-approximation of a minimal robust positively invariant (or MRPI) set (computed with pytope), reproducing the example from Raković et al. (2005).Most of pytope is experimental, fragile, largely untested, and buggy.Figure: Illustration of various polytope operations.Figure: The Minkowski sum of two polytopes.Figure: Robust MPC trajectory from Mayne et al. (2005), combining Figures 1 and 2.Figure: Outerε-approximation of a minimal robust positively invariant (MRPI) set – a reproduction of the example in Raković et al. (2005).ReferencesMayne, D.Q., Seron, M.M., & Raković, S.V. (2005).
Robust model predictive control of constrained linear systems with bounded disturbances.Automatica, 41(2), 219–224.Raković, S.V., Kerrigan, E.C., Kouramas, K.I., & Mayne, D.Q. (2005).
Invariant approximations of the minimal robust positively invariant set.IEEE Transactions on Automatic Control, 50(3), 406–410.
Package: pytopia
PytopiaPytopia is a library that allows you to interact with Cryptopia API.RequirementsPython (3.6, 3.7)InstallationTo install this package, you need to make surepipis installed:pipinstallpytopiaExampleLet's take a look over a simple example on how to use it:frompytopiaimportPytopiapytopia=Pytopia(PUBLIC_KEY,PRIVATE_KEY)# Get the last traded price for every trade pairtrade_pairs=pytopia.get_trade_pairs()fortrade_pairintrade_pairs:market_history=pytopia.get_market_history(trade_pairs[0]['Id'])last_traded_price=market_history[0]['Price']print(last_traded_price)
Package: pytopk
This is the code of the paperStochastic smoothing of the top-K calibrated hinge loss for deep imbalanced classificationpublished at ICML2022.
If you use this code for your work, please cite the paper:@inproceedings{pmlr-v162-garcin22a,
  title = 	 {Stochastic smoothing of the top-K calibrated hinge loss for deep imbalanced classification},
  author =       {Garcin, Camille and Servajean, Maximilien and Joly, Alexis and Salmon, Joseph},
  booktitle = 	 {Proceedings of the 39th International Conference on Machine Learning},
  pages = 	 {7208--7222},
  year = 	 {2022},
  volume = 	 {162},
  series = 	 {Proceedings of Machine Learning Research},
  month = 	 {17--23 Jul},
  publisher =    {PMLR},
}The pytopk packageThe pytopk package contains the code for the balanced and imbalanced top-k losses as well as a differentiable top-k function.InstallationIt can be installed as follows:pip install pytopkTop-k lossesOur losses can be used as standard pytorch loss functions:importtorchfrompytopkimportBalNoisedTopK,ImbalNoisedTopKscores=torch.tensor([[2.0,1.5,-3.0],[7.5,4.0,-1.5]])labels=torch.tensor([0,2])k=2criteria_bal=BalNoisedTopK(k=k,epsilon=1.0)criteria_imbal=ImbalNoisedTopK(k=k,epsilon=0.01,max_m=0.3,cls_num_list=[17,23,55])loss_batch_bal=criteria_bal(scores,labels)loss_batch_imbal=criteria_imbal(scores,labels)Smooth top-k functionWe also provide a differentiable top-k function for tensors of any size that can be plugged into any neural network architecture:importtorchfrompytopkimportNoisedTopKsmooth_topk=NoisedTopK(k=3,dim=-1)x=torch.tensor([[-1.5,2.0,0.7,3.8],[-1.1,-5.4,0.1,2.3]],requires_grad=True)out=smooth_topk(x)print(out)>>tensor([0.4823,-1.4710],grad_fn=<_NoisedTopKBackward>)out.sum().backward()print(x.grad)>>tensor([[0.0000,0.4000,0.6000,0.0000],[0.8000,0.0000,0.2000,0.0000]])
Package: pytopol
Plese seehttp://github.com/resal81/pytopolHistory0.1.6 (2013-09-23)Gromacs topology parsing functionality.0.1.5 (2013-09-17)Added test results for both single- and double-precision of Gromacs.Now reads CHARMM stream filesIncludes a simple mechanism to check if updates are available.Reorganized the documentation and started the wiki on the github repo.0.1.4 (2013-09-17)Faster pair generationSwitch to gromacs 4.6.3-double for testsFixed a bug for multi-chain systems0.1.3 (2013-09-16)The conversion part was rewritten to make it more flexible.Cholestrol test is now passed.0.1.2 (2013-09-15)NBFIX section is now parsed. So the results for molecules with NBFIX parameters such as cholesterol, match better between NAMD and GROMACS.0.1.1 (2013-09-02)Updates to Readme and License.0.1.0 (2013-08-25)First release on PyPI.
Package: pytoppa
Python package to ppa=====================.. image:: https://travis-ci.org/nvbn/pytoppa.png?branch=develop:target: https://travis-ci.org/nvbn/pytoppaUpload python packages to your ppa with easy yml config.Features---------- simple configuration file in yaml- history from git- adding essential dependencies automatically.pytoppa.yml config format-------------------------In general it looks like:.. code-block:: yamlname: package-name  # optional, by default from setup.pysection: python  # optional, by default pythonbuild-dependencies:  # optional- one-of-build-depsdependencies:  # optional- one-of-depsreleases:- one-of-releasesExamples:- `pytoppa <https://github.com/nvbn/pytoppa/blob/develop/.pytoppa.yml>`_- `series_list <https://github.com/nvbn/series_list/blob/develop/.pytoppa.yml>`_- `subliminal <https://github.com/nvbn/subliminal/blob/packaging/.pytoppa.yml>`_Usage-----Run in terminal:.. code-block:: bashpytoppa key ppaFor example:.. code-block:: bashpytoppa 'Vladimir Iakovlev <nvbn.rm@gmail.com>' 'ppa:nvbn-rm/ppa'Installation------------.. code-block:: bashpip install pytoppa
Package: py-topping
py_topping, a topping on great librariesThis library focus on "simplify" (& laziness :P)PyPi Project Page :https://pypi.org/project/py-toppingTo Install the Stable Versionpipinstallpy-toppingTo Install the Newest Versionpipinstallgit+https://github.com/chanon-kr/Shared_Function.gitThis library will *NOT auto install dependencies for you but you could see the list of dependencies in sample linksYou could see samples of how to use this library inside the samples folder in githubhttps://github.com/chanon-kr/Shared_FunctiondatabaseTo Work with SQL Server, MySQL, PostGreSQL, SQLite and Google BigQueryTo read view, table or store procedure as pandas dataframeTo insert pandas dataframe into SQL with different methodsfrom 0.3.18, will roll back if job fail, except Google BigQueryCan't read Store Procedure in PostGreSQL will solve this in later versionWill working with Oracle Database in later versionDependecies and Sample of use =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/database.ipynbsharepointTo download file from SP365 or SP on primTo read csv/excel from SP365 as pandas dataframeTo download List as csv or pandas dataframe from SP365To upload file to SP365 or SP on primDependecies and Sample of use =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/sharepoint.ipynbgcpTo download and upload file from GCP's bucket StorageDependecies and Sample of use =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/lazy_GCS.ipynbsocketTo receive and send data though socket (TCP/IP)Dependecies and Sample of use =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/lazy_TCP.ipynbdata_preparationEncode categorical columnCreate lagging parameterSimple Deep Learning Model for RegressionDependecies and Sample of useData Prep =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/data_preparation.ipynbSimple Deep Learning =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/lazy_ml.ipynbgeneral_useTo send email with pythonTo logging in csv fileTo check port statusTo send LINE message, sticker or picture with line notifyTo Create diff hour of (Desired UTC) - (Environment UTC)To Check health of your machineDependecies and Sample of useLINE =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/lazy_LINE.ipynbEMAIL =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/email_sender.ipynbOther =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/other_function.ipynbopcto read value from OPC UAto write value to OPC UADependecies and Sample of useOPC UA =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/lazy_OPCUA.ipynbrun_pipelineTo run your python or notebook scriptsTo create FastAPIDependecies and Sample of userun pipeline=>https://github.com/chanon-kr/Shared_Function/blob/main/samples/run_pipeline.ipynbcreate FastAPI =>https://github.com/chanon-kr/Shared_Function/blob/main/samples/api.ipynb
Package: pytopplot
DescriptionGUI forAzimuthalBeamCavityInteraction (ABCI) program. ABCI binaries could be obtained fromhttp://abci.kek.jp/abci.htm.InstallationGet python and pipDownload and install python and pip.You may use a package manager for this. For example, in Debian installation command looks like this:sudo apt-get install python3 python3-pipIf you don't have a package manager, download installer from thepython web site.InstallpytopplotFrom the terminal issue the commandpip3 install pytopplotfor system-wide installation, orpip3 install --user pytopplotfor the local installation.DownloadABCIbinary [optional]Package providesABCIbinaries, but they may be outdated.Download the newestABCIbinaries form theABCIweb site.
When program starts, inSettingstab choose the location of theABCIbinary, you want to use.RunIn order to run the program, from the terminal issue the commandpytopplotIf it's not found, you have to modify thePATHenvironment variable to include the python scripts folder (unix guide,windows guide) or supply the full path to the program.OtherUpdatepytopplotTo update program, from the terminal issue the commandpip3 install --upgrade pytopplotfor system-wide installation, orpip3 install --upgrade --user pytopplotfor the local installation.Issue submissionIn case of a problem with the program, create an issue in theissue tracker.
Package: pyTOPSScrape
pyTOPSScrapeA tool for scraping OPLIB opacities from the TOPS web form and converting them into a format more similar to that used by OPALDocumentationThis README provides a basic overview; however, more in depth documentation, including
detailed descriptions of command line arguments and file formats may be found in
the following linksOfficial Documentation(mirror)PDF DocumentationOverviewTheTOPS webformprovides access
to some of the most up to date high temperature radiative opacities. However,
entering compositions manually into a webpage can be a chore. Especially when
one needs opacities for a variety of rescaled compositions as is often the case
when working stellar evolution programs.pyTOPSScrape aims to address this by providing a simple interface to query the
TOPS webform for n tables rescaled from a base composition. Moreover,
pyTOPSScrape can transform the parameterization of opacities from mass density
and temperature to R and temperature. Additionally, pyTOPSScrape will automatically
merge tables from rescaled compositions into a single table mimicking the form
of high temperature opacity tables already used by the Dartmouth Stellar
Evolution Program (DSEP).The primary interface for pyTOPSScrape is a bash script included with the package
an example use of which followsgenerateTOPStablesGS98.abunrescalings.dat-d./rawOutput-oGS98.opac-j20Further examples and the data files needed to run them may be found in the
examples directory of this repository.In addition to this bash script pyTOPSScrape provides a programmatic interface
made up of primarily the pyTOPSScrape.api.call and pyTOPSScrape.api.TOPS_2_OPAL
functions. These can be called individually if you wish to implement your own
custom converter function (In that case you would use call and then some
custom function in place of TOPS_2_OPAL)InstallPrerequisitespython >= 3.8mechanize >= 0.4.5scipy >= 1.5.2tqdm >= 4.50.2beautifulsoup4 >= 4.8.2importlib_resources >= 5.2.0pipIf you install with pip all the dependencies should be automatically installed.pipinstallpyTOPSScrapeSourcegitclonehttps://github.com/tboudreaux/pytopsscrape.gitcdpytopsscrape
pythonsetup.pyinstallCurrent Potential IssuesThere seem to be small variations in the results I get from the web form for
the same inputs between queries. I have yet to track down if this is on my end
of on there end but be aware of this. (This also makes some of the tests fail
as I am doing a character to character check and not a numeric similarity
within threshold check)ExamplesThere are examples of the command line interface and the python interface in
the examples directory of this repository. It is recommended you look at those
before querying your own opacity files. The command line examples are all shell
scripts with names that describe that they are examples of while the python
interface example is in the form of a Jupyter notebook in the
examples/Notebooks directory. If you do not have jupyter installed on your
computer you should be able to view the .ipynb file on Github.
Package: pytoqlik
PyToQlikPyToQlik is a library that allows you to integrate Qlik Desktop with Jupyter notebooks. With it you can:Open and edit a Qlik app inside a Jupyter notebook;Create a Qlik object with data from a pandas DataFrame data structure and/or;Import data from a Qlik object and create a pandas DataFrame to work with in Python.Latest Updates (24/jun/2021):star2: Just added some basic Qlik Cloud SaaS functionalities! :star2:Be a more powerful data scientist by importing and extracting data from Qlik objects in Cloud applications inside your tenant!Getting StartedFor this library to work you might want to have a functioning Qlik Desktop App installed and running on your local machine, or, if using the Cloud version, you will need an API Key to your tenant. There are tutorials on here and on Qlik's website about API Keys. You will also find having thepandaslibrary useful, and either aJupyter Notebook local serveror use something likeGoogle ColaboratoryYou can then download and install PyToQlik using:Installationpip install pytoqlikUsageExample 1Creating a Qlik app and feeding it datafrom pytoqlik import Pytoqlik
import seaborn

df = seaborn.load_dataset('tips')  # df is just some example data provided by the seaborn library

p2q = Pytoqlik()
app = p2q.toQlik(df)Example 2Importing data from a Qlik object to Pythonfrom pytoqlik import Pytoqlik
import seaborn

df = seaborn.load_dataset('tips')  # df is just some example data provided by the seaborn library

p2q = Pytoqlik()
app = p2q.toQlik(df)
app.toPy('your ObjectID')Step by step guideDocumentationPyToQlik current documentation can be foundHERE.Comprehensive Qlik Cloud tutorialA case-study based tutorial has been developed and is availableHERE.Features in developmentConnectivityQlik Enterprise supportQlik Cloud robustness (easy-to-use embedding, more global functionality)Planned FunctionalityData fetching based on dimension and measure namesMore robust embedding objects and sheetsMore robust script editing (appending and replacing)Object creation and manipulation via PythonAuxiliary functions, app listing and object listingTask creation and managingETL features in Python
Package: pytorch2caffe
# pytorch2caffeA package to convert pytorch model to caffe model.## Installationpip3 install pytorch2caffeorgit clonehttps://github.com/woodsgao/pytorch2caffecd pytorch2caffe
python3 setup.py install## TutorialsNote: import torch first then import pytorch2caffeimport torch
from torchvision.models import resnet
from pytorch2caffe import pytorch2caffename=’resnet18’
resnet18=resnet.resnet18()
resnet18.eval()
dummy_input=torch.ones([1,3,224,224])
pytorch2caffe.trans_net(resnet18, dummy_input, name)
pytorch2caffe.save_prototxt(‘{}.prototxt’.format(name))
pytorch2caffe.save_caffemodel(‘{}.caffemodel’.format(name))
Package: pytorch2jax
Pytorch2JaxPytorch2Jax is a small Python library that provides functions to wrap PyTorch models into Jax functions and Flax modules. It usesdlpackto convert between Pytorch and Jax tensors in-memory and executes Pytorch backend inside Jax wrapped functions. The wrapped functions are compaitible Jax backward-mode autodiff (jax.gradandjax.vjp) viafunctorch.vjp.InstallationYou can install the Pytorch2Jax package from PyPI via pip:pip install pytorch2jaxUsageExample 1: Wrap a Pytorch function to a function that accepts Jax tensorsimporttorchimportjax.numpyasjnpfrompytorch2jaximportpy_to_jax_wrapper# Define a PyTorch function that multiples an input tensor with another tensor# and wrap it with the py_to_jax_wrapper decorator@py_to_jax_wrapperdeffn(x):returntorch.rand((10,10))*x# Call the wrapped function on a JAX arrayx=jnp.ones((10,10))output=fn(x)# Print the outputprint(output)Example 2: Convert a PyTorch model to a JAX function and differentiate with gradThe converted Jax function can be used seamlessly with Jax'sgradfunction to compute gradients.importjax.numpyasjnpimportjaximporttorch.nnaspnnfrompytorch2jaximportconvert_pytnn_to_jax# Create a PyTorch modelpyt_model=pnn.Linear(10,10)# Convert PyTorch model to a JAX functionjax_fn,params=convert_pytnn_to_jax(pyt_model)# Define a function that uses the JAX function and returns the sum of its outputdeffx(x):returnjax_fn(params,x).sum()# Compute the gradient of the function `fx` with respect to `x`grad_fx=jax.grad(fx)x=jnp.ones((10,))print(grad_fx(x))# Prints the gradient of fx at xExample 3: Convert a PyTorch model to a Flax model class and do forward pass inside another Flax moduleimportjax.numpyasjnpimportjaximporttorch.nnaspnnimportflax.linenasjnnfrompytorch2jaximportconvert_pytnn_to_flaxfromtypingimportAny# Convert the PyTorch model to a Flax model using the 'convert_pytnn_to_flax' function# flax_module is the converted Flax model and params are the parameters of the converted Flax modelpyt_model=pnn.Linear(10,10)flax_module,params=convert_pytnn_to_flax(pyt_model)# Define a new Flax module and define the flax_module attribute as the converted Flax model# The __call__ method of this module will call the __call__ method of the flax_module attributeclassSampleFlaxModule(jnn.Module):flax_module:Any@jnn.compactdef__call__(self,x):returnself.flax_module()(x)# Create an instance of the new Flax moduleflax_model=SampleFlaxModule(flax_module)# Initialize the parameters of the Flax model using random key and a 10x10 array of ones as inputparams=flax_model.init(jax.random.PRNGKey(0),jnp.ones((10,10)))# Apply the Flax model to the input to get the outputflax_model.apply(params,jnp.ones((10,10)))ContributingIf you encounter any bugs or issues while using pytorch2jax, or if you have any suggestions for improvements or new features, please open an issue on the GitHub repository athttps://github.com/subho406/Pytorch2Jax.LicensePytorch2Jax is released under the MIT License. See LICENSE for more information.
Package: pytorch2tf
pytorch-2-tfThis library is a pipeline designed to convert pretrained PyTorch image models to Tensorflow format for deployment.IntroductionI'm someone who loves PyTorch for its flexibility — it's really great for churning out machine learning models quickly that perform reasonably well.However, I'm also someone who works a lot with deploying machine learning models to mobile devices. PyTorch, unfortunately, is still quite lacking in that respect.
TensorFlow is simply more flexible when it comes to deployment, with support across a variety of platforms from mobile phones to simpler embedded devices.Thus, it's useful to be able to convert trained PyTorch model checkpoints to TensorFlow format so one can quickly deploy ML models into a real-world setting. However, current intermediary formats like ONNX often result in accuracy loss when converting between formats, which is unacceptable for some applications. This library aims to provide an easy way for developers to quickly deploy trained PyTorch models using the power of TensorFlow's support for various deployment platforms.DependenciesPytorch-2-tf usesargparse, which is a parser for command-line options, arguments, and sub-commands;json, a data-interchange format;tqdm, a progress bar for Python;torch, an open source machine learning library; andnumpy, a library that supports large, multi-dimensional arrays and matrices.ContributingSeeCONTRIBUTING.md.