def _import_show_doc_cell(mod=None, name=None):
    """Add an import show_doc cell + deal with the __file__ hack if necessary."""
    source = f'#export\nfrom local.notebook.showdoc import show_doc'
    if mod:
        source += f'\nfrom local.{mod} import *'
    if name:
        source += f'\nfrom pathlib import Path\n__file__ = {name}'
    return {'cell_type': 'code', 'execution_count': None, 'metadata': {
        'hide_input': True}, 'outputs': [], 'source': source}
