original_docstring: Serializes TaskGroup into a JSON object.
docstring: Serializes TaskGroup into a JSON object.
docstring_tokens: Serializes TaskGroup into a JSON object .
code: def serialize_task_group(cls, task_group: TaskGroup) -> Optional[Union[Dict[str, Any]]]:
          """Serializes TaskGroup into a JSON object."""
          if not task_group:
              return None
  
          serialize_group = {
              "_group_id": task_group._group_id,  # pylint: disable=protected-access
              "prefix_group_id": task_group.prefix_group_id,
              "tooltip": task_group.tooltip,
              "ui_color": task_group.ui_color,
              "ui_fgcolor": task_group.ui_fgcolor,
              "children": {
                  label: (DAT.OP, child.task_id)
                  if isinstance(child, BaseOperator)
                  else (DAT.TASK_GROUP, SerializedTaskGroup.serialize_task_group(child))
                  for label, child in task_group.children.items()
              },
              "upstream_group_ids": cls._serialize(list(task_group.upstream_group_ids)),
              "downstream_group_ids": cls._serialize(list(task_group.downstream_group_ids)),
              "upstream_task_ids": cls._serialize(list(task_group.upstream_task_ids)),
              "downstream_task_ids": cls._serialize(list(task_group.downstream_task_ids)),
          }
  
          return serialize_group
code_tokens: def serialize_task_group ( cls , task_group : TaskGroup ) -> Optional [ Union [ Dict [ str , Any ] ] ] : if not task_group : return None serialize_group = { "_group_id" : task_group . _group_id , "prefix_group_id" : task_group . prefix_group_id , "tooltip" : task_group . tooltip , "ui_color" : task_group . ui_color , "ui_fgcolor" : task_group . ui_fgcolor , "children" : { label : ( DAT . OP , child . task_id ) if isinstance ( child , BaseOperator ) else ( DAT . TASK_GROUP , SerializedTaskGroup . serialize_task_group ( child ) ) for label , child in task_group . children . items ( ) } , "upstream_group_ids" : cls . _serialize ( list ( task_group . upstream_group_ids ) ) , "downstream_group_ids" : cls . _serialize ( list ( task_group . downstream_group_ids ) ) , "upstream_task_ids" : cls . _serialize ( list ( task_group . upstream_task_ids ) ) , "downstream_task_ids" : cls . _serialize ( list ( task_group . downstream_task_ids ) ) , } return serialize_group
short_docstring: Serializes TaskGroup into a JSON object.
short_docstring_tokens: Serializes TaskGroup into a JSON object .
comment: """Serializes TaskGroup into a JSON object."""$SEP$# pylint: disable=protected-access