chosen_version = {
return tidy(
cpython,
filter(d => d.tag === sel_v),
mutate({
is_toxic_new_score: d => +d.is_toxic_new_score,
is_toxic: d => d.is_toxic_new_score >= tog_D ? "Toxic" : "Not Toxic",
cumlines_tag: d => +d.cumlines_tag,
abs_lines_changed: d => +d.abs_lines_changed,
insertions: d => +d.insertions,
deletions: d => +d.deletions,
tot_lines_tag: d => +d.tot_ines_tag,
pct_completion_tag: d=> +d.pct_completion_tag,
diff_by_release_s: d=>+d.diff_by_release_s,
diff_prev_row_tag_auth_sec: d=>+d.diff_prev_row_tag_auth_sec,
Day: d => parseTime(d.Day)
}),
leftJoin(graph.nodes, { by: ['Author', 'Author'] })
).map((d) => {
const tzdate = Temporal.Instant.from(d.Date).toZonedDateTimeISO(
"America/Los_Angeles"
);
const date = new Date(tzdate.epochMilliseconds);
const sha = d.sha;
const group = d.group;
const hour = tzdate.hour;
const dayOfMonth = tzdate.day;
const week = tzdate.weekOfYear;
const month = months[tzdate.month - 1];
const year = tzdate.year;
const abs_lines_changed = d.abs_lines_changed;
const diff_prev_row_tag_auth_sec = d.diff_prev_row_tag_auth_sec;
const diff_prev_row_tag_auth_m = d.diff_prev_row_tag_auth_sec/60;
const diff_prev_row_tag_auth_h = d.diff_prev_row_tag_auth_sec/60/60;
const Author = d.Author;
const toxicity_score = d.toxicity_score;
const is_toxic = d.is_toxic;
const cumlines_tag = d.cumlines_tag;
return {
sha,
date,
hour,
dayOfMonth,
week,
month,
year,
abs_lines_changed,
cumlines_tag,
diff_prev_row_tag_auth_sec,
diff_prev_row_tag_auth_m,
diff_prev_row_tag_auth_h,
Author,
toxicity_score,
is_toxic,
group
};
})
}