Returns the sender, respecting the Resent-*
        headers. In any case, prefer Sender over From,
        meaning that if Sender is present then From is
        ignored, as per the RFC.
358521
def sender(self):
        
        to_fetch = (
            ['Resent-Sender', 'Resent-From'] if self.resent else
            ['Sender', 'From']
        )
        for item in to_fetch:
            if item in self:
                _, addr = getaddresses([self[item]])[0]
                return addr
319849
def email(self, name, to, from_addr, subject, body, header, owner=None, **kwargs):
        
        return Email(self.tcex, name, to, from_addr, subject, body, header, owner=owner, **kwargs)
1330308
def get_smtp_mail(self):
        
        header = self.get_smtp_header()
        body = self.get_body().replace('\n', '\r\n')
        return header + '\r\n' + body + '\r\n'
684630
def require_sender(f):
    
    @wraps(f)
    def decorator(*args, **kwargs):
        if not request.authorization:
            return jsonify({'message': 'unauthorized'}), 401

        username = request.authorization.username
        password = request.authorization.password

        if not validate_sender(username, password):
            return jsonify({'message': 'forbidden'}), 403

        return f(*args, **kwargs)
    return decorator
14019
def sender(self, jid: str):
        
        if jid is not None and not isinstance(jid, str):
            raise TypeError("'sender' MUST be a string")
        self._sender = aioxmpp.JID.fromstr(jid) if jid is not None else None
787352
def get_resp(url):
    """"""
    try:
        headers = {'User-Agent': random.choice(USER_AGENTS)}
        try:
            request = requests.get(url, headers=headers, proxies=get_proxies())
        except MissingSchema:
            url = add_protocol(url)
            request = requests.get(url, headers=headers, proxies=get_proxies())
        return lh.fromstring(request.text.encode('utf-8') if PY2 else request.text)
    except Exception:
        sys.stderr.write('Failed to retrieve {0}.\n'.format(url))
        raise
708791
def parse_recipients(header, reference_id=None):
    
    m = _TO_PATTERN.search(header)
    if not m:
        if reference_id and reference_id not in _CABLES_WITHOUT_TO:
            logger.warn('No TO header found in "%s", header: "%s"' % (reference_id, header))
        return []
    to_header = m.group(1)
    return _route_recipient_from_header(to_header, reference_id)
626660
def _live_receivers(self, sender):
        
        receivers = None
        if self.use_caching and not self._dead_receivers:
            receivers = self.sender_receivers_cache.get(sender)
            # We could end up here with NO_RECEIVERS even if we do check this case in
            # .send() prior to calling _live_receivers() due to concurrent .send() call.
            if receivers is NO_RECEIVERS:
                return []
        if receivers is None:
            with self.lock:
                self._clear_dead_receivers()
                senderkey = _make_id(sender)
                receivers = []
                for (receiverkey, r_senderkey), receiver in self.receivers:
                    if r_senderkey == NONE_ID or r_senderkey == senderkey:
                        receivers.append(receiver)
                if self.use_caching:
                    if not receivers:
                        self.sender_receivers_cache[sender] = NO_RECEIVERS
                    else:
                        # Note, we must cache the weakref versions.
                        self.sender_receivers_cache[sender] = receivers
        non_weak_receivers = []
        for receiver in receivers:
            if isinstance(receiver, weakref.ReferenceType):
                # Dereference the weak reference.
                receiver = receiver()
                if receiver is not None:
                    non_weak_receivers.append(receiver)
            else:
                non_weak_receivers.append(receiver)
        return non_weak_receivers
957338
def sender(self) -> Optional[Sequence[SingleAddressHeader]]:
        """"""
        try:
            return cast(Sequence[SingleAddressHeader], self[b'sender'])
        except KeyError:
            return None
1080059
def get_response_signer(self):
        
        if not hasattr(self, "response_signer"):
            self.response_signer = V2ResponseSigner(self.digest, orig=self)
        return self.response_signer
1201199
def keyserver(self):
        
        if 'PreferredKeyServer' in self._signature.subpackets:
            return next(iter(self._signature.subpackets['h_PreferredKeyServer'])).uri
        return ''
238772
def sender(url, **kwargs):
    

    res = url_to_resources(url)
    fnc = res["sender"]
    return fnc(res.get("url"), **kwargs)
835424
def is_bad_headers(self):
        

        headers = [self.subject, self.sender]
        headers += list(self.send_to)
        headers += dict(self.extra_headers).values()

        for val in headers:
            for c in '\r\n':
                if c in val:
                    return True
        return False
1284437
def getheader(self, which, use_hash=None, polish=True):
        """"""
        header = getheader(
            which,
            use_hash=use_hash,
            target=self.target,
            no_tco=self.no_tco,
            strict=self.strict,
        )
        if polish:
            header = self.polish(header)
        return header
340539
async def get_input_sender(self):
        
        if self.input_sender is None and self._sender_id:
            await self._refetch_sender()
        return self._input_sender
982242
def get_header(headers, name, default=None):
    
    name = name.lower()
    for header in headers:
        if header[0].lower() == name:
            return header[1]
    return default
1143701
public Sender getResponseSender() {
        if (blockingHttpExchange != null) {
            return blockingHttpExchange.getSender();
        }
        if (sender != null) {
            return sender;
        }
        return sender = new AsyncSenderImpl(this);
    }