def format_email_address(self, email_type, emails=None):
        """
        returns email headers with email information.
        :param email_type: One of: from|to|cc|bcc
        :param emails: A list of email address or list/tuple of (name, email) pairs.
        :return: the email header
        """
        emails = emails or self.recipients or []
        header = self.get_header(email_type)
        for i, address in enumerate(emails):
            if i > 0: # ensure emails are separated by commas
                header.append(',', 'us-ascii')
            if isinstance(address, basestring):
                # address is a string. use as is. Attempt it as ascii first and
                # if fails, send in the default charset
                try:
                    header.append(address, charset='us-ascii')
                except UnicodeError:
                    header.append(address, charset=self.charset)
            elif (tuple, list) in type(address):
                # address is a list or tuple (name, email): format it
                _name, _address = address
                try:
                    _name.encode('us-ascii')
                    formatted_address = formataddr(address)
                    header.append(formatted_address, charset='us-ascii')
                except UnicodeError: # this is not an ascii name - append it separately
                    header.append(_name)
                    header.append('<{0}>'.format(_address), charset='us-ascii')
        return header
dataset/ETHPy150Open harel/strudelpy/strudelpy/__init__.py/Email.format_email_address/swapped operands of `in`