def discretize_linear_1D(model, x_range):
 x = np.arange((x_range[0] - 0.5), (x_range[1] + 0.5))
 values_intermediate_grid = model(x)
 return (0.5 * (values_intermediate_grid[1:] + values_intermediate_grid[:(-1)]))

def discretize_linear_1D ( model , x_range ) : x = np . arange ( ( x_range [ 0 ] - 0.5 ) , ( x_range [ 1 ] + 0.5 ) ) values_intermediate_grid = model ( x ) return ( 0.5 * ( values_intermediate_grid [ 1 : ] + values_intermediate_grid [ : ( - 1 ) ] ) )
discretize model by performing a linear interpolation .