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
import dgl | |
from typing import Any | |
from copy import deepcopy | |
def construct_subgraph_from_blocks(blocks: list[Any], | |
batch_size:int, | |
node_attributes_to_copy: list[str], | |
) -> dgl.DGLGraph: | |
""" | |
Constructs a copy of a Message flow graphs (MFG), defined as a list of MFGs. | |
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
def normalizeRows(x): | |
""" | |
Implement a function that normalizes each row of the matrix x (to have unit length). | |
Argument: | |
x -- A numpy matrix of shape (n, m) | |
Returns: | |
x -- The normalized (by row) numpy matrix. You are allowed to modify x. | |
""" |
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
#!usr/bin/python | |
# -*- coding: utf-8 -*- | |
# | |
#@created: 09.10.2021 | |
#@author: Fyodor Velikonivtsev | |
#@contact: [email protected] | |
import bisect | |
import io |
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
#!/usr/bin/env python | |
import io | |
import os | |
import pandas as pd | |
def read_vcf(path): | |
with open(path, 'r') as f: | |
lines = [l for l in f if not l.startswith('##')] |
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
git fetch --all | |
git reset --hard origin/master | |
git pull origin master |
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
def turbo_bmh(string, pattern): | |
""" | |
Bad character heuristic, good suffix heuristic, turbo-shift heuristic implemented on Python | |
""" | |
def _suffices_preprocessing(suffix): | |
suffix[m - 1] = m | |
g = m - 1 | |
for i in range(m - 2, -1, -1): | |
if i > g and suffix[i + m - f - 1] < i - g: |