Upload dict_utils.py with huggingface_hub
Browse files- dict_utils.py +1 -1
dict_utils.py
CHANGED
|
@@ -100,7 +100,7 @@ def dict_get(dic, query, use_dpath=True, not_exist_ok=False, default=None):
|
|
| 100 |
elif len(values) == 0:
|
| 101 |
raise ValueError(f'query "{query}" did not match any item in dict: {dic}')
|
| 102 |
|
| 103 |
-
if len(values) == 1:
|
| 104 |
return values[0]
|
| 105 |
|
| 106 |
return values
|
|
|
|
| 100 |
elif len(values) == 0:
|
| 101 |
raise ValueError(f'query "{query}" did not match any item in dict: {dic}')
|
| 102 |
|
| 103 |
+
if len(values) == 1 and "*" not in query and "," not in query:
|
| 104 |
return values[0]
|
| 105 |
|
| 106 |
return values
|