Saravanan666/pypi-org huggingface dataset:
Package: concur
Python ConcurAPI ReferenceDocumentationHomepagePyPIChangelogConcur is a Python GUI framework based on synchronous generators.It is a port ofConcur for Purescript, implemented on top of theDear ImGuiC++ UI library.For introduction to core concepts, see thedocumentation. A more comprehensive introduction can be found in theDocumentation for the Haskell/Purescript versions. This obviously uses Haskell/Purescript syntax and semantics, but many of the concepts will apply to the Python version.Being an abstraction over ImGui, Concur is best used for debugging, prototyping and data analysis, rather than user-facing applications. ImGui functions can be used directly for any functionality that is not wrapped by Concur. See thePyImGui docsfor additional widgets, orImGui itselfif you need to poke really deep.InstallationThe only dependencies are a C++ compiler,GLFWand Python >= 3.6. GLFW is included in major Linux distros, and there arepre-compiled binariesfor Windows and OS X.sudoaptinstalllibglfw3-dev# Ubuntusudopacman-Sglfw# ArchConcur can be installed using pip:pipinstallconcurThis command should produce a very simple GUI app:python-c'import concur as c; c.main(c.button("Close"))'See theintroductory tutorialto get started, or use any of theexamplesas a starting point for your app.DevelopmentFor Concur development, clone the repo and install it using pip:gitclonehttps://github.com/potocpav/python-concur.gitcdpython-concur
pipinstall-e.

examples/all.py# Run the examples to verify installationTo run the tests, you need PyTest and PyTest-benchmark:pipinstallpytestpytest-benchmark

pytest# Run the testsTo build documentation, installpdoc3(pip install pdoc3), clone the submodules (git submodule update --init), and run the script./mkdocs.sh.
Package: concurapi
The Concur API SDK is a Python client library designed to support Concur’s Developer APIs.
You can read more about the Official API by accessing itsofficial documentation.System RequirementsConcur API SDK depends on the following Python libraries:requestsInstallationInstall usingpip:pip install concurapi.ConfigurationYou’ll need to register atConcur’s Administration site.
Before you create a partner application, make sure your user account has web service administrator access.
You can create a partner application by following these steps.Log on to Concur’s Administration using your username and passwordFollow the linksAdministration->Company->Web ServicesClick on the link to register a partner application in the left navigation bar.In the next screen click on theNewbutton to create a new applicationIn the modal dialog, you can choose the permissions for the actions you need to automate.Also, please note the system generatedKeyandSecret. These values are used by the sdk to make a call
to Concur’s API.UsageBefore you use the sdk, you’ll need to register a partner application and retrieve a Key/Secret. Please seeConfiguration.
You’ll also need to install the client sdk usingpip. Please seeSystem RequirementsandInstallation.fromconcurapi.clientimportConcurAPIfromconcurapi.modelsimportReportapi=ConcurAPI(client_key="Kq4qIqR3K3zgOJwdI2KLtQ",client_secret="Kq4qIqR3K3zgOJwdI2KLtQ",username="concuruser@xyz.com",password="johndoe")report=Report(attributes=dict(Name="First Report",Description="Report for a new Expense"),api=api)report.create()get_report=Report.find(report['ID'])If the service is not available, the sdk throws aServiceNotAvailableexception which can be handled like so:fromconcurapi.clientimportConcurAPIfromconcurapi.exceptionsimportServiceNotAvailableimportsystry:api=ConcurAPI(client_key="Kq4qIqR3K3zgOJwdI2KLtQ",client_secret="Kq4qIqR3K3zgOJwdI2KLtQ",username="concuruser@xyz.com",password="johndoe")exceptServiceNotAvailableasse:#handle ServiceNotAvailable exceptionsys.exit(se.message)The sdk returnsHTTPExceptionwhen there is a REST exception from the API.
As an example, if a report with id -12345-abcdeis not available, the service returns a404HTTP Exceptionfromconcurapi.clientimportConcurAPIfromconcurapi.exceptionsimportHTTPExceptionfromconcurapi.modelsimportReportimportsystry:api=ConcurAPI(client_key="Kq4qIqR3K3zgOJwdI2KLtQ",client_secret="Kq4qIqR3K3zgOJwdI2KLtQ",username="concuruser@xyz.com",password="johndoe")Report.find("1234-abcde")exceptHTTPExceptionashe:#handle HTTPException exceptionsys.exit(he.message)ContributionsContributions are welcome! Please open a pull request.
Package: concurrent-api-client
# Python API ClientAn example for API client using python [request](https://docs.python-requests.org/) library.testsdirectory has an example to call an weather reporting API(https://weather.tsukumijima.net/), an API that returns Japanese weather prediction data reported by Meteorological Agency in Japan, compatible with deprecated livedoor API.—## Usage (by running test)### case1: run by python venv`bash $ cdconcurrent-api-client$ python-mvenv venv $ source venv/bin/activate $ (venv) pytest-s#-soption returns standard output. $ (venv) deactivate $ `### case2: run by tox with testing with multiple python versionstox.inihas some python interpreters definition (e.g. py37, py38, py39)
You can setup multiple python versions by [pyenv](https://github.com/pyenv/pyenv). Install pyenv and setup python versions (e.g.pyenv install 3.7.8 3.8.6 3.9.7)
``bash $ cdconcurrent-api-client$ pyenv local 3.7.8 3.8.6 3.9.7 # you need to setup multiple versions that are relevant with `envlist` in `tox.ini` $ tox-r#-roption recreates virtual environment. Once you configure it, you can just run `tox` for later test. `You can see output inlog/api_clint.log—## Workflow with pip and pip-tools (on package update)Please see [note](https://note.hommalab.io/posts/python/python-dependency-management/)
Package: concurrentfloodscraper
Concurrent Flood ScraperIt’s probably exactly what you think it is, based off the nameGET a page. scrape for urls, filter those according to some regex. Put all those in a master queue. Scrape page for any data you want. Repeat…There’s a small demo in the wikipedia_demo. There you can see how easy it is to set up to fit your web scraping needs!SpecificsCreate a child class of concurrentfloodscraper.Scraper and implement the scrape_page(self, text) method. text is the raw html. In this method you do the specific scraping required. Note that only urls that match the class url_filter_regex will be added to the master queue.Annotate your Scraper subclass with concurrentfloodscraper.Route. The single parameter is a regex; URL’s that match the regex will be parsed with that scraper.Repeat steps 1 and 2 for as many different types of pages you expect to be scraping from.Create an instance of concurrentfloodscraper.ConcurrentFloodScraper, pass it the root URL, the number of threads to use, and a page limit. Page limit defaults to None, which means ‘go forever’.Start the ConcurrentFloodScraper instance, and enjoy the magic!
Package: concurrently
ConcurrentlyLibrary helps to easily write concurrent executed code blocks.Quick example:importasynciofromconcurrentlyimportconcurrentlyasyncdefamain(loop):"""
    How to fetch some web pages with concurrently.
    """urls=[# define pages urls'http://test/page_1','http://test/page_2','http://test/page_3','http://test/page_4',]results={}# immediately run wrapped function concurrent# in 2 thread (asyncio coroutines)@concurrently(2)asyncdeffetch_urls():forurlinurls:# some function for download pagepage=awaitfetch_page(url)results[url]=page# wait until all concurrent threads finishedawaitfetch_urls()print(results)if__name__=='__main__':loop=asyncio.get_event_loop()loop.run_until_complete(amain(loop))Decorator@concurrentlymakes to main thinks:starts concurrent execution specified count of decorated functionreturns specialwaiterobject to control the running functionsBy default, the code runs as asyncio coroutines, but there are other supported
ways to execute, by specifying the argumentengine.DocumentationSeehttps://concurrently.readthedocs.io/RequirementsNow support onlyPython 3.5and above.InstallFrom PyPi:$pipinstallconcurrentlyFrom local:# update setuptools$pipinstall'setuptools >= 30.4'# do install$makeinstall# or$pipinstall.DevelopmentPrepare and activate virtual environment like:$python3-mvenv.env# for bash$source.env/bin/activate# for fish$..env/bin/activate.fishUpdate pre-install dependencies:$pipinstall'setuptools >= 30.4'Install:$makeinstall_dev# or$pipinstall--editable.[develop]Run tests:$maketest# or$pytesttests/
Package: concurrent-ssh
concurrent-sshExecuting commands with ssh concurrently on multiple hosts using asyncioInstallationpipinstallconcurrent-ssh# Or from the latest GitHub versionpipinstallgit+https://github.com/DCsunset/concurrent-sshUsageNote: ensure thatsshis in yourPATHenvironment variables.CLIUse-Hor--hoststo specify the hosts to run the commands on:cssh-H<host1><host2>....<host_n>--<command># pass extra ssh optionscssh-o="-q -4"-H<host1><host2>....<host_n>--<command># read hosts from filecssh-fhosts.txt--<command>Note that--is necessary to separate the options and the command.
For-o/--optionsto work correctly, use=to prevent it from being parsed as another option.The standard input (stdin) of thecsshprocess is piped to the stdin of every spawned processes.csshcan handle signals as follows:Upon receiving oneSIGINT(including keyboard interrupt) orSIGTERM,csshwill sendSIGTERMto all spawned processes.Upon receiving more than one of them,csshwill instead sendSIGKILLto kill all spawned processes.LibraryIt can also be used as a library:importasynciofromcssh.executorimportSshExecutorasyncdefmain():hosts=["host1","host2"]executor=SshExecutor(hosts)# running concurrentlyawaitexecutor.run("some_command --test")# access stdout for all hosts (or stderr)asyncforhost,outinexecutor.stdout:print(f"{host}:{out}")# wait until all finishedret_codes=awaitexecutor.wait()asyncio.run(main())See more usage incssh/cli.py.DevelopmentTo set up the development environment,
first clone this repo.Then it's recommended to usevenv:# suppose PWD is the root dir of the repopython-mvenvvenv# activate the environment``sourcevenv/bin/activate
pipinstall-rrequirements.txtTo deactivate, rundeactivate.LicenseThis project is licensed under AGPL-3.0. Copyright notice:concurrent-ssh
Copyright (C) 2023 DCsunset

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
Package: concurrent-tool
pip install concurrent-toolConcurrent libraries for easy use of thread pools, process pools, and coroutinesrequests must be installed to test before use,but the concurrent-tool library is not dependentimport requests
from tool import Multithreading, Multiprocess, Coroutines

def get_info(url):
    data = requests.get(url)
    print(data.status_code)
    return data

# use multithreading

request_list = [
                "http://icanhazip.com",
                "https://github.com/OmkarPathak/pygorithm",
                "https://www.cnblogs.com/lipijin/p/3862684.html"
               ]
multithreading = Multithreading(get_info, request_list, 2)
multithreading.multithreading()

# use multiprocess
multiprocess = Multiprocess(get_info, request_list, 3)
multiprocess.multiprocess()


# use coroutines
Coroutines([get_info(url) for url in request_list])
Package: concurrent-utils
Master:Develop:Concurrency utilities for Python 3.7 + asyncio; the main portion is a component abstraction.
To support this, some pipe implementations for inter-task, inter-thread, and inter-process communication
and some serialization utilities are provided as well.
Inter-process communication is based on ZeroMQ.
Finally a classEventLoopThreadis provided that can be used for bridging synchronous and asynchronous code.A “component” is code that is executing on its own, like an asyncio task, a thread, a worker thread’s load, or a process.
Components process commands issued by their owner, and create events to be handler by their owner.
Components may also produce a result, and of course may communicate with other entities than their owner.Although asyncio is used heavily, the connection between a workload and its owner decouples the two
to allow for any model of concurrency.
Here is an example, taken and adapted from the test suite:import asyncio
from concurrent.futures import ThreadPoolExecutor

from concurrent_utils.component import Component, component_workload, start_component_in_thread


async def test_thread_component_result_success_and_command():
    @component_workload
    async def component(x, *, commands, events):
        await events.send(Component.EVENT_START)
        ### startup complete

        # reply to command
        await commands.send(await commands.recv() + 1)

        # return
        return x

    e = ThreadPoolExecutor(1)
    comp = await start_component_in_thread(e, component, 1)

    assert await comp.request(1) == 2

    assert await comp.result() == 1


asyncio.run(test_thread_component_result_success_and_command())Although the component is defined as a coroutine, it is (in this case) not executed on the owner’s event loop.
The same component could, without modification, be run on the owner’s event loop,
or, with minor modifications to make thecomponentfunction pickle-able, be run in a worker process instead.
Package: concurrent-videocapture
concurrent-videocaptureOpencv VideoCapture that runs concurrently in a thread for faster processingInstallationYou can installconcurrent_videocapturefrom pip usingpip install concurrent_videocaptureor usingpip install git+https://github.com/charlielito/concurrent-videocaptureUsageIt follows the same api thancv2.VideoCapture, so the change in code is minimal. The following example just opens the Camera 0 and shows the image in a cv2 window while simulating a heavy image processing function withtime.sleep.importcv2importtimefromconcurrent_videocaptureimportConcurrentVideoCapture# Use it a the standard cv2.VideoCapture Classcap=ConcurrentVideoCapture(0)whileTrue:init=time.time()grabbed,frame=cap.read()# Simulate heavy image processing functiontime.sleep(0.3)ifnotgrabbed:breakcv2.imshow("video",frame)key=cv2.waitKey(1)ifkey==27:# ESCbreakfps=1/(time.time()-init)print('Fps:{}'.format(fps))cap.release()Additional parametersSometimes it is useful to perform some preprocessing to the image in the thread where the camera is read. For that we can use in the constructor the parametertransform_fn, which is a function that is applied to each frame. The flagreturn_rgbis for converting each frame to RGB since opencv by default returns the frames in GBR format. The next example will flip horizontally the image and return it as RGB:importcv2fromconcurrent_videocaptureimportConcurrentVideoCapturecap=ConcurrentVideoCapture(0,transform_fn=lambdaimage:cv2.flip(image,1),return_rgb=True)whileTrue:grabbed,frame=cap.read()ifnotgrabbed:breakcv2.imshow("video",frame)key=cv2.waitKey(1)ifkey==27:# ESCbreakcap.release()
Package: conda
Conda is a cross-platform, language-agnostic binary package manager. It is the
package manager used byAnacondainstallations, but it may be
used for other systems as well.  Conda makes environments first-class
citizens, making it easy to create independent environments even for C
libraries. Conda is written entirely in Python, and is BSD licensed open
source.InstallationWARNING:Usingpip install condaoreasy_install condawill not
give you conda as a standalone application.  Currently supported install
methods include the Anaconda installer and the miniconda installer.  You
can download the miniconda installer fromhttps://conda.io/miniconda.html.
Package: conda-app
Conda-appInstall isolated applications using condaconda-appis a tinycondaextension (actually a commandline tool usingcondaormamba) to install applications in isolated environments. Likepipxbut with conda environments.The main advantages are:very simplecross-platforminstallation commands for Windows, macOS and
Linux (and different shells, as bash, fish and zsh).the applications are installed inisolatedenvironments.commands provided by the applications areavailable system-wide, i.e. even
when the associated conda environment is not activated.Installation from theconda-forgechannel so there isno need for
compilation.Installation of conda-apppipinstallconda-appExample of MercurialMercurial and common extensions (hg-gitandhg-evolve) can be installed with:conda-appinstallmercurialThen, ina new terminal(on Windows, the "Conda Prompt"), the Mercurial
commandhgshould be available so one can tryhg version -v.This should also work:$ conda-app list
Installed applications:
 ['mercurial', 'spyder', 'pandoc']

$ conda-app uninstall pandoc
...
Package: conda-build
Installation# Display information about current conda installcondainfo# Install conda-build in the current envcondainstall-nrootconda-buildBuilding Your Own PackagesYou can easily build your own packages for conda, and upload them toanaconda.org, a free service for hosting packages for conda, as
well as other package managers.  To build a package, create a recipe.  Seehttp://github.com/conda/conda-recipesfor many example recipes, andhttp://conda.pydata.org/docs/build.htmlfor documentation on how to build
recipes.To upload to anaconda.org, create an account.  Then, install the anaconda-client
and login$condainstallanaconda-client$anacondaloginThen, after you build your recipe$condabuild<recipe-dir>you will be prompted to upload to anaconda.org.To add your anaconda.org channel, or the channel of others to conda so thatconda installwill find and install their packages, run$condaconfig--addchannelshttps://conda.anaconda.org/username(replacingusernamewith the user name of the person whose channel you want
to add).Gotchas/FAQ`OSError: [Errno 36] File name too long:`- This error has been seen on Linux computers with encrypted folders.  The solution is to install miniconda or anaconda to a location that is not encrypted.  This error occurs because the encrypted form of the path that conda-build creates can be too long.Getting HelpThe documentation for conda is athttp://conda.pydata.org/docs/. You can
subscribe to theconda mailing list.  The source
code and issue tracker for conda are onGitHub.ContributingContributions to conda-build are always welcome! Please fork the
conda/conda-build repository, and submit a PR. If a PR is a work in progress,
please put [WIP] in the title. Contributions are expected to pass flake8 and
test suites run on Travis CI (linux) and AppVeyor (windows). Contributors also
need to have signed ourContributor License AgreementTestingRunning our test suite requires cloning one other repo at the same level as conda-build:https://github.com/conda/conda_build_test_recipe- this is necessary for relative path tests
outside of conda build’s build tree.Additionally, you need to install a few extra packages:condainstallpytestpytest-covmockThe test suite runs with py.test. Some useful commands to run select tests,
assuming you are in the conda-build root folder:Run all tests:py.test testsRun one test function:py.test tests/test_api_build.py::test_early_abortRun one parameter of one parametrized test function:Several tests are parametrized, to run some small change, or build several
recipe folders. To choose only one of them:py.test tests/test_api_build.py::test_recipe_builds.py[entry_points]Note that our tests use py.test fixtures extensively. These sometimes trip up IDE
style checkers about unused or redefined variables. These warnings are safe to
ignore.
Package: conda-docker
Conda DockerConda Docker is an extension to the docker concept by having declarative
environments that are associated with docker images. In addition this
tool does not require docker to build images. Thus allowing for
interesting caching behavior and tricks that docker would not normally
allow.Features:dockeris not needed to build imagesdeclarative environments that map 1:1 to docker imagessignificantly faster build times since builds can take advantage of
package cacheinteresting opportunities for layering (e.g. mkl gets separate
layer)no dependencies allowing for library packaged aszipappQuickstartBuild conda docker image from command line:condadockerbuild-bfrolvlad/alpine-glibc:latest\-iexample-image:123456\-odemo.tar\numpynumbaflaskExamples using LibraryDownloading docker images without docker!fromconda_docker.registry.clientimportpull_imageimage=pull_image('frolvlad/alpine-glibc','latest')Modify docker image from filesystemfromconda_docker.docker.baseimportImagefromconda_docker.registry.clientimportpull_imageimage=pull_image('continuumio/miniconda3','latest')image.remove_layer()image.name='this-is-a-test'image.add_layer_path('./')image.add_layer_contents({'this/is/a/test1':b'this is test 1','this/is/a/test2':b'this is test 2'})image.layers[0].config['Env'].append('FOO=BAR')image.write_file('example-filter.tar')Build conda docker image from libraryfromconda_docker.condaimportbuild_docker_environmentbuild_docker_environment(base_image='frolvlad/alpine-glibc:latest',output_image='example-image:123456',packages=['numpy','numba','flask',],output_filename='demo.tar')How does this work?Turns out that docker images are just a tar collection of files. There
are several versions of the spec. Forv1.0the specification isdefined here.
Instead of writing down the spec lets look into a single docker image.dockerpullubuntu:latest
dockersaveubuntu:latest-o/tmp/ubuntu.tarList the directory structure of the docker image. Notice how it is a
collection oflayer.tarwhich is a tar archive of filesystems. And
several json files.VERSIONfile is always1.0currently.tar-tvf/tmp/ubuntu.tarDockerhub happens to export docker images in av1-v1.2compatible
format. Lets only look at the files important forv1. Repositories
tells the layer to use as the layer head of the current name/tag.tar-xf/tmp/ubuntu.tar$filenamecat$filename|python-mjson.toolFor each layer there are three files:VERSION,layer.tar, andjson.tar-xf/tmp/ubuntu.tar$filenamecat$filenametar-xf/tmp/ubuntu.tar$filenamecat$filename|python-mjson.toolLooking at layer metadata.{"id":"93935bf1450219e4351893e546b97b4584083b01d19daeba56cab906fc75fc1c","created":"1969-12-31T19:00:00-05:00","container_config":{"Hostname":"","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":null,"Image":"","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"os":"linux"}Looking at the layer filesystem.tar-xf/tmp/ubuntu.tar$filenametar-tvf$filename|headReferencesDocker Registry API
SpecificationDocker Image SpecificationSummaryRegistry V2
Specification