Saravanan666/pypi-org huggingface dataset:
Package: prefsniff
PrefsniffAuthor:Zachary Cutlip, uid000 at gmailprefsniffis a utility to watch macOS plist files for changes, and then autogenerate thedefaultscommand to apply those changes. Its intended use is to haveprefsniffwatch a plist file while setting a system or application preference. The resulting defaults command can then be added to a shell script or incorporated into a configuration management system such as Ansible.InstallingIf you're here to simply useprefsniffand not to hack on it, there's no need to clone the git repo. You may simply install from PyPI viapip:$ pip3 install prefsniffUsingprefsniffhas two modes of operation; directory mode and file mode.Directory mode: watch a directory (non-recursively) for plist files that are unlinked and replaced in order to observe what file backs a particular configuration setting.File mode: watch a plist file in order to represent its changes as one or moredefaultscommand.Directory mode example:$ prefsniff ~/Library/Preferences
PREFSNIFF version 0.1.0b3
Watching directory: /Users/zach/Library/Preferences
Detected change: [deleted] /Users/zach/Library/Preferences/com.apple.dock.plist
Detected change: [created] /Users/zach/Library/Preferences/com.apple.dock.plistFile mode example:$ prefsniff ~/Library/Preferences/com.apple.dock.plist
PREFSNIFF version 0.1.0b3
Watching prefs file: /Users/zach/Library/Preferences/com.apple.dock.plist
*****************************

defaults write com.apple.dock orientation -string right

*****************************Additional ReadingAdvanceddefaults(1)UsageAn introduction to plist files and thedefaults(1)command. Includes detailed explanation of each plist type and how to manipulate them withdefaults.Defaults Non-obvious LocationsAn explanation of various defaults domains and where their corresponding plist files can be found on disk.Autogeneratingdefaults(1)CommandsAn introduction to this tool,prefsniff, and how to use it to autogeneratedefaultscommands.TODOImplementdataanddateplist typesClean up output so that it can be redirected to a shell script or similarAdd additional output options (such as the name of a shell script to create)Split utility & APIMake prefsniff into a python module that exports APIMake a separateprefsniffcommand-line utility that uses the API
Package: prefsort
Partially sort a sequence, preferring some values.fromprefsortimportprefsortedseq=list('abcde')seq2=prefsorted(seq,'c b')assertseq2==['c','b','a','d','e']Note that this doesn’t sort the majority of the sequence in
the way Python’s normallist.sort()orsorted()do.
It just pulls the preferred members to the front of the list.This is particularly handy to have when organizing data columns,
for example withpandas, the following will make sure the
id and name columns come first in a DataFrame:df=df.reindex(columns=prefsorted(df.columns,'id name'))There is also areverseparameter that will put the “preferred”
items at the end of the list. In this case it’s a “negative
preference.”seq2=prefsorted(seq,'c b',reverse=True)assertseq2==['a','d','e','c','b']
Package: pref_timer
pyPerformanceTimer==================Functionality Performance TimerIntroduction------------The pyPerformanceTimer is used to find the function execution time. So it will use which function takes more time when execute and helps to find out the performance issue. So this is beginning and the more updated coming soon.Installation------------It's very simple install and use, I will show two types of installation manual and PIP installation.Manual Installation===================First you need to clone the package or download the latest release.https://github.com/PraveenJP/pyPerformanceTimer.gitcd 'path to the package'python setup.py installPIP Installation================pip install pref_timerUsage-----It's very easy to use, Please follow the setps.from pref_timer.timer import timer@timerdef main():for i in range(50000):print ("Execution:", i)if __name__ == '__main__':main()Finally run the python file.Result------The Result of the above simple loop methodExecution: 19998Execution: 19999main Taken: 0.3 SecondsIt shows the functionality name and time which is taken.If any suggestion or doubts please let me know via below email.---------------------------------------------------------------Email: praveen.josephmasilamani@outlook.comHappy Coding. :)
Package: prehashed
PrehashedA python dictionary that hashes keys before they are inserted to the dict. This yields substantial memory savings when the keys of a dictionary are quite large (for example long stings).The point of this is that we can store keys that are really large (long strings) cheaply. For example when storing the documents in the tokenized Dailymail dataset the keys take up 1.018 GB while this implementation takes 10.53 MB. A small space saving (7.79 MB vs 10.53 MB) can be found using the built inhashfunction but the results of this are not shareable across runs because python changes the seed across runs.CollisionsObviously we want to knowWhat is the probability that I will have a hash collision?. We can figure this out by asking the reverse. What is the probability that all of keys are unique? Once we have this we can answer the original question by subtracting this from 1.Given N possible hash values (2 ** 160for sha1) we know the first hash will be unique, Then for the second one we know there areN - 1hashes we could use and still be unique, this means our probability isN - 1 / N. This continues forN - 2, 3etc. So if we are hashingkkeys we can find the probability of them all being unique withPI i=1 -> k-1 (N - i) / N. This can be approximated withe^((-k * (k - 1)) / (2 * N)). This can be further approximated with (k * (k - 1) / (2 * N)) for small k because1 - e^x ~= xand when N is 2 ** 160 most k is small.GraphTo sum this up here is a table with some of the probabilities of your keys colliding.kOdds1.71x10^151 in 10 ^ 181.71x10^191 in 10 billion1.71x10^211 in a million1.71x10^231 in 1001.42x10^241 in 2So unless you plan use put171,000,000,000,000,000,000,000keys into this dict or people will die if your code has bugs I wouldn't worry about collisions.There is a small chance that keys will collide. When this happens this dictionary cannot detect that and as a result these keys will overwrite each other. This is so rare that git doesn't have a mitigation strategy either.While a collisions are super rare if you are worried about it I would suggest that all of your values are the same type so that you aren't expecting a string and get an int in the super unlikely case if a collision.If you are still scared about collisions there is also a functioninitial_add(k, v)that will modify your key until it doesn't have a collision, adds it to the dictionary, and returns the new key to use. You need to keep this key to get the value later so this kind of breaks the point of this dict where you want to be able to throw away your keys.
Package: preheat-open
PreHEAT Open Python PackageThis is the open Python package to consume Neogrids REST API.For a quick introduction to how to use it on real-world data, see thequick start guide.Installation and configurationSimple installation:Install the package directly fromPyPiusing:pip install preheat_openConfiguring the toolboxFirst, make sure that you have created an API key for your user. This can be done on youruser profile pagein the PreHEAT App.Now, you can store the API key in a configuration file. This user configuration file should be created in the following places:OSUser level (recommended)Machine levelWindowsC:/Users/[your user]/.preheat/config.json(unsupported)Linux~/.preheat/config.json/etc[/opt]/preheat/config.jsonThe configuration files are read in the following priority order (using the first available):1- User level2- Machine level (Linux only):/etc/opt/preheat/config.json3- Machine level (Linux only):/etc/preheat/config.jsonAnd then add the following content in this file (adjusting with your API key):{
  "PREHEAT_API_KEY": "YOUR_API_KEY_HERE"
}Alternatively, you can also just import it explicitly in your code using the following command in your code
(this is however not recommended, as you risk compromising your API key when sharing your code with others) :from preheat_open import set_api_key

set_api_key("YOUR_API_KEY_HERE")Additional InformationYou can find additional information about thePreHeat API here.ContributionsWe encourage pull requests if you have developed new interesting features.
Package: preimport
English |简体中文preimportpreimport python modules to accelerate running speed and avoid "hang" when invoke module.InstallationpipinstallpreimportUsagefrompreimportimportpreimportpreimport('numpy','PyQt5')preimport(['sys','os'])It will be like following when using preimport in cli.>>> # examples
>>> preimport('numpy')
>>> Preimporting 'numpy'       ...   successfully in 0.202s.
>>>
>>> # if module imported
>>> preimport('os')
>>> Preimporting 'os'        ...   [Note]:os already imported.
>>>
>>> # if module not installed
>>> preimport('PyQt5')
>>> Preimporting 'PyQt5'   ...   [Failed]:ModuleNotFound.
>>>
>>> # error module name
>>> preimport(1)
>>> [Error]: preimport error, moduleName must be str or Iterable.
Package: preimutils
PreImutilsPreImutils is a python library built to empower developers, reseachers and students to prepare and preprocessing image datasets for applications and systems with Deep Learning and Computer Vision capabilities using simple and few lines of code. This documentation is provided to provide detailed insight into all the classes and functions available in PreImutils, coupled with a number of code examples.The Official GitHub Repository of PreImutils ishttps://github.com/mrl-amrl/preimutilsFor read the full doc please visithttps://a-sharifi.github.io/preimutils-doc/Easy to use:Why we need PreImutils?Everything that you need to preprocess your image dataset is here.
One of the most important item for machine learning or CNN or other neural networks is preparing your dataset.- It's easy to use.
- You can use both in terminal and code.
- It has separate classes for object-detection and segmentation datasets.For Object detectionUse in Codefrompreimutils.object_detectionimportAMRLImageAugimg_aug=AMRLImageAug(json_path,xmls_dir,images_dir)img_aug.auto_augmentation(quantity,resized=True,width=300,height=300)Use in TerminalJSON_PATH=~/YOUR_JSON_PATH/label.jsonXMLS_DIR=~/YOUR_ANNOTATION_DIR/IMAGES_DIR=~/YOUR_IMAGES_DIR/FUNCTION=auto_augmentationQUANTITY=1000# the amount of each object to createpreimutils--function$FUNCTION--label_json_path$JSON_PATH--xmls_dir$XMLS_DIR--images_dir$IMAGES_DIR--quantity$QUANTITYFor segmentation taskfrompreimutils.segmentations.vocimportDatasetfrompreimutils.segmentations.vocimportSegmentationAugdataset=Dataset('./VOC2012',images_extention='jpg')# First checking to have valid dataset(All dirs exist all mask's image exist or no)dataset.check_valid_dataset()seg=SegmentationAug(dataset.label_map_path,dataset.masks_dir,dataset.images_dir,images_extention='jpg')# At the end, there must be 2000 of each objectseg.auto_augmentation(2000)# Seprate dataset into validation 10% test 10% and train 80% and save it to train.txt,trainval.txt ,val.txt,test.txtdataset.seprate_dataset(shuffle=True,valid_persent=0.10,test_persent=0.10,save=True)Some points1.  The amount of your dataset is really important. Not very few that lose the accuracy not great number of that lose your time and cause to overfitting, more than 4000 image per object is enough that mostly. depend on how much your feature is hard.
2.  The amount of each object image is important if objects sample count not equal your neural network forget the lower object count for instance if you have 3 object each one should have 4000 sample.


3. Don't forget to shuffle your dataset if you don't do that you never ever don't get good accuracy on all of your objects.
4. If you want to detect your object from all angles don't forget to put sample from other angleattentionNo:objectSample Countobject 12000object 21000object 34000Yes:objectSample Countobject 13900object 24100object 34000PreImutilshelp you to do these points in few line of code.How should I use Preimutils?We prepare a full documentation inhttps://a-sharifi.github.io/preimutils-doc/.
Package: preJPProcess
#PreprocessingThis is one basic project , which pre processes the data frame , removing null values and performs standard scaling.#Main FeaturesRemoves Null values from DataFrame and do standard Scaling of data#Installationpip install preJProcess#Usagee.g, p = preProcess(df)
df ==> dataFrame
p.preProcessData()
p.scaling()#Sample Code
from sklearn.preprocessing import StandardScalerclass preProcess():
definit(self,df):
self.df = dfdef preProcessData(self):
    print("Null values present in your data : ", self.df.isna().sum())
    print("Preprocessing the data, removing Null Values....")
    columns = self.df.columns
    scalar = StandardScaler()
    for col in columns:
        print("Processing : " , col)
        self.df[col].fillna(self.df[col].mean(),inplace=True)
    return self.df
.....
Package: preJProcess
#PreprocessingThis is one basic project , which pre processes the data frame , removing null values and performs standard scaling.#Main FeaturesRemoves Null values from DataFrame and do standard Scaling of data#Installationpip install preJProcess#Usagee.g, p = preProcess(df)
df ==> dataFrame
p.preProcessData()
p.scaling()#Sample Code
from sklearn.preprocessing import StandardScalerclass preProcess():
definit(self,df):
self.df = dfdef preProcessData(self):
    print("Null values present in your data : ", self.df.isna().sum())
    print("Preprocessing the data, removing Null Values....")
    columns = self.df.columns
    scalar = StandardScaler()
    for col in columns:
        print("Processing : " , col)
        self.df[col].fillna(self.df[col].mean(),inplace=True)
    return self.df
.....
Package: prejudice
This package helps defining and creating small and reusable components
that can serve as guard or validation methods.ExampleBelow is an example of a validation on a content item.fromdataclassesimportdataclassfromprejudice.errorsimportConstraintErrorfromprejudice.validatorsimportOr@dataclassclassDocument:id:strbody:str=''content_type:str='text/plain'defnon_empty_document(item):"""Implementation of a validator/predicate
    """ifnotitem.body:raiseConstraintError('Body is empty.')classContentType:def__init__(self,content_type):self.ct=content_typedef__call__(self,item):ifitem.content_type!=self.ct:raiseConstraintError(f'Expected{self.ct}, got{item.content_type}.')validator=Or((ContentType('text/plain'),Or((ContentType('text/html'),non_empty_document))))document=Document(id='test',content_type='application/json')validator(document)# raises ConstraintsErrorsCHANGES0.1.1 (2023-11-09)Cython update and included py3.110.1 (2022-03-16)Initial release.
Package: prejudice-bias-hotel-reviews
Prejudice and Bias in Hotel ReviewsClone Projectgitclonehttps://github.com/vm01-prejudice-bias-hotel-reviews/prejudice-bias-hotel-reviews.gitcdprejudice-bias-hotel-reviews
makeinitRun testsmakecleanAnnotate Nationality Datasetmakedataset_nationalityAnnotate Sentiment Datasetmakedataset_sentimentRun Sweep for Nationalitymakesweep_nationality
Package: prelims
PrelimsFront matter post-processor for static site generators.OverviewPrelimseases updating YAML front matter of the static site generator contents (e.g.,Hugo,Jekyll,Hexo).You can extract keywords based onTF-IDF weighting, generate a list of recommended posts bycontent-based filtering, and even apply arbitrary custom functions to update front matters on-the-fly.ExampleBelow is an original front matter for "User-Centricity Matters: My Reading List from RecSys 2021" attakuti.me:---categories:[Recommender Systems]date:2021-10-05lang:entitle:'User-CentricityMatters:MyReadingListfromRecSys2021'---Once a Python script is executed against all the posts, new metadatarecommendationsandkeywordsare dynamically generated and inserted as:---categories:[Recommender Systems]date:2021-10-05keywords:[recsys,bias,papers,wordcloud,echo,user,recommendations,metrics,recommender,users]lang:enrecommendations:[/note/recsys-2021-echo-chambers-and-filter-bubbles/,/note/recsys-wordcloud/,/note/ethical-challenges-in-recommender-systems/]title:'User-CentricityMatters:MyReadingListfromRecSys2021'---Installation$ pip install prelimsUsageAssume your posts are under/path/to/postswhere a static site generator uses as a document root:posts
├── article-aaa.md
├── ...
└── article-zzz.mdHere, the following script reads all.mdand.htmlfiles in the folder, builds recommendations, and update each post's front matter:fromprelimsimportStaticSitePostsHandlerfromprelims.processorimportRecommenderhandler=StaticSitePostsHandler('/path/to/posts')handler.register_processor(Recommender(permalink_base='/post'))handler.execute()For instance, a front matter ofarticle-aaa.mdmay eventually become:---date:2022-01-01title:Awesome Blog Postrecommendations:[/post/article-zzz/,/post/article-abc/,/post/article-xyz/]keywords:[happy,beer,coffee,park,...]---You can run the script as a pre-commit hook and automate the process e.g., withlint-staged:$ npm install -D lint-staged{..."lint-staged":{"posts/*.{md,html}":["python ./scripts/prelims.py","git add -u posts/"]},...}LimitationsThe author is testing and using Prelims mainly withHugo. Although the tool is intended to be applicable to a variety of static site generators, there must be several edge cases that won't work properly due to unique behaviors associated with a specific generator.We assume there are hundreds of posts at most, not thousands. Every single post is sequentially processed one-by-one, and theRecommendermodule, for example, trains a model from scratch every time. As the number of posts increases, you may encounter scalability issues.
Package: prelims-cli
prelims-cliCLI forprelims.InstallRun:pipinstallprelims-cliIf you need Japanese tokenization, run:pipinstallprelims-cli[ja]UsageAssuming the following folder directory:-content|├──post|└──blog
└─scripts└config└myconfig.yamlwhere, post and blog are pages, and scripts is the place to put scripts.Here is the example of configuration:handlers:
  - target_path: "content/blog"
    ignore_files:
      - _index.md
    processors:
      - type: recommender
        permalink_base: "/blog"
        tfidf_options:
          stop_words: english
          max_df: 0.95
          min_df: 2
        tokenizer: null
  - target_path: "content/post"
    ignore_files:
      - _index.md
    processors:
      - type: recommender
        permalink_base: "/post"
        tfidf_options:
          max_df: 0.95
          min_df: 2
        tokenizer:
          lang: ja
          type: sudachi
          mode: C
          dict: full$prelims-cli--config./scripts/config/myconfig.yaml
target:/user/chezo/src/chezo.uno/content/blog
target:/users/chezo/src/chezo.uno/content/postThen your articles' front matter were updated.
Package: preliz
A tool-box for prior elicitation.OverviewPrior elicitation refers to the process of transforming the knowledge of a particular domain into well-defined probability distributions. Specifying useful priors is a central aspect of Bayesian statistics. PreliZ is a Python package aimed at helping practitioners choose prior distributions by offering a set of tools for the various facets of prior elicitation. It covers a range of methods, from unidimensional prior elicitation on the parameter space to predictive elicitation on the observed space. The goal is to be compatible with probabilistic programming languages (PPL) in the Python ecosystem like PyMC and PyStan, while remaining agnostic of any specific PPL.The Zen of PreliZBeing open source, community-driven, diverse and inclusive.Avoid fully-automated solutions, keep the human in the loop.Separate tasks between humans and computers, so users can retain control of important decisions while numerically demanding, error-prone or tedious tasks are automatized.Prevent users to become overconfident in their own opinions.Easily integrate with other tools.Allow predictive elicitation.Having a simple and intuitive interface suitable for non-specialists in order to minimize cognitive biases and heuristics.Switching between different types of visualization such as kernel density estimates plots, quantile dotplots, histograms, etc.Being agnostic of the underlying probabilistic programming language.Being modular.DocumentationThe PreliZ documentation can be found in theofficial docs.InstallationLast releasePreliZ is available for installation fromPyPI.
The latest version (base set of dependencies) can be installed using pip:pip install prelizTo make use of the interactive features, you can install the optional dependencies:For JupyterLab:pip install "preliz[full,lab]"For Jupyter Notebook:pip install "preliz[full,notebook]"DevelopmentThe latest development version can be installed from the main branch using pip:pip install git+git://github.com/arviz-devs/preliz.gitCitationIf you find PreliZ useful in your work, we kindly request that you cite the following paper:@article{Icazatti_2023,
author = {Icazatti, Alejandro and Abril-Pla, Oriol and Klami, Arto and Martin, Osvaldo A},
doi = {10.21105/joss.05499},
journal = {Journal of Open Source Software},
month = sep,
number = {89},
pages = {5499},
title = {{PreliZ: A tool-box for prior elicitation}},
url = {https://joss.theoj.org/papers/10.21105/joss.05499},
volume = {8},
year = {2023}
}ContributionsPreliZ is a community project and welcomes contributions.
Additional information can be found in theContributing ReadmeCode of ConductPreliZ wishes to maintain a positive community. Additional details
can be found in theCode of ConductDonationsPreliZ, as other ArviZ-devs projects, is a non-profit project under the NumFOCUS umbrella. If you want to support PreliZ financially, you can donatehere.Sponsors