nodes: 0, module; 1, function_definition; 2, function_name:log_time; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, generic_type; 8, expression_statement; 9, function_definition; 10, return_statement; 11, identifier:func; 12, type; 13, identifier:Callable; 14, type_parameter; 15, comment:"""Log the time it takes to run a function. It's sort of like timeit, but
      prettier.
      """; 16, function_name:wrapper; 17, parameters; 18, block; 19, identifier:wrapper; 20, generic_type; 21, type; 22, type; 23, list_splat_pattern; 24, dictionary_splat_pattern; 25, expression_statement; 26, expression_statement; 27, expression_statement; 28, expression_statement; 29, return_statement; 30, identifier:Callable; 31, type_parameter; 32, ellipsis:...; 33, identifier:Any; 34, identifier:args; 35, identifier:kwargs; 36, assignment; 37, call; 38, assignment; 39, call; 40, identifier:ret; 41, type; 42, type; 43, identifier:start_time; 44, call; 45, attribute; 46, argument_list; 47, identifier:ret; 48, call; 49, attribute; 50, argument_list; 51, ellipsis:...; 52, identifier:Any; 53, attribute; 54, argument_list; 55, identifier:log; 56, identifier:info; 57, string:"%s starting..."; 58, call; 59, identifier:func; 60, argument_list; 61, identifier:log; 62, identifier:info; 63, string:"%s finished (%s)"; 64, call; 65, call; 66, identifier:time; 67, identifier:time; 68, attribute; 69, argument_list; 70, list_splat; 71, dictionary_splat; 72, attribute; 73, argument_list; 74, attribute; 75, argument_list; 76, attribute; 77, identifier:title; 78, identifier:args; 79, identifier:kwargs; 80, attribute; 81, identifier:title; 82, identifier:datetime; 83, identifier:timedelta; 84, keyword_argument; 85, identifier:func; 86, identifier:__name__; 87, identifier:func; 88, identifier:__name__; 89, identifier:seconds; 90, call; 91, identifier:int; 92, argument_list; 93, binary_operator:time.time() - start_time; 94, call; 95, identifier:start_time; 96, attribute; 97, argument_list; 98, identifier:time; 99, identifier:time
code: def log_time(func: Callable[..., Any]) -> Callable[..., Any]:
      """Log the time it takes to run a function. It's sort of like timeit, but
      prettier.
      """
  
      def wrapper(*args, **kwargs):
          start_time = time.time()
          log.info("%s starting...", func.__name__.title())
          ret = func(*args, **kwargs)
          log.info(
              "%s finished (%s)",
              func.__name__.title(),
              datetime.timedelta(seconds=int(time.time() - start_time)),
          )
          return ret
  
      return wrapper