rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
self['sim_image'].set_from_file(self.Sim_Image) | self['sim_image'].set_from_file(self.sim_image) | def setup_view(self): self.get_top_widget().set_position(gtk.WIN_POS_CENTER_ON_PARENT) self['sim_image'].set_from_file(self.Sim_Image) self['payt_image'].set_from_file(self.Computer_Image) self['credit_card_image'].set_from_file(self.Modem_Image) self['voucher_image'].set_from_file(self.Betavine_Image) |
logger.info("MSISDN from model cache %s: " % self.msisdn) | logger.info("MSISDN from model cache: %s" % self.msisdn) | def get_msisdn(self, cb): if self.msisdn: logger.info("MSISDN from model cache %s: " % self.msisdn) cb(self.msisdn) return |
logger.info("MSISDN from gconf %s: " % msisdn) | logger.info("MSISDN from gconf: %s" % msisdn) | def get_imsi_cb(imsi): if imsi: msisdn = self.conf.get("sim/%s" % imsi, 'msisdn') if msisdn: logger.info("MSISDN from gconf %s: " % msisdn) self.msisdn = msisdn cb(self.msisdn) return |
if 'ppp' in settings: uuid = settings['connection']['uuid'] ret[uuid] = ProfileModel(self, profile=profile, device_callable=self.device_callable, parent_model_callable=self.parent_model_callable) | uuid = settings['connection']['uuid'] ret[uuid] = ProfileModel(self, profile=profile, device_callable=self.device_callable, parent_model_callable=self.parent_model_callable) | def get_profiles(self): ret = {} for profile in self.manager.get_profiles(): settings = profile.get_settings() # filter out wlan profiles if 'ppp' in settings: uuid = settings['connection']['uuid'] ret[uuid] = ProfileModel(self, profile=profile, device_callable=self.device_callable, parent_model_callable=self.parent_mo... |
if other is None: return True return self.uuid != other.uuid | return not self.__eq__(other) | def __ne__(self, other): if other is None: return True return self.uuid != other.uuid |
self.username = settings['gsm']['username'] | self.username = settings['gsm'].get('username', '') | def _load_settings(self, settings): try: self.uuid = settings['connection']['uuid'] self.name = settings['connection']['id'] self.username = settings['gsm']['username'] self.apn = settings['gsm']['apn'] self.autoconnect = settings['connection'].get('autoconnect', False) self.static_dns = settings['ipv4'].get('ignore-au... |
if settings['gsm'].get('password', None): | if settings['gsm'].get('password') is not None: | def _load_settings(self, settings): try: self.uuid = settings['connection']['uuid'] self.name = settings['connection']['id'] self.username = settings['gsm']['username'] self.apn = settings['gsm']['apn'] self.autoconnect = settings['connection'].get('autoconnect', False) self.static_dns = settings['ipv4'].get('ignore-au... |
'band': self.band, 'username': self.username, | def save(self): props = { 'connection': { 'name': 'connection', 'id': self.name, 'type': 'gsm', 'uuid': self.uuid, 'autoconnect': self.autoconnect}, 'gsm': { 'name': 'gsm', 'band': self.band, 'username': self.username, 'number': '*99#', 'network-type': self.network_pref, 'apn': self.apn}, 'ppp': { 'name': 'ppp', 'refus... | |
'network-type': self.network_pref, | def save(self): props = { 'connection': { 'name': 'connection', 'id': self.name, 'type': 'gsm', 'uuid': self.uuid, 'autoconnect': self.autoconnect}, 'gsm': { 'name': 'gsm', 'band': self.band, 'username': self.username, 'number': '*99#', 'network-type': self.network_pref, 'apn': self.apn}, 'ppp': { 'name': 'ppp', 'refus... | |
if props['gsm']['band'] is None: del props['gsm']['band'] if props['gsm']['network-type'] is None: del props['gsm']['network-type'] | def save(self): props = { 'connection': { 'name': 'connection', 'id': self.name, 'type': 'gsm', 'uuid': self.uuid, 'autoconnect': self.autoconnect}, 'gsm': { 'name': 'gsm', 'band': self.band, 'username': self.username, 'number': '*99#', 'network-type': self.network_pref, 'apn': self.apn}, 'ppp': { 'name': 'ppp', 'refus... | |
logger.info("main-controller: property_device_value_change - device : " + self.model.device) | logger.info("main-controller: property_device_value_change") | def property_device_value_change(self, model, old, new): if self.model.device is not None: sm = self.model.device.connect_to_signal("DeviceEnabled", self.on_device_enabled_cb) self.signal_matches.append(sm) # connect to SIG_SMS_COMP and display SMS sm = self.model.device.connect_to_signal(SIG_SMS_COMP, self.on_sms_rece... |
if 1: | if 0: | def nick_debug(s): if 1: with open(BCM_FAST_LOG, 'a', 0) as f: f.write("%s\n" % s) |
logger.info("main.py: controller - property_profile value changed - begining method") | logger.info("main.py: controller - property_profile value changed" " - begining method") | def property_profile_required_value_change(self, model, old, new): logger.info("main.py: controller - property_profile value changed - begining method") if new: logger.info("main.py: controller - property_profile value changed - calling 'ask_for_new_profile' ") self.ask_for_new_profile() |
logger.info("main.py: controller - property_profile value changed - calling 'ask_for_new_profile' ") | logger.info("main.py: controller - property_profile value " "changed - calling 'ask_for_new_profile' ") | def property_profile_required_value_change(self, model, old, new): logger.info("main.py: controller - property_profile value changed - begining method") if new: logger.info("main.py: controller - property_profile value changed - calling 'ask_for_new_profile' ") self.ask_for_new_profile() |
self.view.set_disconnected(device_present=False) | self.view.set_disconnected() | def property_status_value_change(self, model, old, new): if new == _('Initialising'): self.view.set_initialising(True) elif new == _('No device'): self.view.set_disconnected(device_present=False) elif new in [_('Registered'), _('Roaming')]: self.view.set_initialising(False) |
self['button2'].set_sensitive(sensitive) | self['voucher_button'].set_sensitive(sensitive) | def enable_send_button(self, sensitive): self['button2'].set_sensitive(sensitive) |
if song['file'] in pl: client.play(pl.index(song['file'])) | if(pl): idx = client.playlist().index(client.currentsong()['file']) client.addid(song['file'], idx+1) client.play(idx+1) | def playSong(key): client.connect(mpdHost, mpdPort) client.password(mpdPass) songs = songLookup[key] song = songs[random.randint(0, len(songs)-1)] pl = client.playlist() if song['file'] in pl: client.play(pl.index(song['file'])) else: client.add(song['file']) client.play(len(pl)) #length one higher now, with added... |
client.play(len(pl)) | client.play() | def playSong(key): client.connect(mpdHost, mpdPort) client.password(mpdPass) songs = songLookup[key] song = songs[random.randint(0, len(songs)-1)] pl = client.playlist() if song['file'] in pl: client.play(pl.index(song['file'])) else: client.add(song['file']) client.play(len(pl)) #length one higher now, with added... |
first_frame=df.nframes-1, num_frames=1) sch0 = schedule[0] | first_frame=df.nframes-1, num_frames=1)[0] | def playSong(key): client.connect(mpdHost, mpdPort) client.password(mpdPass) songs = songLookup[key] song = songs[random.randint(0, len(songs)-1)] pl = client.playlist() if song['file'] in pl: client.play(pl.index(song['file'])) else: client.add(song['file']) client.play(len(pl)) #length one higher now, with added... |
while lst > sch0[0]: try: sch0 = schedule.pop(0) except IndexError: print "Schedule out of commands! Do something! Forget about music!" sys.exit(1) print "Passed threshold", sch0[0], "<", lst, "for region", sch0[1] newsong = True if newsong: for region in songLookup.keys: if sch0[1].find(region) >= 0: print "New song!... | try: while lst > schedule[1][0]: schedule.pop(0) print "Passed threshold", schedule[0][0], "<", lst, \ "for region", schedule[0][1] newsong = True if newsong: for region in songLookup.iterkeys(): if schedule[0][1].find(region) >= 0: print "New song!", schedule[0][1], "matches", region playSong(region) break else: prin... | def playSong(key): client.connect(mpdHost, mpdPort) client.password(mpdPass) songs = songLookup[key] song = songs[random.randint(0, len(songs)-1)] pl = client.playlist() if song['file'] in pl: client.play(pl.index(song['file'])) else: client.add(song['file']) client.play(len(pl)) #length one higher now, with added... |
if(pl): idx = client.playlist().index(client.currentsong()['file']) | cur = client.currentsong() if(pl and cur): idx = client.playlist().index(cur['file']) | def playSong(key): client.connect(mpdHost, mpdPort) client.password(mpdPass) songs = songLookup[key] song = songs[random.randint(0, len(songs)-1)] pl = client.playlist() if(pl): idx = client.playlist().index(client.currentsong()['file']) client.addid(song['file'], idx+1) client.play(idx+1) #length one higher now, ... |
client.play() | client.play(len(pl)) | def playSong(key): client.connect(mpdHost, mpdPort) client.password(mpdPass) songs = songLookup[key] song = songs[random.randint(0, len(songs)-1)] pl = client.playlist() if(pl): idx = client.playlist().index(client.currentsong()['file']) client.addid(song['file'], idx+1) client.play(idx+1) #length one higher now, ... |
value = str(value) + ' ' + DateTime().localZone() | value = str(value) + ' +00:00' | def retrieveData(self): sfbc = getToolByName(self.context, 'portal_salesforcebaseconnector') sfa = self.getRelevantSFAdapter() if sfa is None: return {} sObjectType = sfa.getSFObjectType() econtext = getExprContext(sfa) econtext.setGlobal('sanitize_soql', sanitize_soql) updateMatchExpression = sfa.getUpdateMatchExpres... |
try: self.sse_supported.index (TARGET [2]) if check_cflags ("-mfpmath=sse", "CFLAGS"): add_config_h ("TUNE_SSE") except: pass | def startup (self): global CXXFLAGS, TARGET | |
cpu = platform.processor () if (not cpu) or (len (cpu) == 0): cpu = platform.machine () TARGET.append (cpu.replace ("-", "_")) | TARGET.append (platform.machine ()) | def detect_platform (): global HOST, TARGET, DEVNULL if sys.platform [:3] == "win": HOST = ["windows"] TARGET = ["windows"] DEVNULL = "nul" elif sys.platform [:6] == "darwin": HOST = ["mac"] TARGET = ["mac"] DEVNULL = "/dev/null" else: # Default to POSIX HOST = ["posix"] TARGET = ["posix"] DEVNULL = "/dev/null" arch ... |
if var == "CFLAGS": | if var.endswith ("CFLAGS"): | def check_cflags (cflags, var, xcflags = ""): """Check if compiler supports certain flags. This is done by creating a dummy source file and trying to compile it using the requested flags. :Parameters: `cflags` : str The compiler flags to check for `var` : str The name of the variable to append the flags to in the case... |
add_config_h ("HAVE_" + make_identifier (hdr)) | add_config_h ("HAVE_" + make_identifier (hdr.replace (".", "_"))) | def check_header (hdr, cflags = None, reqtext = None): """Check if a header file is available to the compiler. This is done by creating a dummy source file and trying to compile it. :Parameters: `hdr` : str The name of the header file to check for `reqtext` : str The message to print in the fatal error message when th... |
"gcc": lambda: compiler_gcc (), "msvc": lambda: compiler_msvc (), | "GCC": lambda: compiler_gcc (), "MSVC": lambda: compiler_msvc (), | def linklib (self, library, path = None): tmp = "" if path: tmp = "-libpath:" + path.replace ('/', '\\\\') + " " return tmp + ".lib ".join (library.split ()) + ".lib" |
global HOST, TARGET, EXE, TOOLKIT | global HOST, TARGET, EXE, TOOLKIT, COMPILER | def start (): global HOST, TARGET, EXE, TOOLKIT global PREFIX, BINDIR, LIBDIR, SYSCONFDIR, DATADIR, DOCDIR global INCLUDEDIR, LIBEXECDIR, SHAREDLIBS detect_platform () # Read environment variables first for e in ENVARS: globals () [e [0]] = os.getenv (e [0], e [1]) # Parse command-line skip_opt = False for optidx in... |
cpu = platform.processor ().replace ("-", "_") TARGET.append (cpu) | cpu = platform.processor () if (not cpu) or (len (cpu) == 0): cpu = platform.machine () TARGET.append (cpu.replace ("-", "_")) | def detect_platform (): global HOST, TARGET, DEVNULL if sys.platform [:3] == "win": HOST = ["windows"] TARGET = ["windows"] DEVNULL = "nul" elif sys.platform [:6] == "darwin": HOST = ["mac"] TARGET = ["mac"] DEVNULL = "/dev/null" else: # Default to POSIX HOST = ["posix"] TARGET = ["posix"] DEVNULL = "/dev/null" arch ... |
global CONFIG_H | global CONFIG_H, _CONFIG_H | def add_config_h (macro, val = "1"): global CONFIG_H macro = macro.strip () CONFIG_H [macro] = val.strip () _CONFIG_H.append (macro) |
global CONFIG_MAK | global CONFIG_MAK, _CONFIG_MAK | def add_config_mak (macro, val = "1"): global CONFIG_MAK macro = macro.strip () CONFIG_MAK [macro] = val.strip () _CONFIG_MAK.append (macro) |
line = fd.readline ().strip () | lines = fd.readlines () | def check_program (name, prog, ver_regex, req_version, failifnot = False): check_started ("Checking for " + name + " >= " + req_version) rc = False version = None try: fd = os.popen (prog + " 2>&1") line = fd.readline ().strip () fd.close () if VERBOSE: print "\n# '" + prog + "' returned '" + line + "'" m = re.match ... |
if VERBOSE: print "\n m = re.match (ver_regex, line) | for line in lines: line = line.strip () if VERBOSE: print "\n m = re.match (ver_regex, line) if m: version = m.group (1) if not compare_version (version, req_version): raise break | def check_program (name, prog, ver_regex, req_version, failifnot = False): check_started ("Checking for " + name + " >= " + req_version) rc = False version = None try: fd = os.popen (prog + " 2>&1") line = fd.readline ().strip () fd.close () if VERBOSE: print "\n# '" + prog + "' returned '" + line + "'" m = re.match ... |
raise version = m.group (1) if not compare_version (version, req_version): | def check_program (name, prog, ver_regex, req_version, failifnot = False): check_started ("Checking for " + name + " >= " + req_version) rc = False version = None try: fd = os.popen (prog + " 2>&1") line = fd.readline ().strip () fd.close () if VERBOSE: print "\n# '" + prog + "' returned '" + line + "'" m = re.match ... | |
update_file (outfile, content) | return update_file (outfile, content) | def substmacros (infile, outfile = None, macros = None): if not outfile: if infile.endswith (".in"): outfile = infile [:-3] else: abort_configure ( |
self._chunks = [] | def _read_member_header(self): """Fills self._chlen and self._chunks by the read header data. """ header = _read_gzip_header(self._fileobj) offset = self._fileobj.tell() if "RA" not in header["extra_field"]: raise IOError("Not an idzip file: %r" % self.name) | |
_read_member_header() | self._read_member_header() | def _readchunk(self, chunk_index): """Reads the specified chunk or throws EOFError. """ while chunk_index >= len(self._chunks): self._reach_member_end() _read_member_header() |
extra += deobj.decompress(self.fileobj.read(3)) | extra += deobj.decompress(self._fileobj.read(3)) | def _reach_member_end(self): """Seeks the _fileobj at the end of the last known member. """ offset, comp_len = self._chunks[-1] self._fileobj.seek(offset + comp_len) # The zlib stream could end with an empty block. deobj = zlib.decompressobj(-zlib.MAX_WBITS) extra = "" while deobj.unused_data == "" and not extra: extra... |
comp_lenghts_pos = _prepare_header(output, in_size, basename, mtime) | comp_lengths_pos = _prepare_header(output, in_size, basename, mtime) | def _compress_member(input, in_size, output, basename, mtime): comp_lenghts_pos = _prepare_header(output, in_size, basename, mtime) comp_lengths = _compress_data(input, in_size, output) end_pos = output.tell() output.seek(comp_lenghts_pos) for comp_len in comp_lengths: _write16(output, comp_len) output.seek(end_pos) ... |
output.seek(comp_lenghts_pos) | output.seek(comp_lengths_pos) | def _compress_member(input, in_size, output, basename, mtime): comp_lenghts_pos = _prepare_header(output, in_size, basename, mtime) comp_lengths = _compress_data(input, in_size, output) end_pos = output.tell() output.seek(comp_lenghts_pos) for comp_len in comp_lengths: _write16(output, comp_len) output.seek(end_pos) ... |
comp_lenghts_pos = _write_extra_fields(output, in_size) | comp_lengths_pos = _write_extra_fields(output, in_size) | def _prepare_header(output, in_size, basename, mtime): """Returns a prepared gzip header StringIO. The gzip header is defined in RFC 1952. """ output.write("\x1f\x8b\x08") # Gzip-deflate identification flags = FEXTRA if basename: flags |= FNAME output.write(chr(flags)) # The mtime will be undefined if it does not fit... |
return comp_lenghts_pos | return comp_lengths_pos | def _prepare_header(output, in_size, basename, mtime): """Returns a prepared gzip header StringIO. The gzip header is defined in RFC 1952. """ output.write("\x1f\x8b\x08") # Gzip-deflate identification flags = FEXTRA if basename: flags |= FNAME output.write(chr(flags)) # The mtime will be undefined if it does not fit... |
comp_lenghts_pos = output.tell() | comp_lengths_pos = output.tell() | def _write_extra_fields(output, in_size): """Writes the dictzip extra field. It will be initiated with zeros in chunk lengths. See man dictzip. """ num_chunks = in_size // CHUNK_LENGTH if in_size % CHUNK_LENGTH != 0: num_chunks += 1 field_length = 3*2 + 2 * num_chunks extra_length = 2*2 + field_length assert extra_len... |
return comp_lenghts_pos | return comp_lengths_pos | def _write_extra_fields(output, in_size): """Writes the dictzip extra field. It will be initiated with zeros in chunk lengths. See man dictzip. """ num_chunks = in_size // CHUNK_LENGTH if in_size % CHUNK_LENGTH != 0: num_chunks += 1 field_length = 3*2 + 2 * num_chunks extra_length = 2*2 + field_length assert extra_len... |
output = open(filename + ".gz", "wb") | output = open(filename + SUFFIX, "wb") | def main(): args = sys.argv[1:] if len(args) == 0: print >>sys.stderr, __doc__ sys.exit(1) for filename in args: input = open(filename, "rb") inputinfo = os.fstat(input.fileno()) basename = os.path.basename(filename) output = open(filename + ".gz", "wb") compressor.compress(input, inputinfo.st_size, output, basename,... |
self.cache_name = os.path.join(self._CondorDAGNode__job.cache_dir, "%s.cache" % self.get_name()) | self.cache_name = os.path.join(self.cache_dir, "%s.cache" % self.get_name()) self.add_var_opt("input-cache", self.cache_name) | def set_name(self, *args): pipeline.CondorDAGNode.set_name(self, *args) self.cache_name = os.path.join(self._CondorDAGNode__job.cache_dir, "%s.cache" % self.get_name()) |
for c in cache: filename = c.path() pipeline.CondorDAGNode.add_file_arg(self, filename) self.add_output_file(filename) | def add_input_cache(self, cache): if self.output_cache: raise AttributeError, "cannot change attributes after computing output cache" self.input_cache.extend(cache) for c in cache: filename = c.path() pipeline.CondorDAGNode.add_file_arg(self, filename) self.add_output_file(filename) | |
cache_entry.url = "file://localhost" + os.path.abspath(filename) | def set_output(self, description): if self.output_cache: raise AttributeError, "cannot change attributes after computing output cache" cache_entry = power.make_cache_entry(self.input_cache, description, "") filename = os.path.join(self.output_dir, "%s-STRING_LIKELIHOOD_%s-%d-%d.xml.gz" % (cache_entry.observatory, cache... | |
for arg in self.get_args(): if "--add-from-cache" in arg: f = file(self.cache_name, "w") for c in self.input_cache: print >>f, str(c) pipeline.CondorDAGNode.write_input_files(self, *args) break | f = file(self.cache_name, "w") for c in self.input_cache: print >>f, str(c) pipeline.CondorDAGNode.write_input_files(self, *args) | def write_input_files(self, *args): # oh. my. god. this is fscked. for arg in self.get_args(): if "--add-from-cache" in arg: f = file(self.cache_name, "w") for c in self.input_cache: print >>f, str(c) pipeline.CondorDAGNode.write_input_files(self, *args) break |
period = float(binjjob.get_opts()["time-step"]) / math.pi | period = float(binjjob.get_opts()["time-step"]) | def make_binj_fragment(dag, seg, tag, offset, flow = None, fhigh = None): # one injection every time-step / pi seconds period = float(binjjob.get_opts()["time-step"]) / math.pi # adjust start time to be commensurate with injection period start = seg[0] - seg[0] % period + period * offset node = BurstInjNode(binjjob) ... |
class InspiralAnalysisJob(pipeline.CondorDAGJob, pipeline.AnalysisJob): | class InspiralAnalysisJob(pipeline.AnalysisJob, pipeline.CondorDAGJob): | def __init__(self, args=None): self.args = args |
class InspiralAnalysisNode(pipeline.CondorDAGNode, pipeline.AnalysisNode): | class InspiralAnalysisNode(pipeline.AnalysisNode, pipeline.CondorDAGNode): | def __init__(self, cp, dax = False): """ @cp: a ConfigParser object from which the options are read. """ exec_name = 'inspinjfind' sections = ['inspinjfind'] extension = 'xml' InspiralAnalysisJob.__init__(self, cp, sections, exec_name, extension, dax) self.add_condor_cmd('getenv', 'True') # overwrite standard log file ... |
filename = "%s-STRING_LIKELIHOOD_%s-%d-%d.xml.gz" % (cache_entry.observatory, cache_entry.description, int(cache_entry.segment[0]), int(abs(cache_entry.segment))) | filename = os.path.join(self.output_dir, "%s-STRING_LIKELIHOOD_%s-%d-%d.xml.gz" % (cache_entry.observatory, cache_entry.description, int(cache_entry.segment[0]), int(abs(cache_entry.segment)))) | def set_output(self, description): if self.output_cache: raise AttributeError, "cannot change attributes after computing output cache" cache_entry = power.make_cache_entry(self.input_cache, description, "") filename = "%s-STRING_LIKELIHOOD_%s-%d-%d.xml.gz" % (cache_entry.observatory, cache_entry.description, int(cache_... |
self.triggers_dir = power.get_triggers_dir(config_parser) | self.output_dir = power.get_triggers_dir(config_parser) | def __init__(self,config_parser): """ config_parser = ConfigParser object from which options are read. """ pipeline.CondorDAGJob.__init__(self, power.get_universe(config_parser), power.get_executable(config_parser, "lalapps_StringSearch")) pipeline.AnalysisJob.__init__(self, config_parser) self.add_ini_opts(config_pars... |
self.triggers_dir = self.job().triggers_dir | self.output_dir = os.path.join(os.getcwd(), self.job().output_dir) | def __init__(self,job): """ job = A CondorDAGJob that can run an instance of lalapps_StringSearch. """ pipeline.CondorDAGNode.__init__(self,job) pipeline.AnalysisNode.__init__(self) self.__usertag = job.get_config('pipeline','user_tag') self.output_cache = [] self.triggers_dir = self.job().triggers_dir |
self.set_output(os.path.join(self.triggers_dir, "%s-STRINGSEARCH_%s-%d-%d.xml.gz" % (self.get_ifo(), self.__usertag, int(self.get_start()), int(self.get_end()) - int(self.get_start())))) | self.set_output(os.path.join(self.output_dir, "%s-STRINGSEARCH_%s-%d-%d.xml.gz" % (self.get_ifo(), self.__usertag, int(self.get_start()), int(self.get_end()) - int(self.get_start())))) | def get_output(self): """ Returns the file name of output from the ring code. This must be kept synchronized with the name of the output file in ring.c. """ if self._AnalysisNode__output is None: if None in (self.get_start(), self.get_end(), self.get_ifo(), self.__usertag): raise ValueError, "start time, end time, ifo,... |
hwInjNode.set_output_file(os.path.join(hw_inj_dir, outfilename)) | hwInjNode.set_output_file(outfilename) | def hwinj_page_setup(cp,ifos,veto_categories,hw_inj_dir): """ run ligolw_cbc_hardware injection page, soring the input and output in the subdirectory hardware_injection_summary """ hwInjNodes = [] hwinj_length = cp.getint("input","gps-end-time") - cp.getint("input","gps-start-time") hwInjJob = inspiral.HWinjPageJob(cp... |
self.set_stderr_file('logs/' + exec_namee + '-$(cluster)-$(process).err') | self.set_stderr_file('logs/' + exec_name + '-$(cluster)-$(process).err') | def __init__(self, cp, dax = False): """ cp: ConfigParser object from which options are read. """ exec_name = "mvsc_get_doubles" universe = "vanilla" executable = cp.get('condor',exec_name) pipeline.CondorDAGJob.__init__(self, universe, executable) pipeline.AnalysisJob.__init__(self, cp, dax) self.add_condor_cmd('geten... |
for i in range(number): | for i in range(self.number): | def finalize(self): """ finalize the mvsc_get_doubles node """ self.add_var_opt("instruments", self.instruments) self.add_var_opt("trainingstr", self.trainingstr) self.add_var_opt("testingstr", self.testingstr) self.add_var_opt("zerolagstr", self.zerolagstr) for database in self.databases: self.add_file_arg(database) i... |
self.set_stderr_file('logs/' + exec_namee + '-$(cluster)-$(process).err') | self.set_stderr_file('logs/' + exec_name + '-$(cluster)-$(process).err') | def __init__(self, cp, dax = False): """ cp: ConfigParser object from which options are read. """ exec_name = "mvsc_train_forest" universe = "vanilla" executable = cp.get('condor',exec_name) pipeline.CondorDAGJob.__init__(self, universe, executable) pipeline.AnalysisJob.__init__(self, cp, dax) self.add_condor_cmd('gete... |
self.set_stderr_file('logs/' + exec_namee + '-$(cluster)-$(process).err') | self.set_stderr_file('logs/' + exec_name + '-$(cluster)-$(process).err') | def __init__(self, cp, dax = False): |
self.add_file_arg("-A -a 1 %s %s %s" % (self.trainedforest, self.file_to_rank, self.ranked_file)) | self.add_file_arg("-A -a 4 %s %s %s" % (self.trainedforest, self.file_to_rank, self.ranked_file)) | def finalize(self): """ finalize the MvscUseForestNode """ self.ranked_file = self.file_to_rank.replace('.pat','.dat') self.add_file_arg("-A -a 1 %s %s %s" % (self.trainedforest, self.file_to_rank, self.ranked_file)) self.add_output_file(self.ranked_file) |
class MvscUpdateSqlJob(pipeline.CondorDAGJob): | class MvscUpdateSqlJob(pipeline.AnalysisJob, pipeline.CondorDAGJob): | def finalize(self): """ finalize the MvscUseForestNode """ self.ranked_file = self.file_to_rank.replace('.pat','.dat') self.add_file_arg("-A -a 1 %s %s %s" % (self.trainedforest, self.file_to_rank, self.ranked_file)) self.add_output_file(self.ranked_file) |
self.set_stderr_file('logs/' + exec_namee + '-$(cluster)-$(process).err') | self.set_stderr_file('logs/' + exec_name + '-$(cluster)-$(process).err') | def __init__(self, cp, dax = False): """ cp: ConfigParser object from which options are read. """ exec_name = "mvsc_update_sql" universe = "vanilla" executable = cp.get('condor',exec_name) pipeline.CondorDAGJob.__init__(self, universe, executable) pipeline.AnalysisJob.__init__(self, cp, dax) self.add_condor_cmd('getenv... |
class MvscUpdateSqlNode(pipeline.CondorDAGNode): | class MvscUpdateSqlNode(pipeline.AnalysisNode, pipeline.CondorDAGNode): | def __init__(self, cp, dax = False): """ cp: ConfigParser object from which options are read. """ exec_name = "mvsc_update_sql" universe = "vanilla" executable = cp.get('condor',exec_name) pipeline.CondorDAGJob.__init__(self, universe, executable) pipeline.AnalysisJob.__init__(self, cp, dax) self.add_condor_cmd('getenv... |
if (int(seg[0]) - seg[0]) / seg[0] > 1e-15 or (int(seg[1]) - seg[1]) / seg[1] > 1e-15: | if abs((int(seg[0]) - seg[0]) / seg[0]) > 1e-14 or abs((int(seg[1]) - seg[1]) / seg[1]) > 1e-14: | def clip_segment(seg, pad, short_segment_duration): # clip segment to the length required by lalapps_StringSearch. if # # duration = segment length - padding # # then # # duration / short_segment_duration - 0.5 # # must be an odd integer, therefore # # 2 * duration + short_segment_duration # # must be divisble b... |
libraries=['boost_python-mt'] | libraries=['boost_python'] | def pkgconfig(*packages, **kw): import commands flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split(): kw.setdefault(flag_map.get(token[:2]), []).append(token[2:]) return kw |
posidx=find(wt>maxwt+log(randoms)) | posidx=[i for i in range(0,size(weights)) if wt[i]>maxwt+log(randoms[i]) ] | def nest2pos(samps,weights): randoms=rand(size(samps,0)) wt=weights+samps[:,-1] maxwt=max(wt) posidx=find(wt>maxwt+log(randoms)) pos=samps[posidx,:] return pos |
hipeJob.set_pegasus_exec_dir(os.path.join( local_exec_dir, '/'.join(os.getcwd().split('/')[-2:]))) | def test_and_add_hipe_arg(hipeCommand, hipe_arg): if config.has_option("hipe-arguments",hipe_arg): hipeCommand += "--" + hipe_arg + " " + \ config.get("hipe-arguments",hipe_arg) return(hipeCommand) | |
hipeJob.set_pegasus_exec_dir(os.path.join( local_exec_dir, '/'.join(os.getcwd().split('/')[-2:]), usertag)) | def test_and_add_hipe_arg(hipeCommand, hipe_arg): if config.has_option("hipe-arguments",hipe_arg): hipeCommand += "--" + hipe_arg + " " + \ config.get("hipe-arguments",hipe_arg) return(hipeCommand) | |
plotcp.set("pipeline","bank-suffix",bankSuffix) | def plot_setup(plotDir, config, logPath, stage, injectionSuffix, zerolagSuffix, slideSuffix, bankSuffix, cacheFile, injdirType, tag = None, ifos = None, cat = 3): """ run lalapps_plot_hipe and add job to dag plotDir = directory in which to run inspiral hipe config = config file logPath = location where log files... | |
def set_glob(self, file_glob): """ Sets the glob name """ self.add_var_opt('glob',file_glob) def set_input(self, input_file): """ Sets the input file name """ self.add_var_opt('input',input_file) | def get_ifo_tag(self): """ Returns the IFO tag string """ return self.__ifo_tag | |
self.daq = nds.daq(self.host, self.port) | self.daq = nds.daq(host, port) | def __init__(self, host, port): self.daq = nds.daq(self.host, self.port) self.channels = self.daq.recv_channel_list() self.channelLeaves, self.channelTree = make_channel_tree(self.channels) self.rates = tuple(sorted(set(int(c.rate) for c in self.channels))) self.channel_types = tuple(c for c in nds.channel_type.values.... |
stdin, out, err = os.popen3(command) pid, status = os.wait() if status != 0: | p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=isinstance(command, str)) out, err = p.communicate() if p.returncode != 0: | def make_external_call(command, show_stdout=False, show_command=False): """ Run a program on the shell and print informative messages on failure. """ if show_command: print command stdin, out, err = os.popen3(command) pid, status = os.wait() if status != 0: print >>sys.stderr, "External call failed." print >>sys.stde... |
print >>sys.stderr, " status: %d" % status print >>sys.stderr, " stdout: %s" % out.read() print >>sys.stderr, " stderr: %s" % err.read() print >>sys.stderr, " command: %s" % command sys.exit(status) | print >>sys.stderr, " stdout: %s" % out print >>sys.stderr, " stderr: %s" % err raise subprocess.CalledProcessError(p.returncode, command) | def make_external_call(command, show_stdout=False, show_command=False): """ Run a program on the shell and print informative messages on failure. """ if show_command: print command stdin, out, err = os.popen3(command) pid, status = os.wait() if status != 0: print >>sys.stderr, "External call failed." print >>sys.stde... |
print out.read() stdin.close() out.close() err.close() | print out | def make_external_call(command, show_stdout=False, show_command=False): """ Run a program on the shell and print informative messages on failure. """ if show_command: print command stdin, out, err = os.popen3(command) pid, status = os.wait() if status != 0: print >>sys.stderr, "External call failed." print >>sys.stde... |
self.set_stdout_file(os.path.join(get_out_dir(config_parser), "lalapps_binj-$(macrochannelname)-$(macrogpsstarttime)-$(macrogpsendtime)-$(cluster)-$(process).out")) self.set_stderr_file(os.path.join(get_out_dir(config_parser), "lalapps_binj-$(macrochannelname)-$(macrogpsstarttime)-$(macrogpsendtime)-$(cluster)-$(proces... | self.set_stdout_file(os.path.join(get_out_dir(config_parser), "lalapps_binj-$(macrogpsstarttime)-$(macrogpsendtime)-$(cluster)-$(process).out")) self.set_stderr_file(os.path.join(get_out_dir(config_parser), "lalapps_binj-$(macrogpsstarttime)-$(macrogpsendtime)-$(cluster)-$(process).err")) | def __init__(self, config_parser): """ config_parser = ConfigParser object """ pipeline.CondorDAGJob.__init__(self, get_universe(config_parser), get_executable(config_parser, "lalapps_binj")) pipeline.AnalysisJob.__init__(self, config_parser) |
lladdjob = pipeline.LigolwAddJob(get_out_dir(config_parser), config_parser) | lladdjob = pipeline.LigolwAddJob(os.path.join(get_out_dir(config_parser)), config_parser) | def init_job_types(config_parser, job_types = ("datafind", "rm", "binj", "power", "lladd", "binjfind", "bucluster", "bucut", "burca", "burca2", "sqlite", "burcatailor")): """ Construct definitions of the submit files. """ global datafindjob, rmjob, binjjob, powerjob, lladdjob, binjfindjob, buclusterjob, llb2mjob, bucut... |
for cache_entry, parent in input_cache[:binjfindjob.files_per_binjfind]: | for parent in set(parent for cache_entry, parent in input_cache[:binjfindjob.files_per_binjfind]): | def make_binjfind_fragment(dag, parents, tag, verbose = False): input_cache = collect_output_caches(parents) nodes = set() while input_cache: node = BinjfindNode(binjfindjob) node.add_input_cache([cache_entry for (cache_entry, parent) in input_cache[:binjfindjob.files_per_binjfind]]) for cache_entry, parent in input_ca... |
for cache_entry, parent in input_cache[:buclusterjob.files_per_bucluster]: | for parent in set(parent for cache_entry, parent in input_cache[:buclusterjob.files_per_bucluster]): | def make_bucluster_fragment(dag, parents, tag, verbose = False): input_cache = collect_output_caches(parents) nodes = set() while input_cache: node = BuclusterNode(buclusterjob) node.add_input_cache([cache_entry for (cache_entry, parent) in input_cache[:buclusterjob.files_per_bucluster]]) for cache_entry, parent in inp... |
for cache_entry, parent in input_cache[:bucutjob.files_per_bucut]: | for parent in set(parent for cache_entry, parent in input_cache[:bucutjob.files_per_bucut]): | def make_bucut_fragment(dag, parents, tag, verbose = False): input_cache = collect_output_caches(parents) nodes = set() while input_cache: node = BucutNode(bucutjob) node.add_input_cache([cache_entry for (cache_entry, parent) in input_cache[:bucutjob.files_per_bucut]]) for cache_entry, parent in input_cache[:bucutjob.f... |
for cache_entry, parent in input_cache[:burcajob.files_per_burca]: | for parent in set(parent for cache_entry, parent in input_cache[:burcajob.files_per_burca]): | def make_burca_fragment(dag, parents, tag, coincidence_segments = None, verbose = False): input_cache = collect_output_caches(parents) if coincidence_segments is not None: # doesn't sense to supply this keyword argument for # more than one input file assert len(input_cache) == 1 nodes = set() while input_cache: node = ... |
self.add_var_opt('eventnum',str(event)) | self.add_var_arg('--eventnum '+str(event)) | def set_event_number(self,event): """ Set the event number in the injection XML. """ if event is not None: self.__event=int(event) self.add_var_opt('eventnum',str(event)) |
def init_job_types(config_parser, job_types = ("string", "meas_likelihoodjob", "calc_likelihood")): | runsqlitejob = None def init_job_types(config_parser, job_types = ("string", "meas_likelihoodjob", "calc_likelihood", "runsqlite")): | def compute_segment_lists(seglists, offset_vectors, min_segment_length, pad): # don't modify original seglists = seglists.copy() # ignore offset vectors referencing instruments we don't have offset_vectors = [offset_vector for offset_vector in offset_vectors if set(offset_vector.keys()).issubset(set(seglists.keys()))]... |
global stringjob, meas_likelihoodjob, calc_likelihoodjob | global stringjob, meas_likelihoodjob, calc_likelihoodjob, runsqlitejob | def init_job_types(config_parser, job_types = ("string", "meas_likelihoodjob", "calc_likelihood")): """ Construct definitions of the submit files. """ global stringjob, meas_likelihoodjob, calc_likelihoodjob # lalapps_StringSearch if "string" in job_types: stringjob = StringJob(config_parser) # lalapps_string_meas_li... |
this_input_cache = input_cache[:files_per_meas_likelihood] | node.add_input_cache([cache_entry for cache_entry, parent in input_cache[:files_per_meas_likelihood]]) for parent in set(parent for cache_entry, parent in input_cache[:files_per_meas_likelihood]): node.add_parent(parent) | def make_meas_likelihood_fragment(dag, parents, tag, files_per_meas_likelihood = None): if files_per_meas_likelihood is None: files_per_meas_likelihood = meas_likelihoodjob.files_per_meas_likelihood nodes = set() input_cache = power.collect_output_caches(parents) while input_cache: node = MeasLikelihoodNode(meas_likeli... |
for cache_entry, parent in this_input_cache: node.add_input_cache([cache_entry]) node.add_parent(parent) | def make_meas_likelihood_fragment(dag, parents, tag, files_per_meas_likelihood = None): if files_per_meas_likelihood is None: files_per_meas_likelihood = meas_likelihoodjob.files_per_meas_likelihood nodes = set() input_cache = power.collect_output_caches(parents) while input_cache: node = MeasLikelihoodNode(meas_likeli... | |
self.add_opt("use-expected-loudest-event",'') | self.add_var_opt("use-expected-loudest-event",'') | def __init__(self, job, database, output_cache = None, output_tag = "SEARCH_VOLUME", bootstrap_iterations=10000, veto_segments_name="vetoes", use_expected_loudest_event = False): """ @database: the pipedown database containing the injection triggers @ouptut_cache: name prefix for cache file to be written out by program... |
inspiral_hipe_file = open(hipe_cache(ifos, usertag, \ hipecp.getint("input", "gps-start-time"), \ hipecp.getint("input", "gps-end-time")), "a") symlinkedCache.tofile(inspiral_hipe_file) inspiral_hipe_file.close() | def test_and_add_hipe_arg(hipeCommand, hipe_arg): if config.has_option("hipe-arguments",hipe_arg): hipeCommand += "--" + hipe_arg + " " + \ config.get("hipe-arguments",hipe_arg) return(hipeCommand) | |
def get_input_from_cache(self, cache): """ Retrieves """ self.add_var_arg(filename) | def get_input_from_cache(self, cache): """ Retrieves """ self.add_var_arg(filename) | |
self.__sim_type = None | self.__sim_tag = None | def __init__(self, job): """ @job: a PrintLCJob """ pipeline.SqliteNode.__init__(self, job) self.__extract_to_xml = None self.__extract_to_database = None self.__exclude_coincs = None self.__include_only_coincs = None self.__sim_type = None self.__output_format = None self.__columns = None |
def __init__(self, *args): pipeline.LigolwAddNode.__init__(self, *args) | def __init__(self, job, remove_input, *args): pipeline.LigolwAddNode.__init__(self, job, *args) | def __init__(self, *args): pipeline.LigolwAddNode.__init__(self, *args) self.input_cache = [] self.output_cache = [] self.cache_dir = os.path.join(os.getcwd(), self.job().cache_dir) |
for c in cache: self.add_var_arg("--remove-input-except %s" % c.path()) | if self.remove_input: for c in cache: self.add_var_arg("--remove-input-except %s" % c.path()) | def add_preserve_cache(self, cache): for c in cache: self.add_var_arg("--remove-input-except %s" % c.path()) |
def make_lladd_fragment(dag, parents, tag, segment = None, input_cache = None, preserve_cache = None, extra_input_cache = None): node = LigolwAddNode(lladdjob) | def make_lladd_fragment(dag, parents, tag, segment = None, input_cache = None, remove_input = False, preserve_cache = None, extra_input_cache = None): node = LigolwAddNode(lladdjob, remove_input = remove_input) | def make_lladd_fragment(dag, parents, tag, segment = None, input_cache = None, preserve_cache = None, extra_input_cache = None): node = LigolwAddNode(lladdjob) # link to parents for parent in parents: node.add_parent(parent) # build input cache if input_cache is None: # default is to use all output files from parents... |
return make_lladd_fragment(dag, nodes, tag) | return make_lladd_fragment(dag, nodes, tag, remove_input = True) | def make_multibinj_fragment(dag, seg, tag): flow = float(powerjob.get_opts()["low-freq-cutoff"]) fhigh = flow + float(powerjob.get_opts()["bandwidth"]) nodes = make_binj_fragment(dag, seg, tag, 0.0, flow, fhigh) return make_lladd_fragment(dag, nodes, tag) |
infile = '%s/%s.in' % (src_dir, basename) | infile = '%s.in' % basename | def generate_git_version_info(): # info object info = git_info() git_path = check_call_out(('which', 'git')) # determine basic info about the commit # %H -- full git hash id # %ct -- commit time # %an, %ae -- author name, email # %cn, %ce -- committer name, email git_id, git_udate, git_author_name, git_author_email, ... |
oldVal=None | def __init__(self,cp,block_id,dagDir,channel=''): self.dagDirectory=dagDir self.__executable = cp.get('condor','clustertool') self.__universe= cp .get('condor','clustertool_universe') pipeline.CondorDAGJob.__init__(self,self.__universe,self.__executable) pipeline.AnalysisJob.__init__(self,cp) self.add_condor_cmd('geten... | |
for sec in ['candidatethreshold']: self.add_ini_opts(cp,sec) | oldValList.append((optionText,oldVal)) for sec in ['candidatethreshold']: self.add_ini_opts(cp,sec) for myOpt,oldVal in oldValList: | def __init__(self,cp,block_id,dagDir,channel=''): self.dagDirectory=dagDir self.__executable = cp.get('condor','clustertool') self.__universe= cp .get('condor','clustertool_universe') pipeline.CondorDAGJob.__init__(self,self.__universe,self.__executable) pipeline.AnalysisJob.__init__(self,cp) self.add_condor_cmd('geten... |
cp.set('candidatethreshold',optionText,oldVal) | cp.set('candidatethreshold',myOpt,oldVal) | def __init__(self,cp,block_id,dagDir,channel=''): self.dagDirectory=dagDir self.__executable = cp.get('condor','clustertool') self.__universe= cp .get('condor','clustertool_universe') pipeline.CondorDAGJob.__init__(self,self.__universe,self.__executable) pipeline.AnalysisJob.__init__(self,cp) self.add_condor_cmd('geten... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.