function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def signal_shutdown(self) -> None: logger.debug("Signalling shutdown") self._stop_event.set()
gjcarneiro/yacron
[ 400, 38, 400, 9, 1500314642 ]
def job_should_run(startup: bool, job: JobConfig) -> bool: if ( startup and isinstance(job.schedule, str) and job.schedule == "@reboot" ): logger.debug( "Job %s (%s) is scheduled for startup (@reboot)", job.name, ...
gjcarneiro/yacron
[ 400, 38, 400, 9, 1500314642 ]
def genetic_modification(testapp, lab, award): item = { 'award': award['@id'], 'lab': lab['@id'], 'modified_site_by_coordinates': { 'assembly': 'GRCh38', 'chromosome': '11', 'start': 20000, 'end': 21000 }, 'purpose': 'repression...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_RNAi(testapp, lab, award): item = { 'award': award['@id'], 'lab': lab['@id'], 'modified_site_by_coordinates': { 'assembly': 'GRCh38', 'chromosome': '11', 'start': 20000, 'end': 21000 }, 'purpose': 'repre...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_source(testapp, lab, award, source, gene): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'introduced_gene': gene['@id'], 'purpose': 'expression', 'method': 'CRISPR', 'reagents': [ { ...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def crispr_deletion(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'deletion', 'purpose': 'repression', 'method': 'CRISPR' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def crispr_deletion_1(testapp, lab, award, target): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'deletion', 'purpose': 'repression', 'method': 'CRISPR', 'modified_site_by_target_id': target['@id'], 'guide_rna_sequences': ['ACCGGAGA'] } ...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def tale_deletion(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'deletion', 'purpose': 'repression', 'method': 'TALEN', 'zygosity': 'heterozygous' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def crispr_tag(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'tagging', 'method': 'CRISPR' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def bombardment_tag(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'tagging', 'nucleic_acid_delivery_method': ['bombardment'] }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def recomb_tag(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'tagging', 'method': 'site-specific recombination' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def transfection_tag(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'tagging', 'nucleic_acid_delivery_method': ['stable transfection'] }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def crispri(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'interference', 'purpose': 'repression', 'method': 'CRISPR' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def rnai(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'interference', 'purpose': 'repression', 'method': 'RNAi' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def mutagen(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'mutagenesis', 'purpose': 'repression', 'method': 'mutagen treatment' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def tale_replacement(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'replacement', 'purpose': 'characterization', 'method': 'TALEN', 'zygosity': 'heterozygous' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def mpra(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'characterization', 'nucleic_acid_delivery_method': ['transduction'] }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def starr_seq(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'episome', 'purpose': 'characterization', 'nucleic_acid_delivery_method': ['transient transfection'] }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def introduced_elements(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'episome', 'purpose': 'characterization', 'nucleic_acid_delivery_method': ['transient transfection'], 'introduced_elements': 'genomic DNA regions' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def crispr_tag_1(testapp, lab, award, ctcf): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'tagging', 'method': 'CRISPR', 'modified_site_by_gene_id': ctcf['@id'], 'introduced_tags': [{'name': 'mAID-mClover', 'location':...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def mpra_1(testapp, lab, award): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'characterization', 'nucleic_acid_delivery_method': ['transduction'], 'introduced_elements': 'synthesized DNA', 'modified_site_nonspecific':...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def recomb_tag_1(testapp, lab, award, target, treatment_5, document): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'tagging', 'method': 'site-specific recombination', 'modified_site_by_target_id': target['@id'], 'modif...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def rnai_1(testapp, lab, award, source, target): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'interference', 'purpose': 'repression', 'method': 'RNAi', 'reagents': [{'source': source['@id'], 'identifier': 'addgene:12345'}], 'rnai_sequences':...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_1(lab, award): return { 'modification_type': 'deletion', 'award': award['uuid'], 'lab': lab['uuid'], 'modifiction_description': 'some description' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_2(lab, award): return { 'modification_type': 'deletion', 'award': award['uuid'], 'lab': lab['uuid'], 'modification_description': 'some description', 'modification_zygocity': 'homozygous', 'modification_purpose': 'tagging', 'modificatio...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def crispr_gm(lab, award, source): return { 'lab': lab['uuid'], 'award': award['uuid'], 'source': source['uuid'], 'guide_rna_sequences': [ "ACA", "GCG" ], 'insert_sequence': 'TCGA', 'aliases': ['encode:crispr_technique1'], '@typ...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_5(lab, award, crispr_gm): return { 'modification_type': 'deletion', 'award': award['uuid'], 'lab': lab['uuid'], 'description': 'blah blah description blah', 'zygosity': 'homozygous', 'treatments': [], 'source': 'sigma', 'produc...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_6(lab, award, crispr_gm, source): return { 'purpose': 'validation', 'category': 'deeltion', 'award': award['uuid'], 'lab': lab['uuid'], 'description': 'blah blah description blah', "method": "CRISPR", "modified_site_by_target_id": "/ta...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_7_invalid_reagent(lab, award, crispr_gm): return { 'purpose': 'characterization', 'category': 'deletion', 'award': award['uuid'], 'lab': lab['uuid'], 'description': 'blah blah description blah', "method": "CRISPR", "modified_site_by_ta...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_7_valid_reagent(lab, award, crispr_gm): return { 'purpose': 'characterization', 'category': 'deletion', 'award': award['uuid'], 'lab': lab['uuid'], 'description': 'blah blah description blah', "method": "CRISPR", "modified_site_by_targ...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_7_addgene_source(testapp): item = { 'name': 'addgene', 'title': 'Addgene', 'status': 'released' } return testapp.post_json('/source', item).json['@graph'][0]
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_7_multiple_matched_identifiers(lab, award, crispr_gm): return { 'purpose': 'characterization', 'category': 'deletion', 'award': award['uuid'], 'lab': lab['uuid'], 'description': 'blah blah description blah', "method": "CRISPR", "modifi...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_7_multiple_reagents(lab, award, crispr_gm): return { 'purpose': 'characterization', 'category': 'deletion', 'award': award['uuid'], 'lab': lab['uuid'], 'description': 'blah blah description blah', "method": "CRISPR", "modified_site_by_...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_8(lab, award): return { 'purpose': 'analysis', 'category': 'interference', 'award': award['uuid'], 'lab': lab['uuid'], "method": "CRISPR", }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def construct_genetic_modification( testapp, lab, award, document, target_ATF5_genes, target_promoter): item = { 'award': award['@id'], 'documents': [document['@id']], 'lab': lab['@id'], 'category': 'insertion', 'purpose': 'tagg...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def construct_genetic_modification_N( testapp, lab, award, document, target): item = { 'award': award['@id'], 'documents': [document['@id']], 'lab': lab['@id'], 'category': 'insertion', 'purpose': 'tagging', 'nucleic_acid_delive...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def interference_genetic_modification( testapp, lab, award, document, target): item = { 'award': award['@id'], 'documents': [document['@id']], 'lab': lab['@id'], 'category': 'interference', 'purpose': 'repression', 'method': 'RN...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def crispr_knockout(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'knockout', 'purpose': 'characterization', 'method': 'CRISPR' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def recombination_knockout(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'knockout', 'purpose': 'repression', 'method': 'site-specific recombination', 'modified_site_by_coordinates': { "assembly": "GRCh38", "chromo...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def characterization_insertion_transfection(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'characterization', 'nucleic_acid_delivery_method': ['stable transfection'], 'modified_site_nonspecific': 'random', ...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def characterization_insertion_CRISPR(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'characterization', 'method': 'CRISPR', 'modified_site_nonspecific': 'random', 'introduced_elements': 'synthesized DNA' ...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def disruption_genetic_modification(testapp, lab, award): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'CRISPR cutting', 'purpose': 'characterization', 'method': 'CRISPR' } return testapp.post_json('/genetic_modification', item).json['@graph'][0]
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def activation_genetic_modification(testapp, lab, award): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'CRISPRa', 'purpose': 'characterization', 'method': 'CRISPR' } return testapp.post_json('/genetic_modification', item).json['@graph'][0]
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def binding_genetic_modification(testapp, lab, award): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'CRISPR dCas', 'purpose': 'characterization', 'method': 'CRISPR' } return testapp.post_json('/genetic_modification', item).json['@graph'][0]
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def HR_knockout(lab, award, target): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'knockout', 'purpose': 'repression', 'method': 'homologous recombination', 'modified_site_by_target_id': target['@id'] }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def CRISPR_introduction(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'expression', 'nucleic_acid_delivery_method': ['transient transfection'] }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_9(lab, award, human_donor_1): return { 'lab': lab['@id'], 'award': award['@id'], 'donor': human_donor_1['@id'], 'category': 'insertion', 'purpose': 'expression', 'method': 'transient transfection' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def transgene_insertion(testapp, lab, award, ctcf): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'in vivo enhancer characterization', 'nucleic_acid_delivery_method': ['mouse pronuclear microinjection'], 'modified_site_by_gene_...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def guides_transduction_GM(testapp, lab, award): item = { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'expression', 'nucleic_acid_delivery_method': ['transduction'], 'introduced_elements': 'gRNAs and CRISPR machinery', 'MOI': ...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_10(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'insertion', 'purpose': 'expression', 'nucleic_acid_delivery_method': ['transduction'], 'introduced_elements': 'gRNAs and CRISPR machinery', }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def genetic_modification_11(lab, award): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'disruption', 'purpose': 'characterization', 'method': 'CRISPR' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def transgene_insertion_2(testapp, lab, award, ctcf): return { 'lab': lab['@id'], 'award': award['@id'], 'category': 'transgene insertion', 'purpose': 'in vivo enhancer characterization', 'nucleic_acid_delivery_method': ['mouse pronuclear microinjection'], 'modified_s...
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def activation_genetic_modification_2(testapp, lab, award): return{ 'lab': lab['@id'], 'award': award['@id'], 'category': 'activation', 'purpose': 'characterization', 'method': 'CRISPR' }
ENCODE-DCC/encoded
[ 104, 54, 104, 70, 1354841541 ]
def test_make_gym_venv_nostack(name, num_envs, state_shape, reward_scale): seed = 0 frame_op = None frame_op_len = None venv = make_gym_venv(name, num_envs, seed, frame_op=frame_op, frame_op_len=frame_op_len, reward_scale=reward_scale) venv.reset() for i in range(5): state, reward, done,...
kengz/Unity-Lab
[ 1131, 242, 1131, 13, 1506982822 ]
def test_make_gym_concat(name, num_envs, state_shape, reward_scale): seed = 0 frame_op = 'concat' # used for image, or for concat vector frame_op_len = 4 venv = make_gym_venv(name, num_envs, seed, frame_op=frame_op, frame_op_len=frame_op_len, reward_scale=reward_scale) venv.reset() for i in ran...
kengz/Unity-Lab
[ 1131, 242, 1131, 13, 1506982822 ]
def test_make_gym_stack(name, num_envs, state_shape, reward_scale): seed = 0 frame_op = 'stack' # used for rnn frame_op_len = 4 venv = make_gym_venv(name, num_envs, seed, frame_op=frame_op, frame_op_len=frame_op_len, reward_scale=reward_scale) venv.reset() for i in range(5): state, rewa...
kengz/Unity-Lab
[ 1131, 242, 1131, 13, 1506982822 ]
def __init__( self, plotly_name="minexponent", parent_name="choropleth.colorbar", **kwargs
plotly/plotly.py
[ 13052, 2308, 13052, 1319, 1385013188 ]
def isplayfile(pathname) : if os.path.isfile(pathname) == False: return False ext = os.path.splitext(pathname)[1] ext = ext.lower() if (ext == '.mp2') : return True; if (ext == '.mp3') : return True; if (ext == '.ogg') : return True; return False
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def validate_password(self, login, password): if login in users : if encrypt(password) == users[login] : cherrypy.session['username'] = login cherrypy.session['database'] = userdatabase(login) return True return False
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def index(self): html = header (_1, _2, id) = getradio('0') (radio, genre, url) = getradio(id) if id != 0: html += '''<h3><a href="#" onClick="fplayradio('%s')"> ''' % id html += '''Play Last Radio %s <span class="glyphicon glyphicon-play"></span></a></h3>''' % r...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def music(self, directory='/mnt/Media/Music/'): html = header count = 0 html += '''<table class="table table-condensed">''' filelist = os.listdir(directory) filelist.sort() for f in filelist: file = os.path.join(directory, f) html += '''<tr>''' ...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def g(self, name="", genre="", randomlist='false'): list = searchradio(name.decode('utf8'), genre) count = 0 # Randomlist if randomlist == 'true' : shuffle(list) listhtml = '''<table class="table table-condensed">''' for id,radio,gen,url in list: listhtml +=...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def i(self, name="", genre="", url=""): html = "<h2>Insert</h2>" if name == "" or name == None : html += "Error no name" return html if insert(name, genre, url) == False: html += "Error db " return html html += '''<h3>This radio has been inse...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def d(self, id=""): html = "<h2>Delete</h2>" if id == "" or id == None : html += "Error" return html if id == "0" : html += "0 is reserved, sorry" return html #if delete(id) == False: if nonexist(id) == False: html += "Del...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def p(self, id): html = "" if id == "" or id == None : html += "Error no radio id" return html if id == "0" : html += "0 is reserved, sorry" return html (radio, genre, url) = playradio(id) if url == '': html += "Error in p...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def v(self, vol=""): html = "" if vol == "" or vol == None : html += "Error" v = volume(vol) html += "<h6>%s (%s) </h6>" % (v, vol) return html
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def m(self, id): html = '''<h2>Modify</h2>''' if id == "" or id == None : html += "Error" return html if id == "0" : html += "0 is reserved, sorry" return html (name, genre, url) = getradio(id) html += '<h3>%s | %s | %s</h3>' % (name, gen...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def f(self, id="", name="", genre="", url=""): html = '''<h2>Modified</h2>''' if id == "" or id == None : html += "Error missing id" return html if id == "0" : html += "0 is reserved, sorry" return html if modify(id, name, url, genre) == False: ...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def haddfav(self, id=""): if id == "" or id == None : html += "Error missing id" return html if id == "0" : html += "0 is reserved, sorry" return html (name, genre, url) = getradio(id) if 'Fav' in genre: genre = genre.replace(', Fav',...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def k(self): html = "<h2>Stopping</h2>" killall() return html
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def getfooter() : global footer, version db = cherrypy.session['database'] try: con = lite.connect( db ) cur = con.cursor() sql = "select radio, genre, url from Radio where id=0" cur.execute(sql) (radio, genre, url) = cur.fetchone() except: (radio, genre,...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def delete(id) : db = cherrypy.session['database'] try: con = lite.connect( db ) cur = con.cursor() sql = "DELETE from Radio WHERE id = '%s'" % (id) cur.execute(sql) ret = True except: ret = False updateversiondb(cur) con.commit() con.close() ...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def insert(radio, genre, url) : db = cherrypy.session['database'] sql = "INSERT INTO Radio (radio, genre, url, exist) VALUES('%s', '%s', '%s', 1)" % (radio, genre, url) try: con = lite.connect( db ) cur = con.cursor() cur.execute(sql) ret = True except: ret = Fal...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def addgen(id, genre) : db = cherrypy.session['database'] sql = "UPDATE Radio SET genre='%s' WHERE id = %s" % (genre, id) try: con = lite.connect( db ) cur = con.cursor() cur.execute(sql) ret = True except: ret = False updateversiondb(cur) con.commit() ...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def searchradio(radio, genre) : db = cherrypy.session['database'] #o = 'order by radio' o = '' sql = "select id, radio, genre, url from Radio where exist > 0 and radio like '%%%s%%' and genre like '%%%s%%' and id > 0 %s" % (radio, genre, o) try: con = lite.connect( db ) cur = con.cur...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def userdatabase(user) : db = database if not os.path.isfile(db): return None return db
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def setplayer(p): global player player = p
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def killall(): global player status = 0 if player == 'omxplayer': control = "/usr/local/bin/omxcontrol" status = subprocess.call([control, "stop"]) status = subprocess.call(["pkill", player]) return status
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def volume_alsa(vol): # With ALSA on CHIP if vol == 'up': db = subprocess.check_output(["amixer set 'Power Amplifier' 5%+"], shell=True) #db = os.system("amixer set 'Power Amplifier' 5%+") if vol == 'down': db = subprocess.check_output(["amixer set 'Power Amplifier' 5%-"], shell=True...
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def writemypid(pidfile): pid = str(os.getpid()) with open(pidfile, 'w') as f: f.write(pid) f.close
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def error_page_404(status, message, traceback, version): html = header html += "%s<br>" % (status) html += "%s" % (traceback) html += getfooter() return html
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def secureheaders(): headers = cherrypy.response.headers headers['X-Frame-Options'] = 'DENY' headers['X-XSS-Protection'] = '1; mode=block' headers['Content-Security-Policy'] = "default-src='self'"
ernitron/radio-server
[ 8, 3, 8, 1, 1456010490 ]
def assertListEq(self, l1, l2, ignore): ''' succeed iff {l1} - {ignore} == {l2} - {ignore} ''' missing = (set(l1) ^ set(l2)) - set(ignore) if missing: print >>sys.stderr, "l1=%r\nl2=%r\nignore=%r" % (l1, l2, ignore) self.fail("%r missing" % missing.pop())
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def assertHasattr(self, obj, attr, ignore): ''' succeed iff hasattr(obj,attr) or attr in ignore. ''' if attr in ignore: return if not hasattr(obj, attr): print "???", attr self.failUnless(hasattr(obj, attr), 'expected hasattr(%r, %r)' % (obj, attr))
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def assertHaskey(self, obj, key, ignore): ''' succeed iff key in obj or key in ignore. ''' if key in ignore: return if key not in obj: print >>sys.stderr, "***", key self.assertTrue(key in obj)
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def assertEqualsOrIgnored(self, a, b, ignore): ''' succeed iff a == b or a in ignore or b in ignore ''' if a not in ignore and b not in ignore: self.assertEqual(a, b)
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def checkModule(self, moduleName, module=None, ignore=()): ''' succeed iff pyclbr.readmodule_ex(modulename) corresponds to the actual module object, module. Any identifiers in ignore are ignored. If no module is provided, the appropriate module is loaded with __import_...
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def ismethod(oclass, obj, name): classdict = oclass.__dict__ if isinstance(obj, FunctionType): if not isinstance(classdict[name], StaticMethodType): return False else: if not isinstance(obj, MethodType): ...
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def defined_in(item, module): if isinstance(item, ClassType): return item.__module__ == module.__name__ if isinstance(item, FunctionType): return item.func_globals is module.__dict__ return False
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def test_easy(self): self.checkModule('pyclbr') self.checkModule('doctest') # Silence Py3k warning rfc822 = import_module('rfc822', deprecated=True) self.checkModule('rfc822', rfc822) self.checkModule('difflib')
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def test_decorators(self): # XXX: See comment in pyclbr_input.py for a test that would fail # if it were not commented out. # self.checkModule('test.pyclbr_input')
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def test_others(self): cm = self.checkModule
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def test_main(): run_unittest(PyclbrTest)
babyliynfg/cross
[ 75, 39, 75, 4, 1489383147 ]
def build_get_request( resource_group_name: str, managed_instance_name: str, database_name: str, query_id: str, subscription_id: str, **kwargs: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def build_list_by_query_request( resource_group_name: str, managed_instance_name: str, database_name: str, query_id: str, subscription_id: str, *, start_time: Optional[str] = None, end_time: Optional[str] = None, interval: Optional[Union[str, "_models.QueryTimeGrainType"]] = None, ...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get( self, resource_group_name: str, managed_instance_name: str, database_name: str, query_id: str, **kwargs: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list_by_query( self, resource_group_name: str, managed_instance_name: str, database_name: str, query_id: str, start_time: Optional[str] = None, end_time: Optional[str] = None, interval: Optional[Union[str, "_models.QueryTimeGrainType"]] = None, ...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def prepare_request(next_link=None): if not next_link:
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceQueryStatistics", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem)
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]