code: def _get_allocated_bytes(mr):
      if not hasattr(mr, "get_allocated_bytes"):
          if hasattr(mr, "upstream_mr"):
              return _get_allocated_bytes(mr.upstream_mr)
          else:
              return 0
      else:
          return mr.get_allocated_bytes()
  
label_desc: Use image node_id 2 for calling a global function with example usage: _get_allocated_bytes(mr) and returns: mr, _get_allocated_bytes, int