query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
1ad8b2bda71c27dd30959fac0f57aaa8
Finds the shortest path through a weighted graph using a heuristic. Used for planning & pathfinding in low dimension spaces.
[ { "docid": "337086241106fd93d954e33e0b7111a4", "score": "0.6438782", "text": "def a_star(start_vertex, adjacent, cost, heuristic, goal, max_depth=None):\n if max_depth is not None and max_depth <= 0:\n raise ValueError(\"Argument max_depth must be greater than zero\")\n\n class InternalNode...
[ { "docid": "5478766196043feca0d87a016cf5f766", "score": "0.7408174", "text": "def shortest_path(graph, distances, visited_set, use_heuristic=False):\n n_list = []\n h = 0\n for name, dist in distances.items():\n if name not in visited_set and dist != float('inf'):\n if use_heu...
0de9fca772bfb65735c5d9615ad30b7f
store decoded instruction, prepare for next one
[ { "docid": "32f9f6ffb70ceefd08ea42257e2ae3c0", "score": "0.57765085", "text": "def _save_instruction(self, insn):\n self.instructions.append(insn)\n self.cycles = 0\n self.used_words = []\n self.first_address = None", "title": "" } ]
[ { "docid": "251672139dd55cedcb073d1046e8b9c9", "score": "0.66286063", "text": "def _decode(self):\n try:\n ip = self.getReg(self.REG_IP)\n return Instruction.decode(self)\n except InstructionError, e:\n raise ProcessorError(ip, \"error decoding instruction: %s\" % e)", "title": ...
45a4339872939e50f1b9f5e7efc859c3
Return the metadata of the requested table
[ { "docid": "587eaf079abab28e435c2b2b70d0eb05", "score": "0.67164326", "text": "def table_info(request, name=None, get_table_size=False):\n\n try:\n if name is None:\n return JsonResponse({\n 'success': False,\n 'err': \"Invalid table name\"\n ...
[ { "docid": "3fb576fc72d1a4763e97ad9a7ca78b31", "score": "0.7701821", "text": "def _metadata_table(self):\n return _make_metadata_table(self)", "title": "" }, { "docid": "609a06854c7b48a6deecaa33488245e4", "score": "0.76902467", "text": "def get_table_metadata(self):\n r...
4a18047a82e15e9da2c85135e680c633
Get the best ARIMA model.
[ { "docid": "0282a9f33bdc11ac5c8b5843ba0d9963", "score": "0.7164151", "text": "def get_best_model(self):\n return self.auto_est.get_best_model()", "title": "" } ]
[ { "docid": "d8842cd0d2022b7bbda5c575f8abd437", "score": "0.6984959", "text": "def ARIMA_model(training_data,exogenous_value,order):\n\n arima_model = sm.tsa.statespace.SARIMAX(endog=training_data.values, exog=exogenous_value, order=order).fit()\n \n return arima_model", "title": "" }, {...
ac4a70a179548769a54b4e8bcda2a33e
max Informationbased Nonparametric Exploration.
[ { "docid": "e66a409de6378bd34be549f1e3ec9e89", "score": "0.0", "text": "def mic_test(self, inputs):\n # init\n mic_matrix = np.full(\n (self.num_features, self.num_features), np.nan)\n sign_matrix = np.zeros(\n (self.num_features, self.num_features))\n\n ...
[ { "docid": "b1786dfbdc9d9be4ed12f80d58b1acee", "score": "0.6003945", "text": "def _argmax(self, params, **kwargs):\n raise NotImplementedError", "title": "" }, { "docid": "ceef1e74a0096d55b64ef192415892ef", "score": "0.598692", "text": "def max(input, dim):\n pass", "ti...
e27c418436ca52894e43d72ed2eed4f1
Computes the accuracy over the k top predictions for the specified values of k
[ { "docid": "1fb344a00114e8ceae403851687e0b81", "score": "0.7847017", "text": "def accuracy(output, target, topk=(1,)):\n with torch.no_grad():\n maxk = max(topk)\n batch_size = target.size(0)\n\n _, pred = output.topk(maxk, 1, True, True)\n pred = pred.t()\n correct...
[ { "docid": "092b204d6f194e96b85acc310eb7d8eb", "score": "0.8249487", "text": "def accuracy(output, target, topk=(1,)):\n maxk = max(topk)\n batch_size = target.size(0)\n\n _, pred = output.topk(maxk, 1, True, True)\n pred = pred.t()\n correct = pred.eq(target.view(1, -1).expand_as(pred))\...
264d245dad9dd026a02a3524d8c95b3e
Kill the previously started Quixote server.
[ { "docid": "ae941954f9eabbecaef43c4c42270d0b", "score": "0.0", "text": "def kill_server():\n global _server_url\n if _server_url != None:\n try:\n fp = urllib.urlopen('%sexit' % (_server_url,))\n except:\n pass\n\n _server_url = None", "title": "" } ]
[ { "docid": "271d9573d0475ee33c60157648dadab6", "score": "0.7437033", "text": "def kill():\n return Server.kill()", "title": "" }, { "docid": "1857b1c801e91961f9d85a091702b042", "score": "0.7063344", "text": "def killServer():\n if TikaServerProcess:\n try:\n o...
870b64780dfa182edf12e4df39653c90
Smooth the data with von Mises functions
[ { "docid": "fdf5009c7e87693ef95b73de8a36878e", "score": "0.632402", "text": "def vonmises_smoothing(self, **kwargs):\n return self.component_fitting(mode='vonmises', **kwargs)", "title": "" } ]
[ { "docid": "5babe5be0badb185409d0cd539883ea3", "score": "0.5696802", "text": "def smooth(values, dt, tau):\n result = np.empty(len(values))\n result[0] = values[0]\n weights = np.exp(-dt / tau)\n for i in range(1, len(values)):\n result[i] = weights[i] * result[i - 1] + (1 - weights[i...
e7b7cfb0d91468ec87cc607502d3d264
Parse specification in the specification YAML file.
[ { "docid": "1ddd55b5916bf21eab1a67ee8e2b71de", "score": "0.7328811", "text": "def read_specification(self):\n try:\n self._cfg_yaml = load(self._cfg_file)\n except YAMLError as err:\n raise PresentationError(msg=\"An error occurred while parsing the \"\n ...
[ { "docid": "427c032eef2b4c90af30cbfcb501e46f", "score": "0.65131885", "text": "def fileToSpec(file):\n\n stream = open(file, 'r') if file is not None else sys.stdin\n return Specification(yaml.load(stream))", "title": "" }, { "docid": "77bdebc986d9400600856c6fb64388c2", "score": "0...
cb0ddeca3dc7638e06e9b469917ee008
Returns the string representation of the model
[ { "docid": "0f283634439620e9ecd215d87804ec00", "score": "0.0", "text": "def to_str(self):\n return pprint.pformat(self.to_dict())", "title": "" } ]
[ { "docid": "aa510b1d67cd504f00d31d7600881756", "score": "0.8602374", "text": "def _repr_model_(self):\n return str(self)", "title": "" }, { "docid": "0fbfd148e937420716433d412dc3b6bf", "score": "0.85093755", "text": "def __str__(self):\n\n return str(self.model)", "...
8cf8965b43b8078af4ecb4b9011ddce9
Sets the com_adobe_granite_dropwizard_metrics of this ComAdobeGraniteApicontrollerFilterResolverHookFactoryProperties.
[ { "docid": "b9ae26c2fabe116fd5b071ee4d5f46af", "score": "0.6842898", "text": "def com_adobe_granite_dropwizard_metrics(self, com_adobe_granite_dropwizard_metrics: ConfigNodePropertyString):\n\n self._com_adobe_granite_dropwizard_metrics = com_adobe_granite_dropwizard_metrics", "title": "" }...
[ { "docid": "5237d670163db01b323ffb3fb5e1c006", "score": "0.64473355", "text": "def set_metrics(self):\n pass", "title": "" }, { "docid": "e0ce85d34ef93a98035a9f9937453ade", "score": "0.60261935", "text": "def com_adobe_granite_dropwizard_metrics(self) -> ConfigNodePropertyStri...
9f51ea2ac5634ec1411934d9594f7912
Get counts of how many images are of each category for singlelabel classification, and (optionally) plot a histogram of counts. csv_file must be in form below. If csv does not have a header row with column names, then set skip_first=False.
[ { "docid": "4df68d23c91c6350ab90cc0a2db2ec12", "score": "0.83755827", "text": "def get_cat_counts(csv_file,skip_first=True,plot_hist=True):\n \n if skip_first == False: \n df = pd.read_csv(csv_file, names = ['img_name','category'])\n if skip_first == True: \n df = pd.read_csv(csv_...
[ { "docid": "4622c558732975aebb15df0e63ccfd57", "score": "0.59433186", "text": "def generate_category_labels_from_csv(csv_dir):\n categories = {}\n df = pd.read_csv(csv_dir)\n\n for row in df.itertuples():\n categories[row[1]] = row[2]\n return categories", "title": "" }, { ...
c5a655b906dda30ad96710b528390928
project Vector onto TransCom regions
[ { "docid": "e227b2e3424294691783bd382df97a96", "score": "0.0", "text": "def vector2tc(self, vectordata, cov=False):\n\n M = self.tcmatrix\n if cov:\n return np.dot(np.transpose(M), np.dot(vectordata, M))\n else:\n return np.dot(vectordata.squeeze(), M)", "t...
[ { "docid": "8ad5bad2918b718686e9f9f86502b8d0", "score": "0.66207576", "text": "def translate(self, vec):\n vec = toKiCADPoint(vec)\n for drawing in self.board.GetDrawings():\n drawing.Move(vec)\n for footprint in self.board.GetFootprints():\n footprint.Move(vec...
3b234e0e1778749fcf491ff4b7f7ca78
Test fma as str_floatnum_floatnum_str for invalid integer array Array code d.
[ { "docid": "3bf97e6bdacdd1cfd5a82f80fb09bc30", "score": "0.0", "text": "def test_fma_invalid_param_str_floatnum_floatnum_str_1306(self):\n\t\t# This version is expected to pass.\n\t\tarrayfunc.fma(self.floatarrayx, self.floatnumy, self.floatnumz, self.floatarrayout)\n\n\t\t# This is the actual test.\n\t...
[ { "docid": "23478df374aff5d6fc56718d28b5f6d7", "score": "0.813768", "text": "def test_fma_invalid_param_intarray_intarray_str_floatnum_616(self):\n\t\t# This version is expected to pass.\n\t\tarrayfunc.fma(self.floatarrayx, self.floatarrayy, self.floatarrayz, self.floatarrayout)\n\n\t\t# This is the act...
c08c0ec5a4b64a882c6fc119f5bdfc3d
Request a token from service
[ { "docid": "f9d8e22cb53b8dc916d04b680d731cf2", "score": "0.70175856", "text": "def request_token(self):\n token_url = 'https://uaa.%s/oauth/token' % self.url\n headers = {\n 'accept': 'application/json',\n 'authorization': 'Basic Y2Y6'\n }\n params = {\n...
[ { "docid": "d80d4585dd37923bedbd7e387d3b3c0f", "score": "0.71444774", "text": "def _token_request(self, request):\n\n if not self._client.token_endpoint:\n return None\n\n logger.debug('making token request: %s', request)\n client_auth_method = self._client.registration_r...
1d7b961c4d756a1399b3a684b2970aa4
Vypise intervalove a bodove odhady a vrati je jako seznam.
[ { "docid": "44e2ae3e49eff67b9fb8472bb5a35fc1", "score": "0.0", "text": "def report(lkhd):\r\n\r\n ind = min_coord(lkhd)\r\n maxmin = bounds_coord(lkhd)\r\n print('Odhad alfa je {:.1f} a lezi v intervalu {:.1f} az {:.1f}'.format(\r\n alfa[ind[1]], np.amin(alfa[maxmin[1, :]]), np.amax(alfa...
[ { "docid": "4dba9c6fe59a97d18ff90d5380eee0ed", "score": "0.6994862", "text": "def interval(self):\n return self.__interval", "title": "" }, { "docid": "abf75eb67d30f8eb092840890ba092db", "score": "0.69546163", "text": "def get_interval(self):\n raise NotImplementedError('Im...
4c3ea5f57e7fba027a51a350dc39a2c3
Initialize the record, along with a new key.
[ { "docid": "cf8eccd5cbe67c3396ccd2fc2c6a72eb", "score": "0.7322634", "text": "def __init__(self, *args, **kwargs):\r\n record.Record.__init__(self, *args, **kwargs)\r\n self.key = UserKey()", "title": "" } ]
[ { "docid": "9f83103fd350a79e82cf1005d868d1e8", "score": "0.7128397", "text": "def test_init(self):\r\n fake_key = partial(Key, \"Eggs\", \"Bacon\")\r\n keys = [fake_key(str(uuid.uuid1())) for x in range(10)]\r\n rs = sets.KeyRecordSet(keys, Record)", "title": "" }, { "do...
17ab4bad13651f35c6e6f6dd301a6c2e
Function used the evaluation values of a ndeval result file
[ { "docid": "5a2a617339fd18521cf95d513b36c691", "score": "0.0", "text": "def extract_ndeval(fields_order, evaluation_file):\n\t# Reading the evaluation line\n\tline = evaluation_file.next()\n\n\t# Creating a dictionnary to the evaluation values from the score fields and the current line scores\n\tquery_e...
[ { "docid": "fbe1c46ad4fcda03d97ace45f90a2225", "score": "0.67118865", "text": "def evaluate(self, include_fileset=False):", "title": "" }, { "docid": "4d55883f629ee2dbfe0f7971e66f7607", "score": "0.64297915", "text": "def compile_results(self):\n\n\t\t# highly performant code\n\t\tma...
85832575005847dd2e7a417403fc5077
initialize some example perfdata values
[ { "docid": "2c13da305dee4caf21e277503dbac08c", "score": "0.759437", "text": "def setUp(self):\n\n self.perfdata = []\n self.perfdata.append(PERF1)\n self.perfdata.append(PERF2)\n self.perfdata.append(PERF3)\n self.perfdata.append(PERF4)\n\n self.valid_timestamps...
[ { "docid": "99aad547ec6852fbb8815e8d21a811d8", "score": "0.70477575", "text": "def bench_initialize_data():\n return loaddata(ns, name, data, (0,0,0))", "title": "" }, { "docid": "102869a1a4cb6e2df119fa3c6ca121d8", "score": "0.6749036", "text": "def setUp(self): \n self...
60307ba7af660df799ca16892d1c3d96
Force a dependency texture to render immediately
[ { "docid": "c989829526008705e68dc27b33ec1a70", "score": "0.6691529", "text": "def renderDependency(self, dep):\n if not dep.hasRenderState():\n dep.attachRenderState(self.rstate)\n dep.viewport.configureOpenGL()\n dep.drawFrame()\n assert(dep.rendered)", "title...
[ { "docid": "4755d787a7f1c6803e2f74285aef7817", "score": "0.61700636", "text": "def preRenderUpdate(self):\n self._neighborBuffers[self.currentIndex[0]].setActive(False)\n self._resolveBuffer.setShaderInput(\"lastTex\",\n self._neighborBuffers[self....
ec81f3492a646512203d20127819cc35
while a GUEST user is connected GC will not remove none of its projects nor the user itself
[ { "docid": "e05592dcc37128643debb195e9757a51", "score": "0.5476483", "text": "async def test_t1_while_guest_is_connected_no_resources_are_removed(\n disable_garbage_collector_task: None,\n client: TestClient,\n socketio_client_factory: Callable,\n aiopg_engine: aiopg.sa.engine.Engine,\n t...
[ { "docid": "664815eaee10249845f72ab0dcc66027", "score": "0.6786619", "text": "def cleanup(self):\n\n LOG.info('Cleaning up user accounts')\n for u in self.user_manager.iterator():\n LOG.info('User: %s' % u.username)\n\n u_projects = u.api.projects.list()\n ...
aca8b0b191781ab46894f7e7536a5683
Function called by referee to inform internal players that they have won a single game of Fish. Since this is not an interaction specified by the remote proxy pattern, this function simply returns True without communicating with the client
[ { "docid": "c08c04bcb029308b7827d8977f1561e9", "score": "0.59076196", "text": "def inform_of_winners(self, winners: List[PlayerColor]) -> bool:\n self.winners = winners\n return True", "title": "" } ]
[ { "docid": "515c2ff2fb6c1d143e40310233fce082", "score": "0.7147915", "text": "def is_won(game):\n return game.is_over()", "title": "" }, { "docid": "4e510514175d15cc771d36a131b4a970", "score": "0.7048353", "text": "def aPlayerHasWon(game):\n game.playerAMoveCount = len(ai.getAl...
d448ec83f80bfab685df5598fb3a40a0
Unit test for macro including check in rst files test_rst_orphan uses python unittest to check the return value of the f_guidelines rst_check_orphan test function. rst files which are
[ { "docid": "3478261bb81e70199354fe89cdb843a7", "score": "0.65763324", "text": "def test_rst_orphan(self):\n self.assertEqual(\n GuidelineViolations.NO_VIOLATION,\n f_guidelines.rst_check_orphan.test(\":orphan:\"),\n )\n self.assertEqual(\n GuidelineV...
[ { "docid": "127a25217fc9d8778ac27ae4fd9954b6", "score": "0.74015856", "text": "def test_rst_macro(self):\n\n regex_string = rules[\"languages\"][\"reStructuredText\"][\"include\"][\n \"include_files\"\n ][0][\"macros.txt\"][\"regex\"]\n macro_regex = re.compile(regex_stri...
d0d73c71f77331a5d87c6cba7055c1aa
Builds graph from this network and returns it.
[ { "docid": "a7656b063a75969adf00c965d0bda3d4", "score": "0.7587391", "text": "def buildGraph(self):\n self.normalize()\n \n g = nx.DiGraph()\n \n for k, n in self.nodes.items():\n g.add_node(n.node_id, color=n.color(), n_type=n.neuron_type)\n \n ...
[ { "docid": "49435ede5f626dcb445420c22594340d", "score": "0.72999275", "text": "def build_graph(self):\n raise NotImplementedError(\"Subclass must override build_graph()!\")", "title": "" }, { "docid": "a8b3c9bb9f9d47bd9ab83839a14249f9", "score": "0.7252171", "text": "def _buil...
176b2178ec759add208e5f2e37c56bcc
draw the cursor to the screen, if in the correct frame.
[ { "docid": "9914733cd4a98c403be05fbbb2bc738c", "score": "0.7841671", "text": "def draw_cursor(self):\n self.frames += 1\n if self.frames > CURSORFRAMES:\n # now, draw the cursor.\n self.cursor = self.rel_cursor\n else:\n self.cursor = \"\"\n\n ...
[ { "docid": "9dee6bb52a2c987bc487ef2555435009", "score": "0.7041617", "text": "def _draw_frame(self):\n\n self.game._draw_frame(self.display_screen)", "title": "" }, { "docid": "0edf21cb213c09a4787aab2c799c1603", "score": "0.70361966", "text": "def draw(self, screenin):", "...
41ddf87b8aee80fd7cf604541f22294a
Helper to create a Variable stored on CPU memory.
[ { "docid": "ac97d0bd00f3797ebc78ca2edbc129b9", "score": "0.66969126", "text": "def _variable_on_cpu(name, shape, initializer):\n with tf.device('/cpu:0'):\n dtype = tf.float32\n var = tf.get_variable(name, shape, initializer=initializer, dtype=dtype)\n return var", "title": "" } ]
[ { "docid": "be3d6a4f1ce7cad92376233912acba95", "score": "0.70131457", "text": "def create_variable(self, name, alloc, type_, max_stack_depth, batch_size):\n del name\n if alloc is instructions.VariableAllocation.NULL:\n return instructions.NullVariable()\n elif alloc is instructions.Variab...
f94c54ea292a2de26628b579b34fc3eb
Return a new scenario tree with some scenarios replaced by their average value.
[ { "docid": "5cda6255fc665cb4292de1dd123a9e91", "score": "0.6675452", "text": "def average(scenario_tree: ScenarioTree, \n map_stage_to_rvar_names: Optional[Dict[int, List[str]]] = None) -> ScenarioTree:\n scen_tree = copy.deepcopy(scenario_tree)\n scen_tree.average(map_stage_to_rvar_nam...
[ { "docid": "05091a307b7093f5a2a0aaf3c23828af", "score": "0.60327834", "text": "def _average_across_tree(self, map_stage_to_rvar_names: Optional[Dict[int, List[str]]] = None):\n if map_stage_to_rvar_names is None:\n map_stage_to_rvar_names = self.map_stage_to_rvar_names\n for sta...
f15e5784845dfd893a9a0e9205b03fac
Hdf5 export method for the block.
[ { "docid": "38ffe91035bc6cfbc02ef4285e6fecb3", "score": "0.6027526", "text": "def export_hdf5(self, handle):\n handle.create_dataset(\n 'type', (1, ), 'S10', ['flatten'.encode('ascii', 'ignore')]\n )\n handle.create_dataset('shape', data=np.array(self.shape))", "title...
[ { "docid": "97eea5b6ccf830da77780d2f683a11af", "score": "0.696666", "text": "def export_hdf5(self, handle):\n pass", "title": "" }, { "docid": "97eea5b6ccf830da77780d2f683a11af", "score": "0.696666", "text": "def export_hdf5(self, handle):\n pass", "title": "" }, ...
81045398f6bf9043f0bdfafd927600a6
Validates a token with a given secret.
[ { "docid": "64b94e0d0462089561d740ee3f3aa6f1", "score": "0.75841236", "text": "def is_token_valid(token: str, secret: str) -> bool:\n try:\n jwt.decode(\n str.encode(token),\n secret,\n algorithms=[config.JWT_ALG],\n )\n except jwt.exceptions.PyJWTErr...
[ { "docid": "e495750d8ead23368478d2c478c57f9a", "score": "0.66990536", "text": "def valid_token(token, config):\n try:\n decode(token, config)\n except Exception:\n warning_log(\"Invalid token\")\n return True", "title": "" }, { "docid": "2104e0e41d18f133dcc033abd75...
78810dbe1d7a972670d163c504d04198
Returns wether the protocol of the url is http or https. Returns none if another protocol or no protocol is present in the url.
[ { "docid": "9e0eb7302df8c884ce41107550c7b028", "score": "0.6897188", "text": "def get_protocol(url):\n result = re.search(r\"^https?://\", url)\n return result.group(0) if result else None", "title": "" } ]
[ { "docid": "fb4ea7a5904658bcad37a1c1ff29503a", "score": "0.78023887", "text": "def https(url):\n if url[:8] == 'https://':\n return url\n if url[:7] != 'http://':\n return False\n return 'https://' + url[7:]", "title": "" }, { "docid": "7d9f7a68784ca4580941add2adbfa1d5...
5a142a1cebc1ed0adef91f854e0c3ce4
the actual registering of an endpoint is done here.
[ { "docid": "f9048ac479685c39a2c61886bed642a8", "score": "0.65512407", "text": "def _register_endpoint(self, name, **config):\n\n if self.type == self.REDIRECT_ENDPOINT:\n raise ImproperlyConfigured, 'redirect Endpoint \"%s\" can not register endpoints' % self.name\n\n if name in...
[ { "docid": "11ed93be0cd90e54073d90d0a452e2c0", "score": "0.7848222", "text": "def register(endpoint, procedure = None, options = None):", "title": "" }, { "docid": "d57ff7b5b76c5233c71b72af4561a897", "score": "0.717257", "text": "def register(self, endpoint, **config):\n name ...
e9ef466346bc02a0f0c94016b424fbbd
user_enable() Allow all mechanisms that are ON before `PK11Slot.user_disable()` was called to be available again. Sets disable reason to PK11_DIS_NONE.
[ { "docid": "fe3d49d2d76a409740151d11d523087a", "score": "0.6470902", "text": "def user_enable(self): # real signature unknown; restored from __doc__\n pass", "title": "" } ]
[ { "docid": "e0fe69d17b21cbb553f9c9ea3ca6fabf", "score": "0.66574407", "text": "def user_disable(self): # real signature unknown; restored from __doc__\n pass", "title": "" }, { "docid": "e06e1cc2b999c023e3fc44bcf4ccfaac", "score": "0.631137", "text": "def disable_user(self, ma...
a50c599aad9213465e9e1baf10f6f5ac
Column vector of requirement weightings. Each requirement contributions to the overall model according to its weight.
[ { "docid": "89df50998c31df86946bc1ba30e971fb", "score": "0.8679849", "text": "def weight(self):\n vec = np.array([[reqt.weight for reqt in self.requirements]])\n return vec.T # Return as column vector", "title": "" } ]
[ { "docid": "8ef7c41c0a6c88cc1bdd1fb886ab57b7", "score": "0.688155", "text": "def weights(self):\n pass", "title": "" }, { "docid": "3edddcd5c994c6d7de7defb22a244e47", "score": "0.65906084", "text": "def get_weights(self) -> List[float]:\n return self.weight", "title...
f270e502ea2e3a9b37363537d159d82c
Return True if cls_name is a message object based on info in unified
[ { "docid": "6bbf76d43d154cf986de127c27fdb77c", "score": "0.62210727", "text": "def class_is_stats_message(cls):\n\n return \"stats_type\" in of_g.unified[cls][\"union\"]", "title": "" } ]
[ { "docid": "289d5549feaa3be809320a36ef7358a7", "score": "0.75476646", "text": "def class_is_message(cls):\n return \"xid\" in of_g.unified[cls][\"union\"] and cls != \"of_header\"", "title": "" }, { "docid": "a21cb78dfc53864e804c668d44d734ad", "score": "0.6970383", "text": "def is...
cc2bd32ddcea8a8d7dbd16a413b490a0
Execute a shell command and capture its output (expected to be a single line). This is a thin wrapper around system_to_string().
[ { "docid": "a036753f66663e66c6f0767e0436ad49", "score": "0.6720015", "text": "def system_to_one_line(cmd: str, *args: Any, **kwargs: Any) -> Tuple[int, str]:\n rc, output = system_to_string(cmd, *args, **kwargs)\n output = get_first_line(output)\n return rc, output", "title": "" } ]
[ { "docid": "3426284eb7b0b3ad1a0d0cf6a75517ad", "score": "0.7754001", "text": "def shell_output(command: str):\n process = subprocess.run(\n args=[command],\n capture_output=True,\n shell=True,\n text=True # capture STDOUT as text\n )\n if process.returncode == 0:\n ...
278e7ae4349320b7f95151fb8856a03b
Contains(self, long pos) > bool Returns true if the given position is within this range. Allow for the possibility of an empty range assume the position is within this empty range.
[ { "docid": "c0e75285b3986e56a0efafa16a793303", "score": "0.58059067", "text": "def Contains(*args, **kwargs):\n return _richtext.RichTextRange_Contains(*args, **kwargs)", "title": "" } ]
[ { "docid": "95343c548c87a7abe9748f2a672de283", "score": "0.8172459", "text": "def contains(self, pos: tuple[int, int]) -> bool:\n\n start = self._start\n end = self._end\n\n return start[0] <= pos[0] <= end[0] and start[1] <= pos[1] <= end[1]", "title": "" }, { "docid": ...
a654cc135a8083e07cfc3aa0eafe3c1c
Defines a convolution transposed convolution net
[ { "docid": "e2e1af57c24c4e88823752d69fb91bad", "score": "0.6090154", "text": "def conv_pool_transconv_one_hot(img_bands = 4, img_rows = 64, img_cols = 64,nb_blocks=4, in_blocks=[3,4,6,3], filter_depth=[64,128,256,512], dense_layers=1 ,categorical=False,nb_classes=-1, droprate=0.9):\n assert len(filter_...
[ { "docid": "39880de3ececd47957d4c19d44597456", "score": "0.6619897", "text": "def Conv_Layer(self,inputs,filter_num=64,ks1=3,ks2=3,s1=1,s2=1,\r\n Transpose=False,use_bias=False,only_conv=False):\r\n initializer = tf.random_normal_initializer(0., 0.02)\r\n if Transpose:\r\...
74bd46482e33b59d3bfb90ab88f35618
Returns available information on a given phylome
[ { "docid": "fa7b59e0fe3fe2e63eab76834cf0f64b", "score": "0.6757125", "text": "def get_phylome_info(self, phylome_id):\n\n # Check if the phylome id code is well-constructed\n if not self.__check_input_parameter__(str_number = phylome_id):\n raise NameError(\"get_phylome_info: Check your input...
[ { "docid": "fa5a9555f5750d8e42f613d44ab8f13e", "score": "0.7154412", "text": "def phylum_info(self):\n pass", "title": "" }, { "docid": "a2a4e825c3e16dc56fbf36b7cf0d2419", "score": "0.63739514", "text": "def subphylum_info(self):\n pass", "title": "" }, { "d...
b95fb77af48d39a5a1e3ddde474dcc60
Declare victory to peers
[ { "docid": "26d3ea3b6b7348df1fe87db9bbe9cb85", "score": "0.68546593", "text": "def declare_victory(self, reason):\n if(self.bully == self.pid):\n print(\"The Leader is: {} as {}\".format(self.pr_leader(),reason))\n for member in self.members.items():\n pid , a...
[ { "docid": "37c5d4f5f7cde9c85b7343d837efc0b6", "score": "0.5788176", "text": "def vending_machines(self):", "title": "" }, { "docid": "eaddc986737d9d4ec7daccf067c3d1ea", "score": "0.544734", "text": "def __init__(self, vending_machine):\n self.vending_machine = vending_machine...
8c48f6972f194d991d3d4fd7a6dd0b07
generate string containing random combinations of % and ASCII symbols
[ { "docid": "bbc619b59abd48787cbab876d1c7b0ba", "score": "0.6609214", "text": "def get_exotic_str(size=10):\n name = u\"\"\n while len(name) < size:\n num = random.randint(1, 3)\n name = name + u\"%\" * num + get_random_str(2)\n return name", "title": "" } ]
[ { "docid": "78ebee311b61a78eeb0842c08318db9d", "score": "0.64790833", "text": "def generate_alphanumerics():\n spaces_before = random.randint(0, 10)\n spaces_after = random.randint(0,10)\n core_length = random.randint(2,20)\n core_string = ''.join(random.choices(string.ascii_...
08e2b273bd45cef527c56322381ab929
x.__eq__(y) x==yx.__eq__(y) x==yx.__eq__(y) x==y
[ { "docid": "f6cf9ec283538288c58388f140ed6876", "score": "0.0", "text": "def __eq__(self, *args): #cannot find CLR method\r\n pass", "title": "" } ]
[ { "docid": "28f9b1bc378d0090c502f0b953f818c0", "score": "0.8320325", "text": "def eq(x, y):\n return x == y", "title": "" }, { "docid": "8560fc02cea59b845bfbedfe81c8eb4e", "score": "0.7849895", "text": "def __eq__(self, other):\n\t\treturn self.x == other.x and self.y == other.y",...
89af3611257577a703bd2e6424bdc71d
Encode bounding boxes (that are in centersize form) w.r.t. the corresponding prior boxes (that are in centersize form). For the center coordinates, find the offset with respect to the prior box, and scale by the size of the prior box. For the size coordinates, scale by the size of the prior box, and convert to the logs...
[ { "docid": "72eb7bc0a8d80969db4fb1de69dca5e6", "score": "0.0", "text": "def cxcy_to_gcxgcy(cxcy, priors_cxcy):\n\n # The 10 and 5 below are referred to as 'variances' in the original Caffe repo, completely empirical\n # They are for some sort of numerical conditioning, for 'scaling the localizatio...
[ { "docid": "1c8b3617401588754bfc0bc6ba4f101c", "score": "0.6071095", "text": "def encode(self, boxes, labels, img):\r\n boxes = boxes.box\r\n #print(img)\r\n _, h, w = img\r\n boxes /= torch.Tensor([[w, h, w, h]]).expand_as(boxes) # normalize (x1, y1, x2, y2) w.r.t. image ...
f5f1a12e423f64898c87722da6b0c697
Don't have extraction on event class.
[ { "docid": "79d08c89e43444b6e17aa3003457ef12", "score": "0.5585676", "text": "def applyExtraction(self, evt):\n return evt", "title": "" } ]
[ { "docid": "7d776ad9ddd3ecf0dfcfdd983b9d9ea6", "score": "0.63723147", "text": "def processEvent(self, event):\n pass", "title": "" }, { "docid": "fad067ebf8bcbda50b08c793865316b0", "score": "0.6328626", "text": "def __init__(self):\n _LOGGER.error(\"Event class is not m...
8a1fab3c54bbd5998de5c3cb6c71b86b
Fetch account transactions pending
[ { "docid": "49c3248688c051b4d4a533f3c9b576f7", "score": "0.72934383", "text": "def get_account_transactions_pending(self, account_id=None, query_params=None):\n\n return self.fetch('get',\n '%s/%s/transactions/pending' % (ACCOUNTS, account_id),\n ...
[ { "docid": "7cb379d40366857996bc7be31b7c555a", "score": "0.6982897", "text": "def get_latest_transactions(self):", "title": "" }, { "docid": "732597fde4bf630d817f5643921c959f", "score": "0.67092973", "text": "def transaction_request(self, acct, start, end, status):\n if status...
f968f34a257cf2d6f3d05f77ac35c02c
Registers for notification of updated assessments. ``AssessmentReceiver.changedAssessments()`` is invoked when an assessment in this assessment bank is changed.
[ { "docid": "bd42644844bcf3be048f5518d5509323", "score": "0.7559024", "text": "def register_for_changed_assessments(self):\n pass", "title": "" } ]
[ { "docid": "03c592e690d6c4a948d9b29d61ce96c3", "score": "0.7275361", "text": "def register_for_changed_assessments_offered(self):\n pass", "title": "" }, { "docid": "d8638ba531e80f7d89b21a423be92304", "score": "0.70348734", "text": "def register_for_changed_assessments_taken(s...
de6db4ef752c53d8676de255dba988df
take a description as formatted by _transform_block, search for and return the first preceeding header (string defined by cd)
[ { "docid": "361975eaf1cdd14e939f8b5f5ecae174", "score": "0.0", "text": "def _get_keybind_category(self, key_desc):\n query = \"(?<=\\\\n)({}.*?)\\\\n(?=.*{})\".format(re.escape(self.category_descr), re.escape(key_desc))\n category_search = re.findall(query, self._get_raw_config(), flags=re...
[ { "docid": "e13ea169042ee5445f2f49734d97a207", "score": "0.65945625", "text": "def get_header(block):\n # Standard header\n if block.type is BlockType.HEADER:\n return block.header\n # Text followed by :\n elif is_valid_header(block.content.get_partial_clean()):\n return 7\n ...
45a270b227dd168f8c816fa65256ce17
A dict of this user's manga stats, with keys as strings, and values as numerics.
[ { "docid": "e41855e15012b2c4c9f88eb45ae6c253", "score": "0.69878834", "text": "def manga_stats(self):\n return self._manga_stats", "title": "" } ]
[ { "docid": "6e5d1b8f1ebbc44afbe20dd37487c1fa", "score": "0.71393543", "text": "def _make_stats(self):\n return {\n \"load_avg\": self.load_avg.to_dict(),\n \"service_time\": self.service_time.to_dict(),\n }", "title": "" }, { "docid": "13dcc88a79d8dadee074...
928fc070f71adccefb437f5252756b01
This decorator checks for a token, verifies if it is valid and redirects to the login page if needed
[ { "docid": "074034c9511ffb2c577fbf453134a2c0", "score": "0.74882853", "text": "def token_required(func):\n @wraps(func)\n def decorated(*args, **kwargs):\n global login_token\n if not app.config[\"DEBUG\"]:\n url_token = request.args.get('token')\n if url_token ...
[ { "docid": "6254f1b48b0bbeec6eb32b333e524b1a", "score": "0.83707714", "text": "def login_required(f):\n @wraps(f)\n def decorator(*args, **kwargs):\n if not valid_token():\n return redirect(url_for('views.login', **{\"continue\":request.url}))\n return f(*args, **kwargs)\n...
b854cc0f94f5ca5dbf66e9174e0af376
Write a JSON object to cloud storage.
[ { "docid": "afce2bb582e97c7fadb81c2706acd731", "score": "0.7463363", "text": "def json_write(bucket, path, data):\n blob = _make_blob(bucket, path)\n return blob.upload_from_string(json.dumps(data))", "title": "" } ]
[ { "docid": "87c2e2abe4ae47b3be26825827779192", "score": "0.7004237", "text": "def store_json(bucket, dataset, key, to_json):\n json_file = NamedTemporaryFile(mode=\"w+b\")\n json_file.write(json.dumps(to_json).encode())\n # Reset to the beginning:\n json_file.seek(0)\n store_file(bucket, ...
5a5ae203ea2c110f171c5dc86de46448
concatenate files and print on the standard output
[ { "docid": "ca75e9e0396c765c4871f1ef36b0373c", "score": "0.6244764", "text": "def cat(args):\r\n # for every file, attempt to open, read every line, and print\r\n for argument in args[2:]:\r\n file = open(argument)\r\n lines = file.readlines()\r\n for line in lines:\r\n ...
[ { "docid": "23e5d8240e71cd89332d10b1504d6198", "score": "0.7242691", "text": "def concat_files(self, in_files, out_file, concat_opts=None):\n concat_file = f'{out_file}.concat'\n self.write_debug(f'Writing concat spec to {concat_file}')\n with open(concat_file, 'w', encoding='utf-8'...
1cff34ef942b9ac38d0ec62678e277de
Return the directory name with give __file__.
[ { "docid": "111ea80cd841421e7f9fc192363d582d", "score": "0.69222474", "text": "def getDirName(magicFile):\n dirPath = os.path.dirname(os.path.abspath(magicFile))\n parts = dirPath.split(os.path.sep)\n return parts[-1]", "title": "" } ]
[ { "docid": "50bfc1f95a5c3b0fd2195fa403f8eabf", "score": "0.78758234", "text": "def dir_name(self):\n return os.path.split(self.path)[0]", "title": "" }, { "docid": "709bd8acf9d73662e780a61c5798a2cd", "score": "0.7685119", "text": "def directory(self):\n return \"%s.d\" ...
1c8c674bc4911d3e990ecfa6a4ed6b08
Return a tuple of availability zones that have the instance_type. This function builds on get_supported_az_for_instance_types, but simplifies the input to 1 instance type and returns a tuple
[ { "docid": "61d8f6b23b3a6fc37b9fcaa914e21ad3", "score": "0.7708298", "text": "def get_supported_az_for_instance_type(self, instance_type: str):\n return self.get_supported_az_for_instance_types([instance_type])[instance_type]", "title": "" } ]
[ { "docid": "03a5145e5f4e16bab8475e545fe9c442", "score": "0.7645274", "text": "def get_supported_az_for_instance_types(self, instance_types: List[str]):\n # first looks for info in cache, then using only one API call for all infos that is not inside the cache\n result = {}\n offering...
4166f43da3751428ef835a8d56b0b615
Create a quadtree of 'n' points.
[ { "docid": "7679c017510138d7ac6a406eafbc687e", "score": "0.0", "text": "def random(cls,n=50,**kwargs):\n motions=[Motion.random(n=2) for i in range(n)]\n return cls(motions,**kwargs)", "title": "" } ]
[ { "docid": "1ad95cfc250155d495868d7d4a817b52", "score": "0.6579787", "text": "def random(cls,n=50):\n return cls(QuadTree.random(n=n))", "title": "" }, { "docid": "0240cf3dd9442d3bd81eef06fb677339", "score": "0.5730425", "text": "def quad_children(x, y):\n for xo in ran...
6693dd0d3545fa42d0a2ba4f46360eaf
Makes featured profiles for IdeaLab galleries.
[ { "docid": "9895d20dfb920c5da005bd25ddbc885b", "score": "0.7489455", "text": "def makeGallery():\n if params['subtype'] in ['intro', 'new_idea', 'ieg_draft', 'participants_wanted']:\n featured_list = getFeaturedProfiles()\n else:\n sys.exit(\"unrecognized featured content type \" + p...
[ { "docid": "d1d605377361822796ab2f870c16fe02", "score": "0.6286335", "text": "def getFeaturedProfiles():\n featured_list = []\n profile_page = profiles.Profiles(params[params['subtype']]['input page path'], params[params['subtype']]['input page id'], params)\n profile_list = profile_page.getPag...
5f5a8118ee90ba9e1701b257a7d1a143
Base method to send SMS. This method can be extended by child classes to implement SMS sending.
[ { "docid": "1690f7412ec9e9cfd82fcd436276c908", "score": "0.6439799", "text": "def send_sms(self, from_, to, message, callback_url=None):\n\n url = self.base_url + self._PATHS['smsoutbound']\n\n # If 'to' contains only digits, it's an MSISDN, else it's an obfuscated identity\n data =...
[ { "docid": "6509fd35a9af8eb08b911ce9c72047bc", "score": "0.8653039", "text": "def sendSMS(self):\n pass", "title": "" }, { "docid": "43250301a65dfa6a517da438b5c8fba7", "score": "0.7880894", "text": "def send_sms(self, dest, text, sender=''):\n raise NotImplementedError"...
681fc39a4870de1c1a271867c75b5d32
Although this is a stateless net, we use the "state" parameter to pass in the previous labels, unlike LSTMs where state would represent hidden activations of the network.
[ { "docid": "094a33d07d0505c0ce9c03f5b164856b", "score": "0.0", "text": "def forward(\n self, y: Optional[torch.Tensor] = None, state: Optional[List[torch.Tensor]] = None,\n ):\n outs = []\n\n [B, U] = y.shape\n appended_y = y\n if state != None:\n appende...
[ { "docid": "61360cec1be5e56379cec7fe0daf3464", "score": "0.6701732", "text": "def transfer_states_to_neuron(self):", "title": "" }, { "docid": "4c02c69e0c8275194edcd4056c1c0d8f", "score": "0.6692958", "text": "def __setstate__(self, state):\n self._weights, self._biases, self._lay...
f52497ff6f61c9d916ba7093bec81fb8
Draws the current screen into the delegate surface.
[ { "docid": "a9e4a2c22ec5aa8ab39948f0ee55e842", "score": "0.84791386", "text": "def draw(self):\n self.get_current_screen().draw(self._surface)", "title": "" } ]
[ { "docid": "c5d38c3a6f645ce37cd070c245ef3740", "score": "0.80792165", "text": "def draw(self, screen):\r\n pass", "title": "" }, { "docid": "b8114732a0c0f6957a74b9dfc4ecb49c", "score": "0.7948619", "text": "def draw_to_screen(self):\n self.screen.blit(self.image, self.r...
9cf5b7f802daf350491f7a8ef3479226
Sets the low_power_usb of this VmediaPolicyAllOf.
[ { "docid": "0e0153707a1160a732bbf16c6c24f3da", "score": "0.8350906", "text": "def low_power_usb(self, low_power_usb):\n\n self._low_power_usb = low_power_usb", "title": "" } ]
[ { "docid": "8b3ea43d75887285e4acb801785985e4", "score": "0.7069202", "text": "def set_low_power(self):\n logger.debug('Enable low power mode by setting mods=00.')\n self.write_byte_data(MMA8451_REG_CTRL_REG2, MODS_LOW_POWER)", "title": "" }, { "docid": "25fe1506f473f48c2a5ed745...
7487a15acbb8dfd8d4a407ea4c31057a
Get Holy Day by a calendar date.
[ { "docid": "672203003ea0314e126c6176bb7f0299", "score": "0.7131204", "text": "def getHolyDayByDate(self, requestedDate):\n msg = \"Attempting to retrieve holy days from db\"\n LOGGER.info(msg)\n\n nowUtc = datetime.datetime.now(tz=pytz.utc)\n timezone = pytz.timezone(\"Americ...
[ { "docid": "b79f4db962ca72f0fc671163a0e769ec", "score": "0.61988795", "text": "def get_day(self, year, month, day):\n calendar = self.get_shift(year=year, month=month)\n worked_hours = []\n # return next(day_it for day_it in calendar if day_it['day'] == day)\n for day_it in c...
0e1f6e0748b12918c1e4009c77bcba45
empty() Returns True if the number of elements is zero right now. Note that in theory, another thread might add an element right after this function returns.
[ { "docid": "01e9f670209cb7c4b87b0e2d2f7b7cf3", "score": "0.7976789", "text": "def empty(self):\n return len(self) == 0", "title": "" } ]
[ { "docid": "bf783b751c53b1ba6330e4774a061220", "score": "0.86242735", "text": "def empty(self):\n size = len(self.elements)\n return size == 0", "title": "" }, { "docid": "8923db9a35badf5089ab54692bedb339", "score": "0.8620145", "text": "def is_empty(self):\n ret...
1a7c1e11ab620d2d2f722df6363b4910
this function iteratively fits data x into kmeans model. The result of the iteration is the cluster centers.
[ { "docid": "ad98ebbf93f2f20d7067e3531f00c41a", "score": "0.77107215", "text": "def fit(self, x):\n print(\"Fitting to the dataset\")\n # intialize self.centers\n self.init_center(x)\n\n sse_vs_iter = []\n for iter in range(self.max_iter):\n # finds the clust...
[ { "docid": "bdf5b75e75a58acd0d2c646dd0b33d12", "score": "0.75578046", "text": "def fit(self, X):\n centroids = self.initialize_centroid(X, self.k)\n for _ in range(self.max_iterations):\n clusters = self.create_clusters(centroids, X)\n previous_centroids = centroids\n...
5634b262d0535a092a55ffe19925bc68
Game state equality, should ignore time etc
[ { "docid": "74b30c6c9e02724f00211ec16ee93ae0", "score": "0.0", "text": "def __eq__(self, other):\n # return self.freeze() == other.freeze()\n return self.hash() == other.hash()", "title": "" } ]
[ { "docid": "2b03fb0045e81b569ea12501b54e388f", "score": "0.7577427", "text": "def same_game_state(self, other):\n return self._grid == other._grid", "title": "" }, { "docid": "03495e28a8f46ac341da85e94c6ed1d4", "score": "0.75027466", "text": "def test_equal(self):\n # A...
1d12fdf6c5c44b325b63ded3f3b4277a
View for making comments disabled
[ { "docid": "015b6ffa6f8930b9340a381c1851d352", "score": "0.66315573", "text": "def moderate_disable(id):\n comment = Comment.query.get_or_404(id)\n comment.disabled = True\n db.session.add(comment)\n db.session.commit()\n return redirect(url_for('.moderate', page=request.args.get('page', ...
[ { "docid": "d1edd7aa6f5051596a7b655d90922d2e", "score": "0.6276129", "text": "def _commentingAllowed(self):\n return not self.data.timeline.allWorkStopped() or (\n not self.data.timeline.allReviewsStopped() and\n self.data.mentorFor(self.data.task.org))", "title": "" }, { "d...
3c6f5cdd46e7eaa0cc49ddef5eb8891f
Load the model from a file.
[ { "docid": "e5cc9afc8f4498687ccd2a8e123d696d", "score": "0.78549993", "text": "def load_model(self):\n file = open(self.config.MODEL_PATH, \"rb\")\n self.model = pickle.load(file, encoding=\"ASCII\")", "title": "" } ]
[ { "docid": "18ad33d60e09bfae3e842f06f0a67318", "score": "0.8907899", "text": "def load_model(self, model_file=None):", "title": "" }, { "docid": "2cab4c4c48e3d4248586f2e5f9e4b748", "score": "0.8749351", "text": "def load_model(from_file):\n\n raise NotImplementedError", "title...
3b7c4cb44eafac4ca3a16bc12bd88e8c
Constructor of a E3DC object (does not connect)
[ { "docid": "e96047e58faa3af1385bd64817240138", "score": "0.0", "text": "def __init__(self, connectType, **kwargs):\n \n self.connectType = connectType\n self.username = kwargs['username']\n if connectType == self.CONNECT_LOCAL:\n self.ip = kwargs['ipAddress']\n ...
[ { "docid": "96ef8aefbc4172ef186932c042c41f2c", "score": "0.70455325", "text": "def __init__(self, dmc, dc):\n self.dmc = dmc\n self.dc = dc", "title": "" }, { "docid": "c17b28b949b3c432f89cf53a2bd9acb5", "score": "0.65099466", "text": "def __init__(self):\n\t\tself.c = ...
73254f537c8813c1e5a36d369989817a
Return the key containing the name.
[ { "docid": "f1629cfe983f8b594a7731d02471a2fc", "score": "0.0", "text": "def get_name(self, key):\n for key in (\"name\", \"title\"):\n if self.has_key(key) and self.key_type(key) != self.NULL:\n return self.get_as_string(key)\n\n return \"\"", "title": "" } ...
[ { "docid": "fcbc38fcf59b807073d7b2b11a46a90b", "score": "0.7750027", "text": "def key_name(self) -> str:\n return pulumi.get(self, \"key_name\")", "title": "" }, { "docid": "b9e7d32ea82387c66113d51c9652e778", "score": "0.76042306", "text": "def get_key() -> str:\n pass"...
676b480059773d0858c5368503ccb578
Method to authenticate a gateway user with keycloak
[ { "docid": "e20774330e11fc2e7c2d3f316b80732e", "score": "0.0", "text": "def authenticate_using_user_details(self, user_credentials):\n try:\n token, user_info = self._get_token_and_user_info_password_flow(user_credentials)\n return token, user_info\n except Exception ...
[ { "docid": "c10f37577cc7938d2d6345b30b60916a", "score": "0.717711", "text": "def __authenticate(self) -> None:\n print(\"Autenticando em \"+self.keycloak_url)\n url = self.keycloak_url+'auth/realms/master/protocol/openid-connect/token'\n authorization_redirect_url = {\n '...
008c164f15999607aa3ddeb5d7c9d707
The manifest is checked first for the version.
[ { "docid": "b20276b1c591ed526c8d07c5e39e1cfa", "score": "0.66188157", "text": "def test_version_from_manifest(self):\n bundle = self.mkbundle('in', output='out-%(version)s')\n self.env.manifest.version = 'manifest'\n self.env.versions.version = 'versions'\n assert bundle.get_...
[ { "docid": "be2504fb1e6538c36389418206ea740c", "score": "0.7081394", "text": "def getManifest():", "title": "" }, { "docid": "3a57e0dad785654907e4bb733f8d9293", "score": "0.7056929", "text": "def manifest(self):", "title": "" }, { "docid": "71afad78257634cc5cd7ea6bcb4b41e...
6c531d94ee0e432b369d07ab4a9f34f9
From the given sentence object each token is transformed to string and appended to the list of tokens
[ { "docid": "2143e175fb070bba04a2974497a4d6a4", "score": "0.0", "text": "def list_of_tokens(doc: object) -> list:\n token_list = [str(each_token.text) for each_token in doc]\n\n return token_list", "title": "" } ]
[ { "docid": "ffac20314eb07ec3f9f0ee6e88325681", "score": "0.70261323", "text": "def sentences_from_tokens(self, tokens):\n ...", "title": "" }, { "docid": "69db74418c3f4c52186cec53ef074834", "score": "0.66899365", "text": "def _bert_tokenize_sentence(self, tokenizer, sentence):...
153cc40ad1617f690e4092e1f97d0c19
Check if the union tag is ``team_merge_request_sent_shown_to_secondary_team``.
[ { "docid": "188728c806e278886e546c75e4a0b053", "score": "0.8531224", "text": "def is_team_merge_request_sent_shown_to_secondary_team(self):\n return self._tag == 'team_merge_request_sent_shown_to_secondary_team'", "title": "" } ]
[ { "docid": "08f029aa16ff41c12bcd2548e8f33fe5", "score": "0.8294527", "text": "def is_team_merge_request_accepted_shown_to_secondary_team(self):\n return self._tag == 'team_merge_request_accepted_shown_to_secondary_team'", "title": "" }, { "docid": "08f029aa16ff41c12bcd2548e8f33fe5", ...
6d95649681b571edb5fbe7eca9d04f63
The Downloader class is responsible for downloading packages and it's dependencies.
[ { "docid": "fb9c173552dd7a86c779c9213f9eb5d5", "score": "0.0", "text": "def __init__(self, packages, out_dir=\"./out\"):\n self.packages = packages\n self.out_dir = out_dir", "title": "" } ]
[ { "docid": "3182200d6d9fd7aa36eccd72373d2d6a", "score": "0.7099037", "text": "def downloader(self):", "title": "" }, { "docid": "eeabcea7046da8a48556000edd2aaf7e", "score": "0.6681995", "text": "def download_packages(\n self, package_names, dependencies_to_exclude=[], version=...
fd005ae43ef0b77114e68de5875f0a27
cards = [Card(), Card()]
[ { "docid": "34b9b0d2a71573cd0482676a13efab1d", "score": "0.0", "text": "def bulk_append_card(self, cards: 'list[Card, ...]'):\n assert type(cards)==list\n for each in cards:\n self.append(each)", "title": "" } ]
[ { "docid": "213766e651ded64ad47c308fc1952569", "score": "0.8249101", "text": "def __init__(self, cards = None):\n if cards:\n self.cards = cards\n else:\n self.cards = []", "title": "" }, { "docid": "4b2167436ba39c61662dae8e230b7a27", "score": "0.79806...
036ea3cba0d5886a92390ca5f00e53ac
Get triplets for training model. A triplet contains an anchor, a positive, and a negative. Select cowatch pair as anchor and positive, randomly sample a negative.
[ { "docid": "e15247c245c934970e0faaefc5f13293", "score": "0.5595899", "text": "def mine_triplets(all_cowatch, features):\n if not isinstance(all_cowatch,list) and not isinstance(features,np.ndarray):\n logging.error(\"Invalid arguments. Type should be list, dict instead of\"+\n str(type(all_cowa...
[ { "docid": "308c55f9a7cea6a9d8a73c76adfcb079", "score": "0.6431219", "text": "def generate_triplets(test=False):\r\n while True:\r\n list_a = []\r\n list_p = []\r\n list_n = []\r\n\r\n for i in range(batch_size):\r\n #print(i)\r\n a, p, n = get_triple...
663abec506a80adc4aae7d86de59149f
Can't invite user to a team that's not mine
[ { "docid": "ed6d47cefd3415d42dea1050f5b96dbf", "score": "0.7434971", "text": "def test_cannot_invite_to_another_team(self):\n with self.loggedInAs(\"alice\", \"123\"):\n resp = self.client.rpost('invitation_create',\n follow=True,\n ...
[ { "docid": "76547565f0096434d7b0733d36b2d200", "score": "0.7399999", "text": "def test_cannot_invite_team_members(self):\n self.alice_team.add_team_member(self.carl)\n with self.loggedInAs(\"alice\", \"123\"):\n resp = self.client.rpost('invitation_create',\n ...
f6460b17f437800c1dc656d38a0e0277
Compute the hold that maximizes the expected value when the discarded dice are rolled.
[ { "docid": "8545d861eb4b47194135a89caaf51845", "score": "0.73834246", "text": "def strategy(hand, num_die_sides):\r\n max_value = 0.0\r\n max_hold = ()\r\n for hold in gen_all_holds(hand):\r\n expect = expected_value(hold, num_die_sides, len(hand) - len(hold))\r\n if expect > max_...
[ { "docid": "934bd0f032a9cd531682d68eed0c0178", "score": "0.74292517", "text": "def strategy(hand, num_die_sides):\r\n \r\n max_expected_value = 0\r\n optimal_hold = []\r\n #For a given hand, generate all possible holds\r\n possible_holds = gen_all_holds(hand)\r\n #For a given hold, gen...
dc1d4fe4f1d93ed1ddab5f76cd7ad3aa
Initialize SELF to the position depicted in the string STARTING_BOARD. STARTING_BOARD has the form "xxxxx\nxxxxx\nxxxxx..." where each x is either '.' or '', and the newlines separate rows. The number of x's in each row must be equal. Leading and trailing whitespace is ignored.
[ { "docid": "5174b15c020eecd0fb50dfaec66f2d75", "score": "0.72269595", "text": "def __init__(self, starting_board):\n\n # Represent a board as a list of lists of single characters, one list\n # per row, and within each row, one character per column. B0[r][c]\n # represents the curre...
[ { "docid": "4410bf08e2a6e5a89d54d361679396f8", "score": "0.6600261", "text": "def __init__(self):\r\n self.board = [\" \", \" \", \" \", \r\n \" \", \" \", \" \", \r\n \" \", \" \", \" \"]", "title": "" }, { "docid": "ddec5ebac7407ba018aef650f...
1ad7eec27d6dcf86ec7bfe3e8c287c14
recv_directions should return None on fail
[ { "docid": "9e9e5b3274c5bd1868f8bedfaf2f99dc", "score": "0.76010746", "text": "def test_recv_directions_fail():\n string = \"CHAMPLFLFLFL\"\n result = io.recv_directions(string)\n assert_equals(result, None)", "title": "" } ]
[ { "docid": "83eebef10ad9f2d31ef09830ac9b3935", "score": "0.6898982", "text": "def test_recv_robot_info_fail():\n string = \"CHAMP 32 21 W\"\n result = io.recv_directions(string)\n assert_equals(result, None)", "title": "" }, { "docid": "8bb3f0d680ee7375c96d32094a0b36ce", "score"...
d9417c0ed441a06210fbba27dce0044f
Normalize a diff/patch file before it's applied. This can be used to take an uploaded diff file and modify it so that it can be properly applied. This may, for instance, uncollapse
[ { "docid": "82a3c2d96d17af243a4641b25270daa8", "score": "0.6414623", "text": "def normalize_patch(\n self,\n patch: bytes,\n filename: str,\n revision: str,\n ) -> bytes:\n return patch", "title": "" } ]
[ { "docid": "4660344ce841b80aca6c91afd8767e2d", "score": "0.60515046", "text": "def _normalize(self):\n # Ingest the data\n data = self._read_raw()\n\n # Clean data using `_normalize`\n df = self.normalize(data)\n success = self._store_clean(df)\n\n return succes...
57e037236dea359dab847af220308afd
Create a Segment which is generated with autodeploy.
[ { "docid": "b858a4d4afbf131479cd11a1bed0d561", "score": "0.59141743", "text": "def create(self, semantic_model, mode, config_path=None, extra_args=None):\n if semantic_model is SegmentationModel.DEEPLABV3_MOBILENETV2_TF:\n from ..algo_cv.seg.semantic_segmentation_deeplabv3_mobilenetv2_tf \\\n ...
[ { "docid": "58f3a284f2f5c2d3c04123c457864dea", "score": "0.6247422", "text": "def create_segment(self, segment_name: str = \"\") -> Segment:\n segment = Segment(segment_name)\n self._segments.add(segment)\n return segment", "title": "" }, { "docid": "0be78daf1ae027f5b4d5...
c3768705e91bc725c5e38587c0f8dbad
The vendorassigned unique ID for this range.This ID is incremented automaticaly for each DHCP client.
[ { "docid": "de7633b6ddf44a0a599ddea910e9b394", "score": "0.6511509", "text": "def Dhcp6DuidVendorId(self):\n return self._get_attribute('dhcp6DuidVendorId')", "title": "" } ]
[ { "docid": "377d93c9e4a72cbec71921e0ba1e58df", "score": "0.70701176", "text": "def unique_id(self) -> str:\n return f\"{self.dev.system.serial}_{self.dev.name}\"", "title": "" }, { "docid": "c0706950846448c4986cd03a0ade5b30", "score": "0.70366126", "text": "def unique_id(self)...
77a12a55419b78ec5094f90baa955a1c
Entry action for state 'brakelightsOn'..
[ { "docid": "0ae417aa5b0342c341ca4d9999c060a3", "score": "0.7652496", "text": "def __entry_action_main_region__car_off_r2__shuting_down_r2_1_brakelights_on(self):\n\t\tself.timer_service.set_timer(self, 2, 300, False)\n\t\tself.operation_callback.brakelights(\"on\")", "title": "" } ]
[ { "docid": "ce20a3588caa97f044bab2c4dfca4013", "score": "0.7132828", "text": "def __enter_sequence_main_region__car_off_r2__shuting_down_r2_1_brakelights_on_default(self):\n\t\tself.__entry_action_main_region__car_off_r2__shuting_down_r2_1_brakelights_on()\n\t\tself.__state_vector[0] = self.State.main_r...
dada524dfeb353a742892134297adb29
Handles the result of the opponent's move. Transforms the captured_piece bool and value into just an optional value in order to build the request.
[ { "docid": "b7b1c037d7c5438bb04c97623bdc34f9", "score": "0.75338936", "text": "def handle_opponent_move_result(self, captured_piece, captured_square):\n if self.out_of_time:\n return None\n\n try:\n request = make_handle_opponent_move_request(captured_square if captur...
[ { "docid": "ba095000e813e088faa4d1f0cf47c18a", "score": "0.7908477", "text": "def handle_opponent_move_result(self, captured_my_piece: bool, capture_square: Optional[Square]):\n pass", "title": "" }, { "docid": "b57d357d58c7ecf57ed7abac53f608b1", "score": "0.7078982", "text": ...
11a8c4e157a89ec7f31cfed011cf3406
Format the record with colors.
[ { "docid": "3d34b659680ba38fc1fc925980d13126", "score": "0.75765485", "text": "def format(self, record):\r\n color = self.color_seq % (30 + self.colors[record.levelname])\r\n message = logging.Formatter.format(self, record)\r\n message = message.replace('$RESET', self.reset_seq)\\\r...
[ { "docid": "dd614764164891b95a84fe3ad9e2b61d", "score": "0.8127916", "text": "def color_format(self, record):\n message = super().format(record)\n parts = message.split('\\n', 1)\n if '<color>' in parts[0] and '</color>' in parts[0]:\n bef, dur, aft = self.SPLIT_COLOR(par...
b998911a668d0cd73cf46f4ea01aa101
Returns true if both objects are equal
[ { "docid": "f89ca6807840c0f7c2fecc9b650a234a", "score": "0.0", "text": "def __eq__(self, other):\n if not isinstance(other, Episode):\n return False\n\n return self.__dict__ == other.__dict__", "title": "" } ]
[ { "docid": "35781205f766178c26df8024228c9541", "score": "0.8067084", "text": "def __eq__(self, other: object) -> bool:\n return self.__class__ == other.__class__ and self.points == other.points", "title": "" }, { "docid": "df1ca4bbc0e302958ca9db15d603d19b", "score": "0.7999691", ...
aed1e738084454900d605240cb481d43
Sync a room for a client which is starting without any state
[ { "docid": "3cbcddfc577383c7fb2465514a7dfefb", "score": "0.0", "text": "def full_state_sync_for_archived_room(self, room_id, sync_config,\n leave_event_id, leave_token,\n timeline_since_token, tags_by_room):\n\n bat...
[ { "docid": "9b07bce640e05bbb4999c959ad52528c", "score": "0.61042523", "text": "def test_incremental_sync(self) -> None:\n channel = self.make_request(\"GET\", \"/sync\", access_token=self.tok)\n self.assertEqual(channel.code, 200, channel.result)\n next_batch = channel.json_body[\"n...
0a48dcc0e5d8acc80bdcf94d7eb2230f
Return only compounds with no RO5 violations
[ { "docid": "3e3ac8481a00d1140725d7ed8624fbd8", "score": "0.71112686", "text": "def filter_ro5(mols):\n return mols.filter(molecule_properties__num_ro5_violations=0)", "title": "" } ]
[ { "docid": "ab98fc705bde3128e358773730bc475c", "score": "0.56570566", "text": "def find_redundant_compounds(self): \n\n stoich = self.stoichiometry\n\n # Transposing, to use the qr algorithm\n stoich_t = stoich.T\n n_rows = stoich_t.shape[0]\n n_cols = stoich_t.shape...
e9edfb819f9cb3682910bd9b2ef8e39d
Make directory and subdirectories.
[ { "docid": "efb6daf34dbf00c329c8f286cb5fcfdc", "score": "0.64890075", "text": "def MakeDirs( self, path ) :\n \n # modules:\n import os\n \n # split in domain and remaining path:\n if ':' in path :\n domain,dpath = path.split(':',1)\n else :\n ...
[ { "docid": "ce93fd6c8b470bab7977b1f05bf747f8", "score": "0.7336835", "text": "def mkdirs():\n dirs = [\n PYTHON_DIR,\n BUILDS_DIR,\n SHARED_DIR,\n RUN_DIR,\n STATIC_DIR,\n LOG_DIR,\n MEDIA_DIR,\n ]\n for dir in dirs:\n _run_web(\"mkdir -p ...
689ef4dc44033992faded2f451aa3274
Sets the diameter of the
[ { "docid": "f8714e9170fbddd16ab67ffce4d4ee82", "score": "0.6536274", "text": "def set_diameter(self, value):\n if self._device.successfully_set_diameter(value):\n return \"{}\".format(self.Stopped)\n else:\n run_status = self.get_run_status()\n return \"{}N...
[ { "docid": "2e8922b60569a2d01d86bc413100f22d", "score": "0.85909635", "text": "def diameter(self, diameter):\n\n self._diameter = diameter", "title": "" }, { "docid": "7353f3cffe18dd73e85d4804f159418a", "score": "0.701887", "text": "def diameter(self):\r\n return self.r...
8c9d60bda2e7faa6539e0ead3b569e28
Initialize the emitter with an event loop.
[ { "docid": "3d57c407a3975b589594f2da47098ef7", "score": "0.673187", "text": "def __init__(self, loop=None):\n self._loop = loop or asyncio.get_event_loop()\n self._listeners = collections.defaultdict(list)\n self._once = collections.defaultdict(list)\n self._max_listeners = s...
[ { "docid": "e0c3369da3f4c1abd76581fe10e69f2f", "score": "0.69916075", "text": "def __init__(self, loop=None) -> None:\n\n self.loop = loop if loop else asyncio.get_event_loop()", "title": "" }, { "docid": "1fb97ccd138ea175404892d6753ba676", "score": "0.6815965", "text": "def s...
7937c999a5afa4e76d49a4c8dc45d0e3
Returns the point at time t (0>1) along the curve.
[ { "docid": "4d96d37707793141520f29d32bd33f79", "score": "0.72235733", "text": "def pointAtTime(self,t):\n x = (1 - t) * (1 - t) * self[0].x + 2 * (1 - t) * t * self[1].x + t * t * self[2].x;\n y = (1 - t) * (1 - t) * self[0].y + 2 * (1 - t) * t * self[1].y + t * t * self[2].y;\n return Point(x,...
[ { "docid": "df6681abd3f94fe59f3e39c4d68cc2c1", "score": "0.6694643", "text": "def get(self, t):\n # return self.value[np.where((self.time - t) <= 0)[0][-1]] # last one that is <= 0\n return self._value[\n (self._time.searchsorted(t + 1) - 1).clip(0, len(self._value) - 1)\n ...
70ee95c12ccaa52305a62aa13c0596da
List the keys under path, if any, of the original store.
[ { "docid": "67ed1062aee6a8d18ebc3daeff4a9172", "score": "0.6513379", "text": "def listdir(self, path: str = None) -> List[str]:\n return zarr.storage.listdir(self._store, path)", "title": "" } ]
[ { "docid": "fedbcb88517228f6e49224e6c7ab64ae", "score": "0.7502651", "text": "def traversed_keys(self, root_path: str) -> List[str]:\n return self.redis_client_traversed.hkeys(root_path)", "title": "" }, { "docid": "37907698267ce4b2bc7e19d9e795d099", "score": "0.7457224", "tex...
444eac86840ee38810c270d702dc34e7
Return True if the node is significant at the 5% level according to the chisquared distrubtion with 1 df.
[ { "docid": "8a857b67f48c7662b3e4bb4e57d94841", "score": "0.76875913", "text": "def _significant(self, node):\n\t\tx_square_cutoff = 3.841 #1df @ 5% level\n\t\tx_square_node = float(\"inf\") \n\n\t\treturn x_square_node > x_square_cutoff", "title": "" } ]
[ { "docid": "556cfbe6e05fad6380053e80fac12608", "score": "0.5665601", "text": "def techChange_sunny(p):\n return p[:, 0] > 0.325", "title": "" }, { "docid": "fc21c6804aef56340de033ee2840d9c3", "score": "0.5657123", "text": "def __feat_num_significant(self, col, df_uni_var_norm, df_...
0e10ce96f1b52e7bb623b034794ee907
Get the primary database driver.
[ { "docid": "287097578a00ab75ea8ce1b57de8262b", "score": "0.8098757", "text": "def db_driver(self) -> DbDriver:\n\n primary_db_driver = None\n\n # noinspection PyUnusedLocal\n def filter_db_drivers(service_id, service, config):\n nonlocal primary_db_driver\n if ...
[ { "docid": "ea9c2f86bbbbb9465beea3207fedac07", "score": "0.7569865", "text": "def driver(self):\n return self._c.driver", "title": "" }, { "docid": "00e26464acdf461fbf5fae34c90c48af", "score": "0.7451214", "text": "def _get_driver(self):\n if self._config and \"driver\"...
c3b2cf2d9c71baccb00c198de43cf5af
Iterates columnwise over the marker alignment. Excludes samples.
[ { "docid": "300674607fabeb0d2f4d672f073bedbc", "score": "0.5351515", "text": "def iter_marker_sites(self, start=0, stop=None, size=1):\n if self.markers is None or self.markers.nrows == 0:\n return\n if stop is None:\n stop = self.nsites\n if (stop - start) % s...
[ { "docid": "a0d44a244dde0b542e3a237cd14452b2", "score": "0.55822045", "text": "def others_in_column(self, row_, col_):\n for r in range(9):\n if r != row_:\n yield self[r, col_]", "title": "" }, { "docid": "5988acb9ea0c626347aba9bba02a519c", "score": "0.5...
db08e1177f874ec5a2073ffa3d3b937c
Parse swiftrecon output into list of lists grouped by the content of the delimited blocks.
[ { "docid": "c075bcdf0c76921e47a2d0a4551ff995", "score": "0.71614885", "text": "def parse_swift_recon(recon_out):\n\n lines = recon_out.splitlines()\n delimiter_regex = re.compile(r'^={79}')\n collection = []\n\n delimiter_positions = [ind for ind, x in enumerate(lines)\n ...
[ { "docid": "2d0bf5d3c0c116e3052fefa8030ca8ba", "score": "0.65458053", "text": "def processBlock(block):\n out = []\n a = \"\"\n for i in block:\n for j in i:\n if a == \"\":\n a = j\n else:\n a = a + \"|\" + j\n\n out = a.split(\"|\"...
f21ec1a454b7684d26c31c403a205e32
A callback called when device setup failed to connect after repeated tries
[ { "docid": "3d4150e47b5c449f1fe6ef81e9f5672e", "score": "0.6424305", "text": "def devices_scan_failed(self):\n pass", "title": "" } ]
[ { "docid": "6ef6703ff92b4c3939b494a6ae277183", "score": "0.6651631", "text": "def test_on_connect_error(self):\n # this assumed the ssdb server being tested against doesn't use 1023\n # port. An error should be raised on connect \n bad_connection = Connection(port=1023)\n ...
63e2a9a9fcbb147fd55d6f76d423eb0b
Cache potential symbols in the symbol table.
[ { "docid": "f242891fa3149bdb7fe2262b204e019f", "score": "0.5748251", "text": "def _enumerateSymbols(self, machoCtx) -> None:\n\n\t\tsymtab: symtab_command = machoCtx.getLoadCommand(\n\t\t\t(LoadCommands.LC_SYMTAB,)\n\t\t)\n\t\tif not symtab:\n\t\t\tself._logger.warning(\"Unable to find LC_SYMTAB.\")\n\t...
[ { "docid": "5d0760fc5481f25d465307101e3bd6f3", "score": "0.66358835", "text": "def _load_symbols_cache(self, cache):\n\n #\n # Symbols\n #\n\n for sym, address in cache['symbols'].items():\n if self._process.file_type == \"PE\" or \\\n (self.elf ...
dd99e7bd4990e39891a390e9335bdb98
Plot the learning curve of the different networks trained
[ { "docid": "3ffe038286369685daca2d21ff9f7913", "score": "0.6725776", "text": "def plot_learning(steps, stats_mean_list=None, stats_std_list=None,\n labels=[], title=\"Learning Curve\", ylabel=\"Loss\",\n y_lim=[0.0, 1.7], share_x=False, share_y=False,\n ...
[ { "docid": "c021a9f6d6801419b68365d93bbefc7a", "score": "0.7735428", "text": "def plot_learning_curve(training_losses, validation_losses): \n plt.ylabel('Loss')\n plt.xlabel('Training Steps')\n plt.plot(training_losses, label=\"training\")\n plt.plot(validation_losses, label=\"validation\")\n...
b0235b98074062dc84c332d6568a79c7
Flip a bit and win!!!!!!
[ { "docid": "c4a9a8e4c27026a69c7db13d18888223", "score": "0.0", "text": "def flip_bit_to_win(num):\n \"\"\" Convert to binary \"\"\"\n binary = int(num, 2)\n current = 0\n last = 0\n longest = 0\n for i in range(sequence_length):\n bit = bit_manipulation.getbit(binary, i)\n ...
[ { "docid": "ce646fdea7446fd490869ab2c3aa4a03", "score": "0.7966279", "text": "def flip(self):\n self._repeat(table=bit_flipped)", "title": "" }, { "docid": "a5472cfb27a488c804cc7408fd66cca3", "score": "0.7797152", "text": "def test_bit_flip(self):\n\n self.run_steane_te...
a596b7b2e171e5f8cb5c520718640e74
Takes in a save directory and outputs a list of dictionaries with the
[ { "docid": "1d4acaacaf0b082acc2d5fa21ec896ba", "score": "0.0", "text": "def get_escapes(save_dir):\n\n escapes = []\n with open(os.path.join(save_dir, \"esc.11\"), 'r') as f:\n try:\n # Skip the header\n next(f)\n except StopIteration: # Empty file\n ...
[ { "docid": "b3150e0f984564995f68996ee9055be9", "score": "0.66876465", "text": "def parsed_files():\n files = []\n for filename in os.listdir(SAVE_DIRECTORY):\n path = os.path.join(SAVE_DIRECTORY, filename)\n if os.path.isfile(path):\n files.append(filename)\n return fil...