def imports(
    magic="%matplotlib inline", comment=None,
    module_imports=["pesummary", "pesummary.io:read"],
    text="First we import the key python modules", extra_lines=[]
):
    """Return a string containing the key imports

    Parameters
    ----------
    comment: str, optional
        comment to add at the top of the string. Default None
    magic: str, optional
        magic statement to include in the string. Default '%matplotlib inline'
    module_imports: list, optional
        list of modules you wish to import. If a colon is in the import string
        this is interpreted as, 'from %s import %s' % tuple(import.split(':'))'
    text: str, optional
        Markdown text explaining the import cell below. Default
        'First we import the key python modules'
    extra_lines: list, optional
        optional lines to add to the end of the string
    """
    string = ""
    if comment is not None:
        string += comment + "\n"
    if magic is not None:
        string += magic + "\n"
    for _import in module_imports:
        if ":" not in _import:
            string += "import {}\n".format(_import)
        else:
            string += "from %s import %s\n" % tuple(_import.split(":"))
    string += "\n".join(extra_lines)
    if text is not None:
        return [text, string]
    return [string]