Saravanan666/pypi-org huggingface dataset:
Package: phaxio
PhaxioA Python module for interacting with thePhaxio API.InstallationVia pip:$ pip install phaxioFull Documentationhttp://phaxio-python.readthedocs.io/en/latest/UsageSend a fax to multiple people using HTML message:fromphaxioimportPhaxioApiapi=PhaxioApi(key,secret)response=api.Fax.send(to=['4141234567','5141234567','6151234567'],files='/path/to/supported/file.pdf')print(response.data.id)The full set of Phaxio APIs is available and split into functional groups:api.Fax

api.PhoneNumber

api.PhaxCode

api.Account

api.CountriesGenerally, each supported method takes keyword arguments with the exact
same names of the API method parameters as they’re described in thePhaxio documentation.See thetestsfor additional examples, or thefull documentation.Error HandlingErrors will cause anApiException, with fields for HTTP status code, reponse headers, and json response data in the body.Testingexport API_KEY="MY_API_KEY"
export API_SECRET="MY_API_SECRET"
python setup.py testContributingMaking API changesMake changes tospec/api.yamlRunmakeswagger-generateMake changes tophaxio/api.pyas necessaryUpdate documentation if necessarydocs/source/phaxio.rstwill probably not require updates unless it’s a very big changedocs/source/models.rstwill require updates only if there are new model types
Package: phayes
phayesphayesis a python package for easy and efficient quantum phase estimation.Extensive details on Bayesian quantum phase estimation can be found in the accompanying paper,Yamamoto et al, 2023.Quantum phase estimationWiebe et al, 2015,O'Brien et al, 2018,van den Berg, 2021(and
quantum amplitude estimationSuzuki et al, 2019) can be implemented as an instance of Bayesian inference. Shots are generated from a quantum circuit with likelihood
$$p(m \mid \phi, k, \beta) = \frac12\left(1 + (1 - q)\cos(k\phi + \beta - m \pi)\right),$$
where $m \in {0,1}$ is the binaryshotproduced by the quantum device, $\phi$ is the unknown underlyingphase, $q$ is a noise parameter or error rate. $k$ and $\beta$ are circuit parameters that are chosen by the user (orphayes).Starting with a uniform prior over $\phi$,phayesuses Bayesian inference to hone in on the true value (with uncertainty quantification) through repeated measurements.Installpip install phayesBayesian updatesThe core functions arephayes.get_k_and_betaandphayes.update, which determine the experiment parameters and then update the posterior distribution in light of a new measurement (or series of measurements)fromjaximportnumpyasjnpimportphayesnum_shots=100posterior_state=phayes.init()for_inrange(num_shots):k,beta=phayes.get_k_and_beta(posterior_state)m=get_shot(k,beta)posterior_state=phayes.update(posterior_state,m,k,beta)Here the functionget_shotexecutes the quantum circuit above and returns a binary shot (or multiple shots) according the likelihood $p(m\mid \phi, k, \beta)$.There's moreThe probability density function can be visualised easilyprior_state=phayes.init()m=jnp.array([0,1,1,0,0,1])k=jnp.array([1,4,3,8,5,10])beta=jnp.array([1.4,0.6,1.2,1.1,1.9,0.3])posterior_state=phayes.update(prior_state,m,k,beta)importmatplotlib.pyplotaspltlinsp=jnp.linspace(-jnp.pi,jnp.pi,1000)pdf=phayes.pdf(linsp,posterior_state)plt.plot(linsp,pdf)phayesalso has a host of other useful functionsposterior_mean=phayes.circular_mean(posterior_state)posterior_circular_variance=phayes.circular_variance(posterior_state)posterior_holevo_variance=phayes.holevo_variance(posterior_state)Example notebooks can be found in theexamplesfolder.PrecisionBy defaultJAX uses 32-bit precision,
for phase estimation experiments you may well want to enable 64-bit precision by
adding the following to the top of your scriptfromjax.configimportconfigconfig.update(“jax_enable_x64”,True)Citation@software{phayes,
author={Duffield, Samuel},
title={phayes: A python package for easy and efficient Bayesian quantum phase estimation},
year={2023},
url={https://github.com/CQCL/phayes}
}
Package: phazap
phazapPhazap is a package to efficiently post-process gravitational-wave (GW) parameter estimation data to obtain the phases and polarization state of the signal at a given detector and frequency. Details on the method are presented inEzquiaga, Hu, Lo (2023). The key module isphazap.py.This code is used for low-latency identification of strongly lensed gravitational waves via their phase consistency by measuring their distance in the detector phase space. The relevant module including the distance statistic istension_utils.py.Phazap builds on top of the IGWN conda enviromenthttps://computing.docs.ligo.org/conda/environments/igwn/which include the standard GW packages such as LALSuite and bilby.InstallationThere are two ways to install the package, eitherfrom pypi$pipinstallphazapfrom source$gitclonehttps://github.com/ezquiaga/phazap.git
$cdphazap
$pipinstall.Quick-startRefer to thedocumentationfor two illustrative examples
Package: phbdl
A tiny video url getterYou can use this tool to get the video url of pxxxhub.Usage$ phbdl <url>where the<url>is the video's webpage url in your browser. Just copy it and paste into the terminal.Once you get the video url, you can use download the video with your favorite downloader, such as curl, wget, httpie, or even Chrome!For example, withhttpie, you can type this:$ http -d <video-url>where the<video-url>is the video's real url which you get viaphbdl
Package: phc
PHC SDK for PythonThe phc-sdk-py is a developer kit for interfacing with thePHC APIon Python 3.7 and above.Project StatusGetting StartedDependenciesPython 3version >= 3.8Getting the SourceThis project ishosted on GitHub.UsageASessionneeds to be created first that stores the token and account information needed to access the PHC API. One can currently using API Key tokens generated from the PHC Account, or OAuth tokens generated using theCLI.fromphcimportSessionsession=Session(token=<TOKENVALUE>,account="myaccount")Once aSessionis created, you can then access the different parts of the platform.fromphc.servicesimportAccountsaccounts=Accounts(session)myaccounts=accounts.get_list()ContributingWe encourage public contributions! Please reviewCONTRIBUTING.mdandCODE_OF_CONDUCT.mdfor details on our code of conduct and development process.LicenseThis project is licensed under the MIT License - seeLICENSEfile for details.AuthorsSee the list ofcontributorswho participate in this project.AcknowledgementsThis project is built with the following:aiohttp- Asynchronous HTTP Client/Server for asyncio and Python.
Package: phcli
phDagCommandPharbers Python 工具集合打包和发布方式# pipy 打包发布方式
1. 修改 phcli/define_value.py 中 CLI_CLIENT_VERSION 的版本号 
2. 修改 file/ph_max_auto/phDagJob-*.tmp 中的 install_phcli 版本号
   并将 file/ph_max_auto/phDagJob-*.tmp 上传到 s3://ph-platform/*/template/python/phcli/maxauto/ 下
3. 修改 phcli/ph_max_auto/define_value.py 中新的模板文件版本

4. 打包
$ rm -rf build/ dist/
$ python setup.py sdist bdist_egg bdist_wheel

5. 上传
发布 pypi 
$ python -m twine upload dist/*
将生成的 dist/phcli-XXX-py3.8.egg 添加到 s3://ph-platform/*/jobs/python/phcli/common/ 下清洗打包流程# zip 打包方式(scala 调用方式)
$ python setup.py sdist --formats=zip安装方式$ pip install phcli使用方法> phcli -h更新文档2.2.1    2021/1/29紧急修复 bug，在 .ipynb 中无法读取 ~/.profile 中的环境变量2.2.0    2021/1/25新增 recall 召回功能，可撤回 publish 的 dag。phcli maxauto recall --name dag_name2.1.0    2021/1/22Jupyter Spark Session 更语义化的 App Name对 Jupyter R 的支持修复了 phcli maxauto dag 后，无法取参的问题2.0.4修复 jupyter dag 时 timeout 参数的 bug修复 preset.write_asset 的 bug2.0.3phcli maxauto create 新增 option [--timeout]，指定 job 运行的超时时间（min），默认为 60 min。2.0.0之前的 phcli maxauto --cmd XXX --option 改为 phcli maxauto XXX --optionphcli maxauto 新增两个 option，[--ide] 可选 c9(默认)，jupyter。[--runtime] 可选 python3(默认)，r。phcli maxauto create 新增 option [--command] 可选 submit(默认)，script。create/combine/dag 执行过程中出现目录已存在会提示是否覆盖。phcli maxauto combine 新增参数 [--owner]，[--tag]，[--jobs]。phcli maxauto submit 改为 phcli maxauto online_run1.2.3dag airflow list 完成phcli 1.2.3 spark submit 中文乱码 bug 解决phcli 1.2.2 修复 submit jar 问题
Package: phcovid
phcovidAPythonlibrary that allows extraction of pre-processed data for COVID-19 in the Philippines. The goal of the library is to make data accessible so that we do more with analyses and less on cleaning.Get PH COVID data in only two lines of code!Usingphcovidis as simple as importing it and callingget_cases!fromphcovidimportget_casesdf=get_cases()print(get_cases().iloc[:5,:5])#  case_no  age     sex nationality    residence#0     PH1   38  Female     Chinese         None#1     PH2   44    Male     Chinese         None#2     PH3   60  Female     Chinese         None#3     PH4   48    Male    Filipino  Taguig City#4     PH5   62    Male    Filipino        RizalUsing the libraryThe package is installable through Pythonpipwith the assumption that you're usingPython 3.pipinstallphcovidCasesTheget_casesfunction will take data stated from thesourcesthat this library is integrated with.fromphcovidimportget_casesdf=get_cases()The base of the data will come from theDOH dataset. But with the increasing number of cases, some columns from the base dataset is incomplete. To remedy this, columns are completed from a crowdsourced dataset from theData Science Philippines curated COVID-19 datasetor DSPH GSheet Dataset. Below is the breakdown of the columns and where they're coming from.ColumnSourcecase_noDOHtravel_historyDOHlatitudeDOHlongitudeDOHepi_linkDOHdateDOHcase_no_numDOHcontactsDOHnum_contactsDOHcontacts_numDOHageDSPH GSheetsexDSPH GSheetnationalityDSPH GSheetresidenceDSPH GSheetsymptomsDSPH GSheetconfirmation_dateDSPH GSheetfacilityDSPH GSheetstatusDSPH GSheetannouncement_dateDSPH GSheetfinal_status_dateDSPH GSheetCase NetworkWith the cases available, aget_case_networkfunction is created to see how the pandemic is spreading amongst the cases.fromphcovidimportget_cases,get_case_networkdf=get_cases()# takes in the cases dataframe as inputcase_network=get_case_network(df)print(case_network)# 	network_no	network_cases	network_num_cases#0	0	        [1025]	        1#1	1	        [1030]	        1#2	2	        [1034]	        1#3	3	        [1041]	        1#4	4	        [1042]	        1Case Plotfromphcovidimportget_cases,get_case_plotdf=get_cases()# takes in the cases dataframeget_case_plot(df)By default, the plot will be created from theannouncement_datecolumn. This can be changed throughdate_colparameter.get_case_plot(df,date_col="new_col_to_plot")Lastly, astart_datecan also be set (it used all data by default). This date will be in the formatMM-DD-YY.get_case_plot(df,start_date="03-02-20")An example similar to image below should be the result.ContributingGetting StartedAll tests are done onPython 3and may not work as expected onPython 2. As such, it is highly recommended that you havePython 3installed.Make sure to install all libraries for development in your local.pipinstall-rrequirements.dev.txt
Package: pH-diagrams
pH diagramsA Python package to plot fractional composition diagrams and pH-log c diagramsInteractive web app:Installationpip install pH-diagramsUsageThe classAcidmust be imported fromph_diagrams. To create diagrams for the
acetic acid:>>> from ph_diagrams import Acid
>>> import matplotlib.pyplot as plt
>>> fig, axs = plt.subplots(nrows=1, ncols=2)
>>> acetic_acid = Acid(pKa=(4.76,), acid_concentration=0.1)
>>> acetic_acid.plot(plot_type='distribution', backend='matplotlib',
                     title='Acetic acid - Distribution diagram',
                     ax=axs[0], legend=False)
>>> acetic_acid.plot(plot_type='pC', backend='matplotlib',
                     title='Acetic acid - pH-log c diagram', ax=axs[1])
>>> plt.show()As can be seen, the parameterpKamust be a tuple even if there is only one value.
The above example generates the following plot, with both diagrams side by side:The plots above were made withMatplotlib, the default backend.Changing thebackendparameter toplotly, and removing theaxparameter
(it works only with Matplotlib), will open a browser window for each plot.
SincePlotlyis interactive, the user can zoom, pan, and see values on hover.Full documentation is hosted onRead the Docs.A live interactive version of this project can be seen clicking in the following badge:The web app was made withStreamlitand hosted onHeroku.A brief explanation on the chemical theory behind each diagram can be seenhere.Local Streamlit app and Jupyter notebooksThis repo has Jupyter Notebooks and scripts for a fully functionalStreamlitapp. First, create a virtual environment, clone the repo and
install dependencies:python -m venv .venv
source .venv/bin/activate
git clone git@github.com:chicolucio/pH-diagrams.git
cd pH-diagrams
pip install -r requirements.txtThis considers that you haveJupyter Notebookinstalled. If not, install it withpip install notebook.For more basic usage examples, see thetutorial.ipynbnotebook onnotebooksfolder.
In the same folder, thetutorial_interactive_ipywidgets.ipynbfile shows how to
useipywidgetsto create interactive diagrams. Just runjupyter notebookon a
terminal from the repo root folder and select the files.A local version of theStreamlitapp can be used running, from the repo root folder,streamlit run Home.pyon a terminal. A browser window will open (if not, follow
the instructions shown on the terminal output).ContributingAll contributions are welcome.IssuesFeel free to submit issues regarding:recommendationsmore examples for the tutorialenhancement requests and new useful featurescode bugsPull requestsbefore starting to work on your pull request, please submit an issue firstfork the repoclone the project to your own machinecommit changes to your own branchpush your work back up to your forksubmit a pull request so that your changes can be reviewedFor full contribution guidelines and details check out ourcontributing guide.CitingIf you use this project in a scientific publication or in classes, please consider citing asF. L. S. Bustamante & H. B. Soares & N. O. Souza, pH diagrams, 2021.
Available at:https://github.com/chicolucio/pH-diagrams
Package: phdictionary
PhDictionary | Best tool for language learningThis tool can help you to provide better understanding of foreign word using examples, definitions and translation.InstallationpipinstallphdictionaryUsageImporting the modulefromphdictionaryimportdictionaryTo get the definition of a word use this codeword=input()result=dictionary.get_definition(word,2)print(result)This function returns a turple with the definition and examples in a sentence (in this case 2 examples)To translate from English to Frenchword=input()result=dictionary.get_french_english(word,2)print(result)And vice versaword=input()result=dictionary.get_english_french(word,2)print(result)These functions return a turple with the translation and examples in a sentence (in this case 2 examples)To get synonyms to a word in English use thisword=input()result=dictionary.get_synonym(word,4)print(result)This function returns a list with the synonyms (in this case 4 synonyms and by default it returns only one synonym)To get definitions for the list of word use the code belowdictionary.get_definition_from_file(open('file.txt'),2)It generates a Word document with definitions for the each word in list with 2 examples for each (by default it is 0)To get synonyms for the list of word use the code belowdictionary.get_synonyms_from_file(open('file.txt'),3)It generates a Word document with 3 synonyms to the each word in list (by default it is 1)To get translation from French to English for each word in the list use thisdictionary.get_french_english_from_file(open('file.txt'),3)It generates a Word document with translation for the each word in list with 3 examples for each (by default it is 0)You can find all the documentation on GitHub:https://github.com/RediIVIideR/phdictionary
Package: phdimporter
PicoHarp 300 TCSPC .phd file loaderThis module was written to be able to read in.phdphoton time histograms from the PicoHarp software.The layout of the file is as documented in thePicoHarp 300 manualin section 8.2.1 (pages 56-58).Both of these are easy to modify, however the scope of this projec tis limited to our usage case.The module also loads.txtfiles which are the copy-pasted data from the PicoHarp software. This is primary way our research group has extracted data in the past, so it makes sense to keep the functionality alive.For our friends at the University of Saskatchewan, I've also added.ascfile loading.InstallationpipinstallphdimporterUsageThe module only uses onestructimport and contains one class of importance,TRF.fromphdimportTRFtrf=phd('path/to/file/.phd')## ortrf=phd('path/to/file/.txt')The most simple way to return the histogram data is to:x=trf.x# bins in nsy=trf.y# counts/binIt is possible to pull raw data out from the .phd file since it's all stored in theTRFobject, however I'm not going to document this as the variables share the same names as in the PicoHarp manual, and are easily seen in phd.py.Not ImplementedThe importer has been written with a couple of limitations in mind that are based on our usage:Assumes only one histogram per fileAssumes only one PicoHarp device on the machineThe only variable I haven't implemented is the acquisition time, as the computer that we use is not internet connected and the clock is always off, and I'm also not sure how to interpret thetime_tdata type that the variable is stored in.
Package: phdu
PhD-utilsFor people that have to compute and store a large variety of data and/or perform statistical inference.Keep your files tidy!Don't spend time creating directories, deciding filenames, saving, loading, etc. Decoratorssavefig&savedatawill do it for you with optimal compression. More info at thetidypathrepository.Estimate confidence intervalsThe modulephdu.resampleallows calls to theresampleR package.Provides CI and permutation tests.CIs can account narrowness bias, skewness and other errors in CI estimation, as indicated in thearticleAlternatively, usephdu.stats.bootstrapfor numba-accelerated computation (does not callresample).Bootstrap-based power analysis.Calculate the power for accepting H0 and estimate the needed sample size.
Functionpower_analysisinphdu.stats.bootstrapfollows Efron-Tshibirani: An introduction to the bootstrap,  p. 381-384.Numba-accelerated permutation testsModulephdu.stats.tests.permutation.Permutation tests for any statistic.Includes paired and block cases.DemoPlease check theexample notebook.DocumentationGithub pagesInstallFor the R compatible installation first install R:conda install -c conda-forge r r-essentials r-baseInstall with dependencies:pip install phdu[dependencies]Wheredependenciescan bebase(recommended),all,r(needed forresampleto work),statsmodels,matplotliborplotly.
Package: phe
python-paillierA Python 3 library implementing the Paillier Partially Homomorphic Encryption.The homomorphic properties of the paillier crypto system are:Encrypted numbers can be multiplied by a non encrypted scalar.Encrypted numbers can be added together.Encrypted numbers can be added to non encrypted scalars.Citingpython-paillieris designed, developed and supported byCSIRO’s Data61. If
you use any part of this library in your research, please cite it using the following BibTex entry:@misc{PythonPaillier,
  author = {CSIRO's Data61},
  title = {Python Paillier Library},
  year = {2013},
  publisher = {GitHub},
  journal = {GitHub Repository},
  howpublished = {\url{https://github.com/data61/python-paillier}},
}Running unit testspython setup.py testOr use nose:nosetestsNote related to gmpy2gmpy2is not required to use the library, but is preferred. A pure Python implementation is available butgmpy2drastically improves performances. As indication on a laptop not dedicated to benchmarking, running the exampleexamples/federated_learning_with_encryption.pyprovided in the library took:
- 4.5s withgmpy2installed
- 35.7s withoutgmpy2installedHowever,gmpy2is a requirement to run the tests.Code HistoryDeveloped atData61 | CSIRO.Parts derived from the Apache licensed Google project:https://code.google.com/p/encrypted-bigquery-client/
Package: pheather
Currently experimental.Usage, assuming you have a ZODB connection already:import pandas, pheather, transaction

conn.root.iris = Pheather()
transaction.commit()

iris = pandas.read_csv('iris.csv')

conn.root.iris.save(iris)Then, later in a separate session:import pheather

iris = conn.root.iris.read()For folks who are new to ZODB, there’s a helper function for
connecting to (and creating) a ZODB file-based or Postgres-based database:import pheather

# Local files:
conn = pheather.connection('data.fs')

# Postgres database using URL-based connection strings:
conn = pheather.connection('postgresql://localhost/mydb')Changes0.1.1 (2017-05-23)Added missing setup dependency (for feather-format :( )0.1.0 (2017-05-23)Initial experimental release.
Package: pheatmap
pheatmappheatmapfor Python.You can create a heatmap with its annotation bars, just like pheatmap of R. Documnets athereRequirementspheatmapneedpython> 3.8, andnumpy,pandasandmatplolib.InstallYou can installpheatmapbypip.pipinstallpheatmapRun the command above,pipwill automatically installnumpy,pandasandmatplolib.Usageimportnumpyasnpimportpandasaspdfrompheatmapimportpheatmapnrows,ncols=10,10mat=np.linspace(-1,1,nrows*ncols).reshape(nrows,ncols)rownames=["abcdefghig"[i%10]foriinnp.arange(nrows)]colnames=["xyz"[i%3]foriinnp.arange(ncols)]mat=pd.DataFrame(mat,index=rownames,columns=colnames)anno_row=pd.DataFrame(dict(anno1=np.linspace(0,10,nrows),anno2=["CNS"[i%3]foriinnp.arange(nrows)]))anno_col=pd.DataFrame(dict(anno3=np.linspace(0,20,ncols),anno4=["ABC"[i%3]foriinnp.arange(ncols)]))anno_row_cmaps={"anno1":"Blues","anno2":"Set1"}anno_col_cmaps={"anno3":"Purples","anno4":"Set3"}fig=pheatmap(self.mat,annotation_row=self.anno_row,annotation_col=self.anno_col,annotation_row_cmaps=self.anno_row_cmaps,annotation_col_cmaps=self.anno_col_cmaps)fig.savefig("tests/pheatmap.png")Run the above code at the ipython or jupyter notebook. You can see the fellow heatmap with its
annotation bars.Also, you can save the figure to file. For example, save the figure toPDFfile.fig.savefig("pheatmap.pdf")
Package: pheed
Python tools for aggregating physics literatureThepheed(PHysics fEED) package collects physics literature meta data from various online sources and normalizes
the resulting data into a standard format. The package provides three principal data structures. A simplified summary,
aSourceproduces andArticlewhich has anAuthor. It is possible to search for new articles from a source given
some temporal and categorial information, such as "new this week" or "quantum gravity", as well as search for new
articles by particular authors. Where official APIs exist, we use them, else we resort to web-scraping. As a
consequence, the pdf form of the articles may not always be available. We aim to add these features where possible
while respecting the Terms and Conditions of the sources involved. The package hasn't added explicit support for
non-peer-reviewed sources, such as Blogs, though we realize that these can be quite popular in the community and
may add support in the future.Principal StructureThe below outlines the key components of thepheedpackage, and defines some of the relevant attributes or purposes
of each. Examples below will explain usage of each of these components.Source: An online origin for physics articlesArticle: A peer-reviewed publication, typically consisting of a pdf and some meta-dataAuthor: Contributor to anArticle, with the expected attributes (name, etc.)Wrapped SourcesThough thepheedpackage contains all the tools necessary to wrap additonal sources,
it comes with several sources already wrapped out of the box:APS JournalsIOP JournalsArxiv