Cleans email address.
    :param addresses: List of strings (email addresses)
    :return: List of strings (cleaned email addresses)
166142
def clean_addresses(addresses):
    
    if addresses is None:
        return []
    addresses = addresses.replace("\'", "")
    address_list = re.split('[,;]', addresses)
    clean_list = []
    for address in address_list:
        temp_clean_address = clean_address(address)
        clean_list.append(temp_clean_address)
    return clean_list
394874
def delete_email_addresses(self, addresses=[]):
        
        url = self._build_url('user', 'emails')
        return self._boolean(self._delete(url, data=dumps(addresses)),
                             204, 404)
878126
def update(self, addresses):
        
        if isinstance(addresses, six.string_types):
            addresses = [addresses, ]
        s0_, s1_ = set(self.addresses), set(addresses)
        sr_, sa_ = s0_.difference(s1_), s1_.difference(s0_)
        for a__ in sr_:
            self.remove(a__)
        for a__ in sa_:
            self.add(a__)
        return bool(sr_ or sa_)
1021982
def SplitEmailsAndAppendEmailDomain(self, address_list):
    """"""
    result = []
    # Process email addresses, and build up a list.
    if isinstance(address_list, rdf_standard.DomainEmailAddress):
      address_list = [str(address_list)]
    elif isinstance(address_list, string_types):
      address_list = [address for address in address_list.split(",") if address]
    for address in address_list:
      result.append(self.AddEmailDomain(address))
    return result
255556
private Map<String, String> getEmails(Map<String, String> emails) {

		if (emails == null || emails.size() == 0) {
			return null;
		}

		Map<String, String> out = new HashMap<>();

		for (String email : emails.keySet()) {
			if (excluded(email)) {
				continue;
			}

			out.put(email, emails.get(email));
		}

		return out;
	}
733238
private function transformAddressesToArray($addresses): array
    {
        $transformed = [];
        foreach ($addresses as $address) {
            if (null === $address->getName()) {
                $transformed[] = $address->getEmail();

                continue;
            }

            $transformed[$address->getEmail()] = $address->getName();
        }

        return $transformed;
    }
1299788
def get_addresses(message: list) -> list:
    
    # Need the address so that we know who to send the message back to
    addresses = []
    for address in message:
        # if we hit a blank string, then we've got all the addresses
        if address == b'':
            break
        addresses.append(address)

    return addresses
1103149
def parse_emails(emails):
    

    if isinstance(emails, string_types):
        emails = [emails]
    elif emails is None:
        emails = []

    for email in emails:
        try:
            validate_email_with_name(email)
        except ValidationError:
            raise ValidationError('%s is not a valid email address' % email)

    return emails
895592
private function transformArrayToAddresses($addresses): array
    {
        $transformed = [];
        foreach ($addresses as $email => $name) {
            $address = new Address($email, $name);
            $transformed[] = $address;
        }

        return $transformed;
    }
678451
def getEmailAddresses(self):
        
        return self.store.query(
            EmailAddress,
            EmailAddress.person == self).getColumn('address')
315811
def filter_users_by_email(email):
    
    from .models import EmailAddress
    User = get_user_model()
    mails = EmailAddress.objects.filter(email__iexact=email)
    users = [e.user for e in mails.prefetch_related('user')]
    if app_settings.USER_MODEL_EMAIL_FIELD:
        q_dict = {app_settings.USER_MODEL_EMAIL_FIELD + '__iexact': email}
        users += list(User.objects.filter(**q_dict))
    return list(set(users))
559678
def remove_address(self, fqdn, address):
        " "

        # Get a list of addresses.
        for record in self.list_address(fqdn):
            if record.address == address:
                record.delete()
                break
1043803
def good_listize(real_addresses)
      good_listed = clean_addresses(real_addresses, :good_list)
      good_listed = clean_addresses(good_listed, :bad_list) unless good_listed.empty?
      good_listed
    end
733893
def parse_address(address: str) -> str:
    
    display_name, parsed_address = email.utils.parseaddr(address)

    return parsed_address or address
1129214
def parse(self, text):
        '''
        '''
        results = []
        if isinstance(text, str):
            if six.PY2:
                text = unicode(text, 'utf-8')
        self.clean_text = self._normalize_string(text)

        # get addresses
        addresses = set(self._get_addresses(self.clean_text))
        if addresses:
            # append parsed address info
            results = list(map(self._parse_address, addresses))

        return results
778524
def resolve_addresses(user, useralias, to, cc, bcc):
    
    addresses = {"recipients": []}
    if to is not None:
        make_addr_alias_target(to, addresses, "To")
    elif cc is not None and bcc is not None:
        make_addr_alias_target([user, useralias], addresses, "To")
    else:
        addresses["recipients"].append(user)
    if cc is not None:
        make_addr_alias_target(cc, addresses, "Cc")
    if bcc is not None:
        make_addr_alias_target(bcc, addresses, "Bcc")
    return addresses
897310
def email_address_to_list(email_address):
    """"""
    realname, address = email.utils.parseaddr(email_address)
    return (
        [address, realname] if realname and address else
        [email_address, email_address]
    )