in scripts/export_tasks.py [0:0]
def _extract_tasks(library_name, variable_name, value):
"""Extract supported tasks of the library.
Args:
library_name: The name of the library (e.g. paddlenlp)
variable_name: The name of the Python variable (e.g. ALLOWED_TASKS)
value: The AST of the variable's Python value.
"""
if variable_name == "ALLOWED_TASKS":
if isinstance(value, ast.Dict):
for key in value.keys:
lib_to_task_map[library_name].append(key.value)