def _generate_blob_key(time_func=time.time, random_func=random.random):
  timestamp = str(time_func())
  tries = 0
  while tries < 10:
    number = str(random_func())
    digester = hashlib.md5()
    digester.update(timestamp)
    digester.update(number)
    blob_key = base64.urlsafe_b64encode(digester.digest())
    datastore_key = datastore.Key.from_path(blobstore.BLOB_INFO_KIND, blob_key,
                                            namespace='')
    try:
      datastore.Get(datastore_key)
      tries += 1
    except datastore_errors.EntityNotFoundError:
      return blob_key
  raise _TooManyConflictsError()
For the given event, update the event edges table and forward and
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/blob_upload.py/_generate_blob_key--crossover with--dataset/ETHPy150Open matrix-org/synapse/synapse/storage/event_federation.py/EventFederationStore._handle_mult_prev_events