| 1774 | return list(value.values()) if type(value) is dict else value |
| 1775 | |
| 1776 | def precision_from_string(self, str): |
| 1777 | # support string formats like '1e-4' |
| 1778 | if 'e' in str or 'E' in str: |
| 1779 | # Find the exponent part after e/E |
| 1780 | idx = str.find('e') |
| 1781 | if idx == -1: |
| 1782 | idx = str.find('E') |
| 1783 | return -int(str[idx + 1:]) |
| 1784 | # default strings like '0.0001' |
| 1785 | dot_idx = str.find('.') |
| 1786 | if dot_idx == -1: |
| 1787 | return 0 |
| 1788 | # Strip trailing zeros and count decimal places |
| 1789 | decimal_part = str[dot_idx + 1:].rstrip('0') |
| 1790 | return len(decimal_part) |
| 1791 | |
| 1792 | def map_to_safe_map(self, dictionary): |
| 1793 | return dictionary # wrapper for go |