Saravanan666/pypi-org huggingface dataset:
Package: gcloud-flask-oauth-cors
A small class that helps with authentication and CORS for HTTP-triggered cloud functions written in Python and hosted on GCPPlease note: This is not an officially supported Google product.If you are using OAuth to authenticate to aCloud Function written in Pythonand hosted on GCP, and your client is running in a browser, this is for you. If not, you probably won't find this useful.This class does three things:Responds correctly and configurably to the HTTP OPTIONS method used by browsers to do pre-flight checks as part of CORSRetrieves an OAuth2 token supplied in theAuthorizationHTTP header, validates it, and then fetches the information encoded by the tokenGives you back either a valid token, or a response to send back to the user in case a valid token can't be foundInstallationYou can install the latest version of this package using pip:python3 -m pip install --user gcloud-flask-oauth-corsIt's hosted on pypi:https://pypi.org/project/gcloud-flask-oauth-cors/UseIf you don't have one,create an OAuth client IDandpass it as an environment variableto your cloud function. Then, you can use the following:import gcloud_flask_oauth_cors as oauth

def my_function_name(request):
    auth = oauth.Auth(os.getenv("OAUTH_CLIENT_ID"))
    id_info = auth.get_id_info(request)
    if id_info is None:
        # If we were called with the HTTP OPTIONS method, this will return the relevant CORS headers.
        # If another HTTP method was used and we can't authenticate, this will return a 401 (Unauthorized)
        return auth.get_response()

    # Do something with the id_info, for example:
    print(id_info["sub"])On the client side, you can useGoogle Sign-in. Make sure you pass yourid_tokenin any requests like this:let xhr = new XMLHttpRequest();
xhr.setRequestHeader("Authorization", "Bearer " + id_token);
Package: gcloud-functions-params
# Gcloud functions paramspackage for manage params in python gcloud functions## Install```requirements.txtgcloud-functions-params==0.0.2```## Http functionYou can call the function sending arguments:http://function-url?name=exampleor sending json```curl http://function-url -H "Content-Type: application/json" -d '{"name": "example"}'``````pythonfrom gcloud_functions_params import args_or_json_to_dictdef main(request):params = args_or_json_to_dict(request)```## Pubsub functionyou can send a json in the event messagemessage: '{"name": "example"}'```pythonfrom gcloud_functions_params import event_to_dictdef main(event, context):params = event_to_dict(event)```
Package: gcloud_helpers
# gcloud-helpers
Helper Functions for the gcloud apiAs of 2015/03/12, this only contains a helper
for connecting to the datastore. It can be pip installed
by specifying the git repository (and optionally, a hash).
Also, the gcloud datastore API is being updated pretty rapidly.
This code works with gcloud version 0.4.0.
If you update this repo to work
with a newer version of gcloud, make sure to update
requirements.txt
Package: gcloud-network-authorizer
gcloud-authorizerSimple python script to authorize dynamic IPs for Google Cloud clusters and SQL databasesThis is a very simple script that authorizes your current IPv4 IP in the Google Cloud SQL instances and the Google Cloud Kubernetes instances.There is a lot left on implementation like being able to save many instances and code quality (yikes). The data saved is not encrypted yet but it is not the highest priority since this is just basic information which is useless without any authorization data like an access token (which is generated by the gcloud command).GitHub link:https://github.com/ArtAhmetaj/gcloud-authorizerInstallingpip install gcloud-network-authorizerUsageThe base data of the instance, the project name, the zone (conditionally if it’s a database or a cluster change) and the network name must be first saved and then sent in subsequent calls.Sql usageauthorize_networks sql_save –name=<author_name> –sql_instance=<instance_name> –project_name=<project_name>authorize_networks authorize_sqlKubernetes usageauthorize_networks kubernetes_save –name=<author_name> –kubernetes_instance=<name_of_instance> –project_name=<name_of_project> –zone=<geographical_zone>authorize_networks authorize_kubernetes
Package: gcloudoem
Python object to entity mapper for Google Datastore with Django support.Quickstartfrom gcloudoem import *

class TestEntity(Entity):
    name = TextProperty()


class OtherTestEntity(Entity):
    address = TextProperty(default='blah')
    te = ListProperty(ReferenceProperty(TestEntity))

connect(dataset_id='dataset_id', namespace='demo')

es = TestEntity.objects.filter(name='Alice')
oe = OtherTestEntity(te=[e for e in es])
oe.save()
ot = OtherTestEntity.objects.get(pk=oe.key.name_or_id)
print(ot.key.name_or_id, [te.name for te in ot.te])
query = query.Query(TestEntity)
query.add_filter("name", "=", "Kris")
cursor = query()
print([(e.name, e.key.name_or_id,) for e in list(o)])Copyright and LicenseGcloudoem is Copyright (C) the respective authors of the files, as noted at the top of each file. If not noted, it is
Copyright 2015 Kapiche Ltd.Licensed 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.
Package: gcloud-rest-auth
This is a shared codebase forgcloud-rest-authandgcloud-rest-authThis library implements anIamClientclass, which can be used to interact
with GCP public keys and URL sign blobs.It also implements anIapTokenclass which is used for authorizing against
anIdentity-Aware Proxy(IAP) secured GCP service. IAP uses identity tokens
which are specific to the target service and allows administrators to configure
a list of identities (ex. service accounts, users, or groups) that may access
the service. Therefore eachIapTokeninstance corresponds to an ID token
which may be used to authorize against a single IAP service.It additionally implements aTokenclass, which is used for authorizing
against Google Cloud. The othergcloud-rest-*package components accept aTokeninstance as an argument; you can define a single token for all of
these components or define one for each. Each component corresponds to a given
Google Cloud service and each service requires various “scopes”.Installation$pipinstall--upgradegcloud-{aio,rest}-authUsageSeeour docs.ContributingPlease see ourcontributing guide.
Package: gcloud-storage-emulator
Local Emulator for Google Cloud StorageGoogle doesn't (yet) ship an emulator for the Cloud Storage API like they do for
Cloud Datastore.This is a stub emulator so you can run your tests and do local development without
having to connect to the production Storage APIs.THIS IS A WORK IN PROGRESS AND ONLY SUPPORTS A LIMITED SUBSET OF THE APILooking for Commercial Support?Potato offers Commercial Support for all its Open Source projects and we can tailor a support package to your needs.If you're interested in commercial support, training, or consultancy then go ahead and contact us atopensource@potatolondon.comInstallationpip install gcloud-storage-emulatorCLI UsageStarting the emulatorStart the emulator with:$gcloud-storage-emulatorstart--port=9090By default, data is stored under$PWD/.cloudstorage. You can configure the folder using the env variablesSTORAGE_BASEandSTORAGE_DIR.If you wish to run the emulator in a testing environment or if you don't want to persist any data, you can use the--no-store-on-diskparameter. For tests, you might want to consider starting up the server from your code (see thePython APIs)If you're using the Google client library (e.g.google-cloud-storagefor Python) then you can set theSTORAGE_EMULATOR_HOSTenvironment variable to tell the library to connect to your emulator endpoint rather than the standardhttps://storage.googleapis.com, e.g.:$exportSTORAGE_EMULATOR_HOST=http://localhost:9090Wiping dataYou can wipe the data by running$gcloud-storage-emulatorwipeYou can pass--keep-bucketsto wipe the data while keeping the buckets.Python APIsTo start a server from your code you can dofromgcloud_storage_emulator.serverimportcreate_serverserver=create_server("localhost",9023,in_memory=False)server.start()# ........server.stop()You can wipe the data (e.g. for text execution) by callingserver.wipe()This can also be achieved (e.g. during tests) by hitting the/wipeendpointRunning TestsWith ToxIf you have Tox installed then you can run tests with:tox-epy37--{extra_pytest_args}With DockerIf you don't have Tox installed on your system but you do have Docker, then you can run the tests using thethemattrix/toximage:dockerrun-v/ABSOLUTE/PATH/TO/THIS/REPO/ON/YOUR/MACHINE:/appthemattrix/toxtox-epy37[optionaladditionalargsfortox...]With unittestCreate and activate a virtualenv (optional but recommended)cdinto the repository directorypip install -epython -m unittest gcloud_storage_emulator.tests
Package: gcloud-tail
gcloud-tailThegcloudCLI provides a way to "tail" logs from Google App Engine, but not from Stackdriver.  Which is
odd, because it's not especially difficult to do so.  That's what this utility accomplishes.UsageRun this asgcloud-tail FILTER.  The result is in JSON format, with one line per log message.
You can process the results withjq.  For example:$gcloud-tail'severity>=ERROR'|jq-r.textPayloadInstallationThis is a simple Python distribution.  The easiest way to install ispipinstallgcloud-tail
Package: gcloud_taskqueue
Google Taskqueue client=======================Support for Python client for `Task Queue Rest API`_ using `gcloud`_.. _Task Queue Rest API: https://cloud.google.com/appengine/docs/python/taskqueue/rest/.. _gcloud: https://googlecloudplatform.github.io/gcloud-python/Required Dependencies---------------------The following third-party Python modules are required:- gcloudThe easiest way to install the dependencies is to run::$ pip install -r requirements.txtWhy an interface to the Task Queue API?---------------------------------------The Google Cloud Client Library for Python (`gcloud`_) is great, but it's missingan interface to the Task Queue Rest API. This is understandable, because the APIis experimental and still in alpha, and not fully accesble from outside the App Egine.And gcloud does support Pubsub.However, Task Queues offer a few functions that aren't available in Pubsub. Andalthough Push Queues are restricted to use within App Engine, Pull Queues can beused outside the App Engine enviroment.With Pull Queues a worker can lease tasks for a certain period. During this period,the tasks aren't available to other workers. This prevents processing a single taskmultiple times by different workers. This makes Task Queues very useful for backgroundprocessing, for example in combination with object change notifications, to processobjects in a Storage Bucket the moment they are changed or created... https://cloud.google.com/compute/docs/tutorials/batch-processing-with-autoscaler.. https://cloud.google.com/appengine/docs/python/taskqueue/restExample-------Example::>>> from gcloud_taskqueue import Taskqueue, ClientFor object change notifications, you need to create a service account. To pull taskscreated with this account, you need to use it's credentials::>>> json_credentials_path = "/path/to/my-service-credential.json">>> client = Client.from_service_account_json(json_credentials_path, project="my-project")Get taskqueue::>>> tq = Taskqueue(client=client, id="my-taskqueue")Get tasks in taskqueue::>>> for task in tq.list_tasks(client=client):>>>     print("{}\t{}\t{}".format(task.id, task.leaseTimestamp, task.retry_count))Lease 10 tasks for 60 seconds::>>> for task in tq.lease(lease_time=60, num_tasks=10, client=client):>>>     print("{}\t{}\t{}".format(task.id, task.leaseTimestamp, task.retry_count))Lease 10 tasks with specific tag for 60 seconds::>>> for task in tq.lease(lease_time=60, num_tasks=10, tag='my-tag', client=client):>>>     print("{}\t{}\t{}".format(task.id, task.leaseTimestamp, task.retry_count))v0.1.0, -- Initial release.v0.1.1, 2016.04.07 -- bugfix, Taskqueue().exists() returns false if taskqueue does not exist (https://github.com/sebastiancodes/gcloud_taskqueue/issues/1)v0.1.2, 2016.04.07 -- fix indentation, raise DoesNotExist exception if Taskqueue does not exist https://github.com/sebastiancodes/gcloud_taskqueue/issues/1
Package: gcloud-tasks-emulator
Local Emulator for Google Cloud TasksGoogle doesn't (yet) ship an emulator for the Cloud Tasks API like they do for
Cloud Datastore.This is a stub emulator so you can run your tests and do local development without
having to connect to the production Tasks API.THIS IS A WORK IN PROGRESS NOT ALL API CALLS ARE COMPLETELooking for Commercial Support?Potato offers Commercial Support for all its Open Source projects and we can tailor a support package to your needs.If you're interested in commercial support, training, or consultancy then go ahead and contact us atopensource@potatolondon.comUsageStart the emulator with:gcloud-tasks-emulator start --port=9090Then from within your code, use the following (instead of your normal production client connection)Pythonimportgrpcfromgoogle.cloud.tasks_v2importCloudTasksClientfromgoogle.cloud.tasks_v2.gapic.transports.cloud_tasks_grpc_transportimportCloudTasksGrpcTransportclient=CloudTasksClient(transport=CloudTasksGrpcTransport(channel=grpc.insecure_channel("127.0.0.1:9090")))Node.jsconstgrpc=require("@grpc/grpc-js");const{CloudTasksClient}=require('@google-cloud/tasks');constclient=newCloudTasksClient({servicePath:"localhost",port:9090,sslCreds:grpc.credentials.createInsecure()});Javaimportcom.google.api.gax.core.NoCredentialsProvider;importcom.google.api.gax.grpc.InstantiatingGrpcChannelProvider;importcom.google.cloud.tasks.v2.CloudTasksClient;importcom.google.cloud.tasks.v2.CloudTasksSettings;importio.grpc.ManagedChannelBuilder;CloudTasksSettingssettings=CloudTasksSettings.newBuilder().setCredentialsProvider(NoCredentialsProvider.create()).setTransportChannelProvider(InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost:9090").setChannelConfigurator(ManagedChannelBuilder::usePlaintext).build()).build();CloudTasksClientclient=CloudTasksClient.create(settings);The 'default' queueBy default, the emulator won't create a 'default' queue, however you can enable this
by passing the fully-qualified name of the queue:gcloud-tasks-emulator start --default-queue=projects/[PROJECT]/locations/[LOCATION]/queues/defaultSpecifying a queue.yamlIf your project uses a queue.yaml file, you can create default queues by passing its path to the--queue-yamlargument.Additionally, you'll likely want to pass--queue-yaml-projectand--queue-yaml-locationto generate the correct
fully qualified queue names. These settings will otherwise default to"[PROJECT]"and"[LOCATION]"respectively.Specifying a targetTask queue needs to point at a service for outgoing requests. You can specify this with--target-hostand--target-portTestingRun:python gcloud_tasks_emulator/tests.py
Package: gcm-clerk
Python client forGoogle Cloud Messaging (GCM).
Checkdocumentationto learn how to use it.Check the client with similar interface forApple Push Notification service.
This package is based on gcm-client, which was created bySardar Yumatov.Requirementsrequests- HTTP request, handles proxies etc.omnijsonif you use Python 2.5 or older.AlternativesTh only alternative library known at the time of writing waspython-gcm.  This library differs in the
following design decisions:Predictable execution time. Do not automatically retry request on failure.
According to Google’s recommendations, each retry has to wait exponential
back-off delay. We use Celery back-end, where the best way to retry after
some delay will be scheduling the task withcountdown=delay.  Sleeping
while in Celery worker hurts your concurrency.Do not forget results if you need to retry. This sounds obvious, butpython-gcmdrops important results, such as canonical ID mapping if
request needs to be (partially) retried.Clean pythonic API. No need to borrow all Java like exceptions etc.Do not hard-code validation, let GCM fail. This decision makes library
a little bit more future proof.SupportPlease report any bugs or requests throughBitbucketTodoOwn documentation for gcm-clerkAttributions for previous work etc.
Package: gcm-client
Python client forGoogle Cloud Messaging (GCM).
Checkdocumentationto learn how to use it.Check the client with similar interface forApple Push Notification service.Requirementsrequests- HTTP request, handles proxies etc.omnijsonif you use Python 2.5 or older.AlternativesTh only alternative library known at the time of writing waspython-gcm.  This library differs in the
following design decisions:Predictable execution time. Do not automatically retry request on failure.
According to Google’s recommendations, each retry has to wait exponential
back-off delay. We use Celery back-end, where the best way to retry after
some delay will be scheduling the task withcountdown=delay.  Sleeping
while in Celery worker hurts your concurrency.Do not forget results if you need to retry. This sounds obvious, butpython-gcmdrops important results, such as canonical ID mapping if
request needs to be (partially) retried.Clean pythonic API. No need to borrow all Java like exceptions etc.Do not hard-code validation, let GCM fail. This decision makes library
a little bit more future proof.SupportGCM client was created bySardar Yumatov,
contact me if you find any bugs or need help. ContactGetlogicif you need a full-featured push notification service
for all popular platforms. You can view outstanding issues on theGCM
Bitbucket page.
Package: gcm-filters
GCM FiltersGCM-Filters: Diffusion-based Spatial Filtering of Gridded DataDescriptionGCM-Filtersis a python package that performs spatial filtering analysis in a flexible and efficient way.
The GCM-Filters algorithm applies a discrete Laplacian to smooth a field through an iterative process that resembles diffusion (Grooms et al., 2021).
The package can be used for either gridded observational data or gridded data that is produced by General Circulation Models (GCMs) of ocean, weather, and climate.
Such GCM data come on complex curvilinear grids, whose geometry is respected by the GCM-Filters Laplacians.
Through integration withdask, GCM-Filters enables parallel, out-of-core filter analysis on both CPUs and GPUs.InstallationGCM-Filters can be installed using conda:condainstall-cconda-forgegcm_filtersGCM-Filters can also be installed with pip:pipinstallgcm_filtersGetting StartedTo learn how to use GCM-Filters for your data, visit theGCM-Filters documentation.Binder DemoClick the button below to run an interactive demo of GCM-Filters in Binder:Get in touchReport bugs, suggest features or view the source code onGitHub.License and copyrightGCM-Filters is licensed under version 3 of the Gnu Lesser General Public License.Development occurs on GitHub athttps://github.com/ocean-eddy-cpt/gcm-filters.How to cite GCM-FiltersIf you are using GCM-Filters and would like to cite it in academic publications, we
would certainly appreciate it. We recommend two citations.Loose et al., (2022). GCM-Filters: A Python Package for Diffusion-based Spatial Filtering of Gridded Data.
Journal of Open Source Software, 7(70), 3947,https://doi.org/10.21105/joss.03947Here’s an example of a BibTeX entry:@article{Loose2022,author={NoraLooseandRyanAbernatheyandIanGroomsandJuliusBuseckeandArthurGuillauminandElizabethYankovskyandGustavoMarquesandJacobSteinbergandAndrewSlavinRossandHemantKhatriandScottBachmanandLaureZannaandPaigeMartin},title={GCM-Filters:APythonPackageforDiffusion-basedSpatialFilteringofGriddedData},journal={JournalofOpenSourceSoftware},volume={7},number={70},pages={3947},doi={10.21105/joss.03947},url={https://doi.org/10.21105/joss.03947},year={2022},publisher={TheOpenJournal},}Grooms et al., (2021). Diffusion-Based Smoothers for Spatial Filtering of Gridded Geophysical Data.
Journal of Advances in Modeling Earth Systems, 13, e2021MS002552,https://doi.org/10.1029/2021MS002552Here’s an example of a BibTeX entry:@article{Grooms2021,author={Grooms,I.andLoose,N.andAbernathey,R.andSteinberg,J.M.andBachman,S.D.andMarques,G.andGuillaumin,A.P.andYankovsky,E.},title={Diffusion-BasedSmoothersforSpatialFilteringofGriddedGeophysicalData},journal={JournalofAdvancesinModelingEarthSystems},volume={13},number={9},pages={e2021MS002552},keywords={spatialfiltering,coarsegraining,dataanalysis},doi={https://doi.org/10.1029/2021MS002552},url={https://agupubs.onlinelibrary.wiley.com/doi/abs/10.1029/2021MS002552},year={2021}}
Package: gcmpy
gcmpy: Generalised Configuration Model random graphs in PythonOverviewgcmpyis a Python library that creates random graph models according
to the generalised configuration model (GCM). Random graph models provide
an excellent framework to integrate topology with dynamics. The topology
of a network is crucial to the outcome of a dynamical process, such as an
epidemic, occurring over a network.To create the networks,gcmpycreates a joint degree distribution object
through a variety of analytical or empirical methods. Once constructed, this
joint distribution is sampled to obtain a joint degree sequence. The joint
sequence is then used in the GCM algorithm to create a networkx graph. It can
also be used to create an edge list directly, which is significantly faster.There is also a tools library for obtaining useful quantities from the network
as well as converting a joint degree distribution into excess joint degree
distributions and vice versa, for example. We also provide an MCMC rewiring algorithm
to stochastically rewire a synthetic network’s correlations structure to a
target joint excess joint degree distributions.InstallationYou can installgcmpydirectly from PyPi usingpip:pipinstallgcmpyThe master distribution ofgcmpyis hosted on GitHub. To obtain a
copy, just clone the repo:gitclonegit@github.com:PeterStAndrews/gcmpy.gitcdgcmpypythonsetup.pyinstallThe unit tests can be discovered from the project root usingpython3-munittestdiscover-v-stest/-p'test_*.py'DocumentationAPI documentation forgcmpyis available onReadTheDocsAuthor and licenseCopyright (c) 2021, Peter Mann <pm78@st-andrews.ac.uk>Licensed under theGNU General Public License v2 or later (GPLv2+).
Package: gcmstools
This library serves two roles: 1) to provide a class to read standard GCMS
data files, and 2) to fit the data using various fitting routines.  The usage
and installation of this package is outlined in theonline user guide,
which is alsoavailable as a pdf.Currently, this package implements the following:File ImportsAIA (CDF) filesFitting RoutinesNon-negative least squares (nnls) fittingIsotopic AnalysisAnalyze the distribution of isotopes (for isotopic labeling experiments)