query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
a1d5a9c378188368121aa3f333ecd191
Annualize investment for this component assuming a fixed life span after which the component is replaced by the same.
[ { "docid": "ed88cabca559f2ef6a0fc63ae6baa6f4", "score": "0.67393124", "text": "def annualize_investment(self, i):\n return 0", "title": "" } ]
[ { "docid": "072f1455f03907f4d0b6e5f1c60675e0", "score": "0.55601597", "text": "def test_patch_investment_value(self):\n pass", "title": "" }, { "docid": "9b2c1455ad018834e0ff383945397384", "score": "0.5409791", "text": "def testAggregateCorrectly_single(self):\n\n #Crea...
1072070d27b8ffb539250e3be26b1945
Sets the type of this OneOfCustomFluidBCPressure.
[ { "docid": "30a86a01466cc929f4e080adeb548b24", "score": "0.60116017", "text": "def type(self, type):\n if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501\n raise ValueError(\"Invalid value for `type`, must not be `None`\") # noqa: E501\n\n s...
[ { "docid": "872d4d4a0cbc8d66a1e5170cf9204937", "score": "0.699939", "text": "def setType(self, type_):\n raise NotImplementedError(self)", "title": "" }, { "docid": "a649b534947a904e113362ba5e80e814", "score": "0.6868857", "text": "def setType(self, type):\n self.__type...
b83341db609ce8136c9d53118eb1a2db
Tests setting new object with key
[ { "docid": "0a3d4c2e1a6dbeef913b959a3ada09ff", "score": "0.0", "text": "def test_new(self):\n pass", "title": "" } ]
[ { "docid": "ef36253045ef5dc33403621a30a8569c", "score": "0.7352714", "text": "def test_set_into_existing(hash_test):\n assert hash_test.set('sup', 'bro') == {'sup': 'bro'}", "title": "" }, { "docid": "638326fb2445778e498edf4553d491e1", "score": "0.7140362", "text": "def test_set_k...
07716a92882ade315e082239e7a7ac3a
Returns and removes the last item for the list, which is also the top item in the stack. The runtime here is constant time, because all it does is index to the last item of the list.
[ { "docid": "dc088678b98c9ab9619fa837b60ac02e", "score": "0.65494514", "text": "def pop(self):\n if self.items:\n return self.items.pop()\n \n return None", "title": "" } ]
[ { "docid": "3caf8c698b44fefd5d2bd9ebe528caf4", "score": "0.808521", "text": "def pop_back(self):\n\t\t# runtime O(1) removing last element doesnt have effect on other elements\n\t\tself.size -= 1\n\t\treturn self.list.pop()", "title": "" }, { "docid": "c946419c3bc9863bd1d9be7d07be386c", ...
5f54f032bb746c8eccf706ba0adf00ff
Additional logging at high verbosity.
[ { "docid": "e5e40b484c225af405582f14ed2f415d", "score": "0.0", "text": "def test_verbose_matching(self):\n\n match = GeometryStore.objects.create(label='Test Project')\n stdout, stderr = self.call_command(verbosity=2)\n stdout = stdout.read()\n self.assertIn(\n 'At...
[ { "docid": "e9bf6c5f59bf23aedee4cc905ae08377", "score": "0.76229805", "text": "def verbosity(self, verbosity: str) -> None:", "title": "" }, { "docid": "ca250f8ab4db6e42d5d66780a56a03a3", "score": "0.7373726", "text": "def setup_other_logging(self, args, verbose=False, silent=False, ...
52b385f82d598c4966f69ce79a9368eb
Train the Deep Neural Network with Layers of LSTM and Dense
[ { "docid": "27b6cbfcd48426a56aa38a14b95f9b96", "score": "0.6677843", "text": "def train_Model(self,X_train,y_train):\n model = Sequential()\n #Layes of LSTM along with Batch Normalization and dropouts\n model.add(LSTM(64, activation='relu', input_shape=(X_train.shape[1], X_train.sha...
[ { "docid": "4ee27108906da1a7038afdfb7db417bf", "score": "0.7474031", "text": "def train_lstm_model(features_train, labels_train, train_opt):\n # create class weight for imbalanced classes\n class_weight = create_class_weight(Counter(labels_train))\n\n # one hot encode the output variable\n c...
a87592c0a1f251ffe167771e498e176a
Show deserialized yaml objects as json
[ { "docid": "ca579afa8bfa59a4acb8dddd1d505b88", "score": "0.0", "text": "def show(tokens, implementations, samples):\n for sample in samples:\n show_outcome(sample, implementations, tokens=tokens)", "title": "" } ]
[ { "docid": "5ff19beda9e3dc99b78d5b2e8535bb62", "score": "0.6889602", "text": "def yaml(self, obj):\n return yaml.dump(obj, indent=2)", "title": "" }, { "docid": "0bdf9282c12f07df80e30400677cef42", "score": "0.6864921", "text": "def dumps(obj):\n return yaml.dump(obj)", ...
baf89afc01c06e06c59db7f960b365ad
Checks if the EMail type Object's query property matches the general format of an email If the query matches fully, the Object's state property is changed to True. If the query matches the general format at first, but doesn't match the required prefix format, a ValueError is raised with a fitting message If the query d...
[ { "docid": "dc96a85eb4dcb474b5da1cbf6b7e1f19", "score": "0.6491934", "text": "def isQueryType(self) -> None:\n if re.match(r'[a-zA-Z0-9._-]+@[\\w.-]+', self.query):\n count = 0\n atSignIndex = self.query.find(\"@\")\n prefix = self.query[0:atSignIndex]\n ...
[ { "docid": "f49ad204b00929aba89e915e72f89310", "score": "0.50224423", "text": "def test_email_raw(self):\n self.assertIsInstance(self.email.raw, Message)", "title": "" }, { "docid": "696777fc9063d945392a285ec955cbf6", "score": "0.4977578", "text": "def _checkformat(self, topic...
ca117a2b8ee289fc3feb561f9b2761cb
Leave one case with a comment, plus two empty cases to code manually.
[ { "docid": "77186788f15b5cb01c1a0326033be580", "score": "0.5725164", "text": "def to_case_bodies(self) -> List[CaseBody]:\n case_containing_comment = \"//TODO: {clean_line};\\n\".format(clean_line=self.clean_line)\n blank_case_1 = \"//This case intentionally left blank;\"\n blank_ca...
[ { "docid": "68ffeb1c0863474fe67ff4891c99734f", "score": "0.64037967", "text": "def example():\n '''\n this is also a type of multi line comment\n by this example we are now cleared what single and mutiple line comment is.\n '''\n return 1", "title": "" }, { "docid": "f84f6507e...
72dede1bf3e2391570d1bc0944879777
Validate the value passed in is a method or function.
[ { "docid": "54a07a92f9ab3d325eae131906d32231", "score": "0.65965426", "text": "def _validate_callback(self, callback):\r\n if (callback is not None and\r\n not utils.is_callable(callback)):\r\n raise TypeError(\"Callback should be a function or method, is %s\",\r\n ...
[ { "docid": "9dd35315575d3ac767b491c8aed79efa", "score": "0.71747696", "text": "def validate(self, value):\n super().validate(value)\n transformed_value = self.value\n if not callable(transformed_value):\n raise ValidationError(\"Value %(value)s is not a callable.\", param...
535070a27b2717509f95e5f3505ae922
Takes folder name as input and reformats files and saves them into trajectories_as_arrays as
[ { "docid": "46fa1ad8cfdfa5ff9575a6e693c7bebf", "score": "0.68550557", "text": "def folder_reformatter(folder_name, folder_save_location= \"trajectories_as_arrays\", plot_trajectories=False):\r\n # file_list = list(reversed(os.listdir(folder_name)))\r\n file_list = os.listdir(folder_name)\r\n fo...
[ { "docid": "79f908af9b166fa0853a3a3dd0af52b1", "score": "0.6129415", "text": "def preprocessfolder(self):\n imgs, _ = getFilesAndHdf(str(self.in_directory.text()))\n self.img_list = sorted(imgs)\n self.updateImageGroups()", "title": "" }, { "docid": "513494fddab22762fbce...
93453b0f1ab761401a7424d4fea5494e
Wrapper function to catch exceptions in functions
[ { "docid": "b74458788cd6e592636fb2f7e01db75b", "score": "0.73409563", "text": "def exception(function):\n\n @functools.wraps(function)\n def wrapper(*args, **kwargs):\n try:\n return function(*args, **kwargs)\n except Exception as e:\n import traceback\n ...
[ { "docid": "a6f37b37e017e5d5235d9d54f94e6403", "score": "0.790852", "text": "def catch(fn, *args, **kw):\n try:\n return fn(*args, **kw)\n except:\n #print(\"catch: caught exception!\")\n return", "title": "" }, { "docid": "3bff01b60606860bb030ddf8eb8cf27f", "score": "0.779941...
d8f71f39f3546df5a48cc4d184f1dcd4
Calculate the Idzorek omega matrix by taking into account usersupplied confidences in the views.
[ { "docid": "86f10905d6b0ef587a01e657b733cd89", "score": "0.7267532", "text": "def _calculate_idzorek_omega(covariance, view_confidences, pick_matrix):\n\n view_confidences = np.array(np.reshape(view_confidences, (1, covariance.shape[0])))\n alpha = (1 - view_confidences) / view_confidences...
[ { "docid": "641a4ecb3ac788414cb261d6677a1b03", "score": "0.63104594", "text": "def _calculate_omega(self, covariance, tau, pick_matrix, view_confidences, omega_method):\n\n if omega_method == 'prior_variance':\n omega = pick_matrix.dot((tau * covariance).dot(pick_matrix.T))\n el...
d3fd9360d977a970e21935009af48f43
Deletes AWS resources used by the demo.
[ { "docid": "62389e4ca3e1b60139e2fbe7d9719b47", "score": "0.70848787", "text": "def cleanup(self):\n self.demo_resources.cleanup()", "title": "" } ]
[ { "docid": "972f95f2959f6decd98dd447115ac2f5", "score": "0.67874366", "text": "def teardown_s3():\n s3 = boto3.resource('s3')\n bucket = s3.Bucket(CAMD_S3_BUCKET)\n bucket.objects.filter(Prefix=\"proto-dft-2/runs/Si\").delete()\n bucket.objects.filter(Prefix=\"proto-dft-2/submit/Si\").delete...
036e467bb9d026eb31995dd134ef8c0a
Tests correct behaviour of AgentData.validate_trans().
[ { "docid": "488d8cffea7b369248a6a1036a8e5839", "score": "0.7768848", "text": "def test_positive_validate_trans(self):\n agent = Agent()\n tree = Tree()\n generator = tree_test.Generator()\n genesis = generator.gen_genesis()\n tree.add(genesis.get_identifier(), deepcopy...
[ { "docid": "0bc392ab9c7b1a716a5bb615b4c51f5f", "score": "0.7115385", "text": "def test_negative_validate_trans_1(self):\n agent = Agent()\n tree = Tree()\n generator = tree_test.Generator()\n genesis = generator.gen_genesis()\n tree.add(genesis.get_identifier(), deepco...
a2a7028798eabae5b2f98956a5a428dd
Get point loading due to axial force as heavside for axial force diagrams
[ { "docid": "5ee3c5a2ed9c45ef5bbfaca8e2d87634", "score": "0.5364127", "text": "def ax_singularity(self, x):\n return _h(self._location, x)*self.get_point_loading()", "title": "" } ]
[ { "docid": "7aba0bb55b2a7df4cb076717df0ee1be", "score": "0.63613003", "text": "def v_get_point_loading(self, mom_bal=False):\n return self._reaction_vert*(self._location if mom_bal else 1)", "title": "" }, { "docid": "9bf26284dfc25e4a35555f5551f4185c", "score": "0.6351065", "t...
62b19a105ee3feb4f0a143b34d0e6264
Smooths a given image with a gaussian kernel with widths given as sigmas. This smoothing can be used to mimic charge diffusion within the CCD. The default values are from Table 82 of CCD_273_Euclid_secification_1.0.130812.pdf converted to sigmas (FWHM / (2sqrt(2ln2)) and rounded up to the second decimal.
[ { "docid": "52d2bd1457532ac6d94e36c21e777b40", "score": "0.67235106", "text": "def smoothingWithChargeDiffusion(self, image, sigma=(0.32, 0.32)):\n return ndimage.filters.gaussian_filter(image, sigma)", "title": "" } ]
[ { "docid": "94ef8d8eefc2e7a85259a8caf3b6470d", "score": "0.7369736", "text": "def calc_gaussian(img, sigma=3):\n blurFilter = sitk.SmoothingRecursiveGaussianImageFilter()\n blurFilter.SetSigma(sigma)\n imgSmooth = blurFilter.Execute(img)\n return imgSmooth", "title": "" }, { "doc...
d06c87d46961dda91f4000e4f7098dca
We only want to keep the smallest k elements in max heap
[ { "docid": "ace66780b7068ff05261ad1fb9c304cf", "score": "0.0", "text": "def add_element(self, element: int, end: int = -1):\n if element < self.arr[0]:\n self.arr[0] = element\n self.heapify(0, end)", "title": "" } ]
[ { "docid": "1857a079b2f58622838f9e22110f0ff7", "score": "0.7386581", "text": "def get_static_top_k(nums, k):\n if len(nums) <= k:\n return nums\n min_h = MinHeap(nums[:k], k) # one time use\n min_h.build_heap()\n # compare data with heap top\n for n in range(k, len(nums)):\n ...
13ababd9f38e4a5b7e561e0b4271185a
Opens a color picker and sets point color for the plot if a color is not specified
[ { "docid": "afa5f4df8b7ea114ff5c75f92ccfc8c4", "score": "0.5313986", "text": "def set_isopleth_2_color(self, color=None):\n if not color:\n initial_color = self.isopleth_2_color_preview.palette().window().color()\n color = QColorDialog.getColor(initial_color).name()\n\n ...
[ { "docid": "54e7485b4e104092fbdb698b7ef604a0", "score": "0.6972183", "text": "def set_point_color(self, color=None):\n if not color:\n initial_color = self.point_color_preview.palette().window().color()\n color = QColorDialog.getColor(initial_color).name()\n\n style =...
ef8a52bdae12a6ac4938c2e83caec730
Get the extension point URL based on a method instance
[ { "docid": "811f9a3da5396af738f5b356e07f06fc", "score": "0.8212115", "text": "def _get_extension_point_url_from_method(domain, category, plugin_method):\n name = getattr(plugin_method, \"__name__\", None) or str(id(plugin_method))\n return \"{}/{}/{}\".format(domain, category, name).replace(\"//\"...
[ { "docid": "2307f7b249e1992727f39ee67e8fcadd", "score": "0.65730506", "text": "def get_url(self):\n raise NotImplementedError", "title": "" }, { "docid": "1e4323b2a02f8bb72ea12c070c0523f4", "score": "0.643839", "text": "def _get_url_extension(self):\n return ''", "t...
ec44e9316b422f01495aea3db5d0d7e7
Shows a small widget that counts the cheers and offers a link to cheers more
[ { "docid": "d2e43b23e486083c0885aa37f119c349", "score": "0.6571422", "text": "def show_cheers_widget(context, content):\n \n container = Cheers.objects.get_container(content)\n cheers = Cheers.objects.get_for_object(content).count()\n\n if context['request'].user.is_authenticated():\n ...
[ { "docid": "5b16dda87344f8df349eb7d5f9c9bd67", "score": "0.6046909", "text": "def show_count_goods_in_wishlist(user):\n if user.is_authenticated():\n try:\n count = user.wishlist.goods.count()\n return \"<span id='wish_number'>\" + str(count) + \"</span>\"\n except...
940d1b8a17ff81df583ac617b2ad1d17
Use the jsonplaceholder API to add a fake todo.
[ { "docid": "2e7a09d9413f62928d5d7fa02441e649", "score": "0.6715809", "text": "def request_todo():\n response = requests.post(\n \"https://jsonplaceholder.typicode.com/todos\",\n data = {\n 'title': \"laundry\",\n 'userId': 1\n }\n )\n\n if not response...
[ { "docid": "a08f660ecae0f916d38bb18b7ce345e8", "score": "0.66141295", "text": "def post(self, id=None):\n data = self.todo_list_parser.parse_args()\n user = get_jwt_identity()\n public.create_todo_for_user(data[\"name\"], user)\n return {}", "title": "" }, { "doci...
9d7e17a82caf04f86602e993a381ff27
Check link status of the ports.
[ { "docid": "ee269d649d3b305fbaac5c50ccba5242", "score": "0.8408618", "text": "def check_ports(self, status=True):\n # RRC not support link speed change\n if self.kdriver == \"fm10k\":\n return\n\n for port in self.ports:\n out = self.tester.send_expect(\n ...
[ { "docid": "2ef339ec34af11ddfeb71823e0d58949", "score": "0.74812603", "text": "def link_state(self, *args):\n\n try:\n interface = self.parse_portnumber(*args)\n self.execute(f'show int status {interface}')\n answer = self.__conn.response.split('\\n')\n ...
6e54a8eca9e4180926415d486ca1f740
Verifies that frame identified by ``locator`` contains ``text``. See the `Locating elements` section for details about the locator syntax. See `Page Should Contain` for an explanation about the ``loglevel`` argument.
[ { "docid": "714c40aee4f537ef3fee94ba26b34fc3", "score": "0.85518944", "text": "def frame_should_contain(\n self, locator: Union[WebElement, str], text: str, loglevel: str = \"TRACE\"\n ):\n if not self._frame_contains(locator, text):\n self.log_source(loglevel)\n r...
[ { "docid": "ca452c4bc7c156401f6a4263b46ba2b5", "score": "0.7412529", "text": "def current_frame_should_contain(self, text: str, loglevel: str = \"TRACE\"):\n if not self.is_text_present(text):\n self.log_source(loglevel)\n raise AssertionError(\n f\"Frame shou...
4eb0b034bb9d1dcf9b517325f826a365
Gets the full value (all bits) from the Fctl field.
[ { "docid": "e374a7ba5f5ba767a2e0810738308ac4", "score": "0.63612956", "text": "def fctl(self,):\n return self._fctl", "title": "" } ]
[ { "docid": "b3c30f5c9fc9ae6a6784e721e7631336", "score": "0.63656574", "text": "def raw_val(self):\r\n return self.msg_val >> self.bit_start", "title": "" }, { "docid": "9fd14b6d4ea516241d100e0437f8d56c", "score": "0.62198126", "text": "def get_raw(self):\n value = self....
f78a87ac168d79e800d9089de3221bfc
Display the geographic map.
[ { "docid": "b1de97ed75a0a70594e5f330171169df", "score": "0.0", "text": "def map(self,var,y1=None,y2=None,x1=None,x2=None,y='I',x='J',loc=[],\\\n m=None,p='cyl',edge='n',face='y',intp='n',cbar='y',ref=None,**kwargs):\n nc=self.nc\n dims=self.dims\n dimkeys=self.dimkeys\n \n bmsp...
[ { "docid": "6288591c2420b1551b0762768914cda4", "score": "0.75788015", "text": "def display_map(self):\n print(self.map)", "title": "" }, { "docid": "cf57fb48b5bf3a6b0da2afff1ad61ab1", "score": "0.7310399", "text": "def show_map(self, name):\n g = geocoder.osm(name)\n ...
afd710d6e63b3ce9114bd5b71ef13b55
r""" sub/pub registration Create a subscription. The subscription becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions and publications.
[ { "docid": "9c656d3e6a3c7568ae38a914670f4924", "score": "0.0", "text": "def helicsFederateRegisterSubscription(fed: \"helics_federate\", key: \"char const *\", units: \"char const *\") -> \"helics_input\":\n return _helics.helicsFederateRegisterSubscription(fed, key, units)", "title": "" } ]
[ { "docid": "1809d7dd2ce08c8e421be7ae0d2d031d", "score": "0.799498", "text": "def create_subscription():\n pass", "title": "" }, { "docid": "290bb296d352a8553287332b46bcb2cc", "score": "0.7299079", "text": "def create_subscription():\n subscriber = pubsub_v1.SubscriberClient()\n...
b6717fddd5dc12d4f7d26459c810a82d
Rename a menu item
[ { "docid": "ad82d3e09405d379790ce7c18d7a60a5", "score": "0.72674495", "text": "def RenameMenu(self, MenuItemString=defaultNamedNotOptArg, NewName=defaultNamedNotOptArg):\n\t\treturn self._oleobj_.InvokeTypes(6, LCID, 1, (24, 0), ((8, 1), (8, 1)),MenuItemString\n\t\t\t, NewName)", "title": "" } ]
[ { "docid": "e4070dbf12de343d946415b89420539e", "score": "0.70504844", "text": "def renameDialog(self):\n item = self.itemOfContextMenu\n newName, ok = QInputDialog.getText(self.views()[0], self.sender().text(),\n \"Enter new name of \" + item.itemT...
d87bdfd38f12e72ca63811f13c7988bf
Setter method for config, mapped from YANG variable /mpls/signaling_protocols/rsvp_te/interface_attributes/interface/config (container)
[ { "docid": "7947316147ea0b17b1df53fefac1ef00", "score": "0.79970694", "text": "def _set_config(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_config_openconfig_mpls_igp__mpls_signaling_protocols_rsvp_te_interface_attributes_interf...
[ { "docid": "2ab4817b5a6c17b20fc22fdab5329cfb", "score": "0.8041246", "text": "def _set_config(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_config_openconfig_mpls__mpls_signaling_protocols_rsvp_te_interface_attributes_interface_c...
41eec308ed7d459c1e85fea52ba54ebf
For `print` and `pprint`
[ { "docid": "bff2052ac2ba06621cc51030f2133214", "score": "0.0", "text": "def __repr__(self):\n return self.to_str()", "title": "" } ]
[ { "docid": "6400e853207eb06fb5f0764d2fd40c08", "score": "0.7634721", "text": "def __special_print(self):\n pass", "title": "" }, { "docid": "3fc3020430a216ca8555aca00f1b1d6c", "score": "0.74984014", "text": "def print(*args, **kwargs): # known special case of print\n pass",...
2642d6f90c9cbf6babb31277a1c8f50d
Converts a token (str) in an id using the vocab.
[ { "docid": "58c9afb30ab42882f134ae6da1db5f53", "score": "0.8012835", "text": "def _convert_token_to_id(self, token):\n return self.vocab.get(token, self.vocab.get(self.unk_token))", "title": "" } ]
[ { "docid": "a247f0841dd5145445a241a1bb0b66f2", "score": "0.8083753", "text": "def convert_token_to_id(self, token):\n return self.vocab[token]", "title": "" }, { "docid": "0afb07ec120009bde5fcd4306251584e", "score": "0.7667727", "text": "def convert_id_to_token(self, id_: int)...
d13dc7fde480a06e47995b264c6ad3cb
View for deleting an existing Contact object. Retrieves the Contact object and deletes it.
[ { "docid": "80f4f55163ef61f081fa3e763d7e0828", "score": "0.7051108", "text": "def delete(request, listing_id):\n user_id = request.user.id\n listing_id = listing_id\n contact = Contact.objects.get(listing_id=listing_id, user_id=user_id)\n contact.delete()\n # Directs user to dashboard if ...
[ { "docid": "4100e1b3a32b650904cdbae7d244ed04", "score": "0.7768654", "text": "def delete_contact(request, id):\n contact = Contact.objects.get(pk=id)\n contact.delete()\n return JsonResponse({'success': True})", "title": "" }, { "docid": "68c4ad4c75fc7d17ae02de041d699c15", "scor...
fcf66e350d11c77456a9999c0f06784c
drawing single rate figure
[ { "docid": "b77b93ecb18e8e442d22179b3eac678b", "score": "0.60216314", "text": "def __viz_rate(self, precoder: str, alpha: float, mode: str, color: str, marker: str):\n rows = 16\n cols = 8\n power_db = np.array([10 * np.log10(p_temp) for p_temp in power_range])\n if precoder ...
[ { "docid": "c6aaa2b25d65f5b6c2c0414e398b40e1", "score": "0.6754473", "text": "def drawing() -> None:", "title": "" }, { "docid": "f943f411fbf7b24eae5940bc2b9a266c", "score": "0.6675388", "text": "def draw( self ):\n pass", "title": "" }, { "docid": "cb1d6b2102c44e4...
5ddf5c501f1f2fe13d68b6b1d2cd9af5
Renders the template for user management, passing forward all users
[ { "docid": "4486f8b3ee5a4bdaac7d698c3ae6fc47", "score": "0.7548799", "text": "def manage_users():\n if not verify_login(url_for('manage_users'), True):\n return redirect('login')\n\n return render_template('Site/manage_users.html', user=session, title='User Management', css='manage_users.cs...
[ { "docid": "a61619db8a1b7d1492be3ee68d6b639b", "score": "0.768411", "text": "def user():\n return render_template(\"user.html\")", "title": "" }, { "docid": "877b2d12ce8a50687c4f64453fb8668c", "score": "0.7255453", "text": "def user():\n return render_template(\"user.html\", us...
797d1eeaba0a56a56e39a89f0a8f8501
gets all the possible moves that can be made by white pieces on the board returns a list of these moves in the form (id, (i, j))
[ { "docid": "e46570c47b177b7151920b462f9ce900", "score": "0.74544895", "text": "def get_all_moves_w(self):\n all_moves = list()\n\n # loop through all pieces\n for piece in self.whites.values():\n\n # loop through moves for each piece and add to list\n for move ...
[ { "docid": "83262dc4583a9d25441ca4e0965de8c3", "score": "0.81470615", "text": "def possibleMoves(self):\n moves = []\n for row in range(len(self.board)):\n for col in range(len(self.board[row])):\n turn = self.board[row][col][0]\n piece = self.board...
5218d72562896a3b73945ca10c13f9d5
Basic linear regression 'model' for use with ODR
[ { "docid": "fcc9d567c27592e89fedaee9668a2a46", "score": "0.0", "text": "def f(p, x):\n\treturn (p[0] * x) + p[1]", "title": "" } ]
[ { "docid": "1808d0a75c0b5ecdb4e518b76faccd47", "score": "0.75374883", "text": "def _liner_regression_model():\r\n reg = linear_model.LinearRegression()\r\n reg.fit(wines[3][:, np.newaxis], wines[5])\r\n print(reg.coef_)\r\n plt.scatter(wines[3], wines[5])\r\n plt.show()", "title": "" ...
49963c8fe86ccc3e6e035b6d2d4764cd
Trains model and generates graphs.
[ { "docid": "ca12baae486ca1f1034edf22c2e62805", "score": "0.0", "text": "def training_phase(self) -> None:\n print(\"* Setting up training job.\", flush=True)\n self.train_dataloader = self.get_dataloader(hdf_path=self.train_h5_path,\n data...
[ { "docid": "18487819a1bee50ed5592899c326623d", "score": "0.6983044", "text": "def run(self):\n # initialize\n self.initialize()\n\n # model\n self.train()", "title": "" }, { "docid": "729d4935cec53b11067ba0d682bfa901", "score": "0.6971355", "text": "def st...
59dd2c0cc43a35a4714728514b1f82fb
Reads Json File into memory
[ { "docid": "cdcea52a1923175dbd72e1c605e241c6", "score": "0.0", "text": "def read_json_file(path_to_file):\n with open(path_to_file) as p:\n # Read file\n df = pd.read_json(p)\n # Remove outdated versions\n df = df[df[2] > CONF.ignore_version_min]\n df = df[df[2] < C...
[ { "docid": "d4c6ea6f2e57f9d83a8e20db663625c6", "score": "0.80215484", "text": "def json_reader(self):\n fn = self.fn\n if os.path.isfile(fn) and os.path.getsize(fn) > 0:\n with open(fn, 'rt') as ff:\n return json.load(ff)", "title": "" }, { "docid": "0...
0b3d9defa1f9a870e865f9379f04c32c
render static map with all map features that were added to map before
[ { "docid": "5c7736ad9d3098e5dd5d61867879f491", "score": "0.0", "text": "async def render(self, zoom: Optional[int] = None, center: Optional[Tuple[float, float]] = None) -> Image:\n\n if not self.lines and not self.markers and not self.polygons and not (center and zoom):\n raise Runtime...
[ { "docid": "2aba0deaf061ccb789440dde516ca413", "score": "0.66984594", "text": "def make_map(self):", "title": "" }, { "docid": "e531918031e7fd3ebe28f005dd336ee4", "score": "0.6492546", "text": "def render_map(self):\n cent_x = (self.map_width / 2) + 3\n cent_y = (self....
b95f166da26990e6e0a569a356bc1e3a
Serie on a site.
[ { "docid": "fc5c5a436a6ac1abeb96a78bfb2c8892", "score": "0.0", "text": "def test_base_01(self):\n s = sitehydro.Sitehydro(code='A0445810', libelle='Le Rhône à Marseille')\n g = 'Q'\n t = 16\n o = obshydro.Observations(\n obshydro.Observation('2012-10-03 06:00', 33)...
[ { "docid": "cf596b356d7fbe2e3ca2b14f34f14b87", "score": "0.5957596", "text": "def getSite():", "title": "" }, { "docid": "729b53be2114614c394e7de90f6cc3d1", "score": "0.5566644", "text": "def on_site(data):\n\treturn data", "title": "" }, { "docid": "7c5356b343a03f668a8a6...
36df3bf95d8e7a9344a2496070236251
Your extreme 2048 evaluation function (question 5).
[ { "docid": "79c5b69cf10a38e1926299165b75eeb8", "score": "0.55875546", "text": "def better_evaluation_function(current_game_state):\n Weights= [1,10,15]\n\n board = current_game_state.board\n max_tile = current_game_state.max_tile\n emptyCells = current_game_state.get_empty_tiles()[0].size\n\...
[ { "docid": "b5c1d5d053826bebf5aa991412177189", "score": "0.62113535", "text": "def betterEvaluationFunction(gameState):\n return betterEvaluationFunction_bestButSlower(gameState)", "title": "" }, { "docid": "80b0ef018e5ab06c48139bea3909eef5", "score": "0.5929156", "text": "def probl...
01e4e2952b97720cc5d44088ccd07f2f
Upload an asset to Hangar51
[ { "docid": "e5e378f588f24ff53abe15b53d01b7d7", "score": "0.0", "text": "def create(cls, client, file, name=None, expire=None, secure=False):\n return cls(\n client,\n client(\n 'put',\n f'assets',\n files={'file': file},\n ...
[ { "docid": "437025a0ea46080597aae093421805bc", "score": "0.68052816", "text": "def upload(args):\n asset = asset_utils.Asset(args.asset_name,\n asset_utils.MultiStore(gsutil=args.gsutil))\n asset.upload_new_version(args.target_dir, commit=args.commit,\n ...
1a832616cb6b06708dfe06313fca72e0
Returns the amount of production the tile produces
[ { "docid": "6a42bb33e0766afa656bf732d4134a74", "score": "0.0", "text": "def getProduction(self):\n return self._production", "title": "" } ]
[ { "docid": "58da72d9708ea165b7cc80487bbcbcd4", "score": "0.71903956", "text": "def getNumTiles(self):\n return self.height*self.width \n # TODO: Your code goes here", "title": "" }, { "docid": "4891df995f4acb7df2ae9203bae8ad18", "score": "0.7129132", "text": "def getNum...
a34b1fba110096252a79289ce019e213
Closes down the connection to Gmail.
[ { "docid": "2fef5efd7e1dd7bff50d7a4a481838f6", "score": "0.61492366", "text": "def close(self) -> bool:\n if not self.gmail.close():\n raise ControllerCloseError()\n else:\n return True", "title": "" } ]
[ { "docid": "5104d31bbd7cab0a6da16165b8e44bc3", "score": "0.69253117", "text": "def close(self):\n self.close_imap()\n self.close_smtp()", "title": "" }, { "docid": "51abb427412e2e71c3b2f18686fa1520", "score": "0.67812467", "text": "def close(self):\n self.imap.cl...
95d92eade0c13c442c8cf261369b36ac
Read a csv file and import the attributes.
[ { "docid": "f63a35f99ecdf151a6624f8f9ecdc07f", "score": "0.6875641", "text": "def from_csv(filename, sep=\";\"):\n with open(filename, \"r\") as f:\n for line in f.readlines():\n key, val = line.strip().split(sep)\n setattr(self, key, val)", "title": "...
[ { "docid": "18273c8be73e04f6a56ac07ac4ba5df8", "score": "0.726499", "text": "def import_from_csv(self, file_name):\n with open(file_name) as csvfile:\n reader = csv.reader(csvfile, delimiter=',')\n next(reader, None)\n for row in reader:\n self.add_...
dbdc5fd2d3f41bfb0bd7d2641ffc9013
__next__(PixelIterator self) > double
[ { "docid": "92674ae7f4f7e9705f417d4a941eabf8", "score": "0.81508714", "text": "def __next__(self):\r\n return _ilwisobjects.PixelIterator___next__(self)", "title": "" } ]
[ { "docid": "ca16689992ffc5b9f7c7ae7768cc29c9", "score": "0.81843203", "text": "def __float__(self):\r\n return _ilwisobjects.PixelIterator___float__(self)", "title": "" }, { "docid": "5825166d4d566fb4be1932786e79ad94", "score": "0.74169964", "text": "def __int__(self):\r\n ...
4d4b69001315667607b1f7faa42b93d7
Return the smallest and largest eigenvalue of hermitian operator ``A``.
[ { "docid": "be15624cfe423eae6eb95a64bac60cec", "score": "0.5767281", "text": "def bound_spectrum(A, backend='auto', **kwargs):\n el_min = eigvalsh(A, k=1, which='SA', backend=backend, **kwargs)[0]\n el_max = eigvalsh(A, k=1, which='LA', backend=backend, **kwargs)[0]\n return el_min, el_max", ...
[ { "docid": "2b1b3da2611f3d4c65c4525d3af722fa", "score": "0.6762377", "text": "def eigsh(A: Tensor,\n largest: bool = True,\n m: int = 20,\n max_iter: int = 10000,\n tol: float = 1e-5\n ) -> Tuple[Tensor, Tensor, int]:\n e, v, n_iter = Eigsh.apply(A, larges...
a4ee6faead96f35a3b1b16184b361e13
str> str some_cat is string inputted category ledg_list is a list of dictionaries representing transactions returns string transactions from dictionary where category matches parameters presented
[ { "docid": "1c31535c876d29367da1c7861e3c9e84", "score": "0.58800286", "text": "def print_by_cat(some_cat, ledg_list):\n val_list = []\n for transaction in ledg_list:\n if transaction[CATEGORY_COL] == some_cat:\n for key in transaction:\n if key == AMOUNT_COL:\n ...
[ { "docid": "7db5287fed0a62e8502975fdf3899a87", "score": "0.5633938", "text": "def combine_category(category):\n\n\tcategory_filter = []\n\n\tfor c in category:\n\t\tif c == \"sex\":\n\t\t\tcategory_filter.extend((\"SEX OFFENSES, NON FORCIBLE\", \"SEX OFFENSES, FORCIBLE\",\n\t\t\t\t\t\t\t\t\t\"PROSTITUIO...
328b92bde75dadfe209108158be68dec
Handles the dropping of the dragged connection
[ { "docid": "1f2bf1c01672169d8d0ecc19b68c05a0", "score": "0.61582077", "text": "def _drop(self, position): # pylint: disable=unused-argument\n if not self._playing:\n return\n\n if self._game.is_resolving():\n return\n\n self._grid_view.clear_dragged_connection...
[ { "docid": "8766a2cd58f3ce147a6d4ea91ea6590c", "score": "0.7067113", "text": "def after_drop(self, target, connection, **kw):", "title": "" }, { "docid": "6f3319ea51c67fb1d1095f968bcc72d6", "score": "0.6980423", "text": "def hook_drop(self):\n widget = self.widget\n wid...
bd2f05cd580045979c2412703f64ee52
Test restore_file_version raises 404 error
[ { "docid": "c4c327fe6c722803ef647d67251ca282", "score": "0.81118536", "text": "def test_restore_file_version_fails_with_404_exception(self) -> None:\n\n URL.API_BASE_URL = \"http://test.com\"\n url = \"{}/v1/files/{}/versions/{}/restore\".format(\n URL.API_BASE_URL, self.file_id...
[ { "docid": "d61331df523c92996c20317a014e9cbf", "score": "0.7169947", "text": "def test_restore_file_version_succeeds(self) -> None:\n\n URL.API_BASE_URL = \"http://test.com\"\n url = \"{}/v1/files/{}/versions/{}/restore\".format(\n URL.API_BASE_URL, self.file_id, self.version_id...
285755df5d7f67c6059001aa63fc4002
Prints and returns the number of errors relating to objects within arrays lacking `id` fields.
[ { "docid": "87316cb585a31940d1a5895ff7149f60", "score": "0.553918", "text": "def validate_object_id(*args):\n exceptions = {\n 'changes', # deprecated\n 'records', # uses `ocid` not `id`\n '0', # linked releases\n }\n\n required_id_exceptions = {\n # 2.0 fixes.\n ...
[ { "docid": "e401fc12a143e3bc1b8f74ee30a903f3", "score": "0.60479474", "text": "def display_errors():\n for e in parable.errors:\n write(\"\\n\" + e, COLOR_ERROR)\n return len(parable.errors)", "title": "" }, { "docid": "80be0c10a7e0e124d7f61e9367081f85", "score": "0.60005736...
76278f0e5efc26b02b96ab25f8229df1
Returns the attack power of your army
[ { "docid": "24e4a5710af35b78f21d14c0706dd9c7", "score": "0.8111584", "text": "def get_attack_power(county, army):\n strength = 0\n for name, amount in army.items():\n strength += county.armies.values()[name].attack * amount\n strength *= uniform(0.85, 1.15)\n return int(strength)", ...
[ { "docid": "e60dba37e35027f7496d1eaef118f31c", "score": "0.7620182", "text": "def attack_power(self, params):\n return self.polity.attack_power(params)", "title": "" }, { "docid": "78330785932fa22be6e4b9e27e1030cd", "score": "0.728332", "text": "def attack_power(self, params):...
752bfb8f156c2e4c52797ac6ddd1e564
Return the username for further use.
[ { "docid": "00e03a92d0d1b352e150f26119f313d9", "score": "0.87460893", "text": "def get_username(self):\n return self._username", "title": "" } ]
[ { "docid": "32ce8f3d9b2d89f3ff088323f3c6e6d6", "score": "0.8789279", "text": "def get_username(self):\n return self.username", "title": "" }, { "docid": "b9f3d48e59dd013ff027376c19cf5463", "score": "0.86927414", "text": "def username(self) -> str:\n return pulumi.get(se...
3baa3c732ef9d18f9a5305271ca48a56
Computes the evaluation mask.
[ { "docid": "acbc7f6b3daba332facb5f50cb5a46dc", "score": "0.6564162", "text": "def computeEvaluationMask(maskDIR, resolution, level):\n #slide = openslide.open_slide(maskDIR)\n #dims = slide.level_dimensions[level]\n #pixelarray = np.zeros(dims[0] * dims[1], dtype='uint')\n #pixelarray = np.a...
[ { "docid": "4a46143edac361dbfc09e3c6ae223b01", "score": "0.6575322", "text": "def apply_mask(self, mask: torch.Tensor) -> None:", "title": "" }, { "docid": "7ae3c375a662ab9d38f9ae79b30cb0e3", "score": "0.65126675", "text": "def calc_mask(self, layer, config):\n raise NotImplem...
7adfcbd2a184d6e5c05c1413ad13bdf4
Work around python reserved word
[ { "docid": "ab07dd336111b6d444888dc26bd4aedf", "score": "0.0", "text": "def ws_import(x):\n getattr(ws, \"import\")(x)", "title": "" } ]
[ { "docid": "d779d8cf4f5b99294984cb5fb4e5fcdf", "score": "0.661349", "text": "def _name_exsit(self):", "title": "" }, { "docid": "f6ca2f39abcd0667a25be60b540c11fc", "score": "0.649878", "text": "def check_reserved_keyword(self, name):\r\n for backend in self.check_reserved:\r\n...
aa5bad694ee4262475ec322683c3ebca
Given a list of paths to CSV metric files, returns a dictionary containing the global maximum for each metric key
[ { "docid": "6d32dca4c94d56e0ec3c06bc1d7c06d0", "score": "0.72449195", "text": "def findMaxima(inpaths, core):\n maxima = {}\n readers = {}\n infiles = {}\n for ind, p in enumerate(inpaths):\n infile = open(p, 'r')\n infiles[p] = infile\n readers[p] = DictRead...
[ { "docid": "4a9a0fac8bedc4f1a6429c56d0b68a2a", "score": "0.5977436", "text": "def get_max_yaxis(filename):\n max_master = -1\n max_no_master = -1\n with open(filename) as csvfile:\n reader = csv.DictReader(csvfile)\n for row in reader:\n value = float(row[\"value\"])\n ...
5c26ab72c9a537b0f09d4240cafafe2b
Adds a product to the db access only for admin
[ { "docid": "c6d4a9588073a83c47a35c6412e5308e", "score": "0.6830448", "text": "def add_product():\n # Checks if user is in session\n if \"user\" in session:\n # Checks if user is admin\n if session[\"user\"] == \"admin\".lower():\n if request.method == \"POST\":\n ...
[ { "docid": "1061fca0fdb1996a72462df588ee9065", "score": "0.73962516", "text": "def add_product():\n\n check_admin()\n add_product = True\n\n form = ProductForm()\n if form.validate_on_submit():\n product = Products(\n name=form.name.data,\n description=form.descr...
8aaa38d8bca476576a3131617ce995cf
Unique event id used by calendars
[ { "docid": "c403bff3fb4d933f1bfd206491488043", "score": "0.0", "text": "def cal_guid(self):\n return \"mtg\" + str(self.id) + \"@lnldb\"", "title": "" } ]
[ { "docid": "78d08c2588e7581c4c9ace3fffe653a0", "score": "0.78009397", "text": "def EventID(self) -> int:", "title": "" }, { "docid": "0c53035e738c1972090844622e47386c", "score": "0.77761203", "text": "def event_id(cls) -> str:\n return jsii.sget(cls, \"eventId\")", "title"...
c84c6f086d512304fa5d8c87585128d6
Set the given binding as the active one.
[ { "docid": "75341077ed9254acdb1f3b58629af968", "score": "0.734818", "text": "def set(self, binding):\n if not isinstance(binding, Bindings):\n # here, we assume that binding is a class, so we take the first\n # existing binding that is an instance of this class\n ...
[ { "docid": "011cacc27b248b4ce131045f712b8819", "score": "0.792457", "text": "def set_binding(self, binding):\n self.binding = binding", "title": "" }, { "docid": "78bbcdcd31ff234e252f29c2aa99c353", "score": "0.65545285", "text": "def setBinding(self, name, value):\n if ...
c30c667d5c5acfd97a1ef3c96272db95
Create a module from spec.
[ { "docid": "5cc8b8b1a3720e02264fccaecee78c40", "score": "0.78956467", "text": "def create_module(self, spec):\n if spec.name in sys.modules:\n # NOTE: Original name was already loaded, no need for going through all of importlib\n return sys.modules[spec.name]\n return...
[ { "docid": "ed48e74b84544028ce9264f387690eba", "score": "0.8555461", "text": "def create_module(cls, spec):\n return None", "title": "" }, { "docid": "ed48e74b84544028ce9264f387690eba", "score": "0.8555461", "text": "def create_module(cls, spec):\n return None", "ti...
9c579ee58ffb6223b9fb2c25c3ce72c5
Returns a new address of the custom currency or an existing one if the waves_address is already associated to an address of the custom cryptocurrency.
[ { "docid": "f41b358d49817ab1f5d163f58ffa8550", "score": "0.6344724", "text": "def create_address(self, waves_address: str) -> str:\n pass", "title": "" } ]
[ { "docid": "d858fdd21e034f2ef86e40ace1983a4b", "score": "0.60368794", "text": "def save(self,\n force_insert=False,\n force_update=False,\n using=None,\n update_fields=None):\n self.address_str = \"{}:{}\".format(self.coin.symbol, self.address)\n ...
a2ea01cceefd4fefdf12e838a468986b
Check that a generated cell is valid on the board.
[ { "docid": "7f8942579202c333a920584560995ae4", "score": "0.67646253", "text": "def isValidCell(cell):\n assert(type(cell) == tuple)\n if cell[0] < 0 or cell[1] < 0: return False\n if cell[0] > 11 or cell[1] > 11: return False\n if cell[0] < 6 and cell[1] > 5: return False\...
[ { "docid": "676a43fd6e31baadcd7271a8ea4f829a", "score": "0.71884423", "text": "def check_valid(cell: str) -> bool:\r\n global user_sequence\r\n return cell not in user_sequence", "title": "" }, { "docid": "9f411eb37deddc80476fb1d7e657da59", "score": "0.7176858", "text": "def va...
8c762669aac2bf002e9d0ebbf40e3d96
Test parallel feature fetch vector and return a file
[ { "docid": "70d4a68abae269b4c8caafec9da0ea86", "score": "0.7135391", "text": "def test_bqparallelfeature_fetch_2():\n filename = 'bqparallelfeature_fetch_2.h5'\n path = os.path.join(results_location, filename)\n PF=ParallelFeature()\n PF.set_thread_num(2)\n PF.set_chunk_size(5)\n filen...
[ { "docid": "5860a95e8ac72ce55a34838e7ccfd876", "score": "0.7470921", "text": "def test_bqparallelfeature_fetchvector_1():\n PF=ParallelFeature()\n PF.set_thread_num(2)\n PF.set_chunk_size(5)\n feature_vectors = PF.fetch_vector(bqsession, 'SimpleTestFeature', resource_list)", "title": "" ...
a938a21caf56eaceb7e5feec8346c651
get a bucket object, gc
[ { "docid": "5577f1f5f369e82ba39244911c5daa7a", "score": "0.73369956", "text": "def _get_bucket_gc(self, storage_bucket):\n client = gc.Client(project=self.gc_project_name)\n bucket = client.bucket(storage_bucket)\n if not bucket.exists():\n raise DataCloudError('sync up: ...
[ { "docid": "122723d39081f1efc4f682af4696cc92", "score": "0.6894451", "text": "def get_bucket(self):\n raise NotImplementedError()", "title": "" }, { "docid": "98a1f7a64bc2eb8398c35d2bdfd2ae87", "score": "0.67157984", "text": "def _gcs_object(self, path):\n bucket_name, blob...
08d7629f6b7f6c8b964a363946f21f61
>>> a = Link(1, Link(2, Link(3))) >>> b = reverse(a) >>> b Link(3, Link(2, Link(1))) >>> a Link(1, Link(2, Link(3)))
[ { "docid": "c1d7655c8dbcdf83f67c6c1880e51550", "score": "0.73522156", "text": "def reverse(lst):\n rev = Link.empty\n while lst is not Link.empty:\n rev = Link(lst.first, rev)\n lst = lst.rest\n return rev", "title": "" } ]
[ { "docid": "754c30f123c8966abcf8cc515faa1da6", "score": "0.75776565", "text": "def reverse(self):\n reverse = Link.empty\n while self is not Link.empty:\n reverse = Link(self.first, reverse)\n self = self.rest\n return reverse", "title": "" }, { "do...
0f3e2405c3155d56cfec9c2af6116240
Take name string, give back security group ID. To get around VPC's API being stupid.
[ { "docid": "afe3481db4dc4f46fe24a53d3b04c401", "score": "0.7532722", "text": "def get_security_group_id(self, name):\n # Memoize entire list of groups\n if not hasattr(self, '_security_groups'):\n self._security_groups = {}\n for group in self.get_all_security_groups(...
[ { "docid": "e592471444ff87ca1469506859a90787", "score": "0.75126034", "text": "def get_secgroup_id(kwargs=None, call=None):\n if call == \"action\":\n raise SaltCloudSystemExit(\n \"The get_secgroup_id function must be called with -f or --function.\"\n )\n\n if kwargs is N...
60ea7da3974f1023b2ee423d0b3a4c8d
Draw GO as a DAG
[ { "docid": "12cac323d199a866919b9d5ffc6b2bfc", "score": "0.6420478", "text": "def draw_GO(self):\n nx.draw(self.Ontology)\n plt.show()", "title": "" } ]
[ { "docid": "ffedb5c528864cc0eb748fe488e4ccea", "score": "0.7305107", "text": "def draw_dag(self):\n return nx.draw(self.graph, labelled=True)", "title": "" }, { "docid": "a8a4d8ecd0afefb18f9a6bbd89555450", "score": "0.6930505", "text": "def makeDotGraph(self) -> str:\n ...
3094f7e4637cdc5fe59ceefaa65a5198
Find component with componentType specified types and property key hast value
[ { "docid": "664414399cf9a693786a9d8f0656e235", "score": "0.63733405", "text": "def findValue(self, key: str, searchValue: Any, componentType: Optional[QWidget.__class__] = None) -> List[QWidget]:\n lst = list()\n for component in self.findKey(key, componentType):\n value = compo...
[ { "docid": "9eb39ff9195599ecc4a8f6bd6a42f00f", "score": "0.6614395", "text": "def findKey(self, key: str, componentType: Optional[QWidget.__class__] = None) -> List[QWidget]:\n\n if not isinstance(key, str):\n print(\"Property key typeError: {!r}\".format(key.__class__.__name__))\n ...
730408ed2c8f7f1da6a8babc8c53cfc9
Get the current audio status
[ { "docid": "10ebacf1356eff7924df86560ca26b88", "score": "0.8365147", "text": "async def get_audio_status(self):\n await self.request(EP_GET_AUDIO_STATUS)\n return {} if self.last_response is None else self.last_response.get('payload')", "title": "" } ]
[ { "docid": "eec5ad075a9497899d8872fe4bbb1ed8", "score": "0.717519", "text": "def audioTrack(self):\n audio = self.__setting['audio']\n code = getClientLanguage()\n if code in audio:\n return audio[code]\n return 0", "title": "" }, { "docid": "b4feeab7c5...
884430a0909d760db377c9498b33f682
Helper command to italicalize text
[ { "docid": "c23a9db612a1b62317217505331427b2", "score": "0.54463166", "text": "async def cmd_italics(self, message, content, leftover_args):\n content = ' '.join([content, *leftover_args])\n return await self._check_bot(message, \"*{}*\".format(content))", "title": "" } ]
[ { "docid": "39221d5d2f76a8dd3feef4404db1445c", "score": "0.684061", "text": "def _text_transformation(text):", "title": "" }, { "docid": "67528e8072b69d8b7d95672ab4eb63cc", "score": "0.6472909", "text": "def itex(self, text):\n if itex2mml:\n try:\n t...
4c2d55e98090af004c3e5c7fa53e0491
Get 'protocol.Data_Pool' instance for all pools.
[ { "docid": "4b7048b9bcc1531778030fb295109810", "score": "0.5296444", "text": "def storage_pools(node):\n\tif node.conn is None:\n\t\traise StorageError(_('Error listing pools at \"%(uri)s\": %(error)s'), uri=node.pd.uri, error='no connection')\n\ttry:\n\t\tpools = []\n\t\tfor name in timeout(node.conn.l...
[ { "docid": "21f619874ee3d30d602925fb877823f0", "score": "0.696777", "text": "def _pooldata(self):\n return next(\n (pool for pool in self.coordinator.data if pool[\"id\"] == self._poolid),\n None,\n )", "title": "" }, { "docid": "1f38ac6e613c151b874ddf2ad7...
cb01d8f179b96afe456c4374ba00c084
Setter method for times_enabled, mapped from YANG variable /mpls_state/times_enabled (uint32)
[ { "docid": "f3d5d37c63d62fd6ee442a490118d304", "score": "0.8622464", "text": "def _set_times_enabled(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, in...
[ { "docid": "ca2c91c265b62974f208a2229e7eaaf7", "score": "0.6474298", "text": "def _get_times_enabled(self):\n return self.__times_enabled", "title": "" }, { "docid": "bb6e7db1e1f56d93a73cad871b6c2e2f", "score": "0.58690506", "text": "def _set_transit_lsps_enabled(self, v, load=Fal...
fe035d829c552549a539f537efab9262
Emit a record. The record is translated to OTLP format, and then sent across the pipeline.
[ { "docid": "1c96e07c20eae7c6bb89f3bb6ea3b55d", "score": "0.7012174", "text": "def emit(self, record: logging.LogRecord) -> None:\n self._log_emitter.emit(self._translate(record))", "title": "" } ]
[ { "docid": "d35408cfec0b6ff72aeeda9906fae37b", "score": "0.76543707", "text": "def emit(self, record):\n\n pass", "title": "" }, { "docid": "4fcb41e745bc2849ef5355704b347341", "score": "0.76331604", "text": "def emit(self, record):\n pass", "title": "" }, { ...
8dfce375e6ed156a70383611e0499a25
add work logs from list
[ { "docid": "40d677023c64a6275d9fc492b4a9c7ef", "score": "0.76735646", "text": "def add_work_logs(list_dict=worklogs):\n for worklog in list_dict:\n try:\n Worklog.create(worker_name=worklog['worker_name'],\n task_name=worklog['task_name'],\n ...
[ { "docid": "7cfece95eff671c2df92744a07cd0138", "score": "0.6894855", "text": "def append_logs(self, logs: List[Dict[str, Any]]) -> None:\n\n raise NotImplementedError", "title": "" }, { "docid": "a1796a43d9c88e9e9e91a4ac3d4083f6", "score": "0.6539237", "text": "def test_log_li...
5339215e19cc8d68841aa88014416c61
drop(self, noun) consumes a World and a noun, removes the noun from the players inventory if noun exists in Player's inventory and mutates noun by adding noun to Room's contents.
[ { "docid": "b133d149b23bb2ff56c52a195b042ede", "score": "0.80960494", "text": "def drop(self, noun):\n for things in self.player.inventory:\n if noun == things.name:\n self.player.inventory.remove(things)\n self.player.location.contents.append(things)\n ...
[ { "docid": "f7ec4dbcc13ed912996edd6451514158", "score": "0.76989484", "text": "def drop(self, verb, noun, inoun = None):\n objNoun = None\n objInoun = None\n self.moved = False\n\n if noun in self.inventory:\n objNoun = self.inventory[noun]\n if inoun:\n...
343d2860196b19ce3084cd41f48cff08
image = jpg, jpeg, png On success returns ``mglib.path.PagePath`` instance.
[ { "docid": "f33e34470cc5a4dc08950830b714c41c", "score": "0.52879614", "text": "def ocr_page_image(\n doc_path,\n page_num,\n lang,\n **kwargs\n):\n logger.debug(\"OCR image (jpeg, jpg, png) document\")\n\n page_path = PagePath(\n document_path=doc_path,\n page_num=page_nu...
[ { "docid": "1836a08dc9f468691afa711b35b0118f", "score": "0.63259786", "text": "def open_image_label(page_path, img_path, label_path):\n page = PrimaPage(page_path)\n p_img_open = page_img_opener(page)\n img = p_img_open(img_path)\n l_img = p_img_open(label_path)\n return img, l_img", ...
155d8b341ec361d98c586dab33045e70
Extract layer, region, module number and position from a unique half module identifier.
[ { "docid": "222d3258e5dc71dc20c25c2a11449233", "score": "0.77563006", "text": "def locateTTHalfModule(halfModuleId):\n position = halfModuleId[-1:]\n uLayer = halfModuleId.split('Region')[0]\n region, moduleNum = halfModuleId.split('Region')[1].split('Module')\n return uLayer, region, int(mo...
[ { "docid": "9a4ed24cee1d705b2da57b78137b0493", "score": "0.65242213", "text": "def locateTTModule(moduleId):\n uLayer = moduleId.split('Region')[0]\n region, moduleNum = moduleId.split('Region')[1].split('Module')\n return uLayer, region, int(moduleNum)", "title": "" }, { "docid": "...
a180806d61024f0350df46a9bd274ae8
Given a list of ExternalWorkUnit, makes sure that all ExternalExtensibleBase have materialized tracked objects. Then returns the wrapped WorkUnits.
[ { "docid": "7234f0836ae26093c1c422bec307c429", "score": "0.7181121", "text": "def _unwrap_ext_work_units(self, ext_work_units):\n\n external_work_units_grouped_by_class = defaultdict(list)\n external_work_units_grouped_by_global_id = defaultdict(list)\n\n for ext_work_unit in ext_wo...
[ { "docid": "cfe144b4a80d516769a57d2159701103", "score": "0.72182626", "text": "def _sync_work_units(self, work_units):\n\n if not work_units:\n return work_units\n\n # 1. Batch query for existing work units by (workflow_provider, external_work_unit_id)\n existing = list(W...
33593f0e78201eba2947500129adce71
A test to check that rank finds index of a key in sorted order.
[ { "docid": "60eab464fc87ca845690c8ea8a664d75", "score": "0.7065371", "text": "def test_rank_negative():\n keys = list(range(-100, 100))\n d = OrderedTreeDict((key, None) for key in keys)\n assert all(list(\n keys[d.rank(k)] == k for k in keys\n ))", "title": ""...
[ { "docid": "89a15ef69961bdfc7cf40c95814aa0b9", "score": "0.7637563", "text": "def test_rank():\n keys = list(range(100))\n d = OrderedTreeDict((key, None) for key in keys)\n assert all(list(\n keys[d.rank(k)] == k for k in keys\n ))", "title": "" }, { "...
988f504f229ab3b4a5f2b97b190eef4c
The bits whose parity stores the parity of the bits 0 .. `index`.
[ { "docid": "cc3b88ae371ff7610cf6db652f3a46c7", "score": "0.7036098", "text": "def _parity_set(index):\n indices = set()\n\n # For bit manipulation we need to count from 1 rather than 0\n index += 1\n\n while index > 0:\n indices.add(index - 1)\n # Remove least significant one f...
[ { "docid": "d0d714be8d59dfb6c9cf2bf613e5cfdc", "score": "0.70778936", "text": "def parity(n):\n # bin(n) returns 0b.... \n # bin(n)[2:] trims \"ob\"\n return sum(int(x) for x in bin(n)[2:]) % 2", "title": "" }, { "docid": "5db780d213b678e431fa2da2ac6c604a", "score": "0.70349866", ...
85e99bef792e9ff5155cd81d3c20f826
In each job, the methods are executed with the same dataset split and their results are put in an array.
[ { "docid": "b609984317ade71cbbf1be7340f999ea", "score": "0.0", "text": "def validate(analysis, dataset_manager, pixel_methods):\n results = []\n train, verify = dataset_manager.get_data_splits()\n if analysis is True:\n data_analysis(train)\n for pixel_method in pixel_methods:\n ...
[ { "docid": "2c75164bb06e2fe93a8887b597c49827", "score": "0.6873918", "text": "def batch_run(self) -> None:", "title": "" }, { "docid": "93e4fb49c095b7635f67d8e053f02338", "score": "0.65535104", "text": "def run_parallel(self, **kwargs):\n\n duts=kwargs.get('duts') \n me...
31ece964885d2dce60226c5e8cdbc050
Emit ``CREATE TYPE`` for this
[ { "docid": "4deeed2a3eb4a6af3b3697f5038a011a", "score": "0.0", "text": "def create(self, bind=None, checkfirst=True):\n if not bind.dialect.supports_native_enum:\n return\n\n super().create(bind, checkfirst=checkfirst)", "title": "" } ]
[ { "docid": "f6f886f23fbe426eefa80c709ee61745", "score": "0.66751873", "text": "def create(self):\n return CreateDatatypes([self])[0]", "title": "" }, { "docid": "4e275bd469fadcc00e9677156359e143", "score": "0.66318345", "text": "def create_type(self, create_type):\n\n s...
b91cdbd5e0f55cb1591ad023618cb050
Add a morph.DFMRotate object or create a new one. If no argument is given, a new instance of morph.DFMRotate will be created.
[ { "docid": "8abe78c38d9fcefb8cf2294aa8859ef7", "score": "0.0", "text": "def add_rotate(rotate_obj):", "title": "" } ]
[ { "docid": "976dffd0871d2fa44491dc8d42c37db7", "score": "0.5145458", "text": "def MorphParamCreateDFMRotate(name, rotate_args, entities, bounds, autobounds):", "title": "" }, { "docid": "fe8b8d14829630d2c7752af44f9745ef", "score": "0.502624", "text": "def add(self) -> None:\n\n ...
8e915c9bed9fe88cb18c1dc152baa1e4
Generacion de hinchas de River
[ { "docid": "043b0f1bef0ba62cfa505cba8d4eeee7", "score": "0.0", "text": "def barra_brava_river(viajes, lugares_bote, mutex):\n while viajes < 20:\n time.sleep(random.randrange(0, 5))\n hr = threading.Thread(target=hincha_river, args=(lugares_bote, mutex,))\n hr.start()\n # ...
[ { "docid": "0cc41407da05b64dc4ef2d3a5f2701d2", "score": "0.67497545", "text": "def hincha_river():", "title": "" }, { "docid": "3b0bb52fa9521499ef508c6bb7079ab1", "score": "0.60572916", "text": "def genemap(self):\n\t\treturn [('W1',8, 'Weighted'), ('L1',8, 'Weighted'), ('R1',8, 'Wei...
4c3f1e80e1a13647cfac3dc3f583becc
Test for searching and finding through the children of a node with location specified.
[ { "docid": "040f8892cd1ebc22e86bd7fd0ef294be", "score": "0.5892507", "text": "def test_find_node(self):\n # Assign\n node2 = Node(\"Child node 2\")\n node3 = Node(\"Child node 3\")\n node2.add_or_replace_child(node=node3, index=2)\n\n node1 = Node(\"Child node 1\")\n ...
[ { "docid": "402682c267e585a31521634972681bfe", "score": "0.63392574", "text": "def getChildren(node, *args, **kwargs):", "title": "" }, { "docid": "47f5e66c1cce9bfeecaeb53fb73a0493", "score": "0.63026905", "text": "def findChildren(self, name='None', attrs='{}', recursive='True', tex...
faf67ca2c6b38c34528540e8f97c1612
Checks that _ViewerApplet doesn't crash on the given model file.
[ { "docid": "b1121d0ebf7609c6e9b520ac4d1b5a01", "score": "0.57598865", "text": "def _check_viewer_applet_on_model(self, resource):\n dut = mut.Meldis()\n lcm = dut._lcm\n diagram = self._make_diagram(\n resource=resource,\n visualizer_params=DrakeVisualizerParam...
[ { "docid": "6b58e04ec2a8a0bd02e23457960f62ba", "score": "0.61653244", "text": "def test_viewer_applet_plain_meshes(self):\n self._check_viewer_applet_on_model(\n \"drake/manipulation/models/iiwa_description/urdf/\"\n \"iiwa14_no_collision.urdf\")", "title": "" }, { ...
4589f6947d22d318bcdf8a791f92482b
compute boundary of disjoint union of polygons, return union polygon(s) and list of boundary pieces in the same order as corresponding input polygons
[ { "docid": "1257ff00729ac91d555243cdc1ab5e4f", "score": "0.83428013", "text": "def compute_disjoint_union(*polygons):\n # note: the outputs that are holes are correctly returned in clockwise\n # i.e. opposite direction. this can be identified with the is_a_hole\n # function below.\n\n # dete...
[ { "docid": "6c3d5b45fb28b128783dbaf7b86098fd", "score": "0.6554626", "text": "def polygon_iou(list1, list2):\n polygon_points1 = np.array(list1).reshape(4, 2)\n poly1 = Polygon(polygon_points1).convex_hull\n polygon_points2 = np.array(list2).reshape(4, 2)\n poly2 = Polygon(polygon_points2).c...
db7e74bcfd026b96bad79174d35983aa
create a new branch that merges the clusters of two or more branches that have different clusters
[ { "docid": "3d8533a6bbc0b74951d479f93c58ce05", "score": "0.6773576", "text": "def create_merge_branch(self, cid, merge_child, occluded_parents, fathers, line_num, point_list):\n\n saved_parent_nodes = []\n\n for oparent in occluded_parents:\n\n parent_node = [pnode for pnode in ...
[ { "docid": "a3c052576b04bd128432dd0a90f4608b", "score": "0.6381184", "text": "def mergeBranchToCluster(self, mcid, cluster_id, branch_id, close=1):\n\n node_list = Graph.cluster_dict[cluster_id][branch_id]\n # make all the cluster_id's the same\n for node in node_list:\n ...
3755e75101ba7ee74b0543b79d5cc561
Return list of GET parameters that should be removed from querystring
[ { "docid": "d53a7ac1ac0903af71c3a29c647c9a20", "score": "0.7678245", "text": "def get_querystring_parameter_to_remove(self):\n return self.del_query_parameters + [self.sort_parameter]", "title": "" } ]
[ { "docid": "6d9cb29b157f9a0901208652d3c8ceb7", "score": "0.7658783", "text": "def remove_from_query(context, *args, **kwargs):\n query_params = []\n # go through current query params..\n for key, value_list in context[\"request\"].GET._iterlists():\n # skip keys mentioned in the args\n ...
05820bf0cda8ff6e6985ae5b64e56305
used to print fraction
[ { "docid": "a7ef7522c1dba33096776029f106df1d", "score": "0.67656446", "text": "def __str__(self):\n x = self.numerator / self.denominator\n if x != 0:\n return \"%s and %s / %s\" % (x, self.numerator % self.denominator, self.denominator)\n else:\n return \"%s /...
[ { "docid": "e8e765c12dee572b44efd64798c47853", "score": "0.7505799", "text": "def printFrac(self, num, den):\n # Wrap LaTeX in \\frac tag\n code = r\"\\frac{%s}{%s}\" % (num, den)\n\n # Append to editor\n self.ui.text_equation.append(code)", "title": "" }, { "doci...
26bf712cdea56b737a3a82b2da71dbc5
Control the normals of an object. This command works on faces or polygonal objects.
[ { "docid": "e9126d584ef78d5ce88a4c8db5fd9b97", "score": "0.52289", "text": "def polyNormal(*args, **kwargs):\n\n pass", "title": "" } ]
[ { "docid": "1bbb05d3a41115c7ef5c1abf20d11d98", "score": "0.73524904", "text": "def setNormals(self):\n self.Normals[0] = normalize(cross(map(operator.sub, self.V1[0], self.V1[2]), map(operator.sub, self.V1[0], self.V1[1])))\n self.Normals[1] = normalize(cross(map(operator.sub, self.V1[0], ...
f049ba5d88464a89918b015e73f5e21b
Return 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": "0be70d3e77e77041a9ddcf1c23fe823d", "score": "0.848826", "text": "def __str__(self):\n\t\treturn str(self.__model)", "title": "" }, { "docid": "0fbfd148e937420716433d412dc3b6bf", "score": "0.8422646", "text": "def __str__(self):\n\n return str(self.model)", "tit...
83be23f920b87d1cbb6264dd415dccd4
Return keyword arguments bound to given logger
[ { "docid": "ec185db085a952fee750b32b67b30585", "score": "0.75169855", "text": "def bound_log_kwargs(log):\n f = log.msg\n kwargs_list = []\n while True:\n try:\n kwargs_list.append(f.keywords)\n except AttributeError:\n break\n else:\n f = f...
[ { "docid": "2e798378f8e489aba849418d7a681020", "score": "0.6344701", "text": "def parseKwargs(cls, config_stats, logger=None):\n kwargs = {}\n kwargs.update(config_stats)\n kwargs.pop('type',None)\n return kwargs", "title": "" }, { "docid": "09192833047de487d28bfa...
e8b27759e021dbf9f09cef998af40765
Load a doc for a given sbid
[ { "docid": "6d8d2a37f31a63f95ece7b9f226370ec", "score": "0.7412022", "text": "def load_doc(sbid):\n data_path = os.path.join(base_dir, sbid, 'data.json')\n doc = json.loads(open(data_path).read())\n try:\n del(doc['_attachments'])\n del(doc['_rev'])\n except KeyError:\n ...
[ { "docid": "d07dff9a9e2a95a7dd8b26d6437b7032", "score": "0.6116128", "text": "def get_document(self, docid):\n return self.backend.get_document(docid)", "title": "" }, { "docid": "3ccd0641fd2c91275191ac035c3efc67", "score": "0.59131324", "text": "def get_document_by_id(self, i...
0911e9e71f69f1b97436a7108347a172
Identify the persons by disambiguation. Apply Bipartite Graph Matching. Take list of matrices and for each consecutive pair of them, get the trajectory of people. Tracks of people over the frames.
[ { "docid": "fa30220e3af254543409af6460daed89", "score": "0.666316", "text": "def disambiguatePersons(self):\n track_labels = []\n start = True\n # Iterate over the frame pose matrices\n for i, poses in enumerate(self.vid_persons):\n \n if poses.shape == ...
[ { "docid": "49950be6e0f4806ad2611217e0a64591", "score": "0.5999887", "text": "def _extractmatches(keyfaces):\n key, faces = keyfaces\n \n # no match found\n if len(faces) == 1:\n start, end, isgt = key\n seg1, ...
f0f7919b90c422c4f92ba926d87b1354
Persist results of block b.
[ { "docid": "6cc70a39c64b0f6b2e3631f1e6463026", "score": "0.71250165", "text": "def persist_result(b, psco_name=''):\n from storage_model.block import Block\n bl = Block()\n bl.block = b\n bl.make_persistent(psco_name)", "title": "" } ]
[ { "docid": "bb23a3e42525e164153054d51237f6b4", "score": "0.5830644", "text": "def _store_result(self, total_count, open_result, values, data):\n [self._result] = values\n self._push(None)", "title": "" }, { "docid": "8aab13632aba6065c760c498de19e80b", "score": "0.5778085", "tex...
ede51f1a4b660f32c1c46cac49914b10
Verify creating and deleting subnet with allocation pools
[ { "docid": "5a24538a9d1351937a182e14b0edc031", "score": "0.82713765", "text": "def test_create_delete_subnet_with_allocation_pools(self):\n self._create_verify_delete_subnet(\n **self.subnet_dict(['allocation_pools']))", "title": "" } ]
[ { "docid": "5e577dc0af595ea0742a1c4a8e599307", "score": "0.8004876", "text": "def test_create_delete_subnet_with_gw_and_allocation_pools(self):\n self._create_verify_delete_subnet(**self.subnet_dict(\n ['gateway', 'allocation_pools']))", "title": "" }, { "docid": "ff2c39b96...
eb29bbd417a4e579073ff643eec19a99
Hints that we don't want a blank line before the next statement.
[ { "docid": "d34dc89189a06ab496cc7a221d4ef6ef", "score": "0.0", "text": "def stick(self):\n self._in_group = True", "title": "" } ]
[ { "docid": "6f698b7c22a9db644bfffee571ec3470", "score": "0.68750113", "text": "def emptyline(self):\n pass", "title": "" }, { "docid": "6f698b7c22a9db644bfffee571ec3470", "score": "0.68750113", "text": "def emptyline(self):\n pass", "title": "" }, { "docid":...
a93ae90d531f7014b808bb4520c8ef6a
split ecg to make 2d matrix of the form beats x points. bad qrst complexes are replaced by average
[ { "docid": "b99ece4bdabcd6f14afd3e1e6ad713d0", "score": "0.5666693", "text": "def makeMat(ecg,qrsonsets,qrsflags):\n \n #convert to millivolts\n #ecg = ecg*1000 # do this later in the calling script if reqd\n \n #Get mean cycle length\n rrintervals = qrsonsets[1:]-qrsonsets[:-1]...
[ { "docid": "d243886f471226abb337be55d4f06252", "score": "0.58604336", "text": "def G_ee(basis,molecule,P,ee):\n\n # Size of the basis set\n K = basis.K\n\n G = np.zeros((K,K))\n\n for i in range(K):\n for j in range(K):\n for k in range(K):\n for l in range(K...
1f8ff2e7af3dde7f64c880f4c1bb86f9
Asserts tensor has expected shape. If tensor shape and expected_shape, are fully defined, assert they match. Otherwise, add assert op that will validate the shape when tensor is evaluated, and set shape on tensor.
[ { "docid": "373c9a769ae38c46cd24b84d92a9126d", "score": "0.7199602", "text": "def with_shape(expected_shape, tensor):\n if isinstance(tensor, sparse_tensor.SparseTensor):\n raise ValueError('SparseTensor not supported.')\n\n # Shape type must be 1D int32.\n if tensor_util.is_tensor(expected_shape)...
[ { "docid": "81afcb0928fe5aa288d1028b6c28ecf6", "score": "0.84670264", "text": "def _assert_shape_op(expected_shape, actual_tensor):\n with ops.name_scope('assert_shape', values=[actual_tensor]) as scope:\n actual_shape = array_ops.shape(actual_tensor, name='actual')\n is_shape = _is_shape(expecte...