code: def binary_focal_crossentropy(
      y_true,
      y_pred,
      gamma=2.0,
      from_logits=False,
      label_smoothing=0.0,
      axis=-1,
  ):
      y_pred = ivy.asarray(y_pred)
      y_true = ivy.asarray(y_true, dtype=y_pred.dtype)
      label_smoothing = ivy.asarray(label_smoothing, dtype=y_pred.dtype)
      gamma = ivy.asarray(gamma, dtype=y_pred.dtype)
  
      if label_smoothing > 0.0:
          y_true = (
              y_true * (1.0 - label_smoothing) + 0.5 * label_smoothing
          )
  
      if from_logits:
          sigmoidal = ivy.sigmoid(y_pred)
      else:
          sigmoidal = y_pred
  
      p_t = (y_true * sigmoidal) + ((1 - y_true) * (1 - sigmoidal))
      focal_factor = ivy.pow(1.0 - p_t, gamma)
  
      if from_logits:
          zeros = ivy.zeros_like(y_pred, dtype=y_pred.dtype)
          cond = y_pred >= zeros
          relu_logits = ivy.where(cond, y_pred, zeros)
          neg_abs_logits = ivy.where(cond, -y_pred, y_pred)
          bce = ivy.add(
              relu_logits - y_pred * y_true,
              ivy.log1p(ivy.exp(neg_abs_logits)),
          )
      else:
          epsilon_ = 1e-7
          y_pred = ivy.clip(y_pred, epsilon_, 1.0 - epsilon_)
          bce = y_true * ivy.log(y_pred + epsilon_)
          bce += (1 - y_true) * ivy.log(1 - y_pred + epsilon_)
          bce = -bce
      bfce = focal_factor * bce
      return ivy.mean(bfce, axis=ivy.to_scalar(axis))
  
imports: import ivy
  from ivy.functional.frontends.tensorflow.func_wrapper import to_ivy_arrays_and_back
label_desc: Use image node_id 7 for calling a global function with example usage: binary_focal_crossentropy(y_true, y_pred, gamma, from_logits, label_smoothing, axis) and returns: ivy