This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_many(d, required=[], optional=[], one_of=[]): | |
| """ | |
| Returns a predictable number of elements out of `d` in a list for auto-expanding. | |
| Keys in `required` will raise KeyError if not found in `d`. | |
| Keys in `optional` will return None if not found in `d`. | |
| Keys in `one_of` will raise KeyError if none exist, otherwise return the first in `d`. | |
| Example usage: |