Saravanan666/pypi-org huggingface dataset:
Package: penchmark
Python benchmark libraryInstallationpipinstallpenchmark
pipinstallpenchmark[charts]ExampleClassesCallee,InDatafrompenchmarkimportbenchmark_and_print,Callee,InDatacallees=(Callee(callee_name='mul',callee=lambdax:x[0]*x[1]),Callee(callee_name='nop',callee=lambdax:x))dataset=(InData(name='small-data',data=(2,1),count_of_call=100000),InData(name='big-data',data=(200,10),count_of_call=1000),InData(name='skipped-data',data=(1,1),count_of_call=0))benchmark_and_print(callees,dataset)Tuplesfrompenchmarkimportbenchmark_and_printcallees=(('mul',lambdax:x[0]*x[1]),('nop',lambdax:x))dataset=(('small-data',(2,1),100000),('big-data',(200,10),1000),('skipped-data',(1,1),0))benchmark_and_print(callees,dataset)Auto generate names of calleesfrompenchmarkimportbenchmark_and_printdefmul(x):returnx[0]*x[1]defnop(x):returnxdataset=(('small-data',(2,1),100000),('big-data',(200,10),1000),('skipped-data',(1,1),0))benchmark_and_print((mul,nop),dataset)Markdown resultsmall-datacallee_nameelapsedrationop0.00501.0000mul0.00801.5842big-datacallee_nameelapsedrationop0.00001.0000mul0.00011.7201Summarycallee_namemeanmediannop1.00001.0000mul1.65211.6521Console mode result...benchmark_and_print((mul,nop),dataset,markdown=False)SMALL-DATA

callee_name      elapsed    ratio
-------------  ---------  -------
nop               0.0050   1.0000
mul               0.0079   1.5944

BIG-DATA

callee_name      elapsed    ratio
-------------  ---------  -------
nop               0.0001   1.0000
mul               0.0001   1.7565

SUMMARY

callee_name      mean    median
-------------  ------  --------
nop            1.0000    1.0000
mul            1.6754    1.6754Callee with exceptionsfrompenchmarkimportbenchmark_and_printdefcallee_with_exceptions(x):ifnotx:raiseException()callees=(('callee-with-exceptions',callee_with_exceptions),('callee-without-exceptions',lambdax:None))dataset=(('valid-data',True,10),('invalid-data',False,10),)benchmark_and_print(callees,dataset)valid-datacallee_nameelapsedratiocallee-without-exceptions0.000001callee-with-exceptions0.000002.36735invalid-datacallee_nameelapsedratiocallee-without-exceptions0.000001callee-with-exceptionsERRORSummarycallee_namemeanmediancallee-without-exceptions11Expected using InDatafrompenchmarkimportbenchmark_and_print,InDatadefmul2_1(sequ):return[x*2forxinsequ]defmul2_2(sequ):return[x+xforxinsequ]dataset=(InData(name='small-data',data=(2,1),count_of_call=100000,expected=[4,2]),InData(name='big-data',data=(200,10),count_of_call=1000,expected=[400,20]),InData(name='skipped-data',data=(1,1),count_of_call=0,expected=[2,2]))benchmark_and_print((mul2_1,mul2_2),dataset)Expected using tuplesfrompenchmarkimportbenchmark_and_printdefmul2_1(sequ):return[x*2forxinsequ]defmul2_2(sequ):return[x+xforxinsequ]dataset=(('small-data',(2,1),100000,[4,2]),('big-data',(200,10),1000,[400,20]),('skipped-data',(1,1),0,[2,2]))benchmark_and_print((mul2_1,mul2_2),dataset)small-datacallee_nameelapsedratiomul2_20.021141mul2_10.023171.09603big-datacallee_nameelapsedratiomul2_20.000211mul2_10.000221.01147Summarycallee_namemeanmedianmul2_211mul2_11.053751.05375
Package: pencilcase
import pencilcasepencilDrop-in debugger that allows you to write code while you debug. ✏️Pencil it in! Write code by debugging your code. Lines of code are
automatically inserted into your file. Clean them up later and voilà!pencilcase.pencil()timerSuper simple drop-in profiler. ⏱Context manager that counts how much time is spent across all executions
of the contained code block, storing it in seconds to the specified global
variable. Prints out the value of that variable each time it is run.with pencilcase.timer('weaving_baskets'):
    weave_baskets()Alternatively, apply as a decorator to a function to count time spent in
that function.@pencilcase.timer('weaving_baskets')
def weave_baskets():
    ...eraserThis is a totally unnecessary feature, but who has a pencil case without an eraser??pencilcase.eraser()microfilmPretty-print the given dict as JSON. 🎞blob = ...
pencilcase.microfilm(blob)butterfly_netContext manager that catches all exceptions raised within, doing nothing but
printing their lovely exception traces and then letting them be free. 🦋with pencilcase.butterfly_net():
    ...
Package: pencilctl-lite
pencilctl_liteRepositório contendo o script pencilctl_lite, responsável por fazer deploy de projetos que utilizem uma estrutura de docker stack, mas que não serão executados no cluster principal da Pencil.Quick StartPara utilizar este script, existem algumas pré-requisitos:Um cluster swarm tem que existir na máquina em que ele será executado;O projeto que será alvo do deploy deve possuir uma pastadocker/production, contendo os arquivos Dockerfile (caso as stacks exigam imagens customizadas), e os arquivos de stack, que serão utilizados para realizar o deploy do projeto.O diretóriodocker/production, deve ter a seguinte estrutura:xpto: Diretório que centraliza todos os arquivos de uma stack. Um projeto pode ter mais de uma stack, por exemplo, uma stack para fazer deploy do servidor, e outra para um http proxy ou um redis. O pencilctl _lite permite fazer deploy de multiplas stacks. Diretório obrigatório;xpto/stacks: Diretório contendo os arquivos de stack do projeto.  Diretório obrigatório;xpto/nginx_confs: Diretório contendo arquivos de configuração do nginx. Diretório optativo;xpto/server: Diretório contendo o Dockerfile do serviço chamado server, declarado no arquivo de stack. Diretório optativo;xpto/db: Diretório contendo o Dockerfile do serviço chamado db, declarado no arquivo de stack. Diretório optativo;xpto/nginx: Diretório contendo o Dockerfile do serviço chamado nginx, declarado no arquivo de stack Diretório optativo;Essa estrutura deve existirno repositório do projetoque será alvo do deploy. O papel do script é apenas acessar esse diretório e automatizar os processos de build e deploy. Essa estrutura também padroniza o nome/tag das imagens que são construidas via./pencilctl_lite build.Supondo a stack xpto, o comando para buildar a imagem do server seria:./pencilctl_lite.sh build --docker_path=/home/user/xpto/docker --service=server --stack=xptoEste comando geraria a imagem127.0.0.1:5000/xpto_server:stable-prod.O comando para fazer deploy da stack:./pencilctl_lite.sh deploy --docker_path=/home/user/xpto/docker --stack=xptoEste comando geraria a stackxpto_prod.Para saber quais comandos o script possui e quais argumentos ele recebe, basta executar:./pencilctl_lite.sh help
Package: pencil-pusher
📝 pencil_pusherA Github Action that creates and publishes source documentation to the repository's wiki. THIS IS NOT A DOCUMENTATION GENERATION TOOL. This tool is designed to take pre-generated documentation and publish it to a the source repository's github wiki page. This removes the need to host a webpage for documentation and allows for an easy way to include documentation generation in your CI/CD pipeline. To get started using this action in your repository check out theGeneral Usagepage of our wiki.Tech Stackdockerpythonpydoc-markdownthis project usessnake-charmerfor automatic releases
Package: pencils
pencilsPancils is a Python library with a colletion of color palettes.Currently available palettes:Everything fromflatuicolors.comMost of the palettes frommaterialui.coTailwindcolor palette.Bootstrapcolor palette.CSS (HTML) color names.Features:A lot of colors from manually picked palettes.100% type safe.Best integration with IDEs, autocomplete all the way down.Includes multiple representations (HEX,RGB,HSL) for each color.Zero-dependency.Installatiion:python3-mpipinstallpencilsUsageGet the hex representation of "Sunflower" color fromDutch PaletteofFlat UI Colors:importpencilspencils.NLPalette.colors.sunflower.value.hex# 'FFC312'The color:◼◼◼That's a lot of attributes and each one of them has a meaning:NLPaletteis an instance of thepencils.Paletteclass which holds information about palette name, author, source URL, and even emojis associated with the palette.colorsattribute is anenum, a subclass ofpencils.Colors.sunfloweris the color ID.valueis used to get the value of the enum. The value is an instance ofpencils.Colorclass which contains operations on colors.hexis a lowercase hex representaion of the color without#.Make the color darker:color=pencils.NLPalette.colors.sunflower.value.hslcolor.lightness=.2color.hex# '664c00'The color:◼◼◼Get random color from a random palette:pencils.random_palette().random_color()# Color(name='Unmellow Yellow', hex='fffa65')The color:◼◼◼
Package: pencompy
Pencom PackagePackage to control Pencom serial relay boards through an Ethernet adaptor
using Python.Example:from time import sleep
from pencompy import pencompy

hub = pencompy( 'host.test.com', 4008 )

# Turn the first relay on
hub.set( 0, 0, True )

# Pause for a second
sleep(1.)

# Turn the first relay off
hub.set( 0, 0, False )

# Close the interface
hub.close()
Package: pend
This is wrapper of pendulum.Pendulumis too long and a hassle to type. Butpendis easy. That’s just it.pendulum repositorypendulum siteInstallpip install pendUse>>>importpend>>>now_in_paris=pend.now('Europe/Paris')>>>now_in_paris'2016-07-04T00:49:58.502116+02:00'# Seamless timezone switching>>>now_in_paris.in_timezone('UTC')'2016-07-03T22:49:58.502116+00:00'>>>tomorrow=pend.now().add(days=1)>>>last_week=pend.now().subtract(weeks=1)>>>past=pend.now().subtract(minutes=2)>>>past.diff_for_humans()>>>'2 minutes ago'>>>delta=past-last_week>>>delta.hours23>>>delta.in_words(locale='en')'6 days 23 hours 58 minutes'# Proper handling of datetime normalization>>>pend.datetime(2013,3,31,2,30,tz='Europe/Paris')'2013-03-31T03:30:00+02:00'# 2:30 does not exist (Skipped time)# Proper handling of dst transitions>>>just_before=pend.datetime(2013,3,31,1,59,59,999999,tz='Europe/Paris')'2013-03-31T01:59:59.999999+01:00'>>>just_before.add(microseconds=1)'2013-03-31T03:00:00+02:00'
Package: pendant
pendantPython 3.6+ library for submitting to AWS Batch interactively.❯pipinstallpendantFeatures:Submit Batch jobsRead the documentation at:pendant.readthedocs.ioEnd-to-end ExampleThe principle object for deploying jobs to AWS Batch is the Batch job definition.
Every Batch job definition has a name, parameters, and some form of optional parameter validation.>>>frompendant.aws.batchimportBatchJob,JobDefinition>>>frompendant.aws.s3importS3Uri>>>frompendant.aws.exceptionimportS3ObjectNotFoundError>>>classDemoJobDefinition(JobDefinition):...def__init__(self,input_object:S3Uri)->None:...self.input_object=input_object......@property...defname(self)->str:...return'demo-job'......defvalidate(self)->None:...ifnotself.input_object.object_exists():...raiseS3ObjectNotFoundError(f'S3 object does not exist:{self.input_object}')Let's instantiate the definition at a specific revision and validate it.>>>definition=DemoJobDefinition(input_object=S3Uri('s3://bucket/object')).at_revision('6')>>>definition.validate()NoneValidation is also performed when a job definition is wrapped by aBatchJobso the call to.validate()above was redundant.
Wrapping a job definition into a Batch job is achieved with the following, but no useful work will happen until the job is submitted.>>>job=BatchJob(definition)Now we are ready to submit this job to AWS Batch!
Submitting this Batch job is easy, and introspection can be performed immediately:>>>response=job.submit(queue='prod')>>>job.is_submitted()TrueWhen the job is in aRUNNINGstate we can access the job's Cloudwatch logs.
The log events are returned as objects which have useful properties such astimestampandmessage.>>>forlog_eventinjob.log_stream_events():...print(log_event)LogEvent(timestamp="1543809952329",message="You have started up this demo job",ingestion_time="1543809957080")LogEvent(timestamp="1543809955437",message="Configuration, we are loading from...",ingestion_time="1543809957080")LogEvent(timestamp="1543809955437",message="Defaulting to approximate values",ingestion_time="1543809957080")LogEvent(timestamp="1543809955437",message="Setting up logger, nothing to see here",ingestion_time="1543809957080")And if we must, we can cancel the job as long as we provide a reason:>>>response=job.terminate(reason='I was just testing!')
Package: pendfetch
Show off your terminal, in style.A nice relaxing double pendulum simulation using ASCII, able to simulate multiple pendulums at once, and provide tracing of pendulums as well as providing some system information.
  If you spot any bugs or features that need adding (especially with the specs), just open an issue :)FeaturesAs mentioned, able to simulate multiple pendulums at once.Able to specify the weight and mass of pendulums to create different butterfly effects.Uses equations fromhere.If -s is used, it grabs system specs and displays them.(hi r/unixporn)Obviously a lot could be done to it (see below the Args), Any contributions are appreciated)Quickstart:Dependencies:Python 3.2+,curses (standard on UNIX) or relevent windows port, psutils if you want to use -sGithubClone usinghttps://github.com/Nekurone/pendfetch.gitor download the zip.Extract if necessary and head inside the folder.python3 pendulum.py [args]Pippython3 -m pip install pendfetch(orpip install pendfetch)pendfetch [args]Don't forget to include-sfor neofetch feature :)ArgsVisualshelp (-h)trace (-t)tracedrop (-tD)specs (-s)Maths and Pendulum settingspendulum (-p)speed (-sP)gravity (-g)mass (-m)length (-l)Window settingsHEIGHT (-H)WIDTH (-W)dHEIGHT (-dH)dWIDTH (-dW)Visuals--help (-h)Spits out a fairly standard argparse help message. Note this is printed out when the program is run anyway.type: None, default: None
 setting in example: -h--trace (-t)Enables 'tracing', a faint line behind the pendulums that fades.type: bool, default: off,
 setting in example: -t--traceDrop (-tD)Controls the rate at which the trace from -t fades. Higher is faster fading.type: float, default: 1.0,
 setting in example: -t -tD 0.5--specs (-t)Enables showing system info, note this feature is still a WIP, any bugs or issues just let me know.type: bool, default: off,
 setting in example: -sMaths and Pendulum Settings--pendulum (-p)Number of pendulums to simulate at once. Combine with the gravity settings and some speed settings for some really pretty visuals.type: int, default: 1,
 setting in example: -p 300--speed (-sP)Multiplier for speed of simulation. Around 0.5-1.5 is a good rangetype: float, default: 1.0,
 setting in example: -sP 3.0--gravity(-g)Controls the strength of gravity, note, this directly affects the speed of the simulation. So slowing down is recommended.type: float, default: 9.81,
 setting in example: -g 1--mass (-m)Controls the mass of the pendulums, useful mostly for butterfly effectstype: float, default: 100.0,
 setting in example: -m 300 -sP 0.2--length (-l)Controls the length of the arms of the pendulums, useful mostly for butterfly effectstype: float, default: 250.0, setting in example: -l 150 -sP 0.3todo: Window settingsIf you have any suggestions, or anything you'd like to add (or, more likely you found a bug) just open a PR :)
Package: pending
Pending events awaitable for asyncioInstantiate a Pending awaitable, register events scheduled to be returned after
a given number of seconds, and then await.Once the first one (with smallest scheduling delay) is returned, re-await to get
the next one, and so on. Optionally cancel or postpone (reschedule) scheduled events.Example of use:>>>importasyncio>>>frompendingimportPending>>>events=Pending()>>>events.schedule("second",10)>>>events.schedule("first",9)>>>asyncdefmain():...foriinlen(events):...evt=awaitevents...print(evt)...>>>asyncio.run(main())firstsecondNote: the registered "event" can be any hashable object.
Package: pendo
pendoAn unofficial Python HTTP client forPendo.FeaturesServer Side Track EventsRequirementsPython 3.9+InstallationpipinstallpendoUsageServer Side Track EventsA Pendo Admin can access thependo_integration_keyin your app settings via: Subscription Settings > Choose your App > App Details.frompendoimportPendoclient=Pendo(pendo_integration_key="<YOUR_INTEGRATION_KEY>")response=client.track({"event":"MyEvent","visitorId":"00000-0000-0000-0000","accountId":"11111-1111-1111-1111","timestamp":int(time.time()*1000),})assertresponse.status_code==200ContributingRead thecontributing guide.
Package: pendrell
Pendrell:  Twisted HTTP/1.1 User Agent for the Programmable WebPendrell augments the twisted.web framework with an HTTP 1client that has
several advantages over prior art (or at least urllib2 and twisted.web.client):HTTP 1.1 support:TE/transfer-encoding support for chunked, gzip, and deflate encodingsAbility to simultaneously maintain multiple persistent connections.Transparent gzip and deflate Content-encoding support.Ability to stream data, by performing call-backs with data chunks,
alleviates the need to buffer large files.Advanced gzip support accommodates incremental decoding of chunked streams.Asynchronous (twisted) API.Integration with cookielib, and compatibility with urllib2.Request API.Proxy Support.ChangelogVersion 0.3.7Make HTTP more less-noisy ;pVersion 0.3.6Make HTTP less noisy.Version 0.3.5Typo fix in version compatibilityVersion 0.3.4Much less loggingVersion compatibility object eliminates build-time requirements on TwistedVersion 0.3.3LRU requester cache cleanup.Version 0.3.2Support servers that neither provide a content-length nor use chunked
encoding.Version 0.3.1Authorization caching eliminates unnecessary unauthorized responses.Version 0.3.0Allow multiple Authenticators to be installed into Agent.authenticators.Modify errors.UnauthorizedResponse to handle multiple WWW-Authenticate
header values.ContactOliver Gould <ver at olix0r.net>
E242 A7F8 0901 CB63 EBA9  62EA 90F1 192F 0294 0825http://pendrell.olix0r.net/http://github.com/olix0r/tx-pendrellLicenseCopyright (c) 2010  Oliver V. GouldPermission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the “Software”),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Package: pendsim
pendsim: an Inverted Pendulum-On-A-Cart Sandbox!A simple inverse-pendulum simulator, with a module to render animations of the simulation and API for custom controllers. See theExample Video.It uses rk45 to simulate a dynamic model of the simple inverse pendulum on a cart:Inverted Pendulum.For more details on the package features, as well as how it can be used in an educational context, see the pending JOSE submission: (Markdown), (PDF)InstallationThis package is published on PyPi. Install withpip:pipinstallpendsimRequires Python 3.DocumentationThe Full Package Documentation is available here.
Package: pendulo
PenWin32 (Pendulo) python API calling interfaceWhat is it?A python package enabling users to call a minimal set of PenWin32.dll API functions and subroutines within python scripts. For latest python version e.g. 3.10. 32 bits only.InstallationWindows onlypip install penduloRequirements (32 bits)python 3.10numpy 1.21.3 (python 3.10)Pendulo kernel library (penwin32.dll) 2022+valid Pendulo_size and Pendulo_version licenseThis tool expects Picwin32.dll to be in the PATH or in one of the following folders:%localappdata%/Programs/Safege/Pendulo or
                %localappdata%/Programs/Suez/Pendulo or
[ C: or D: ] / 'Program Files (x86)/Safege/Pendulo_'
             + ['' or '_fr' or '_uk' or '_esp' or '_eng'] + ['' or '_ck']With custom installations, PENDULO_DIR environment variable can be set to define the path.ContentThe package provides:pen_vers = init(debug=0) functionclose() functionvdat, vval = ts(id_elem, typelt, attr) retrieves the result TS for element ‘id_elem’ of type ‘typelt’ and attribute ‘attr’.Example of ‘typelt’ and ‘attr’:‘LINK’ or ‘ARC’: ‘Q’‘NODE’ or ‘NOEUD’: ‘P’, ‘CH’ or ‘HH’‘TANK’ or ‘RESERVOIR’: ‘NC’ or ‘NV’, ‘VO’‘PUMP’ or ‘POMPE’: ‘PC’, ‘VR’, ‘Q’‘VANNE’ or ‘ROBINET’ or ‘REGULATEUR’: ‘DO’, ‘PC’, ‘Q’‘ANB’: ‘Q’, ‘VO’, ‘NC’ or ‘NV’Example# -*- coding: utf-8 -*-
from logging import root
import os.path as OP
import pendulo
from ganessa.plot import pageplot
from ganessa.util import winstr, strf3
import ganessa.sim as pic


folder = OP.dirname(__file__)
# init pendulo
pendulo.init()
model = OP.join(folder, 'VIROFL_1.PEN')
# load Pendulo model
print('===\nChargement de ', model)
istat = pendulo.loadmodel(winstr(model))
if not istat:
    print(' * Erreur au chargement *')

# get unit for demand at node
cs_coef, cs_name, cs_ref = pendulo.get_unit_info('CS')
print(f'Unit CS: {cs_name} = {cs_coef} {cs_ref}')
# get demand value at a given node
node = 'PEN1'
idx, z_node, cs_node, ch_node = pendulo.get_node(node)
print(f'Demand at node {node} is: {strf3(cs_node)} {cs_name}')
# set / change demand boundary condition: sequence of (time, value) tuples
stat = pendulo.set_node_boundary_condition(node, [(0, cs_node), (0.5, 3*cs_node)])
print('Changing demand', 'OK' if stat else '*failed*')

# run simulation
print('Starting simulation ... please wait')
stat = pendulo.run_simulation(horizon=20, storage_factor=10)
print('Simulation','OK' if stat else '*failed*')
# collect results
results = []
for node in ['PEN1', '36N646', '36N495', '36N488', '36N463', '36N35']:
    t, v = pendulo.ts(winstr(node), typelt='NODE', attr='CH')
    if len(t) and len(v):
        results.append((node, t, v))
fname = OP.join(folder, 'Simulation_1.png')
pageplot(results, 'Simulation #1 - Charge aux noeuds', 2, 3, fname, inter=False, orient='h')
pendulo.close()
Package: penelopa
Penelopa: AI-driven Codebase ModifierPenelopa is an innovative tool designed to leverage OpenAI's GPT models for intelligent and automated codebase modifications. It comprehends and executes code changes based on natural language task descriptions, bringing a new level of efficiency to code maintenance.InstallationInstall Penelopa easily using pip:pipinstallpenelopaUsageRun Penelopa from the command line with various options:penelopa--task=<taskdescription>--gpt_key=<OpenAIGPTkey>--config_path=<pathtoconfig>--logging=<True/False>--project=<projectname>--path=<projectpath>--model=<GPTmodel>--temperature=<float>--top_p=<float>--max_tokens=<int>--gitignore=<True/False>--listing=<pathtolistingfile>--updated_listing=<True/False>--assistant_id=<assistantid>Arguments--config_path: Path to the YAML configuration file.--logging: Enable verbose logging (True/False).--project: Name of the project for contextual understanding.--path: Path to the project directory.--task: Description of the task for the AI to understand and perform.--gpt_key: API key for OpenAI services.--model: OpenAI GPT model to use.--temperature: Level of creativity for AI responses.--top_p: Diversity of AI responses.--max_tokens: Maximum word count for AI responses.--gitignore: Consider .gitignore rules (True/False).--listing: Path to project file listing for context.--updated_listing: Flag to update the listing file (True/False).--assistant_id: Identifier for the AI assistant instance.ContributingYour contributions are welcome! Feel free to createissue requeststo enhance Penelopa's functionalities.LicenseThis project is licensed under theGNU Affero General Public License v3.0.