MCPcopy Create free account
hub / github.com/celery/celery / prepare

Function prepare

celery/app/annotations.py:34–47  ·  view source on GitHub ↗

Expand the :setting:`task_annotations` setting.

(annotations)

Source from the content-addressed store, hash-verified

32
33
34def 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
50def resolve_all(anno, task):

Callers 3

test_returns_listMethod · 0.90

Calls 1

expand_annotationFunction · 0.85

Tested by 3

test_returns_listMethod · 0.72