query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d5df3ae10b17560d6f2fba6bab97419a
Choose the delta at the scale of distance between x and perturbed sample.
[ { "docid": "458593a223db83509fd2a4c9d4eb9482", "score": "0.61818564", "text": "def select_delta(self, dist_post_update, current_iteration):\n if current_iteration == 1:\n delta = 0.1 * (self.clip_max - self.clip_min)\n else:\n if self.constraint == \"l2\":\n ...
[ { "docid": "7fb56989b9f587e618d9c1ce21973c98", "score": "0.6158791", "text": "def perturb_point(self, x, scale):\n x_samp = x + (scale / 2.0) * (np.random.rand(3) - 0.5)\n return x_samp", "title": "" }, { "docid": "e7a68a31fe1bfbc3f97887a930b25278", "score": "0.6102524", ...
1c3cdbd9b6a32aa61ca09359cc66165b
Some results need some preprocessing before they can be used.
[ { "docid": "d5d33ebde96df81148406132c446550d", "score": "0.6002665", "text": "def setup(self):\n for res in self.results[:]:\n func = RESULT_SETUP.get(res.name)\n if func:\n res.value = func(res)\n if res.value is None:\n self...
[ { "docid": "7f80630101505f4b428c8d4bb687a62b", "score": "0.68797165", "text": "def preprocess(self):\n pass", "title": "" }, { "docid": "a7f5a8829dc555ee134e7bff4e71e115", "score": "0.6822881", "text": "def _process_result(self, result):\n\n pass", "title": "" }, ...
49f336462b5055e273ad672b95544749
r""" Check if ``self`` is birational.
[ { "docid": "26a800a9382ab683657611ae45b54a80", "score": "0.77205276", "text": "def is_birational(self):\n return self.index() == 1", "title": "" } ]
[ { "docid": "18081e8667c907c029aa819ff7f199c0", "score": "0.66714483", "text": "def __bool__(self) -> bool:\n return True", "title": "" }, { "docid": "d6f207277c224feb4505079136b57bfe", "score": "0.65972024", "text": "def __bool__( self ):\n return self() is not ...
5cc43d055b6de25afc31ee411976d73e
Quit the connection with modhost
[ { "docid": "bdf293592383fd274bca72f84b33540a", "score": "0.0", "text": "def close(self):\n if self.connection is not None:\n self.connection.close()\n if self.connection_fd is not None:\n self.connection_fd.close()", "title": "" } ]
[ { "docid": "3c413bdb3620bac5ec68f4c369ca649c", "score": "0.6583904", "text": "def disconnect(self, command=\"exit\"):\n pass", "title": "" }, { "docid": "7ef06ac027d79aa2e8db10f03595f93a", "score": "0.65540636", "text": "def Quit(self):\n self._ExecuteSessionCommand('quit')...
33ef83e318a1606725f95be3861e4e68
Convenience function to slice an ordered dictionary. Returns the sliced dictionary
[ { "docid": "acea3a96386ea6b89c534ece963690bc", "score": "0.77445686", "text": "def slice_dict(d, start, end):\r\n items = [(k, v) for k, v in d.items()]\r\n\r\n return {x[0]:x[1] for x in items[start:end]}", "title": "" } ]
[ { "docid": "0dd3a6d317266ec832a000b175f80715", "score": "0.7321811", "text": "def slice_dictionary(dic_in, idx):\n dic_out = {key: dic_in[key][idx] for key in dic_in.keys()}\n return dic_out", "title": "" }, { "docid": "8a017659d2a78dc6cc3d78892dc7807e", "score": "0.631764", "t...
98815c40ed75f5788ef5316e9b508d92
prints if the user has access to the reservation an on which host.
[ { "docid": "7b5fb180e3e231f9baf1520496ee8e39", "score": "0.0", "text": "def info(cls, user=None, project=None):\n TODO.implement()", "title": "" } ]
[ { "docid": "14f47bcccacab6f9b4ed4d39fcb30994", "score": "0.598083", "text": "def can_edit_guest(self, guest):\n return guest.host == self", "title": "" }, { "docid": "1e4e46c8c79908df84b9d8f72ef92df6", "score": "0.595052", "text": "def user_requested_network_access(request):\n...
9a6a55874b27dcd3e92917f87e6d011a
Create a formatted textbox for highlighting important information
[ { "docid": "d14e6c3a934a1206d7c27a2a47ba9524", "score": "0.0", "text": "def box(text, decor='*', decor_x=None, decor_y=None,\n boxwidth=60, borderwidth=2):\n decor_x = decor_x if decor_x else decor\n decor_y = decor_y if decor_y else decor\n decor_x_width = len(decor_x) if len(decor_x) >...
[ { "docid": "67aeeb0ceca68c4f4033d3cab0b8cb18", "score": "0.6648455", "text": "def AddStyledText(self, data):", "title": "" }, { "docid": "941b5dcae220b5ea24d98f35d6f7cad6", "score": "0.6572662", "text": "def BCTextEditCreate(p, text):", "title": "" }, { "docid": "a17300d6...
e239182a5438ffb5c7c512cbce3cf66b
Given an input text, return a version of the text with the URLs replaced with their transformed versions.
[ { "docid": "321bf7f182af287f135c1cc44d12e7ff", "score": "0.7913676", "text": "def transform_in_place(self,text,rush=False):\n urls = extract_urls(text)\n subs = self.transform_all(urls,rush)\n for url, sub in zip(urls,subs):\n if sub:\n text = text.replace(url,sub)\n return text"...
[ { "docid": "75243174d6a69748aa14cecc6b0ce0bc", "score": "0.6854942", "text": "def _replace_urls(text: Any, value: str) -> Any:\n return re.sub(REGEX_URL, value, str(text)) if pd.notna(text) else text", "title": "" }, { "docid": "4d89847bd1ae8b69e2cb98ccf977c9ad", "score": "0.6769859",...
ec50b726b10914cec686e5a61ad05924
Completes an incomplete chunk of characters. Returns the completion
[ { "docid": "d1fd22c6dbfbdf508c5616b31964e6c4", "score": "0.0", "text": "def autocomplete(seq: str) -> str:\n table = seq.maketrans('([{<', ')]}>', ')]}>')\n return seq.translate(table)[::-1]", "title": "" } ]
[ { "docid": "286f7aa54721da2ec5630d1ace609363", "score": "0.58200043", "text": "def _complete(self):\n try:\n # Send the completion request to the kernel\n msg_id = self.kernel_client.complete(\n code=self.input_buffer,\n cursor_pos=self._get_input_buffer_cursor_pos...
8feca7641f3127443416d9398feafb1b
Return universal dictionary and original data
[ { "docid": "734230153a2781fa3a049ad34b3ac150", "score": "0.67511684", "text": "def to_universal(self):\n # create dictionary\n dic = dict(self._udic)\n\n # add processing flags for output\n self._oproc = {}\n self._odtype = self._data.dtype\n\n return dic,self._...
[ { "docid": "0526f4b215baf714c1dd2a6c4e772037", "score": "0.6934387", "text": "def transform(self, data) -> Dict:\n return data", "title": "" }, { "docid": "ff55d2e0f6080551b634429f1f0cda4f", "score": "0.67512566", "text": "def as_dict_nopwd(self):", "title": "" }, { ...
a6bcd6e13f8578acb2600db3bb634d3e
Save all ad in file ad.json
[ { "docid": "878d607e2feb47db2b21c421a0f5964a", "score": "0.84016776", "text": "def saveAd(self):\n with open('ad.json', 'w') as outfile:\n json.dump(self.__dicAd, outfile)", "title": "" } ]
[ { "docid": "e8bbcd53d1bb311e2f01ca30448cf013", "score": "0.6336655", "text": "def save_agent_apis(self):\n with open(f'{self.dir}/agent_apis.json', 'w') as f:\n json.dump(self.stored_agent_apis, f, sort_keys=True, indent=4)", "title": "" }, { "docid": "86d47fae35ce2fb31a73f...
a5fa5f8baca442d4682d0ea6df6b89e6
encode bytes array b into the right format for further sharing
[ { "docid": "caca5db522204a81192d13def2b955a5", "score": "0.7202181", "text": "def encode(self,b):\n raise NotImplementedError('subclasses must override encode()!')", "title": "" } ]
[ { "docid": "68ecba6a29f34eb553afc83993fd2baf", "score": "0.6813171", "text": "def encode(self,b):\n \n F = self.F\n \n k = len(b)\n messageslist = []\n \n plp = len(bin(self.p))-2\n blockSize = int(plp/8)-1\n #print('block size :'+ str(block...
df661938aa580a2d4f2756aed70a8022
Handler method for the event that the associated monitored peer sent MSG_SUPPORT_REQUIRED. The method updates the internal state as appropriate (timeout handling, sliding window update, support requests made update).
[ { "docid": "07d0d1797e492a5cb64041466152f7bf", "score": "0.75821877", "text": "def received_support_required_message(self):\n self.increment_support_requests()\n self.stop_timeout_timer()\n\n self._ts_list.append(time.time())\n\n if len(self._ts_list) > PEER_REQUIRED_MSGS:\n ...
[ { "docid": "f11861f275ade21e112d5462754de1f2", "score": "0.7257408", "text": "def received_support_not_needed_message(self):\n self.reset_support_cycle()\n self.start_timeout_timer()", "title": "" }, { "docid": "cd11c883646f344e2490d9c4b03721a6", "score": "0.5879369", "...
03e6ed0471da15b6aa214477d6b113d0
The L{UserInfoSignup} page is displayed over HTTP if there is no SSL server available.
[ { "docid": "667aa5b3480e0727b4f59b7cceb561ab", "score": "0.71448237", "text": "def test_userInfoSignupOverHTTP(self):\n self._createSignup(u'foobar-signup')\n\n # It is not necessarily the case that we want /signup to require a\n # session. However, that is how it is currently impl...
[ { "docid": "a39e9ffaa99fe3aa62207c20a913c355", "score": "0.7410411", "text": "def test_userInfoSignupOverHTTPS(self):\n # Create the necessary SSL server\n SSLPort(store=self.store, factory=self.site, portNumber=443)\n\n self._createSignup(u'barbaz-signup')\n\n page = getWith...
53210d2e717a566450e9be766d34b8d2
Download the cross year individual file
[ { "docid": "a3d5486d3c4783b1a0bdcf1f29a96588", "score": "0.6808135", "text": "def download_ind_cross_year(session, to_csv=True, **kwargs):\n download_unzip_csv_psid(\"IND2011ER.zip\", str(1053), session,\n to_csv=to_csv, **kwargs)\n\n return", "title": "" } ]
[ { "docid": "bf67edd37bd44c407125d8ede2ab5619", "score": "0.730029", "text": "def download_mortality():\n for year in range(firstyear, lastyear + 1):\n p = mort_url.replace(\"YYYY\", str(year))\n dst = os.path.join(mort_raw_dir, \"mort%4dus.zip\" % year)\n with closing(request.url...
989e1c20c5cc0e51eed638c2b7ecddc5
A user can update the school year.
[ { "docid": "7ead13bd8587afc521e509587a61f12e", "score": "0.56566006", "text": "def test_post(self):\n user = self.make_user()\n school_year = SchoolYearFactory(school=user.school)\n new_start_date = school_year.start_date - datetime.timedelta(days=1)\n data = {\n \...
[ { "docid": "bcbaf2111dbf8cd6fdd86adba0133b48", "score": "0.70102715", "text": "def changeGraduationYear(username, year):\n matches = UserProfile.objects.filter(username=username)\n numMatches = matches.count()\n if numMatches == 0:\n return ERR_NO_RECORD_FOUND\n ac...
1c5b4cf8165d6977bd76c3fac85aebd4
Add a label tag(s).
[ { "docid": "6d62accade5344858fdc5073e00233a2", "score": "0.77899337", "text": "def addLabel(self, labels, locked=True):\n return self.editTags('label', labels, locked=locked)", "title": "" } ]
[ { "docid": "4c339f4a9de97d9d23f03ca529bae28b", "score": "0.77279514", "text": "def add_label(self, label):\n self.labels.append(label)", "title": "" }, { "docid": "1ca83547eeb23283a20521fd8bd17cab", "score": "0.7681334", "text": "def addLabel(self, label):\n\t\tself.labellist....
022771019974ea70549b76c1566b9a9a
Initialize this instance from a given Namespace object.
[ { "docid": "6a1cd8645d0b7245f97b91450411b0e3", "score": "0.7992852", "text": "def __construct_from_namespace(self, ns):\n assert isinstance(ns, Namespace) # TODO (bworrell): Change this to an if not isinstance(...): raise TypeError?\n self.__construct_from_components(*ns)", "title": "...
[ { "docid": "7d91ed6cf7242740512b59a28ca26bcb", "score": "0.7637102", "text": "def __init__(self, namespace = None ):\n\t\tif not namespace:\n\t\t\tself._namespace = mc.namespaceInfo( cur = True )\n\t\telse:\n\t\t\tself._namespace = namespace\n\t\tif not self._namespace.startswith( ':' ):\n\t\t\tself._na...
7ab51d1efea99ac2f572fb6dda304880
Set the detail level at which data is collected.
[ { "docid": "daebfe04bae2b167f29756b308b7f339", "score": "0.44741932", "text": "def set_level(self, level: str) -> None:\n with self._mutex:\n self._enabled = level == 'all'", "title": "" } ]
[ { "docid": "97c5704d9aa3e60f0084aa9075291ee4", "score": "0.7236289", "text": "def detail(self, detail) :\n\t\ttry :\n\t\t\tself._detail = detail\n\t\texcept Exception as e:\n\t\t\traise e", "title": "" }, { "docid": "7946a8993e4be52b095d5b957d48d333", "score": "0.71081233", "text": "...
e5de335a287de242d66c92520de531af
Main tasks to update the server from the given commit id, will use the HEAD of the current branch by default
[ { "docid": "a0b0f6a5734510bdc86823774bd5a8d9", "score": "0.53373516", "text": "def deploy(id='HEAD'):\n release_dir = deploy_code(id)\n install_requirements(release_dir)\n backup_database()\n migrate_database(release_dir)\n collectstatic(release_dir)\n switch_release(release_dir)\n ...
[ { "docid": "6c85cb83ca35a0d00eb78429d1121c69", "score": "0.6648317", "text": "def commit(branch_id, commit_id):\n branch_id = branch_id\n commit_id = commit_id\n url = \"http://127.0.0.1:5000/api/branches/{}\".format(branch_id)\n r = requests.get(url=url)\n # extracting data in json forma...
69af8d5395581365176294c238933877
Return True if model dispersion range fully overlaps the band.
[ { "docid": "3bd469d5ce2debc49a556b3647ef4043", "score": "0.0", "text": "def bandoverlap(self, band, z=None):\n band = np.asarray(band)\n if z is None:\n z = self._parameters[0]\n z = np.asarray(z)\n ndim = (band.ndim, z.ndim)\n band = band.ravel()\n z...
[ { "docid": "8b8e4569cc7ecc5f03ce855b156d8181", "score": "0.6914792", "text": "def can_overlap(self):\n return False", "title": "" }, { "docid": "023d56c56889f8a4e66a36bf7ae58adf", "score": "0.6638366", "text": "def can_overlap(self):\n return self.is_open", "title":...
13482b30b62b74306ccc4965a21aa610
Get item from the map. Create the entry for missing key. >>> m = ... >>> lambdas = m[ cellID ]
[ { "docid": "2a4ca7265e0834068df343828a5f20e3", "score": "0.61268276", "text": "def __getitem__ ( self , cellID ) : \n _ls = self._lambdas.get( cellID , None )\n if not _ls :\n self._lambdas [ cellID ] = [ 1.0 ] \n _ls = self._lambdas[ cellID ]\n return _...
[ { "docid": "1928a33707e36a50d2d2457f67adbcec", "score": "0.60336035", "text": "def get(aMap, key, default=None):\n i,k,v = get_slot(aMap, key, default=default)\n return v", "title": "" }, { "docid": "e0879d84e75ba25902f58a0b3e6b93c1", "score": "0.6008953", "text": "def __getite...
161229f54e231e81f4e19d4d4c9e4d04
Return a dict containing SOF header data. See ISO/IEC 109181 Section B.2.2. After returning, `fp` will be positioned at the end of the current marker segment.
[ { "docid": "f8e6ec2efe70422473cbf0be18c67eae", "score": "0.67942053", "text": "def SOF(fp):\n (length,\n precision,\n nr_lines,\n samples_per_line,\n nr_components) = unpack('>HBHHB', fp.read(8))\n\n component_id = {}\n #horizontal_sampling_factor = []\n #vertical_sampling_fa...
[ { "docid": "592152d8473a90345eeeed029f4922f0", "score": "0.6137701", "text": "def read_header(fp):\n return fits.getheader(fp)", "title": "" }, { "docid": "b958b4385cf8ad732514ea76e342d1ad", "score": "0.6027179", "text": "def read_header(fo):\n assert fo.read(len(MAGIC)) ==...
d1f8c18d620d66fb75de8ec53f023722
Create an int8 byte stream of RGB values, 3 x 1024 bytes.
[ { "docid": "3e21a728ec583ffa9caf4a630e8afb4e", "score": "0.70442647", "text": "def create_int8_array(self):\n\n arr = np.asarray(self.im, dtype=np.uint8)\n\n # Pillow use column-major notation while numpy uses row-major notation\n arr = np.transpose(arr, (1, 0, 2))\n\n red = ...
[ { "docid": "f8602aafcc53b600ef4566f230a2ac6c", "score": "0.6939256", "text": "def getRGB_8bit(self):\n return int(self.r * 255), int(self.g * 255), int(self.b * 255)", "title": "" }, { "docid": "05d987c6794bf1b3f4ea1fceaa7e364a", "score": "0.6485311", "text": "def to_uint8(dat...
10185a186c87674303496843fdbf60c4
Full integration test of Experiment 2
[ { "docid": "95007202268d14decb063f502293e35d", "score": "0.0", "text": "def create_static_weight_array(self):\n\n # Initial dimensions of the layers\n input_size = 785\n hidden_size = 100\n output_size = 10\n sizes = [input_size, hidden_size, output_size]\n\n tr...
[ { "docid": "a22cd5fd05b193606c5fadbda1cd865a", "score": "0.74775195", "text": "def test_integration(self):\n pass", "title": "" }, { "docid": "508074da5e37f19f5b9ecf344df45111", "score": "0.7271228", "text": "def test_demo(storage, monkeypatch):\n monkeypatch.chdir(os.path....
6c1118bb3f696791d3ae7d84f8bd4ef3
Run this ReaderProcess. Acquire mutex, read shared data, Release mutex.
[ { "docid": "dee8a7f035312ca930aacfe8fcb52de3", "score": "0.76601106", "text": "def run(self):\n\n print \"Reader Process, PID = \", self.pid, \" starting...\"\n\n self.arbitrator.det_mutex_lock(self.pid, 0)\n\n print \"Reader Process, PID = {0} read the following: {1}\".format(self....
[ { "docid": "c67607ebc37aac081306193e3b1ca607", "score": "0.6425643", "text": "def _read(self):\n Thread(target=self._read_by_single_thread).start()", "title": "" }, { "docid": "53f53bde197a88eff97fd2e578ce0e71", "score": "0.6217942", "text": "def start_read_data(self):\n\n\t\t...
e4bb5cde93bbc584ecd64e5cc2668daa
Run the agent for a finite number of trials.
[ { "docid": "cfcbf5fad510241b995f1ba9f887e288", "score": "0.7004024", "text": "def run():\n\n # Set up environment and agent\n e = Environment() # create environment (also adds some dummy traffic)\n a = e.create_agent(LearningAgent) # create agent\n e.set_primary_agent(a, enforce_deadline=T...
[ { "docid": "82b7f73221c4d359825cc78fbb732207", "score": "0.72908324", "text": "def run():\n\n # Set up environment and agent\n e = Environment() # create environment (also adds some dummy traffic)\n a = e.create_agent(LearningAgent) # create agent\n e.set_primary_agent(a, enforce_deadline=...
8cf565bd2ac7b00d79191c8603fc40e6
model with 2 hidden layers, loss is MSE
[ { "docid": "850c00540166333c48a4105170504ece", "score": "0.66835165", "text": "def get_network_mse_2(x_all, y_all,\n num_of_neurons=(2, 25, 25, 2),\n activation='relu',\n lr=0.001,\n momentum_coef=0.0,\n weigh...
[ { "docid": "1c19f893d8a1c0f70e61dd4abd2259cc", "score": "0.6717006", "text": "def losses(self, targets, outputs, loss, model):", "title": "" }, { "docid": "419a320218f45491753b75ed575a00a5", "score": "0.6410956", "text": "def mse_loss(self, Yhat, Y):\n Yhat = F.softmax(Yhat, d...
d42c9a0c3afa2ec55c54ffa7cbd91dfa
Return a valid deductive proof of IO (i.e., '(p>p)') via MP, I1, I2
[ { "docid": "f83e78af79439de96d9449fef65c2f33", "score": "0.5907493", "text": "def prove_implies_self():\r\n # Task 4.8\r\n l1 = Proof.Line(Formula.parse('((p->((p->p)->p))->((p->(p->p))->(p->p)))'), I2, [])\r\n l2 = Proof.Line(Formula.parse('(p->((p->p)->p))'), I1, [])\r\n l3 = Proof.Line(Fo...
[ { "docid": "f5e89f895db0da3c1baa60a14e31b17d", "score": "0.64605075", "text": "def prove_I2() -> Proof:\n # Optional Task 6.7a", "title": "" }, { "docid": "126d12c5988fe6cb16967f01c2868e65", "score": "0.6049535", "text": "def prove_I0() -> Proof:\n line_0 = Proof.Line(Formula.p...
2bcf31a0934cde6f04fdda58cd376bbe
The input will have shape (N, 1, H, W), where N is the batch size, and H and W give the shape of each channel. The output should have shape (N, 10).
[ { "docid": "201edcdce37ef69b4e4587eab3f0ee1e", "score": "0.0", "text": "def forward(self, x):\r\n x = self.conv1(x)\r\n x = self.conv1_BN(x)\r\n x = F.relu(x)\r\n x = self.conv1_dp(x)\r\n x = self.Block2_1(x)\r\n x = self.Block2_2(x)\r\n x = self.Block3_1...
[ { "docid": "f22b2d2dfe6348d20048aad5e70f92ed", "score": "0.6862061", "text": "def loop_conv(X, W):\n # Go over all five dimensions \n # (#batches x #channels x #height x #width x #dur/length )\n # with filter that has\n # #filters x #channels x #height x #width x #dur/length \n num_filter...
e22928d789333e568b07048ca41f023d
Sets the instance_type of this RequestAppCreate.
[ { "docid": "be443b896b7563a9227ecf38822e6a13", "score": "0.7441373", "text": "def instance_type(self, instance_type):\n\n self._instance_type = instance_type", "title": "" } ]
[ { "docid": "c1d7ecabf934b068216bab48bc70b3a8", "score": "0.67711645", "text": "def application_type(self, application_type):\n\n self._application_type = application_type", "title": "" }, { "docid": "c1d7ecabf934b068216bab48bc70b3a8", "score": "0.67711645", "text": "def applic...
91a0f5fbbd6e93feee42ee355baeecc5
Returns a grid object restricted to a subdomain. Use slicing with caution, this functionnality depends on the order of the dimensions in the netcdf files.
[ { "docid": "cb737a3a98f4a74929c0046b5f08ef6f", "score": "0.50651413", "text": "def __getitem__(self,ij):\n import copy\n print(' Generate a subset of the original grid')\n returned = copy.copy(self)\n returned.ij = ij\n # update\n returned.lon_rho = returned.lon...
[ { "docid": "fd742a331147e50014ba63b94fcde522", "score": "0.60625345", "text": "def lattice_slice(self,slice_coords):\n if self.sitesize!=1: raise NotImplementedError\n d = self.lattice.shape[len(slice_coords):]\n coords = [e for e in slice_coords]+[0 for i in d]\n t = self.la...
b850b35a94ab7625c103a13ca1083113
Will fetch names of columns when initially called.
[ { "docid": "b24a4486f76a9077ddf02af4ec68c6ec", "score": "0.0", "text": "def __init__(self, **kwargs):\n self.__table__ = Sql.Table(self.__name__)\n self.__column_info__ = self.__table__.columns\n self.__relationships__ = self.__table__.relationships\n self.__lower_relationshi...
[ { "docid": "9740837a910639796695ec862dae083b", "score": "0.844828", "text": "def column_names(self):", "title": "" }, { "docid": "d519065947e1835dbe926adcaf411f7d", "score": "0.81059986", "text": "def get_column_names(self):\n return _get_column_names(self, \"\")", "title"...
05b6c95710705a715c88e5bae70adfb6
Returns a list with the numbers of the source groups computed
[ { "docid": "a7ee1707028d79d129176a99d4f232af", "score": "0.66329837", "text": "def computed_groups():\n return [int(filename[7:9]) for filename in glob.glob('00001-1*.txt')]", "title": "" } ]
[ { "docid": "ff18350d91bc3e36aea7d6083a76f97f", "score": "0.6573295", "text": "def groups():", "title": "" }, { "docid": "a3bd4300678b00e7aced4c38eff9ef7e", "score": "0.6356105", "text": "def source_group_cidrs(self) -> pulumi.Output[Sequence[str]]:\n return pulumi.get(self, \"...
b01570b8130a226c28fe25be841c9f28
from_unix refuses to accept nonnumeric input
[ { "docid": "b8bbd62ba26b12c51bb96c2d61d5febe", "score": "0.7485918", "text": "def test_convert_non_numeric_from_unix(self):\n with self.assertRaises(TypeError):\n times.from_unix('lol')", "title": "" } ]
[ { "docid": "fd9e3ea0fe6c5ea3fa2a8af6380003d6", "score": "0.7162269", "text": "def test_convert_non_numeric_to_unix(self):\n with self.assertRaises(TypeError):\n times.to_unix('lol')", "title": "" }, { "docid": "9e9a6038e38b928e313331baeff6f008", "score": "0.60347754", ...
69cb9ab9a9d8a584e84b8597035aa089
Move obstacles and refresh background for past obstacle positions.
[ { "docid": "0a8bb540e57e8604f252744d0b8e9975", "score": "0.74818057", "text": "def move_obstacles(game: Game):\n #Clear current obstacle locations to refresh background\n for obstacle in game.obstacles:\n game.screen.blit(\n GameSettings.background.image,\n (obstacle.r...
[ { "docid": "cb58acbfaedffa11fa15f288b2300928", "score": "0.66321206", "text": "def move_obstacle(self):\n obstacle_id = np.random.choice(self.obstacles)\n pose1 = self.c.simGetObjectPose(obstacle_id)\n pose2 = copy.deepcopy(pose1)\n dx, dy = np.random.uniform(-20, 20), np.ran...
0b8c51aaec1f65d4fe9674f322c525ab
retrieve batches of items
[ { "docid": "e4c8370c6f09c899950925c81585b5a0", "score": "0.0", "text": "def __getitem__(self, idx):\n\n data_batch = self.data[self.batch_size * idx:self.batch_size * (idx + 1)]\n labels_batch = self.labels[self.batch_size * idx:self.batch_size * (idx + 1)]\n # Encode data:\n ...
[ { "docid": "1a32aeaf107b7cd02d085477b98b1d92", "score": "0.75982505", "text": "def get_batch():", "title": "" }, { "docid": "5ad28b4499fe24ea314ae1fc61e8dcf2", "score": "0.6946158", "text": "def _batch_db(self, lis, batch_size):\n\t\n return ([lis[x:x+batch_size] for x in rang...
89ec236f45a30cbc22bac48d30a0568a
these are namespace commands
[ { "docid": "edbacfbb946f893c2710da6a6f290e66", "score": "0.5845463", "text": "def namespace(config):\n pass", "title": "" } ]
[ { "docid": "7dc3eb30a5cf51471649dca796c691eb", "score": "0.71752167", "text": "def namespace(self):", "title": "" }, { "docid": "df4645962c624ebd043f2cd698f059de", "score": "0.68727106", "text": "def commands():\n pass", "title": "" }, { "docid": "df4645962c624ebd043f2...
c1dc28be9c584ec373dfc8e4bdfa7ee1
All things user interface happen here. Communicates directly with master controller
[ { "docid": "b9747003ac4b6a579510ac0d89d6c435", "score": "0.0", "text": "def ui_process(ui_rx, ui_tx, visualization_data):\n global ui_state\n global ui_error\n\n get_enums()\n get_game_settings()\n get_hsv_settings()\n\n ui_state = ui_state_enum.idle\n ui_error = ui_error_enum.none\...
[ { "docid": "65beccc6ef0916123e46e24855b2fb76", "score": "0.6509467", "text": "def run(self):\n self.controller.welcome()\n self.controller.db_management_menu_process()\n self.controller.find_or_display_substitute_process()", "title": "" }, { "docid": "d5f56b4866f6cc5192c...
be43b1e18f026c72326e1d36f2b164d8
Gives us battery voltage level (mV), current draw (mA), charge current (mA, current flowing in through the USB connection), and temperature (C).
[ { "docid": "c40e39fa0e0d19aa40295624dff86d4a", "score": "0.0", "text": "def get_power_values(self):\n x=self.send_packet_check_response('\\x60')\n return struct.unpack('<iiih',x)", "title": "" } ]
[ { "docid": "1ce1a6af04628952af5e80ba4530a13d", "score": "0.7306391", "text": "def read_core_vbat(self) -> float:", "title": "" }, { "docid": "ea1ebe525fa11485662eb87a8e918399", "score": "0.7162272", "text": "def get_vbat(self):\n return self.read_register(4096, 1, 3)", "ti...
49bf7f2c57241504ce7a34e11b56501c
Execute cpplint with the specified arguments.
[ { "docid": "6e1f7befdc015b8cec783ea3e9ba573c", "score": "0.66612774", "text": "def check_style(args, white_list = None, black_list = None):\n\n # Apply patches.\n cpplint.FileInfo.RepositoryName = patch_RepositoryName\n\n # Process cpplint arguments.\n filenames = cpplint.ParseArguments(args)\n\n i...
[ { "docid": "580eb110804b1f6ee353d819e8daadae", "score": "0.74200356", "text": "def command_ci_lint(args):\n subcommands = []\n\n for a in args.args:\n if a.lower() == 'cpp':\n if 'cpp' not in subcommands:\n subcommands.append('cpp')\n elif a.lower() == 'pyth...
2c5de2be45a4b545b2b6a775bfa9c174
La fonction arg retourne les arguments lors de l'appel du script.
[ { "docid": "ce207363b0d26810d15930df5a661e6e", "score": "0.0", "text": "def arg():\n parser = optparse.OptionParser(usage='%prog [options] [-t] [-e] [-c] [-a] [-i]', version='%prog v1.0')\n\n # Main parameters\n parser.add_option('-t', '--topic', dest='topic', help='Sujet à rechercher', type=st...
[ { "docid": "3562331350a8f122721c0b8789734f2f", "score": "0.6817039", "text": "def cli(**args):", "title": "" }, { "docid": "5adbeb21e1c7b26b81d9a6eeea841637", "score": "0.66714114", "text": "def do_args(self, arg):\n sep = arg if arg else None\n self.steps.append(step.A...
6cfe1f5042397f00c5aa107c98e5abb0
Listener for data streams. Calls process_data_response() on each started plugin.
[ { "docid": "ed4ad9fd589df9f942e15eccc9a22397", "score": "0.89294094", "text": "def data_listener(self, data_stream):\n for p in self.plugins:\n p.process_data_response(data_stream)", "title": "" } ]
[ { "docid": "7098fc28cce344597b438b0057cf0793", "score": "0.64566314", "text": "def on_receive(self, streamdata):\n try:\n jsondata = json.loads(streamdata)\n if 'progress' in jsondata:\n if not jsondata['progress'] == \"\":\n progs = jsondat...
83ecb423047ce31baedcc6254892e4c3
Calls runlib.in_toto_record_start and handles exceptions
[ { "docid": "c159137dd87e22643311f6765dd55863", "score": "0.7465828", "text": "def in_toto_record_start(step_name, key, material_list):\n try:\n runlib.in_toto_record_start(step_name, key, material_list)\n except Exception as e:\n log.error(\"in start record - {}\".format(e))\n sys.exit(1)", ...
[ { "docid": "6bca15378e2d595520e61ef7b5f2b39d", "score": "0.658534", "text": "def StartRecord(self):", "title": "" }, { "docid": "8294f0f70db8182bfc05cd7ce9a6a40d", "score": "0.5948659", "text": "def in_toto_record_stop(step_name, key, product_list):\n try:\n runlib.in_toto_record...
2488bf800f522b53a75f63a28a28e121
Reads data from the request until it's all done.
[ { "docid": "69d2fd2a8d1eeedd656cdd414b65a9f9", "score": "0.0", "text": "def read(self, size: int = -1) -> bytes:\n # Thanks h2 docs page for the chunking inspiration\n # However, we're lazy and just shove it back on the front of the queue when we're done\n curr_data = b\"\"\n ...
[ { "docid": "c2189a9bff462a3f72f97daac8446393", "score": "0.7297952", "text": "def _do_read_rest(self):\n data = self._do_read(self._bufsize)\n while data != \"\":\n data = self._do_read(self._bufsize)", "title": "" }, { "docid": "fe5f5bffe0f9cfd066bd2548f74f66df", ...
c52315606862a72ece85fccbae97bf9c
/ J11 = dP/dd J12 = dP/dV J13 = dP/dT \ | (N1)x(N1) (N1)x(M) (N1)x(R) | | | | J21 = dQ/dd J22 = dQ/dV J23 = dQ/dT | | (M)x(N1) (M)x(M) (M)x(R) | | | | J31 = ddT/dd J32 = ddT/dV J33 = ddT/dT | \ (R)x(N1) (R)x(M) (R)x(R) / N = Number of buses M = Number of PQ buses R = Number temperaturedependent branches shape = (len(br...
[ { "docid": "e09283f8d8298715b166d76a7c67a824", "score": "0.60691553", "text": "def create_J33(branch, tdpf_lines, r_theta_pu, Vm, Va, dg_dT):\n\n nrow = len(branch)\n J33 = eye(nrow, format=\"csr\", dtype=np.float64)\n\n # J33 = np.zeros(shape=(nrow, nrow))\n # J33[np.arange(nrow), np.arange...
[ { "docid": "5cbd1bb70437597804ac8803490b3f3c", "score": "0.6564797", "text": "def create_J23(branch, tdpf_lines, in_pq_f, in_pq_t, pq, pq_lookup, Vm, Va, dg_dT, db_dT):\n\n ncol = len(branch)\n nrow = len(pq)\n J23 = np.zeros(shape=(nrow, ncol), dtype=np.float64)\n\n if nrow == 0:\n r...
8a8211f686722e57ee9d319f1ba314d6
Runs the gc three times to ensure that all circular reference are correctly removed.
[ { "docid": "a9e59ee7a7606eafd7b27de6bc4c7d5c", "score": "0.732601", "text": "def python_gc():\n for i in range(3):\n gc.collect()", "title": "" } ]
[ { "docid": "8843622ddf7f863989df3c739bd9f8da", "score": "0.74390703", "text": "def _cleanup(self):\n\n # Release references to allow garbage collection to run\n del self.gals\n del self.bkg\n del self.cbkg\n del self.zredbkg\n del self.zredstr\n del self....
31b13f5bd8644c38c34b9b521cc034cf
Returns a list of adjacent blocks
[ { "docid": "a21365914d45d88411471e2c2684ab96", "score": "0.70061344", "text": "def neighbours_list(self, block):\n i = block.bw\n j = block.bh\n list = []\n for a in range(i - 1, i + 2, 1):\n for b in range(j - 1, j + 2, 1):\n if ((0 <= a <= (self.bw...
[ { "docid": "e45434556913f0063dd451d90126f88d", "score": "0.66834855", "text": "def get_blocks(self) -> List[List[Box]]:\n return [[box for box in self.boxes\n if (box.row - 1) // 3 == i and (box.col - 1) // 3 == j]\n for i in range(3) for j in range(3)]", "title...
04b118a81e0b43b6df3c0f98854d8e3c
Create entity object using name, id, position, size, velocity and acceleration.
[ { "docid": "0c9577df3b13f9d0dda32b905ae08960", "score": "0.6925983", "text": "def __init__(self,name=\"Unnamed\",id=None,position=None,size=None,velocity=[0,0],acceleration=[0,0],borders=None,direction=[0,0],friction=0,dimensions=2,moving_function=lambda x:200*x,controllable=False):\n Entity.made...
[ { "docid": "316a84020eaf5a959df30ab108977d13", "score": "0.68110937", "text": "def create_entity(self, entity_type, pos=[0, 0], rot=0, vel=[0, 0], avel=0, radius=0, player_id=-1):\n\n try:\n e = self.unused_entities.pop()\n self.log('Reusing entity')\n e.initializ...
54e7f271169f9c8b02a8739bd9e878f3
Stochastic approximation to the pseudolikelihood
[ { "docid": "8621a62c5a2080ebdd14429317553ae0", "score": "0.0", "text": "def get_pseudo_likelihood_cost(self, updates):\n\n bit_i_idx = theano.shared(value=0, name='bit_i_idx')\n\n # 将输入值约等于邻近的整数值\n xi = T.round(self.input)\n\n fe_xi = self.free_energy(xi)\n\n # flip bi...
[ { "docid": "fdd9cf2abc7b060c86a0a0ecf842ac0a", "score": "0.6314672", "text": "def dh_lstsq(stim_data, target_data, spk_data,\n lambda_c=1e-1, lambda_d=1e-1, order=1, n_samples=10000,\n min_d=-1e-2, max_d=1e-2, dt=0.001, h_tar=Lowpass(0.1), \n mean_taus=[1e-1, 1e-2], std_taus=[1e-2, ...
69545acc71e151ea63828968b82a2ff2
Azure Active Directory Application the DMS instance will use to connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage Account
[ { "docid": "cd082516338d0c01bfd04b65392de0cc", "score": "0.49190915", "text": "def azure_app(self) -> 'outputs.AzureActiveDirectoryAppResponse':\n return pulumi.get(self, \"azure_app\")", "title": "" } ]
[ { "docid": "09d3e3678a0d048beda39710c3626c02", "score": "0.62265956", "text": "def test_aad_app(self):\r\n uuid = str(uuid4())\r\n key = \"key of application\"\r\n kcsbs = [\r\n KustoConnectionStringBuilder(\r\n \"localhost;Application client Id={0};applica...
f5e6e2b3fe3a69b9464cb52f4a29a047
Add package to features if it is not already there.
[ { "docid": "9cf91ffe9ba113fdd544f265ea4ef828", "score": "0.6057932", "text": "def sync_package_and_features(package_spec):\n feature_list = [f.lower() for f in package_spec['feature_classes']]\n current_gdb_ids = []\n current_shp_ids = []\n\n for feature_spec in [spec_manager.get_feature(f) ...
[ { "docid": "cc3f60030601778cd5e41eb98045d133", "score": "0.69725466", "text": "def add_package(self, package_name):\n pass", "title": "" }, { "docid": "bcf8c290134b205fd40c2d5b13599cba", "score": "0.66052705", "text": "def add_feature(self, feature, namespace=\"\"):\r\n ...
491f793dc9aba4162b799ac315df9b84
This method is used to set pump alarm volume.
[ { "docid": "c8bea01e91d151acb183f06a6c2737a8", "score": "0.6849828", "text": "def set_alarm_volume(self, alarm_volume):\n request_command = self.parser_invoker.set_alarm_volume_command_bytes(self.sequence_id, self.product_id,\n ...
[ { "docid": "b676842f8ade3dbdec43380206478707", "score": "0.8364088", "text": "def set_alarm_volume(self, volume):\n self.parent.data_layer.set_setting('audio.volume.alarm', volume)", "title": "" }, { "docid": "b75d00ae3441314a8e49c9217ccc73ff", "score": "0.69712573", "text": "...
aace9dea156cd72589eb3cbc754d7ab9
Validate if the image size is 1024 X 1024.
[ { "docid": "b70cead04894158132948e227a4d0f13", "score": "0.7655434", "text": "def clean_image(self):\n image = self.cleaned_data['image']\n self.cleaned_data['image_type'] = ImageType.MAIN_IMAGE\n width = image.image.width\n height = image.image.height\n if width == 10...
[ { "docid": "4fd74863e1e94ce01a3fdd27f704712d", "score": "0.7625393", "text": "def check_image_size(self, imgsize):\n if imgsize[0]<=maximagesize:\n return True\n else:\n return False", "title": "" }, { "docid": "f2c84153e49a42efad80db22d5a6f8fe", "scor...
83d909f07bf5e65fa138aa34151ad916
Create display text with anchor name
[ { "docid": "765f0309ee6e4a1d5cb3c2e8fa081743", "score": "0.6333951", "text": "def create_text(self):\n self.label = TextNode('anchor label {}'.format(self.name))\n self.label.set_text(self.name)\n if (bots_id[0] in self.distance and bots_id[1] in self.distance):\n self.la...
[ { "docid": "1dd0dfdf49a7332c70e22248be545009", "score": "0.6359931", "text": "def get_anchor_text(anchor):\n alttext = anchor.string\n\n if not alttext:\n # Does this anchor contain child nodes?\n children = anchor.contents\n if len(children) > 0:\n # Check to see i...
c62bfd2dc2981355566a14b18edf0cd2
Test if dict whose values are tensors can be converted to np arrays.
[ { "docid": "74278902bcbf4debb308a5dc51839140", "score": "0.6932694", "text": "def test_dict_np_to_torch():\n dic = {'a': np.zeros(1), 'b': np.ones(1)}\n dict_np_to_torch(dic)\n for tensor in dic.values():\n assert isinstance(tensor, torch.Tensor)", "title": "" } ]
[ { "docid": "f1f7b9a8aa6d3db9fbcdc2556c5924c2", "score": "0.6723942", "text": "def is_arr(arr):\n if isinstance(arr, bellini.Quantity):\n arr = arr.magnitude\n return isinstance(arr, np.ndarray) or isinstance(arr, jnp.ndarray) or isinstance(arr, torch.Tensor)", "title": "" }, { "...
c8b9893cd6f495d8c850eccf3539973d
Finds, if the given numbers all contain the same digits
[ { "docid": "2b55f9437ab19ee85816a4001c7edd43", "score": "0.7358358", "text": "def same_digits(x, x2, *args):\n x = set(str(x))\n x2 = set(str(x2))\n\n if len(x) != len(x2):\n return False\n elif len(x - x2) != 0:\n return False\n else:\n for i in range(len(args)):\n ...
[ { "docid": "2796fd036493da70fef5649fe949dd45", "score": "0.7024211", "text": "def repeating_digit(numb, n):\n snumb = str(numb)\n for i in xrange(10):\n if snumb.count(str(i)) >= n:\n return True\n return False", "title": "" }, { "docid": "8b0d8d157751667e83e573c14...
5d87e37e34209bc7dab55c736e56975f
Execute MFDn version 15.
[ { "docid": "e1ff14b29ad665e132f38dbd4c9e8e1e", "score": "0.57663363", "text": "def run_mfdn(task, postfix=\"\"):\n # enter work directory\n work_dir = \"work{:s}\".format(postfix)\n os.chdir(work_dir)\n\n # check that mfdn.input exists\n if not os.path.isfile(\"mfdn.input\"):\n rai...
[ { "docid": "76956e12a81db07079dedddad93c4437", "score": "0.53207594", "text": "def part1():\n print(f'Part 1 answer: {IntCodeProcessor(path = \"day09input.txt\").execute_program(1)}')", "title": "" }, { "docid": "472c954899f0bba5eadc7a49064ddc8d", "score": "0.531972", "text": "def...
f3f6f2666fa71ac4ccc366c440598e12
Get a dictionary representation of the object. This dict representation includes metadata such as the object's module and class name.
[ { "docid": "a79a7ae5abfda4f74816a6b2fa3e1f5c", "score": "0.0", "text": "def to_dict(self) -> dict:\n input_dict = super().to_dict()\n input_dict[\"raw_prior_cls\"] = self.raw_prior.__class__.__name__\n input_dict[\"raw_prior_module\"] = self.raw_prior.__module__\n input_dict[...
[ { "docid": "7a46103e62d5e4fd2e2f5c5a96fcb27a", "score": "0.7729782", "text": "def as_dict(self):\n obj = {\n \"@module\": self.__class__.__module__,\n \"@class\": self.__class__.__name__,\n \"pca\": self.pca.__dict__,\n \"scaler\": self.scaler.__dict__,...
d54c007776ebce75d10246961596b576
Returns a dictionary with financial reports available Returns Dict Dictionary with financial reports available
[ { "docid": "1eaaa5c7a717dd44bc8792d8e71c4118", "score": "0.60237044", "text": "def get_report(self) -> Dict:\n driver = self._instantiate_driver()\n report_data = {}\n\n for _ in range(self.MAX_RETRIES):\n print(\"Coletando dados do link:\", self.link)\n try:\n...
[ { "docid": "59af67b86e941cdbd594ef83587281ae", "score": "0.6689384", "text": "def all_reports():\n return _registry.items()", "title": "" }, { "docid": "ec5d3cc141b830220365125fed79d835", "score": "0.6491339", "text": "def getReports():\n\n pass", "title": "" }, { "...
4d2e9e150c957fc669a6cdbece75767b
Return the number of pixels equal one in the given region
[ { "docid": "8235c021c0a7edf1e3538cae114b5c63", "score": "0.0", "text": "def histogram(alert, clas, region=None):\n if not region:\n region = alert.geometry()\n\n if clas == 'both':\n conf = alert.select('confirmed\\d{2}').unmask()\n prob = alert.select('probable\\d{2}').unmask...
[ { "docid": "458ad310c8813b240a9d48ace6330206", "score": "0.7422681", "text": "def get_pixel_count(image: ee.Image, region: Any) -> Any:\n return image.reduceRegion(\n reducer=ee.Reducer.count(),\n geometry=region,\n scale=10,\n maxPixels=1e9,\n )", "title": "" }, ...
96dce90ce4f6fa867e29b30642619aa1
Distribute andsend the mesh info to all the processors. Should only be run from processor 0 and will send info to the other processors. There should be a corresponding rec_submesh called from all the other processors
[ { "docid": "232adb03e7c4407430006f29f50a44d4", "score": "0.7041033", "text": "def distribute_mesh(domain, verbose=False, debug=False, parameters=None):\n\n if debug:\n verbose = True\n\n numprocs = size()\n\n\n # Subdivide the mesh\n if verbose: print('Subdivide mesh')\n new_nodes,...
[ { "docid": "8c7e54536faf4da40bc2836cec4ca4cd", "score": "0.62078166", "text": "def pre_mesh(self):\n self.create_tri_mesh()\n self.create_mappings()\n self.define_vorverts()\n self.process_voredges()", "title": "" }, { "docid": "5e3b0f7e4e8797a0df67fedb47d7f005", ...
cb43f9fffaaca9a6d1f18e656a5c4912
Keep track of the modifications. Store everything into the HISTORY table of the Measurment set
[ { "docid": "6ad3febf72a4c512a8099e26513487b6", "score": "0.55077523", "text": "def updateHist(msname, message):\n log = inspect.stack()\n \n mstable = table( os.path.join(msname, 'HISTORY'), ack=False, readonly=True)\n #cli_table = mstable.getcol('CLI_COMMAND')\n app_table = mstable.g...
[ { "docid": "619aa3aefcacc2aafcff8ed4127dd22e", "score": "0.59455246", "text": "def saveHistory(self) -> None:\n pass", "title": "" }, { "docid": "e42d915d6d4cd1c99c0fd6137d62973c", "score": "0.5942796", "text": "def get_modified(self):", "title": "" }, { "docid": "...
a2a1edd92d7d42bea6bcaeff02646461
Constructs a ResNet34 model.
[ { "docid": "fd4339f6d77323edca3fc0941dc77aab", "score": "0.7428298", "text": "def resnet34(pretrained=False, **kwargs):\n model = ResNet(BasicBlock, [3, 4, 6, 3], **kwargs)\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['resnet34']))\n return model", "title": ...
[ { "docid": "dc9db4def5033b31448217960d1c93ed", "score": "0.7424663", "text": "def resnet34(pretrained=False):\n model = ResNet(BasicBlock, [3, 4, 6, 3])\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['resnet34']))\n return model", "title": "" }, { "doc...
a98ac91e3000cb7d66e364efe1147459
Ensure numpy arrays are always of type float
[ { "docid": "ce62599e1f10b653168b1f8edbb653c8", "score": "0.0", "text": "def reconciliate_cont_type(feature: np.ndarray, dtype: str) -> np.ndarray:\n if dtype == \"FLOAT\":\n return feature\n elif dtype == \"INT\":\n return (feature + 0.5).astype(int).astype(float)\n else:\n ...
[ { "docid": "264a7c5c4285c2d049e21765b266633d", "score": "0.7941092", "text": "def ensure_float_numpy(data):\n if isinstance(data, (list, tuple)):\n return np.array(data, dtype=float)\n else:\n assert(data.dtype in [np.float, np.float32])\n return data", "title": "" }, ...
4d54e03f1e63573c46735e266bfb93f1
Check whether value is from set of allowed values using ontology.
[ { "docid": "a8af603cce4fc88aac10d7238d6e36ef", "score": "0.0", "text": "def is_child(\n query,\n ontology: Union[Ontology, bool, int, float, str, List[bool], List[int], List[float], List[str]],\n ontology_parent=None,\n) -> True:\n if ontology_parent is None and ontology is None:...
[ { "docid": "1da2d20c3ff6542b9fef56938e713137", "score": "0.68716836", "text": "def check(self, value):\n return self._allowed_values.check(value)", "title": "" }, { "docid": "c0d397b9224d44e93fa0dd8fbc06cdd1", "score": "0.64902467", "text": "def _allowed_values_validator(insta...
ef28584b3bb788584137ea84626d264d
Linear annealing from start noise to end noise.
[ { "docid": "6e0f7d88532f29a71bb82f06ec254750", "score": "0.0", "text": "def create_grasping_env_ddpg_sampler(\n env=None,\n policy_model=None,\n unsquashed_model=None,\n action_dim=None,\n min_samples_before_train=1000,\n num_samples_at_end=50000,\n noise...
[ { "docid": "8a2a56434a6f14429524e6b95443a635", "score": "0.61480093", "text": "def linear(self, X):\r\n # self.linear_g=random.random()/100\r\n return X", "title": "" }, { "docid": "9e65de52a2b1b82327cd93ec538754da", "score": "0.60435975", "text": "def add_noise():\n ...
ebf55e8e161afa3a05ebd5c3107555ec
Function returns the Fibonacci series from 1 to n in a list
[ { "docid": "e63282681c79b28d5a475eb867c53d40", "score": "0.79864705", "text": "def fib(n):\r\n result = []\r\n a=0\r\n b=1\r\n c=b\r\n \r\n while b < n:\r\n result.append(c)\r\n c=a+b\r\n a=b\r\n b=c\r\n return result", "title": "" } ]
[ { "docid": "d1308f472abb4ea6b0b05c27ca45d4eb", "score": "0.86509764", "text": "def fibonacci(n):\n return sum_series(n)", "title": "" }, { "docid": "4e8dde1446a601bb93b19572dd9dfe90", "score": "0.84684163", "text": "def fibonacci(n):\n fibs = [0, 1]\n for i in range(2, n+1):...
93eea7d5185c07a5040a5c5e1b040c62
'PARSE' test command runner. It will call ``grammarinatorparse`` with the specified command line. Tests whether the building of Grammarinator trees from test sources works properly.
[ { "docid": "3d5529055570655ee03c84ffdfd22e76", "score": "0.7629618", "text": "def run_parse(grammar, commandline, tmpdir):\n run_subprocess(grammar, f'{sys.executable} -m grammarinator.parse {commandline}', tmpdir)", "title": "" } ]
[ { "docid": "9a3eca01884d8115c16dfc33e18ec206", "score": "0.64627254", "text": "def run_reparse(grammar, commandline, tmpdir):\n run_subprocess(grammar, f'{sys.executable} {os.path.join(tool_dir, \"reparse.py\")} {commandline}', tmpdir)", "title": "" }, { "docid": "817b5835c3e7f9c9b73dc0d0...
bb2f696a5fda3b5f59392ab5f27b6509
sum squares of natural nums from 1 to n
[ { "docid": "594219ff51d726bb9b1c9f97ceecc8ff", "score": "0.8523777", "text": "def sum_squares(n):\r\n S = 0\r\n for i in range(1, n+1):\r\n S += i**2\r\n return S", "title": "" } ]
[ { "docid": "4f330b8daf953e24e4cb9cb91cda2218", "score": "0.871387", "text": "def squares_sum(n):\r\n S = sum([i for i in range(1, n+1)])\r\n return S**2", "title": "" }, { "docid": "f2fb2188249737cb68864fa65bc8ff36", "score": "0.85173947", "text": "def sum_of_squares(n):\n\n tot...
faab1a7b306d878dd6f485eea2a63787
Return the property resources contained in the SPARQL query.
[ { "docid": "b39a7b003a133c1b149ff0b70e72fba6", "score": "0.72271043", "text": "def properties(self) -> List[Resource]:\n raise QueryMethodNotImplemented", "title": "" } ]
[ { "docid": "7c86434c6f4d7089635a13978dee8818", "score": "0.76253617", "text": "def properties(self) -> List[WikidataResource]:\n return [Resource.create_resource(w_property) for w_property in\n WIKIDATA_PROPERTY_PATTERN.findall(self.get_query())]", "title": "" }, { "doc...
e78f53d52b21115b3acf702af61f20d0
Set the plugin's visibility to global `PLUGIN_ID` is the id of the plugin to set global
[ { "docid": "55d2ad8b30b87b65c8d26b7f5281e803", "score": "0.7932023", "text": "def set_global(plugin_id, logger, client):\n status_codes = [400, 403, 404]\n with prettify_client_error(status_codes, logger):\n client.plugins.set_global(plugin_id)\n logger.info('Plugin `{0}` was set to ...
[ { "docid": "75b118ba1e38e0b3899bc4bf809072f0", "score": "0.7128243", "text": "def set_visibility(plugin_id, visibility, logger, client):\n validate_visibility(visibility, valid_values=VISIBILITY_EXCEPT_PRIVATE)\n status_codes = [400, 403, 404]\n with prettify_client_error(status_codes, logger):...
666dc8138de24ba47d0b1db3d17ec353
Renvoie la liste des voisins
[ { "docid": "6581d6764599ee1c9737b4cbbdc70aa8", "score": "0.0", "text": "def neighbors(murs,courrant):\n liste_voisins = []\n (ligne,colonne) = courrant\n \n for direction in [(0,1),(0,-1),(1,0),(-1,0)]:\n prochaine_ligne = ligne + direction[0]\n prochaine_colonne = colonne + di...
[ { "docid": "1355faa0f6bb406f3a8ed0d3f90c4332", "score": "0.6463952", "text": "def listItems():", "title": "" }, { "docid": "05e72b947c545e0c3fd847c032d16592", "score": "0.6413691", "text": "def list():", "title": "" }, { "docid": "05e72b947c545e0c3fd847c032d16592", "s...
2812ed0b25a7f3175d2e5636bb3b5917
Calculate the hex string representation of the nearest valid period for a given frequency
[ { "docid": "857dd3f6981e4048214c79f432c1acf6", "score": "0.78509706", "text": "def hexStringOfFreq(freq):\n period_hexstr = '{:06x}'.format(int(1e8*1.0/freq)).upper()\n return period_hexstr", "title": "" } ]
[ { "docid": "b73232b27df14367d645e98e103794b3", "score": "0.6192979", "text": "def freq_to_zipf(freq):\n return math.log(freq, 10) + 9", "title": "" }, { "docid": "21c4f696365758a07374fba06c49fdc3", "score": "0.61928314", "text": "def hexStringOfPeriod(period_10ns):\n period_hex...
077e4c6793b7e22aea6310a82f60e535
Validate for positive number or 0
[ { "docid": "2acb4fc91cdc7a5d68f0fb809b6f21a4", "score": "0.6488366", "text": "def validate_entry(entry):\n try:\n entry = float(entry)\n if (entry < 0):\n entry = -1\n except TypeError: \n entry = -1\n return entry", "title": "" } ]
[ { "docid": "b4148ad6ebfb313ba18f2ef8ea19a66b", "score": "0.7879615", "text": "def zero_and_negative_value_validator(value):\n try:\n value = float(value)\n except ValueError:\n raise ValidationError(_('Niepoprawna wartość'))\n if float(value) <= 0.0:\n raise ValidationError...
74c4fb27b5a7163fa3161a80c33aa64f
Returns a dict of dicts mapping each df's numerical columns to float32 or int32 dtypes. This reduces the entire data load time to 1/3 of the original load time (1 min instead of 3 min)
[ { "docid": "6b7e0f265346811e91e6280652bb2887", "score": "0.8309593", "text": "def map_dtype_cols(self):\n \n dict_of_dfs = self.get_small_data()\n dict_dict_dtypes = {}\n for df_key, df in dict_of_dfs.items():\n df_temp = df.copy()\n # dict -> col_name:c...
[ { "docid": "54eb0008978919dddfe8fc424726af3e", "score": "0.6913942", "text": "def _separate_dtypes(self) -> Dict[str, List[str]]:\n\n columns_by_dtype = {}\n\n for data_type in ['float', 'int', 'object']:\n relevant_columns = list(self._df.select_dtypes(include=data_type).column...
7c3c4a400fbf71018af625610e237398
Authenticate to the Salesforce API with the provided credentials. This function can be called multiple times, but will only make an external request once per the lifetime of the process. Subsequent calls to authenticate() will return the original oauth response. This function is threadsafe.
[ { "docid": "44bdd85022bf96c0366988df6b064ac9", "score": "0.70473737", "text": "def authenticate(settings_dict=dict()):\n\t# if another thread is in this method, wait for it to finish.\n\toauth_lock.acquire()\n\ttry:\n\t\tglobal oauth_data\n\t\tif(oauth_data):\n\t\t\treturn oauth_data\n\t\t\n\t\tconsumer...
[ { "docid": "2607b87827d13d109636afaab9fd2720", "score": "0.710903", "text": "def oauth2_authenticate(self, credentials):\n self.http = credentials.authorize(self.http)", "title": "" }, { "docid": "72ce033de019c3e7359bf6325b6be346", "score": "0.66123664", "text": "def authentic...
188c92a0fb0bab6fa3649a2c7a04cac6
Finds the complete sentence and its probability from a Trellis graph.
[ { "docid": "82f1672ea5da6cb25abe45042de0e757", "score": "0.510992", "text": "def _backtrack_path(trellis, last_word):\n total_prob, previous_word = trellis[-1][last_word]\n previous_prob = total_prob\n\n word_path = [last_word]\n individual_probabilities = []\n for state in reversed(trell...
[ { "docid": "4724732017e6ab8fa81c815ef1cefb3c", "score": "0.62844396", "text": "def sentence_logprob(self, sentence):\n res = 0\n temp = get_ngrams(sentence, 3)\n for item in temp:\n \tp = self.smoothed_trigram_probability(item)\n \tif p > 0:\n \t\tres = res + ma...
22a5c86b0b772d11fe601e54e24c4040
Returns energy as a function of angle.
[ { "docid": "204a28339f568dbf75addc21067e0796", "score": "0.0", "text": "def __getitem__(self, angle):\n return np.interp(angle, self.kin_data['a'], self.kin_data['e'])", "title": "" } ]
[ { "docid": "8a753d1bbe3ca4c6e8d0d0211bbce530", "score": "0.71086246", "text": "def get_angle(self):\n res_dict = self._get(\"req-get-angle-pos\")\n return float(res_dict[\"value\"])", "title": "" }, { "docid": "f4eae6ded7fe19a07eb8a5bcb8679e99", "score": "0.7105621", "t...
ae30d3f38c39b4d059a62551d0b77f08
Validate a URL strubg.
[ { "docid": "7f6c7d0c2b823c1327948e2f27f897b7", "score": "0.70066833", "text": "def _validate_url(self, url):\n\n if url is None:\n return []\n try:\n self.url_validator(url)\n except ValidationError:\n return [\"{} is not a valid URL\".format(url)]\n...
[ { "docid": "3c512c5c48eb16b3045a8bbe06d231ab", "score": "0.86394995", "text": "def _validate_url(self, url):\n return", "title": "" }, { "docid": "bc8f97617d989d0b6824af5b1c498db3", "score": "0.8470324", "text": "def check_url(cls, url):\n if url.startswith((\"http://\"...
faea13276c2e68ae9bb711a934ccafa2
Load person keypoints for the given image.
[ { "docid": "cd8832d2467937dd03dc3d9d2848b87c", "score": "0.5753433", "text": "def load_keypoints_mask(self, image_id):\n # If not a COCO image, delegate to parent class.\n image_info = self.image_info[image_id]\n if image_info[\"source\"] != \"jump\":\n keypoints, _ = sup...
[ { "docid": "96de0dbab33c2861d995ac17c9af16a2", "score": "0.67061466", "text": "def keypoints(self, path: str) -> List[np.array]:\n if path not in self.cache[\"keypoints\"]:\n image = self.image(path)\n image = Image.fromarray(cv.cvtColor(image, cv.COLOR_BGR2RGB))\n ...
2f8e41435df6f049f281263f9b21f866
Add a new song
[ { "docid": "17e21c344416d52817562e31594ef902", "score": "0.6398591", "text": "def songs_post():\n data = request.json\n \n # Check that the JSON supplied is valid\n # If not you return a 422 Unprocessable Entity\n try:\n validate(data, song_schema)\n except ValidationError as er...
[ { "docid": "18923b6234f95f0a255faa1b537e8a55", "score": "0.8461795", "text": "def add(playlist, song):\n pass", "title": "" }, { "docid": "cea3fc57c641bf2349439c0799fe0a9a", "score": "0.8367535", "text": "def add (self, song):\n self.songs.append(song)", "title": "" }...
48bd32661a8600df84e5296332fc95ba
calculates peak signaltonoise ratio (psnr).
[ { "docid": "313d80db982575a93b063abe78cbf50e", "score": "0.5475886", "text": "def psnr (GT,P,MAX=None):\n if MAX is None:\n MAX = np.iinfo(GT.dtype).max\n\n GT,P = _initial_check(GT,P)\n\n mse_value = mse(GT,P)\n if mse_value == 0.:\n return np.i...
[ { "docid": "2da47108eae5969476474873d77deb70", "score": "0.68403", "text": "def peak_snr(img):\n return np.max(img) / np.mean(img)", "title": "" }, { "docid": "ccdc0bd41270a5cffc9872b50bd50341", "score": "0.6765981", "text": "def peak_significance(self):\n with warnings.cat...
03af61eadf28978989ff440bab87aabe
Returns 401 if not authenticated.
[ { "docid": "447e7595eab010219260448dcaa458c0", "score": "0.0", "text": "def test_create_not_authenticated(self, app, client):\n with override_config(app, 'DEPARTMENTS_SUPPORTING_DROP_INS', ['COENG']):\n AppointmentTestUtil.create_drop_in_appointment(client, 'COENG', expected_status_cod...
[ { "docid": "41b758c04bbfad0ebbe3ab9e33291dc7", "score": "0.7765208", "text": "def authenticate(self):\n resp = Response(\n None, 401\n )\n abort(401, description=\"Please log in by accessing the /authorize endpoint\", response=resp)", "title": "" }, { "docid":...
2d445cb061a42f790961e26ff0c0198a
Create and save a new user
[ { "docid": "9061b14e75cd3c0835b690af29dbb991", "score": "0.0", "text": "def create_user(self, email, username, password=None, **extra_fields):\n if not email:\n raise ValueError('User must have an email address!')\n\n if not username:\n raise ValueError('User must hav...
[ { "docid": "d2e22d3b86621ef013068af8c359c91e", "score": "0.81188846", "text": "def save(self):\n with create_connection() as connection:\n new_user_id = create_user(\n connection, self.name, self.email, self.password)\n self.id = new_user_id", "title": "" ...
6baf9464ccef93acf6e9693be54cd5f8
Get name of provider.
[ { "docid": "40a082887edc8ca86f842df1e540506f", "score": "0.0", "text": "def test_get_name(self):\n provider = OCIProvider()\n self.assertEqual(provider.name(), \"OCI\")", "title": "" } ]
[ { "docid": "fe57123fbad45837bcf0c3d72d43f53f", "score": "0.8773611", "text": "def get_name(self):\n\t\t\n\t\treturn self.target.provider_name", "title": "" }, { "docid": "3b2bd7f6a75bababaac2a6fd34bb75f8", "score": "0.8698227", "text": "def provider_name(self) -> pulumi.Output[str]:\...
07736583d0fe74a62b43aaa65eed2f2c
Sample neighbors to be the supportive fields for multilayer convolutions.
[ { "docid": "17b2d2288bba37435b126f3d43c005b3", "score": "0.5517784", "text": "def sample(self, inputs):\n samples = [inputs]\n for k in range(self.num_aggs):\n # Aggregator for k-hop neighbors is at layer K-k\n t = self.num_aggs - k - 1\n sampler = self.sam...
[ { "docid": "2bb598e434e5db7767719f501c8e7391", "score": "0.64004725", "text": "def get_neighbors(self):", "title": "" }, { "docid": "f8480fa621644f3ff6688dc5f3c1da12", "score": "0.6192645", "text": "def test_grid_graph_get_neighbors_8conn(self):\n new_obs_map = self.world_desc...
af92ac0fcd858e1b9e220360582ce577
Raw prediction for Logistic Regression classifier.
[ { "docid": "0c4113e409f5f73d177ea260be14a2f6", "score": "0.0", "text": "def raw_predict(self, features):\n\n features_bias = features\n return np.dot(features_bias, self.coef_)", "title": "" } ]
[ { "docid": "5b610a193453ff3aba49bb7885e3c2b1", "score": "0.7799648", "text": "def predict(self, X):\r\n return self.__logistic.predict(X.T)", "title": "" }, { "docid": "0842998c2ee79bf2841c74f54b037739", "score": "0.7340794", "text": "def _predict(self, X):\n y = self.c...
76f418a54007db933961e2d080cb1c1a
Tests for compliance with Data interface. Runs tests that every Datacompliant class should satisfy.
[ { "docid": "84cfa8f7349563f3e2261dc5ced78a0f", "score": "0.6969802", "text": "def validate_data_interface(ds: smlb.Data) -> bool:\n\n # actual or \"virtual\" abc inheritance\n assert isinstance(ds, smlb.Data)\n\n if ds.num_samples == float(\"inf\"):\n # infinite data tests\n pass\...
[ { "docid": "e3c0f7dab7a01715ea083f6e99e95be2", "score": "0.6556427", "text": "def test(self, model, data):\n\t\traise NotImplementedError", "title": "" }, { "docid": "7a6dd6e5abf9802da10e0afeada419dd", "score": "0.6243776", "text": "def test_005_is_data(self):\n eval_data = {}...
cf33c64f16e6447e36f5e8e6b09143ee
Retrieves only users created by an external system
[ { "docid": "848f828362c77bf05a56ba1caea801cf", "score": "0.6912667", "text": "def get_external_users(self):\n return (user for user in self.users if user.external_account == 'social')", "title": "" } ]
[ { "docid": "32867a3d7cd70e82bce89395e889c9de", "score": "0.7024964", "text": "def getUsers():", "title": "" }, { "docid": "13ef2d538b58ec2e44d6b465918072e6", "score": "0.68696696", "text": "def get_all_users(self):", "title": "" }, { "docid": "0dcab2a76a9e1eabab45bf4a2bc7...
70e9d23c2821ab6df0182cf4fa166c5f
Returns temperature in Celsius.
[ { "docid": "2304336a46446ffc3fc2b1f836631e28", "score": "0.0", "text": "def c2f(temp):\n return 1.8 * temp + 32", "title": "" } ]
[ { "docid": "7500c1555c56eeb3a186c914f35c8ba7", "score": "0.7971279", "text": "def to_celsius():\n\n fahrenheit = int(input(\"give the temperature...\"))\n\n celsius = (5/9) * (fahrenheit - 32)\n\n print(celsius)", "title": "" }, { "docid": "7fdff99cfb0b269b5f27ad4b69fc3446", "sc...
e63335db9aee5405a83c808bef88ab70
Write a function def BIC(X, kmin=1, kmax=None, iterations=1000, tol=1e5,
[ { "docid": "157306a8df220de22c474f8f21e78778", "score": "0.84026706", "text": "def BIC(X, kmin=1, kmax=None, iterations=1000, tol=1e-5,\n verbose=False):\n if not isinstance(X, np.ndarray) or len(X.shape) != 2:\n return (None, None, None, None)\n if type(kmin) != int or kmin <= 0 or ...
[ { "docid": "f47b134b205555009af1cbcbb8cf3fa7", "score": "0.6886853", "text": "def compute_bic(kmeans, X):\n # print(X)\n # assign centers and labels\n centers = [kmeans.cluster_centers_]\n labels = kmeans.labels_\n # number of clusters\n m = kmeans.n_clusters\n # size of the cluster...
75fb2d7989cc777ac2398f0151a32d2a
Is the hand High Card?
[ { "docid": "028d1e4e96bb492062db44261ebd00fc", "score": "0.6395162", "text": "def high_card(dL):\n holder = 0\n if len(dL) == 5:\n return True\n else:\n return False", "title": "" } ]
[ { "docid": "2d6ed4502a06a2b2db1eeda5fad8d8ae", "score": "0.7161693", "text": "def is_card():\n return False", "title": "" }, { "docid": "1d7ee66a0469e575914d5729541ced6c", "score": "0.70982385", "text": "def is_blackjack(self):\n high_cards = [c for c in self.cards if c...
a5095d6b0b75cb200ea3cba50bae9a6b
Get value of height.
[ { "docid": "575bace13b5488479d8cb74b1e8fe943", "score": "0.77826166", "text": "def getHeight(self):\n return self.get('image.height')", "title": "" } ]
[ { "docid": "2670be81bd779f463e303e1adad4d578", "score": "0.87635314", "text": "def value(self):\n return self.height", "title": "" }, { "docid": "ff2c982e6515ccf107f3e942590a4df8", "score": "0.8344536", "text": "def get_height(self) -> int:\n return self.get_state_field...
f3f3df7e1c1482afbb20898aa344d0b3
Marks a key as explicitly changed by the user
[ { "docid": "cd9e97e2f1c4cf7df21a85f38972747f", "score": "0.7192706", "text": "def _mark_as_changed(self, key):\n if not key:\n return\n key = self._db_field_map.get(key, key)\n if hasattr(self, '_changed_fields') and key not in self._changed_fields:\n self._cha...
[ { "docid": "f6149507256ea7e9f3d17310933bd7f9", "score": "0.6985511", "text": "def setChanged(self, key):\n if key not in self.data:\n raise ArgumentError(\"No settings data for \" + key)\n if key not in self.changed:\n self.changed.append(key)", "title": "" }, ...
8ba4723daf7286e9529ea452ff1edde9
Stops the device from spinning
[ { "docid": "e3cb15fce3fe26126e65cc4e8d43cb73", "score": "0.0", "text": "def idle(self):\n self.device.set_motor_speed(sweep_constants.MOTOR_SPEED_0_HZ)", "title": "" } ]
[ { "docid": "a2bbd32d90fe939f54405e5c6f986c4c", "score": "0.79570085", "text": "def stop():\n global _spin\n\n if _spin is not None:\n _spin.stop()", "title": "" }, { "docid": "e81108d1534ab67a2a559b4e29d4140b", "score": "0.795585", "text": "def stopSpin(self):\n\t\tif se...
39c19375d1e4f80a4d6f057d6a600739
Test for method is_superuser should return True for super_user object.
[ { "docid": "dbd32415e8971b42da945fdd9846a223", "score": "0.8903598", "text": "def test_is_superuser(self):\n super_user = create_superuser()\n self.assertEqual(super_user.is_superuser, True)", "title": "" } ]
[ { "docid": "3dc67c3b245266dc6b534e7c9ef73e52", "score": "0.85716677", "text": "def test_is_superuser(self):\n user = create_user()\n self.assertEqual(user.is_superuser, False)", "title": "" }, { "docid": "74e702dce22b84c8754039f680020574", "score": "0.8448674", "text": ...
41cbcc092507f91c715422fd45da0518
Sends a command and waits for a confirmation. Prints any response or errors the daemon sends.
[ { "docid": "f94d65abc05280590c0ebf4aeb6c7f2d", "score": "0.6671436", "text": "def send(msg):\n global _conn\n\n _conn.send(msg)\n confirm = _conn.recv()\n\n if confirm[0] == True:\n if len(confirm) > 1:\n print(\" \" + confirm[1])\n else:\n if len(confirm) == 0...
[ { "docid": "e6e3e3f327e871853d02e204c311d514", "score": "0.67982674", "text": "def do_command(command):\n send_command(command)\n response = get_response()\n print(\"Rcvd: <<< \\n\" + response)\n return response", "title": "" }, { "docid": "60181a2aaabe87d74701153d1335763f", ...
5f1d7813ef916e3a2794ae3c53a9a463
updates the place object
[ { "docid": "b6857822a2a4264202100b91ac965d69", "score": "0.6469898", "text": "def update_place(place_id):\n upd_place = request.get_json(silent=True)\n if upd_place is None:\n return \"Not a JSON\", 400\n place_to_update = storage.get(Place, place_id)\n if place_to_update is None:\n ...
[ { "docid": "0500848120bbc791893ae769879ed0bd", "score": "0.6592217", "text": "def update_place(request):\n\t# Only animators\n\tif not request.user.get_profile().is_animator():\n\t\traise PermissionDenied()\n\t# Update the place\n\tplace = Place.get_main_place()\n\tif place.now_open():\n\t\tplace.do_clo...
0cfe0527c22def381f60c09fbc49dafa
Parses the document and returns all candidate mentionentity pairs.
[ { "docid": "17348bcf1373e3bb402c8af839d75448", "score": "0.5840238", "text": "def parse(self, doc, doc_id):\n query = Document(doc_id, doc)\n candidate_ens = defaultdict(list)\n for ngram in query.get_ngrams():\n for en in self.commonness.get(ngram, {}):\n ...
[ { "docid": "c292852ff145d40f6e539768b377b931", "score": "0.65487295", "text": "def _extract_candidates(self, document):\n\n # fetch results of the NER\n locations = []\n timex_candidates = []\n\n tokens = document.get_tokens()\n\n for i, sentence in enumerate(tokens):\...