Skip to content

Instantly share code, notes, and snippets.

View jg-you's full-sized avatar
🐢

Jean-Gabriel Young jg-you

🐢
View GitHub Profile
@jg-you
jg-you / orbits.py
Last active June 11, 2024 18:28
Computing the number of orbits in a graph, with dreadnaut (nauty), in python
# -*- coding: utf-8 -*-
"""
Wrapper around dreadnaut that computes the orbits of a graph.
NOTE: Must have installed `dreandaut`. The location of the binary can be passed
as an argument to `compute_automorphisms`.
Author: Jean-Gabriel Young <[email protected]>
"""
import subprocess
@laurencee9
laurencee9 / draw_curved_edges.py
Last active July 9, 2019 19:34
Draw curved network edges in python
import numpy as np
import matplotlib.patches as mpatches
import networkx as nx
from matplotlib.patches import FancyArrowPatch as ArrowPath
from matplotlib.font_manager import FontProperties
def draw_curved_edges(edges, pos, ax, mu=0.05, edge_color="black", edge_width=1.0, alpha=1.0, arrow_scale=20.0, loopsize=0):
"""
@ByoungInKim
ByoungInKim / create_directory.py
Last active May 30, 2024 08:33
python - create directory if path if it doesn`t exist for file write
import os
directory = '/home/kenny/gist'
if not os.path.exists(directory):
os.makedirs(directory)
@ksimek
ksimek / program_options_boilerplate.cpp
Last active December 28, 2023 05:12
Boilerplate code for a C++ program using boost program options. Usage string is automatically generated from positional arguments.
#include <boost/program_options.hpp>
#include <sstream>
#include <fstream>
#include <iterator>
#include <algorithm>
namespace po = boost::program_options;
class Options
{
{
"1": "7642c4c2e24b176ed442153e3097e819bf5ca80e",
"2": "b3d784bbaf1286612ad44308231aa58350da17a6",
"3": "a05cb173c1ba1c6ae30bcf5edbd5d5e19566e764",
"4": "55d264f8671b50b5dbaffa56d1ee719fd429e8f4",
"5": "478ec952d186329f825db4ee7978e31dd42de622",
"6": "e82bd73e8c188d151ed790b5ad5a24fa01533fa0",
"7": "28a9dfb84ef81592f21ed285d7cf09be0b605988",
"8": "e98c13fc9df6a893efa0c57bcfa548be664ab8c8",
"9": "af316e6df5bded14f9b268fcbffe7892eb5f244c",