code: def retrieve_pip_installs(library_names, cumulated):
      if cumulated:
          returned_values = {}
          for library_name in library_names:
              for i in datasets["pip"][library_name]:
                  if i["day"] in returned_values:
                      returned_values[i["day"]]["Cumulated"] += i[
                          "num_downloads"
                      ]
                  else:
                      returned_values[i["day"]] = {
                          "Cumulated": i["num_downloads"]
                      }
  
          library_names = ["Cumulated"]
  
      else:
          returned_values = {}
          for library_name in library_names:
              for i in datasets["pip"][library_name]:
                  if i["day"] in returned_values:
                      returned_values[i["day"]][library_name] = i[
                          "num_downloads"
                      ]
                  else:
                      returned_values[i["day"]] = {
                          library_name: i["num_downloads"]
                      }
  
          for library_name in library_names:
              for i in returned_values.keys():
                  if library_name not in returned_values[i]:
                      returned_values[i][library_name] = None
  
      returned_values = collections.OrderedDict(
          sorted(returned_values.items())
      )
      output = {
          l: [k[l] for k in returned_values.values()]
          for l in library_names
      }
      output["day"] = list(returned_values.keys())
      return output
  
file_path: gradio/demo/dashboard/helpers.py
imports: import collections
  from datetime import datetime
  from datasets import DatasetDict, load_dataset
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: retrieve_pip_installs(library_names, cumulated) and returns: output