Saravanan666/pypi-org huggingface dataset:
Package: cognito-code-grant
AWS Cognito code grant for Django Rest FrameworkThis package implements an authentication backend and a set of handlers that enable your application to use
code grant authentication with AWS Cognito.The package has been developed by STITCH (https://www.stitchdesignlab.com/)The documentation for this project is a work-in-progress and is pretty much bare bones. Do not hesitate to
contact us, or open an issue or PR for contribution.LinksAWS CognitoDjango Rest FrameworkGrant types of Cognito explained by AWSCode grantCode grant is an OAuth 2.0 flow that allows one to use Cognito as a data store and authentication backend
for users, while maintaining an updating replica of User and Group information in your applications database.
This way, the application gains the possibility to add custom business logic for users, while the user data is
still stored and managed centrally through Cognito.This is especially useful when you are implementing multiple API backends for a platform that consist of multiple
applications that need to operate on a shared userbase.See the link above for a detailed explanation of the standard.InstallationYou can install this package from pip:pip install cognito_code_grantUsageThe implementation consists of anauthentication backend, a login handler, and a logout handler.
To use the backend, simply specify it in your Django Settings:REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'cognito_code_grant.authentication.CognitoAuthentication',
        'rest_framework.authentication.BasicAuthentication',
        ...
    )To use the handlers, include them in your URLs using a helper function:from cognito_code_grant.views import include_auth_urls

urlpatterns = [
    path('auth/', include_auth_urls()),
    ...
]Additionally, you will need to set the following settings to point to your instance of Cognito:AUTH_COGNITO_CLIENT_ID = # your client ID
AUTH_COGNITO_CODE_GRANT_URL = # your token endpoint (https://AUTH_DOMAIN/oauth2/token)
AUTH_COGNITO_JWKS_URL = # the url for your JWKs (https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json.)DevelopmentTo run tests, you need to point Django to local test settings, and run the migrations (it will use an sqllite db in a temp folder).exportDJANGO_SETTINGS_MODULE=tests.settingspython-mdjangomigratepython-mdjangotestOn a merge to master, CICD will automatically create apatchversion bump, and deploy to pypi. Minor/Major realeases need to be handled manually by the maintainers.
Package: cognitojwt
Decode and verifyAmazon CognitoJWT tokensNote: tested on Python >= 3.6, compatible with PEP-492 (async/await coroutines syntax)InstallationPackage works in two modes: synchronous -requestsas http-client and asynchronous -aiohttpas http-client.
In order to avoid installing unnecessary dependencies I separated installation flow into two modes:Async mode -pip install cognitojwt[async]Sync mode -pip install cognitojwt[sync]Usageimportcognitojwtid_token='<YOUR_TOKEN_HERE>'REGION='**-****-*'USERPOOL_ID='eu-west-1_*******'APP_CLIENT_ID='1p3*********'# Sync modeverified_claims:dict=cognitojwt.decode(id_token,REGION,USERPOOL_ID,app_client_id=APP_CLIENT_ID,# Optionaltestmode=True# Disable token expiration check for testing purposes)# Async modeverified_claims:dict=awaitcognitojwt.decode_async(id_token,REGION,USERPOOL_ID,app_client_id=APP_CLIENT_ID,# Optionaltestmode=True# Disable token expiration check for testing purposes)Note: if the application is deployed inside a private vpc without internet gateway, the application will not be able to download the JWKS file.
In this case set theAWS_COGNITO_JWKS_PATHenvironment variable referencing the absolute or relative path of the jwks.json file.It is possible to allow multiple app client ids by passing the value as a Container instance such as a list or tuple:ALLOWED_CLIENT_IDS=('client_one','client_two')verified_claims:dict=cognitojwt.decode(id_token,REGION,USERPOOL_ID,app_client_id=ALLOWED_CLIENT_IDS,testmode=True# Disable token expiration check for testing purposes)
Package: cognito-login
Cognito Login: A CLI to get a jwt from cognito login credentialsMakes heavy use of thewarrantlibrary to make it easy to get a jwt from a cognito userpool.ConfigurationConfiguration for this project is sourced from your current working directory./.cognito-login.yaml, your home directory~/.cognito-login.yaml, or environment variables showin in thecognito-login --helpoutput.Configuration file properties look similar to the command-line arguments, except without the--.The following command$cognito-login--user-pool-idus-east-1_ABCABCABC--app-client-idabcabcabcabcabcabcabcabcab-u...-p...can be made easier by defining the following config:user-pool-id:us-east-1_ABCABCABCapp-client-id:abcabcabcabcabcabcabcabcabso you just have to execute this command:$cognito-login-u...-p...Usage-h, --helpGet more information on how to use the command-v, --versionDisplay the current version of cognito-login--user-pool-idThe ID of the user pool you want to authenticate with--app-client-idThe ID of the user pool's app client you want to authenticate with-u, --usernameThe username of the user you want to authenticate-p, --passwordThe password of the user you want to authenticate
Package: cognito-oauthtools
cognito-oauthtoolsSimple AWS Cognito client to simplify project implementation.Getting StartedInstallationcognito-oauthtools can easily be install using pip:pipinstallcognito-oauthtoolsObjectsClientcognito_oauthtools.ClientIntializingTo intialize acognito_oauthtools.Client, you must pass it:endpointThe dns name of the Cognito endpointclient_idThe id of your Cognito authorizer clinetclient_secretThe secret for your Cognito clienthost_domainThe domain name of the server that cognito will hit with oauth redirectslogout_path="/"Path on the host to return to after logging outredirect_path="/oauth"Path on the host to return to after logging inoauth=cognito_oauthtools.Client('ENDPOINT.amazoncognito.com','CLIENT_ID','CLIENT_SECRET','myapp.example')PropertiesloginUrlCognito URL to authorizeregisterUrlCognito URL to register a new userlogoutUrlCognito URL to logoutMethodsget_token(code)Method that gets cognito token from the oauth return codeUsercognito_oauthtools.UserIntializingTo intialize acognito_oauthtools.User, you must pass it:clientcognito_oauthtools.Clientobject for the user to usetokenThe user's authorization tokenuser=cognito_oauthtools.User(client,"xxxxTOKENxxxx")
Package: cognito-overlay
Cognito OverlayAWS Cognito is AWS's authentication framework.This overlay is intended to leverage a Cognito User Pool and provide authorizers and a simplified API (via Flask App) that can be mounted into an existing API Gateway (rather than communicating with the Cognito service from the front-end directly).A Terraform Module is also provided that will stand up the IAM roles and Cognito User Pool and groups. This can be referenced directly, or used as a basis for a different implementation.
Package: cognito-search
Have you ever used the Cognito’s UI in Amazon? Yeah, super painful.
Inspired by dkerwin’sssm-search, I decided to
make this small utility. It’ll search in your cognito user pools,
looking for any matches inName(case insensitive)Installation$pipinstallcognito-searchUsage$cognito-search-suser-pool-nameCognitoSearchversion0.0.1SearchingUserPoolfor['test']ReadinguserpoolsfromCognito................{u'CreationDate':datetime.datetime(2018,8,24,10,8,26,994000,tzinfo=tzlocal()),u'Id':u'REDACTED',u'LambdaConfig':{},u'LastModifiedDate':datetime.datetime(2018,8,24,10,8,26,994000,tzinfo=tzlocal()),u'Name':u'user-pool-name'}Found1matchesoutof1234userpoolsfromCognitoIf you need to specify an AWS profile to use, just add--profiledev(etc).Publishing Updates to PyPiFor the maintainer - to publish an updated version of cognito-search,
increment the version number in version.py and run the following:dockerbuild-f./Dockerfile.buildenv-tcognito-search:build.dockerrun--rm-it--entrypointmakecognito-search:buildpublishAt the prompts, enter the username and password to the pypi.org repo.LicenseMIT LicensePermission 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: cognito-user-shell
cognito-user-shellExtendable Python shell/CLI tool/API client with AWS Cognito authenticationExample package shows how you can expand and implement your own tools.Installationpip install cognito-user-shellRun the examplegitclonehttps://github.com/jussiniinikoski/cognito-user-shell.gitcdcognito-user-shell# Set up some environment variables# set PYTHONPATH to current directory if didn't pip installexportPYTHONPATH=./exportCOGNITO_CLIENT_ID=add-your-aws-cognito-client-id-hereexportAPI_URL=http://127.0.0.1:8000
pythonexample
Package: cognosco
Cognosco is a command line tool for auditing the merged pull requests
on Github or Github Enterprise, using the Github API.  It generates a
report of all policy violations for all the repositories it was
requested to examine.  Each pull request is listed with a link to the
pull request, as well as an indication of which policy rules were
violated.UsageCognosco usescli_tools, and so provides extensive help text,
accessible by using the “–help” argument.  The primary arguments it
needs have to do with authenticating to Github (see the help for
“–username”, “–password”, and “–github-url”; note that cognosco
will prompt for a password if none is provided).Cognosco also must be told which repositories to examine; this is done
by passing one or more of the “–repo”, “–user”, or “–org” options.
(Note that cognosco will generate an empty report if none of these
options are passed.)  Any mix of these options may be used; cognosco
will explore all listed repositories, and all repositories it can see
under the listed users or organizations.
Package: cog-reloader
Cog reloaderMake reloading cogs easy while editing. Compitable withnextcordanddiscord.pyWarningDon't load this while bot is in production, Load only in development environment.This will not reload files that are not cog.Installationpip install cog-reloaderUsagefromdiscord.extimportcommandsbot=commands.Bot(command_prefix='/')@bot.eventasyncdefon_ready():print(f'We have logged in as{bot.user}')bot.load_extension('cog_reloader')# make sure its an `_` not `-`TOKEN='TOKEN_HERE'bot.run(TOKEN)Join DiscordFor any kind of help
Package: cogreqs
CogreqsCogreqs is an experimental drop-in replacement forcog initthat intelligently populatescog.yaml.Installationpip install cogreqsUsageRun the following command in an existing Python repository:$ cogreqs --gpu .

Wrote cog.yaml
Wrote predict.pycog.yaml may now contain something like# Configuration for Cog ⚙# Reference: https://github.com/replicate/cog/blob/main/docs/yaml.mdbuild:# set to true if your model requires a GPUgpu:true# a list of ubuntu apt packages to installsystem_packages:-"ffmpeg"-"libsndfile-dev"# python version in the form '3.8' or '3.8.12'python_version:"3.8"# a list of packages in the format <package-name>==<version>python_packages:-"librosa==0.9.1"-"numpy==1.22.2"-"scipy==1.8.0"-"torch==1.10.2"# commands run after the environment is setuprun:NOTE:Cogreqs outputs a predict.py that's only compatible with thefuturebranch of Cog. Until that branch is merged into main, install Cog fromhttps://github.com/replicate/cog/releases/tag/v0.1.0-alphaYou can also output the generated cog.yaml contents to stdout:$ cogreqs --config-path=- --predict-path=/dev/null .

# Configuration for Cog ⚙
# Reference: https://github.com/replicate/cog/blob/main/docs/yaml.md

build:
[...]CLI referenceusage: cogreqs [-h] [-f] [-g] [--config-path CONFIG_PATH] [--predict-path PREDICT_PATH] folder

Generate cog.yaml and predict.py from an existing repository. This is an experimental alternative to
cog init

positional arguments:
  folder                Project folder

optional arguments:
  -h, --help            show this help message and exit
  -f, --force-overwrite
                        Overwrite existing cog.yaml and predict.py
  -g, --gpu             Use GPU
  --config-path CONFIG_PATH
                        Config file path (default cog.yaml)
  --predict-path PREDICT_PATH
                        Predict file path (default predict.py)How does it work?Cogreqs usespipreqsto extract requirements from Python files in a repository. It then applies a sequence of heuristics on those requirements to populatepython_packagesandsystem_packagesincog.yaml.For example, cogreqs knows thatlibrosarequires theffmpegandlibsndfile-devsystem packages so it will add those tosystem_packagesiflibrosais one of the python requirements.Work in progress!This project is very much work in progress. Please submit an issue or pull request if you have ideas for heuristics or other features!
Package: cogwatch
Cog WatchAutomatic hot-reloading for your discord.py command files.cogwatchis a utility that you can plug into yourdiscord.pybot(or
various supported bot libraries)that will watch your command files directory(cogs)and automatically reload them as you modify or move them around in
real-time.No more reloading your commands manually every time you edit an embed just to
make sure it looks perfect!FeaturesAutomatically reloads commands in real-time as you edit them(no !reload
<command_name> needed).Optionally handles the loading of all your commands on start-up(removes
boilerplate).Supported Librariescogwatchshouldwork with any library that forked fromdiscord.py.
However, these libraries have been explicitly tested to work:discord.pynextcorddiscord4pydisnakepycordGetting StartedYou can install the library withpip install cogwatch.Import thewatchdecorator and apply it to youron_readymethod and let the
magic take effect.See theexamplesdirectory for more details.importasynciofromdiscord.extimportcommandsfromcogwatchimportwatchclassExampleBot(commands.Bot):def__init__(self):super().__init__(command_prefix='!')@watch(path='commands',preload=True)# This is all you need to add.asyncdefon_ready(self):print('Bot ready.')asyncdefon_message(self,message):ifmessage.author.bot:returnawaitself.process_commands(message)asyncdefmain():client=ExampleBot()awaitclient.start('YOUR_TOKEN_GOES_HERE')if__name__=='__main__':asyncio.run(main())ConfigurationThese options can be passed to the decorator(or the class if manually
initializing):path: Path of the directory where your command files exist; cogwatch will
watch recursively within this directory.Defaults to 'commands'.preload: Whether to detect and load all cogs on start.Defaults to False.colors: Whether to use colorized terminal outputs or not.Defaults to
True.default_logger: Whether to use the default logger(to sys.stdout)or not.Defaults to True.loop: Custom event loop.Defaults to the current running event loop.debug: Whether to run the bot only when the Python__debug__flag is
True.Defaults to True.NOTE:cogwatchwill only run if the__debug__flag is set on
Python. You can read more about thathere. In short, unless you
run Python with the-Oflag from your command line,__debug__will beTrue. If you just want to bypass this feature, pass indebug=Falseand it
won't matter if the flag is enabled or not.LoggingBy default, the utility has a logger configured so users can get output to the
console. You can disable this by passing indefault_logger=False. If you want
to hook into the logger -- for example, to pipe your output to another terminal
ortaila file -- you can set up a custom logger like so:importloggingimportsyswatch_log=logging.getLogger('cogwatch')watch_log.setLevel(logging.INFO)watch_handler=logging.StreamHandler(sys.stdout)watch_handler.setFormatter(logging.Formatter('[%(name)s]%(message)s'))watch_log.addHandler(watch_handler)Licensecogwatch is available under theMIT License.
Package: cog-worker
Cog WorkerScalable geospatial analysis on Cloud Optimized GeoTIFFs.Documentation:https://vizzuality.github.io/cog_workerPyPI:https://pypi.org/project/cog-workercog_worker is a simple library to help write scripts to conduct scaleable
analysis of gridded data. It's intended to be useful for moderate- to large-scale
GIS, remote sensing, and machine learning applications.Installationpip install cog_workerExamplesSeedocs/examplesfor Jupyter notebook examplesQuick startA simple cog_worker scriptfromrasterio.plotimportshowfromcog_workerimportManagerdefmy_analysis(worker):arr=worker.read('roads_cog.tif')returnarrmanager=Manager(proj='wgs84',scale=0.083333)arr,bbox=manager.preview(my_analysis)show(arr)Define an analysis function that recieves a cog_worker.Worker as the first parameter.fromcog_workerimportWorker,Managerimportnumpyasnp# Define an analysis function to read and process COG data sourcesdefMyAnalysis(worker:Worker)->np.ndarray:# 1. Read a COG (reprojecting, resampling and clipping as necessary)array:np.ndarray=worker.read('roads_cog.tif')# 2. Work on the array# ...# 3. Return (or post to blob storage etc.)returnarrayRun your analysis in different scales and projectionsimportrasterioasrio# Run your analysis using a cog_worker.Manager which handles chunkingmanager=Manager(proj='wgs84',# any pyproj stringscale=0.083333,# in projection units (degrees or meters)bounds=(-180,-90,180,90),buffer=128# buffer pixels when chunking analysis)# preview analysisarr,bbox=manager.preview(MyAnalysis,max_size=1024)rio.plot.show(arr)# preview analysis chunksforbboxinmanager.chunks(chunksize=1500):print(bbox)# execute analysis chunks sequentiallyforarr,bboxinmanager.chunk_execute(MyAnalysis,chunksize=1500):rio.plot.show(arr)# generate job execution parametersforparamsinmanager.chunk_params(chunksize=1500):print(params)Write scale-dependent functions¶importscipydeffocal_mean(worker:Worker,kernel_radius:float=1000# radius in projection units (meters))->np.ndarray:array:np.ndarray=worker.read('sample-geotiff.tif')# Access the pixel size at worker.scalekernel_size=kernel_radius*2/worker.scalearray=scipy.ndimage.uniform_filter(array,kernel_size)returnarrayChunk your analysis and run it in a dask clusterfromcog_worker.distributedimportDaskManagerfromdask.distributedimportLocalCluster,Client# Set up a Manager with that connects to a Dask clustercluster=LocalCluster()client=Client(cluster)distributed_manager=DaskManager(client,proj='wgs84',scale=0.083333,bounds=(-180,-90,180,90),buffer=128)# Execute in worker pool and save chunks to disk as they complete.distributed_manager.chunk_save('output.tif',MyAnalysis,chunksize=2048)
Package: cogworks-data
# cogworks_data
Hosts data for cogworks## For MaintainersTo perform an editable install, clone this repo, navigate to its top level (to the directory that containssrc/andsetup.py) and run`console $ pip install-e. `Now any edits you make to the source code will immediately be reflected in your install.MIT LicenseCopyright (c) 2022 Massachusetts Institute of TechnologyPermission 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: cogwright
Implements thecogcommand.cog makewill run the standard build procedure in the current working directory. The working directory should be the project root of your git repository. Module-specific parameters and methods are specified via the__blueprint__.pyfile, which should be in the working directory. FTP login credentials may be specified in the__auth__.pyfile, which should be in the working directory, and listed in the.gitignorefile.cog -A downloadarchivename.zip makewill specify a different archive to use as the module payload.Home-page:https://github.com/philipov/cogwrightAuthor: Philip Loguinov
Author-email:philipov@gmail.comLicense: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status : : 2 - Pre - Alpha
Classifier: Environment :: Console
Classifier: Environment :: Other Environment
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Customer Service
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: Microsoft :: Windows :: Windows 7
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.6
Requires: twine
Requires: wheel
Package: cohere-aws
Cohere Python SDK (AWS SageMaker & Bedrock)This package provides functionality developed to simplify interfacing with theCohere models via AWS SageMaker Marketplaceand theCohere models via AWS Bedrockin Python >=3.9InstallationThe package can be installed with pip:pipinstall--upgradecohere-awsInstall from source:pythonsetup.pyinstallQuick StartTo use this library, you need to configure your AWS credentials. You can do this by runningaws configure. Once that's set up, please refer to one of the Jupyter notebooks to get started. Here is the one for ourmedium command modelNote: by default we assume region configured in AWS CLI (aws configure get region), to override useregion_nameparameter, e.g.client=Client(region_name='us-east-1')
Package: cohere-haystack
cohere-haystackTable of Contentscohere-haystackInstallationContributingLicenseInstallationpip install cohere-haystackContributinghatchis the best way to interact with this project, to install it:pipinstallhatchWithhatchinstalled, to run all the tests:hatch run testNote: integration tests will be skipped unless the env var COHERE_API_KEY is set. The api key needs to be valid
in order to pass the tests.To only run unit tests:hatch run test -m"not integration"To only run embedders tests:hatch run test -m"embedders"To only run generators tests:hatch run test -m"generators"Markers can be combined, for example you can run only integration tests for embedders with:hatch run test -m"integrations and embedders"To run the lintersruffandmypy:hatch run lint:allLicensecohere-haystackis distributed under the terms of theApache-2.0license.
Package: cohere-sagemaker
Cohere Python SDK (AWS SageMaker)This package provides functionality developed to simplify interfacing with theCohere models via AWS SageMaker Marketplacein Python >=3.6InstallationThe package can be installed with pip:pipinstall--upgradecohere-sagemakerInstall from source:pythonsetup.pyinstallQuick StartTo use this library, you need to configure your AWS credentials. You can do this by runningaws configure. Once that's set up, please refer to one of the Jupyter notebooks to get started. Here is the one for ourmedium command modelNote: by default we assume region configured in AWS CLI (aws configure get region), to override useregion_nameparameter, e.g.client=Client(region_name='us-east-1')