query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
eb85624807aa0c6481b333d5603773be
Tests the insert method.
[ { "docid": "d80cf976fc8e4c59b66f82ca08877bc9", "score": "0.762313", "text": "def test_insert(self):\n test_text = 'this is an insert test post'\n doc_id = self.engine.insert({'text': test_text})\n\n result = self.engine.find_by_id(doc_id)\n self.assertEqual(self._get_id([resu...
[ { "docid": "42e6d55ed9b8167441d0c0db9c55427c", "score": "0.8176738", "text": "def test_insert(self):\n\n ids = self._helper.insert('test_table', (\n {'col_b': randint(0, 99)},\n {'col_b': randint(0, 99)},\n {'col_b': randint(0, 99)}\n ))\n self.asser...
94d0024e99bf646bff8fd64e8a0db8e4
generates a new date from person_id preferences
[ { "docid": "b5233295c049c8cc5179ac1568ad534c", "score": "0.67847145", "text": "def generate_from_person_id(date_person_id):\r\n\r\n person_prefs = Preference.query.filter(Preference.date_person_id==date_person_id).first()\r\n \r\n # person_prefs.attribute == \r\n print(f'\\n\\n{person_prefs}'...
[ { "docid": "a38fa82d82be41e76567c98bb83f0bf3", "score": "0.60629743", "text": "def create_date_person(user_id, name, relationship_type):\r\n\r\n date_person = DatePerson(user_id=user_id, name=name, relationship_type=relationship_type)\r\n\r\n db.session.add(date_person)\r\n db.session.commit()\...
1589c5865da94ec1a570d5900ce7fe81
Create a property package
[ { "docid": "a837c1b42e44072798c7ada49de8282d", "score": "0.529537", "text": "def pp_toluene():\n\n return PropertyPackage(phases=1, phase_names=['toluene'])", "title": "" } ]
[ { "docid": "d4becaaefdda3b48b49cdee6a733c8b9", "score": "0.66099685", "text": "def create_property(key, value):\n\n prop = manifest.CTD_ANON_4()\n prop.PropertyKey = unicode(key)\n prop.PropertyValue = unicode(value)\n\n return prop", "title": "" }, { "docid": "8f881dd8a34bdb0fe2...
5c1b4edc37cf0c9d7eaae82e09ff2489
This method sets self.country_code from given locale
[ { "docid": "09124be737d4905ae4c97bb5cff1c361", "score": "0.6249225", "text": "def get_country_code_from_locale(self):\n regex_pattern = re.compile('[-_](.*$)', re.U)\n match = regex_pattern.findall(self.locale)\n if match:\n return match[0].upper()\n else:\n ...
[ { "docid": "2cd480f0e5b77b98260f1207398ba917", "score": "0.7170048", "text": "def country_code(self, country_code):\n\n self._country_code = country_code", "title": "" }, { "docid": "2cd480f0e5b77b98260f1207398ba917", "score": "0.7170048", "text": "def country_code(self, count...
a5a14d993f096de597bd893e0ee12422
Return the Body Mass Index (BMI) for the given weight, height, and measurement system.
[ { "docid": "31680e17a6bc9efb79d34c03894346b1", "score": "0.784507", "text": "def calculate_bmi(height, weight, system='m'):\n if system == 'm':\n bmi = (weight / (height ** 2))\n else:\n bmi = 703 * (weight / (height ** 2))\n return bmi", "title": "" } ]
[ { "docid": "f5996c4338c038a932b2454500eb8fee", "score": "0.8331378", "text": "def body_mass_index(weight, height):\n bmi = weight / (height ** 2) * 10000\n return bmi", "title": "" }, { "docid": "9078e04477ee72b02fc0ca32e01c4981", "score": "0.7788883", "text": "def calculate_bm...
81869966304cac1edc9a4a0a291c2a06
>>> cover_phone_number('01234 567 890') '01234 '
[ { "docid": "6a782a16b67a0e7bc8c81c9310fd264e", "score": "0.74416536", "text": "def cover_phone_number(no):\n result = ''\n for order, digit in enumerate(no):\n if order < 5:\n result = result + digit\n else:\n if order in (5, 8, 11):\n result = re...
[ { "docid": "10ef34eb9301b5071bdb4651a7f4541b", "score": "0.7311842", "text": "def phone(number):\n\treturn", "title": "" }, { "docid": "6973b0b1aa9a6a9c68ae05a6f689a096", "score": "0.72521627", "text": "def get_raw_phone_number(phone):\n if not phone:\n return\n if phone...
fcec292034e2345fb9fb6face4ca9787
Initializes an empty graph that will store
[ { "docid": "78ac43c9ec2bf6ad7fc97f1d39a653c3", "score": "0.80484927", "text": "def __init__(self):\n self.graph = {}", "title": "" } ]
[ { "docid": "f9edf2b2716187983888b6916bdc16e5", "score": "0.8202905", "text": "def __init__(self):\n super(Graph, self).__init__()\n self.vertex = []\n self.edges = {}", "title": "" }, { "docid": "cd62b0588bbf781e12dcf50f6b2377a3", "score": "0.8162918", "text": "d...
d0a2a8fec99873f3f23741f91d1b5447
Get appliance OSPF interfaces configuration
[ { "docid": "fae438d4fd00c57de550c3c278de6b0b", "score": "0.77904", "text": "def get_appliance_ospf_interfaces_config(\n self,\n ne_id: str,\n) -> dict:\n return self._get(\"/ospf/config/interfaces/{}\".format(ne_id))", "title": "" } ]
[ { "docid": "3234037c36bb52ad62356d0e92c5e305", "score": "0.6962521", "text": "def config_if(self):\n\n resource = \"/ip/address\"\n\n for intf in self.interfaces:\n\n response = self.request_put(resource, intf)\n #print(response)", "title": "" }, { "docid"...
7495509b729bd83921a95fa42410dfce
check input, extract data from csv file find copynumber files created by varscan
[ { "docid": "dd3b2cc955a7893deea1dfc1c0bbed64", "score": "0.5857006", "text": "def main(): # run analyses of copynumber files using functions defined above\n # initialize lists\n individual_samples = set()\n ancestor_clone_pairs = set()\n missing_pairs = set()\n analyzed_pairs = set()\n\n ...
[ { "docid": "712e9b347ffc2d5821cf6bec6902a509", "score": "0.65452796", "text": "def read_csv_file():\n\n csv_open = open(csv_file, 'rU')\n csv_reader = csv.reader(csv_open)\n row1 = next(csv_reader)\n\n clone_regex = re.compile('(Clone).*')\n clones = ([c.group(0) for cell in row1 for c in...
6d7c635ef6190c251b027ad60d043f1b
Encode image file into string using base64.
[ { "docid": "083775d02d746f13cdbf4045f2c8b572", "score": "0.84103495", "text": "def encodeImage(imageFile):\n encoded_string = ''\n if not os.path.exist(imageFile):\n print(\"File does not exist\",imageFile)\n with open(imgFile, \"rb\") as image_file:\n encoded_...
[ { "docid": "e3eb3d717edbcc83c69c8e8a7f2f63ec", "score": "0.8400944", "text": "def encode_image(filename):\n with open(filename, \"rb\") as image_file:\n encoded_string = base64.b64encode(image_file.read())\n return encoded_string.decode(\"utf-8\")", "title": "" }, { "docid": "20...
7b760be8345a0f6b5f9b92938d3443f2
Insert a new tray by adding tray to database.
[ { "docid": "34cdcc6da48271164ffd28891aa06cdc", "score": "0.8211067", "text": "def insert_tray(tray: NewTrayInsert):\n with get_session() as sess:\n tray = Tray(**tray.dict())\n sess.add(tray)", "title": "" } ]
[ { "docid": "986f26d9d9e21b32706b815174baa564", "score": "0.60956424", "text": "def insert(self):\n db.session.add(self)\n db.session.commit()", "title": "" }, { "docid": "1333b9854ffb8e3522d004fb384a98e6", "score": "0.6006402", "text": "def insert_transaction(self, item...
60b1d7c2af15251da1f18ba1fdaec554
show the stdout and stderr logs from a container
[ { "docid": "d2edbb196b20ba3bf704ef2110636600", "score": "0.68574196", "text": "def logs(docker, container):\n info = docker.inspect_container(container)\n real_user = os.environ['SUDO_USER']\n if check_contenair_user(info, real_user):\n print docker.logs(container, stdout=True, stderr=Tr...
[ { "docid": "18b4643ddd8f6a3602c022aca55b9799", "score": "0.6842843", "text": "def app_logs():\n run(f'docker logs {service_container_name}')", "title": "" }, { "docid": "318a9b46d67867f3bdb8d0e98f9815cf", "score": "0.6645457", "text": "def logs(c):\n docker_compose(c, 'logs -f ...
84c47483d857f890fe9beeda7750176d
returns the color of the drawn circle on the screen it can be different from the mass radius depending on mass.z
[ { "docid": "352421a22a01d4800f90a2cba9f68d4d", "score": "0.6111481", "text": "def show_color(self):\n if not self.bound:\n return self.color\n r, g, b = self.color\n x = (WIND + self.z) / (2 * WIND)\n r = int(abs(r * x))\n g = int(abs(g * x))\n b = in...
[ { "docid": "7a7d93903e0a47e10ecb16bf8d297757", "score": "0.707346", "text": "def _drawcircle(self,x,y,rad):\n color=\"red\"\n return self.c.create_oval(x-rad,y-rad,x+rad,y+rad,width=rad/5,fill=color,outline='black')", "title": "" }, { "docid": "5251198223462dcdfb636d832cd01f64", ...
7fba9ede4b0716e61c11ec7b2329ca94
Generates a random character in [AZaz09].
[ { "docid": "c2cee4d2d87f3a14e49abaa85bf7e0d1", "score": "0.75228137", "text": "def random_alpha_num_char():\n num = random.randint(0, 26 + 26 + 10)\n if num < 26:\n return chr(num + 65)\n num -= 26\n if num < 26:\n return chr(num + 97)\n return chr(num + 48)", "title": "...
[ { "docid": "b331f1497ca3a7668249f633afa29201", "score": "0.7927985", "text": "def random_charachter() -> chr:\r\n return chr(int(random.randrange(32, 126, 1)))", "title": "" }, { "docid": "1e58f69b2bcd64cf7c038a4f1183e9af", "score": "0.79179096", "text": "def random_char(alph):\n ...
480ab2652d0d43eb768f1e1958a2b2af
Sets the volume of the player.
[ { "docid": "5188a5b1a0c43f191664c6fbf30dc6f7", "score": "0.71377057", "text": "async def _volume(self, ctx: commands.Context, *, volume: int):\n\n await ctx.message.delete(delay=5)\n if not ctx.voice_state.is_playing:\n return await ctx.send('Nothing being played at the moment.'...
[ { "docid": "0605d5ecd7672b195973cb02635dd7d5", "score": "0.8093429", "text": "async def volume(self, ctx, volume: int=None):\n player = self.bot.lavalink.players.get(ctx.guild.id)\n\n if not volume:\n return await ctx.send(f'🔈 **{player.volume}%**')\n\n await player.set_...
48396caa299375cb51992b31e43c3e59
Takes key delimiter to avoid false collisions
[ { "docid": "7dcf97ff70b889f82261618afbdd3bbb", "score": "0.0", "text": "def __init__(self, delim):\n \n self.__headers__= []\n self.__keys__ = []\n self.__delim__= delim", "title": "" } ]
[ { "docid": "034355288292464d0dae3d826be50cda", "score": "0.6467016", "text": "def key_to_path(self, key):\n assert type(key) == str\n if self.config['separator'] in key:\n return key.split(self.config['separator'])\n else:\n return [key]", "title": "" }, { "docid": "e75ff1...
d2c6b52742fafc7dd50224580b53e7da
Register an endpoint with this client.
[ { "docid": "b4e161884b7e6e24370777782bd9d197", "score": "0.0", "text": "def register(self, name, cls, routes):\n self.__dict__[name] = cls(self, routes[0], routes[1])", "title": "" } ]
[ { "docid": "8e9c617398c09504bf9c8a7a7e5c2be9", "score": "0.74871415", "text": "def register(self, endpoint):\n endpoint = endpoint if not self.prefix else self.prefix + endpoint\n self.routes.append((endpoint, self.handler))", "title": "" }, { "docid": "05b66432fa3d0bd4403cee00...
df15ea22cd573caba7e021139fb6add6
Updates configuration to continue parsing from the last state.
[ { "docid": "fe75c85fbfa26e293115d1958ec091d3", "score": "0.0", "text": "def configureLastEnv(self, lastBlock):\n\t\tself.lastOffset = self.db.getLastOffset(lastBlock.fileName)\n\t\tself.setDatFileList(lastBlock.fileName)\n\t\tself.blockCount = lastBlock.blockNumber + 1", "title": "" } ]
[ { "docid": "8c847d2d8c5d8e067e9b9c4cec258a93", "score": "0.67347", "text": "def config_reloaded(self):\n self.normalize_config()\n self.rebuild_alias_maps()", "title": "" }, { "docid": "ac27db10d59c79d20bbbffb7541fc7c3", "score": "0.657165", "text": "def reload(self):\n...
cdbfad92f73dfb254a59e293ab82bb5c
The ID of the basic GA instance.
[ { "docid": "10168b545ae147fb3b30235bea337f67", "score": "0.0", "text": "def accelerator_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"accelerator_id\")", "title": "" } ]
[ { "docid": "623bf3ecf10b26f32a0e22e015278b41", "score": "0.7669954", "text": "def analytics_id(self):\r\n return self.__analytics_id", "title": "" }, { "docid": "748ad9b2fba9e34c2af90a9740a955f9", "score": "0.71005523", "text": "def unique_id(self):\n return f\"{self.hass.d...
7751137b5ef6a8be9faa1f2ea7c6c57b
Encodes a Prensor into a tuple of lists of Tensors.
[ { "docid": "45a99029ad517ac5a66a7d00aa3e38fc", "score": "0.62981755", "text": "def _to_components(self, value: \"Prensor\") -> List[tf.Tensor]:\n result = []\n self._append_to_components(value, result)\n return result", "title": "" } ]
[ { "docid": "ffa4a990d841e423269f90aac54c0873", "score": "0.59007865", "text": "def encode(self, X: Tensor) -> List[Tensor]:\n return self.encoder(X)", "title": "" }, { "docid": "615d83ebd482ecaa56c904bb4eba76ba", "score": "0.5785119", "text": "def encode_tensor(obj: Tensor) ->...
d9c067aea9f5fa263434023f4e0cdca0
Stub method, no functionality so that calling ``.get_input_entity()`` from ``.resolve()`` doesn't fail.
[ { "docid": "caf590479c1c5e4deb68e1ad9f005bca", "score": "0.54916525", "text": "def get_input_entity(self, peer):\n return peer", "title": "" } ]
[ { "docid": "c6776fd5951f50f77a98f2827ca3787d", "score": "0.53908837", "text": "def _get_input(self):\n return self.__input", "title": "" }, { "docid": "c6776fd5951f50f77a98f2827ca3787d", "score": "0.53908837", "text": "def _get_input(self):\n return self.__input", "title": ...
d25728fa22bded19bc0c2391aeb198a2
If data is identical but at a different level in the tree, strip_template() will not find it.
[ { "docid": "20e0b7836f784a80bbc2864de19aabf5", "score": "0.47186264", "text": "def test_different_level(self):\r\n self.assertStrips(\r\n '<div><p>Foo</p><p>Bar</p></div>',\r\n '<p>Foo</p><p>Bar</p>',\r\n '<div><p>Foo</p><p>Bar</p></div>',\r\n 0,\r\n ...
[ { "docid": "0db6bc4ac2ff1dfc3d0d454d25159543", "score": "0.6451072", "text": "def strip_template(tree1, tree2, check_ids=True, debug=False):\r\n # TODO:\r\n # Solve the sidebar problem -- delete them\r\n\r\n # Assemble a list of trees to compare. Obviously, first we just compare the\r\n #...
f1b046b956850e508fcf55a6df4b6b7e
Collate function for PGL dataloader.
[ { "docid": "8178101d28df8f18d5dfdd9f1325e9e4", "score": "0.0", "text": "def __init__(self, graph_wrapper, label_name='Log10_Kd', is_inference=False):\n assert label_name in ['Log10_Kd', 'Log10_Ki', 'KIBA']\n super(DTACollateFunc, self).__init__()\n self.graph_wrapper = graph_wrapper...
[ { "docid": "d92a08224e9af357bb87b0169edadf67", "score": "0.6742523", "text": "def collater(self, samples):\n\t\treturn collate(\n\t\t\tsamples, self.src_embedding, self.tgt_embedding, self.src_dict, self.sql_dict, \n\t\t\tpad_idx=self.src_dict.pad(), eos_idx=self.src_dict.eos(), \n\t\t\tunk_idx=self.sr...
1b765e94847150c9962d5efd934b7ad4
Check that the GRIB2 URL exist and is of useful length.
[ { "docid": "576189b698c80c0c60c6cfe0bfefe259", "score": "0.76307017", "text": "def _check_grib(self, url):\n head = requests.head(url)\n check_exists = head.ok\n if check_exists:\n check_content = int(head.raw.info()[\"Content-Length\"]) > 1_000_000\n return ch...
[ { "docid": "204ea2128c5700896e1ad6969fecb6de", "score": "0.6853001", "text": "def checkUrlExists(window,url):\n\tcon = None\n\ttry:\n\t\tcon=db.connect('dlList.db')\n\t\tcursor = con.cursor()\n\t\tsql = \"SELECT * FROM downloads WHERE fileurl='\"+url+\"'\"\n\t\tcursor.execute(sql)\n\t\trows = cursor.fet...
7e8618d600b26c25ea152421e904908e
Initiate training in the framework.
[ { "docid": "3107dd14c7a1b9bc7e0d61ff6ac437e3", "score": "0.0", "text": "def train(self, nncfg=None):\n for nnpatch in self.nnpatches:\n for nnmodel in nnpatch.nnmodels:\n\n # If `nncfg` is already provided at NNModel creation, prioritize !\n if ((nnmodel.n...
[ { "docid": "c04dac0951e3d7f0955f14e704fab09e", "score": "0.8627881", "text": "def start_training(self):\n self.__init__()", "title": "" }, { "docid": "3dfadb6fb2382607383e18917e51ef57", "score": "0.8184445", "text": "def train(self):\n self.module.start_training()\n ...
f176e2207ac746f2af84b220abbd5d6d
ez_as_py.Window.get_rect() Returns the dimensions of the window.
[ { "docid": "b3f19e2eba6ae3e7aa3944f36429696d", "score": "0.8090245", "text": "def get_rect(self):\n\n return self._window.get_rect()", "title": "" } ]
[ { "docid": "a8725c2b8728a3ac539d861550ecbb31", "score": "0.80813", "text": "def get_window_rect(self):\n return self._selenium_web_driver().get_window_rect()", "title": "" }, { "docid": "dc06c84eba3e7d9bdbfdbf195fcfd780", "score": "0.7673315", "text": "def get_window_rect(wind...
126ed6e8cc263f3169177ded98785fb3
Stops the mojo shell.
[ { "docid": "fb731e4dd192d39fac66ae02a8ddbee4", "score": "0.6821146", "text": "def StopShell(self):\n subprocess.check_call(self._CreateADBCommand(['shell',\n 'am',\n 'force-stop',\n ...
[ { "docid": "deb13e56e09dd66c4b83baf4edb8bbf6", "score": "0.70763576", "text": "def stop(self):\n self.execute('pl_stop')", "title": "" }, { "docid": "54870459170defb80c47588d993b09ec", "score": "0.69280404", "text": "def stop(self):\n\t\tPopen([\"screen\", \"-S\", self.name, \...
05a5d5586961a6e30bf575dacccdff7a
The name of the Log Store.
[ { "docid": "851950395880187338a3968561079308", "score": "0.739993", "text": "def sls_logstore(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"sls_logstore\")", "title": "" } ]
[ { "docid": "e9740687d067a0cf19e6252460c0df26", "score": "0.8303079", "text": "def store_name(self) -> str:\n return pulumi.get(self, \"store_name\")", "title": "" }, { "docid": "5010d70b0c4cdfe1aba9bb172116dba0", "score": "0.8030705", "text": "def store_name(self):\n\n ...
095c89e054db19a35f4b9d6db87667c9
Try to get data about the board by parameter 'board_url'. Function is called upon GET request, checks request parameters and get data from DB if record exists
[ { "docid": "04915bb04d226f57f3da84c20d9eb072", "score": "0.7731758", "text": "def get_board(data):\n # validate all required fields exists\n for required_field in [\"board_url\"]:\n if required_field not in data.keys():\n err = f\"No '{required_field}' specified\"\n re...
[ { "docid": "73ccee6729593ec4a71baee0ddf10528", "score": "0.58711916", "text": "def get_boards(self) -> Optional[List[Board]]:\n http_method = 'GET'\n detail = 'boards'\n values = {}\n url_postfix = 'boards'\n response = None\n try:\n response = make_r...
9ba5ec79a9302af8d0123c4c9aad8a67
Sorts all the fabrics in the system in to physical shelves, taking into account maximum capacity, proximity grouping by pattern, and checking if there is actually quantity before assigning a shelf
[ { "docid": "aca164ffe7dc6941b1a4f576fa3a245d", "score": "0.74741846", "text": "def sort_fabrics():\n max_shelf_qty = Decimal('240')\n shelves = Shelf.objects.all().order_by('tower', 'name')\n current_shelf_index = 0\n shelf = shelves[current_shelf_index]\n cell_style = \"\"\"\n ...
[ { "docid": "b4cb2524fec347b6ea4a5fcff1ed1911", "score": "0.5964946", "text": "def PantrySorterEmptyShelf(Shelf: Shelf, stackableFood, unstackableFood):\n print(stackableFood, unstackableFood)\n unstackableFood = sorted(unstackableFood, reverse=True)\n stackableFood = sorted(stackableFood, rever...
6ac45f39cb1314b9c014133ecf90e9db
Convert the product attribute form a string to an enum and return it.
[ { "docid": "f8be53873402eb15ea70d1f29c7c3e7a", "score": "0.6536794", "text": "def product_as_enum(self):\n return Fit.field_enums.product_enum(self.manufacturer, self.product)", "title": "" } ]
[ { "docid": "32267688a1610b39258f5bd86ac3ab87", "score": "0.7099658", "text": "def convert_attr_type_to_enum(attr_value):\r\n if str(attr_value.type) == 'AttrType.INTS':\r\n return 7\r\n elif str(attr_value.type) == 'AttrType.UNDEFINED':\r\n return 0\r\n elif str(attr_value.type) =...
da0b6b90adf08064d06211309e30161c
Init. Remove if found. Convert to uppercase. Convert Os to 0s if found.
[ { "docid": "20f2ed6679f7ab64cf9345c9245666cb", "score": "0.0", "text": "def __init__(self, tag: str):\n if tag.startswith('#'):\n tag = tag[1:]\n tag = tag.replace('O', '0')\n tag = tag.upper()\n self._tag = tag", "title": "" } ]
[ { "docid": "d296894557ee5f0907bdb0319940102c", "score": "0.530492", "text": "def swapcase(self):\n return \"\"", "title": "" }, { "docid": "086fdf579ea6e309c3117571e27ef338", "score": "0.5259351", "text": "def __init__(self, inString):\r\n # replacing every keyboard symbol ...
9dc543c1b6023a5fcc5e4833ba4c797f
Returns the amount of damage this weapon will do
[ { "docid": "589d861fab5d94fe94d7d1d2b235c62f", "score": "0.0", "text": "def get_amount(self):\n return 5", "title": "" } ]
[ { "docid": "d071e053f13c61fa0c111ee136d462df", "score": "0.8673491", "text": "def damage(self, weapon):\n damage = self.ability_scores.strength.modifier\n for die in range(weapon.multiplier):\n damage += Dice.roll(weapon.damage_die)\n return damage", "title": "" }, ...
d31396fa7e71a367f792e2fd3dee2c06
A convenience method to create a Worker that uses a shared thread pool for performing operations for GUI clients in a background thread
[ { "docid": "f0bc37e7f8d034b9e1461a4fbe8fc835", "score": "0.75226104", "text": "def createGuiWorker() -> ghidra.util.worker.Worker:\n ...", "title": "" } ]
[ { "docid": "d033a6b043ea48866266aacd0e9d067c", "score": "0.71658456", "text": "def create_worker(self):", "title": "" }, { "docid": "b26e67465cf3a9098c42cf2a2533bda0", "score": "0.6285358", "text": "def worker_pool(self, *, max_workers=None):\n return concurrent.futures.Thread...
458659e045cff9aa4dc4d0a41aa4ed9d
Stop the client. Must be invoked when done with the client for graceful exit. If already stopped, will not do anything. Cannot be cancelled if you try, the client will still fully shut down as much as possible, although CancelledError will still be raised.
[ { "docid": "57620fd574d7a038b1ee2c20ccbaddad", "score": "0.6313185", "text": "async def stop(self) -> None:\n cancelled_tasks = []\n logger.debug(\"Stopping ProvisioningMQTTClient...\")\n\n if self._process_dps_responses_task:\n logger.debug(\"Cancelling '_process_dps_res...
[ { "docid": "4a6bf9e069d2867b325f8891a1068339", "score": "0.7935486", "text": "def stop(self):\n self.info(\"Stopping client\")\n with self.__lock:\n self.__isocket.disconnect(self.__raddr)\n self.__isocket.close()\n\n self.__done = True\n\n self.__ba...
b6d7b86e4b7bd65a0ada5fbd5a190a1b
Initialize internal set which will hold all tokens.
[ { "docid": "180d6e6813da247d9c756bbaaac23ba4", "score": "0.7904349", "text": "def __init__(self):\n self._tokens = set()", "title": "" } ]
[ { "docid": "0c47979dfc53180adde213d01b1ccd89", "score": "0.6796376", "text": "def __init__(self):\n\t\tself.s = set()", "title": "" }, { "docid": "02efeb7887570eb52bfc0a23403e9739", "score": "0.6761306", "text": "def __init__(self):\n self.all_words = set()\n self.uniqu...
01c89c0f326c0ef8a2645d1ed77f5ee1
Take a list of blocks and place them into the world in one go.
[ { "docid": "c78b2f5eb4f94285754458a48d9118a6", "score": "0.52899325", "text": "def sendBlocks(blockList, x=0, y=0, z=0, retries=5, flags='0100011'):\n body = str.join(\"\\n\", ['~{} ~{} ~{} {}'.format(*bp) for bp in blockList])\n try:\n response = setBlock(x, y, z, body, flags)\n ret...
[ { "docid": "f3b2707d26453c19feb0ecb5eb8cd48a", "score": "0.6527537", "text": "def update_body_blocks(self) -> None:\n for i in range(0, len(self.body_blocks) - 1):\n self.body_blocks[i].setpos(self.body_blocks[i + 1].pos())", "title": "" }, { "docid": "9909accc7b21b06034cd9...
7b201d064d8a0dad0a690c43f7b08b79
Return a randomly shuffled copy of a list
[ { "docid": "e9b8bf65db11c18fca07b2f27e6b7946", "score": "0.80562687", "text": "def shuffle(input_list):\n output_list = list(input_list)\n random.shuffle(output_list)\n return output_list", "title": "" } ]
[ { "docid": "6ec0efb610d74977bfdf18b035d06be7", "score": "0.8064399", "text": "def sample_list(l):\n outl = l[:]\n random.shuffle(outl)\n return outl[0]", "title": "" }, { "docid": "3b6a6728b7215bc758b15f145b70a21b", "score": "0.795556", "text": "def partial_shuffle_orig(ls, ...
e0ddcae60b69a4318a11a246c1454df9
Applies 2D Gaussian Blur.
[ { "docid": "224cc2963a2ab7b5c1f2b34bf9aa12ba", "score": "0.0", "text": "def __init__(self, in_channels, out_channels, ksize=5):\n\n super(GaussianConv2d, self).__init__()\n weight = (np.arange(ksize, dtype=np.float32) - ksize // 2) ** 2\n weight = np.sqrt(weight[None, :] + weight[:, None])\n ...
[ { "docid": "687ae079bfddc7119b5409b0a5bdd133", "score": "0.7160371", "text": "def _gaussian_blur(self, img, kernel_size):\r\n return cv2.GaussianBlur(img, (kernel_size, kernel_size), 0)", "title": "" }, { "docid": "50efc7ccae0b729fdb6b07bd4e9a7ca3", "score": "0.70999116", "tex...
5986bd6a59c7c3d96fa913666a852520
Get the tools name by locating the line starting with 'STATS SUMMARY' which contains the tool name in the format e.g 'STATS SUMMARY blr.cli.tool_name. Return tool name
[ { "docid": "9b1cfc2336ee1482c2814c3c7d9e4afd", "score": "0.79888105", "text": "def get_tool_name(file):\n for line in file:\n if line.startswith(\"STATS SUMMARY\"):\n return line.strip().split(\".\")[-1]\n\n return None", "title": "" } ]
[ { "docid": "9d45da86d3750ac2f3c9160162bb916c", "score": "0.6053547", "text": "def GetInfo(self, tool):\n return (INFO % tool.replace('\\\\', '/'))", "title": "" }, { "docid": "924224d8f4de85f9f0c86155e8c450d4", "score": "0.5898121", "text": "def extract_tool_details(self, node):\n...
696d3c1b102fbc3a1cbd5a1e81a7febb
Get a list of tracks and save them to the database Return the number of track saved
[ { "docid": "ed30a712872bcfd2eb98e0d4efd63b99", "score": "0.53171325", "text": "def write_track_to_datastore(track, user, location): \n logging.info(\"Saving track \\\"%s\\\" by \\\"%s\\\" (id: %s, created at: %s) to datastore ...\" % \\\n (track['title'], user.username, track['id'], track[...
[ { "docid": "7113dbafa0725fb0b398d2bfaf371758", "score": "0.65143496", "text": "def getTrackCount(self):", "title": "" }, { "docid": "c22c60d02e82c1160fd75ea7d88939ed", "score": "0.6346815", "text": "def task_7_song_counter():\n list = Song.objects.all()\n return len(list)", ...
33b66aeb908a685ae028f257f6cdab5c
returns y_predicted.shape[2] binary clf curves calculated axis[1]wise this is a numpy implementation
[ { "docid": "1a2d8e903a57cfb31df4f796ac19f1ca", "score": "0.7147785", "text": "def _last_axis_binary_clf_curve(y_true, y_predicted):\n assert y_true.shape == y_predicted.shape\n axis = -1\n sort_idx = list(np.ogrid[[slice(x) for x in y_predicted.shape]])\n sort_idx[axis] = y_predicted.argsort...
[ { "docid": "e6770e82198d0d0915e0a55298116c41", "score": "0.7294076", "text": "def predicty(self, x):\n \"\"\" checked: yis0 + yis1 = 1, even with posteriorLabelGivenHypo \"\"\"\n yis0 = np.zeros(1)\n yis1 = np.zeros(1)\n for iconfig in range(self.ntotPerm):\n y = s...
101d81614ab0a5a889c0c5c8f30c8a93
Method to get all connection types
[ { "docid": "1c2bedd0979e2655c426ccbacf5c59b7", "score": "0.75797945", "text": "def connectionTypes(request: HttpRequest) -> Response:\n if request.method == \"GET\":\n res = Connections.getConnectionTypes()\n return Response(res.json())", "title": "" } ]
[ { "docid": "98b5f976a955658a2f18d8853d873c9f", "score": "0.70869887", "text": "def network_connections(self, type: str = 'inet') -> List[dict]:\n schema = ConnectionSchema()\n return schema.dump(\n schema.load(psutil.net_connections(kind=type), many=True), # type: ignore\n ...
3ed796d7fb0d790e934c120b07f97043
Will produce the isolation source linear combination predictions.
[ { "docid": "36765d0d6933adb56f64042231c3107b", "score": "0.0", "text": "def seqenv(self):\n return Seqenv(self, self.p.seqenv_dir)", "title": "" } ]
[ { "docid": "98a17fef7ec9649ac5bc58e7b786d499", "score": "0.5872101", "text": "def predict(self, cfg):", "title": "" }, { "docid": "3d2569a6dfe82ae752eb4dc1b5e5c312", "score": "0.57712275", "text": "def linear_nonlinear_combining_model():\r\n# combining_type = ['arima_ffnn', 'arima...
b15d38c3c411fae60885cd3a5ea2f768
Here we know the architecture num_nodes = num_inter + 2, so we add another 1
[ { "docid": "6f301c58d3a55bc85294f05fb5ae76fc", "score": "0.0", "text": "def generate_arch(self, n, num_nodes, num_ops=8):\n # def _get_arch():\n # arch = []\n # for i in range(2, num_nodes):\n # p1 = np.random.randint(0, i)\n # op1 = np.random.r...
[ { "docid": "b090a3bd6217391aa1e78b910d578ed3", "score": "0.5962054", "text": "def number_of_edges(self):", "title": "" }, { "docid": "7bbfecdfee7c69775885f676dc237ff0", "score": "0.5906666", "text": "def add_node(self, node_for_adding, **attr):\n\n self.num_states += 1\n\n ...
ec8f1251875f46906e98641a9876f069
Test all known migration cases.
[ { "docid": "46833f24f414b7e1599600f9531df70b", "score": "0.0", "text": "def test_compiled_string_is_expected():\n builder = DjangoTagMigrationBuilder()\n file_migration = builder.build_migration(DJANGO_TEMPLATE)\n compiled = file_migration.compile()\n assert compiled == TRANSIFEX_TEMPLATE\n\...
[ { "docid": "c12c7465e867794386171e686d0362be", "score": "0.7462017", "text": "def run_migration_checks():\n check_model_state()\n check_migration_state()", "title": "" }, { "docid": "0336de207b599a5978811d3f4062925c", "score": "0.7103489", "text": "def migration():", "title...
ce1c96a4d80733f9dded1747970509c6
Uses the frequency as the fit parameters
[ { "docid": "4e7b8a5e8df2789f646c09fbe8cd8f6e", "score": "0.0", "text": "def get_fit_old(self):\n def fit_PSD_target_function(f, f_QP, f_RO):\n tail = True\n # tail = False\n if tail:\n return (4 * f_RO ** 2 * f_QP) / ((2 * f_QP) ** 2 + (2 * np.pi * ...
[ { "docid": "4a53186e3fdf2d627b95ae8f897e6ed3", "score": "0.70693344", "text": "def set_frequency(self, frequency):", "title": "" }, { "docid": "a7ad01f2056a664fe2cdc21a5693024b", "score": "0.66535306", "text": "def fit(self):", "title": "" }, { "docid": "a7ad01f2056a664fe...
28e8d58e031b6e9984ce908b755a5e1d
Update parameter dictionary, while also performing some basic checks.
[ { "docid": "ca91c3445747af00598d0000a0615a04", "score": "0.0", "text": "def update(self, values, check_conflict=False, check_already_exists=True, path=\"\"):\n # check if values is not a dictionary\n if not isinstance(values, dict):\n values = values._dict_items\n # check...
[ { "docid": "b6f27b5b1708baf25527a92069a0bb4d", "score": "0.7634509", "text": "def update_parameters(self):", "title": "" }, { "docid": "52a41537d757e88af18f861bdb7b2c79", "score": "0.75093085", "text": "def update_params(self) -> None:\n raise NotImplementedError", "title"...
7dcb2c2e1cd2aabf754f610640b6b72d
Return the node corresponding to line n of external file given by path.
[ { "docid": "e096dfb90f0f6450e621e8b673c3c206", "score": "0.7063621", "text": "def find_line(path: str, n: int) -> tuple[Position, int]:\n if path == root_path:\n p, offset = c.gotoCommands.find_file_line(n, root)\n else:\n # Find an @<file> node with t...
[ { "docid": "9782e0ee913fb0e1297522a755a2c9c4", "score": "0.61165345", "text": "def getLineNumber(lnr, path):\n global realmap\n lnr = int(lnr)\n\n if not path in realmap:\n realmap[path] = getDecoded(path)\n\n if realmap.get(path) == \"not found\":\n return str(lnr)\n\n lastLn...
ecb3abf80a6c753d2a9bb905fc601082
It is an array of string values. If the operator is In or NotIn, the values array must be nonempty. If the operator is Exists or DoesNotExist, the values array must be empty.
[ { "docid": "83bedbf18fa8b31ed46d6fdafb101161", "score": "0.46206558", "text": "def values(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"values\")", "title": "" } ]
[ { "docid": "2144af1d3298794a7da56c26a4c8fea0", "score": "0.6495714", "text": "def contains_operator(metadata, values, logical_operator=\" or \"):\n if isinstance(values, (list, tuple)):\n filters = [f\"contains({metadata},'{item}')\" for item in values]\n filters_joined = logical_operat...
4a1939a5eb8a098543846af3f2c5decb
method which returns the status (1 for win of 1, 2 for win of 2, 0 for full board and a tie) we decided to keep the numbers as numbers and not as constant because we because we have noticed that the constants create more confusion in this case after a conversation with lab support
[ { "docid": "454fd2f109148f7d7a8a5fd2f612be93", "score": "0.0", "text": "def get_winner(self):\r\n\r\n\r\n player = self.get_current_player()\r\n\r\n\r\n for i in range(self.ROWS):\r\n\r\n for j in range(self.COLOUMNS - 3):\r\n\r\n if self.board[i][j] == player and...
[ { "docid": "518cc98d4e81758d6d7a4d60382824b4", "score": "0.7457999", "text": "def check_status(mat, stat):\n if stat == GAME_OVER:\n return GAME_OVER\n for r in range(len(mat)):\n if COAL_CELL in mat[r]:\n return PLAY\n return WIN", "title": "" }, { "docid":...
44d2eda6e096b216d06513fa51569107
Saidas do bairro de sabados, domingos e feriados
[ { "docid": "379dc0eb871f2c7d74aefb80aa0e57e1", "score": "0.0", "text": "def SaidasBairroSabadosDomingoseFeriados6823(self, msg, args, flow_only=True):\n try:\n yield msg.ctx['z52'] + \"\"\"\nEsse onibus nao possui horario nesses dias, deseja consultar as empresas?\n-> /empresas\"\"\"\n...
[ { "docid": "618777769afbe97dc7f9f8b42bdbeaab", "score": "0.68243456", "text": "def SaidasBairroSabadosDomingoseFeriados178(self, msg, args, flow_only=True):\n try:\n yield msg.ctx['z5'] + \"\"\"\nSabados:\n|06:00| A D\n|06:45| \n|07:30| D\n|08:30| A D\n|09:30|\n|10:30| A D\n|11:00| SC ...
b8931249e149b6f7e5829d521b73dc28
Ensure we can create a new account object and it returns status code as 201.
[ { "docid": "d448f0b7f5691e066ec1b8497ab7f3ed", "score": "0.0", "text": "def test_given_valid_details_for_registration(self):\n\n response = self.client.post(self.register_url, self.valid_registration_data, format='json')\n self.assertEqual(response.status_code, status.HTTP_201_CREATED)", ...
[ { "docid": "54b1493f11cffca22ef66264bd13bcfe", "score": "0.7521507", "text": "def test_create_account(self):\n\n response = self.client.post(\n '/api/v1/users', data=json.dumps(create_account), content_type='application/json')\n result = json.loads(response.data.decode())\n ...
3916e3eb546ea428885852405cc3f11e
Ensambla el sistema de ecuaciones
[ { "docid": "5ae8f9ab0e1f89c7367e33b976ebc38c", "score": "0.53271186", "text": "def ensamblar_sistema(self):\n \n Ngdl = self.Nnodos * self.Ndimensiones\n\n self.K = np.zeros((Ngdl,Ngdl), dtype=np.double)\n self.f = np.zeros((Ngdl), dtype=np.double)\n self.u = np.zeros(...
[ { "docid": "230aeb41b55eff2e4983667e22fba701", "score": "0.6246159", "text": "def iniciaconfiguracion():\n\tos.system(\"CLS\")\n\truta = os.getcwd()\n\trutatask = ruta + \"\\\\syncloud.exe\"\n\ttimetask = \"\"\n\tkey = _winreg.CreateKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\\\Olesistemas\\\\syncloud')\...
2541eb9e1e33ce147bdb8184afa7d8db
Returns a secure filename that is mostly guaranteed to be unique.
[ { "docid": "210a598d950e07f6021996eb18ce2257", "score": "0.7789519", "text": "def secure_uuid_filename(_obj, data):\n\n _, ext = path.splitext(data.filename)\n uid = uuid1()\n return secure_filename('{}{}'.format(uid, ext))", "title": "" } ]
[ { "docid": "8fcf0c370b38efe3b8877bdd8508d2ad", "score": "0.79068273", "text": "def generate_secret_filename_for(filename):\n secret = os.urandom(constants.FILENAME_SECRET_LENGTH).hex()\n return secret + filename", "title": "" }, { "docid": "dc03048562e6273eb0e7720bb1857366", "score...
6eb19d0511ab549c0fa61b646922241f
Called after an object has been moved into this object. Anything inside a character is an item, in their inventory or equipped. It's assumed that coordinate 0 is the character's inventory, and coordinates 1+ are their equipment slots.
[ { "docid": "3d7df2a78ba3426f8d90607e1587d03b", "score": "0.51111734", "text": "def at_object_receive(self, obj: DefaultObject, source_location: typing.Optional[DefaultObject], move_type=\"move\", **kwargs):\n obj.db.coordinates = 0", "title": "" } ]
[ { "docid": "fee4d1485ac8e479d3529f2925b77351", "score": "0.61136115", "text": "def move_being_on_map(self, obj, dx, dy):\n newx = obj.x + dx\n newy = obj.y + dy\n # checks\n self.rules.assert_remove_ok(obj)\n self.rules.assert_unoccupied(obj.place, newx, newy)\n ...
1e3e6aca4e87ac8d47d5b6e268cb6a89
Delete singleton for given arguments in a class decorated with SingletonWithRegardsTo
[ { "docid": "85015b99acc71fc329f8ac21ee521fd7", "score": "0.7398244", "text": "def delete_singleton_for(x, *args) -> None:\n del x.__it__[args]", "title": "" } ]
[ { "docid": "3287075af136606fc1de66d043c06c40", "score": "0.6534979", "text": "def singleton(cls):\n \n # Ex: from class 'Fucker' to singleton name \"_FuckerSingleton\"\n # 'closure' for the class name, needed to recover the global object name:\n singletonName = '_{}Singleton'.format(cls.__n...
793273eae081136d8f3febb8da253e13
Get the boolean value for a given config parameter.
[ { "docid": "93fc056817c3321dd9b9a5b6340c474d", "score": "0.7363348", "text": "def getConfigBoolean(category, identifier):\n global config\n return config.getboolean(category, identifier)", "title": "" } ]
[ { "docid": "b2ae98a2a0e1024fbd755982bb0f400a", "score": "0.79825675", "text": "def get_bool(self, name, default=False):\n param = self.module.params.get(name, default)\n\n if param in (True, False):\n return param\n elif isinstance(param, str):\n return BOOLEAN...
c7bc01c8c595a41fbdf5c05e887f3f7a
Return list of column names.
[ { "docid": "a8a1f72d635808bf5123e00e24d47356", "score": "0.75188255", "text": "def columns(self):\n if self._default_index:\n return list(self._df.columns)\n return list(self._df.index.names) + list(self._df.columns)", "title": "" } ]
[ { "docid": "b50d29d4eb3280d1ab00bfa8ce62d58b", "score": "0.87906796", "text": "def getColumnsNames(self):\n self.do('show columns from ' + self.__nameTable + ';')\n return list([name[0] for name in self.done()])", "title": "" }, { "docid": "715fc82ab8aac2989f607f23723d0699", ...
e83d260d7944ed2df03968de04210f5e
Selectionne toute les equipes
[ { "docid": "ed0a094b03dc336c2dbcf9cba7d0d249", "score": "0.0", "text": "def nom_equipes(id_equipe):\n c=conn.cursor()\n p = (id_equipe, )\n c.execute(\"\"\"SELECT nom FROM TEAM WHERE id = ?\"\"\", p)\n r=c.fetchall()\n return r[0][0]", "title": "" } ]
[ { "docid": "fc04a92527757372ee40f2afea1f1ae0", "score": "0.5983597", "text": "def select( self ):", "title": "" }, { "docid": "50cf8f958d662ede8e29dba741222c64", "score": "0.58359784", "text": "def GetSelectedScalarComponents(self):\n ...", "title": "" }, { "docid"...
99c0d72e525d482329b2e642eb8c4c8b
Reset state_identifiers to None
[ { "docid": "e6e6ca6d6b2e6722e34171e9ebc6f862", "score": "0.88936627", "text": "def reset_state(self):\n self.state_identifiers = {k:None for k in self._get_state()}", "title": "" } ]
[ { "docid": "3711c9c93b006e8b4cf3574e222340bb", "score": "0.7362603", "text": "def reset_state(self):", "title": "" }, { "docid": "38bcc6fe5d3b74fe76d2c3754b12f469", "score": "0.7149735", "text": "def reset(self, state):\n pass", "title": "" }, { "docid": "48a521a59...
588065c092536f7288acf9dbfbdc684a
Start the FTP client
[ { "docid": "c87cc3a7d39919e3dc281d1fb5e9d120", "score": "0.7409453", "text": "def start(self):\n while True:\n try:\n userInput = raw_input('ftp>')\n except KeyboardInterrupt:\n self.commandSock.close()\n break\n\n if u...
[ { "docid": "40a5e6d4c8c6e9800aed333d8fbbeba8", "score": "0.7501968", "text": "def startFtp(self, host, port):\n self.ftpfactory = factory = FileClientFactory(self) # setting up the factory\n factory.protocol = FileClientProtocol\n factory.deferred = defer.Deferred()\n factory...
9ac724d1ba5c72f1a5fe4c4654ab92af
1. If value is bigger than Node, go right. If empty, add Node. 2. if value is smaller than Node, go left. If empty, add Node. 3. if value is same as Node, overwrite and return.
[ { "docid": "d303aa8d096e0c55418dde460440f6a9", "score": "0.6986899", "text": "def insert(self, value): \n if value > self.value:\n if self.right is None:\n self.right = Node(value)\n else:\n #Insert on right node. \n self.right.insert(value)\n\n if value < self.value...
[ { "docid": "cc0d4b56d0a03baa884dd027f8872a66", "score": "0.7236795", "text": "def add(self, value: object) -> None:\n # make new node\n new_node = TreeNode(value)\n\n\n\n if self.root is None:\n self.root = new_node\n\n else:\n current = self.root\n ...
441d22117b67a3254b48a5d80db5e675
Searches through the class's attrs for methods with the same name as HTTP ones and adds the bottle.request decorator to them. The route is set via self.route .
[ { "docid": "46576f42443c93c02aa41745f2b78883", "score": "0.69266075", "text": "def __new__(cls, name, bases, attrs):\n if 'route' in attrs: # to allow inheritance\n # Get the given route\n # or routes if a list is provided\n routes = attrs['route']\\\n ...
[ { "docid": "23abe07965fcb8e4521a1b2d07e3cff9", "score": "0.6665122", "text": "def __getattr__(self, name, *args, **kwargs):\n if name not in ('get', 'post', 'put', 'head', 'delete'):\n raise AttributeError\n return partial(self._request, name, *args, **kwargs)", "title": "" ...
454fdc73af98476e48abd7b0554cd692
Arms vehicle and fly to aTargetAltitude.
[ { "docid": "29bf935b4f5da125599c399f93de029e", "score": "0.74334264", "text": "def arm_and_takeoff(aTargetAltitude):\n\n print(\"Basic pre-arm checks\")\n # Don't try to arm until autopilot is ready\n while not vehicle.is_armable:\n print(\" Waiting for vehicle to initialise...\")\n ...
[ { "docid": "af213d26adaf5f294494c15dc4f2d00c", "score": "0.7867513", "text": "def arm_and_takeoff(self, aTargetAltitude):\r\n print(\"Basic pre-arm checks\")\r\n # Don't let the user try to arm until autopilot is ready\r\n while not vehicle.is_armable:\r\n print(\" Waitin...
f603e37c07d87db035c521a1654b497b
currently only suppor one example at a time
[ { "docid": "c0621f075dbd648f6f37506eded4f33b", "score": "0.0", "text": "def saliency_expl(expl_method, Xs, ys, model):\n print('Computing explanation by {}...'.format(expl_method))\n\n assert Xs.shape[0] == 1\n assert ys.shape[0] == 1\n\n if expl_method == 'SG':\n sg_r = 0.2\n ...
[ { "docid": "f84a606a4456d9f6f52b70f06ae01465", "score": "0.70378304", "text": "def add_examples(self,src):\n return", "title": "" }, { "docid": "1274e76c0963b153550760a5a6822c52", "score": "0.6776039", "text": "def sample(self):\n pass", "title": "" }, { "do...
79741a40c9400c9e7569054ca8891dc6
example function to load model The prefix allows the loading of different models
[ { "docid": "fcd7e1764c0ffc983e0b39ea4aff7f8d", "score": "0.76179326", "text": "def model_load(prefix='sl',country='all', training=True):\n \n models = [f for f in os.listdir(MODEL_DIR) if re.search(\"sl\",f)]\n\n if len(models) == 0:\n raise Exception(\"Models with prefix '{}' cannot be ...
[ { "docid": "c0fd5de7decb08a60cafccf195b1f345", "score": "0.76663965", "text": "def loadmodel(self, nameprefix):\n self.topicmodeler.loadmodel(nameprefix)", "title": "" }, { "docid": "97c0da6e305b6175b926cc9ce18bb622", "score": "0.76616585", "text": "def load_model():\n pass...
22309e7e09d72f5df4eb925c102f7779
CreateFilmSchema accepts a valid title
[ { "docid": "1ad064f3127428bf4539e89d332f18a6", "score": "0.6432382", "text": "def test_title_passes_validation(self):\n result = self.schema.deserialize(self.params)\n self.assertEqual(self.params['title'], result['title'])", "title": "" } ]
[ { "docid": "85eb6fd2eec38707529103ac3078cfba", "score": "0.63343024", "text": "def create_movie():\n body = request.get_json()\n validated_body = {}\n required_fields = ['title', 'release_date']\n for field in required_fields:\n resp = body.get(field, None)\n if resp is None:\n...
daa1ef20b040cb30b2c08026e8c2b7d8
Draw a pixel at (x,y) on the given canvas
[ { "docid": "0995007b44a80ad80146cc37fd0a1fff", "score": "0.7908712", "text": "def draw_pixel(canvas, x, y, color='#FF0000'):\n x1, y1 = x - 1, y - 1\n x2, y2 = x + 1, y + 1\n canvas.create_oval(x1, y1, x2, y2, fill=color, outline=color)", "title": "" } ]
[ { "docid": "eb9d7b8bdc51c63d8b12792d5b48a0d3", "score": "0.7462939", "text": "def draw_pixel(self, x, y):\n # TODO Support for colors\n if (x, y) not in self.coord2rectangle:\n r = self.canvas.create_rectangle(x, y, x+1, y+1, fill=\"black\")\n self.coord2rectangle[(x,...
4ff1bc27f33dfb14c2e012b3e212a2a1
Ensure virtual machine endpoint returns a valid response
[ { "docid": "defb997169eda472584e5d8d9cd0b157", "score": "0.6642315", "text": "def test_endpoint_virtual_machine(self):\n\n for i in range(60):\n utils.build_vm_full(f\"api-test-vm-{i}.example.com\")\n\n resp = self.client.get(\"/api/plugins/prometheus-sd/virtual-machines/\")\n ...
[ { "docid": "67a12dd4e5a05e76ce0ee3a18313dd21", "score": "0.6154137", "text": "def verify(self, response):", "title": "" }, { "docid": "41f9543e83d54ae65b2a593f033a6b4d", "score": "0.60561776", "text": "def check(self, response):\n pass", "title": "" }, { "docid": "...
e99ea12864f0f0d98f66a723a580ef33
Find all water touching point (i,j) and set to ii. The recursive version works for teeny, tiny grids only, so we need another way.
[ { "docid": "1a6ad161e90035cd4a4d77e21a0f1e1a", "score": "0.67142487", "text": "def flood_fill_water(imask, i, j, ii):\n Mp, Lp = imask.shape\n Lm = Lp-2\n Mm = Mp-2\n jj = imask[j,i]\n\n llist = []\n llist.append((j,i))\n while len(llist) > 0:\n (j,i) = llist.pop()\n i...
[ { "docid": "419f98b652d4ab344feb2043d0c6ed25", "score": "0.5981496", "text": "def swimInWater(self, grid: List[List[int]]) -> int:\n\n n = len(grid)\n\n to_visit = []\n\n def add_to_visit(i, j):\n heapq.heappush(to_visit, (grid[i][j], i, j))\n\n def neighbors(i, j)...
00f6d034adfcd3beaf86e7505d0ae22f
Start the agent after initialisation.
[ { "docid": "1491c91070d75bdf257c2ff5acaeafb3", "score": "0.7184218", "text": "def on_initialized(self) -> None:\n self.start()", "title": "" } ]
[ { "docid": "3b4be7c1b90499b9dfd73790ef730100", "score": "0.78729284", "text": "def agent_start(self, state):\n pass", "title": "" }, { "docid": "232a87f307a67be276259c654c633733", "score": "0.7734188", "text": "def init_agent(self):", "title": "" }, { "docid": "4eb...
398a8a80ee96b0ca0e45d459aeaefb5d
BGR format, packed into 2 bytes by dropping LSBs.
[ { "docid": "7ffc6cbaac3fab19fdefcecb63cfc96c", "score": "0.53539056", "text": "def save_bgr565(pixels: Array, data: bytearray, width: int, height: int) -> None:\n for offset in range(width * height):\n data[2*offset], data[2 * offset + 1] = compress565(\n pixels[4 * offset + 2],\n ...
[ { "docid": "06a6a687383b0f339c9d45e713944124", "score": "0.648248", "text": "def rgb2bgr(tpl):\n return (tpl[2], tpl[1], tpl[0])", "title": "" }, { "docid": "187a8dd5a5e69a8eec16f24f10e9f27a", "score": "0.637679", "text": "def from_rgb2bgr(im):\n return cv2.cvtColor(im, cv2.COLOR...
e12dde588b95e7dc2285219334173982
Creates the logistical function for percent increase in exp.
[ { "docid": "70f7cf4e4f10fc320823fa801ad7d3b2", "score": "0.6326081", "text": "def exp_algorithm(self):\n exp_logistic = 1 / (\n 3 + math.exp(-(3 / 4) * (self.playerLevel / 16) - 4)) + 1\n return exp_logistic", "title": "" } ]
[ { "docid": "f1bc095663e2201c1472cfae0a3b0016", "score": "0.7222441", "text": "def log(x):\n return 1 / ( 1 + math.exp(-x))", "title": "" }, { "docid": "427a834b19c5cab5d04c7074822f5036", "score": "0.70191973", "text": "def exp(x):\n return F.exp(x)", "title": "" }, { ...
76d8a4a962caf2411134a7ab3da14128
Sort the segments in blue and red
[ { "docid": "2546b0ed2ad9cad8b4b2ae20845f8f6f", "score": "0.8025422", "text": "def sort_segments(case):\n blue = []\n red = []\n for segment in case:\n\n if segment[-1] == 'B':\n blue.append(int(segment[:-1]))\n else:\n red.append(int(segment[:-1]))\n\n # s...
[ { "docid": "1355250a07537a8dcc0629f5dc7e0575", "score": "0.6966242", "text": "def sortColors(self, nums) -> None:\n end, end_0, start_1, start_2, count_1 = len(nums) - 1, -1, -1, -1, 0\n for i in range(end, -1, -1):\n if nums[i] == 2:\n start_2 = i\n el...
1ab6d1d0f03396b3d9278e24a23c3d29
Use the given status structure and upate all of the redis variables with the current values.
[ { "docid": "373481df6af4d56f205a3446b94fda97", "score": "0.7114745", "text": "def updateRedis(self,status):\n\n self.redis.set('pumpcall',status['PC'])\n self.redis.set('pumpon',status['P'])\n self.redis.set('northcall',status['NC'])\n self.redis.set('northon',status['N'])\n ...
[ { "docid": "13f3868cf43499654a670d77e85c5e99", "score": "0.6291984", "text": "def updateStatus(self):\n\n try :\n st = self.api.getSystemStatus()\n\n if st:\n self.updateRedis(st)\n\n bFast = False\n for key in ['P','PC','N','NC','S','SC'...
3f40489d1f123e20b33fb7002aa842da
get the last execution result of the EoX API auto sync
[ { "docid": "f09a18a493f4a14a124658503b9a2d05", "score": "0.795451", "text": "def get_cisco_eox_api_auto_sync_last_execution_result(self):\n return self._config_options[ConfigOption.CISCO_EOX_CRAWLER_LAST_EXECUTION_RESULT]", "title": "" } ]
[ { "docid": "b6025beb0654ff0149e33ae1f554e28d", "score": "0.68530107", "text": "def get_cisco_eox_api_auto_sync_last_execution_time(self):\n return self._config_options[ConfigOption.CISCO_EOX_CRAWLER_LAST_EXECUTION_TIME]", "title": "" }, { "docid": "32229a5cc40f87b900278b6fac6d9fa3", ...
6358dfa57d11a64dec215b90d16ad948
generated source for method parseAndGetClassForMessage
[ { "docid": "35bae810b20ef8b26a8550ad4e6b7e87", "score": "0.7376051", "text": "def parseAndGetClassForMessage(cls, message):\n try:\n json_obj = json.loads(message)\n if json_obj is None:\n # Nothing found\n raise Exception(\"Could not find [\" ...
[ { "docid": "9693b8b81c159ca8ea2de795504711e8", "score": "0.6514559", "text": "def _parse_msg(self, msg):\n raise NotImplementedError(\"Implement!\")", "title": "" }, { "docid": "5594dba28b3e43f98d8eba50df9e984e", "score": "0.650433", "text": "def generate_message_classes(messa...
a098c3b6f3646c90f7b6e6f563f3ac81
Write values from row of septwq table using cursor and sql, using num for the first element.
[ { "docid": "4a18dea0a97aaebfd50360a841c4eb2d", "score": "0.75467116", "text": "def writeSeptRow(self, num: int, row: List[Any], cursor: Any, sql: str) -> None:\n data = (num, row[1].lower()) + tuple(row[4:7]) + tuple(row[8:12]) + tuple(row[13:16]) + (row[2],)\n cursor.execute(sql, data)", ...
[ { "docid": "aaafeb3175ba43a527c8dfb69b771262", "score": "0.71464074", "text": "def writePestRow(self, num: int, row: List[Any], cursor: Any, sql: str) -> None:\n data = (num, row[2].lower()) + tuple(row[3:7]) + (row[8], 0, 0, 0, 0, 0, 0, 0, 0, row[10])\n cursor.execute(sql, data)", "ti...
b2c5a670fd92894d410e96d40abdcf0e
Return a dictionary mapping package to recipe name.
[ { "docid": "dd851b24009a5f0216ea3f9c824a09c4", "score": "0.534241", "text": "def _pkgmap(d):\n\n target_os = d.getVar(\"TARGET_OS\", True)\n target_vendor = d.getVar(\"TARGET_VENDOR\", True)\n basedir = os.path.dirname(d.getVar(\"PKGDATA_DIR\", True))\n\n dirs = (\"%s%s-%s\" % (arch, target_...
[ { "docid": "15852747fb8674970bb432c0bdfb20d2", "score": "0.61707795", "text": "def recipes():\n return {'recipes': [recipe(), recipe()]}", "title": "" }, { "docid": "40cf200d1b8aefffb7a98b88a7f76b4d", "score": "0.61030656", "text": "def packages_from_entry(self, entry):\r\n ...
923aa58fcc2054b3c100e2f5d852d0ad
This tests to see if the function that removed quotes worked and that there are no remaining quotations in the data
[ { "docid": "b4f723e2ff61fcd43c3cec1e918d1837", "score": "0.8019426", "text": "def test_replace_quotes():\n df_result_quotes = replace_quotes(output_not_cleaned)\n assert '\"' not in df_result_quotes.values\n print('TEST PASSED, for replace_quotes')", "title": "" } ]
[ { "docid": "5d27fa81384f85a59c3d6ccc79418bb4", "score": "0.6825093", "text": "def test_remove_quotes(self):\n # Set up\n sample_sheet = CasavaSampleSheet(fp=cStringIO.StringIO(\"\"\"FCID,Lane,SampleID,SampleRef,Index,Description,Control,Recipe,Operator,SampleProject\n\"D190HACXX\",1,\"PB\"...
4ce8dae4ac4053b4ab3ca20a68802c00
Calculate average distance of two clusters
[ { "docid": "f67bd78a9d76772e123e3a2250a45b7b", "score": "0.69087136", "text": "def mean(average_dis1, num_of_distance1, average_dis2, num_of_distance2, num_of_distances):\r\n return (average_dis1*num_of_distance1 + average_dis2*num_of_distance2)/num_of_distances", "title": "" } ]
[ { "docid": "397ef63681c0bead1b04d694faf2c1b2", "score": "0.7762529", "text": "def _calculate_average_distance(matrix, clusters, c_x, c_y):\n\n pass", "title": "" }, { "docid": "3ab2226ee7caf41831be5816611eb289", "score": "0.7740244", "text": "def avg_cluster_distance(self, mat...
f634af849b1a0f84d7a22d842504efad
Set up a blob selection survey
[ { "docid": "77bcf48d7ed0a69707ea80974df3ea53", "score": "0.58597565", "text": "def testBlobs(self):\n nside = 32\n survey_length = 2.0 # days\n\n surveys = []\n # Set up the DD\n dd_surveys = generate_dd_surveys(nside=nside)\n surveys.append(dd_surveys)\n\n ...
[ { "docid": "4a9668099875beb4a9c885505b4d2517", "score": "0.53254974", "text": "def test_bokeh_selector(self):\n from straxen.analyses.bokeh_waveform_plot import DataSelectionHist\n p = self.st.get_array(nt_test_run_id, 'peak_basics')\n ds = DataSelectionHist('ds')\n fig = ds....
caba96953d0db8ab81c413e65e5f9dde
Returns the loom input tensor, used for building feed dictionaries. May be fed a single result or a sequence of results from `Compiler.build_loom_inputs()` or `Compiler.build_loom_input_batched()`.
[ { "docid": "a4a7142f25ab9382865e61641721e6ce", "score": "0.82956433", "text": "def loom_input_tensor(self):\n self._check_loom_initialized()\n return self._wet.input_tensor", "title": "" } ]
[ { "docid": "b1e438b5032c09b23af1bd83e8f00646", "score": "0.63694286", "text": "def input_tensor(interpreter):\r\n tensor_index = interpreter.get_input_details()[0]['index']\r\n return interpreter.tensor(tensor_index)()[0]", "title": "" }, { "docid": "8978a692cfa1077b16d93793236519fb", ...
a65c1835300f919c202a781fd914cf72
Builds a layer which connects to the input_layer according to the given parameters.
[ { "docid": "77f3d7c659762805d395fbc0fee40fbb", "score": "0.61406976", "text": "def create_output_layer(input_layer, weights_tuple, delta, layer_name, refrac):\n# print('Number of output neurons {} for size {}x{}'.format(\\\n# total_output_neurons, t_n, t_m))...
[ { "docid": "3a81c94c57960a2260aafdee1e162199", "score": "0.6962431", "text": "def create_layer(input_layer, layer):\n\n # Common to all layers\n layer_type = layer[0]\n name = layer[1]\n\n\n if layer_type == CONV:\n weights = weight_variable(layer[2], name+'_conv_weights')\n stride = l...
4c9e79ec6f0453fbd09830ae83effa3f
Return a dict description of the Operation
[ { "docid": "28710bff765d22500247aae734742e28", "score": "0.5967061", "text": "def describe(self) -> dict:\n\n description = super().describe()\n\n description.update(\n {\n \"args\": {\"keys\": self.keys}\n }\n )\n\n return description", ...
[ { "docid": "edb73633f6a56bc0d0a4cd54c806823b", "score": "0.84622484", "text": "def describe(self) -> dict:\n\n return {\n \"operation\": type(self).__name__\n }", "title": "" }, { "docid": "084ed9cb0338e34f3fc6cb6189dc59d2", "score": "0.73279786", "text": "de...
e02c3b6520f5cfe70a6eeb8665f0faab
"To ensure the robustness of the model, five random datasets were created to repeat the training and testing of the CNN classifiers (5fold crossvalidation)"
[ { "docid": "35b086822916871823d5cf5d63c5a3bd", "score": "0.5881104", "text": "def run(self, *inputs, **kwargs) -> None:\n validation_folds = self.config.training_crossval_folds\n split_ratios = [1.0 / validation_folds] * validation_folds\n\n \"\"\"\n \"All baseline MR data we...
[ { "docid": "8b71a66a734b075d1133dcee50313951", "score": "0.66847914", "text": "def train_model():\r\n x_train = []\r\n x_test = []\r\n x_valid = []\r\n\r\n y_train = []\r\n y_test = []\r\n y_valid = []\r\n\r\n # reading train\r\n read_images(fpath_train, x_train, y_train, FEMALE)...
012e9d167c4fb65431c816f0d2bcbe37
The name of the category.
[ { "docid": "e9c3dee8d88435fba7afa382d2833fa5", "score": "0.0", "text": "def name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"name\")", "title": "" } ]
[ { "docid": "89d5292e894ed33a2743b5ac6e40c96c", "score": "0.9356435", "text": "def category_name(self) -> str:\n return pulumi.get(self, \"category_name\")", "title": "" }, { "docid": "0708909944d1765b981bfd898b8dc4cb", "score": "0.93421", "text": "def category_name(self):\n ...
25b75ea7bf5cb76a12789e7989129fb6
Returns a ApplicationCache Object to interact with the browser app cache.
[ { "docid": "30b841e126a587fbf9af547ebf5dc15d", "score": "0.83621204", "text": "def get_application_cache(self) -> ApplicationCache:\n return self._selenium_web_driver().application_cache", "title": "" } ]
[ { "docid": "ee705e4bfe2f7971b08deb8b63d3f503", "score": "0.6836842", "text": "def create_cache():\n class _App(object):\n config = {}\n\n cache_config = {\n 'CACHE_TYPE': 'filesystem',\n 'CACHE_DEFAULT_TIMEOUT': 60 * 60 * 24 * 7,\n 'CACHE_THRESHOLD': 100,\n 'CACH...
e6be7d743ec3c3a768eef75172fd2f8f
find users with their username that start with letter that user has entered
[ { "docid": "2c1b08376ea3c1ba98ed3949f10267b2", "score": "0.83855855", "text": "def users(letter):\n return User.objects.filter(username__istartswith=letter)", "title": "" } ]
[ { "docid": "d8e566029b9c771acb958a39552c0017", "score": "0.85593385", "text": "def getUsersStartingWith(letters):", "title": "" }, { "docid": "8664fa1d80739b81e26240163caa7420", "score": "0.6641168", "text": "def check_username(self, username):\n match = re.findall(r\"^[a-zA-Z...
60a13f80bbbd52ab881d64ae67e7d878
Test LimitTracker used in auvimport.
[ { "docid": "376124658927b62692caa4f6e6bed547", "score": "0.5882347", "text": "def test_limit_tracker(self):\n\n # check direct values\n direct_track = LimitTracker()\n\n direct_track.check(1.0)\n\n self.assertEqual(direct_track.minimum, 1.0)\n self.assertEqual(direct_t...
[ { "docid": "5e84c8ee36f03c4d423562b65adc6087", "score": "0.6538664", "text": "def test_rate_limit_interface():\n per_user_rate_def = RateDefinition(per_week=50000, per_day=13000, per_second=.001)\n min_rate_def = RateDefinition(per_second=10)\n per_user_rate_def = PerUserRateDefinition(per_user...
ec66effa18f2468179bea5514cc33f27
Changes each face when a turn is made
[ { "docid": "fbd8f96f5e48ea6fb17378d7c6c7e8a1", "score": "0.0", "text": "def turnSide(side, copy1, copy2, copy3, numMoves, isPrime,\n falseSide1, falseSide2,\n falseCopy1, falseCopy2,\n trueSide1, trueSide2, \n trueCopy1, trueCopy2,\n twoSide1, ...
[ { "docid": "ffc8669634c0df6b38b564f4c3edc344", "score": "0.6458799", "text": "def __init__(self):\n self.face = 0", "title": "" }, { "docid": "0695201c5269bde707b3ec1907317f36", "score": "0.6264643", "text": "def changeTurn(self):\n self._players[self._current].deactiva...
9003693612e2496d1b8ec20c13e967fc
Takes a project UUID and either creates a new document in the desprojects index or updates the document if one already exists for that project.
[ { "docid": "809657dc207ab465236a7ea3711a9617", "score": "0.74024814", "text": "def index_or_update_project(self, uuid):\n from designsafe.apps.api.projects.models import Project\n\n client = get_service_account_client()\n project_model = Project(client)\n project = project_model.search({'uui...
[ { "docid": "3eb70541f86495a1a812503637a60949", "score": "0.58575755", "text": "def reindex_projects(self):\n client = get_service_account_client()\n query = {'name': 'designsafe.project'}\n\n in_loop = True\n offset = 0\n while in_loop:\n listing = client.meta.listMetadata(q=json.d...
68e37ec088ae4267c593779e2ace4a03
r"""The number of graphs in the dataset.
[ { "docid": "179a0ee94a6a7e7d1a87da777afe7be5", "score": "0.0", "text": "def __len__(self): # -> Literal[1]:\n ...", "title": "" } ]
[ { "docid": "0355f1833468a8bd7a3a10e653f39a43", "score": "0.8215049", "text": "def number_of_graphs(self):\n return self.get_table_row_count(self.GRAPH_TABLE._name_)", "title": "" }, { "docid": "d5cf06f4008d0a5795c841c5b8657580", "score": "0.75362337", "text": "def n_datasets(s...
e436a651273cc71240d278e3bae026c5
Show the given variable on the plot. Undoes `ignore_variable`. If a dataframe name is specified, all of its columns will be shown.
[ { "docid": "13c4e6f3f61e09eaa750fd207f32f767", "score": "0.4953621", "text": "def show_variable(self, toast: Toast, var_name: str) -> None:\n try:\n return self.active_view.show_variable(toast, var_name)\n except NotImplementedError:\n toast.show(f\"{self._active} doe...
[ { "docid": "f3416a3c42880a57556602bd26db1797", "score": "0.57033026", "text": "def ignore_variable(self, toast: Toast, var_name: str) -> None:\n try:\n return self.active_view.ignore_variable(toast, var_name)\n except NotImplementedError:\n toast.show(f\"{self._active...
2be6d369e19ba2cf155c71d55a982262
Start a player off with the default starting deck, an empty hand, and an empty discard pile. Set the game stage to 'early_game'. Initialize a turn counter. Draw a random starting hand from the deck.
[ { "docid": "9ab052ff693422df14ac76b389410470", "score": "0.7242505", "text": "def __init__(self):\n\n self.hand = [] # empty hand\n self.discard = [] # empty discard pile\n self.deck = 3 * [estate] + 7 * [copper] # starting deck\n self.game_stage = GameStage.early_game # ...
[ { "docid": "5100836fd6ace5c376bcbe31fb141463", "score": "0.7105495", "text": "def start_new_game(self, player_hand):\n self.deck_of_cards += self.hand\n self.deck_of_cards += player_hand\n self.deck_of_cards.shuffle()", "title": "" }, { "docid": "73b8d8128052bfd7bd5a587d...
878430aedb1cf2faa0d7a646f80b93dd
Returns True if `n` is a prime number. Uses a sieve based approach.
[ { "docid": "f6562e93978739d735e33a2f03e547ef", "score": "0.82913023", "text": "def is_prime(n):\n if n < 2:\n return False\n ps = primes()\n p = next(ps)\n while p * p <= n:\n if n % p == 0:\n return False\n p = next(ps)\n return True", "title": "" } ...
[ { "docid": "78a25bc4f1590805de217f19646d793b", "score": "0.8519759", "text": "def isPrime(n):\n\tif n > 1:\n\t\tsqrtN = int(math.sqrt(n))\n\t\tfor i in xrange(2, sqrtN + 1):\n\t\t\tif n % i == 0:\n\t\t\t\treturn False\n\t\treturn True\n\telse:\n\t\treturn False", "title": "" }, { "docid": "d...
c4d430e66bb3d21f6d5a3c0b14362f75
Gets the EMD language between the two languages
[ { "docid": "62965b2c20affbafeeb5c0cc7a3c475e", "score": "0.0", "text": "def apply(lang1, lang2, variant=Variants.PYEMD, parameters=None):\n return exec_utils.get_variant(variant).apply(lang1, lang2, parameters=parameters)", "title": "" } ]
[ { "docid": "7d19c984c03b3e59c0e29927e52e446b", "score": "0.6914142", "text": "def get_language(self):", "title": "" }, { "docid": "38cf8daef8d0e9165e88916da0f08868", "score": "0.67045707", "text": "def getLanguage(self) -> ghidra.program.model.lang.Language:\n ...", "title...
dcb6c0a8a52a7bb0ac92e1bdf7df1718
get all the bookmars that a certai project has
[ { "docid": "4705871157183a2403386664a34c0255", "score": "0.0", "text": "def get_projectBookmarks(self, projectId):\n from Bookmark import Bookmark\n cursor = self.dbconnect.get_cursor()\n cursor.execute('select * from bookmark where project=%s', (projectId,))\n bookmarks = li...
[ { "docid": "edff7cd81254a3f14281af7177212839", "score": "0.6072002", "text": "def getBooks():\n ret = {}\n books = []\n iter = model.getBooks()\n while iter.next():\n books.append((iter.id, iter.name))\n\n ret['books'] = books\n return ret", "title": "" }, { "docid":...
e048fbeb7c6ddb0b67d7a05a70285c70
Gets the side of the line p is on.
[ { "docid": "61392af388f6f7d1f80e07e4e0dd26b4", "score": "0.711668", "text": "def line_side(pl, p, pr):\n\tv1 = (pr[0]-pl[0], pr[1]-pl[1]) # Vector 1\n\tv2 = (pr[0]-p[0], pr[1]-p[1]) # Vector 1\n\txp = v1[0]*v2[1] - v1[1]*v2[0] # Cross product\n\tif xp > 0:\n\t return 1\n\telif xp < 0:\n\t ret...
[ { "docid": "cb2c6c21f616e1864d15179f7c84d096", "score": "0.7492487", "text": "def get_side(self):\n return self.get_perimeter() / 4", "title": "" }, { "docid": "dc079eec7d6fd53e500597fcb4a05fcb", "score": "0.7384879", "text": "def point_side_line(p1, p2, p):\n\n # Get vecto...