<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def WriteHashBlobReferences(self, references_by_hash, cursor):
 """Writes blob references for a given set of hashes."""

    values = []
    for hash_id, blob_refs in iteritems(references_by_hash):
      refs = rdf_objects.BlobReferences(items=blob_refs).SerializeToString()
      values.append({
          "hash_id": hash_id.AsBytes(),
          "blob_references": refs,
      })
    _Insert(cursor, "hash_blob_references", values)