@staticmethod<EOL><INDENT>def resource_to_bucket_and_key(resource_name):<DEDENT>
if not resource_name.startswith(S3Meterer.s3_url_prefix):<EOL><INDENT>raise ValueError("<STR_LIT>" %<EOL>S3Meterer.s3_url_prefix)<EOL><DEDENT>s3_bucket_and_key = resource_name[len(S3Meterer.s3_url_prefix):]<EOL>try:<EOL><INDENT>bucket, key = s3_bucket_and_key.split("<STR_LIT:/>", <NUM_LIT:1>)<EOL>if not bucket:<EOL><INDENT>raise ValueError("<STR_LIT>" %<EOL>resource_name)<EOL><DEDENT>return (bucket, key)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError("<STR_LIT>" % resource_name)<EOL><DEDENT>
S3Meterer.resource_to_bucket_and_key(resource_name) -> (str, str)

Convert an S3 resource name in the form 's3://bucket/key' to a tuple
of ('bucket', 'key').