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