Skip to content

Instantly share code, notes, and snippets.

View evilkost's full-sized avatar

Valentin Gologuzov evilkost

  • Czech Republic, Prague
View GitHub Profile
import logging
logging.basicConfig(
level=logging.INFO,
format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s',
datefmt='%H:%M:%S'
)
log = logging.getLogger(__name__)
log.info("Logger initiated")
def rs(length=8):
return ''.join([
choice('abcdefghijklmnopqrstuvwxyz0123456789'
+ 'abcdefghijklmnopqrstuvwxyz'.upper())
for _ in range(length)
])
#!/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

OBS sign cli keys

-r : rpmsign mode

-s : sign mode

-C : create cert mode

Usage

default port: 5617

protocol: TCP binary ((

connect with local port [1..1024]

#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
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
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)
# 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
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