Skip to content

Commit

Permalink
Update util.py
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-grim authored Oct 30, 2024
1 parent e3e6f25 commit 82377b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/deep_neurographs/utils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---
Expand Down

0 comments on commit 82377b0

Please sign in to comment.