def compute_lag_features(data, ts_uid_columns, lags):
    """
    data: pandas.Dataframe
        dataframe with column 'y' (response values)
    ts_uid_columns: list
        List of columns names that are unique identifiers for time series.
    lags: list
        list of integer lag values
    """
    assert 'y' in data.columns, "Missing 'y' column in dataframe."
    lag_features = data.loc[:, (['ds', 'y'] + ts_uid_columns)].copy(deep=True)
    for lag in lags:
        feature_name = f'lag{lag}'
        feature_value = lag_features.groupby(ts_uid_columns)['y'].shift(lag
            ).values
        lag_features[feature_name] = feature_value
    lag_features.drop('y', axis=1, inplace=True)
    return lag_features
