query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get gradient of layer w.r.t. input
def d_dinput(self, ): if self.max_pool: df_dx = self.gen_df_dx((self.indices, self.current_input.shape), self.output_shape)(self.current_input) else: # if its trainable then the parameters will have changed and we # need to rebuild f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_gradient(self):\n # Fast path\n if self._gradient is not None:\n return self._gradient\n # Flatten (make if necessary)\n gradient = tools.flatten(tools.grads_of(self._model.parameters()))\n self._gradient = gradient\n return gradient", "def compute_gradient(self, grad=None):\n ...
[ "0.78446084", "0.7454795", "0.7414165", "0.73661286", "0.7339103", "0.73385197", "0.730173", "0.72988003", "0.72886133", "0.7264903", "0.72599643", "0.72508866", "0.71907014", "0.7170893", "0.71661574", "0.716205", "0.7159538", "0.71528375", "0.71518123", "0.71518123", "0.714...
0.0
-1
Layer gradietn w.r.t. weights
def d_dweight(self, ): return self.gen_df_dw(self.params, self.output_shape)(self.current_input)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_weights(self):", "def apply_on_layer(self, layer):\n init_g = Constant(1.)\n\n try:\n weight_tag = 'W' if hasattr(layer, 'W') else 'U'\n except AttributeError:\n raise AttributeError(\"Trying to call weight norm on {} \".format(layer)+\\\n ...
[ "0.6715377", "0.63848263", "0.62963724", "0.61965996", "0.6194673", "0.61767", "0.6139174", "0.61305153", "0.61224943", "0.6117915", "0.6117915", "0.6087451", "0.6044396", "0.6016933", "0.6011271", "0.5999865", "0.5955873", "0.59331846", "0.5928005", "0.59248793", "0.59248793...
0.0
-1
Layer gradietn w.r.t. bias
def d_dbias(self, ): out = self.gen_df_db(self.params, self.output_shape)(self.current_input) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bias_prior(self):", "def get_bias(self):", "def bias(self):\n if self._bias is None:\n with self:\n self._bias = nengo.Node([1], label='cortical bias')\n return self._bias", "def bias_(self):\n return self.get_tensor_value('logistic_regression/bias:0')", "...
[ "0.7033934", "0.701894", "0.6693003", "0.6667423", "0.65386903", "0.6533102", "0.6450065", "0.6307289", "0.62953794", "0.6220519", "0.6218021", "0.62141305", "0.621233", "0.6153833", "0.6114264", "0.6079437", "0.6056445", "0.6056445", "0.6056445", "0.6049752", "0.6019976", ...
0.0
-1
Return the first_name plus the last_name, with a space in between.
def get_full_name(self): full_name = '%s %s' % (self.first_name, self.last_name) return full_name.strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(first_name, last_name):\n return first_name + \" \" + last_name", "def full_name(first_name, last_name):\n\t\n\treturn first_name + \" \" + last_name", "def get_formated_name(first_name,last_name):\n\tfull_name = first_name + '' + last_name\n\treturn full_name.title()", "def get_full_name(se...
[ "0.83418363", "0.82269484", "0.8099016", "0.80672693", "0.8052289", "0.80440307", "0.7993753", "0.7992884", "0.7992884", "0.7992884", "0.79781276", "0.79624933", "0.7956748", "0.79396284", "0.7936353", "0.79332894", "0.79148924", "0.79008836", "0.7892486", "0.7869447", "0.785...
0.7785872
54
Simulates a user's profile
def describe_user(self): print('\nFirst Name: ' + self.first_name.title(), end='\n',) print('Last Name: ' + self.last_name.title(), end='\n') print('Address: ' + self.address.title(), end='\n',) print('State: ' + self.state.title(), end='\n',) print('Country: ' + self.countr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_view(cls, user, profile):\r\n pass", "def user_view(cls, user, profile):\n pass", "def _profile(user):\n profile = UserProfile()\n profile.user_id = user.id\n profile.save()", "def user_profile(rayvision_connect, mock_requests):\n return UserProfile(rayvision_connect, auto_...
[ "0.73372257", "0.7179101", "0.71723765", "0.7114612", "0.7095808", "0.69884944", "0.6977845", "0.6964265", "0.6922696", "0.6919543", "0.69124097", "0.6883565", "0.6828427", "0.6826876", "0.679845", "0.67761904", "0.6757307", "0.67399824", "0.6714277", "0.6703913", "0.66998863...
0.0
-1
Increases the login attempts by 1
def increment_login_attempts(self, increment): increment == self.login_attempts self.login_attempts += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increment_login_attemtps(self):\r\n self.login_attempts += 1", "def increment_login_attempts(self):\n\t\tself.login_attempts += 1", "def increment_login_attempts(self):\n\t\tself.login_attempts += 1", "def increment_login_attempts(self):\n self.login_attempts += 1", "def increment_login_a...
[ "0.9045635", "0.8914883", "0.8914883", "0.8761578", "0.8761578", "0.8761578", "0.8761578", "0.8761578", "0.8761578", "0.8761578", "0.85113835", "0.8227807", "0.78676057", "0.7603771", "0.7603771", "0.7553793", "0.74939764", "0.74939764", "0.74939764", "0.74939764", "0.7493976...
0.840855
11
Resets the login attempts
def reset_login_attempt(self, reset): reset == self.login_attempts self.login_attempts -= self.login_attempts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_login_attemtps(self):\r\n self.login_attempts = 0", "def reset_login_attempts(self):\n\t\tself.login_attempts = 0", "def reset_login_attempts(self):\n\t\tself.login_attempts = 0", "def reset_login_attempts(self):\n self.login_attempts = 0", "def reset_login_attempts(self):\n ...
[ "0.9023589", "0.8897008", "0.8897008", "0.87974", "0.87974", "0.87974", "0.87974", "0.87974", "0.87974", "0.8730208", "0.84998906", "0.8389746", "0.79732955", "0.6945088", "0.6885764", "0.6806393", "0.6719825", "0.6691015", "0.6656966", "0.65796435", "0.6446203", "0.6446203...
0.8209015
12
Initializes data for ProspectivePrimer object
def __init__(self, seq, aligned_index, unaligned_index): self.seq=seq self.aligned_index=aligned_index self.unaligned_index=unaligned_index self.numeric_seq=convert_to_numeric(self.seq) self.upstream_regions=[] self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_primers(initial_primers):\n \n\n primers=[]\n for n in initial_primers:\n primers.append(ProspectivePrimer(n[0],n[1],initial_primers[n]))\n \n return primers", "def __init__(self, title, semester, professor, crn, status):\n self.semesters = [semester]\n self.prof...
[ "0.7271173", "0.6307158", "0.6298468", "0.62722576", "0.6196198", "0.61693597", "0.6160022", "0.6158654", "0.6073067", "0.60460526", "0.5932731", "0.59157014", "0.5879267", "0.5873221", "0.5865648", "0.5857605", "0.5814375", "0.5807719", "0.57968795", "0.57907635", "0.5780164...
0.0
-1
Override equality operator for testing primer objects
def __eq__(self, other): return (self.seq == other.seq and self.aligned_index == other.aligned_index and self.unaligned_index == other.unaligned_index and self.numeric_seq == other.numeric_seq and self.upstream_regions == other.upst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n pass", "def __eq__(self, other):\n pass", "def __eq__(self, p_object):\n if any([self[i] != p_object[i] for i in range(9)]):\n return False\n return True", "def __eq__(self,*args):\r\n pass", "def __eq__(self,*args):\r\n pass", "def __eq...
[ "0.72263765", "0.72263765", "0.71889865", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147", "0.71733147"...
0.0
-1
returns count of sequences in given fasta file(s) The input_fasta_files is a list of fasta filepaths
def get_sequence_count(input_fasta_files): # Correction for the case that only one file passed if type(input_fasta_files)==str: input_fasta_files=[input_fasta_files] count=0 for n in input_fasta_files: fasta_f=open(n,'U') for label,seq in MinimalFastaParser(fasta_f)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_seqs_in_filepaths(fasta_filepaths, seq_counter=count_seqs):\r\n total = 0\r\n counts = []\r\n inaccessible_filepaths = []\r\n # iterate over the input files\r\n for fasta_filepath in fasta_filepaths:\r\n # if the file is actually fastq, use the fastq parser.\r\n # otherwise u...
[ "0.7568509", "0.7414015", "0.67043936", "0.6663063", "0.6578762", "0.61955506", "0.61545354", "0.59026015", "0.5882633", "0.586203", "0.5835468", "0.58194464", "0.57913864", "0.5739672", "0.5698394", "0.569644", "0.5685289", "0.56555086", "0.56553745", "0.56428534", "0.564140...
0.8925589
0
Calculates number of sequences needed to include in primer objects
def get_number_seqs_for_primer(percent_match, seq_count): total_seq_use=int((1-percent_match)*seq_count) return total_seq_use
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return self.total_num_sequences", "def get_num_sequence(self):\n return len(self.study_list)", "def count(seq):\n\treturn sum(1 for x in seq)", "def __len__(self):\n return self.get_num_sequence()", "def total_nt(self) -> int:\n return self.sequence.length",...
[ "0.6587066", "0.65026635", "0.63337415", "0.6276302", "0.6245099", "0.61935514", "0.61692625", "0.6154156", "0.61426014", "0.60713667", "0.60706687", "0.6044734", "0.6044734", "0.6011961", "0.60081875", "0.5998915", "0.5998915", "0.5960162", "0.5953712", "0.5906147", "0.59045...
0.6394693
2
Iterates over given fasta files to build target dictionary
def iterate_target_sequences(input_fasta_files, sequence_length, percent_match, search_range): initial_primers={} for n in input_fasta_files: # seq_count and total_seq_use based on percent_match parameter to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fasta_parser(filename):\n fasta = {}\n with open(filename) as f:\n contents = f.read()[1:].split('\\n>')\n for section in contents:\n sample = section.split('\\n')\n sample_id = sample[0]\n seq = ''.join(sample[1:]).strip()\n fasta[sample_id] = se...
[ "0.6757965", "0.64520144", "0.6273736", "0.6222894", "0.61979413", "0.6151645", "0.61084914", "0.6087539", "0.606773", "0.6048207", "0.5939079", "0.59056056", "0.5876165", "0.5861193", "0.5859077", "0.5849697", "0.58278835", "0.58157", "0.5814199", "0.5786765", "0.57842433", ...
0.61925364
5
Builds list of primer objects from initial_primers
def construct_primers(initial_primers): primers=[] for n in initial_primers: primers.append(ProspectivePrimer(n[0],n[1],initial_primers[n])) return primers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_primers(header,\r\n mapping_data):\r\n\r\n if \"LinkerPrimerSequence\" in header:\r\n primer_ix = header.index(\"LinkerPrimerSequence\")\r\n else:\r\n raise IndexError(\r\n (\"Mapping file is missing LinkerPrimerSequence field.\"))\r\n if \"ReversePrimer\" i...
[ "0.61152774", "0.5685748", "0.54845613", "0.54509944", "0.5440025", "0.53709817", "0.53416723", "0.53409606", "0.53197396", "0.5274368", "0.5267137", "0.5261285", "0.52573895", "0.5245288", "0.5206712", "0.5176481", "0.51707155", "0.5140353", "0.5139623", "0.5128205", "0.5076...
0.8783308
0
builds dictionary of Xmers from given fasta files Uses sequences to build a list of objects of Xmers with related
def build_seq_data(seq, sequence_length, initial_primers, search_range): aligned_seq=DNA.make_seq(seq) # remove gap characters unaligned_seq=str(DNA.make_seq(seq).degap()) gaps=aligned_seq.gap_maps() if search_range: primer_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sequenceDict(self):\n\t\twith open(self.ff) as fastaFile:\n\t\t\tsequences = {}\n\t\t\tfor name, seq in self.readFasta(fastaFile):\n\t\t\t\tsequences[name] = seq\n\t\treturn sequences", "def fasta_parser(filename):\n fasta = {}\n with open(filename) as f:\n contents = f.read()[1:].split('\\n>')\...
[ "0.6634437", "0.6517825", "0.6509534", "0.64855963", "0.6462974", "0.64315665", "0.6255282", "0.6237787", "0.6224911", "0.6148253", "0.6131294", "0.6090451", "0.6084087", "0.60775065", "0.6069291", "0.605778", "0.6008139", "0.5965887", "0.59655946", "0.59623206", "0.5950733",...
0.0
-1
convert DNA codes to numeric values for bitwise comparisons returns a numeric list corresponding to the nucleotide sequence
def convert_to_numeric(sequence): int_mapped_seq=[] DNA_to_numeric = get_DNA_to_numeric() for n in sequence: int_mapped_seq.append(DNA_to_numeric[n]) return int_mapped_seq
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str2NumList(strn):\n\treturn [ord(chars) for chars in strn]", "def nucleotide_numbering():\n nucleotide_to_number = {'A': 0, 'C': 1, 'G': 2, 'T': 3}\n number_to_nucleotide = {0: 'A', 1: 'C', 2: 'G', 3: 'T'}\n return nucleotide_to_number, number_to_nucleotide", "def encode_rna(x):\n return [0 if...
[ "0.6309183", "0.6230118", "0.6208863", "0.6096392", "0.5975599", "0.59637845", "0.5953173", "0.59482646", "0.580563", "0.5801203", "0.5766781", "0.5749419", "0.5746811", "0.57197213", "0.5715822", "0.5704024", "0.570132", "0.5697264", "0.5672337", "0.56659025", "0.56524974", ...
0.69297695
0
returns a corrected unaligned index based on aligned index
def get_corrected_index(seq, aligned_index): # Counts the number of nucleotides in aligned sequence, returns # count of nucleotides occuring before aligned index reached slice_seq=seq[0:aligned_index] # If different gap characters used, may need to modify this # In curre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_align_idx(self):\n self.amp4.rotateAng([5, 5, 5], ang='deg')\n al = align(self.amp3, self.amp4, mv=[0, 1, 2, 3], sv=[0, 1, 2, 3], method='idxPoints')\n all(self.assertAlmostEqual(al.m.vert[i, 0], al.s.vert[i, 0], delta=0.1) for i in range(al.s.vert.shape[0]))", "def idx2off(i):\n ...
[ "0.63992536", "0.58021104", "0.56746924", "0.5617751", "0.56103647", "0.5595864", "0.55761355", "0.54659295", "0.54612035", "0.5456233", "0.5443871", "0.5337581", "0.53357214", "0.53213453", "0.529732", "0.5248855", "0.5244388", "0.5244107", "0.52407306", "0.5207596", "0.5194...
0.6640512
0
Deletes primer objects given a list of indices to delete
def del_primers(primers, deletions): # Sort primers in reverse order so indices remain correct during deletion deletions.sort(reverse=True) for n in deletions: del primers[n] return primers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _delete_command_idxs(indexes, from_cmake):\n for index in sorted(indexes, reverse=True):\n del from_cmake[index]", "def delete_multiple(self, idxes, sort = True):\n if(sort): idxes.sort() # inplace\n # forced to loop but it's better than using np.remove which is not inplace.\n ...
[ "0.6810795", "0.67705464", "0.66847456", "0.659264", "0.6534062", "0.65080416", "0.6439221", "0.63597953", "0.63597953", "0.6238947", "0.62121487", "0.6197653", "0.6155357", "0.611707", "0.61094785", "0.6075659", "0.60659623", "0.60549635", "0.6032439", "0.6022622", "0.601030...
0.653887
4
Appends upstream and downstream sequence information for primer hit Because some sequences may be hit near the 5' or 3' end of sequence read, it is necessary to append N's to the upstream or downstream region. This makes both visual inspection of the primers easier and allows for alignment objects to be loaded given a ...
def append_primer_hit(primer, label, hit_index, region_slice, overall_length, unaligned_seq, primer_len): primer.match_count+=1 primer.labels.append(label.split()[0]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primer_start_fix(self):\r\n #TODO this function will not be used anymore, remove?\r\n if self.type in [\"forward_primer\", \"reverse_primer\", \"PCR_product\"]:\r\n self.start += 1\r\n if self.type == \"region\" and self.source == \"Primer3\":\r\n # this is the region...
[ "0.61210686", "0.6015792", "0.5825172", "0.5388359", "0.5349065", "0.5332983", "0.5280968", "0.5251739", "0.52036214", "0.5173795", "0.5172554", "0.516637", "0.5143279", "0.5141967", "0.5104009", "0.5093995", "0.5085161", "0.50663805", "0.50557864", "0.50397253", "0.49996945"...
0.6823022
0
searches through integer mapped sequence to find specific matches This function does not append data from sequences, rather its purpose is to eliminate nonspecific primers before the sensitive primers (along with the associated sequence data) are built.
def find_specific_primer_matches(primers, integer_mapped_seq, deletion_threshold, seq_count, sequence_length, label, unali...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_sensitive_primer_matches(primers,\n integer_mapped_seq,\n deletion_threshold,\n seq_count,\n sequence_length,\n label,\n ...
[ "0.70073456", "0.6101962", "0.5778454", "0.57115793", "0.5597058", "0.55890054", "0.55768037", "0.54905343", "0.54866445", "0.5374324", "0.5360855", "0.53143424", "0.5302089", "0.523852", "0.5202517", "0.52015847", "0.5189258", "0.5116563", "0.51111543", "0.50882447", "0.5085...
0.72535133
0
searches through integer mapped sequence to find matches
def find_sensitive_primer_matches(primers, integer_mapped_seq, deletion_threshold, seq_count, sequence_length, label, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_seq(seq, barcode_map, result_dict):\n for i in range(len(seq)):\n for barcode in barcode_map.keys():\n possible_match = seq[i: i + len(barcode)]\n if possible_match == barcode:\n result_dict[barcode][i] += 1", "def occurence(main_seq,sub_seq):\n start=...
[ "0.7315551", "0.62305427", "0.61885595", "0.6087165", "0.60010016", "0.59858793", "0.5982761", "0.59719914", "0.58985144", "0.5875418", "0.58698523", "0.5865422", "0.58653706", "0.57982004", "0.57981664", "0.5795842", "0.579426", "0.57487833", "0.5737486", "0.57217073", "0.56...
0.52892095
72
returns max number of missed seqs to be above threshold
def get_deletion_threshold(percent_match, seq_total): return int(float(1-percent_match)*seq_total)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_repeats(seq):\n max_item = 0\n item_count = [seq.count(item) for item in seq]\n try:\n max_item = max(item_count)\n except ValueError:\n \"arg is an empty sequence\"\n return max_item", "def num_larger(threshold, values):\n num = sum([1 for n in values if (n>threshold)])\n...
[ "0.63247347", "0.6317331", "0.6310057", "0.6004469", "0.5953126", "0.5931313", "0.59071994", "0.5869132", "0.5867101", "0.5866491", "0.5832915", "0.5804919", "0.5800774", "0.5782871", "0.57597333", "0.5745662", "0.5734066", "0.57165194", "0.571367", "0.56970453", "0.5675978",...
0.60113037
3
Iterates through excluded sequences, deletes nonspecific primers
def get_specific_hits(primers, exclude_fasta_files, specificity_max, sequence_length, region_slice, seq_total_exclude): seq_count=0 # Once sequence is found deletion_threshold number of times in ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prune_sequence(sequence_set, extended_set):\n tmp_set = set()\n for seq in sequence_set:\n # se una sotto-sequenza e' trovata viene ignorata, altrimenti e' aggiunta al set temporaneo\n found = False\n for ext in extended_set:\n if seq1_in_seq2(seq, ext, 0): # eps e' 0 per...
[ "0.6506757", "0.5864291", "0.5836645", "0.58106935", "0.5798354", "0.57801235", "0.5676812", "0.5652798", "0.5613111", "0.5604975", "0.5600722", "0.5583961", "0.55615985", "0.55557966", "0.5548367", "0.5534944", "0.5532436", "0.5531215", "0.5530289", "0.55264467", "0.55206", ...
0.0
-1
Retains and appends information to primer objects w/ sensitive hits
def get_sensitive_hits(primers, input_fasta_files, percent_match, sequence_length, region_slice): seq_count=0 for n in input_fasta_files: seq_total_target=get_sequence_count(n) deletion_threshold=get_del...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.seen = {}", "def append_primer_hit(primer, \n label,\n hit_index,\n region_slice,\n overall_length,\n unaligned_seq,\n primer_len):\n \n \n prim...
[ "0.58676577", "0.58081216", "0.5399095", "0.53947353", "0.52922446", "0.52842057", "0.52187425", "0.5211678", "0.5172692", "0.51650256", "0.51514506", "0.5130112", "0.5114776", "0.5109664", "0.5069289", "0.5065905", "0.5063866", "0.50437415", "0.5039819", "0.5024819", "0.5023...
0.0
-1
Iterates list of primer objects, calculates percent matches
def calculate_percent_match(primers, seq_count, exclude_seq_count=1): # Calculate percent of sequences that are 'hit' by each primer for n in range(len(primers)): # Calculate percent perfect match primers[n].percent_match=float(primers[n].m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_p(candidate, reference):\n matches = 0\n for grama in candidate:\n if grama in reference:\n matches += 1\n return matches/len(candidate)", "def resultat_match(self, binomes):\n for binome in binomes:\n while True:\n score_un = self.vue.ent...
[ "0.61019254", "0.5894499", "0.58586526", "0.5768695", "0.5768504", "0.5746886", "0.57437664", "0.57017726", "0.5665368", "0.5643431", "0.56431913", "0.5563038", "0.55320835", "0.5523601", "0.54986566", "0.54957074", "0.54766464", "0.54745346", "0.5454031", "0.54450965", "0.54...
0.71711147
0
Appends standard aligned index value to ProspectivePrimer objects
def append_std_aligned_index(primers, standard_index_seq, region_slice): for n in primers: n.std_index = True standard_unaligned_index = get_corrected_index(standard_index_seq, n.aligned_index) # 5' for forward primer wo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table_key(self, reindex_dict):\n reindexed_marks = []\n for m in self.component1.marks:\n new_m = reindex_dict.get(m)\n if new_m == None:\n if len(reindex_dict) == 0:\n new_m = 0\n else:\n new_m = max(reinde...
[ "0.590127", "0.5743373", "0.5539483", "0.5368967", "0.52574486", "0.5224323", "0.52219516", "0.5219616", "0.51754165", "0.5169657", "0.5157575", "0.51386046", "0.51257545", "0.5122756", "0.50792426", "0.50733215", "0.5063912", "0.5045901", "0.50283784", "0.50128955", "0.50089...
0.68654364
0
Search sequences for occurences of Xmers of sequence_length
def search_sequences(input_fasta_filepath, sequence_length, exclude_fasta_filepath, verbose, percent_match, full_primer_length, output_f, specificity_threshold, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_long_runs(num_sequence, l):\n chunked = [(k, list(g)) for k, g in itertools.groupby(num_sequence)]\n retval = [(i, len(g)) for i, (k, g) in enumerate(chunked) if k and len(g) > l]\n return retval", "def _get_subsequence_counts(sequences, length, min_support=None):\n # type: (Union[List[str],...
[ "0.6158212", "0.5900014", "0.5739277", "0.56833863", "0.5648507", "0.5630975", "0.55703413", "0.5561924", "0.5560446", "0.55566347", "0.5490579", "0.5489507", "0.54834145", "0.5462696", "0.54503065", "0.54357773", "0.5432112", "0.5426299", "0.5423302", "0.54226434", "0.538099...
0.5569087
7
Test that we can replace a node that is not shutdown gracefully.
def replace_stopped_node_test(self): self._replace_node_test(gently=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_shutdown_node_test(self):\n self._replace_node_test(gently=True)", "def test_replaceDoesNotDisableCircuitBreaker(self):\n disco = create_disco()\n node = create_node(\"somewhere\")\n disco.onMessage(None, NodeActive(node))\n resolved_node = resolve(disco, \"myservic...
[ "0.769972", "0.7263482", "0.6913333", "0.6884029", "0.6764669", "0.6671188", "0.66309", "0.6547465", "0.6521186", "0.63726807", "0.6367974", "0.6297034", "0.62832415", "0.6264931", "0.6194157", "0.61867064", "0.60964704", "0.604574", "0.60426784", "0.594662", "0.5943657", "...
0.6583538
7
CASSANDRA9871 Test that we can replace a node that is shutdown gracefully.
def replace_shutdown_node_test(self): self._replace_node_test(gently=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_node_graceful_shutdown(self, proc_info, controller_node):\n launch_testing.asserts.assertExitCodes(proc_info, process=controller_node)", "def test_05_node_down_and_resync_hard(self):\n for cluster in test_rest.cluster.clusters:\n if cluster == 'index':\n continue\...
[ "0.72033966", "0.71024096", "0.70595825", "0.69823843", "0.69612706", "0.6911128", "0.68039066", "0.6747855", "0.65598166", "0.6542973", "0.6518864", "0.64961773", "0.6485054", "0.6472087", "0.6463794", "0.6445934", "0.6360621", "0.6331515", "0.6325584", "0.627847", "0.626650...
0.75695765
0
Check that the replace address function correctly replaces a node that has failed in a cluster. Create a cluster, cause a node to fail, and bring up a new node with the replace_address parameter. Check that tokens are migrated and that data is replicated properly.
def _replace_node_test(self, gently): debug("Starting cluster with 3 nodes.") cluster = self.cluster cluster.populate(3).start() node1, node2, node3 = cluster.nodelist() if DISABLE_VNODES: num_tokens = 1 else: # a little hacky but grep_log returns...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fail_without_replace_test(self):\n debug(\"Starting cluster with 3 nodes.\")\n cluster = self.cluster\n cluster.populate(3)\n node1, node2, node3 = cluster.nodelist()\n cluster.seeds.remove(node3)\n NUM_TOKENS = os.environ.get('NUM_TOKENS', '256')\n if DISABLE_V...
[ "0.7335298", "0.696548", "0.6733719", "0.66466993", "0.66246766", "0.66044146", "0.6539186", "0.62632495", "0.62551445", "0.60812336", "0.5919062", "0.5836285", "0.580578", "0.57712513", "0.5759019", "0.56695586", "0.5572982", "0.55582047", "0.5545848", "0.5520033", "0.551707...
0.66577613
3
When starting a node from a clean slate with the same address as an existing down node, the node should error out even when auto_bootstrap = false (or the node is a seed) and tell the user to use replace_address. CASSANDRA10134
def fail_without_replace_test(self): debug("Starting cluster with 3 nodes.") cluster = self.cluster cluster.populate(3) node1, node2, node3 = cluster.nodelist() cluster.seeds.remove(node3) NUM_TOKENS = os.environ.get('NUM_TOKENS', '256') if DISABLE_VNODES: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_with_reset_resume_state_test(self):\n\n cluster = self.cluster\n cluster.populate(3).start()\n node1, node2, node3 = cluster.nodelist()\n\n node1.stress(['write', 'n=100K', 'no-warmup', '-schema', 'replication(factor=3)'])\n\n session = self.patient_cql_connection(nod...
[ "0.6077486", "0.59152275", "0.5730985", "0.57131267", "0.5675744", "0.55063087", "0.5453649", "0.54527897", "0.54008937", "0.5391057", "0.5317235", "0.53120404", "0.52710044", "0.52428687", "0.5236482", "0.51801217", "0.51627666", "0.51423806", "0.51393414", "0.51322865", "0....
0.6074668
1
To handle situations such as failed disk in a JBOD, it may be desirable to replace a node without bootstrapping. In such scenarios best practice advice has been to wipe the node's system keyspace data, set the initial tokens via cassandra.yaml, startup without bootstrap and then repair. Starting the node as a replaceme...
def unsafe_replace_test(self): debug('Starting cluster with 3 nodes.') cluster = self.cluster cluster.populate(3) cluster.set_batch_commitlog(enabled=True) node1, node2, node3 = cluster.nodelist() cluster.seeds.remove(node3) NUM_TOKENS = os.environ.get('NUM_TOKENS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fail_without_replace_test(self):\n debug(\"Starting cluster with 3 nodes.\")\n cluster = self.cluster\n cluster.populate(3)\n node1, node2, node3 = cluster.nodelist()\n cluster.seeds.remove(node3)\n NUM_TOKENS = os.environ.get('NUM_TOKENS', '256')\n if DISABLE_V...
[ "0.71049017", "0.682219", "0.65992427", "0.6297513", "0.62767684", "0.6222005", "0.61809766", "0.60596913", "0.6026414", "0.5952776", "0.5792869", "0.5709729", "0.56964314", "0.55712783", "0.55003196", "0.54920876", "0.5481311", "0.54768157", "0.5469145", "0.5460061", "0.5439...
0.6841581
1
Test resumable bootstrap while replacing node. Feature introduced in
def resumable_replace_test(self): cluster = self.cluster cluster.populate(3).start() node1, node2, node3 = cluster.nodelist() node1.stress(['write', 'n=100K', 'no-warmup', '-schema', 'replication(factor=3)']) session = self.patient_cql_connection(node1) stress_table = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_node_reboot_item(self):\n pass", "def replace_with_reset_resume_state_test(self):\n\n cluster = self.cluster\n cluster.populate(3).start()\n node1, node2, node3 = cluster.nodelist()\n\n node1.stress(['write', 'n=100K', 'no-warmup', '-schema', 'replication(factor...
[ "0.621285", "0.62068325", "0.60204685", "0.5959929", "0.59415275", "0.59175444", "0.5897233", "0.5879828", "0.5834466", "0.58204174", "0.5803024", "0.5793873", "0.57870626", "0.5701866", "0.5682745", "0.56759197", "0.5672473", "0.56564605", "0.56402594", "0.56383705", "0.5633...
0.61235756
2
Test replace with resetting bootstrap progress
def replace_with_reset_resume_state_test(self): cluster = self.cluster cluster.populate(3).start() node1, node2, node3 = cluster.nodelist() node1.stress(['write', 'n=100K', 'no-warmup', '-schema', 'replication(factor=3)']) session = self.patient_cql_connection(node1) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_progress(self):\n self.state = \"\"", "def test_reset(self):\r\n self.p += 8\r\n self.p.reset()\r\n self.assertEqual(str(self.p), '[>............] 0%')", "def set_progress(self, progress: float):", "def advance():\n pg = ppv.progress + random.random() / 20\n ...
[ "0.5962981", "0.55730134", "0.5517491", "0.52934307", "0.5284073", "0.5189856", "0.5175916", "0.5137845", "0.50970894", "0.50963163", "0.50952303", "0.50824916", "0.508001", "0.50770926", "0.50761473", "0.50592273", "0.5057629", "0.50519264", "0.50475955", "0.50475955", "0.50...
0.48889038
35
Test that replace fails when there are insufficient replicas CASSANDRA11848
def replace_with_insufficient_replicas_test(self): debug("Starting cluster with 3 nodes.") cluster = self.cluster cluster.populate(3).start() node1, node2, node3 = cluster.nodelist() if DISABLE_VNODES: num_tokens = 1 else: # a little hacky but gre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_redis_increase_replica_count_usual_case():", "def test_base_replica_repair_with_contention(self):\n self._base_replica_repair_test(fail_mv_lock=True)", "def resumable_replace_test(self):\n\n cluster = self.cluster\n cluster.populate(3).start()\n node1, node2, node3 = cluste...
[ "0.6814609", "0.68009305", "0.6593998", "0.639997", "0.63156056", "0.6274903", "0.627408", "0.6214506", "0.6018259", "0.58900636", "0.5862111", "0.5845466", "0.5839016", "0.5836313", "0.5830308", "0.5829698", "0.57167", "0.56765765", "0.5672758", "0.56702614", "0.5639919", ...
0.73329014
0
Test that multidc replace works when rf=1 on each dc
def multi_dc_replace_with_rf1_test(self): cluster = self.cluster cluster.populate([1, 1]) cluster.start() node1, node2 = cluster.nodelist() node1 = cluster.nodes['node1'] yaml_config = """ # Create the keyspace and table keyspace: keyspace1 keyspa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_data_source_soaps_id_replace_post(self):\n pass", "def test_replace_groups(self):\n pass", "def test_replace_group(self):\n pass", "def test_replace_identity(self):\n pass", "def _add_dc_after_mv_test(self, rf, nts):\n\n session = self.prepare(rf=rf)\n\n l...
[ "0.5868793", "0.57626647", "0.57394946", "0.57088983", "0.56332976", "0.5594742", "0.556429", "0.55391914", "0.54893154", "0.5411253", "0.5371333", "0.52877027", "0.52727324", "0.52647424", "0.52616", "0.524178", "0.5240369", "0.52387863", "0.5235418", "0.519722", "0.5170311"...
0.6363337
0
Initialize our `Finitefield` object with a given `prime` number
def __init__(self, prime): if prime != 0: # Check if prime is different from zero self.prime = prime # Assign it else: raise ValueError # Raise an error if prime is negative
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(s, p):\n Zmod.__init__(s, p)\n if s.element_class != FiniteFieldElement:\n raise ArithmeticError(\"Invalid Prime : %d\" % p)\n s.p = p", "def __init__(self, prime, server):\n self.N = prime\n self.g = 2\n self.k = 3\n self.server = server", ...
[ "0.69248664", "0.64870983", "0.5943145", "0.5748694", "0.57429487", "0.5697714", "0.5641275", "0.5625622", "0.5612961", "0.56080437", "0.5605338", "0.5581152", "0.555875", "0.5549988", "0.55280745", "0.5524173", "0.54919416", "0.5483966", "0.5442872", "0.5397962", "0.5372536"...
0.74800426
0
Apply `Extended Euclidean Algorithm` to obtain `gcd`.
def extended_euclides(self, a, b): x = last_y = 0 y = last_x = 1 while b != 0: quot = a // b a, b = b, a % b x, last_x = last_x - quot * x, x y, last_y = last_y - quot * y, y return [last_x, last_y]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extgcd(x, y):\n # Crandall & Pomerance \"PRIME NUMBERS\", Algorithm 2.1.4 page 85 of \"http://thales.doa.fmph.uniba.sk/macaj/skola/teoriapoli/primes.pdf\"\n a, b, g, u, v, w = 1, 0, x, 0, 1, y\n while w:\n q, t = divmod(g, w)\n a, b, g, u, v, w = u, v, w, a-q*u, b-q*v, t\n if g >= 0:\...
[ "0.7539463", "0.75067073", "0.7455534", "0.7445256", "0.73438376", "0.72952276", "0.7214193", "0.7184915", "0.7184301", "0.7072077", "0.7036319", "0.69709265", "0.69679457", "0.69297695", "0.6921448", "0.69009405", "0.68982315", "0.68785053", "0.6864153", "0.686164", "0.68472...
0.0
-1
Perform modular `division` according finite fields' aritmethic.
def division(self, num, denom): inverse = self.extended_euclides(denom, self.prime)[0] # Apply our extended euclidean algo and obtain the first item of the list, this sould be the inverse return num * inverse # Multiply the inverse for the numerator to obtain quotient
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def div(f, g):\n lev, dom, per, F, G = f.unify(g)\n q, r = dmp_div(F, G, lev, dom)\n return per(q), per(r)", "def division():\r\n error_handler()\r\n f1.delete(0, END)\r\n d1 = float(operand.get())\r\n d2 = float(operator.get())\r\n result = d1 / d2\r\n f1.insert(10, str(re...
[ "0.611495", "0.59073436", "0.5899651", "0.5849352", "0.5824946", "0.5820736", "0.57673085", "0.57544917", "0.5747584", "0.57012504", "0.5687956", "0.5673295", "0.5672008", "0.5666649", "0.5646528", "0.5644622", "0.5637174", "0.5574932", "0.5566055", "0.55549794", "0.55512077"...
0.5287747
69
Obtain equivalence class of a certain number.
def equivalence(self, n): return n % self.prime
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_equivalent_class(record):\n equivalent_class = {}\n class_members=[]\n max_class_number = -1\n for pair in record:\n if (pair[0] in equivalent_class) and (not (pair[1] in equivalent_class)):\n equivalent_class[pair[1]] = equivalent_class[pair[0]]\n if (not(pair[0] i...
[ "0.5669883", "0.5552854", "0.5449721", "0.5332555", "0.5325522", "0.53195566", "0.53147596", "0.529187", "0.5286526", "0.5284268", "0.52787423", "0.52514434", "0.5224838", "0.5221005", "0.522084", "0.5210592", "0.52059454", "0.52004546", "0.51959074", "0.51881945", "0.5165687...
0.61218315
0
Generate random int `n` such that `0 <= n <= prime`.
def random_int(self, top): return random.randint(0, top) % self.prime
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_prime(n):\n assert n > 3\n k = int(log2(n))\n m = n - 1\n d = 0\n while(m % 2 == 0):\n m //= 2\n d += 1\n for _ in range(k):\n a = randint(2, n - 2)\n x = pow(a, m, n)\n if x == 1 or x == n - 1:\n continue\n for _ in range(d - 1):\n ...
[ "0.7877164", "0.7752492", "0.76700974", "0.7575768", "0.73313224", "0.7323237", "0.7304841", "0.7234368", "0.7212159", "0.718724", "0.7154295", "0.710153", "0.70722497", "0.7051513", "0.704767", "0.7031115", "0.70165616", "0.7007428", "0.69956565", "0.6977279", "0.6942", "0...
0.0
-1
Obtain this finite fields `prime` number.
def get_prime(self): return self.prime
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_prime(self):\n if(not self._constructed): raise EGCSUnconstructedStateError()\n return self._prime", "def Em_prime(self):\n delta_electrons = self._GetElectronDiff()\n assert delta_electrons != 0\n return - self.DeltaGmPrime() / (constants.F*delta_electrons)", "def E_...
[ "0.71399903", "0.66589963", "0.6651876", "0.6646228", "0.662972", "0.647131", "0.6122692", "0.6115008", "0.6047143", "0.60251045", "0.6022619", "0.5988457", "0.59664625", "0.596395", "0.5935993", "0.5896268", "0.58959156", "0.58298343", "0.5828062", "0.5750545", "0.5699855", ...
0.7992657
0
amenities route with no ID
def amenities(amenity_id=None): if request.method == 'GET': all_amenities = storage.all('Amenity') all_amenities = [obj.to_json() for obj in all_amenities.values()] return jsonify(all_amenities) if request.method == 'POST': req_json = request.get_json() if req_json is No...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def route(self):\n pass", "def amenities_no_id(amenity_id=None):", "def normalise(self) -> \"Route\":\n pass", "def routes(self, body):\n pass", "def through(self, name: str) -> List[Route]:\n output: List[Route] = list()\n for id_ in self.search(name).data[\"route\"]...
[ "0.6354111", "0.6264859", "0.61972857", "0.5819001", "0.581865", "0.56669456", "0.5627603", "0.55344", "0.5534315", "0.55061823", "0.5503839", "0.5501315", "0.53954834", "0.5381589", "0.5375968", "0.53428745", "0.5313714", "0.52659637", "0.5258824", "0.52479875", "0.52046376"...
0.0
-1
Returns true if i is a leaf. True if i has no children
def is_leaf(self, i): return len(self.children[i]) == 0 or len(self.pq[i]) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_leaf(self):\n if len(self.children) == 0:\n return True\n else:\n return False", "def is_leaf(self):\r\n return self.num_children() == 0", "def is_leaf(self):\n return len(self.children) == 0", "def is_leaf(self):\n return len(self.child_list) =...
[ "0.82774425", "0.8232412", "0.8213968", "0.8201722", "0.8164184", "0.81311023", "0.81169236", "0.8108716", "0.8108716", "0.8108716", "0.8108716", "0.80393773", "0.80339175", "0.7978852", "0.797204", "0.79555184", "0.79298913", "0.78709584", "0.78234917", "0.7776668", "0.77559...
0.8860917
0
Gives the children of node i that has elements elems. In this version, it grabs all 2 partitions if they are not there and caches this in children[i].
def get_children(self, i, elems): # if len(elems) == 1: # return [] # elif self.explored[i]: # return self.children[i] # else: self.children[i], self.children_elems[i] = self._get_children(list(elems)) # all_two_partitions(list(elems)) # self.update_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children(self, i):\n if i < 0:\n raise IndexError()\n return self._children[i]", "def get_children_elements(self):\n\n pass", "def children_recursive(self, i):\n result = []\n for child in self.children(i):\n result += [child] + self.children_recursi...
[ "0.63445675", "0.60507435", "0.59418297", "0.5931057", "0.5728822", "0.5700945", "0.56202734", "0.5581891", "0.55794436", "0.55772966", "0.55548924", "0.5552774", "0.5548988", "0.5543629", "0.5530173", "0.551414", "0.55022126", "0.5479672", "0.54726505", "0.5466317", "0.54577...
0.81951326
0
Get the node corresponding to the given elements, create new id if needed. Creates a new id if needed.
def record_node(self, elements: frozenset) -> int: logging.debug('get node id from elements %s', str(elements)) if elements not in self.elems2node: logging.debug('get node id from elements %s. new node! %s', str(elements), self.next_id) logging.debug('Clusters =%s ', str(self.clu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNodeById(self, nodes, id):\n for item in nodes:\n if item.getProperty('id') == id:\n return item", "def create_id(elements: Iterable) -> str:\r\n i = 1\r\n while str(i) in elements:\r\n i += 1\r\n return str(i)", "def update_node_id(node: Element) -> None...
[ "0.5942844", "0.58788836", "0.58618236", "0.55669534", "0.55313444", "0.54860556", "0.5439955", "0.54111147", "0.53839993", "0.53363097", "0.533143", "0.53260684", "0.53103817", "0.53013533", "0.5292114", "0.5276335", "0.5268265", "0.5268265", "0.5268265", "0.5268265", "0.526...
0.6063719
0
Add last splitting llh to subtree llh. Assumes delta_min and lam are the same for both a_node and b_node
def get_energy_of_split(self, elem_l, elem_r): # logging.debug(f"computing energy of split: {ch_l, ch_r}") # elem_l = self.clusters[ch_l] # elem_r = self.clusters[ch_r] # To follow the convention on Ginkgo, to get the correct result, we set t==0 if we have a leaf, i.e. t<t_cut ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _finalize_leaf(self, node):\n node.value = -self.shrinkage * node.sum_gradients / (\n node.sum_hessians + self.splitter.l2_regularization)\n self.finalized_leaves.append(node)", "def _compute_best_split_and_push(self, node):\n\n node.split_info = self.splitter.find_node_split(...
[ "0.55932456", "0.55510145", "0.54642284", "0.5366041", "0.5326848", "0.5302723", "0.5289726", "0.51891357", "0.51791817", "0.5175469", "0.5147306", "0.5121746", "0.5092955", "0.5072795", "0.50273865", "0.50056016", "0.49869534", "0.49738866", "0.49672574", "0.49655488", "0.49...
0.48502734
34
Enable or Disable VRRP.
def vrrp(self, **kwargs): ip_version = kwargs.pop('ip_version', '4') get = kwargs.pop('get', False) enable = kwargs.pop('enable', True) callback = kwargs.pop('callback', self._callback) if get: enable = None vrrp_args = dict() vrrp_method = 'protocol_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_enabled(self, bEnabled):\n\t\tcall_sdk_function('PrlVmDev_SetEnabled', self.handle, bEnabled)", "def set_enabled(self, bEnabled):\n\t\tcall_sdk_function('PrlVirtNet_SetEnabled', self.handle, bEnabled)", "def set_relock_enabled():\n relock_enabled = request.params.get(\"relock_enabled\", 0) == \"true...
[ "0.6014747", "0.5889021", "0.5826828", "0.5719806", "0.57056844", "0.5568046", "0.5486277", "0.54614824", "0.5442514", "0.54342896", "0.5434215", "0.53747004", "0.5339388", "0.5333639", "0.53323823", "0.53323823", "0.53206813", "0.5309866", "0.5282525", "0.52813756", "0.52529...
0.52442425
21
Enable or Disable Vrrpe.
def vrrpe(self, **kwargs): ip_version = kwargs.pop('ip_version', '4') enable = kwargs.pop('enable', True) get = kwargs.pop('get', False) callback = kwargs.pop('callback', self._callback) if get: enable = None vrrpe_args = dict() vrrpe_method = 'proto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_enabled(self, bEnabled):\n\t\tcall_sdk_function('PrlVmDev_SetEnabled', self.handle, bEnabled)", "def _doEnableRegulation(self):\n self._cmdRegulOn()", "def enable(self):\n self.enabled = True", "def enable(self):\n self.enabled = True", "def enable(self):", "def enable(self) ...
[ "0.6167926", "0.61560124", "0.6082954", "0.6082954", "0.60781544", "0.60453457", "0.60059565", "0.5915727", "0.58522904", "0.5793752", "0.5793752", "0.5793752", "0.5793752", "0.5793752", "0.5793752", "0.5793752", "0.5793752", "0.5793752", "0.5793752", "0.5793752", "0.5774481"...
0.5583485
26
Enable or Disable isis.
def isis(self, **kwargs): enable = kwargs.pop('enable', True) get = kwargs.pop('get', False) callback = kwargs.pop('callback', self._callback) if get: enable = None isis_args = {} if get: config = ('router_isis_get', isis_args) x = cal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle(self):\n if self.is_enabled:\n self.disable()\n else:\n self.enable()", "def setEnabled(*args):", "def setEnabled(*args):", "def setEnabled(*args):", "def setEnabled(*args):", "def setEnabled(*args):", "def setEnabled(*args):", "def setEnabled(*args):", ...
[ "0.65819794", "0.64373547", "0.64373547", "0.64373547", "0.64373547", "0.64373547", "0.64373547", "0.64373547", "0.64373547", "0.64373547", "0.64373547", "0.64373547", "0.63177824", "0.63177824", "0.6315479", "0.6309165", "0.62334406", "0.6215598", "0.6189995", "0.6185965", "...
0.6095527
27
Enable or Disable OSPF.
def ospf(self, **kwargs): ip_version = kwargs.pop('ip_version', '4') enable = kwargs.pop('enable', True) vrf = kwargs.pop('vrf', 'default-vrf') get = kwargs.pop('get', False) callback = kwargs.pop('callback', self._callback) if get: enable = None osp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggleIpforward(v):\n file_path = \"/proc/sys/net/ipv4/ip_forward\"\n with open(file_path, \"w\") as f:\n if v.ipForward:\n print(0, file=f)\n v.ipForward = False\n else:\n print(1, file=f)\n v.ipForward = True\n return", "asy...
[ "0.5948043", "0.56836504", "0.56771296", "0.56567425", "0.5461226", "0.54282016", "0.5390515", "0.53849965", "0.5301857", "0.5292198", "0.5239643", "0.52300185", "0.5196304", "0.5194292", "0.5172837", "0.5154461", "0.51444197", "0.5127659", "0.506502", "0.50603294", "0.505292...
0.0
-1
Enable or Disable mpls.
def mpls(self, **kwargs): enable = kwargs.pop('enable', True) get = kwargs.pop('get', False) callback = kwargs.pop('callback', self._callback) if get: enable = None mpls_args = {} if get: config = ('router_mpls_get', mpls_args) x = ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_pulse_modulation(self):\n self.write(\":SOUR:PULM:STAT ON\")", "async def async_turn_on(self):\n await self.async_mute_volume(False)", "def modsToggle(self, connect=False, verbose=True):\n try:\n if self._mods_available:\n if connect: \n ...
[ "0.62451345", "0.6093683", "0.60115725", "0.60078275", "0.5995367", "0.5924754", "0.5854489", "0.58518136", "0.58518136", "0.58518136", "0.58518136", "0.58518136", "0.58518136", "0.58518136", "0.58518136", "0.58518136", "0.58518136", "0.58518136", "0.58437115", "0.58381873", ...
0.5606011
37
Push RSPECs to Jira
def push_rspecs(host, auth, rspecs): for rspec in rspecs: description = rspec["fields"]["description"] click.echo(f"Pushing {rspec['key']} ", err=True) data = { "update": { "description": [ { "set": description ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push_current_data(project):\n defects = []\n\n logger.info(\"Starting {}...\".format(project))\n jira_issues = get_jira_defects(project)\n now = datetime.datetime.utcnow().strftime(DATE_FORMAT)\n logger.debug(\"Fetched {} issues successfully for {}\".format(len(jira_issues), project))\n\n # ...
[ "0.60630643", "0.59804326", "0.5954895", "0.588658", "0.5663922", "0.5642216", "0.54534817", "0.54471946", "0.54439807", "0.54370046", "0.5394964", "0.5368015", "0.5364517", "0.53410673", "0.5320143", "0.5316345", "0.5315661", "0.53115475", "0.53106874", "0.5309121", "0.52791...
0.7445449
0
Return the given string as a native string in the given encoding.
def tonative(n, encoding='ISO-8859-1'): # In Python 2, the native string type is bytes. if isinstance(n, six.text_type): # unicode for Python 2 return n.encode(encoding) return n
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_native_string(string, encoding='ascii'):\n if isinstance(string, str):\n out = string\n else:\n out = string.decode(encoding)\n\n return out", "def native_(s, encoding='latin-1', errors='strict'):\n if isinstance(s, text_type):\n return s.encode(encoding, errors)\...
[ "0.8789175", "0.79968244", "0.7674134", "0.7387134", "0.7373827", "0.72284156", "0.7190662", "0.7112319", "0.7099836", "0.70713055", "0.6986353", "0.6885627", "0.6806217", "0.66796917", "0.66330653", "0.6579638", "0.65549314", "0.6536207", "0.6463338", "0.6441715", "0.6439027...
0.6085863
44
Return the native string base64decoded (as a native string).
def base64_decode(n, encoding='ISO-8859-1'): decoded = base64.decodestring(n.encode('ascii')) return tonative(decoded, encoding)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_base64(in_str):\n return base64.decodestring(in_str)", "def decode_base64(in_str):\n import base64\n return base64.decodestring(in_str)", "def _b64decode(self, string):\n import base64\n return base64.b64decode(string)", "def _b64decode(self, string):\n import base64\...
[ "0.8067439", "0.80654204", "0.795048", "0.795048", "0.7825964", "0.77486134", "0.7590062", "0.7526743", "0.7523486", "0.74797565", "0.7419113", "0.7362449", "0.7340626", "0.7317962", "0.722794", "0.72097844", "0.71709585", "0.710157", "0.7080437", "0.7070938", "0.7067492", ...
0.7763325
5
Linear interpolation between two numbers. Useful for computing model progress.
def mix(a, b, amount): return ((1.0 - amount) * a) + (amount * b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_lerp(a, b, x):\n\n return a + x * (b - a)", "def linear_interpolate(x, x0, y0, x1, y1):\n try:\n return (y0 * (x1 - x) + y1 * (x - x0)) / (x1 - x0)\n except ZeroDivisionError:\n return 0.0", "def _lerp(self, start_value, end_value):\n # @todo: can probably replace ...
[ "0.6891263", "0.68196017", "0.6787468", "0.6765854", "0.67290205", "0.6653676", "0.66533405", "0.65707356", "0.6540503", "0.65130246", "0.6471198", "0.6448784", "0.6440433", "0.6435491", "0.64236724", "0.64230263", "0.6400892", "0.63270205", "0.63234186", "0.6308474", "0.6302...
0.0
-1
Evaluate a hyperchunk expression.
def evaluate(hdf5_array, expression, expression_type, expression_level=0, hyperslice=None): # cherrypy.log.error("%sEvaluating %s expression: %s" % ( # " " * expression_level, expression_type, slycat.hyperchunks.tostring(expression))) if isinstance(expression, int): return expression elif ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(compiled_expression):", "def evaluateValue(compiled_expression):", "def evaluateStructure(compiled_expression):", "def Eval(expression):\n # pylint: disable=eval-used\n return eval(expression)", "def evaluateText(compiled_expression):", "def __compute(self, string_expression):\...
[ "0.68550146", "0.62890464", "0.6096527", "0.6064937", "0.5928181", "0.5926942", "0.5815244", "0.57254684", "0.57254684", "0.5722065", "0.5640725", "0.5634758", "0.5618035", "0.56178874", "0.5598748", "0.5591727", "0.55853295", "0.5584246", "0.5561595", "0.5537471", "0.5502795...
0.5864296
6
Update the model, and signal any waiting threads that it's changed. will only update model base on "state", "result", "started", "finished", "progress", "message"
def update_model(database, model, **kwargs): with get_model_lock(model["_id"]): model = database.get('model',model["_id"]) for name, value in list(kwargs.items()): if name in ["state", "result", "started", "finished", "progress", "message"]: model[name] = value database.sav...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_model(self, verbose):\n if self.comm.project.meshes == \"multi-mesh\":\n self.comm.lasif.move_gradient_to_cluster()\n\n if not self.task_dict[\"summing_completed\"]:\n grad_summer = GradientSummer(comm=self.comm)\n grad_summer.sum_gradients(\n ...
[ "0.6762966", "0.6599357", "0.6590767", "0.654541", "0.65431905", "0.64981276", "0.64073306", "0.63160753", "0.62998945", "0.6161755", "0.61373526", "0.61307395", "0.6046786", "0.6040864", "0.603853", "0.6015816", "0.5989257", "0.5976024", "0.5965626", "0.5942992", "0.59074223...
0.6560515
3
calls the parse function specified by the registered parser
def parse_existing_file(database, parser, input, attachment, model, aid): kwargs = {} aids = [] aids.append(aid) try: slycat.web.server.plugin.manager.parsers[parser]["parse"](database, model, input, attachment, aids, **kwargs) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, parsed):", "def __call__(self, parser, text):\n try:\n nltk_parse_tree = parser(text)\n\n self._evaluate(nltk_parse_tree)\n except:\n self.player.respond(\"I'm sorry, I don't understand.\")", "def dispatch(self, filename):\n\n parser = self.fi...
[ "0.7141631", "0.6943791", "0.6737296", "0.66144806", "0.65685266", "0.65541196", "0.65362394", "0.6534741", "0.636403", "0.6354073", "0.6245667", "0.6234949", "0.6231486", "0.6178043", "0.616621", "0.6158808", "0.6157734", "0.61548436", "0.61548436", "0.61548436", "0.61548436...
0.0
-1
Retrieve metadata describing an arrayset artifact.
def get_model_arrayset_metadata(database, model, aid, arrays=None, statistics=None, unique=None): if isinstance(arrays, str): arrays = slycat.hyperchunks.parse(arrays) if isinstance(statistics, str): statistics = slycat.hyperchunks.parse(statistics) if isinstance(unique, str): unique...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metadata(self) -> 'outputs.DataCollectionEndpointResponseMetadata':\n return pulumi.get(self, \"metadata\")", "def get_assets_metadata(self):\n return Metadata(**settings.METADATA['asset_ids'])", "def GetMetadata(self):\n return self.dict['meta']", "def _getAllMeta(self):\n try:\n...
[ "0.5965084", "0.5936909", "0.57802886", "0.57577825", "0.5755986", "0.5726956", "0.5722624", "0.57162297", "0.57162297", "0.5708068", "0.5654824", "0.5649437", "0.56223595", "0.56223595", "0.56223595", "0.56223595", "0.56223595", "0.56012475", "0.5600938", "0.5594341", "0.558...
0.64080864
0
Read data from an arrayset artifact.
def get_model_arrayset_data(database, model, aid, hyperchunks): # parse hyperchunks if isinstance(hyperchunks, str): hyperchunks = slycat.hyperchunks.parse(hyperchunks) return_list = [] # get lock and open file with slycat.web.server.hdf5.lock: with slycat.web.server.hdf5.open(mode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read(self, data_set, location=None):\n self._open_file(data_set, location)\n\n for i, array_id in enumerate(\n data_set._h5_base_group['Data Arrays'].keys()):\n # Decoding string is needed because of h5py/issues/379\n name = array_id # will be overwritten if ...
[ "0.68536", "0.6536912", "0.6432639", "0.6314505", "0.5697424", "0.5666781", "0.5609006", "0.56069285", "0.55209285", "0.5469197", "0.54431087", "0.54424345", "0.5429055", "0.5405057", "0.5379938", "0.5350713", "0.53391415", "0.5336844", "0.5309386", "0.53012276", "0.52882814"...
0.60102564
4
Start a new model array set artifact.
def put_model_arrayset(database, model, aid, input=False): model = database.get('model',model["_id"]) slycat.web.server.update_model(database, model, message="Starting array set %s." % (aid)) storage = uuid.uuid4().hex with slycat.web.server.hdf5.lock: with slycat.web.server.hdf5.create(storage)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put_model_array(database, model, aid, array_index, attributes, dimensions):\n slycat.web.server.update_model(database, model, message=\"Starting array set %s array %s.\" % (aid, array_index))\n model = database.get('model', model['_id'])\n storage = model[\"artifact:%s\" % aid]\n with slycat.web.se...
[ "0.61201274", "0.55832493", "0.55832493", "0.55684704", "0.5436291", "0.5358201", "0.5327634", "0.52918756", "0.52394766", "0.5192222", "0.5192222", "0.5192222", "0.5192222", "0.51882184", "0.5163489", "0.5162972", "0.5125661", "0.51193255", "0.50964105", "0.50704527", "0.505...
0.5996218
1
store array for model
def put_model_array(database, model, aid, array_index, attributes, dimensions): slycat.web.server.update_model(database, model, message="Starting array set %s array %s." % (aid, array_index)) model = database.get('model', model['_id']) storage = model["artifact:%s" % aid] with slycat.web.server.hdf5.loc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_model_array(objects):\n\tfor elem in objects:\n\t\telem.save()", "def array(self):", "def store(self):\n\n pass", "def __array__(self):\n return self.to_array()", "def __array__(self):\n return self.array", "def put_model_arrayset_data(database, model, aid, hyperchunks, data...
[ "0.67616886", "0.66248757", "0.6282884", "0.61489743", "0.6124077", "0.61121273", "0.6021722", "0.5923599", "0.5916513", "0.59119177", "0.585429", "0.58484674", "0.58484674", "0.58484674", "0.58484674", "0.58430886", "0.58313227", "0.57929647", "0.5777224", "0.5758766", "0.57...
0.62951946
2
Write data to an arrayset artifact.
def put_model_arrayset_data(database, model, aid, hyperchunks, data): # cherrypy.log.error("put_model_arrayset_data called with: {}".format(aid)) if isinstance(hyperchunks, str): hyperchunks = slycat.hyperchunks.parse(hyperchunks) data = iter(data) slycat.web.server.update_model(database, model...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_write_element(setup_teardown_file):\n f = setup_teardown_file[3]\n\n dt = np.dtype('(3,)f8')\n dset = f.create_dataset('x', (10,), dtype=dt)\n\n data = np.array([1, 2, 3.0])\n dset[4] = data\n\n out = dset[4]\n assert np.all(out == data)", "def test_write_element(self):\n dt ...
[ "0.65863824", "0.6536039", "0.62674475", "0.6248463", "0.6099719", "0.6086565", "0.5947786", "0.5932743", "0.5904107", "0.5831756", "0.58212835", "0.5807893", "0.57833177", "0.57301813", "0.566023", "0.56549037", "0.5618263", "0.5617314", "0.55858254", "0.5577587", "0.5571146...
0.6964377
0
Delete a model parameter in the couch database
def delete_model_parameter(database, model, aid): with get_model_lock(model["_id"]): del model["artifact:%s" % aid] del model["artifact-types"][aid] database.save(model)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_field(model, *arg):\n return model._pw_index_.delete_field(*arg)", "def delete_parameter(request, parameter, **_kwargs):\n pass", "def obj_delete(self, request=None, **kwargs):\n self.get_collection(request).remove({ \"_id\": ObjectId(kwargs.get(\"pk\")) })", "async def rm_object(model,...
[ "0.74125355", "0.7057663", "0.6858939", "0.6829538", "0.6783668", "0.6773147", "0.6772022", "0.6767092", "0.6750633", "0.6732334", "0.67046046", "0.6679741", "0.6674734", "0.6657565", "0.663638", "0.66068643", "0.6587644", "0.6583732", "0.6554846", "0.6554846", "0.6550237", ...
0.7517227
0
Create a cached remote session for the given host.
def create_session(hostname, username, password): return slycat.web.server.remote.create_session(hostname, username, password, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_session(self,session_id,host_id,host_name,spotify_token):\n self.sessions[session_id] = {\n \"HOST\" : {\n \"ID\" : host_id,\n \"NAME\" : host_name,\n \"spotify_token\" : spotify_token,\n \"spotify_player\"...
[ "0.60513884", "0.5854512", "0.5685533", "0.56772697", "0.56223834", "0.56103456", "0.55523884", "0.5550031", "0.5545152", "0.55318147", "0.54500717", "0.54113406", "0.5394822", "0.53833413", "0.53454465", "0.5333294", "0.53289765", "0.53118473", "0.5303092", "0.52960545", "0....
0.6709572
0
Submits a command to the slycatagent to check the status of a submitted job to a cluster running SLURM.
def checkjob(sid, jid): with slycat.web.server.remote.get_session(sid) as session: return session.checkjob(jid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def submit_slurm_job(redmine_instance, issue, work_dir, cmd, job_type, cpu_count=8, memory=12000):\n # Set status of issue to In Progress\n redmine_instance.issue.update(resource_id=issue.id,\n status_id=2,\n notes='Your {} job has been submit...
[ "0.67806154", "0.64936507", "0.64204454", "0.64122754", "0.6343671", "0.62638646", "0.6209969", "0.61676043", "0.6123873", "0.60592985", "0.59875995", "0.5981088", "0.59467685", "0.5936007", "0.58914423", "0.58903265", "0.5865847", "0.5835899", "0.5825963", "0.57195586", "0.5...
0.6096987
9
Returns the content of a file from a remote system.
def get_remote_file(sid, path): with slycat.web.server.remote.get_session(sid) as session: return session.get_file(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_remote_file(remote_command_executor, file_path):\n logging.info(f\"Retrieving remote file {file_path}\")\n result = remote_command_executor.run_remote_command(f\"cat {file_path}\")\n assert_that(result.failed).is_false()\n return result.stdout.strip()", "def ReadRemoteFile(url) -> bytes:\n ...
[ "0.7640399", "0.7553728", "0.7478964", "0.7462949", "0.71824425", "0.71270823", "0.7121259", "0.70242935", "0.6997884", "0.69715077", "0.6936305", "0.6915336", "0.67810124", "0.6629874", "0.6550695", "0.65336716", "0.6516444", "0.6455042", "0.64504737", "0.6403048", "0.633445...
0.7170343
5
Returns the content of a file from a remote system.
def write_remote_file(sid, path, data): with slycat.web.server.remote.get_session(sid) as session: return session.write_file(path, data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_remote_file(remote_command_executor, file_path):\n logging.info(f\"Retrieving remote file {file_path}\")\n result = remote_command_executor.run_remote_command(f\"cat {file_path}\")\n assert_that(result.failed).is_false()\n return result.stdout.strip()", "def ReadRemoteFile(url) -> bytes:\n ...
[ "0.76377964", "0.7553697", "0.74793774", "0.74607646", "0.71808547", "0.7169315", "0.7126356", "0.712121", "0.7023629", "0.6995676", "0.6972547", "0.693851", "0.6915787", "0.67796135", "0.66305393", "0.65500766", "0.6534719", "0.6515702", "0.64542055", "0.64537203", "0.640158...
0.0
-1
Returns the content of a file from a remote system.
def get_remote_file_server(client, sid, path): with slycat.web.server.remote.get_session_server(client, sid) as session: return session.get_file(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_remote_file(remote_command_executor, file_path):\n logging.info(f\"Retrieving remote file {file_path}\")\n result = remote_command_executor.run_remote_command(f\"cat {file_path}\")\n assert_that(result.failed).is_false()\n return result.stdout.strip()", "def ReadRemoteFile(url) -> bytes:\n ...
[ "0.7637799", "0.75530237", "0.7480447", "0.7462526", "0.71802956", "0.71691436", "0.7127205", "0.7121969", "0.7023323", "0.69718087", "0.69356894", "0.69155663", "0.6780282", "0.6630117", "0.65488577", "0.6533866", "0.6515667", "0.6454058", "0.64513093", "0.6402387", "0.63329...
0.69964707
9
get the resonse_url and clean it to make sure that we are not being spoofed
def response_url(): current_url = urlparse(cherrypy.url()) # gets current location on the server try: location = cherrypy.request.json["location"] if parse_qs(urlparse(location['href']).query)['from']: # get from query href cleaned_url = parse_qs(urlparse(location['href']).query)['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_long_url(self):\n url = self.cleaned_data.get('long_url')\n headers = getattr(settings, 'DEFLECT_REQUESTS_HEADERS', None)\n timeout = getattr(settings, 'DEFLECT_REQUESTS_TIMEOUT', 3.0)\n try:\n r = requests.get(url, headers=headers, timeout=timeout,\n ...
[ "0.63518", "0.622883", "0.6113596", "0.61127734", "0.6089494", "0.60464", "0.60459745", "0.60136104", "0.6003202", "0.5996835", "0.5968541", "0.5964263", "0.5957325", "0.5915546", "0.5894142", "0.5866399", "0.58576095", "0.5803815", "0.57866335", "0.5758677", "0.5738808", "...
0.6576252
0
decode the url from the json that was passed to us
def decode_username_and_password(): try: # cherrypy.log.error("decoding username and password") user_name = str(base64_decode(cherrypy.request.json["user_name"]).decode()) password = str(base64_decode(cherrypy.request.json["password"]).decode()) except Exception as e: cherrypy.lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode(self, shortUrl):\n pass", "def fetchJson(url):", "def _parsing_url(self, base_url):\n url2 = f\"{self.location}?apikey={self.api_key}&details=true\"\n absolute_url = urljoin(base_url, url2)\n return absolute_url", "def parse(url, decoded=True, lazy=False):\n enc_url ...
[ "0.6724137", "0.62845045", "0.61558026", "0.6129052", "0.607561", "0.6058836", "0.60544485", "0.60304576", "0.59773505", "0.59586334", "0.59586334", "0.5936556", "0.59338444", "0.5920652", "0.59200126", "0.5906249", "0.58911985", "0.58513397", "0.58460695", "0.58417153", "0.5...
0.0
-1
try and delete any outdated sessions for the user if they have the cookie for it
def clean_up_old_session(user_name=None): cherrypy.log.error("cleaning all sessions for %s" % user_name) if "slycatauth" in cherrypy.request.cookie: try: # cherrypy.log.error("found old session trying to delete it ") sid = cherrypy.request.cookie["slycatauth"].value c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def session_gc(session_store):\n if random.random() < 0.001:\n # we keep session one week\n if hasattr(session_store, 'gc'):\n session_store.gc()\n return\n last_week = time.time() - 60*60*24*7\n for fname in os.listdir(session_store.path):\n path = o...
[ "0.7129545", "0.697994", "0.672983", "0.6679393", "0.66634405", "0.6570749", "0.6550736", "0.6536721", "0.6528558", "0.651916", "0.6491734", "0.64853835", "0.6464785", "0.6463646", "0.6447692", "0.6446159", "0.6430663", "0.64276487", "0.64138967", "0.63970834", "0.6382262", ...
0.77049917
0
check to see if the session user is equal to the apache user raise 403 and delete the session if they are not equal
def check_user(session_user, apache_user, sid): if session_user != apache_user: cherrypy.log.error("session_user::%s is not equal to apache_user::%s in standard auth" "deleting session and throwing 403 error to the browser" % (session_user, apache_user)) # force a lock so ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_not_logged_cannot_delete(self):\n\n utils.test_not_logged_cannot_access(self, self.url)", "def process_request(self, request):\n if request.user.is_authenticated():\n cache = get_cache('default')\n cache_timeout = 86400\n cache_key = \"user_pk_%s_restrict\"...
[ "0.6440854", "0.64278203", "0.63911074", "0.62447345", "0.6228785", "0.6101922", "0.60444987", "0.60331225", "0.6016866", "0.59865224", "0.5937146", "0.5915369", "0.5902086", "0.58984023", "0.5892552", "0.58844024", "0.58813035", "0.58813035", "0.58813035", "0.58813035", "0.5...
0.8276541
0
WSGI/RevProxy nologin session creations. Successful authentication and access verification, create a session and return.
def create_single_sign_on_session(remote_ip, auth_user, secure=True): # must define groups but not populating at the moment !!! groups = [] # Successful authentication and access verification, create a session and return. cherrypy.log.error("++ create_single_sign_on_session creating session for %s" % a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_login_session(self):\r\n sess = requests.Session()\r\n r = sess.get(self.page(self.LOGIN_PAGE), verify=self.verify)\r\n if r.status_code == 200:\r\n csrf_token = EndaceWebSession.find_csrf_token_login(r.content)\r\n if csrf_token is None:\r\n ra...
[ "0.6733353", "0.6671999", "0.6663395", "0.6483263", "0.64537203", "0.64376736", "0.6419057", "0.6402842", "0.63882256", "0.63803804", "0.6374061", "0.6363517", "0.63575304", "0.6329776", "0.63234717", "0.63106215", "0.6230235", "0.6218408", "0.62107366", "0.62045014", "0.6176...
0.6349125
13
checks that the connection is https and then returns the users remote ip
def check_https_get_remote_ip(): if not (cherrypy.request.scheme == "https" or cherrypy.request.headers.get("x-forwarded-proto") == "https"): cherrypy.log.error("slycat-standard-authentication.py authenticate", "cherrypy.HTTPError 403 secure connection required.") rai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRemoteHost():", "def remoteip(self) :\n\t\ttry :\n\t\t\treturn self._remoteip\n\t\texcept Exception as e:\n\t\t\traise e", "def get_remote_ip(request):\n \n return utilities.get_remote_ip(request)", "def get_remote_ip(request):\n return request.META.get(\"HTTP_REMOTE_ADDR\", request.META.get(...
[ "0.7072389", "0.6898136", "0.6809364", "0.67104733", "0.65298426", "0.6514117", "0.6488618", "0.6484981", "0.6445124", "0.6399658", "0.63811284", "0.6367772", "0.6339807", "0.6320289", "0.6307788", "0.62999815", "0.62957853", "0.6291374", "0.6265773", "0.62566173", "0.6234748...
0.8518679
0
Get prime factors of a number My first attempt
def prime_factors(num): prime_factors = [] for i in range(2, num + 1): if (num % i) == 0 and is_prime(i) == True: prime_factors.append(i) return prime_factors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prime_factors(number):\n factors = []\n\n if number == 0 : return factors\n\n # first round factors by two\n while number % 2 == 0:\n factors.append(2)\n number /= 2\n\n # other rounds goes by odd numbers only (no other even is prime)\n divisor = 3\n while divisor <= number:\...
[ "0.82042557", "0.8147192", "0.8018355", "0.8004612", "0.79873264", "0.7944634", "0.79333955", "0.7930283", "0.7920351", "0.7916223", "0.7902941", "0.7897498", "0.7886862", "0.7878178", "0.7859822", "0.785683", "0.7854722", "0.78475076", "0.7846217", "0.7843143", "0.7819817", ...
0.7765716
24
A better version utilizing reduce to compute the factors
def prime_factors(number): all_factors = factors(number) return list(filter(lambda x: is_prime(x), all_factors))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_factors():", "def factorize(x):\n pass", "def factors(self):\n X = [Var(i,2) for i in range(self.nvar)]\n factors = [Factor([],np.exp(self.c))] \n # TODO: exclude if zero? or exclude if inf/-inf, or if in \"assigned\", or?\n factors = factors + [Factor([X[i]],[-th,th]).exp() for i,th in ...
[ "0.78034914", "0.7011307", "0.6977456", "0.6975599", "0.69231594", "0.6762288", "0.6699016", "0.6690765", "0.6627676", "0.6618061", "0.6558593", "0.6540131", "0.6521527", "0.65092236", "0.64560753", "0.6455464", "0.64112425", "0.6380858", "0.63768893", "0.63763225", "0.634369...
0.0
-1
Initializes the class info
def __init__(self, inventory_info, brand, voltage): #Creates common instance variables from the parent class Inventory.__init__(self, inventory_info) self.brand = brand self.voltage = voltage
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(cls):", "def __init__(self):\n self.classes = {}", "def _init(self):\n pass", "def __init__(self):\n self.info = dict()", "def init(self):\n pass", "def init(self):\n pass", "def init(self):\n pass", "def init(self):\n pass", "def init...
[ "0.764334", "0.72520864", "0.72341454", "0.7223234", "0.7137112", "0.7137112", "0.7137112", "0.7137112", "0.7137112", "0.7137112", "0.7137112", "0.7137112", "0.6976509", "0.697203", "0.6962759", "0.6962759", "0.6962759", "0.6962759", "0.6962759", "0.69617856", "0.69617856", ...
0.0
-1
Returns a dictionary of the appliance information
def return_as_dictionary(self): output_dict = Inventory.return_as_dictionary(self) output_dict['brand'] = self.brand output_dict['voltage'] = self.voltage return output_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_info(self):\n model = self.data.wiserSmart.getWiserDeviceInfo(self.appliance_id).get(\"modelId\")\n\n return {\n \"name\": self.appliance_name,\n \"identifiers\": {(DOMAIN, self.unique_id)},\n \"manufacturer\": MANUFACTURER,\n \"model\": model,\n...
[ "0.68340296", "0.64511883", "0.6429673", "0.63661414", "0.6178411", "0.6143794", "0.6004927", "0.5908223", "0.5882048", "0.5861325", "0.58534074", "0.582269", "0.5810581", "0.5738718", "0.57187784", "0.5704744", "0.56831396", "0.56160563", "0.5611361", "0.56076753", "0.559992...
0.55311066
28
Initializer of the density estimator object
def __init__(self, sigma=80, kernel_sizes=[1, 5, 10, 20, 30, 50], trainSize=80): self.sigma = sigma self.original_image = misc.face(gray=True) self.blurred_image = image.gaussian_filter( self.original_image, sigma ) self.kernel_sizes = kernel_sizes self.trainSize = trainSize ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(\n self,\n estimator = SGDClassifier(),\n ):\n self.estimator = estimator", "def initializeDistribution(self):\n if (self.lowerBoundUsed == False and self.upperBoundUsed == False):\n self._distribution = distribution1D.BasicExponentialDistribution(self...
[ "0.6776613", "0.6710023", "0.6679785", "0.66536045", "0.66534305", "0.6633553", "0.6618915", "0.6572826", "0.6543909", "0.6539447", "0.65300274", "0.6413623", "0.6406495", "0.6398659", "0.6389819", "0.63341206", "0.6296253", "0.62479204", "0.6244795", "0.6235777", "0.62308174...
0.0
-1
Method that displays the original and blurred images
def displayImages(self): plt.figure(figsize=(8,6)) plt.subplot(1,2,1) plt.imshow( self.original_image, cmap="gray") plt.title("Original Image") plt.subplot(1,2,2) plt.imshow( self.blurred_image, cmap="gray") plt.title("Blurred Image")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_image(self):\n cv2.imshow('Image', self.__diff_image())\n cv2.waitKey()", "def blurImage(self):\n\n print (\"--Blurring Main Image--\")\n self.blurButton.setDown(True)\n im = Image.open(self.ActivePhoto)\n blurred_image = im.filter(ImageFilter.GaussianBlur(1))\n...
[ "0.65680623", "0.656295", "0.6562389", "0.64684945", "0.64078856", "0.6385656", "0.63168657", "0.6307291", "0.62678707", "0.6236219", "0.6151714", "0.60914916", "0.6090772", "0.608311", "0.6025253", "0.5972603", "0.59622127", "0.5956339", "0.5948988", "0.59457", "0.59445393",...
0.82821536
0
Method that draws a given number of samples
def drawSamples(self, numberOfSamples, from_where="image"): #drawing n random numbers between 0 and 1 randomVector = np.random.random(int(numberOfSamples)) #creating the CDF function by linearizing and normalizing the image CDF = np.cumsum(self.blurred_image)/np.sum(self.blurred_image)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_samples(self, n_samples):", "def generate_samples(self, n_samples):", "def draw(self, nsamples):\n \n if self.dist == 'normal':\n mean = self.mean\n sd = self.sd\n self.sample = sd * np.random.randn(nsamples) + mean\n \n elif self.di...
[ "0.7396069", "0.7396069", "0.69397813", "0.6703381", "0.6670661", "0.66620207", "0.65451866", "0.6485609", "0.6326246", "0.6252662", "0.624357", "0.6222786", "0.62139446", "0.62139446", "0.62139446", "0.62139446", "0.62012917", "0.61866266", "0.616744", "0.6128955", "0.609176...
0.63690203
8
Estimating the PDF via the Parzen window estimator
def estimateDensity(self, sampledPDF, h=1, kernel='box'): if kernel=='box': kernel = np.ones((h,h)) else: kernel = np.ones((h,h)) PDF = image.correlate(input=sampledPDF, weights=kernel, mode='mirror') PDF = PDF/np.sum(PDF) #normalize pdf return PDF
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pdf(self, x):\n raise NotImplementedError", "def PDF(gal_index,**kwargs):\n\n p = copy.copy(params)\n for key,val in kwargs.items():\n setattr(p,key,val)\n\n # PDF PLACEHOLDER\n lognHs = np.linspace(-5,8,200)\n total_PDF = np.zeros(len(lognHs))\n\n #...
[ "0.5916287", "0.5728557", "0.5727254", "0.56561184", "0.56460965", "0.564025", "0.5637642", "0.5618261", "0.5612769", "0.5608306", "0.5597453", "0.55869424", "0.55792725", "0.5566751", "0.5535333", "0.5523445", "0.54895705", "0.5463009", "0.5429472", "0.5410741", "0.53716004"...
0.0
-1
Applying maximum likelihood to compute the optimal kernel size
def evaluateSet( self, numberOfSamples=10000, kernels_to_test=[], threshold=10e-12 ): if( len(kernels_to_test)==0 ): kernels_to_test = self.kernel_sizes trainSet_likelihoods = [] testSet_likelihoods = [] _,indexes = self.drawSamples(numberOfSamples) likelihoods = {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MaxHks(N): \n return np.log2(N-1)/2", "def get_kernel_size(factor):\r\n return 2 * factor - factor % 2", "def max_log_likelihood(data):\n # Assume data is given as counts\n tot = sum(data)\n return _np.sum([nlogp(n, n / tot) for n in data if n > 0])", "def max_log_likelihood_fit(self) -...
[ "0.6288088", "0.62006557", "0.6194032", "0.6133932", "0.60385174", "0.6037988", "0.59555125", "0.59118533", "0.5898888", "0.58942467", "0.58941555", "0.5894055", "0.58850336", "0.5873435", "0.5863817", "0.5839507", "0.5833621", "0.5825103", "0.58148074", "0.58127475", "0.5803...
0.0
-1
Displaying the reconstructed density
def displayReconstruction(self, samples, numberOfSamples): plt.figure(figsize=(12,8)) plt.suptitle( "Reconstruction using " + str(int(numberOfSamples)) + " samples") pdfs = [] for i, h in enumerate( self.kernel_sizes ): pdf = self.estimateDensity( samples, h) p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_density(self):\n tot_fields = self.tot_col * self.tot_rows # Total number of fields\n pop_fields = 100 - ((self.empty / tot_fields) * 100)\n\n print('Information density (%): ' + str(pop_fields) + '%')\n results.append('Information density (%): ' + str(pop_fields) + '%')", "...
[ "0.6939039", "0.65721995", "0.6411101", "0.6290236", "0.6290236", "0.6290236", "0.62702644", "0.6186949", "0.60757685", "0.6065886", "0.60595256", "0.6030779", "0.60120064", "0.59907037", "0.596386", "0.58940405", "0.5893764", "0.5875544", "0.58697325", "0.583976", "0.578265"...
0.65008986
2
Open the serial port of the UARTTTL Converter as 'COM3' in Windows. Exit if any errors occur.
def __init__(self): self.port = 'COM3' self.baud = 9600 try: self.ser = Serial(self.port, self.baud) except: exit("<ERROR: check serial connection>") if not self.ser.is_open: exit(f"<ERROR: can't open serial port: {self.port}>") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_serial():\n ser = serial.Serial()\n #ser.port = \"\\\\.\\COM4\" # Windows\n ser.port = \"/dev/ttyUSB0\" # Linux\n ser.baudrate = 57600\n try:\n ser.open()\n except Exception, e:\n logger.info(\"Possible open serial port: \" + str(e))\n print 'Check the serial ...
[ "0.6325166", "0.62709165", "0.60685354", "0.60586196", "0.60050476", "0.5996784", "0.5898819", "0.5875078", "0.584626", "0.5798623", "0.5706698", "0.5626539", "0.56090456", "0.5607052", "0.56019235", "0.5593599", "0.5586568", "0.5563705", "0.55613315", "0.55433446", "0.554102...
0.61393535
2
Connect the autoguiding program to MCU by echoing a message; (Not currently implemented, because stable connection is assumed after opening the port).
def connect(self): wBytes = self.ser.write(str('UART Enabled').encode('ascii')) sleep(0.05) echoStr = self.ser.read(self.ser.in_waiting) if echoStr is 'UART Enabled': print(f'\t<Connection Succesful: {echoStr}>\n')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect():\n try:\n MotorController.serial_connection = serial.Serial(\"/dev/ttyUSB0\")\n MotorController.serial_connection.timeout = 1\n MotorController.serial_connection.baudrate = 115200\n MotorController.serial_connection.xonxoff = True\n MotorC...
[ "0.6718128", "0.65281594", "0.6485706", "0.6298746", "0.62421924", "0.62221706", "0.6207371", "0.6146021", "0.6097363", "0.60800916", "0.60669076", "0.60279125", "0.6027382", "0.5954995", "0.59388345", "0.59245974", "0.587642", "0.58689845", "0.5866315", "0.58613867", "0.5859...
0.6433782
3
Send motor rates to the MCU.
def transmit(self, raRate, decRate): # send raRate and decRate with 3 digits beyond decimal, add in extra # spaces to ensure MCU program catches all characters. data = f" {raRate:.3f} {decRate:.3f} " try: self.ser.write(data.encode('ascii')) sleep(0.1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_motor_speed(data):\n print('sending new motor power')\n slider_power = json.dumps({\"id\" : \"Motor1\", \"speed\": data})\n SERIAL_PARENT.send(slider_power)\n OUTGOING.append(slider_power)", "def serialTransmit( motorInput ):\n\n\tpub = rospy.Publisher('/rxtx/sendMA', UInt8MultiArray)\n\ts...
[ "0.69105667", "0.60923356", "0.6075218", "0.60559964", "0.60223866", "0.595638", "0.5952413", "0.5894706", "0.5892083", "0.58580714", "0.58504534", "0.58489096", "0.58374953", "0.58277863", "0.58238757", "0.5792214", "0.5789344", "0.5784369", "0.57820576", "0.5724529", "0.570...
0.57064885
20
Disconnect UART serial port.
def disconnect(self): self.ser.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disconnect(self):\n printf(\"Disconnect from port - {0}...\".format(self.port.device))\n self.__serial.close()\n self.__isConnected = False\n self.checking_port_flag = False", "def disconnect(self):\n try:\n if self.serial.isOpen():\n self.serial.c...
[ "0.73141676", "0.7226807", "0.7215016", "0.6835475", "0.6612377", "0.6580393", "0.6518381", "0.64457214", "0.640015", "0.6360599", "0.63575613", "0.6318108", "0.6307145", "0.62991554", "0.61748624", "0.6153207", "0.60209024", "0.6006931", "0.5997012", "0.5960546", "0.5944861"...
0.6409816
8
create new directory with a given name and location
def mkdir(name): speech.speak("Executing 'mkdir " + name + "' command to create a directory.") subprocess.call(["mkdir", name])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_directory(path, name):\n new_path = os.path.join(path, name)\n if not os.path.isdir(new_path):\n subprocess.run(['mkdir', new_path])", "def create_dir(name_new_path):\n\n try:\n os.mkdir(config_tools.full_dest + name_new_path)\n except OSError:\n print(\"Создать директ...
[ "0.7940952", "0.7751765", "0.7730348", "0.7707595", "0.76756537", "0.7597756", "0.7534886", "0.74532807", "0.74532807", "0.7450739", "0.742758", "0.7392121", "0.73771375", "0.7363844", "0.7363562", "0.735646", "0.73481566", "0.73136765", "0.73070407", "0.7306524", "0.7302084"...
0.73013836
21
show documentation for a given command
def man(command): speech.speak("Executing 'man " + command + "' to show you documentation for this command.") subprocess.call(["man", command])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help(command=None):\n if command is None: \n # print first line of docstring\n for cmd in commands:\n ds = commands[cmd].__doc__.split('\\n')[0]\n print \"%-16s %s\" % (cmd,ds)\n else:\n print commands[command].__doc__", "def comman...
[ "0.83478016", "0.77925104", "0.74063873", "0.73907745", "0.7329704", "0.7214699", "0.7143654", "0.7078661", "0.70768416", "0.70658195", "0.7049626", "0.6950294", "0.68523484", "0.6851183", "0.6839119", "0.6814253", "0.6781433", "0.6778989", "0.67785394", "0.67772233", "0.6757...
0.70985985
7
extract tar, gz, zip, rar files
def extract(file, fileFormat): speech.speak("Extracting files in " + file + ".") patoolib.extract_archive(file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_all(fn,dst=\".\"):\r\n if tarfile.is_tarfile(fn): \r\n with tarfile.open(fn,'r') as tf:\r\n tf.extractall(dst)\r\n tf.close()\r\n elif zipfile.is_zipfile(fn):\r\n with zipfile.ZipFile(fn, 'r') as zf:\r\n zf.extractall(dst)\r\n zf.close()\r...
[ "0.7512958", "0.7361045", "0.7168272", "0.713573", "0.6851653", "0.6839956", "0.6807038", "0.67333925", "0.6730762", "0.6699402", "0.667898", "0.6668537", "0.66684425", "0.6660241", "0.66132975", "0.65898645", "0.6579276", "0.6570976", "0.65682155", "0.65599513", "0.65282065"...
0.61160177
47
copy file or directory at a given location; can be pasted later
def copy(location): copyData = settings.getDataFile() copyFileLocation = os.path.abspath(location) copy = {"copyLocation": copyFileLocation} dataFile = open(copyData, "wb") pickle.dump(copy, dataFile) speech.speak(location + " copied successfully!") speech.speak("Tip: use 'hallie paste' to paste this file.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _copy_file ( self, source, dest ):\n return", "def doTheCopy(argpath,argdest):\n print(\"To copy:\"+argpath)\n shutil.copy(argpath,argdest)", "def paste(location):\n\tcopyData = settings.getDataFile()\n\tif not location:\n\t\tlocation = \".\"\n\ttry:\n\t\tdata = pickle.load(open(copyData, \"rb\"...
[ "0.78699106", "0.78513217", "0.7787219", "0.7697764", "0.76555914", "0.7598463", "0.74543375", "0.7350774", "0.729522", "0.72942924", "0.7286982", "0.72575486", "0.72492427", "0.72348595", "0.7225497", "0.7176757", "0.71722156", "0.71607417", "0.7126409", "0.71213377", "0.711...
0.7375638
7
paste a file or directory that has been previously copied
def paste(location): copyData = settings.getDataFile() if not location: location = "." try: data = pickle.load(open(copyData, "rb")) speech.speak("Pasting " + data["copyLocation"] + " to current directory.") except: speech.fail("It doesn't look like you've copied anything yet.") speech.fail("Type 'hallie ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pasteFile(self) -> None:\n if not self._fileClipboard:\n return\n cut = self._fileClipboard.pop()\n filenames = [x.name for x in self._fileClipboard]\n destPaths = [self._currPath.joinpath(x) for x in filenames]\n try:\n duplicates = []\n for...
[ "0.75675744", "0.72383505", "0.69673383", "0.69241136", "0.6830915", "0.6801877", "0.67643505", "0.66626996", "0.6652511", "0.65969956", "0.6596979", "0.64582324", "0.64567304", "0.6437227", "0.6432736", "0.6422666", "0.6394669", "0.6371352", "0.6369552", "0.6356414", "0.6339...
0.7870862
0
=> dict of Location
def toJSType(self): return dict( name=self.name, description=self.description, address=self.address, lat=self.lat, lng=self.lng, submitted_by=self.submitted_by, certified=self.certified, id=str(self.id), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location_dict(self) -> SubDirDict[Optional[str]]:\n location_dict: SubDirDict[Optional[str]] = SubDirDict()\n for directory, location_time in self.camera_placements.items():\n location_dict[Path(directory)] = location_time.location\n\n return location_dict", "def location(...
[ "0.764609", "0.7477134", "0.72553116", "0.7162669", "0.6891924", "0.68018645", "0.6772827", "0.6744064", "0.6725044", "0.67016494", "0.67016494", "0.67016494", "0.67016494", "0.67016494", "0.67016494", "0.67016494", "0.6680989", "0.66465604", "0.6639322", "0.6637375", "0.6618...
0.0
-1
Assign created bookmark logged in user
def form_valid(self, form): form.instance.human = self.request.user return super(CreateBookmark, self).form_valid(form)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bookmark(user_id, item_id):\n Bookmark.objects.get_or_create(user=User.objects.get(pk=user_id),\n item=Item.objects.get(pk=item_id))", "def _add_bookmark(self, user=None):\r\n if user:\r\n DBSession.add(user)\r\n username = user.username\r\n ...
[ "0.7095662", "0.70001817", "0.68548065", "0.6407481", "0.6377778", "0.62824607", "0.6242103", "0.61858726", "0.61509687", "0.6072298", "0.59908825", "0.5969805", "0.59131074", "0.5884926", "0.5761686", "0.5700264", "0.5553401", "0.5538153", "0.5481482", "0.5447973", "0.540859...
0.6098279
9
Convert a hash into a primary key of a bookmark. Redirect to url of that bookmark.
def link(request, link_id): bkmrk_id = Bookmark.decode_id(link_id) bookmark = get_object_or_404(Bookmark, pk=bkmrk_id) if request.user.is_authenticated(): Click.objects.create(human=request.user, bookmark=bookmark) else: Click.objects.create(bookmark=bookmark) return redirect(bookmar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redirect(self):\r\n mdict = self.matchdict\r\n hash_id = mdict.get('hash_id', None)\r\n username = mdict.get('username', None)\r\n\r\n hashed = Hashed.query.get(hash_id)\r\n\r\n if not hashed:\r\n # for some reason bad link, 404\r\n return HTTPNotFound()...
[ "0.63148457", "0.57396394", "0.5684094", "0.5611188", "0.54874325", "0.5427076", "0.542324", "0.5405205", "0.53902143", "0.53448087", "0.526206", "0.5256518", "0.52414", "0.5240961", "0.52375144", "0.5220141", "0.5199927", "0.50420105", "0.5036365", "0.5034292", "0.50134444",...
0.54213333
7
Display list of bookmarks for any given user
def user_list(request, user_name): bookmarks = get_list_or_404(Bookmark.objects.all().filter(human__username=user_name)) return render(request, 'urly_bird/any_user_list.html', {'bookmarks': bookmarks})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bookmark(request):\r\n \r\n if request.method == 'GET':\r\n if request.GET.get('path'):\r\n object_list = BookmarkItem.objects.filter(bookmark__user=request.user).order_by('order')\r\n #print urllib.unquote(request.GET.get('path'))\r\n try:\r\n b...
[ "0.71984094", "0.7148708", "0.6793257", "0.67187834", "0.6641313", "0.6623683", "0.633557", "0.6249334", "0.62378967", "0.6236893", "0.619135", "0.61078155", "0.6044722", "0.59958416", "0.5948521", "0.5945683", "0.5907882", "0.5876983", "0.5854694", "0.58490324", "0.58267343"...
0.7803272
0
Converts cones in the GUIs frame of reference to cones in the lidar's frame of reference and gets those in the lidar's field of view Sets detected_cones with only cones within the lidar's field of view. Sorts the cones by angle starting at 135 degrees.
def lidarScan(self): # Get cones seen by lidar lidar_coords = [] for point in self.gui_points: # Convert from gui frame to lidar frame x = (point[0] - self.lidar_pos[0])*scaling_factor y = (self.lidar_pos[1] - point[1])*scaling_factor # Convert po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotationDetermination(self):\n \n for index, row in enumerate(self.magdata):\n if index > 11 and index < (len(self.magdata) - 12):\n br1 = [row[0] for row in self.magdata[(index-12):(index-2)]]\n bt1 = [row[1] for row in self.magdata[(index-12):(index-2)]]...
[ "0.5472272", "0.5462623", "0.54448014", "0.5388763", "0.535019", "0.53095686", "0.52818936", "0.52364", "0.52262443", "0.51484215", "0.51208395", "0.5072665", "0.5054126", "0.49976072", "0.49777424", "0.4968893", "0.4947722", "0.49220458", "0.4889088", "0.4872785", "0.4870850...
0.6696489
0
Constructor. One endpoint is passed to the constructor, more could be added via call to C{addEndpoints}.
def __init__(self, factory, endpoint=None, identity=None): self.factory = factory self.endpoints = [] self.identity = identity self.socket = Socket(factory.context, self.socketType) self.queue = deque() self.recv_parts = [] self.read_scheduled = None self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, endpoint_a, endpoint_b):\n self.endpoint_a = endpoint_a\n self.endpoint_b = endpoint_b", "def __init__(self, endpoint, project=None):\n self.endpoint = endpoint\n self.project = project", "def __init__ (self, graph, endpoints, aliases, prefixes):\n\n self.g...
[ "0.8295459", "0.73074913", "0.72434187", "0.7152757", "0.6827328", "0.67919844", "0.6727075", "0.6725295", "0.67198765", "0.67135537", "0.669592", "0.6693468", "0.6693394", "0.6571743", "0.653612", "0.64965385", "0.64322674", "0.6400459", "0.6398988", "0.63870555", "0.6339391...
0.0
-1