code: def profiling(func):
      """
      Create the Decorator to mark a function for profiling. The time and memory usage will be recorded and printed.
  
      Example:
      .. highlight:: python
      .. code-block:: python
  
          @profiling
          def foo():
              print(1)
  
      :param func: function to be profiled
      :return: arguments wrapper
      """
      from jina.logging.predefined import default_logger
  
      @wraps(func)
      def arg_wrapper(*args, **kwargs):
          start_t = time.perf_counter()
          start_mem = used_memory(unit=1)
          r = func(*args, **kwargs)
          elapsed = time.perf_counter() - start_t
          end_mem = used_memory(unit=1)
          # level_prefix = ''.join('-' for v in inspect.stack() if v and v.index is not None and v.index >= 0)
          level_prefix = ""
          mem_status = f"memory Δ {get_readable_size(end_mem - start_mem)} {get_readable_size(start_mem)} -> {get_readable_size(end_mem)}"
          default_logger.info(
              f"{level_prefix} {func.__qualname__} time: {elapsed}s {mem_status}"
          )
          return r
  
      return arg_wrapper
  
imports: import time
  import typing
  from functools import wraps
  from typing import Optional, Union, Callable
  from jina.constants import __windows__
  from jina.helper import get_readable_size, get_readable_time, colored, get_rich_console
  from rich.progress import Progress, Task, BarColumn, TimeRemainingColumn, SpinnerColumn, TimeElapsedColumn, TextColumn, ProgressColumn, TaskID
  from rich.text import Text
  from rich.table import Column
  from rich.console import Console
label_desc: Use image node_id 3 for calling a global function with example usage: profiling(func) and returns: arg_wrapper, r