rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
return re.sub(r"([+-]?[.0-9]+)[Ee]?([+-]?[0-9]+)", r"\1 \\times 10^{\2}", s)
m, e = floatpattern.match(s).groups() return r"%s \\times 10^{%d}" % (m, int(e))
def latexnumber(s): """ Convert a string of the form "d.dddde-dd" to "d.dddd \times 10^{-dd}" """ return re.sub(r"([+-]?[.0-9]+)[Ee]?([+-]?[0-9]+)", r"\1 \\times 10^{\2}", s)
93839b38b5d5fee5d9941f59939032deb6c48ec7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/93839b38b5d5fee5d9941f59939032deb6c48ec7/SnglBurstUtils.py
s = numpy.real(s)
s = numpy.real(s)
def IMRpeakAmp(m1,m2,spin1z,spin2z,d): """ IMRpeakAmp finds the peak amplitude of the waveform for a given source parameters and the source distance. usage: IMRpeakAmp(m1,m2,spin1z,spin2z,distance) e.g. spawaveApp.IMRpeakAmp(30,40,0.45,0.5,100) """ chi = spawaveform.computechi(m1, m2, spin1z, spin2z) imrfFinal = spa...
0bdd962ae73f315890b6347b4ef9f25b152c7cb9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/0bdd962ae73f315890b6347b4ef9f25b152c7cb9/spawaveApp.py
mcmcfilelist += node.outputName'
mcmcfilelist += node.outputName
def __init__(self,job,coinc,cp,opts,dag,ifo,ifonames,p_nodes): pipeline.CondorDAGNode.__init__(self,job)
05035e645679043fd1ca6facde81b57b17155a95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/05035e645679043fd1ca6facde81b57b17155a95/stfu_pipe.py
cp.set("fu-condor","mcmc", self.which("lalapps_spinspiral"))
cp.set("fu-condor","spinmcmc", self.which("lalapps_spinspiral"))
def __init__(self, configfile=None): cp = ConfigParser.ConfigParser() self.cp = cp self.time_now = "_".join([str(i) for i in time_method.gmtime()[0:6]]) self.ini_file=self.time_now + ".ini" home_base = home_dirs() # CONDOR SECTION NEEDED BY THINGS IN INSPIRAL.PY cp.add_section("condor") cp.set("condor","datafind",self...
05035e645679043fd1ca6facde81b57b17155a95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/05035e645679043fd1ca6facde81b57b17155a95/stfu_pipe.py
cp.set("makeCheckListWiki","ini-file",self.ini_file)
cp.set("makeCheckListWiki","ini-file",os.path.abspath(self.ini_file))
def __init__(self, configfile=None): cp = ConfigParser.ConfigParser() self.cp = cp self.time_now = "_".join([str(i) for i in time_method.gmtime()[0:6]]) self.ini_file=self.time_now + ".ini" home_base = home_dirs() # CONDOR SECTION NEEDED BY THINGS IN INSPIRAL.PY cp.add_section("condor") cp.set("condor","datafind",self...
7af3808c8bded294da5949d5d10b9e4ea18c1bb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/7af3808c8bded294da5949d5d10b9e4ea18c1bb5/stfu_pipe.py
if trigger.chisq_h1 < 4 or trigger.chisq_l < 4:
if trigger.chisq_h1 < 4 or trigger.chisq_v < 4:
def get_signal_vetoes(trigger,bankq=0,bankn=0,autoq=0,auton=0,chiq=0,chin=0,sigmaVals = None,fResp = None): sbvs = {} q = bankq nhigh = bankn q2 = autoq nhigh2 = auton if trigger.chisq == 0: sbvs['BestNR1'] = 0 else: if trigger.chisq < 60: sbvs['BestNR1'] = trigger.snr else: sbvs['BestNR1'] = trigger.snr/((1 + (trigge...
f5cea0acc9eb8c5f98e8d26075ddaef489f7a6c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f5cea0acc9eb8c5f98e8d26075ddaef489f7a6c8/coh_PTF_pyutils.py
df = float((event1.central_freq + 0.5*event1.bandwidth - event2.central_freq - 0.5*event2.bandwidth)/(event1.central_freq + 0.5*event1.bandwidth + event2.central_freq + 0.5*event2.bandwidth))
f_cut1 = event1.central_freq + event1.bandwidth / 2 f_cut2 = event2.central_freq + event2.bandwidth / 2 df = float((f_cut1 - f_cut2) / (f_cut1 + f_cut2))
def coinc_params_func(events, offsetvector): # # check for coincs that have been vetoed entirely # if len(events) < 2: return None params = {} # # zero-instrument parameters # params["nevents"] = (len(events),) # # one-instrument parameters # for event in events: prefix = "%s_" % event.ifo params["%ssnr2_chi2" %...
25a3dc1b78a704666ce9f482a744565f842bfa06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/25a3dc1b78a704666ce9f482a744565f842bfa06/stringutils.py
"nevents": rate.tophat_window(1)
"nevents": rate.tophat_window(1)
def dt_binning(instrument1, instrument2): dt = 0.005 + inject.light_travel_time(instrument1, instrument2) # seconds return rate.NDBins((rate.ATanBins(-dt, +dt, 3001),))
25a3dc1b78a704666ce9f482a744565f842bfa06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/25a3dc1b78a704666ce9f482a744565f842bfa06/stringutils.py
def get_coincparamsdistributions(xmldoc):
def get_coincparamsdistributions(xmldoc, seglists = None):
def get_coincparamsdistributions(xmldoc): coincparamsdistributions, process_id = ligolw_burca_tailor.coinc_params_distributions_from_xml(xmldoc, u"string_cusp_likelihood") return coincparamsdistributions
25a3dc1b78a704666ce9f482a744565f842bfa06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/25a3dc1b78a704666ce9f482a744565f842bfa06/stringutils.py
def load_likelihood_data(filenames, verbose = False):
def load_likelihood_data(filenames, seglists = None, verbose = False):
def load_likelihood_data(filenames, verbose = False): coincparamsdistributions = None for n, filename in enumerate(filenames): if verbose: print >>sys.stderr, "%d/%d:" % (n + 1, len(filenames)), xmldoc = utils.load_filename(filename, gz = (filename or "stdin").endswith(".gz"), verbose = verbose) if coincparamsdistribut...
25a3dc1b78a704666ce9f482a744565f842bfa06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/25a3dc1b78a704666ce9f482a744565f842bfa06/stringutils.py
coincparamsdistributions = get_coincparamsdistributions(xmldoc)
coincparamsdistributions = get_coincparamsdistributions(xmldoc, seglists = seglists)
def load_likelihood_data(filenames, verbose = False): coincparamsdistributions = None for n, filename in enumerate(filenames): if verbose: print >>sys.stderr, "%d/%d:" % (n + 1, len(filenames)), xmldoc = utils.load_filename(filename, gz = (filename or "stdin").endswith(".gz"), verbose = verbose) if coincparamsdistribut...
25a3dc1b78a704666ce9f482a744565f842bfa06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/25a3dc1b78a704666ce9f482a744565f842bfa06/stringutils.py
coincparamsdistributions += get_coincparamsdistributions(xmldoc)
coincparamsdistributions += get_coincparamsdistributions(xmldoc, seglists = seglists)
def load_likelihood_data(filenames, verbose = False): coincparamsdistributions = None for n, filename in enumerate(filenames): if verbose: print >>sys.stderr, "%d/%d:" % (n + 1, len(filenames)), xmldoc = utils.load_filename(filename, gz = (filename or "stdin").endswith(".gz"), verbose = verbose) if coincparamsdistribut...
25a3dc1b78a704666ce9f482a744565f842bfa06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/25a3dc1b78a704666ce9f482a744565f842bfa06/stringutils.py
pipeline.CondorDAGJob.__init__(self,self.__universe,self.__executable) self.setupJob(name=self.name,dir=dir,cp=cp,tag_base=tag_base)
self.setupJob(name=self.name,dir=dir,cp=cp,tag_base=tag_base)
def __init__(self,opts,cp,dir='',tag_base=''): """ """ self.__executable = string.strip(cp.get('fu-condor','plotmcmc')) self.name = os.path.split(self.__executable.rstrip('/'))[1] self.__universe = "vanilla"
a627dfaff8b63ff5e2852047ce0b8646f5e6b641 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/a627dfaff8b63ff5e2852047ce0b8646f5e6b641/stfu_pipe.py
os.path.join("bin", "search_volume_by_s1_s2"),
def run(self): # remove the automatically generated user env scripts for script in ["pylal-user-env.sh", "pylal-user-env.csh"]: log.info("removing " + script ) try: os.unlink(os.path.join("etc", script)) except: pass
a019c4b0522ce86d589cf0f39840014d0379a330 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/a019c4b0522ce86d589cf0f39840014d0379a330/setup.py
self.FAR = -1
self.FAR = 99
def __init__(self): """ here are all the things we need """ #start with data needed for every coinc self.ifo_list = [] self.ifo_coincs = [] self.snr = {} self.gps = {} self.eff_distances = {} self.mass1 = {} self.mass2 = {} self.time = None self.FAR = -1 #this stuff is only needed for injections self.is_injection = ...
be8cfcd82a5a5e331d1d030f7034863d70f64728 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/be8cfcd82a5a5e331d1d030f7034863d70f64728/skylocutils.py
if ctab[0].false_alarm_rate is not None: coinc.set_FAR(ctab[0].false_alarm_rate)
def get_coincs_from_coinctable(self,files): """ read data from coinc tables (xml format) FIXME: currently assumes one coinc per file!!! """ for file in files: coinc = CoincData() xmldoc = utils.load_filename(file) sngltab = tab.get_table(xmldoc,lsctables.SnglInspiralTable.tableName) coinc.set_snr(dict((row.ifo, row.sn...
be8cfcd82a5a5e331d1d030f7034863d70f64728 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/be8cfcd82a5a5e331d1d030f7034863d70f64728/skylocutils.py
coincTrigs = CoincInspiralUtils.coincInspiralTable(inspTrigs,'snr')
statistic = CoincInspiralUtils.coincStatistic('snr',None,None) coincTrigs = CoincInspiralUtils.coincInspiralTable(inspTrigs,statistic)
def get_coincs_from_coire(self,files): """ uses CoincInspiralUtils to get data from old-style (coire'd) coincs """ coincTrigs = CoincInspiralUtils.coincInspiralTable() inspTrigs = SnglInspiralUtils.ReadSnglInspiralFromFiles(files, \ mangle_event_id = True,verbose=None) #note that it's hardcoded to use snr as the statis...
c5476ebb03d5348cf59eefbc3035b78574a7d926 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/c5476ebb03d5348cf59eefbc3035b78574a7d926/skylocutils.py
self.FAR = -1
self.FAR = 99
def __init__(self): """ here are all the things we need """ #start with data needed for every coinc self.ifo_list = [] self.ifo_coincs = [] self.snr = {} self.gps = {} self.eff_distances = {} self.mass1 = {} self.mass2 = {} self.time = None self.FAR = -1 #this stuff is only needed for injections self.is_injection = ...
3d55d0a3b24296f7f520395dda89285057339f7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/3d55d0a3b24296f7f520395dda89285057339f7d/skylocutils.py
def __init__(self): """ here are all the things we need """ #start with data needed for every coinc self.ifo_list = [] self.ifo_coincs = [] self.snr = {} self.gps = {} self.eff_distances = {} self.mass1 = {} self.mass2 = {} self.time = None self.FAR = -1 #this stuff is only needed for injections self.is_injection = ...
3d55d0a3b24296f7f520395dda89285057339f7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/3d55d0a3b24296f7f520395dda89285057339f7d/skylocutils.py
if ctab[0].false_alarm_rate is not None: coinc.set_FAR(ctab[0].false_alarm_rate)
def get_coincs_from_coinctable(self,files): """ read data from coinc tables (xml format) FIXME: currently assumes one coinc per file!!! """ for file in files: coinc = CoincData() xmldoc = utils.load_filename(file) sngltab = tab.get_table(xmldoc,lsctables.SnglInspiralTable.tableName) coinc.set_snr(dict((row.ifo, row.sn...
3d55d0a3b24296f7f520395dda89285057339f7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/3d55d0a3b24296f7f520395dda89285057339f7d/skylocutils.py
cacheSelected = cacheSelected.sieve(segment=segments.segment(math.floor(float(time)), math.ceil(float(time))))
if math.floor(float(time)) != math.ceil(float(time)): cacheSelected = cacheSelected.sieve(segment=segments.segment(math.floor(float(time)), math.ceil(float(time)))) else: cacheSelected = cacheSelected.sieve(segment=segments.segment(math.floor(float(time))-0.5, math.floor(float(time))+0.5))
def getParamsFromCache(fileName,type,ifo=None,time=None): qscanList = [] cacheList = lal.Cache.fromfile(open(fileName)) if not cacheList: return qscanList cacheSelected = cacheList.sieve(description=type,ifos=ifo) if time: cacheSelected = cacheSelected.sieve(segment=segments.segment(math.floor(float(time)), math.ceil(f...
a027ce38aaf2bc2df88aed587618ceb49cd6b1cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/a027ce38aaf2bc2df88aed587618ceb49cd6b1cb/stfu_pipe.py
if re.search( table_name+r'[.]', table_param ) is None:
if table_param.find( table_name+'.' ) == -1:
def __init__( self, table_name, table_param, param_ranges_opt, verbose = False ): """ Parse --param-ranges option. Creates self.param which is the table_name and the table_param appended together (with a '.') and self.param_ranges, which is a list of tuples that give the lower parameter value, whether it is an open or ...
aa613f9ca1679aa7fff3f9cfa9b4bb9989c85fd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/aa613f9ca1679aa7fff3f9cfa9b4bb9989c85fd7/ligolw_sqlutils.py
def __init__(self, xmldoc, b_b_def, sb_b_def, si_b_def, sb_c_e_def, sb_c_n_def, si_c_e_def, si_c_n_def, process):
def __init__(self, xmldoc, b_b_def, sb_b_def, si_b_def, sb_c_e_def, sb_c_n_def, si_c_e_def, si_c_n_def, process, livetime_program):
def __init__(self, xmldoc, b_b_def, sb_b_def, si_b_def, sb_c_e_def, sb_c_n_def, si_c_e_def, si_c_n_def, process): # # store the process row #
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
self.burst_peak_time_window = 6.378140e6 / 299792458 * 1.25 if len(self.snglbursttable): self.burst_peak_time_window += max(self.snglbursttable.getColumnByName("duration")) self.coinc_peak_time_window = self.burst_peak_time_window + SimBurstUtils.burst_is_near_injection_window def bursts_near_pe...
def bursts_near_peaktime(self, t, window):
def __init__(self, xmldoc, b_b_def, sb_b_def, si_b_def, sb_c_e_def, sb_c_n_def, si_c_e_def, si_c_n_def, process): # # store the process row #
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
within self.burst_peak_time_window of t.
within window seconds of t. This is not used to define any coincidences, only to provide a short list of burst events for use in more costly comparison tests.
def bursts_near_peaktime(self, t): """ Return a list of the burst events whose peak times are within self.burst_peak_time_window of t. """ return self.snglbursttable[bisect.bisect_left(self.snglbursttable, t - self.burst_peak_time_window):bisect.bisect_right(self.snglbursttable, t + self.burst_peak_time_window)]
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
return self.snglbursttable[bisect.bisect_left(self.snglbursttable, t - self.burst_peak_time_window):bisect.bisect_right(self.snglbursttable, t + self.burst_peak_time_window)] def coincs_near_peaktime(self, t):
return self.snglbursttable[bisect.bisect_left(self.snglbursttable, t - window):bisect.bisect_right(self.snglbursttable, t + window)] def coincs_near_peaktime(self, t, window):
def bursts_near_peaktime(self, t): """ Return a list of the burst events whose peak times are within self.burst_peak_time_window of t. """ return self.snglbursttable[bisect.bisect_left(self.snglbursttable, t - self.burst_peak_time_window):bisect.bisect_right(self.snglbursttable, t + self.burst_peak_time_window)]
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
which at least one burst event's peak time is within self.coinc_peak_time_window of t.
which at least one burst event's peak time is within window seconds of t. This is not used to define any coincidences, only to provide a short list of coinc events for use in more costly comparison tests.
def coincs_near_peaktime(self, t): """ Return a list of the (coinc_event_id, event list) tuples in which at least one burst event's peak time is within self.coinc_peak_time_window of t. """ # FIXME: this test does not consider the time slide # offsets that should be applied to the coinc, but for now # injections are d...
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
return [(coinc_event_id, events) for coinc_event_id, events in self.coincs if (t - self.coinc_peak_time_window <= events[-1].get_peak()) and (events[0].get_peak() <= t + self.coinc_peak_time_window)]
near_events = set(self.bursts_near_peaktime(t, window)) return [(coinc_event_id, events) for coinc_event_id, events in self.coincs if set(events) & near_events]
def coincs_near_peaktime(self, t): """ Return a list of the (coinc_event_id, event list) tuples in which at least one burst event's peak time is within self.coinc_peak_time_window of t. """ # FIXME: this test does not consider the time slide # offsets that should be applied to the coinc, but for now # injections are d...
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
Return False if the peak time of the injection sim lies within the time interval of burst. """ return SimBurstUtils.time_at_instrument(sim, burst.ifo) not in burst.get_period()
Return False (injection matches event) if an autocorrelation-width window centred on the injection is continuous with the time interval of the burst. """ tinj = SimBurstUtils.time_at_instrument(sim, burst.ifo) window = SimBurstUtils.stringcusp_autocorrelation_width / 2 return segments.segment(tinj - window, tinj + wind...
def StringCuspSnglCompare(sim, burst): """ Return False if the peak time of the injection sim lies within the time interval of burst. """ return SimBurstUtils.time_at_instrument(sim, burst.ifo) not in burst.get_period()
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
Return False if the peak time and centre frequency of sim lie within the time-frequency tile of burst. """ return StringCuspSnglCompare(sim, burst) or (sim.frequency not in burst.get_band())
Return False (injection matches event) if the peak time and centre frequency of sim lie within the time-frequency tile of burst. """ return (SimBurstUtils.time_at_instrument(sim, burst.ifo) not in burst.get_period()) or (sim.frequency not in burst.get_band())
def ExcessPowerSnglCompare(sim, burst): """ Return False if the peak time and centre frequency of sim lie within the time-frequency tile of burst. """ return StringCuspSnglCompare(sim, burst) or (sim.frequency not in burst.get_band())
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
Return False if the peak time and centre frequency of sim lie within the time-frequency tile of burst.
Return False (injection matches event) if the time of the sim and the peak time of the burst event differ by less than or equal to delta_t seconds.
def OmegaSnglCompare(sim, burst, delta_t = 10.0): """ Return False if the peak time and centre frequency of sim lie within the time-frequency tile of burst. """ return abs(float(SimBurstUtils.time_at_instrument(sim, burst.ifo) - burst.get_peak())) > delta_t
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
Return False if the peak time of the sim is "near" the burst event. """ return OmegaNearCoincCompare(sim, burst)
Return False (injection matches coinc) if the peak time of the sim is "near" the burst event. """ tinj = SimBurstUtils.time_at_instrument(sim, burst.ifo) window = SimBurstUtils.stringcusp_autocorrelation_width / 2 + SimBurstUtils.burst_is_near_injection_window return segments.segment(tinj - window, tinj + window).disjo...
def StringCuspNearCoincCompare(sim, burst): """ Return False if the peak time of the sim is "near" the burst event. """ return OmegaNearCoincCompare(sim, burst)
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
Return False if the peak time of the sim is "near" the burst event.
Return False (injection matches coinc) if the peak time of the sim is "near" the burst event.
def ExcessPowerNearCoincCompare(sim, burst): """ Return False if the peak time of the sim is "near" the burst event. """ return not SimBurstUtils.burst_is_near_injection(sim, burst.start_time, burst.start_time_ns, burst.duration, burst.ifo)
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
Return False if the peak time of the sim is "near" the burst event. """ start_time = burst.get_peak() - burst.duration / 2.0 return not SimBurstUtils.burst_is_near_injection(sim, start_time.seconds, start_time.nanoseconds, burst.duration, burst.ifo)
Return False (injection matches coinc) if the peak time of the sim is "near" the burst event. """ return OmegaSnglCompare(sim, burst, delta_t = 20.0 + burst.duration / 2)
def OmegaNearCoincCompare(sim, burst): """ Return False if the peak time of the sim is "near" the burst event. """ start_time = burst.get_peak() - burst.duration / 2.0 return not SimBurstUtils.burst_is_near_injection(sim, start_time.seconds, start_time.nanoseconds, burst.duration, burst.ifo)
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
def find_sngl_burst_matches(contents, sim, comparefunc): """ Scan the burst table for triggers matching sim. """ return [burst for burst in contents.bursts_near_peaktime(sim.get_time_geocent()) if not comparefunc(sim, burst)]
def find_sngl_burst_matches(contents, sim, comparefunc, sieve_window): """ Scan the burst table for triggers matching sim. sieve_window is used in a bisection search to quickly identify burst events within that many seconds of the injection's peak time at the geocentre; it should be larger than the greatest time diffe...
def find_sngl_burst_matches(contents, sim, comparefunc): """ Scan the burst table for triggers matching sim. """ return [burst for burst in contents.bursts_near_peaktime(sim.get_time_geocent()) if not comparefunc(sim, burst)]
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
def find_exact_coinc_matches(coincs, sim, comparefunc):
def find_exact_coinc_matches(coincs, sim, comparefunc, seglists):
def find_exact_coinc_matches(coincs, sim, comparefunc): """ Return a list of the coinc_event_ids of the burst<-->burst coincs in which all burst events match sim. """ # FIXME: this test does not consider the time slide offsets that # should be applied to the coinc, but for now injections are done # at zero lag so this...
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
in which all burst events match sim.
in which all burst events match sim and to which all instruments on at the time of the sim contributed events.
def find_exact_coinc_matches(coincs, sim, comparefunc): """ Return a list of the coinc_event_ids of the burst<-->burst coincs in which all burst events match sim. """ # FIXME: this test does not consider the time slide offsets that # should be applied to the coinc, but for now injections are done # at zero lag so this...
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
return [coinc_event_id for coinc_event_id, events in coincs if True not in (bool(comparefunc(sim, event)) for event in events)]
on_instruments = SimBurstUtils.on_instruments(sim, seglists) return set(coinc_event_id for coinc_event_id, events in coincs if on_instruments.issubset(set(event.ifo for event in events)) and not any(comparefunc(sim, event) for event in events))
def find_exact_coinc_matches(coincs, sim, comparefunc): """ Return a list of the coinc_event_ids of the burst<-->burst coincs in which all burst events match sim. """ # FIXME: this test does not consider the time slide offsets that # should be applied to the coinc, but for now injections are done # at zero lag so this...
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
return [coinc_event_id for coinc_event_id, events in coincs if False in (bool(comparefunc(sim, event)) for event in events)]
return set(coinc_event_id for coinc_event_id, events in coincs if not all(comparefunc(sim, event) for event in events))
def find_near_coinc_matches(coincs, sim, comparefunc): """ Return a list of the coinc_event_ids of the burst<-->burst coincs in which at least one burst event matches sim. """ # FIXME: this test does not consider the time slide offsets that # should be applied to the coinc, but for now injections are done # at zero la...
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
process = process
process = process, livetime_program = { "StringCusp": "StringSearch", "excesspower": "lalapps_power", "omega": None }[search]
si_c_n_def = si_c_n_def,
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
events = find_sngl_burst_matches(contents, sim, snglcomparefunc)
events = find_sngl_burst_matches(contents, sim, snglcomparefunc, burst_peak_time_window)
si_c_n_def = si_c_n_def,
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
coincs = contents.coincs_near_peaktime(sim.get_time_geocent()) coinc_event_ids = find_exact_coinc_matches(coincs, sim, snglcomparefunc) if coinc_event_ids: add_sim_coinc_coinc(contents, sim, coinc_event_ids, contents.sb_c_e_coinc_def_id) coinc_event_ids = find_near_coinc_matches(coincs, sim, nearcoinccomparefunc) if co...
coincs = contents.coincs_near_peaktime(sim.get_time_geocent(), coinc_peak_time_window) exact_coinc_event_ids = find_exact_coinc_matches(coincs, sim, snglcomparefunc, contents.seglists) near_coinc_event_ids = find_near_coinc_matches(coincs, sim, nearcoinccomparefunc) assert exact_coinc_event_ids.issubset(near_coinc_even...
si_c_n_def = si_c_n_def,
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
events = find_sngl_burst_matches(contents, sim, snglcomparefunc)
events = find_sngl_burst_matches(contents, sim, snglcomparefunc, burst_peak_time_window)
si_c_n_def = si_c_n_def,
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
coincs = contents.coincs_near_peaktime(sim.get_time_geocent()) coinc_event_ids = find_exact_coinc_matches(coincs, sim, snglcomparefunc) if coinc_event_ids: add_sim_coinc_coinc(contents, sim, coinc_event_ids, contents.si_c_e_coinc_def_id) coinc_event_ids = find_near_coinc_matches(coincs, sim, nearcoinccomparefunc) if co...
coincs = contents.coincs_near_peaktime(sim.get_time_geocent(), coinc_peak_time_window) exact_coinc_event_ids = find_exact_coinc_matches(coincs, sim, snglcomparefunc, contents.seglists) near_coinc_event_ids = find_near_coinc_matches(coincs, sim, nearcoinccomparefunc) assert exact_coinc_event_ids.issubset(near_coinc_even...
si_c_n_def = si_c_n_def,
f23162e4f63afbd6a2032de2d75ca44643717584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/f23162e4f63afbd6a2032de2d75ca44643717584/ligolw_binjfind.py
(self.coint.type,sngl.ifo,sngl.ifo,timeString)
(self.coinc.type,sngl.ifo,sngl.ifo,timeString)
def get_analyzeQscan_RDS(self): """ """ #analyseQscan.py_FG_RDS_full_data/H1-analyseQscan_H1_931176926_116_rds-unspecified-gpstime.cache cacheList=list() cacheFiles=list() for sngl in self.coinc.sngls: timeString=str(float(sngl.time)).replace(".","_") myCacheMask="*%s*/%s-analyseQscan_%s_%s_rds*.cache"%\ (self.coint.ty...
8f5bc08aa7c5a9ce674e08a28ead83d83999609d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/8f5bc08aa7c5a9ce674e08a28ead83d83999609d/makeCheckListWiki.py
sys.stdout.write("Found: %s\n",publication_directory)
sys.stdout.write("Found: %s\n" %(publication_directory))
def __init__(self,type=None,ifo=None,time=None,snr=None,chisqr=None,mass1=None,mass2=None,mchirp=None): """ """ self.type=str(type) self.ifo=str(ifo) self.time=float(time) self.snr=float(snr) self.chisqr=float(chisqr) self.mass1=float(mass1) self.mass2=float(mass2) self.mchirp=float(mchirp)
8f5bc08aa7c5a9ce674e08a28ead83d83999609d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/8f5bc08aa7c5a9ce674e08a28ead83d83999609d/makeCheckListWiki.py
sys.stdout.write("Found: %s\n",publication_url)
sys.stdout.write("Found: %s\n" %(publication_url))
def __init__(self,type=None,ifo=None,time=None,snr=None,chisqr=None,mass1=None,mass2=None,mchirp=None): """ """ self.type=str(type) self.ifo=str(ifo) self.time=float(time) self.snr=float(snr) self.chisqr=float(chisqr) self.mass1=float(mass1) self.mass2=float(mass2) self.mchirp=float(mchirp)
8f5bc08aa7c5a9ce674e08a28ead83d83999609d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/8f5bc08aa7c5a9ce674e08a28ead83d83999609d/makeCheckListWiki.py
coincTrigs = CoincInspiralUtils.coincInspiralTable(inspTriggers,'snr')
coincTrigs = CoincInspiralUtils.coincInspiralTable(inspTrigs,'snr')
def get_coincs_from_coire(self,files): """ uses CoincInspiralUtils to get data from old-style (coire'd) coincs """ coincTrigs = CoincInspiralUtils.coincInspiralTable() inspTrigs = SnglInspiralUtils.ReadSnglInspiralFromFiles(files, \ mangle_event_id = True,verbose=None) #note that it's hardcoded to use snr as the statis...
dc0d302d6255c3e1457b8ee8961a5c8535491853 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/dc0d302d6255c3e1457b8ee8961a5c8535491853/skylocutils.py
def now(): return datetime.now()
da66d430c0acc35d155af13f1e3e3c04f787efd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1844/da66d430c0acc35d155af13f1e3e3c04f787efd7/fu.py
global JAVA_TYPE_MAP JAVA_TYPE_MAP = {
global JAVA_PRIMITIVE_TYPE_MAP JAVA_PRIMITIVE_TYPE_MAP = {
def updateTypeMaps(namespace): """ Updates the type maps with a new namespace. **Must** be executed at least once, **before** node class file generation. """ global JAVA_TYPE_MAP JAVA_TYPE_MAP = { # Base types namespace + 'boolean': 'Boolean', namespace + 'dateTime': 'String', namespace + 'string': 'String', namespace ...
da66d430c0acc35d155af13f1e3e3c04f787efd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1844/da66d430c0acc35d155af13f1e3e3c04f787efd7/fu.py
'NamingConvention': 'String', 'PercentFraction': 'Double', 'MIMEtype': 'String', 'Leader': 'Experimenter', 'Contact': 'Experimenter', 'Pump': 'Laser',
def updateTypeMaps(namespace): """ Updates the type maps with a new namespace. **Must** be executed at least once, **before** node class file generation. """ global JAVA_TYPE_MAP JAVA_TYPE_MAP = { # Base types namespace + 'boolean': 'Boolean', namespace + 'dateTime': 'String', namespace + 'string': 'String', namespace ...
da66d430c0acc35d155af13f1e3e3c04f787efd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1844/da66d430c0acc35d155af13f1e3e3c04f787efd7/fu.py
global JAVA_TYPE_MAP JAVA_TYPE_MAP = copy.deepcopy(JAVA_PRIMITIVE_TYPE_MAP) JAVA_TYPE_MAP['NamingConvention'] = 'String' JAVA_TYPE_MAP['PercentFraction'] = 'Double' JAVA_TYPE_MAP['MIMEtype'] = 'String' JAVA_TYPE_MAP['Leader'] = 'Experimenter' JAVA_TYPE_MAP['Contact'] = 'Experimenter' JAVA_TYPE_MAP['Pump'] = 'Laser'
def updateTypeMaps(namespace): """ Updates the type maps with a new namespace. **Must** be executed at least once, **before** node class file generation. """ global JAVA_TYPE_MAP JAVA_TYPE_MAP = { # Base types namespace + 'boolean': 'Boolean', namespace + 'dateTime': 'String', namespace + 'string': 'String', namespace ...
da66d430c0acc35d155af13f1e3e3c04f787efd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1844/da66d430c0acc35d155af13f1e3e3c04f787efd7/fu.py
return javaType
if not self.isPrimitive and not self.isEnumeration: return "String" return self.javaType
def _get_metadataStoreType(self): # FIXME: No more node #javaType = self.javaType #if javaType[-4:] == "Node": # return "String" return javaType
da66d430c0acc35d155af13f1e3e3c04f787efd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1844/da66d430c0acc35d155af13f1e3e3c04f787efd7/fu.py
doc="""The property's MetadataStore type.""")
doc="""The property's MetadataStore type.""")
def _get_metadataStoreType(self): # FIXME: No more node #javaType = self.javaType #if javaType[-4:] == "Node": # return "String" return javaType
da66d430c0acc35d155af13f1e3e3c04f787efd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1844/da66d430c0acc35d155af13f1e3e3c04f787efd7/fu.py
if o is not None and o.base == "Reference": return True
if o is not None: return o.isReference
def _get_isReference(self): o = self.model.getObjectByName(self.type) if o is not None and o.base == "Reference": return True return False
da66d430c0acc35d155af13f1e3e3c04f787efd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1844/da66d430c0acc35d155af13f1e3e3c04f787efd7/fu.py
BACK_REFERENCE_OVERRIDE = {'Screen': ['Plate'], 'Plate': ['Screen']}
BACK_REFERENCE_OVERRIDE = {'Screen': ['Plate'], 'Plate': ['Screen'], 'Annotation': ['Annotation']}
def now(): return datetime.now()
33ca668f1e2bc211408916409f5987902b983f32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1844/33ca668f1e2bc211408916409f5987902b983f32/fu.py
namespace + 'positiveInteger': 'PositiveInteger', namespace + 'nonNegativeInteger': 'NonNegativeInteger',
'PositiveInt': 'PositiveInteger', 'NonNegativeInt': 'NonNegativeInteger', 'PositiveLong': 'PositiveLong', 'NonNegativeLong': 'NonNegativeLong',
def updateTypeMaps(namespace): """ Updates the type maps with a new namespace. **Must** be executed at least once, **before** node class file generation. """ global JAVA_PRIMITIVE_TYPE_MAP JAVA_PRIMITIVE_TYPE_MAP = { namespace + 'boolean': 'Boolean', namespace + 'dateTime': 'String', namespace + 'string': 'String', nam...
33ca668f1e2bc211408916409f5987902b983f32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1844/33ca668f1e2bc211408916409f5987902b983f32/fu.py
return JAVA_TYPE_MAP[self.type]
return JAVA_TYPE_MAP[self.type.replace('OME:', '')]
def _get_javaType(self): try: # Hand back the type of enumerations if self.isEnumeration: javaType = self.name if len(self.delegate.values) == 0: # As we have no directly defined possible values we have # no reason to qualify our type explicitly. return self.type if javaType == "Type": # One of the OME XML unspecific "...
33ca668f1e2bc211408916409f5987902b983f32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1844/33ca668f1e2bc211408916409f5987902b983f32/fu.py
CODEPOINTS = {\n\
def print_header(): print "\
bf2a87a44b2d474baa7044c77e6ae38d4822dc2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10700/bf2a87a44b2d474baa7044c77e6ae38d4822dc2a/unihan_kconv.py
print "],\nu'x%s':["%code[0],
if firsttime: firsttime = False print "CODEPOINTS = { \nu'x%s':["%code[0], else: print "],\nu'x%s':["%code[0],
def process_readings(): oucode = 0 olcode = 0 for line in open(source,'r'): items = line[:-1].split('\t') try: r = re.match(r'kKorea', items[1]) if r is not None: code = re.sub(r'U\+([0-9A-F]{2})([0-9A-F]{2})',r'\1\t\2',items[0]).split('\t') ucode = int(code[0],16) lcode = int(code[1],16) pron = items[2].split(' ')[0]...
bf2a87a44b2d474baa7044c77e6ae38d4822dc2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10700/bf2a87a44b2d474baa7044c77e6ae38d4822dc2a/unihan_kconv.py
print '"[?]",',
print "'',",
def process_readings(): oucode = 0 olcode = 0 for line in open(source,'r'): items = line[:-1].split('\t') try: r = re.match(r'kKorea', items[1]) if r is not None: code = re.sub(r'U\+([0-9A-F]{2})([0-9A-F]{2})',r'\1\t\2',items[0]).split('\t') ucode = int(code[0],16) lcode = int(code[1],16) pron = items[2].split(' ')[0]...
bf2a87a44b2d474baa7044c77e6ae38d4822dc2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10700/bf2a87a44b2d474baa7044c77e6ae38d4822dc2a/unihan_kconv.py
print '"'+pron+'",',
print "'"+pron+"',",
def process_readings(): oucode = 0 olcode = 0 for line in open(source,'r'): items = line[:-1].split('\t') try: r = re.match(r'kKorea', items[1]) if r is not None: code = re.sub(r'U\+([0-9A-F]{2})([0-9A-F]{2})',r'\1\t\2',items[0]).split('\t') ucode = int(code[0],16) lcode = int(code[1],16) pron = items[2].split(' ')[0]...
bf2a87a44b2d474baa7044c77e6ae38d4822dc2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10700/bf2a87a44b2d474baa7044c77e6ae38d4822dc2a/unihan_kconv.py
self.kakasi = CDLL("libkakasi")
self.kakasi = CDLL("\\kakasi\\lib\\kakasi")
def __init__(self): self.codepoints = CODEPOINTS self.codepoints.update(JACODES)
181f9235e3fa3ea58e938b9ceb91268e1baa7126 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10700/181f9235e3fa3ea58e938b9ceb91268e1baa7126/jadecoder.py
self.kakasi = CDLL("libkakasi.so")
self.kakasi = CDLL("libkakasi.so")
def __init__(self): self.codepoints = CODEPOINTS self.codepoints.update(JACODES)
181f9235e3fa3ea58e938b9ceb91268e1baa7126 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10700/181f9235e3fa3ea58e938b9ceb91268e1baa7126/jadecoder.py
pmap = { ord(u'â'):'a',ord(u'à'):'a',ord(u'ắ'):'a',ord(u'ă'):'a',ord(u'ấ'):'a', ord(u'ü'):'u',ord(u'ụ'):'u',ord(u'ú'):'u',ord(u'ử'):'u',ord(u'ư'):'u', ord(u'ù'):'u', ord(u'é'):'e', ord(u'ọ'):'o',ord(u'ố'):'o',ord(u'ộ'):'o',ord(u'ơ'):'o',ord(u'ớ'):'o', ord(u'ớ'):'o', } r1 = re.compile(r'U\+([0-9A-F]{2})([0-9A-F]{2}\...
def process_readings(self, source, fout): oucode = 0
9145b8e82b3e4a975e637a96d80862a186515a18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10700/9145b8e82b3e4a975e637a96d80862a186515a18/unihan_conv.py
code = re.sub(r'U\+([0-9A-F]{2})([0-9A-F]{2}\b)',r'\1\t\2',items[0]).split('\t')
code = r1.sub(r'\1\t\2',items[0]).split('\t')
def process_readings(self, source, fout): oucode = 0
9145b8e82b3e4a975e637a96d80862a186515a18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10700/9145b8e82b3e4a975e637a96d80862a186515a18/unihan_conv.py
pron = items[2].split(' ')[0].capitalize() if not all(ord(c) < 128 for c in pron): pron = re.sub('[^\x00-\x7f]',lambda x: self.pmap[ord(x)], pron)
ptmp = items[2].split(' ')[0].capitalize() pron = re.sub('[^\00-\x7f]', lambda x: pmap[ord(x.group())], ptmp)
def process_readings(self, source, fout): oucode = 0
9145b8e82b3e4a975e637a96d80862a186515a18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10700/9145b8e82b3e4a975e637a96d80862a186515a18/unihan_conv.py
self.gen_map(fout, oucode)
self.gen_map(fout, oucode)
def process_readings(self, source, fout): oucode = 0
9145b8e82b3e4a975e637a96d80862a186515a18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10700/9145b8e82b3e4a975e637a96d80862a186515a18/unihan_conv.py
if obtained != valid:
if not expected_result(obtained, valid):
def expand (file, entry, type = -1):
a5b45471485c35b80cfe0668a4fec1a12a72538b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14180/a5b45471485c35b80cfe0668a4fec1a12a72538b/testsuite.py
if obtained != valid:
if not expected_result(obtained, valid):
def expand (file, entry):
a5b45471485c35b80cfe0668a4fec1a12a72538b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14180/a5b45471485c35b80cfe0668a4fec1a12a72538b/testsuite.py
from ipdb import set_trace; set_trace() debug(title)
def main_upload(arguments): """Upload video to Youtube.""" usage = """Usage: %prog [OPTIONS] EMAIL PASSWORD FILE TITLE DESCRIPTION CATEGORY KEYWORDS Upload a video to youtube spliting it if necessary (uses ffmpeg).""" parser = optparse.OptionParser(usage, version=VERSION) parser.add_option('-c', '--get-categories', de...
9a1ca1cfb5fe15c213d33feb4a0065af9208d38d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9246/9a1ca1cfb5fe15c213d33feb4a0065af9208d38d/youtube_upload.py
password = (sys.stdin.read().strip() if password0 == "-" else password0)
password = (sys.stdin.readline().strip() if password0 == "-" else password0)
def main_upload(arguments): """Upload video to Youtube.""" usage = """Usage: %prog [OPTIONS] EMAIL PASSWORD FILE TITLE DESCRIPTION CATEGORY KEYWORDS Upload a video to youtube spliting it if necessary (uses ffmpeg).""" parser = optparse.OptionParser(usage, version=VERSION) parser.add_option('-c', '--get-categories', de...
e1560097324ccb81eeddb0650e1658d6b1cc6efb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9246/e1560097324ccb81eeddb0650e1658d6b1cc6efb/youtube_upload.py
sys.stderr.write("--- " + str(obj) + "\n")
string = str(obj.encode(get_encoding()) if isinstance(obj, unicode) else obj) sys.stderr.write("--- " + string + "\n") def get_encoding(): return sys.stdout.encoding or locale.getpreferredencoding()
def debug(obj): """Write obj to standard error.""" sys.stderr.write("--- " + str(obj) + "\n")
9999034b88a09fe278589e25fccf30ffe5f276ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9246/9999034b88a09fe278589e25fccf30ffe5f276ac/youtube_upload.py
encoding = sys.stdout.encoding or locale.getpreferredencoding()
encoding = get_encoding()
def main_upload(arguments): """Upload video to Youtube.""" usage = """Usage: %prog [OPTIONS] EMAIL PASSWORD FILE TITLE DESCRIPTION CATEGORY KEYWORDS Upload a video to youtube spliting it if necessary (uses ffmpeg).""" parser = optparse.OptionParser(usage, version=VERSION) parser.add_option('-c', '--get-categories', de...
9999034b88a09fe278589e25fccf30ffe5f276ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9246/9999034b88a09fe278589e25fccf30ffe5f276ac/youtube_upload.py
debug("kwargs = %s" % kwargs)
def main_upload(arguments): """Upload video to Youtube.""" usage = """Usage: %prog [OPTIONS] EMAIL PASSWORD FILE TITLE DESCRIPTION CATEGORY KEYWORDS Upload a video to youtube spliting it if necessary (uses ffmpeg).""" parser = optparse.OptionParser(usage, version=VERSION) parser.add_option('-c', '--get-categories', de...
9999034b88a09fe278589e25fccf30ffe5f276ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9246/9999034b88a09fe278589e25fccf30ffe5f276ac/youtube_upload.py
if (os.path.exists(os.path.join(root_dir, ".git")) or os.path.exists(os.path.join(root_dir, ".hg"))): prefix = os.path.commonprefix([root_dir, project_dir]) return fullname[len(prefix) + 1:]
if (os.path.exists(os.path.join(root_dir, ".git")) or os.path.exists(os.path.join(root_dir, ".hg"))): prefix = os.path.commonprefix([root_dir, project_dir]) return fullname[len(prefix) + 1:]
def RepositoryName(self): """FullName after removing the local path to the repository.
df58397e6f4ed5d2740b06fa5118dfc9cb92f2ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8431/df58397e6f4ed5d2740b06fa5118dfc9cb92f2ef/cpplint.py
def RepositoryName(self): """FullName after removing the local path to the repository.
e8777217774ca1c50e978c3fbecd3a9aa3cbb882 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8431/e8777217774ca1c50e978c3fbecd3a9aa3cbb882/cpplint.py
not os.path.exists(os.path.join(root_dir, ".git"))):
not os.path.exists(os.path.join(root_dir, ".git")) and not os.path.exists(os.path.join(root_dir, ".hg"))):
def RepositoryName(self): """FullName after removing the local path to the repository.
e8777217774ca1c50e978c3fbecd3a9aa3cbb882 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8431/e8777217774ca1c50e978c3fbecd3a9aa3cbb882/cpplint.py
if os.path.exists(os.path.join(root_dir, ".git")):
if (os.path.exists(os.path.join(root_dir, ".git")) or os.path.exists(os.path.join(root_dir, ".hg"))):
def RepositoryName(self): """FullName after removing the local path to the repository.
e8777217774ca1c50e978c3fbecd3a9aa3cbb882 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8431/e8777217774ca1c50e978c3fbecd3a9aa3cbb882/cpplint.py
def id (about, host):
def id(about, host):
def id (about, host): # this might turn into a cache that gets dumped to file and # supports more than two fixed hosts in time. cache = IDS_MAIN if host == FLUIDDB_PATH else IDS_SAND return cache[about]
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
http = Http (timeout=timeout)
http = Http(timeout=timeout)
def _get_http(timeout): try: http = Http (timeout=timeout) except TypeError: # The user's version of http2lib is old. Omit the timeout. http = Http () return http
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
http = Http ()
http = Http()
def _get_http(timeout): try: http = Http (timeout=timeout) except TypeError: # The user's version of http2lib is old. Omit the timeout. http = Http () return http
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
url = host + urllib.quote (path)
url = host + urllib.quote(path)
def _get_url(host, path, hash, kw): url = host + urllib.quote (path) if hash: url = '%s?%s' % (url, urllib.urlencode (hash)) elif kw: url = '%s?%s' % (url, urllib.urlencode (kw)) return url
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
url = '%s?%s' % (url, urllib.urlencode (hash))
url = '%s?%s' % (url, urllib.urlencode(hash))
def _get_url(host, path, hash, kw): url = host + urllib.quote (path) if hash: url = '%s?%s' % (url, urllib.urlencode (hash)) elif kw: url = '%s?%s' % (url, urllib.urlencode (kw)) return url
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
url = '%s?%s' % (url, urllib.urlencode (kw))
url = '%s?%s' % (url, urllib.urlencode(kw))
def _get_url(host, path, hash, kw): url = host + urllib.quote (path) if hash: url = '%s?%s' % (url, urllib.urlencode (hash)) elif kw: url = '%s?%s' % (url, urllib.urlencode (kw)) return url
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
def __init__ (self, hash):
def __init__(self, hash):
def __init__ (self, hash): for k in hash: self.__dict__[k] = hash[k]
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
def __str__ (self): keys = self.__dict__.keys () keys.sort () return '\n'.join (['%20s: %s' % (key, str (self.__dict__[key]))
def __str__(self): keys = self.__dict__.keys() keys.sort() return '\n'.join(['%20s: %s' % (key, str(self.__dict__[key]))
def __str__ (self): keys = self.__dict__.keys () keys.sort () return '\n'.join (['%20s: %s' % (key, str (self.__dict__[key])) for key in keys])
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
def __init__ (self, name, value=None):
def __init__(self, name, value=None):
def __init__ (self, name, value=None): self.name = name self.value = value
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
def __str__ (self):
def __str__(self):
def __str__ (self): return ('Tag "%s", value "%s" of type %s' % (self.name, str (self.value), str (type (self.value))))
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
% (self.name, str (self.value), str (type (self.value))))
% (self.name, str(self.value), str(type(self.value))))
def __str__ (self): return ('Tag "%s", value "%s" of type %s' % (self.name, str (self.value), str (type (self.value))))
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
def __init__ (self, username=None, password=None, id=None, filename=None):
def __init__(self, username=None, password=None, id=None, filename=None):
def __init__ (self, username=None, password=None, id=None, filename=None): if username: self.username = username self.password = password else: if filename == None: filename = get_credentials_file () if os.path.exists (filename): try: f = open (filename) lines = f.readlines () self.username = lines[0].strip () self.pas...
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
filename = get_credentials_file () if os.path.exists (filename):
filename = get_credentials_file() if os.path.exists(filename):
def __init__ (self, username=None, password=None, id=None, filename=None): if username: self.username = username self.password = password else: if filename == None: filename = get_credentials_file () if os.path.exists (filename): try: f = open (filename) lines = f.readlines () self.username = lines[0].strip () self.pas...
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
f = open (filename) lines = f.readlines () self.username = lines[0].strip () self.password = lines[1].strip () f.close ()
f = open(filename) lines = f.readlines() self.username = lines[0].strip() self.password = lines[1].strip() f.close()
def __init__ (self, username=None, password=None, id=None, filename=None): if username: self.username = username self.password = password else: if filename == None: filename = get_credentials_file () if os.path.exists (filename): try: f = open (filename) lines = f.readlines () self.username = lines[0].strip () self.pas...
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
' credentials from %s.' % str (filename))
' credentials from %s.' % str(filename))
def __init__ (self, username=None, password=None, id=None, filename=None): if username: self.username = username self.password = password else: if filename == None: filename = get_credentials_file () if os.path.exists (filename): try: f = open (filename) lines = f.readlines () self.username = lines[0].strip () self.pas...
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
'read credentials from %s.' % str (filename))
'read credentials from %s.' % str(filename))
def __init__ (self, username=None, password=None, id=None, filename=None): if username: self.username = username self.password = password else: if filename == None: filename = get_credentials_file () if os.path.exists (filename): try: f = open (filename) lines = f.readlines () self.username = lines[0].strip () self.pas...
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
def __init__ (self, credentials=None, host=None, debug=False):
def __init__(self, credentials=None, host=None, debug=False):
def __init__ (self, credentials=None, host=None, debug=False): if credentials == None: credentials = Credentials () self.credentials = credentials if host is None: host = choose_host() self.host = host self.debug = debug self.timeout = choose_http_timeout() if not host.startswith ('http'): self.host = 'http://%s' % hos...
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
credentials = Credentials ()
credentials = Credentials()
def __init__ (self, credentials=None, host=None, debug=False): if credentials == None: credentials = Credentials () self.credentials = credentials if host is None: host = choose_host() self.host = host self.debug = debug self.timeout = choose_http_timeout() if not host.startswith ('http'): self.host = 'http://%s' % hos...
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
if not host.startswith ('http'):
if not host.startswith('http'):
def __init__ (self, credentials=None, host=None, debug=False): if credentials == None: credentials = Credentials () self.credentials = credentials if host is None: host = choose_host() self.host = host self.debug = debug self.timeout = choose_http_timeout() if not host.startswith ('http'): self.host = 'http://%s' % hos...
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
auth = 'Basic %s' % userpass.encode ('base64').strip()
auth = 'Basic %s' % userpass.encode('base64').strip()
def __init__ (self, credentials=None, host=None, debug=False): if credentials == None: credentials = Credentials () self.credentials = credentials if host is None: host = choose_host() self.host = host self.debug = debug self.timeout = choose_http_timeout() if not host.startswith ('http'): self.host = 'http://%s' % hos...
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py
def set_connection_from_global (self):
def set_connection_from_global(self):
def set_connection_from_global (self): """Sets the host on the basis of the global variable flags, if that exists. Used to enable the tests to run against alternate hosts.""" self.host = choose_host () self.debug = choose_debug_mode () self.timeout = choose_http_timeout ()
e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py