# Path: tensorflow_decision_forests/tensorflow/ops/training/op.py



from contextlib import contextmanager  # pylint: disable=g-importing-member
from typing import Union
from tensorflow_decision_forests.tensorflow.ops.training import op as training_op
    from colabtools.googlelog import CaptureLog
      from wurlitzer import sys_pipes
import io
import sys
  # Redirect them to python's standard output.
  try:
    return CaptureLog()
  except:
    try:
      # This can hang if the cout/cerr is visible to the user.
      return sys_pipes()
    except:
      warning("Cannot redirect the training output because neither of "
              "colabtools.googlelog or wurlitzer available. Run `pip install "
              "wurlitzer -U` and try again.")
      return no_op_context()

  # pylint: enable=g-importing-member
  # pytype: enable=import-error
  # pylint: enable=g-import-not-at-top
  # pylint: enable=bare-except


def set_yggdrasil_logging_level(level: int) -> None:
  """Sets the amount of logging in YggdrasilDecision Forests code.

  No-op in the internal build.

  See: yggdrasil_decision_forests::logging::SetLoggingLevel.

  Args:
    level: Logging level.
  """


# Path: tensorflow_decision_forests/tensorflow/ops/training/op.py



# Path: tensorflow_decision_forests/tensorflow/tf_logging.py
from contextlib import contextmanager  # pylint: disable=g-importing-member
from typing import Union
from tensorflow_decision_forests.tensorflow.ops.training import op as training_op
    from colabtools.googlelog import CaptureLog
      from wurlitzer import sys_pipes
import io
import sys

  # Redirect them to python's standard output.
  try:
    return CaptureLog()
  except:
    try:
      # This can hang if the cout/cerr is visible to the user.
      return sys_pipes()
    except:
      warning("Cannot redirect the training output because neither of "
              "colabtools.googlelog or wurlitzer available. Run `pip install "
              "wurlitzer -U` and try again.")
      return no_op_context()

  # pylint: enable=g-importing-member
  # pytype: enable=import-error
  # pylint: enable=g-import-not-at-top
  # pylint: enable=bare-except


def set_yggdrasil_logging_level(level: int) -> None:
  """Sets the amount of logging in YggdrasilDecision Forests code.

  No-op in the internal build.

  See: yggdrasil_decision_forests::logging::SetLoggingLevel.

  Args:
    level: Logging level.
  """


  training_op.yggdrasil_decision_forests_set_logging_level(level=level)