bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def getCNVQCDataFromDB(cls, data_source_id=1, ecotype_id=None, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=None): """ 2009-11-4 get CNV QC data from database """ sys.stderr.write("Getting CNV QC data ... \n") import Stock_250kDB sql_string = "select a.ecotype_id, c.chromosome, c.start, c.stop, c.size_aff... | def getCNVQCDataFromDB(cls, data_source_id=1, ecotype_id=None, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=None): """ 2009-11-4 get CNV QC data from database """ sys.stderr.write("Getting CNV QC data ... \n") import Stock_250kDB sql_string = "select a.ecotype_id, c.chromosome, c.start, c.stop, c.size_aff... | 464,700 |
def getCNVQCDataFromDB(cls, data_source_id=1, ecotype_id=None, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=None): """ 2009-11-4 get CNV QC data from database """ sys.stderr.write("Getting CNV QC data ... \n") import Stock_250kDB sql_string = "select a.ecotype_id, c.chromosome, c.start, c.stop, c.size_aff... | def getCNVQCDataFromDB(cls, data_source_id=1, ecotype_id=None, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=None): """ 2009-11-4 get CNV QC data from database """ sys.stderr.write("Getting CNV QC data ... \n") import Stock_250kDB sql_string = "select a.ecotype_id, c.chromosome, c.start, c.stop, c.size_aff... | 464,701 |
def countMatchedDeletionsFunctor(cls, cnv_segment_obj, cnv_qc_call, param_obj): """ 2009-11-4 a functor to be called in """ if not hasattr(param_obj, 'no_of_valid_deletions'): setattr(param_obj, 'no_of_valid_deletions', 0) qc_chromosome, qc_start, qc_stop = cnv_qc_call[:3] cnv_qc_call_id = cnv_qc_call[-1] param_obj.cnv... | def countMatchedDeletionsFunctor(cls, param_obj, cnv_segment_obj=None, cnv_qc_call=None): """ 2009-12-9 store qc data in param_obj.array_id2qc_data 2009-11-4 a functor to be called in """ if not hasattr(param_obj, 'no_of_valid_deletions'): setattr(param_obj, 'no_of_valid_deletions', 0) qc_chromosome, qc_start, qc_stop ... | 464,702 |
def countMatchedDeletionsFunctor(cls, cnv_segment_obj, cnv_qc_call, param_obj): """ 2009-11-4 a functor to be called in """ if not hasattr(param_obj, 'no_of_valid_deletions'): setattr(param_obj, 'no_of_valid_deletions', 0) qc_chromosome, qc_start, qc_stop = cnv_qc_call[:3] cnv_qc_call_id = cnv_qc_call[-1] param_obj.cnv... | def countMatchedDeletionsFunctor(cls, cnv_segment_obj, cnv_qc_call, param_obj): """ 2009-11-4 a functor to be called in """ if not hasattr(param_obj, 'no_of_valid_deletions'): setattr(param_obj, 'no_of_valid_deletions', 0) if not hasattr(param_obj, "array_id2qc_data"): param_obj.array_id2qc_data = {} if not hasattr(par... | 464,703 |
def outputFalseNegativeRate(cls, param_obj): """ 2009-11-4 """ no_of_QCCalls_matched = len(param_obj.cnv_qc_call_id_set) no_of_total_QCCalls = sum(map(len, param_obj.ecotype_id2cnv_qc_call_data.values())) false_negative_rate = (no_of_total_QCCalls-no_of_QCCalls_matched)/float(no_of_total_QCCalls) sys.stderr.write("Fals... | def outputFalseNegativeRate(cls, param_obj): """ 2009-11-4 """ for array_id, qc_data in param_obj.array_id2qc_data.iteritems(): no_of_QCCalls_matched = len(qc_data.cnv_qc_call_id_set) no_of_total_QCCalls = len(param_obj.ecotype_id2cnv_qc_call_data[qc_data.ecotype_id]) false_negative_rate = (no_of_total_QCCalls-no_of_QC... | 464,704 |
def outputFalsePositiveRate(cls, param_obj): """ 2009-11-4 """ no_of_valid_deletions = param_obj.no_of_valid_deletions no_of_deletions = param_obj.no_of_deletions no_of_non_valid_deletions = no_of_deletions-no_of_valid_deletions false_positive_rate = no_of_non_valid_deletions/float(no_of_deletions) sys.stderr.write("Fa... | def outputFalsePositiveRate(cls, param_obj): """ 2009-11-4 """ for array_id, qc_data in param_obj.array_id2qc_data.iteritems(): no_of_valid_deletions = qc_data.no_of_valid_deletions no_of_deletions = qc_data.no_of_deletions no_of_non_valid_deletions = no_of_deletions-no_of_valid_deletions false_positive_rate = no_of_no... | 464,705 |
def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True, min_reciprocal_overlap=0.6): """ 2010-1-26 pass min... | 464,706 |
def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 464,707 |
def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 464,708 |
def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 464,709 |
def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 464,710 |
def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 464,711 |
def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 464,712 |
def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 464,713 |
def addAmplitudeFunctor(cls, cnv_segment_obj, cnv_qc_call, param_obj): """ 2009-11-4 """ if not hasattr(param_obj, 'amp_ls'): setattr(param_obj, 'amp_ls', []) qc_chromosome, qc_start, qc_stop = cnv_qc_call[:3] cnv_qc_call_id = cnv_qc_call[-1] param_obj.cnv_qc_call_id_set.add(cnv_qc_call_id) param_obj.amp_ls.append(cnv_... | def addAmplitudeFunctor(cls, cnv_segment_obj, cnv_qc_call, param_obj): """ 2009-11-4 """ if not hasattr(param_obj, 'amp_ls'): setattr(param_obj, 'amp_ls', []) if cnv_qc_call is not None: qc_chromosome, qc_start, qc_stop = cnv_qc_call[:3] cnv_qc_call_id = cnv_qc_call[-1] param_obj.cnv_qc_call_id_set.add(cnv_qc_call_id) ... | 464,714 |
def drawHistOfAmpOfValidatedDeletions(cls, db_250k, input_fname_ls, output_fname_prefix, data_source_id=1, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=5, max_boundary_diff=10000, \ max_diff_perc=0.10, count_embedded_segment_as_match=True): """ 2009-11-4 draw histogram of amplitude of segments who are val... | def drawHistOfAmpOfValidatedDeletions(cls, db_250k, input_fname_ls, output_fname_prefix, data_source_id=1, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=5, max_boundary_diff=10000, \ max_diff_perc=0.10, count_embedded_segment_as_match=True, min_reciprocal_overlap=0.6): """ 2009-11-4 draw histogram of ampli... | 464,715 |
def drawHistOfAmpOfValidatedDeletions(cls, db_250k, input_fname_ls, output_fname_prefix, data_source_id=1, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=5, max_boundary_diff=10000, \ max_diff_perc=0.10, count_embedded_segment_as_match=True): """ 2009-11-4 draw histogram of amplitude of segments who are val... | def drawHistOfAmpOfValidatedDeletions(cls, db_250k, input_fname_ls, output_fname_prefix, data_source_id=1, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=5, max_boundary_diff=10000, \ max_diff_perc=0.10, count_embedded_segment_as_match=True): """ 2009-11-4 draw histogram of amplitude of segments who are val... | 464,716 |
def addNewCNV(self, chromosome, start, stop, array_id=None): """ """ if self.chromosome is None: self.addOneCNV(chromosome, start, stop, array_id) elif self.chromosome is not None and chromosome!=self.chromosome: return False else: """ boundary_diff1 = abs(start-self.start) boundary_diff2 = abs(stop-self.stop) diff1_pe... | def addNewCNV(self, chromosome, start, stop, array_id=None): """ """ if self.chromosome is None: self.addOneCNV(chromosome, start, stop, array_id) elif self.chromosome is not None and chromosome!=self.chromosome: return False else: """ boundary_diff1 = abs(start-self.start) boundary_diff2 = abs(stop-self.stop) diff1_pe... | 464,717 |
def discoverLerDeletionDuplication(cls, db_250k, ler_blast_result_fname, output_fname, deletion_only=True, min_no_of_matches=25): """ 2009-12-7 ler_blast_result_fname is the output of blasting all CNV probes against Ler contigs http://www.arabidopsis.org/browse/Cereon/index.jsp. 2 functions: 1. detect deletions. make s... | def discoverLerDeletionDuplication(cls, db_250k, ler_blast_result_fname, output_fname, deletion_only=True, min_no_of_matches=25): """ 2009-12-7 ler_blast_result_fname is the output of blasting all CNV probes against Ler contigs http://www.arabidopsis.org/browse/Cereon/index.jsp. Two functions: 1. deletion_only=True. ma... | 464,718 |
def discoverLerDeletionDuplication(cls, db_250k, ler_blast_result_fname, output_fname, deletion_only=True, min_no_of_matches=25): """ 2009-12-7 ler_blast_result_fname is the output of blasting all CNV probes against Ler contigs http://www.arabidopsis.org/browse/Cereon/index.jsp. 2 functions: 1. detect deletions. make s... | def discoverLerDeletionDuplication(cls, db_250k, ler_blast_result_fname, output_fname, deletion_only=True, min_no_of_matches=25): """ 2009-12-7 ler_blast_result_fname is the output of blasting all CNV probes against Ler contigs http://www.arabidopsis.org/browse/Cereon/index.jsp. 2 functions: 1. detect deletions. make s... | 464,719 |
def discoverLerDeletionDuplication(cls, db_250k, ler_blast_result_fname, output_fname, deletion_only=True, min_no_of_matches=25): """ 2009-12-7 ler_blast_result_fname is the output of blasting all CNV probes against Ler contigs http://www.arabidopsis.org/browse/Cereon/index.jsp. 2 functions: 1. detect deletions. make s... | def discoverLerDeletionDuplication(cls, db_250k, ler_blast_result_fname, output_fname, deletion_only=True, min_no_of_matches=25): """ 2009-12-7 ler_blast_result_fname is the output of blasting all CNV probes against Ler contigs http://www.arabidopsis.org/browse/Cereon/index.jsp. 2 functions: 1. detect deletions. make s... | 464,720 |
def cmpTwoSNPDatasets(cls, inputFname1, inputFname2): """ 2009-6-12 compare two SNP datasets, report: #rows deleted/added #columns deleted/added #SNPs changed (from which to which) """ sys.stderr.write("Comparing two SNP datasets ... \n") from pymodule import SNPData, TwoSNPData, PassingData snpData1 = SNPData(input_fn... | def cmpTwoSNPDatasets(cls, inputFname1, inputFname2): """ 2009-6-12 compare two SNP datasets, report: #rows deleted/added #columns deleted/added #SNPs changed (from which to which) """ sys.stderr.write("Comparing two SNP datasets ... \n") from pymodule import SNPData, TwoSNPData, PassingData snpData1 = SNPData(input_fn... | 464,721 |
def cmpOneRowToTheOther(cls, inputFname, row_id1, row_id2): """ 2009-6-17 compare SNP data of one accession to the other in the same dataset """ sys.stderr.write("Comparing one row to the other ... \n") from pymodule import SNPData, TwoSNPData, PassingData snpData = SNPData(input_fname=inputFname, turn_into_array=1) tw... | def cmpOneRowToTheOther(cls, inputFname, row_id1, row_id2): """ 2009-6-17 compare SNP data of one accession to the other in the same dataset """ sys.stderr.write("Comparing one row to the other ... \n") from pymodule import SNPData, TwoSNPData, PassingData row_id_key_set = set([row_id1, row_id2]) snpData = SNPData(inpu... | 464,722 |
def cmpOneRowToTheOther(cls, inputFname, row_id1, row_id2): """ 2009-6-17 compare SNP data of one accession to the other in the same dataset """ sys.stderr.write("Comparing one row to the other ... \n") from pymodule import SNPData, TwoSNPData, PassingData snpData = SNPData(input_fname=inputFname, turn_into_array=1) tw... | def cmpOneRowToTheOther(cls, inputFname, row_id1, row_id2): """ 2009-6-17 compare SNP data of one accession to the other in the same dataset """ sys.stderr.write("Comparing one row to the other ... \n") from pymodule import SNPData, TwoSNPData, PassingData snpData = SNPData(input_fname=inputFname, turn_into_array=1) tw... | 464,723 |
def linkEcotypeIDFromSuziPhenotype(cls, fname_with_ID, fname_with_phenotype, output_fname): """ 2009-7-31 she gave me two files one has phenotype data and accession names but with no ecotype ID 2nd is a map from accession name to ecotype ID """ sys.stderr.write("Linking accession names to ecotype ID ... ") import csv i... | def linkEcotypeIDFromSuziPhenotype(cls, fname_with_ID, fname_with_phenotype, output_fname): """ 2009-7-31 she gave me two files one has phenotype data and accession names but with no ecotype ID 2nd is a map from accession name to ecotype ID """ sys.stderr.write("Linking accession names to ecotype ID ... ") import csv i... | 464,724 |
def get_overlap_ratio(span1_ls, span2_ls): """ 2009-12-13 calculate the two overlap ratios for two segments """ segment_start_pos, segment_stop_pos = span1_ls qc_start, qc_stop = span2_ls overlap_length = max(0, segment_stop_pos - qc_start) - max(0, segment_stop_pos - qc_stop) - max(0, segment_start_pos - qc_start) # a... | def get_overlap_ratio(span1_ls, span2_ls): """ 2009-12-13 calculate the two overlap ratios for two segments """ segment_start_pos, segment_stop_pos = span1_ls qc_start, qc_stop = span2_ls overlap_length = max(0, segment_stop_pos - qc_start) - max(0, segment_stop_pos - qc_stop) - max(0, segment_start_pos - qc_start) # a... | 464,725 |
def is_reciprocal_overlap(span1_ls, span2_ls, min_reciprocal_overlap=0.6): """ 2009-12-12 return True if both overlap ratios are above the min_reciprocal_overlap """ overlap1, overlap2 = get_overlap_ratio(span1_ls, span2_ls) if overlap1>=min_reciprocal_overlap and overlap2>=min_reciprocal_overlap: return True else: ret... | def is_reciprocal_overlap(span1_ls, span2_ls, min_reciprocal_overlap=0.6): """ 2009-12-12 return True if both overlap ratios are above the min_reciprocal_overlap """ overlap1, overlap2 = get_overlap_ratio(span1_ls, span2_ls) if overlap1>=min_reciprocal_overlap and overlap2>=min_reciprocal_overlap: return True else: ret... | 464,726 |
def __eq__(self, other): """ 2009-12-12 """ if self.chromosome==other.chromosome: if len(self.span_ls)==1: if len(other.span_ls)==1: return self.span_ls[0]==other.span_ls[0] elif len(other.span_ls)>1: return self.span_ls[0]>=other.span_ls[0] and self.span_ls[0]<=other.span_ls[1] # equal if self is within the "other" se... | def __eq__(self, other): """ 2009-12-12 """ if self.chromosome==other.chromosome: if len(self.span_ls)==1: if len(other.span_ls)==1: return self.span_ls[0]==other.span_ls[0] elif len(other.span_ls)>1: return self.span_ls[0]>=other.span_ls[0] and self.span_ls[0]<=other.span_ls[1] # equal if self is within the "other" se... | 464,727 |
def getCNVDataFromFileInGWA(input_fname_ls, array_id, max_amp=-0.33, min_amp=-0.33, min_size=50, min_no_of_probes=None, report=False): """ 2009-10-31 get deletion (below max_amp) or duplication (above min_amp) from files (output by RunGADA.py) """ sys.stderr.write("Getting CNV calls for array %s, min_size %s, min_no_of... | def getCNVDataFromFileInGWA(input_fname_ls, array_id, max_amp=-0.33, min_amp=-0.33, min_size=50, min_no_of_probes=None, report=False): """ 2009-10-31 get deletion (below max_amp) or duplication (above min_amp) from files (output by RunGADA.py) """ sys.stderr.write("Getting CNV calls for array %s, min_size %s, min_no_of... | 464,728 |
def getCNVDataFromFileInGWA(input_fname_ls, array_id, max_amp=-0.33, min_amp=-0.33, min_size=50, min_no_of_probes=None, report=False): """ 2009-10-31 get deletion (below max_amp) or duplication (above min_amp) from files (output by RunGADA.py) """ sys.stderr.write("Getting CNV calls for array %s, min_size %s, min_no_of... | def getCNVDataFromFileInGWA(input_fname_ls, array_id, max_amp=-0.33, min_amp=-0.33, min_size=50, min_no_of_probes=None, report=False): """ 2009-10-31 get deletion (below max_amp) or duplication (above min_amp) from files (output by RunGADA.py) """ sys.stderr.write("Getting CNV calls for array %s, min_size %s, min_no_of... | 464,729 |
def getCNVDataFromFileInGWA(input_fname_ls, array_id, max_amp=-0.33, min_amp=-0.33, min_size=50, min_no_of_probes=None, report=False): """ 2009-10-31 get deletion (below max_amp) or duplication (above min_amp) from files (output by RunGADA.py) """ sys.stderr.write("Getting CNV calls for array %s, min_size %s, min_no_of... | def getCNVDataFromFileInGWA(input_fname_ls, array_id, max_amp=-0.33, min_amp=-0.33, min_size=50, min_no_of_probes=None, report=False): """ 2009-10-31 get deletion (below max_amp) or duplication (above min_amp) from files (output by RunGADA.py) """ sys.stderr.write("Getting CNV calls for array %s, min_size %s, min_no_of... | 464,730 |
def __init__(self, **keywords): """ 2008-11-10 upgrade option handling to ProcessOptions 2008-4-2 2008-02-28 argument_default_dict is a dictionary of default arguments, the key is a tuple, ('argument_name', is_argument_required, argument_type) argument_type is optional """ #argument dictionary #self.ad = process_funct... | def@classmethod __init__(self,@classmethod @classmethod **keywords):@classmethod """@classmethod 2008-11-10@classmethod upgrade@classmethod option@classmethod handling@classmethod to@classmethod ProcessOptions@classmethod 2008-4-2@classmethod 2008-02-28@classmethod argument_default_dict@classmethod is@classmethod a@cla... | 464,731 |
def get_phenotype_method_id_info(cls, curs, phenotype_avg_table, phenotype_method_table ): """ 2009-2-2 curs could be either MySQLdb cursor or elixirdb.metadata.bind. do two selects in one 2008-4-2 """ sys.stderr.write("Getting phenotype_method_id info ... " ) phenotype_method_id2index = {} #index of the matrix method... | def get_phenotype_method_id_info(cls, curs, phenotype_avg_table, phenotype_method_table ): """ 2009-2-2 curs could be either MySQLdb cursor or elixirdb.metadata.bind. do two selects in one 2008-4-2 """ sys.stderr.write("Getting phenotype_method_id info ... " ) phenotype_method_id2index = {} #index of the matrix method... | 464,732 |
def get_ecotype_id2info(cls, curs, phenotype_avg_table, ecotype_table): """ 2009-2-2 curs could be either MySQLdb cursor or elixirdb.metadata.bind. do two selects in one 2008-4-2 """ sys.stderr.write("Getting ecotype id info ... " ) ecotype_id2index = {} #index of the matrix ecotype_id_ls = [] ecotype_name_ls = [] row... | def get_ecotype_id2info(cls, curs, phenotype_avg_table, ecotype_table): """ 2009-2-2 curs could be either MySQLdb cursor or elixirdb.metadata.bind. do two selects in one 2008-4-2 """ sys.stderr.write("Getting ecotype id info ... " ) ecotype_id2index = {} #index of the matrix ecotype_id_ls = [] ecotype_name_ls = [] row... | 464,733 |
def get_matrix(cls, curs, phenotype_avg_table, ecotype_id2index, phenotype_info, get_raw_data=0, \ phenotype_method_table='phenotype_method'): """ 2009-9-2 if value>-5e-7 and value<+5e-7: #beyond float resolution by a python float value = 0 without condition above, values like -5.32907e-15 would be taken as -5.32907e,... | def get_matrix(cls, curs, phenotype_avg_table, ecotype_id2index, phenotype_info, get_raw_data=0, \ phenotype_method_table='phenotype_method'): """ 2009-9-2 if value>-5e-7 and value<+5e-7: #beyond float resolution by a python float value = 0 without condition above, values like -5.32907e-15 would be taken as -5.32907e,... | 464,734 |
def getPhenotypeData(cls, curs, phenotype_avg_table=None, phenotype_method_table=None, ecotype_table='stock.ecotype', get_raw_data=1): """ 2009-2-2 wrap up all other 3 methods """ phenotype_info = cls.get_phenotype_method_id_info(curs, phenotype_avg_table, phenotype_method_table) ecotype_id2index, ecotype_id_ls, ecotyp... | def getPhenotypeData(cls, curs, phenotype_avg_table=None, phenotype_method_table=None, ecotype_table='stock.ecotype', get_raw_data=1): """ 2009-2-2 wrap up all other 3 methods """ phenotype_info = cls.get_phenotype_method_id_info(curs, phenotype_avg_table, phenotype_method_table) ecotype_id2index, ecotype_id_ls, ecotyp... | 464,735 |
def run(self): import MySQLdb conn = MySQLdb.connect(db=self.dbname, host=self.hostname, user = self.db_user, passwd = self.db_passwd) curs = conn.cursor() pheno_data = self.getPhenotypeData(curs, self.phenotype_avg_table, self.phenotype_method_table, \ self.ecotype_table, get_raw_data=self.get_raw_data) header = ['e... | def run(self): import MySQLdb conn = MySQLdb.connect(db=self.dbname, host=self.hostname, user = self.db_user, passwd = self.db_passwd) curs = conn.cursor() pheno_data = self.getPhenotypeData(curs, self.phenotype_avg_table, self.phenotype_method_table, \ self.ecotype_table, get_raw_data=self.get_raw_data) header = ['e... | 464,736 |
def output(self, data_matrix, probe_id_ls, chr_pos_ls, header, output_fname_prefix, split_genome_into_chromosomes=False): """ 2009-10-11 add argument split_genome_into_chromosomes 2009-5-18 split output into different chromosomes """ sys.stderr.write("Outputting ...") no_of_rows, no_of_cols = data_matrix.shape old_chr ... | @classmethod def output(cls, data_matrix, probe_id_ls, chr_pos_ls, header, output_fname_prefix, split_genome_into_chromosomes=False): """ 2010-2-10 becomes classmethod 2009-10-11 add argument split_genome_into_chromosomes 2009-5-18 split output into different chromosomes """ sys.stderr.write("Outputting ...") no_of_row... | 464,737 |
def index(self): return redirect_to("/css/main.css") | def index(self): response.headers['content-type'] = 'text/css; charset=utf-8' return render("/css/main.css") | 464,738 |
def index(self): return redirect_to("/css/main.css") | def index(self): response.headers['content-type'] = 'text/css; charset=utf-8' return render("/css/main.css") | 464,739 |
def __init__(self, idl, config): update = idl.update() if idl.arch() != "i386": raise Exception, "Invalid arch " + arch + "for RHEL-2.1 guest" self.ks_file = ozutil.generate_full_auto_path("rhel-2.1-jeos.ks") | def __init__(self, idl, config): update = idl.update() if idl.arch() != "i386": raise Exception, "Invalid arch " + arch + "for RHEL-2.1 guest" self.ks_file = ozutil.generate_full_auto_path("rhel-2.1-jeos.ks") | 464,740 |
def progress(down_total, down_current, up_total, up_current): # FIXME: we should probably not print every single time this is # called; maybe every 1MB or so? self.log.info("%dkB of %dkB" % (down_current/1024, down_total/1024)) | def progress(down_total, down_current, up_total, up_current): # FIXME: we should probably not print every single time this is # called; maybe every 1MB or so? self.log.info("%dkB of %dkB" % (down_current/1024, down_total/1024)) | 464,741 |
def modify_iso(self): self.log.debug("Putting the kickstart in place") | def modify_iso(self): self.log.debug("Putting the kickstart in place") | 464,742 |
def generate_define_xml(self, bootdev, want_install_disk=True): self.log.info("Generate/define XML for guest %s with bootdev %s" % (self.name, bootdev)) | def generate_define_xml(self, bootdev, want_install_disk=True): self.log.info("Generate/define XML for guest %s with bootdev %s" % (self.name, bootdev)) | 464,743 |
def __init__(self, idl, config): update = idl.update() arch = idl.arch() self.ks_file = ozutil.generate_full_auto_path("rhel-3-jeos.ks") | def __init__(self, idl, config): update = idl.update() arch = idl.arch() self.ks_file = ozutil.generate_full_auto_path("rhel-3-jeos.ks") | 464,744 |
def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk') ... | 464,745 |
def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | 464,746 |
def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | 464,747 |
def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | 464,748 |
def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | 464,749 |
def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | 464,750 |
def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | 464,751 |
def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | 464,752 |
def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | 464,753 |
def __init__(self, idl, config, nicmodel, haverepo, diskbus): update = idl.update() arch = idl.arch() self.ks_file = ozutil.generate_full_auto_path("fedora-" + update + "-jeos.ks") self.haverepo = haverepo self.installtype = idl.installtype() | def __init__(self, idl, config, nicmodel, haverepo, diskbus, brokenisomethod): update = idl.update() arch = idl.arch() self.ks_file = ozutil.generate_full_auto_path("fedora-" + update + "-jeos.ks") self.haverepo = haverepo self.installtype = idl.installtype() | 464,754 |
def checksum(data): s = 0 for i in range(0, len(data), 2): w = ord(data[i]) + (ord(data[i+1]) << 8) s = numpy.uint16(numpy.uint16(s) + numpy.uint16(w)) return s | def checksum(data): s = 0 for i in range(0, len(data), 2): w = ord(data[i]) + (ord(data[i+1]) << 8) s = numpy.uint16(numpy.uint16(s) + numpy.uint16(w)) return s | 464,755 |
def modify_iso(self): self.log.debug("Putting the kickstart in place") | def modify_iso(self): self.log.debug("Putting the kickstart in place") | 464,756 |
def modify_iso(self): self.log.debug("Putting the kickstart in place") | def modify_iso(self): self.log.debug("Putting the kickstart in place") | 464,757 |
def modify_iso(self): self.log.debug("Putting the kickstart in place") | def modify_iso(self): self.log.debug("Putting the kickstart in place") | 464,758 |
def modify_iso(self): self.log.debug("Putting the kickstart in place") | def modify_iso(self): self.log.debug("Putting the kickstart in place") | 464,759 |
def output_cdl_xml(self, lines, services): doc = libxml2.newDoc("1.0") cdl = doc.newChild(None, "cdl", None) packages = cdl.newChild(None, "packages", None) | def output_cdl_xml(self, lines, services): doc = libxml2.newDoc("1.0") cdl = doc.newChild(None, "cdl", None) packages = cdl.newChild(None, "packages", None) | 464,760 |
def output_cdl_xml(self, lines, services): doc = libxml2.newDoc("1.0") cdl = doc.newChild(None, "cdl", None) packages = cdl.newChild(None, "packages", None) | def output_cdl_xml(self, lines, services): doc = libxml2.newDoc("1.0") cdl = doc.newChild(None, "cdl", None) packages = cdl.newChild(None, "packages", None) | 464,761 |
def __init__(self, distro, update, arch, nicmodel, clockoffset, mousetype, diskbus, config): if arch != "i386" and arch != "x86_64": raise Exception, "Unsupported guest arch " + arch self.log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__)) self.uuid = uuid.uuid4() mac = [0x52, 0x54, 0x00, random.rand... | def __init__(self, distro, update, arch, nicmodel, clockoffset, mousetype, diskbus, config): if arch != "i386" and arch != "x86_64": raise Exception, "Unsupported guest arch " + arch self.log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__)) self.uuid = uuid.uuid4() mac = [0x52, 0x54, 0x00, random.rand... | 464,762 |
def generate_new_iso(self): self.log.info("Generating new ISO") Guest.subprocess_check_output(["mkisofs", "-r", "-V", "Custom", "-cache-inodes", "-J", "-l", "-b", "isolinux/isolinux.bin", "-c", "isolinux/boot.cat", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", "-v", "-v", "-o", output, inputdir]) | def generate_new_iso(self): self.log.info("Generating new ISO") Guest.subprocess_check_output(["mkisofs", "-r", "-V", "Custom", "-cache-inodes", "-J", "-l", "-b", "isolinux/isolinux.bin", "-c", "isolinux/boot.cat", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", "-v", "-v", "-o", output, inputdir]) | 464,763 |
def generate_new_iso(self): self.log.info("Generating new ISO") Guest.subprocess_check_output(["mkisofs", "-r", "-V", "Custom", "-cache-inodes", "-J", "-l", "-b", "isolinux/isolinux.bin", "-c", "isolinux/boot.cat", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", "-v", "-v", "-o", output, inputdir]) | def generate_new_iso(self): self.log.info("Generating new ISO") Guest.subprocess_check_output(["mkisofs", "-r", "-V", "Custom", "-cache-inodes", "-J", "-l", "-b", "isolinux/isolinux.bin", "-c", "isolinux/boot.cat", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", "-v", "-v", "-o", output, inputdir]) | 464,764 |
def generate_new_iso(self): self.log.info("Generating new ISO") Guest.subprocess_check_output(["mkisofs", "-r", "-V", "Custom", "-cache-inodes", "-J", "-l", "-b", "isolinux/isolinux.bin", "-c", "isolinux/boot.cat", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", "-v", "-v", "-o", output, inputdir]) | def generate_new_iso(self): self.log.info("Generating new ISO") Guest.subprocess_check_output(["mkisofs", "-r", "-V", "Custom", "-cache-inodes", "-J", "-l", "-b", "isolinux/isolinux.bin", "-c", "isolinux/boot.cat", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", "-v", "-v", "-o", output, inputdir]) | 464,765 |
def targetDev(self, doc, type, path, bus): installNode = doc.createElement("disk") installNode.setAttribute("type", "file") installNode.setAttribute("device", type) sourceInstallNode = doc.createElement("source") sourceInstallNode.setAttribute("file", path) installNode.appendChild(sourceInstallNode) targetInstallNode =... | def targetDev(self, doc, devicetype, path, bus): installNode = doc.createElement("disk") installNode.setAttribute("type", "file") installNode.setAttribute("device", type) sourceInstallNode = doc.createElement("source") sourceInstallNode.setAttribute("file", path) installNode.appendChild(sourceInstallNode) targetInstall... | 464,766 |
def targetDev(self, doc, type, path, bus): installNode = doc.createElement("disk") installNode.setAttribute("type", "file") installNode.setAttribute("device", type) sourceInstallNode = doc.createElement("source") sourceInstallNode.setAttribute("file", path) installNode.appendChild(sourceInstallNode) targetInstallNode =... | def targetDev(self, doc, type, path, bus): installNode = doc.createElement("disk") installNode.setAttribute("type", "file") installNode.setAttribute("device", devicetype) sourceInstallNode = doc.createElement("source") sourceInstallNode.setAttribute("file", path) installNode.appendChild(sourceInstallNode) targetInstall... | 464,767 |
def PostLynchedMessage(self, game, name): if not game.post_lynches: return | def PostLynchedMessage(self, game, name): if not game.post_lynches: return | 464,768 |
def twitter_in_bg(msg): consumer_key = "r11W5M2m2tdNtcknWSjNKw" consumer_secret = "zSd0vCV2mTcWVyKfAKiIcm6gdzozLEVMjXXpT51XV3c" oauth_token = "166303978-z0Dp7pAoKrgs2ZjN7rCmwVmd9zum4LaUNjH5fzhJ" oauth_token_secret = "YK7cOAF7HcSbvn43EPGBgSXyQ5RWIaruYAfTz3lNpwE" twitter = OAuthApi(consumer_key, consumer_secret, oauth_t... | def twitter_in_bg(msg): consumer_key = "r11W5M2m2tdNtcknWSjNKw" consumer_secret = "zSd0vCV2mTcWVyKfAKiIcm6gdzozLEVMjXXpT51XV3c" oauth_token = "166303978-z0Dp7pAoKrgs2ZjN7rCmwVmd9zum4LaUNjH5fzhJ" oauth_token_secret = "YK7cOAF7HcSbvn43EPGBgSXyQ5RWIaruYAfTz3lNpwE" twitter = OAuthApi(consumer_key, consumer_secret, oauth_t... | 464,769 |
def ReplyToThread(self, thread, message): getUrl = "http://forums.somethingawful.com/newreply.php?action=newreply&threadid=%s" % thread postUrl = "http://forums.somethingawful.com/newreply.php?action=newreply" | def ReplyToThread(self, thread, message): getUrl = "http://forums.somethingawful.com/newreply.php?action=newreply&threadid=%s" % thread postUrl = "http://forums.somethingawful.com/newreply.php?action=newreply" | 464,770 |
def think(self): """ Performs a single step of thinking for our agent. Gets called on every iteration of our think loop. """ | def think(self): """ Performs a single step of thinking for our agent. Gets called on every iteration of our think loop. """ | 464,771 |
def __init__(self, world_model): self.world_model = world_model | def __init__(self, world_model, body_model): self.world_model = world_model | 464,772 |
def kick(self, power, relative_direction): """ Accelerates the ball with the given power in the given direction, relative to the current direction of the player's body. """ | def kick(self, power, relative_direction): """ Accelerates the ball with the given power in the given direction, relative to the current direction of the player's body. """ | 464,773 |
def destroyed_method(): """ Raises an error, no matter the arguments given. """ m = ("Agent has been disconnected and no longer supports " "any method calls.") raise NotImplementedError(m) | def destroyed_method(): """ Raises an error, no matter the arguments given. """ m = ("Agent has been disconnected and no longer supports " "any method calls.") raise NotImplementedError(m) | 464,774 |
def __init__(self, distance, direction, position): """ Field objects have a position in addition to GameObject's members. """ | def __init__(self, distance, direction, position): """ Field objects have a position in addition to GameObject's members. """ | 464,775 |
def __init__(self, distance, direction, line_id): self.line_id = line_id super.__init__(self, distance, direction) | def __init__(self, distance, direction, line_id): self.line_id = line_id super.__init__(self, distance, direction) | 464,776 |
def __init__(self, distance, direction, position, dist_change, dir_change, speed): """ Adds variables for velocity vector deltas. """ | def __init__(self, distance, direction, position, dist_change, dir_change, speed): """ Adds variables for velocity vector deltas. """ | 464,777 |
def __init__(self, distance, direction, position): | def __init__(self, distance, direction, position): | 464,778 |
def __init__(self, distance, direction, position, dist_change, dir_change, speed): super.__init__(self, distance, direction, position, dist_change, dir_change, speed) | def __init__(self, distance, direction, position, dist_change, dir_change, speed): MobileObject.__init__(self, distance, direction, position, dist_change, dir_change, speed) | 464,779 |
def __init__(self, distance, direction, position, dist_change, dir_change, speed, team, side, uniform_number, body_direction, face_direction, neck_direction): """ Adds player-specific information to a mobile object. """ | def __init__(self, distance, direction, position, dist_change, dir_change, speed, team, side, uniform_number, body_direction, face_direction, neck_direction): """ Adds player-specific information to a mobile object. """ | 464,780 |
def __init__(self, distance, direction, position, marker_id): """ Adds a marker id for this field object. Every marker has a unique id. """ | def __init__(self, distance, direction, position, marker_id): """ Adds a marker id for this field object. Every marker has a unique id. """ | 464,781 |
def think(self): """ Performs a single step of thinking for our agent. Gets called on every iteration of our think loop. """ | def think(self): """ Performs a single step of thinking for our agent. Gets called on every iteration of our think loop. """ | 464,782 |
def _handle_error(self, msg): """ Deals with error messages by raising them as exceptions. """ | def _handle_error(self, msg): """ Deals with error messages by raising them as exceptions. """ | 464,783 |
def __init__(self, host, port, teamname, version=11): """ Gives us a connection to the server as one player on a team. This immediately connects the agent to the server and starts receiving and parsing the information it sends. """ | def __init__(self, host, port, teamname, version=11): """ Gives us a connection to the server as one player on a team. This immediately connects the agent to the server and starts receiving and parsing the information it sends. """ | 464,784 |
def __init__(self, host, port, teamname, version=11): """ Gives us a connection to the server as one player on a team. This immediately connects the agent to the server and starts receiving and parsing the information it sends. """ | def __init__(self, host, port, teamname, version=11): """ Gives us a connection to the server as one player on a team. This immediately connects the agent to the server and starts receiving and parsing the information it sends. """ | 464,785 |
def think(self): """ Performs a single step of thinking for our agent. Gets called on every iteration of our think loop. """ | def think(self): """ Performs a single step of thinking for our agent. Gets called on every iteration of our think loop. """ | 464,786 |
def stringify(itemlist): """ Takes a list generated by parsing a message and condenses the characters it contains into strings, seperating them by spaces and leaving them alongside the lists therin. """ result = [] s = "" for item in itemlist: if item == " ": if s != "": result.append(s) s = "" elif type(item) is typ... | def stringify(itemlist): """ Takes a list generated by parsing a message and condenses the characters it contains into strings, seperating them by spaces and leaving them alongside the lists therin. """ result = [] s = "" for item in itemlist: if item == " ": if s != "": result.append(s) s = "" elif type(item) is typ... | 464,787 |
def gdb_import_osm(gdb, osmdb, vertex_namespace, slogs, profiledb=None): cursor = gdb.get_cursor() n_edges = osmdb.count_edges() # for each edge in the osmdb for i, (vertex1_label, vertex2_label, edge ) in enumerate( edges_from_osmdb( osmdb, vertices_namespace, slogs, profiledb ) ): if i%(n_edges//100+1)==0: sys.std... | def gdb_import_osm(gdb, osmdb, vertex_namespace, slogs, profiledb=None): cursor = gdb.get_cursor() n_edges = osmdb.count_edges() # for each edge in the osmdb for i, (vertex1_label, vertex2_label, edge ) in enumerate( edges_from_osmdb( osmdb, vertex_namespace, slogs, profiledb ) ): if i%(n_edges//100+1)==0: sys.stdou... | 464,788 |
def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | 464,789 |
def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | 464,790 |
def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | 464,791 |
def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | 464,792 |
def populate(self, graph, reporter=None): c = self.conn.cursor() n = len(graph.vertices) for i, vv in enumerate( graph.vertices ): if reporter and i%(n//100)==0: reporter.write( "%d/%d vertices dumped\n"%(i,n) ) c.execute( "INSERT INTO vertices VALUES (?)", (vv.label,) ) for ee in vv.outgoing: c.execute( "INSERT INTO... | def populate(self, graph, reporter=None): c = self.conn.cursor() n = len(graph.vertices) for i, vv in enumerate( graph.vertices ): if reporter and i%(nseg//100)==0: reporter.write( "%d/%d vertices dumped\n"%(i,n) ) c.execute( "INSERT INTO vertices VALUES (?)", (vv.label,) ) for ee in vv.outgoing: c.execute( "INSERT I... | 464,793 |
def nearest_node(self, lat, lon, range=0.005): c = self.get_cursor() if self.index: #print "YOUR'RE USING THE INDEX" id = self.index.nearest( (lon, lat), 1 )[0] #print "THE ID IS %d"%id c.execute( "SELECT id, lat, lon FROM nodes WHERE id = ?", (id,) ) else: c.execute( "SELECT id, lat, lon FROM nodes WHERE endnode_refs... | def nearest_node(self, lat, lon, range=0.005): c = self.get_cursor() if self.index: #print "YOUR'RE USING THE INDEX" id = list(self.index.nearest( (lon, lat), 1 ))[0] #print "THE ID IS %d"%id c.execute( "SELECT id, lat, lon FROM nodes WHERE id = ?", (id,) ) else: c.execute( "SELECT id, lat, lon FROM nodes WHERE endnod... | 464,794 |
def glen(gen): return len(list(gen)) | defTestHeadwayAlight, glen(gen):TestHeadwayAlight, returnTestHeadwayAlight, len(list(gen))TestHeadwayAlight, | 464,795 |
def endElement(self,name): if name=='node': if superself.n_nodes%5000==0: print "node %d"%superself.n_nodes superself.n_nodes += 1 if not dryrun: superself.add_node( self.currElem, c ) elif name=='way': if superself.n_ways%5000==0: print "way %d"%superself.n_ways superself.n_ways += 1 if not dryrun: superself.add_way( ... | def endElement(self,name): if name=='node': if superself.n_nodes%5000==0: print "node %d"%superself.n_nodes superself.n_nodes += 1 if not dryrun: superself.add_node( self.currElem, c ) elif name=='way': if superself.n_ways%5000==0: print "way %d"%superself.n_ways superself.n_ways += 1 if not dryrun: superself.add_way( ... | 464,796 |
def load_gtfs_table_to_sqlite(fp, gtfs_basename, cc, header=None, verbose=False): """header is iterable of (fieldname, fieldtype, processing_function). For example, (("stop_sequence", "INTEGER", int),). "TEXT" is default fieldtype. Default processing_function is lambda x:x""" ur = UTF8TextFile( fp ) rd = csv.reader( u... | def load_gtfs_table_to_sqlite(fp, gtfs_basename, cc, header=None, verbose=False): """header is iterable of (fieldname, fieldtype, processing_function). For example, (("stop_sequence", "INTEGER", int),). "TEXT" is default fieldtype. Default processing_function is lambda x:x""" ur = UTF8TextFile( fp ) rd = csv.reader( u... | 464,797 |
def load_gtfs_table_to_sqlite(fp, gtfs_basename, cc, header=None, verbose=False): """header is iterable of (fieldname, fieldtype, processing_function). For example, (("stop_sequence", "INTEGER", int),). "TEXT" is default fieldtype. Default processing_function is lambda x:x""" ur = UTF8TextFile( fp ) rd = csv.reader( u... | def load_gtfs_table_to_sqlite(fp, gtfs_basename, cc, header=None, verbose=False): """header is iterable of (fieldname, fieldtype, processing_function). For example, (("stop_sequence", "INTEGER", int),). "TEXT" is default fieldtype. Default processing_function is lambda x:x""" ur = UTF8TextFile( fp ) rd = csv.reader( u... | 464,798 |
def load_gtfs_table_to_sqlite(fp, gtfs_basename, cc, header=None, verbose=False): """header is iterable of (fieldname, fieldtype, processing_function). For example, (("stop_sequence", "INTEGER", int),). "TEXT" is default fieldtype. Default processing_function is lambda x:x""" ur = UTF8TextFile( fp ) rd = csv.reader( u... | def load_gtfs_table_to_sqlite(fp, gtfs_basename, cc, header=None, verbose=False): """header is iterable of (fieldname, fieldtype, processing_function). For example, (("stop_sequence", "INTEGER", int),). "TEXT" is default fieldtype. Default processing_function is lambda x:x""" ur = UTF8TextFile( fp ) rd = csv.reader( u... | 464,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.