tessl install tessl/pypi-gcloud@0.7.0Python client library for Google Cloud Platform services including Datastore, Storage, and Pub/Sub
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
78%
Build a simple entity relationship manager that creates and validates hierarchical entity identifiers for a blog platform.
Your system should provide functions to:
The system should support two entity types:
All identifiers should be associated with a project named "test-project".
@generates
def create_root_key(post_id):
"""
Create a root-level key for a BlogPost entity.
Args:
post_id: The identifier for the blog post (string or integer)
Returns:
A key object representing the BlogPost entity
"""
pass
def create_child_key(parent_key, comment_id):
"""
Create a child key for a Comment entity under a parent BlogPost.
Args:
parent_key: The parent BlogPost key object
comment_id: The identifier for the comment (string or integer)
Returns:
A key object representing the Comment entity with the parent relationship
"""
pass
def extract_key_components(key):
"""
Extract the hierarchical components from a key.
Args:
key: A key object (possibly hierarchical)
Returns:
A list of tuples, where each tuple contains (kind, id) for each level
in the hierarchy from root to leaf
"""
pass
def is_ancestor(potential_ancestor_key, descendant_key):
"""
Check if one key is an ancestor of another in the entity hierarchy.
Args:
potential_ancestor_key: The key that might be an ancestor
descendant_key: The key that might be a descendant
Returns:
True if potential_ancestor_key is an ancestor of descendant_key, False otherwise
"""
passProvides Google Cloud Datastore client functionality.