<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_mean_time(timepoints, weights):
 """Return the weighted mean of the given timepoints. With equal given weights, the result is simply the mean of the given time points: 5.0 With different weights, the resulting mean time is shifted to the larger ones: 6.0 Or, in the most extreme case: 7.0 There will be some checks for input plausibility perfomed, e.g.: Traceback (most recent call last):
 ValueError: While trying to calculate the weighted mean time, \ the following error occurred: For the following objects, at least \ one value is negative: weights. """

    timepoints = numpy.array(timepoints)
    weights = numpy.array(weights)
    validtools.test_equal_shape(timepoints=timepoints, weights=weights)
    validtools.test_non_negative(weights=weights)
    return numpy.dot(timepoints, weights)/numpy.sum(weights)