def get_accounts_with_maximum_nominal(accounts):
    """Provides the accounts that have maximum nominal interest.

    Args:
        accounts: non empty array of accounts to find maximum nominal within
    Returns:
        array of 1..* accounts that have maximum nominal
    Raises:
        Exception if null or empty array of accounts provided
    """

    if not accounts or len(accounts) == 0:
        raise Exception('Must provide array of accounts')
    accounts_having_max_nominal = []
    for account in accounts:
        if len(accounts_having_max_nominal) == 0:
            accounts_having_max_nominal.append(account)
        else:
            if account.nominal > accounts_having_max_nominal[0].nominal:
                accounts_having_max_nominal.clear()
                accounts_having_max_nominal.append(account)
            elif account.nominal == accounts_having_max_nominal[0].nominal:
                accounts_having_max_nominal.append(account)
    return accounts_having_max_nominal