code: def summarize_by_task(df: pd.DataFrame) -> pd.DataFrame:
      """Groups regions to get the total runtime for each task.
  
      Args:
        df: A dataframe of runtime profiling numbers.
  
      Returns:
        The dataframe grouped by task.
      """
      df_numeric = df.select_dtypes(exclude=["object"])
      by_task = df_numeric.groupby(by=["Task"]).sum()
      return by_task.reset_index()
  
imports: from typing import Dict, Sequence, List, Tuple, Text, Union
  from absl import app
  from absl import flags
  import altair
  import pandas
  import tensorflow
  from third_party.nucleus.io import sharded_file_utils
  from deepvariant import dashboard_utils
label_desc: Use image node_id 4 for calling a global function with example usage: summarize_by_task(df) and returns: by_task