<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def with_line_numbers(code):
 """ Adds line numbers to each line of a source code fragment Parameters code : string any multiline text, such as as (fragments) of source code Returns ------- str : string The input with added <n>: for each line Example ------- code = "def do_stuff(x):
\n\tprint(x)\n" with_line_numbers(code) 1: def do_stuff(x):
 2: print(x) 3: """

    max_number_length = str(len(str(len(code))))
    format_str = "{:>" + max_number_length + "d}: {:}"
    return "\n".join([format_str.format(line_number + 1, line) for line_number, line in enumerate(code.split("\n"))])