This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Finds all maximal cliques in a graph using the Bron-Kerbosch algorithm. The input graph here is | |
# in the adjacency list format, a dict with vertexes as keys and lists of their neighbors as values. | |
# https://en.wikipedia.org/wiki/Bron-Kerbosch_algorithm | |
from collections import defaultdict | |
def find_cliques(graph): | |
p = set(graph.keys()) | |
r = set() | |
x = set() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A | |
B | |
C | |
D | |
E | |
F | |
G | |
H | |
I | |
J |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X "POST" \ | |
-H 'accept: application/json' \ | |
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ | |
"https://notebooks.firecloud.org/api/google/v1/runtimes/$GOOGLE_PROJECT/$CLUSTER_NAME/stop" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Cartesian coordinates per facet-panel | |
#' | |
#' This function mimics the behavior of [ggplot2::coord_cartesian()], | |
#' while supporting per-panel limits when faceted. | |
#' | |
#' @details | |
#' | |
#' A 'panel_limits' data frame may contain: | |
#' | |
#' - zero or more faceting variables, all of which must be found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# instead of doing sort | uniq -c this will count with little overhead the various lines that you sent at it | |
awk '{table[$0]+=1} END {for (entry in table) {print entry, table[entry]}}' | |