def METHOD_NAME(client, ou, active, recursive=True, ignoredAccounts=()):
    results = []
    ous = [ou]
    if recursive:
        ous = get_sub_ous(client, ou)
    account_pager = client.get_paginator('list_accounts_for_parent')
    for ou in ous:
        for a in account_pager.paginate(
            ParentId=ou['Id']).build_full_result().get(
                'Accounts', []):
            a['Path'] = ou['Path']
            a['Tags'] = {
                t['Key']: t['Value'] for t in
                client.list_tags_for_resource(ResourceId=a['Id']).get('Tags', ())}
            if a['Id'] in ignoredAccounts:
                continue
            if active:
                if a['Status'] == 'ACTIVE':
                    results.append(a)
            else:
                results.append(a)
    return results