pip install PyGitHub
You may want to use pip3 instead of pip.
| # Original version: https://gist.github.com/mogproject/50668d3ca60188c50e6ef3f5f3ace101 | |
| from collections import defaultdict | |
| import networkx as nx | |
| import plotly.graph_objects as go | |
| from typing import Any, List, Dict, Tuple, Union, Callable | |
| Vertex = Any | |
| Edge = Tuple[Vertex, Vertex] | |
| Num = Union[int, float] |
| #!/usr/bin/env python3 | |
| """ | |
| Santorini benchmark launcher. | |
| """ | |
| __author__ = 'Yosuke Mizutani' | |
| __version__ = '0.0.4' | |
| __license__ = 'Apache License, Version 2.0' | |
| import sys |
| #!/bin/bash | |
| TIMEOUT=timeout | |
| run_with_timeout() { | |
| oldopt=$- | |
| set +e | |
| $TIMEOUT $@ | |
| ret=$? | |
| if [[ $ret -eq 124 ]]; then |
| static inline int encode_distance(int start, int distance) { return ((start + 1) << 4) + distance; } | |
| static inline int decode_distance(int x) { return x & ((1 << 4) - 1); } | |
| static inline int node_visited(int x, int v) { return (x >> 4) == v + 1; } | |
| template <typename Graph> | |
| static void extend_closed_neighborhood(Graph const& G, Graph& H, int v, int radius, int buffer[]) { | |
| assert(0 <= v && v < G.number_of_nodes()); | |
| assert(radius >= 0); |
| #!/usr/bin/env python | |
| import sys | |
| import fileinput | |
| import re | |
| diff = -8 | |
| def repl(matched): | |
| h = int(matched.group(1)) + diff |