Saravanan666/pypi-org huggingface dataset:
Package: ec2-ssh
A pair of command line utilities for finding and SSH-ing into your Amazon EC2
instances by tag (such as ‘Name’).Forked from Instagram original code by YPlan.InstallationFrom pip:pipinstallec2-sshUsage# ec2-ssh%ec2-sshnginx2# equivalent to
# ssh ubuntu@ec2-123-45-67-89.compute-1.amazonaws.com%ec2-sshroot@appserver%ec2-sshdeploy@nginx2sudorestartnginx# Specifying the user with an environment variable%EC2_SSH_USER=deployec2-sshnginx2# ec2-host# w/o arg: prints all active instances%ec2-hostec2-123-45-67-89.compute-1.amazonaws.comec2-132-45-67-89.compute-1.amazonaws.comec2-231-45-67-89.compute-1.amazonaws.com# w/ arg%ec2-hostbackendec2-132-45-67-89.compute-1.amazonaws.comec2-132-45-67-90.compute-1.amazonaws.com# w/ tag arg too%ec2-host-tenvironmentproductionec2-132-45-67-90.compute-1.amazonaws.comec2-111-45-67-90.compute-1.amazonaws.comHistoryPendingNext version release notes here1.9.0 (2017-09-08)Bothec2-hostandec2-sshnow only show/use instances in therunningstate.Use the Public IP for an instance if EC2 no Public DNS for a public instance.
It turns out EC2 may not return the Public DNS even when a Public IP is
assigned.1.8.0 (2017-07-19)Use private IP addresses for instances that don’t have public ones. Such
instances are not guaranteed to be accessible from the current host,
depending on networking setup, but it’s better the tool let’s you try it.1.7.0 (2017-04-23)Rewrite to usesetup.py’sentry_pointsfeature, rather thanscripts. This makes everything importable from theec2_sshmodule and
makesec2-sshfaster as calling theec2-hostbehaviour no longer
requiressubprocess.1.6.0 (2017-04-13)ec2-sshsupports specifying the username with the-u/--userflag
or theEC2_SSH_USERenvironment variable.1.5.3 (2017-03-23)Acquired the PyPI nameec2-ssh, moved fork back there fromec2-ssh-yplan.1.5.2 (2016-08-17)Fix Python 3 bug with subprocess output type1.5.1 (2016-01-21)Pip failed to receive wheel in version 1.5.0, re-uploading1.5.0 (2016-01-21)Now usingboto31.4.0 (2016-01-07)ec2-sshrewritten in Python. As part of this, the automatic ‘pretty
prompt’ has been removed.1.3.0 (2016-01-06)Forked by YPlanOutput from ec2-host is now in random order, allowing ec2-ssh to spread
logins between similar instancesPython 3 compatibility1.2.1 (2011-11-27)Fix issue when ec2-host finds one offline instance with same name as an online instance1.2 (2011-11-27)Merged pull requests to add region and tag support1.1.1 (2011-11-17)Add line echoing host before establishing SSH connection1.1 (2011-11-15)override prompt (PS1) to show tag name1.0 (2011-09-05)initial release
Package: ec2-ssh-yplan
Moved back to justec2-ssh.HistoryPendingNext version release notes here1.5.2 (2016-08-17)Fix Python 3 bug with subprocess output type1.5.1 (2016-01-21)Pip failed to receive wheel in version 1.5.0, re-uploading1.5.0 (2016-01-21)Now usingboto31.4.0 (2016-01-07)ec2-sshrewritten in Python. As part of this, the automatic ‘pretty
prompt’ has been removed.1.3.0 (2016-01-06)Forked by YPlanOutput from ec2-host is now in random order, allowing ec2-ssh to spread
logins between similar instancesPython 3 compatibility1.2.1 (2011-11-27)Fix issue when ec2-host finds one offline instance with same name as an online instance1.2 (2011-11-27)Merged pull requests to add region and tag support1.1.1 (2011-11-17)Add line echoing host before establishing SSH connection1.1 (2011-11-15)override prompt (PS1) to show tag name1.0 (2011-09-05)initial release
Package: ec2-ssm-connect
ec2-ssm-connectAn interactive command-line tool to list Amazon EC2 instances and establish secure connections using AWS Systems Manager (SSM) Session Manager.🚀 InstallationBefore using this tool, ensure you have the AWS CLI installed. This tool depends on it.AWS CLIpipinstallec2-ssm-connect🛠 UsageThe application reads the AWS CLI credentials from the environment variables.
After installation, you can use the command:ec2-ssm-connectTo filter EC2 instances by name:ec2-ssm-connect--filter[INSTANCE_NAME]Example:$ec2-ssm-connect1.ID:i-0bb72e6f61ef2s612Name:acme-aws-int-keycloak-ec22.ID:i-0819d17cdf4ees213Name:acme-aws-int-auth-proxy-ec23.ID:i-082949bfd9b12s7cfName:acme-aws-int-auth-app-ec24.ID:i-0caaf2ffbb132se5bName:acme-aws-int-auth-web-ec25.ID:i-0dd580f86932as157Name:jenkins-int-instance6.ID:i-001bfa8b72680s6d9Name:vault-int-ecs-instance7.ID:i-0295e01f6bc12se68Name:server01-int-ecs-instance
EnterthenumberoftheEC2instanceyouwanttoconnectto:[HEREYOUENTERTHENUMBEROFTHEINSTANCEYOUWANTTOCONNECTTO,INTHISCASE1TO7]$ec2-ssm-connect-fjenkins1.ID:i-0dd580f86932as157Name:jenkins-int-instance
EnterthenumberoftheEC2instanceyouwanttoconnectto:[HEREYOUENTERTHENUMBEROFTHEINSTANCEYOUWANTTOCONNECTTO,INTHISCASEONLY1ISPOSSIBLE]📦 Dependenciesboto3: For AWS SDK functionalities.AWS CLI: Required for establishing connections with EC2 instances.✍️ AuthorIngo Marlos Batista de Sousa📜 LicenseThis project is licensed under the MIT License.
Package: ec2stack
An EC2 Compatibility Interface For Apache CloudStackDescriptionApacheCloudStackis an open source software designed to deploy and
manage large networks of virtual machines, as highly available, highly
scalable Infrastructure as a Service (IaaS) cloud computing platform.ec2stack takes Amazon EC2 API requests, maps these requests to the
appropriate CloudStack API calls and parses the responses as required.
This allows utilities created for the Amazon EC2 API to be used against
Apache CloudStack.Easy setup withDockerThe easiest way to run ec2stack is to use a docker container. Pull the
image from docker hub.$ docker pull runseb/ec2stackRun an interactive container and configure ec2stack for your CloudStack
endpoint. Be careful to use 0.0.0.0 as the address for ec2stack server.$ docker run -t -i ec2stack ec2stack-configureCommit the configured container into a new image specific to your cloud.$ docker commit <container id> ec2stack:yourcloudRun an container with the ec2stack command$ docker run -d -p 5000:5000 ec2stack:yourcloud ec2stackRegister a user$ curl -d AWSSecretKey=yoursecretkey -d AWSAccessKeyId=yourapikey -d Action=RegisterSecretKey http://localhost:5000You now just need to configure your aws cli and use the local ec2stack
point:$ aws ec2 describe-images --endpoint=http://localhost:5000UsageIMPORTANT: Please note that the current version of ec2stack only
supports AWS Signature Version 2 and therefore will NOT work with the
current AWS CLI unless you explicitly tell it to use Version 2. You can
set the signature version for your default AWS CLI profile with:$ aws configure set default.ec2.signature_version v2If you are using named profiles then you can set the version for the
specific profile with:$ aws configure set profile.<your profile name>.ec2.signature_version v2Both of the above commands will update your~/.aws/configfile.For usage information please see theUser Guide.
Package: ec2stash
Configthis script is designed to run across multiple accounts and across multiple regions you can switch between regions/accounts using some OS varsTo execute an assume role action:$ export AWS_SSM_ROLE=arn:aws:iam::111111111:role/adminCommand$ ec2stash -h
Usage: ec2stash [OPTIONS] COMMAND [ARGS]...

Options:
  --iam TEXT     IAM to assume
  --region TEXT  AWS region
  --kms TEXT     KMS Key
  --help         Show this message and exit.

Commands:
  backup
  blockerase
  delete
  erase
  get
  gettag
  list
  put
  render
  restore
  setup
  tagLicenseec2stash is licensed under theMIT.
Package: ec2_tag_conditional
EC2 Tag conditionalsThis is a python library and shell command that answers the question:"Is this instance tagged with the given tag and have a given value"It is designed to be run on AWS's EC2 instances.It will always fail if it's not on AWS, so tags should only be tested for
truthiness, not falseness.As a Libraryfromec2_tag_conditionalimportInstanceTagstags=InstanceTags()iftags['Env']=='prod':do_prod_thing()else:do_other_thing()As a command line script>instance-tags"Env=prod">echo$?0>instance-tags"Madeup=NotThere">echo$?1>instance-tags"Env=prod"&&do_prod_thingExample use casesThis code was written with the following use case in mind:You havenservers in a auto scaling group, launched from a custom
AMI (golden image). The nature of the application running on the
servers is that, for some functions to work (backup, reporting),
a given set of tasks should only be run by one server.This server is called a 'controller'. The script that created the ASG
also tags (in the AWS metadata) one (and only one) of the servers
withcontroller=True.When the AMI is baked, the images don't need to know if they are a
controller or not, as cron tasks can be written like:instance-tags "controller=True" && do_controller_onlyOr for controllers in production (rather than dev or staging
environments):instance-tags "controller=True" && instance-tags "Env=prod" && do_controller_onlyBecause the exit code of theinstance-tagsscript is 1 if the tag
with the given value isn't found on the instance, the script wont
run on any server that isn't an EC2 instance with the given values.
Package: ec2-task
Copyright (c) 2018 Dr. Shubham DiptPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 THESOFTWARE.Description: ec2_task=================Enabling easy start, running of tasks and stopping of EC2 instances in AWS.Requirements------------* Python3 (>=3.4)### Usage$ pip install ec2-taskAdd your AWS credentials and details of your EC2 instance in config file e.g. aws_config.ini.The aws_config file should have the following:[aws]AWS_ACCESS_KEY_ID=AWS_SECRET_ACCESS_KEYINSTANCE_ID=REGION=KEY_PATH=<path to aws key file for ssh>USER=<user e.g. ubuntu>List of tasks should be added as a separate file (containing mainly shell commands) e.g. task.sh.>>> from ec2_task import connect_ec2>>> ec2_instance = connect_ec2.Ec2Instance(config_file="aws_config.ini") # include the path of your aws config file>>> ec2_instance.start_instance()>>> ec2_instance.run_task(task_file="task.sh") # include the path of your task file>>> ec2_instance.stop_instance()Check example in the Github repository.Platform: anyClassifier: Programming Language :: Python :: 3Classifier: License :: OSI Approved :: MIT LicenseClassifier: Operating System :: OS Independent
Package: ec2u
EC2 Utils CLIInstall:Before you can begin usingec2u, you must set up authentication credentials.
If you have the AWS CLI installed, then you can use it to configure your credentials file:aws configureAlternatively, you can create the credential file yourself. By default, its location is at~/.aws/credentials:[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEYYou may also want to set a default region. This can be done in the configuration file. By default, its location is at ~/.aws/config:[default]
region=us-east-1This sets up credentials for the default profile as well as a default region to use when creating connections.
SeeCredentialsfor in-depth configuration sources and options.Install:pip install ec2uFeature:Usage:ec2u[OPTIONS]COMMAND[ARGS]...

Options:--verbose--versionShowtheversionandexit.--helpShowthismessageandexit.

Commands:gen-configGenerateAWSconfigurationfilehas-tagCheckwhetherornotinstancehasgiventagprivate-ipv4GetprivateIPv4oftheinstanceChangelog0.1.7 - 2020-05-27AddedFix issue commandhas-tagdoes not work as expected0.1.6 - 2020-05-21AddedAdd subcommandprivate-ipv4
Package: ec2yaml
ec2yaml========Take a yaml file like this ::app:name: fooowner: adam venturellalocation: us-west-2key: <optional>secret: <optional>instances:app_server:key_name: aventurellaimage: ami-6ac2a85asize: m3.mediumzone: us-west-2ctags:- key1: value1- key2: value2ip_address: foosecurity_groups:- ssh- http- https- foo-salt- foo-sshvolumes:- foo-volume: /dev/sdhelastic_ips:- foovolumes:foo-volume:size: 1zone: us-west-2ctags:- key1: value1- key2: value2security_groups:foo-ssh:ip_protocol: tcpfrom_port: 1022to_port: 1022cidr_ip: '0.0.0.0/0'foo-salt:ip_protocol: tcpfrom_port: 2000to_port: 65535cidr_ip: '0.0.0.0/0'And materialize it into AWS EC2 accordingly.Command line tool ::Usage:ec2yaml <conf> [(--key=<key> --secret=<secret>)\| --boto-profile=<boto-profile>]\[--loglevel=<level>]Options:-h --help                           Show this screen.-v --version                        Show version.-k --key=<key>                      AWS access key ID-s --secret=<secret>                AWS secret access key-bp --boto-profile=<boto-profile>   Boto Profile Name-l --loglevel=<level>               Log level to display [default: info]Release History---------------0.0.1 (2014-05-07)++++++++++++++++++**API Changes****Bugfixes**0.0.6 (2014-05-07)++++++++++++++++++**API Changes**- Instances can now be arbitrarily tagged ::instances:app_server:key_name: aventurellaimage: ami-6ac2a85asize: m3.mediumzone: us-west-2ctags:- key1: value1- key2: value2ip_address: foosecurity_groups:- ssh- http- https- foo-salt- foo-sshvolumes:- foo-volume: /dev/sdh- Volumes can now be arbitrarily tagged ::volumes:foo-volume:size: 1zone: us-west-2ctags:- key1: value1- key2: value20.0.8 (2014-05-08)++++++++++++++++++**API Changes**- A boto profile can now be specified in the command line arguments**Bugfixes**- Fixes an issue with a key and secret from the command line notbeing properly assigned.
Package: ec3-cli
Elastic Cloud Computing Cluster (EC3) is a tool to create elastic virtual clusters on topof Infrastructure as a Service (IaaS) providers, either public (such as Amazon Web Services,Google Cloud or Microsoft Azure)or on-premises (such as OpenNebula and OpenStack). We offer recipes to deploy TORQUE(optionally with MAUI), SLURM, SGE, HTCondor, Mesos, Nomad and Kubernetes clusters that can be self-managed with CLUES:it starts with a single-node cluster and working nodes will be dynamically deployed and provisionedto fit increasing load (number of jobs at the LRMS). Working nodes will be undeployed when they are idle.This introduces a cost-efficient approach for Cluster-based computing.
Package: ec3-python-wrapper
EC3 Python WrapperUNDER ACTIVE DEVELOPMENT. MORE DOCUMENTATION AND FUNCTIONALITY COMING SOON.This is a Python wrapper for working with the Building Transparency EC3 API.
Documentation for the EC3 API can be found athttps://buildingtransparency.org/ec3/manage-apps/api-doc/apiInstallingpip install ec3-python-wrapperDocumentationFor documentation on how to use the EC3 Python Wrapper visit:https://ec3-python-wrapper.readthedocs.io/Usage ExampleSome Jupyter Notebook examples are provided here:Overview of some available functions:ec3_overview.ipynbQuerying and plotting materials:ec3_materials_plot.ipynbCreditsObviously none of this would exist without the great efforts of theBuilding Transparencyteam and the EC3 database.Much of how this library has been structured was modeled off of the amazing work done on thepyAirtable module.LicenseMIT
Package: ec4sap-client
EC4SAP Python ClientSummaryThis Python client provides an API to access the Swisscom EC4SAP environment in an easy way. It is written in Python 2.7 (a port to Python 3 will follow later). The API is based on the Python client provided by Abiquo.GIT Repositories:https://gitlab.swisscloud.io/itclouds/ec4sap-python-clienthttps://github.com/abiquo/api-python-clientGet startedInstall EC4SAP client with 'pip install ec4sap-client' - for the cli you will need to install globally (sudo)Adapt the config (see below)Write some code, have funExample 1: get all VMs accessable by the current user and export it as a .csv (no admin rights needed)fromec4sapimportconfigfromec4sap.abiquo_apiimport*fromec4sap.abiquo_envimport*env=ABIQUO_ENV("int")vm=ABQ_VM(env).scanAllTenant(keys=config.CSV_FORMAT_VM)printvm.csvHeader()foriinrange(vm.count()):printvm.csvRow(i)Setup an environmentThe
EC4SAP Python Client uses OAuth1 to authenticate your client in Abiquo. Compared to Oauth2, which is used by the portal to authenticate an user, these credentials are stored fix in the user context of of Abiquo and do not expire. To use the client it is neccessary to register the Application in your EC4SAP user context. This will be made via console (see below).First you need an active OAuth2 Token (Authentication Bearer) - this is the hardest part of the job:Login to your desired EC4SAP Environment (DEV/INT/PRD)Open the Developer Console of your browser (F12 on Chrome)Search for a MOS enabled VMSelect the "Virtual Machine Services" in the context menu of the VMSearch for the Parameter "Authorization: Bearer ..." in the Request Header of the CMS-Orch API Request (e.q. ".../Folders?...")With this token you are now able to Register your application in Abiquo and generate a set of OAuth1 tokens:Start the EC4SAP Console (console.py)Set the desired Environment (most probably prd and/or int)>>>setenvintRegister your application (name e.q. MyApp is free choosable)>>>regMyApp43ee89a5-049d-4f39-b66a-6b72df75a89d
OK:RegistrationofapplicationMyAppsuccessful

ApplicationName:MyApp
ApplicationKey:123-456-789
ApplicationSecret:xxxxxxxxxxxxxxxxx
AcessToken:abc-def-ghi
AccessSecret:xxxxxxxxxxxxxxxxxThe tokens are now stored locally and your EC4SAP Client is ready. If you need more than one environmemnt you can start over at Nr.1
Package: ecache
Run testmakeunittestInstallation / Rquirementspip intall ecacheUsageWith Flask IntegratefromflaskimportFlask,jsonifyfromflask_sqlalchemyimportSQLAlchemyfromecache.ext.flask_cacheimportCacheableMixin,query_callable,regionsapp=Flask(__name__)app.config['SQLALCHEMY_DATABASE_URI']='sqlite:////tmp/test.db'app.debug=Truedb=SQLAlchemy(app)classUser(db.Model,CacheableMixin):"""Default backend is redis and expiration time is 1 hour, default
    region name is `default`, you can override this:

        cache_regions = your_regions
        cache_label = your_label
    """id=db.Column(db.Integer,primary_key=True)name=db.Column(db.String)@app.route('/users')defall_users():"""Result will try to get from cache first. load from db if cache miss.
    """users=[user.to_dict()foruserinUser.cache.filter()]returnjsonify(users=users)@app.route('/users/<int:user_id')defview_user(user_id):"""Result will try to get from cache first. load from db if cache miss.
    """user=User.cache.get(user_id)returnjsonify(user.to_dict())More detail seeexampleWith Pure SQLAlchemy model Integrate# -*- coding: utf-8 -*-importredisfromsqlalchemyimport(Column,Integer,String,SmallInteger)fromecache.coreimportcache_mixinfromecache.dbimportdb_manager,model_base# alsosee :class:`ecache.db.DBManager`DBSession=db_manager.get_session('test')cache_client=redis.StrictRedis()CacheMixin=cache_mixin()DeclarativeBase=model_base()classTodoListModel(DeclarativeBase,CacheMixin):__tablename__=='todo_list'TABLE_CACHE_EXPIRATION_TIME=3600id=Column(Integer,primary_key=True)title=Column(String,default='')is_done=Column(SmallInteger,default=0)@classmethoddefget_todo(cls,todo_id):todo=cls.get(todo_id)# `cls.get` inherited from `CacheMixin`returntodo@classmethoddefadd(cls,title):todo=cls(title=title)s=DBSession()s.add(todo)s.commit()
Package: ecadataset
Endoscopic Content Area (ECA) datasetA simple python loader for theEndoscopic Content Area (ECA) dataset. An implementation of thehausdorff distance, optimised for content areas, is also included in the package.InstallationTo use this dataset, first ensure you have a synapse account, then simply install from pip...pipinstallecadatasetand run the download command...ecadatasetdownload-dpath/to/datasetYou'll be prompted for your synapse credentials and the data will be downloaded.
You may also check an existing copy of the dataset with the check command...ecadatasetcheck-dpath/to/datasetUsageimportmatplotlib.pyplotaspltfromecadatasetimportECADataset,DataSource,AnnotationType,content_area_hausdorff# Create dataset object...dataset=ECADataset(# Path to the directory containing the dataset.data_directory="path/to/dataset",# Options are: DataSource.CHOLEC, DataSource.ROBUST, and DataSource.BOTH.data_source=DataSource.BOTH,# Options are: AnnotationType.AREA, AnnotationType.MASK, and AnnotationType.BOTH.annotation_type=AnnotationType.BOTH,# Whether to use cropping to provide additonal samples without a content area.include_cropped=True,# Whether to include information about where the frame was taken from.include_source_info=True)# Iterate through the first 10 samples, slicing is supported...forimage,area,mask,infoindataset[:10]:# Circular content area represented as (x, y, r) or None if no area present...print("Content area: ",area)# Origin information in the form (dataset, video, frame)...print("Sample source: ",info)# Image and mask are returned as PIL images...plt.subplot(121)plt.imshow(image)plt.subplot(122)plt.imshow(mask)plt.show()# Guessing the content area circle and scoring it against the ground truth...width,height=image.sizearea_guess=(width//2,height//2,width//2)score,_=content_area_hausdorff(area_guess,area,(height,width))print(score)