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
from typing import Generator | |
def iterize(generator: Generator): | |
""" | |
This function creates an iterable object from the generator you pass here, | |
it helps when function expects an iterable, but you have a generator. | |
:param generator: generator that you want to wrap. | |
:return: an iterable object. | |
""" | |
return type('_wrappedGenerator', (), { |
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
#!/bin/python3 | |
from subprocess import run | |
from typing import List | |
def install_with(*command: List[str]): | |
print('Running "{}" ========================'.format(' '.join(command))) | |
result = run(command) | |
print('Command returned with status: {} ===='.format(result.returncode)) |
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
from sympy import * | |
from sympy.polys import subresultants_qq_zz | |
x_var = Symbol('x') | |
p_var = Symbol('p') | |
q_var = Symbol('q') | |
f_x = Matrix([ | |
[x_var ** 0, x_var ** 1, x_var ** 2] | |
]) |
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
FROM ocaml/opam2:4.07 | |
RUN sudo apt install m4 gcc-multilib make git -y | |
RUN opam pin add -n ostap https://github.com/sign5/ostap.git#memoCPS | |
RUN opam pin add -y lama https://github.com/JetBrains-Research/Lama.git | |
RUN git clone https://github.com/JetBrains-Research/Lama.git | |
RUN eval $(opam env) && cd Lama && make |
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/python3 | |
import json | |
from pathlib import Path | |
from urllib import request | |
coc_java_dir_path = Path.home() / '.config/coc/extensions/coc-java-data' | |
nvim_config_dir_path = Path.home() / '.config/nvim/' | |
coc_settings_json_path = nvim_config_dir_path / 'coc-settings.json' | |
coc_settings_json_bak_path = nvim_config_dir_path / 'coc-settings.json.bak' |
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