query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
30548a722196a488ddfe6373dc06961b
Launch the actual computation and return the associate params/couplings.
[ { "docid": "946acb052f8fec74536626bbbbc2e28c", "score": "0.74470735", "text": "def main(self):\n \n self.analyze_parameters()\n self.analyze_couplings()\n return self.params, self.couplings", "title": "" } ]
[ { "docid": "8274cf0d22fab22cc18915ae7ee2424c", "score": "0.6514732", "text": "def running_internals(self):\n\n # Define all functions used\n for func in self['functions']:\n exec(\"def %s(%s):\\n return %s\" % (func.name,\n \",\"....
c6fa8fc4716763497fca64b421574e17
reindexes an object in all language branches
[ { "docid": "41ce0c7c964c32ebb8c5b09cec30866e", "score": "0.68288916", "text": "def reindexer():", "title": "" } ]
[ { "docid": "c00ec790d24b2d35300feb99c55d47d9", "score": "0.6613141", "text": "async def reindex_all_content(context: IBaseObject, security=False):", "title": "" }, { "docid": "d260b7c1d4b53d38e52cb8414956253e", "score": "0.65043896", "text": "def reindexObject(self, idxs=[]):\n ...
22d2a30a7df866ae06a7fad099c70539
Send a longer chunk of text as a snippet or file attachment.
[ { "docid": "cce5018d85ab0e845aab0238be1d02a3", "score": "0.5858727", "text": "def send_snippet(self, text, title=None):\n self.send_markdown(f\"```\\n{text}\\n```\")", "title": "" } ]
[ { "docid": "1bdb7e17f3f3ba86b0db6b89246adcb1", "score": "0.586219", "text": "async def say_with_attachment(self, *, channel_id, title, text, message_type=None):\n await self.say(\n channel_id=channel_id,\n text=title,\n attachments=[{\"fallback\": title, \"text\":...
d15641820c9aea1031b06ed35ba64898
Encode as a kore pattern
[ { "docid": "85d1f1029e9680214e9892087a592250", "score": "0.0", "text": "def as_pattern(self) -> kore.Pattern:\n return KoreUtils.construct_and(self.get_constraint(), self.pattern)", "title": "" } ]
[ { "docid": "ec459b9ce4946d521fd4637b31fab36c", "score": "0.6436093", "text": "def _encode(self, k):\r\n # NOTE: '_' is NOT in the base64 alphabet!\r\n return base64.encodestring(k).replace('\\n', '_').replace(\"/\", \"-\")", "title": "" }, { "docid": "45393879d6b16b0f6f8c86a03d...
f79175f2d4892f9fafb843ff6b11629c
Load, augment, featurize and normalize for speech data.
[ { "docid": "de59ad2a8bf1814a801edbc4a80695e2", "score": "0.53907084", "text": "def process_utterance(self, audio_file: str, transcript: str, text_sep: Optional[str]=None) -> (np.ndarray, List):\n speech_segment = SpeechSegment.from_file(audio_file, transcript)\n self._augmentation_pipeline...
[ { "docid": "9c3766ca6f7cfa4f44d75a9ff0d5bd29", "score": "0.6271676", "text": "def import_input(self):\n\n if self.speech is True and self.mode == \"live\":\n r = sr.Recognizer()\n with sr.Microphone() as source:\n print(\"Speak Anything :\")\n r...
fd3401706d316af6f8b5af9fc2a6ee41
Called when our source value changes
[ { "docid": "1a7b7a705fb4ea0ee9f85cd9a9b8ffa5", "score": "0.0", "text": "def _update_hook(self, value, name):\n output = node_handle.handle(self, value, name)\n if output == None:\n return\n old = getattr(self.dict, 'value', None)\n self.dict['value'] = output\n ...
[ { "docid": "02db73ecadff59335dc6849c907a7458", "score": "0.677726", "text": "def _on_value_changed(self, value):\n self._field.value = value", "title": "" }, { "docid": "889bb99cf3eef5ed9e1a51e320d88b6f", "score": "0.669307", "text": "def __sourceDataChanged(self, topLeft, bot...
40903f85710acdd7e900b9b50c600124
This function initialize the node computing the various MDDs, and verify if a solution exists.
[ { "docid": "fa6ef67e8a295ac82e283c3e87b1d0de", "score": "0.6093743", "text": "def initialize_node(self, stop_event, verbose=False):\n if verbose:\n print(\"Initializing node: \", self._path_costs_vector)\n self._mdd_vector = self.compute_mdds(verbose)\n self.compute_solut...
[ { "docid": "301f132408cffa4d7beae4b0e5c023b3", "score": "0.6172178", "text": "def test_node_and_edge_initialization(self):\n uds = self.__class__.uds\n model = self.__class__.model\n\n # A test document\n test_doc_id = self.__class__.test_doc_id\n test_doc = self.__cla...
c4cea5a48f90a9f75502f5be54fe6be5
The name of the algorithm in the UI. Should be localised.
[ { "docid": "41af7db50ff7f69fa4c76bba80096d9c", "score": "0.0", "text": "def displayName(self):\n return self.tr(self.name())", "title": "" } ]
[ { "docid": "a30429a08f9a688364d0b35ebe4d689f", "score": "0.7608423", "text": "def _get_display_name(self):\n # If there are no arguments then take the name directly from the document name, else\n # assume it is an algorithm and use its name\n if len(self.arguments) > 0:\n ...
9d898111b4842579f357fed1b70f6156
View to show the contact page.
[ { "docid": "523a03221425584ca8e0c145e812fb8a", "score": "0.8505186", "text": "def contact_view():\n return render_template('contact.html')", "title": "" } ]
[ { "docid": "c3bbf4e6ffdee358abbd62e044c3e5e6", "score": "0.8453134", "text": "def show_contact():\n\n return render_template(\"contact.html\")", "title": "" }, { "docid": "acffefe0e7875afa0ae1d783a8e2c5bc", "score": "0.8283936", "text": "def contact():\n return render_template(...
ce518c439f9b1cdc65cb22a66d51b357
Passed to Pyramid as a bound method when creating a route. Converts the arguments to route_url (which should be row objects) into URLfriendly strings.
[ { "docid": "0584414a6c0aba71d208df9330918321", "score": "0.0", "text": "def pregenerator(self, request, elements, kw):\n # Get the row object, and get the property from it\n row = kw.pop(self.key)\n kw[self.key] = self.sqla_column.__get__(row, type(row))\n\n if self.parent_ro...
[ { "docid": "ed9e0a28282dbb138efc64486a9ed5a2", "score": "0.64248407", "text": "def get_self_url(cls, *args, **kwargs):\n # Convert the route to an f-string type syntax\n route_str = cls.URL.replace(\"<\", \"{\").replace(\">\", \"}\")\n if kwargs:\n # We have keyword argum...
b48359780a9062a7626991519488d16c
Check that a list of JS files have been removed
[ { "docid": "f0d289c4616db61fb58d4c304a484323", "score": "0.7070249", "text": "def testCustomJSRemoved(self):\n jsfiles = [\"multi-resolution.js\"] # Examples are [\"++resource++plonetheme.example/test.css\"]\n for resource in self.jstool.getResources():\n self.failIf(resource.ge...
[ { "docid": "36c918cb816ca966deba40b74821a507", "score": "0.64431936", "text": "def testCustomJSAdded(self):\n jsfiles = [\"multi-resolution.js\"] # Examples are [\"++resource++plonetheme.example/test.css\"]\n for resource in self.jstool.getResources():\n try:\n js...
4f0390a8b7252f5d4f304506bd94fe2e
Fix packaging errors found in the image.
[ { "docid": "736f939bb7ff22ddaac49a99da07ae3f", "score": "0.0", "text": "def fix(op, api_inst, pargs, accept, backup_be, backup_be_name, be_activate,\n be_name, new_be, noexecute, omit_headers, parsable_version, quiet,\n show_licenses, verbose):\n\n return __api_op(op, api_inst, args=pargs, ...
[ { "docid": "52453a1a8cd90c4e06a8c6cb38b53a3e", "score": "0.60056734", "text": "def test_ignore_missing(self):\n self.image_create(self.rurl1)\n self.pkg(\"update missing\", exit=1)\n self.pkg(\"update --ignore-missing missing\", exit=4)", "title": "" },...
060e54f5da7d2021daf8ae2683599e45
Inverts existing Fraction, inplace
[ { "docid": "55add0ba130de1d852b736109dce3771", "score": "0.70644534", "text": "def invert(self):\n self.num, self.den = self.den, self.num\n return self", "title": "" } ]
[ { "docid": "66a8eb9e5cb8312e4c05290ce1fee4c8", "score": "0.69685155", "text": "def invert(self):\n\t\tassert (self.numerator!=0), \"Numerator can't be zero\"\n\n\t\tself.numerator,self.denominator = self.denominator,self.numerator\n\t\treturn self", "title": "" }, { "docid": "3939cf00dff2740...
10ed61026d44368e1de67d01c5b42e38
Set default website for all categories without website value
[ { "docid": "cbc7df2ece5c153bda31aef3245228ba", "score": "0.58391696", "text": "def init(self):\n IS_INITED = \"product_public_category_is_inited\"\n\n if self.env[\"ir.config_parameter\"].get_param(IS_INITED):\n return\n\n self.search([(\"website_ids\", \"=\", False)]).wr...
[ { "docid": "5bbaaa322d8a3fe7c5fa238ebc8e1108", "score": "0.60959905", "text": "def change_category_to_default(self, request, queryset):\n queryset.update(category='Default')", "title": "" }, { "docid": "4aace95249b08664caac8eacd3ea4e68", "score": "0.60282636", "text": "def def...
e7e197b6a2175759b0514b2484799f26
(3.6b) in Damour & EspositoFarese 1996
[ { "docid": "c167a7f5f347f13bb00444cb91468f56", "score": "0.0", "text": "def extdnudr(self, r, M, nu, varphi, psi, om, ombar):\n R2M = L2M(r) - 2.0 * M # unit: g\n U = self.STGq.U(varphi)\n A = self.STGq.A(varphi)\n dphsq=self.STGq.dphsq(varphi)\n return r * dphsq * ps...
[ { "docid": "0c228a45d85213c2a10df1220ec22208", "score": "0.6990006", "text": "def Q21():", "title": "" }, { "docid": "3b4947a5c88f6ccc57ce79a776a30d36", "score": "0.6917688", "text": "def Q3_1():", "title": "" }, { "docid": "ff129cee933d269d50768fb7d7eaffa8", "score":...
1e5eeffbd3209d5e1d9c447667a5817e
Emit program arguments as 'send_text' signal
[ { "docid": "25e3985d037e3ebf738286529b641aa9", "score": "0.7654704", "text": "def work(self):\n arguments = QCoreApplication.arguments()\n if len(arguments) > 1:\n for arg in arguments[1:]:\n self.send_text.emit(arg)", "title": "" } ]
[ { "docid": "1801a39e82d19789eb816c56a86b7e75", "score": "0.6452907", "text": "def SendText(self, text):\n #self.text = text\n #self._logger.debug('Sent text: %s', text)\n if text[0]=='whole':\n print 'in whole: sending sendtext signal',text[1]\n \n elif text...
a707696145f51dffbe9bc2c33dcef42a
Sets the based_on of this Film.
[ { "docid": "eb352cb4ffcf1211a8112509c1e76f17", "score": "0.7516244", "text": "def based_on(self, based_on):\n\n self._based_on = based_on", "title": "" } ]
[ { "docid": "dd5b6a7cf1e4679fe7c42af9e9cb8ac2", "score": "0.59977955", "text": "def compatibility_based_on(self, compatibility_based_on):\n\n self._compatibility_based_on = compatibility_based_on", "title": "" }, { "docid": "768c892b40146705d2e83c45669ee7c3", "score": "0.5930045", ...
6cecda759d1cdc6b6f63ce9c57b20a98
Create Client object from config file values
[ { "docid": "53b65740caa5624dae7809752d4a3e32", "score": "0.69351506", "text": "def _from_dict(config):\n return ClientConfig(processor=config.get(\"processor\", DEFAULT),\n response=config.get(\"response\",\n \"json/simple/...
[ { "docid": "3d1aad5e7e5150fef654dccb5e092300", "score": "0.721617", "text": "def from_config(cls):\n config = Config()\n client = cls(\n username=config.get('username'),\n api_key=config.get('api_key'),\n server=config.get('api_server'),\n versio...
ecd7ffe4859e546997d377c09a6b5e1e
Add a light to the camp
[ { "docid": "5339152ba055c287bc9d06d78ab518f6", "score": "0.7063856", "text": "def add_light(self, kind, adr, soft):\n if kind == 'bar':\n newLight = Bar(adr)\n self.lights.add(newLight)\n for i in range(4):\n self.resTable.add(soft + i, newLight, i)...
[ { "docid": "0e76f976ffc992be93726eecd91d2851", "score": "0.7031817", "text": "def AddLightToScene(self, LpszNewValue=defaultNamedNotOptArg):\n\t\treturn self._oleobj_.InvokeTypes(65725, LCID, 1, (3, 0), ((8, 1),),LpszNewValue\n\t\t\t)", "title": "" }, { "docid": "0e76f976ffc992be93726eecd91d...
b342e16aa75497d9ddfe93579d8ec247
compute the 2's complement of int value val
[ { "docid": "5906e2fd9754b2d0f99ade785d2e37da", "score": "0.63457954", "text": "def twos_comp(val, bits=16):\n if (val & (1 << (bits - 1))) != 0: # if sign bit is set e.g., 8bit: 128-255\n val = val - (1 << bits) # compute negative value\n return val # retur...
[ { "docid": "94277e56bb3737662c02817dbf916fa5", "score": "0.76466656", "text": "def to_twos_complement(val):\r\n assert(-128<=val<=127), 'val expected to be in range -128..127. Was: %s' % val\r\n if val < 0:\r\n val = -((val^0xFF)+1)\r\n return val", "title": "" }, { "docid": ...
a2817de2c3b96b36cb78c07d3a287a3e
Return True if this environment can be deleted, otherwise False.
[ { "docid": "b46432ca8f5c49701db84cb55d2a7333", "score": "0.6426232", "text": "def deletable(self):\r\n from moztrap.model import ProductVersion\r\n return not ProductVersion.objects.filter(environments=self).exists()", "title": "" } ]
[ { "docid": "d028985c4faafb5b51a06153de83368e", "score": "0.73257", "text": "def deletable(self):\r\n return not self.environments.exists()", "title": "" }, { "docid": "18507354cac5a41362005e2d4472f942", "score": "0.721794", "text": "def can_delete(self):\n return self.u...
15705d69084a2cf1e9b226ff07c2d5e4
Endpoint can be one of `ga` or `realtime`.
[ { "docid": "97563835321af8a6ba3193e98c311ac9", "score": "0.4935052", "text": "def __init__(self, endpoint, profile):\n \n # various shortcuts\n self.profile = profile\n self.account = account = profile.account\n self.service = service = profile.account.service\n ...
[ { "docid": "168960ab56c6925179c9b6bcf437de07", "score": "0.6674954", "text": "def endpoint():\n pass", "title": "" }, { "docid": "3f5cf29b555945fa1c133574cde2f4b9", "score": "0.5978449", "text": "def describe_endpoint(endpointType=None):\n pass", "title": "" }, { "d...
ff168e43fffa9e4ba290d9436f322b40
(tuple) Signals that can be probed in the neuron population.
[ { "docid": "a547efb08db30346a14cd996e2058486", "score": "0.636023", "text": "def probeable(self):\n return ('output', 'input') + tuple(self.ensemble.neuron_type.probeable)", "title": "" } ]
[ { "docid": "6f19367f726c8c371bb564485db2ca8b", "score": "0.5695944", "text": "def observe(self) -> Tuple[Any, Any, Any]:\n raise NotImplementedError", "title": "" }, { "docid": "3a885956a2f6969fd9c8596cbd175506", "score": "0.56858057", "text": "def _set_propreties(self):\n ...
185be77ac599a13dc94ae346a082c9db
given a list of 4element tuples, transforms it into a numpy array
[ { "docid": "49757fbbc766571138cea8f03ec1e0a2", "score": "0.5386675", "text": "def segments_to_numpy(segments):\n segments = numpy.array(segments, dtype=SEGMENT_DATATYPE, ndmin=2) # each segment in a row\n segments = segments if SEGMENTS_DIRECTION == 0 else numpy.transpose(segments)\n return se...
[ { "docid": "aaffbbaab61cc92e270ea8f9f84aa6e4", "score": "0.73967636", "text": "def tuples_to_array(t):\n assert type(t) is list\n assert len(t) != 0\n length = len(t)\n a = np.empty((length, 2))\n for i_, tuple_ in enumerate(t):\n a[i_] = np.array([tuple_[0], tuple_[1]])\n retur...
ac1125ee9475f897bb8120d5f0c29f1a
Retrieve the contents of a web page, convert it to a string, then return the string.
[ { "docid": "f4fbf02006aed5c71c564e5a3d9e3a7d", "score": "0.79234254", "text": "def get_page(url):\n socket = urlopen(url) # open a connection to url\n data = socket.read() # read everything as a stream of bytes\n socket.close() # close connection\n s = str(data, 'utf-8') #...
[ { "docid": "eff16908d7d6c7d0a4447a0e3d4aaa46", "score": "0.7719838", "text": "def __get_page_content(url) -> str:\n session = requests.Session()\n session.headers.update({'User-Agent': 'fuck you'})\n return session.get(url).content.decode('ascii', errors='ignore')", "title": "" }, { ...
0388ce17b7a5a0286520a5d1d54bd06d
Most common case, e.g. self.popupmenu = wx.Menu() where all you know about is that you imported wx.
[ { "docid": "706818a5b814f35186854915c8e5d593", "score": "0.0", "text": "def test_2(self):\n self.do(\n rhs=[\"a\", \"Blah\"],\n made_rhs_call=True,\n call_pos=1,\n quick_classes=[],\n quick_defs=[],\n imports=[\"a\"],\n ...
[ { "docid": "a05a060ec0b5bd64e66831451815ce63", "score": "0.6452351", "text": "def __init__(self, name=wx.EmptyString, ext=wx.EmptyString, type=0):", "title": "" }, { "docid": "7420c5d4692bde1f3c8a8300b281d205", "score": "0.64391017", "text": "def __init__(self, name=wx.EmptyString):"...
ba44e7307e2555122a2550924ec95ab6
Get the encoded version of the current raw text
[ { "docid": "e5f141a511285a9727fc884de0ddcfd6", "score": "0.7009194", "text": "def encoded_text(self):\n return b64encode(self._text.encode('utf-8')).decode('utf-8')", "title": "" } ]
[ { "docid": "d4bb1d07dc992fe711a789830567b59e", "score": "0.69265985", "text": "def _encode(self, text):\n return text", "title": "" }, { "docid": "b4d16e744a9f456b8585935ad196f323", "score": "0.6504555", "text": "def _inlob(self, text):\n text = text.data #this is a alr...
cd92877d1e1e067f3e97bd0a6193ccb2
Output the portfolio holdings information as a dictionary with Assets as keys and subdictionaries as values.
[ { "docid": "2b5a393229a34f324890e6d352548dda", "score": "0.6123874", "text": "def holdings_to_dict(self):\n holdings = {}\n for asset, pos in self.pos_handler.positions.items():\n holdings[asset] = {\n \"quantity\": pos.quantity,\n \"book_cost\": po...
[ { "docid": "2bff36979939ab591bf739fd2133830e", "score": "0.6790736", "text": "def portfolio_to_dict(self):\n port_dict = self.holdings_to_dict()\n port_dict[\"total_cash\"] = self.total_cash\n port_dict[\"total_value\"] = self.total_value\n return port_dict", "title": "" ...
862bb647843a5dd7c89b249c13fe581f
Extract ImageNet dataset file list
[ { "docid": "df3fdd5056bfb1ef4bed4c754d88f517", "score": "0.0", "text": "def strip_imagenet(dest, src, root_path):\n\n print(\"Stripping ImageNet\")\n\n files = []\n\n with open(src) as f_src:\n while True:\n line = f_src.readline()\n \n if not line:\n ...
[ { "docid": "2e621a5dbfba6296bb2e35c60f61a4d7", "score": "0.6949771", "text": "def _read_dataset():\n car_images = glob.glob('dataset/vehicles/**/*.png')\n non_car_images = glob.glob('dataset/non-vehicles/**/*.png')\n\n cars = [cv2.imread(img) for img in car_images]\n non_cars = [cv2.imread(i...
f190c91313b8c4f5f15bcb9506507d89
Returns the first tick that is relevant for production utilization calculation
[ { "docid": "3238d30ef752eac076ccbf203b58fedd", "score": "0.67001", "text": "def _get_first_relevant_tick(self, ignore_pause):\r\n\r\n\t\tcurrent_tick = Scheduler().cur_tick\r\n\t\tstate_hist_len = min(PRODUCTION.STATISTICAL_WINDOW, current_tick - self._creation_tick)\r\n\r\n\t\tfirst_relevant_tick = cur...
[ { "docid": "245dcd5350872bdcf422d49bfe139985", "score": "0.6013034", "text": "def get_sweep_start(self):\n self.gpib.write(\"FREQ:START?\\n\".encode())\n return float(self.gpib.readline().decode())", "title": "" }, { "docid": "32a4a45ce6a9b994c689742d687d1ef2", "score": "0....
8269948fb79ffee4fc947669ada0a40f
Callback when strategy is stopped.
[ { "docid": "c7a4003fe9057005424c94e4572373db", "score": "0.7501047", "text": "def on_stop(self):\n self.write_log(\"策略停止\")\n self.put_event()", "title": "" } ]
[ { "docid": "a0bd734c6b4b26c77d25741c49960941", "score": "0.75808346", "text": "def on_stop(self):\n self.write_log(\"策略停止\")\n\n self.put_event()", "title": "" }, { "docid": "a0bd734c6b4b26c77d25741c49960941", "score": "0.75808346", "text": "def on_stop(self):\n ...
143a289f1ad4f272f4a3c3cc6796d044
Draw a circle in win.
[ { "docid": "7ef559c34c26847653e649142e3f1f3a", "score": "0.70165163", "text": "def draw(self, win):\n center = Point((self.agent_y + 0.5) * GRID_WIDTH, (self.agent_x + 0.5) * GRID_WIDTH)\n radius = GRID_WIDTH / 3\n self.agent = Circle(center, radius)\n color = COLOR[random.ra...
[ { "docid": "b578a3b87df26579f34ce19174f0e08b", "score": "0.8317228", "text": "def draw(self):\n circle(screen, self.color, self.coordinates, self.radius)", "title": "" }, { "docid": "1045014e919a022bc78ab08e147f49af", "score": "0.8247094", "text": "def draws_circle(position, c...
5a87aa64379dbf96d353779e45fafe4d
Invert the gravity (left becomes right, top becomes bottom).
[ { "docid": "d798fced164c0b6cf1267110c543b414", "score": "0.78058606", "text": "def invert(self, vertical=True, horizontal=True):\n x, y = self.x, self.y\n if vertical:\n y = 1.0 - self.y\n if horizontal:\n x = 1.0 - self.x\n return Gravity(x, y)", "t...
[ { "docid": "71f8ed4533c304d47c2f842027344668", "score": "0.64032644", "text": "def invert(self):\n self.x *= -1\n self.y *= -1", "title": "" }, { "docid": "c08e0653268c96de3b08f00f4f07ae29", "score": "0.6358194", "text": "def invert(self):\n self.invert_x()\n ...
19f2c6dac39672deb8a1e35a261a667c
Update the named variables declaration for a subroutine.
[ { "docid": "f79dc4bcca89c461c2386a9418cde2e5", "score": "0.0", "text": "def run(self, edit):\n codeblock = self.focus_view.get_codeblock(self.selection_start())\n var_dict = codeblock.get_variables_from_function()\n\n var_queue = deque(v[1] for v in sorted(var_dict.items()))\n ...
[ { "docid": "a6e056a343b64cb8aa9cddd3dea46b18", "score": "0.5980276", "text": "def update_ssa(self):\n vc = {}\n for i in self.instructions:\n # If its been declared before and updated, use updated\n # TODO: clean this up\n if isinstance(i.arg1, str) and i.a...
9ee3ab5fb91a1ecd6e64e67868c368c1
Set up event listeners for SQLite. This includes several settings made on connections as they are created, as well as transactional control extensions.
[ { "docid": "fd5738ebb36a515938303dbffc33b0db", "score": "0.7135502", "text": "def _init_events(engine, sqlite_synchronous=True, sqlite_fk=False, **kw):\n\n def regexp(expr, item):\n reg = re.compile(expr)\n return reg.search(six.text_type(item)) is not None\n\n @sqlalchemy.event.list...
[ { "docid": "fb0a30d79e83adf8cf9dd9e1d13f0e3c", "score": "0.63923454", "text": "def init_events(engine, **kw):\n @sqlalchemy.event.listens_for(engine, \"before_cursor_execute\")\n def execute_timeout_task(conn, cursor, statement,\n parameters, context, executemany):\n ...
324f69b659d88f18f68d2f6a4dd5ff05
Count back from the end of the pipeline to find the element.
[ { "docid": "8f9284eb5e4ce8348a385fd9c0ca94b9", "score": "0.0", "text": "def walk(expr):\n if not _is_pipe(expr):\n return 0\n arg_index = walk(expr.args[0])\n if arg_index == index:\n result[0] = expr.name\n return arg_index+1", ...
[ { "docid": "dcb7e749b2a125caea656afd1616bc6e", "score": "0.6944127", "text": "def count(self, e):\r\n x = e\r\n counter = 0\r\n curr = self._head\r\n #if bag is empty\r\n if self._size == 0:\r\n raise Empty('Your bag is empty.')\r\n return\r\n #go through entire list and ...
dd2edfafa4d2a8bd0b107ea9e2eef5b2
Overloads the < operator to determine if one Binary instance is less than the other.
[ { "docid": "8f369d30615af6b49f0824ccfe833d39", "score": "0.66852206", "text": "def __lt__(self, other):\n if self.num_list[0] == 1 and other.num_list[0] == 1:\n for i in range(16):\n if self.num_list[i] > other.num_list[i]:\n return False\n ...
[ { "docid": "dc40edfbd546f781334c0fa5d671a49d", "score": "0.75930506", "text": "def __lt__(self, other):\n return self._bin_op(exprs.LessThan, other)", "title": "" }, { "docid": "5976fc52a181995389a1595c4d166478", "score": "0.74743986", "text": "def __lt__(self, other):\n if...
460eb6eef9b9986fcc726ec527d07d89
Waits until the device flash is ready Returns the current device status
[ { "docid": "281770035e286dee04eb8b92d0c4065c", "score": "0.84571934", "text": "def wait_flash(self):\n while True:\n status = self.mdm.status()\n if status & 0x2:\n return status\n time.sleep(0.1)", "title": "" } ]
[ { "docid": "77ddc7ec89ed5ff94a7e838218608c76", "score": "0.6853201", "text": "def wait_for_device_ready(self, label):\n\n emulator_port = str(self.options.get(label)[\"emulator_port\"])\n adb = self.options.avd.adb_path\n\n log.debug(\"Waiting for device emulator-\"+emulator_port+\"...
f158d9c63a8e7e8254e309322fc4772e
Parse all the arguments introduced by command line when executing the detection
[ { "docid": "95a8547e6a58391668a0ba627f2db42d", "score": "0.6842433", "text": "def argument_parsing(self):\n\n # HANDLING ARGUMENTS\n import argparse\n\n parser = argparse.ArgumentParser(description='Process an image and classify human detection.')\n parser.add_argument('-i', ...
[ { "docid": "4aff4e01be456333e94b8b120ccb4a66", "score": "0.80280733", "text": "def parse_args():", "title": "" }, { "docid": "a1ec488ce0a1de8739a4a1d1d7a124ae", "score": "0.75546795", "text": "def parse_and_run(argv):\n \n args = parse_arguments(argv)\n face_detector(args.img_path...
9a0f73db9a0496af2b0eb48a2304326e
Retrieve a tuple with 2 lists. The first list contains all columns which GROUP BY should be applied on. The second list contains the exact elements that should be used in a GROUP BY SQL statement. If no GROUP BY columns exist, return 2 empty lists.
[ { "docid": "c5d47e2321bb4eb0f7e9a9910d166e91", "score": "0.7259239", "text": "def get_group_by_columns(self):\n \n columns = self.get_columns()\n g_by_columns = []\n g_by_elements = []\n for column in columns:\n if column.get_group_by():\n g_b...
[ { "docid": "05883e0f5baca849057181ce0ef10d78", "score": "0.66572136", "text": "def group_by_columns(self):\n grouping = []\n\n for c in self.column_expressions:\n if not self.xquery.is_aggregate_expression(c):\n grouping.append(c)\n return \", \".join(set(g...
f5c58020074c93d84ee7abcc89bd933b
Test Commission model string method, order total and uploaded file directory path
[ { "docid": "a01a7e986f28462ebc6a4f651f519338", "score": "0.5720278", "text": "def test_commission_model(self):\n # Create test file solution found in\n # https://stackoverflow.com/questions/11170425/\n # how-to-unit-test-file-upload-in-django\n image_one = SimpleUploadedFile(...
[ { "docid": "f5c65cc465e5435eda97112db79a1c5e", "score": "0.5865011", "text": "def test_get_file_path(self):\n pass", "title": "" }, { "docid": "f69a28f860c784b7d36d8aa230651d50", "score": "0.5628576", "text": "def test_path():", "title": "" }, { "docid": "b79cdc118...
6d51b429e30f3c0694adf263d252f058
dequeue to new job of a certain pilot
[ { "docid": "ef0a1a14d0444c79f2d8f5f911911bd1", "score": "0.71742123", "text": "def dequeue_job(self, pilot_url):\n return self.subjob_queue.get()", "title": "" } ]
[ { "docid": "8e57e85c2549bdbf0ae8901846329c50", "score": "0.6466433", "text": "def _next_job(self):\n if self.__job_queue:\n # Produce message from the top of the queue\n job = self.__job_queue.pop()\n # logging.debug(\"queue = %s, popped %r\", self.__job_queue, jo...
bb3ee056ec8dd091cf73d94fe2ab5682
Resolves how priors depend on each other and automatically sorts them into the right order. 1. All unconditional priors are put in front in arbitrary order 2. We loop through all the unsorted conditional priors to find which one can go next 3. We repeat step 2 len(self) number of times to make sure that all conditional...
[ { "docid": "f98a32ce6fb13c37cca36f14bf9f6360", "score": "0.611434", "text": "def _resolve_conditions(self):\n self._unconditional_keys = [key for key in self.keys() if not hasattr(self[key], 'condition_func')]\n conditional_keys_unsorted = [key for key in self.keys() if hasattr(self[key], ...
[ { "docid": "0a3164bc5b6e7a2cb7bd1be40986724f", "score": "0.5720859", "text": "def calculate_prereqs(self, metadata, entries):\n prereqs = []\n toexamine = list(entries[:])\n while toexamine:\n entry = toexamine.pop()\n # tuples of (PriorityStructFile, element) ...
3f3f0e1248cde55a0cdd199d739726cc
Print the bins in a given range
[ { "docid": "b6f865f694b2c1716f5ad77ffff5d208", "score": "0.83056146", "text": "def printBins(self, minBin, maxBin):\n pass", "title": "" } ]
[ { "docid": "9469b556c09438c9d9eb3e8fd38d17f2", "score": "0.6799565", "text": "def bin_edges(bins: int, range: Tuple[float, float]) -> np.ndarray:\n return np.linspace(range[0], range[1], bins + 1)", "title": "" }, { "docid": "872b8049934dbeb5e45379fc5b94f47d", "score": "0.66740656", ...
d5cb80cbdb77db95202c81611808d5dd
Changes must be written by the driver.
[ { "docid": "0c9545a443bb4f37f18f4319ee345fa7", "score": "0.0", "text": "def hasChanges(self):\n\n if self.unkown is True:\n return True\n\n for change in self.changes.values():\n if change is not None:\n return True\n return False", "title": ...
[ { "docid": "08485ae4e3d1e474756da21ed6115bd3", "score": "0.758862", "text": "def post_write(self):\n pass", "title": "" }, { "docid": "f24748f9e61020dcbc69ce09072b354f", "score": "0.70349896", "text": "def ready_to_write(self):\r\n\r\n return True", "title": "" },...
19e9b9511152dbdbbf0719398f37de24
Return the metadata of the experiment.
[ { "docid": "7d7358a67929ccfe7cb5f3c60ec3da49", "score": "0.6429164", "text": "def getMetadata(self):\n\n headerStr = ''\n with self.header.open(encoding='utf-8') as f:\n for line in f:\n if line.startswith('#'):\n break\n else:\n ...
[ { "docid": "c06fce8eaa73c463fd7cec0de00f1e57", "score": "0.7997135", "text": "def getMetadata(self):\n import labstep.entities.metadata.repository as metadataRepository\n\n return metadataRepository.getMetadata(self)", "title": "" }, { "docid": "09e5dcfacecd40fe952ad88a1a07ab68...
500b86bc9b8f45d455bdd8a7c4bddd97
Joins the voice channel the invoker is in.
[ { "docid": "22b60e9fbb09af69a0b7f636df3af36d", "score": "0.70100325", "text": "async def c_join(self, source):\n channel = source.author.voice_channel\n\n if not channel:\n await self.bot.send_message(source.channel, '```You are not in a voice channel!```')\n return\n...
[ { "docid": "b6b6dc7f47f7008436f872caf5d0e4f5", "score": "0.7776425", "text": "async def join(self, ctx):\n author = ctx.message.author\n try:\n channel = author.voice.channel\n except:\n await ctx.send(\"You are not connected to a voice channel\")\n ...
cef53450215900cbd2dfe39b4bb8473d
Handles unexpected response code.
[ { "docid": "9d9d0e994ce4a47ead21c74b26a6661b", "score": "0.0", "text": "def test_handle_unexpected(self, mock_Session):\n session_one = self.session(status.USE_PROXY)\n mock_Session.return_value = session_one\n self.app_one.config['BASE_ENDPOINT'] = 'https://fooservice/baz'\n ...
[ { "docid": "c14957dc3aac2c38d5eaedcab6962cc8", "score": "0.7090598", "text": "def test_unexpected_response_status_code(self):\n unsupported_response_data_maker = _ResponseMaker(304)\n connection = _MockConnection(unsupported_response_data_maker)\n\n with assert_raises(UnsupportedRes...
c97408f15f5564a98a20eefa772a8fd3
Return a unique ID to use for this entity.
[ { "docid": "f48ecb5ab053768170bf2c3493fa6b52", "score": "0.0", "text": "def unique_id(self):\n return f\"{DOMAIN}_detection_fps\"", "title": "" } ]
[ { "docid": "14431f5da0eae13aece39fb44f573fb1", "score": "0.87838584", "text": "def unique_id(self):\n return self.entity_id", "title": "" }, { "docid": "14431f5da0eae13aece39fb44f573fb1", "score": "0.87838584", "text": "def unique_id(self):\n return self.entity_id", ...
a87e35196736c34c7ad6e775ebb3e3de
Recreate the (compressed) image from the code book & labels
[ { "docid": "173fbfdac4336fa15df9f4bbd33d4092", "score": "0.78643507", "text": "def recreate_to_image(codebook, labels, w, h):\r\n d = codebook.shape[1]\r\n codebook = [i for i in range(len(codebook))]\r\n image = np.zeros((w, h))\r\n label_idx = 0\r\n for i in range(w):\r\n for j i...
[ { "docid": "bf35b41826181a8b00e5f0160d645dd7", "score": "0.79256207", "text": "def recreate_image(codebook, labels, w, h):\r\n image = np.zeros((w, h, 3))\r\n label_idx = 0\r\n for i in range(w):\r\n for j in range(h):\r\n image[i][j] = codebook[labels[label_idx]]\r\n ...
47db7060c8f231a335444adf4942b987
delete the node with the given data and return the root node of the tree
[ { "docid": "3ba7b9ceb4c4a56a43acd47eda68fb63", "score": "0.78276366", "text": "def deleteNode(root, data):\t \n\tif root.data == data:\n\t\t# found the node we need to delete\n\t\tif root.right and root.left: \n\t\t\t# get the successor node and its parent \n\t\t\t[psucc, succ] = findMin(root.right, ...
[ { "docid": "e8641fe3a6f0866b51336477ed11b9c0", "score": "0.8268588", "text": "def delete(self, data):\n if data not in self :\n raise ValueError(\"No such node exists\")\n # Locate the necessary node\n curr = self.find(data) \n\n # If node is leaf node\n ...
6cfb2664202767b04ea65866135fd3de
Get transcript from inference results
[ { "docid": "3cff952e31dd19f4361da46faa61076f", "score": "0.5847435", "text": "def get_transcript(path, lm=False):\n inf = import_file_path(path)\n if lm:\n return inf['beam transcript']\n else:\n return inf['transcript']", "title": "" } ]
[ { "docid": "d481488f696254547440c2f8d938e20f", "score": "0.637816", "text": "def transcript(self):\n return self._transcript", "title": "" }, { "docid": "df4785917167ac5ffdf710e941147409", "score": "0.62225485", "text": "def get_transcript(self):\n self.latest_voice_tra...
cad166fe34f6ba5101f208a75de3be13
This subcommand from demo execute a nine point example.
[ { "docid": "d22944bca4ae580f68acbbac1a1c0eb0", "score": "0.7618061", "text": "def cli_demo_nine_points_execute(config):\r\n\r\n demo_class = CliDemoNinePointsExecute(config)\r\n demo_class.do()", "title": "" } ]
[ { "docid": "54119dc8984a8186ff787c748aace7c5", "score": "0.7129739", "text": "def cli_demo_nine_points(config):\r\n\r\n pass", "title": "" }, { "docid": "665ead69b503f6511ffbdc971942293c", "score": "0.685722", "text": "def cli_demo_nine_points_train(config):\r\n\r\n demo_class ...
fb37ca1d61554a4d2bad50d4465d008e
Setter method for lsp_has_secondary, mapped from YANG variable /mpls_state/lsp/basic/lsp_has_secondary (boolean)
[ { "docid": "a592b2c4162ae81a992f4296c099cf9d", "score": "0.8601844", "text": "def _set_lsp_has_secondary(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-has-secondary\", rest_name=\"lsp-has-seco...
[ { "docid": "07e4a545588eb8617130c51da840f883", "score": "0.7510318", "text": "def _get_lsp_has_secondary(self):\n return self.__lsp_has_secondary", "title": "" }, { "docid": "5aa5127cb6235c5b1f13771b55734dbc", "score": "0.74474293", "text": "def _set_lsp_has_selected_secondary(sel...
ceefc8a3a4e7666dca210ea9a9d7c681
Dispose all the pages.
[ { "docid": "26e1794e515ce2340522b58ebaef3c87", "score": "0.880068", "text": "def dispose_pages(self):", "title": "" } ]
[ { "docid": "9db0ea4e5416e2cd73b51636fe724256", "score": "0.69985336", "text": "def clear_window(self):\n for p in self.pages:\n p.destroy()", "title": "" }, { "docid": "841387b850d071f7e03110b75c2c5bcc", "score": "0.67682207", "text": "def dispose(self):\n fo...
6c434ed1379042c7d22990a75cccc97f
test step for a minibatch and always center crop window
[ { "docid": "a1547d1ff9ac3394fdb122e88805fc3f", "score": "0.0", "text": "def test_step(self, x, y, metrics, training=False):\n if self.crop == True:\n x, y = center_crop(x, y, int(self.window_size))\n y = bin_resolution(y, self.bin_size)\n elif self.crop == False:\n ...
[ { "docid": "085f7c8056aa5037a8ed48334192fd4a", "score": "0.60580826", "text": "def test_center_crop_negative_margin(self):\n data = np.ones((8, 4, 30, 30, 30))\n seg = np.ones(data.shape)\n crop_size = np.array([36, 40, 16])\n data_cropped, seg_cropped = center_crop(data, cro...
d5fc4b0325e69d8fee7fea8317d67644
Convert an HTML string to a Latex string.
[ { "docid": "e8cc06b168b17c5d42ea61c8e275851a", "score": "0.70828", "text": "def html2latex(value):\n return mark_safe(pypandoc.convert_text(value, 'tex', format='html'))", "title": "" } ]
[ { "docid": "3d31ad4fc7780e43212af90d081ccf32", "score": "0.7563371", "text": "def html2latex(html_text):\n html_text = html_text.replace(\"<strong>\", \"\\\\textbf{\")\n html_text = html_text.replace(\"</strong>\", \"}\")\n html_text = html_text.replace(\"<code>\", \"$\")\n h...
c2f62bc2c6d4c0d706c7f804eeec2176
Draw a 2D histogram showing the bin boundaries for the indicated TH2Polystyle binning unrollBins should be a tuple (xbins, columns)
[ { "docid": "91e4354128bb8f959e42b2899db1d430", "score": "0.72139156", "text": "def drawUnrolledBinMapping(c, unrollBins, xtitle=\"\", ytitle=\"\", printstr=\"\", printdir=\".\"):\n\n #make temporary TH2Poly\n poly = macro.makeTH2PolyFromColumns(\"Temp\", \"\", unrollBins[0], unrollBins[1])\n #s...
[ { "docid": "ad6ba2e4082c366878508491dbe0dbb9", "score": "0.6734064", "text": "def makeHistogram(values, numBins, xLabel, yLabel, title=None):", "title": "" }, { "docid": "ee15d75f0b004f1f6471f6a00da211e9", "score": "0.6713821", "text": "def unroll2DHistograms(hists, xbins=None, cols=...
69a0bb1268c2882e75bf3fe57162160d
builds a tensorflow graph that represents the network.
[ { "docid": "cbb1875de26ab1d82daaf16232d5e7e5", "score": "0.7172934", "text": "def build_network_with_tf(self):\n input_dim = self.input_dim\n if self.number_of_dimensions_of_input == 1:\n x = tf.placeholder(shape=[None, input_dim], dtype=tf.float32, name=\"input_placeholder\")\n...
[ { "docid": "8b0952ff7416489860b0c07e199b8409", "score": "0.7677023", "text": "def _build_graph(self):\n\n self.graph = tf.Graph()\n with self.graph.as_default():\n # dtype is stored as a string so that it can easily be saved/reloaded with the model. Because of this, we\n ...
c6e43d12be87cb05e2bb5a2cdfc49e2c
Adds an alias with list of values to the channel/value dictionary.
[ { "docid": "83af5144a6da60a66e3cfa14d9e57a9e", "score": "0.51896596", "text": "def add_values(name, values):\n int_values = map(int, values)\n cv_dict[values_key][name] = int_values", "title": "" } ]
[ { "docid": "a8e39d69fa0c37089d4fb40612af8d8e", "score": "0.6566318", "text": "def _add_to_aliases(self, key, value):\n if key not in self._aliases:\n self._aliases[key] = set()\n self._aliases[key].add(value)", "title": "" }, { "docid": "88ee9b09673364781f239880b3d67...
9de03a5a47686fafc7746a79193a2b87
Provide a boost to our craft's velocity in whatever orientation we're currently facing.
[ { "docid": "2f3ceb84c0009fe3991942d252b3c72a", "score": "0.80969983", "text": "def boost(self) -> None:\n if self.fuel <= 0.0:\n return\n self.velocity += helpers.V(magnitude=self.engine_power, angle=self.orientation)\n self.fuel -= self.engine_power\n self.boostin...
[ { "docid": "d9e98a2f5871852f47691525e320376d", "score": "0.70775014", "text": "def setBoostVelocity(self,value):\n self.boost_velocity = value", "title": "" }, { "docid": "52bac5a8c2fee2a290d52ab350f74a32", "score": "0.6838848", "text": "def boost(self, thrust):\n # n oubli...
44a84a445f9ff523d14358a11da0f8cb
Draw Face detection bounding Box
[ { "docid": "bb3a545dbd069256efc45ed742fb596d", "score": "0.61849076", "text": "def draw_detection_roi(self, frame, roi):\n for i in range(len(roi)):\n # Draw face ROI border\n cv2.rectangle(frame,\n tuple(roi[i].position), tuple(roi[i].position + roi[i...
[ { "docid": "646561d6afe7a2df7245e04ab50ed5bd", "score": "0.70830184", "text": "def drawBoxesGetFaces(img, bounding_boxes, facial_landmarks=[]):\n faces = []\n for b in bounding_boxes:\n b = [int(x) for x in b]\n cv2.rectangle(img, (b[0], b[1]), (b[2], b[3]), (0,0,255), 2)\n fa...
a94907ed2f9a0079a16a48db34493880
Zip a pair of PortSet's into a single PortPairs object.
[ { "docid": "b2b1fb52362d601929c7a87d644dbbd0", "score": "0.6560809", "text": "def Zip(cls, local_ports, remote_ports):\n with_dns = local_ports.dns is not None and remote_ports.dns is not None\n return cls(\n PortPair(local_ports.http, remote_ports.http),\n PortPair(local_ports.https, re...
[ { "docid": "235822a4c73171cdcbd2be48d73ee59b", "score": "0.60803455", "text": "def pairwise(iterable):\n a_from_pair, b_from_pair = tee(iterable)\n next(b_from_pair, None)\n return zip(a_from_pair, b_from_pair)", "title": "" }, { "docid": "fc88232ad78a43f1c4c7582b5b45d9b...
2aeacaca50542b7c6675f607ba5357ca
Return site wires that this object is attached too.
[ { "docid": "1404da4b9c07d73970821090dbba3385", "score": "0.7355321", "text": "def site_wires(self):\n return [\n SiteWire(self.site.tile_index, self.site.site_index,\n self.in_site_wire_index),\n SiteWire(self.site.tile_index, self.site.site_index,\n ...
[ { "docid": "20ccbbfd406041948d1922e1f1a76e40", "score": "0.7698001", "text": "def site_wires(self):\n if self.site_wire_index is not None:\n return [\n SiteWire(self.site.tile_index, self.site.site_index,\n self.site_wire_index)\n ]\n ...
ab51133dfabcdb262445e538e232fb26
Generate and return a random EdgeThresholdsGraph that represent an instance of Facility Location problem
[ { "docid": "1873f7e3f0c0264888d4a858cd63b4d9", "score": "0.5422635", "text": "def generate_facility_location_graph(f, c, opening_costs_range, service_costs_range, num_of_edges=None):\n nodes = map(str, range(1, 1 + f + c))\n facilities = nodes[:f]\n clients = nodes[f:]\n\n opening_costs = {f...
[ { "docid": "524ed12c9ea78b561b84345084c935f5", "score": "0.6402077", "text": "def make_random_edge(self):\n random_edge = tuple(random.sample(self.towns, 2))\n return random_edge", "title": "" }, { "docid": "0274a86cfb501bfbdf9f6cfe6ede06c7", "score": "0.6395408", "text...
0f9c2059115a956a9fdbb02daa78ddad
Computes 2dimensional tSNE based on n_pcs principal components of a given principal component space. Usually the spliced RNA space, but extensions to other spaces are trivially implemented by choosing a different PC space.
[ { "docid": "fd1f7e7d61bf0a791eb9b80490be1377", "score": "0.51926935", "text": "def fit_tsne(vlm, pc_space_name, ts_name, n_pcs, seed=None):\r\n bh_tsne = TSNE(random_state=seed)\r\n setattr(vlm,ts_name,bh_tsne.fit_transform(getattr(vlm,pc_space_name)[:, :n_pcs]))", "title": "" } ]
[ { "docid": "5491c8b4ebb48da424b874180acef81f", "score": "0.6279812", "text": "def pcs(pc_las):\n return test_pointcloud.overlap_pcs([pc_las], nx=4, ny=3, overlap=0.5)", "title": "" }, { "docid": "f137f086e3e0486b71655a565c6e5b2c", "score": "0.6053203", "text": "def ECS(Ts, N, nxCO...
b4d4883fbc695336038435c8822a042b
Synthesizes new faces by sampling from the latent vector distribution
[ { "docid": "d7bfabdcfb5b04f5364e7492ea5bd49a", "score": "0.5472448", "text": "def synthesize(eigenfaces, variances, faces_mean, k=50, n=25):\n #Example for Digits\n #sample from distribution of Z\n #np.random(0, np.sqrt(sigma))\n Z = np.random.normal(0, np.sqrt(variances[0:k]), (n, variances[0:k].sh...
[ { "docid": "be2893d80a6f732e1a90abdbee0035a5", "score": "0.5876113", "text": "def update_face_vectors(self, new_face_vectors):\n\n if self.face_vectors is None:\n self.face_vectors = new_face_vectors\n else:\n self.face_vectors = (self.face_vectors + new_face_vectors)...
f2525c2989ac12e3928018736c98f41b
returns a list like self except that all of the leading elements for which predicate is true have been removed. Thus, predicate will be false on the first element of the result; predicate is a function on the elements of self that returns a Boolean.
[ { "docid": "54bf650df26a295c8cc455992c54ce07", "score": "0.7394373", "text": "def dropWhile(self, predicate):\n return EmptyList()", "title": "" } ]
[ { "docid": "63f0bdfbc19aec747d3b0929cfb0d770", "score": "0.753259", "text": "def dropWhile(self, predicate):\n if predicate(self.head()) == True:\n return self.tail().dropWhile(predicate)\n else:\n return ConsList(self.head(), self.tail())", "title": "" }, { ...
a54159c7de72fe39bd63482e717d3810
This method is deprecated. Please switch to Start.
[ { "docid": "e8fe3618db4d2bd361fcf034b8f50f6b", "score": "0.0", "text": "def ArenaSeasonCloseRewardExcelStartRewardParcelUniqueIdVector(builder, numElems):\n return StartRewardParcelUniqueIdVector(builder, numElems)", "title": "" } ]
[ { "docid": "b212c0d233ff8802ffa32d219f15e0c4", "score": "0.70593727", "text": "def start(self):\n pass # pragma: no cover", "title": "" }, { "docid": "bd1c7287f1fc9f895288bd2c05546a5c", "score": "0.7006938", "text": "def start(self):\n pass", "title": "" }, { ...
cd386d43fda0ed62931b0651aa2c4bc6
Releases held token If necessary pauses the current statemachine
[ { "docid": "d512001b0cab2d697af7ea1052d06258", "score": "0.5633814", "text": "def release_token(self, rel_prio):\n\n if self.is_active():\n self.pause_behaviour()\n\n self._token = False\n self.release_pub.publish(rel_prio)", "title": "" } ]
[ { "docid": "b86dc5f2e5e8c8758c994ca965efff9a", "score": "0.70441586", "text": "def release_token(self, token):", "title": "" }, { "docid": "63cd260b777701980b0de31deba7677e", "score": "0.6541842", "text": "def unlock(self):\n \n pass", "title": "" }, { "docid": ...
31e7b59c2072bc9f05826734a3cd16ec
Determine if the PR is generated by Staticman
[ { "docid": "689d4880b3b8d3e32baf0c92bcd9d073", "score": "0.69265985", "text": "def is_staticman(ci_data):\n return ci_data.travis_pull_request_branch[:9] == \"staticman\"", "title": "" } ]
[ { "docid": "78f742588cac257547b4071c3cae08cb", "score": "0.5865069", "text": "def _is_building_documentation():\n return \"DRAKE_IS_BUILDING_DOCUMENTATION\" in os.environ", "title": "" }, { "docid": "d277528db1322b78e0040843574ce35d", "score": "0.58139706", "text": "def project_de...
729fd72140f4d6c86d0ff7e3eaea42a3
on_start is called when a Locust start before any task is scheduled
[ { "docid": "67c364d39fc0d11cae433d46d4ea8252", "score": "0.8461914", "text": "def on_start(locust):", "title": "" } ]
[ { "docid": "504be96883aacab4272b2c0d0c04b30f", "score": "0.83683604", "text": "def on_start(locust):\n pass", "title": "" }, { "docid": "769cb0e6f57ba8da0f1802b416547b84", "score": "0.7444135", "text": "async def on_start_task(self, task):", "title": "" }, { "docid...
d4f826eb0ea88bcdc5a0c01114d29e51
Make a new Adversarial agent with the optional depth argument. (MinimaxAgent, str) > None
[ { "docid": "4b500add2ab1ef25ecf78745e4303826", "score": "0.5415515", "text": "def __init__(self, max_player, depth=\"2\"):\n self.max_player = max_player\n self.depth = int(depth)", "title": "" } ]
[ { "docid": "415b23fe894129f9780316e8ec15eaea", "score": "0.5626437", "text": "def createAgent(self):\n # convert behaviour initialisation\n attr_dict = {}\n for attrs in self.agent_init:\n attr_dict[(attrs[0], attrs[1])] = attrs[2]\n # only a single agent to create...
bfa7de30c255659f52b0761723d25a7e
Delegate your managed_zone to these virtual name servers; defined by the server
[ { "docid": "8982c38a47f8742b0399c57c70573cae", "score": "0.0", "text": "def name_servers(self) -> pulumi.Output[Sequence[str]]:\n return pulumi.get(self, \"name_servers\")", "title": "" } ]
[ { "docid": "2b9de6f0095c4435fd7f078981713661", "score": "0.6076091", "text": "def zones_dnssec(self):\n\n self.add('AUTH', \"zones\", \"dnssec\")", "title": "" }, { "docid": "415a731e30aec3f6f9d2e99f1c5a142b", "score": "0.59958065", "text": "def create_zone(self, context, zone):\n...
9dbdac5a4d1f705163f580a4835a1ab7
WOL an available group
[ { "docid": "009549dc9cd08a92b2db3867935e7c19", "score": "0.6641883", "text": "def wol_group(group_name):\n if not config.get('groups'):\n raise ApiError('No groups configured', status_code=404)\n\n group = config['groups'].get(group_name)\n if not group:\n raise ApiError(f'No grou...
[ { "docid": "cda1cd9f6dc6cee2442bada533edc62a", "score": "0.6424918", "text": "def groups_group():\n pass", "title": "" }, { "docid": "e8a9ad1c322a69cb171062c299be64dc", "score": "0.6032336", "text": "def check_group(self) -> str:\n return None", "title": "" }, { ...
859ec79973e7d97dbee1e55a8b0793c3
Retrieve a zipped file containing all the model contents of a specified model. The project argument is only needed if the model argument is not a valid UUID or RestObj.
[ { "docid": "1169baf35a12a59d10ff3ba1de36bda5", "score": "0.79734606", "text": "def get_zipped_model(\n model: Union[str, RestObj],\n git_path: Union[str, Path],\n project: Optional[Union[str, RestObj]] = None,\n) -> (str, str):\n # Find the specified model and pull down the contents in a zip...
[ { "docid": "cea37830640366a77cc91ad08a1e59b2", "score": "0.69464684", "text": "def get_model_file(root=data_dir()):\n root = os.path.expanduser(root)\n\n os.makedirs(root, exist_ok=True)\n\n zip_file_path = os.path.join(root, ZIP_FILE_NAME)\n if not os.path.exists(zip_file_path):\n do...
0c4c19d06ba4ed038e76e4dbf1ff0b72
Expect to fail to choose unit if request is nonsense. (400)
[ { "docid": "da42955fd95b4724347bdffed67c8f29", "score": "0.7176227", "text": "def test_choose_unit_400(db_conn, session):\n\n create_route_subject_test_data(db_conn)\n request = {\n 'db_conn': db_conn,\n 'cookies': {\n 'session_id': session,\n },\n 'params': {}\n }\n code, response ...
[ { "docid": "25847879ba2a9a0259c641b0db7148d3", "score": "0.70922345", "text": "def bad_request():\n abort(400)", "title": "" }, { "docid": "102d69e182cad3f68d6662c7341866e1", "score": "0.70518553", "text": "def bad_request():\n abort(400)", "title": "" }, { "doc...
7274feeadc97019fffb159bce234f584
This will start a elements regtest and mines a block every miningperiod. If a bitcoind is already running on port 18443, it won't start another one. If you CTRLC this, the bitcoind will still continue to run. You have to shut it down.
[ { "docid": "ae73786e0d5f94b8fa44cede7ad79831", "score": "0.0", "text": "def elementsd(\n quiet,\n data_dir,\n port,\n log_stdout,\n mining,\n mining_period,\n reset,\n create_conn_json,\n cleanuphard,\n config,\n):\n noded(\n \"elements\",\n quiet,\n ...
[ { "docid": "913afdea5dae51e8b5aa41bfdeba60d2", "score": "0.6218326", "text": "def crazy_miner_simulation():\n relaysPorts = [8050]\n masterPort = 9801\n start_master(masterPort)\n start_relays(relaysPorts)", "title": "" }, { "docid": "0ac318082916948f1442935f1818833a", "score...
00cfc9849e1845549ff82569289c5382
Given a url, write it to a new row
[ { "docid": "96a8124f0a41107890bb3c0202a8eacf", "score": "0.6758715", "text": "def add_row(url):\n conn = sqlite3.connect(DB)\n c = conn.cursor()\n c.execute(f\"SELECT * FROM pages WHERE url = ?\", (url,))\n if c.fetchall() or not url.startswith(\"http\"):\n conn.commit()\n conn...
[ { "docid": "79dadf158ff103df8cdf5902ad64c256", "score": "0.7318951", "text": "def write_url(title, url):\n conn = sqlite3.connect(DB_FILE)\n c = conn.cursor()\n t = (title, url)\n c.execute('INSERT INTO url_history VALUES (?, ?)', t)\n conn.commit()\n conn.close...
874c69db24cd5e15ae31803e13dd6645
Return start and end token for spacy Doc, Span or Token part of self.hyp and self.ref
[ { "docid": "bc4c842e8065bfdd5f45b24c888f8e3d", "score": "0.8575066", "text": "def start_and_end_token(self, hyp, ref):\n\n if isinstance(hyp, spacy.tokens.Doc) and isinstance(ref, spacy.tokens.Doc):\n hyp_start, hyp_end = hyp[0].i, hyp[-1].i\n ref_start, ref_end = ref[0].i, ...
[ { "docid": "300ed0b4db0bcbfd81a6a04224e02c53", "score": "0.6341767", "text": "def token_index_span(self) -> Tuple[int, int]:\n return self.token_start_index, self.token_end_index", "title": "" }, { "docid": "b7b389adf3bbfcfecf861751d5932f2b", "score": "0.5975561", "text": "def...
102bc91966a43e1a4e7d6b65d46ee719
Rename the series in the database.
[ { "docid": "b44def9da3e7f15a4b0173ad9c1ea00a", "score": "0.0", "text": "def rename(self, new):\n keys = list(self.keys())\n keymap = zip(keys, new.keys())\n if len(keymap) != len(keys):\n raise errors.RecordError(\"Key mismatch in new Records instance\")\n\n with s...
[ { "docid": "9135e8e601243e562f3fd712836b3734", "score": "0.66254634", "text": "def rename(self, new_name):\r\n self.table.rename_chain(self.name, new_name)", "title": "" }, { "docid": "cf0d6c4a9c35b51e674f67ff206ef301", "score": "0.6326434", "text": "def rename(self, index=Non...
0c17c44846a5b46c3cecf2dfc983dc19
Initialize a NLK object
[ { "docid": "d23a6705a1331e75f1ab6df9e692e8f9", "score": "0.0", "text": "def __init__(self, positions=None, current=1850):\n if positions is not None:\n wire_positions = positions\n else:\n wire_positions = _np.zeros([2, 8])\n s1 = _np.array([1, -1, 1, -1])\...
[ { "docid": "2f87117454aee892015d71c2c4258d70", "score": "0.6765631", "text": "def __init__(self, k):\n self.maxIter = 50\n self.trained = False\n self.k = k\n self.centroids = None", "title": "" }, { "docid": "3e0e7cde4bad11b880000e7ec10e637f", "score": "0.664...
0a5b73111c2a021da419298df49c78fd
r""" Return an iterator on the binary trees forming a longest chain of ``self`` (regarding ``self`` as an interval of the Tamari lattice).
[ { "docid": "c6b0ae29b42fb71f2682a497776a7d23", "score": "0.71699774", "text": "def maximal_chain_binary_trees(self):\n for it in self.maximal_chain_tamari_intervals():\n yield it.lower_binary_tree()", "title": "" } ]
[ { "docid": "f3743287cf1a2e951fe13c0e05871d5f", "score": "0.66229737", "text": "def __iter__(self):\n leaf_paths, leaf_vals = self._find_combinatorial_leaves()\n return self._combinations_generator(leaf_paths, leaf_vals)", "title": "" }, { "docid": "415f19d616796209e228930349ada...
561883f1dc1816baa76323eb841bfcba
Generate indices for a cross validation (XV) split, given ids of samples, or just number of samples
[ { "docid": "05141023165e9390ce47af5083e2eb59", "score": "0.68206316", "text": "def generate_split_indices(samples_ids, seed, split_ratios):\n samples_ids = np.array([samples_ids]).astype(int).flatten()\n\n if samples_ids.size == 1:\n samples_ids = np.array(range(samples_ids[0])).astype(int)...
[ { "docid": "188084aa844ff27c527ac6aff1886226", "score": "0.6551422", "text": "def _get_train_idx(self):\n len_list = [len(df) for df in self.df]\n \n bz_t = self.bz//len(len_list)\n batch_num = [x//bz_t for x in len_list]\n\n batch_nth = [0] * len(len_list)\n\n ...
8959b9646383649cafb36946b0307427
Saves a grid of generated digits ranging from 0 to n_classes
[ { "docid": "7833d9eaa358de18dcefde968aee5307", "score": "0.0", "text": "def sample_image(gen, batches_done, n_row=10):\n # Sample noise\n z = Variable(FloatTensor(np.random.normal(0, 1, (n_row ** 2, args.latent_dim))))\n # Get labels ranging from 0 to n_classes for n rows\n labels = np.array...
[ { "docid": "110eaff6a65ed8c372828e34ef2c7685", "score": "0.6237407", "text": "def process_grid(df_train, df_test, th, n_cells):\n preds = np.zeros((df_test.shape[0], 3), dtype=np.int64)\n\n for g_id in range(n_cells):\n if g_id % 100 == 0:\n print('iter: %s' % (g_id))\n\n ...
eaf8886c7317830e71ff2ab090304674
Create a dictionary of the roll, mapping formated names ('lastfirstmiddle') to names.
[ { "docid": "be3ea650cc9ed303eb29699afba86b9e", "score": "0.67195386", "text": "def _createRollDict(self, roll):\n\n roster = {}\n sections = {}\n with open(roll, 'rb') as f:\n reader = csv.reader(f, delimiter=',')\n reader.next()\n reader.next()\n ...
[ { "docid": "a251cd47d25e07380fca6436319eb798", "score": "0.5616474", "text": "def parse_name(name):\n GENERATIONAL_TITLES = ['jr', 'jr.', 'sr', 'sr.']\n d = {}\n try:\n for i in range(1, len(name)):\n d[\"last\"] = name[-i].replace(',', '')\n if d[\"last\"].lower() ...
83dcbcb2cb2463033b6def2d5357e55e
Iterate once over the whole XML, create a lookup of all images that reference a particular parent post. A parent post may have zero or more image URLs.
[ { "docid": "2e8a2aad1119b030b3f819e6f4d3ba0e", "score": "0.5839193", "text": "def retrieve_attachment_urls_for_all_postids(attachment_docroot=docroot):\n the_list = {}\n for attachment_item in attachment_docroot.findall('channel/item'):\n if attachment_item.find(ns('wp', 'post_type')).text ...
[ { "docid": "8bd2d9718cc7515a7d0d5dcf44d9911a", "score": "0.5659315", "text": "def find_image_nodes(doc, result):\n\n if (doc['type'] == 'img') or \\\n ((doc['type'] == 'html_element') and (doc['value'] == 'img')):\n alt = doc['attr'].get('alt', '')\n result.append({'alt': alt, 'sr...
467066e1a6e6fdaa24fc7e4e229019bf
Obtain frame data from serialized representation
[ { "docid": "76fb5743f0169d13f584106e066b6a8a", "score": "0.0", "text": "def _process_frames(dataset_info, example):\n frames = tf.concat(example['frames'], axis=0)\n frames = tf.map_fn(_convert_frame_data, tf.reshape(frames, [-1]), dtype=tf.float32, back_prop=False)\n img_dims = (dataset_info.f...
[ { "docid": "7c21e82ac455e82be0857447b3834c43", "score": "0.6352675", "text": "def record_data_frame(self):\n return self._record.data_frame", "title": "" }, { "docid": "11ee3a44dfa43ddb787734627b3b83e4", "score": "0.634195", "text": "def dataFrame(self):\n return self._...
10b138e27f0f15442e2b31fa84fac6b6
The function append a Node at the end of LinkedList
[ { "docid": "154a0a3cdbc4d4728e46082537414619", "score": "0.72198534", "text": "def right_append(self, input):\n # empty linked_list\n if not self:\n self.head = Node(input)\n else:\n cur_head = self.head\n while cur_head.pointer_next is not None:\n ...
[ { "docid": "478983894129ed1c1d31cfaedbd16379", "score": "0.79091364", "text": "def append(self,n):\n temp = self.head\n if temp == None:\n self.head = n\n else:\n while temp.next != None:\n temp = temp.next\n temp.next = n\n ...
9a78be2146dc87b9178f673daad470a9
Redefinition of parse_rmc to save the time
[ { "docid": "b39fd47071c05fd3d3343fe51c48278c", "score": "0.6712352", "text": "def parse_rmc(self, string_data, save=True):\n if ':' in string_data:\n string_data = string_data.split(':')[1]\n rmc_data = super(PerlanParser, self).parse_rmc(string_data, save)\n if rmc_data:...
[ { "docid": "b9deee1ba432274a9a1c8c967c8732dc", "score": "0.6551649", "text": "def _Parse(self):", "title": "" }, { "docid": "b9deee1ba432274a9a1c8c967c8732dc", "score": "0.6551649", "text": "def _Parse(self):", "title": "" }, { "docid": "bc1e6ad05a9057784cf33ea3f8462417",...
06b6e8bc2523b7b18cdc01a18d3612be
Read Excel (XLSX) file exported from JCU StaffOnline and get all students and their subjects
[ { "docid": "fc39824c2e358b46160c2282f2268c24", "score": "0.7414024", "text": "def get_student_data(filename=STUDENT_FILE):\n class_workbook = xlrd.open_workbook(filename)\n class_sheet = class_workbook.sheet_by_index(0)\n # map student emails to list of subjects in a dictionary (campus doesn't ...
[ { "docid": "74b58c507ca911310ccb520a92ea174c", "score": "0.5900893", "text": "def parse_students(self):\n _student_list = pd.read_excel(self._STUDENT_LIST_PATH, skiprows=12)\n _student_list = _student_list.drop(axis=1, labels=[\"Unnamed: 3\", \"Unnamed: 5\", \"Unnamed: 6\"]).iloc[:, 2:]\n ...
2e04fbe8403da1cd960b4f32f58e2765
Update any internals given that electron e moved to epos. mask is a Boolean array which allows us to update only certain walkers
[ { "docid": "73af38a496c43edc4c7131fd9b259d9f", "score": "0.68341744", "text": "def updateinternals(self, e, epos, mask=None):\n # MAY want to vectorize later if it really hangs here, shouldn't!\n\n s = int(e >= self._nelec[0])\n if mask is None:\n mask = [True] * epos.con...
[ { "docid": "fc9d459ebecb50cbb1c2b6df0baf1784", "score": "0.6291065", "text": "def _update(self, mask):\n if self.reporting:\n for pin in self.pins:\n if pin.mode is INPUT:\n pin_nr = pin.pin_number - self.port_number * 8\n pin.value ...
1cab93539b8b4d4e321515a51acb536f
Convert string to pair limits. e.g. '16' to int range limit.
[ { "docid": "7aa4262320655b2b964e3a541c2a9b04", "score": "0.81002384", "text": "def str_to_pair_limit(in_str):\n if '-' in in_str and ',' in in_str:\n tmp = in_str.split(',')\n in_str = [s for s in tmp if '-' not in s]\n for s in tmp:\n if '-' in s:\n start, end = s.split('-')\n ...
[ { "docid": "4a10da4ff3193eb6c2ce9c3c1aba9d42", "score": "0.6356894", "text": "def _range_split(s: str) -> Tuple[int, int, int]:\n ab = s.split(\"-\", 1)\n nnum_len = len(ab[0])\n a = int(ab[0])\n b = int(ab[-1])\n if a > b:\n a, b = b, a\n b = b + 1\n...
fbc119f3e7437f809c01aac232854d11
construct a variable learning rate over the provided number of epochs
[ { "docid": "c04496f29d776f3208965b3e085b27d9", "score": "0.69680476", "text": "def get_variable_learning_rate(nepochs, lr_start_log=-2,\n break_in=[20, 30, 50]):\n assert len(break_in) >= 1\n\n learning_rate = None\n\n lr = lr_start_log\n if nepochs > sum(break_in) + 1:\n learn...
[ { "docid": "34179d7e72643ceb98ecdc1680e1565e", "score": "0.86148375", "text": "def learning_rate(epochs):", "title": "" }, { "docid": "e46743a98d8ef9ba74ce8ac023439a07", "score": "0.7762184", "text": "def get_learning_rate(self, epoch):\n return", "title": "" }, { ...
fc23371ef12121834b0664f275afd943
Is this a proper HTML snippet?
[ { "docid": "572cb8dcfd7055ba8dc98dd680267962", "score": "0.0", "text": "def com_google_fonts_check_description_valid_html(descfile, description):\n passed = True\n\n if \"<html>\" in description or \"</html>\" in description:\n yield FAIL,\\\n Message(\"html-tag\",\n ...
[ { "docid": "aa0699a7e573edc0889acf2ddfbe5446", "score": "0.73903984", "text": "def _html(self):", "title": "" }, { "docid": "8a3a2173df8611fb872f641d781a062e", "score": "0.71077365", "text": "def html(self):\n pass", "title": "" }, { "docid": "88e1535689d428dba9e60...
3d6e1893481eafc0b8bd8f3965dc888a
Returns a PCollection of 'SUCCESS' or 'FAILURE' results from generating SkillOpportunityModel.
[ { "docid": "0d4a9c719e889d24a86c568b467cffa2", "score": "0.60505646", "text": "def run(self) -> beam.PCollection[job_run_result.JobRunResult]:\n question_skill_link_models = (\n self.pipeline\n | 'Get all non-deleted QuestionSkillLinkModels' >> (\n ndb_io.GetM...
[ { "docid": "ca291b95741703ce26ba969c798a6365", "score": "0.67145866", "text": "def run(self) -> beam.PCollection[job_run_result.JobRunResult]:\n skill_opportunity_model = (\n self.pipeline\n | 'Get all non-deleted skill models' >> ndb_io.GetModels(\n opportuni...
0a61c6a7b417b6944636e25161a7cbee
Get output file and list of directories from where we should read data
[ { "docid": "f9b863c4e7c59aee9ff91b58c062cc96", "score": "0.5720874", "text": "def main():\n if len(sys.argv) < 3:\n print \"Usage: %s output_file dir1 [dir2 dir3... dirn]\" % (sys.argv[0])\n sys.exit(1)\n\n output_file = sys.argv[1]\n dirs = sys.argv[2:]\n for input_dir in dirs...
[ { "docid": "a2872d1c38211cab387162f14b9c43a8", "score": "0.6767316", "text": "def get_output_files(data_dir):\n return glob.glob(data_dir + \"**/*.out\")", "title": "" }, { "docid": "bf63d6d8f717f9871a397d5fdd1b6ece", "score": "0.66384065", "text": "def out_files(self):\n r...
22aef6579af487ef0e84610749b15a97
Returns the contents of the input files
[ { "docid": "0e01ae512e7f330929d4e746070731ce", "score": "0.0", "text": "def reed_files(stud_file, room_file):\n if is_file_exists(stud_file):\n with open(stud_file, 'r') as file:\n students = json.load(file)\n if is_file_exists(room_file):\n with open(room_file, 'r') as fi...
[ { "docid": "7db871e5fdd8ed4d231cccab379c5677", "score": "0.7194773", "text": "def inp_readall() -> str:\n with open(input_filename()) as f:\n return f.read()", "title": "" }, { "docid": "7d5d054142d322ccec5a83205f7b4b04", "score": "0.70207864", "text": "def read_input():\n ...
6df52353bb5dc56491dcf89d13e6be30
Create the cluster at the given `data_directory` using the provided keyword parameters as options to the command. `command_option_map` provides the mapping of keyword arguments to command options.
[ { "docid": "dbb2e98bf07779a55ed513ec2fd63e51", "score": "0.47324774", "text": "def init(self,\n\t\tpassword = None,\n\t\ttimeout = None,\n\t\t**kw\n\t):\n\t\tinitdb = self.installation.initdb\n\t\tif initdb is None:\n\t\t\tinitdb = (self.installation.pg_ctl, 'initdb',)\n\t\telse:\n\t\t\tinitdb = (initdb...
[ { "docid": "8b121346c76f2784153a676b050f02bf", "score": "0.5405217", "text": "def run_cluster(*data):\n work_dir = dd.get_work_dir(data[0][0])\n out_dir = os.path.join(work_dir, \"seqcluster\", \"cluster\")\n out_dir = os.path.abspath(safe_makedir(out_dir))\n out_file = os.path.join(out_dir,...
862210e1c0026b7c26e94091e641e274
Middle 3 + Last 3 + first 3
[ { "docid": "78da2da9cfab4d84efd373500fc06159", "score": "0.53523904", "text": "def mid_last_first(seq):\n if len(seq) > 1:\n if type(seq) is tuple:\n mid_last_first_v = (*seq[int(len(seq)/3):int((len(seq)/3)*2):1], *seq[-int(len(seq)/3)::1],\n *seq[:in...
[ { "docid": "1763566f9e83bc5eb73e688a6e6caa08", "score": "0.65921575", "text": "def middle(li):\n return li[1:-1]", "title": "" }, { "docid": "240172c41b86105d86fe8da7ab8b4341", "score": "0.64002675", "text": "def middle(t):\n return t[1:-1]", "title": "" }, { "docid...