Repository: Project-MONAI/MONAI

Issue:
get parsed content with default attribute error
**Describe the bug**
get parsed content with default
```py
from monai.bundle import ConfigParser

config = {"my_dim": 2}
cfg = ConfigParser(config)
print(cfg.get_parsed_content("my_dim"))  # 2
print(cfg.get_parsed_content("test_key", default=1))
```

```
2
Traceback (most recent call last):
  File "/Users/Documents/MONAI/my_test_2.py", line 6, in <module>
    print(cfg.get_parsed_content("test_key", default=1))
  File "/Users/Documents/MONAI/monai/bundle/config_parser.py", line 291, in get_parsed_content
    return self.ref_resolver.get_resolved_content(id=id, **kwargs)
  File "/Users/Documents/MONAI/monai/bundle/reference_resolver.py", line 190, in get_resolved_content
    return self._resolve_one_item(id=id, **kwargs)
  File "/Users/Documents/MONAI/monai/bundle/reference_resolver.py", line 130, in _resolve_one_item
    item_config = item.get_config()
AttributeError: 'int' object has no attribute 'get_config'
```


**Expected behavior**
no attribute error



Discussion:

Patch:
diff --git a/monai/bundle/reference_resolver.py b/monai/bundle/reference_resolver.py
--- a/monai/bundle/reference_resolver.py
+++ b/monai/bundle/reference_resolver.py
@@ -127,6 +127,8 @@ def _resolve_one_item(
             item = look_up_option(id, self.items, print_all_options=False, default=kwargs.get("default", "no_default"))
         except ValueError as err:
             raise KeyError(f"id='{id}' is not found in the config resolver.") from err
+        if not isinstance(item, ConfigItem):
+            return item
         item_config = item.get_config()
 
         if waiting_list is None:
@@ -151,11 +153,10 @@ def _resolve_one_item(
                     look_up_option(d, self.items, print_all_options=False)
                 except ValueError as err:
                     msg = f"the referring item `@{d}` is not defined in the config content."
-                    if self.allow_missing_reference:
-                        warnings.warn(msg)
-                        continue
-                    else:
+                    if not self.allow_missing_reference:
                         raise ValueError(msg) from err
+                    warnings.warn(msg)
+                    continue
                 # recursively resolve the reference first
                 self._resolve_one_item(id=d, waiting_list=waiting_list, **kwargs)
                 waiting_list.discard(d)


Test patch:
diff --git a/tests/test_cldice_loss.py b/tests/test_cldice_loss.py
--- a/tests/test_cldice_loss.py
+++ b/tests/test_cldice_loss.py
@@ -17,14 +17,8 @@
 from monai.losses import SoftclDiceLoss, SoftDiceclDiceLoss
 
 TEST_CASES = [
-    [  # shape: (1, 4), (1, 4)
-        {"y_pred": torch.ones((100, 3, 256, 256)), "y_true": torch.ones((100, 3, 256, 256))},
-        0.0,
-    ],
-    [  # shape: (1, 5), (1, 5)
-        {"y_pred": torch.ones((100, 3, 256, 256, 5)), "y_true": torch.ones((100, 3, 256, 256, 5))},
-        0.0,
-    ],
+    [{"y_pred": torch.ones((7, 3, 11, 10)), "y_true": torch.ones((7, 3, 11, 10))}, 0.0],
+    [{"y_pred": torch.ones((2, 3, 13, 14, 5)), "y_true": torch.ones((2, 3, 13, 14, 5))}, 0.0],
 ]
 
 
diff --git a/tests/test_config_parser.py b/tests/test_config_parser.py
--- a/tests/test_config_parser.py
+++ b/tests/test_config_parser.py
@@ -174,6 +174,7 @@ def test_parse(self, config, expected_ids, output_types):
             self.assertTrue(isinstance(v, cls))
         # test default value
         self.assertEqual(parser.get_parsed_content(id="abc", default=ConfigItem(12345, "abc")), 12345)
+        self.assertEqual(parser.get_parsed_content(id="abcd", default=1), 1)
 
     @parameterized.expand([TEST_CASE_2])
     def test_function(self, config):