'float calculate_remaining_filament( float length, int extruder )
Calculate the remaining length of filament for the given extruder if
the given length were to be extruded.'

def calculate_remaining_filament(self, length, extruder=0):

    remainder = (self.spool_manager.getRemainingFilament(extruder) - length)
    minimum_warning_length = 1000.0
    if (remainder < minimum_warning_length):
        self.log(_(('\nWARNING:    Currently    loaded    spool    for    extruder    ' + ('%d    will    likely    run    out    of    filament    during    the    print.\n' % extruder))))
    return remainder
