code: def _only_once(f: Callable) -> Callable:
      """decorator to only run a function once"""
      f.called = False  # type:ignore[attr-defined]
  
      def wrapped(**kwargs: Any) -> Any:
          if f.called:  # type:ignore[attr-defined]
              return
          ret = f(**kwargs)
          f.called = True  # type:ignore[attr-defined]
          return ret
  
      return wrapped
  
imports: from __future__ import annotations
  import os
  import re
  import socket
  import subprocess
  from subprocess import PIPE, Popen
  from typing import Any, Callable, Iterable, Sequence
  from warnings import warn
label_desc: Use image node_id 3 for calling a global function with example usage: _only_once(f) and returns: wrapped, ret