code: def _nbool_correspond_ft_tf(u, v, w=None):
      if u.dtype == v.dtype == bool and w is None:
          not_u = ~u
          not_v = ~v
          nft = (not_u & v).sum()
          ntf = (u & not_v).sum()
      else:
          dtype = np.result_type(int, u.dtype, v.dtype)
          u = u.astype(dtype)
          v = v.astype(dtype)
          not_u = 1.0 - u
          not_v = 1.0 - v
          if w is not None:
              not_u = w * not_u
              u = w * u
          nft = (not_u * v).sum()
          ntf = (u * not_v).sum()
      return (nft, ntf)
  
imports: import math
  import warnings
  import numpy
  import dataclasses
  from typing import Optional, Callable
  from functools import partial
  from scipy._lib._util import _asarray_validated
  from .None import _distance_wrap
  from .None import _hausdorff
  from ..linalg import norm
  from ..special import rel_entr
  from .None import _distance_pybind
label_desc: Use image node_id 6 for calling a global function with example usage: _nbool_correspond_ft_tf(u, v, w) and returns: nft,  ntf