query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Objects which are not equal have different hash.
def testDeleteOpHashDifferent(self): first_entry = entry.BaseLDAPEntry(dn="ou=Team, dc=example,dc=com") second_entry = entry.BaseLDAPEntry(dn="ou=Cowboys, dc=example,dc=com") first = delta.DeleteOp(first_entry) second = delta.DeleteOp(second_entry) self.assertNotEqual(hash(firs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __hash__(self):\n return super().__hash__()", "def __hash__(self):\n return hash(self.hash)", "def __hash__(self):\n return 0", "def __hash__(self):\r\n return hash(tuple(sorted(self.__dict__.items())))", "def __hash__(self):\n return hash(repr(self))", "def __h...
[ "0.7564856", "0.7425919", "0.7301297", "0.72786856", "0.7221085", "0.7221085", "0.7221085", "0.72175765", "0.721317", "0.7194113", "0.7194113", "0.7194113", "0.7194113", "0.71817267", "0.7179601", "0.71660316", "0.71350855", "0.7111713", "0.71104544", "0.70943356", "0.7085317...
0.0
-1
If fail to delete when the RDN does not exists.
def testDeleteOp_DNNotFound(self): root = self.getRoot() sut = delta.DeleteOp("cn=nope,dc=example,dc=com") deferred = sut.patch(root) failure = self.failureResultOf(deferred) self.assertIsInstance(failure.value, ldaperrors.LDAPNoSuchObject)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_non_existing_resource(self):\n CommonTestCases.admin_token_assert_in(\n self,\n delete_assigned_resource_from_non_existing_resource,\n \"Resource does not exist\"\n )", "def test_delete_non_existing(created_test_helper, request):\n # delete all fi...
[ "0.6679839", "0.639518", "0.63135505", "0.62912107", "0.62724584", "0.62544453", "0.62386143", "0.6193215", "0.61845905", "0.6167773", "0.6097933", "0.6097221", "0.6082274", "0.6032078", "0.60291326", "0.6018721", "0.59913737", "0.597406", "0.59729934", "0.59676313", "0.59641...
0.645009
1
Invalid type of DN raises AssertionError
def testDeleteOpInvalidDN(self): self.assertRaises(AssertionError, delta.DeleteOp, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_udp_unknown_rec_type():\n with pytest.raises(SystemExit):\n assert dnsck_query(\"8.8.8.8\", \"google.com\", \"XYZ\", 1)", "def test_invalid_email_domain_input(self):\n email_dom = '*.domain.loc'\n domain = SpokeEmailDomain(self.org_name)\n self.assertRaises(error.InputErro...
[ "0.6102946", "0.60879546", "0.60435635", "0.59925544", "0.59021413", "0.5806988", "0.5777806", "0.5716664", "0.57142717", "0.56849355", "0.5669419", "0.5668466", "0.5655222", "0.5636531", "0.56307924", "0.56252545", "0.56155413", "0.5597194", "0.5589934", "0.5567641", "0.5567...
0.6022595
3
It will return a LDIF representation of the contained operations.
def testAsLDIF(self): sut = delta.ModifyOp( "cn=Paula Jensen, ou=Dev Ops, dc=airius, dc=com", [ delta.Add( "postaladdress", ["123 Anystreet $ Sunnyvale, CA $ 94086"], ), delta.Delete("description"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_operations():", "def operation_list(self):\n return self._operation_list", "def operation_list(self):\n return self._operation_list", "def operation_list(self):\n return self._operation_list", "def operation_list(self):\n return self._operation_list", "def operations(...
[ "0.6598007", "0.6439332", "0.6439332", "0.6439332", "0.6439332", "0.6393982", "0.6393982", "0.6393982", "0.6393982", "0.63889986", "0.6144092", "0.60984135", "0.59286124", "0.57884157", "0.5775359", "0.57272893", "0.57272893", "0.57272893", "0.56695014", "0.5587015", "0.55496...
0.52602476
39
Modify operations for different DN are not equal.
def testInequalityDiffertnDN(self): first = delta.ModifyOp( "cn=john,dc=example,dc=com", [delta.Delete("description")] ) second = delta.ModifyOp( "cn=doe,dc=example,dc=com", [delta.Delete("description")] ) self.assertNotEqual(first, second)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testInequalityDiffertnOperations(self):\n first = delta.ModifyOp(\n \"cn=john,dc=example,dc=com\", [delta.Delete(\"description\")]\n )\n second = delta.ModifyOp(\n \"cn=doe,dc=example,dc=com\", [delta.Delete(\"homeDirectory\")]\n )\n\n self.assertNotEqua...
[ "0.6681576", "0.65745145", "0.65569013", "0.6536842", "0.64830977", "0.6244514", "0.6045619", "0.6024494", "0.5961783", "0.59554327", "0.59079593", "0.58932847", "0.58687186", "0.58522695", "0.5812426", "0.5788335", "0.5754975", "0.57522243", "0.5747672", "0.573616", "0.57223...
0.7554225
0
Modify operations with different modifications are not equal
def testInequalityDifferentModifications(self): first = delta.ModifyOp("cn=john,dc=example,dc=com", [delta.Add("description")]) second = delta.ModifyOp( "cn=john,dc=example,dc=com", [delta.Delete("description")] ) self.assertNotEqual(first, second)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_mutate(self, change: Statement) -> None:\n self.assertThat(\n statement_mutates(change.statement()),\n Equals(True),\n )", "def testInequalityNotModifyOP(self):\n sut = delta.ModifyOp(\"cn=john,dc=example,dc=com\", [delta.Delete(\"description\")])\n\n se...
[ "0.6674253", "0.6627485", "0.63496286", "0.6284287", "0.6184366", "0.61420083", "0.6137223", "0.6102831", "0.6047738", "0.60134405", "0.60112035", "0.6003769", "0.5979842", "0.5949728", "0.59481263", "0.5919961", "0.5910403", "0.59081334", "0.59034055", "0.58968216", "0.58823...
0.742697
0
Modify operations are not equal with other object types.
def testInequalityNotModifyOP(self): sut = delta.ModifyOp("cn=john,dc=example,dc=com", [delta.Delete("description")]) self.assertNotEqual("cn=john,dc=example,dc=com", sut)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\n if not isinstance(other, VmdkDiskModify):\n return True\n\n return self.to_dict() != other.to_dict()", "def test_not_equal_on_not_equal_data_type(self):\n a = objects.OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = objects.OpaqueObject...
[ "0.66701645", "0.6650229", "0.66290677", "0.6574526", "0.65306", "0.6503209", "0.6490417", "0.64533794", "0.6431893", "0.641037", "0.63912207", "0.63811505", "0.6380642", "0.63728714", "0.6324027", "0.6298897", "0.6289167", "0.62679493", "0.626407", "0.62496984", "0.6221644",...
0.64344126
8
Modify operations for same DN but different operations are not equal.
def testInequalityDiffertnOperations(self): first = delta.ModifyOp( "cn=john,dc=example,dc=com", [delta.Delete("description")] ) second = delta.ModifyOp( "cn=doe,dc=example,dc=com", [delta.Delete("homeDirectory")] ) self.assertNotEqual(first, second)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testInequalityDifferentModifications(self):\n first = delta.ModifyOp(\"cn=john,dc=example,dc=com\", [delta.Add(\"description\")])\n\n second = delta.ModifyOp(\n \"cn=john,dc=example,dc=com\", [delta.Delete(\"description\")]\n )\n\n self.assertNotEqual(first, second)", "...
[ "0.6798626", "0.6790039", "0.64913595", "0.6463415", "0.6445248", "0.5919772", "0.59141284", "0.5883514", "0.57962304", "0.57737195", "0.5692895", "0.54507035", "0.54124886", "0.53976315", "0.53965425", "0.5354999", "0.5335473", "0.5258104", "0.5254796", "0.52072364", "0.5206...
0.6480506
3
Modify operations can be hashed and equal objects have the same hash.
def testHashEquality(self): first = delta.ModifyOp( "cn=john,dc=example,dc=com", [delta.Delete("description")] ) second = delta.ModifyOp( "cn=john,dc=example,dc=com", [delta.Delete("description")] ) self.assertEqual(first, second) self.assertEqua...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __hash__(self):\n return hash(self.hash)", "def hash(self):\n raise NotImplementedError() # To be subclassed", "def __hash__(self):\n raise NotImplementedError", "def deep_hash(obj):\n pass", "def __hash__(self):\n return self.to_hash()", "def __hash__(self):\n ...
[ "0.70124847", "0.68387544", "0.68186057", "0.6792331", "0.6755944", "0.67329466", "0.6731514", "0.6717045", "0.6702675", "0.66972065", "0.6625806", "0.6593128", "0.6565008", "0.65592676", "0.65592676", "0.6558719", "0.6538804", "0.6523224", "0.6523224", "0.6523224", "0.650020...
0.63634175
44
Different modify operations have different hash values.
def testHashInequality(self): first = delta.ModifyOp( "cn=john,dc=example,dc=com", [delta.Delete("description")] ) second = delta.ModifyOp( "cn=john,dc=example,dc=com", [delta.Delete("homeDirectory")] ) self.assertNotEqual(first.asLDIF(), second.asLDIF()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __hash__(self):\n return hash(self.hash)", "def __hash__(self):\n return hash(self.base_location) ^ hash(self.fold_path) ^ hash(self.field)", "def hash_functions(self):\n pass", "def testAddOpHashDifferent(self):\n first_entry = entry.BaseLDAPEntry(\n dn=\"ou=Duplic...
[ "0.6373035", "0.62858194", "0.62785876", "0.62437814", "0.623889", "0.6235268", "0.61956877", "0.6182764", "0.6178705", "0.61568016", "0.61372834", "0.6135117", "0.6131941", "0.61267024", "0.61107266", "0.60953116", "0.6083854", "0.6079137", "0.60712725", "0.6070831", "0.6058...
0.5807803
52
If fail to modify when the RDN does not exists.
def testModifyOp_DNNotFound(self): root = self.getRoot() sut = delta.ModifyOp( "cn=nope,dc=example,dc=com", [delta.Add("foo", ["bar"])], ) deferred = sut.patch(root) failure = self.failureResultOf(deferred) self.assertIsInstance(failure.value, ld...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_existing_key_fail(self, data, new_data):\n message = 'exists'\n rv = self.add_success(data)\n assert not in_response(rv, message)\n rv = self.add_success(new_data)\n assert not in_response(rv, message)\n rv = self.update_fail(data, message)\n assert self....
[ "0.5711266", "0.56854874", "0.5597808", "0.5491597", "0.54523", "0.5447621", "0.5374708", "0.5363889", "0.5353114", "0.53295374", "0.5298084", "0.52946264", "0.5289387", "0.5286757", "0.5261818", "0.52331877", "0.5229697", "0.52155083", "0.51857257", "0.5172711", "0.5168168",...
0.64315724
0
Training + test step.
def step(self, epoch): self.train(epoch) self.test(epoch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_training(self):\n\t\tpass", "def train():\n pass", "def train_step(self):\n pass", "def train(self):\n pass", "def train(self):\n pass", "def train(self):\n pass", "def train(self):\n pass", "def train(self):\n pass", "def train():\n # YO...
[ "0.86795723", "0.8360763", "0.83442223", "0.82142705", "0.82142705", "0.82142705", "0.82142705", "0.82142705", "0.8101455", "0.8018498", "0.79888463", "0.7962108", "0.79236984", "0.7896879", "0.7851873", "0.78287673", "0.7817029", "0.78054273", "0.77364445", "0.7735966", "0.7...
0.7733964
20
__init__(self, rawPredictionCol="rawPrediction", labelCol="label", \
def __init__(self, rawPredictionCol="rawPrediction", labelCol="label", metricName="areaUnderROC", metricParams={"recallValue": 0.6}): super(BinaryClassificationEvaluatorWithPrecisionAtRecall.__mro__[1], self).__init__() if (metricName == "areaUnderROC") | (metricName == "areaUnderPR"): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self) :\n self.prediction_ = None", "def __init__(self) :\n self.prediction_ = None", "def __init__(self) :\n self.prediction_ = None", "def __init__(self,prediction, x1, y1, x2, y2):\n self.prediction = prediction\n self.x1 = x1\n ...
[ "0.69210494", "0.69210494", "0.69210494", "0.6434834", "0.64275473", "0.6343054", "0.632467", "0.6190539", "0.61857134", "0.61763215", "0.6134767", "0.60644007", "0.6056159", "0.60437053", "0.5998379", "0.59822845", "0.59767073", "0.59527683", "0.5917565", "0.5898436", "0.587...
0.58776873
20
Calculate the precisionrecall (PR) curve. It's not a public method. Use it only when you understand what you are doing exactly. The PR curve result is similar to that in sklearn and ROCR in R with minor difference. The first precisionrecall pair always takes the value (1,0).
def _cal_pr_curve(self, labelAndVectorisedScores): rawPredictionCol = self.rawPredictionColValue labelCol = self.labelColValue curve = precision_recall_curve(labelAndVectorisedScores, rawPredictionCol, labelCol).select("precision","recall") return curve
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision_recall(y_true, y_prob, ARGS):\n average_precision = average_precision_score(y_true, y_prob)\n if ARGS.graphs:\n precision, recall, _ = precision_recall_curve(y_true, y_prob)\n plt.style.use('ggplot')\n plt.clf()\n plt.plot(recall, precision,\n label='...
[ "0.7959289", "0.77566373", "0.7682807", "0.74131346", "0.73854953", "0.73743725", "0.73437935", "0.7288011", "0.72208554", "0.72071886", "0.718288", "0.7181433", "0.7181433", "0.7180739", "0.7163176", "0.7161011", "0.7159116", "0.70982945", "0.7091552", "0.70432097", "0.70173...
0.8154175
0
Evaluate the performance using a number of metrics, including areaUnderROC, areaUnderPR and precisionAtGivenRecall at different recall values.
def evaluateWithSeveralMetrics(self, dataset, metricSets=None): if metricSets is None: # all metrics metricSets = [{"metricName": "areaUnderROC"}, {"metricName": "areaUnderPR"}, {"metricName": "precisionAtGivenRecall", "metricParams": {"recallValue...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _eval_classifier(self):\n\n y_pred_baseline = self.df_baseline[self.score_column]\n y_pred_sample = self.df_sample[self.score_column]\n\n y_label_baseline = self.df_baseline[self.label_column]\n y_label_sample = self.df_sample[self.label_column]\n\n precision_baseline = preci...
[ "0.68614495", "0.6718771", "0.6693842", "0.6569567", "0.6557199", "0.65358484", "0.6526995", "0.6505559", "0.65005565", "0.64669365", "0.6450622", "0.6445871", "0.6443841", "0.6408051", "0.63957804", "0.6369756", "0.63612455", "0.63544005", "0.63512", "0.633024", "0.63229483"...
0.7196005
0
Gets the value of metricName or its default value.
def getMetricName(self): return self.getOrDefault(self.metricName)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_metric(self, metric_name):\n return getattr(self, metric_name, None)", "def metric_value(self) -> typing.Optional[str]:\n return self._values.get('metric_value')", "def metric_value(self) -> typing.Optional[str]:\n return self._values.get('metric_value')", "def getMetricValue(sel...
[ "0.81234086", "0.797722", "0.797722", "0.7605855", "0.74967813", "0.7449283", "0.74163926", "0.7085162", "0.7085162", "0.70478195", "0.6923538", "0.6923538", "0.6923538", "0.6923538", "0.6923538", "0.6923538", "0.6923538", "0.6923538", "0.6923538", "0.6915573", "0.69003487", ...
0.79294765
4
Gets the value of metricParams or its default value.
def getMetricValue(self): return self.getOrDefault(self.metricParams)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_metric_value(self) -> float:", "def metric_value(self) -> typing.Optional[str]:\n return self._values.get('metric_value')", "def metric_value(self) -> typing.Optional[str]:\n return self._values.get('metric_value')", "def get_metric(self):\n assert self._metric in self._metri...
[ "0.67874414", "0.67644763", "0.67644763", "0.63105017", "0.62489593", "0.60398257", "0.5935273", "0.5876949", "0.5823762", "0.58103245", "0.58067614", "0.5773091", "0.57403225", "0.57252383", "0.5723292", "0.57183594", "0.57183594", "0.5717882", "0.5708103", "0.56951916", "0....
0.8135723
0
setParams(self, rawPredictionCol="rawPrediction", labelCol="label", \ metricName="areaUnderROC") Sets params for binary classification evaluator.
def setParams(self, rawPredictionCol="rawPrediction", labelCol="label", metricName="areaUnderROC", metricParams={"recallValue": 0.6}): tmp = getattr(self, "metricParams", None) if tmp is None: self.metricParams = Param(self, "metricParams", "additional param...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setParams(self, *, predictionCol=\"prediction\", labelCol=\"label\",\n metricName=\"meanAveragePrecision\", k=10):\n kwargs = self._input_kwargs\n return self._set(**kwargs)", "def __init__(self, rawPredictionCol=\"rawPrediction\", labelCol=\"label\",\n metricNa...
[ "0.66631395", "0.65350604", "0.55556506", "0.5203026", "0.5126673", "0.5100271", "0.48111624", "0.47620893", "0.47243646", "0.4686018", "0.46371552", "0.4626044", "0.4589343", "0.45600268", "0.45395043", "0.45305347", "0.45246565", "0.4500843", "0.44883516", "0.44861096", "0....
0.8205035
0
get post published time
def parse_publish_time(ep_info): return ep_info.find('div', {'class': 'l'}).get_text().encode('utf-8')[14:33]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPublishedTime(self): #$NON-NLS-1$\r", "def get_pub_date():\n return datetime.datetime.now()", "def get_published_date(self):\n return self._get_date_or_timestamp('published')", "def published(self):\n xutimes = self.xutimes()\n\n # If there are 2 xutimes, published is the secon...
[ "0.76688", "0.67377037", "0.6678644", "0.65511495", "0.6349361", "0.6302059", "0.6172528", "0.59950393", "0.59340465", "0.588991", "0.5865755", "0.5862706", "0.585491", "0.58395094", "0.58317786", "0.57924294", "0.57924294", "0.57924294", "0.5765555", "0.5765555", "0.5765555"...
0.64970154
4
get contact and location detail
def parse_details(ep_news): # instances that might be able to get from ep_news information = { 'price': None, # 价格: 'area': None, # 地区:* 'address': None, # 地址: 'contact': None, # 联系人: 'telephone': None, # 电话:* 'wechat': None, # 微信: '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact_details(self) -> 'outputs.ContactDetailsResponse':\n return pulumi.get(self, \"contact_details\")", "def contact_details(self) -> 'outputs.ContactDetailsResponse':\n return pulumi.get(self, \"contact_details\")", "def contact_details(self) -> 'outputs.ContactDetailsResponse':\n ...
[ "0.7269883", "0.7269883", "0.7269883", "0.69329244", "0.6759677", "0.6645875", "0.6620822", "0.65785277", "0.65075946", "0.64596516", "0.645059", "0.6439542", "0.6416189", "0.64047223", "0.6347984", "0.6338171", "0.6317102", "0.6266705", "0.6193849", "0.61848843", "0.6155751"...
0.0
-1
Verify that all TEAL operations are allowed in the specified version.
def verifyOpsForVersion(teal: List[TealComponent], version: int): for stmt in teal: if isinstance(stmt, TealOp): op = stmt.getOp() if op.min_version > version: raise TealInputError( "Op not supported in TEAL version {}: {}. Minimum required version...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_supported_features(self):", "def validate_tls_min_version(self, node=None, version=\"1.2\", expect=\"fail\"):\n if node is None:\n node = self.cluster.master\n cmd = self.curl_path + \" -v --tlsv\" + version + \" --tls-max \" + version + \\\n \" -u \" + node....
[ "0.605336", "0.60329", "0.60300153", "0.60155135", "0.5997113", "0.5989051", "0.5982622", "0.5955021", "0.585883", "0.5794829", "0.5772645", "0.5752176", "0.57045716", "0.56767166", "0.5638141", "0.5625682", "0.56105036", "0.5606664", "0.5603677", "0.5598673", "0.55873007", ...
0.7799678
0
Verify that all TEAL operations are allowed in mode.
def verifyOpsForMode(teal: List[TealComponent], mode: Mode): for stmt in teal: if isinstance(stmt, TealOp): op = stmt.getOp() if not op.mode & mode: raise TealInputError( "Op not supported in {} mode: {}".format(mode.name, op) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_mode(mode: str) -> bool:\n return mode in (TEST, EASY, HARD)", "def check_enable_mode(self, *args, **kwargs):\n pass", "def check_supported_features(self):", "def test_support_MODES(self):\n self._testIntOrDefaultFeature(\"MODES\")", "def validate(self, mode): # pragma: no co...
[ "0.6500566", "0.6143098", "0.60593975", "0.6029194", "0.5904798", "0.5900099", "0.58975023", "0.5871597", "0.5865913", "0.57844806", "0.57491904", "0.5658872", "0.5654506", "0.56218165", "0.55978805", "0.55922246", "0.55898875", "0.5581408", "0.5576764", "0.5552772", "0.55508...
0.76222074
0
Compile a PyTeal expression into TEAL assembly.
def compileTeal( ast: Expr, mode: Mode, *, version: int = DEFAULT_TEAL_VERSION, assembleConstants: bool = False, ) -> str: if ( not (MIN_TEAL_VERSION <= version <= MAX_TEAL_VERSION) or type(version) is not int ): raise TealInputError( "Unsupported TEAL ver...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile(expression):", "def compile(expression: str) -> Compiled:\r\n e = Compiled(expression)\r\n e.tokenize()\r\n return e", "def translate(expr):\n return from_python(ast.parse(expr))", "def compile_expression(self):\n\t\t\n\t\tself.outfile.write('<expression>\\n')\n\t\tself.compile_term()...
[ "0.6607673", "0.61874115", "0.60439116", "0.6028703", "0.5831331", "0.5777732", "0.576733", "0.569624", "0.5684834", "0.5669194", "0.5646223", "0.56038624", "0.5554042", "0.553608", "0.553608", "0.553608", "0.5497846", "0.54754347", "0.5434601", "0.53916115", "0.53916115", ...
0.641567
1
returns a table instance suitable for holding data described by tableDef. This is the main interface to table instancation. suppressIndex=True can be used to suppress index generation on inmemory tables with primary keys. Use it when you are sure you will not need the index (e.g., if staging an ondisk table). See getPa...
def TableForDef(tableDef, suppressIndex=False, parseOptions=common.parseNonValidating, **kwargs): if isinstance(tableDef, rscdef.SimpleView): tableDef = tableDef.getTableDef() if tableDef.onDisk: if tableDef.viewStatement: cls = dbtable.View else: cls = dbtable.DBTable return cls(tableDef, suppressIn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_table(self, **kwargs):\r\n options = {}\r\n table_class = self.get_table_class()\r\n table = table_class(self.get_table_data(), **kwargs)\r\n paginate = self.get_table_pagination() # pylint: disable=E1102\r\n if paginate is not None:\r\n options['paginate'] = ...
[ "0.6120025", "0.5961077", "0.5945433", "0.5808422", "0.5798979", "0.5774817", "0.5764215", "0.57284814", "0.5645541", "0.5642013", "0.55859804", "0.5583069", "0.5562619", "0.5546648", "0.5538228", "0.5529514", "0.5458134", "0.5414584", "0.54040205", "0.5359194", "0.5352598", ...
0.83285594
0
returns a table from resultTableDef containing the results for a query for fragment and pars in queriedTable. resultTableDef must be a TableDef with svc.OutputField columns (which you can easily generate from columns using svc.OutputTableDef.fromColumns) queriedTable must be a DBTable instance. The other arguments are ...
def makeTableForQuery(queriedTable, resultTableDef, fragment, pars, distinct=False, limits=None, suppressIndex=True, connection=None): return TableForDef(resultTableDef, suppressIndex=suppressIndex, connection=connection, rows=[r for r in queriedTable.iterQuery(resultTableDef, fragment, pars, distinct, lim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _makeResultTableDef(self, service, inputTable, queryMeta):\n\t\treturn base.makeStruct(outputdef.OutputTableDef,\n\t\t\tparent_=self.queriedTable.parent, id=\"result\",\n\t\t\tonDisk=False, columns=self.getQueryCols(service, queryMeta),\n\t\t\tparams=self.queriedTable.params)", "def _makeTable(self, rowIter,...
[ "0.6903858", "0.6107269", "0.6102175", "0.5799797", "0.57989585", "0.5455938", "0.5440752", "0.5417696", "0.54101384", "0.5348835", "0.52263045", "0.5221324", "0.5219741", "0.5193257", "0.51673913", "0.51188475", "0.51160085", "0.50599", "0.50572443", "0.50319016", "0.5026560...
0.757694
0
returns a table for tableDef, taking raw rows from iterator and using a defaultNone rowmaker.
def makeTableFromRows(tableDef, iterator): t = TableForDef(tableDef) rmk = rscdef.RowmakerDef.makeTransparentFromTable(tableDef ).compileForTableDef(tableDef) for row in iterator: t.addRow(rmk(row, t)) return t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _makeTable(self, rowIter, resultTableDef, queryMeta):\n\t\trows = list(rowIter)\n\t\tisOverflowed = len(rows)>queryMeta.get(\"dbLimit\", 1e10)\n\t\tif isOverflowed:\n\t\t\tdel rows[-1]\n\t\tqueryMeta[\"Matched\"] = len(rows)\n\t\tres = rsc.TableForDef(resultTableDef, rows=rows)\n\t\tif isOverflowed:\n\t\t\tqu...
[ "0.70325714", "0.6607077", "0.6408103", "0.6369529", "0.6331045", "0.6286862", "0.62021285", "0.6153239", "0.60818386", "0.6070199", "0.6062928", "0.60610604", "0.6008984", "0.5969291", "0.5960584", "0.59414375", "0.59244776", "0.59010464", "0.5898795", "0.5890541", "0.584980...
0.809845
0
Take file path as string; return text as string. Takes a string that is a file path, opens the file, and turns the file's contents as one string of text.
def open_and_read_file(file_path): # your code goes here text_file = open(file_path) text_string= text_file.read() text_file.close() return text_string
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_and_read_file(file_path):\n\n text_file = open(file_path)\n full_text = text_file.read()\n\n return full_text", "def openFile(filepath):\n assert checkExistenceFile(filepath), \"filepath does not exist\"\n with open(filepath, \"r\", encoding=\"utf-8\") as f:\n text = \" \".join(map...
[ "0.80470866", "0.8014033", "0.7990872", "0.7920758", "0.786444", "0.7798141", "0.7678207", "0.76581025", "0.76132697", "0.76079136", "0.7569296", "0.7539552", "0.75283855", "0.75040907", "0.7503145", "0.7498271", "0.7412663", "0.73693025", "0.7360746", "0.7329229", "0.72927",...
0.80692214
0
Take input text as string; return dictionary of Markov chains. A chain will be a key that consists of a tuple of (word1, word2) and the value would be a list of the word(s) that follow those two words in the input text.
def make_chains(text_string): chains = {} n = 2 # n = int(raw_input("Enter the number of ngrams you want? >")) # your code goes here words = text_string.split() for i in range(len(words) - 1): ngram = tuple(words[i: i + n]) if i >= len(words) - n: chains[ngram] = Non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_chains(text_string):\n\n chains = {}\n #create an empty dictionary\n words = text_string.split()\n #make text into string and then splitting it\n \n for i in range(len(words)-2):\n #for every word in string except for last two words\n bi_gram = (words[i], words[i + 1])\n ...
[ "0.7840543", "0.78154624", "0.7713415", "0.7712986", "0.76834387", "0.761076", "0.7523042", "0.74511385", "0.7411473", "0.73400015", "0.7228308", "0.714769", "0.7137265", "0.7104048", "0.706657", "0.7028261", "0.6979907", "0.6967344", "0.6962526", "0.6946249", "0.6859069", ...
0.7030246
15
Return text from chains.
def make_text(chains, n): words = [] capital_keys = [key for key in chains.keys() if key[0][0].isupper() and chains[key] != None] first_key = choice(capital_keys) words.extend(list(first_key)) rand_value = choice(chains[first_key]) words.append(rand_value) current_string = " ".join(words...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_text(chains):\n key = choice(list(chains.keys()))\n\n words = []\n\n while key in chains:\n word = get_new_word(key, chains)\n words.append(word)\n key = get_new_key(key, word)\n\n return \" \".join(words)", "def make_text(chains):\n\n # your code goes here\n n_gra...
[ "0.6876859", "0.6833934", "0.66362095", "0.65267885", "0.64033717", "0.64020866", "0.6392574", "0.6373365", "0.63158154", "0.6237213", "0.61482704", "0.6144094", "0.61204606", "0.61166", "0.61025923", "0.608136", "0.60543156", "0.605091", "0.6044553", "0.6030785", "0.59899336...
0.5927299
23
chops string at punctuation and has 140 char limit
def chops_string(current_string): if len(current_string) > 140: chopped_string = current_string[:140] else: chopped_string = current_string for i in range(len(chopped_string) - 1, 0, -1): if chopped_string[i] in ".?": new_chopped_string = chopped_string[:i + 1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ChopText(dc, text, max_size):\r\n \r\n # first check if the text fits with no problems\r\n x, y, dummy = dc.GetMultiLineTextExtent(text)\r\n \r\n if x <= max_size:\r\n return text\r\n\r\n textLen = len(text)\r\n last_good_length = 0\r\n \r\n for i in xrange(textLen, -1, -1):\r...
[ "0.67730683", "0.67222553", "0.6623491", "0.66110086", "0.65253127", "0.64975154", "0.6381167", "0.6334502", "0.6334502", "0.6334502", "0.6334502", "0.62505287", "0.6207931", "0.6167163", "0.61488664", "0.61245024", "0.6113596", "0.6112493", "0.6090708", "0.6082373", "0.60692...
0.63371265
7
Takes markov chain of less than 140 characters and tweets it
def tweet(chopped_string): status = api.PostUpdate(chopped_string) print status.text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_text(markov_chains):\n\n random_num = generate_random_number(markov_chains.keys())\n\n random_text = []\n\n start_words = generate_start_words(random_num, markov_chains.keys())\n \n random_text.extend(start_words)\n\n\n for i in range(500):\n word_tuple = (random_text[-2],random_text...
[ "0.6491201", "0.6420324", "0.6404344", "0.6331434", "0.62516975", "0.6180663", "0.61768556", "0.6172576", "0.6162811", "0.61131287", "0.60716426", "0.60196114", "0.5941954", "0.5934305", "0.5916181", "0.5898955", "0.58937705", "0.587658", "0.5635887", "0.56358594", "0.5614897...
0.0
-1
the main backup function. The simulate option goes through the motions and outputs what would be done without executing
def do_backup(infile, simulate=False): # parse the input file cp = cparse.ConfigParser() cp.optionxform = str cp.read(infile) # store the list of files and directories we will backup # in each dictionary, the key is the root directory to copy from and the # list it indexes is the list of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backup():\n\n\t# Sound backup alarm.\n\t#Sound.tone([(1000, 500, 500)] * 3)\n\n\t# Turn backup lights on:\n\tLeds.set_color(Leds.RIGHT, Leds.RED)\n\tLeds.set_color(Leds.LEFT, Leds.RED)\n\n\t# Stop both motors and reverse for 1.5 seconds.\n\t# `run-timed` command will return immediately, so we will have to wait...
[ "0.65743506", "0.62866676", "0.60612804", "0.5717248", "0.5711721", "0.5660554", "0.5612648", "0.5609111", "0.55898035", "0.5586355", "0.558241", "0.5507118", "0.54775506", "0.5468942", "0.5467805", "0.5458969", "0.54422337", "0.5414463", "0.5412901", "0.53900707", "0.5389421...
0.65804386
0
municipio de la recogida
def municipio(update, context): user = update.message.from_user context.user_data['municipio'] = update.message.text logger.info("El municipio de %s es: %s", user.first_name, update.message.text) update.message.reply_text(emoji.emojize("Muy bien, ahora la dirección para esta recogida."), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geocode(self, geocoder):\n for term in self.terms:\n # No need to geocode regions\n if not term.get('region'):\n geo = geocoder.geocode(term['string'])\n if geo:\n term['geo'] = geo\n if not self.region:\n ...
[ "0.57516754", "0.5722131", "0.5722131", "0.55322856", "0.5245639", "0.5219513", "0.51864374", "0.51653004", "0.5079808", "0.5071183", "0.5070369", "0.5064358", "0.5060312", "0.50454557", "0.50388813", "0.50386727", "0.5026934", "0.5010187", "0.50078595", "0.49691686", "0.4943...
0.62810594
0
Direccion para programar la recogida
def direccion(update, context): user = update.message.from_user context.user_data['direccion'] = update.message.text logger.info("%s es de %s", user.first_name, update.message.text) reply_keyboard = [['Mañana', 'Tarde', 'Todo el día']] update.message.reply_text(emoji.emojize("\n ¿En qué horario pode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(self):\n ...", "def create_reco_path(Env):\n \n reco = Env.create_path('reco')\n reco.set_globals(params={'GearXMLFile': gearfile , 'MaxRecordNumber' : nevents_alu, 'LCIOInputFiles': rawfile_alu }) \n reco.add_processor(name=\"M26Clusterizer\")\n reco.add_processor(name=\"M26GoeHitMaker\")\n...
[ "0.6511977", "0.6047358", "0.59086376", "0.59045446", "0.5834774", "0.569708", "0.5680784", "0.5663638", "0.5580568", "0.5521243", "0.5514576", "0.55057937", "0.5471582", "0.545902", "0.5436333", "0.5430237", "0.5430237", "0.54294795", "0.535575", "0.53417236", "0.5333277", ...
0.0
-1
Guarda los datos y finaliza la conversacion
def finConversacion(update, context): user = update.message.from_user reply_keyboard = [['Empezar']] update.message.reply_text(emoji.emojize(":tada: :tada: :tada: Debuti. Esto es todo por ahora. Muchas gracias, " + user.first_name + "\n Si quieres empezar de nuevo, dale al botón o e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup(self) -> None:\n self.min_insert_size = -1 # ensure everything gets flushed\n self.insert_data()\n self.db_event_time = sum(self.event_times)", "def finalise(self):", "def finalize(self):\n self._db_obj.progress = self._db_obj.total\n self._db_obj.step = \"Complet...
[ "0.64594984", "0.637586", "0.60826033", "0.6078333", "0.60050803", "0.5994859", "0.59886575", "0.5983417", "0.59477496", "0.5944865", "0.59288293", "0.5867139", "0.5867139", "0.5867139", "0.5867139", "0.5867139", "0.5860597", "0.5847804", "0.5846087", "0.5830729", "0.5823536"...
0.0
-1
Captura errores provininetes del update
def error(update, context): logger.warning('Update "%s" caused error "%s"', update, context.error) reply_keyboard = [['Empezar']] update.message.reply_text(emoji.emojize("Perdona, algo ha ido mal mientras hablábamos. \n¿Probamos de nuevo? 👉👈 😅" + "\n Si quieres empezar de n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(update, context):\n\tlogger.warning('Update \"%s\" caused error \"%s\"', update, context.error)", "def error(update, context):\n\tlogger.warning('Update \"%s\" caused error \"%s\"', update, context.error)", "def error(update, context):\n\tlogger.warning('Update \"%s\" caused error \"%s\"', update, co...
[ "0.7319511", "0.7319511", "0.7301058", "0.72189295", "0.7215703", "0.7165587", "0.7146246", "0.71069735", "0.70717734", "0.70355755", "0.70355755", "0.70355755", "0.70355755", "0.70355755", "0.70355755", "0.70355755", "0.70355755", "0.70355755", "0.70355755", "0.70355755", "0...
0.61202866
84
Devuelve una frase cuando no entiende la respuesta
def noEntendi(update, context, _reply_keyboard): primeraParte = [config.get("mensajes", "no_entendi_1_1"), config.get("mensajes", "no_entendi_1_2"), config.get("mensajes", "no_entendi_1_3")] segundaParte = [config.get("mensajes", "no_entendi_2_1"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emptyresponse():\n return get_response(\"\")", "def nonexistent(self, resp):\n return any(a in str(resp).lower() for a in NOT_FOUND_KEYWORDS)", "def test_text_is_missing(app):\n rv = app.test_client().post('/tokenize', json={})\n assert rv.status_code == 400\n\n rv = app.test_client().po...
[ "0.6491831", "0.57334256", "0.5721411", "0.56470156", "0.5641886", "0.5626311", "0.5619789", "0.56044114", "0.5590333", "0.5569706", "0.55335426", "0.5513558", "0.5491574", "0.54844373", "0.5468034", "0.5436859", "0.5422745", "0.54222906", "0.5410018", "0.54074734", "0.537440...
0.52835065
33
Creacion del bot, handles de conversacion y polling
def main(): logger.info("Respirabot started ") if len(sys.argv)>1: if sys.argv[1] == "produccion": logger.warning("--- Ejecutando Bot de Producción ---") telegramToken = config.get("telegram", "token_produccion") else: logger.warning("--- Eje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_bot(self):\n dispatcher = self.updater.dispatcher\n\n dispatcher.add_handler(CommandHandler(\"start\", self.on_bot_start))\n dispatcher.add_handler(CommandHandler(\"help\", self.on_bot_help))\n dispatcher.add_handler(CommandHandler(\"about\", self.on_bot_about))\n dispat...
[ "0.6973717", "0.68092024", "0.68092024", "0.65856636", "0.64815533", "0.6441418", "0.6393317", "0.6392364", "0.6372745", "0.6372745", "0.6353107", "0.6329339", "0.6297457", "0.62282807", "0.6180215", "0.6162172", "0.61315906", "0.61274385", "0.61014354", "0.6049295", "0.59829...
0.6043387
20
Selects the right generator
def get_dataset(self, purpose): if purpose == 'train': return self._get_dataset_from_generator(self._get_train_generator) elif purpose == 'validation': return self._get_dataset_from_generator(self._get_validation_generator) elif purpose == 'test': return self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_generator(name, device):\n if name == \"dcgan_rand\":\n generator = transformations.dcgan_cifar10(device, random=True)\n elif name == \"dcgan_cifar10\":\n generator = transformations.dcgan_cifar10(device)\n elif name == \"dcgan_cifar100_grey\":\n generator = transformations.dc...
[ "0.6515577", "0.6476392", "0.6328498", "0.62788916", "0.62553835", "0.61865675", "0.6183795", "0.61665154", "0.6135335", "0.607846", "0.5992547", "0.59417117", "0.59412897", "0.5927435", "0.5917745", "0.5888551", "0.5882553", "0.5880862", "0.5875571", "0.5873227", "0.5847064"...
0.0
-1
Get a generator for the training set
def _get_train_generator(self): while(True): random.shuffle(self.train) for data_element in self.train: if self.debug: print("training on: {}".format(data_element)) image, heatmap = self._generate_input_tuple(data_element) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generator (self) -> tf.keras.Sequential:\n return self._generator", "def get_load_generator(self):\n raise NotImplementedError", "def generator(self):\n return self._generator", "def load_generator(\n ckpt, is_stylegan1, G_res, out_size, noconst, latent_dim, n_mlp, channel_multiplier,...
[ "0.73506755", "0.711219", "0.70807475", "0.70761955", "0.70359993", "0.68668103", "0.6859256", "0.6849475", "0.6807743", "0.6757912", "0.67504096", "0.67065716", "0.66231763", "0.6557234", "0.6494452", "0.6480636", "0.6414629", "0.6409606", "0.64053684", "0.63765883", "0.6349...
0.7064496
4
Get a generator for the validation set
def _get_validation_generator(self): for data_element in self.validation: if self.debug: print("validating on: {}".format(data_element)) image, heatmap = self._generate_input_tuple(data_element) yield (image, heatmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_validation_iterator(self) -> tf.contrib.data.Iterator:\n return self.validation.make_initializable_iterator()", "def __get_validators__(cls) -> Generator:\n yield cls.validate_type\n yield cls.validate_strip\n yield cls.validate_allow_empty\n yield cls.validate_max_leng...
[ "0.72144264", "0.69479173", "0.68369865", "0.6305825", "0.6227489", "0.6188366", "0.6187947", "0.615651", "0.6136088", "0.6002709", "0.594444", "0.5936085", "0.59200394", "0.5869089", "0.58582646", "0.5788431", "0.5777411", "0.5755018", "0.57443184", "0.5736021", "0.569935", ...
0.70835185
1
Get a generator for the test set
def _get_test_generator(self): for data_element in self.test: image, heatmap = self._generate_input_tuple(data_element) yield (image, heatmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generator(self):\n return self._generator", "def generator(self):\n return [None, 1]", "def _generators(self):\n return self.free_group.generators", "def generators(self):\n return self._generators", "def get_test_iterator(self) -> tf.contrib.data.Iterator:\n return s...
[ "0.6934883", "0.68869245", "0.6804469", "0.6739523", "0.67380416", "0.6609572", "0.65743655", "0.65264046", "0.65076804", "0.6437126", "0.64093107", "0.6408682", "0.64085275", "0.640297", "0.6397539", "0.6397323", "0.6379365", "0.6374366", "0.63537973", "0.6293432", "0.626813...
0.680245
3
Generates pairs of preprocessed images and heatmaps
def _generate_input_tuple(self, data_element): itk_img = sitk.ReadImage(os.path.join(os.path.join(self.base_path, 'images'), data_element)) itk_centroid = sitk.ReadImage(os.path.join(os.path.join(self.base_path, 'centroid_masks'), data_element)) itk_img_arr = np.array(sitk.GetArrayFromImage...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_images_pred(self, inputs, outputs):\n for scale in self.scales:\n disp = outputs[(\"disp\", scale)]\n disp = F.interpolate(\n disp, [self.height, self.width], mode=\"bilinear\", align_corners=False)\n source_scale = 0\n\n _, depth = dis...
[ "0.6612688", "0.65252745", "0.6474979", "0.63260067", "0.62858665", "0.62729615", "0.6249939", "0.6238934", "0.6228878", "0.6163732", "0.6144352", "0.61086196", "0.6101276", "0.60774285", "0.60680383", "0.60469073", "0.6028129", "0.60276085", "0.6024423", "0.6018528", "0.6014...
0.62595814
6
Generates a train/validation/test split for the images
def _train_validation_test_split(self, images, centroids): # Get test images from images list. Test images are images for which a centroid mask does NOT exist test = [] filtered_images = [] # split images in test and train/val set for image in images: if imag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_datasets(img_lst):\n num = len(img_lst)\n\n idx = np.random.permutation(num)\n train_lst = np.array(img_lst)[idx[:int(num * .8)]] # 80/20 split\n validation_lst = np.array(img_lst)[idx[int(num * .8):int(num * .9)]]\n test_lst = np.array(img_lst)[idx[int(num * .9):]]\n return train_lst...
[ "0.7404242", "0.69282395", "0.6905587", "0.68349373", "0.6814655", "0.6804746", "0.6789946", "0.6778164", "0.6777697", "0.67680496", "0.6739402", "0.67353", "0.67269737", "0.67141557", "0.6707179", "0.67021906", "0.66901654", "0.66886663", "0.66656077", "0.66521865", "0.66506...
0.65909046
26
Set up for the first 11 tests.
def get_testing_data(): def _get_testing_data(data_csv, platemap_csv, data_type, size, pkl_file): with open(pkl_file, 'rb') as file: # load the list with expexcted data frames from .pkl file expected_list = pickle.load(file) actual_output = fa.read_in_envision(data_csv =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\t\tself.testCases = [\n\t\t\t{\n\t\t\t\t'show': \"House\",\n\t\t\t\t'episode': 11,\n\t\t\t\t'season': 3,\n\t\t\t\t'title': \"Words and Deeds\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t'show': \"Lost\",\n\t\t\t\t'episode': 21,\n\t\t\t\t'season': 2,\n\t\t\t\t'title': \"?\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t'show': \...
[ "0.7619112", "0.75964916", "0.75964916", "0.75964916", "0.75964916", "0.75964916", "0.75964916", "0.75964916", "0.75964916", "0.75964916", "0.75964916", "0.75964916", "0.75964916", "0.7583967", "0.7558627", "0.75468165", "0.75107336", "0.75032073", "0.74950135", "0.74950135", ...
0.0
-1
Test for error raised if size is not 384 or 96.
def test_plate_size_error(): test_object = fa.read_in_envision(data_csv=plate_1, platemap_csv=plate_map_file, data_type='plate', size=100)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_exceptionGreaterThan64k(self) -> None:\n raise LargeError(2 ** 16)", "def check_resize_size(size):\n if isinstance(size, int):\n check_value(size, (1, FLOAT_MAX_INTEGER))\n elif isinstance(size, (tuple, list)) and len(size) == 2:\n for i, value in enumerate(size):\n ...
[ "0.67716676", "0.66709614", "0.66432613", "0.6614499", "0.6546472", "0.6528925", "0.65032125", "0.64347726", "0.6432811", "0.64136565", "0.63525164", "0.6322647", "0.6276211", "0.62542063", "0.6223549", "0.6220651", "0.6183461", "0.6180869", "0.61783415", "0.6154778", "0.6140...
0.6057454
32
Test for error if data_type = list but raw data file is in plate format.
def test_incorrect_data_type_list(): test_object = fa.read_in_envision(data_csv=plate_1, platemap_csv=plate_map_file, data_type='list', size=384)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_incorrect_data_type_plate():\n \n test_object = fa.read_in_envision(data_csv=list_A, platemap_csv=plate_map_file, data_type='plate', size=384)", "def test_incorrect_data_type():\n \n test_object = fa.read_in_envision(data_csv=list_A, platemap_csv=plate_map_file, data_type='typo', siz...
[ "0.75342304", "0.70626557", "0.6768114", "0.6571354", "0.61076355", "0.59984607", "0.59412366", "0.593715", "0.58935404", "0.5881785", "0.58569247", "0.5786611", "0.57838047", "0.5749198", "0.574268", "0.5735595", "0.5733344", "0.5718264", "0.5713996", "0.56484675", "0.559914...
0.7635421
0
Test for error if data_type = plate but raw data file is in list format.
def test_incorrect_data_type_plate(): test_object = fa.read_in_envision(data_csv=list_A, platemap_csv=plate_map_file, data_type='plate', size=384)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_incorrect_data_type_list():\n \n test_object = fa.read_in_envision(data_csv=plate_1, platemap_csv=plate_map_file, data_type='list', size=384)", "def test_incorrect_data_type():\n \n test_object = fa.read_in_envision(data_csv=list_A, platemap_csv=plate_map_file, data_type='typo', size=384...
[ "0.7794329", "0.6749305", "0.6440731", "0.63738686", "0.59231424", "0.58522236", "0.5734133", "0.572137", "0.5673078", "0.5640752", "0.56203806", "0.55289614", "0.5516629", "0.55102366", "0.5478745", "0.54479927", "0.5442712", "0.5433583", "0.5409536", "0.5393837", "0.5391756...
0.72638327
1
Test for error if data_type argument is neither plate nor list.
def test_incorrect_data_type(): test_object = fa.read_in_envision(data_csv=list_A, platemap_csv=plate_map_file, data_type='typo', size=384)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_incorrect_data_type_list():\n \n test_object = fa.read_in_envision(data_csv=plate_1, platemap_csv=plate_map_file, data_type='list', size=384)", "def test_incorrect_data_type_plate():\n \n test_object = fa.read_in_envision(data_csv=list_A, platemap_csv=plate_map_file, data_type='plate', s...
[ "0.7103727", "0.6875899", "0.68417084", "0.6746036", "0.6601033", "0.62386924", "0.6223473", "0.622124", "0.6186211", "0.6181421", "0.6156659", "0.6154845", "0.6145773", "0.61215585", "0.6076571", "0.6075887", "0.6063792", "0.6039532", "0.6018891", "0.60168535", "0.5987455", ...
0.6503586
5
Test whether the invalidate function turns the value of the 'Valid' column to False in a given set of well ids, columns and rows.
def test_invalidate(): example_platemap = pd.read_csv(inval_platemap, index_col=[0]) # read in an example platemap with invalidated well ids, rows and columns test_object = fa.read_in_envision(data_csv=plate_2_repeat, platemap_csv=plate_map_file, data_type='plate', size=384) # read in actual data and p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalidate_error():\n \n test_object = fa.read_in_envision(data_csv=plate_2_repeat, platemap_csv=plate_map_file, data_type='plate', size=384)\n test_object.invalidate() # execute the invalidate function without specifying well ids, rows or columns to be invalidated", "def cell_invalidation(_f...
[ "0.61532485", "0.6008592", "0.59615946", "0.59555566", "0.5877972", "0.5876424", "0.58687544", "0.5847433", "0.58406866", "0.57983524", "0.57739675", "0.57136995", "0.5703538", "0.5683163", "0.5681022", "0.5666945", "0.5645097", "0.5643834", "0.5600089", "0.55769676", "0.5572...
0.68301916
0
Test whether the 'invalidate' function raises an error if no arguments are passed.
def test_invalidate_error(): test_object = fa.read_in_envision(data_csv=plate_2_repeat, platemap_csv=plate_map_file, data_type='plate', size=384) test_object.invalidate() # execute the invalidate function without specifying well ids, rows or columns to be invalidated
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invalidate_for(self):\n return None", "def invalidate_for(self):\r\n return None", "def invalidate(self):\n return False", "def test_watch_bad_argument(self):\n self.assertFalse(\n reloading.refresh(datetime, force=True),\n Message('Should not reload not a module...
[ "0.6648751", "0.6526247", "0.6239088", "0.5900166", "0.56189", "0.5544497", "0.5537865", "0.55341893", "0.5506922", "0.54491156", "0.54310495", "0.54098284", "0.53973675", "0.5384598", "0.5350985", "0.5343964", "0.5318394", "0.52575517", "0.5239422", "0.5233298", "0.5212309",...
0.60976124
3
Tests whether the background correction function performs correct calculations to get the background corrected values of p and s channel signal
def test_background_correct(): with open(HsHis6_PEX5C_vs_HsPEX5C_p_s_corrected, 'rb') as file: # load the list with expexcted data frames from .pkl file expected_list = pickle.load(file) test_object = fa.read_in_envision(data_csv=HsHis6_PEX5C_vs_HsPEX5C, platemap_csv=Hs_His6_PEX5C_vs_HsPEX5C_pla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getBackgroundCorrected(ds, bkg, norm_ref=None, norm_target=-1):\n print 'background correction of', ds.title\n\n # normalise\n print 'Bkg before: %f' % bkg[2,25,2]\n if norm_ref:\n bkg,target = applyNormalization(bkg,norm_ref,norm_target)\n\n rs = ds.__copy__() # for metadata\n # resu...
[ "0.65292513", "0.6052669", "0.5702846", "0.5668885", "0.5588744", "0.5585142", "0.5563358", "0.5550591", "0.55287355", "0.5511105", "0.5437935", "0.5358553", "0.5357077", "0.53366697", "0.5321925", "0.52943116", "0.52937794", "0.5270108", "0.5203199", "0.51957315", "0.5175876...
0.63610095
1
Tests whether the calculate_r_I function performs correct calculations to get the raw and background corrected values of intensity and anisotropy
def test_calculate_r_i(): with open(HsHis6_PEX5C_vs_HsPEX5C_calc_r_I, 'rb') as file: # load the list with expexcted data frames from .pkl file expected_list = pickle.load(file) test_object = fa.read_in_envision(data_csv=HsHis6_PEX5C_vs_HsPEX5C, platemap_csv=Hs_His6_PEX5C_vs_HsPEX5C_platemap,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_rsi(image):\n\n # roll axes to conventional row,col,depth\n img = np.rollaxis(image, 0, 3)\n\n # bands: Coastal(0), Blue(1), Green(2), Yellow(3), Red(4), Red-edge(5), NIR1(6), NIR2(7)) Multispectral\n COAST = img[:, :, 0]\n B = img[:, :, 1]\n G = img[:, :, 2]\n Y = img[:, :, 3]\n R...
[ "0.6223731", "0.6151776", "0.6007631", "0.5974062", "0.5893048", "0.5850717", "0.58224195", "0.5686782", "0.5679441", "0.5646331", "0.562151", "0.55506206", "0.55378217", "0.5529095", "0.54820305", "0.5459452", "0.5451719", "0.54428566", "0.54057056", "0.53846204", "0.5367401...
0.5423607
18
Test for an error raised if the calculate_r_i function is called with the correct parameter as True prior to the background subtraction
def test_no_backg_subt(): test_object = fa.read_in_envision(data_csv=HsHis6_PEX5C_vs_HsPEX5C, platemap_csv=Hs_His6_PEX5C_vs_HsPEX5C_platemap, data_type='plate', size=384) test_object.calculate_r_i(correct=True, plot_i=False, thr=80)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_results(self):\n if not self.ctx.is_restart and self.can_restart():\n self.ctx.is_restart = True\n self.report('Calculation is not converged and restart parameters are given: calc scheduled for restart')", "def __call__(self): # run test\n\n ...
[ "0.5697887", "0.56862307", "0.5652391", "0.56442446", "0.56041795", "0.55811197", "0.557146", "0.5522984", "0.54922605", "0.54536295", "0.5438057", "0.5408651", "0.54070437", "0.54070437", "0.5378096", "0.53728116", "0.5364579", "0.5355418", "0.5334695", "0.5331516", "0.53303...
0.56345457
4
start point of the app
def index(): return render_template('index.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startapp():", "def start (self):\n pass", "def start (self):\n pass", "def start(self):\r\n pass", "def start(self):\n pass", "def start(self):\n pass", "def start(self):\n pass", "def start(self):\n pass", "def start(self):\n pass", "de...
[ "0.8492143", "0.8363531", "0.8363531", "0.83245224", "0.8323632", "0.8323632", "0.8323632", "0.8323632", "0.8323632", "0.8323632", "0.8323632", "0.8323632", "0.83003753", "0.8274841", "0.8259383", "0.8259383", "0.8259383", "0.8259383", "0.8127597", "0.8127597", "0.812389", ...
0.0
-1
return a template of nodes.html
def node(): return render_template('nodes.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graphing1():\n return render_template('graph1.html')", "def addGenericNode():\n return render_template(\"addGenericNode.html\")", "def get(self):\n return render_template ('nome do html')", "def generate_html_template(self, news_list):\n with open(self.template, \"r\") as fp:\n ...
[ "0.6528794", "0.6357709", "0.6328158", "0.62870455", "0.62844205", "0.6268067", "0.61775446", "0.61775446", "0.61438644", "0.6132522", "0.6118087", "0.6080962", "0.6065939", "0.60523665", "0.6042195", "0.60045296", "0.59810543", "0.5975848", "0.5970648", "0.59310323", "0.5926...
0.8621902
0
function that recieve an id and send to the torre api to return the information as a json
def id(text): url = "https://bio.torre.co/api/bios/{}".format(text) request = get(url) print(request.status_code) if request.status_code != 200: abort(404, 'Not Found') return request.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_from_api(_id):\n # get employee name\n employee_name = requests.get(\n 'https://jsonplaceholder.typicode.com/users/' + _id).json()['username']\n\n # get employee info\n info = requests.get(\n 'https://jsonplaceholder.typicode.com/todos?userId=' + _id).json()\n # Write to cs...
[ "0.64823586", "0.64728427", "0.6283787", "0.62567455", "0.6227529", "0.6171123", "0.6161169", "0.613851", "0.6096506", "0.6030402", "0.5998821", "0.59925264", "0.5970917", "0.59407645", "0.5916527", "0.5913766", "0.5911259", "0.58871174", "0.57844204", "0.57770264", "0.575659...
0.65873057
0
function that recieve a key to search in the torre api and return a list of coincidences
def key(text): url = "https://bio.torre.co/api/people?q={}&limit=10".format(text) request = get(url) print(request.json()) if request.status_code != 200 or len(request.json()) < 1: abort(404, 'Not Found') return json.dumps(request.json())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(self, key, headers=Headers()):", "def ballot_get_contests_by_tag(key, value):\r\n return make_request({\"method\": \"ballot_get_contests_by_tag\",\r\n \"params\": [key, value],\r\n \"jsonrpc\": \"2.0\",\r\n \"id\": 0, })", "d...
[ "0.6478836", "0.6024228", "0.5795371", "0.5594707", "0.5593145", "0.55411565", "0.5527065", "0.55062836", "0.5494928", "0.5460958", "0.54490304", "0.5425797", "0.5392197", "0.53665507", "0.5362524", "0.53596425", "0.5358832", "0.53473693", "0.53468525", "0.5346352", "0.534207...
0.5901144
2
recive the id of an user, ask for the conections and return the information to draw the nodes
def conections(text): limit = 6 request_conections = get_conections(text, limit) request_user = id(text) angle = 360 / limit angle2 = 30 principal = {} secondary = {} data = {} create_dict(principal, request_user, "self", angle) i = 1 for conection in request_conections: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_conections(user_id, limit):\n url_conect = \"https://bio.torre.co/api/people/{}/connections?limit={}\".format(user_id, limit)\n request = get(url_conect)\n if request.status_code != 200:\n abort(404, 'Not Found')\n return request.json()", "async def lookup(self, ctx, user_id: int):\n ...
[ "0.59642047", "0.5605806", "0.5603265", "0.55791175", "0.5535385", "0.54389566", "0.54255253", "0.5419835", "0.5386988", "0.53542393", "0.5341794", "0.5309696", "0.5309696", "0.5308776", "0.5305902", "0.52922404", "0.5272686", "0.52617073", "0.5248267", "0.523367", "0.523174"...
0.5196708
22
function that get the conections of an user given the id
def get_conections(user_id, limit): url_conect = "https://bio.torre.co/api/people/{}/connections?limit={}".format(user_id, limit) request = get(url_conect) if request.status_code != 200: abort(404, 'Not Found') return request.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_connections(network, user):\n if not user in network:\n return None\n if not 'connections' in network[user]:\n return []\n return network[user]['connections']", "def get_connection(self, user_id):\n logging.debug('ConnectionsClient/get_connection()')\n url = '/pod/v1/...
[ "0.63471746", "0.62897015", "0.6080058", "0.60384804", "0.5986767", "0.59058696", "0.58764243", "0.5813119", "0.5799602", "0.5768668", "0.5727054", "0.57236326", "0.5715743", "0.56753516", "0.5619295", "0.5578455", "0.5575732", "0.55389047", "0.55191123", "0.5507065", "0.5499...
0.74861646
0
handle the data to given by the conections to prepare for javascript draw
def create_dict(dictionary, user, father, angle, i=0): data = {} data["name"] = user["person"]["name"] data["id"] = user["person"]["publicId"] try: data["img"] = user["person"]["picture"] except: pass if father == "self": data["posx"] = 0 data["posy"] = 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_data(self):\n\n return NotImplementedError", "def draw(self):\r\n scalex,scaley = self.getScale()\r\n try:\r\n self.clear()\r\n # Draw Graph Background\r\n self.drawLayout()\r\n if self.app.data == None:# If no data, break\r\n ...
[ "0.64597917", "0.6248536", "0.6165629", "0.6103815", "0.60311455", "0.60078347", "0.6006269", "0.6002087", "0.59225667", "0.5919086", "0.58978397", "0.5887564", "0.5858492", "0.5856284", "0.5856284", "0.5856284", "0.5856284", "0.58150923", "0.58132595", "0.5708828", "0.568980...
0.0
-1
Constructor for the HED logger.
def __init__(self, name=None): self.log = {} self.name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n self.log = logging.getLogger(logger_name(__name__))", "def __init__(self):\n\n self._logger = logging.getLogger(__name__)", "def __init__(self):\r\n self.logger = dict()", "def __init__(self):\n self...
[ "0.75638324", "0.7499825", "0.7496299", "0.7490632", "0.742989", "0.7315539", "0.7292822", "0.72662014", "0.71722215", "0.7157706", "0.7140861", "0.71227425", "0.70831037", "0.70392835", "0.70136416", "0.69801646", "0.69340897", "0.69211906", "0.6905667", "0.6871592", "0.6828...
0.6939277
16
Return the log as a string, with entries separated by newlines.
def get_log_string(self, level=None): log_lines = [f"Name:{str(self.name)} Level:{str(level)}"] for key, item in self.log.items(): log_lines.append(f"{key}:") if item: for entry in item: if not level or (entry["level"] == level): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_log(self):\n\n open_lf = open(self.logfile, 'r')\n log_str = open_lf.read()\n sys.stdout.write(log_str)\n\n return log_str", "def get_formatted_task_log(self):\n try:\n log = requests.get(self.gs_base_url + \"/out.log\").content\n except:\n ...
[ "0.70994776", "0.6636679", "0.6498945", "0.6483803", "0.6436465", "0.6419768", "0.64023906", "0.63518935", "0.6291789", "0.6112271", "0.610589", "0.60014796", "0.59091604", "0.59091604", "0.5906159", "0.58620924", "0.58502805", "0.5849809", "0.5814813", "0.57979417", "0.57753...
0.69506097
1
Add a vertex to the graph.
def add_vertex(self, vertex_id): self.vertices[vertex_id] = set() # set of edges from this vert # a set is like a list except it allows O(1) lookups like a hashtable and it doesn't allow duplicates
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vertex(self, vertex):\n raise NotImplementedError", "def add_vertex(self, vertex):\n if isinstance(vertex, Vertex):\n self.vertices.append(vertex)\n return\n raise TypeError('Is not vertex instance!')", "def add_vertex(self, vertex_name: n):\n new_verte...
[ "0.8703537", "0.84338593", "0.8423067", "0.8409588", "0.83660835", "0.8317327", "0.8255059", "0.8086839", "0.8082268", "0.803738", "0.80348116", "0.7882737", "0.78723216", "0.7840483", "0.7840483", "0.7762625", "0.775688", "0.77160776", "0.7714244", "0.7668677", "0.76634395",...
0.72670186
39
Add a directed edge to the graph.
def add_edge(self, v1, v2): # First we check to see if the vertices we're trying to connect exist if v1 in self.vertices and v2 in self.vertices: # If they do exist, we add v2 as a neighbor to v1 self.vertices[v1].add(v2) else: # If v1 or v2 does not exist, we...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, edge):\n src = edge.get_source()\n dest = edge.get_destination()\n #weightEdge = WeightedEdge(src, dest, edge.get_total_distance(), edge.get_outdoor_distance())\n if not (src in self.edges and dest in self.edges):\n raise ValueError('Node not in graph')\n ...
[ "0.78169996", "0.77789694", "0.7618847", "0.761851", "0.75694674", "0.7547367", "0.7483565", "0.7437083", "0.74284625", "0.7422367", "0.741715", "0.7337182", "0.73281914", "0.7266331", "0.7227267", "0.7212267", "0.71977764", "0.7194343", "0.71735585", "0.7168542", "0.7152955"...
0.6447642
88
Get all neighbors (edges) of a vertex.
def get_neighbors(self, vertex_id): return self.vertices[vertex_id]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neighbors_in(self, vertex):\n return list(self.neighbor_in_iterator(vertex))", "def neighbors_out(self, vertex):\n return list(self.neighbor_out_iterator(vertex))", "def get_neighbours(self, vertex):\n output = []\n \n if vertex in self.adjacency_list:\n for ne...
[ "0.8146008", "0.78266084", "0.78112674", "0.7634123", "0.76183206", "0.7559868", "0.7391218", "0.73596346", "0.73310196", "0.7279731", "0.71649474", "0.7128683", "0.7083494", "0.7077735", "0.7033856", "0.69887614", "0.69749075", "0.6923719", "0.68615776", "0.6847223", "0.6838...
0.729323
13
Print each vertex in breadthfirst order beginning from starting_vertex.
def bft(self, starting_vertex): # First we create an empty queue and enqueue the starting vertex qq = Queue() qq.enqueue(starting_vertex) # Then we create a set to store the vertices we visit visited = set() # Here we write a while loop that will run as long as the queu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bft(self, starting_vertex):\n # create an empty queue and enqueue the starting vertex ID\n queue = Queue()\n queue.enqueue(starting_vertex)\n # create an emtpy Set to stoe the visited vertices\n visited = set()\n # while the queue is not empty ...\n while queue....
[ "0.70667464", "0.6979862", "0.6909106", "0.68523353", "0.6753442", "0.6720827", "0.6719588", "0.6714974", "0.6637809", "0.6562473", "0.65480953", "0.64359945", "0.6428864", "0.6395085", "0.63539046", "0.6337553", "0.63178927", "0.62684286", "0.62529117", "0.62306154", "0.6174...
0.68725127
3
Print each vertex in depthfirst order beginning from starting_vertex.
def dft(self, starting_vertex): # First, we create an empty stack and push the starting vertex ss = Stack() ss.push(starting_vertex) # Then we create a set to store the vertices we visit visited = set() # Here we write a while loop that will run as long as the stack is ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print(self):\n for i, v in enumerate(self._adj):\n if v:\n print(\"vertex {0}\".format(i))\n for e in v:\n print(e)\n print()", "def dft(self, starting_vertex):\n \n visited = []\n stack = Stack()\n\n ...
[ "0.71442217", "0.7097335", "0.6844493", "0.6655301", "0.6629964", "0.65694076", "0.64505523", "0.63725525", "0.618516", "0.6174981", "0.6125597", "0.61178565", "0.6105832", "0.6093275", "0.6074492", "0.60744387", "0.6066715", "0.6049891", "0.6042915", "0.60275644", "0.6025777...
0.62792003
8
Print each vertex in depthfirst order beginning from starting_vertex. This should be done using recursion.
def dft_recursive(self, starting_vertex, visited=None): # First, we set our initial condition if visited is None: # If no nodes have been visited, we create a set to store the nodes we visit visited = set() # Then we add the starting vertex to the visited set vis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dft_recursive(self, starting_vertex):\n # TODO\n # creating a function inside that includes a list\n # of previously traversed vertices\n def recursive(graph, traversed, vertex):\n # if the vertex is in traversed already, return none\n if vertex in traversed:\n...
[ "0.71111", "0.7087287", "0.70046896", "0.69521785", "0.6610307", "0.66052985", "0.64853853", "0.64322525", "0.63706416", "0.6346533", "0.62979746", "0.62097836", "0.62037903", "0.615803", "0.61493325", "0.6126961", "0.61253214", "0.6092986", "0.6085189", "0.60631824", "0.6058...
0.5419566
77
Return a list containing the shortest path from starting_vertex to destination_vertex in breathfirst order.
def bfs(self, starting_vertex, destination_vertex): # First, we create an empty queue and enqueue the starting vertex as a list qq = Queue() qq.enqueue([starting_vertex]) # Then we create a set to store the vertices we visit visited = set() # We write a while loop that ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dfs(self, starting_vertex, destination_vertex):\n\n parents = {}\n\n for index, (p, c) in enumerate(self.vertices.items()):\n for child in c:\n if child not in parents:\n parents[child] = []\n parents[child].append(p)\n\n path = [...
[ "0.7659226", "0.75587445", "0.74425584", "0.7346739", "0.728975", "0.727325", "0.723667", "0.72047615", "0.71612984", "0.714764", "0.7138549", "0.7089868", "0.70811826", "0.7056604", "0.70488393", "0.7022512", "0.70190996", "0.70000625", "0.6983462", "0.69232124", "0.6887063"...
0.6955285
19
Return a list containing a path from starting_vertex to destination_vertex in depthfirst order.
def dfs(self, starting_vertex, destination_vertex): # First, we create an empty stack and push the starting vertex onto the stack ss = Stack() ss.push([starting_vertex]) # Then we create a set to store the vertices we visit visited = set() # We write a while loop that w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dfs(self, starting_vertex, destination_vertex):\n\n parents = {}\n\n for index, (p, c) in enumerate(self.vertices.items()):\n for child in c:\n if child not in parents:\n parents[child] = []\n parents[child].append(p)\n\n path = [...
[ "0.8430803", "0.7577893", "0.74265605", "0.73263896", "0.7264412", "0.72132045", "0.71690327", "0.7143365", "0.7078884", "0.69962204", "0.6983124", "0.69708425", "0.69157046", "0.6913365", "0.6913365", "0.6899288", "0.6899288", "0.6868995", "0.6810703", "0.6806686", "0.680453...
0.7001528
9
Return a list containing a path from starting_vertex to destination_vertex in depthfirst order. This should be done using recursion.
def dfs_recursive(self, starting_vertex, destination_vertex, visited=None, path=None): # First we write a couple if statements for the initial case where there are no visited nodes and therefore no paths if visited is None: # If nothing has been visited yet, we create an empty set ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dfs(self, starting_vertex, destination_vertex):\n\n parents = {}\n\n for index, (p, c) in enumerate(self.vertices.items()):\n for child in c:\n if child not in parents:\n parents[child] = []\n parents[child].append(p)\n\n path = [...
[ "0.86398935", "0.7851373", "0.7701232", "0.76726115", "0.76101196", "0.75910693", "0.7564465", "0.7409766", "0.7386346", "0.733942", "0.73314714", "0.7315953", "0.7315953", "0.71769303", "0.7163085", "0.7106128", "0.7106055", "0.7097805", "0.70751095", "0.7053062", "0.698976"...
0.70766926
18
Read a byte (or multiple bytes) from the device.\n
def read_byte_data(self, register_address, amount=1): with SMBus(self.i2c_bus) as bus: data = bus.read_i2c_block_data(self.i2c_address, register_address, amount) if amount == 1: return data[0] else: return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Read_Byte(self):\r\n data = self.Port.read(1)\r\n return data", "def read_byte(self, addr):\n raise NotImplementedError()", "def read_byte():\n try:\n result = ord(self._buffer[read_cursor[0]])\n read_cursor[0] += 1\n return resul...
[ "0.7715525", "0.768307", "0.7215954", "0.71913224", "0.7157877", "0.7098685", "0.7070564", "0.70418745", "0.69745934", "0.69734", "0.6973264", "0.69517064", "0.6938464", "0.6893904", "0.68349165", "0.6827607", "0.68268704", "0.67843", "0.67833656", "0.6779479", "0.6779479", ...
0.61092967
76
Write a byte (or multiple bytes) to the device.\n
def write_byte_data(self, value, register_address): if type(value) != list: value = [value] with SMBus(self.i2c_bus) as bus: bus.write_i2c_block_data(self.i2c_address, register_address, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_byte(self, addr, data):\n raise NotImplementedError()", "def _write_byte(self, byte):\n\n # Setup io pin as output\n self.gpio.setup(self._io_pin, GPIO.OUT)\n\n for _ in range(8):\n # Write data on the rising edge of clk\n self.gpio.output(self._clk_pin...
[ "0.7731139", "0.7425538", "0.74137324", "0.74044555", "0.73970586", "0.73786175", "0.73297405", "0.727029", "0.7227886", "0.7187903", "0.6970419", "0.6933494", "0.6926549", "0.6897055", "0.6878404", "0.6866382", "0.6820549", "0.679378", "0.6790886", "0.67902005", "0.675978", ...
0.6061255
74
Writes a flag to a register with the given offset.\n
def write_flag_data(self, flag, register_address, offset): if len(flag) + offset > 8: raise ValueError("Flag + offset exceeded 8 bit limit.") register_value = self.read_byte_data(register_address) for index, value in enumerate(flag): if value: register_va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setFlag(flagbyte, pos, status):\n if status:\n return flagbyte | 2**pos\n else:\n return flagbyte & ~2**pos", "def set_flag(self, flag_name, value):\n flags = {'C':0, # Carry\n 'Z':1, # Zero\n 'I':2, # Interrupt mask\n 'D':3, # De...
[ "0.6303939", "0.62794644", "0.6193683", "0.61641306", "0.6088857", "0.5993474", "0.596513", "0.59287363", "0.5836613", "0.5812747", "0.5805649", "0.5772962", "0.5758084", "0.5718409", "0.5704642", "0.5610061", "0.5600659", "0.5600078", "0.5501439", "0.5494253", "0.548575", ...
0.7759315
0
Toggles between IDLE and SLEEP state. In sleep state the device can still receive and process I2C messages.\n
def wake_up(self, wake_up=True): self.write_flag_data([wake_up], APDS_9960.ENABLE_REG_ADDRESS, 0) time.sleep(0.01)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter_sleep_mode(self):\n self.execute(SdpI2cCmdEnterSleepMode())", "def sleep(self):\n if not self.is_sleeping:\n self.wait_until_idle()\n self.__interface.send_command('POWER_OFF')\n self.wait_until_idle()\n self.__interface.send_command('DEEP_SLEEP...
[ "0.71191245", "0.69461465", "0.6366366", "0.61503685", "0.61194503", "0.60804427", "0.6047658", "0.60283273", "0.60117793", "0.59875923", "0.59793526", "0.5960768", "0.5959351", "0.59531546", "0.59463334", "0.5938639", "0.58425194", "0.58327305", "0.5829838", "0.57420117", "0...
0.0
-1
Sleep After Interrupt. When enabled, the device will automatically enter low power mode when the INT pin is asserted. Normal operation is resumed when INT pin is cleared over I2C.\n
def set_sleep_after_interrupt(self, enable=True): self.write_flag_data([enable], APDS_9960.CONFIG_3_REG_ADDRESS, 4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sleep(self, sleep_time: float = 10) -> None:\n sleep_until_interrupt(sleep_time, lambda: self.stopped, interval=0.5)", "def irq_handler():\n # open an LED session\n with LEDs() as LED:\n # specify the LED which you want to control\n led = Led.LED1\n # specify the LED status...
[ "0.6538061", "0.64390194", "0.6414846", "0.63437057", "0.63230747", "0.62960297", "0.6261905", "0.6241375", "0.6126499", "0.6092909", "0.60635877", "0.60110074", "0.5898803", "0.58937633", "0.5853994", "0.5834014", "0.5828191", "0.5827495", "0.56839854", "0.56753117", "0.5654...
0.6614292
0
The LED_BOOST allows the LDR pin to sink more current above the maximum setting. Additional LDR current during proximity and gesture LED pulses. Current value, set by LDRIVE, is increased by the percentage of LED_BOOST.\n
def set_led_boost(self, led_boost): if not (APDS_9960.LED_BOOST_100 <= led_boost <= APDS_9960.LED_BOOST_300): raise ValueError("led_boost must be one of APDS.LED_BOOST_N") self.write_flag_data([bool(led_boost & 0b01), bool(led_boost & 0b10)], APDS_9960.CONFIG_2_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tune(self):\n if self.freq_peak < self.freq_lo:\n return\n tuning_freq = self.get_tuning_freq(self.freq_peak)\n\n # create 5 bins around the closest frequency to the current peak\n index_freq = np.argwhere(self.NOTES == tuning_freq)[0][0]\n bands = np.zeros(5)\n ...
[ "0.5621568", "0.55511063", "0.54889923", "0.54712635", "0.5467339", "0.54611146", "0.5456708", "0.5446773", "0.5445104", "0.53961974", "0.5396124", "0.5379429", "0.53387177", "0.5309808", "0.530692", "0.5287951", "0.5257031", "0.5256162", "0.5243171", "0.5240784", "0.52318925...
0.6998518
0
The Proximity Interrupt Threshold sets the high and low trigger points for the comparison function which generates an interrupt. If the value generated by the proximity channel, crosses below the lower threshold or above the higher threshold, an interrupt may be signaled to the host processor. Interrupt generation is s...
def set_proximity_interrupt_thresholds(self, low_thr, high_thr): self.write_byte_data(low_thr, APDS_9960.PROX_INT_LOW_THR_REG_ADDRESS) self.write_byte_data(high_thr, APDS_9960.PROX_INT_HIGH_THR_REG_ADDRESS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _proximity_thread(self):\n count = 0\n while True:\n print(\"---------------- Analizo si debo detectar enemigos - PROXIMITY\")\n print(\"----- DEBO?? ::::> self.enemy_not_detected = {}\".format(self.enemy_not_detected))\n while self.enemy_not_detected:\n ...
[ "0.5534539", "0.54538596", "0.5126924", "0.51206297", "0.505338", "0.5048163", "0.5048163", "0.5048163", "0.5048163", "0.5048163", "0.5022339", "0.4987388", "0.4979836", "0.49741766", "0.49654108", "0.49539858", "0.4941065", "0.49398372", "0.49256364", "0.49235585", "0.491772...
0.6906886
0
The Interrupt Persistence sets a value which is compared with the accumulated amount Proximity cycles in which results were outside threshold values. Any Proximity result that is inside threshold values resets the count.\n
def set_proximity_interrupt_persistence(self, persistence): if not (0 <= persistence <= 15): raise ValueError("persistance must be in range [0-15]") flag = [] for i in range(4): flag.append(bool(persistence & (1 << i))) self.write_flag_data(flag, APDS_9960.INTERR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_als_interrupt_persistence(self, persistence):\n if not (0 <= persistence <= 15):\n raise ValueError(\"Persistence must be in range [0 - 15]\")\n\n flag = []\n for i in range(4):\n flag.append(bool(persistence & (1 << i)))\n self.write_flag_data(flag, APDS_9...
[ "0.57186526", "0.544084", "0.53434235", "0.5194584", "0.51427823", "0.5097822", "0.50370705", "0.5025331", "0.50119144", "0.49928343", "0.49647838", "0.4948093", "0.49450144", "0.4934572", "0.49326453", "0.49172455", "0.49014217", "0.48967862", "0.48871198", "0.48867267", "0....
0.59330386
0
The proximity pulse count is the number of pulses to be output on the LDR pin. The proximity pulse length is the amount of time the LDR pin is sinking current during a proximity pulse.\n
def set_proximity_pulse_count_and_length(self, pulse_count, pulse_length=PULSE_LEN_8_MICROS): if not (1 <= pulse_count <= 64): raise ValueError("pulse_count must be in range [1-64]") if not (APDS_9960.PULSE_LEN_4_MICROS <= pulse_length ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_gesture_pulse_count_and_length(self, pulse_count, pulse_length):\n if not (1 <= pulse_count <= 64):\n raise ValueError(\"pulse_count must be in range [1-64].\")\n if not (APDS_9960.PULSE_LEN_4_MICROS <= pulse_length\n <= APDS_9960.PULSE_LEN_32_MICROS):\n r...
[ "0.62280905", "0.60387653", "0.60241723", "0.58001226", "0.5613278", "0.55236006", "0.53408086", "0.5327092", "0.52434987", "0.5174105", "0.50176656", "0.49432734", "0.49347064", "0.49076405", "0.4898199", "0.4889249", "0.48849964", "0.4871372", "0.47583196", "0.47577885", "0...
0.6915799
0
In proximity mode, the UP and RIGHT and the DOWN and LEFT photodiodes are connected forming diode pairs. The offset is an 8bit value used to scale an internal offset correction factor to compensate for crosstalk in the application.\n
def set_proximity_offset(self, up_right_offset=0, down_left_offset=0): if not (-127 <= up_right_offset <= 127 and -127 <= down_left_offset <= 127): raise ValueError("up_right_offset and down_left_offset must be in range [-127-127]") ur_reg_value = abs(up_right_offset) ur_reg_value |...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_offset_mapping(self):\n self.quad_offset_mapping = {\n 'forward': direction_arr[self.direction_mod_offset % len(self.direction_arr)],\n 'right': direction_arr[(self.direction_mod_offset + 1) % len(self.direction_arr)],\n 'backward': direction_arr[(self.directio...
[ "0.5933824", "0.5909894", "0.57860225", "0.5501753", "0.54334956", "0.5392128", "0.5383301", "0.52975345", "0.52211267", "0.52162117", "0.5173359", "0.51116484", "0.50885093", "0.5061578", "0.50394344", "0.5035166", "0.49952644", "0.4973922", "0.4973023", "0.49721557", "0.496...
0.6428218
0
Select which photodiodes are used for proximity.\n
def disable_photodiodes(self, mask_up, mask_down, mask_left, mask_right, proximity_gain_compensation): self.write_flag_data([mask_right, mask_left, mask_down, mask_up], APDS_9960.CONFIG_3_REG_ADDRESS, 0) self.write_flag_data([proximity_gain_compen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proximity(self) -> 'outputs.PreventionInspectTemplateInspectConfigRuleSetRuleHotwordRuleProximity':\n return pulumi.get(self, \"proximity\")", "def toggleCamGeoDisplay():\n\n sel = nuke.selectedNodes()\n\n # on a selection\n good = []\n goodCam = [\"Camera2\",\"Camera\", \"hubCamera\"]\n ...
[ "0.53012717", "0.5174238", "0.515828", "0.49783686", "0.4965054", "0.4943291", "0.49331453", "0.479628", "0.47908714", "0.4783873", "0.4766599", "0.47625536", "0.4751872", "0.4726029", "0.47087565", "0.46947035", "0.46850884", "0.4683038", "0.4635431", "0.46346575", "0.462394...
0.5060718
3
ALS and Color Gain Control.\n
def set_als_gain(self, als_gain): if not (APDS_9960.ALS_GAIN_1X <= als_gain <= APDS_9960.ALS_GAIN_64X): raise ValueError("als_gain must be one of ALS_GAIN_NX.") self.write_flag_data([bool(als_gain & 0b01), bool(als_gain & 0b10)], APDS_9960.CONTROL_1_REG_ADDRESS,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cb_plus(event):\n delta_alpha = pm_rate\n # Increase Alpha \n sAlpha0.set_val( np.clip(sAlpha0.val + delta_alpha, alpha_min[0], alpha_max[0]) )\n sAlpha1.set_val( np.clip(sAlpha1.val + delta_alpha, alpha_min[1], alpha_max[1]) )\n sAlpha2.set_val( np.clip(sAlpha2.val + delta_alpha, alpha_min[2], ...
[ "0.61909044", "0.6019365", "0.5929962", "0.5900015", "0.5762963", "0.57595664", "0.57347745", "0.5716265", "0.5715346", "0.5710017", "0.5676743", "0.56529814", "0.5638359", "0.56324124", "0.5616069", "0.5586263", "0.55725414", "0.55310977", "0.55283916", "0.55103725", "0.5507...
0.59323347
2
ALS level detection uses data generated by the Clear Channel. The ALS Interrupt Threshold registers provide 16bit values to be used as the high and low thresholds for comparison to the 16bit CDATA values. If AIEN is enabled and CDATA is greater than high_thr or less than low_thr for the number of consecutive samples sp...
def set_als_thresholds(self, low_thr, high_thr): if not (0 <= low_thr <= 0xFFFF and 0 <= high_thr <= 0xFFFF): raise ValueError("low_thr and high_thr must be in range [0 - 0xFFFF]") ailtl = low_thr & 0xFF ailth = low_thr >> 8 aihtl = high_thr & 0xFF aihth = high_thr >...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trackThresholdOptical(threshold, ants=0) :\n SPEED_OF_LIGHT = 299792458.0 # m/s\n antlist = helpers.makeList(ants)\n if antlist[0] == 0: antlist = currentAntennaNumbers()\n flo = lofreq()\n t = 0\n for ant in antlist:\n antmp = \"control.antenna%d\" %ant\n d = queryDouble(antmp ...
[ "0.5127868", "0.50271463", "0.50269413", "0.49790308", "0.49651873", "0.4957171", "0.49556398", "0.49099463", "0.4901325", "0.48932168", "0.48726988", "0.4858668", "0.48179138", "0.47960213", "0.47849968", "0.47839293", "0.47799924", "0.4759391", "0.47558066", "0.4723935", "0...
0.6228796
0
The Interrupt Persistence sets a value which is compared with the accumulated amount of ALS cycles in which results were outside threshold values. Any Proximity or ALS result that is inside threshold values resets the count.\n
def set_als_interrupt_persistence(self, persistence): if not (0 <= persistence <= 15): raise ValueError("Persistence must be in range [0 - 15]") flag = [] for i in range(4): flag.append(bool(persistence & (1 << i))) self.write_flag_data(flag, APDS_9960.INTERRUPT_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_proximity_interrupt_persistence(self, persistence):\n if not (0 <= persistence <= 15):\n raise ValueError(\"persistance must be in range [0-15]\")\n\n flag = []\n for i in range(4):\n flag.append(bool(persistence & (1 << i)))\n self.write_flag_data(flag, AP...
[ "0.5933555", "0.5064672", "0.5031599", "0.50105256", "0.500727", "0.49721605", "0.49680948", "0.4959001", "0.4926938", "0.49013528", "0.4897051", "0.48954308", "0.48909703", "0.48878804", "0.488631", "0.48823065", "0.4871497", "0.48599643", "0.48292905", "0.48122618", "0.4798...
0.6456317
0
The ATIME register controls the internal integration time of ALS/Color analog to digital converters. The maximum count (or saturation) value can be retrieved with the get_saturation method.
def set_als_integration_time(self, wtime): if not (2.78 <= wtime <= 712): raise ValueError("The integration time must be in range [2.78 - 712] millis.") value = 256 - int(wtime / 2.78) self.write_byte_data(value, APDS_9960.ALS_ATIME_REG_ADDRESS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_saturation(self):\n cycles = 256 - self.read_byte_data(APDS_9960.ALS_ATIME_REG_ADDRESS)\n return min(65535, cycles * 1025)", "def arming_time(self, time):\n self.write(\":FREQ:ARM:STAR:SOUR IMM\")\n self.write(\":FREQ:ARM:STOP:SOUR TIM\")\n self.write((\":FR...
[ "0.64724326", "0.563255", "0.51065123", "0.49832928", "0.4893324", "0.48625252", "0.4853138", "0.48348826", "0.48339704", "0.478559", "0.4782315", "0.47527668", "0.47326314", "0.47261244", "0.47188354", "0.4714407", "0.46628112", "0.4647732", "0.46390954", "0.4639064", "0.462...
0.5712123
1
Returns the saturation value. The values returned by get_color_data can not exceed this value.
def get_saturation(self): cycles = 256 - self.read_byte_data(APDS_9960.ALS_ATIME_REG_ADDRESS) return min(65535, cycles * 1025)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saturation(value):\n value = int(value)\n if value < 0 or value > 254:\n raise ValueError('Minimum saturation is 0, to the maximum 254')\n return value", "def saturation(self):\n raise NotImplementedError", "def SaturationIteration(self):\n\t\treturn self._get_attribute('saturationIt...
[ "0.75432783", "0.7071739", "0.6463091", "0.6442149", "0.63868296", "0.638218", "0.63512975", "0.6325678", "0.6062935", "0.5933715", "0.58989453", "0.58589077", "0.5809527", "0.5754634", "0.5749245", "0.57135993", "0.5665404", "0.56161374", "0.55984116", "0.559381", "0.5559254...
0.7205243
1
Red, green, blue, and clear data is stored as 16bit values.\n
def get_color_data(self): color = [] data = self.read_byte_data(APDS_9960.CLEAR_DATA_LOW_BYTE_REG_ADDRESS, 8) for i in range(4): channel_low = data[2 * i] channel_high = data[2 * i + 1] color.append((channel_high << 8) | channel_low) return color
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Color(red, green, blue, white = 0):\n\treturn (white << 24) | (red << 16)| (green << 8) | blue", "def color565(red, green=0, blue=0):\n try:\n red, green, blue = red # see if the first var is a tuple/list\n except TypeError:\n pass\n return (red & 0xf8) << 8 | (green & 0xfc) << 3 | bl...
[ "0.6495621", "0.6425074", "0.639765", "0.63788307", "0.6322453", "0.62710625", "0.61844", "0.5983197", "0.5979095", "0.59609216", "0.5919516", "0.58895004", "0.58596253", "0.583944", "0.5836719", "0.58039385", "0.57911336", "0.57642907", "0.57500345", "0.5748845", "0.5738117"...
0.6400982
2
Causes immediate entry in to the gesture state machine. (Sets GMODE bit to 1).
def enter_immediately_gesture_engine(self): self.write_flag_data([True], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tempo_mode_switch(event):\n value = gremlin.actions.Value(event.is_pressed)\n tempo_mode_switch_container(event, value)", "def reset_gesture_engine_interrupt_settings(self):\n self.write_flag_data([True], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 2)", "def start_game_mode_0(self):\n pygam...
[ "0.64456195", "0.6436026", "0.6280486", "0.604037", "0.6018092", "0.595716", "0.5912481", "0.58597565", "0.57941246", "0.5740382", "0.5719762", "0.5699554", "0.5676315", "0.5588025", "0.5577839", "0.5577839", "0.55683905", "0.5566166", "0.5562105", "0.5535422", "0.55093366", ...
0.7515096
0
Causes exit of gesture when current analog conversion has finished. (Sets GMODE bit to 0).
def exit_gesture_engine(self): self.write_flag_data([False], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter_immediately_gesture_engine(self):\n self.write_flag_data([True], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 0)", "def end_meassuring(self):\n self.enabler = 0\n #self.t.join()\n return 1", "def reset_gesture_engine_interrupt_settings(self):\n self.write_flag_data([True...
[ "0.6204986", "0.61876327", "0.6119402", "0.60128915", "0.58192956", "0.5805768", "0.58045125", "0.5732705", "0.5648836", "0.56200397", "0.5600777", "0.5567693", "0.556139", "0.55331045", "0.5531628", "0.551762", "0.551595", "0.55131304", "0.5508788", "0.5508114", "0.5504611",...
0.7086376
0
The Gesture Proximity Enter Threshold Register value is compared with Proximity value, to determine if the gesture state machine is entered. The proximity persistence filter, is not used to determine gesture state machine entry.\n
def set_gesture_prox_enter_threshold(self, enter_thr): if not (0 <= enter_thr <= 0xFF): raise ValueError("enter_thr must be in range [0-0xFF]") self.write_byte_data(enter_thr, APDS_9960.GESTURE_PROX_ENTER_THR_REG_ADDRESS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _proximity_thread(self):\n count = 0\n while True:\n print(\"---------------- Analizo si debo detectar enemigos - PROXIMITY\")\n print(\"----- DEBO?? ::::> self.enemy_not_detected = {}\".format(self.enemy_not_detected))\n while self.enemy_not_detected:\n ...
[ "0.5757454", "0.56020814", "0.53926754", "0.5352367", "0.53383684", "0.52304655", "0.5219664", "0.51235837", "0.5075878", "0.50137794", "0.5001173", "0.50007147", "0.49675512", "0.49580908", "0.49561635", "0.49509966", "0.49507138", "0.49507138", "0.49507138", "0.49507138", "...
0.61184835
0
Gesture Gain Control. Sets the gain of the proximity receiver in gesture mode.\n
def set_gesture_gain(self, gesture_gain): if not (APDS_9960.PROXIMITY_GAIN_1X <= gesture_gain <= APDS_9960.PROXIMITY_GAIN_8X): raise ValueError("gesture_gain must be one of PROXIMITY_GAIN_NX.") self.write_flag_data([bool(gesture_gain & 0b01), bool(gesture_gain & 0b10)], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gain(self, value: int):\n self._gain = value", "def set_gain(self, *args):\n return _uhd_swig.usrp_source_set_gain(self, *args)", "def set_gain(self, *args):\n return _uhd_swig.usrp_sink_set_gain(self, *args)", "def servo_gain(self, *args, **kwargs) -> Any:\n pass", "def gai...
[ "0.72236526", "0.7142051", "0.71037644", "0.670552", "0.6676222", "0.6616772", "0.6583288", "0.654424", "0.6536786", "0.636523", "0.6328636", "0.628973", "0.6206066", "0.62003624", "0.6175178", "0.61648065", "0.6162114", "0.6161054", "0.6148989", "0.6107458", "0.60962665", ...
0.78268313
0
Gesture LED Drive Strength. Sets LED Drive Strength in gesture mode.\n
def set_gesture_led_drive(self, led_drive): if not (APDS_9960.LED_DRIVE_100_mA <= led_drive <= APDS_9960.LED_DRIVE_12_5_mA): raise ValueError("led_drive must be one of APDS_9960.LED_DRIVE_N_mA") self.write_flag_data([bool(led_drive & 0b01), bool(led_drive & 0b10)], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setStrength(self, strength):\n self.st = strength", "def _update_strength(self, event=None):\n password = self.password.GetValue()\n nd = calc_password_strength(password, WEB_SPEED)\n self.strength.UpdateStrength(nd)", "def passive(self,target):\r\n target.shield_increase...
[ "0.6159737", "0.58596337", "0.5856965", "0.58434373", "0.58287036", "0.580724", "0.5727781", "0.5701948", "0.56999344", "0.5685342", "0.5637115", "0.5624758", "0.5582452", "0.55279744", "0.55041975", "0.54653424", "0.54322726", "0.53898245", "0.53835577", "0.53776944", "0.532...
0.59419864
1
Gesture Wait Time. The wait time controls the amount of time in a low power mode between gesture detection cycles.\n
def set_gesture_wait_time(self, wait_time): if not (APDS_9960.GESTURE_WAIT_0_MILLIS <= wait_time <= APDS_9960.GESTURE_WAIT_39_2_MILLIS): raise ValueError("wait_time must be one of GESTURE_WAIT_N_MILLIS.") flag = [bool(wait_time & 0b001), bool(wait_time & 0b010), bool(wait_ti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait(wait_time):\n\n time.sleep(wait_time)", "def wait(wait_time=WAIT_TIME):\n # time.sleep(wait_time)\n pass", "def _probe_wait_time(self):\n r = self.probe_cycle_time / float(len(self.servers)) #self.probe_cycle_time=5\n r = max(.25, r) # Cap it at four per second\n ...
[ "0.57153314", "0.57148886", "0.5602625", "0.55212903", "0.54715544", "0.5466659", "0.5333803", "0.5330431", "0.5311649", "0.52756834", "0.5274838", "0.52264786", "0.51597995", "0.5156371", "0.5150652", "0.51452655", "0.51131916", "0.5106126", "0.50989145", "0.5072049", "0.506...
0.69317573
0
The offsets are used to scale an internal offset correction factor to compensate for crosstalk in the application.\n
def set_gesture_offsets(self, up_offset, down_offset, left_offset, right_offset): offsets = [up_offset, down_offset, left_offset, right_offset] if not all(map(lambda x: -127 <= x <= 127), offsets): raise ValueError("All offset must be in range [-127-127]") for i, offset in enumerate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, offset_inputs, factor_inputs, offset_outputs, factor_outputs):\n super(OffsetScaling, self).__init__()\n self.__x_offset = offset_inputs\n self.__x_factor = factor_inputs\n self.__y_offset = offset_outputs\n self.__y_factor = factor_outputs", "def layer_offse...
[ "0.6936374", "0.6909715", "0.69021463", "0.643048", "0.6356925", "0.6248796", "0.6247094", "0.6225472", "0.6215159", "0.6208611", "0.61808515", "0.6171629", "0.61010915", "0.60662127", "0.6035535", "0.60271776", "0.60044855", "0.59924906", "0.59314543", "0.5915122", "0.590867...
0.0
-1
The Gesture pulse count sets the number of pulses to be output on the LDR pin. The Gesture Length sets the amount of time the LDR pin is sinking current during a gesture pulse.\n
def set_gesture_pulse_count_and_length(self, pulse_count, pulse_length): if not (1 <= pulse_count <= 64): raise ValueError("pulse_count must be in range [1-64].") if not (APDS_9960.PULSE_LEN_4_MICROS <= pulse_length <= APDS_9960.PULSE_LEN_32_MICROS): raise ValueEr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pulse_width_record(self, pin):\n self._time = time.ticks_us()\n if self._prev_time == 0:\n self._prev_time = self._time\n return\n self.pulse_buffer.append(self._time - self._prev_time)\n self._prev_time = self._time\n self.lenth = self.lenth + 1", "d...
[ "0.58871394", "0.5812478", "0.53247136", "0.52602947", "0.5230236", "0.52116054", "0.51759845", "0.50555176", "0.50435483", "0.50218105", "0.49391502", "0.48018453", "0.47807133", "0.47458133", "0.47376844", "0.47105458", "0.46696803", "0.46682718", "0.4660123", "0.46519205", ...
0.7343269
0
Enables or disables all gesture engine related interrupts.
def enable_gesture_interrupts(self, enable_interrupts=True): self.write_flag_data([enable_interrupts], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_gesture_engine_interrupt_settings(self):\n self.write_flag_data([True], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 2)", "def __enableControls(self):\n for key in self._keyMap.keys():\n self.__acceptKeyDown(key)\n self.__acceptKeyUp(key)", "def reset_interrupts(self):\...
[ "0.6738598", "0.593146", "0.5893441", "0.58042115", "0.57367915", "0.57062775", "0.56397986", "0.5504371", "0.5497118", "0.5495267", "0.5455906", "0.5451774", "0.5438363", "0.53805196", "0.5355464", "0.53459203", "0.53361106", "0.53002137", "0.52094555", "0.5185152", "0.51653...
0.7029731
0
Gesture FIFO Threshold. This value is compared with the FIFO Level (i.e. the number of UDLR datasets) to generate an interrupt (if enabled).\n
def set_gesture_fifo_threshold(self, fifo_thr): if not (APDS_9960.FIFO_INT_AFTER_1_DATASET <= fifo_thr <= APDS_9960.FIFO_INT_AFTER_16_DATASETS): raise ValueError("fifo_thr must be one of FIFO_INT_AFTER_N_DATASET(S)") flag = [bool(fifo_thr & 0b01), bool(fifo_thr & 0b10)] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Get_FifoThreshold_Value(self):\r\n return self.__readFromRegister(self.__REG_RW_FIFO_CTRL_REG, self.__MASK_FIFO_CTRL_REG_WTM)", "def get_number_of_datasets_in_fifo(self):\n return self.read_byte_data(APDS_9960.GESTURE_FIFO_LEVEL_REG_ADDRESS)", "def Get_IsFifoGreaterOrEqualThanWatermark_Value(...
[ "0.7217201", "0.6184922", "0.6143215", "0.5877546", "0.5784132", "0.5784132", "0.5784132", "0.5784132", "0.5784132", "0.57625073", "0.5756488", "0.56993127", "0.55141264", "0.54837537", "0.54837537", "0.54837537", "0.5465431", "0.54647267", "0.54647267", "0.5459775", "0.54504...
0.67023325
1
Clears GFIFO, GINT, GVALID, GFIFO_OV and GFIFO_LVL.
def reset_gesture_engine_interrupt_settings(self): self.write_flag_data([True], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self) -> None:\n self.block = None\n self.tx = None\n self.msg = None\n self.block_batch = None\n self.tx_batch = None\n self.new_icon_score_mapper = None\n self.cumulative_step_used = 0\n self.step_counter = None\n self.event_logs = None\n ...
[ "0.6665694", "0.65390146", "0.6491511", "0.6380758", "0.6245514", "0.6240778", "0.62276393", "0.6223358", "0.622275", "0.6201187", "0.62005305", "0.61913353", "0.6165366", "0.6139739", "0.6137161", "0.608797", "0.60866565", "0.6083486", "0.60780805", "0.60539365", "0.60380644...
0.0
-1