code: def sort_by_type(file_list):
      
      ret_dict = defaultdict(list)
      for filepath in file_list:
          _, ext = os.path.splitext(filepath)
          ret_dict[ext.replace('.', '')].append(filepath)
  
      return ret_dict
docs: Sorts a list of files into types.
  
      :param file_list: List of file paths.
      :return: {extension: [<list of file paths with that extension>]}