def send_messages(self, email_messages):
        if not email_messages:
            return

        num_sent = 0
        for message in email_messages:
            try:
                mail = self._create_mail(message)
                if mail:
                    self.client.send(mail)
                    num_sent += 1
            except sendgrid.SendGridClientError:
                if not self.fail_silently:
                    raise
            except sendgrid.SendGridServerError:
                if not self.fail_silently:
                    raise
        return num_sent
%prog sort bedfile
dataset/ETHPy150Open crowdresearch/crowdsource-platform/crowdsourcing/backends/sendgrid_backend.py/SendGridBackend.send_messages--crossover with--dataset/ETHPy150Open tanghaibao/jcvi/formats/bed.py/sort