MCPcopy
hub / github.com/keystone-engine/keypatch / dict_to_ordered_list

Method dict_to_ordered_list

keypatch.py:828–833  ·  view source on GitHub ↗
(dictionary)

Source from the content-addressed store, hash-verified

826 ### Form helper functions
827 @staticmethod
828 def dict_to_ordered_list(dictionary):
829 list = sorted(dictionary.items(), key=lambda t: t[0], reverse=False)
830 keys = [i[0] for i in list]
831 values = [i[1] for i in list]
832
833 return (keys, values)
834
835 def get_value_by_idx(self, dictionary, idx, default=None):
836 (keys, values) = self.dict_to_ordered_list(dictionary)

Callers 3

get_value_by_idxMethod · 0.95
find_idx_by_valueMethod · 0.95
setupMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected