Skip to content

Instantly share code, notes, and snippets.

View zurk's full-sized avatar

Konstantin Slavnov zurk

View GitHub Profile
@zurk
zurk / levenshtein.py
Created November 15, 2018 20:09
Liechtenstein distance calculation with edit sequence. Align 3 sequences.
class Action:
equal = 0
replace = 1
insert = 2
delete = 3
Action.names = {i: name for name, i in Action.__dict__.items() if name[0] != "_"}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zurk
zurk / How engine performance depends from siva file size or blobs number inside.ipynb
Created March 26, 2018 10:25
How engine performance depends from siva file size or blobs number inside.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

How to install cluster locally

Hey, ones I fall into troble that I need to modify and test docker container which is running on our cluster. So the best I can do is to run everything locally. So let's do it. I run everything on Ubuntu 16.04.3 LTS.

What we need to install

1. Docker

It is easy. Instrucion for Ubuntu is here

2. kubectl

@zurk
zurk / get_random_walks.py
Last active February 2, 2018 16:32
Example. How you can get random walks from UAST via sourced-ml.
import os
from sourced.ml.transformers import Engine, UastExtractor, UastDeserializer, Transformer, HeadFiles
from sourced.ml.utils import create_engine
from sourced.ml.algorithms.uast_struct_to_bag import Uast2RandomWalks
# Sourced-ml is based on transformers.
# You create a pipeline from transformers and then run it.
# We do not have a transformer, that just returns random walks, so we need to create it first.
@zurk
zurk / Bblfsh usecases.ipynb
Last active December 21, 2017 13:06
Bblfsh usecases
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zurk
zurk / sourced.ml via engine.ipynb
Last active January 11, 2018 08:41
We have 3 main algorithms in our sourced.ml (https://github.com/src-d/ml). One can find a description in the README. Now algorithms don't use our new cool engine (https://github.com/src-d/engine). We need to understand how we can rearchitect our tool. At first, let's see how we can reproduce them.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zurk
zurk / tree_visualization.ipynb
Last active September 27, 2017 15:36
Babelfish tree text visualization for roles structure.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zurk
zurk / UAST
Created August 14, 2017 13:39
UAST for function call
uast {
internal_type: "Module"
children {
internal_type: "FunctionDef"
properties {
key: "internalRole"
value: "body"
}
properties {
key: "returns"