def RemoveDirectory(rebalance):
  """Remove temporary directory of the given rebalance object."""
  loc = data_store.DB.Location()
  if not os.path.exists(loc):
    return False
  if not os.path.isdir(loc):
    return False
  tempdir = _GetTransactionDirectory(loc, rebalance.id)
  try:
    if tempdir.startswith(loc):
      shutil.rmtree(tempdir)
  except __HOLE__:
    pass
dataset/ETHPy150Open google/grr/grr/server/data_server/rebalance.py/RemoveDirectory