code: def _recurse_lb(
      buf: LazyBuffer,
      realizes: Set[LazyBuffer],
      allbufs: Dict[LazyBuffer, None],
      simple_pads: Set[LazyBuffer],
      children: DefaultDict[LazyBuffer, Dict[LazyBuffer, None]],
      scheduled=False,
  ):
      if buf in allbufs or buf.base.realized:
          return
      if GRAPH:
          log_lazybuffer(buf, scheduled)
      if isinstance(buf.dtype, ImageDType) and (
          prod(buf.shape) != prod(buf.dtype.shape)
          or not any(
              buf.shape[x] % 4 == 0 for x in buf.st.unit_stride_axes()
          )
      ):
          if DEBUG >= 3:
              print(
                  f"forcing image {buf.dtype} with shape {buf.shape} to float32"
              )
          buf.dtype = (
              dtypes.float32
          )  # NOTE: this is what makes the dtype above not match
      if buf.base != buf:
          # realize all places where the buffer is expanded
          if prod(buf.base.st.shape) < prod(buf.st.shape):
              if (
                  len(buf.st.views) == 1
                  and buf.st.views[-1].mask
                  and all_int(buf.base.st.shape)
                  and prod(buf.base.st.shape)
                  == prod([y - x for x, y in buf.st.views[-1].mask])
              ):
                  simple_pads.add(buf.base)
              else:
                  realizes.add(buf.base)
          return _recurse_lb(
              buf.base, realizes, allbufs, simple_pads, children
          )
      if buf.forced_realize:
          realizes.add(buf)
      allbufs[buf] = None
      if buf.op in LoadOps:
          realizes.add(buf.base)
      if buf.op == LoadOps.COPY:
          assert (
              buf.srcs[0].st.contiguous
              and buf.srcs[0].size == buf.srcs[0].base.size
          ), "can only copy contig"
          realizes.add(buf.srcs[0].base)
      for x in buf.srcs:
          children[x.base][buf] = None
          _recurse_lb(x, realizes, allbufs, simple_pads, children)
  
imports: from __future__ import annotations
  import sys, math
  from collections import defaultdict
  from typing import Union, Optional, Any, Tuple, List, Set, Dict, DefaultDict, cast
  from tinygrad.dtype import dtypes, DType, ImageDType
  from tinygrad.helpers import prod, flatten, getenv, dedup, DEBUG, all_int, all_same, GRAPH
  from tinygrad.ops import LoadOps, UnaryOps, BinaryOps, TernaryOps, ReduceOps, BufferOps, Op, LazyOp, ConstBuffer, MemBuffer, ScheduleItem
  from tinygrad.shape.symbolic import sint, Variable
  from tinygrad.shape.shapetracker import ShapeTracker
  from tinygrad.device import Buffer
  from tinygrad.graph import log_lazybuffer
  from weakref import ref, ReferenceType
label_desc: Use image node_id 4 for calling a global function with example usage: _recurse_lb(buf, realizes, allbufs, simple_pads, children, scheduled) and returns: _recurse_lb