Saravanan666/pypi-org huggingface dataset:
Package: pypolys
pypolys packagePython implementation of polynomials is presented.InstallationSee doc/quickstart.txtUsage>>>fromfractionsimportFraction>>>frompypolys.polysimportPoly>>>p=Poly(2,3)+4# 2 * x ** 3 + 4>>>pPoly(4)+Poly(2,3)>>>p.is_zero()False>>>len(p)# the number of terms2>>>p*Poly(3,5)Poly(12,5)+Poly(6,8)>>>p**2Poly(16)+Poly(16,3)+Poly(4,6)>>>p.diff()Poly(6,2)# 6 * x ** 2>>>p.integrate()Poly(4,1)+Poly(Fraction(1,2),4)# 4 * x + x ** 4 / 2>>>p.combine(Poly(5,7))Poly(4)+Poly(250,21)>>>p.eval(Fraction(3,5))Fraction(554,125)>>>p.eval(0.6)4.432>>>p.leading_term(key=Poly.key_deg)Poly(2,3)>>>p.leading_monomial(key=Poly.key_deg)Poly(1,3)>>>p.leading_coefficient(key=Poly.key_deg)2>>>Poly(6,5)/Poly(3,2)# for monomials onlyPoly(2,3)>>>Poly(6,3).lcm(Poly(3,2))Poly(1,3)>>>list(p.iterterms())[Poly(4),Poly(2,3)]>>>sorted(term.degree()forterminp.iterterms())[0,3]>>>[p[i]foriinrange(8)]# coefficient list[4,0,0,2,0,0,0,0]ContributorsAndrzej Kapanowski (project leader)Adrian SzumskiEOF
Package: pypoman
Polyhedron manipulation in PythonThis library allows common operations overconvex polyhedrasuch aspolytope projectionandvertex enumeration.See theAPI documentationfor details.InstallationInstall system packages (here for Debian-based distributions) for Python and GLPK by:$sudoapt-getinstallcythonlibglpk-devpythonpython-devpython-pippython-scipyThen, install the library by:$pipinstallpypomanExamplesVertex enumerationWe can compute the list of vertices of a polytope described in halfspace representation by $A x \leq b$:importnumpyasnpfrompypomanimportcompute_polytope_verticesA=np.array([[-1,0,0,0,0,0,0,0,0,0,0,0],[0,-1,0,0,0,0,0,0,0,0,0,0],[0,0,-1,0,0,0,0,0,0,0,0,0],[0,0,0,-1,0,0,0,0,0,0,0,0],[0,0,0,0,-1,0,0,0,0,0,0,0],[0,0,0,0,0,-1,0,0,0,0,0,0],[0,0,0,0,0,0,-1,0,0,0,0,0],[0,0,0,0,0,0,0,-1,0,0,0,0],[0,0,0,0,0,0,0,0,-1,0,0,0],[0,0,0,0,0,0,0,0,0,-1,0,0],[0,0,0,0,0,0,0,0,0,0,-1,0],[0,0,0,0,0,0,0,0,0,0,0,-1],[1,1,1,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,0,0,0,0,0,0],[0,0,0,0,0,0,1,1,1,0,0,0],[0,0,0,0,0,0,0,0,0,1,1,1],[1,0,0,1,0,0,1,0,0,1,0,0],[0,1,0,0,1,0,0,1,0,0,1,0],[0,0,1,0,0,1,0,0,1,0,0,1]])b=np.array([0,0,0,0,0,0,0,0,0,0,0,0,2,1,2,2,1,2,3])vertices=compute_polytope_vertices(A,b)Halfspace enumerationThe other way round, assume we know the vertices of a polytope, and want to get its halfspace representation $A x \leq b$.importnumpyasnpfrompypomanimportcompute_polytope_halfspacesvertices=map(np.array,[[1,0,0],[0,1,0],[1,1,0],[0,0,1],[0,1,1]],)A,b=compute_polytope_halfspaces(vertices)Polytope projectionLet us project an $n$-dimensional polytope $A x \leq b$ over $x = [x_1\ \ldots\ x_n]$ onto its first two coordinates $proj(x) = [x_1 x_2]$:fromnumpyimportarray,eye,ones,vstack,zerosfrompypomanimportplot_polygon,project_polytopen=10# dimension of the original polytopep=2# dimension of the projected polytope# Original polytope:# - inequality constraints: \forall i, |x_i| <= 1# - equality constraint: sum_i x_i = 0A=vstack([+eye(n),-eye(n)])b=ones(2*n)C=ones(n).reshape((1,n))d=array([0])ineq=(A,b)# A * x <= beq=(C,d)# C * x == d# Projection is proj(x) = [x_0 x_1]E=zeros((p,n))E[0,0]=1.E[1,1]=1.f=zeros(p)proj=(E,f)# proj(x) = E * x + fvertices=project_polytope(proj,ineq,eq,method='bretl')if__name__=="__main__":# plot projected polytopeimportpylabpylab.ion()pylab.figure()plot_polygon(vertices)See alsoA short introduction toPolyhedra and polytopesKomei Fukuda'sFrequently Asked Questions in Polyhedral ComputationThePolyhedronclass inSageStabiliPy: a Python package implementing a more general recursive method for polytope projection
Package: pypom-axe
pypom-axe integrates the aXe accessibility testing API with PyPOM.RequirementsYou will need the following prerequisites in order to use pypom-axe:Python 2.7 or 3.6PyPOM >= 1.2.0InstallationTo install pypom-axe:$pipinstallpypom-axeUsagepypom-axewill run the aXe accessibility checks by default whenever itswait_for_page_to_load()method is called.If you overloadwait_for_page_to_load(), you will need to callsuper([YOURCLASS NAME],self).wait_for_page_to_load()within your
overloaded method.You can disable accessibility tests by setting the environment variableACCESSIBILITY_DISABLEDtotrue.You canenableoutput of the JSON results by setting the environment variableACCESSIBILITY_REPORTINGtotrue. This will output files to ./results/,
which must be created if it does not already exist.base.pyfrompypom_axe.axeimportAxePageasPageclassBase(Page):defwait_for_page_to_load(self,context=None,options=None,impact=None):super(Base,self).wait_for_page_to_load()self.wait.until(lambdas:self.seed_urlins.current_url)returnselfYou also have the option to customize the accessibility analysis using the
parameterscontext,options, andimpact.contextandoptionsdirectly reflect the parameters used in axe-core.
For more information oncontextandoptions, view theaXe
documentation here.The third parameter,impact, allows you to filter violations by their impact
level.The options are'critical','serious'and'minor', with the
default value set toNone.This will filter violations for the impact level specified, andall violations with a higher impact level.frompypom_axe.axeimportAxePageasPageclassBase(Page):defwait_for_page_to_load(self,context=None,options=None,impact=None):super(Base,self).wait_for_page_to_load(None,None,'serious')self.wait.until(lambdas:self.seed_urlins.current_url)returnselfResourcesIssue TrackerCodeCHANGELOGversion 0.1.0Enabled the use of two new environment variables.ACCESSIBILITY_DISABLED=truewill disable accessibility tests.ACCESSIBILITY_REPORTING=falsewillenablethe output of JSON results.version 0.0.7Modified impact_included class method to reflect changes to the aXe API:There are now only 3 impact levels:'critical','serious', and'minor'
Package: py-pomo
py-pomoA simple CLIpomodorotimer, made with Python w/Click.All contibutions are welcome.py-pomoUsageExamplesTodoUsagegitclonehttps://github.com/BasicPixel/py-pomo.git# Clone this repocdpy-pomo

virtualenvvenv# Start a virtualenv (on unix systems, requires virtualenv package).venv/bin/activate

pipinstall--editable.# Install the packagepomo--help# Run the scriptExamplesStart a 25-minute pomo timer:pomoStart a timer for 30 seconds:pomo-s-d30# Orpomo--in-seconds--duration30Start a 10-minute timer, with minimal output (MM:SS):pomo-m-d10# Orpomo--minimal--duration10Learn more about the available options by running:pomo--helpTodoSave configuration to a filePublish to PyPITest on different environments
Package: pypomod
PypomodA simple python CLI package for the pomodoro timer.Currently, only works on macOSInstallationpipinstallpypomodUse caseHow to use# Run pomodoro timer. 20 minutes work timer, 5 minutes break timer and repeat 1 time.pomodoro-w20-b5-rDemoOptionspomodoro-h

usage:pympod[-h][-wWORK_TIME][-bBREAK_TIME][-rREPEAT]AsimplepythonCLIpackageforthepomodorotimer.

options:-h,--helpshowthishelpmessageandexit-wWORK_TIME,--work_timeWORK_TIMESettheworktime.Defaultis20minutes.-bBREAK_TIME,--break_timeBREAK_TIMESetthebreaktime.Defaultis5minutes.-rREPEAT,--repeatREPEATSetthenumberofrepeats.Defaultis1.WIPLinux and Windows are not fully supported yet.
Package: pypomodoro
PyPomodoroDisplays a full screenPomodootimer in your terminal.InstallationpipinstallpypomodoroScreenshotUsagepypomodoro [-h] [-w WORK_MINS] [-b BREAK_MINS] [-v] [--version]

optional arguments:
  -h, --help            show this help message and exit
  -w WORK_MINS, --work WORK_MINS
                        Number of miinutes for work
  -b BREAK_MINS, --break BREAK_MINS
                        Number of minutes for break
  -v, --verbose         Move detailed display
  --version             show program's version number and exitDevelopmentCreate virtual env and install dev dependenciesmakeinitRun tests in venvmaketestRun the app in venvmakerun
Package: pypon
pyponpypon - A simple controller for  PON Optical Line Terminals (OLTs) that support the VOLTHA project's Openolt api.Install pypon in a Python virtual environment$ virtualenv myenv
.. some output ..

$ source myenv/bin/activate
(myenv) $ pip install pyponCheck ponctl is installed$ which ponctl
...myenv/bin/ponctlponctl help$ ponctl --help
Usage: ponctl [OPTIONS] COMMAND [ARGS]...

  ponctl - Command-line utility for managing PON whiteboxes

  Options:
    --help  Show this message and exit.

    Commands:
      devinfo  Get device info from OLT_HOST_PORT.
        ind      Get device info from OLT and, optionally, send them to Kafka...Use ponctl to display OLT device info$ ponctl devinfo 10.90.0.114:9191
vendor: "EdgeCore"
model: "asfvolt16"
firmware_version: "BAL.2.6.0__Openolt.2018.10.04"
...Use ponctl to display streaming indications from OLT$ ponster ind 10.90.0.114:9191
2019-06-10 15:03.07 Southbound Grpc Rx
2019-06-10 15:03.07 Indications initialized
2019-06-10 15:03.07 openolt grpc starting
2019-06-10 15:03.07 openolt grpc started
waiting for indication...
olt_ind {
  oper_state: "up"
  }
  waiting for indication...
...If running a local kafka broker, check indications on kafka bus:confluent-kafka/consumer.py localhost:9092 foo openolt.ind-10.90.0.114Developgit clone git@github.com:shadansari/openolt.git
cd pypon
pipenv shell
pipenv installRebuild protobufs if changed:make protos
Package: pypond
PyPond - Python Pond timeseries library.OverviewPyPond is a Python implementation of the JavaScriptPond timeseries
library. At a very high level, both
implementations offer classes and structures to collect, manipulate and
transmit timeseries data. Time series transmission is done via a
JSON-based wire format.This implementation isavailable on
GitHuband the API documentation is
available atsoftware.es.net(and
alternately onRTD).PyPond runs on python 2.7 and 3.3 through 3.9.Core DocumentationThemain project sitehas extensive
documentation on the various structures (Event, TimeRange, TimeSeries,
etc) that both implementations use internally. There is no need to
duplicate that conceptual documentation here since the python
implementation follows the same API and uses the same structures.The only real difference with pypond is that the method names have been
changed to their obvious pythonic corollaries (obj.toString()becomesobj.to_string()) and any comparison methods named.is()in the JavaScript version have been renamed to.same()in pypond
sinceisis a reserved word in python.Thetestscan
also be referred to as a fairly complete set of examples as well.
Package: pypony
PyPonyPyPony is a 🪄magical🪄 Python CLI tool for contract testing OpenAPI specifications against the live APIs that they define.Supported OAS FeaturesJSON or YAMLenums$refoneOfInstall Locallymakeinstall-dependencies
makeinstall-cliRemove Local Installationmakeremove-cliTestmaketestGenerate Coverage Reportmaketest-coverageRunpypony-st./my_steps.yml-sp./my_spec.yml-vArgumentsArgumentDescription'-st', '--step'Relative path to step file'-sp', '--spec'Relative path to spec file'-v', '--verbose'Boolean verbose output (default=False)'-ff', '--fail-fast'Option to fail fast if an exception is encountered (default=False)Step FileThestepfile is what is used to make API calls - its where you provide information like base url, auth, path, request body, etc. PyPony uses the information in the step file to check against the OpenAPI spec, ensuring it matches the definiution, and then sends it using therequestslibrary.Step files export expressions and environment variables, allowing it to be run in a CI/CD pipeline and making data from previous steps accessible.Required Step File FieldsBaseURLStepsnameoperation_idmethodpathstatus_codeExample Step File---
base_url: https://voice.bandwidth.com/api/v2
auth:
    username: ${{ env.BW_USERNAME }}
    password: ${{ env.BW_PASSWORD }}
steps:
  - name: createCall
    operation_id: createCall
    method: POST
    path: /accounts/${{ env.BW_ACCOUNT_ID }}/calls
    headers:
      Content-Type: application/json
    body:
      to: ${{ env.USER_NUMBER }}
      from: ${{ env.BW_NUMBER }}
      applicationId: ${{ env.BW_VOICE_APPLICATION_ID }}
      answerUrl: ${{ env.BW_ANSWER_URL }}
    status_code: 201

  - name: Get Call Info
    operation_id: getCallState
    method: GET
    path: /accounts/${{ env.BW_ACCOUNT_ID }}/calls/${{ steps.createCall.response.data.callId }}
    auth:    # overrides global auth definition
        username: ${{ env.VOXBONE_USERNAME }}
        password: ${{ env.VOXBONE_PASSWORD }}
    status_code: 200

  - name: listConferences
    operation_id: listConferences
    method: GET
    path: /accounts/${{ env.BW_ACCOUNT_ID }}/conferences
    status_code: 200The full step file schema can be foundhere.
Package: pypool-pump
PyPoolPumpPyPoolPumpis a python module providing classes for computing the duration needed for a swimming pool filtering pump.
This module will provide methods to define the filtering daily schedule.Each classes is an implementation of a different algorithm found when searching Internet to find best way to compute the filtering pump duration.Classes descriptionBase classFilteringDuration()class is the base class with no duration computation. It gather all the common code for each implementation.
You will find a way to add a percentage modifier on the duration computed and a way to construct the daily filtering schedule.You should not call directly this class except if you want to implement a new algorithm.Dumb algorithmDumbFilteringDuration()is child class with an implementation of the common known algorithm using only the water temperature as parameter:filtering duration (in hour) = water temperature (in °C) / 2.Reference: the poster delivered with my swimming poolBasic algorithmBasicFilteringDuration()is  child class with an implementation of the previous algorithm with some optimizations:No need to filter if water temperature below 10°CBetween 10°C and 14°C we can reduce the duration (water temperature in °C / 3)Between 14°C and 30°C we use the standard rule (water temperature in °C / 2)Above 30°C continuous filtering.Reference: To be completedAbacus based algorithmAbacusFilteringDuration()is a child class with an implementation of a water temperature based abacus. I found this when searching potential existing module on Github.Reference: this abacus is used in theJeedom pool addonby @scadinot.Advanced algorithmPumpCaracteristicFilteringDuration()is a child class with an implementation of an algorithm based on the pool dimension, the pump characteristics and the water temperature.ContributeIf you want to contribute to the development:Start by cloning this repository.Setup a virtual environmentInstall the python package in edition mode:pip install -e .Create a branch for your featureTest your change usingtoxSend a PR when ready.LicenseThis software is under the MIT License.
Package: py-popgen
The PPP is a software platform with the goal of reducing the computational expertise required for conducting population genomic analyses. The PPP was designed as a collection of scripts that facilitate common population genomic workflows in a consistent and standardized environment. Functions were developed to encompass entire workflows, including: input preparation, file format conversion, various population genomic analyses, output generation, and visualization. By facilitating entire workflows, the PPP offers several benefits to prospective end users - it reduces the need of redundant in-house software and scripts that would require development time and may be error-prone, or incorrect, depending on the expertise of the investigator. The platform has also been developed with reproducibility and extensibility of analyses in mind.The current documentation may be foundhere.A PDF of the documentation is also available fordownload.
Package: pypopt
Pypopt: Ipopt for PythonPypopt is an Ipopt wrapper for Python. The aim is to expose the same
API as Ipopt C++ interface.ExamplesYou can find examples in theexamples/folder.PythonJournalIn Pypopt you can use Python objects as targets for Ipopt journaling.
The Python objects needs to implement two methods:write(str): called to writestrto the stream objectflush(): called to flush the streamThis means we can use Python3io.StringIOto capture Ipopt output to string:app=IpoptApplication()f=io.StringIO()j=PythonJournal(EJournalLevel.J_NONE,f)jnlst=app.journalist()jnlst.add_journal(j)RequirementsA working C++ compilerCythonIpoptPytest + pytest-runner + pytest-cov for testingIpopt InstallationWe recommendinstalling Ipopt from source.If you have Ipopt installed in a different location than/usrset
the following environment variables before proceeding to the next
section:IPOPT_INCLUDE_DIR=/path/to/ipopt/include
IPOPT_LIBRARY_DIR=/path/to/ipopt/libInstallationPypopt is available onPypi:pip install pypoptInstallation from SourceTo installpypoptsimply run:python setup.py installTroubleshootingPypopt is a Cython extension, this makes it sometimes tricky to install correctly.Different toolchain for Ipopt and PypoptIpopt and Pypopt need to be compiled with the same C++ toolchain. If
that’s not the case, you will see an error like the following when
loading Pypopt:Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lib/python3.6/site-packages/pypopt/__init__.py", line 24, in <module>
  from pypopt._cython import (
ImportError: /lib/python3.6/site-packages/pypopt/_cython.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN5Ipopt7Journal4NameB5cxx11EvThis means Ipopt and Pypopt were compiled with different
compilers/flags.  To fix this issue install Ipopt from source and set
theIPOPT_INCLUDE_DIRandIPOPT_LIBRARY_DIRenvironment
variables to your Ipopt installation.LicenseCopyright 2018 Francesco CecconLicensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.Changelog0.5.0 (2020-04-28)Improve TNLP interface for optimal performanceImplement Pyomo direct solver interface0.4.2 (2018-07-05)Documentation update0.4.1 (2018-07-05)Fix MANIFEST.in0.4.0 (2018-07-05)Changes to TNLP interface
Package: pypopulation
pypopulationLightweight population lookup usingISO 3166alpha-1/2 country codes forPython 3.6.1and higher.>>>importpypopulation>>>>>>pypopulation.get_population("DE")# Germany83132799The aim is to provide a minimalist package with no dependencies that does one thing only, as best as possible. Population figures are read from a JSON file into Python dictionaries at import time. The API then only exposes the dictionaries.The given figures are estimates at best.Read below for more details on the data source.InterfaceThe API is formed by 3 functions:get_population_a2: population for a 2-letter country codeget_population_a3: population for a 3-letter country codeget_population: population for either a 2-letter or a 3-letter country codeAll functions returnNoneif no country is found for the given country code.Lookup is case insensitive, i.e."DE"and"de"give same results.Lookups using country names are difficult & not currently supported, but the source JSON file does contain them. This is to make the source file more comprehensible. If all you have to work with is a country name, consider usingpycountryto resolve your names to ISO 3166 codes first.If you would like to build your own wrapper around the source JSON, you can do:countries:t.List[t.Dict]=pypopulation._load_file()InstallationWithpipfromPyPI:pip install pypopulationDevelopmentI'm usingPoetryto maintain development dependencies. These dependencies are only used to assure code quality. They are not necessary to use the package, and are not installed in a production environment.Replicate the development environment:poetry installRun lint, tests and produce a.coveragefile:poetry run flake8
poetry run coverage run -m unittestThese commands run in CI (GH Actions) on pull requests againstmaster. Tests are ran on all supported Python versions. Refer to theChecksworkflow for more information. New releases trigger thePublishworkflow, which builds a distribution and pushes it to PyPI.Data sourceThe population figures were sourced fromThe World Bank(2020-07-01). This dataset provides the country name, alpha-3 code, and population figures found in the resource JSON file. The data was enriched with alpha-2 country codes for each row. Rows not corresponding to political countries were removed, e.g. "Middle East & North Africa (excluding high income)". Some country names were adjusted for readability, e.g. expanded abbreviations.No adjustments were made to the population figures. Please refer to the linked page for a more detailed description of the dataset.This projects aims to expose the linked data to Python code. It does not guarantee correctness of the provided figures.
Package: pyporcc
PyPorCCPyPorCC is a package that allows the detection and classification of Harbor Porpoises' clicks.
The detection of clicks in continuous files is a python adaptation of the PAMGuard click detector algorithm.Gillespie D, Gordon J, McHugh R, McLaren D, Mellinger DK, Redmond P, Thode A, Trinder P, Deng XY (2008) PAMGUARD:
Semiautomated, open source software for real-time acoustic detection and localisation of cetaceans.
Proceedings of the Institute of Acoustics 30:54–62.The classification is done using the PorCC algorithm, adapted to python from the paper:Cosentino, M., Guarato, F., Tougaard, J., Nairn, D., Jackson, J. C., & Windmill, J. F. C. (2019).
Porpoise click classifier (PorCC): A high-accuracy classifier to study harbour porpoises ( Phocoena phocoena )
in the wild.
The Journal of the Acoustical Society of America, 145(6), 3427–3434.https://doi.org/10.1121/1.5110908Also other models can be trained. The implemented ones so far are:svc: Support Vector Machineslsvc: Linear Support Vector MachinesRandomForest: Random Forestknn: K-Nearest NeighborUsageClick detectorThe Click detector can be used in continuous wav files (with higher than 300 kHz sampling rate) or in the SoundTrap
HF output files (*.bcl + *.dwv).
For SoundTrapHF files, you can create a ClickDetectorSoundTrapHF object with the necessary parameters and run it as:importpathlibimportpyhydrophoneaspyhyfrompyporccimportClickDetectorSoundTrapHF,ClickDetector,PorCC,Filtersound_folder=pathlib.Path("./../tests/test_data/soundtrap")save_folder=pathlib.Path('./../tests/test_data/output')# Hydrophonemodel='ST300HF'name='SoundTrap'serial_number=67416073soundtrap=pyhy.soundtrap.SoundTrapHF(name=name,model=model,serial_number=serial_number)# Filters parameterslowcutfreq=100e3# Lowcut frequencyhighcutfreq=160e3# Highcut frequency# Define the filterspfilter=Filter(filter_name='butter',filter_type='bandpass',order=4,frequencies=[lowcutfreq,highcutfreq])dfilter=Filter(filter_name='butter',filter_type='high',order=4,frequencies=20000)classifier=PorCC(load_type='manual',config_file='default')cd=ClickDetectorSoundTrapHF(hydrophone=soundtrap,save_folder=save_folder,convert=True,classifier=classifier,prefilter=pfilter,save_noise=False)cd.detect_click_clips_folder(sound_folder,blocksize=60*576000)For continuous data, just make sure you use the class ClickDetector object instead of a ClickDetectorSoundTrapHF!
The rest of the code should be the same (except the hydrophone definition, which will depend on the instrument you use)NotePlease note, the clicks PAMGuard's Click Classifier classified as porpoise clicks appear as 0 in both ClassifiedAs
and ManualAssign fields.Citation