@classmethod<EOL><INDENT>def decode(cls, key):<DEDENT>
<EOL>prefix, sep, param_str = key.partition('<STR_LIT::>')<EOL>if sep != '<STR_LIT::>' or prefix not in cls._prefix_to_version:<EOL><INDENT>raise ValueError("<STR_LIT>" % key)<EOL><DEDENT>version = cls._prefix_to_version[prefix]<EOL>parts = param_str.split('<STR_LIT:/>')<EOL>uuid = parts.pop(<NUM_LIT:0>)<EOL>params = {}<EOL>for part in parts:<EOL><INDENT>name, sep, value = part.partition('<STR_LIT:=>')<EOL>if sep != '<STR_LIT:=>':<EOL><INDENT>raise ValueError("<STR_LIT>" %<EOL>part)<EOL><DEDENT>params[name] = cls._decode(value)<EOL><DEDENT>return cls(uuid, params, version=version)<EOL>
Decode a bucket key into a BucketKey instance.

:param key: The string form of a bucket key.

:returns: A suitable instance of BucketKey corresponding to
          the passed-in key.