clearml-agent/clearml_agent/backend_config/utils.py
2020-12-22 21:21:29 +02:00

10 lines
341 B
Python

def get_items(cls):
""" get key/value items from an enum-like class (members represent enumeration key/value) """
return {k: v for k, v in vars(cls).items() if not k.startswith('_')}
def get_options(cls):
""" get options from an enum-like class (members represent enumeration key/value) """
return get_items(cls).values()