query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
0e9ed4e2ae7a13df9cb4e74d0ee1ec9e
Update's the table from database using query as input use " " at the beginning and end of the query
[ { "docid": "96313f56d509bf954f7d64f086669e44", "score": "0.7863273", "text": "def update_table(self,query):\n query=query\n self._cursor.execute(query)\n self._connection.commit()", "title": "" } ]
[ { "docid": "bb68f0d9403b049569ad037b78d4e87d", "score": "0.7928796", "text": "def update(self, sql):", "title": "" }, { "docid": "f3fa507bf7a6aceb5b4cf35ddd2ba805", "score": "0.7482706", "text": "def make_update_query(self, query: str):\n\n self.create_connection() # sets con...
e1dcd7079a55f1c787e707ed12f112c4
1. Generate morphed images using face morpher
[ { "docid": "8a4a078ac64b1e5be88467de13ba285e", "score": "0.68224627", "text": "def morph_emotion_images(emotion, subjects):\n \n head_direction = 'Rafd090'\n eye_direction = 'frontal'\n \n for subject in subjects:\n \n print('[INFO] Processing', subject...)\n \n ...
[ { "docid": "cc9e78a261e7f4def8e8801d07438f48", "score": "0.6737589", "text": "def create_mini_images():\n\n emotions = [\"neutral\", \"anger\", \"contempt\", \"disgust\", \"fear\", \"happy\", \"sadness\", \"surprise\"]\n for emotion in emotions:\n source_path = \"ck-sorted/\"+emotion\n ...
a8670cc1596318191a7492675d7b0937
Initializes a Chirp signal.
[ { "docid": "68205559a42a7f7dd982bb85900d878d", "score": "0.0", "text": "def __init__(self, startf=200, stopf=400, t1=1, method='linear'):\n self.startf = startf\n self.stopf = stopf\n self.t1 = t1\n self.method = method", "title": "" } ]
[ { "docid": "57b079b9520727f56128997987e8372b", "score": "0.6390474", "text": "def define_chirp(self):\n\n sec = 1\n k = 50\n w1 = 100\n w2 = self.chirp_high\n\n t = np.linspace(0, sec, int(self.fs*sec))\n\n chirp = np.sin(2*np.pi * w1 * sec * (np.exp(t *\n ...
3b627bf502dda60b5ec37a7e49e885b8
Sets the criteriaboxid of this MdsQuery.
[ { "docid": "ddc5167f97b59c706aae83e78182ca9b", "score": "0.738749", "text": "def criteriaboxid(self, criteriaboxid):\n if criteriaboxid is None:\n raise ValueError(\"Invalid value for `criteriaboxid`, must not be `None`\") # noqa: E501\n\n self._criteriaboxid = criteriaboxid", ...
[ { "docid": "70d3a99d8262de3fefdb7c4708a5b9c7", "score": "0.5326126", "text": "def __init__(self, criteriaboxid=None, handlerclass=None, join=None, label=None, layout=None, properties=None, statement=None, stylename=None, widget=None): # noqa: E501 # noqa: E501\n self._criteriaboxid = None\n ...
967191b6464eefb9b6ddcabbbe49ead0
Get All Detectors in Detector Table
[ { "docid": "919673a91f70b9104b20d9b152079b8e", "score": "0.0", "text": "def getAllPartitions(self):\n connection = sqlite3.connect(self.dataBaseFile)\n c = connection.cursor()\n try:\n c.execute(\"SELECT * FROM Partition\")\n res = c.fetchall()\n ret...
[ { "docid": "78ac6ae6c2097d86d3ce2e41feca4a72", "score": "0.734863", "text": "def getAllDetectors(self):\n connection = sqlite3.connect(self.dataBaseFile)\n c = connection.cursor()\n try:\n c.execute(\"SELECT * FROM Detector\")\n res = c.fetchall()\n ...
a3724545d34835fb51fbdf6c28e8d045
Takes in original obs and randomly cutout a strip to a 55x55
[ { "docid": "991be187fc1ab739f6239b8152d43f1e", "score": "0.7064706", "text": "def cutout(obs, shape=(32, 32)): ##obs.shape==320,64,64,3\n x = np.random.randint(46)\n # obs[:, :x, :,:] = 0\n obs[:, x:x+4,:,:] = 0\n return obs", "title": "" } ]
[ { "docid": "4daf049d01540af5c66255816ca15792", "score": "0.67266196", "text": "def rand_crop(obs, shape=(32, 32)): ##obs.shape==320,64,64,3\n x, y = np.random.randint(15,size=(2,))\n # obs[:, :x, :,:] = 0\n obs[:, :, :y,:] = 0\n # obs[:,64-x:, :, :] = 0\n obs[:, :, 64-y:, :] = 0\n retu...
09eeddc452f5f4cd65017c3764caf1a9
Used to specify whether file notifications are sent to IoT Hub on upload. Defaults to `false`.
[ { "docid": "de9efd70cdd7ac2d1e5c27927577137f", "score": "0.5638011", "text": "def notifications_enabled(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"notifications_enabled\")", "title": "" } ]
[ { "docid": "63969bc2dcab7f4ea14e134acdbd3880", "score": "0.6151067", "text": "def requires_file_upload(self):\r\n return self._requires_file_upload", "title": "" }, { "docid": "9a316cf340b732d001f328addd90ea05", "score": "0.60951287", "text": "def may_attach_files(self, user):...
fc11d77f35850396f2e9f33e38fe0f03
Clean up dict after converting everything to dict
[ { "docid": "a1475a6c04b4671008aa165a5c686a8f", "score": "0.6964649", "text": "def scrub_dict(d):\n if type(d) is dict:\n return dict((k, scrub_dict(v)) for k, v in d.iteritems() if v and scrub_dict(v))\n else:\n return d", "title": "" } ]
[ { "docid": "031c08b6ca06896819c3fcdb44be9439", "score": "0.72440386", "text": "def clean_dictionary(d: dict) -> dict:\n for key in d:\n if hasattr(d[key], '__call__'):\n d.pop(key)\n return d", "title": "" }, { "docid": "38802b0e6b0715a331a543b5f946e829", "score":...
09886154c61e5e66c4e93fe553650ee5
Average a list of datapoints. A list with no nonNone items has an average of zero.
[ { "docid": "c6931123be8acf7dc94fed2857ccc05c", "score": "0.6805623", "text": "def avg(dpList):\n if not dpList:\n return 0.0\n\n dpList = [x for x in dpList if x is not None]\n if not dpList:\n return 0.0\n\n return sum(dpList) / len(dpList)", "title": "" } ]
[ { "docid": "98ec3fc8563d74ec906d33c57f0247cd", "score": "0.76778173", "text": "def mean(lst):\n lst = [elem for elem in lst if elem is not None]\n return np.mean(np.array(lst)) if len(lst) > 0 else 0", "title": "" }, { "docid": "4fb533ab645d793c19574b8c589dd3a4", "score": "0.754892...
75c9178eeb21d213ee9acfa8e3d59fe1
My customized model function
[ { "docid": "64c8770a14f07d7dcfe1534d34cbc624", "score": "0.0", "text": "def my_model_backward(labels, fc_filters, reg_scale, conv1d_filters, filter_channel_list ):\n \n ##Record the variables before Backwardmodel is created\n BeforeBackCollectionName = \"BeforeBack_Collection\"\n for var i...
[ { "docid": "1542ec9e58a9ab3a9bdbf240d0a86296", "score": "0.7477061", "text": "def model(self):", "title": "" }, { "docid": "89397b8e83794d799dce2718e3b00cd0", "score": "0.7177977", "text": "def inModel(self):\n \n pass", "title": "" }, { "docid": "539ad520dd5224...
c26ed3725398a4fed9398fe7c1e7c913
Print list of commands to run
[ { "docid": "99898ba4171ce55afb904a8e93227608", "score": "0.7087355", "text": "def print_commands(commands,\n status_update_callback,\n logger):\n #logger.write(\"Printing commands only.\\n\\n\")\n #for c in commands:\n # for e in c:\n # status_up...
[ { "docid": "b9b7d4eed90f1015a2643fe265875fb2", "score": "0.81645465", "text": "def print_commands(self):\r\n pass", "title": "" }, { "docid": "2a13ba3352fb1ea2bf46156e1906f339", "score": "0.7973929", "text": "def show_commands(self):\n print('-h\\t--lists all commands')\n ...
503fa88ca6c1c1f072a8e6d8dfb77199
Open communications with EBAM Plus unit
[ { "docid": "4e6ef82766b8cadba65d720055a694ad", "score": "0.0", "text": "def connect(self):\n if not self.cli.isOpen():\n self.cli.open()", "title": "" } ]
[ { "docid": "892e4220778f1b71eee360d1382bda18", "score": "0.64897", "text": "def performOpen(self, options={}):\n\n # connect, either through name or by autodetecting\n if self.comCfg.address == '<autodetect>': #input from labber in \"Communication\" section of the driver\n self....
e30dc2df7026bc10e25a72089707317c
Edits a Databricks cluster Policy. The specification for the request json can be found at
[ { "docid": "65a789f753aad72de61c8a890fe8fab4", "score": "0.66613555", "text": "def edit_cli(api_client, json_file, json):\n if not bool(json_file) ^ bool(json):\n raise RuntimeError('Either --json-file or --json should be provided')\n if json_file:\n with open(json_file, 'r') as f:\n...
[ { "docid": "9d1a3637d76fd45b18894681b2229123", "score": "0.67657363", "text": "def cluster_update_policy(self, cluster, policy, **attrs):\n return self.service.update_cluster_policy(cluster, policy, **attrs)", "title": "" }, { "docid": "9304fa1bf5d10e026f38e6220ec3cb3d", "score": ...
ed6f5b0306438010b938131d2a4e1338
Determines the reaction in which the molecule acts as an acid
[ { "docid": "6ce159e012bddb79bb5caebedafcd836", "score": "0.77446043", "text": "def acid_reaction(self):\r\n return (self + H*H*O > self.conjugate_base() + H*H*H*O*ep)", "title": "" } ]
[ { "docid": "bbb1be8060a4d49a5feb66d2af56c6de", "score": "0.82701194", "text": "def acid_reaction(self):\r\n return Molecule(self.parts, self.count, self.charge).acid_reaction()", "title": "" }, { "docid": "580168c967bde3459afb0f4c7df80b43", "score": "0.79462945", "text": "def ...
9684abc1e5468def436d92ce25f527ae
Multiply every element of self by value. Done in place.
[ { "docid": "9d86fa04561e94c82d8a1531e8cf94cb", "score": "0.7325298", "text": "def scale(self, value:Any):\r\n self._inert = (i*value for i in self)\r\n return self", "title": "" } ]
[ { "docid": "f911b7d4237ef29b024e6616813f694d", "score": "0.727317", "text": "def __mul__(self, scalar):\n # BAD python 2.3 compat change\n return type(self)( [scalar*item for item in self] )", "title": "" }, { "docid": "4c920e9ce16034ec191b54391418f4ff", "score": "0.7248915...
aef59dbb3900ae0a18478a838687c9a8
Creates a new patient.
[ { "docid": "9a6f2fd99b6165685488448bbb96c4b1", "score": "0.7603765", "text": "def new_patient(patient_data: dict) -> Patients:\n database = get_connection()\n patient = Patients(id=str(uuid.uuid4()), created_at=datetime.now(), clinical_information=patient_data)\n database.patients.insert(\n ...
[ { "docid": "b89d660e229974b4ffde32f91bc4ad23", "score": "0.76125675", "text": "def createPatient(self):\n p = Prescription()\n p.patient_id = self.patients.data\n p.medication = self.medication.data\n p.frequency = self.frequency.data\n p.start_dt = self.start_dt.data\...
4ea9e42b0e93fcfff85b39a7b86c1d6c
Cross rows and columns on an iteration to obtain the diagonal
[ { "docid": "0d56d91b140566eb4cbc70485a88c8ef", "score": "0.63815534", "text": "def get_inv_diagonal(rows, columns):\n diagonal_boxes = []\n j = len(rows) - 1\n for i in range(len(rows)):\n diagonal_boxes.append(rows[i] + columns[j])\n j = j - 1\n return diagonal_boxes", "ti...
[ { "docid": "e64b4d30af1573095f8b90fb69ceed39", "score": "0.676744", "text": "def _diags(self):\n indices = jnp.arange(self.dim)[:,jnp.newaxis]\n bin_reps = (indices >> jnp.arange(self.N)[::-1]) & 1\n spins = 1 - 2 * bin_reps\n spins_prime = jnp.hstack( (spins[:,1:] , spins[:,...
44dc5cc5a85b70e4d2e57f030e7e7e14
Compute the Section, in the coordinate syteme given by the Location Law. To have the Normal to section equal to the Location Law Normal. If contact beetween and is forced.
[ { "docid": "3abe8a46cf705b9ace13b235e31319b7", "score": "0.52541476", "text": "def ModifiedSection(self, *args):\n return _GeomFill.GeomFill_SectionPlacement_ModifiedSection(self, *args)", "title": "" } ]
[ { "docid": "6f00126098607b4a21a1e7a81f945b25", "score": "0.58446944", "text": "def ConstantSection(self, *args):\n return _GeomFill.GeomFill_SectionLaw_ConstantSection(self, *args)", "title": "" }, { "docid": "a4ed5004f5f44261468c0151db23d3eb", "score": "0.5688747", "text": "d...
f81c994135f7b7437388af46633d6c0d
Promote im1, im2 to nearest appropriate floating point precision.
[ { "docid": "2ce479e3318c24ed1654c0ae94b655c7", "score": "0.6312333", "text": "def _as_floats(im1, im2):\n float_type = np.result_type(im1.dtype, im2.dtype, np.float32)\n im1 = np.asarray(im1, dtype=float_type)\n im2 = np.asarray(im2, dtype=float_type)\n return im1, im2", "title": "" } ...
[ { "docid": "a31b8f00695681215b37a0107c052974", "score": "0.58750874", "text": "def _normalize(op1, op2, shouldround = 0, prec = 0):\r\n # Yes, the exponent is a long, but the difference between exponents\r\n # must be an int-- otherwise you'd get a big memory problem.\r\n numdigits = int(op1.ex...
05af6a2b3aebd38c9780fc80281b3661
Creates one alignment by going through a traceback path.
[ { "docid": "77995b1a764fbe875ed1c5f68ef3c08c", "score": "0.6657382", "text": "def _create_alignment(self, path):\r\n path.reverse()\r\n start = path[0]\r\n\r\n alignment_a = strings.EMPTY\r\n alignment_b = strings.EMPTY\r\n\r\n cur_char_align_1 = 0\r\n cur_char_...
[ { "docid": "b68da0baa939d1d9b8ef083853ff5e18", "score": "0.6136285", "text": "def doAlignment(self):\n\n seq1len = len(self.seq1)\n seq2len = len(self.seq2)\n\n # 1st subscript = sequence 1,\n # 2nd subscript = sequence 2\n scores = [ [0 for i in range(seq2len+1)] for ...
eb61ee2d5e6ae2243355dfd18f6e52c1
Construct a multibox layer, return a class and localization predictions.
[ { "docid": "3a35ef534a00913dc524ad506142ceac", "score": "0.5202887", "text": "def ssd_multibox_layer(inputs,\n num_classes,\n sizes,\n ratios=[1],\n normalization=-1,\n bn_normalization=False):\...
[ { "docid": "a909d4e71632524361ad39fd32aef038", "score": "0.6050399", "text": "def build_classifier(self, **kwargs):\n # loc and conf layers\n in_channels = tuple(self.feature_layers[name].out_channels for name in self.classifier_source_names)\n\n _dbox_num_per_fpixel = [len(aspect_r...
6a9bd6c9182d895d73b587ffbc60567d
Setup mock response 404
[ { "docid": "e7ddeeff820f007b87fef5066cd97f48", "score": "0.0", "text": "def __init__(self, data, status_code=404):\n self.data = data\n self.status_code = status_code", "title": "" } ]
[ { "docid": "f54208934f6fd1b96047516946acd0a7", "score": "0.76103675", "text": "def test_return_404(self):\n buffer = {}\n\n def start_response(code, headers):\n buffer['code'] = code\n buffer['headers'] = headers\n\n result = self.instance.return_404(\n ...
93ce6917d53ddbc7e14b937630567268
shut down continuous recording.
[ { "docid": "ba300671e375e518c21b746a7550fa37", "score": "0.0", "text": "def continuousEnd(self):\n print \"Die!\"\n self.threadsDieNow = True", "title": "" } ]
[ { "docid": "1781197fec3dc9f16a56bb3ff133e825", "score": "0.7465613", "text": "def recording_stop(self):\n self.recording = False\n self.threads['recording'] = None", "title": "" }, { "docid": "f5575fc4a17a3afdc8b91b3c6c9272fb", "score": "0.7301088", "text": "def stop_ca...
ffd55afce1716d645c191e4472691883
Add validation result objects to a list of results.
[ { "docid": "490a20fdad84e9b78d1db58b47fd8327", "score": "0.0", "text": "async def get_valid_invalid_results(\n self, classification_tokens: List, transcripts: List,\n classification: Classification, results: List, gene_tokens: List,\n mane_data_found: Dict, is_identifier: bool,\n ...
[ { "docid": "cb8ce75ee4fcce71f7ba9fb8bc9628ce", "score": "0.693104", "text": "def merge_results(self, final, result):\n final.errors += result.errors\n final.failures += result.failures\n final.skipped += result.skipped\n final.expectedFailures += result.expectedFailures\n ...
87d1242011a4ea0509275c443be6bd65
Fixture function which creates the model metadata json file without the sensor or neural_network information
[ { "docid": "eec09f5a125600f51fb444f12b957841", "score": "0.5558178", "text": "def create_model_metadata_action_space():\n model_metadata_path = \"test_model_metadata_action_space.json\"\n model_metadata = {\n \"action_space\": [\n {\n \"steering_angle\": 45,\n ...
[ { "docid": "b9b61a5120be8456706b5b11b043eaa7", "score": "0.7641225", "text": "def create_model_metadata():\n model_metadata_path = \"test_model_metadata.json\"\n model_metadata = {\n \"action_space\": [\n {\n \"steering_angle\": -30,\n \"speed\": 0.6...
7eb379bc8c9ad909a2f3fdef4962d706
Test the time step increment of a ToySquares object
[ { "docid": "ba63fcb9b4c122394b641ca64959ac70", "score": "0.8912831", "text": "def test_increment_time_step(self):\n toy_squares = self.test_constructor()\n toy_squares.increment_time_step()", "title": "" } ]
[ { "docid": "92261ed520f4713cf8c807793616e38a", "score": "0.74221474", "text": "def timeStep(self):", "title": "" }, { "docid": "5bd38aef68c994295bfa238f3756f482", "score": "0.6563983", "text": "def increment_time_step(self):\n self.time_step += 1", "title": "" }, { ...
f7246852e12b56d8f4f1b9b13c43776f
Add a client to the block list.
[ { "docid": "54876cdd5ba23390cdbba72baed894dd", "score": "0.0", "text": "def block_client(self, mac):\n\n self._mac_cmd(mac, 'block-sta')", "title": "" } ]
[ { "docid": "59f946378fcf9476230d213bfc604000", "score": "0.77596116", "text": "def add_client(self, client: socket.socket) -> None:\n self._clients.append(client)", "title": "" }, { "docid": "e1384726375c262471690e2be48147fa", "score": "0.7421137", "text": "def register(self, ...
2e9296b5bd5a7a3a9fb4203aac2f90f1
Compute precision and recall of different score threshold
[ { "docid": "69bd9b243c1d4b4825931a395827e329", "score": "0.0", "text": "def rp_various_th(gt_pds, ths, etol, metric=azimuth_distance):\n pr = []\n for t in ths:\n pdf = pds_to_pdf(gt_pds, t)\n _, r, p, _, _ = eval_recall_precision(pdf, [etol], metric=metric)\n pr.append((r[0],...
[ { "docid": "7f9a8dc1f92914411102b0d0628a5bb2", "score": "0.78416824", "text": "def precision_at_recall(scores, labels, target_recall):\n positive_scores = scores[labels == 1.0]\n threshold = np.percentile(positive_scores, 100 - target_recall*100)\n predicted = scores >= threshold\n return pr...
0f2f04ded56e31af9f78b9577d14f7e1
Get a set of legal combinations of target (exposure time, sensitivity). Gets the target exposure value, which is a product of sensitivity (ISO) and exposure time, and returns equivalent tuples of (exposure time,sensitivity) that are all legal and that correspond to the four extrema in this 2D param space, as well as to...
[ { "docid": "912be3127dd161a655a69a2043356cf1", "score": "0.7153181", "text": "def get_target_exposure_combos(its_session=None):\n if its_session is None:\n with its.device.ItsSession() as cam:\n exposure = get_target_exposure(cam)\n props = cam.get_camera_properties()\n ...
[ { "docid": "8994c58b2d36c61ffa0f80920bee15bd", "score": "0.60776895", "text": "def get_target_exposure(its_session=None):\n cached_exposure = None\n for s in sys.argv[1:]:\n if s == \"target\":\n cached_exposure = __get_cached_target_exposure()\n if cached_exposure is not None...
13a1f4a01c8bdb5bf9ed48373336cc8e
Clone(itkIsolatedConnectedImageFilterIF2IF2 self) > itkIsolatedConnectedImageFilterIF2IF2_Pointer
[ { "docid": "8e4deb70da60c0e10db653b12fc735da", "score": "0.9369704", "text": "def Clone(self) -> \"itkIsolatedConnectedImageFilterIF2IF2_Pointer\":\n return _itkIsolatedConnectedImageFilterPython.itkIsolatedConnectedImageFilterIF2IF2_Clone(self)", "title": "" } ]
[ { "docid": "8381db5192bb2f2dea69a19d8ddd520c", "score": "0.88956755", "text": "def Clone(self) -> \"itkIsolatedConnectedImageFilterIUC2IUC2_Pointer\":\n return _itkIsolatedConnectedImageFilterPython.itkIsolatedConnectedImageFilterIUC2IUC2_Clone(self)", "title": "" }, { "docid": "99f90...
e5e042c8fc342e1994f4fc2cb4e561e3
Get item with the specified Id.
[ { "docid": "5e24fdda50f697c9459795fa135b522c", "score": "0.71838367", "text": "def get(self, itemId):\n\n tableRow = self.__queryTableRow(itemId)\n return self.__getItemFromTableRow(tableRow)", "title": "" } ]
[ { "docid": "b88dfccb495f954fb8fd0f791e6b5d7f", "score": "0.86855495", "text": "def getItem(self, id):\n path = 'item/' + id\n return self.sendRestRequest('GET', path)", "title": "" }, { "docid": "15d5ee78bc3f44b0c0619e5b4e135c81", "score": "0.7920818", "text": "def get_...
8110df8e5976ea4b2be197eebacd69f5
Ensures correct output from is_v_wind_field. In this case the answer is yes.
[ { "docid": "55dd6928d4b8a4b81d8bb41fc8db8adc", "score": "0.8026145", "text": "def test_is_v_wind_field_true(self):\n\n self.assertTrue(grib_io.is_v_wind_field(V_WIND_NAME))", "title": "" } ]
[ { "docid": "c22039e2105441ccda68e2fe307fa85b", "score": "0.7764373", "text": "def test_is_u_wind_field_v_wind(self):\n\n self.assertFalse(grib_io.is_u_wind_field(V_WIND_NAME))", "title": "" }, { "docid": "cab1e36c9939960c2ac1794dca943e7f", "score": "0.7331233", "text": "def te...
c9ba8f4bfdaae302393c82e504eb69bf
Test that the string is correctly parsed.
[ { "docid": "b967bf926cc3d869cb6e8c5e13feb784", "score": "0.0", "text": "def test_parse_string_key_val(key: str, value: str, enclosing: str):\n enclosed_value = enclosing.format(value)\n bibtex_str = f\"\"\"@string{{{key} = {enclosed_value}}}\"\"\"\n library: Library = Splitter(bibtex_str).split...
[ { "docid": "68bcb075ee9023bc6504ab3b98c0912c", "score": "0.8762374", "text": "def __test_parse_string():", "title": "" }, { "docid": "f21244c00c5bec4a58b7f54687975541", "score": "0.74926984", "text": "def test_parse_str(self):\n\n obj = self.parser.parse_str(STR)\n self...
2ae863de650db4ee3a7ff292d859e71b
Ensure ``path`` outputs proper settings file path.
[ { "docid": "7f2eb865576fa67708552492ef14276c", "score": "0.6299038", "text": "def test_settings_path(self):\n with self.cli_runner.isolated_filesystem():\n with open(\"settings.json\", \"w\") as handler:\n handler.write(PULP_SMASH_CONFIG)\n with mock.patch.obj...
[ { "docid": "d49d3192faad7077206e313d0d2e8fa0", "score": "0.62478626", "text": "def test_get_settings_file_path_returns_the_settings_path_correctly(self):\n self.assertEqual(\n os.path.expanduser('~/.atrc/last_version'),\n ExternalDCC.get_settings_file_path()\n )", ...
db56b62c837eeb813a767122f02d3d5c
generate all graident targets for CC Graph
[ { "docid": "8def199e03ddb3e57dd452bf2c938c97", "score": "0.53105754", "text": "def GraphDef_Grad(graph_def, targets):\n all_pairs = set()\n for target in targets:\n for wrt in target.grad_wrts:\n all_pairs.add((target.name, wrt))\n\n for pair in all_pairs:\n g_target = ...
[ { "docid": "60d287fb34ae7e3076cd7efcf7539469", "score": "0.6744482", "text": "def __generate_targets(self):\n targets = list()\n for i in range(len(self.images)):\n mat = sio.loadmat(self.masks[i], mat_dtype=True, squeeze_me=True, struct_as_record=False)\n categories ...
da5f3f850684cd950c772a6c423981fc
Execute all commands issued after MULTI
[ { "docid": "eeb79144b48cc547bd8eda52b1d4704d", "score": "0.6023346", "text": "def _exec(self):\r\n if not self._in_transaction:\r\n raise Error('Not in transaction')\r\n\r\n futures_and_postprocessors = self._transaction_response_queue\r\n self._transaction_response_queue...
[ { "docid": "dda936b07c092ad782de1aba63e81567", "score": "0.6528384", "text": "def execute_commands(self):\n for command in self.commands:\n command.execute(self)\n\n self.commands.clear()\n self.controller.loading = False", "title": "" }, { "docid": "cce11de11...
3303d6927f44a64c4d0fdd3feca1faf9
decode control choice strings >>> a = Parameter([]) >>> a._onOffParser(1) 'on'
[ { "docid": "37aea494cada7c57b9ba3f650af682da", "score": "0.6830201", "text": "def _onOffParser(self, usrStr):\n ref = {\n 'on' : ['1'],\n 'off' : ['0'],\n }\n usrStr = drawer.selectionParse(usrStr, ref)\n if usrStr == None:\n selStr = ...
[ { "docid": "621779a6535a480d22d4f8db6d1da406", "score": "0.55207944", "text": "def _decode_boolean(data: str) -> Tuple[int, base.Asn1Item]:\r\n if data[0] == '1':\r\n return 1, univ.Boolean(value=True)\r\n else:\r\n return 1, univ.Boolean(value=False)", "title": "" }, { "...
39ab20ecd199378318d85b3d7501b6ba
Cuts the selected text from the line edit. Copies the selected text to the clipboard then deletes the selected text from the line edit.
[ { "docid": "668e040d2ce6d90fca8f89da6da9aef5", "score": "0.7026711", "text": "def cut(self):\n self.widget.Cut()\n self._update_shell_selection_and_cursor()", "title": "" } ]
[ { "docid": "70e29e1fe2c3ae489f6f68a3d2a73b81", "score": "0.77484757", "text": "def editCut(self):\n widget = QtGui.QApplication.focusWidget()\n try:\n if widget.hasSelectedText():\n widget.cut()\n return\n except AttributeError:\n ...
6272898a2a26e5319b121f4f311870f2
This method configures Serial Port option in Bios Policy.
[ { "docid": "5d1cc36694c82efaef1184495a6799c0", "score": "0.6220808", "text": "def bios_conf_serial_port_a(handle, name, parent_org_dn,\n vp_serial_port_a_enable=\"platform-default\"):\n\n from ucsmsdk.mometa.bios.BiosVfSerialPortAEnable import \\\n BiosVfSerialPortAE...
[ { "docid": "c64bd2d416d7d52c6d562b64a9da0c3b", "score": "0.67158395", "text": "def _update_serial_port(self):", "title": "" }, { "docid": "d27573773a5effb1fc3f30e4f1001f6e", "score": "0.67053586", "text": "def __init__(self, serialPort):\n self.__serialPort = serialPort", ...
ab4561e60b8d17ad3e9706a5bdad0f5e
vraci posledni vygenerovany obrazek
[ { "docid": "9862ae685f443540f28e99e363c75520", "score": "0.0", "text": "def getImage(self):\n return self.mergeImages()", "title": "" } ]
[ { "docid": "67ea62c603f56ebebe165f8302d920e1", "score": "0.63692826", "text": "def graficar(self):", "title": "" }, { "docid": "66dbd1ccb817c652c7178c06c7368c7d", "score": "0.62632704", "text": "def preparation(self):", "title": "" }, { "docid": "a1799f1e0af250b75b587be6b...
e90564c8c32db5ea742e1378643912c8
Tokenization/string cleaning for all datasets except for SST.
[ { "docid": "2c7da3f2b0c6c61cde56150c7bad40da", "score": "0.0", "text": "def clean_str(string):\n string = re.sub(r\"[^A-Za-z0-9(),\\+!?\\'\\`]\", \" \", string)\n string = re.sub(r\"\\'s\", \" \\'s\", string)\n string = re.sub(r\"\\'ve\", \" \\'ve\", string)\n string = re.sub(r\"n\\'t\", \" ...
[ { "docid": "b83641c6804b9e83900942ae4337486e", "score": "0.6654124", "text": "def cleanup_tokens(self):\n raise NotImplementedError", "title": "" }, { "docid": "5e9fe54b86bfae9f8b800afed3853334", "score": "0.66179585", "text": "def clean(str_input_dataset):\n\tstr_clean_datase...
5dd02d0415547f3f2075d2b995d22465
List all registered user names.
[ { "docid": "de0509e2edc83fc9a2b96c68761c6277", "score": "0.676247", "text": "def get_users_view(request):\n user_name_list = ax.evaluate_call(lambda: [user.user_name for user in\n UserService.all(models.User, db_session=request.db)],\n ...
[ { "docid": "e11550c2bc2053986e8a1101486dbabb", "score": "0.79452044", "text": "def list_users(self):\n pass", "title": "" }, { "docid": "ec1ec8aa3e65420fb561c7e7d9a81399", "score": "0.79144025", "text": "def list(self, request, format=None):\n usernames = [user.username...
02f8ec1dbb4565a65a735cd47153f869
This Dataset returns sys.maxsize, but is effectively unlimited.
[ { "docid": "d8c9aeeecff6b2c39021299813852f14", "score": "0.7583838", "text": "def __len__(self):\n return sys.maxsize", "title": "" } ]
[ { "docid": "014ad5c757cf79d33f34e3caa8b16f23", "score": "0.7852997", "text": "def __len__(self):\n\t\treturn min(len(self.dataset), self.opt.max_dataset_size)", "title": "" }, { "docid": "591f645eecd2c5835f57f0dfe90c7e6f", "score": "0.77031475", "text": "def maxsize(self):\n r...
7b27d376791b46a38ba562f6fe6bd2d6
Return dict of current parameters.
[ { "docid": "d9ddcdb75d127dfd6736448eb7236734", "score": "0.75191206", "text": "def get_params(self):\n parameter_dict = {\n 'regression_model': self.regression_model,\n 'holiday': self.holiday,\n 'mean_rolling_periods': self.mean_rolling_periods,\n 'mac...
[ { "docid": "3cf9e43ecc4bec239accccc8d23c8210", "score": "0.8382747", "text": "def param_dict(self):\n return self.params.param_dict()", "title": "" }, { "docid": "9f9705309e0e045c816935e2ba229178", "score": "0.8358229", "text": "def get_params(self) -> dict:\n\t\treturn dict()...
5fc41bac473de89bde8fd57a79bcc753
Sets the next_quote_number of this InvoiceSettings.
[ { "docid": "5b4899f73aacda3408acf6a4ab04ad3c", "score": "0.83951414", "text": "def next_quote_number(self, next_quote_number):\n\n self._next_quote_number = next_quote_number", "title": "" } ]
[ { "docid": "04adb1996b68cc40f09a039527a77589", "score": "0.63772535", "text": "def next_invoice_number(self, next_invoice_number):\n\n self._next_invoice_number = next_invoice_number", "title": "" }, { "docid": "8103b18f09d7d8b0c612bfe99c3997b0", "score": "0.62827", "text": "d...
6e8b8262a19b1c75022347aaab7573e6
This function takes in 2 lists of tuples, one for visited cities and their distance from the outbreak city, and another for the unvisited cities and it's distance from the outbreak city. it moves the city with the shortest distance, which is the distance from the visited city to its nearest neighbouring city, from the ...
[ { "docid": "be55ec6d9760f8a38fe94ecd3f55a4bd", "score": "0.7617503", "text": "def visit_next(visited, unvisited, distance):\n\n # Takes in the visited cities as a list\n visited_list = visited\n\n # Takes in the unvisited cities as a list\n unvisited_list = unvisited\n\n # Gets the shorte...
[ { "docid": "3ee2efd959a25fbdb8ae5f6d6baefb41", "score": "0.61393", "text": "def dijsktra(initial, destination):\n \n distances = {}\n\n for i in city_list:\n distances[i.state] = 10000000000000\n\n distances[initial.state] = 0\n\n q = PriorityQueue()\n\n q.put( (0, initial.state...
c0f7a1b92bd168f6b5656caefb477e56
Sets objective of model to minimization of enzymatic mass.
[ { "docid": "5381cdaae655f133f3562b505f58e64d", "score": "0.5934148", "text": "def set_enzymatic_objective(cobra_model, coefficients_forward, coefficients_reverse):\n coefficients = dict()\n for (bigg_id, cf) in coefficients_forward.items():\n rxn = cobra_model.reactions.get_by_id(bigg_id)\n...
[ { "docid": "57a0a352db57b18e123cc27b029c93a8", "score": "0.73641044", "text": "def Minimize(self, obj: ObjLinearExprT):\n self._SetObjective(obj, minimize=True)", "title": "" }, { "docid": "ce71e8f03db5f70ea793377ffb73845d", "score": "0.69110936", "text": "def _SetObjective(se...
53679d492b371e2133afbc443afe9005
computes residuals based on distance from ellipsoid can be used with different lossfunctions on residual
[ { "docid": "7c6ae09ece715a1bb31ffcedcd812579", "score": "0.0", "text": "def fitting_obj_stack(param, x, y, z, i):\n\n\n # centers\n cx = param[0]\n cy = param[1]\n\n #num_layers = len(set(z))\n #assert len(param) == num_layers+2\n\n radii = param[2:]\n\n num_layers = len(radii) / 2\...
[ { "docid": "6bde0a984bdbc9de25e970990587fd95", "score": "0.6588138", "text": "def ellipsoid_fit_rmse(query_points, axes, center, rotmat, return_full=True): \n # Find starting angles for all query points\n ellipsoid_points, ell_theta, ell_phi = generate_ellipsoid_even(axes, center, rotmat, \n ...
3a64a0b9859bfe2c14156c5350510d65
If the download doesn't complete, the validator fails.
[ { "docid": "f317b436fec237c212be7e1c65623b82", "score": "0.0", "text": "def test_download_fail(mock_tools, tmp_path):\n # Mock the environment as if there is not WiX variable\n mock_tools.os.environ.get.return_value = None\n\n # Mock the download failure\n mock_tools.download.file.side_effec...
[ { "docid": "3b8e5b802d54159eac4931d814661471", "score": "0.67761797", "text": "def __download_and_verify(url):\n \n n = __download_url(url)\n if n==1:\n FAILED = True\n elif n==0:\n if __verify(url):\n VERIFYFAIL=True\n elif n==3:\n if __check_md5(url):\n ...
1ccfae3bff6322e4b4bf1fc7c24361f4
Make a query to the Telegram Bot API.
[ { "docid": "4c183467346d812399c2676a2c673dc1", "score": "0.0", "text": "def make_request(method, message):\n url = f'{BASE_URL}{BOT_TOKEN}/{method}'\n post = requests.post(url, json=message)\n return post.json()", "title": "" } ]
[ { "docid": "65b103293b5c140607ffef35562dd283", "score": "0.6427141", "text": "def make_query_request(self, api_query):\n\t\ttry:\n\t\t\treturn requests.post(self.query_url, json=api_query, headers=headers, timeout=self.request_timeout)\n\t\texcept Exception as e:\n\t\t\tlogging.warning(\"Exception in ca...
69ade830278b509dc236a0d7b91ad23a
Gets the current option.
[ { "docid": "51d4d91a6a0cfaeeb71fc180401d8b75", "score": "0.8279675", "text": "def get_opt(self): \n\t\treturn self.cur_opt", "title": "" } ]
[ { "docid": "285f88057b249e864cd5e59d8158f198", "score": "0.8269581", "text": "def getOption(self):\n return self._option", "title": "" }, { "docid": "0a465ad4e648c0b76efb2d228ac9ff35", "score": "0.81982434", "text": "def get_selected_option(self):\n return self._current...
37006b8d55639e2f4b6cd00a7d4978ff
Prints a pretty banner for starting up script
[ { "docid": "19e35a89a46841a8ba19db6f42ced08e", "score": "0.67428637", "text": "def print_start_banner(target : str, start : str, end : str) -> None:\n print(\"-\" * 60)\n print(\"Starting scan on ports {0} - {1} target: {2}\".format(start, end, target))\n print(\"Time started: {}\".format(datet...
[ { "docid": "c96c0c7aedac0dc614e89712f21ebfb4", "score": "0.7727753", "text": "def print_banner():\n print_green(\"///////////////////\")\n print_green(\"// s l y t h e r //\")\n print_green(\"///////////////////\")", "title": "" }, { "docid": "7250930078f091c89fd13e83115bc528", ...
8d3afb91c26db22102b0a220ca2c055d
build the content for one option
[ { "docid": "936c529a999bf1e3861633927b45549e", "score": "0.7659812", "text": "def _build_option_content(self):\n return Step(\n name=\"option_content\",\n tipe=\"content\",\n value=self._config,\n index=self.steps.current.index,\n )", "title"...
[ { "docid": "ad66492fca0c1c1d8d521f00ee802da2", "score": "0.6674333", "text": "def _create_content(self, options):\n sizer = wx.BoxSizer(wx.VERTICAL)\n self.SetSizer(sizer)\n\n for opt in options:\n\n if opt.get_type() == \"bool\":\n self.__add_bool(opt.get_...
b3e7fb4c0bec180d6cc29cd90e15c3af
picks player to go first
[ { "docid": "ba5e66c73444f077c9a555f95d974d94", "score": "0.7084739", "text": "def pick_player():\n \n number = random.randint(0, 1)\n\n if number == 0:\n return 'Player 1'\n else:\n return 'Player 2'", "title": "" } ]
[ { "docid": "743fd69dc486d9851a5f7b2a45df898d", "score": "0.8099728", "text": "def choose_first_player(self):\n self.turn = random.choice([self.player1, self.cpu]) \n self.first_player = self.turn", "title": "" }, { "docid": "76ef58f5bee4e05fd4c01a9dfb2e66a6", "score": "0.80...
7cf2e49eae0d6e3fa469ffd16542de71
Test read 4 series in 6 pages.
[ { "docid": "fda7fba2af675a3944dd133dc5af19ff", "score": "0.5077106", "text": "def test_read_generic_series():\n fname = public_file('tifffile/generic_series.tif')\n with TiffFile(fname) as tif:\n assert tif.byteorder == '<'\n assert len(tif.pages) == 6\n assert len(tif.series)...
[ { "docid": "1dc788c32847d7e6de2a26a47e6ac0a4", "score": "0.61458886", "text": "def test_get_page_size_12_page17(self):\n response = self.client.get(self.url + \"?page_size=12&page=6\")\n self.assertEqual(len(response.data[\"results\"]), 3)", "title": "" }, { "docid": "2780c1bda...
29d68b084388e0271e4254f03d17719b
Called on game end.
[ { "docid": "6c52813fb82e4da6560c338a205bca95", "score": "0.9067296", "text": "def on_game_end(self) -> None:", "title": "" } ]
[ { "docid": "1d3c2859a1ecc59bc02ef9fdf50581c7", "score": "0.84280807", "text": "def hook_end_of_game(self, game, player):", "title": "" }, { "docid": "0439697e16f72cf8fc8dbcc339bd1bfd", "score": "0.8149644", "text": "async def end_game(self):", "title": "" }, { "docid": "8...
406e848dba14958e11fbeac4d1148241
Checks that `true_negative_rate` calculates the right quantity.
[ { "docid": "9a1893e4df5308175962382670e3d5c8", "score": "0.7326625", "text": "def test_true_negative_rate(self):\n # For the penalty, the default loss is hinge.\n expected_penalty_numerator = np.sum(\n np.maximum(0.0, 1.0 - self._penalty_predictions) *\n (self._penalty_labels <= 0.0)...
[ { "docid": "0dc92908a3c6787e6ea8d9b75225f569", "score": "0.7055266", "text": "def test_false_negative_rate(self):\n # For the penalty, the default loss is hinge.\n expected_penalty_numerator = np.sum(\n np.maximum(\n 0.0, 1.0 - self._penalty_predictions) * (self._penalty_labels >...
c0d84acff8b3c57d9ac6f26fd8edc728
Add an ECDF confidence interval to a plot. This method of computing a confidence interval can be thought of as computing confidence intervals of the inverse ECDF in the sense that we compute a confidence interval for the xvalues for each of the discrete values of the ECDF. This is equivalent to computing bootstrap conf...
[ { "docid": "a218626aeed8ffd9717c12b0ff268c93", "score": "0.6035395", "text": "def _ecdf_conf_int(\n p,\n data,\n complementary=False,\n q_axis=\"x\",\n n_bs_reps=1000,\n ptiles=[2.5, 97.5],\n **kwargs,\n):\n data = utils._convert_data(data)\n\n bs_reps = np.array(\n [np...
[ { "docid": "3d6ee8375a96da8e4774c9274ea54b55", "score": "0.6659887", "text": "def display_confidence_interval_of_two_independant_eer(roc1, roc2, alpha):\n\n base, lower, upper, e = confidence_interval_of_two_independant_eer(roc1, roc2, alpha)\n plt.figure()\n plt.hist(e)\n n, bins, patches =...
1878690f3a2e767f1c480802400d82f0
Decorator for Flask API routes that configures a structlog logging context. This decorator also logs the entry and exit from the route.
[ { "docid": "2d832e7e5483354d907c2b610640ffa1", "score": "0.7450892", "text": "def log_route(f):\n @wraps(f)\n def decorated_function(*args, **kwargs):\n # new() creates a new logging context\n logger = get_logger(\"ltddasher\").new()\n # bind information about request that app...
[ { "docid": "95d41ca0a128e51527551a1736829200", "score": "0.58519137", "text": "def register_logging(app):\n\n class RequestFormatter(logging.Formatter):\n\n def format(self, record):\n record.url = request.url\n record.remote_addr = request.remote_addr\n return...
8189ff5ceb326cc763f8574719002d01
Iterate over the jobs.
[ { "docid": "37989d955fd11cd99c46db115f2a7726", "score": "0.8211515", "text": "def __iter__(self):\n for j in self.jobs:\n yield j", "title": "" } ]
[ { "docid": "f7e47df71a6a35e785ddba578270c9a4", "score": "0.809505", "text": "def jobs(self):\n for job in self._jobs:\n yield job", "title": "" }, { "docid": "407993a0dcab8166e87568ddc55eb712", "score": "0.739263", "text": "def _all_jobs(self):\n for child in sel...
d080f5aec8528d6068e0df21d0371990
Get the shaker's target speed in RPM, if set.
[ { "docid": "d925a35697aceb752043a937dbef162f", "score": "0.73180777", "text": "def get_target_speed(self) -> Optional[int]:\n return self._sync_module_hardware.target_speed # type: ignore[no-any-return]", "title": "" } ]
[ { "docid": "70e56cf43a1248fb1d17dec37a3a5e8b", "score": "0.68449944", "text": "def get_speed(self):\n return self.speed", "title": "" }, { "docid": "1ea5984678f409270b4204aef0be6c84", "score": "0.67140687", "text": "def get_speed(self):\r\n return self._speed", "tit...
b28f5773fdb4318bcc9e943c8a126dd8
Returns dictonary that maps each word to its letter code words list of words return dictonary
[ { "docid": "8d885fb8271e024d34facbf930cbf6d0", "score": "0.8214427", "text": "def map_of_codes(words):\n\tmap_of_codes = dict()\n\tcodes = []\n\tfor word in words:\n\t\tmap_of_codes[word] = letter_code(word)\n\treturn map_of_codes", "title": "" } ]
[ { "docid": "5f97c1f59df0a248e91209194694929d", "score": "0.7414668", "text": "def make_word_dict(wordlist):\n alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n word_dict = dict()\n for word in wordlist:\n word_dict.setdefault(word[0].upper(), []).append(word.upper())\n return word_dict", ...
bf6eda80eb6f20a7499caa7bc94fa3d0
Parse and return input rangefile as dict
[ { "docid": "6a631f5147d3d486373264ba1b05b358", "score": "0.7883238", "text": "def _parsefile(self, rngpath: str) -> dict:\n\n # TODO check it's a rng file (avoid utf-8 encoding errors)\n try:\n with open(rngpath, 'r') as file:\n r = [v.split() for v in file]\n ...
[ { "docid": "d10c6e0f8acb3aa42547aa3663edd755", "score": "0.6517698", "text": "def _parse_input_file(input_file):\n input_dict = dict()\n logger = logging.getLogger(__name__)\n\n try:\n f = open(input_file, \"r\")\n for line in f:\n # Ignore comments in input file!\n ...
b258891e1e264a29c11ff6d0fcfa079b
Create an HDFS paths to look at from provided main hdfs dir and provided time range list.
[ { "docid": "9b30c587ff7b852baa427ddc269af5c9", "score": "0.7487591", "text": "def make_hdfs_path(hdir, trange):\n return ['%s/%s' % (hdir, d) for d in range_dates(trange)]", "title": "" } ]
[ { "docid": "75d211320736d6cda3ae25d0d0e34509", "score": "0.6589645", "text": "def test_hdfs_paths ():\n \"\"\"\n hdfs = PyWebHdfsClient(host='localhost',port='50070', user_name='hdfs')\n hdfs.make_dir(\"inbound/bloomberg\") \n hdfs.make_dir(\"inbound/bloomberg/ohlcv\")\n hdfs.make_dir(...
2fdd7fa013ed09db82187224e9f0dfd7
Cleans the string from problematic chars
[ { "docid": "70329abdd6d6f66c0d1ffdf75eb2ffab", "score": "0.0", "text": "def replace_char(text):\n\n for ch in ['/', '`', '*', '{', '}', '[', ']', '(', ')', '#', '+', '-', '.', '!', '\\$', ':', '|']:\n text = text.replace(ch, \"_\")\n return text", "title": "" } ]
[ { "docid": "8c6de6119fd3932290e8db0f3495cf46", "score": "0.7372472", "text": "def Clean(s):\n for c in BAD_CHARACTERS:\n s = s.replace(c, '_')\n return s", "title": "" }, { "docid": "a71c91b0a137d047cb307a2063bea342", "score": "0.7360314", "text": "def clean_string(s):\n c = ...
2f40207c805b23dcf4c5f28e87c60024
Retrun this object's __task_name
[ { "docid": "c734aab3ea8671bfaac122fc4477f21f", "score": "0.9185114", "text": "def task_name(self) -> str:\n return self.__task_name", "title": "" } ]
[ { "docid": "429f8ece8d00bee28363560ebd509627", "score": "0.93508923", "text": "def task_name(self):\n return self._task_name", "title": "" }, { "docid": "633258a65ced3a28d4a6a4094dcccf55", "score": "0.91086996", "text": "def task_name(self):\n return function_or_class_name(...
7f034481e85837eda6d8b7bd7bd789bb
r""" Resets the various data arrays on the object back to their original state. This is useful for repeating a simulation at different inlet conditions, or invasion points for instance.
[ { "docid": "2193e11289f06efaf8f3a5957103b8c2", "score": "0.6870243", "text": "def reset(self):\n self[\"pore.invasion_pressure\"] = np.inf\n self[\"throat.invasion_pressure\"] = np.inf\n self[\"pore.invasion_sequence\"] = -1\n self[\"throat.invasion_sequence\"] = -1\n ...
[ { "docid": "f0eddd2f77ea202d0c6aaaef3004d993", "score": "0.7440329", "text": "def reset(self):\n self.set_t(0.0)\n self.m = 0\n self.n = 0\n self.o = 0\n self.resize_arrays()\n self.clear_ijv()\n self.clear_ts()", "title": "" }, { "docid": "63...
1f541f95fbd8bd940dea6d66b7fb9ccc
Retrieve a list of all categories.
[ { "docid": "e3e9bd171ad02482f1c9fb8c3af4bed6", "score": "0.0", "text": "def get_category() -> jsonify:\n\tcategories = []\n\tcategory_results = db.session.query(IncidentCategory).all()\n\tfor category in category_results:\n\t\tnew_category = {}\n\t\tnew_category['id'] = category.id\n\t\tnew_category['na...
[ { "docid": "07b4db07f5ded899901b6122913b1154", "score": "0.8321011", "text": "def get_all_categories():\n categories_dict = get_categories_dict_db()\n return jsonify(categories_dict)", "title": "" }, { "docid": "d1e978a0dd31186c3637d6d570a03874", "score": "0.82590973", "text": ...
45ce4a07d98b6c6a05f38ced74b4eb0c
The number of successful requests the account has performed.
[ { "docid": "6b0c1d7f270bf6b56f0725f0ccc3c186", "score": "0.62084264", "text": "def successful_api_calls(self):\n return self._successful_api_calls", "title": "" } ]
[ { "docid": "496d049346c0727358a4441acc8cb687", "score": "0.7959406", "text": "def successfulCount(self) -> int:", "title": "" }, { "docid": "2521faaba0023070a9f908979978721e", "score": "0.69510853", "text": "def nreturned(self):\n if not self._counters_calculated:\n ...
8f03b306abc58c21ce7eb710ad1a723f
Define observation groups for a given table of bins. Define one group for each possible combination of the observation group axis bins, defined as rows in the input table.
[ { "docid": "58d54a7800624b4b26151f929e05d855", "score": "0.7689213", "text": "def define_groups(self, table):\n if len(self.obs_groups_table.columns) is not 0:\n raise RuntimeError(\n \"Catched attempt to overwrite existing obs groups table.\")\n\n # define number...
[ { "docid": "479a74bfcb57297f06609ec038a52285", "score": "0.73450506", "text": "def group_observation_table(self, obs_table):\n if 'GROUP_ID' in obs_table.colnames:\n raise KeyError(\n \"Catched attempt to overwrite existing grouping in the table.\")\n\n # read the...
5200f887684da296076c157cf535b32d
create a new game play for the player
[ { "docid": "468cfde9f3d6990ec2b206b070a01e69", "score": "0.70035684", "text": "def make_a_play(self, new_play):\n self.plays.append(new_play)", "title": "" } ]
[ { "docid": "cee521afb114678b3670112c326212d2", "score": "0.77359706", "text": "def newGame():\r\n # click on Play\r\n pyautogui.click(PLAY_COORDS, duration=0.25)\r\n logging.debug('New game...')", "title": "" }, { "docid": "73e3ac0ca67deb029ff26e2e9573bb94", "score": "0.7456077"...
ae80bc40a3c04877f91ff122bd1b76ea
Returns a dictionary of cluster groups, containg the users in each group.
[ { "docid": "21e6d049f8a77f5287b79678d4323ba1", "score": "0.6638795", "text": "def get_cluster_groups(\n ocm_api: OCMBaseClient, cluster_id: str\n) -> dict[OCMClusterGroupId, OCMClusterGroup]:\n cluster_groups: dict[OCMClusterGroupId, OCMClusterGroup] = {}\n for group_dict in ocm_api.get_paginat...
[ { "docid": "239f4d1489db15274ec8efcb1994e027", "score": "0.7212028", "text": "def list_groups(self):\n return self.session.query(schema.ClusterGroup).all()", "title": "" }, { "docid": "c8d4adec92e4fc81ecacf195a047e5eb", "score": "0.69516546", "text": "def get_cluster_groups(gr...
14ce7b744e56af6e0a63445334f0e67e
Internal method to get values of time series values in spring. Part of year aggregator function for gvg method.
[ { "docid": "792bab097e456deb76234d4b9407e6d3", "score": "0.0", "text": "def _get_spring(series: Series, min_n_meas: int) -> float:\n inspring = _in_spring(series)\n if inspring.sum() < min_n_meas:\n return Series(nan)\n else:\n return series.loc[inspring]", "title": "" } ]
[ { "docid": "78faf76c1525b9844ca51e96fbc8b9ac", "score": "0.59957784", "text": "def feb29(ts, dim='doy'):\n #return (ts.where(ts.doy.isin([59,60,61]),drop=True).mean(dim=dim).values)\n return (ts.where(ts.doy.isin([59,61]),drop=True).mean(dim=dim).values)", "title": "" }, { "docid": "ea...
597931493f291bce8f94e74758017c86
Apply rankbased thresholding on given matrix. In RCut (also known as `kperdoc`), only `rank` best topics are assigned to each document.
[ { "docid": "1f5e53d86b0f5f3524cee7273be71aeb", "score": "0.5806677", "text": "def r_cut(y, rank=3):\n y = np.array(y)\n y_pred = np.zeros(y.shape, dtype=bool)\n for i, row in enumerate(y):\n max_js = row.argsort()[-rank:][::-1]\n for j in max_js:\n y_pred[i, j] = True\n...
[ { "docid": "e91e6f4e70eb1b78646730d67fa0b6ab", "score": "0.61783934", "text": "def rankify(mat, size=11):\n return generic_filter(mat, rankkern, size=(\n size, size), mode='constant', cval=-1)", "title": "" }, { "docid": "0fad1c1f3d96675b4d2e7da640495382", "score": "0.5966574",...
52af6ff21b973aa2cd9c9089aed1f599
Save a dataset in a way that it's readable by load_dataset.
[ { "docid": "ae1e677c9c29db4870dce2133ad9eba1", "score": "0.0", "text": "def save_dataset(filename, theta_vector, amp_dataset, ph_dataset, x_grid):\n\tto_save = np.concatenate((theta_vector, amp_dataset, ph_dataset), axis = 1)\n\ttemp_x_grid = np.zeros((1,to_save.shape[1]))\n\tK = int((to_save.shape[1]-3...
[ { "docid": "e208299ef2e05512fa69fd21543ef0cf", "score": "0.7637095", "text": "def _save_dataset(self):\n dataset = datastore.Resource.new(\n self.dataset_name,\n self._dataset_files,\n self._meta_data)\n repo = self.data_repo()\n repo.save(dataset, o...
00c417c15b524e968fdfa3a8835f51cd
Updates the config with data from the cache
[ { "docid": "513e60e2aad3bfe65b8444e2c411f1ae", "score": "0.7814324", "text": "async def update(self, data=None):\n if data is not None:\n self.cache.update(data)\n await self.api.update_config(self.cache)", "title": "" } ]
[ { "docid": "a75a38ce910e27ffeae5c022e27e18c4", "score": "0.786449", "text": "def update_cache(self):\n pass", "title": "" }, { "docid": "d29532092cd1e14fedd9af2eb790a4c7", "score": "0.7683715", "text": "async def update(self):\n await self.bot.api.update_config(self.fil...
95d80d6dfef902c68f1348978cb4d026
Read stock data (adjusted close) for given symbols from CSV files.
[ { "docid": "85cde913e57d414b2527d791f792b1de", "score": "0.6046349", "text": "def get_data(symbols, dates):\r\n df = pd.DataFrame(index=dates)\r\n for symbol in symbols:\r\n df_temp = pd.read_csv(symbol_to_path(symbol), index_col='Date',\r\n parse_dates=True, usecols=['Date',...
[ { "docid": "a8d8645fcc925ecee2412ed9a3db1768", "score": "0.7471986", "text": "def _open_csv(self):\n combined_index = None\n for symbol in self.symbol_list:\n path = self.csv_path + '/{}.csv'.format(symbol)\n self.symbol_data[symbol] = pd.read_csv(\n pa...
a5717931205c99dbc7e5b99b793f36a7
Ova funkcija je poopcenje funkcije operator_kanbaza. Ona daje matricni prikaz linearnog operatora f u paru baza (bazaD2,bazaK2) ako je on zadan u paru baza (bazaD1,bazaK1). Ako bazaK1 nije eksplicitno navedena, podrazumijeva se da je bazaK1=bazaD1. Ako bazaK2 nije eksplicitno navedena, podrazumijeva se da je bazaK2=baz...
[ { "docid": "11a9ac321f1d945453fabe1b8393c2b6", "score": "0.7151839", "text": "def operator_baza(f,bazaD1,bazaD2,bazaK1=None,bazaK2=None,klasa='sympy'): \n if isfunction(f):\n #operator f je zadan formulom\n M = operator_kan(f,klasa)\n else:\n #operator f je zadan matricom ...
[ { "docid": "af7549cc5d18b9cf9d56a081cd3520b8", "score": "0.7329589", "text": "def operator_kanbaza(f,baza1,baza2=None,klasa='sympy'): \n if isfunction(f):\n #operator f je zadan formulom\n M = operator_kan(f,klasa)\n else:\n #operator f je zadan matricom u paru kanonskih baza\...
a2ba58efdc9e91c122fb0243afe6f507
Extract the course descriptions from the document. Write them to the appropriate Course records in the database.
[ { "docid": "ba84b03c2eca5d2d3c535e6f92301885", "score": "0.75976646", "text": "def ExtractCourseDescriptions(document: Document, courses: List[Course]) -> None:\n\n courseDescriptionOn = False\n allparagraphs = []\n pertinentParagraphs = []\n number = 0\n pHeader = \"\"\n hIsCourseTitl...
[ { "docid": "3c0601b75ff7eab4168a97065371a8bf", "score": "0.7158249", "text": "def ExtractCourseAndDescription(firebase: firebase, document: Document, knowledgeAreas: List[KnowledgeArea], courses: List[Course], catalogId: str) -> None:\n\n global currentKnowledgeArea\n\n knowledgeAreaId = \"\"\n ...
10be4055dc44747101cc3d0847c103b0
This is the main method of the tool.
[ { "docid": "5987afff833f5856b1bc716afc9b2e8a", "score": "0.0", "text": "def main(self):\n if not os.path.isfile(os.path.join(self.project_directory, \"make_project.json\")):\n print(f\"Generating CProject in {self.project_directory}...\")\n self.normami(\"ami-makeproject\", ...
[ { "docid": "ec021328057f10f8af523fff413bbe9a", "score": "0.8747809", "text": "def main ():", "title": "" }, { "docid": "ec021328057f10f8af523fff413bbe9a", "score": "0.8747809", "text": "def main ():", "title": "" }, { "docid": "1d4484b0529dbe0541b241834cb12a3e", "scor...
c7cafb5f4313d1b5fa9cdfd206771bee
Binary must wrap a string type
[ { "docid": "9ed9bd995a217fb464f9ddab65e1e4cd", "score": "0.7420099", "text": "def test_binary_force_string(self):\n with self.assertRaises(TypeError):\n Binary(2)", "title": "" } ]
[ { "docid": "eea0267dc26b875303145a2447b0192b", "score": "0.72017926", "text": "def isbinary(s, params, ui, **kwargs):\n return s", "title": "" }, { "docid": "5242fe89c082c090012e14c26675050c", "score": "0.7061668", "text": "def test_binary_converts_unicode(self):\n b = Bina...
1b26a7e2470731048736735d41e820ca
centers the window to the screen
[ { "docid": "6622fe436845f7b3986af42688cfc35c", "score": "0.8327689", "text": "def _center_window(self):\r\n screen = QtGui.QDesktopWidget().screenGeometry()\r\n size = self.geometry()\r\n self.move(\r\n (screen.width() - size.width()) * 0.5,\r\n (screen.height(...
[ { "docid": "0470869de0fe4c2dc345e28a653fcd8f", "score": "0.8163197", "text": "def center(self,win):\n win.update_idletasks()\n width = win.winfo_width()\n frm_width = win.winfo_rootx() - win.winfo_x()\n win_width = width + 2 * frm_width\n height = win.winfo_height()\n ...
495cf48c5e18e12b7bfaf87cc50f1428
Wisdom AI engine. This extracts insights from documents and returns key points, abstracts, wordclouds and PDF viewer if possible.
[ { "docid": "932e0ca123feee64a87a4865f30a383f", "score": "0.5761071", "text": "def wisdom(search_me, source, pdfurl, userid):\n ### source needs to be name of data source (\"arxiv\", \"google scholar\", \"doaj\")\n search_me = search_me.strip()\n # check if pdfurl has been found before\n pdf ...
[ { "docid": "d04f78c317274e362e0222600c00b016", "score": "0.5694965", "text": "def main():\n logging.basicConfig(level=logging.DEBUG)\n custom_embedding = True\n\n # Download embeddings'\n if custom_embedding:\n embedding_path = '../data/custom_embedding.pkl'\n embedding_index_p...
8e011d0b414fc36e0eedeb9448e99c0d
returns a dict with some joint info
[ { "docid": "8972d83bad2dffd5c842b188e5eca22d", "score": "0.7336723", "text": "def _get_joint_info(self, body_id, joint_id):\n # todo: make joint_info a class so we don't have to memorise the keys\n info = self._p.getJointInfo(body_id, joint_id)\n joint_info = {\n 'id': in...
[ { "docid": "d062645d5feee624eb9b8bbb5e39aa28", "score": "0.7694279", "text": "def joint_dict(self):\n self.check_joint_names()\n return dict(zip(self.joint_names, self.joint_values))", "title": "" }, { "docid": "711b5a3870f4e152646742d8714a6112", "score": "0.6767711", "...
5d53dc63cf45f2b3db50f8910018ee32
Initialize with the column names (in a XiboEvent tuple) use in Xibo JSON responses.
[ { "docid": "4b51f78cbba9b28efcdfefb61709a950", "score": "0.58089435", "text": "def __init__(self, column_names):\n self.column_names = column_names", "title": "" } ]
[ { "docid": "b91406418d4f7587da0fc1f8a3998de4", "score": "0.5988165", "text": "def json_to_xibo_event(self, json_event):\n return XiboEvent(\n xibo_id=json_event[self.column_names.xibo_id],\n meetup_id=json_event[self.column_names.meetup_id],\n name=json_event[self...
9567da02ab3490901b639507bf63db42
Returns a list of locales found in the "locales" property of the manifest. This will convert locales found in the SHORTER_LANGUAGES setting to their full locale. It will also remove locales not found in AMO_LANGUAGES.
[ { "docid": "b3e587f2da19952e54367eb789e2dd40", "score": "0.6775279", "text": "def get_supported_locales(manifest):\n return sorted(filter(None, map(find_language, set(\n manifest.get('locales', {}).keys()))))", "title": "" } ]
[ { "docid": "c7eeb0b6810a336325fe917618b5dcf9", "score": "0.74035686", "text": "def get_locales(app: Sphinx) -> List[str]:\n # Manually configured list of locales\n sitemap_locales: Optional[List[str]] = app.builder.config.sitemap_locales\n if sitemap_locales:\n # special value to add not...
0514c3e3f00ed75fc520a4e64741f14f
Renders a template from the given template source string with the given context. Template variables will be autoescaped.
[ { "docid": "a770a3bef0b5686c817732c498e625f6", "score": "0.8366585", "text": "def render_template_string(source, **context):\n ctx = _app_ctx_stack.top\n ctx.app.update_template_context(context)\n return _render(ctx.app.jinja_env.from_string(source), context, ctx.app)", "title": "" } ]
[ { "docid": "2591aad30c9c871ce95371d363072d1e", "score": "0.8500779", "text": "def render_template_string(source, **context):\n ctx = stack.top\n lookup = _lookup(ctx.app)\n template = Template(source, lookup=_lookup(ctx.app), **lookup.template_args)\n return _render(template, context, ctx.ap...
6287c1dd2a1e7937b08a68ddf5349771
T.__new__(S, ...) > a new object with type S, a subtype of T
[ { "docid": "4cd774e88eb43b6786dfb6dbd212399c", "score": "0.72122014", "text": "def __new__(S, *more): # real signature unknown; restored from __doc__\r\n pass", "title": "" } ]
[ { "docid": "4fb50b5679d0bc2205d77fa7704c8195", "score": "0.74194497", "text": "def __new__(self,S, ):\n pass", "title": "" }, { "docid": "4fb50b5679d0bc2205d77fa7704c8195", "score": "0.74194497", "text": "def __new__(self,S, ):\n pass", "title": "" }, { "doc...
b5590739bfefe0c7424bd86d5dede73b
returns a connection to mechanical turk.
[ { "docid": "3b946ba33bb556f7b8bda8e254aea043", "score": "0.79187876", "text": "def get_mt_conn(sandbox=settings.SANDBOX):\n if sandbox:\n host=\"mechanicalturk.sandbox.amazonaws.com\"\n else:\n host=\"mechanicalturk.amazonaws.com\"\n\n return connection.MTurkConnection(\n a...
[ { "docid": "56a5a7204653cff73a19f5b0b1ac1780", "score": "0.627893", "text": "def connection():\n return get_connection()", "title": "" }, { "docid": "c29a8ed3dbdcb9193cd9222e6b99893b", "score": "0.6158203", "text": "def _connect(self):\n return httplib.HTTPConnection(se...
9b337da8305531e87506f09a76a8b1cf
Receives a message from the CCM using the configured adapter
[ { "docid": "13b97c92b7ab12f1f249fbb976afc713", "score": "0.73328966", "text": "def receive_message_from_ccm(self) -> str:\n with hw_lock:\n return self.ccm_adapter.receive_message_with_stop_byte()", "title": "" } ]
[ { "docid": "8c6cd8c20e92b52dfd75e49af8253aa7", "score": "0.7003274", "text": "def receive_message(self):\n pass", "title": "" }, { "docid": "586a9036a9863930cd60d2c5f50d037a", "score": "0.6642486", "text": "def rcv_message(self, message):\n pass", "title": "" }, { ...
94d97e50552b686245c4cf9ada41c177
Permission Checking Function to be used as a Dependency for API endpoints. This is used as a helper. This will either return a User object to the calling method if the user meets the authentication requirements, or it will raise a CredentialException and prevent the method that depends on this from continuing.
[ { "docid": "70d2872c3c88f205c82a40f0a7ad2ad2", "score": "0.0", "text": "def current_user_researcher(token: str = Depends(oauth2_scheme)):\n user = get_current_user(token)\n if not any(role in [Roles.admin.name, Roles.researcher.name] for role in user.roles):\n raise CredentialException()\n\...
[ { "docid": "5e224920ce0bc70b58729d9fc529e91d", "score": "0.7034291", "text": "def check_auth(func):\n\n @wraps(func)\n def invoke(self, *args, **kwargs):\n try:\n self.user = self.state.get_user()\n if self.user is None:\n print(\...
814d29215dd48fa3003c1a2a39a7b4ff
Looks up the UID of the resource with the given name.
[ { "docid": "7ccbfb8989ccbd49b774db442cfa0174", "score": "0.8512743", "text": "def resourceUIDForName(self, name):\n uid = self._db_value_for_sql(\"select UID from RESOURCE where NAME = :1\", name)\n\n return uid", "title": "" } ]
[ { "docid": "22c43a1d43961de77cb6605b3291cf35", "score": "0.6511902", "text": "def resource_uid(self) -> Optional[str]:\n return pulumi.get(self, \"resource_uid\")", "title": "" }, { "docid": "bd16aa5bb834eff63cf6559219c3e5ea", "score": "0.65088683", "text": "def _get_uid(self,...
7fedc36119e96a11cbfecfce4483d863
Creates a view that allows ANY logged in user to submit a field trip request but checks to make sure the admin is accepting requests first.
[ { "docid": "d808caee7bdabd7b0bddaebc979f5bd0", "score": "0.66285205", "text": "def create(request):\n admin_option = AdminOption.objects.get()\n if not admin_option.window_open:\n return HttpResponse(\"New field trip requests have been disabled.\")\n\n title = \"Submit a Field Trip Reque...
[ { "docid": "34a30345c20e0a3d5e61f19441df8845", "score": "0.6473721", "text": "def home():\n\n form = TripForm()\n \n if form.validate_on_submit():\n \n if validate_dates(form.start_date_time.data, form.end_date_time.data, form):\n \n return render_template('creat...
99d3bdd659d55dca74810a5a89293664
Write a pd.DataFrame to a google sheets sheet
[ { "docid": "eaa125b9edb84e9ad4fed7d55fc2e99d", "score": "0.63241166", "text": "def write_df(wks, df, row, col):\n\n # header row\n for j, col_name in enumerate(df.columns):\n if 'AOL' in col_name:\n wks.update_cell(row+1, col+j+1, 'AOL')\n wks.update_cell(row+2, col+j+...
[ { "docid": "f2cbcdddc55b0d33b6dba497953238b6", "score": "0.7028948", "text": "def write_google_sheet(results_dict, row=2, name='results_layers', sheet_name='run1'):\n # Google API stuff\n scope = [\"https://www.googleapis.com/auth/drive\"]\n creds = ServiceAccountCredentials.from_json_keyfile_n...
9410c012f0a34a67a772c66287a39474
moves item identified by key to the head of the list
[ { "docid": "82f0a5cf6411760d15775794141626bc", "score": "0.814508", "text": "def movehead(self, key):\n #remove from old position in list\n n = self.d[key]\n n.next.prev = n.prev\n n.prev.next = n.next\n #put in front position of list\n self.l.next.prev = n\n ...
[ { "docid": "67072f43b5e8d065011b2c282e4bfc4b", "score": "0.67528284", "text": "def change_key(self, key, newkey):\n if key in self.list:\n self.list.remove(key)\n self.list.append(newkey)\n self.sort()\n else:\n raise KeyError('No such key')", ...
fe32bdc2e08352e3b214f2ef83cc9a05
Return vector of distances (from vector a to each vector in matrix B).
[ { "docid": "f90a260f3c1a7dec66483c160d36697c", "score": "0.74742806", "text": "def distance(self, a, B):\n return np.linalg.norm(a-B, axis=1, ord=2)", "title": "" } ]
[ { "docid": "b999fcf1356d308e2fae0525e6491457", "score": "0.6998436", "text": "def calculate_distance_list(rA, rB):\n squared_sum = 0\n for dim in range(len(rA)):\n squared_sum += (rA[dim] - rB[dim])**2\n \n distance = np.sqrt(squared_sum)\n return distance", "title": "" }, ...
e3681f8e80d992b6a48d659329f3e97f
@ param query_embedds = (n, d) @ param target_embedds = (n, d) @ param img_ids = (n,)
[ { "docid": "5aac2fbdaeacbcc9c51d58942cf4ec1f", "score": "0.6189335", "text": "def ranking(query_embedds, target_embedds, img_ids):\n\n cos_sim = torch.mm(query_embedds,target_embedds.T)/ \\\n torch.mm(query_embedds.norm(2, dim=1, keepdim=True),\n target_embedds.n...
[ { "docid": "2a0d8c3f6444f00756c4da15a4161f82", "score": "0.6125822", "text": "def get_images(k):\n\n keys = np.linspace(0, 99, 50)\n values = np.random.randn(50, 50)\n image_embeddings = dict(zip(keys, values))\n\n # with open(\"image_embeddings.pickle\", \"rb\") as f:\n # image_embedding...
cf090fe9542868e99484e51b47cd4719
Find the first status matching the given id
[ { "docid": "273f0441220e69f71c097180394e0b39", "score": "0.5996115", "text": "def get_card_status(status_id):\n status = data_manager.execute_select(\n \"\"\"\n SELECT * FROM statuses s\n WHERE s.id = %(status_id)s;\n \"\"\", {\"status_id\": status_id})\n return status"...
[ { "docid": "3f3256587c96740dc1d2b1c1aaffc75b", "score": "0.7008374", "text": "def get_status(self, status_id: StatusID):\n pass", "title": "" }, { "docid": "7c7e39e58fe3e485e0cc9f321a375e01", "score": "0.6748259", "text": "def get_card_status(status_id):\n statuses = persis...
94c53df768d04da17d323d893257f0e7
Testing the building class function.
[ { "docid": "654d6599c56fe9c783f45854ff6d073c", "score": "0.6755711", "text": "def test_building_class():\n # Testing the ruleset for classifying Hazus building class\n res = []\n ref_class = ['WSF', 'WMUH']\n ref = np.ones(2)\n for i in range(2):\n data_dir = os.path.join(cur_dir, ...
[ { "docid": "79785cbd6d603ba51a4083520d3df1f4", "score": "0.7564869", "text": "def test_01_BuildObjects(self):\n pass", "title": "" }, { "docid": "3b0ee69e1abd41003d408ff9161a2153", "score": "0.7322961", "text": "def test_build(self): \n\n Builder(self.app)\...
b9dd9e8181293cb24fa0c3e0b144cff8
Entry point of program
[ { "docid": "7b29257fa5d2d624779dbb9d8e13a809", "score": "0.0", "text": "def main():\n client.run(secrets.TOKEN)", "title": "" } ]
[ { "docid": "1d4484b0529dbe0541b241834cb12a3e", "score": "0.8570562", "text": "def main():\n\t\tpass", "title": "" }, { "docid": "ec021328057f10f8af523fff413bbe9a", "score": "0.8506079", "text": "def main ():", "title": "" }, { "docid": "ec021328057f10f8af523fff413bbe9a", ...