-C : create cert mode
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 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") |
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 rs(length=8): | |
return ''.join([ | |
choice('abcdefghijklmnopqrstuvwxyz0123456789' | |
+ 'abcdefghijklmnopqrstuvwxyz'.upper()) | |
for _ in range(length) | |
]) |
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/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 |
#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
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 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 |
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
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) |
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
# 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 |
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 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 |