code: def test_tb_init_with_default_region():
      """
      Test TensorBoardApp init when user does not provide region.
      """
      # happy case
      with patch(
          "sagemaker.Session.boto_region_name",
          new_callable=PropertyMock,
      ) as region_mock:
          region_mock.return_value = TEST_REGION
          tb_app = TensorBoardApp()
          assert tb_app.region == TEST_REGION
  
      # no default region configured
      with patch(
          "sagemaker.Session.boto_region_name",
          new_callable=PropertyMock,
      ) as region_mock:
          region_mock.side_effect = [ValueError()]
          with pytest.raises(ValueError):
              tb_app = TensorBoardApp()
  
imports: from __future__ import absolute_import
  import json
  from unittest.mock import patch, Mock, mock_open, PropertyMock
  import boto3
  import botocore
  import pytest
  from sagemaker.interactive_apps.tensorboard import TensorBoardApp
label_desc: Use image node_id 26 for calling a global function with example usage: test_tb_init_with_default_region() without return types