<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_accounts(self, provider='aws'):
 """Get Accounts added to Spinnaker. Args: provider (str):
 What provider to find accounts for. Returns: list: list of dicts of Spinnaker credentials matching _provider_. Raises: AssertionError: Failure getting accounts from Spinnaker. """

        url = '{gate}/credentials'.format(gate=API_URL)
        response = requests.get(url, verify=GATE_CA_BUNDLE, cert=GATE_CLIENT_CERT)
        assert response.ok, 'Failed to get accounts: {0}'.format(response.text)

        all_accounts = response.json()
        self.log.debug('Accounts in Spinnaker:\n%s', all_accounts)

        filtered_accounts = []
        for account in all_accounts:
            if account['type'] == provider:
                filtered_accounts.append(account)

        if not filtered_accounts:
            raise ForemastError('No Accounts matching {0}.'.format(provider))

        return filtered_accounts