o
    ȷe                     @   s  d dl mZmZ d dlmZmZ d dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlmZ d dlmZ dZeZejdd dee
 e
 e
 f Ze Zed	Zed
ZedZedZe	j !e	j "e#dZ$dd Z%G dd dej&Z'e(da)e(dZ*t)+e'  e*+e'  e%  ej,dfddZ-ej.dfddZ/dddZ0dddZ1dddZ2dddZ3dd d!Z4dd"d#Z5dd$d%Z6dd&d'Z7dd(d)Z8dd*d+Z9dd,d-Z:dd.d/Z;dd0d1Z<dd2d3Z=dd4d5Z>dd6d7Z?dd8d9Z@dd:d;ZAdd<d=ZB		@ddAdBZCddCdDZD		ddEdFZE			@ddHdIZFddJdKZGddLdMZH		@ddNdOZI		ddPdQZJ		ddRdSZK		ddTdUZL			@ddVdWZM		ddXdYZN		ddZd[ZO		dd\d]ZP		dd^d_ZQ		dd`daZR		ddbdcZS		ddddeZT		ddfdgZU		ddhdiZV		ddjdkZW		ddldmZX		ddndoZY		ddpdqZZ		ddrdsZ[		ddtduZ\		ddvdwZ]		ddxdyZ^		ddzd{Z_		dd|d}Z`		dd~dZadd dedd@fddZbdd Zcejdee dS )    )ConfigBotoConfigLocations)BucketStorageUriFileStorageUriN)urlparse)InvalidUriErrorz2.49.0 zBoto/%s Python/%s %s/%sz.^[a-zA-Z0-9][a-zA-Z0-9\._-]{1,253}[a-zA-Z0-9]$z[-_a-z0-9]{64}z3(?P<versionless_uri_str>.+)#(?P<generation>[0-9]+)$z/(?P<versionless_uri_str>.+)#(?P<version_id>.+)$zendpoints.jsonc                  C   s0   t D ]} ztjtj|  W q   Y qd S N)r   loggingconfig
fileConfigospath
expanduser)file r   D/var/www/ideatree/venv/lib/python3.10/site-packages/boto/__init__.pyinit_loggingA   s   r   c                   @   s   e Zd Zdd ZdS )NullHandlerc                 C   s   d S r	   r   )selfrecordr   r   r   emitJ   s   zNullHandler.emitN)__name__
__module____qualname__r   r   r   r   r   r   I   s    r   botoz	boto.perfc                 C   sV   |sd}t | }|| t |}|| t |}|| || |ad S Nz0%(asctime)s %(name)s [%(levelname)s]:%(message)s)r
   	getLoggersetLevelFileHandler	FormattersetFormatter
addHandlerlog)namefilepathlevelformat_stringloggerfh	formatterr   r   r   set_file_loggerV   s   






r+   c                 C   sT   |sd}t | }|| t  }|| t |}|| || |ad S r   )r
   r   r   StreamHandlerr    r!   r"   r#   )r$   r&   r'   r(   r)   r*   r   r   r   set_stream_loggerd   s   





r-   c                 K      ddl m} || |fi |S )a&  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.sqs.connection.SQSConnection`
    :return: A connection to Amazon's SQS
    r   )SQSConnection)boto.sqs.connectionr/   )aws_access_key_idaws_secret_access_keykwargsr/   r   r   r   connect_sqsr      r4   c                 K   r.   )a#  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.s3.connection.S3Connection`
    :return: A connection to Amazon's S3
    r   S3Connection)boto.s3.connectionr7   )r1   r2   r3   r7   r   r   r   
connect_s3   r5   r9   c                 K   r.   )aV  
    @type gs_access_key_id: string
    @param gs_access_key_id: Your Google Cloud Storage Access Key ID

    @type gs_secret_access_key: string
    @param gs_secret_access_key: Your Google Cloud Storage Secret Access Key

    @rtype: L{GSConnection<boto.gs.connection.GSConnection>}
    @return: A connection to Google's Storage service
    r   )GSConnection)boto.gs.connectionr:   )gs_access_key_idgs_secret_access_keyr3   r:   r   r   r   
connect_gs   r5   r>   c                 K   r.   )a&  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.ec2.connection.EC2Connection`
    :return: A connection to Amazon's EC2
    r   EC2Connection)boto.ec2.connectionr@   )r1   r2   r3   r@   r   r   r   connect_ec2   r5   rB   c                 K   r.   )a2  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.ec2.elb.ELBConnection`
    :return: A connection to Amazon's Load Balancing Service
    r   )ELBConnection)boto.ec2.elbrC   )r1   r2   r3   rC   r   r   r   connect_elb   r5   rE   c                 K   r.   )a  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.ec2.autoscale.AutoScaleConnection`
    :return: A connection to Amazon's Auto Scaling Service

    :type use_block_device_types bool
    :param use_block_device_types: Specifies whether to return described Launch Configs with block device mappings containing
        block device types, or a list of old style block device mappings (deprecated).  This defaults to false for compatability
        with the old incorrect style.
    r   )AutoScaleConnection)boto.ec2.autoscalerF   )r1   r2   r3   rF   r   r   r   connect_autoscale   s   
rH   c                 K   r.   )a@  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.ec2.cloudwatch.CloudWatchConnection`
    :return: A connection to Amazon's EC2 Monitoring service
    r   )CloudWatchConnection)boto.ec2.cloudwatchrI   )r1   r2   r3   rI   r   r   r   connect_cloudwatch      
rK   c                 K   r.   )a&  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.sdb.connection.SDBConnection`
    :return: A connection to Amazon's SDB
    r   )SDBConnection)boto.sdb.connectionrM   )r1   r2   r3   rM   r   r   r   connect_sdb   r5   rO   c                 K   r.   )  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.fps.connection.FPSConnection`
    :return: A connection to FPS
    r   )FPSConnection)boto.fps.connectionrQ   )r1   r2   r3   rQ   r   r   r   connect_fps   r5   rS   c                 K   r.   )a#  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.mturk.connection.MTurkConnection`
    :return: A connection to MTurk
    r   )MTurkConnection)boto.mturk.connectionrT   )r1   r2   r3   rT   r   r   r   connect_mturk  s   rV   c                 K   r.   )rP   r   )CloudFrontConnection)boto.cloudfrontrW   )r1   r2   r3   rW   r   r   r   connect_cloudfront  rL   rY   c                 K   r.   )a  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.vpc.VPCConnection`
    :return: A connection to VPC
    r   )VPCConnection)boto.vpcrZ   )r1   r2   r3   rZ   r   r   r   connect_vpc#  r5   r\   c                 K   r.   )a  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.rds.RDSConnection`
    :return: A connection to RDS
    r   RDSConnection)boto.rdsr^   r1   r2   r3   r^   r   r   r   connect_rds2  r5   ra   c                 K       ddl m} |d| |d|S )a  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.rds2.layer1.RDSConnection`
    :return: A connection to RDS
    r   r]   r1   r2   Nr   )boto.rds2.layer1r^   r`   r   r   r   connect_rds2A  s   re   c                 K   r.   )a   
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.emr.EmrConnection`
    :return: A connection to Elastic mapreduce
    r   )EmrConnection)boto.emrrf   )r1   r2   r3   rf   r   r   r   connect_emrT  r5   rh   c                 K   r.   )a  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.sns.SNSConnection`
    :return: A connection to Amazon's SNS
    r   )SNSConnection)boto.snsri   )r1   r2   r3   ri   r   r   r   connect_snsc  r5   rk   c                 K   r.   )a  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.iam.IAMConnection`
    :return: A connection to Amazon's IAM
    r   )IAMConnection)boto.iamrl   )r1   r2   r3   rl   r   r   r   connect_iamr  r5   rn   c                 K   r.   )a/  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.dns.Route53Connection`
    :return: A connection to Amazon's Route53 DNS Service
    r   )Route53Connection)boto.route53ro   )r1   r2   r3   ro   r   r   r   connect_route53  rL   rq   c                 K   r.   )aD  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.cloudformation.CloudFormationConnection`
    :return: A connection to Amazon's CloudFormation Service
    r   )CloudFormationConnection)boto.cloudformationrr   )r1   r2   r3   rr   r   r   r   connect_cloudformation  rL   rt   E"  /services/EucalyptusFc           
      K   sv   ddl m} ddlm} |stddd}|stddd}| s'tdd	d} |d
| d}	|||f|	|||d|S )a  
    Connect to a Eucalyptus service.

    :type host: string
    :param host: the host name or ip address of the Eucalyptus server

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.ec2.connection.EC2Connection`
    :return: A connection to Eucalyptus server
    r   r?   
RegionInfoCredentialseuca_access_key_idNeuca_secret_access_keyBotoeucalyptus_host
eucalyptusr$   endpoint)regionportr   	is_secure)boto.ec2r@   boto.ec2.regioninforx   r   get)
hostr1   r2   r   r   r   r3   r@   rx   regr   r   r   connect_euca  s*   r   c                 K   r.   )a+  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.glacier.layer2.Layer2`
    :return: A connection to Amazon's Glacier Service
    r   Layer2)boto.glacier.layer2r   r1   r2   r3   r   r   r   r   connect_glacier  rL   r   c                 K   sz   ddl m} t| }|j|d< |j|d< |j|d< d|vr$|jdk|d< ||j|jd|d	< ||d
< ||d< tdi |S )a  
    Connect to an EC2 Api endpoint.  Additional arguments are passed
    through to connect_ec2.

    :type url: string
    :param url: A url for the ec2 api endpoint to connect to

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.ec2.connection.EC2Connection`
    :return: A connection to Eucalyptus server
    r   rw   r   r   r   r   httpsr   r   r1   r2   Nr   )r   rx   r   r   hostnamer   schemerB   )urlr1   r2   r3   rx   purlr   r   r   connect_ec2_endpoint  s   



r   /services/Walrusc           	      K   sn   ddl m} ddl m} |stddd}|stddd}| s'tdd	d} |||f| ||| |d
|S )a  
    Connect to a Walrus service.

    :type host: string
    :param host: the host name or ip address of the Walrus server

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.s3.connection.S3Connection`
    :return: A connection to Walrus
    r   r6   OrdinaryCallingFormatry   rz   Nr{   r|   walrus_host)r   r   r   calling_formatr   r8   r7   r   r   r   )	r   r1   r2   r   r   r   r3   r7   r   r   r   r   connect_walrus  s*   r   c                 K   r.   )a  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.ses.SESConnection`
    :return: A connection to Amazon's SES
    r   )SESConnection)boto.sesr   )r1   r2   r3   r   r   r   r   connect_ses'  r5   r   c                 K   r.   )a  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.sts.STSConnection`
    :return: A connection to Amazon's STS
    r   )STSConnection)boto.stsr   )r1   r2   r3   r   r   r   r   connect_sts6  r5   r   c                 K   sP   ddl m} ddl m} tdd| }tdd|}|||fd| |d|S )	ah  
    Connect to the Internet Archive via their S3-like API.

    :type ia_access_key_id: string
    :param ia_access_key_id: Your IA Access Key ID.  This will also look
        in your boto config file for an entry in the Credentials
        section called "ia_access_key_id"

    :type ia_secret_access_key: string
    :param ia_secret_access_key: Your IA Secret Access Key.  This will also
        look in your boto config file for an entry in the Credentials
        section called "ia_secret_access_key"

    :rtype: :class:`boto.s3.connection.S3Connection`
    :return: A connection to the Internet Archive
    r   r6   r   ry   ia_access_key_idia_secret_access_keyzs3.us.archive.org)r   r   r   r   )r   r   r   r3   r7   r   
access_key
secret_keyr   r   r   
connect_iaE  s   r   c                 K   r.   )a6  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.dynamodb.layer2.Layer2`
    :return: A connection to the Layer2 interface for DynamoDB.
    r   r   )boto.dynamodb.layer2r   r   r   r   r   connect_dynamodbe     r   c                 K   r.   )a,  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.swf.layer1.Layer1`
    :return: A connection to the Layer1 interface for SWF.
    r   Layer1)boto.swf.layer1r   r1   r2   r3   r   r   r   r   connect_swfv  r   r   c                 K   r.   )a3  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.cloudsearch.layer2.Layer2`
    :return: A connection to Amazon's CloudSearch service
    r   r   )boto.cloudsearch.layer2r   r   r   r   r   connect_cloudsearch  s   
r   c                 K   s"   ddl m} || |fd|i|S )a  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :type sign_request: bool
    :param sign_request: whether or not to sign search and
        upload requests

    :rtype: :class:`boto.cloudsearch2.layer2.Layer2`
    :return: A connection to Amazon's CloudSearch2 service
    r   r   sign_request)boto.cloudsearch2.layer2r   )r1   r2   r   r3   r   r   r   r   connect_cloudsearch2  s   
r   c                 K   r.   )aU  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.cloudsearchdomain.layer1.CloudSearchDomainConnection`
    :return: A connection to Amazon's CloudSearch Domain service
    r   )CloudSearchDomainConnection)boto.cloudsearchdomain.layer1r   )r1   r2   r3   r   r   r   r   connect_cloudsearchdomain  s   r   c                 K   r.   )a7  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.beanstalk.layer1.Layer1`
    :return: A connection to Amazon's Elastic Beanstalk service
    r   r   )boto.beanstalk.layer1r   r   r   r   r   connect_beanstalk  r   r   c                 K   rb   )aG  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.ets.layer1.ElasticTranscoderConnection`
    :return: A connection to Amazon's Elastic Transcoder service
    r   )ElasticTranscoderConnectionrc   Nr   )boto.elastictranscoder.layer1r   )r1   r2   r3   r   r   r   r   connect_elastictranscoder     r   c                 K   s    ddl m} |d| |d|S )Nr   )OpsWorksConnectionrc   r   )boto.opsworks.layer1r   )r1   r2   r3   r   r   r   r   connect_opsworks  s   r   c                 K   rb   )a9  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.redshift.layer1.RedshiftConnection`
    :return: A connection to Amazon's Redshift service
    r   )RedshiftConnectionrc   Nr   )boto.redshift.layer1r   )r1   r2   r3   r   r   r   r   connect_redshift  r   r   c                 K   rb   )a6  
    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.support.layer1.SupportConnection`
    :return: A connection to Amazon's Support service
    r   )SupportConnectionrc   Nr   )boto.support.layer1r   )r1   r2   r3   r   r   r   r   connect_support  r   r   c                 K   rb   )a]  
    Connect to AWS CloudTrail

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.cloudtrail.layer1.CloudtrailConnection`
    :return: A connection to the AWS Cloudtrail service
    r   )CloudTrailConnectionrc   Nr   )boto.cloudtrail.layer1r   )r1   r2   r3   r   r   r   r   connect_cloudtrail     r   c                 K   rb   )ai  
    Connect to AWS DirectConnect

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    :rtype: :class:`boto.directconnect.layer1.DirectConnectConnection`
    :return: A connection to the AWS DirectConnect service
    r   )DirectConnectConnectionrc   Nr   )boto.directconnect.layer1r   )r1   r2   r3   r   r   r   r   connect_directconnect3  r   r   c                 K   rb   )aV  
    Connect to Amazon Kinesis

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    rtype: :class:`boto.kinesis.layer1.KinesisConnection`
    :return: A connection to the Amazon Kinesis service
    r   )KinesisConnectionrc   Nr   )boto.kinesis.layer1r   )r1   r2   r3   r   r   r   r   connect_kinesisI  r   r   c                 K   rb   )am  
    Connect to Amazon CloudWatch Logs

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    rtype: :class:`boto.kinesis.layer1.CloudWatchLogsConnection`
    :return: A connection to the Amazon CloudWatch Logs service
    r   )CloudWatchLogsConnectionrc   Nr   )boto.logs.layer1r   )r1   r2   r3   r   r   r   r   connect_logs_  r   r   c                 K   rb   )aw  
    Connect to Amazon Route 53 Domains

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    rtype: :class:`boto.route53.domains.layer1.Route53DomainsConnection`
    :return: A connection to the Amazon Route 53 Domains service
    r   )Route53DomainsConnectionrc   Nr   )boto.route53.domains.layer1r   )r1   r2   r3   r   r   r   r   connect_route53domainsv  r   r   c                 K   rb   )ay  
    Connect to Amazon Cognito Identity

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    rtype: :class:`boto.cognito.identity.layer1.CognitoIdentityConnection`
    :return: A connection to the Amazon Cognito Identity service
    r   )CognitoIdentityConnectionrc   Nr   )boto.cognito.identity.layer1r   )r1   r2   r3   r   r   r   r   connect_cognito_identity  r   r   c                 K   rb   )ai  
    Connect to Amazon Cognito Sync

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    rtype: :class:`boto.cognito.sync.layer1.CognitoSyncConnection`
    :return: A connection to the Amazon Cognito Sync service
    r   )CognitoSyncConnectionrc   Nr   )boto.cognito.sync.layer1r   )r1   r2   r3   r   r   r   r   connect_cognito_sync  r   r   c                 K   rb   )a^  
    Connect to AWS Key Management Service

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    rtype: :class:`boto.kms.layer1.KMSConnection`
    :return: A connection to the AWS Key Management Service
    r   )KMSConnectionrc   Nr   )boto.kms.layer1r   )r1   r2   r3   r   r   r   r   connect_kms  r   r   c                 K   rb   )aR  
    Connect to AWS Lambda

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    rtype: :class:`boto.awslambda.layer1.AWSLambdaConnection`
    :return: A connection to the AWS Lambda service
    r   )AWSLambdaConnectionrc   Nr   )boto.awslambda.layer1r   )r1   r2   r3   r   r   r   r   connect_awslambda  r   r   c                 K   rb   )a^  
    Connect to AWS CodeDeploy

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    rtype: :class:`boto.cognito.sync.layer1.CodeDeployConnection`
    :return: A connection to the AWS CodeDeploy service
    r   )CodeDeployConnectionrc   Nr   )boto.codedeploy.layer1r   )r1   r2   r3   r   r   r   r   connect_codedeploy  r   r   c                 K   rb   )aP  
    Connect to AWS Config

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    rtype: :class:`boto.kms.layer1.ConfigServiceConnection`
    :return: A connection to the AWS Config service
    r   )ConfigServiceConnectionrc   Nr   )boto.configservice.layer1r   )r1   r2   r3   r   r   r   r   connect_configservice   r   r   c                 K   rb   )aT  
    Connect to AWS CloudHSM

    :type aws_access_key_id: string
    :param aws_access_key_id: Your AWS Access Key ID

    :type aws_secret_access_key: string
    :param aws_secret_access_key: Your AWS Secret Access Key

    rtype: :class:`boto.cloudhsm.layer1.CloudHSMConnection`
    :return: A connection to the AWS CloudHSM service
    r   )CloudHSMConnectionrc   Nr   )boto.cloudhsm.layer1r   )r1   r2   r3   r   r   r   r   connect_cloudhsm  r   r   c                 K   rb   )z
    Connect to Amazon EC2 Container Service
    rtype: :class:`boto.ec2containerservice.layer1.EC2ContainerServiceConnection`
    :return: A connection to the Amazon EC2 Container Service
    r   )EC2ContainerServiceConnectionrc   Nr   )boto.ec2containerservice.layer1r   )r1   r2   r3   r   r   r   r   connect_ec2containerservice.     r   c                 K   rb   )z
    Connect to Amazon Machine Learning service
    rtype: :class:`boto.machinelearning.layer1.MachineLearningConnection`
    :return: A connection to the Amazon Machine Learning service
    r   )MachineLearningConnectionrc   Nr   )boto.machinelearning.layer1r   )r1   r2   r3   r   r   r   r   connect_machinelearning>  r   r   r   Tc              
   C   st  d}d}|  d}	|	dkr| }
| }n| d|	  }
| |	d d }|
dvr.td|
 |
dkr@d	}|d
kr:d}t|||S |dd}|d }d}|r`|r`t|rZt|r`td|  |
dkrt	|}|r|
 }|d }|dd}t|d }n$|
dkrt|}|r|
 }|d }|dd}|d }ntd|
 t|dkr|d }||
|||||||dS )aR  
    Instantiate a StorageUri from a URI string.

    :type uri_str: string
    :param uri_str: URI naming bucket + optional object.
    :type default_scheme: string
    :param default_scheme: default scheme for scheme-less URIs.
    :type debug: int
    :param debug: debug level to pass in to boto connection (range 0..2).
    :type validate: bool
    :param validate: whether to check for bucket name validity.
    :type bucket_storage_uri_class: BucketStorageUri interface.
    :param bucket_storage_uri_class: Allows mocking for unit tests.
    :param suppress_consec_slashes: If provided, controls whether
        consecutive slashes will be suppressed in key paths.
    :type is_latest: bool
    :param is_latest: whether this versioned object represents the
        current version.

    We allow validate to be disabled to allow caller
    to implement bucket-level wildcarding (outside the boto library;
    see gsutil).

    :rtype: :class:`boto.StorageUri` subclass
    :return: StorageUri subclass for given URI.

    ``uri_str`` must be one of the following formats:

    * gs://bucket/name
    * gs://bucket/name#ver
    * s3://bucket/name
    * gs://bucket
    * s3://bucket
    * filename (which could be a Unix path like /a/b/c or a Windows path like
      C:\c)

    The last example uses the default scheme ('file', unless overridden).
    Nz://r      )r   s3gszUnrecognized scheme "%s"r   F-T/   r   zInvalid bucket name in URI "%s"r   versionless_uri_str
generationr   
version_id)suppress_consec_slashesr   r   	is_latest)findlowerr   r   splitBUCKET_NAME_REmatchTOO_LONG_DNS_NAME_COMPsearchGENERATION_RE	groupdictint
VERSION_RElen)uri_strdefault_schemedebugvalidatebucket_storage_uri_classr   r   r   r   end_scheme_idxr   r   	is_stream
path_partsbucket_nameobject_namer  mdr   r   r   r   storage_uriN  s`   )


r  c                 C   sN   t | tjjjstdtt|  | jj	j
 }d|| jj| jf }t|S )zReturns a StorageUri for the given key.

    :type key: :class:`boto.s3.key.Key` or subclass
    :param key: URI naming bucket + optional object.
    z7Requested key (%s) is not a subclass of boto.s3.key.Keyz
%s://%s/%s)
isinstancer   r   keyKeyr   strtypebucket
connectionproviderget_provider_namer$   r  )r  	prov_namer
  r   r   r   storage_uri_for_key  s   
r   )NN)NNNru   rv   F)NNNru   r   F)NNF)fboto.pyami.configr   r   boto.storage_urir   r   boto.pluginr   datetimer   platformresysr
   logging.configboto.compatr   boto.exceptionr   __version__Versionstrptimepython_versionsystemrelease	UserAgentr   compiler  r  r  r  r   joindirname__file__ENDPOINTS_PATHr   Handlerr   r   r#   perflogr"   INFOr+   DEBUGr-   r4   r9   r>   rB   rE   rH   rK   rO   rS   rV   rY   r\   ra   re   rh   rk   rn   rq   rt   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   pluginload_pluginsr   r   r   r   <module>   s,  


























'
$

(

 

























e