code: 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"))
          ]
      )
  
imports: import ast
  import re
  import warnings
  from operator import attrgetter
  from hyperopt import space_eval
label_desc: Use image node_id 6 for calling a global function with example usage: with_line_numbers(code) and returns: str