code: def scale_sections(sections, scaling_scope):
    '''
    input: unscaled sections.
    returns: sections scaled to [0, 255]
    '''
    new_sections = []
  
    if scaling_scope == 'layer':
      for section in sections:
        new_sections.append(scale_image_for_display(section))
  
    elif scaling_scope == 'network':
      global_min, global_max = global_extrema(sections)
  
      for section in sections:
        new_sections.append(scale_image_for_display(section,
                                                    global_min,
                                                    global_max))
    return new_sectionf scale_sections(sections, scaling_scope):
    '''
    input: unscaled sections.
    returns: sections scaled to [0, 255]
    '''
    new_sections = []
  
    if scaling_scope == 'layer':
      for section in sections:
        new_sections.append(scale_image_for_display(section))
  
    elif scaling_scope == 'network':
      global_min, global_max = global_extrema(sections)
  
      for section in sections:
        new_sections.append(scale_image_for_display(section,
                                                    global_min,
                                                    global_max))
    return new_sections
docs: input: unscaled sections.
    returns: sections scaled to [0, 255]