From 82377b02250da9d07bc0fab4fab57ebfd7d4dee4 Mon Sep 17 00:00:00 2001 From: Anna Grim <108307071+anna-grim@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:54:00 -0700 Subject: [PATCH] Update util.py --- src/deep_neurographs/utils/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/deep_neurographs/utils/util.py b/src/deep_neurographs/utils/util.py index 023b6a6..1413c60 100644 --- a/src/deep_neurographs/utils/util.py +++ b/src/deep_neurographs/utils/util.py @@ -477,7 +477,10 @@ def sample_once(my_container): sample """ - return sample(my_container, 1)[0] + if type(my_container) is list: + return sample(my_container, 1)[0] + else: + return sample(list(my_container), 1)[0] # --- dictionary utils ---