def get_bucket(self, hash_name, bucket_key):
results = []<EOL>for row in self._get_bucket_rows(hash_name, bucket_key):<EOL><INDENT>val_dict = pickle.loads(row)<EOL>if '<STR_LIT>' in val_dict:<EOL><INDENT>row = []<EOL>col = []<EOL>data = []<EOL>for e in val_dict['<STR_LIT>']:<EOL><INDENT>row.append(e[<NUM_LIT:0>])  <EOL>data.append(e[<NUM_LIT:1>])  <EOL>col.append(<NUM_LIT:0>)  <EOL><DEDENT>coo_row = numpy.array(row, dtype=numpy.int32)<EOL>coo_col = numpy.array(col, dtype=numpy.int32)<EOL>coo_data = numpy.array(data)<EOL>vector = scipy.sparse.coo_matrix((coo_data, (coo_row, coo_col)), shape=(val_dict['<STR_LIT>'], <NUM_LIT:1>))<EOL><DEDENT>else:<EOL><INDENT>vector = numpy.fromstring(val_dict['<STR_LIT>'],<EOL>dtype=val_dict['<STR_LIT>'])<EOL><DEDENT>results.append((vector, val_dict.get('<STR_LIT:data>')))<EOL><DEDENT>return results<EOL>
Returns bucket content as list of tuples (vector, data).