original_docstring: Creates a bunch of AuthDBSnapshotShard entities with deflated AuthDB.
  
    Runs transactionally to avoid updating the same entity group from multiple
    RPCs at once (instead there'll be only one transaction that touches it).
  
    Stores shards sequentially to avoid making a bunch of memory-hungry RPCs in
    parallel in already memory-constrained (but not performance critical) code
    path.
  
    Uses relatively low compression level to make decompression in performance
    critical 'load_sharded_auth_db' fast.
  
    Args:
      auth_db: replication_pb2.AuthDB with pushed DB.
      primary_url: URL of the primary auth service that pushed the DB.
      auth_db_rev: revision of AuthDB being pushed.
      shard_size: size in bytes of each shard.
  
    Returns:
      List of IDs of created AuthDBSnapshotShard entities.
    
docstring: Creates a bunch of AuthDBSnapshotShard entities with deflated AuthDB.
  Runs transactionally to avoid updating the same entity group from multiple
  RPCs at once (instead there'll be only one transaction that touches it).
  
  Stores shards sequentially to avoid making a bunch of memory-hungry RPCs in
  parallel in already memory-constrained (but not performance critical) code
  path.
  
  Uses relatively low compression level to make decompression in performance
  critical 'load_sharded_auth_db' fast.
docstring_tokens: Creates a bunch of AuthDBSnapshotShard entities with deflated AuthDB . Runs transactionally to avoid updating the same entity group from multiple RPCs at once ( instead there ' ll be only one transaction that touches it ) . Stores shards sequentially to avoid making a bunch of memory - hungry RPCs in parallel in already memory - constrained ( but not performance critical ) code path . Uses relatively low compression level to make decompression in performance critical ' load_sharded_auth_db ' fast .
code: def store_sharded_auth_db(auth_db, primary_url, auth_db_rev, shard_size):
    """Creates a bunch of AuthDBSnapshotShard entities with deflated AuthDB.
  
    Runs transactionally to avoid updating the same entity group from multiple
    RPCs at once (instead there'll be only one transaction that touches it).
  
    Stores shards sequentially to avoid making a bunch of memory-hungry RPCs in
    parallel in already memory-constrained (but not performance critical) code
    path.
  
    Uses relatively low compression level to make decompression in performance
    critical 'load_sharded_auth_db' fast.
  
    Args:
      auth_db: replication_pb2.AuthDB with pushed DB.
      primary_url: URL of the primary auth service that pushed the DB.
      auth_db_rev: revision of AuthDB being pushed.
      shard_size: size in bytes of each shard.
  
    Returns:
      List of IDs of created AuthDBSnapshotShard entities.
    """
    ids = []
    blob = zlib.compress(auth_db.SerializeToString(), 3)
    while blob:
      shard, blob = blob[:shard_size], blob[shard_size:]
      ids.append(hashlib.sha256(shard).hexdigest()[:16])
      model.AuthDBSnapshotShard(
          key=model.snapshot_shard_key(primary_url, auth_db_rev, ids[-1]),
          blob=shard,
      ).put()
    return ids
code_tokens: def store_sharded_auth_db ( auth_db , primary_url , auth_db_rev , shard_size ) : ids = [ ] blob = zlib . compress ( auth_db . SerializeToString ( ) , 3 ) while blob : shard , blob = blob [ : shard_size ] , blob [ shard_size : ] ids . append ( hashlib . sha256 ( shard ) . hexdigest ( ) [ : 16 ] ) model . AuthDBSnapshotShard ( key = model . snapshot_shard_key ( primary_url , auth_db_rev , ids [ - 1 ] ) , blob = shard , ) . put ( ) return ids
short_docstring: Creates a bunch of AuthDBSnapshotShard entities with deflated AuthDB.
short_docstring_tokens: Creates a bunch of AuthDBSnapshotShard entities with deflated AuthDB .
comment: """Creates a bunch of AuthDBSnapshotShard entities with deflated AuthDB.
  
    Runs transactionally to avoid updating the same entity group from multiple
    RPCs at once (instead there'll be only one transaction that touches it).
  
    Stores shards sequentially to avoid making a bunch of memory-hungry RPCs in
    parallel in already memory-constrained (but not performance critical) code
    path.
  
    Uses relatively low compression level to make decompression in performance
    critical 'load_sharded_auth_db' fast.
  
    Args:
      auth_db: replication_pb2.AuthDB with pushed DB.
      primary_url: URL of the primary auth service that pushed the DB.
      auth_db_rev: revision of AuthDB being pushed.
      shard_size: size in bytes of each shard.
  
    Returns:
      List of IDs of created AuthDBSnapshotShard entities.
    """