def filter_out_blocked_addresses(message_tuples):
  send_count = 0
  allowed = []
  for subject, message, from_email, recipients in message_tuples:
    blocked = [r for r in recipients if not is_allowed_to_send_email_to(r)]
    for r in blocked:
      log_blocked_send(from_email, r, subject)
      send_count += 1
    allowed_recipients = [r for r in recipients if not r in blocked]
    allowed.append((subject, message, from_email, allowed_recipients))
  return (allowed, send_count)
dataset/ETHPy150Open CollabQ/CollabQ/common/mail.py/filter_out_blocked_addresses/original