rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
i = self.childNodes.index(refchild) | for i, childNode in enumerate(self.childNodes): if childNode is oldchild: break else: raise ValueError, oldchild | def replaceChild(self, newchild, oldchild): """ Replace an existing node with a new node. It must be the case that oldchild is a child of this node; if not, ValueError is raised. newchild is returned. """ i = self.childNodes.index(refchild) self.childNodes[i].parentNode = None self.childNodes[i] = newchild newchild.par... |
l += [self] | l.append(self) | def getElements(self, filter): """ Return a list of elements below elem for which filter(element) returns True. """ l = reduce(lambda l, e: l + e.getElements(filter), self.childNodes, []) if filter(self): l += [self] return l |
the current offset, this is a no-op, otherwise the | the current offset this is a no-op, otherwise the | def __setitem__(self, key, value): """ Set an offset. If the new offset is identical to the current offset, this is a no-op, otherwise the corresponding segmentlist object is shifted. """ if key not in self: raise KeyError, key delta = value - self[key] if delta != 0.0: self.__parent[key].shift(delta) dict.__setitem__... |
no error will be raised, but the offset will not be recorded. This simplifies the case of updating | no error will be raised, but the offset will be ignored. This simplifies the case of updating | def update(self, d): """ From a dictionary of offsets, apply each offset to the corresponding segmentlist. NOTE: it is acceptable for the offset dictionary to contain entries for which there is no matching segmentlist; no error will be raised, but the offset will not be recorded. This simplifies the case of updating... |
def popitem(*arg): | def popitem(*args): | def popitem(*arg): raise NotImplementedError |
Return a copy of dictionary. The return value is a new object with references to the original keys, and shallow copies of the items. | Return a copy of the segmentlistdict object. The return value is a new object with references to the original keys, and shallow copies of the segment lists. | def copy(self): """ Return a copy of dictionary. The return value is a new object with references to the original keys, and shallow copies of the items. """ new = self.__class__() for key, value in self.iteritems(): new[key] = copy(value) dict.update(new.offsets, self.offsets) return new |
for key in self.iterkeys(): self[key].contract(x) | for value in self.itervalues(): value.contract(x) | def contract(self, x): """ Run contract(x) on all segmentlists. """ for key in self.iterkeys(): self[key].contract(x) return self |
for key in self.iterkeys(): self[key].protract(x) | for value in self.itervalues(): value.protract(x) | def protract(self, x): """ Run protract(x) on all segmentlists. """ for key in self.iterkeys(): self[key].protract(x) return self |
if not self or not keys: | if not keys: | def intersection(self, keys): """ Return the intersection of the segmentlists associated with the keys in keys. """ if not self or not keys: return segmentlist() it = iter(keys) seglist = self[it.next()] for value in map(self.__getitem__, it): seglist &= value return seglist |
it = iter(keys) seglist = self[it.next()] for value in map(self.__getitem__, it): | seglist = ~segmentlist() for value in map(self.__getitem__, keys): | def intersection(self, keys): """ Return the intersection of the segmentlists associated with the keys in keys. """ if not self or not keys: return segmentlist() it = iter(keys) seglist = self[it.next()] for value in map(self.__getitem__, it): seglist &= value return seglist |
@return: Instance of class LDRdataFindClientException | @return: Instance of class LSCsegFindClientException | def __init__(self, args=None): """ Create an instance of this class, ie. an LSCsegFindClient exception. |
Disconnect from the LDRdataFindServer. | Disconnect from the LSCsegFindServer. | def __del__(self): """ Disconnect from the LDRdataFindServer. |
@param host: the host on which the LDRdataFindServer runs | @param host: the host on which the LSCsegFindServer runs | def __connect__(self, host, port): """ Attempt to open a connection to the LSCsegFindServer using the 'host' and 'port' and expecting the server to identify itself with a corresponding host certificate. |
@param port: port on which the LDRdataFindServer listens | @param port: port on which the LSCsegFindServer listens | def __connect__(self, host, port): """ Attempt to open a connection to the LSCsegFindServer using the 'host' and 'port' and expecting the server to identify itself with a corresponding host certificate. |
raise LDRdataFindClientException, msg | raise LSCsegFindClientException, msg | def distinctAttrValues(self, attr): """ Query LSCsegFindServer metadata tables for the distince values of an attribute and return the values as a list. |
if self.__options.keys() or self.__short_options.keys() or self.arguments: | if self.__options.keys() or self.__short_options.keys() or self.__arguments: | def write_sub_file(self): """ Write a submit file for this Condor job. """ if not self.__log_file: raise CondorSubmitError, "Log file not specified." if not self.__err_file: raise CondorSubmitError, "Error file not specified." if not self.__out_file: raise CondorSubmitError, "Output file not specified." if not self.__... |
segments. Raises ValueError if the segments do not intersect. | segments, or None if the segments do not intersect. | def __and__(self, other): """ Return the segment that is the intersection of the given segments. Raises ValueError if the segments do not intersect. """ if not self.intersects(other): raise ValueError, other return segment(max(self[0], other[0]), min(self[1], other[1])) |
raise ValueError, other | return None | def __and__(self, other): """ Return the segment that is the intersection of the given segments. Raises ValueError if the segments do not intersect. """ if not self.intersects(other): raise ValueError, other return segment(max(self[0], other[0]), min(self[1], other[1])) |
Return the segment that is the union of the given segments. Raises ValueError if the segments are disjoint. | Return the segment that is the union of the given segments, or None if the result cannot be represented as a single segment. | def __or__(self, other): """ Return the segment that is the union of the given segments. Raises ValueError if the segments are disjoint. """ if not self.continuous(other): raise ValueError, other return segment(min(self[0], other[0]), max(self[1], other[1])) |
raise ValueError, other | return None | def __or__(self, other): """ Return the segment that is the union of the given segments. Raises ValueError if the segments are disjoint. """ if not self.continuous(other): raise ValueError, other return segment(min(self[0], other[0]), max(self[1], other[1])) |
contained in other. Raises ValueError if the result would be disjoint. | contained in other, or None if the result cannot be represented as a single segment. | def __sub__(self, other): """ Return the segment that is that part of self which is not contained in other. Raises ValueError if the result would be disjoint. """ if not self.intersects(other): return self if (self in other) or ((self[0] < other[0]) and (self[1] > other[1])): raise ValueError, other if self[0] < other... |
raise ValueError, other | return None | def __sub__(self, other): """ Return the segment that is that part of self which is not contained in other. Raises ValueError if the result would be disjoint. """ if not self.intersects(other): return self if (self in other) or ((self[0] < other[0]) and (self[1] > other[1])): raise ValueError, other if self[0] < other... |
msg = "No LFNs returned for segment %d %d" % ( str(self.get_start()), | msg = "No LFNs returned for segment %s %s" % ( str(self.get_start()), | def get_output(self): """ Return the output file, i.e. the file containing the frame cache data. or the files itself as tuple (for DAX) """ if self.__dax: if not self.__lfn_list: # call the datafind client to get the LFNs from pyGlobus import security from glue import LDRdataFindClient from glue import gsiserverutils |
raise ValueError, "could not convert \"%s\" to CacheEntry" % args[0] | raise ValueError, "could not convert \"%s\" to CacheEntry" % line | def __init__(self, line = None, coltype = LIGOTimeGPS): """ Create a CacheEntry object, parsing an optional string argument (one line from a LAL cache file). """ if line != None: match = self._regex.search(line) if not match: raise ValueError, "could not convert \"%s\" to CacheEntry" % args[0] self.observatory = match.... |
self.__start = segment[2] | self.__start = segment[1] | def __init__(self,segment): """ segemnt = a tuple containing the (segment id, gps start time, gps end time, duration) of the segment. """ self.__id = segment[0] self.__start = segment[2] self.__end = segment[2] self.__dur = segment[3] self.__chunks = [] self.__unused = self.dur() self.__ifo = None |
def write_parentss(self,fh): | def write_parents(self,fh): | def write_parentss(self,fh): """ Write the parent/child relations for this job to the DAG file descriptor. fh = descriptor of open DAG file. """ for parent in self.__parents: fh.write( 'PARENT ' + parent + ' CHILD ' + str(self) + '\n' ) |
low = bisect_right(self, seg, low) | low = bisect.bisect_right(self, seg, low) | def __ior__(self, other): """ Replace the segmentlist with the union of itself and another. If the two lists have numbers of elements m and n respectively, then this algorithm is O(n log m), which means it is optimized for the case when the latter list contains a small number of segments. If you have two large lists ... |
i = bisect_left(self, other) | i = bisect.bisect_left(self, other) | def intersects_segment(self, other): """ Returns True if the intersection of self and the segment other is not the null set, otherwise returns False. The algorithm is O(log n). Requires the list to be coalesced. """ i = bisect_left(self, other) return ((i != 0) and (other[0] < self[i-1][1])) or ((i != len(self)) and ... |
new[key] = copy(value) | new[key] = copy.copy(value) | def copy(self): """ Return a copy of the segmentlistdict object. The return value is a new object with references to the original keys, and shallow copies of the segment lists. """ new = self.__class__() for key, value in self.iteritems(): new[key] = copy(value) dict.update(new.offsets, self.offsets) return new |
self[key] = copy(value) | self[key] = copy.copy(value) | def __ior__(self, other): for key, value in other.iteritems(): if key in self: self[key] |= value else: self[key] = copy(value) return self |
dict.__setitem__(new, key, copy(intersection)) | dict.__setitem__(new, key, copy.copy(intersection)) | def extract_common(self, keys): """ Return a new segmentlistdict containing only those segmentlists associated with the keys in keys, with each set to the intersection of the original lists. The offsets are preserved. """ new = segmentlistdict() intersection = self.intersection(keys) for key in keys: dict.__setitem__(... |
if value.intersects(seg): | if value.intersects_segment(seg): | def intersects_segment(self, seg): """ Returns True if any segmentlist in self intersects the segment, otherwise returns False. """ for value in self.itervalues(): if value.intersects(seg): return True return False |
self.set_stderr_file(log_dir + '/datafind-$(macroobservatory)-$(macrogpsstarttime)-$(macrogpsendtime)-$(cluster)-$(process).err') self.set_stdout_file(self.__cache_dir + '/$(macroobservatory)-$(macrogpsstarttime)-$(macrogpsendtime).cache') | self.set_stderr_file(log_dir + '/datafind-$(macroobservatory)-$(macrotype)-$(macrogpsstarttime)-$(macrogpsendtime)-$(cluster)-$(process).err') self.set_stdout_file(self.__cache_dir + '/$(macroobservatory)-$(macrotype)-$(macrogpsstarttime)-$(macrogpsendtime).cache') | def __init__(self,cache_dir,log_dir,config_file,dax=0): """ @param cache_dir: the directory to write the output lal cache files to. @param log_dir: the directory to write the stderr file to. @param config_file: ConfigParser object containing the path to the LSCdataFind executable in the [condor] section and a [datafind... |
if self.__start and self.__end and self.__observatory: | if self.__start and self.__end and self.__observatory and self.__type: | def __set_output(self): """ Private method to set the file to write the cache to. Automaticaly set once the ifo, start and end times have been set. """ if self.__start and self.__end and self.__observatory: self.__output = self.__job.get_cache_dir() + '/' + self.__observatory + '-' self.__output += str(self.__start) + ... |
self.__observatory = obs | self.__observatory = str(obs) | def set_observatory(self,obs): """ Set the IFO to retrieve data for. Since the data from both Hanford interferometers is stored in the same frame file, this takes the first letter of the IFO (e.g. L or H) and passes it to the --observatory option of LSCdataFind. @param obs: IFO to obtain data for. """ self.add_var_opt(... |
self.__type = type | self.__type = str(type) self.__set_output() | def set_type(self,type): """ sets the frame type that we are querying """ self.__type = type |
dbobj.dbconn.commit() | ligomd.dbcon.commit() | uniq_def = (row[run_col],row[ifos_col],row[name_col],row[vers_col]) |
return 1 | return NotImplemented | def __cmp__(self, other): """ Compare a value to a LIGOTimeGPS. If the value being compared to the LIGOTimeGPS is not also a LIGOTimeGPS, then an attempt is made to convert it to a LIGOTimeGPS. |
self.calibration_cache_path() | self.__calibration_cache = self.calibration_cache_path() | def calibration(self): """ Set the path to the calibration cache file for the given IFO. During S2 the Hanford 2km IFO had two calibration epochs, so if the start time is during S2, we use the correct cache file. """ # figure out the name of the calibration cache files # as specified in the ini-file self.calibration_ca... |
b = self.childNodes[:] | b = other.childNodes[:] | def compare(self, other): # can't override __cmp__() because that screws up the # removeChild() method. """ Two elements compare as equal if they generate equivalent markup. """ result = cmp(self.tagName, other.tagName) if not result: result = cmp(dict(self.attributes), dict(other.attributes)) if not result: result = c... |
self.set_stderr_file(log_dir + '/datafind-$(macroobservatory)-$(macrotype)-$(macrogpsstarttime)-$(macrogpsendtime)-$(cluster)-$(process).err') self.set_stdout_file(self.__cache_dir + '/$(macroobservatory)-$(macrotype)-$(macrogpsstarttime)-$(macrogpsendtime).cache') | self.set_stderr_file(os.path.join(log_dir, 'datafind-$(macroobservatory)-$(macrotype)-$(macrogpsstarttime)-$(macrogpsendtime)-$(cluster)-$(process).err')) self.set_stdout_file(os.path.join(self.__cache_dir, '$(macroobservatory)-$(macrotype)-$(macrogpsstarttime)-$(macrogpsendtime).cache')) | def __init__(self,cache_dir,log_dir,config_file,dax=0): """ @param cache_dir: the directory to write the output lal cache files to. @param log_dir: the directory to write the stderr file to. @param config_file: ConfigParser object containing the path to the LSCdataFind executable in the [condor] section and a [datafind... |
self.__output = self.__job.get_cache_dir() + '/' + self.__observatory + '-' self.__output += self.__type + '-' self.__output += str(self.__start) + '-' + str(self.__end) + '.cache' | self.__output = os.path.join(self.__job.get_cache_dir(), self.__observatory + '-' + self.__type + '-' + str(self.__start) + '-' + str(self.__end) + '.cache') | def __set_output(self): """ Private method to set the file to write the cache to. Automaticaly set once the ifo, start and end times have been set. """ if self.__start and self.__end and self.__observatory and self.__type: self.__output = self.__job.get_cache_dir() + '/' + self.__observatory + '-' self.__output += self... |
colnamefmt = ":".join(Type.tableName.split(":")[:-1]) + ":%%s" | colnamefmt = ":".join(Type.tableName.split(":")[:-1]) + ":%s" | def New(Type, columns = None): """ Convenience function for constructing pre-defined LSC tables. The optional columns argument is a list of the names of the columns the table should be constructed with. If columns = None, then the table is constructed with all valid columns included (pass columns = [] to create a tab... |
def _verifyChildren(self, child, i): | def _verifyChildren(self, i): | def _verifyChildren(self, child, i): nstream = 0 for child in self.childNodes: if child.tagName == Dim.tagName: if nstream: raise ElementError, "Dim(s) must come before Stream in Array" else: if nstream: raise ElementError, "only one Stream allowed in Array" nstream += 1 |
if (not play) or ( play and ( (end-sl) % 6370 < length + 600 ) ): | if (not play) or (play and ((end-sl-729273613) % 6370 < length + 600)): | def make_chunks(self,length=0,overlap=0,play=0,sl=0): """ Divides the science segment into chunks of length seconds overlapped by overlap seconds. If the play option is set, only chunks that contain S2 playground data are generated. If the user has a more complicated way of generating chunks, this method should be over... |
ligolw + "'\"" | ligolw += "'\"" | def xml(self): """Convert a table dictionary to LIGO lightweight XML""" if len(self.table) == 0: raise LIGOLwDBError, 'attempt to convert empty table to xml' ligolw = """\ |
'stream' : (pid, lfn), 'query' : '' | 'stream' : [(pid, lfn)], 'query' : '', 'orderedcol' : ['process_id', 'lfn' ] | def set_lfn(self,lfn): """ Add an LFN table to a parsed LIGO_LW XML document. |
'stream' : (pid, dn), 'query' : '' | 'stream' : [(pid, dn)], 'query' : '', 'orderedcol' : ['process_id', 'dn' ] | def set_dn(self,dn): """ Add an gridcert table to a parsed LIGO_LW XML document. |
c.close() | def segmentFindWithMetadata_vx(self, arg): """ Given a list of attributes to query on, the first of which is the segfind client/server communication protocol version. Corresponds to the METASEGSVX method in the LSCsegFindServer RPC protocol. | |
@return: Instance of class LDBDServerException | @return: Instance of class ServerHandlerException | def __init__(self, args=None): """ Initialize an instance. |
class LDBDServer(SocketServer.BaseRequestHandler): | class ServerHandler(SocketServer.BaseRequestHandler): | def __init__(self, args=None): """ Initialize an instance. |
global logger | global logger, max_bytes | def handle(self): """ This method does all the work of servicing a request to the server. See the documentation for the standard module SocketServer. |
max = configuration['max_client_byte_string'] input = f.read(size=max,waitForBytes=2) | input = f.read(size=max_bytes,waitForBytes=2) | def handle(self): """ This method does all the work of servicing a request to the server. See the documentation for the standard module SocketServer. |
raise LDBDServerException, \ | raise ServerHandlerException, \ | def handle(self): """ This method does all the work of servicing a request to the server. See the documentation for the standard module SocketServer. |
raise LDBDServerException, \ | raise ServerHandlerException, \ | def insertmap(self, arg): """ Insert some LIGO_LW xml data in the metadata database with an LFN to PFN mapping inserted into the RLS database |
return "%s %s %s %s %s" % (self.observatory or "-", self.description or "-", duration, duration, self.url) | return "%s %s %s %s %s" % (self.observatory or "-", self.description or "-", start, duration, self.url) | def __str__(self): """ Returns a string, with the format of a line in a LAL cache, containing the contents of this cache entry. """ if self.segment != None: start = self.segment[0] duration = self.segment.duration() else: start = "-" duration = "-" return "%s %s %s %s %s" % (self.observatory or "-", self.description or... |
macro = self.__bad_macro_chars( r'', arg ) | macro = self.__bad_macro_chars.sub( r'', arg ) | def add_var_arg(self, arg): """ Add a variable (or macro) option to the condor job. The option is added to the submit file and a different argument to the option can be set fot each node in the DAG. arg = name of option to add. """ if arg not in self.__var_args: self.__var_args.append(arg) macro = self.__bad_macro_char... |
macro = self.__bad_macro_chars( r'', var ) | macro = self.__bad_macro_chars.sub( r'', var ) | def add_var(self,var,value): """ Add the a variable (macro) arguments for this node. If the option specified does not exist in the CondorJob, it is added so the submit file will be correct when written. var = option name. value = value of the option for this node in the DAG. """ macro = self.__bad_macro_chars( r'', var... |
print "sending" print msg | def segmentQueryWithMetadata(self, queryList): """ Query LSCsegFindServer to find the segment(s) with the appropriate metadata values. | |
raise KeyError, "process ID %s not found" % id | raise KeyError, "process ID %s not found" % key | def __getitem__(self, key): """ Return the row having process ID equal to key. """ for row in self: if row.process_id == key: return row raise KeyError, "process ID %s not found" % id |
otherwise append value as a new row. | otherwise append value as a new row. Note: value.process_id need not equal key. | def __setitem__(self, key, value): """ If a row has proces ID equal to key, replace it with value, otherwise append value as a new row. """ for i in range(len(self)): if self.rows[i].process_id == key: self.rows[i] = value return self.appendRow(value) |
raise KeyError, "process ID %s not found" % id | raise KeyError, "process ID %s not found" % key | def __delitem__(self, key): """ Delete the row with process ID equal to key. """ for i in range(len(self)): if self.rows[i].process_id == key: del self.rows[i] return raise KeyError, "process ID %s not found" % id |
def get_params(self, id): """ Turn the rows matching the process ID id into a dictionary | def appendRow(self, row): if row.param in [r.param for r in self]: raise ligolw.ElementError, "duplicate parameter %s for process ID %s" % (row.param, row.process_id) if row.type not in metaio.Types: raise ligolw.ElementError, "unrecognized Type attribute %s" % row.type metaio.Table.appendRow(self, row) def __getitem_... | def get_params(self, id): """ Turn the rows matching the process ID id into a dictionary of parameter/value pairs. """ params = {} for row in self: if row.process_id != id: pass elif params.has_key(row.param): raise ligolw.ElementError, "duplicate process parameter %s for process ID %s" % (row.param, id) elif row.type ... |
if row.process_id != id: | if row.process_id != key: | def get_params(self, id): """ Turn the rows matching the process ID id into a dictionary of parameter/value pairs. """ params = {} for row in self: if row.process_id != id: pass elif params.has_key(row.param): raise ligolw.ElementError, "duplicate process parameter %s for process ID %s" % (row.param, id) elif row.type ... |
raise ligolw.ElementError, "duplicate process parameter %s for process ID %s" % (row.param, id) | raise ligolw.ElementError, "duplicate parameter %s for process ID %s" % (row.param, row.process_id) | def get_params(self, id): """ Turn the rows matching the process ID id into a dictionary of parameter/value pairs. """ params = {} for row in self: if row.process_id != id: pass elif params.has_key(row.param): raise ligolw.ElementError, "duplicate process parameter %s for process ID %s" % (row.param, id) elif row.type ... |
self.add_ini_opts(config_parser, "ligolw_add") | self.add_ini_opts(cp, "ligolw_add") | def __init__(self,log_dir,cp,dax=False): """ cp = ConfigParser object from which options are read. """ self.__executable = cp.get('condor','ligolw_add') self.__universe = 'vanilla' CondorDAGJob.__init__(self,self.__universe,self.__executable) AnalysisJob.__init__(self,cp,dax) self.add_ini_opts(config_parser, "ligolw_ad... |
def timeQuery(self, mytype, start, end, strict): | def timeQuery(self, mytype, site, start, end, strict): | def timeQuery(self, mytype, start, end, strict): """ Query LDRdataFindServer for time ranges for a particular frameType. Optionally supprts gpsStart and gpsEnd, these will be processed server-side. @param mytype: frame type @param start: gps start time @param stop: gps end time @param strict: strict query flag @retur... |
rpc = "SEGMENT\0type\0%s\0" % (mytype,) | rpc = "SEGMENT\0type\0%s\0observatory\0%s\0" % (mytype,site) | def timeQuery(self, mytype, start, end, strict): """ Query LDRdataFindServer for time ranges for a particular frameType. Optionally supprts gpsStart and gpsEnd, these will be processed server-side. @param mytype: frame type @param start: gps start time @param stop: gps end time @param strict: strict query flag @retur... |
timelist = LDRdataFindClient.timeQuery(self,mytype,start,end,strict) | timelist = LDRdataFindClient.timeQuery(self,mytype,site,start,end,strict) | def showTimes(self,argDict): """ Query LDRdataFind server for gps times for existing data corresponding to the specified frame type. @param argDict: Dictionary of arguments passed to all methods. @return: results of query """ start = argDict['start'] end = argDict['end'] strict = argDict['strict'] mytype = argDict[... |
sql += "name,comment AS x,y FROM segment_definer WHERE " | sql += "name AS x, comment FROM segment_definer WHERE " | def distinctAttribute(self, arg): """ Find distinct values for an attribute. Corresponds to the DISTINCT method in the LSCsegFindServer RPC protocol. |
if isinstance(x, types.StringTypes): | if len(x) == 1: | def distinctAttribute(self, arg): """ Find distinct values for an attribute. Corresponds to the DISTINCT method in the LSCsegFindServer RPC protocol. |
seg = segments.segment(map(coltype, tokens[1:2])) | seg = segments.segment(map(coltype, tokens[1:3])) | def fromsegwizard(file, coltype=long, strict=True): """ Read a segmentlist from the file object file containing a segwizard compatible segment list. Parsing stops on the first line that cannot be parsed (which is consumed). The segmentlist will be created with segments whose boundaries are of type coltype, which shou... |
child = self.endAdcData() | self.endAdcData() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endAdcInterval() | self.endAdcInterval() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endArray() | self.endArray() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endColumn() | self.endColumn() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endComment() | self.endComment() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endDetector() | self.endDetector() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endDim() | self.endDim() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endIGWDFrame() | self.endIGWDFrame() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endLIGO_LW() | self.endLIGO_LW() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endParam() | self.endParam() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endStream() | self.endStream() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endTable() | self.endTable() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
child = self.endTime() | self.endTime() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name ==... |
fileName = 'tmpLSCsegFindWebPage.txt' | fileName = 'tmpDataFromURL_LSCsegFind.txt' | def GetSegments(self): fileName = 'tmpLSCsegFindWebPage.txt' |
savedFileName = 'LSCsegFindWebPage.txt' | savedFileName = 'dataFromURL_LSCsegFind.txt' | def GetSegments(self): fileName = 'tmpLSCsegFindWebPage.txt' |
Convenience functions for constructing pre-defined LAL tables. | Convenience function for constructing pre-defined LSC tables. | def New(Type): """ Convenience functions for constructing pre-defined LAL tables. Example: import lsctables table = lsctables.New(laltables.ProcessTable) """ attrs = sax.xmlreader.AttributesImpl({u"Name": Type.tableName}) table = Type(attrs) for name, type in table.validcolumns.items(): table.appendChild(metaio.Colum... |
table = lsctables.New(laltables.ProcessTable) | table = lsctables.New(lsctables.ProcessTable) | def New(Type): """ Convenience functions for constructing pre-defined LAL tables. Example: import lsctables table = lsctables.New(laltables.ProcessTable) """ attrs = sax.xmlreader.AttributesImpl({u"Name": Type.tableName}) table = Type(attrs) for name, type in table.validcolumns.items(): table.appendChild(metaio.Colum... |
other = LIGOTimeGPS(other) | try: other = LIGOTimeGPS(other) except: return 1 | def __cmp__(self, other): """ Compare a value to a LIGOTimeGPS. If the value being compared to the LIGOTimeGPS is not also a LIGOTimeGPS, then an attempt is made to convert it to a LIGOTimeGPS. |
if start > stop: | if start > ostop: | def coalesce(self): """ Coalesces any adjacent ScienceSegments. Returns the number of ScienceSegments in the coalesced list. """ |
elif stop > start: | elif stop > ostop: | def coalesce(self): """ Coalesces any adjacent ScienceSegments. Returns the number of ScienceSegments in the coalesced list. """ |
stop= other[i2].end() | stop2 = other[i2].end() | def union(self, other): """ Replaces the ScienceSegments contained in this instance of ScienceData with the union of those in the instance other. Returns the number of ScienceSegments in the union. other = ScienceData to use to generate the intersection """ |
id = self.id() | id = seg.id() | def coalesce(self): """ Coalesces any adjacent ScienceSegments. Returns the number of ScienceSegments in the coalesced list. """ |
new = segmentlistdict(self) | new = self.copy() | def __and__(self, other): new = segmentlistdict(self) new &= other return new |
new = segmentlistdict(self) | new = self.copy() | def __or__(self, other): new = segmentlistdict(self) new |= other return new |
new = segmentlistdict(self) | new = self.copy() | def __sub__(self, other): new = segmentlistdict(self) new -= other return new |
new = seglistdict(self) | new = self.copy() | def __invert__(self): new = seglistdict(self) for key, value in new.iteritems(): dict.__setitem__(new, key, ~value) return new |
Coalesce all segmentlists in self. | Run coalesce() on all segmentlists. | def coalesce(self): """ Coalesce all segmentlists in self. """ for value in self.itervalues(): value.coalesce() return self |
Contract the segmentlists. | Run contract(x) on all segmentlists. | def contract(self, x): """ Contract the segmentlists. """ for key in self.iterkeys(): self[key].contract(x) return self |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.