code: def _get_summary_time_context_or_null(
      summary_metric: Optional["Summary"],
  ) -> Union[nullcontext, "Timer"]:
      """
      helper function to either get a time context or a nullcontext if the summary metric is None
      :param summary_metric: An optional metric
      :return: either a Timer context or a nullcontext
      """
      return summary_metric.time() if summary_metric else nullcontext()
  
file_path: jina/jina/serve/helper.py
imports: import functools
  import inspect
  import os
  import typing
  from typing import Any, Dict, List, Optional, Tuple, Union
  import grpc
  from jina.helper import convert_tuple_to_list
  from contextlib import nullcontext
label_desc: Use image node_id 1 for calling a global function with example usage: _get_summary_time_context_or_null(summary_metric) and returns: unknown