Saravanan666/pypi-org huggingface dataset:
Package: pydicts
PyDictsModule to use dictionaries, list of dictionaries and other data structuresLinkshttps://github.com/turulomio/pydicts/https://pypi.org/project/pydicts/DocumentationI've developed this module because I needed this kind of methods developing with Django and pythonYou can access documentation inPydicts Github pageCHANGELOG0.13.0 (2024-01-26)Removed ccy dependency due to slow python release updates0.12.0 (2024-01-16)Improved percentage logicIntegrated ccy module for currencies listingAdded more test. Coverage is now 86%Added support to ISO 8601 durations casts. Added support to durations in MyJsonEncoder moduleAdded jupyter-book support for documentationAdded project logoFixed jinja2 dependency security warnning0.11.0 (2023-12-13)Added in casts ignore_exceptions parameter in all methodsAdded a lot of tests. Test coverage is now 73%.Added more stability to casts0.10.0 (2023-12-08)Improving str2decimal conversions. Changed type parameter to decimal_separator.Added Percentage and Currency classes to manage this objects0.9.0 (2023-12-04)Added gettext supportImproved spanish translationAdded custom exceptions for each moduleImproved documentationAdded lol_print methodmyjsonencoder has been included to convert from json to dictionaries0.8.0 (2023-11-26)Migrating casts and datetime_functions to pydicts.casts. Utils to make casting easyCreate lol (List of lists) module0.7.0 (2023-11-04)Improved documentationRemoved duplicated lod_min and lod_max methodsAdded lod_filter_keys functionAdded lod_filter_dictionaries functionAdded lod_clone functionAdded lod_calculate function0.6.0 (2023-07-02)Fixed a race condition bug in lod_ymv_transposition_with_percentages0.5.0 (2023-05-04)Added support to latex tables from list of dictionaries0.4.0 (2023-04-19)Added poetry supportAdded poethepoet supportAdded lod_remove_key0.3.0 (2023-04-16)Added lod_ymv_transposition_with_porcentages0.2.0 (2023-04-12)Added lod_print with tabulate moduleImproving documentationRefactorized modules to lod_xyv, lod_ymmv0.1.0 (2023-04-10)First version addapting listdict_functions from reusingcode
Package: pyDictStore
What is pyDictStorepyDictStore adds automated dictionary storage to properties eliminating the need for code bodies, property getters and setters. It also provides a property change event.Minimum usageThe minimum usage of this library requires you to add the @storage decorator to your class. This will automatically wrap your properties with the auto storage capabilities. The default value applied to any property is None. To override this, you will need to apply the @default decorator to your propperty's getter.@storageclassExampleClass():@propertydefexampleProperty(self):...@exampleProperty.setterdefexampleProperty(self,value):......with default value@storageclassExampleClass():@property@default(10)defexampleProperty(self)->int:...@exampleProperty.setterdefexampleProperty(self,value)->None:...Overriding the getter and settergetterIf the getter returns a value other than None it will override the value pulled by pyDictStore. The example below will result in the property always returning 12.@storageclassExampleClass():@property@default(10)defexampleProperty(self)->int:return12setterOverriding the setter allows you to modify the value that is saved into storage. This is helpful if you need to perform logic against the value being passed in or if you want to force the storage type; such as parsing an integer from a string or storing a Boolean value as an integer. To do this requires ignoring normal setter conventions by using a return statement.:warning:Warning:Overriding the output does not work if you return a value of None.@storageclassExampleClass():@property@default(10)defexampleProperty(self)->int:...@exampleProperty.setterdefexampleProperty(self,value)->None:returnvalue*3Event HandlingWhen the setter of a property is called it will raise a PropertyChanged Event within your class. This provides you the instance of the class that raised the event, the name of the property, the previous value, and the new value.:bulb:Note:When the default value is instantiated the PropertyChanged event does not fire....event handler within class@storageclassExampleClass():def__init__(self)->None:self.PropertyChanged+=self.onPropertyChanged@staticmethoddefonPropertyChanged(sender,name:str,oldValue,newValue):...#Your Custom Action here@property@default(10)defexampleProperty(self)->int:...@exampleProperty.setterdefexampleProperty(self,value)->None:......event handler external from classdefonPropertyChanged(sender,name:str,oldValue,newValue):...#Your Custom Action here@storageclassExampleClass():def__init__(self)->None:self.PropertyChanged+=onPropertyChanged@property@default(10)defexampleProperty(self)->int:...@exampleProperty.setterdefexampleProperty(self,value)->None:...
Package: pydict-surf
# pydict_surf
Performs a walk over all fields of json and python dictionary.  Works almost same asos.walkA toolkit to route inside a nested dictionary and list.
The item is specifically designed for routing inside a json dictionary. It can route inside a
key, outside it, and to a specific address. The class is also capable of updating and reading
keys. The usage of this class is almost like the os command system as it haschdict(instead of
chdir),pwdict(instead of pwd), etc
Package: pydicttoxml
Convert python dictionary into a xml equivalent outputUsage of Pydicttoxmld={'student':{'name':'Shera','age':25,'address':{'pin':500082,'city':'Hyderabad','state':'telangana','country':'India'}}}frompydicttoxmlimportdict2xmlxml=dict2xml(d,root_tag_name="data")Output<?xml version="1.0" encoding="UTF-8"?><data><student><name>Shera</name><age>25</age><address><pin>500082</pin><city>Hyderabad</city><state>telangana</state><country>India</country></address></student></data>
Package: pydid
PyDIDPython library for validating, constructing, and representing DIDs and DID Documents.InstallationUsing a virtual environment is generally recommended:$python-mvenvenv
$sourceenv/bin/activateInstall with pip:$pipinstallpydidDevelopmentThis project is managed withPoetry.To begin making code changes, clone this repo and do the following to install
dependencies:$python-mvenvenv
$sourceenv/bin/activate
$pipinstallpoetry
$poetryinstallContributingSeeCONTRIBUTING.md.
Package: pydiderotlibs
PyDiderotLibsAfin de faciliter l'apprentissage de python dans l'enseignement secondaire, les enseignants de mathématiques du lycée Diderot à Marseille construisent quelques librairies qui ont pour objectif de cacher certaines difficultés liées au langage de programmation afin de pouvoir cibler certains points pédagogiques.La documentation est disponible surreadthedocs.repere: Permet l'affichage d'un repère du plan interactif (zoom, déplacer).entree: Fonctions d'entrées utilisateur avec des fenêtres tkinter.lycee: Regroupe les fonctions principales que sont amenés à utiliser les élèves de lycée en mathématiques (toutes filières confondues).graphique: Permet l'affichage d'une fenêtre graphique dynamique et une gestion simplifiée des entrées clavier et souris.images: Permet quelques manipulations simples sur les images numériques dans le cadre du programme de SNT.
Package: pydidit
pydiditis a command line tool to post to iDoneThis serviceInstallationto install just run:sudo pip install pydiditThis will install didit script to your path.Usagepydidit uses environment variables to configure the default behaviour.Environment variableCommand line parameterDescriptionDIDIT_TEAM--teamiDoneThis team to post toDIDIT_API_TOKEN--api-tokenAPI token to useYou can add the following lines to your.bashrcor.zshrcshell initialization scripts:export DIDIT_API_TOKEN=<my_idonethis_api_tag>
export DIDIT_TEAM=<my_team>To post your progress you have several options:putting your progress as an argument like:didit I can now post progress using a simple command line toolor like:didit 'I can now post progress! With simple command line tool!'runningdiditwithout parameters will open an editor where you can enter your progress. This has an advantage, that it makes it much easier to enter multiline textsTODOEnable showing and/or editing the last postEnable adding more then one progress point in one edit sessionAllow getting a progress from STDIN
Package: pydiecalc
#pydiecalc[![Build Status](https://travis-ci.org/roaet/pydiecalc.svg?branch=master)](https://travis-ci.org/roaet/pydiecalc)##Installation`pip install pydiecalc`##Usage###As a CLITo run the pydiecalc library as an interactive CLI you run the applicationwithout arguments:`pydiecalc`###From the Command LineTo run the pydiecalc library from the command line you run the application witharguments that will be parsed:`pydiecalc 1d6 + 10`###As a libraryTo use pydiecalc as a library you need to import it and then handle the output:```import pydiecalcresult, rolls = pydiecalc.roll('1d6 + 10')````pydiecalc.roll` will raise `CaughtRollParsingError` if the parsing fails.
Package: pydiff
pydiff diffs Python code at the bytecode level. This is useful for checking for
changes to the actual code structure while ignoring formatting changes.InstallationFrom pip:$ pip install --upgrade pydiffExamplefoo.py:importos,sysdefmain():x=len(sys.argv)+100y=x+77print(y)bar.py:importosimportsysdefmain():x=len(sys.argv)+101y=x+77print(y)$ pydiff foo.py bar.py:---+++@@ -4,7 +4,7 @@None,{'co_argcount': 0,'co_cellvars': (),-                'co_consts': [None, 100, 77],+                'co_consts': [None, 101, 77],'co_flags': 67,'co_freevars': (),'co_kwonlyargcount': 0,
Package: pydiffchecker
PyDiffCheckerWrappers for git diffLineShiftCheckerThis tool provides an API for checking shifted but not modified lines in changed files of a Git diff. The tool will collect the lines where the content did not change into dict-like objects with source->destination line number mapping per changed file. File renames are detected as well.The behavior is very similar to unified diff on Github or output ofgit-diffn. There are green (added), red (remove) and white (unmodified) lines. The return value of the API will contain these "white" lines with the source/destination line number for the whole file.ExampleLet's assume this is the output of git-diffn:diff --git a/pydiffchecker/helper.py b/pydiffchecker/helper.pyindex f9d4e08..6a6c214 100644--- a/pydiffchecker/helper.py+++ b/pydiffchecker/helper.py@@ -3,14 +3,13 @@ from typing import Iterator3,   3:4,   4:5,   5: def subprocess_readlines(cmd, cwd=None) -> Iterator[str]:-   6     :-    process = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE)+        6:+    process = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, text=True)7,   7:8,   8:     for line in process.stdout:-   9     :-        line = line.decode().rstrip(r'\n')-  10     :-+        9:+        line = line.rstrip('\n')11,  10:         yield line12,  11:-  13     :-    process.wait()+       12:+    process.communicate()14,  13:15,  14:     if process.returncode != 0:16,  15:         raise subprocess.CalledProcessError(process.returncode, cmd)Here the lines 3-5, 7-8, 11-12 and 14-16 are unmodified, but some of them are shifted. Of course, "white" lines that are not shown above are also unmodified. The API fill return the following data (visualized for simplicity, see Usage how to access the data programatically):* pydiffchecker/helper.py->pydiffchecker/helper.py:
    1->1
    2->2
    3->3
    4->4
    5->5
    6->None
    7->7
    8->8
    9->None
    10->None
    11->10
    12->11
    13->None
    14->13
    15->14
    16->15Usagefrompydiffchecker.line_shift_checkerimportLineShiftCheckerline_shift_checker=LineShiftChecker('HEAD~','HEAD')all_shifted_lines=line_shift_checker.get_all_shifted_lines()# Iterate through shifted linesforsrc_path,shifted_linesinall_shifted_lines.items():renamed_to=shifted_lines.dst_pathforsrc_line_index,dst_line_indexinshifted_lines:print(f'{src_line_index}->{dst_line_index}')# Find if lines are shifted (and to where) in a fileif'your/file.cpp'inall_shifted_lines:shifted_lines=all_shifted_lines['your/file.cpp']renamed_to=shifted_lines.dst_pathif12inshifted_lines:# line 12 was shifted, to where?shifted_to=shifted_lines[12]
Package: py-diffie-hellman
py-diffie-hellmanPython implementation of theDiffie-Hellman key exchange protocol.Supports RFC 3526 MODP Groups 5, 14, 15, 16, 17, 18 (1536 to 8192 bit) and RFC 2409 Groups 1 and 2 (768 and 1024 bit).
The default group is 14 (2048-bit).The key length in bits may be supplied to the constructor, defaults to 540-bit.ExampleEncryptionfromdiffiehellmanimportDiffieHellman# automatically generate two key pairsdh1=DiffieHellman(group=14,key_bits=540)dh2=DiffieHellman(group=14,key_bits=540)# get both public keysdh1_public=dh1.get_public_key()dh2_public=dh2.get_public_key()# generate shared key based on the other side's public keydh1_shared=dh1.generate_shared_key(dh2_public)dh2_shared=dh2.generate_shared_key(dh1_public)# the shared keys should be equalassertdh1_shared==dh2_shared
Package: pydiffmap
This is the home of the documentation for pyDiffMap, an open-source project to develop a robust and accessible diffusion map code for public use. Our documentation is currently under construction, please bear with us.Free software: MIT License.InstallationPydiffmap is installable using pip.  You can install it using the commandpip install pyDiffMapYou can also install the package directly from the source directly by downloading the package from github and running the command below, optionally with the “-e” flag for an editable install.pip install [source_directory]Documentationhttps://pyDiffMap.readthedocs.io/DevelopmentTo run the all tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxIf you don’t have tox installed, you can also run the python tests directly withpytestChangelog0.2.0.1 (2019-02-04)
New Features
~~~~~~~~~~~~
* Added a more generous epsilon procedure for convenience.0.2.0 (2019-02-01)New FeaturesAdded support for user-provided kernel functions.Added a utility for building a sparse matrix from a function on the data.(Re)added separate TMDmap class wrapping base diffusion map class to
allow for easier construction of TMDmaps.Added ability to explicitly provide the sampled density for q^alpha normalization.Added Variable Bandwidth Diffusion Maps.Added a new out-of-sample extension method that should work for variable bandwidth methods.Tweaks and ModificationsChanged from exp^(-d^2) to exp^(-d^2/4) convention.Moved weight functionality into a function provided on initialization,
rather than input values, and added a helper function that allows values to
be read from a lookup table.Improved the Diffusion Map test suite.Moved out-of-sample routines into separate functions.Moved matrix symmetrization into newly made utility file.Adjusted constructor for the diffusion map to take the kernel object directly.BugfixesFixed bug where weight matrices were not included for out of sample extension.OtherMoved to MIT license.0.1.0 (2017-12-06)Fixed setup.py issues.0.1.0 (2017-12-06)Added base functionality to the code.
Package: pydiffres
Learning differetiable temporal resolutionThis work introduces DiffRes, which enables differentiable temporal resolution learning on audio spectrogram (as opposed to common fixed hop size approaches) to improve the performance of audio classification models.DiffRes-based method can achieve the same or better classification accuracy with 25%-75% fewer temporal dimensions on the feature level.This algocould also be usefulfor the compression of other time-series data, by merging non-essential time frame and preserve important frame.DiffRes:Enables differentiable temporal resolution learning to improve the performance of audio classification models.Merges non-essential time frames while preserving important frames.Acts as a "drop-in" module between an audio spectrogram and a classifier, and can be end-to-end optimized.Fun fact:Working on spectrogram with a tiny hop size / very-high temporal resolution (e.g., 1 ms) becomes computationally tractable, by selectively compressing the time dimension using DiffRes.The dynamic time compression of DiffRes act as data augmentation.UsageVery simple, just insert DiffRes between the spectrogram and your down stream task!First, install this algorithm:gitclonegit@github.com:haoheliu/diffres-python.gitcddiffres-python
pipinstall-e.# Install torch-scattercondainstallpytorch-scatter-cpygThen try out this example:importosimporttorchfrompydiffresimportDiffRes# =========> Assume you have already got a spectrogram (better in log-scale)# The spectrogram data: [Batchsize, T-steps, F-bins]data=torch.randn(1,3000,128)model=DiffRes(in_t_dim=3000,# The temporal dimension of your spectrogramin_f_dim=128,# The frequency dimension of your spectrogramdimension_reduction_rate=0.75,# How much temporal dimension to removelearn_pos_emb=False# If you like to make the resolution encoding learnable)# Use DiffRes to compress the temporal dimension# fix-resolution/hopsize Spectrogram ===========> compressed spectrogramret=model(data)# 1. Add this to your loss function: ret["guide_loss"].# 2. Use this for classification: ret["feature"].# 3. Alternatively, you can also use ret["avgpool"] or ret["maxpool] classification with/without ret["resolution_enc"] for classification.The ret variable is a python dict, which has the following keys:"score":The importance score of each spectrogram frame."guide_loss":A loss value that you need to optimize so that DiffRes can work."avgpool":The compressed feature using avgpool aggregation."maxpool":The compressed feature using maxpool aggregation."resolution_enc":The resolution encoding."feature":The concatenation of ret["avgpool"], ret["maxpool], and ret["resolution_enc"]"activeness":A value indicates the activeness of DiffRes. Higher value means DiffRes is distinguishing important frame actively."x":The original input spectrogram.You can directly using ret["feature"] for classification. Or you can DIY your own version using ret["avgpool"], ret["maxpool], and ret["resolution_enc"].You can visualize the DiffRes output dict by# Visualization of DiffRes.model.visualize(ret,savepath=module)The classification piplineComing soonCite asComing soonExamples
Package: pydiffx
pydiffx - Python Reader/Writer for DiffX Filespydiffx is a Python implementation of theDiffX specification.DiffX is a proposed specification for a structured version of Unified Diffs
that contains metadata, standardized parsing, multi-commit diffs, and binary
diffs, in a format compatible with existing diff parsers.Learn more.This module is a reference implementation designed to make it easy to read and
write DiffX files in any Python application.CompatibilityPython 2.7Python 3.6Python 3.7Python 3.8Python 3.9Python 3.10Python 3.11Installationpydiffx can be installed usingpip:pip install -U pydiffxUsing pydiffxSee thedocumentationfor tutorials and
code references.
Package: pydig
pydigpydig is a python wrapper library for the 'dig' command line tool.Versioningpydig followsSemVer(MAJOR.MINOR.PATCH) to track what is in each release.Major version number will be bumped when there is an incompatible API changeMinor version number will be bumped when there is functionality added in a backwards-compatible manner.Patch version number will be bumped when there is backwards-compatible bug fixes.Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.InstallationInstallation the package from pypi with your tool of choicepip,poetryorpipenv.pipinstallpydigUsageTo use the default resolver you can callpydig.querythis resolver will use
thedigcommand found in your$PATH.>>> import pydig
>>> pydig.query('example.com', 'A')
['93.184.216.34']
>>> pydig.query('www.github.com', 'CNAME')
['github.com.']
>>> pydig.query('example.com', 'NS')
['a.iana-servers.net.', 'b.iana-servers.net.']If your want to adjust the executable location, the nameservers to dig will
query against or would like to pass additional arguments/flags, you can
configure your own instance of a resolver. and call thequerymethod of your
custom resolver.>>> import pydig
>>> resolver = pydig.Resolver(
...     executable='/usr/bin/dig',
...     nameservers=[
...         '1.1.1.1',
...         '1.0.0.1',
...     ],
...     additional_args=[
...         '+time=10',
...     ]
... )
>>> resolver.query('example.com', 'A')
>>> ['93.184.216.34']DocumentationThe code is 150~ lines with 100% test coveragehttps://github.com/leonsmith/pydig/tree/master/pydig
Package: pydigest
Visit http://bitbucket.org/akoha/python-digest/ for further information.This library was written to aid in the implementation of HTTP Digest Authentication forPython web frameworks.It may be used as follows:>>> import time>>> import python_digest>>>>>> secret = 'b_wy%h=ts0ii3g0ulqbx8q%w(72zh%4hslu7js&(^q+_s49jj-'>>>>>> www_authenticate_header = python_digest.build_digest_challenge(time.time(), secret, 'API', 'ADAC33E813C0CE930F4744C90E02396E', False)>>> www_authenticate_header'Digest nonce="1263192256.57:c6b7a75bf9a3b925cb01f91d298b7204", realm="API", algorithm="MD5", opaque="ADAC33E813C0CE930F4744C90E02396E", qop="auth", stale="false"'>>>>>> # Send the 'WWW-Authenticate' header to the client>>> # ...>>>>>> # Receive the 'Authorization' header from the client>>> http_authorization_header = 'Digest username="erik", realm="API", nonce="1263174643.19:7f936796976b235aa92ea05333d36483", uri="/site_media/static/pinax/css/facebox.css", algorithm=MD5, response="18824d23aa8649c6231978d3e8532528", opaque="ADAC33E813C0CE930F4744C90E02396E", qop=auth, nc=00000004, cnonce="54a4b93a966e882b"'>>> digest_response = python_digest.parse_digest_credentials(http_authorization_header)>>> python_digest.validate_nonce(digest_response.nonce, secret)True>>> expected_request_digest = python_digest.calculate_request_digest('GET', python_digest.calculate_partial_digest('erik', 'API', 'test'), digest_response)>>> expected_request_digest == digest_response.responseTrueYou may choose to only accept nonces that have been generated within some time period -get_nonce_timestamp() may be used to extract the timestamp from the client-provided nonce.You may also choose to enforce the uniqueness of nonce-counts by storing the last seen noncecount in (for example) a database and verifying it after checking the request-digest.
Package: pydiggs
A Python package for Data Interchange for Geotechnical and Geoenvironmental Specialists (DIGGS).Free software: GNU General Public License v3Documentation:https://pydiggs.readthedocs.io.GitHub:https://github.com/xinp-hub/pydiggs.FeaturesValidate DIGGS instance files against DIGGS XSD, Schematron schemas, and XML Dictionaries.