def code_block(text, language=""):
    """Return a code block.

    If a language is specified a fenced code block is produced, otherwise the
    block is indented by four spaces.

    Keyword arguments:
    language -- Specifies the language to fence the code in (default blank).

    >>> code_block("This is a simple codeblock.")
    '    This is a simple codeblock.'
    >>> code_block("This is a simple codeblock.\\nBut it has a linebreak!")
    '    This is a simple codeblock.\\n    But it has a linebreak!'
    >>> code_block("This block of code has a specified language.", "python")
    '```python\\nThis block of code has a specified language.\\n```'
    >>> code_block("So\\nmany\\nlinebreaks.", "python")
    '```python\\nSo\\nmany\\nlinebreaks.\\n```'
    """
    if language:
        return f"```{language}\n{text}\n```"
    return "\n".join([f"    {item}" for item in text.split("\n")])