code: def get_global_palette(filenames, options):
  
      '''Fetch the global palette for a series of input files by merging
  their samples together into one large array.
  
      '''
  
      input_filenames = []
  
      all_samples = []
  
      if not options.quiet:
          print('building global palette...')
  
      for input_filename in filenames:
  
          img, _ = load(input_filename)
          if img is None:
              continue
  
          if not options.quiet:
              print('  processing {}...'.format(input_filename))
  
          samples = sample_pixels(img, options)
          input_filenames.append(input_filename)
          all_samples.append(samples)
  
      num_inputs = len(input_filenames)
  
      all_samples = [s[:int(round(float(s.shape[0])/num_inputs))]
                     for s in all_samples]
  
      all_samples = np.vstack(tuple(all_samples))
  
      global_palette = get_palette(all_samples, options)
  
      if not options.quiet:
          print('  done\n')
  
      return input_filenames, global_palettf get_global_palette(filenames, options):
  
      '''Fetch the global palette for a series of input files by merging
  their samples together into one large array.
  
      '''
  
      input_filenames = []
  
      all_samples = []
  
      if not options.quiet:
          print('building global palette...')
  
      for input_filename in filenames:
  
          img, _ = load(input_filename)
          if img is None:
              continue
  
          if not options.quiet:
              print('  processing {}...'.format(input_filename))
  
          samples = sample_pixels(img, options)
          input_filenames.append(input_filename)
          all_samples.append(samples)
  
      num_inputs = len(input_filenames)
  
      all_samples = [s[:int(round(float(s.shape[0])/num_inputs))]
                     for s in all_samples]
  
      all_samples = np.vstack(tuple(all_samples))
  
      global_palette = get_palette(all_samples, options)
  
      if not options.quiet:
          print('  done\n')
  
      return input_filenames, global_palette
docs: Fetch the global palette for a series of input files by merging
  their samples together into one large array.