bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def draw_tls_surface(self, Lx_eigen_vec, Lx_eigen_val, Lx_rho, Lx_pitch): """Draws the TLS probability surface for a single non-intersecting screw axis. Lx_eigen_val is the vaiance (mean square deviation MSD) of the rotation about the Lx_eigen_vec axis. """ ## create a unique list of bonds which will be used to ## ren... | defself.driver.glr_lighting_disable() draw_tls_surface(self,self.driver.glr_lighting_disable() Lx_eigen_vec,self.driver.glr_lighting_disable() Lx_eigen_val,self.driver.glr_lighting_disable() Lx_rho,self.driver.glr_lighting_disable() Lx_pitch):self.driver.glr_lighting_disable() """Drawsself.driver.glr_lighting_disable()... | 6,500 |
def atom_common(arec1, arec2): arec2["serial"] = arec1["serial"] arec2["chainID"] = arec1["chainID"] arec2["resName"] = arec1["resName"] arec2["resSeq"] = arec1["resSeq"] arec2["iCode"] = arec1["iCode"] arec2["name"] = arec1["name"] arec2["altLoc"] = arec1["altLoc"] arec2["element"] = arec1["element"] arec2["ch... | def atom_common(arec1, arec2): arec2["serial"] = arec1["serial"] arec2["chainID"] = arec1["chainID"] arec2["resName"] = arec1["resName"] arec2["resSeq"] = arec1["resSeq"] arec2["iCode"] = arec1["iCode"] arec2["name"] = arec1["name"] arec2["altLoc"] = arec1["altLoc"] arec2["element"] = arec1["element"] arec2["ch... | 6,501 |
def process(self, recs): """Returns a dictionary with attributes chain_id, num_res, and sequence_list """ seqres = {} | def process(self, recs): """Returns a dictionary with attributes chain_id, num_res, and sequence_list """ seqres = {} | 6,502 |
def calc_atom_weight(atm): """Weight the least-squares fit according to this function. """ | def calc_atom_weight(atm): """Weight the least-squares fit according to this function. """ | 6,503 |
def __init__(self, form, text=None): Page.__init__(self, form) self.text = text | def __init__(self, form, text): Page.__init__(self, form) self.text = text | 6,504 |
def main(): form = cgi.FieldStorage() page = None job_id = check_job_id(form) if job_id==None: page = ErrorPage("The Job ID seems to be expired.") else: page = RefinePrepPage(form) try: print page.html_page() except RefinePrepError, err: text = '<center><p>%s</p></center>' % (err.text) page = ErrorPage(form, text) ... | def main(): form = cgi.FieldStorage() page = None job_id = check_job_id(form) if job_id==None: page = ErrorPage(form, "The Job ID seems to be expired.") else: page = RefinePrepPage(form) try: print page.html_page() except RefinePrepError, err: text = '<center><p>%s</p></center>' % (err.text) page = ErrorPage(form, ... | 6,505 |
def next_chain_id(suggest_chain_id): if suggest_chain_id != "": try: self.struct[suggest_chain_id] except KeyError: return suggest_chain_id for chain_id in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": try: self.struct[chain_id] except KeyError: return chain_id | def next_chain_id(suggest_chain_id): if suggest_chain_id != "": try: self.struct[suggest_chain_id] except IndexError: return suggest_chain_id for chain_id in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": try: self.struct[chain_id] except IndexError: return chain_id | 6,506 |
def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | 6,507 |
def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | 6,508 |
def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | 6,509 |
def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | 6,510 |
def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | 6,511 |
def NewTLSGraphChain0(tls_model): """Generate and return the proper TLSGraphChain subclass for the requested TLS model. """ if tls_model=="HYBRID": return TLSGraphChainFastHybrid() if tls_model=="ANISO": return TLSGraphChainAnisotropic() if tls_model=="PLUGIN": return TLSGraphChainPlugin() raise Exception() | def NewTLSGraphChain0(tls_model): """Generate and return the proper TLSGraphChain subclass for the requested TLS model. """ if tls_model=="HYBRID": if USE_TLSMDMODULE==True: return TLSGraphChainFastHybrid() else: return TLSGraphChainHybrid() if tls_model=="ANISO": return TLSGraphChainAnisotropic() if tls_model=="PLUGIN... | 6,512 |
def html_chain_alignment_plot(self, chain): """generate a plot comparing all segmentations """ plot = sequence_plot.TLSSegmentAlignmentPlot() for ntls, cpartition in chain.partition_collection.iter_ntls_chain_partitions(): plot.add_tls_segmentation(cpartition) | def html_chain_alignment_plot(self, chain): """generate a plot comparing all segmentations """ plot = sequence_plot.TLSSegmentAlignmentPlot() for ntls, cpartition in chain.partition_collection.iter_ntls_chain_partitions(): plot.add_tls_segmentation(cpartition) | 6,513 |
def html_chain_alignment_plot(self, chain): """generate a plot comparing all segmentations """ plot = sequence_plot.TLSSegmentAlignmentPlot() for ntls, cpartition in chain.partition_collection.iter_ntls_chain_partitions(): plot.add_tls_segmentation(cpartition) | def html_chain_alignment_plot(self, chain): """generate a plot comparing all segmentations """ plot = sequence_plot.TLSSegmentAlignmentPlot() for ntls, cpartition in chain.partition_collection.iter_ntls_chain_partitions(): plot.add_tls_segmentation(cpartition) | 6,514 |
def gldl_iter_multidraw_animate(self): """ """ ## optimization: if a rotation of 0.0 degrees was already ## drawn, then there is no need to draw it again zero_rot = False for Lx_axis, Lx_rho, Lx_pitch, Lx_rot, Lx_scale in ( ("L1_eigen_vec", "L1_rho", "L1_pitch", "L1_rot", "L1_scale"), ("L2_eigen_vec", "L2_rho", "L2_pi... | def gldl_iter_multidraw_animate(self): """ """ ## optimization: if a rotation of 0.0 degrees was already ## drawn, then there is no need to draw it again zero_rot = False for Lx_axis, Lx_rho, Lx_pitch, Lx_rot, Lx_scale in ( ("L1_eigen_vec", "L1_rho", "L1_pitch", "L1_rot", "L1_scale"), ("L2_eigen_vec", "L2_rho", "L2_pi... | 6,515 |
def gldl_iter_multidraw_animate(self): """ """ ## optimization: if a rotation of 0.0 degrees was already ## drawn, then there is no need to draw it again zero_rot = False for Lx_axis, Lx_rho, Lx_pitch, Lx_rot, Lx_scale in ( ("L1_eigen_vec", "L1_rho", "L1_pitch", "L1_rot", "L1_scale"), ("L2_eigen_vec", "L2_rho", "L2_pi... | def gldl_iter_multidraw_animate(self): """ """ ## optimization: if a rotation of 0.0 degrees was already ## drawn, then there is no need to draw it again zero_rot = False for Lx_axis, Lx_rho, Lx_pitch, Lx_rot, Lx_scale in ( ("L1_eigen_vec", "L1_rho", "L1_pitch", "L1_rot", "L1_scale"), ("L2_eigen_vec", "L2_rho", "L2_pi... | 6,516 |
def gldl_iter_multidraw_animate(self): """ """ ## optimization: if a rotation of 0.0 degrees was already ## drawn, then there is no need to draw it again zero_rot = False for Lx_axis, Lx_rho, Lx_pitch, Lx_rot, Lx_scale in ( ("L1_eigen_vec", "L1_rho", "L1_pitch", "L1_rot", "L1_scale"), ("L2_eigen_vec", "L2_rho", "L2_pi... | def gldl_iter_multidraw_animate(self): """ """ ## optimization: if a rotation of 0.0 degrees was already ## drawn, then there is no need to draw it again zero_rot = False for Lx_axis, Lx_rho, Lx_pitch, Lx_rot, Lx_scale in ( ("L1_eigen_vec", "L1_rho", "L1_pitch", "L1_rot", "L1_scale"), ("L2_eigen_vec", "L2_rho", "L2_pi... | 6,517 |
def update_time(self): """Changes the time of the TLS group simulating harmonic motion. """ if self.tls_group.is_null(): return | def update_time(self): """Changes the time of the TLS group simulating harmonic motion. """ if self.tls_group.is_null(): return | 6,518 |
def update_time(self): """Changes the time of the TLS group simulating harmonic motion. """ if self.tls_group.is_null(): return | def update_time(self): """Changes the time of the TLS group simulating harmonic motion. """ if self.tls_group.is_null(): return | 6,519 |
def update_time(self): """Changes the time of the TLS group simulating harmonic motion. """ if self.tls_group.is_null(): return | def update_time(self): """Changes the time of the TLS group simulating harmonic motion. """ if self.tls_group.is_null(): return | 6,520 |
def draw_tls_surface(self, Lx_eigen_vec, Lx_eigen_val, Lx_rho, Lx_pitch): """Draws the TLS probability surface for a single non-intersecting screw axis. Lx_eigen_val is the vaiance (mean square deviation MSD) of the rotation about the Lx_eigen_vec axis. """ ## create a unique list of bonds which will be used to ## ren... | def draw_tls_surface(self, Lx_eigen_vec, Lx_eigen_val, Lx_rho, Lx_pitch): """Draws the TLS probability surface for a single non-intersecting screw axis. Lx_eigen_val is the vaiance (mean square deviation MSD) of the rotation about the Lx_eigen_vec axis. """ ## create a unique list of bonds which will be used to ## ren... | 6,521 |
def draw_tls_surface(self, Lx_eigen_vec, Lx_eigen_val, Lx_rho, Lx_pitch): """Draws the TLS probability surface for a single non-intersecting screw axis. Lx_eigen_val is the vaiance (mean square deviation MSD) of the rotation about the Lx_eigen_vec axis. """ ## create a unique list of bonds which will be used to ## ren... | def draw_tls_surface(self, Lx_eigen_vec, Lx_eigen_val, Lx_rho, Lx_pitch): """Draws the TLS probability surface for a single non-intersecting screw axis. Lx_eigen_val is the vaiance (mean square deviation MSD) of the rotation about the Lx_eigen_vec axis. """ ## create a unique list of bonds which will be used to ## ren... | 6,522 |
def draw_tls_surface(self, Lx_eigen_vec, Lx_eigen_val, Lx_rho, Lx_pitch): """Draws the TLS probability surface for a single non-intersecting screw axis. Lx_eigen_val is the vaiance (mean square deviation MSD) of the rotation about the Lx_eigen_vec axis. """ ## create a unique list of bonds which will be used to ## ren... | def draw_tls_surface(self, Lx_eigen_vec, Lx_eigen_val, Lx_rho, Lx_pitch): """Draws the TLS probability surface for a single non-intersecting screw axis. Lx_eigen_val is the vaiance (mean square deviation MSD) of the rotation about the Lx_eigen_vec axis. """ ## create a unique list of bonds which will be used to ## ren... | 6,523 |
def write_mstring(self, mstring): self.write(self.form_string(mstring)) | def write_mstring(self, mstring): self.write(self.form_string(mstring)) | 6,524 |
def SendEmail(address, subject, body): if not os.path.isfile(conf.MSMTP): sys.stderr.write("Mail Client %s Not Found" % (conf.MSMTP)) return mlist = ["To: %s" % (address), "Subject: %s" % (subject), "", body] ## send mail using msmtp pobj = subprocess.Popen([conf.MSMTP, address], stdin = subprocess.PIPE, stdout = sub... | def SendEmail(address, subject, body): if not os.path.isfile(conf.MSMTP): sys.stderr.write("mail client not found: %s" % (conf.MSMTP)) return mlist = ["To: %s" % (address), "Subject: %s" % (subject), "", body] ## send mail using msmtp pobj = subprocess.Popen([conf.MSMTP, address], stdin = subprocess.PIPE, stdout = su... | 6,525 |
def SendEmail(address, subject, body): if not os.path.isfile(conf.MSMTP): sys.stderr.write("Mail Client %s Not Found" % (conf.MSMTP)) return mlist = ["To: %s" % (address), "Subject: %s" % (subject), "", body] ## send mail using msmtp pobj = subprocess.Popen([conf.MSMTP, address], stdin = subprocess.PIPE, stdout = sub... | def SendEmail(address, subject, body): if not os.path.isfile(conf.MSMTP): sys.stderr.write("Mail Client %s Not Found" % (conf.MSMTP)) return mlist = ["To: %s" % (address), "Subject: %s" % (subject), "", body] ## send mail using msmtp try: pobj = subprocess.Popen([conf.MSMTP, address], stdin = subprocess.PIPE, stdout ... | 6,526 |
def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: ... | def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec stats = {} stats["time"] = sec for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: pass else: if text.find("RESOLUTION RANGE HIGH") == 1: print text | 6,527 |
def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: ... | def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: rec_type = rec["RECORD"] if rec_type == "REMARK": try: text = rec["tex... | 6,528 |
def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: ... | def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: ... | 6,529 |
def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: ... | defread_pdb(path):sec=time.time()records=pdbmodule.read(path)sec=time.time()-secifrecords!=None:print"%s:%drecordsin%.2fseconds"%(path,len(records),sec)else:print"%s:NORECORDS"%(path)forrecinrecords:ifrec["RECORD"]=="REMARK":try:text=rec["text"]exceptKeyError:passelse:iftext.find("RESOLUTIONRANGEHIGH")==1:printtext | 6,530 |
def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: ... | defread_pdb(path):sec=time.time()records=pdbmodule.read(path)sec=time.time()-secifrecords!=None:print"%s:%drecordsin%.2fseconds"%(path,len(records),sec)else:print"%s:NORECORDS"%(path)forrecinrecords:ifrec["RECORD"]=="REMARK":try:text=rec["text"]exceptKeyError:passelse:iftext.find("RESOLUTIONRANGEHIGH")==1:printtext | 6,531 |
def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: ... | def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: ... | 6,532 |
def log_job_end(jdict): ln = "" ln += "[%s]: " % (time.asctime(time.localtime(time.time()))) ln += "Finished Job %s" % (jdict["job_id"]) log_write(ln) ## write to a special log file if jdict.get("private_job", True): private_text = "private" else: private_text = "public" submit_time = jdict.get('submit_time', 0.0) r... | def log_job_end(jdict): ln = "" ln += "[%s]: " % (time.asctime(time.localtime(time.time()))) ln += "Finished Job %s" % (jdict["job_id"]) log_write(ln) ## write to a special log file if jdict.get("private_job", True): private_text = "private" else: private_text = "public" submit_time = jdict.get('submit_time', 0.0) r... | 6,533 |
def iter_protein_atoms(sobjx): for fragx in sobjx.iter_amino_acids(): for atmx in fragx.iter_atoms(): if atmx.name=="CA": yield atmx | def iter_protein_atoms(sobjx): for fragx in sobjx.iter_amino_acids(): for atmx in fragx.iter_atoms(): if atmx.name=="CA": yield atmx | 6,534 |
def iter_atoms(self): """Iterates over all Atom objects. The iteration is preformed in order according to the Chain and Fragment ordering rules the Atom object is a part of. """ for chain in self.iter_chains(): for atm in chain.iter_atoms(): yield atm | def iter_atoms(self): """Iterates over all Atom objects according to the Structure defaults. """ for chain in self.iter_chains(): for atm in chain.iter_atoms(): yield atm | 6,535 |
def count_atoms(self): """Counts all Atom objects in the Structure's default alt_loc. """ n = 0 for atm in self.iter_atoms(): n += 1 return n | def count_atoms(self): """Counts all Atom objects in according to the Structure defaults. """ n = 0 for atm in self.iter_atoms(): n += 1 return n | 6,536 |
def iter_all_atoms(self): """ """ for chain in self.iter_chains(): for atm in chain.iter_all_atoms(): yield atm | def iter_all_atoms(self): """Iterates over all Atom objects including all atoms in multiple conformations. """Iterates over all Atom objects including all atoms in multiple conformations. for chain in self.iter_chains(): for atm in chain.iter_all_atoms(): yield atm | 6,537 |
def count_all_atoms(self): """Counts all Atom objects. """ n = 0 for atm in self.iter_all_atoms(): n += 1 return n | def count_all_atoms(self): """Counts all Atom objects including all atoms in multiple conformations. """ n = 0 for atm in self.iter_all_atoms(): n += 1 return n | 6,538 |
def __init__(self): gtk.Dialog.__init__(self, "About mmCIF Editor", None, 0) self.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) self.connect("delete-event", self.delete_event_cb) self.connect("response", self.delete_event_cb) | def __init__(self): gtk.Dialog.__init__(self, "About mmCIF Editor", None, 0) self.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) self.connect("delete-event", self.delete_event_cb) self.connect("response", self.delete_event_cb) | 6,539 |
def refmac5_prep(xyzin, tlsin, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTL... | def refmac5_prep(xyzin, tlsin_list, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] tls_file = TLSFile() tls_file.set_file_format(TLSFileFor... | 6,540 |
def refmac5_prep(xyzin, tlsin, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTL... | def refmac5_prep(xyzin, tlsin, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] for tlsin in tlsin_list: tls_file = TLSFile() tls_file.set_fi... | 6,541 |
def refmac5_prep(xyzin, tlsin, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTL... | def refmac5_prep(xyzin, tlsin, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT... | 6,542 |
def atom_common(arec1, arec2): arec2["serial"] = arec1["serial"] arec2["chainID"] = arec1["chainID"] arec2["resName"] = arec1["resName"] arec2["resSeq"] = arec1["resSeq"] arec2["iCode"] = arec1["iCode"] arec2["name"] = arec1["name"] arec2["altLoc"] = arec1["altLoc"] arec2["element"] = arec1["element"] arec2["ch... | def atom_common(arec1, arec2): arec2["serial"] = arec1["serial"] arec2["chainID"] = arec1["chainID"] arec2["resName"] = arec1["resName"] arec2["resSeq"] = arec1["resSeq"] arec2["iCode"] = arec1["iCode"] arec2["name"] = arec1["name"] arec2["altLoc"] = arec1["altLoc"] arec2["element"] = arec1["element"] arec2["ch... | 6,543 |
def atom_common(arec1, arec2): arec2["serial"] = arec1["serial"] arec2["chainID"] = arec1["chainID"] arec2["resName"] = arec1["resName"] arec2["resSeq"] = arec1["resSeq"] arec2["iCode"] = arec1["iCode"] arec2["name"] = arec1["name"] arec2["altLoc"] = arec1["altLoc"] arec2["element"] = arec1["element"] arec2["ch... | def atom_common(arec1, arec2): arec2["serial"] = arec1["serial"] arec2["chainID"] = arec1["chainID"] arec2["resName"] = arec1["resName"] arec2["resSeq"] = arec1["resSeq"] arec2["iCode"] = arec1["iCode"] arec2["name"] = arec1["name"] arec2["altLoc"] = arec1["altLoc"] arec2["element"] = arec1["element"] arec2["ch... | 6,544 |
def atom_common(arec1, arec2): arec2["serial"] = arec1["serial"] arec2["chainID"] = arec1["chainID"] arec2["resName"] = arec1["resName"] arec2["resSeq"] = arec1["resSeq"] arec2["iCode"] = arec1["iCode"] arec2["name"] = arec1["name"] arec2["altLoc"] = arec1["altLoc"] arec2["element"] = arec1["element"] arec2["ch... | def atom_common(arec1, arec2): arec2["serial"] = arec1["serial"] arec2["chainID"] = arec1["chainID"] arec2["resName"] = arec1["resName"] arec2["resSeq"] = arec1["resSeq"] arec2["iCode"] = arec1["iCode"] arec2["name"] = arec1["name"] arec2["altLoc"] = arec1["altLoc"] arec2["element"] = arec1["element"] arec2["ch... | 6,545 |
def __init__(self): ## bars are 15 pixels heigh self.pheight = ALIGN_HEIGHT ## spacing pixels between stacked bars self.spacing = ALIGN_SPACING ## background color self.bg_color = rgb_f2i((1.0, 1.0, 1.0)) self.frag_list = [] self.segmentations = [] | def __init__(self): ## bars are 15 pixels heigh self.pheight = ALIGN_HEIGHT ## spacing pixels between stacked bars self.spacing = ALIGN_SPACING ## background color self.bg_color = rgb_f2i((1.0, 1.0, 1.0)) self.frag_list = [] self.segmentations = [] | 6,546 |
def add_tls_segmentation(self, chainopt, ntls): """Add a TLS optimization to the alignment plot. """ tlsopt = chainopt["tlsopt"][ntls] ## get the list of TLS segments for the specified number of ## segments (ntls) tls_seg_desc = {} self.segmentations.append(tls_seg_desc) tls_seg_desc["chainopt"] = chainopt tls_seg_des... | def add_tls_segmentation(self, chainopt, ntls): """Add a TLS optimization to the alignment plot. """ tlsopt = chainopt["tlsopt"][ntls] ## get the list of TLS segments for the specified number of ## segments (ntls) tls_seg_desc = {} self.configurations.append(tls_seg_desc) tls_seg_desc["chainopt"] = chainopt tls_seg_de... | 6,547 |
def plot(self, path): """Plot and write the png plot image to the specified path. """ if len(self.frag_list)==0 or len(self.segmentations)==0: return False nfrag = len(self.frag_list) target_width = 500 fw = int(round(float(ALIGN_TARGET_WIDTH) / nfrag)) fwidth = max(1, fw) | def plot(self, path): """Plot and write the png plot image to the specified path. """ if len(self.frag_list)==0 or len(self.configurations)==0: return False nfrag = len(self.frag_list) target_width = 500 fw = int(round(float(ALIGN_TARGET_WIDTH) / nfrag)) fwidth = max(1, fw) | 6,548 |
def plot(self, path): """Plot and write the png plot image to the specified path. """ if len(self.frag_list)==0 or len(self.segmentations)==0: return False nfrag = len(self.frag_list) target_width = 500 fw = int(round(float(ALIGN_TARGET_WIDTH) / nfrag)) fwidth = max(1, fw) | def plot(self, path): """Plot and write the png plot image to the specified path. """ if len(self.frag_list)==0 or len(self.segmentations)==0: return False nfrag = len(self.frag_list) target_width = 500 fw = int(round(float(ALIGN_TARGET_WIDTH) / nfrag)) fwidth = max(1, fw) | 6,549 |
def plot(self, path): """Plot and write the png plot image to the specified path. """ if len(self.frag_list)==0 or len(self.segmentations)==0: return False nfrag = len(self.frag_list) target_width = 500 fw = int(round(float(ALIGN_TARGET_WIDTH) / nfrag)) fwidth = max(1, fw) | def plot(self, path): """Plot and write the png plot image to the specified path. """ if len(self.frag_list)==0 or len(self.segmentations)==0: return False nfrag = len(self.frag_list) target_width = 500 fw = int(round(float(ALIGN_TARGET_WIDTH) / nfrag)) fwidth = max(1, fw) | 6,550 |
def calc_include_atom(atm, reject_messages = False): """Filter out atoms from the model which will cause problems or cont contribute to the TLS analysis. """ if atm.position == None: return False if atm.occupancy < 0.1: if reject_messages == True: console.stdoutln("calc_include_atom(%s): rejected because of low occupa... | def calc_include_atom(atm, reject_messages = False): """Filter out atoms from the model which will cause problems or cont contribute to the TLS analysis. """ if atm.position == None: return False if atm.occupancy < 0.1: if reject_messages == True: console.stdoutln("calc_include_atom(%s): rejected because of low occupa... | 6,551 |
def __init__(self): self.visible = True self.width = 0 self.height = 0 self.zplane = 5000.0 | def __init__(self): self.visible = True self.width = 0 self.height = 0 self.zplane = 5000.0 | 6,552 |
def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | def lsq_fit_segment(self, frag_id1, frag_id2): """Performs a LSQ fit of TLS parameters for the protein segment starting with fragment index ifrag_start to (and including) the fragment ifrag_end. """ ## all return values here fit_info = {} ## calculate the start/end indexes of the start fragment ## and end fragment so ... | 6,553 |
def load_atom(self, atm_map): """Called repeatedly by the implementation of read_atoms to load all the data for a single atom. The data is contained in the atm_map argument, and is not well documented at this point. Look at this function and you'll figure it out. """ ## XXX -- I presently do not support more than one... | def load_atom(self, atm_map): """Called repeatedly by the implementation of read_atoms to load all the data for a single atom. The data is contained in the atm_map argument, and is not well documented at this point. Look at this function and you'll figure it out. """ ## XXX -- I presently do not support more than one... | 6,554 |
def load_atom(self, atm_map): """Called repeatedly by the implementation of read_atoms to load all the data for a single atom. The data is contained in the atm_map argument, and is not well documented at this point. Look at this function and you'll figure it out. """ ## XXX -- I presently do not support more than one... | defload_atom(self,atm_map):"""Calledrepeatedlybytheimplementationofread_atomstoloadallthedataforasingleatom.Thedataiscontainedintheatm_mapargument,andisnotwelldocumentedatthispoint.Lookatthisfunctionandyou'llfigureitout."""##XXX--IpresentlydonotsupportmorethanoneNMR##styleMODEL;thisisfirstonthelistforthe##nextversionif... | 6,555 |
def load_atom(self, atm_map): """Called repeatedly by the implementation of read_atoms to load all the data for a single atom. The data is contained in the atm_map argument, and is not well documented at this point. Look at this function and you'll figure it out. """ ## XXX -- I presently do not support more than one... | def load_atom(self, atm_map): """Called repeatedly by the implementation of read_atoms to load all the data for a single atom. The data is contained in the atm_map argument, and is not well documented at this point. Look at this function and you'll figure it out. """ ## XXX -- I presently do not support more than one... | 6,556 |
def load_atom(self, atm_map): """Called repeatedly by the implementation of read_atoms to load all the data for a single atom. The data is contained in the atm_map argument, and is not well documented at this point. Look at this function and you'll figure it out. """ ## XXX -- I presently do not support more than one... | def atm_id = (name, alt_loc, fragment_id, chain_id) load_atom(self, atm_id = (name, alt_loc, fragment_id, chain_id) atm_map): atm_id = (name, alt_loc, fragment_id, chain_id) """Called atm_id = (name, alt_loc, fragment_id, chain_id) repeatedly atm_id = (name, alt_loc, fragment_id, chain_id) by atm_id = (name,... | 6,557 |
def load_atom(self, atm_map): """Called repeatedly by the implementation of read_atoms to load all the data for a single atom. The data is contained in the atm_map argument, and is not well documented at this point. Look at this function and you'll figure it out. """ ## XXX -- I presently do not support more than one... | def load_atom(self, atm_map): """Called repeatedly by the implementation of read_atoms to load all the data for a single atom. The data is contained in the atm_map argument, and is not well documented at this point. Look at this function and you'll figure it out. """ ## XXX -- I presently do not support more than one... | 6,558 |
def close(self): for fil in self.fils: fil.close() | def close(self): for fil in self.fils: fil.close() | 6,559 |
def close(self): for fil in self.fils: fil.close() | def close(self): for fil in self.fils: fil.close() | 6,560 |
def atom_test(atom, stats): """Tests the mmLib.Structure.Atom object. """ stats["atom_count"] += 1 stats["testing"] = atom len(atom) alt_loc = atom.get_structure().get_default_alt_loc() atom.get_fragment() atom.get_chain() atom.get_model() atom.get_structure() visited_atm_list = [] for atm in atom.iter_alt_loc(... | def atom_test(atom, stats): """Tests the mmLib.Structure.Atom object. """ stats["atom_count"] += 1 stats["testing"] = atom len(atom) alt_loc = atom.get_structure().get_default_alt_loc() atom.get_fragment() atom.get_chain() atom.get_model() atom.get_structure() visited_atm_list = [] for atm in atom.iter_alt_loc(... | 6,561 |
def __str__(self): try: frag1 = self.segment[0] frag2 = self.segment[-1] except IndexError: return "AlphaHelix(%s %d)" % (self.helix_id, self.helix_class) | def __str__(self): try: frag1 = self.segment[0] frag2 = self.segment[-1] except IndexError: return "AlphaHelix(%s %d)" % (self.helix_id, self.helix_class) | 6,562 |
def refmac5_prep(xyzin, tlsin_list, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = FileLoader.LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] tls_file = TLS.TLSFile() tls_file.set_file_fo... | def refmac5_prep(xyzin, tlsin_list, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = FileLoader.LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] tls_file = TLS.TLSFile() tls_file.set_file_fo... | 6,563 |
def refmac5_prep(xyzin, tlsin_list, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = FileLoader.LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] tls_file = TLS.TLSFile() tls_file.set_file_fo... | def refmac5_prep(xyzin, tlsin_list, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = FileLoader.LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] tls_file = TLS.TLSFile() tls_file.set_file_fo... | 6,564 |
def html_page(self): job_id = check_job_id(self.form) title = 'Input Files for Refmac5 TLS Refinement' x = '' x += self.html_head(title) x += self.html_title(title) | def html_page(self): job_id = check_job_id(self.form) title = 'Input Files for Refmac5 TLS Refinement' x = '' x += self.html_head(title) x += self.html_title(title) | 6,565 |
def isatty(self): return 1 | def isatty(self): return 1 | 6,566 |
def main(self, argv, noshell): cmd = None edit = 0 debug = 0 startup = 0 try: opts, args = getopt.getopt(argv, "c:deist:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.stderr.write(usage_msg) sys.exit(2) for o, a in opts: noshell = 0 if o == '-c': cmd = a if o == '-d': debug = 1 if o == '-... | def main(self, argv, noshell): cmd = None edit = 0 debug = 0 startup = 0 try: opts, args = getopt.getopt(argv, "c:dir:st:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.stderr.write(usage_msg) sys.exit(2) for o, a in opts: noshell = 0 if o == '-c': cmd = a if o == '-d': debug = 1 if o == '... | 6,567 |
def main(self, argv, noshell): cmd = None edit = 0 debug = 0 startup = 0 try: opts, args = getopt.getopt(argv, "c:deist:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.stderr.write(usage_msg) sys.exit(2) for o, a in opts: noshell = 0 if o == '-c': cmd = a if o == '-d': debug = 1 if o == '-... | def main(self, argv, noshell): cmd = None edit = 0 debug = 0 startup = 0 try: opts, args = getopt.getopt(argv, "c:deist:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.stderr.write(usage_msg) sys.exit(2) for o, a in opts: noshell = 0 if o == '-c': cmd = a if o == '-d': debug = 1 if o == '-... | 6,568 |
def main(self, argv, noshell): cmd = None edit = 0 debug = 0 startup = 0 try: opts, args = getopt.getopt(argv, "c:deist:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.stderr.write(usage_msg) sys.exit(2) for o, a in opts: noshell = 0 if o == '-c': cmd = a if o == '-d': debug = 1 if o == '-... | def main(self, argv, noshell): cmd = None edit = 0 debug = 0 startup = 0 try: opts, args = getopt.getopt(argv, "c:deist:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.stderr.write(usage_msg) sys.exit(2) for o, a in opts: noshell = 0 if o == '-c': cmd = a if o == '-d': debug = 1 if o == '-... | 6,569 |
def main(self, argv, noshell): cmd = None edit = 0 debug = 0 startup = 0 try: opts, args = getopt.getopt(argv, "c:deist:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.stderr.write(usage_msg) sys.exit(2) for o, a in opts: noshell = 0 if o == '-c': cmd = a if o == '-d': debug = 1 if o == '-... | def main(self, argv, noshell): cmd = None edit = 0 debug = 0 startup = 0 try: opts, args = getopt.getopt(argv, "c:deist:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.stderr.write(usage_msg) sys.exit(2) for o, a in opts: noshell = 0 if o == '-c': cmd = a if o == '-d': debug = 1 if o == '-... | 6,570 |
def testNtoH(self): for func in socket.htonl, socket.ntohl: for i in (0, 1, ~0xffff, 2L): self.assertEqual(i, func(func(i))) | def testNtoH(self): for func in socket.htonl, socket.ntohl: for i in (0, 1, ~0xffff, 2L): self.assertEqual(i, func(func(i))) | 6,571 |
def _ascii_split(self, s, charset, firstline): # Attempt to split the line at the highest-level syntactic break # possible. Note that we don't have a lot of smarts about field # syntax; we just try to break on semi-colons, then whitespace. rtn = [] lines = s.splitlines() while lines: line = lines.pop(0) if firstline: ... | def _ascii_split(self, s, charset, firstline): # Attempt to split the line at the highest-level syntactic break # possible. Note that we don't have a lot of smarts about field # syntax; we just try to break on semi-colons, then whitespace. rtn = [] lines = s.splitlines() while lines: line = lines.pop(0) if firstline: ... | 6,572 |
def islower (c): return c in string.lowercase | def islower (c): return c in string.lowercase | 6,573 |
def _fix_sentence_endings (self, chunks): """_fix_sentence_endings(chunks : [string]) | def _fix_sentence_endings (self, chunks): """_fix_sentence_endings(chunks : [string]) | 6,574 |
def _fix_sentence_endings (self, chunks): """_fix_sentence_endings(chunks : [string]) | def _fix_sentence_endings (self, chunks): """_fix_sentence_endings(chunks : [string]) | 6,575 |
def dumps(self, values): out = [] write = out.append dump = self.__dump if isinstance(values, Fault): # fault instance write("<fault>\n") dump(vars(values), write) write("</fault>\n") else: # parameter block # FIXME: the xml-rpc specification allows us to leave out # the entire <params> block if there are no parameters... | def dumps(self, values): out = [] write = out.append dump = self.__dump if isinstance(values, Fault): # fault instance write("<fault>\n") dump({'faultCode': values.faultCode, 'faultString': values.faultString}, write) write("</fault>\n") else: # parameter block # FIXME: the xml-rpc specification allows us to leave out ... | 6,576 |
def run (self): | def run (self): | 6,577 |
def do_key(self, event): (what, message, when, where, modifiers) = event c = chr(message & charCodeMask) if modifiers & cmdKey: if c == '.': raise self else: result = MenuKey(ord(c)) id = (result>>16) & 0xffff # Hi word item = result & 0xffff # Lo word if id: self.do_rawmenu(id, item, None, event) | def do_key(self, event): (what, message, when, where, modifiers) = event c = chr(message & charCodeMask) if modifiers & cmdKey: if c == '.': raise self else: result = MenuKey(ord(c)) id = (result>>16) & 0xffff # Hi word item = result & 0xffff # Lo word if id: self.do_rawmenu(id, item, None, event) | 6,578 |
def put(self, data, to=None): args = (self.name, 'put', data) if to: args = args + to apply(self.tk.call, args) | def put(self, data, to=None): args = (self.name, 'put', data) if to: if to[0] == '-to': to = to[1:] args = args + ('-to',) + tuple(to) apply(self.tk.call, args) | 6,579 |
def test_run_abort(self): # returncode handles signal termination p = subprocess.Popen([sys.executable, "-c", "import os; os.abort()"]) p.wait() self.assertEqual(-p.returncode, signal.SIGABRT) | def test_run_abort(self): # returncode handles signal termination old_limit = self._suppress_core_files() try: p = subprocess.Popen([sys.executable, "-c", "import os; os.abort()"]) finally: self._unsuppress_core_files(old_limit) p.wait() self.assertEqual(-p.returncode, signal.SIGABRT) | 6,580 |
def trace_vdelete(self, mode, cbname): self._tk.call("trace", "vdelete", self._name, mode, cbname) self._tk.deletecommand(cbname) | def trace_vdelete(self, mode, cbname): self._tk.call("trace", "vdelete", self._name, mode, cbname) self._tk.deletecommand(cbname) | 6,581 |
def try_cpp (self, body=None, headers=None, include_dirs=None, lang="c"): """Construct a source file from 'body' (a string containing lines of C/C++ code) and 'headers' (a list of header files to include) and run it through the preprocessor. Return true if the preprocessor succeeded, false if there were any errors. ('... | def try_cpp (self, body=None, headers=None, include_dirs=None, lang="c"): """Construct a source file from 'body' (a string containing lines of C/C++ code) and 'headers' (a list of header files to include) and run it through the preprocessor. Return true if the preprocessor succeeded, false if there were any errors. ('... | 6,582 |
def search_cpp (self, pattern, body=None, headers=None, include_dirs=None, lang="c"): """Construct a source file (just like 'try_cpp()'), run it through the preprocessor, and return true if any line of the output matches 'pattern'. 'pattern' should either be a compiled regex object or a string containing a regex. If ... | def search_cpp (self, pattern, body=None, headers=None, include_dirs=None, lang="c"): """Construct a source file (just like 'try_cpp()'), run it through the preprocessor, and return true if any line of the output matches 'pattern'. 'pattern' should either be a compiled regex object or a string containing a regex. If ... | 6,583 |
def search_cpp (self, pattern, body=None, headers=None, include_dirs=None, lang="c"): """Construct a source file (just like 'try_cpp()'), run it through the preprocessor, and return true if any line of the output matches 'pattern'. 'pattern' should either be a compiled regex object or a string containing a regex. If ... | def search_cpp (self, pattern, body=None, headers=None, include_dirs=None, lang="c"): """Construct a source file (just like 'try_cpp()'), run it through the preprocessor, and return true if any line of the output matches 'pattern'. 'pattern' should either be a compiled regex object or a string containing a regex. If ... | 6,584 |
def try_compile (self, body, headers=None, include_dirs=None, lang="c"): """Try to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise. """ from distutils.ccompiler import CompileError self._check_compiler() try: self._compile(body, headers, lang) ok = 1 except CompileError: o... | def try_compile (self, body, headers=None, include_dirs=None, lang="c"): """Try to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise. """ from distutils.ccompiler import CompileError self._check_compiler() try: self._compile(body, headers, include_dirs, lang) ok = 1 except C... | 6,585 |
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 6,586 |
def testMultiply(self): self.assertEquals((0 * 10), 0) self.assertEquals((5 * 8), 40) | def testMultiply(self): self.assertEquals((0 * 10), 0) self.assertEquals((5 * 8), 40) | 6,587 |
def failUnlessAlmostEqual(self, first, second, places=7, msg=None): """Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. | def failUnlessAlmostEqual(self, first, second, places=7, msg=None): """Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. | 6,588 |
def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | 6,589 |
def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | 6,590 |
def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | 6,591 |
def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | 6,592 |
def run(self, test): "Run the given test case or test suite." result = self._makeResult() startTime = time.time() test(result) stopTime = time.time() timeTaken = float(stopTime - startTime) result.printErrors() self.stream.writeln(result.separator2) run = result.testsRun self.stream.writeln("Ran %d test%s in %.3fs" % (... | def run(self, test): "Run the given test case or test suite." result = self._makeResult() startTime = time.time() test(result) stopTime = time.time() timeTaken = stopTime - startTime result.printErrors() self.stream.writeln(result.separator2) run = result.testsRun self.stream.writeln("Ran %d test%s in %.3fs" % (run, ru... | 6,593 |
def cmp(f1, f2, shallow=1, use_statcache=0): """Compare two files. Arguments: f1 -- First file name f2 -- Second file name shallow -- Just check stat signature (do not read the files). defaults to 1. use_statcache -- obsolete argument. Return value: True if the files are the same, False otherwise. This function... | def cmp(f1, f2, shallow=1, use_statcache=None): """Compare two files. Arguments: f1 -- First file name f2 -- Second file name shallow -- Just check stat signature (do not read the files). defaults to 1. use_statcache -- obsolete argument. Return value: True if the files are the same, False otherwise. This funct... | 6,594 |
def cmpfiles(a, b, common, shallow=1, use_statcache=0): """Compare common files in two directories. a, b -- directory names common -- list of file names found in both directories shallow -- if true, do comparison based solely on stat() information use_statcache -- obsolete argument Returns a tuple of three lists: fil... | def cmpfiles(a, b, common, shallow=1, use_statcache=None): """Compare common files in two directories. a, b -- directory names common -- list of file names found in both directories shallow -- if true, do comparison based solely on stat() information use_statcache -- obsolete argument Returns a tuple of three lists: ... | 6,595 |
def demo(): import sys import getopt options, args = getopt.getopt(sys.argv[1:], 'r') if len(args) != 2: raise getopt.error, 'need exactly two args' dd = dircmp(args[0], args[1]) if ('-r', '') in options: dd.report_full_closure() else: dd.report() | def demo(): import sys import getopt options, args = getopt.getopt(sys.argv[1:], 'r') if len(args) != 2: raise getopt.GetoptError('need exactly two args', None) dd = dircmp(args[0], args[1]) if ('-r', '') in options: dd.report_full_closure() else: dd.report() | 6,596 |
def _bytecode_filenames (self, py_filenames): bytecode_files = [] for py_file in py_filenames: if self.compile: bytecode_files.append(py_file + "c") if self.optmize > 0: bytecode_files.append(py_file + "o") | def _bytecode_filenames (self, py_filenames): bytecode_files = [] for py_file in py_filenames: if self.compile: bytecode_files.append(py_file + "c") if self.optimize > 0: bytecode_files.append(py_file + "o") | 6,597 |
def add(self, message): """Add message and return assigned key.""" tmp_file = self._create_tmp() try: self._dump_message(message, tmp_file) finally: tmp_file.close() if isinstance(message, MaildirMessage): subdir = message.get_subdir() suffix = self.colon + message.get_info() if suffix == self.colon: suffix = '' else: ... | def add(self, message): """Add message and return assigned key.""" tmp_file = self._create_tmp() try: self._dump_message(message, tmp_file) finally: _sync_close(tmp_file) if isinstance(message, MaildirMessage): subdir = message.get_subdir() suffix = self.colon + message.get_info() if suffix == self.colon: suffix = '' e... | 6,598 |
def flush(self): """Write any pending changes to disk.""" if not self._pending: return self._lookup() new_file = _create_temporary(self._path) try: new_toc = {} self._pre_mailbox_hook(new_file) for key in sorted(self._toc.keys()): start, stop = self._toc[key] self._file.seek(start) self._pre_message_hook(new_file) new_... | def flush(self): """Write any pending changes to disk.""" if not self._pending: return self._lookup() new_file = _create_temporary(self._path) try: new_toc = {} self._pre_mailbox_hook(new_file) for key in sorted(self._toc.keys()): start, stop = self._toc[key] self._file.seek(start) self._pre_message_hook(new_file) new_... | 6,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.