@register.filter
def avg_download_speed(installs):
  """Returns an avg download speed from a list of models.InstallLog entities."""
  speeds = [i.dl_kbytes_per_sec for i in installs if i.dl_kbytes_per_sec]
  if speeds:
    avg_speed = sum(speeds) / len(speeds)
    return download_speed(avg_speed)
  else:
    return 'N/A'
dataset/ETHPy150Open google/simian/src/simian/mac/admin/custom_filters.py/avg_download_speed/original