Saravanan666/pypi-org huggingface dataset:
Package: python-cephclient
python-cephclient is a python module to communicate withCeph’s REST API(ceph-rest-api).This is currently a work in progress.ABOUTClientThe cephclient class takes care of sending calls to the API through HTTP and
handle the responses. It supports queries for JSON, XML, plain text or binary.WrapperThe wrapper class extends the client and provides helper functions to
communicate with the API.Nothing prevents you from calling the client directly exactly like the wrapper
does.
The wrapper exists for convenience.Development, Feedback, BugsWant to contribute ? Feel free to send pull requests !Have problems, bugs, feature ideas ?
I am using the githubissue trackerto manage them.HOW TO USEInstallationInstall the package through pip:pip install python-cephclientInstallation does not work ?python-cephclient depends on lxml which itself
depends on some packages. To install lxml’s dependencies on Ubuntu:apt-get install python-dev libxml2-dev libxslt-devInstanciate CephWrapper:from cephclient.wrapper import *

wrapper = CephWrapper(
    endpoint = 'http://apiserver:5000/api/v0.1/',
    debug = True # Optionally increases the verbosity of the client
)Do your request and specify the reponse type you are expecting.Eitherjson,xml,text(default) orbinaryare available.json:response, body = wrapper.get_fsid(body = 'json')
print('Response: {0}, Body:\n{1}'.format(response, json.dumps(body, indent=4, separators=(',', ': '))))

====

Response: <Response [200]>, Body:
{
    "status": "OK",
    "output": {
        "fsid": "d5252e7d-75bc-4083-85ed-fe51fa83f62b"
    }
}xml:response, body = wrapper.get_fsid(body = 'xml')
print('Response: {0}, Body:\n{1}'.format(reponse, etree.tostring(body, pretty_print=True)))

====

Response: <Response [200]>, Body:
<response>
  <output>
    <fsid><fsid>d5252e7d-75bc-4083-85ed-fe51fa83f62b</fsid></fsid>
  </output>
  <status>
    OK
  </status>
</response>text:response, body = wrapper.get_fsid(body = 'text')
print('Response: {0}, Body:\n{1}'.format(response, body))

====

Response: <Response [200]>, Body:
d5252e7d-75bc-4083-85ed-fe51fa83f62bbinary:response, body = wrapper.mon_getmap(body = 'binary')
# < Do something binary with 'body' >RELEASE NOTES0.1.0.5dmsimard:Add missing dependency on the requests librarySome PEP8 and code standardization cleanupAdd root “PUT” methodsAdd mon “PUT” methodsAdd mds “PUT” methodsAdd auth “PUT” methodsDonald Talton:Add osd “PUT” methods0.1.0.4Fix setup and PyPi installation0.1.0.3GET API calls under ‘/tell’ have been implemented.GET API calls are are in root (/) have been renamed to be coherent with incoming future development0.1.0.2Implemented or fixed missing GET calls (All API GET calls that are not under the ‘/tell’ namespace are now supported)Client can optionally raise an exception when requesting a unsupported body type for a provided API call (ex: requesting json through the wrapper for a call that is known to only return binary will raise an exception)Client now supports binary type responses (ex: crush map, mon map, etc)Improved the README (!)0.1.0.1First public release of python-cephclient
Package: python-cern-sso
This is a re-implementation of the Perl scriptcern-get-sso-cookie.
as a Python library. As a bonus, a shell client re-implementing (most
of) the functionality ofcern-get-sso-cookie, is also provided.PrerequisitesThis package assumes a working Kerberos and OpenSSL setup, but should be
compatible with both python 2.7 and 3.UsageThe module provides only two functions:krb_sign_onandcert_sign_on, used for authentication with Kerberos and certificates
respectively. Both take an optional cookiejar (which can be a RequestsCookieJar, or aMozillaCookieJar) which is filled during
operations. In any event, a cookie jar is also returned by both
functions.The returned cookie jar can be used directly as an argument to Requests’cookiesimportcern_ssoimportrequestsmy_url="https://my-secret-place.cern.ch"cookies=cern_sso.krb_sign_on(my_url)# Perform requestr1=requests.get(my_url,cookies=cookies)It is assumed that the user running the program is already authenticated
against Kerberos.This is what the same procedure would look like using SSL certificates:importcern_ssoimportrequestsmy_url="https://my-secret-place.cern.ch"cert_file="/home/albin/myCert.pem"key_file="/home/albin/myCert.key"cookies=cern_sso.cert_sign_on(my_url,cert_file=cert_file,key_file=key_file)# Perform requestr1=requests.get(my_url,cookies=cookies)Certain limitations apply to the certificate and key files, please see
the following section on command-line usage for further information on
this.For an example of how to use an external CookieJar, seebin/cern-get-sso-cookie.py.Usingcern-get-sso-cookie.pyJust likecern-get-sso-cookie, the Python implementation will
authenticate against a desired URL and returna Mozilla cookie-file
suitable for use with Curl or Wget.For use with Kerberos, make sure you are authenticated either via
password or a keytab:$kinitme@CERN.CH<enterpassword>Now you can perform the authentication:$cern-get-sso-cookie.py--urlhttps://cerntraining.service-now.com--kerberos# cookies.txt now contains the relevant session cookies$curl-L--cookiecookies.txt--cookie-jarcookies.txt-H'Accept: application/json'"https://cerntraining.service-now.com/api/now/v1/table/incident"In the spirit of the UNIX philosophy,cern-get-sso-cookie.pyoutputs
nothing on success. Please try--verboseor even--debugif that is
not to your liking!For authentication against a SSL certificate (and key), you first need
to process the certificate files to remove passwords and separate the
key and certificate:$opensslpkcs12-clcerts-nokeys-inmyCert.p12-outmyCert.pem$opensslpkcs12-nocerts-inmyCert.p12-outmyCert.tmp.key$opensslrsa-inmyCert.tmp.key-outmyCert.keyIt is assumed that your certificate and key files have the same base
name and are located in the same folder, and that the key has the file
ending.keyand the certificate.pem. In the example above, the base
namemyCertwas used.Finally, you can use the certificates to obtain a SSO cookie:$cern-get-sso-cookie.py--urlhttps://cerntraining.service-now.com--certmyCertFor further notes on usage, seecern-get-sso-cookie.py--help.
Package: python-certifi-win32
NOTE : This package has been replaced bypip-system-certsand is generally unmaintained.This package patches certifi at runtime to also include certificates from the windows certificate store.This will allow packages such as requests (and tools based on it, like pip) to verify tls/ssl
connections to servers who’s ca is trusted by your windows install.This module will automatically keep the merged certifi+windows cacerts file up to date, even when the
certifi module is updated.Simply install with:pip install python-certifi-win32and requests should trust your hosts if your host system does.AcknowledgementsThis module is inspired by a patch for python-certifi to implement this functionality:https://github.com/certifi/python-certifi/pull/54The method of patching at runtime is built from the autowrapt module:https://pypi.python.org/pypi/autowrapt
Package: pythonCFG
What is pythonCFG?It is an easy-to-use library to implement control flow graph generation in your emulator.All that is required is to wrap your instruction set around the two classes Instruction or Jump.Downloading the libraryIf you wish to download the library and use it, you must install Graphviz and add it to your PATH at install.https://graphviz.org/download/After installing Graphviz, you can use pip to install the library for use in your own emulator.pip install pythonCFGUsing the libraryAssuming you have an emulator which contains some pseudocode such as...emulator.execute(instruction)You will take this instruction and wrap it into a Instruction or Jump class.
An instruction can optionally take an operand, but requires a name.A jump requires a name and "success_address" (operand) for all types of JumpType. A failure address is needed in the case of a JCC.Some psuedocode to simulate this is...matchinstruction:caseINC:returnInstruction("INC")caseJUMP:returnJump("JUMP",0x30,JumpType.JMP)## NOTE: A failure address is not needed as this is an absolute jump!## NOTE: You will need to dynamically determine what your success_address and failure_address.caseCONDITIONAL_JUMP:returnJump("COND",0x30,""" JumpType.JCC_TAKEN or JumpType.JCC_NOT_TAKEN """,0x20)## NOTE: A failure address is needed as this is conditional.## It is burden upon you to determine if the jump is taken or not as it is not feasible for this library and its goals.After matching your instruction set into an Instruction or Jump, you will need to execute this instruction in the graph.
Some pseudocode after you've matched your instruction set with its respective operands.classEmulator:def__init__(self):## OTHER ARGUMENTS ARE IMPLEMENTATION SPECIFICself.graph=pyCFG(0)## Import this class and set your entry point address ( in this case 0 ).defexecute(self,instruction):self.graph.execute(matched_instruction(instruction))## We are assuming you have correctly determined operands in matched_instruction.defoutput(self):self.graph.png("some_output.png")# Returns an image of the control flow graph.Implementations?There is an example implementation in the source code of pythonRSCdev.https://github.com/Calastrophe/pythonRSC-dev/blob/master/src/pythonRSCdev/emulator.py#L41Then the matched instruction is executed inside the start() function above it.What does it look like?A large execution graph will typically look something like this ( instructions in the block depend on your architecture ).There a few things subject to change on how the control flow graph will look in coming versions in order to better analyze the graph.
Package: python-cfonb
Python-CFONBIntroductionTheCFONBformat is an old file format
for banking interchange, made by the CFONB (Comité français d’organisation et
de normalisation bancaires). It is still used today to retrieve bank statements
or make transfer orders. The specifications of the format can be found on theCFONB website.python-cfonbis a pure Python lib to read or write CFONB files, distributed under the LGPL license:import method should read file-like object (with IOString or real plain text file)export method to export Python object in CFO fileformat checker according bank specification: special char, mandatory fields, etc.The first two usecase are : read bank statements, and make transfer ordersInstallation>>> pip install python-cfonbStatement ParserYou can read a statement like this:>>> from os.path import join
>>> statement_file = open(join('cfonb', 'tests', 'bank_statement.cfo'))
>>> from cfonb import StatementReader
>>> reader = StatementReader()
>>> result = reader.parse(statement_file)
>>> statement = result[0]The statement has a header and a footer, which are both statement rows:>>> statement.header
<cfonb.parser.common.Row object at ...>
>>> statement.footer
<cfonb.parser.common.Row object at ...>A row can be read as a list:>>> statement.header.as_list()
['01', '30002', '    ', '00447', ...]Or as a dict:>>> statement.header.as_dict()
{'bank_code': '30002', 'nb_of_dec': ' ', '_5': ...}Or as an object:>>> header = statement.header.as_obj()
>>> header.bank_code
'30002'The statement lines between the header and the footer can be iterated:>>> # TODO: use an interator, and hide the parse_amount in the object
>>> from cfonb.parser.common import parse_amount
>>> for line in statement.lines:
...     l = line.as_obj()
...     print parse_amount(l.amount, l.nb_of_dec)
-2000.0
-1000.0
4000.0
-3000.0Transfer WriterPrepare the contents:>>> from datetime import datetime
>>> from cfonb.writer.transfert import Transfert
>>> transfert = Transfert()
>>> transfert.setEmeteurInfos('2000121','bigbrother','virement de test',503103,2313033,1212,datetime(2011,11,27))
<cfonb.writer.transfert.Transfert instance at ...>
>>> transfert.add('un test','littlebrother','credit agricole ile de france',50011,6565329000,100,'un peu d\'argent',6335)
<cfonb.writer.transfert.Transfert instance at ...>
>>> content = transfert.render()You can use a filename with render method:>>> transfert.render(filename='./virement.cfonb')
"0302        200012      ..."
Package: python-cfonts
██████╗ ███████╗  ██████╗  ███╗   ██╗ ████████╗ ███████╗
 ██╔════╝ ██╔════╝ ██╔═══██╗ ████╗  ██║ ╚══██╔══╝ ██╔════╝
 ██║      █████╗   ██║   ██║ ██╔██╗ ██║    ██║    ███████╗
 ██║      ██╔══╝   ██║   ██║ ██║╚██╗██║    ██║    ╚════██║
 ╚██████╗ ██║      ╚██████╔╝ ██║ ╚████║    ██║    ███████║
  ╚═════╝ ╚═╝       ╚═════╝  ╚═╝  ╚═══╝    ╚═╝    ╚══════╝This is a Python port ofcfonts. Thanks for the original code and beautiful console fonts!NOTE:This project supports Python 3.6+Installation$pipinstallpython-cfontsUsageDocumentationCommand line interface:usage:cfonts[-h][-V][-f{console,block,simpleBlock,simple,3d,simple3d,chrome,huge,grid,pallet,shade,slick}][-cCOLORS][-bBACKGROUND][-a{left,center,right}][-lLETTER_SPACING][-zLINE_HEIGHT][-s][-mMAX_LENGTH][-gGRADIENT][-i][-t]text

positionalarguments:text

optionalarguments:-h,--helpshowthishelpmessageandexit-V,--versionshowprogram'sversionnumberandexit-f{console,block,simpleBlock,simple,3d,simple3d,chrome,huge,grid,pallet,shade,slick},--font{console,block,simpleBlock,simple,3d,simple3d,chrome,huge,grid,pallet,shade,slick}Usetodefinethefontface-cCOLORS,--colorsCOLORSUsetodefinethefontcolor-bBACKGROUND,--backgroundBACKGROUNDUsetodefinethebackgroundcolor-a{left,center,right},--align{left,center,right}Usetoalignthetextoutput-lLETTER_SPACING,--letter-spacingLETTER_SPACINGUsetodefinetheletterspacing-zLINE_HEIGHT,--line-heightLINE_HEIGHTUsetodefinethelineheight-s,--spacelessUsetodefinethebackgroundcolor-mMAX_LENGTH,--max-lengthMAX_LENGTHUsetodefinetheamountofmaximumcharactersperline-gGRADIENT,--gradientGRADIENTDefinegradientcolors(separatedbycomma)-i,--independent-gradientSetthisoptiontore-calculatethegradientcolorsforeachnewline.Onlyworksincombinationwiththegradientoption.-t,--transition-gradientSetthisoptiontogenerateyourowngradients.Eachcolorsetinthegradientoptionwillthenbetransitionedtodirectly.Or generate the fonts pragramatically:fromcfontsimportrender,sayoutput=render('Hello world',colors=['red','yellow'],align='center')print(output)Supported CharactersAO22=BP33@CQ44#DR55$ES66%FT77&GU88(HV99)IW!!/JX??:KY..;LZ++,M0--'N1__`` (space)"Contributingpython-cfontsis managed bypdm, first install it:pipxinstallpdmThen, install a dependencies:pdminstall-dRun tests:$pdmrunpytesttestsLicenseThe project is originated by@dominikwilkowski, under GPLv2 license.
Ported by@frostming, under MIT license. SeeLICENSEfor detailsChangelogv1.5.2Fix the RGB color codes for truecolor system.v1.5.1Fix the truecolor display on Windows.Enable truecolor by default for Windows Terminal.Add type hints for the codebase.v1.5.0Officially drop support of Python 2.7v1.4.0Officially drop support of Python 3.5v1.3.1Fix the sdist.v1.3.0Relicense to MIT.v1.2.0Add fonttiny.v1.1.0Switch toargparseto drop dependencyclick.v1.0.0Support gradient colors and transition gradient.v0.5.0Add four new fonts and double quote as supported charater.v0.3.1Fix a bug that the background doesn't span the full width.v0.3.0Supports Python 2.7.v0.2.0Initial commit and testing.
Package: python-cgp
cgpA Python implementation of the correlation based glimpse proportion (CGP) index proposed in [1] for speech intelligibility prediction.Supports batched inputs.Installationpip install python-cgpUsageimportcgpimportsoundfileassfx,fs=sf.read("path/to/input/signal")y,fs=sf.read("path/to/reference/signal")z=cgp.cgp(x,y,fs)For batched inputs:importcgpimportnumpyasnpimportsoundfileassfx_1,fs=sf.read("path/to/input/signal/1")y_1,fs=sf.read("path/to/reference/signal/1")x_2,fs=sf.read("path/to/input/signal/2")y_2,fs=sf.read("path/to/reference/signal/2")# x_1 and x_2 might have different lengths so we pad before creating the batchlengths=[len(x_1),len(x_2)]n=max(lengths)x_1=np.pad(x_1,(0,n-len(x_1)))y_1=np.pad(y_1,(0,n-len(y_1)))x_2=np.pad(x_2,(0,n-len(x_2)))y_2=np.pad(y_2,(0,n-len(y_2)))# create the batchx=np.stack([x_1,x_2])y=np.stack([y_1,y_2])# provide the lengths argument to ensure the same result as for unbatched processingz=cgp.cgp(x,y,fs,axis=1,lengths=lengths)NoteThis implementation corrects an indexing error in the original MATLAB code inremoveSilentFrames.mwhich causes the last frame in the voice activity detection stage to be discarded.
This means the results can differ slightly from the original implementation.
To obtain the same results as the original implementation, set the_discard_last_frameargument toTrue.Speed comparison withpystoiThe paper claims CGP takes substantially less time to execute compared to baselines such as ESTOI [2].
Below is a comparison withpystoifor unbatched inputs.TODOReferences[1] A. Alghamdi, L. Moen, W.-Y. Chan, D. Fogerty and J. Jensen, "Correlation based glimpse proportion index", in Proc. WASPAA, 2023.[2] J. Jensen and C. H. Taal, "An algorithm for predicting the intelligibility of speech masked by modulated noise maskers", in IEEE/ACM Trans. Audio, Speech, Lang. Process., 2016.
Package: python-challenge-bypass-ristretto
python-challenge-bypass-ristrettoPython bindings for Brave'sprivacy passlibrary
using the providedffiAPIs.UsageThe API largely mirrors that of the underlying Rust library with a few classes thrown in.
For example:>>> from challenge_bypass_ristretto import  RandomToken
>>> print(RandomToken.create().blind().encode_base64())
QxE220HfZvvOJSNdDx3hgYNfQntxeT+mkRr55LNMNyYdXdFOfkrHRoQz+MXlqfyoiWPWc7dG3k4sa5ZWDv+9WtPkZf1uZVhTwBW4YKgyPXK3jj4Ig7kKDjcGMGtoCdgJHow to installBinary wheels for Linux (manylinux2010), macOS, and Windows are distributed on PyPI.pip install python-challenge-bypass-ristrettoHow to buildThe Rust FFI library is a git submodule, so to clone all sources needed for a build:git clone --recursive https://github.com/LeastAuthority/python-challenge-bypass-ristrettoThen, with the Rust and Python toolchains installed:python setup.py build sdist bdist_wheel
pip install --editable .There is also Nix-based package which manages most of this complexity for you and only requires a checkout:nix-buildLicenseCurrently the same license as the Brave's library, Mozilla Public License v2.CopyrightLeast Authority TFA GmbH
Package: python-chamelboots
Version v0.0.28.This is a proof of concept package. It came out of my disdain for typing any sort of HTML tag.I often code inside ofJupyter notebooks. Sometimes I want to display custom HTML inside of those notebooks.The issue is that writing complex HTML such as a list by hand is tedious and error-prone. Template libraries do help, but they introduce their own clumsy syntax into HTML. And the templates are often very long strings that clutter the notebook. Storing the templates in files takes my mind away from the notebooks.Then I discovered the template libraryChameleonthat uses valid HTML as its template. Brilliant!Though I would still have to type the templates which are HTML tags which takes me back to my original disdain of typing HTML tags.This library addresses that issue. It also adds some utilities that I use when coding inside notebooks.Here is an examplewhere I used chamelboots to insert a link menu into a notebook. The links were references to anchor tags inserted into a very long cell output. It made it easier to navigate the output.The navigation can even happen during code execution.Generated with cookiecutter-pylibrary.Free software: BSD 2-Clause LicenseInstallationpipinstallchamelbootsYou can also install the in-development version withpipinstallhttps://github.com/dm-wyncode/python-chamelboots/archive/master.zipIt is still possible to install by cloning this repository, activating a virtual environment, and running the following:pythonsetup.pyinstallDocumentationhttps://python-chamelboots.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 toxChangelog0.0.0 (2019-11-05)First release on PyPI.
Package: python-changelog
Changelog GeneratorA module that generates changelogs based on git tags.
It uses conventional commits (conventionalcommits.org) to read and scope commits.
Markdown is used for formating.Commands$ pychangelog generate[<path>] [--branch=<string>] [--types=<list>] [--bodytags=<list>]generates new CHANGELOG.md file at the repo rootoverrides old CHANGELOG.md$ pychangelog add[<path>] [--branch=<string>] [--types=<list>] [--bodytags=<list>]keeps the content of old CHANGELOG.md while appending new versions$ pychangelog printout[<path>] [--branch=<string>] [--types=<list>] [--bodytags=<list>]prints the generated changelog in the terminal instead of writing it in the CHANGELOG.mddoes not touch CHANGELOG.mdOptionsOptionFormatDescriptionDefaultpathTEXTpath to root of the git repository.--branchTEXTgit branchmain--typesTEXT comma seperated listcommit types to show in changelogfeat,fix,chore,docs,refactor,test--bodytagsTEXT comma seperated listbody tags that schould be shown in changelogBREAKING CHANGE,MAJORInstalationYou can install the changelog generator via PyPI:pip install python-changelog
Package: python-chattrainer
InstallationThe aim of the project is to build a software solution to train people and employees to interact with the chatting and messaging consoles. This can also be used by people to train themselves how to chat with people without conveying false sentiments to the receiver. Customer care employees can be trained using this software to make them efficient communicators and agents who convey positive sentiment to the clients of the company.Recommendation : Install ChatterBot module and nltk and sklearn modules before using this module to avoid issues while installation.Usages : python-chattrainer$pipinstallpython-chattrainer
$python-chattrainerLicenseMITAuthorSahil Ahuja
Package: python-cheatsheet
python_cheatsheetA-Z Python CheatsheetFree software: MIT licenseDocumentation:https://python-cheatsheet.readthedocs.io.FeaturesSphinx Documentation!TODOCreditsImagination sparkedhere. This package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2018-09-10)First release on PyPI.
Package: python-chefkoch
python_chefkochPython library to retrieve data from chefkoch.deInstallationUse the package managerpipto installpython_chefkochpip install python_chefkochExamples:Retrieving daily recommendationsfrompython_chefkochimportchefkochrecipes=chefkoch.get_daily_recommendations(category="backe")forrecipeinrecipes:print("\n"+str(recipe))Retrieving a random recipefrompython_chefkochimportchefkochrecipe=chefkoch.get_random_recipe()print(recipe.modify_portions(portions=6))forstepinrecipe.steps:print("Next -> "+step)Searching for a specific recipe with filterfrompython_chefkochimportchefkochprint(chefkoch.get_specifications())recipes=chefkoch.search(search_term="Lasagne",filters={"page":2,"sort":"rating","duration":30,"difficulty":{"easy":True,"medium":True,"hard":False}},specifications=["vegetarisch","gemuese"])print(recipes)Recipe interactionsnametypedescriptionget_next_stepmethodreturns the next step of the recipe. Throws EndOfRecipeError when the end is reachedmodify_portionsmethodmodifies the portions and returns the new dict for ingredientsinfo_dictattributecontains all information retrived directly from javascript from the chefkoch pageingredientsattributedictionary with ingredients as key and the amount as values. Everything is a stringstepsattributelist with all steps. Simply the instruction text split by '.'imageattributehyper-link to the main image...attributesmore attributes available that are self-explainatoryContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.