<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_all_accounts(bucket, region='us-west-2', json_path='accounts.json', **filters):
 """Fetches all the accounts from SWAG."""

    swag_opts = {
        'swag.type': 's3',
        'swag.bucket_name': bucket,
        'swag.bucket_region': region,
        'swag.data_file': json_path,
        'swag.schema_version': 1
    }

    swag = SWAGManager(**parse_swag_config_options(swag_opts))
    accounts = swag.get_all()
    accounts = [account for account in accounts['accounts'] if is_sub_dict(filters, account)]
    return {'accounts': accounts}