Saravanan666/pypi-org huggingface dataset:
Package: perplexed
perplexedThis library is based on the idea from Andrej Karpathy on understanding
the failure cases of a model by looking at the worst predictions.
Specifically, this library focuses on calculating the perplexity of
Large Language Models (LLMs) such as GPT-2 and BERT. The idea is to
calculate the perplexity of a model on a dataset at the per token level.
This allows us to understand where the model is perplexed and where it
is not. This is useful for debugging and understanding the model.InstallpipinstallperplexedHow to useUsing the APIperplexedis designed to work with the HuggingFace ecosystem and is built on top
of thetransformersanddatasetslibraries. The API is designed to
be simple and easy to use. The main function isperplexedwhich takes in a model, dataset, and tokenizer and returns a simple
Counter object with the perplexity of each token in the dataset. Here is
an example of how to use it:fromperplexed.coreimportperplexedtokenizer=AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-125M")tokenizer.pad_token=tokenizer.eos_tokenmodel=AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-neo-125M")dataset=load_dataset("wikitext","wikitext-2-raw-v1",split="test").select(range(100))# filter out empty stringsdataset=dataset.filter(lambdax:len(x["text"])>0)perplexity_cnt=perplexed(model,dataset,tokenizer=tokenizer,column="text",batch_size=1,device="cpu")perplexity_cnt.most_common(10)Found cached dataset wikitext (/home/nathan/.cache/huggingface/datasets/wikitext/wikitext-2-raw-v1/1.0.0/a241db52902eaf2c6aa732210bead40c090019a499ceb13bcbfa3f8ab646a126)
Loading cached processed dataset at /home/nathan/.cache/huggingface/datasets/wikitext/wikitext-2-raw-v1/1.0.0/a241db52902eaf2c6aa732210bead40c090019a499ceb13bcbfa3f8ab646a126/cache-68eb731029328d8b.arrow
Loading cached processed dataset at /home/nathan/.cache/huggingface/datasets/wikitext/wikitext-2-raw-v1/1.0.0/a241db52902eaf2c6aa732210bead40c090019a499ceb13bcbfa3f8ab646a126/cache-1c1cd85efcee4db8.arrow

[(' wired', 60983688.0),
 (' 768', 21569838.0),
 (' shatter', 12281687.0),
 (' unsett', 8289435.0),
 (' ignited', 6605209.0),
 (' Tanz', 4834899.0),
 (' Influence', 4153321.75),
 (' Career', 4064189.0),
 (' Television', 2325870.75),
 (' Moral', 2243574.5)]
Package: perplexityai
perplexityaiA simple module to use Perplexity AI in Python.Get started:python -m pip install -U perplexityaiJoin myDiscord serverfor live chat, support, or if you have any issues with this package.Support this repository:⭐Star the project:Star this repository. It means a lot to me! 💕🎉Join my Discord Server:Chat with me and others.Join here:Example:Perplexity:fromperplexityaiimportPerplexityprompt=input("👦: ")forainPerplexity().generate_answer(prompt):print(f"🤖:{a['answer']}")Labs:"""Models:["mixtral-8x7b-instruct","llava-7b-chat","llama-2-70b-chat","codellama-34b-instruct","mistral-7b-instruct","pplx-7b-chat","pplx-70b-chat","pplx-7b-online","pplx-70b-online",]"""fromperplexityaiimportLabsprompt=input("👦: ")forrinLabs().generate_answer(prompt,"MODEL"):print(f"🤖:{r['output']}")Thanks tonathanrchn's perplexityaifor the original code.
Package: perplexity-client
Unofficial Perplexity API ClientThis is an UNOFFICIAL Perplexity API Client for interaction with Perplexity AI API.Usagefrompeplexity_client.clientimportPerplexityClient,PerplexityModelsclient=PerplexityClient(api_key="YOUR-API-KEY")messages=[{"role":"user","text":"Give me 20 most visited places on Earth"}]# Here we can use online model or leave it with the default mistral-7b-instruct modelplaces=client.chat_completion(messages=messages,model=PerplexityModels.PPLX_70B_ONLINE)
Package: perprof-py
perprof-pyA Python module for performance profiling (as described byDolan and
Moré) with TikZ and matplotlib output.ReferenceWhen using this software for publications, please cite the paper below, which
describes this project:Siqueira, A. S., Costa da Silva, R. G. and Santos, L.-R., (2016).
Perprof-py: A Python Package for Performance Profile of Mathematical
Optimization Software. Journal of Open Research Software. 4(1), p.e12.
DOI:http://doi.org/10.5334/jors.81.LicenseCopyright (C) 2013-2023 Abel Soares Siqueira, Raniere Gaia Costa da Silva, Luiz Rafael dos Santos.
Licensed under the GNU GPL v3.This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See theGNU General Public Licensefor more
details.Installpython-mpipinstallperprof-pyFor more details, see thedocumentation.How to useperprof-pyFILESBACKENDFor more details on the FILES format and the available backends, see thedocumentation.Getting HelpIf you didn't find something at the documentation, want to report a bug, or request a new feature, please open anissue.
Package: perprof-web
perprof-webWeb interface for theperprof-pyfor creating performance profiles (as described byDolan and Moré).ReferenceWhen using this software for publications, please cite the paper below, which
describes this project:Siqueira, A. S., Costa da Silva, R. G. and Santos, L.-R., (2016). Perprof-web: A Python Package for Performance Profile of Mathematical Optimization Software. Journal of Open Research Software. 4(1), p.e12. DOI:10.5334/jors.81.InstallUseperprof-webfrom Docker if you just want to use it.How to useRun perprof-web using Docker withdockerrun-p5000:5000abelsiqueira/perprof-webGetting HelpIf you didn't find something at the documentation, want to report a bug, or request a new feature, please open anissue.
Package: perpy
PERPY——Functions commonly used in computer paper writing and scientific research.INSTALLpipinstallperpyIMPORTimportperpyaspyLOAD——load dataset from fileTEST FILE——test1.txt1 5 02 4 03 3 04 2 15 1 1CASE 1——Non label & No max min scalingpath=r'D:\perpy'# file directorycol_labels=None# non labelscaling=False# no max min scalingx=py.load(path,col_labels,scaling)print(x)CASE 2——The labels is in the first column & To max min scalingpath=r'D:\perpy'# file directorycol_labels=0# the labels is in the first columnscaling=True# to max min scalingx,r=py.load(path,col_labels,scaling)print(x,'\n',r)CASE 3——The labels is in the last column & No max min scalingpath=r'D:\perpy'# file directorycol_labels=2# the labels is in the last column. non-zero numberscaling=False# no max min scalingx,r=py.load(path,col_labels,scaling)print(x,'\n',r)DIST——Calculate the euclidean distance between point A and point BA=np.mat([1,2,3,4])# point AB=np.mat([4,3,2,1])# point Bdist=py.dist(A,B)print(dist)4.47213595499958PLT_SCATTER——Drawing scatter plotpath=r'D:\perpy'# file directorycol_labels=2# the labels is in the last column. non-zero numberscaling=False# no max min scalingx,r=py.load(path,col_labels,scaling)py.plt_scatter(x=x,labels=r,fig_label=['X——label','Y——label'],fig_legend=['Cluster','01'])# 00-upper left, 01-upper right, 10-down left, 11-down rightPLT_RUNTIME——Drawing runtime plottimes=[[1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0],# Runtime list, times[0] is A times, times[1] is B times.[1,1.1,1.2,1.3,1.4,1.5,1.6,1.7]]instances=[1,2,3,4,5,6,7,8]# xlabels=['$A$','$B$']# labelspy.plt_runtime(times,instances,labels)PLT_RADAR——Drawing radar plotTEST FILE——test2.txt1.0 0.8 0.6 0.5 0.90.6 0.9 0.7 0.7 0.30.4 0.1 1.0 0.8 0.5data=np.loadtxt(r'D:\perpy\test2.txt')algorithm=['a','b','c']labels=np.array(['A','B','C','D','E'])py.plt_radar(labels,data,algorithm,legend=(1.7,0.68))
Package: perrot
PerrotTheperrotlibrary is an extension of the originalperodrawing library
to make simple plots and charts. Please see theexamplesfolder
or in-code documentation of classes and functions to learn more about theperrotlibrary capabilities.
I also strongly recommend to check details of theperoitself.RequirementsPython 3.6+NumpyPeroInstallationTheperrotlibrary is fully implemented in Python. No additional compiler is necessary. After downloading the source
code just run the following command from theperrotfolder:$ python setup.py installor simply use pip$ pip install perrotExamplesIn theexamplesfolder you will find sample codes to generate and
understand all the following images. Check the image name and find corresponding python draw file.DisclaimerThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Please note that theperolibrary is still in an alpha state. Any changes in its API may occur.
Package: perry-bot
Perry BotA self-care bot.Free software: BSD licenseDocumentation:https://perry-bot.readthedocs.io.Attention: this project is still heavily under development!FeaturesCLI and GUITrackerWater trackerMood trackerHabit trackerDaily, weekly, bi-weekly, monthly, and yearly habitsVisualize your tracked dataLocal data storage in a sqlite database.You feel like sh*t'sinteractive self-careCreditsThis package was created based on a modifiedaudreyr/cookiecutter-pypackageproject template usingCookiecutter.=======
History0.1.0 (2021-02-17)Set up project skeleton and documentation.
Package: pers
Persistent resultsPersistent results is a Python class that ensures the results will be available even if interruptions occur.Installation:pip install persUsage:Example 1If the code below breaks for some reason (let's say the computer shuts down because of a power outage or some exception), you can restart it to continue from the step it finished.frompersimportPersistentResultsimportpandasaspd# pandas is not requiredresults=PersistentResults('test.pickle',# filename for result cachinginterval=1,# how often dump the resultstmpfilename='~test.pickle'# tmp cache file (optional))fun=lambdax,y,a,b:x**2+yforxinrange(10):foryinrange(11):results.append(fun,x,y,a=x,b=y)results.save()print(pd.DataFrame(results.data))Output:{'result': 66, 'x': 8, 'y': 2, 'a': 8, 'b': 2}
110
|     |   result |   x |   y |   a |   b |
|----:|---------:|----:|----:|----:|----:|
|   0 |        0 |   0 |   0 |   0 |   0 |
|   1 |        1 |   0 |   1 |   0 |   1 |
|   2 |        2 |   0 |   2 |   0 |   2 |
[..]
| 107 |       89 |   9 |   8 |   9 |   8 |
| 108 |       90 |   9 |   9 |   9 |   9 |
| 109 |       91 |   9 |  10 |   9 |  10 |Example 2frompersimportPersistentResultsimportpandasaspdresults=PersistentResults('test2.pickle',interval=1,result_prefix=''# we do not want a prefix _result_)deffun(x,y,a,b):print(f'x:{x}, y:{y}')return{# yes, we can return dictionary'out':x**2+y,'x':x,# yes, we can return input in dict'a':a,}try:forxinrange(10):foryinrange(11):results.append(fun,x=x,y=y,a=x,b=y)ifx==5andy==5:# simulate rebootraiseException('Unexpected reboot...')except:pass# RERUN the tests# will skip already processed elementsforxinrange(10):foryinrange(11):results.append(fun,x=x,y=y,a=x,b=y)results.save()print(pd.DataFrame(results.data).to_markdown())x: 0, y:0
x: 0, y:1
[..]
x: 5, y:4
x: 5, y:5
Unexpected reboot...

x: 5, y:6
x: 5, y:7
[..]
x: 9, y:9
x: 9, y:10

|     |   out |   x |   a |   y |   b |
|----:|------:|----:|----:|----:|----:|
|   0 |     0 |   0 |   0 |   0 |   0 |
|   1 |     1 |   0 |   0 |   1 |   1 |
|   2 |     2 |   0 |   0 |   2 |   2 |
[..]
| 107 |    89 |   9 |   9 |   8 |   8 |
| 108 |    90 |   9 |   9 |   9 |   9 |
| 109 |    91 |   9 |   9 |  10 |  10 |
Package: persai
PersaiIntroduction 🔎Persai is a Python package designed to analyze Twitter (X) posts and provide insights into the Big Five personality traits (Openness, Conscientiousness, Extraversion, Agreeableness, Neuroticism). This tool leverages data from your Twitter archive to offer a unique perspective on your social media presence. 🐦Visit our website for more information and documentationInstallation 🛠️Install Persai easily using pip:pipinstallpersaiHow to Use 💡Follow these steps to analyze your Twitter (X) data using Persai:Export Your Twitter Data:Follow Twitter's guidelines todownload your Twitter (X) archive.Prepare Your Data:Locate thetwitter.jsfile in your downloaded Twitter (X) data.Save this file in the directory where you plan to run the Persai package.Set Your OpenAI Key:Assign your OpenAI key to a variable. For security reasons, avoid hardcoding the key in your script. Instead, consider using environment variables or other secure methods.Run Persai:Use the following Python code to perform the Big Five analysis:frompersaiimportbig_fiveopenai_key="your_openai_key_here"data="twitter.js"result=big_five(data,openai_key)print(result)Sample Output 📈After running the script, you'll receive a dictionary with the analysis results. It will look something like this:{"openness":"high","conscientiousness":"low","extraversion":"low","agreeableness":"low","neuroticism":"low"}These results provide a snapshot of the personality traits expressed in your Twitter (X) posts.ContributingFeel free to contribute to the project or suggest improvements! 🌟Acknowledgments :clap:This project is a reimplementation of the ideas and methodologies presented in the paperIs ChatGPT a Good Personality Recognizer? A Preliminary Study. Thank you for providing this research.LicenseThis project is licensed under theMIT License.
Package: perscode
perscodeVectorization methods for persistence diagrams based in the paperPersistence Codebooks for
Topological Data Analysis.Usageimportperscodeimportnumpyasnp# generate diagramsdiagrams=[np.random.rand(100,2)for_inrange(20)]fordiagramindiagrams:diagram[:,1]+=diagram[:,0]# N is the size of the vectors# normalize is a Bool to whether or not normalize the output vectorpbow=perscode.PBoW(N=3,normalize=False)wpbow=perscode.wPBoW(N=3)# n_subsample is an int or None. If none all points will be used when calculating GMMs.spbow=perscode.sPBoW(N=10,n_subsample=None)# vectorize diagramspbow_diagrams=pbow.transform(diagrams)wpbow_diagrams=wpbow.transform(diagrams)spbow_diagrams=spbow.transform(diagrams)# for PVLAD and stable PVLADpvlad=perscode.PVLAD(N=3)spvlad=perscode.sPVLAD(N=3)pvlad_diagrams=pvlad.transform(diagrams)spvlad_diagrams=spvlad.transform(diagrams)TODOImplement options to pass cluster centers as arguments in wPBoW and sPBoW.Implement PVLADImplement sPVLADImplement PFVImplement optional weighted subsampling to wPBoW, sPBoW, sPVLAD classes.
Package: persei
Ease the crossing - or straddling - of the Python 2 vs Python 3 border, with Persei, a group of helpful classes for dealing with string and binary data in a consistent manner across Python 2.6-3.3.The name is short for “Unicode-Persei 8”, where the 8 stands for UTF-8. If you don’t get the reference, that’s bad news, but don’t fry your brain on it.The code is all migrated from EJTP.util.py2and3, which was too globally useful to keep locked up as an EJTP dependency. It was written by Moritz Sichert, with various modifications here and there by others. EJTP 0.9.6+ will depend on Persei as an external dependency.
Package: persephone
Persephone v0.4.2 (beta version)Persephone (/pərˈsɛfəni/) is an automatic phoneme transcription tool.
Traditional speech recognition tools require a large pronunciation
lexicon (describing how words are pronounced) and much training data so
that the system can learn to output orthographic transcriptions. In
contrast, Persephone is designed for situations where training data is
limited, perhaps as little as an hour of transcribed speech. Such
limitations on data are common in the documentation of low-resource
languages. It is possible to use such small amounts of data to train a
transcription model that can help aid transcription, yet such technology
has not been widely adopted.The speech recognition tool presented here is named after the
goddess who was abducted by Hades and must spend one half of each
year in the Underworld. Which of linguistics or computer science is
Hell, and which the joyful world of spring and light? For each it’s
the other, of course. — Alexis MichaudThe goal of Persephone is to make state-of-the-art phonemic
transcription accessible to people involved in language documentation.
Creating an easy-to-use user interface is central to this. The user
interface and APIs are a work in progress and currently Persephone must
be run via a command line.The tool is implemented in Python/Tensorflow with extensibility in mind.
Currently just one model is implemented, which uses bidirectional long
short-term memory (LSTMs) and the connectionist temporal classification
(CTC) loss function.We are happy to offer direct help to anyone who wants to use it.
Please use thediscussion mailing listto discuss questions regarding this project.
We are also very welcome to thoughts, constructive criticism, help with
design, development and documentation, along with anybug reportsorpull requestsyou may have.DocumentationDocumentation can be foundhere.ContributorsPersephone has been built based on the code contributions of:Oliver AdamsJanis LesinskisBen FoleyNay SanCitationIf you use this code in a publication, please citeEvaluating Phonemic
Transcription of Low-Resource Tonal Languages for Language
Documentation:@inproceedings{adams18evaluating,
title = {Evaluating phonemic transcription of low-resource tonal languages for language documentation},
author = {Adams, Oliver and Cohn, Trevor and Neubig, Graham and Cruz, Hilaria and Bird, Steven and Michaud, Alexis},
booktitle = {Proceedings of LREC 2018},
year = {2018}
}
Package: persession
PERSESSION (PERsistent SESSION)A wrapper onrequests.Sessionwith following additional functionalities:Persistence: session can be cached in a file for persistence between script runs.Login functionalities: login and is_logged_in functions are available to help logging into sitesUsagefrompersessionimportSession,LoginStatusbase_url='https://e.com'cache_file_path='cache.dat'session=Session(cache_file_path)is_logged_in=session.is_logged_in()ifnotis_logged_in:login_url=base_url+'/login'data={'user':'user','password':'pass'}res=session.login(login_url,data)ifres.login_status!=LoginStatus.FAILURE:is_logged_in=Trueprint('Login success')else:print('login failed')ifis_logged_in:data_url=base_url+'/data'res=session.get(data_url)You can also check outexample.pyfor a detailed example.
Package: perseus
perseusTool for snapshot management. In early progress stagePrerequisitespython >= 3.7Installationpip install perseusUsageperseus --helporpython -m perseus --helpContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Local developmentThe project uses poetry as a dependency management tool. For local development convenient way to installing and
running project is usingpoetry install. Please, use>=1.0.0 versionof
poetry even if it is a beta-version.Poetry automatically creates venv (or uses already activated venv) and install all requirements to it and the project
itself aseditable.
TIP: Usepoetry shellorpoetry runbefore running commands: they activate venv. If you want to connect venv to
your IDE, usepoetry env list --full-pathLicenseMIT
Package: perseus-agent-library
Perseus Agent Python LibraryPerseus Agent Python Library provides core classes to develop agents (workers) responsible for performing asynchronous tasks in the background.These components have minimal dependencies on other libraries, so that they can be deployed easily.  In addition, these components will keep their interfaces as stable as possible, so that other Python projects can integrate these components without having to worry about changes in the future.To install the Perseus Agent Python Library, enter the follow command line:$pipenvinstallperseus-agent-library
Package: perseus-core-library
Perseus: Core Python LibraryPerseus Core Python Library is a repository of reusable Python components to be shared with Python projects integrating Perseus RESTful API server framework.These components have minimal dependencies on other libraries, so that they can be deployed easily.  In addition, these components will keep their interfaces as stable as possible, so that other Python projects can integrate these components without having to worry about changes in the future.To install the Perseus Core Python Library, enter the follow command line:$pipinstallperseus-core-library
Package: perseus-email-library
Perseus: Email Python LibraryPerseus Email Python Library is a repository of reusable Python components to compose and send email.These components have minimal dependencies on other libraries, so that they can be deployed easily.  In addition, these components will keep their interfaces as stable as possible, so that other Python projects can integrate these components without having to worry about changes in the future.To install the Perseus Email Python Library, enter the follow command line:$poetryaddperseus-email-library
Package: perseus-getenv-library
Perseus GetEnv Python LibraryMajormode Perseus GetEnv Python Library is a helper library to read environment variables.This library relies onpython-dotenvto read key-value pairs from a.envfile, which helps in the development of applications following the12-factor principles.This library provides a helper function to convert the value of environment variables in the expected data type.InstallationTo installPerseus GetEnv Python Library, simply enter the follow command line:pipinstallperseus-getenv-library
Package: perseus-microrm-library
Perseus MicrORMMajormode Perseus MicrORM Python Library is a small, little, mini, tiny, micro Object-Relational Mapping (ORM).MicrORM is not a object-relational mapping in the sense it maps Pyth objects to a Relational DataBase Management System (RDBMS), but in the sense it maps results of SQL queries, executed on a RDBMS, to Python objects.InstallationTo installPerseus MicrORM Python Library, simply enter the follow command line:pipinstallperseus-microrm-libraryUsageimportuuidfrommajormode.perseus.utilsimportcastfrommajormode.perseus.utils.rdbmsimportRdbmsConnectionRDBMS_CONNECTION_PROPERTIES={None:{'rdbms_hostname':'localhost','rdbms_port':5432,'rdbms_database_name':'foo','rdbms_account_username':'dbo','rdbms_account_password':''}}PLACE_IDS=[uuid.UUID('54879ffc-a1ec-11e8-85bd-0008a20c190f'),uuid.UUID('9025d1c8-a1ec-11e8-9e29-0007cb040bcc')]withRdbmsConnection.acquire_connection(RDBMS_CONNECTION_PROPERTIES,auto_commit=False,connection=None)asconnection:cursor=connection.execute("""SELECT place_id,ST_X(location) AS longitude,ST_Y(location) AS latitude,ST_Z(location) AS altitude,accuracy,creation_timeFROM placeWHERE place_id IN %[place_ids]s""",{'place_ids':PLACE_IDS})rows=cursor.fetch_all()places=[row.get_object({'place_id':cast.string_to_uuid,'creation_time':cast.string_to_timestamp})forrowincursor.fetch_all()]forplaceinplaces:print(place.place_id,place.longitude,place.latitude)
Package: perseus-name-generator-library
Perseus Name Generator Python LibraryWrapper ofJoao HENRIQUES'sname-genlibrary, a small module to generate names for characters, places, etc.To installPerseus Name Generator Python Library, simply enter the follow command line:pipinstallperseus-name-generatorFor generating names with a specific language, simply get an instance of the word generator for this language and call the methodgenerate_name.  For example:>>>frommajormode.utils.namegenimportNameGeneratorFactory>>>name_generator=NameGeneratorFactory.get_instance(NameGeneratorFactory.Language.Japanese)>>>name_generator.generate_name()'Ishimmi'>>>name_generator.generate_name()'Suita'>>>name_generator.generate_name()'Tashirara'>>>name_generator.generate_name()'Miyakai'>>>name_generator.generate_name()'Miharadase'