Expand the :setting:`task_annotations` setting.
(annotations)
| 32 | |
| 33 | |
| 34 | def prepare(annotations): |
| 35 | """Expand the :setting:`task_annotations` setting.""" |
| 36 | def expand_annotation(annotation): |
| 37 | if isinstance(annotation, dict): |
| 38 | return MapAnnotation(annotation) |
| 39 | elif isinstance(annotation, str): |
| 40 | return mlazy(instantiate, annotation) |
| 41 | return annotation |
| 42 | |
| 43 | if annotations is None: |
| 44 | return () |
| 45 | elif not isinstance(annotations, (list, tuple)): |
| 46 | annotations = (annotations,) |
| 47 | return [expand_annotation(anno) for anno in annotations] |
| 48 | |
| 49 | |
| 50 | def resolve_all(anno, task): |