def format_code(code):
    """
    Formats some code with line numbers

    Parameters
    ----------
    code : str
        Code

    Returns
    -------
    str
        Code prefixed with line numbers
    """
    lines = ['']
    lines.extend(["%-5d %s" % (i, l) for i, l
                  in enumerate(code.split('\n'), 1)])
    return '\n'.join(lines)