code: def _write(stream: bytes, path: str):
      Path(path).parent.mkdir(parents=True, exist_ok=True)
  
      with open(path, "wb") as f:
          f.write(stream)
  
imports: import os
  import socket
  import subprocess
  from collections import defaultdict
  from contextlib import closing
  from pathlib import Path
  from ray.air.util.node import _force_on_node
  import ray
  from typing import Any, List, Dict, Union, Callable
label_desc: Use image node_id 2 for calling a global function with example usage: _write(stream, path) without return types