def get_appropriated_part_size(file_size):
    """Gets the appropriated part size when uploading or downloading files,
       given an initial file size"""
    if file_size <= 104857600:
        return 128
    if file_size <= 786432000:
        return 256
    if file_size <= 1572864000:
        return 512
    raise ValueError('File size too large')
