def coolbean_sheets(entries, context):
    'Given a set of entries, pull out any slugs and add them to the context'
    settings = context.setdefault('coolbean-accounts', {})
    for entry in entries:
        if isinstance(entry, data.Open):
            document = entry.meta.get('document_name', None)
            tab = entry.meta.get('document_tab', None)
            slug = entry.meta.get('slug', '')
            if (document and tab and slug):
                settings[slug] = {'account': entry.account, 'document': document, 'tab': tab, 'currencies': entry.currencies}
            elif (document or tab):
                print(f'Skipping {entry.account}: {document}/{tab}/{slug}')
    return (entries, [])
Given a set of entries, pull out any slugs and add them to the context
def coolbean_sheets(entries, context):
    
    settings = context.setdefault('coolbean-accounts', {})
    for entry in entries:
        if isinstance(entry, data.Open):
            document = entry.meta.get('document_name', None)
            tab = entry.meta.get('document_tab', None)
            slug = entry.meta.get('slug', )
            if (document and tab and slug):
                settings[slug] = {'account': entry.account, 'document': document, 'tab': tab, 'currencies': entry.currencies}
            elif (document or tab):
                print(f'Skipping {entry.account}: {document}/{tab}/{slug}')
    return (entries, [])