def is_permanently_delisted(quarterly_submissions, qtr, s):
    """
    Check if a company is permanently delisted starting from a given qtr. This function is not great, I should have made
    a single function that finds the first qtr for which a company is listed and the qtr for which it became delisted,
    if ever.

    :param quarterly_submissions:
    :param qtr: a given qtr
    :param s: Settings dictionary
    :return: bool assessing whether or not it is permanently delisted after the given qtr
    """
    flag_permanently_delisted = True
    idx = s['list_qtr'].index(qtr)
    for qtr in s['list_qtr'][idx:]:
        if len(quarterly_submissions[qtr]):
            flag_permanently_delisted = False
            break
    return flag_permanently_delisted
