id
stringlengths
20
20
title
stringclasses
1 value
text
stringlengths
8
768k
ff7969fba10b8228bf6c
def find_barcode(self, forward_sequence, reverse_sequence): output = [None] * 3 seq1 = forward_sequence.seq seq2 = reverse_sequence.seq seq2_rc = seq2.reverse_complement() output[0] = index_iterate(seq1, self.barcodes) output[1] = index_iterate(seq2_rc, self.barcode...
ff797d8b2d01a9531ceb
def update_trainline_stops(url=_STATIONS_CSV_FILE): csv_content = requests.get(url).content all_stops_raw = pd.read_csv(io.StringIO(csv_content.decode('utf-8')), sep=';', index_col=0, low_memory=False) # filter on station with parnt_station_id (that we can call the API with) ...
ff7996bcf23a49035cfe
def isempty(self): return self.head is None
ff79a8fdad06750ded9f
def printInformation(self): print(str(self.amount) + " " + str(self.unit) + " of " + str(self.ingredient_name))
ff79b68fc24e9a7e7c30
def tree_node(tree, list_split, length_list, parent_category, number_iter=0): if number_iter == length_list: return None else: identifier = parent_category + '_' + list_split[number_iter] if identifier not in tree: tree.create_node(parent=parent_category, identifier=identifie...
ff79cc6654197709d9b0
def ev_read(self, worker): raw = worker.current_msg #self.logger.debug("ev_read raw=\'%s\'" % raw) try: self._parser.feed(raw + '\n') except SAXParseException, ex: raise MessageProcessingError( \ 'Invalid communication (%s): "%s"' % (ex.getM...
ff79eff6255ec30ad6aa
def empty_like(df): return df[[]].copy()
ff7a03c04daa0a7129ba
def ValueType(self): return self._get_attribute('valueType')
ff7a15818ead7d9750dc
def save_weights(self): self.Q_value.save_weights(os.path.join(self.path_save_weights, "{}-weights-{}-{}.h5".format(self.agent_name, self.env.getName(), self.steps_cont)))
ff7a210c59f8866864c6
def get(self): return DBSession.query(Task).get( int(self.request.matchdict['id'])).to_json()
ff7a2398c7e80f785887
def calculate_recent_high(tsd,dates): high_prices = [] for date in dates: high_price = tsd[date]["2. high"] high_prices.append(high_price) recent_high = max(high_prices) return recent_high
ff7a26be2dff997674cc
def encode(data): for sample in data: yield utils.autoencode(data)
ff7a2994e378c2095dfa
def test_get_all_groups(self): for i in range(self.hiarc_util.LARGE_ENTITY_COUNT): self.hiarc_groups.create_group(self.hiarc_util.create_group()) all_groups = self.hiarc_groups.get_all_groups() assert self.hiarc_util.LARGE_ENTITY_COUNT == len(all_groups)
ff7a2affa66a5cd91354
def pos_tag_feature(sentences, words, pos_tag): pos_tag_words_count_list = [] # Create a list with the number of words with the input pos_tag appear in the phrase for sentence in sentences: pos_tag_words_count_list.append(len([word for word in sentence.bag_of_words if words[word]....
ff7a4978cb1402948aa8
def scheduler_period(self, scheduler_period: ConfigNodePropertyInteger): self._scheduler_period = scheduler_period
ff7a4a7b1e9cb6bc27b3
def initLayout(self): # Create grid Layout for main widget self.main_widget = QtWidgets.QWidget() self.main_widget.setObjectName('main_widget') self.main_layout = QtWidgets.QGridLayout() self.main_widget.setLayout(self.main_layout) # Create left-side-up widget se...
ff7a5f1d26baea614196
def configuration(self): config = Configuration(self.session) # Get full configuration config.get() return config
ff7a5f4dd41406ad3e3b
def draw_changing_global_graph_temperature(start_date: str, end_date: str) -> None: data = pd.read_csv("GlobalLandTemperaturesByCountry.csv") data = data.drop("AverageTemperatureUncertainty", axis=1) clean_data = data.dropna() sorted_data = clean_data.groupby(['Country', 'dt']).sum().reset_index() ...
ff7a835e58c25be7ed76
def create_hexgrid(self,bbox, side): grid = [] v_step = math.sqrt(3) * side h_step = 1.5 * side x_min = bbox[3][0] x_max = bbox[1][0] y_min = bbox[1][1] y_max = bbox[3][1] # print(x_min , x_...
ff7b01d3590adedb8d19
def test_process_reset_after(self): xknx = XKNX() reset_after_sec = 0.001 async_after_update_callback = AsyncMock() binaryinput = BinarySensor( xknx, "TestInput", "1/2/3", reset_after=reset_after_sec, device_updated_cb=async_aft...
ff7b138ee05e1835f378
def _get_affinity_matrix(self, X, Y=None): if self.affinity == 'precomputed': self.affinity_matrix_ = X return self.affinity_matrix_ if self.affinity == 'nearest_neighbors': if sparse.issparse(X): warnings.warn("Nearest neighbors affinity currently doe...
ff7b4c32ef057d545a8f
def compare_dicts(old: Dict = None, new: Dict = None) -> Dict[str, Dict]: ret = {} for key in set(new or {}).union(old or {}): if key not in old: # New key ret[key] = {"old": "", "new": new[key]} elif key not in new: # Key removed ret[key] = {"new"...
ff7b5c163c56bf70009b
def testServerAPIGetEntitiesByMetaMemeType(serverURL = None, memePath = "Graphyne.Generic", metaMemePath = "Graphyne.GenericMetaMeme"): #"NumericValue.nv_intValue_3" method = moduleName + '.' + '/modeling/getEntitiesByMetaMemeType/<memePath>' Graph.logQ.put( [logType , logLevel.DEBUG , method , "en...
ff7b68ad94a7c7ffdfd3
def assertIntermediateStatuses( statuses, runs): for status in statuses: state = status.state if runs[status.run_id] == "sleep": if not state in sleepDef.interm_states: raise Exception("run type:{0}, expected on of {1}, got {2}".format("sleep", sleepDef.interm_states, state)) if runs[status....
ff7b6a8c1c78c4addda4
def _fit(self, data): self._model = copulas.multivariate.GaussianMultivariate(distribution=self._distribution) self._model.fit(data) self._update_metadata()
ff7b828f36eecb41d26a
def _fixpath(path): return abspath(normpath(path))
ff7b8a14747c476ec1e6
def build_heap(data): swaps = [] for i in range(len(data) // 2, -1, -1): sift_down(i, data, swaps) return swaps
ff7bd35c6fdc4e271535
def __ne__(self, v: 'itkVectorSS4') -> "bool": return _itkVectorPython.itkVectorSS4___ne__(self, v)
ff7bd4ea9820656efc90
def dequeue(self): return self.queue.pop(0)
ff7be07e1d5e20a1da51
def set_query_period(): while True: start_time_input = raw_input("Input the start date and hour in YYYY-MM-DD-HH format:\n") end_time_input = raw_input("Input the end date and hour in YYYY-MM-DD-HH format:\n") try: # strptime throws an exception if the input doesn't match the pattern ...
ff7bee4d588095cdd09c
def run_simulation(self, simulation_input): pass
ff7c035865e1c91bcd78
def __init__(self, MLP_type, hidden_size: int=50, dropout: float=0.2, num_labels: int=4, input_len: int = 5120): super(MultimodalClassifier, self).__init__() self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') if MLP_type == "Sabat": self.classifier = nn.Seque...
ff7c21f6d8c7ea11c07f
def find_range(x,a,b,option='within'): if option=='within': return np.where(np.logical_and(x>=a, x<=b))[0] elif option=='outside': return np.where(np.logical_or(x < a, x > b))[0] else: raise ValueError('unrecognized option paramter: {}'.format(option))
ff7c2878c8478c7f625e
def find_R0(field, L, R1, poloidal_turns): # First, find the location of the magnetic axis: pfl_axis = periodic_field_line(field, 31, periods=1, R0=1.0) # For now, assume R along the axis is nearly constant: Raxis = np.mean(pfl_axis.R) def objective(R): return num_poloidal_turns(R, fie...
ff7c45a818c5cd886b19
def _get_l1_csnp_rx(self): return self.__l1_csnp_rx
ff7c59752be30e6b7b7a
def test_full_name(self): self.assertEqual(self.john.full_name, "John Doe") self.assertEqual(self.solar.full_name, "Nathan Graule")
ff7c65a4be421aff6481
def ordenar_usuarios_por_variancia(self): list_usuarios = [] usuarios: Dict = self.usuarios for user_id in usuarios: usuario: Usuario = usuarios[user_id] estatistica_user = usuario.dados_estatisticos() list_usuarios.append((estatistica_user["var"], user_id)) ...
ff7c82bd564e9a722659
def experimentalMTF(inp,out,win=1,dx=1.): fi,psdi = fourier.realPSD(inp-mean(inp),win=win,dx=dx) fo,psdo = fourier.realPSD(out-mean(out),win=win,dx=dx) #Need to cut out frequencies above Nyquist where ripple is introduced pdb.set_trace() return fo[0],1-psdo[:,0]/psdi[:,0]
ff7caa48291d1cb80652
def key_setup(vault, **kwargs): vault_path = proper_path(vault) if not os.path.exists(vault_path): os.makedirs(vault_path) kb = KeyBundle() for usage in ["sig", "enc"]: if usage in kwargs: if kwargs[usage] is None: continue _args = kwargs[usage]...
ff7cb4437057378067de
def ListIndexes(self, request, context): context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
ff7cd9a81eddc90616a6
def hit(self, timestamp): while len(self.q) != 0 and timestamp - self.q[0] >= 300: self.q.popleft() self.count -= 1 self.q.append(timestamp) self.count += 1
ff7ce4273be406feec26
def get(request, board_id, task_id): try: task = Task.objects.get(id=task_id) return APIResponse(status=200, data={'task': task.to_json()}) except ObjectDoesNotExist: return APIResponse(status=404, user_msg='Task not found')
ff7d088e6b36af56433d
def _break_lock(self):
ff7d27618742a9ad1a18
def test_l4_mss(): _test_core_optical("LM04*")
ff7d3154fe44bb909d6b
def features_correlation_matrix_by_class(self, features=None, mask=None, tick_labels=None, vmin=-1, vmax=1, labels_dict=None, grid_columns=2): features = self.common_features if features is None else features _, df, class_labels = self._apply_mask(mask, self....
ff7d32d93a0cbbdca17b
def mts_column_post_process( datafile, t, L0, W0, area, ls, us, delt, ifor_str, unit, path, delimt, itime, iext, ifor, iwid, switch, coef, ): import matplotlib.pyplot as plt import os plt.ioff() print 'filename = ', datafile #print path+'\\'+files[i] f = open(path...
ff7d4169342ed56761f8
def _suits_query(self, query): if len(query) == len(self._name): for query_el, name_el in zip(query, self._name): if query_el is not None and query_el != name_el: # Mismatch found return False else: # Everything Ok ...
ff7d521673a434b4f449
def remove_item(self): return self.set_.pop()
ff7d64149b21aa11ba18
def obtain_sizes(self): self.length_all_episodes = len(self.all_moves) self.episode = 0 self.step = 0 # Add positions to the map self.topology = [] self.topology = np.load(TOPOLOGY_LOG) self.top_dims = self.topology.shape
ff7d8ba99c9a32ed2bb1
def cancel(self): self._client.delete(self._this_job_path())
ff7d9dfe9345467be895
def should_flush(self) -> bool: return ( len(self._to_put) + len(self._to_delete) + len(self._unprocessed) >= MAX_WRITE_BATCH )
ff7db87ded6b8460c4a5
async def clean(self, ctx): channel = ctx.message.channel author = ctx.message.author server = ctx.message.server message = ctx.message prefix = settings.Get().prefix(ctx.message.server) search_range = 1000 delete_invokes = True delete_all = chan...
ff7dc5038b4a2e5cb015
def draw_star(t): for i in range(5): t.left(144) t.forward(100)
ff7dce136f524412da9b
def load_flac(input_file_path): wav_data, sr = sf.read(str(input_file_path), dtype="int16") # print("wac_dat",wav_data.shape) return wav_data, sr
ff7dce4f2a51c6723e71
def set_start(self): self._start = True
ff7ddc4f0818bc2284f1
def H(w, feature_matrix, truth, c_pos=1, c_neg=3): # The the c cost vector c = np.matmul(-w, feature_matrix) # Size is len(en) * len(fr) c = c + (c_neg + c_pos) * truth - c_pos # Get the constraints' RHS b_ub = np.ones(6, dtype=np.float32) # Matrix of eqiality constraints. Will fill with one...
ff7e04e94e43560efb92
def watcher(): try: client = MongoClient(host,port) db=client["local"] tail_opts = { 'tailable': True, 'await_data': True } # get the latest timestamp in the database last_ts = db.oplog.rs.find().sort('$natural', -1)[0]['ts'] print last_ts while True: query = { 'ts': { '$gt': last_ts } } #To ge...
ff7eb6cdef688f0c8049
def set_filled(self, flag): self._fill_flag = flag self._update_color()
ff7ed2fb46c8bf8d0d37
async def list_available_genomes(): _LOGGER.info("serving genomes list") return list(rgc.genomes[IK]["aliases_raw"].keys())
ff7f1cf12b16f234aa6b
def set_pixel(self, i: int, j: int, pixel_value): if not self.range_check(i, j): return self._pixel_array[i][j] = pixel_value
ff7f2cdc96ab4111bf31
def construyendo_resp(n,resp_u,contador,Resp,respuesta_correcta,num_letras_texto,frameant): if lista_texto[n] in resp_u.split(): messagebox.showerror('Organiza la oracion','Ya oprimiste ese boton') #widget mensaje de error elif contador==1: re...
ff7f2e19e752e5b87a4f
def text_to_id(text): text = strip_accents(text.lower()) # text = re.sub('[ ]+', '_', text) # text.replace(' ', '') text = re.sub('[^0-9a-zA-Z_-]', '', text) text = text.split('-')[0] return text
ff7f47a2948a4578808f
def p_yellow(text): print(colorama.Fore.YELLOW + text + colorama.Fore.WHITE, end='')
ff7f510c776b6b922ac4
def get_shape(self): return self._chol.get_shape()
ff7f60f42d5998dee01a
def _get_value_in_yaml_path(self, d, yaml_path): keys = yaml_path.split(".") value = d for key in keys: value = value[key] return value
ff7fddb7cbe302a67dc7
def _CheckFields(self, fields): for f in fields: if f not in self: raise ConfigError('Entry %s: missing required field: %s' % (self['name'], f))
ff7fea0cf8aa52211e8c
def fetchFileIdsWithPath(self, path, recursive=False): path = os.path.abspath(path) if recursive: path = "%s%%" % path self.sql.execute('SELECT id, name FROM _file WHERE dir LIKE ?', [path]) return self.sql.fetchall()
ff800b7910d7d15138fd
def openAboutApp(self): self.about_Window = QtWidgets.QDialog() self.about_ui = Ui_aboutDialog() self.about_ui.setupUi(self.about_Window) self.about_Window.show()
ff801f025e3127c92468
def random_proposer_selection(self): # probs = [1/self.m for _ in range(self.m)] return choices(self.nodes,k=1)[0] # equiprobable is the default
ff802ed9681c30414d5f
def simplify(self, tolerance=0.0, srid=None, format=None, precision=8): # Transform first, then simplify. transform = self._transform(srid) print transform simplify = self._simplify(transform, tolerance) return self.extra(select={self._geo_field().name: simplify})
ff803697144b81e4e25d
def get_concentration(self, e_fermi, temperature): if self.fixed_concentration: return self.fixed_concentration else: return sum( self.charge_state_concentrations( e_fermi, temperature ).values() )
ff8048f51d1405469d49
def is_train_in_database(train_number: int) -> bool: database = db_connection() cursor = database.cursor(dictionary=True) cursor.execute(f"SELECT * FROM backend_trains WHERE trainID = {train_number}") records = cursor.fetchall() return len(records) > 0
ff8059c357ed26f8ad48
def small_ml(): data_file = os.path.join(os.path.dirname(__file__), "./u1_ml100k_test") data = Dataset.load_from_file(data_file, Reader("ml-100k")) return data
ff8090e029f612830132
def tail(self): raise NotImplementedError
ff80a0c81a867292bad6
def support_languages(languages): for language in languages.split(","): language = language.strip() if language and LOCALE.startswith(language): return True return False
ff80a3c686082338b000
def find_row(table, var): for row in range(len(table) - 1, -1, -1): # count down from rows in table to 0 try: if var > table[row][0]: return row except TypeError: if var > table[row]: return row
ff80b09658fc834e7118
def decode_url(raw_bin_data: bitstring.BitArray, domain_links: dict, bytes_counter: int): url = [] length_octet = raw_bin_data.bin[0:8] if length_octet[0:2] == '11': url.append(domain_links[int(raw_bin_data.bin[2:16], base=2)]) raw_bin_data, bytes_counter = bin_cutter(raw_bin_data, bytes_cou...
ff80c2b4ca5b843128ec
def activate(self): if not self.id: raise RuntimeError('User must be defined to set activation.') self.active = True self.save()
ff80c7e49838e97273af
def first(self): if self.is_empty(): raise Empty('queue is empty') return self._data[self._front]
ff80dfb45baf090207da
def performOpen(self, options={}): CoInitialize() self.VNA=CreateObject('AgilentNA.AgilentNA') self.log("VNA object created") self.VNA.Initialize( "TCPIP::129.16.115.134::5025::SOCKET", False, False, "") self.log("VNA Initialized") self.ch1=self.VNA.Chan...
ff80f2450e464ff6de1a
def __init__(self, embedding_size, hidden_size, vocab_size, num_layers=1, embedding_matrix=None, train_embedding=True): super(Decoder, self).__init__() self.embed = embedding_layer(num_embeddings=vocab_size, embedding_dim=embedding_size, # nn.Embedding(vocab_size, embe...
ff810acaea1a0f7a58ea
def get_remote_repository(self, repository_id): raise NotImplementedError
ff81239ea28badf0fe5a
def diff_files(left, right, output, pattern): result = 0 file_names = sorted(glob.glob(os.path.join(left, pattern))) print "* Comparing %s '%s' files." % (len(file_names), pattern) b_name = os.path.basename for file_name in file_names: right_name = os.path.join(right, b_name(file_name)) ...
ff8135740745c364ca29
def down(self): self.current -= 1 if self.current < self.bottom: self.current = self.bottom return self.current
ff8171726f17472015ad
def convert_age_to_label(age): if 0 <= age <= 18: label = 0 elif 19 <= age <= 29: label = 1 elif 30 <= age <= 39: label = 2 elif 40 <= age <= 49: label = 3 elif 50 <= age <= 59: label = 4 else: label = 5 return label
ff8178c08dbace39fb50
def set_sort(self, request): # Look for 'sort' in get request. If not available use default. sort_request = request.GET.get(self.sort_parameter, self.default_sort) if sort_request.startswith('-'): sort_order = '-' sort_field = sort_request.split('-')[1] else: ...
ff818c2f9b406efbcb38
def _process_parallel(tasks, data, reduce_method=combine_result_with_and): return reduce(reduce_method, [task(data) for task in tasks])
ff8194bd7f8aea235e31
def log(self, msg: str) -> None: if not self.log_file: return with open(self.log_file, 'a') as fd: time_str = '[' + datetime.datetime.now().isoformat() + '] ' fd.write(time_str + msg + '\n')
ff8195722547e735cf2a
def set_log_file(self,logfile): if not self.logfile == sys.stdout: self.logfile.close() self.logfile=open(logfile,"a")
ff81c3d3873f7249a169
def write_json(open_file, rset, lines=False): if lines: for entry in rset: open_file.write(json.dumps(entry)+'\n') else: open_file.write(json.dumps(rset))
ff81c9f15e38501e99ef
def contact_infectivity(): return 0.3
ff81d00478fde63e8c90
def test_validate(self): f = SetOf() f.validate(set([u'foo', u'bar'])) self.assertRaises(ValidationError, f.validate, u'this is not a set') self.assertRaises(ValidationError, f.validate, set(['a', 2])) self.assertRaises(ValidationError, f.validate, [u'a', u'b'])
ff820d59839610f43c74
def find_offset(pattern, template): ''' new resizing for odd sides ''' pattern, template = resize_even(pattern, template) real_corr = crr_2d(pattern, template) best_match, match_value = find_best_match(real_corr) firstVal = best_match[0] - 2 * pattern.shape[0] - extra_row ...
ff8223afd5e7a119a3d1
def merge(xs, ys): result = [] xi = 0 yi = 0 while True: if xi >= len(xs): # If xs list is finished, result.extend(ys[yi:]) # Add remaining items from ys return result # And we’re done. if yi >= len(ys): # Same again, but swap roles ...
ff8242ad79c5cb66d4a9
def to_timestamp(dt): if not dt: return (dt - datetime(1970, 1, 1)).total_seconds()
ff8248934be63d9f0a23
def calendars(self): return c.Calendars(self)
ff824ca91519be6d481d
def open(self, filename): name = self.__class__.__name__ raise NotImplementedError("{:s} does not support open()." "".format(name))
ff8261bddc3bc993f65c
def objString(obj): try: if type(obj) in [int, float]: return str(obj) elif isinstance(obj, dict): if len(obj) > 5: return "<dict {%s,...}>" % (",".join(list(obj.keys())[:5])) else: return "<dict {%s}>" % (",".join(list(obj.keys()))...
ff827bb4033a894e4dd8
def search_vendor_by_display_name(self, display_name=None): response = self._get_request('QueryResponse', Vendors.SEARCH_VENDOR.format(display_name)) return response['Vendor'][0] if 'Vendor' in response else None
ff8286729b454d20e1b3
def __curse_dict_map(self, fct): if type(fct) == str: return dict(map(lambda kv: (kv[0], __access_member_by_string(kv[1], fct)), self.items())) return dict(map(lambda kv: (kv[0], fct(kv[1])), self.items()))