def load(self, key):
<EOL>if isinstance(key, basestring):<EOL><INDENT>key = BucketKey.decode(key)<EOL><DEDENT>if key.uuid != self.uuid:<EOL><INDENT>raise ValueError("<STR_LIT>" %<EOL>key)<EOL><DEDENT>if key.version == <NUM_LIT:1>:<EOL><INDENT>raw = self.db.get(str(key))<EOL>if raw is None:<EOL><INDENT>return self.bucket_class(self.db, self, str(key))<EOL><DEDENT>return self.bucket_class.hydrate(self.db, msgpack.loads(raw),<EOL>self, str(key))<EOL><DEDENT>records = self.db.lrange(str(key), <NUM_LIT:0>, -<NUM_LIT:1>)<EOL>loader = BucketLoader(self.bucket_class, self.db, self, str(key),<EOL>records)<EOL>return loader.bucket<EOL>
Given a bucket key, load the corresponding bucket.

:param key: The bucket key.  This may be either a string or a
            BucketKey object.

:returns: A Bucket object.