Skip to content

Instantly share code, notes, and snippets.

View evilkost's full-sized avatar

Valentin Gologuzov evilkost

  • Czech Republic, Prague
View GitHub Profile
def main_g(inp_iter, c):
while True:
count = [0,]
def inner_g():
while count[0] < c:
yield inp_iter.next()
count[0] += 1
else:
count[0] = 0
raise StopIteration()
import brukva
c = brukva.Client()
c.connect()
#c.select(9)
p = c.pipeline()
p.set('foo', 'bar')
p.get('foo')
from tornado.ioloop import IOLoop
class CallbackDispatcher(object):
def __init__(self, generator):
self.ioloop = IOLoop.instance()
self.g = generator
try:
self.call(self.g.next())
except StopIteration:
pass
# require pandas 0.13+
import pandas as pd
def read_one(prefix, filename, alg):
return pd.read_csv(prefix + "Mona_Lisa.bmp.LS.csv", sep="\t", index_col=0, header=None, names=['Evals', 'Error'])
##### CSV format:
# separator: \t
# no header
assay = read.csv("es_ass.csv", header=TRUE, sep=" ", row.name=1)
pheno = read.csv("es_pheno.csv", header=TRUE, sep=" ", row.name=1)
source('~/res/mixgene_workdir/data/R/ranking.Methods.r')
response = pheno['User_class']
restr_svmrfe_best10 = RestrictedSVMRFE(t(assay), response , best=10)
import pandas as pd
from functools import partial
from collections import Iterable
STORE_DIR = "preprocessed"
def do_df(filename, sep=" ", new_name=None, do_transpose=False, plugin_func=None):
df = pd.read_table(filename, sep=sep, index_col=0)
if do_transpose:
df = df.T

#Copr Api v2

Here I propose a second version of the Copr Api.
Main reasons: to make api more RESTful-like and uniform.
Features:

  • each entity should be represented by resource
  • ... and grouped in collections (is entity have parent or owner)
  • more clear URL schema

Usage

default port: 5617

protocol: TCP binary ((

connect with local port [1..1024]

OBS sign cli keys

-r : rpmsign mode

-s : sign mode

-C : create cert mode

#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of