r""" Search for the standard in the lists of user-defined or built-in standards. Search may be performed by using the complete standard information (dictionary) or by one of the keys. The function returns reference to the first matching entry in the list or None.
(self, standard, key=None)
| 827 | return standard_ref |
| 828 | |
| 829 | def find_standard(self, standard, key=None): |
| 830 | r""" |
| 831 | Search for the standard in the lists of user-defined or built-in standards. |
| 832 | Search may be performed by using the complete standard information (dictionary) |
| 833 | or by one of the keys. The function returns reference to the first matching |
| 834 | entry in the list or None. |
| 835 | |
| 836 | Examples: |
| 837 | ``find_standard(st)`` - search for dictionary ``st`` |
| 838 | ``find_standard(st["name"], key="name")`` - search by key ``name``. |
| 839 | |
| 840 | Parameters |
| 841 | ---------- |
| 842 | |
| 843 | standard: dict or other |
| 844 | The dictionary with standard information (the complete dictionary |
| 845 | must match one of the list elements) or the value of one of the |
| 846 | dictionary element (e.g. serial, or name). In the latter case, |
| 847 | the ``key`` must be specified |
| 848 | |
| 849 | key: str or None |
| 850 | The name of the dictionary key used for searching. The first |
| 851 | matching entry is returned. |
| 852 | |
| 853 | Returns |
| 854 | ------- |
| 855 | |
| 856 | Reference to one of the entries of user-defined or built-in lists |
| 857 | if search is successful or None if the standard was not found. |
| 858 | """ |
| 859 | if standard is None: |
| 860 | return None |
| 861 | |
| 862 | standard_ref = self._find_standard_custom(standard, key=key) |
| 863 | if not standard_ref: |
| 864 | standard_ref = self._find_standard_built_in(standard, key=key) |
| 865 | |
| 866 | return standard_ref |
| 867 | |
| 868 | def set_selected_standard(self, standard=None): |
| 869 | r""" |