def METHOD_NAME(iden, res_master_secret, tickets):
    """Calculate PSK associated with provided ticket identity."""
    ticket = [i for i in tickets if i.ticket == iden.identity][0]
    ticket_hash = 'sha256' if len(res_master_secret) == 32 else 'sha384'
    psk = HKDF_expand_label(res_master_secret, b"resumption",
                            ticket.ticket_nonce, len(res_master_secret),
                            ticket_hash)
    return psk