Saravanan666/pypi-org huggingface dataset:
Package: covdefaults
covdefaultsA coverage plugin to provide sensible default settingsinstallationpipinstallcovdefaultsusageto enable the plugin, addcovdefaultsto your coverage pluginsin.coveragerc:[run]plugins=covdefaultsinsetup.cfg/tox.ini:[coverage:run]plugins=covdefaultsinpyproject.toml:[tool.coverage.run]plugins=["covdefaults"]default settings[coverage:run]branch=Truesource=.omit=*/__main__.py*/setup.py[coverage:report]show_missing=Trueskip_covered=Truefail_under=100exclude_lines=# a more strict default pragma\# pragma:no cover\b# allow defensive code^\s*raise AssertionError\b^\s*raise NotImplementedError\b^\s*return NotImplemented\b^\s*raise$# typing-related code^\s*if (False|TYPE_CHECKING)::\.\.\.(\s*#.*)?$^ +\.\.\.$-> ['"]?NoReturn['"]?:# non-runnable codeif __name__== ['"]__main__['"]:$# additional platform related pragmas (see below)# additional version related pragmas (see below)partial_branches=# a more strict default pragma\# pragma:no cover\b# out platform pragmas\# pragma:(nt|posix|cygwin|darwin|linux|msys|win32|cpython|pypy) (no )?cover\b# our version pragmas\# pragma:(>=?|<=?|==|!=)\d+\.\d+ cover\bplatform specific# pragma: no coverseveral# pragma: no covertags will be added automatically based on the
platform and implementation.these will be in the form of:# pragma: TAG no coveror# pragma: TAG coverthese tags will be generated by the following values:os.nament(windows)posix(linux, macOs, cygwin, etc.)sys.platformcygwindarwin(macOs)linuxmsyswin32sys.implementation.namecpythonpypyfor every tag which does not match, you can use negation.  here's an example:ifsys.platform=='win32':# pragma: win32 coverbin_dir='Scripts'else:# pragma: win32 no coverbin_dir='bin'note here that# pragma: win32 coverwill become a "no cover" for everything
which is notwin32-- whereas the# pragma: win32 no coverwill be a
"no cover" only onwin32.version specific# pragma: no coverseveral# pragma: no covertags will be added automatically based on the
platform and implementation.these will be in the form of:# pragma: >=#.# coverwhere the comparison operator is one of>,>=,<,<=,==,!=for example:ifsys.version_info>=(3,9):# pragma: >=3.9 coverprint('3.9+')else:# pragma: <3.9 coverprint('old')overriding optionsseveral of the options can be overridden / extended in your coverage
configuration.  the examples below assume.coveragerchowever any of the
filescoveragesupports work as well.run:omit[run]omit=pre_commit/resources/*this will result in thepre_commit/resources/*beingomitted in addition
to the defaults provided bycovdefaults.[covdefaults]subtract_omit=*/__main__.pythis will result in*/__main__.pynot beingomitted (*/__main__.pyis
among the defaults provided bycovdefaults).run:source[run]source=$PWDcovdefaults will not override this value to.if it is set manually.report:exclude_lines[report]exclude_lines=^if MYPY:$this will result in lines matching^if MYPY:$to additionally be excluded
from coverage in addition to the defaults provided bycovdefaults.report:fail_under[report]fail_under=90covdefaultswill not change the value if you provide one forfail_under
Package: coven
writeup v0
Dedicated to the public domain under CC0:https://creativecommons.org/publicdomain/zero/1.0/.# Coven: Code Coverage Through Bytecode WitchcraftCoven is a test coverage harness for Python 3. It uses an extension to the CPython interpreter, pending integration (issue #24900) into Python 3.7. The patch also works on Python 3.6, and Coven is developed against 3.6.# LicenseCoven is dedicated to the public domain. It is written and maintained by George King.# Usagecovenacts as a drop-in replacement forpython3. Mileage may vary.coven script-to-test.py# IssuesPlease file issues to the github repository: github.com/gwk/coven.
Package: covenant
covenant projectQuickstartUsing covenant in Dockerdocker-compose up -dSeedocker-compose.ymlInstallationpip install covenantRunningRunning daemoncovenant -c <conffile> -p <pidfile> --logfile <logfile>Running foregroundcovenant -f -c <conffile> -p <pidfile> --logfile <logfile>Examples:curlhttp://localhost:9118/metrics/apache1curlhttp://localhost:9118/metrics/nginx1curlhttp://localhost:9118/metrics/rabbitmq1curlhttp://localhost:9118/metrics/redis1curlhttp://localhost:9118/probe/secure-layer1?target=https://example.comcurlhttp://localhost:9118/probe/sshd-pidfile-exists?target=/var/run/sshd.pid
Package: coveo-arnparse
coveo-arnparseSimple dataclass and parser around Amazon Resource Names (ARNs).Ref:https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.htmlUsageParse from a string>>>fromcoveo_arnparseimportarnparse>>>arn=arnparse("arn:aws:sns:us-east-1:123456789012:my_topic")>>>repr(arn)Arn(partition='aws',service='sns',region='us-east-1',account='123456789012',resource='my_topic')>>>str(arn)"arn:aws:sns:us-east-1:123456789012:my_topic">>>arn.resource_type''>>>arn.resource_id''When a:or a/is in the resource, you can also obtain either parts:>>>fromcoveo_arnparseimportarnparse>>>arn=arnparse("arn:aws:ssm:us-east-1:123456789012:parameter/path/key")>>>arn.resource_type'parameter'>>>arn.resource_id'path/key'>>>arn.resource'parameter/path/key'Create an instance directly>>>fromcoveo_arnparseimportArn>>>Arn(service="s3",resource="my_bucket/path/file.jpg")Arn(partition='aws',service='s3',region='',account='',resource='my_bucket/path/file.jpg')
Package: coveo-itertools
coveo-itertoolsAnother spin on iteration goodness.dict lookupA one-liner function to retrieve a value from a dictionary:fromtypingimportDict,Anyfromcoveo_itertools.lookupsimportdict_lookupexample:Dict[str,Any]={'nested':{'key':{'lookup':True}}}assertdict_lookup(example,'nested','key','lookup')==Trueassertdict_lookup(example,'not','there',default=None)isNone
Package: coveo-push-api-client.py
Python Push API ClientInstallationpip installcoveo-push-api-client.pyUsageSee more examples in the./samplesfolder.frompush_api_clientpyimportSource,DocumentBuildersource=Source("my_api_key","my_org_id")myDocument=DocumentBuilder("https://my.document.uri","My document title")\.withData("these words will be searchable")response=source.addOrUpdateDocument("my_source_id",myDocument)print(f"Document added:{response.json()}")Exponential backoff retry configurationBy default, the SDK leverages an exponential backoff retry mechanism. Exponential backoff allows for the SDK to make multiple attempts to resolve throttled requests, increasing the amount of time to wait for each subsequent attempt. Outgoing requests will retry when a429status code is returned from the platform.The exponential backoff parameters are as follows:retry_after- The amount of time, in seconds, to wait between throttled request attempts.Optional, will default to 5.max_retries- The maximum number of times to retry throttled requests.Optional, will default to 10.You may configure the exponential backoff that will be applied to all outgoing requests. To do so, specify aBackoffOptionsobject when creating either aSourceorPlatformClientobject:source=Source("my_api_key","my_org_id",BackoffOptions(3,10))By default, requests will retry a maximum of 10 times, waiting 10 seconds after the second attempt, with a time multiple of 2 (which will equate to a maximum execution time of roughly 1.5 hours. Seeurllib3 Retry documentation).DevRequires Python 3.9Requires pipenv:pip install pipenvInstall dependencies:pipenv install--devBuild:pipenv run tox-ebuildTests:pipenv run toxFull list of commands:pipenv run tox-avVersioning and Publishing to PyPIBefore merging a feature branch into master, you must update the package version of your branch:Openpyproject.tomlin the text editor of your choiceUnder[project], update theversion, following semantic versioning format (v{Major}.{Minor}.{Patch})Once the feature branch you would like to publish has been merged into master:Checkout the latest version of master on localRunpipenv run tox-ecleanRunpipenv run tox-ebuildYou should now see that that thedistdirectory has been populated with a.whland.tar.gzfile with the correct version in the filenames. These are the distribution archives.Once the distribution archives are ready:Runpipenv run tox-epublish----repositorypypifrom the root directoryWhen prompted for a username, enter__token__When prompted for a password, enter the PyPI publishing API key, including thepypi-prefixAfter the command finishes running with a successful exit message, confirm that the published version islive on PyPI.NoteThis project has been set up using PyScaffold 4.0.1. For details and usage
information on PyScaffold seehttps://pyscaffold.org/.For more information on the release process, refer to thePyPiandPyScaffolddocumentation.
Package: coveo-pypi-cli
coveo-pypi-cliA very simple pypi cli that can be used to obtain the latest version of a package, or calculate the next one.Serves our automatic pypi push github action.pypi current-versionDisplay the current version of a package frompypi.orgpypi next-versionCompute the next version of a package.Can be given a minimum versione.g.: pypi is0.0.3and mininum set to0.1: next version will be0.1Supports computing pre-release versionsprivate index supportYou can target a private pypi server through a switch or an environment variable.Using the--indexswitch$pypicurrent-versionsecret-package--indexhttps://my.pypi.server.org1.0.0

$pypicurrent-versionsecret-package--indexhttps://my.pypi.server.org:51800/urlprefix1.0.0Using the environment variable:$PYPI_CLI_INDEX="https://my.pypi.server.org"pypicurrent-versionsecret-packageNote: Unlikepip --index-url,you must omitthe/simpleurl prefix.
The API used bycoveo-pypi-cliis served by the/pypiendpointand should not be specified either!pypi-cli in actionThe best example comes from thegithub action, which computes the next version based on the current release and what's in thepyproject.toml.Here's what you can expect from the tool:$pypicurrent-versioncoveo-functools0.2.1

$pypinext-versioncoveo-functools0.2.2

$pypinext-versioncoveo-functools--prerelease0.2.2a1

$pypinext-versioncoveo-functools--minimum-version0.20.2.2

$pypinext-versioncoveo-functools--minimum-version0.30.3

$pypinext-versioncoveo-functools--minimum-version0.3--prerelease0.3a1# Here's an example of how we use it in the github action$poetryversion
coveo-pypi-cli0.1.0
$minimum_version=$(poetryversion|cut--fields2--delimiter' ')0.1.0# when left unattended, the next-version increments the patch number$pypinext-versioncoveo-pypi-cli--minimum-version$minimum_version0.2.2# in order to change the minor or major, because the script uses `poetry version` to obtain the minimum version,# just set it in `pyproject.toml` manually or by calling `poetry version <new-version>` (and commit!)$poetryversion0.3
Bumpingversionfrom0.1.0to0.3
$minimum_version=$(poetryversion|cut--fields2--delimiter' ')0.3
$pypinext-versioncoveo-pypi-cli--minimum-version$minimum_version0.3# IMPORTANT: the publish step MUST set the computed version for poetry before publishing!$poetryversion$minimum_version0.3
$poetrypublish
...# after publishing the above, repeating the steps would yield:$pypinext-versioncoveo-pypi-cli--minimum-version$minimum_version0.3.1# for completeness, you can also publish pre-releases:$pypinext-versioncoveo-pypi-cli--minimum-version$minimum_version--prerelease0.3.1a1
Package: coveo-styles
coveo-stylesDon't let your CLI app spit out hundreds of boring lines!Manage your user feedback a bit like you manage logs, and get bonus colors and emojis just because we can!This module provides anechosymbol that you can use instead ofprintfor convenience.It is also completely customizable!predefined themes for common actionsHere's how a ci run could look like:fromcoveo_styles.stylesimportechoecho.step("Launching ci operations")echo.normal("pytest",emoji='hourglass')echo.normal("black",emoji='hourglass')echo.noise("Generated test reports in .ci/")echo.success()echo.warning("Formatting errors detected")echo.suggest("The --fix switch will automatically fix these for you and re-run the test !!smile!!")echo.error("The CI run detected errors you need to fix",pad_after=False)echo.error_details("Black reported files to reformat",item=True)echo.error_details("Details as items is nice!",item=True)Launching ci operations

⌛ pytest
⌛ black
Generated test reports in .ci/

✔ Success!


⚠ Formatting errors detected


🤖 The --fix switch will automatically fix these for you and re-run the test 😄


💥 The CI run detected errors you need to fix
 · Black reported files to reformat
 · Details as items is niceIt's even nicer with colors! :) This doc needs a few animated gifs!exception hookException handlers may re-raise an exception as anExitWithFailurein order to hide the traceback from the user and show a helpful error message.Here's an example for the sake of demonstration:frompathlibimportPathfromcoveo_styles.stylesimportExitWithFailuretry:project=Path('./project').read_text()exceptFileNotFoundErrorasexception:raiseExitWithFailure(suggestions='Use the --list switch to see which projects I can see')fromexceptionThe stacktrace will be hidden, the app will exit with code 1 after printing the exception type and message:! FileNotFoundError: [Errno 2] No such file or directory: 'project'

🤖 Use the --list switch to see which projects I can seeUnhandled exceptions (those that are not wrapped by an ExitWithFailure), will display the usual python feedback and stacktrace.hunting for emojisEmoji support is provided by theemojipackage.
Their description provides different links to help with your emoji hunt, but for some reason not everything is supported or has the name it should have.The only foolproof way I have found is to actually inspect theemojipackage, either by openingsite-packages/emoji/unicode_codes/en.pyin my IDE or programmatically like this:fromcoveo_styles.stylesimportechofromemoji.unicode_codes.enimportEMOJI_UNICODE_ENGLISH,EMOJI_ALIAS_UNICODE_ENGLISHquery='smile'.lower()foremoji_namein{*EMOJI_UNICODE_ENGLISH,*EMOJI_ALIAS_UNICODE_ENGLISH}:emoji_name=emoji_name.strip(':')ifqueryinemoji_name.lower():echo.normal(f'{emoji_name}: !!{emoji_name}!!')sweat_smile: 😅
cat_face_with_wry_smile: 😼
smile: 😄
smiley: 😃
smiley_cat: 😺
smile_cat: 😸
Package: coveo-systools
coveo-systoolsLanguage and OS related utilities.Content in a nutshell:enhanced subprocess callsasyncio subprocess callsfile and app finding made easysafe text write and replace-if-differentgit-repo-root locatorbool platformsif WINDOWS or LINUX or MAC or WSL:searching the filesystemimportosfromcoveo_systools.filesystemimportfind_paths,find_application,find_repo_rootos.getcwd()# '/code/coveo-python-oss/coveo-systools'find_application('git')# WindowsPath('C:/Program Files/Git/cmd/git.EXE')  # windows example for completenessfind_repo_root()# Path('/code/coveo-python-oss')list(find_paths('pyproject.toml',search_from=find_repo_root(),in_root=True,in_children=True))# [Path('/code/coveo-python-oss/pyproject.toml'), ...]enhanced subprocess callsAn opinionated version ofsubprocess.check_callandsubprocess.check_output.New in 2.0.7: asyncio support, throughasync_check_callandasync_check_output.Adds the following features:command line is a variable args (instead of a list)automatic conversion of output to a stripped string (instead of raw bytes)automatic conversion of Path, bytes and number variables in command lineautomatic filtering of ansi codes from the outputenhanced DetailedCalledProcessError on error (a subclass of the typical CalledProcessError)frompathlibimportPathfromcoveo_systools.subprocessimportcheck_callcheck_call('mypy','--config-file',Path('configs/mypy.ini'),verbose=True)safe I/O, if changedGood programming practices requires files to be saved using a temporary filename and then renamed.
This helper takes it a step further by skipping the write operation if the content did not change:importjsonfrompathlibimportPathfromcoveo_systools.filesystemimportsafe_text_writesafe_text_write(Path('./path/to/file.txt'),json.dumps(...),only_if_changed=True)conditional platforms syntactic sugarReadability is important, not repeating yourself is important.
Forget aboutplatform.platform()and use bools directly:fromcoveo_systools.platformsimportWINDOWS,LINUX,IOS,WSLifWINDOWSorWSL:print("Hello Windows!")elifLINUXorIOS:print("Hello Unix!")
Package: coveo-testing-extras
coveo-testing-extrasContains extra testing tools without dependency restrictions.temporary resource implementation: Docker ContainerThe docker container temporary resource can be used to prepare short-lived containers.Supports building from a dockerfileSupports pulling imagesCan signal on AWS ECR logoutDynamic port mapping retrievalSaves log output before removing the containerAutomatic AWS ECR login exampleHere's how you can enhanceTemporaryDockerContainerResourcewith automatic ECR login:frombase64importb64decodeimportboto3fromcoveo_testing_extras.temporary_resource.docker_containerimport(TemporaryDockerContainerResource,ECRLogoutException,get_docker_client)classWithECR(TemporaryDockerContainerResource):defobtain_image(self)->None:try:super().obtain_image()exceptECRLogoutException:self._do_ecr_login()super().obtain_image()def_do_ecr_login(self)->None:""" Performs an ecr login through awscli. """assertself.ecr_regionecr=boto3.client('ecr')account_id,*_=self.image_name.split('.')assertaccount_id.isdigit()authorization_data=ecr.get_authorization_token(registryIds=[account_id])['authorizationData'][0]username,password=b64decode(authorization_data['authorizationToken']).decode().split(':')withget_docker_client()asclient:login=client.login(username=username,password=password,registry=authorization_data['proxyEndpoint'])assertlogin['Status']=='Login Succeeded'
Package: coverage
Code coverage testing for Python.Coverage.py measures code coverage, typically during test execution. It uses
the code analysis tools and tracing hooks provided in the Python standard
library to determine which lines are executable, and which have been executed.Coverage.py runs on these versions of Python:Python 3.8 through 3.12, and 3.13.0a3 and up.PyPy3 versions 3.8 through 3.10.Documentation is onRead the Docs.  Code repository and issue tracker are onGitHub.New in 7.x:experimental support for sys.monitoring;
dropped support for Python 3.7;
addedCoverage.collect()context manager;
improved data combining;[run] exclude_alsosetting;report--format=;
type annotations.New in 6.x:dropped support for Python 2.7, 3.5, and 3.6;
write data on SIGTERM;
added support for 3.10 match/case statements.For EnterpriseAvailable as part of the Tidelift Subscription.Coverage and thousands of other packages are working with
Tidelift to deliver one enterprise subscription that covers all of the open
source you use.  If you want the flexibility of open source and the confidence
of commercial-grade software, this is for you.Learn more.Getting StartedLooking to runcoverageon your test suite? See theQuick Start sectionof the docs.Change historyThe complete history of changes is on thechange history page.Code of ConductEveryone participating in the coverage.py project is expected to treat other
people with respect and to follow the guidelines articulated in thePython
Community Code of Conduct.ContributingFound a bug? Want to help improve the code or documentation? See theContributing sectionof the docs.SecurityTo report a security vulnerability, please use theTidelift security
contact.  Tidelift will coordinate the fix and disclosure.LicenseLicensed under theApache 2.0 License.  For details, seeNOTICE.txt.
Package: coverage2img
CoverageToImgIntroductionTo convert from coverage.json - that is made bycoveragelibrary of pypi - to imageExample of structure of coverage.json{"meta":{"version":"6.0.2","timestamp":"2021-10-15T10:56:02.804556","branch_coverage":false,"show_contexts":false}"files":{"path/file_name.py":{"executed_lines":[],"summary":{"covered_lines":0,"num_statements":0,"percent_covered":100.0,"percent_covered_display":"100","missing_lines":0,"excluded_lines":0},"missing_lines":[],"excluded_lines":[]},...}"totals":{"covered_lines":100,"num_statements":200,"percent_covered":80.0,"percent_covered_display":"80","missing_lines":19,"excluded_lines":1,}}Examplecoverage.json -> pngcoverage2img-icoverage.json-oresult.png
Package: coverage2sql
Command to Read a coverage file and put the data in a SQL databasecoverage2sql is a tool for storing data of test coverage into a SQL database.
With using this tool, you can store time series coverage data and analyze it
if your coverage rate is down.Free software: Apache licenseDocumentation:http://docs.openstack.org/developer/coverage2sqlSource:http://git.openstack.org/cgit/openstack/coverage2sqlBugs:http://bugs.launchpad.net/coverage2sqlUsageDB SetupThe usage of coverage2sql is split into 2 stages. First you need to prepare a
database with the proper schema; coverage2sql-db-manage should be used to do
this. The utility requires db connection info which can be specified on the
command or with a config file. Obviously the sql connector type, user,
password, address, and database name should be specific to your environment.
coverage2sql-db-manage will use alembic to setup the db schema. You can run the
db migrations with the command:coverage2sql-db-manage --database-connection mysql://coverage:pass@127.0.0.1/coverage upgrade heador with a config file:coverage2sql-db-manage --config-file etc/coverage2sql.conf upgrade headThis will bring the DB schema up to the latest version for coverage2sql.FeaturesTODO
Package: coverage-badge
A small script to generate coverage badges using Coverage.py. Example of a generated badge:The badge template has been taken fromshields.io, therefore it should look
mostly good. (The spec is a bit stricter on the margins, but I can’t easily do
text width calculations in Python so the margins might not always be 4px.):arrow_right: Note:If you need a script with a few more features
(e.g. test badges, flake8 reports, etc), check outgenbadge.InstallationRun:pip install coverage-badgeUsageFirst, run Coverage.py to generate the necessary coverage data. Then you can
either return the badge SVG to stdout:$ coverage-badge…or write it to a file:$ coverage-badge -o coverage.svgIt’s important that you runcoverage-badgefrom the directory where the.coveragedata file is located.Different colors for cover ranges:The full usage text:usage: __main__.py [-h] [-o FILEPATH] [-p] [-f] [-q] [-v]

Generate coverage badges for Coverage.py.

optional arguments:
  -h, --help   show this help message and exit
  -o FILEPATH  Save the file to the specified path.
  -p           Plain color mode. Standard green badge.
  -f           Force overwrite image, use with -o key.
  -q           Don't output any non-error messages.
  -v           Show version.LicenseMIT License, seeLICENSE.txtfile..