code: def maybenoop(f: F) -> F:
      @wraps(f)
      def wrapper(self: "TensorBoard", *args: Any, **kwds: Any) -> None:
          if self.writer is None:
              return
          return f(self, *args, **kwds)
  
      return cast(F, wrapper)
  
file_path: foolbox/foolbox/tensorboard.py
imports: from typing import Union, Callable, TypeVar, Any, cast
  from typing_extensions import Literal
  import eagerpy
  from functools import wraps
label_desc: Use image node_id 1 for calling a global function with example usage: maybenoop(f) and returns: cast, f