query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c831db51a49f82c1aad70fcfb2c7a168
Configure the action space.
[ { "docid": "765e854f6819b2dd146069c878c01d67", "score": "0.7577407", "text": "def _initialize_action_space(self) -> None:", "title": "" } ]
[ { "docid": "d4e74311ef892427cf268c56f6777f0c", "score": "0.7442753", "text": "def _set_action_space(self):\n assert isinstance(self.env.action_space, gym.spaces.Discrete), self.env.action_space\n self.action_space = self.env.action_space", "title": "" }, { "docid": "d4e74311ef8...
cfeb8d8af6510704a896ae6353ef0d5c
Regression test for bug 8106. Same sort of problem as the previous test, but this time there are more extra tables to pull in as part of the select_related() and some of them could potentially clash (so need to be kept separate).
[ { "docid": "ee5f4f90b9acdd3898401caf24d2174a", "score": "0.7024326", "text": "def test_regression_8106(self):\r\n\r\n us = TUser.objects.create(name=\"std\")\r\n usp = Person.objects.create(user=us)\r\n uo = TUser.objects.create(name=\"org\")\r\n uop = Person.objects.create(u...
[ { "docid": "f64bd0357ba1341d44bef91a90f66996", "score": "0.70327324", "text": "def test_regression_8106(self):\r\n\r\n us = TUser.objects.create(name=\"std\")\r\n usp = Person.objects.create(user=us)\r\n uo = TUser.objects.create(name=\"org\")\r\n uop = Person.objects.create(...
36c63ee68e5763e9bb4f9e2b93d6a70b
Getter method for rip, mapped from YANG variable /l3vpn_ntw/vpn_services/vpn_service/vpn_nodes/vpn_node/vpn_network_accesses/vpn_network_access/routing_protocols/routing_protocol/rip (container)
[ { "docid": "8871e6f3e7446d88fb57804a1b4aa586", "score": "0.56625473", "text": "def _get_rip(self):\n return self.__rip", "title": "" } ]
[ { "docid": "952732d3cc85b07d414af726f561636b", "score": "0.7309867", "text": "def _set_rip(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_rip_ietf_l3vpn_ntw__l3vpn_ntw_vpn_services_vpn_service_vpn_nodes_vpn_node_vpn_network_access...
78789e4c729ea48916680b63fd1b8695
Momentum update of the key encoder
[ { "docid": "40a33b2614b114bc49ebb4814681b3b2", "score": "0.74493855", "text": "def _momentum_update_key_encoder(self):\n m = self._get_m()\n for param_q, param_k in zip(self.model.parameters(), self.lagging_model.parameters()):\n param_k.data = param_k.data * m + param_q.data * ...
[ { "docid": "48e07aaa6996bd22c5d2743d6144d105", "score": "0.79691774", "text": "def _momentum_update_key_encoder(self):\n for param_q, param_k in zip(self.encoder_q.parameters(), self.encoder_k.parameters()):\n param_k.data = param_k.data * self.m + param_q.data * (1. - self.m)", "t...
3b8428bcc5c56e3148d620de310023e6
Within an Ensembl release path, get the subpath for protein sequences data given an ncbi taxonomy id, e.g. the pattern on Ensembl is like 'fasta/species.name'
[ { "docid": "d9daa28e0c5b1b527137e31b5331ab99", "score": "0.6448442", "text": "def __get_subpath_fasta_for_species(self, taxonomy_id):\n # The subpath is fasta/species.name\n self._get_logger().debug(\"__get_subpath_fasta_for_species for taxonomy id '{}'\".format(taxonomy_id))\n retu...
[ { "docid": "c62de25da7c9765ca1ce4561c24fe193", "score": "0.68920547", "text": "def __get_subpath_protein_sequence_for_species(self, taxonomy_id):\n # The subpath is fasta/species.name/pep\n self._get_logger().debug(\"__get_subpath_protein_sequence_for_species for taxonomy id '{}'\".format(...
a3c7062c6a4d1e2a43caa2ab02bffb88
Test invalid authentication token
[ { "docid": "00a093e6f48062723399fd0d7b110f70", "score": "0.8041319", "text": "def test_invalid_auth_token(self):\n with self.app.app_context():\n self.user.save()\n self.assertEqual(\"Invalid token. Please log in again.\", self.user.decode_auth_token(\"riignrgnrg\"))", "...
[ { "docid": "3bcb0ca1f106825f5c1daad370857d5c", "score": "0.83785814", "text": "def test_invalid_token(self):\n response = self.client.get('/api/user/', content_type='application/json',\n HTTP_AUTHORIZATION='Bearer nhbvjhsjkhfkjsfn,sjk')\n\n self.assertIn('...
9223b6c8e27f2e13221a17a177a3666b
_parse_samples should properly parse a packet containing two samples of only digital io data for one dio line
[ { "docid": "00429153e7af412af8180a3930c33953", "score": "0.7083207", "text": "def test_parse_multiple_dio_subset(self):\n # Two samples, ADC disabled\n # DIO 0 enabled\n header = b'\\x02\\x00\\x01'\n\n # First 7 bits ignored, DIO8 low, DIO 0-7 alternating\n sample = b'...
[ { "docid": "19631da13a7aeebcda171a379807c227", "score": "0.7278747", "text": "def test_parse_single_dio_subset_again(self):\n # One sample, ADC disabled\n # DIO 0 enabled\n header = b'\\x01\\x00\\x01'\n\n # First 7 bits ignored, DIO8 low, DIO 0-7 alternating\n sample =...
dbbc1c9ccba84af63176f11074f88fbd
Function to initialize prototypes in the model.
[ { "docid": "c50d145aefe9f51bc544711bb3ba6846", "score": "0.73591924", "text": "def initialize_prototypes(self, initialize_by=\"class-mean\", pass_w=[], pass_w_labels=[]):\n self.initialize_by = initialize_by\n\n # Initialize the prototypes\n if (initialize_by == \"initialized\"):\n ...
[ { "docid": "e18db8209b7abdfb6437d14e16dd5d6a", "score": "0.6100342", "text": "def __init__(self):\n self.iris_model = self._load_model()\n self.query_schema = IrisQuerySchema()", "title": "" }, { "docid": "ab6f6f1ca407b9696970ba7f464620ff", "score": "0.60907435", "text"...
e71eee33e0341ee4212c5f4391092175
Test case for get_driver_safety_score
[ { "docid": "8bc33e0e05ad9ae19c00748599897426", "score": "0.75541055", "text": "def test_get_driver_safety_score(self):\n query_string = [('access_token', 'access_token_example'),\n ('start_ms', 56),\n ('end_ms', 56)]\n headers = { \n ...
[ { "docid": "c825af99a6b243890e1896076c32cb77", "score": "0.6813096", "text": "def test_company_earnings_quality_score(self):\n pass", "title": "" }, { "docid": "c46e8283f137f6921182bbecf21c72ef", "score": "0.68129355", "text": "def test_get_score(self):\n score_dict = s...
b98bc37159e4ab5ff692f3583e33c50c
Implement data processing similar to ToTensor.
[ { "docid": "14841e5dbfac84b151c5c444ed6b5ced", "score": "0.0", "text": "def __call__(self, results):\n for i, modal in enumerate(results['modality']):\n video = results['video'][i].transpose(3, 0, 1, 2)\n results['video'][i] = torch.tensor(\n np.ascontiguousar...
[ { "docid": "99d1e460acc07b9ca12d1daf114b4c21", "score": "0.7140292", "text": "def evaluate(self, data, batch_size=512):", "title": "" }, { "docid": "1b750ba546005573394218900676dc48", "score": "0.7139154", "text": "def compute(self, data):", "title": "" }, { "docid": "2a1...
5a10b5cedb3047b8a48e09dad7ec1566
LampStateParameters a model defined in OpenAPI
[ { "docid": "e80e87a8180fc8a01528641e0e8ad613", "score": "0.0", "text": "def __init__(self, brightness=None, master_brightness=None, net_brightness=None, dim_curve_active=None, dim_curve=None, power_on=None, vibrancy=None, cct=None, x_chromaticity=None, y_chromaticity=None, local_vars_configuration=None)...
[ { "docid": "61c666097d6089a5d2bc5f6e76f276e0", "score": "0.601345", "text": "def sampleModelParameters(self):\n pass", "title": "" }, { "docid": "1693beeaf7ed0cad3aba2ae3bf09e3bd", "score": "0.5515178", "text": "def __init__(self, state: str=None, temperature: float=None):\n ...
d725300c97bd2fc2e76f746a0950aa8b
Helper function for parallel pairwise distance calculations.
[ { "docid": "ff1d4d64c6b4030851944bfe13604ccc", "score": "0.0", "text": "def _all_dist_to_end(args):\n idx = args[0]\n spiketrains = args[1]\n start = args[2]\n end = args[3]\n N = args[4]\n num_spiketrains = len(spiketrains)\n distances = []\n for jdx in range(idx+1, num_spiketra...
[ { "docid": "1465d0103db13253dec0ab80ec0b42f2", "score": "0.70513475", "text": "def _pairwise_dist(self,s1,s2):\n\n return 0.0", "title": "" }, { "docid": "11b0e810e8e0f2bb77487a4d5c5043d9", "score": "0.6761033", "text": "def _pairwise_dist(self,seq1,seq2):\n \n retur...
dcaeaaf6692df901bfea43c6702c9c21
SetFont(font) Sets the current font for the DC.
[ { "docid": "0407b810ea7cee0079baedb1e8a85652", "score": "0.780529", "text": "def SetFont(self, font):", "title": "" } ]
[ { "docid": "63cde49d565aed7a1bedde4d14357473", "score": "0.77239305", "text": "def setFont(self, font):\n self.textFont = font", "title": "" }, { "docid": "952c56c2ce4261a89ef4ec6c1c310243", "score": "0.7673749", "text": "def set_font(self, font):\n self._font = font", ...
be25159ceafaee2cda1f609648e81cb0
Setter method for state, mapped from YANG variable /qos/interfaces/interface/output/classifers/classifier/state (container)
[ { "docid": "9821c217eea856154e39377f61555bee", "score": "0.83308876", "text": "def _set_state(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_state_openconfig_qos_interfaces__qos_interfaces_interface_output_classifers_classifier_st...
[ { "docid": "73d7d8d1caf11d86aac69cd5916293eb", "score": "0.83311594", "text": "def _set_state(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_state_openconfig_qos_interfaces__qos_interfaces_interface_input_classifers_classifier_sta...
bee74ad7e3b04dc6434706e761651b3e
Get a list of user's messages
[ { "docid": "cd71a6c26f5d90d4ec854602899f7a0a", "score": "0.6941459", "text": "def list_messages(self,\n from_=None,\n to=None,\n from_date_time=None,\n to_date_time=None,\n direction=None,\n ...
[ { "docid": "5f692e0eb2bdda918ac8d19d75108253", "score": "0.8211176", "text": "def list(self):\n try:\n response = self.service.users().messages().list(userId=self.user_id,\n labelIds=self.label_ids).execute()\n messages =...
67201eebadfb05d07ab563fab01f9f62
Store a progress operation
[ { "docid": "eb720a8dbca1df2a8809fcf0151a809b", "score": "0.71220106", "text": "def store(self, progressObj, session = None):\n \n # Does an exception exist?\n if progressObj.completed and progressObj.resultCode:\n \n try:\n if session: session.un...
[ { "docid": "a61af1fb4ecfbd5fce38ea82fbb7c55b", "score": "0.6987925", "text": "def save_progress(self):\n\n with self._write_lock:\n self.set_modified_at()\n self.doc_ref.collection('progress').document('progress').set({\n 'progress': self._progress.to_dict()\n...
d784b4fd958871a98e9adbb6ae61c231
!Make a list of detector configs a list of detector configs (lsst.afw.cameraGeom.DetectorConfig)
[ { "docid": "fa5d2417908e4700de4eef5869faefc8", "score": "0.8084532", "text": "def _makeDetectorConfigList(self):\n # There is only a single detector assumed perfectly centered and aligned.\n detector0Config = cameraGeom.DetectorConfig()\n detector0Config.name = '0'\n detector...
[ { "docid": "3e6fa7eb4574ef4fd745365289c49bc9", "score": "0.70075893", "text": "def makeDetectorConfigs(self, detFile):\n detectors = []\n self.detectorNameList = []\n self.detectorIdList = []\n with open(detFile) as fh:\n names = fh.readline().rstrip().lstrip(\"#\"...
ac2d14e311f61d409115b70f90050623
Testing json_patch with remove op and missing path
[ { "docid": "901c071aa7cfeebf21f257d30e123803", "score": "0.8216336", "text": "def test_remove_with_missing_path(self):\n doc = {\n 'a': 1,\n }\n patch = [{\n 'op': 'remove',\n 'value': 1,\n }]\n\n message = 'Missing key \"path\" for pat...
[ { "docid": "96d60e083c8addd0cfe19651052d9160", "score": "0.8357207", "text": "def test_remove_with_complex_path(self):\n doc = {\n 'a': [{\n 'b': 1,\n 'c': 2,\n }],\n }\n\n self.assertEqual(\n json_patch(\n ...
dc1e25b68f60aafd2604d012b3dff8a6
Tests the mongo map reduce utility functions
[ { "docid": "8727c9e54e115d814f5b803acc679fe9", "score": "0.75288475", "text": "def test_mapreduce(Corn):\n Corn.create({'id': 1, 'name': u'foo', 'lastname': u'bar'}).save()\n Corn.create({'id': 2, 'name': u'baz', 'lastname': u'bar'}).save()\n Corn.create({'id': 3, 'name': u'foo', 'lastname': u'...
[ { "docid": "36a9b3b59336d000345d11ca9b2e0c5e", "score": "0.62238985", "text": "def map_reduce(self, map_function, reduce_function):\n \n mapped = []\n for i in self.docs:\n mapped.append(map_function(i))\n \n return reduce_function(mapped)\n pass"...
8ab33b06afd8890ccd81cf2ad9cc9f6c
A simple function to be wrapped by assemblywrapper
[ { "docid": "62b6d1fb03cd36869c5a7c8f4d7b83c4", "score": "0.0", "text": "def passthrough(output):\n return output", "title": "" } ]
[ { "docid": "20dac9c083de07ca26d97b3f06158ce3", "score": "0.6395671", "text": "def __call__(self, assembly1, assembly2):\n raise NotImplementedError()", "title": "" }, { "docid": "d3675434fd87de2d7c1ab340cef5bedc", "score": "0.62855", "text": "def test_assemblywrapper(self):\n ...
c8b213203726dc688a55a8c919f2f7a5
Switches the TPS reserved state on or off. ON OFF
[ { "docid": "497d79af61a8f7a47a8f0da4b8f0ccae", "score": "0.6989425", "text": "def set_digitaltv_settings_tpsreservedstate_dvbt(self, state_type):\n self.specan.write('DVBT:TPSR:STAT {}'.format(state_type))\n logging.info('DVBT:TPSR:STAT {}'.format(state_type))\n self.specan.query('*...
[ { "docid": "7ae76e1e96e833cce200624edf4a14a4", "score": "0.66995955", "text": "def ptc_on(self):\n\t #PTC control is option 1\n\t options = int(self.get_set_options())\n\t if (options | 1) != options:\n\t #make sure humidity and altitude are off\n\t options = options & ~18\n\t ...
9ec0ed4c0dd9573e5669d6b0d7f4650a
Returns the string name of a PLinApi.TLINDirection value
[ { "docid": "16030d19993e049c5714b8d7cc0df44d", "score": "0.59649193", "text": "def getFrameDirectionAsString(direction):\n # check given parameter\n if (isinstance(direction, PLinApi.TLINDirection)):\n value = direction.value\n else:\n value = int(direction)\n ...
[ { "docid": "a27ff22c72ab89793d95b6c7b849889e", "score": "0.61148554", "text": "def redirect_type(self) -> str:\n return pulumi.get(self, \"redirect_type\")", "title": "" }, { "docid": "3b946869b51763078d90ec142827df38", "score": "0.6032446", "text": "def _get_lsp_forwarding_ou...
e5d6e4c07785259bc2bcdbe8ddcd8871
Concatenate input arrays along the given dimension.
[ { "docid": "10bc504b57c6fa0b220448c649b2f155", "score": "0.62408817", "text": "def concat(x: Sequence[VariableLikeType], dim: str) -> VariableLikeType:\n if x and isinstance(x[0], data_group.DataGroup):\n return data_group._apply_to_items(concat, x, dim)\n return _call_cpp_func(_cpp.concat,...
[ { "docid": "9f63ddcd24ff19b22581d795cf1df2e2", "score": "0.7381869", "text": "def concatenate(self, arrays, axis=0):\n assert_schema(arrays, bounded=True, same_attributes=True)\n slice_at_end = arrays[0].ndim == 1 and axis == 1\n\n # pad with extra dimensions as needed\n arra...
0a4df1e96132e4ef6cfa39d54eb82148
Delete a collection of KubeVirt objects. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
[ { "docid": "a81f92514cdcc5554fe86beb26eabcdf", "score": "0.6330248", "text": "def delete_collection_namespaced_kube_virt(self, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('callback'):\n return self.delete_collection_namespaced_kube_virt_with_http_info(**...
[ { "docid": "969296681eb4ea99295c1d555f3e6f1a", "score": "0.6406125", "text": "def delete_collection(self, **kwargs):\n self._delete_collection(**kwargs)", "title": "" }, { "docid": "8bc70ae6b3a96dab6cf1affd9ecd284f", "score": "0.62253577", "text": "def delete_collections(self,...
a45f7d7f50bf09cb67605be19af215b1
Trim an existing alignment based on provided primers or specific, predefined positions. Primers take precedence over the positions, i.e. if both are provided, positions will be ignored. This action uses mafft_add action to add provided primers (if any) to the existing alignment. Subsequently, start (5'most) and end (3'...
[ { "docid": "acf7f3d307dd3455ead2c5cb930c7336", "score": "0.6895433", "text": "def trim_alignment(ctx,\n aligned_sequences,\n primer_fwd=None,\n primer_rev=None,\n position_start=None,\n position_end=None):\n exp...
[ { "docid": "8c0324079a826d0fc81572d695bd8efb", "score": "0.691214", "text": "def _trim_alignment(expand_alignment_action,\n aligned_sequences,\n primer_fwd=None,\n primer_rev=None,\n position_start=None,\n pos...
803bd0e96151b10bfa97985222cfae50
Points p1 and p2 are represented as tuples of coordinates.
[ { "docid": "7ddd65669b93b656d354ff1e1f766e1b", "score": "0.0", "text": "def distance (self, p1, p2):\n d = math.sqrt((p1[0]-p2[0])**2 + (p1[1]-p2[1])**2)\n return d", "title": "" } ]
[ { "docid": "5e89027a88823160eca0405c15af5445", "score": "0.71197873", "text": "def get_xy(kp_pairs):\n p1 = np.int32([kpp[0].pt for kpp in kp_pairs])\n p2 = np.int32([kpp[1].pt for kpp in kp_pairs]) \n \n return p1, p2", "title": "" }, { "docid": "c61341462112b79830485adde2cb9787...
edfd537c4ada446be0d0f7837bd86b93
Computes encodings for all quantization sim nodes in the model.
[ { "docid": "0319c54a3a1ede111f9d2fd03b73e320", "score": "0.5776553", "text": "def compute_encodings(self, forward_pass_callback, forward_pass_callback_args):\n ops_with_invalid_encodings = []\n self._compute_and_set_parameter_encodings(ops_with_invalid_encodings)\n\n self._set_op_mo...
[ { "docid": "7eea248f3d7a7cceacb35937949c5a3f", "score": "0.70447296", "text": "def compute_encoding(self):\n # No action required for AdaroundTensorQuantizer.\n # Function is in place if QcQuantizeWrapper calls while in Training mode", "title": "" }, { "docid": "8605efbedc218f9...
5ce77cea7310b8c8a91647bd367da23f
Perform the actual request. Retrieve a connection from the connection pool, pass all the information to it's perform_request method and return the data. If an exception was raised, mark the connection as failed and retry (up to `max_retries` times). If the operation was succesful and the connection used was previously ...
[ { "docid": "b3052713d98bfbffe60d54588f8e4930", "score": "0.6911943", "text": "def perform_request(self, method, url, params=None, body=None):\n if body is not None:\n body = self.serializer.dumps(body)\n\n # some clients or environments don't support sending GET with body\n ...
[ { "docid": "6c4f6e5f333684f5b412b9552778b598", "score": "0.6186178", "text": "def _http_request(self, auth_host, auth_port, method, path, **kwargs):\n conn = self._get_http_connection(auth_host, auth_port)\n RETRIES = 3\n retry = 0\n \n while True:\n ...
4d2c66d907975b8b8e52d9b191ba1e85
It seems that dvbsnoop can output data buffered from the previous tune. This makes sure we discard that data, 2000 is an arbitrary number.
[ { "docid": "5effc2d29762eeaab1907368d17f3f7b", "score": "0.5411468", "text": "def flush(self):\n log.info('Flushing stale EIT data...')\n self.dvbsnoop_flush = subprocess.Popen(\n ['dvbsnoop', '-adapter', self.adapter, '-n', '2000', '-nph', '0x12'],\n stdout=subproces...
[ { "docid": "99172bd7fb42bb2a074232f56e729cda", "score": "0.58245504", "text": "def stop_tuning(self):\n it = len(self._history)\n n_drop = int(self.tune_drop_fraction * it)\n self._history = self._history[n_drop:]\n return super().stop_tuning()", "title": "" }, { ...
3a42a38c234c69881b4482a5b0a88c37
GIVEN logged in user and app instance WHEN trying to logout users withot token in header THEN check 401 status code, and error message
[ { "docid": "f8d5c146c36fdc7aa6928e936b1a460f", "score": "0.6664895", "text": "def test_logout_user_without_token(client, access_token):\n rv_logout = client.post('/logout/access')\n resp = rv_logout.get_json()\n assert rv_logout.status == '401 UNAUTHORIZED'\n assert resp['msg'] == 'Missing A...
[ { "docid": "95ca2369f8145cc85732450654253da9", "score": "0.7324254", "text": "def logout():\n user = User()\n user_token = request.headers['Authorization']\n token = user_token.split(\" \")[1]\n if user.blacklist_token(token):\n return jsonify({\"message\": \"log out successful\"}), 2...
5aeda7b5c58df5b216aa7b52f60ccaad
gets the Parental identity for a given cM position
[ { "docid": "5c780c7987e00ae2af23423ca1ff4f92", "score": "0.6218072", "text": "def getParentAtMapLoc(self, mapLoc):\r\n if mapLoc < 0 or mapLoc > self.cM:\r\n raise ValueError, \"Map location must be withing the range of the chromosome.\"\r\n loc = cM/float(self.cM)\r\n return self....
[ { "docid": "aa1881bf6d5644ead8c92e2011483b2e", "score": "0.633048", "text": "def parent_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"parent_id\")", "title": "" }, { "docid": "90231c82fe678ad1b3219d1e9fbd4f48", "score": "0.6276556", "text": "def parent(self, pos)...
864fcfbf80205ca0a4666afcf46c96d1
Initializes the user model with a password and email
[ { "docid": "8da9f6f7fc89957347c96bfd37c08cf6", "score": "0.6965422", "text": "def __init__(self, email, password):\n\t\tself.email = email\n\t\tself.password = Bcrypt().generate_password_hash(password).decode()", "title": "" } ]
[ { "docid": "a44f4f5b965b8c663a0ca5aa368b4f30", "score": "0.7764653", "text": "def __init__(self, user_email, user_password):\n if Helpers.is_valid_format_email(user_email):\n self.email = user_email\n else:\n raise ValueError('Email %s is not valid!' % user_email)\n ...
6c51eca38bc72fb777aa80d495ccf298
Returns an ipopt solver object with the desired options for convergence evaluation (and initialization) Returns Pyomo solver
[ { "docid": "f92dde69679496d5463197b5cdff8256", "score": "0.80685276", "text": "def get_solver(self):\n opt = pe.SolverFactory('ipopt')\n opt.options = {'tol': 1e-6,\n 'mu_init': 1e-8,\n 'bound_push': 1e-8}\n return opt", "title": "" ...
[ { "docid": "b3fd79586ea5c1fe93ed6cfa9bbfeaea", "score": "0.69074684", "text": "def makeSolver(self):\n pass", "title": "" }, { "docid": "b64907117cf10108065aeaaa8613f5b4", "score": "0.69001853", "text": "def solve(self):\n solver = SolverFactory('ipopt',executable='C:/U...
51f5c0e033e7ae3a05a02beaacd60851
Read in shelx file and returns a list without line endings.
[ { "docid": "bdcc0c65ff2284891c0e01ad3e57ce7c", "score": "0.5820845", "text": "def read_nested_file_to_list(resfile: str) -> list:\n reslist = []\n try:\n with open(os.path.abspath(resfile), 'r') as f:\n reslist = f.read().splitlines(keepends=False)\n except...
[ { "docid": "a727a62d4a43dedd1a22d323914477db", "score": "0.65961695", "text": "def read_list(fn):\n f = open(fn, \n \"r\")\n s = f.read()\n f.close()\n # If the last character in the file is a newline, delete it\n if s[-1] == \"\\n\":\n s = s[:-1]\n l = s.split(\"\\n...
419579f351fd3412f655411a01d8124e
Log the compute_node status
[ { "docid": "f1f8936b6566393a42f0be9252be774b", "score": "0.0", "text": "def _stoppedComputePartition(self, compute_node_id, compute_partition_id):\n instance = self._getSoftwareInstanceForComputePartition(\n compute_node_id,\n compute_partition_id)\n instance.setAccessStatus(\n ...
[ { "docid": "a88817d4255fef209804cce42961c1cb", "score": "0.63056797", "text": "def log_state(self):\n rospy.loginfo(\"STATE: %s [%s]\" %(self.__class__.__name__, 15 - self.ros_node.get_time()))", "title": "" }, { "docid": "1ad00fbb269b26dd340553b9a7b5822b", "score": "0.62696135"...
bfa34172375d579d902d0b8dda80bed3
Check running state of API and start if they is close.
[ { "docid": "1dc3fa2c6f303c4b65cd9c2cdbc70a4d", "score": "0.61420894", "text": "async def _homeassistant_watchdog_api():\n nonlocal retry_scan\n\n # if Home-Assistant is active\n if not await homeassistant.is_initialize() or \\\n not homeassistant.watchdog:\n ...
[ { "docid": "b9608e5b512d5183f60b7586792a1fab", "score": "0.7087699", "text": "def check_api(self):\n\t\tcount = 0\n\t\twhile count < self.attempts:\n\n\t\t\tif self.check_api_process():\n\t\t\t\t# this mean that there is process for the API\n\t\t\t\tif self.check_tmux_session():\n\t\t\t\t\t# this mean t...
eb1d6c7f3de8a924c2bd1cc63b1fd610
This is an autogenerated method for the PySwitchLib.
[ { "docid": "fa858fe2e6eeeb4d52f5e1f3096bdb53", "score": "0.0", "text": "def interface_vlan_ip_igmp_snooping_mrouter_interface_create(self, vlan=None, interface=None, api_timeout=''):\n\n operation_type = 'create'\n compositions_list = [('pybind.nos.v6_0_2f.interface_vlan.interface.vlan', u'vlan'),...
[ { "docid": "233257f4560383deaa164012446439be", "score": "0.6714755", "text": "def __init__(self, switchNode):\n functions = [\"switch\"]\n ThreecomSwitch.__init__(self, switchNode, 2, 4094, 10000, 100000)", "title": "" }, { "docid": "59d24211ac353392b58e2e5543bb9c5d", "scor...
dfe7127c52507a8fee38d3011c84b57e
Use nonspline based parameteriser and get all raw samples directly. We cannot spline the result from ParametrizerConstAccel as that would violate the constraints. Must evaluate on the result directly. Command rate is in Hz.
[ { "docid": "d0d66882644188f6b2dd9acdedef6f8b", "score": "0.0", "text": "def run_topp_const_accel(\n waypts, qlim, vlim, alim, cmd_rate=1000, verify_lims=True\n):\n topp = DraculaToppra(waypts, qlim, vlim, alim)\n traj = topp.compute_const_accel()\n if verify_lims:\n logger.info(\"Veri...
[ { "docid": "62284337a0271810127536e138a24b30", "score": "0.54773104", "text": "def read_raw(self):\n\t\tdata_array = np.empty(self.num_channels)\n\t\tfor chan in range(self.num_channels):\n\t\t\t#Read in data\n\t\t\trc, data_array[chan] = comedi.comedi_data_read(self.dev, self.sub_device, chan, self.ran...
4988da0d9120b9102e31e273dbbf3116
Sets the user_id of this User.
[ { "docid": "fad0418aef327c1450c5988c894dccd9", "score": "0.8165536", "text": "def user_id(self, user_id):\n if self._configuration.client_side_validation and user_id is None:\n raise ValueError(\"Invalid value for `user_id`, must not be `None`\") # noqa: E501\n\n self._user_id ...
[ { "docid": "4705ee352cab08b964b1848251a5676f", "score": "0.867646", "text": "def user_id(self, user_id: int):\n\n self._user_id = user_id", "title": "" }, { "docid": "00f3a9fa8c1a23ab5d5d6b5016b3122b", "score": "0.86753106", "text": "def user_id(self, user_id):\n \n ...
a7f22ae0d4b408539a6fa956ae250e09
r""" return list of time steps values (in years) that are available.
[ { "docid": "616fb70b0f0264fde6afb11481ed69b7", "score": "0.69536537", "text": "def getTimeSteps(self, a=None):\n dbi = self.getInterface(\"database\")\n timeInYears = dbi.getHistory(self.r, [\"time\"])[\"time\"]\n\n # remove the time step info. Clients don't want it\n timeInY...
[ { "docid": "177124659fe3ba504d40dd2cf7d2055c", "score": "0.71331424", "text": "def get_integration_times(start_year: int, end_year: int, time_step: int):\n n_iter = int(round((end_year - start_year) / time_step)) + 1\n return numpy.linspace(start_year, end_year, n_iter).tolist()", "title": "" ...
05a91dec207230e1d50ca5b6f2cf76a7
Add a new task with the description issued by the user.
[ { "docid": "77ec2cf0327045856117ad2bc3240673", "score": "0.85855055", "text": "def addUserTask(self):\n desc = input(\"Task Description: \")\n self.addTask(desc)", "title": "" } ]
[ { "docid": "2afd7ea64b2b38a75d0e4dfaa622051a", "score": "0.80948436", "text": "def addTask(self, desc):\n t = Task(desc)\n self.tasks[t.id] = t", "title": "" }, { "docid": "c22e7c9d11723b5a09e4930a5b336d39", "score": "0.7860794", "text": "def add_task(self, name, descri...
d8702baf45c460dd80c94708f6e1ec25
Builds the 3D UNet Keras model.f
[ { "docid": "18adebf71b4da8552351a203c366aab2", "score": "0.0", "text": "def baseline_resnet(inputs, pool_size=(2, 2, 2), n_labels=1,\n deconvolution=False,\n depth=4, n_base_filters=16,\n batch_normalization=True,\n activation_n...
[ { "docid": "09bea2ae110a5244c62260c18a7857da", "score": "0.71187824", "text": "def get_model(self):\n\n\t# number of convolutional filters to use at each layer\n\tnb_filters = [16, 32, 48]\n\n\t# level of pooling to perform at each layer (POOL x POOL)\n\tnb_pool = [2, 2, 2]\n\n\t# level of convolution t...
f266f9e386c78e90c8ebab8bccadb45b
Test 'each' and 'finally_assert' methods.
[ { "docid": "3382762011812112dfc8826b3a41104f", "score": "0.59889525", "text": "def test_each_and_finally_assert_methods():\n\n # define a custom validator class\n class MyValidator(CSVValidator):\n\n def __init__(self, threshold):\n field_names = ('foo', 'bar')\n super...
[ { "docid": "ea69c0af716754b33c989484d2855f81", "score": "0.6643278", "text": "def testIteratorFinalIteration(self):\n pass", "title": "" }, { "docid": "ed9d55332d4dcb8b18037b48d109ff9d", "score": "0.66406405", "text": "def test_simple_call(self):\n i = iter([1,2,3,4,5])...
b6401ff0eddff033effeebcc854ec141
Test ``_safe_indexing`` with 2D container.
[ { "docid": "d895910693b9bd6fb13539cd232c5ac5", "score": "0.7092296", "text": "def test_safe_indexing_2d_mask(array_type, indices_type, axis,\n expected_subset):\n columns_name = ['col_0', 'col_1', 'col_2']\n array = _convert_container(\n [[1, 2, 3], [4, 5, 6], ...
[ { "docid": "9ba24c4063db8ef692e410cf63e7ff63", "score": "0.74597317", "text": "def test_safe_indexing_2d_container_axis_0(array_type, indices_type):\n indices = [1, 2]\n if indices_type == 'slice' and isinstance(indices[1], int):\n indices[1] += 1\n array = _convert_container([[1, 2, 3],...
3f79f68440ec3b233ea37e027b33a709
Ensure that `heisenberg_expand` raises exception if it receives an array with order > 2
[ { "docid": "a5082562ca28f5c2ab0d61b248c34c82", "score": "0.6564538", "text": "def test_wrong_input_shape(self):\n\n class DummyOp(qml.operation.CVOperation):\n num_wires = 1\n\n op = DummyOp(wires=1)\n\n with pytest.raises(ValueError, match=\"Only order-1 and order-2 arra...
[ { "docid": "ebc0ad5231c4b5bc37c4ae35b96dbe3c", "score": "0.707614", "text": "def test_verification(self):\n with self.assertRaises(TypeError):\n order = 2\n _ = bch_expand(1, numpy.ones((2, 2)), order=order)\n\n with self.assertRaises(ValueError):\n order =...
1554b0798e48624d8eb166b499760a5e
Read from stdin if input is from a pipe or file redirection, otherwise, run shell command to get input.
[ { "docid": "d2785ff498b5fc583213cf9b95f1a836", "score": "0.6727332", "text": "def load_initial_input():\n mode = os.fstat(sys.stdin.fileno()).st_mode\n if stat.S_ISFIFO(mode) or stat.S_ISREG(mode):\n lines = sys.stdin.read().splitlines()\n sys.stdin = sys.stdout # Necessary to work ...
[ { "docid": "40c99a06a502e843580fc6d2d217e0be", "score": "0.6751126", "text": "def run_shell_command(command, stdin=None, **kwargs):\n with run_interactive_shell_command(command, **kwargs) as p:\n ret = p.communicate(stdin)\n return ret", "title": "" }, { "docid": "c1150fc304cecd...
e3017e1c75676ee083067d2801e231dc
verify that an expected string is returned from the function
[ { "docid": "63db23eb2ef9f040f2789a937e9258cf", "score": "0.0", "text": "def test_generate_sql_update(config_path, config_name):\n\n # expected output string\n expectedReturnTuple = (\"UPDATE [Sandbox1].[dbo].[unittest] SET [type] = ?, [color] = ? WHERE [id] = ? AND [number] = ?\", ['Ostrich','Mu...
[ { "docid": "b0e2bedbb812482fd736a96b4f606e40", "score": "0.7913029", "text": "def func() -> str:\n return expected_result", "title": "" }, { "docid": "7baa55521f33412db3f577921b288456", "score": "0.6918", "text": "def check_string(result, func, cargs, offset=-1, str_result=Fal...
2c14cd0cc418d4a239d2f7f6ce2aa0bd
Render this histogram with the matplotlib pcolormesh method. This method is generally be preferred over the imshow method since it allows nonequidistant bins (which is permitted by the Histogram2D class.
[ { "docid": "075573eea247d59853d1e8d59b708849", "score": "0.6304512", "text": "def pcolor(self,ax=None,**kwargs):\n\n style = copy.deepcopy(self._style)\n style.update(kwargs)\n\n if ax is None: ax = plt.gca()\n \n if style['logz']: norm = LogNorm()\n else: norm ...
[ { "docid": "20863dd164afca9323d373161b7d3e72", "score": "0.669269", "text": "def pcolor_mesh_hist2( h, *args, **kwargs ):\n mask, colz, colorbar = pop_existing( kwargs, 'mask', 'colz', 'colorbar' )\n\n # get bin edges first\n x1 = r2numpy.get_bin_edges_axis(h.GetXaxis())\n y1 = r2numpy.get_b...
c9e536b8ad286f198ddc695ea42f90a8
get calendar list from calendar_user_list
[ { "docid": "1fb567e6a44c41fcece4203272566026", "score": "0.8805419", "text": "def get_calendar_list(calendar_user_list):\r\n list_calendar = []\r\n list_calendar.append((0, '---'))\r\n for l in Calendar.objects.values_list('id', 'name').filter(user_id__in=calendar_user_list).order_by('id'):\r\n...
[ { "docid": "447b8e786b41b6582809e0532f55c189", "score": "0.8304395", "text": "def get_calendar_user_list(calendar_user_list):\r\n list_calendar_user = []\r\n list_calendar_user.append((0, '---'))\r\n for l in CalendarUser.objects.values_list('id', 'username').filter(id__in=calendar_user_list).o...
f03d62d507e5df04a000ca4c30fcd00d
Create a new DocTest containing the given examples. The DocTest's globals are initialized with a copy of `globs`.
[ { "docid": "6103d2b95137e4e221a756d97704099f", "score": "0.7097044", "text": "def __init__(self, examples, globs, name, filename, lineno, docstring):\r\n assert not isinstance(examples, basestring), \\\r\n \"DocTest no longer accepts str; use DocTestParser instead\"\r\n self....
[ { "docid": "adc7c71aafc1898d3cdf4f74abfc036f", "score": "0.6857998", "text": "def test_doc_examples(self):\n start = time.time()\n files = get_all_example_rst_file_paths()\n filtered_files = []\n filtered_files = filter_exemptions(files)\n filtered_files.extend([os.pat...
36854e24aa4bb25a68bd22035347ef14
find out if a type is str or not
[ { "docid": "fa186b9d0d9407ec0590e911543e8ec0", "score": "0.8048978", "text": "def is_string(atype):\n if atype == str:\n return True\n elif PY2:\n if atype == unicode:\n return True\n return False", "title": "" } ]
[ { "docid": "fd7f5d2004effcaaa437230155096056", "score": "0.8011629", "text": "def is_str(_object):\n return type(_object) is str", "title": "" }, { "docid": "8571c7ebe787b395b4fcb8f7a0e18fa5", "score": "0.79255277", "text": "def is_string_type(self, datatype):\n if datatype...
7bb06759155c9d49451329c693ae5290
Renders the logout function for all logout requests.
[ { "docid": "4397a361dffe4b12cd66a14f0eee73c9", "score": "0.70709914", "text": "def logout_form(request):\n if request.method == 'GET':\n print(\"LOGGING OUT!\")\n logout(request)\n else:\n print(\"ALREADY LOGGED OUT!\")\n assert isinstance(request, HttpRequest)\n return ...
[ { "docid": "65e57d6a654c93a9940bdad11f4cc14b", "score": "0.75880826", "text": "def logout():\n logout_user()\n return render_template('index.html', user=current_user)", "title": "" }, { "docid": "69599ea2dc83497362eda534f37a7760", "score": "0.7549292", "text": "def logout():\n ...
68f11fd5997991adec5679670515fc21
This method is used to upload new plugins to the daemon. It is used when connecting to the daemon remotely and installing a new plugin on the client side. 'plugin_data' is a xmlrpc.Binary object of the file data, ie, plugin_file.read()
[ { "docid": "90e46fc23b5fa05d0fad3374b461acd0", "score": "0.6431145", "text": "def upload_plugin(self, filename, filedump):\n\n try:\n filedump = base64.decodestring(filedump)\n except Exception, e:\n log.error(\"There was an error decoding the filedump string!\")\n ...
[ { "docid": "379bec4d54c4b7728916e164925f4011", "score": "0.6462988", "text": "def send_plugin_message(self, plugin, data):\n\n\t\tfor client in self.registered_clients:\n\t\t\ttry: client(plugin, data)\n\t\t\texcept: self.logger.exception(\"Exception while sending plugin data to client\")", "title":...
3ee985dd92b74742ad9ad7d773e06393
Sets the city of this NewUser.
[ { "docid": "b212de62c6a6f96897a7c4f5a066d4fe", "score": "0.7665644", "text": "def city(self, city):\n\n self._city = city", "title": "" } ]
[ { "docid": "2563e67e7f11f2ccedaa0262ea4a1899", "score": "0.8143902", "text": "def set_city(self, city):\n self.city = city", "title": "" }, { "docid": "35ce93b60f1328fdaad1342017569606", "score": "0.7753587", "text": "def city(self, city: str):\n\n self._city = city", ...
173eed50f5dfc3c0d56ee2d9fc880cd5
Write text to the textfile
[ { "docid": "9c7f45b5a2bdaa4e60d2917c8739554f", "score": "0.6635086", "text": "def append_to_file(dataset_file_path, text):\n with open(dataset_file_path, \"a\") as f:\n f.write(text)", "title": "" } ]
[ { "docid": "5c40bc87ec74cffa56fe0034a8ff6213", "score": "0.8612657", "text": "def write_to_file(self, file_path, text):\n with open(file_path, mode='w+') as f:\n f.write(text)", "title": "" }, { "docid": "98fde169b8ef127ef74ce992be656fba", "score": "0.85078734", "te...
ff54f794ef029e1eb2fcd3d009586a45
Handle all the possible mouse presses for the scene and pass the event forward if its not handled by the scene.
[ { "docid": "ff6149dec516e3b8cc5268bf95824fc0", "score": "0.0", "text": "def mousePressEvent(self, event):\n if (event.button() == QtCore.Qt.LeftButton and\n not self.surface.contains(event.scenePos()) and\n not event.modifiers() & QtCore.Qt.ControlModifier and\n ...
[ { "docid": "e1fac54ff56d6e8146b990fd8a0e6907", "score": "0.73311126", "text": "def handle_mouse_pressed(self, event):\n pass", "title": "" }, { "docid": "f73df2a0c11892990e3d2a2f17918551", "score": "0.7060593", "text": "def on_event(self):\n scene = self.scene\n\n ...
268722e9e7c4bb3df53ab83068936be5
return the loss, gradient, and hessian.
[ { "docid": "40594a7b08ab376e4daa13d3868760a7", "score": "0.0", "text": "def logistic_regression_SGD(y, tx, initial_w, batch_size, max_iters, gamma, adapt_gamma = False, pr = False):\n w = initial_w\n gamma_0 = gamma\n for n_iter in range(max_iters):\n for new_y, new_tx in batch_iter(y, t...
[ { "docid": "7e9b5ca854216fbb7ff74d24b0d9532d", "score": "0.67403907", "text": "def get_LGH(y, tx, w):\n loss = calculate_loss(y, tx, w)\n gradient = calculate_gradient(y, tx, w)\n hessian = calculate_hessian(y, tx, w)\n return loss, gradient, hessian", "title": "" }, { "docid": "...
a5b92392ac4c2980db52e184ecbc42c2
Takes a user's userID as an argument Returns a dictionary containing every user in that user's extended network with the shortest friendship path between them. The key is the friend's ID and the value is the path.
[ { "docid": "b82c316d79e0916e47a364b5a737cfd1", "score": "0.73624843", "text": "def getAllSocialPaths(self, userID):\n all_paths = {} # Note that this is a dictionary, not a set\n \n for friend in self.friendships[userID]:\n path = self.bfs(userID, friend)\n\n ...
[ { "docid": "bedbb9a6a9c2acf0eb6e295a05e8f389", "score": "0.828359", "text": "def getAllSocialPaths(self, userID):\n visited = {} # Note that this is a dictionary, not a set\n # !!!! IMPLEMENT ME\n \n ### NEW SOLUTION ###\n # store shortest path as UserID:UserID in fir...
eaa444ef7df3c303bb48b8228bf10f39
Multiplies this interval with another interval
[ { "docid": "916b07c218a2ecb28f47f3ad951c74f7", "score": "0.6791965", "text": "def __mul__(self, other):\n other = as_interval(other)\n combinations = [self.left * other.left, self.left * other.right, self.right * other.left, self.right * other.right]\n return Interval(min(combinatio...
[ { "docid": "2d5f4d15f3d8e84c11e0bbeca902ebb4", "score": "0.6828198", "text": "def __mul__(self, other):\n return Timestamp(self.secs * other)", "title": "" }, { "docid": "544477220b23e5d399b11ed7915bb1f2", "score": "0.6693795", "text": "def __mul__(self, val):\n return ...
ac09ff228d4f9b88977222a6a3d0de2d
The function samples data.
[ { "docid": "aa3c25bb0fe24212ca49a0220006671c", "score": "0.0", "text": "def sampleData(period, inputfile, outputfile):\n\n with open(inputfile, 'r') as fread, open(outputfile, 'w') as fwrite:\n for i, line in enumerate(fread):\n if (i % period) == 0:\n fwrite.write(li...
[ { "docid": "8894dacc6eeae25b0a91f7ccc7638ef2", "score": "0.74959934", "text": "def sample(self, x):", "title": "" }, { "docid": "d921cfb2d5f3e737576e279dd162a5e5", "score": "0.7410754", "text": "def samples(self):\n raise NotImplementedError", "title": "" }, { "doc...
f90d35138ca48512d3d358c2ec43d914
Quit program Consumes user input and closes the program
[ { "docid": "85f42d710fba3e26190dffedf063e17c", "score": "0.0", "text": "def __close(event):\n\tsys.exit()", "title": "" } ]
[ { "docid": "26b52d0300420fea5c9af688063ed615", "score": "0.81623447", "text": "def exit_program():\n quit()", "title": "" }, { "docid": "26b52d0300420fea5c9af688063ed615", "score": "0.81623447", "text": "def exit_program():\n quit()", "title": "" }, { "docid...
287f1b8fca3643e248bffdf16e733c64
Helper function to set the left, right, forward, and back cameras up on the vehicle as I've see fit.
[ { "docid": "ea20145ba45b20bd09b911f36b4d99f9", "score": "0.650022", "text": "def _setup_my_cameras(self):\n left_cam_orientation = airsim.to_quaternion(pitch=-0.17, yaw=-1.04, roll=0.0)\n forward_cam_orientation = airsim.to_quaternion(pitch=-0.17, yaw=0.0, roll=0.0)\n right_cam_orientation = ai...
[ { "docid": "ee37b9e28df59de0a26c4dd2870471b8", "score": "0.6848906", "text": "def fp_cam_set(controller, camera, cam_control, cam_plane, front_face): \n obj = controller.owner\n \n if obj['cam_set'] == 'Off':\n obj = controller.owner\n #how fast the camera gets to it's new positio...
004312f2145b5d91dc3a4036c01a64fe
count the number of missing values per columns
[ { "docid": "682cd9a4c94c2a72bb8a484a1f96d77b", "score": "0.64475155", "text": "def nacolcount(self):\n print(\"this function is deprecated please use nacount\")\n Serie = self.isnull().sum()\n df = DataFrame(Serie,columns = ['Nanumber'])\n df['Napercentage'] = df['Nanumber']/(self.nrow())\...
[ { "docid": "4a92a7e246cbd08cfa1ace95dc0e940a", "score": "0.8330409", "text": "def number_of_missing_values(df: pd.DataFrame) -> None:\n return df.isnull().sum()", "title": "" }, { "docid": "8e40a31b458d5e19d1117df09cda5569", "score": "0.8180646", "text": "def countMissingValues(da...
f5c8c1eba789766e6be7e4918f8496ea
GetBf(TMemIn self, void const LBf, TSize const & LBfL) > int
[ { "docid": "bac5d8369fc327d0c30afca8d9f0b1ab", "score": "0.78249145", "text": "def GetBf(self, *args):\n return _snap.TMemIn_GetBf(self, *args)", "title": "" } ]
[ { "docid": "ed0cb5b7a0a4495e257b1f248f6d67ae", "score": "0.69384676", "text": "def GetBf(self):\n return _snap.TMem_GetBf(self)", "title": "" }, { "docid": "d182b1728f757ec526d6f35315ccb2ee", "score": "0.6666825", "text": "def GetNextLnBf(self, *args):\n return _snap.TM...
861e3b9958c01f8b4970164586f0c3d9
Validate a module and execute the callback on error on the main thread pipeline a pipeline to be validated module_num the module number of the module to be validated test_mode whether pipeline is in test mode callback a callback with the signature, "fn(setting, message, pipeline_data)" where setting is the setting that...
[ { "docid": "1f7076cb16ba22ed8423b8b94d4352c5", "score": "0.82378304", "text": "def validate_module(pipeline, module_num, test_mode, callback):\n pipeline.test_mode = test_mode\n modules = [m for m in pipeline.modules() if m.module_num == module_num]\n if len(modules) != 1:\n return\n ...
[ { "docid": "a318fd4e40e2ad1f6770687309fada0d", "score": "0.6367838", "text": "def __init__(self, pipeline, module, callback):\n self.pipeline = cache_pipeline(pipeline)\n self.module_num = module.module_num\n self.test_mode = pipeline.test_mode\n self.callback = callback\n ...
4d7d020018e75254dd98416bdd16efe7
Setup the socket for incoming clients
[ { "docid": "33c0a8390fb0881de0da27cbf2a203f9", "score": "0.6232878", "text": "def open_socket(self):\n try:\n self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n self.server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1)\n self.server.bind((sel...
[ { "docid": "a443115ed21b3b3ab63fcd644a873db9", "score": "0.7407922", "text": "def socket_init(self):\n self.socket = socket.socket(\n socket.AF_INET,\n socket.SOCK_STREAM,\n socket.IPPROTO_TCP)", "title": "" }, { "docid": "d2a68c5c73b63ba56d51f75c67a82...
34674e617acdd412666da9e644f26789
Representation and format used
[ { "docid": "8a1596edfcadcf7affa321ae74ac7544", "score": "0.0", "text": "def __str__(self):\n return \"[{}] ({}) {}\".format(self.__class__.__name__, self.id,\n self.__dict__)", "title": "" } ]
[ { "docid": "de663bb7d6dfdc822d7ee90c89610f96", "score": "0.7453937", "text": "def __repr__(self) -> str:\n return self.fmt", "title": "" }, { "docid": "065fbd9619952cc726a8853928814929", "score": "0.72634256", "text": "def get_info_format(self):", "title": "" }, { ...
dd926a4ad890750ef312e6fa344911e6
Configure deployment targets. Abstracted so this can be overriden for rendering before deployment.
[ { "docid": "d0621e67eea74b210e039781919e3d32", "score": "0.67634934", "text": "def configure_targets(deployment_target):\n global S3_BUCKET\n global LOG_LEVEL\n global DEPLOYMENT_TARGET\n\n if deployment_target == 'production':\n S3_BUCKET = PRODUCTION_S3_BUCKET\n LOG_LEVEL = l...
[ { "docid": "165fd21d3eef1b705b6308a219cde4ac", "score": "0.7250672", "text": "def configure_targets(deployment_target):\n global S3_BUCKETS\n global SERVERS\n global DEBUG\n\n if deployment_target == 'production':\n S3_BUCKETS = PRODUCTION_S3_BUCKETS\n SERVERS = PRODUCTION_SERV...
1acd35f54c4b016506cd00744f343c70
Implements a hybrid of the NESS and SMC2 algorithm, as recommended in the NESS article. That is, we use the SMC2 algorithm for the first part of the series and then switch to NESS when it becomes too computationally demanding to use the SMC2.
[ { "docid": "d139b60b51f3ceca04d3e3519d4120c3", "score": "0.0", "text": "def __init__(self, filter_, particles, switch=500, smc2_kw=None, ness_kw=None):\n\n super().__init__(filter_, particles, switch, first_kw=smc2_kw, second_kw=ness_kw)", "title": "" } ]
[ { "docid": "253ea4322dcf5608375e8521609fe30e", "score": "0.6247595", "text": "def eSC(params, (n1,n2), pts):\n\tS, N1, N2, M12, M21, Ta, Ts = params\n\t\n\txx = dadi.Numerics.default_grid(pts)\n\t\n\tN1_func = lambda t: S * (N1/S)**(t/(Ta+Ts))\n\tN2_func = lambda t: (1-S) * (N2/(1-S))**(t/(Ta+Ts))\n\n\t...
ce7e9a3da80a664810b0bfee382e2446
Return True if node is turned on, False if not.
[ { "docid": "6f4ce2a1269dacaa548d5e74894ebd87", "score": "0.70480686", "text": "def isOn(self):\n return (int(self.get_flags) & 3) == 0", "title": "" } ]
[ { "docid": "66db5174783ab412dbba26c1fdeb644b", "score": "0.84309113", "text": "def is_on(self) -> bool:\n return bool(self._node.status)", "title": "" }, { "docid": "8add53e292da503c5ebe2214e4e0af4f", "score": "0.7315773", "text": "def is_on(self) -> bool:\n return self...
273071ec9d208a722481ee675af65d9a
Returns a random shuffling of the array.
[ { "docid": "0a4886b5c0cbda5e213e526c16fb0ae5", "score": "0.72436756", "text": "def shuffle(self):\n ans = self.nums[:]\n for i in range(len(ans) - 1, -1, -1):\n j = random.randint(0, i)\n ans[i], ans[j] = ans[j], ans[i]\n return ans", "title": "" } ]
[ { "docid": "0429db19315e7a5451dd49528814b233", "score": "0.7761317", "text": "def shuffle(self):\n n = len(self.arr)\n bound = [ (x, random.random()) for x in self.arr]\n bound.sort(key=lambda x:x[1])\n return [x[0] for x in bound]", "title": "" }, { "docid": "40a...
83a46b9cb0746e38d0be8fbb719aebb4
Convert a full matrix to a partial vector
[ { "docid": "2f62d8c09ee7b91a5d0d8eadde405605", "score": "0.71898866", "text": "def full_matrix_to_partial_matrix(self, full_matrix):\n return full_matrix[self.m_min:, self.n_min:]", "title": "" } ]
[ { "docid": "e8dd61f6410d461c1b83e26e73167926", "score": "0.85416037", "text": "def full_matrix_to_partial_vector(self, full_matrix):\n part_matrix = self.full_matrix_to_partial_matrix(full_matrix)\n return self.partial_matrix_to_partial_vector(part_matrix)", "title": "" }, { "d...
be93cbea7f8dafbfc9fc3b3b4969a88b
writes a given list to a file with given path to that file
[ { "docid": "ae140e5d156ed02d7b7035f1aa8f9f1d", "score": "0.0", "text": "def save_result(self, timestamp, folder_name, file_name, result_list):\n path = (self.spider_name, timestamp, folder_name)\n write_file(result_list, path, file_name)", "title": "" } ]
[ { "docid": "e3ffdb2da1d96b4981a8989227493f81", "score": "0.79097027", "text": "def write_list_to_file(list_to_save, save_path):\n \n Path(save_path).parent.mkdir(exist_ok=True, parents=True)\n \n with open(str(save_path), 'w') as fid:\n for line in list_to_save:\n fid.write...
d8f25f1d7324169a17d0281b43ae95a2
Since print_relation is the most computationally heavy function, handle each query's print_relation in it's own process and save the results to a multithreading dictionary.
[ { "docid": "c8fcfb6ae6b52aea274b5959e93c58b5", "score": "0.5012408", "text": "def _str_worker(self, proc: int, query: datalog_parser.Query, results: dict):\n result = str(query) + \"? \"\n if self.rdbms[query] is SINGLE_MATCH:\n result += \"Yes(1)\\n\"\n elif self.rdbms[q...
[ { "docid": "fc821650accb518306cf716fe0ad1622", "score": "0.56099725", "text": "def process_relationships(cur, resp, where_relationship, params_relationship, sql):\n try:\n results = cur.fetchall()\n retrived_people_count = len(results)\n\n if results and len(results) > 0 and u.re...
7b21a01e9cdf70bb16ad95d29653df67
Assume identity of specified user. As an administrator, you can assume the identity of any user in your organization.
[ { "docid": "da4948de5c0338d416ac0c2d01c87764", "score": "0.59164953", "text": "def assume_user(self, email=None):\n if email is None:\n self._assume_user = None\n else:\n # email = email.replace('@', '%40')\n self._assume_user = six.moves.urllib.parse.quote...
[ { "docid": "16238f629c91702c44993b44da470106", "score": "0.66630304", "text": "def authorized_userid(self, identity):\n pass", "title": "" }, { "docid": "aff2125ab5f51068eab41c9339fc9d5c", "score": "0.6395221", "text": "def confirm_identity():\n msg = \"The current user is ...
0b18184a200b8545fb9728198b231d8b
This method prints information in a reasonably easy to read format, and compensates for some formatting challenges in pprint.
[ { "docid": "6a7d176560527fff04045d801eb91383", "score": "0.0", "text": "def print_object( self, arg_object, arg_name_for_object = None ) :\n if not arg_name_for_object == None :\n\n print( arg_name_for_object, \"=\", )\n\n print( \"\\n\".join( self._print_info_get_list_of_string...
[ { "docid": "ef2c8025e8e85397262f486816a47e92", "score": "0.7855242", "text": "def pprint(self):\n try:\n print(self.pformat(self))\n except:\n print(self.__dict__)", "title": "" }, { "docid": "722ea2b2105afac63e72370b535659a1", "score": "0.7789151", ...
fcaacc9cbace69879b367eed6c36fd4c
Return bool whether this request is successful (200299) or not.
[ { "docid": "fc14434367db3e27faf185f9ccd4011c", "score": "0.7483755", "text": "def ok(self) -> bool:\n return self._status == 0 or 200 <= self._status <= 299", "title": "" } ]
[ { "docid": "f9437aca13c074cb0f40b651934d58ac", "score": "0.8216712", "text": "def is_successful(self) -> bool:\n return self.code is not None and self.code >= 200 and self.code < 300", "title": "" }, { "docid": "e06b19668cc2a71e82ec017ec5202a67", "score": "0.81315345", "text":...
93e884109e1522efaa30c02a475e8f20
Decode an ODB2 stream into a pandas dataframe
[ { "docid": "14780229a223ee27c7006785698c72d3", "score": "0.0", "text": "def read_odb(source, columns=None, aggregated=True, single=False):\n if single:\n assert aggregated\n return _read_odb_oneshot(source, columns)\n else:\n return _read_odb_generator(source, columns, aggrega...
[ { "docid": "f9956bf1a9ca018b1310380d6db7118c", "score": "0.628087", "text": "def df_from_bytes_np_records(bytes_: bytes) -> pd.DataFrame:\n b = BytesIO(bytes_)\n rec = np.load(b)\n df = pd.DataFrame.from_records(rec, index=\"index\")\n return df", "title": "" }, { "docid": "37cd2...
cc7460de9c01f90a3a5d92c4c564cf62
Convert ase atoms' index to castep like return (Specie, Ion) Deprecated, use ase_to_castep_index
[ { "docid": "80c739bcb425f97c8ec8969783ccacd1", "score": "0.62893224", "text": "def atoms_to_castep(atoms, index):\n atom = atoms[index]\n symbol = atom.symbol\n # Start counter\n count = 0\n for atom in atoms:\n if atom.symbol == symbol:\n count += 1\n if atom.ind...
[ { "docid": "b4b9a359fbc4f4838157c22f060ebd60", "score": "0.7522824", "text": "def ase_to_castep_index(atoms, indices):\n if isinstance(indices, int):\n indices = [indices]\n symbols = np.array(atoms.get_chemical_symbols())\n iatoms = np.arange(len(atoms))\n res = []\n # Iterate thr...
c4141dbf62408002212c668a55290779
Return a default filename
[ { "docid": "acef1e2dd1bbad11f4e30a2ed285067a", "score": "0.8789937", "text": "def _default_filename(default_filename, label=None):\n if not label:\n filename = default_filename.format(round(time.time()))\n else:\n filename = default_filename.format(label)\n return filename", "...
[ { "docid": "a44d0dc7aab878667cbe8d496b938052", "score": "0.86708117", "text": "def default_filename(self):\n if self.path:\n return Path(self.path).name", "title": "" }, { "docid": "7b6b1f7dc30f57f3aa9b17a824128229", "score": "0.8010142", "text": "def get_defaultfil...
fe6e130838ca6791afb3d7327d21832b
Returns if there's a next element in the iteration.
[ { "docid": "ffc74addc44719c306d6e42bd489da75", "score": "0.8082671", "text": "def hasNext(self):\n if self._hasnext is None:\n try:\n self._thenext = next(self.it)\n except StopIteration:\n self._hasnext = False\n else:\n ...
[ { "docid": "f946b915ce9bb5d7f9bbda02971b6eb3", "score": "0.8134432", "text": "def has_next(self):\n return self._has_next", "title": "" }, { "docid": "f4613058c77a4e3a13081c8f06103364", "score": "0.79846334", "text": "def has_next(self):\n return self.sequence.has_next(...
2ed1953506251b65b2535fb5de771473
Print the version of acloud. The VERSION file is built into the acloud binary. The version file path is under "public/data".
[ { "docid": "6388687e7e576f68edc6db43fcc75e54", "score": "0.5592797", "text": "def GetVersion():\n version_file_path = os.path.join(_CONFIG_DATA_PATH, _VERSION_FILE)\n if os.path.exists(version_file_path):\n with open(version_file_path) as version_file:\n return version_file.read(...
[ { "docid": "579001e9d9b87d09e853ec395b288c69", "score": "0.69931334", "text": "def version():\n print(version)", "title": "" }, { "docid": "71acca3ffe13eb8627a650b75a853da4", "score": "0.69509643", "text": "def show_version():\n print(version)", "title": "" }, { ...
fc635732e2656cd76225818361e24cb0
Create complement automaton (p23).
[ { "docid": "bfd4822fcdb6a0ba67282ba993d0da4d", "score": "0.6469388", "text": "def complement (self):\n S = self.S\n I = self.I\n Σ = self.Σ\n T = self.T\n F = [ s for s in S if s not in self.F ]\n\n return FA(S, I, Σ, T, F)", "title": "" } ]
[ { "docid": "c0b9abd88068a80201d69b1a94761a78", "score": "0.741861", "text": "def complement(sequence):\n\tpass", "title": "" }, { "docid": "82e2c1796e75d6700dbbecd3b02784d5", "score": "0.7122255", "text": "def complement(seq):\n seq = ''.join([_complement[s] for s in seq])\n return...
dbf20236f2fd6d0052a70ddb05755e6e
Draws text on a given surface, but does not flip() the pygame display
[ { "docid": "106742215e118bae2e9e5ae015c375ef", "score": "0.7643315", "text": "def draw_text(surf, text, size, x, y):\n font = pygame.font.Font(font_name, size)\n text_surface = font.render(text, True, WHITE)\n text_rect = text_surface.get_rect()\n text_rect.midtop = (x, y)\n surf.blit(tex...
[ { "docid": "202ecba47fcea0d6df43104a67c2964a", "score": "0.7655349", "text": "def draw_text(surf, text, size, x, y):\n font = pygame.font.Font(FONT_NAME, size)\n text_surface = font.render(text, True, WHITE)\n text_rect = text_surface.get_rect()\n text_rect.midtop = (x, y)\n surf.blit(tex...
35212d110695ed541874c14e3ca8778d
Periodically we send the actual status for every relais The main topic is extended by "stat/"+ status (0 = off 1 = on)
[ { "docid": "a165e531a04e8e5ca54363d4a12eff97", "score": "0.79904836", "text": "def send_status(relist) :\n global CONF\n # log (\"send_status\")\n for i in range(len(relist)):\n rstat = relist[i].get()\n if rstat :\n mqtt_sta = 1\n else:\n mqtt_sta = 0...
[ { "docid": "78b8259175309804b0111ec3462d84ba", "score": "0.7426226", "text": "def send_stat (relais_nrß) :\n global CONF\n for i in range(0,len(relist)) :\n if relist[i].get() : \n mqtt_sta = 1\n else:\n mqtt_sta = 0\n rel = str(i+1)\n client.publi...
71044b0a01e6275f12aa76e42795f48c
This method takes the smiles string and runs through the validation check of a smiles string.
[ { "docid": "ee20d6c3ed5ea6ae56b705c74b42cbbb", "score": "0.6944015", "text": "def validate_smiles(self, smiles):\n\n # Use MolVS to validate the smiles to make sure enumeration and r group connections are correct\n # at least in the 1D Format.\n from molvs import validate_smiles as ...
[ { "docid": "0092f72c071ae329d215d8a58d019ba5", "score": "0.71211714", "text": "def IsValidSMILES(text):\n is_valid = False\n results = smiles.parseString(text)\n if results:\n is_valid = True\n return(is_valid)\n return is_valid", "title": "" }, { "docid": "274fb728...
6469ce076bc38cc2b48241c249df8846
itkSquaredDifferenceImageFilterIF3IF3IF3_Superclass_cast(itkLightObject obj) > itkSquaredDifferenceImageFilterIF3IF3IF3_Superclass
[ { "docid": "6a94c199fbfb62acbe989871883c5582", "score": "0.87611955", "text": "def itkSquaredDifferenceImageFilterIF3IF3IF3_Superclass_cast(*args):\n return _itkSquaredDifferenceImageFilterPython.itkSquaredDifferenceImageFilterIF3IF3IF3_Superclass_cast(*args)", "title": "" } ]
[ { "docid": "39ecbda0f71ab287d0ba2da17f76c271", "score": "0.86661303", "text": "def itkSigmoidImageFilterIF3IF3_Superclass_cast(obj: 'itkLightObject') -> \"itkSigmoidImageFilterIF3IF3_Superclass *\":\n return _itkSigmoidImageFilterPython.itkSigmoidImageFilterIF3IF3_Superclass_cast(obj)", "title": ...
2bdc32a8c8461f86ea251bbd2a44e058
Reverts a transaction if before the configured withdrawal lock.
[ { "docid": "5b00103636c430cd2d9212960266c0eb", "score": "0.60975236", "text": "def _revert_on_withdrawal_lock(self, _user: Address, _id: int) -> None:\n\n deposit_time = self._withdraw_lock[_id][_user]\n if deposit_time + WITHDRAW_LOCK_TIMEOUT > self.now():\n revert(f\"{TAG}: As...
[ { "docid": "2e127a7d6d971ce6e17af3f2112331b1", "score": "0.6691026", "text": "def rollback(self) -> None:\n self._check_thread()\n if self.state not in (_STATE_ACTIVE, _STATE_PARTIAL_COMMIT):\n raise TransactionError(\"Transaction is not active.\")\n try:\n if ...
9092e79339bd6a32b19c144508d510a5
Transform image perspective using OpenCV functions
[ { "docid": "b437a995dca3f0361343df4ad097ff0e", "score": "0.7015952", "text": "def warp(self, image):\n\t\treturn cv2.warpPerspective(image, self.transformation_matrix, (image.shape[0], image.shape[1]), flags=cv2.INTER_CUBIC)", "title": "" } ]
[ { "docid": "e4d720145f38baea418efe75d75cc9c6", "score": "0.7743494", "text": "def perspect_transform(img, src, dst):\n M = cv2.getPerspectiveTransform(src, dst)\n warped = cv2.warpPerspective(img, M, (img.shape[1], img.shape[0]))# keep same size as input image\n \n return warped", "title...
3b4d553fc9f2f47851b8d99eea361a49
get size info by downloading small part of it
[ { "docid": "db338b1bf733ca268854f043d9d43366", "score": "0.66978264", "text": "def quickQueryImgSize(src):\n try:\n with request.urlopen(src) as file:\n p = ImageFile.Parser()\n while True:\n data = file.read(1024)\n if not data:\n ...
[ { "docid": "9721d38a16ecec0c460f437a152a81b4", "score": "0.7361434", "text": "def get_info(self):\n try:\n resp = urllib.request.urlopen(self.url)\n self.size = int(resp.headers['content-length'])\n except urllib.error.HTTPError:\n self.size = -1;", "ti...
68400876ee6dc25f8b277ea69c814ab5
Count number of files in each subdirectory in dataDir.
[ { "docid": "cfe70ada7d43ad163104289f72cee968", "score": "0.6957413", "text": "def count_samples(dataDir):\n assert(isdir(dataDir))\n filenames = [f for f in listdir(dataDir)]\n class_count = {}\n for f in filenames:\n path = dataDir+\"/\"+f\n if isdir(path):\n class_count[f] = len(listdir...
[ { "docid": "dd9caba0bd91e567e3c8d24a7508861a", "score": "0.7474413", "text": "def files_in_directory(path: str):\r\n count = 0\r\n for _, _, files in os.walk(path):\r\n count += len(files)\r\n \r\n return count", "title": "" }, { "docid": "849e66dd3a5a459db82f2fd30d516294"...
066ae097295fc95829622edcb8e2468b
Return list of stations w/ status
[ { "docid": "d89236c484845cb571bb6eafdec2d80f", "score": "0.7941429", "text": "def get_status(self, stations:list = None):\n url = 'https://gbfs.urbansharing.com/trondheimbysykkel.no/station_status.json'\n\n data = self._FetchData(url)\n\n if stations:\n results = []\n ...
[ { "docid": "7c63df56a0bff2f9e6b7994576f818c1", "score": "0.74598414", "text": "def get_stations(self):\n return self.call_api('stn', 'stns')", "title": "" }, { "docid": "3bac02a9813b4730b91ad0f486ac6fdf", "score": "0.7244118", "text": "def _get_stations(self):\n r = sel...
b514582c9166d3f669a30d662f644aaf
Should correctly create a keyspace in Cassandra
[ { "docid": "cf2a0bb45f7445fac787994e431d5633", "score": "0.7807259", "text": "def test_create_keyspace(self):\n self.render_config_template(\n cassandra_ports=[9042],\n cassandra_send_request=True,\n cassandra_send_response=True,\n cassandra_send_reques...
[ { "docid": "81e2224946d7a5e6fd6b7c40ba2e2782", "score": "0.807247", "text": "def createKeyspace(self):\n sys = SystemManager(str(self.host) + \":\" + str(self.port),framed_transport=True, timeout=30)\n try:\n print \"Trying to create new keyspace\"\n sys.create_keyspa...
959883e1ab0bcfe8ca8ed927c82070ed
Visualize faces obtained from MTCNN
[ { "docid": "70dbb8d91398ceb44e87f31fb5698591", "score": "0.78203064", "text": "def visualize_faces_mtcnn(img_path, detector):\n img = cv2.imread(img_path)\n faces = detector(img)\n for x in faces:\n x = np.asarray(x)\n x = np.transpose(x, (1, 2, 0))\n x = cv2.cvtColor(x, cv...
[ { "docid": "ee20f8b403c10b30526608e2bb664356", "score": "0.6805244", "text": "def faces():", "title": "" }, { "docid": "c4d006a66ea0674f515a62e5dacf24da", "score": "0.6586629", "text": "def recognize_faces_and_draw_knn(self, minDistance=0.5):\r\n index = 0\r\n new_image...
bcb2027c3c56212fac8d91ec35e638df
Version number of the Redis engine used by the cluster.
[ { "docid": "c5cc51d64dd355f2fa49949efc1f44e7", "score": "0.79144454", "text": "def engine_version(self) -> str:\n return pulumi.get(self, \"engine_version\")", "title": "" } ]
[ { "docid": "4ff972cf54a6ad220b13fd20e15c481d", "score": "0.7563207", "text": "def engine_version(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"engine_version\")", "title": "" }, { "docid": "4ff972cf54a6ad220b13fd20e15c481d", "score": "0.7563207", "text": "def engine...
da458fc2e0df01b67bf643f74d2a4719
A parsing with checking that it is not ambiguous
[ { "docid": "39987259454b6e802d48cd0d8fc15f52", "score": "0.0", "text": "def __parse(self, w, var):\r\n if (w, var) in self.__cache:\r\n return self.__cache[w, var]\r\n else:\r\n n = len(w)\r\n if n == 1: return int((var, w) in self.__prods)\r\n counter = 0\r\n for p in sel...
[ { "docid": "362b63e565f979e5740efa2a27e8e3c1", "score": "0.639785", "text": "def ambiguousParse(self, word):\r\n self.__cache.clear()\r\n return self.__parse(word, 0) != 1", "title": "" }, { "docid": "e2d70c25ed7ca7086ea10af06cdd9443", "score": "0.6308442", "text": "def parse()...
4ceb5896dbde5e90af77304ea6e3fd6a
Convert a value to a JSON serializable value
[ { "docid": "d3882393097a90b9be7d3ba9047cd478", "score": "0.0", "text": "def serialize(value, list_obj_type, **kwargs):\n serialized_list = []\n for el in value:\n if issubclass(list_obj_type, Type):\n serialized_list.append(list_obj_type.serialize(el, **kwargs))\n...
[ { "docid": "ba48399899584d9edb4caa6c73a7016b", "score": "0.83150655", "text": "def to_json(self, value):\r\n return value", "title": "" }, { "docid": "91b489dfea37aa0a9c81190c459096d5", "score": "0.8236348", "text": "def _serialize_value(value):\n return value", "ti...
6f623d32fc14b8124f9a3193bc79b872
Test call subroutine with parameter that is defined multiple times.
[ { "docid": "daf56366e11edbc3dd865b676a3b0b2a", "score": "0.62572026", "text": "def test_call_with_common_parameter(self):\n amp = circuit.Parameter(\"amp\")\n\n with pulse.build() as subroutine:\n pulse.play(pulse.Gaussian(160, amp, 40), pulse.DriveChannel(0))\n pulse...
[ { "docid": "1ea99a172ec554e436fc623247ceef88", "score": "0.67987573", "text": "def test_runs_once_runs_only_once():\n func = fake_function(expect_call=True).times_called(1)\n task = decorators.runs_once(func)\n for i in range(2):\n task()", "title": "" }, { "docid": "f9c9623f...
befa954a806ef81c803dd20c5190657d
Base method which allows us to understand different goals.
[ { "docid": "d421c7307c7661f2c21f9e054a633cce", "score": "0.0", "text": "def achieve_goals(state, goals):\n tasks = []\n for goal in goals:\n if goal.kwargs['predicate'] == 'agent-at':\n action = 'move-to'\n tasks.append((action, goal.args[0]))\n elif goal.kwargs...
[ { "docid": "97e7c5eafec6ce8952affd0d1c8c4fd2", "score": "0.69283324", "text": "def funtion(self):\n pass", "title": "" }, { "docid": "f240aea361128e7757b08542987ba29f", "score": "0.6904391", "text": "def mystere():", "title": "" }, { "docid": "9674a53f41c819786d781...
5a3b414277fd2a74b4ef90902ea40c36
Return a list of students in the grade book
[ { "docid": "36ee0f2a014fcf975e133a1919f6bf1b", "score": "0.63622546", "text": "def allStudents(self):\n if not self.isSorted:\n self.students.sort()\n self.isSorted = True\n # return self.students[:]\n for s in self.students:\n yield s # generato...
[ { "docid": "70ac378fbf6537d2233f442e322c2655", "score": "0.73335534", "text": "def students(self):\n return Student.objects.filter(groups__in=list(self.groups.all()))", "title": "" }, { "docid": "d8a1991469a65fc1caff6cdc6841e351", "score": "0.7234299", "text": "def students(se...