query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Convert correlator bit mode to enum. | def bitModeToEnum(bitMode):
bits = {
0: CORR_2BIT,
1: CORR_3BIT,
2: CORR_4BIT
}
return bits[bitMode] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _calc_relay_mode(\n momentary_mode_on_value,\n momentary_follow_sense_value,\n momentary_on_off_trigger_value,\n):\n if not momentary_mode_on_value:\n return RelayMode.LATCHING\n if momentary_follow_sense_value:\n return RelayMode.MOMENTARY_C\n if momentary_on_off_trigger_value:... | [
"0.5906161",
"0.5861784",
"0.58459556",
"0.5834383",
"0.5723645",
"0.5570642",
"0.5480125",
"0.5473638",
"0.54436433",
"0.5399373",
"0.53275126",
"0.5294446",
"0.5286063",
"0.52799034",
"0.5277024",
"0.52483034",
"0.5243496",
"0.524309",
"0.5232962",
"0.51984876",
"0.5183514"... | 0.7966779 | 0 |
Return correlator band list for input astroband number or list. The return value depends on the astroband mode for the input astroband and whether the individual correlator bands are online. By default offline correlator bands will be removed from the return list. | def makeCorrBandList(astroband, includeOfflineBands = False) :
if ( subarrayNo < 1) :
raise Exception, "Invalid subarray number %d" % subarrayNo
if ( subarrayNo > 2 ) :
raise Exception, "No correlator in this subarray"
ablist = helpers.makeList(astroband)
# s.getCorrelatorBandNoSeq has t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getBandwidths( astrobands ):\n\n slPrefix = \"Control.SpectralLineCorrelator.Slcband\"\n wbPrefix = \"Control.WidebandCorrelator.Wbcband\"\n bwSuffix = \".ControlBandPoints.bandwidth\"\n spmMpPrefix = \"SignalPath.Mapping.Astroband%d.Input1\" \n corrBandMpName = spmMpPrefix + \".corrBa... | [
"0.65228856",
"0.58982337",
"0.55877364",
"0.54404026",
"0.5436914",
"0.53737473",
"0.5327891",
"0.53080434",
"0.52900267",
"0.52742434",
"0.5259635",
"0.5192897",
"0.5191274",
"0.517168",
"0.51429546",
"0.51272744",
"0.5000925",
"0.49861434",
"0.4967511",
"0.4964974",
"0.495... | 0.69317716 | 0 |
Discover if an astroband is online or offline. If any correlator bands that make up the astroband are offline, then the astroband is considered offline. | def isAstrobandOnline(band) :
cblist = makeCorrBandList(band,True)
if ( band < 9 ) :
monFormat = "Control.SpectralLineCorrelator.SlcBand%d.ControlBandPoints.%s"
elif ( band < 25 ) :
monFormat = "Control.WidebandCorrelator.WbcBand%d.ControlBandPoints.%s"
band = band - 8
elif ( ba... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_offline(self):\n return not self.is_online",
"def can_detect_offline(self):\n raise NotImplementedError(\"Abstract method, must be overridden\")",
"def astrobandOnline(band, online, subarray=DEFAULT) :\n try:\n if subarray == BOTH:\n raise Exception, \"Can't do astrobandOnl... | [
"0.6297459",
"0.62414503",
"0.55780476",
"0.55282944",
"0.5493556",
"0.5448559",
"0.5378067",
"0.53203803",
"0.52783227",
"0.5276613",
"0.52611965",
"0.5245878",
"0.52326316",
"0.5187821",
"0.5181773",
"0.513873",
"0.51151735",
"0.5092995",
"0.5053297",
"0.5036976",
"0.502690... | 0.7421881 | 0 |
Configure an astroband. See the freq command for instructions on tracking lines in both both sidebands of a single astroband. | def configastroband(band, conf, bw, fcenter, sb2=AUTO, frest='none',
imagefrest='none', bits=CORR_2BIT, decimate=False,
subarray=DEFAULT, doThrow=True) :
if subarray == BOTH:
raise Exception, "Can't do configastroband on BOTH subarrays"
if subarray == DEFAULT and subarray... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def configwideastroband(conf=\"DEFAULT\", bits=None, decimate=False, \n subarray=DEFAULT, dotsys=True, optflat=True):\n if subarray == BOTH:\n raise Exception, \"Can't do configwideastroband only on BOTH subarrays\" \n subNo = subarrayNo\n if subarray == SCI1: subNo = 1\n if su... | [
"0.6370969",
"0.5829945",
"0.5694304",
"0.5623834",
"0.54832864",
"0.5460355",
"0.54365206",
"0.5391959",
"0.53538555",
"0.5353359",
"0.53467524",
"0.53461546",
"0.5298049",
"0.5285779",
"0.5284255",
"0.5262381",
"0.52503675",
"0.51937515",
"0.5191608",
"0.51764876",
"0.51762... | 0.7142335 | 0 |
Enable or disable correlations on COBRA widebands. This command is to disable correlations when the temperature in the correlator room is alarmingly high and reenable them when the temperature is normal again. This command only affects the wideband correlator, astrobands 924. | def enableCorrelation( band=range(9,25), enable=True ) :
if ( not subarrayOwnsCorrelator(subarrayNo , CORR_WIDEBAND) ) :
print "This command is only for the Wideband correlation and this subarray does not own the Wideband correlator."
return
try:
bandl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disableCorrelation( band=range(9,25) ) : \n enableCorrelation(band, False)",
"def alarmIntegdisable(corr=CORR_ALL, subarray=DEFAULT) :\n if subarray == SCI1: acorrs = assignedCorrelator(1)\n elif subarray == SCI2: acorrs = assignedCorrelator(2)\n elif subarray == DEFAULT: acorrs =... | [
"0.708702",
"0.5884361",
"0.5867024",
"0.58371174",
"0.5648922",
"0.550957",
"0.5457643",
"0.5300708",
"0.529055",
"0.5256296",
"0.52493954",
"0.51568544",
"0.500385",
"0.48554188",
"0.48498443",
"0.4843008",
"0.48411706",
"0.4836802",
"0.48284262",
"0.48272127",
"0.48200884"... | 0.70892817 | 0 |
Disable correlations on COBRA widebands. This command is to be used when the temperature in the correlator room is alarmingly high. This command only affects the wideband correlator, astrobands 924. | def disableCorrelation( band=range(9,25) ) :
enableCorrelation(band, False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alarmDisableCorrelator(nums=0):\n\n # support using 0 as a wildcard meaning \"all bands\"\n if nums == 0:\n nums = range(1, 25)\n\n m = [helpers.getAstroBandName(elem) for elem in helpers.makeList(nums)]\n alarmMpdisable(m)",
"def enableCorrelation( band=range(9,25), enable=True ) : \n... | [
"0.63286287",
"0.6170231",
"0.5906365",
"0.58820695",
"0.5632852",
"0.53899634",
"0.53198725",
"0.5233722",
"0.5222247",
"0.52207536",
"0.51702386",
"0.51438475",
"0.513244",
"0.5083642",
"0.5080653",
"0.50774455",
"0.506213",
"0.50585824",
"0.5036577",
"0.5014688",
"0.500964... | 0.8011283 | 0 |
Add the correlator of the given type to this subarray. | def addCorrelator(corrType) :
try :
s.addCorrelator(corrType)
except Exception, ex:
print(ex.errorMsg)
e = "Unable to add the %s correlator. If it is currently\n" % CORR_STRING[corrType]
e += "owned by another subarray, you will have to issue\n"
e += "removeCorrelator(%s) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subarrayOwnsCorrelator(subNo, corrType) :\n return s.subarrayOwnsCorrelator(subNo, corrType);",
"def addCompartmentType(self, *args):\n return _libsbml.Model_addCompartmentType(self, *args)",
"def add_annotation_type(self, doc, annotation_type):\n if len(doc.annotations) != 0:\n ... | [
"0.5573549",
"0.5198973",
"0.50783527",
"0.5044893",
"0.50023323",
"0.49090385",
"0.48758894",
"0.48625863",
"0.48483852",
"0.47457042",
"0.47128755",
"0.46951088",
"0.46776322",
"0.46736583",
"0.46577397",
"0.46539834",
"0.46413013",
"0.46394444",
"0.463531",
"0.46340382",
"... | 0.6902857 | 0 |
Remove the correlator of the given type to this subarray. | def removeCorrelator(corrType) :
try :
s.removeCorrelator(corrType)
except Exception, ex:
print(ex.errorMsg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def removeCompartmentType(self, *args):\n return _libsbml.Model_removeCompartmentType(self, *args)",
"def unsubscribe(self, meta_type, callback):\n try:\n self.subscribers.get(meta_type, []).remove(callback)\n except ValueError:\n pass\n try:\n self.na... | [
"0.63052374",
"0.60447836",
"0.5961167",
"0.5860985",
"0.57976204",
"0.5753245",
"0.56893265",
"0.5680001",
"0.55847526",
"0.55502135",
"0.54902756",
"0.5399578",
"0.5398459",
"0.5375597",
"0.5371558",
"0.532346",
"0.53169096",
"0.5311863",
"0.5311781",
"0.5309467",
"0.528613... | 0.7116738 | 0 |
Return true if subNo owns correlator corrType | def subarrayOwnsCorrelator(subNo, corrType) :
return s.subarrayOwnsCorrelator(subNo, corrType); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subarrayOwnsSingleCorrelator(subNo) :\n return s.subarrayOwnsSingleCorrelator(subNo);",
"def subarrayOwnsMultipleCorrelators(subNo) :\n return not(s.subarrayOwnsSingleCorrelator(subNo) or s.subarrayOwnsNoCorrelator(subNo));",
"def subarrayOwnsNoCorrelator(subNo) :\n return s.subarrayOwnsNoCorrelat... | [
"0.69570714",
"0.6521806",
"0.6240644",
"0.5741771",
"0.5555837",
"0.5513306",
"0.539202",
"0.519268",
"0.51813525",
"0.51725227",
"0.51623845",
"0.5157837",
"0.51450896",
"0.5143507",
"0.5134653",
"0.5086888",
"0.50413036",
"0.5040062",
"0.50358355",
"0.5021562",
"0.50058955... | 0.7609557 | 0 |
Return true if subNo owns a single correlator | def subarrayOwnsSingleCorrelator(subNo) :
return s.subarrayOwnsSingleCorrelator(subNo); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subarrayOwnsCorrelator(subNo, corrType) :\n return s.subarrayOwnsCorrelator(subNo, corrType);",
"def subarrayOwnsMultipleCorrelators(subNo) :\n return not(s.subarrayOwnsSingleCorrelator(subNo) or s.subarrayOwnsNoCorrelator(subNo));",
"def subarrayOwnsNoCorrelator(subNo) :\n return s.subarrayOwnsNo... | [
"0.68557173",
"0.6848883",
"0.6596314",
"0.623743",
"0.6051847",
"0.59892964",
"0.5937055",
"0.5906517",
"0.5822915",
"0.57441044",
"0.57017046",
"0.5695624",
"0.5676243",
"0.5606198",
"0.5591151",
"0.5583134",
"0.55760664",
"0.556057",
"0.5525837",
"0.5507653",
"0.5493841",
... | 0.7252112 | 0 |
Return true if subNo owns multiple correlators | def subarrayOwnsMultipleCorrelators(subNo) :
return not(s.subarrayOwnsSingleCorrelator(subNo) or s.subarrayOwnsNoCorrelator(subNo)); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subarrayOwnsSingleCorrelator(subNo) :\n return s.subarrayOwnsSingleCorrelator(subNo);",
"def subarrayOwnsCorrelator(subNo, corrType) :\n return s.subarrayOwnsCorrelator(subNo, corrType);",
"def subarrayOwnsNoCorrelator(subNo) :\n return s.subarrayOwnsNoCorrelator(subNo);",
"def have_own_oid(self... | [
"0.7004857",
"0.67430735",
"0.6508126",
"0.57946116",
"0.5551974",
"0.5525708",
"0.5517743",
"0.54913515",
"0.5485321",
"0.5461876",
"0.5461529",
"0.5454378",
"0.5436017",
"0.5432968",
"0.5401166",
"0.5394217",
"0.5387598",
"0.53800565",
"0.5365959",
"0.53213954",
"0.5309958"... | 0.78153515 | 0 |
Return true if subNo owns no correlator | def subarrayOwnsNoCorrelator(subNo) :
return s.subarrayOwnsNoCorrelator(subNo); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subarrayOwnsSingleCorrelator(subNo) :\n return s.subarrayOwnsSingleCorrelator(subNo);",
"def subarrayOwnsMultipleCorrelators(subNo) :\n return not(s.subarrayOwnsSingleCorrelator(subNo) or s.subarrayOwnsNoCorrelator(subNo));",
"def subarrayOwnsCorrelator(subNo, corrType) :\n return s.subarrayOwnsCo... | [
"0.7457564",
"0.73384917",
"0.6950785",
"0.6013972",
"0.59969777",
"0.59725124",
"0.5928687",
"0.5835376",
"0.5792245",
"0.5655316",
"0.563718",
"0.56194603",
"0.56186354",
"0.5528336",
"0.5474522",
"0.5473918",
"0.5463516",
"0.5441039",
"0.54385626",
"0.5433797",
"0.53583294... | 0.73549736 | 1 |
Optimize thresholds in CARMA hardware bands (noop for COBRA bands). This command will set a sequence number to be returned by the correlator library code when complete. | def optimizeThresholds(band=0, tmo=7) :
# Optimize thresholds should take <5 seconds, so set tmo to 7
bandlist = helpers.makeList(band)
cblist = makeCorrBandList(band)
# If band is offline, don't wait for it.
if ( len( cblist ) != 0 ) :
rangedCb = helpers.formatAsRanges(cblist)
c1 = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def corrBandSetup( aband, corrType ):\n\n def bandwidthToEnum( bw ):\n \"\"\"Convert input numeric bandwidth to a fixed enum.\"\"\"\n # global BW500, BW250, BW125, BW62, BW31, BW8, BW2\n bandwidths = {\n BW500: 500.0,\n BW250: 500.0/2.0,\n BW125: 500.0/4.0,\... | [
"0.5134447",
"0.497698",
"0.4936505",
"0.492589",
"0.48882788",
"0.48651153",
"0.48346126",
"0.4822611",
"0.4771616",
"0.47462997",
"0.4725015",
"0.46741113",
"0.4662426",
"0.46582332",
"0.4653577",
"0.46462318",
"0.46399012",
"0.46357852",
"0.4628793",
"0.4605712",
"0.459127... | 0.6061847 | 0 |
Flatten phases on CARMA hardware bands (noop for COBRA bands). This command will set a sequence number to be returned by the correlator library code when complete. | def flattenPhases( band = 0, tmo = 45 ) :
bandlist = helpers.makeList(band)
cblist = makeCorrBandList(band)
# If band is offline, don't wait for it.
if ( len( cblist ) != 0 ) :
rangedCb = helpers.formatAsRanges(cblist)
c1 = "Waiting for astrobands %s before turning noise on" % rangedCb
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fit_continuum(self, clobber, sender=None):\n\n # Any existing continuum determination?\n try:\n index, session = (self.current_order_index, self.parent.session)\n except AttributeError:\n return None\n\n continuum = session.metadata[\"normalization\"][\"continu... | [
"0.5065962",
"0.5047233",
"0.50330794",
"0.48544934",
"0.48387676",
"0.47855112",
"0.4717687",
"0.46841422",
"0.45728466",
"0.4540054",
"0.45294976",
"0.45159313",
"0.45081306",
"0.44978267",
"0.44977158",
"0.44967613",
"0.4489226",
"0.44882345",
"0.44878557",
"0.44783106",
"... | 0.6203538 | 0 |
Measure spectral calibration on CARMA hardware bands (noop for COBRA bands). This command will set a sequence number to be returned by the correlator library code when complete. | def calibrateSpectra( band = 0, noiseEnable = True, intTime = 10.0, tmo = 45) :
bandlist = helpers.makeList(band)
cblist = makeCorrBandList(band)
# If band is offline, don't wait for it.
if ( len( cblist ) != 0 ) :
rangedCb = helpers.formatAsRanges(cblist)
if ( noiseEnable ) : noisestat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _doCalibration(self):\n self._cmdCalibration(2)",
"def calibration(self, cal: int, /) -> None:",
"def calibration(self, pulse_min: int, pulse_max: int, pulse_centre: int, /) -> None:",
"def calibrate_device(self,event):\n message = \"\"\"Place Microphone as close as possible to speaker.\\n\... | [
"0.5688111",
"0.5619414",
"0.54762083",
"0.545381",
"0.54419345",
"0.54114103",
"0.5403431",
"0.538974",
"0.5376027",
"0.5365721",
"0.53200394",
"0.53021747",
"0.5248494",
"0.5236462",
"0.517266",
"0.5138744",
"0.5124169",
"0.509972",
"0.506811",
"0.5068007",
"0.5042844",
"... | 0.6095755 | 0 |
Performs threshold optimization, phase flattening, and passband calibration on the input bands. See help('optimizeThresholds'), help('flattenPhases'), and help('calibrateSpectra') for documentation on the individual commands. | def calbands( band = 0, tmo = 30 ) :
optimizeThresholds(band,tmo)
flattenPhases(band,tmo)
calibrateSpectra(band=band,tmo=tmo) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def optimizeThresholds(band=0, tmo=7) :\n # Optimize thresholds should take <5 seconds, so set tmo to 7\n bandlist = helpers.makeList(band)\n cblist = makeCorrBandList(band)\n # If band is offline, don't wait for it.\n if ( len( cblist ) != 0 ) :\n rangedCb = helpers.formatAsRanges(cblist)\n ... | [
"0.6598044",
"0.5516116",
"0.51753336",
"0.50831044",
"0.5083062",
"0.5073641",
"0.49681965",
"0.49477708",
"0.49461862",
"0.48917234",
"0.48720822",
"0.48474032",
"0.47887155",
"0.47865933",
"0.47822243",
"0.47402188",
"0.46983764",
"0.469177",
"0.46812314",
"0.46705264",
"0... | 0.6875286 | 0 |
Checks that all correlator bands have valid configurations. Throws an exception if any band is online and has an invalid configuration (2nd LO out of range). See RTD=>spectralCorrelator=>Setup for details on individual bands. It is recommended that all observing scripts include this command after the spectral setup has... | def checkbands() :
dontThrowException = False
success = s.checkConfig(dontThrowException)
return success | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assertCorrConfig() :\n # eventually we will want a wait on C3Gmax8 or C3GMax24 astrobands \n if ( subarrayOwnsCorrelator(subarrayNo,CORR_WIDEBAND) or subarrayOwnsCorrelator(subarrayNo,CORR_SPECTRAL) ) :\n print \"This command is currently a no-op for non-C3G correlators\"\n return\n if ( s... | [
"0.67619085",
"0.6121834",
"0.60907114",
"0.5982502",
"0.57582027",
"0.5733291",
"0.5721437",
"0.5683597",
"0.55950683",
"0.55374146",
"0.54948896",
"0.54919857",
"0.5478742",
"0.5460964",
"0.5408447",
"0.53071785",
"0.5290512",
"0.5271138",
"0.522686",
"0.52079004",
"0.51883... | 0.71009576 | 0 |
Assert correlator configuration. Currently C3G only. | def assertCorrConfig() :
# eventually we will want a wait on C3Gmax8 or C3GMax24 astrobands
if ( subarrayOwnsCorrelator(subarrayNo,CORR_WIDEBAND) or subarrayOwnsCorrelator(subarrayNo,CORR_SPECTRAL) ) :
print "This command is currently a no-op for non-C3G correlators"
return
if ( subarrayOwnsN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_configuration():\n config = Configuration()\n\n assert config.relay_pin is not None\n assert config.relay_pin >= 1\n assert config.relay_pin < 32\n assert config.seconds_between_checks > 0\n assert config.seconds_to_power_off > 0\n assert config.seconds_to_wait_after_power_on > config... | [
"0.5503123",
"0.5493085",
"0.5357124",
"0.53565276",
"0.5280575",
"0.5280575",
"0.51480776",
"0.5146665",
"0.51248163",
"0.51024705",
"0.50931686",
"0.50565785",
"0.5055608",
"0.50432163",
"0.49908352",
"0.49746826",
"0.4968224",
"0.4898519",
"0.48980814",
"0.4896364",
"0.489... | 0.78560895 | 0 |
Reorganizes an obsblock name from sci1 to sci2 | def restructurePacsObsblock( obsblockID ) :
substrings = obsblockID.split("_", 1)
if( len( substrings ) != 2 ) :
raise Exception, "Unexpected obsblock name %s" % (obsblockID)
start = 2
if( int( substrings[1][0] ) < 3):
start = 3
pObsblockID = substrings[0] + "_30" + substrings[1][sta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _block_name_base(stage, block):\n if block < 27:\n block = \"%c\" % (block + 97) # 97 is the ascii number for lowercase 'a'\n conv_name_base = \"res\" + str(stage) + block + \"_branch\"\n bn_name_base = \"bn\" + str(stage) + block + \"_branch\"\n return conv_name_base, bn_name_base",
"def... | [
"0.5947437",
"0.5599263",
"0.5549044",
"0.5411557",
"0.53322893",
"0.53154194",
"0.5293666",
"0.52788246",
"0.5239792",
"0.5176192",
"0.5124838",
"0.5122875",
"0.50959355",
"0.5082647",
"0.49902964",
"0.49886322",
"0.49735075",
"0.49654686",
"0.49645257",
"0.4956436",
"0.4956... | 0.6266186 | 0 |
Begin observations for a project. This command will contact the project database to validate the input project.obsblock. Validation means that the project.obsblock already exists in the project database or it is a commissioning project (ctNNN), summer school project (csNNN), or special project (see below)which also mus... | def newPacsProject( projectName, obsblockName, subObsblockName='', pdb=True,
attempt=1) :
myThrow("Cannot currently run PACS projects")
if(obsblockName.lower() == "none") :
m = obsblockName + " is a protected name and cannot be used "
m += "as an obsblock name" % (obsblockNa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def newProject( projectName, obsblockName, subObsblockName='', pacs=False, \n maxsens=False, subarray=DEFAULT) :\n\n useProjectDatabase = True\n if (useProjectDatabase and \"rpnt\" != projectName and \"ct013\" != projectName) :\n aiv = carma.observertools.ItemValue(\"project\",projectName)\n... | [
"0.6232386",
"0.59023374",
"0.5462125",
"0.5287918",
"0.50398856",
"0.48839322",
"0.48488358",
"0.48297235",
"0.4715697",
"0.4686789",
"0.46447957",
"0.4637209",
"0.46121097",
"0.46112105",
"0.45955724",
"0.45672008",
"0.4540704",
"0.45365438",
"0.45283625",
"0.4510689",
"0.4... | 0.6593976 | 0 |
Internal function to close out the current trial by changing the project name and taking a 0.5 sec integration. There is no effect on or interaction with the PDB. | def _closeTrial(projectName="NONE",
comment="Trial closed, ready for new project", subarray=DEFAULT) :
multiSubarray('setObsblock', subarray, projectName,"STANDBY","",1)
rtdComment(comment, subarray=subarray)
_pdbIntegration(subarray=subarray) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shutdown(self):\n rospy.loginfo(\"Stopping Project\")\n rospy.sleep(1)",
"def test_project_stop_aborted(self, get_internal_project: MagicMock):\n get_internal_project.return_value = None\n ep = exposed.ExposedProject()\n ep.stop()",
"def close(self):\n #title()\n self.exper... | [
"0.60612273",
"0.601658",
"0.5915488",
"0.5770156",
"0.5679582",
"0.5649762",
"0.56407416",
"0.54123837",
"0.5377269",
"0.53196913",
"0.5277563",
"0.52581096",
"0.52400863",
"0.52315336",
"0.52291906",
"0.51521915",
"0.51521915",
"0.5133188",
"0.5101127",
"0.5086745",
"0.5076... | 0.762831 | 0 |
Marks the current time as the start of the track for this subarray. This start time is then used to update the monitor point Control.SubarrayX.trackRuntime | def setTrackStartTime() :
s.startTrack() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_time(self, start_time):\n self._start_time = start_time",
"def start_time(self, start_time):\n self._start_time = start_time",
"def start_time(self, start_time):\n\n self._start_time = start_time",
"def start_time(self, start_time):\n\n self._start_time = start_time",
... | [
"0.6345083",
"0.6345083",
"0.62927806",
"0.62927806",
"0.62927806",
"0.62927806",
"0.62927806",
"0.62668294",
"0.6185986",
"0.6185852",
"0.61206514",
"0.61057717",
"0.6071414",
"0.60508764",
"0.60339624",
"0.6033478",
"0.6007642",
"0.59792316",
"0.5911723",
"0.59043354",
"0.5... | 0.7030668 | 0 |
Set project code to WEATHER to indicate the array is shut down due to weather. Turn off the integration alarm. Changes project database to the weather project and does a short noise source integration. | def weather(obsblock, subarray=DEFAULT) :
_closeTrial("WEATHER",
"Array stopped due to weather conditions. ", subarray=subarray)
commandlog("weather()", subarray=subarray)
newProject("ct017", obsblock, "", False, subarray=subarray)
intent("noise", "O", subarray=subarray)
# An integration is r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _closeTrial(projectName=\"NONE\", \n comment=\"Trial closed, ready for new project\", subarray=DEFAULT) :\n multiSubarray('setObsblock', subarray, projectName,\"STANDBY\",\"\",1)\n rtdComment(comment, subarray=subarray)\n _pdbIntegration(subarray=subarray)",
"def reset_target(scope) -> None:\... | [
"0.57236844",
"0.5619799",
"0.5388669",
"0.5361776",
"0.51903564",
"0.518104",
"0.5171833",
"0.5132404",
"0.51185286",
"0.509919",
"0.50985926",
"0.50909144",
"0.50884616",
"0.5080609",
"0.5071539",
"0.50325775",
"0.5029852",
"0.5018787",
"0.49985236",
"0.49942088",
"0.498730... | 0.66897166 | 0 |
Set project code to MAINTENANCE to indicate the array is shut down due to maintenance. Turn off the integration alarm. No affect/interaction with project database. | def maint(subarray=DEFAULT) :
_closeTrial("MAINTENANCE",
"Array stopped for maintenance. Integration Alarm Disabled.",
subarray=subarray)
alarmIntegdisable(subarray=subarray)
commandlog("maint()", subarray=subarray) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __periodic_maintenance__(self):\n pass",
"def handle_admindebugoff(bot, event):\n event.chan.data.debug = False;\n event.chan.save()\n event.reply(\"debugging is disabled for %s\" % event.channel)",
"def maintainance(self, on_off, instance_type):\n print((\"enabling\" if on_off else ... | [
"0.5627309",
"0.5469806",
"0.541803",
"0.5332949",
"0.52753425",
"0.5270804",
"0.5260578",
"0.52237195",
"0.5193514",
"0.5188294",
"0.51657027",
"0.5153987",
"0.51531446",
"0.5135296",
"0.5124379",
"0.5107029",
"0.506851",
"0.50468165",
"0.5007548",
"0.49991298",
"0.49888715"... | 0.65907764 | 0 |
Enable the control building alarm for the current subarray. In normal operation (no parameters), this command DOES NOT enable the alarm in other subarrays. If the hardware=True parameter is given, the alarm hardware will be switched on as well. | def alarmenable(hardware=False, subarray=DEFAULT):
# disable the alarm in hardware
if (hardware):
multiSubarray('alarmEnable', subarray, False)
# enable the alarm in hardware
if (hardware):
multiSubarray('alarmEnable', subarray, True)
sleep(2)
# warn if the... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alarmdisable(hardware=False, subarray=DEFAULT):\n if type(hardware) != bool:\n raise Exception, \"The first parameter, hardware, must be a boolean\"\n \n # disable the alarm in hardware\n if (hardware):\n multiSubarray('alarmEnable', subarray, False)\n\n # disable the fault sys... | [
"0.70628685",
"0.6104455",
"0.55884373",
"0.55223894",
"0.5475838",
"0.5446244",
"0.5409909",
"0.5314301",
"0.5270653",
"0.5270653",
"0.5270653",
"0.5270653",
"0.5270653",
"0.5270653",
"0.5270653",
"0.5270653",
"0.5270653",
"0.5270653",
"0.5270653",
"0.52280205",
"0.52266586"... | 0.7743576 | 0 |
Set condition to trigger the 1mm observing audible alarm or shut it off. This command sets the monitor point Control.SubarrayN.alarm1mm to True (ON) or False (OFF). It is up to the Fault System to trigger the audible alarm based on this monitor point. This is not an observer command, but one that is used by a script ch... | def alarm1mm(state) :
if (subarrayNo > 2) :
raise Exception, "This command is only valid for Science subarrays."
if ( state == ON ) :
s.alarm1mm( True );
return;
if ( state == OFF ) :
s.alarm1mm( False );
return;
raise Exception, "Bad input. Must be ON or OFF (no qu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alarm1mmdisable() :\n mpName = 'Control.Subarray%d.alarm1mm' %subarrayNo\n alarmMpdisable( mpName )",
"def alarm1mmrestore() :\n mpName = 'Control.Subarray%d.alarm1mm' %subarrayNo\n alarmMpenable( mpName )",
"def alarm_in_setup_change():\n setup_write(\"!M1 meas interval\", \"00:01:00\")\n ... | [
"0.6795192",
"0.60038036",
"0.59205425",
"0.53639764",
"0.525379",
"0.5189586",
"0.51384604",
"0.5041758",
"0.50153303",
"0.50120187",
"0.49966085",
"0.49573925",
"0.4941633",
"0.48825312",
"0.47544187",
"0.4751294",
"0.47331583",
"0.47113958",
"0.4673999",
"0.46537703",
"0.4... | 0.7125641 | 0 |
Alias for scriptClear() for those who get it backwards. | def clearScript(subarray=DEFAULT) :
scriptClear(subarray=subarray) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scriptClear(subarray=DEFAULT) :\n multiSubarray('setScriptState', subarray, carma.control.COMPLETED)\n multiSubarray('setScriptName', subarray, \"NONE\")",
"def controlVariablesClear() :\n s.clearScriptAll()",
"def clear():\n\n os.system(\"clear\")",
"def _do_clear(self):\n print()\n ... | [
"0.7160316",
"0.7070179",
"0.6457483",
"0.64225215",
"0.63810164",
"0.63690627",
"0.63606274",
"0.6351148",
"0.6345805",
"0.63119227",
"0.63017714",
"0.62690496",
"0.6254175",
"0.62299436",
"0.622074",
"0.61884844",
"0.61829984",
"0.6168536",
"0.61521953",
"0.6148701",
"0.613... | 0.7769165 | 0 |
Clear all of the script control variables (boolean is set to False). There are 4 different types of script control variables, | def controlVariablesClear() :
s.clearScriptAll() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self.vars = []",
"def reset(self):\n for var in self.var_list:\n var.value = None\n var.domain = copy.deepcopy(var.init_domain)",
"def reset(self):\n self._varstate = None\n self.frozen = False",
"def clear_all():\n gl = globals().copy()... | [
"0.69685525",
"0.6792774",
"0.65594727",
"0.6486979",
"0.64804095",
"0.64804095",
"0.64804095",
"0.64108974",
"0.6388572",
"0.6362844",
"0.63310015",
"0.6276415",
"0.62694186",
"0.6243053",
"0.6199096",
"0.6196313",
"0.61652887",
"0.6164904",
"0.6124811",
"0.61055803",
"0.609... | 0.8582838 | 0 |
Dumps all of the script control variable values. | def dumpScriptAll() :
for idx in range(1,101) :
b = "False"
if s.getScriptBool(idx): b = "True "
d = s.getScriptDouble(idx)
i = s.getScriptInt(idx)
st = s.getScriptString(idx)
msg = "%2i %s %12.5f %8i %s" %(idx,b,d,i,st)
print msg | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dump_var_map(self):\n vars = []\n vars.append(\"--------- VARIABLES ---------\")\n for var in self.var_map:\n vars.append(var)\n\n return vars",
"def var_dump(interp, args_w):\n for w_x in args_w:\n if w_x:\n w_x = w_x.copy() # xxx ideally we sho... | [
"0.6812104",
"0.61378425",
"0.60437447",
"0.59589374",
"0.5933434",
"0.59265774",
"0.5919141",
"0.5919141",
"0.5919141",
"0.5919141",
"0.5918586",
"0.5918586",
"0.5918586",
"0.5918586",
"0.5811385",
"0.57949096",
"0.57602614",
"0.5711157",
"0.56992555",
"0.5654225",
"0.563967... | 0.66891915 | 1 |
Send an email message from obs.org to the PI with information about the track observation. A different message is sent at the start and end of the observation. | def sendMsg(pC,principalInvestigator,email,trackFileName,start=0) :
startlst=lst()
lstsym=str(int(startlst))+":"+str(int(60*(startlst-int(startlst))))
date=str(yearMonthDay())
msg = 'To: '+email+'\n'
msg += 'From: obs@mmarray.org\n'
if start == 0:
msg += 'Subject: Your track has been ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_iemtracker(obs):\n threshold = datetime.datetime.utcnow() - datetime.timedelta(hours=3)\n threshold = threshold.replace(tzinfo=pytz.UTC)\n\n tracker = TrackerEngine(IEM.cursor(), PORTFOLIO.cursor())\n tracker.process_network(obs, 'iarwis', NT, threshold)\n tracker.send_emails()\n IEM.commi... | [
"0.6047392",
"0.5930256",
"0.59202343",
"0.586822",
"0.58068657",
"0.5760621",
"0.57577103",
"0.570033",
"0.5693378",
"0.5677406",
"0.5673065",
"0.56706476",
"0.5637678",
"0.5633572",
"0.5632186",
"0.56146246",
"0.5589418",
"0.5575034",
"0.55649513",
"0.5555863",
"0.5550379",... | 0.6733289 | 0 |
Stow the antennas out of the snow. This command should only be used if you cannot use snowtrack(). There are not many cases when snowtrack() cannot be used, but E config is one of them and a weather station failure is another. During snow stow, the 10m antennas are moved to an azimuth 60 degrees away from the wind dire... | def snowstow(windOutOf) :
print snowstow.__doc__
weather("snow")
[ovroAnts,bimaAnts,szaAnts] = antennasByType()
ovroStowPosT =windOutOf+60.0
if windOutOf < 180.0 : windDirection=windOutOf+180.0
else : windDirection=windOutOf-180.0
if ovroStowPosT < 180.0 : ovroStowPos = ovroStowPosT+180.0
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def snowtrack(lengthTime=2.0, subarray=DEFAULT) :\n print snowtrack.__doc__\n \n import etrack\n # If in E-configuration, use etrack\n if (subarrayNo == 1) and (etrack.IS_E_CONFIGURATION):\n m = \"Snowtrack not allowed in E configuration\"\n raise Exception, m\n \n weather(\... | [
"0.66961503",
"0.5904872",
"0.54886526",
"0.54766953",
"0.543557",
"0.51687306",
"0.51671773",
"0.5101945",
"0.4974943",
"0.4966216",
"0.48898572",
"0.48682976",
"0.4865038",
"0.4775351",
"0.47712338",
"0.46774948",
"0.46370578",
"0.4619034",
"0.46168867",
"0.46051925",
"0.46... | 0.6642244 | 1 |
Appends string to system script variable. | def addScriptString(indx, svar, bindx=None, delim='\n', allowDup=True,
append=True):
# Nothing to do if svar is empty
if svar == None or svar == "": return
# Add string
if append:
# add delimiter
msgAppend = svar
msgOrig = s.getScriptString(indx)
if m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addstr(self,name,string):\n\t\tself.windows[name].addstr(string)",
"def varStringMod(self, arg):\n\t\targ[0] = \"'\" + arg[0] + \"'\"\n\t\treturn arg",
"def add(self, string: str) -> None:\n self._output.append(string)",
"def add_env(v,s):\n if 0:\n if os.path.exists(s):\n tag... | [
"0.62055093",
"0.590066",
"0.57980835",
"0.5780663",
"0.5760095",
"0.5653718",
"0.5611262",
"0.5608664",
"0.55755275",
"0.5527451",
"0.5508108",
"0.54943025",
"0.5437677",
"0.54371566",
"0.5430279",
"0.5414275",
"0.5403909",
"0.532952",
"0.5326041",
"0.53104687",
"0.52972347"... | 0.62818205 | 0 |
Reset maximum track length | def setTmax(t, verbose=True):
if t == None:
s.setScriptDouble(odi.INDX_DBL_TMAX,0.0)
s.setScriptBool(odi.INDX_BOOL_TMAX,False)
if verbose:
trackMessage('Unsetting maximum track length')
else:
s.setScriptDouble(odi.INDX_DBL_TMAX,helpers.convertHms(t))
s.setScri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_track():\n global track_last_slided_pos\n global track_last_paused_pos\n \n track_pos_label.configure(text=\"00:00\")\n track_pos.set(0)\n track_last_slided_pos = 0\n track_last_paused_pos = 0",
"def reset(self):\n self.tracker.reset()\n self.total_max_q = 0.0\n ... | [
"0.6320473",
"0.6217292",
"0.618574",
"0.5946089",
"0.5885567",
"0.58650887",
"0.5842807",
"0.5821639",
"0.5781376",
"0.577064",
"0.57474893",
"0.574308",
"0.573613",
"0.5686022",
"0.56634796",
"0.5654557",
"0.5629254",
"0.562146",
"0.5619057",
"0.5589052",
"0.5581282",
"0.... | 0.6347638 | 0 |
End source/phasecalibrator cycles and observe calibrator one last time. The current integration will complete before going to the last calibrator. Also, if there are multiple phase calibrators in the track, lastcal() will only end the current phase calibrator cycle. | def lastcal():
s.setScriptBool(odi.INDX_BOOL_LASTCAL,True)
printInColor("\nWarning: If you are running the queue() program, the next\nscript in the queue file will still be executed unless\nyou comment or remove the remaining scripts!\n\n", color='blue')
trackMessage('lastcal() command issued') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stopAfterNextCal():\n s.setScriptBool(odi.INDX_BOOL_STOPNEXTCAL,True)\n trackMessage('stopAfterNextCal() command issued')",
"def _end_of_loop(self):\n\n ### LIVE FRAMERATE ###\n self.timer_ms.run(current_time=time.time())\n if self.timer_ms.isComplete():\n t_end = time.t... | [
"0.61502624",
"0.5575414",
"0.54207",
"0.52624804",
"0.52501315",
"0.5195702",
"0.5170429",
"0.51357806",
"0.5126295",
"0.5124367",
"0.50601095",
"0.498057",
"0.49718964",
"0.49683946",
"0.49361098",
"0.49279588",
"0.49279588",
"0.49268377",
"0.49182355",
"0.4904941",
"0.4891... | 0.5649107 | 1 |
Set whether or not optical pointing should be done | def doOptPoint(opnt):
s.setScriptBool(odi.INDX_BOOL_DO_OPT_POINT, opnt)
s.setScriptBool(odi.INDX_BOOL_DO_OPT_POINT_SET, True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addPointing(opnt=False):\n\n # Check optical pointing \n s.setScriptBool(odi.INDX_BOOL_LASTPOINT, False)\n if not opnt:\n s.setScriptBool(odi.INDX_BOOL_OPTRAD_VECTOR, False)",
"def set_allow_approx_motion(self, on_off):\r\n return self._arm.set_allow_approx_motion(on_off)",
"def _set_... | [
"0.6588087",
"0.63125527",
"0.61318487",
"0.59549606",
"0.5862022",
"0.5721567",
"0.57016647",
"0.5664332",
"0.56200546",
"0.55518293",
"0.5543051",
"0.5539893",
"0.55274624",
"0.542552",
"0.54222417",
"0.5385799",
"0.53756016",
"0.5370556",
"0.535706",
"0.53444815",
"0.52951... | 0.72897667 | 0 |
End source/phasecalibrator cycles after observing next observation of the phase calibrator. If there are multiple phase calibrators in the track, stopAfterNextCal() will only end the current phase calibrator cycle. | def stopAfterNextCal():
s.setScriptBool(odi.INDX_BOOL_STOPNEXTCAL,True)
trackMessage('stopAfterNextCal() command issued') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_phase():\n pass",
"def stop_cb(evt): \n speech_recognizer.stop_continuous_recognition()\n nonlocal done\n done = True",
"def stop_cb(evt):\n # print('CLOSING on {}'.format(evt))\n speech_recognizer.stop_continuous_recognition()\n global done\n done = True",
... | [
"0.5738766",
"0.5522346",
"0.5416902",
"0.5297352",
"0.5296612",
"0.5261284",
"0.5194817",
"0.5191342",
"0.5082681",
"0.50724125",
"0.50649804",
"0.50312734",
"0.5026157",
"0.50197494",
"0.4967035",
"0.49494922",
"0.4924713",
"0.4866965",
"0.4864145",
"0.4863429",
"0.48568004... | 0.60340816 | 0 |
Set True/False if the alarm should be sound at end of track. If value=None, then return True/False current value of variable. | def endTrackAlarm(value=None):
if value == None:
return (s.getScriptBool(odi.INDX_BOOL_ALARM) != 0)
else:
s.setScriptBool(odi.INDX_BOOL_ALARM, value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _isalarm(self):\n return self.dp.state()==PyTango.DevState.ALARM",
"def is_alarm():\n return _alarm",
"def isSetValue(self):\n return _libsbml.FluxBound_isSetValue(self)",
"def fungible(self, value):\n if value is not None:\n self._fungible = True if value else False",
... | [
"0.59787244",
"0.5738537",
"0.5674769",
"0.56136316",
"0.5544511",
"0.54360664",
"0.5418291",
"0.53602624",
"0.53532284",
"0.53267926",
"0.5323142",
"0.5282501",
"0.5266213",
"0.5265672",
"0.52342415",
"0.52288115",
"0.5226598",
"0.51819444",
"0.5143008",
"0.51370555",
"0.508... | 0.7868524 | 0 |
Set the name for the current configuration, e.g E07a. | def configName(name):
s.setConfigName(name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, name):\n self.settings[\"name\"] = name",
"def set_name(self, name):\n self.options['name'] = name",
"def set_name(self,name):\r\n self._name = __name",
"def set_name(self, newname=\"\"):\n self.name = newname",
"def set_name(self, application_name):\r\n se... | [
"0.75990784",
"0.72593856",
"0.71909016",
"0.71906376",
"0.7132947",
"0.7092127",
"0.7087652",
"0.70426255",
"0.70426255",
"0.70426255",
"0.70426255",
"0.70426255",
"0.70295274",
"0.70295274",
"0.70191246",
"0.70191246",
"0.70191246",
"0.70191246",
"0.6998889",
"0.69505775",
... | 0.7444697 | 1 |
Retrieve the array configuration name from the monitor system and set appropriately. | def restoreConfigName( ):
subNo = s.getSubarrayNo()
configMpName = "Control.Subarray%d.configName" %subNo
retries = 24
arrayConfig = queryString( configMpName, retries )
configName(arrayConfig) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __getitem__(self, name):\n return config_to_array(self.data[name])",
"def __getitem__(self, name):\n return self.config[name]",
"def __getitem__(self, name : str) -> Any:\n return self._client.get_config()[name]",
"def monitors_read_name(self) -> str:\n result = ctypes.c_char_... | [
"0.5907049",
"0.5621108",
"0.5614035",
"0.55263686",
"0.54542005",
"0.54503113",
"0.53544015",
"0.5326681",
"0.5297838",
"0.5222342",
"0.5202803",
"0.51868767",
"0.51785773",
"0.5176751",
"0.5176751",
"0.5176751",
"0.5145027",
"0.5136186",
"0.5087494",
"0.49911147",
"0.498683... | 0.57738537 | 1 |
Put in offsets and measure acquisition time. An optional parameter controls whether azel offsets are used or radec (equatorial) offsets. Offsets set to zero on completion. | def acqtimer(off1, off2, ants=0, azelmode = True) :
result = dict()
notdone = True
t0 = time.time()
while notdone :
if azelmode :
ret = offset(off1, off2, ants, tmo=100, waiton=ANY)
else:
ret = equatOffset(off1, off2, ants, tmo=100, waiton=ANY)
t = time.ti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def observeOffsets(antennas, sourceInfo, offsetsAz, offsetsEl, \n data, xoff, yoff, intTime, antwait=-2, niter=None):\n # Loop over offsets\n for i in range(len(xoff)):\n # Set offsets for all antennas\n offaz = [0.0] * len(antennas)\n offel = [0.0] * len(antennas)\n for j... | [
"0.6249644",
"0.5608046",
"0.5438869",
"0.54133475",
"0.54091555",
"0.53756326",
"0.5354311",
"0.5325705",
"0.5317637",
"0.527583",
"0.52652246",
"0.5150676",
"0.5132607",
"0.511077",
"0.50621986",
"0.4948096",
"0.49445495",
"0.4928753",
"0.4920454",
"0.49120563",
"0.49112818... | 0.69684196 | 0 |
Prepare antennas for move during configuration change. This routine will remove ants from their current subarray, stow them (unless otherwise specified via az/el options), shutdown all carma processes on the antenna, then shutdown the antenna computer. This routine can only be called from an engineering subarray. | def prepAntennaForMove( ants, az=None, el=None, shutdown=True ) :
antlist = helpers.makeList(ants)
thisSaNo = Subarray.getSubarrayNo()
if thisSaNo <= 2:
warning = "So as not to interfere with running science tracks, "
warning += "prepAntennaForMove can only be called from an engineer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def restoreAntenna(ants, retune=True, waiton=ALL, dotsys=True, \n dbg=False, subarray=DEFAULT):\n ants = helpers.makeList(ants)\n\n # Check for ants=0 and throw an exception if found\n if ants.count(0) > 0: raise Exception, \"ants=0 not allowed\"\n\n if len(ants) == 0: raise Exception, \"Empty a... | [
"0.68581176",
"0.6154851",
"0.5833814",
"0.5646837",
"0.5521542",
"0.52105343",
"0.5184088",
"0.51279265",
"0.5111885",
"0.5102876",
"0.50907314",
"0.49453285",
"0.49398956",
"0.49195987",
"0.491448",
"0.49054423",
"0.48941678",
"0.48632368",
"0.48368832",
"0.48355258",
"0.48... | 0.7189141 | 0 |
Initializes the linelength system for all antennas in the subarray. This command takes control of the local oscillator reference synthesizer and manually steps the frequency to measure the absolute line lenghts. The absolute lenghts are required for the correction of phase as a function of LO reference frequency. The L... | def linelengthinit() :
if subarrayNo < 3:
import LineLength
LineLength.quickinit()
else :
m = "The hardware only supports a linelength system for sci1 and sci2"
raise Exception, m | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_length(self):\n if self.nb_points <= 1:\n self.length = 0\n else:\n ldiff_degree = self.coord_list[1:] - self.coord_list[:-1]\n ldiff_meter = ldiff_degree * np.pi * EQUATORIAL_EARTH_RADIUS / 180\n ldiff_meter[:, 0] *= np.cos(self.mean_pos[1] * np.p... | [
"0.58651036",
"0.54014134",
"0.53469694",
"0.5266891",
"0.5113313",
"0.5110258",
"0.5069612",
"0.5047413",
"0.49912387",
"0.48948982",
"0.4893894",
"0.48808482",
"0.48740464",
"0.48644847",
"0.48628604",
"0.48546344",
"0.48540956",
"0.48498458",
"0.48274973",
"0.48206794",
"0... | 0.7248108 | 0 |
Takes a carma antenna number (123) and returns a string for the prefix of the antenna common monitor points for that antenna. | def antCommonPrefix(antnum):
return device.Carma(antnum).getName() + ".AntennaCommon." | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def antCommonDrivePrefix(antnum):\n return antCommonPrefix(antnum) + \"Drive.\"",
"def commonprefix(m):\r\n if not m: return ''\r\n s1 = min(m)\r\n s2 = max(m)\r\n for i, c in enumerate(s1):\r\n if c != s2[i]:\r\n return s1[:i]\r\n return s1",
"def dummy_junction24():\n r... | [
"0.63767654",
"0.545882",
"0.53817755",
"0.53438073",
"0.5331886",
"0.53292096",
"0.5325011",
"0.5312943",
"0.5302899",
"0.52905566",
"0.52855766",
"0.52598166",
"0.5226442",
"0.5200662",
"0.51981306",
"0.5173224",
"0.5147685",
"0.5139372",
"0.5135514",
"0.5089579",
"0.507680... | 0.747595 | 0 |
Takes a carma antenna number (123) and returns a string for the prefix of the antenna common drive monitor points for that antenna. | def antCommonDrivePrefix(antnum):
return antCommonPrefix(antnum) + "Drive." | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def antCommonPrefix(antnum):\n return device.Carma(antnum).getName() + \".AntennaCommon.\"",
"def start_with_start_codon(rna: str):\n return rna.find(START_CODON)",
"def start_with_the_beggining(rna: str):\n return 0",
"def get_acid_name(seq):\n term_list = []\n for i in __kmers(seq,k=3):\n ... | [
"0.7492892",
"0.5314376",
"0.5306098",
"0.5298075",
"0.52941364",
"0.52681535",
"0.5219187",
"0.51895344",
"0.5176598",
"0.5173822",
"0.5153371",
"0.5133816",
"0.50930274",
"0.5090687",
"0.506935",
"0.50385046",
"0.5014838",
"0.49957013",
"0.49564558",
"0.4956167",
"0.4931728... | 0.73306566 | 1 |
Returns other wrap azimuth choice for a specific az on a given antenna. If there is no choice in the other wrap then the input az is returned. | def _wrapChoice(az, ant):
azlimpos = queryCommonDouble("Drive.Limit.azHighSwLimitVal", ant)
azlimneg = queryCommonDouble("Drive.Limit.azLowSwLimitVal", ant)
if az+360 < azlimpos: return az+360
if az-360 > azlimneg: return az-360
return az | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_azimuth(self, p, az):\n az.value = self._get_azimuth(p, az.value)",
"def _wrapFix(az, ant):\n azlimpos = queryCommonDouble(\"Drive.Limit.azHighSwLimitVal\", ant)\n azlimneg = queryCommonDouble(\"Drive.Limit.azLowSwLimitVal\", ant)\n if az > azlimpos: return az-360\n if az < azlimneg: ... | [
"0.61522496",
"0.5870123",
"0.5626781",
"0.5579218",
"0.55327225",
"0.5496348",
"0.54850036",
"0.52684975",
"0.5227909",
"0.52067214",
"0.5146007",
"0.51213527",
"0.5114932",
"0.5094431",
"0.5086052",
"0.50646514",
"0.5057559",
"0.50555485",
"0.50372165",
"0.50106776",
"0.498... | 0.6858087 | 0 |
Return angular distance (degrees) between a ref and source. Taken directly from short.py. | def distSky(source,ref):
srcAzEl = azel(source)
refAzEl = azel(ref)
deg2rad = 180.0/math.pi
srcAz = srcAzEl[0]/deg2rad
srcEl = srcAzEl[1]/deg2rad
refAz = refAzEl[0]/deg2rad
refEl = refAzEl[1]/deg2rad
cosDist = math.sin(refEl)*math.sin(srcEl) + \
math.cos(refEl)*math... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance(source,ref):\n if 1:\n srcAzEl = subarrayControl.s.azel(source,0.0);\n refAzEl = subarrayControl.s.azel(ref,0.0);\n deg2rad = 180.0/math.pi;\n srcAz = srcAzEl[0]/deg2rad;\n srcEl = srcAzEl[1]/deg2rad;\n refAz = refAzEl[0]/deg2rad;\n refEl = r... | [
"0.7559642",
"0.63710743",
"0.6324561",
"0.6217934",
"0.61901504",
"0.61725974",
"0.59843516",
"0.5848393",
"0.5810738",
"0.5801446",
"0.57833564",
"0.5772321",
"0.5760597",
"0.5754589",
"0.5721188",
"0.5607297",
"0.5591862",
"0.5572229",
"0.5566459",
"0.55430853",
"0.5530293... | 0.6994309 | 1 |
List the current 3mm offsets for all antennas. This command can be run from any subarray. | def list3mmPointing() :
p3mm = _radioPointingSetup(RX3MM, range(1,24))
# output commands for the current 3 mm constants
for i in range(1,24):
print "radio3mmPointingConstants(%6.2f, %5.2f, %5.2f, %2i)" \
%(p3mm[i-1][0], p3mm[i-1][1], p3mm[i-1][2], i) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _getoffsets(isMountoffset):\n mplist = list()\n for i in range(23) :\n a = i+1\n mp = device.Carma(a).getName() + \".AntennaCommon.Drive.Point.\"\n if (isMountoffset): mp += \"mountOffset\"\n else: mp += \"offset\"\n mpaz = mp + \"Az\"\n mpel = m... | [
"0.6298957",
"0.584171",
"0.55187047",
"0.54696965",
"0.5365225",
"0.5267465",
"0.5198149",
"0.5095262",
"0.5080789",
"0.5050708",
"0.5013974",
"0.4973104",
"0.49660915",
"0.49382102",
"0.49262902",
"0.49142644",
"0.4861401",
"0.48566976",
"0.48566976",
"0.48536363",
"0.48463... | 0.6319312 | 0 |
list the current 1mm offsets for all antennas. This command can be run from any subarray. | def list1mmPointing() :
p1mm = _radioPointingSetup(RX1MM, range(1,16))
# output commands for the current 1 mm constants
for i in range(1,16):
print "radio1mmPointingConstants(%6.2f, %5.2f, %5.2f, %2i)" \
%(p1mm[i-1][0], p1mm[i-1][1], p1mm[i-1][2], i) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _getoffsets(isMountoffset):\n mplist = list()\n for i in range(23) :\n a = i+1\n mp = device.Carma(a).getName() + \".AntennaCommon.Drive.Point.\"\n if (isMountoffset): mp += \"mountOffset\"\n else: mp += \"offset\"\n mpaz = mp + \"Az\"\n mpel = m... | [
"0.66314715",
"0.6135641",
"0.5860272",
"0.58340955",
"0.55722463",
"0.54873574",
"0.5480766",
"0.5435904",
"0.5343687",
"0.5292275",
"0.5285656",
"0.5219673",
"0.5188564",
"0.51864374",
"0.51208794",
"0.50726646",
"0.5057414",
"0.50538135",
"0.50479156",
"0.50453085",
"0.499... | 0.6336081 | 1 |
List the current 1cm offsets for all antennas. This command can be run from any subarray. | def list1cmPointing() :
p1cm = _radioPointingSetup(RX1CM, range(1,24))
# output commands for the current 1 cm constants
for i in range(1,24):
print "radio1cmPointingConstants(%6.2f, %5.2f, %5.2f, %2i)" \
%(p1cm[i-1][0], p1cm[i-1][1], p1cm[i-1][2], i) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _getoffsets(isMountoffset):\n mplist = list()\n for i in range(23) :\n a = i+1\n mp = device.Carma(a).getName() + \".AntennaCommon.Drive.Point.\"\n if (isMountoffset): mp += \"mountOffset\"\n else: mp += \"offset\"\n mpaz = mp + \"Az\"\n mpel = m... | [
"0.643205",
"0.6040211",
"0.59831065",
"0.59063154",
"0.56265956",
"0.55534226",
"0.5473489",
"0.53666294",
"0.5333026",
"0.526643",
"0.52507526",
"0.5201533",
"0.51356727",
"0.5096927",
"0.5055142",
"0.49765915",
"0.49765915",
"0.49673194",
"0.49671245",
"0.49288037",
"0.490... | 0.6153735 | 1 |
Version of send_head that support CGI scripts | def send_head(self):
if self.is_cgi():
return self.run_cgi()
else:
return SimpleHTTPServer.SimpleHTTPRequestHandler.send_head(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_head(self):\n path = self.path\n # separate the query\n i = path.find( '?' )\n if i >= 0:\n query = path[ i: ]\n path = path[ : i ]\n else:\n query = ''\n if os.path.isdir( '.' + path ): # os.getcwd() ?\n # check if index.py exists\n pathindexpy = os.p... | [
"0.71186113",
"0.7072445",
"0.7043338",
"0.63623106",
"0.62240005",
"0.61107",
"0.600515",
"0.5989743",
"0.59558696",
"0.59558696",
"0.59558696",
"0.59558696",
"0.58993906",
"0.58564466",
"0.5842792",
"0.57966834",
"0.5787695",
"0.57708013",
"0.57674086",
"0.57582486",
"0.575... | 0.7657877 | 0 |
Enrich the imdb's roidb by adding some derived quantities that are useful for training. This function precomputes the maximum overlap, taken over groundtruth boxes, between each ROI and each groundtruth box. The class with maximum overlap is also recorded. | def prepare_roidb(self, imdb):
sizes = imdb.get_sizes()
roidb = imdb.roidb
for i in range(imdb.nrof_images):
roidb[i]['image'] = imdb.image_path_at(i)
roidb[i]['width'] = sizes[i][0]
roidb[i]['height'] = sizes[i][1]
gt_overlaps = roidb[i]['gt_overl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_roidb(self):\n # for pascal_voc dataset\n roidb = self.gt_roidb()\n # data argument\n if self.cfg.if_flipped is True:\n print('append flipped images to training')\n roidb = self.append_flipped_images(roidb)\n\n sizes = [PIL.Image.open(self.image_... | [
"0.62947613",
"0.6177065",
"0.6093744",
"0.60819995",
"0.59676373",
"0.5900556",
"0.5744024",
"0.5683012",
"0.5650073",
"0.5633033",
"0.5594822",
"0.55569935",
"0.55127525",
"0.5484376",
"0.5422571",
"0.5390029",
"0.53889686",
"0.53777176",
"0.5363809",
"0.5360346",
"0.535545... | 0.7132294 | 0 |
Generate a Pegasus tutorial workflow. | def tutorial(self, env=TutorialEnv.LOCAL_MACHINE, example=TutorialExample.SPLIT, workflow_dir=None):
if not env:
raise Exception('An environment option should be provided (e.g., TutorialEnv.LOCAL_MACHINE).')
if not example:
raise Exception('A tutorial workflow should be provided ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gen_tutorials(repo_dir: str) -> None:\n with open(os.path.join(repo_dir, \"website\", \"tutorials.json\"), \"r\") as infile:\n tutorial_config = json.loads(infile.read())\n\n tutorial_ids = [x[\"id\"] for v in tutorial_config.values() for x in v]\n tutorial_dirs = [x.get(\"dir\") for v in tutor... | [
"0.67753446",
"0.62299657",
"0.6077962",
"0.60061926",
"0.599782",
"0.59875387",
"0.59330463",
"0.58497566",
"0.58269465",
"0.5810097",
"0.576157",
"0.5755149",
"0.57495797",
"0.57256716",
"0.5679493",
"0.56505334",
"0.5649622",
"0.56029904",
"0.5578672",
"0.55577457",
"0.555... | 0.78688043 | 0 |
Print a list of output files. | def outputs(self):
if not self.output_dir:
raise Exception('No output directory is configured.')
outputs = [os.path.join(root, name)
for root, dirs, files in os.walk(self.output_dir)
for name in files]
for f in outputs:
print(f.repl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_out(self, *lst):\n self.print2file(self.stdout, True, True, *lst)",
"def oprint(message, files):\n for file in files:\n print(message, file=file)",
"def list_output_files(self):\r\n fname = self.__get_output_filename()\r\n return [fname] if fname else []",
"def do_files... | [
"0.71666247",
"0.6986485",
"0.69479764",
"0.6688843",
"0.664149",
"0.65403795",
"0.64839077",
"0.62587917",
"0.6241118",
"0.62407506",
"0.6237926",
"0.6213133",
"0.61910677",
"0.61746985",
"0.60794526",
"0.60629255",
"0.605812",
"0.6006705",
"0.5980807",
"0.59651256",
"0.5965... | 0.7076018 | 1 |
Inspect an output file. | def inspect(self, path):
if not path:
raise Exception('A path to an output file should be provided. '
'Use outputs() to obtain a list of output files.')
with open(self.output_dir + '/' + path) as file:
for line in file:
print(line) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parsePlanOutput(outputFile, testTempFile):\n status = False\n outputFileRead = open(outputFile, \"r\") \n for line in outputFileRead.readlines():\n if re.search(\"Objects \\*{25}\", line) != None:\n status = True\n if status:\n testTempFile.write(line)\n if status == False:\n sy... | [
"0.58869696",
"0.584433",
"0.5764194",
"0.57405293",
"0.56826556",
"0.5601478",
"0.55892545",
"0.5565464",
"0.55371916",
"0.54614437",
"0.54562044",
"0.5421926",
"0.53945446",
"0.5328415",
"0.53129506",
"0.5310114",
"0.52989644",
"0.52939594",
"0.5281504",
"0.52688336",
"0.52... | 0.6763707 | 0 |
Uses keys to replace strings at the directory, filename, and text levels. | def repl_file(self, dir, file, dirkey, filekey, txtkey):
startloc = os.path.join(self.loc, dir, file)
newdir = self.dictreplace(dir, dirkey)
newfile = self.dictreplace(file, filekey)
enddir = os.path.join(self.loc, newdir)
endloc = os.path.join(enddir, newfile)
if not os.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def replace_keys(parent_path, old_key, new_key):\n\n for subdirs, dirs, files in os.walk(parent_path):\n for file in files:\n os.rename(os.path.join(subdirs, file), os.path.join(subdirs, file.replace(old_key,new_key)))\n for i in range(len(dirs)):\n new_name = dirs[i].replace... | [
"0.65923476",
"0.61325896",
"0.590063",
"0.5836015",
"0.5731576",
"0.5686947",
"0.5642059",
"0.5595601",
"0.55755085",
"0.5560886",
"0.54415673",
"0.5425035",
"0.5405759",
"0.5385948",
"0.53856915",
"0.536941",
"0.5324997",
"0.5292047",
"0.5277423",
"0.5275525",
"0.52568114",... | 0.6572058 | 1 |
Takes a string rule and determines if the string matches that rule. | def stringcheck(self, rule, string):
if not "*" in rule:
return rule in string
elif rule[0] == "*":
return string.endswith(rule[1:])
elif rule[-1] == "*":
return string.startswith(rule[:-1])
else:
start, end = rule.split("*")
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsIt(rule,cstr):\n try:\n if(oilcc_isIt[rule].search(cstr)):\n return True\n else:\n return False\n except:\n return False",
"def matches_rule(word):\n return re.search(pattern, word)",
"def _match_rule(self, name: str, rule: str) -> bool:\n if... | [
"0.6912381",
"0.6793155",
"0.6757989",
"0.6755887",
"0.64468634",
"0.6373423",
"0.62784255",
"0.62050515",
"0.61833984",
"0.61234087",
"0.6119311",
"0.6119255",
"0.60224366",
"0.6013743",
"0.5964268",
"0.5962319",
"0.59329265",
"0.59320724",
"0.58433694",
"0.58417547",
"0.582... | 0.8225092 | 0 |
Does stringcheck for all the given rules, and determines if any of them applies. | def check_all_rules(self, rulelist, string):
checks = []
for rule in rulelist:
checks.append(self.stringcheck(rule, string))
return True in checks | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stringcheck(self, rule, string):\n if not \"*\" in rule:\n return rule in string\n elif rule[0] == \"*\":\n return string.endswith(rule[1:])\n elif rule[-1] == \"*\":\n return string.startswith(rule[:-1])\n else:\n start, end = rule.split(... | [
"0.6447017",
"0.6287805",
"0.6199133",
"0.5915023",
"0.58895576",
"0.58005023",
"0.5792323",
"0.5785618",
"0.57185185",
"0.56370646",
"0.56111664",
"0.55919105",
"0.5582149",
"0.5559069",
"0.54843974",
"0.5484084",
"0.54292095",
"0.54084337",
"0.5401505",
"0.53901595",
"0.538... | 0.76779884 | 0 |
Uses a dictionary as a key for string replacements. | def dictreplace(self, string, keydict):
for old, new in keydict.items():
string = string.replace(old, new)
return string | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def replacer(s,replace_dict):\n for k,v in replace_dict.items(): s = s.replace(k,v)\n return s",
"def replace(instring, indict):\n indict = dict(indict)\n for key in indict:\n instring = instring.replace(key, indict[key])\n return instring",
"def replace_by_dict(source_string, mapping):\n... | [
"0.78926927",
"0.7417743",
"0.73105955",
"0.72577405",
"0.7110021",
"0.6787178",
"0.6777643",
"0.6766052",
"0.66884285",
"0.66720575",
"0.66538024",
"0.6652432",
"0.65591717",
"0.6504223",
"0.6473671",
"0.6456878",
"0.64566296",
"0.64377874",
"0.6437747",
"0.64372575",
"0.642... | 0.8023328 | 0 |
Deconstruct the FloatRangeField into serializable components. | def deconstruct(self):
name, path, args, kwargs = super(FloatRangeField, self).deconstruct()
del kwargs['max_length']
return name, path, args, kwargs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getFloat(self):\n try:\n data, n = self._buf.pop(_F_LEN)\n \n if n != _F_LEN:\n raise SerializationError('There is not enough data left.')\n \n return _F_STRUCT.unpack(data)[0]\n except StructError as e:\n raise Seri... | [
"0.5398457",
"0.5393584",
"0.51457995",
"0.5049726",
"0.50301224",
"0.5011639",
"0.50101024",
"0.49991855",
"0.49492478",
"0.49452984",
"0.49320596",
"0.4929214",
"0.49285436",
"0.49276838",
"0.49017966",
"0.48877838",
"0.48825708",
"0.48511657",
"0.48147455",
"0.4800734",
"0... | 0.737736 | 0 |
Deconstruct the DateTimeListField into serializable components. | def deconstruct(self):
name, path, args, kwargs = super(DateTimeListField, self).deconstruct()
kwargs['objects'] = self.objects
return name, path, args, kwargs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deconstruct(self):\n return super(\n AutoDateTimeField, self).deconstruct()",
"def _to_serialize_list(value):\n return [v.serialize() for v in value]",
"def deconstruct_datetime(self, date: datetime) -> List[int]:\n year, month, day, hour, _, _, _, _, _ = date.timetuple()\n ... | [
"0.65117496",
"0.57819253",
"0.5714718",
"0.56896156",
"0.5685041",
"0.56283945",
"0.55598015",
"0.5500175",
"0.5479843",
"0.545604",
"0.5448795",
"0.54457337",
"0.54223335",
"0.53673184",
"0.53414214",
"0.5293339",
"0.5262901",
"0.526114",
"0.5244337",
"0.5218316",
"0.520067... | 0.7798639 | 0 |
Plays the memory with a given startlist of numbers for a certain amount of rounds. Use a dictionary to keep track of the last occurences of numbers for efficiency. | def play_game(numbers, rounds):
# Init memory with the starting numbers
memory = {}
for i, n in enumerate(numbers):
memory[n] = i
# Play the game for the given amount of rounds
while len(numbers) < rounds:
cur_index = len(numbers) - 1
last_num = numbers[cur_index]
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def perform_round(lst,number_of_passes):\n cursor=lst.head\n while cursor.turn != True:\n cursor=cursor.next\n cursor.turn=False\n round_string = \"The music starts (\" + str(number_of_passes) + \"):\"\n for turn in range(0,abs(number_of_passes)):\n round_string = str(round_string) + c... | [
"0.579184",
"0.57782227",
"0.5646055",
"0.54991066",
"0.5400147",
"0.53532016",
"0.5341199",
"0.530187",
"0.52808553",
"0.52095217",
"0.51808715",
"0.5173777",
"0.51443136",
"0.51388",
"0.51331514",
"0.5126243",
"0.51252717",
"0.50712013",
"0.505735",
"0.50533915",
"0.5026892... | 0.7381086 | 0 |
Localize image using Cascade classifier with Haarlike features. | def localizeLP(img):
# preprocess
gray_img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# using cascade classifier to detect license plate
# the trained classifier is not good, retrain to get better results.
# pre-trained classifier at: https://github.com/openalpr/openalpr/tree/master/runtime_data/region
cascade = cv2.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def collate_fn(batch):\n # Unzip the batch\n imgs,qs, answers = list(zip(*batch))\n\n # concatenate the vectors\n imgs = torch.stack(imgs)\n \n #concatenate the labels\n q = torch.stack(qs)\n a = torch.stack(answers)\n \n return imgs, q, a",
"... | [
"0.5748481",
"0.564642",
"0.5636013",
"0.56356776",
"0.5615261",
"0.5536735",
"0.55229443",
"0.54977804",
"0.54853445",
"0.5465233",
"0.5464229",
"0.54625404",
"0.54576737",
"0.5436323",
"0.53961796",
"0.5374263",
"0.53548074",
"0.5338206",
"0.5330387",
"0.53137565",
"0.52880... | 0.6315925 | 0 |
Tests _fully_qualified_typename and _qualified_typename. | def test_qualified_typename(self):
self.assertEquals(
'modules.courses.triggers_tests.FunctionsTests',
triggers._fully_qualified_typename(self.__class__))
self.assertEquals(
'triggers_tests.FunctionsTests',
triggers._qualified_typename(self.__class__)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_qualified(obj):\n return obj.is_qualified()",
"def is_restrict_qualified(self):\r\n return conf.lib.clang_isRestrictQualifiedType(self)",
"def parse_typename(typename):\n if typename is None:\n raise ValueError(\"function type must be provided\")\n idx = typename.rfind(\"/\")\n ... | [
"0.56892884",
"0.55367714",
"0.54135007",
"0.5163306",
"0.51539487",
"0.5059008",
"0.5058109",
"0.49659324",
"0.4955711",
"0.49309996",
"0.49297294",
"0.4924386",
"0.49218565",
"0.49099782",
"0.48829246",
"0.4870979",
"0.48644233",
"0.48635703",
"0.48507825",
"0.48354822",
"0... | 0.7428457 | 0 |
Tests validate_when and validate. | def test_validate(self):
# Instances of datetime.datetime simply pass through as-is.
self.assertEquals(self.dt_when,
self.TDTT.validate_when(self.dt_when))
# Date/time in string form should be in ISO-8601 format.
self.assertEquals(self.dt_when,
self.TDTT.validate... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_validate(self):\n pass",
"def test_validators():",
"def validate():",
"def test_is(self):\n invalid = self.TDTT()\n self.check_invalid_is(invalid)\n\n valid = self.TDTT(when=self.txt_when)\n self.check_valid_is(valid)",
"def test_field_rules():",
"def _validate... | [
"0.7223889",
"0.7004105",
"0.6632455",
"0.63061345",
"0.6280972",
"0.6250253",
"0.61987627",
"0.6184117",
"0.61796606",
"0.61786795",
"0.61786795",
"0.6178419",
"0.61129487",
"0.6103459",
"0.60935664",
"0.6049328",
"0.6044717",
"0.6044717",
"0.6044717",
"0.6044717",
"0.604471... | 0.70431215 | 1 |
Tests inplace sorting of DateTimeTriggers by ascending `when`. | def test_sort(self):
expected = [
self.TDTT(when=self.dt_when - (3*self.SORT_DELTA)),
self.TDTT(when=self.dt_when - self.SORT_DELTA),
self.TDTT(when=self.dt_when),
self.TDTT(when=self.dt_when + self.SORT_DELTA),
self.TDTT(when=self.dt_when + (2*self.SO... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sortByTimeGenerated(self, records, verbose=False, in_place=False):\n tmp = records\n if (verbose):\n print \"[EVT] Sorting by time generated\"\n\n swapped = True\n while swapped:\n swapped = False\n for i in xrange(len(tmp)-1):\n ni = ... | [
"0.643479",
"0.58211726",
"0.5709898",
"0.55527586",
"0.5481054",
"0.54639983",
"0.54604423",
"0.5438183",
"0.5361368",
"0.53487635",
"0.530965",
"0.5274343",
"0.52588004",
"0.5255942",
"0.5200478",
"0.51999944",
"0.5174421",
"0.5174109",
"0.5168562",
"0.51667756",
"0.5142177... | 0.72124404 | 0 |
Checks payload_into_settings, from_payload, set_into_settings. | def check_payload_into_settings(self, cls, settings_name):
payload, expected_triggers = self.create_payload_triggers()
expected_settings = {'publish': {settings_name: expected_triggers}}
settings = {}
cls.payload_into_settings(payload, self.course, settings)
self.assertItemsEqual... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_settings(self, settings):\n pass",
"def check_settings(self):\n pass",
"def check_settings(self):\r\n pass",
"def validate_and_transfer_matching_settings(self, origin_settings, destination_settings):\n for name, dest_value in destination_settings.items():\n ... | [
"0.67614985",
"0.61143166",
"0.60716796",
"0.5964747",
"0.5959951",
"0.5803888",
"0.5774146",
"0.5747484",
"0.5520605",
"0.55154634",
"0.54156154",
"0.5373282",
"0.5368625",
"0.53534275",
"0.5329817",
"0.5316485",
"0.53031826",
"0.5296858",
"0.52752376",
"0.5250135",
"0.52351... | 0.7207848 | 0 |
Tests validate, validate_content, ..._type, ..._type_and_id. | def test_validate(self):
content_id = 1
for ct in self.CONTENT_TYPES:
self.assertEquals(ct, self.TCT.validate_content_type(ct))
content = self.TCT.validate_content_type_and_id(ct, content_id)
self.assertTrue(content)
content_id += 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_validate(self):\n pass",
"def validate():",
"def test_validators():",
"def validate(cls, **kwargs: Any) -> None: # pragma no cover",
"def __validate():\n # TODO: implement",
"def _validate(self):\n pass",
"def validate(self):",
"def validate(self):",
"def validate(self):\... | [
"0.7059156",
"0.6494685",
"0.6374575",
"0.63122094",
"0.62782127",
"0.62331545",
"0.6205417",
"0.6205417",
"0.6199205",
"0.61803764",
"0.6126146",
"0.6122847",
"0.608884",
"0.60551554",
"0.60551554",
"0.6048767",
"0.60344577",
"0.60168785",
"0.60168785",
"0.60168785",
"0.6016... | 0.77192247 | 0 |
Tests encode and encoded. | def test_encode(self):
pass # TODO(tlarsen) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_encode():",
"def test_encode(self):\n assert url_encoder.encode(1) == 'TheStakeOut'\n assert url_encoder.encode(800) == 'TheStockTip-TheSeven'\n assert url_encoder.encode(99999) == 'MaleUnbonding-TheConversion-TheAndreaDoria'",
"def test_encode(self):\n for (input, output) ... | [
"0.829749",
"0.7552924",
"0.7498625",
"0.7425797",
"0.72987723",
"0.72037345",
"0.7195854",
"0.7184268",
"0.70167744",
"0.6979981",
"0.69634086",
"0.69458646",
"0.6938445",
"0.69010174",
"0.68710065",
"0.6824702",
"0.68218",
"0.6819064",
"0.67902136",
"0.674057",
"0.67349476"... | 0.8711291 | 0 |
Tests decode, decoded, type, id. | def test_decode(self):
pass # TODO(tlarsen) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_decode():",
"def test_decode(self):\n self.assertEqual(\n hex_to_b64(self.hex_string),\n self.expect_result\n )",
"def test_data_type_id(self):\n self.assertTrue(self.tester.data_type(ret_id=True), 2)",
"def test_encode_decode(self):\n assert self._t... | [
"0.69751924",
"0.64979476",
"0.63591725",
"0.63111717",
"0.62814766",
"0.626682",
"0.6266714",
"0.6238487",
"0.61316234",
"0.61301476",
"0.6088435",
"0.6065776",
"0.60509026",
"0.6036641",
"0.6000089",
"0.59926146",
"0.5986662",
"0.594807",
"0.5935184",
"0.5903433",
"0.585598... | 0.7387505 | 0 |
Tests encoded_defaults for default content availability. | def test_encoded_defaults(self):
self.assertEquals(
{'availability': courses.AVAILABILITY_UNAVAILABLE},
self.TCT.encoded_defaults()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_encoded_defaults(self):\n # Some milestone value *must* be supplied as a keyword argument.\n self.assertEquals(None, self.TMT.encoded_defaults())\n\n expected = {\n 'availability': availability_options.AVAILABILITY_NONE_SELECTED,\n }\n\n for km in self.TMT.KNO... | [
"0.6882404",
"0.6022345",
"0.5952608",
"0.59206825",
"0.59206825",
"0.59206825",
"0.5800904",
"0.5745019",
"0.57314473",
"0.5730746",
"0.5709854",
"0.57065046",
"0.56951386",
"0.56719714",
"0.56630874",
"0.56560576",
"0.5653553",
"0.56516874",
"0.56444764",
"0.5638715",
"0.56... | 0.71467835 | 0 |
Tests act_on_settings, act_on_triggers, log_acted_on, separate. | def test_act_on_settings(self):
pass # TODO(tlarsen) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_tests(self):\n # Trigger a config change which triggers a deferred hook.\n self.run_charm_change_hook_test('configure_ovs')\n\n # Trigger a package change which requires a restart\n self.run_package_change_test(\n 'openvswitch-switch',\n 'openvswitch-switch... | [
"0.623842",
"0.623842",
"0.621745",
"0.61089045",
"0.6004984",
"0.5972395",
"0.5960642",
"0.5936052",
"0.5935933",
"0.5934627",
"0.5914928",
"0.58929944",
"0.58585495",
"0.5845517",
"0.583862",
"0.5830573",
"0.57860124",
"0.5780546",
"0.5775852",
"0.5774144",
"0.5769156",
"... | 0.698936 | 1 |
Check start/end date settings are initially not present at all. | def check_course_start_end_dates(self, start_date, end_date, env):
self.assertEquals(
start_date, courses.Course.get_named_course_setting_from_environ(
constants.START_DATE_SETTING, env))
self.assertEquals(
end_date, courses.Course.get_named_course_setting_from_en... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_date_is_still_default(self):\r\n return self.advertised_start is None and self.start == CourseFields.start.default",
"def i_see_the_set_dates(_step):\r\n verify_date_or_time(COURSE_START_DATE_CSS, '12/20/2013')\r\n verify_date_or_time(COURSE_END_DATE_CSS, '12/26/2013')\r\n verify_date_o... | [
"0.6365726",
"0.62536246",
"0.625068",
"0.6220489",
"0.6202668",
"0.60811967",
"0.60560757",
"0.6046873",
"0.60114574",
"0.5984492",
"0.59612954",
"0.59529877",
"0.5919051",
"0.58709264",
"0.58674276",
"0.5832837",
"0.5799704",
"0.5778795",
"0.5778053",
"0.57703453",
"0.57558... | 0.64336413 | 0 |
Sets start/end dates in the env dict and save Course settings. | def set_course_start_end_dates(cls, start_date, end_date, env, course):
courses.Course.set_named_course_setting_in_environ(
constants.START_DATE_SETTING, env, start_date)
courses.Course.set_named_course_setting_in_environ(
constants.END_DATE_SETTING, env, end_date)
course... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_course_start_end_dates(cls, env, course):\n courses.Course.clear_named_course_setting_in_environ(\n constants.START_DATE_SETTING, env)\n courses.Course.clear_named_course_setting_in_environ(\n constants.END_DATE_SETTING, env)\n course.save_settings(env)",
"def... | [
"0.76056725",
"0.6693804",
"0.6623653",
"0.596774",
"0.5526295",
"0.53793997",
"0.5373826",
"0.5316276",
"0.53008837",
"0.52950966",
"0.52711564",
"0.52555025",
"0.52297807",
"0.5215605",
"0.5172544",
"0.50916505",
"0.49732736",
"0.49320087",
"0.4926757",
"0.4919198",
"0.4901... | 0.85006946 | 0 |
Clears start/end dates in the env dict and save Course settings. | def clear_course_start_end_dates(cls, env, course):
courses.Course.clear_named_course_setting_in_environ(
constants.START_DATE_SETTING, env)
courses.Course.clear_named_course_setting_in_environ(
constants.END_DATE_SETTING, env)
course.save_settings(env) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_course_start_end_dates(cls, start_date, end_date, env, course):\n courses.Course.set_named_course_setting_in_environ(\n constants.START_DATE_SETTING, env, start_date)\n courses.Course.set_named_course_setting_in_environ(\n constants.END_DATE_SETTING, env, end_date)\n ... | [
"0.7170265",
"0.5950432",
"0.5559638",
"0.5531477",
"0.5512223",
"0.5477832",
"0.54643327",
"0.5199673",
"0.50414866",
"0.50282294",
"0.5017112",
"0.50159776",
"0.50101876",
"0.50023746",
"0.49994445",
"0.49873328",
"0.4944921",
"0.49434495",
"0.49427646",
"0.49107668",
"0.49... | 0.84702414 | 0 |
Common default values for modules/courses MilestoneTriggerTests. | def default_test_args(self, cls, availabilities, milestones):
cls = cls if cls is not None else self.TMT
availabilities = self.default_availabilities(cls, availabilities)
milestones = self.default_milestones(cls, milestones)
return cls, availabilities, milestones | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_set_project_default_power_schedule(self):\n pass",
"def test_Defaults(self):\n self._run(self._test_scenarios, \"Defaults\")",
"def test_init_default(self):\n self._test_init_default()",
"def test_defaults_are_overwritten(self, junit4_hooks, full_args):\n junit4_hooks._ig... | [
"0.64062476",
"0.6275275",
"0.6057469",
"0.5881225",
"0.58727926",
"0.58030194",
"0.5741579",
"0.56539375",
"0.5641394",
"0.56124616",
"0.56071043",
"0.5603774",
"0.560142",
"0.559325",
"0.5592113",
"0.5591336",
"0.5581404",
"0.5528492",
"0.5522069",
"0.55122554",
"0.5503041"... | 0.6492582 | 0 |
Checks validate and encode with course availability values. | def check_availability(self, cls=None, availabilities=None):
cls, availabilities, _ = self.default_test_args(
cls, availabilities, None)
for avail in availabilities:
self.assertEquals(avail, cls.validate_availability(avail))
self.assertEquals(avail, cls.encode_availa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_encoded_defaults(self):\n self.assertEquals(\n {'availability': courses.AVAILABILITY_UNAVAILABLE},\n self.TCT.encoded_defaults())",
"def test_course_available(self):\n \n course = Course.objects.first()\n \n self.assertTrue(course.is_course_availa... | [
"0.6136251",
"0.6085046",
"0.5855669",
"0.576699",
"0.574024",
"0.5673222",
"0.5654309",
"0.56352246",
"0.5598622",
"0.558573",
"0.55079013",
"0.54867643",
"0.5478487",
"0.5471645",
"0.54715854",
"0.54680926",
"0.5419947",
"0.539749",
"0.5391479",
"0.53740835",
"0.5311452",
... | 0.62439466 | 0 |
Checks validate_milestone and validate. | def check_milestone_validate(self, cls=None, availabilities=None,
milestones=None):
cls, availabilities, milestones = self.default_test_args(
cls, availabilities, milestones)
self.assertEquals(None, cls.validate_milestone('invalid'))
for m in milest... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checkValid(self) -> None:\n if len(self.times) != len(self.milestones):\n raise ValueError(\"Times and milestones are not the same length\")\n if len(self.times)==0:\n raise ValueError(\"Trajectory is empty\")\n for (tprev,t) in zip(self.times[:-1],self.times[1:]):\n ... | [
"0.6378415",
"0.6269639",
"0.62534237",
"0.6173257",
"0.615183",
"0.6026113",
"0.5858124",
"0.58213055",
"0.57407755",
"0.5705937",
"0.56740135",
"0.56287795",
"0.56071585",
"0.5542125",
"0.55112123",
"0.55112123",
"0.55112123",
"0.55112123",
"0.55112123",
"0.55112123",
"0.55... | 0.73656005 | 0 |
Tests encoded_defaults for default course availability. | def test_encoded_defaults(self):
# Some milestone value *must* be supplied as a keyword argument.
self.assertEquals(None, self.TMT.encoded_defaults())
expected = {
'availability': availability_options.AVAILABILITY_NONE_SELECTED,
}
for km in self.TMT.KNOWN_MILESTONES... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_encoded_defaults(self):\n self.assertEquals(\n {'availability': courses.AVAILABILITY_UNAVAILABLE},\n self.TCT.encoded_defaults())",
"def test_modes_for_course_empty(self):\r\n # shouldn't be able to find a corresponding course\r\n modes = CourseMode.modes_for_c... | [
"0.8295157",
"0.63012004",
"0.5921293",
"0.5847954",
"0.57298696",
"0.57039165",
"0.5702693",
"0.56546444",
"0.5584186",
"0.5565199",
"0.55635387",
"0.55561256",
"0.5543244",
"0.5446204",
"0.5407748",
"0.5401716",
"0.5375512",
"0.53748214",
"0.53748214",
"0.53748214",
"0.5369... | 0.67426074 | 1 |
Tests act_on_settings, act_on_triggers, log_acted_on, separate. | def test_act_on_settings(self):
pass # TODO(tlarsen) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_tests(self):\n # Trigger a config change which triggers a deferred hook.\n self.run_charm_change_hook_test('configure_ovs')\n\n # Trigger a package change which requires a restart\n self.run_package_change_test(\n 'openvswitch-switch',\n 'openvswitch-switch... | [
"0.623842",
"0.623842",
"0.621745",
"0.61089045",
"0.6004984",
"0.5972395",
"0.5960642",
"0.5936052",
"0.5935933",
"0.5934627",
"0.5914928",
"0.58929944",
"0.58585495",
"0.5845517",
"0.583862",
"0.5830573",
"0.57860124",
"0.5780546",
"0.5775852",
"0.5774144",
"0.5769156",
"... | 0.698936 | 0 |
Loads all sounds in l. May prevent parachute errors. | def load_sounds(l):
if not pygame.mixer.get_init():
pygame.mixer.init()
sounds = [pygame.mixer.Sound(f) for f in l]
return dict(zip(l, sounds)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_sounds(self, folder):\n pygame.mixer.init()\n cwd = os.getcwd()\n dir = cwd + '/' + folder\n files = os.listdir(dir)\n for file in files:\n snd = pygame.mixer.Sound(dir + '/' + file)\n self.sounds.append(snd)",
"def __load_all_sounds(sounds_dict, ... | [
"0.7370936",
"0.7199157",
"0.6451483",
"0.6300559",
"0.6298802",
"0.6274747",
"0.62063986",
"0.6048684",
"0.5971862",
"0.59680766",
"0.5933179",
"0.5880798",
"0.58624417",
"0.5779353",
"0.5754411",
"0.5747006",
"0.5724687",
"0.567971",
"0.5667842",
"0.56595975",
"0.56235003",... | 0.7959696 | 0 |
Play sound. Just a wrapper around the pygame rountine. If a dictionary is supplied, this will look to see if a preloaded sound object is inside. | def play_sound(f, wait=False, dic=None):
if not pygame.mixer.get_init():
pygame.mixer.init()
if dic:
sound = dic[f]
else:
sound = pygame.mixer.Sound(f)
sound.play()
if wait:
while pygame.mixer.get_busy():
events.wait(0.01)
return sound | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def play_sound(self, sound) -> None:\n pass",
"def playSound(self,sound):\n sound.play()",
"def play(sound):\n if SOUNDDIR != \"\":\n call([\"aplay\", SOUNDDIR + sound])",
"def play_sound(self, sound):\n try:\n if self.se_volume != 0:\n self.sound_lib[so... | [
"0.75804734",
"0.7244587",
"0.7210693",
"0.7203287",
"0.71800363",
"0.6999076",
"0.69224423",
"0.68853384",
"0.68328685",
"0.67799264",
"0.6749946",
"0.674491",
"0.6668335",
"0.6664186",
"0.65898",
"0.6553095",
"0.65028334",
"0.6490294",
"0.64543456",
"0.64322513",
"0.6397571... | 0.73427707 | 1 |
Play the correct or incorrect sound depending on the Boolean corr. | def play_feedback(corr):
if not PRELOADED_FEEDBACK:
global FEEDBACK_SOUNDS
p = os.path.join(os.path.dirname(os.getcwd()), 'stimuli', 'audio')
FEEDBACK_SOUNDS = [pygame.mixer.Sound(os.path.join(p, 'Wrong.wav')),
pygame.mixer.Sound(os.path.join(p, 'Correct.wav')... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sound(bool): #py:sound\n RUR._sound_(bool)",
"def configure_with_sound_control(self):\n\t\tfor q in self.questions:\n\t\t\tq[\"question\"] = sc(q[\"question\"]) #reconfiguring the question to a sound control object\n\t\t\tif not q.get(\"on_wrong\") == None: #making sure that the on_wrong option is not se... | [
"0.71450335",
"0.6558936",
"0.6515834",
"0.63772386",
"0.6349702",
"0.6348677",
"0.6283701",
"0.61794937",
"0.60397595",
"0.60179764",
"0.59987295",
"0.59298086",
"0.5889833",
"0.5867754",
"0.5745315",
"0.5731073",
"0.5715341",
"0.5687437",
"0.5669852",
"0.56673366",
"0.56634... | 0.7407674 | 0 |
Get abilities that the agent is capable of running | async def capabilities(self, abilities):
capabilities = []
for ability in abilities:
if self.privileged_to_run(ability) and ability.find_executors(self.executors, self.platform):
capabilities.append(ability)
return capabilities | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def capabilities(self):\n return []",
"def capabilities(self):\n pass",
"def capabilities(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"capabilities\")",
"def allowed_capabilities(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(sel... | [
"0.67862815",
"0.6529786",
"0.6407793",
"0.63755095",
"0.63755095",
"0.63590306",
"0.62482405",
"0.6053558",
"0.6017414",
"0.6013242",
"0.596813",
"0.595811",
"0.59305435",
"0.5921104",
"0.5906278",
"0.5853147",
"0.5853147",
"0.5847606",
"0.58305615",
"0.58110666",
"0.577209"... | 0.790447 | 0 |
Get preferred executor for ability Will return None if the agent is not capable of running any executors in the given ability. | async def get_preferred_executor(self, ability):
potential_executors = ability.find_executors(self.executors, self.platform)
if not potential_executors:
return None
preferred_executor_name = self._get_preferred_executor_name()
for executor in potential_executors:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def executor(self, name):\n return Registry.require(Executor, name)",
"def executor_object():\n try:\n return ExecutorThread.local_thread.executor_object\n except AttributeError:\n pass\n return None",
"def get_executor(max_workers: int) -> Executor:\n retur... | [
"0.638568",
"0.6196815",
"0.5967114",
"0.59295124",
"0.5148409",
"0.5088872",
"0.5082672",
"0.5080718",
"0.50478846",
"0.50345725",
"0.50103617",
"0.49430525",
"0.49265295",
"0.49049777",
"0.49015915",
"0.48791605",
"0.4863712",
"0.4825056",
"0.48142576",
"0.48113245",
"0.480... | 0.89876074 | 0 |
Mark specified executor to remove. | def set_pending_executor_removal(self, executor_name):
if executor_name and isinstance(executor_name, str):
if executor_name in self.executors:
# Remove the executor server-side so planners can generate appropriate links immediately.
self.executors.remove(executor_nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def executor(self, new_executor):\n current_executor = self.executor\n if current_executor == new_executor:\n return\n if current_executor is not None:\n current_executor.remove_node(self)\n if new_executor is None:\n self.__executor_weakref = None\n ... | [
"0.628482",
"0.6028192",
"0.596513",
"0.5784518",
"0.5773723",
"0.5644852",
"0.5641025",
"0.5518549",
"0.5389791",
"0.53743446",
"0.5364516",
"0.5359334",
"0.53566223",
"0.5351305",
"0.5351305",
"0.5334332",
"0.53080463",
"0.52636623",
"0.52636623",
"0.52636623",
"0.5237643",... | 0.7300625 | 0 |
Mark specified executor to update its binary path to the new path. | def set_pending_executor_path_update(self, executor_name, new_binary_path):
if executor_name and new_binary_path and isinstance(executor_name, str) and isinstance(new_binary_path, str):
if executor_name in self.executors:
self._executor_change_to_assign = dict(action='update_path', e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def executor(self, new_executor):\n current_executor = self.executor\n if current_executor == new_executor:\n return\n if current_executor is not None:\n current_executor.remove_node(self)\n if new_executor is None:\n self.__executor_weakref = None\n ... | [
"0.5611104",
"0.5486753",
"0.5220842",
"0.51972806",
"0.5025277",
"0.5002137",
"0.49392906",
"0.48403326",
"0.48127034",
"0.480448",
"0.47762698",
"0.4726095",
"0.4698296",
"0.46962816",
"0.46564126",
"0.46416593",
"0.46404466",
"0.46349934",
"0.46310186",
"0.4567368",
"0.456... | 0.748904 | 0 |
Return the executor change dict and remove pending change to assign. | def assign_pending_executor_change(self):
executor_change = self.executor_change_to_assign
self._executor_change_to_assign = None
return executor_change | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_pending_executor_removal(self, executor_name):\n if executor_name and isinstance(executor_name, str):\n if executor_name in self.executors:\n # Remove the executor server-side so planners can generate appropriate links immediately.\n self.executors.remove(exe... | [
"0.59110326",
"0.535943",
"0.535604",
"0.5241402",
"0.523549",
"0.51258403",
"0.5048096",
"0.502798",
"0.50173634",
"0.5005226",
"0.49379593",
"0.49332476",
"0.4914084",
"0.48553094",
"0.48414272",
"0.4832309",
"0.48216757",
"0.48040527",
"0.4796571",
"0.478985",
"0.4731433",... | 0.7338747 | 0 |
USBD_STATUS USBD_ValidateConfigurationDescriptor( PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc, ULONG BufferLength, USHORT Level, PUCHAR Offset, ULONG Tag ); | def USBD_ValidateConfigurationDescriptor(self, emu, argv, ctx={}):
rv = ddk.STATUS_SUCCESS
ConfigDesc, BufferLength, Level, Offset, Tag = argv
return rv | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_config(self):\n pass",
"def validate_config(self):\n pass",
"def _validate_config(self):\n pass",
"def has_descriptor(self, uuid):",
"def valid_al_config_dumper(self, rule_to_validate_al_config_d, tag_index):\r\n self.required_fields[AL_CONFIG_D].attributefound()\r\... | [
"0.5637477",
"0.5637477",
"0.5588721",
"0.5466894",
"0.5458221",
"0.54119885",
"0.5392765",
"0.5309966",
"0.5293971",
"0.52836573",
"0.5221569",
"0.5193196",
"0.51759213",
"0.51461744",
"0.5135818",
"0.5132836",
"0.5128843",
"0.51150835",
"0.50967944",
"0.50754213",
"0.507183... | 0.84517133 | 0 |
Flip a two sided coin | async def flipcoin(self, ctx):
flip = random.choice([True, False])
if flip == True:
msg = 'It\'s heads!'
await ctx.send(msg)
elif flip == False:
msg = 'It\'s tails!'
await ctx.send(msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def coin(self, ctx):\n flip = random.randint(1, 2)\n if flip == 1:\n await ctx.send(\"You flipped heads!\")\n else:\n await ctx.send(\"You flipped tails!\")",
"def flip_coins(num_coins, num_flips):\n return np.random.randint(2, size=(num_coins, num_flips))",
... | [
"0.71662307",
"0.70422477",
"0.69776726",
"0.69704235",
"0.68177986",
"0.6807119",
"0.668485",
"0.6659383",
"0.664643",
"0.66284627",
"0.66097903",
"0.6542317",
"0.652815",
"0.65058815",
"0.6505187",
"0.64950174",
"0.64938545",
"0.6493833",
"0.6484777",
"0.64774853",
"0.63888... | 0.74172246 | 0 |
Capture output of parser.print_help() | def do_print_help(parser):
string_io = StringIO()
parser.print_help(file=string_io)
return string_io.getvalue() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_help():\n parser = parsersetup()\n parser.print_help()",
"def PrintHelp(self):\n self._parser.print_help()",
"def print_help(self):\n self.parser.print_help()",
"def printhelp():",
"def print_help(self):\n if self._help_subparser:\n self._help_subparser.print_hel... | [
"0.83903086",
"0.80760163",
"0.79264015",
"0.7635739",
"0.751225",
"0.7337768",
"0.7226662",
"0.7202086",
"0.71734536",
"0.7112224",
"0.7107955",
"0.7092832",
"0.70329845",
"0.70294994",
"0.7027109",
"0.7027014",
"0.70097953",
"0.69849205",
"0.6982765",
"0.6964453",
"0.693644... | 0.81906986 | 1 |
Cancel replay if it is already set to replay; Set replay if it is not set to replay, and cancel replay poll if there is one active. | def doReplay(self, cy, username, args, source):
if source != 'chat' or not cy.nowPlayingMedia:
return
rank = cy._getRank(username)
if rank < 2:
return
if self.replay != -1:
self.replay = -1
cy.sendCyWhisper('Cancelled replay.')
else... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cancel_retry(self):\n if self._cancel_retry is not None:\n self._cancel_retry.cancel()\n self._cancel_retry = None",
"def cancel_retry(self):\n if self._cancel_retry is not None:\n self._cancel_retry.cancel()\n self._cancel_retry = None",
"def cance... | [
"0.602903",
"0.602903",
"0.5621697",
"0.55837536",
"0.5533685",
"0.550521",
"0.5449166",
"0.53940284",
"0.53894967",
"0.5387946",
"0.53647715",
"0.53470606",
"0.53406376",
"0.53406376",
"0.53406376",
"0.53406376",
"0.5338463",
"0.5338463",
"0.53277963",
"0.52818286",
"0.52582... | 0.619514 | 0 |
Make a poll asking users if they would like the current video to be replayed | def makePoll(self, cy):
self.poll = True
boo = random.randint(0, 1)
pollTime = min(int(cy.mediaRemainingTime - 12), 100)
choices = ('Yes!', 'No!') if boo else ('No!', 'Yes!')
target = '3:1' if boo else '1:3'
title = ('Replay %s? (%s to replay, vote time: %s seconds)' %
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def play_random_video(self):\n\n print(\"play_random_video needs implementation\")",
"def play_random_video(self):\n #[ expression for item in list if conditional ]\n unflagged_videos = [video for video in self._video_library.get_all_videos() if not video.flagged]\n #ran_num = randran... | [
"0.6257165",
"0.62251276",
"0.61791044",
"0.6126756",
"0.6047353",
"0.5996757",
"0.5966322",
"0.5884541",
"0.58599246",
"0.58398485",
"0.5827932",
"0.58036554",
"0.5793624",
"0.5785692",
"0.5775081",
"0.57664335",
"0.57455105",
"0.566806",
"0.5665569",
"0.56539655",
"0.564993... | 0.6922726 | 0 |
This function calculates Euclidean distance between data1 and data2 | def euclidean_distance(data1, data2):
#Convert data into numpy array
array1 = np.array(data1)
array2 = np.array(data2)
#Create distance array
dist_array = np.sqrt(np.sum((array2-array1)**2, axis=1))
#Reshape array before return results
return np.reshape(dist_array, [len(dist_array)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def euclideanDistance(data1, data2):\n distance = 0\n for x in range(14):\n data1[x] = truncate(data1[x], 3)\n data2[x] = truncate(data2[x], 3)\n dist = truncate((data1[x] - data2[x]) ** 2, 3)\n distance = truncate(distance + dist, 3)\n\n # Final Euclidean distance between trai... | [
"0.85524786",
"0.8366913",
"0.8059013",
"0.7997354",
"0.7976146",
"0.79569393",
"0.7779689",
"0.7755199",
"0.7751564",
"0.7729782",
"0.7728699",
"0.7724675",
"0.7715573",
"0.7703966",
"0.7702208",
"0.76962894",
"0.75868785",
"0.75775486",
"0.75720084",
"0.7547875",
"0.7535825... | 0.84898156 | 1 |
Log error and exit when the installed version of paddlepaddle is not satisfied. | def check_version():
err = "PaddlePaddle version 1.6 or higher is required, " \
"or a suitable develop version is satisfied as well. \n" \
"Please make sure the version is good with your code." \
try:
fluid.require_version('1.6.0')
except Exception as e:
logger.error(err... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_pyversion() -> None:\n pyversion = float(str(sys.version_info[0]) + '.' + str(sys.version_info[1]))\n if not pyversion >= 3.6:\n text = f'''FAIL: You are using python {pyversion}. This pipeline was built with python 3.7.\nFAIL: use 3.6 <= python version < 3.8\nFAIL: exiting cmh_test.py'''\n... | [
"0.5620176",
"0.5560952",
"0.5543166",
"0.5491692",
"0.5484875",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"0.5476015",
"... | 0.69239944 | 0 |
Creates ImageGraphic from an image file. Scales image to match the `size` aspect ratio. | def from_image_path(cls, image_path, center_offset, size):
helper_rect = FloatRect(0, 0, size[0], size[1])
helper_rect.center = (math.floor(
center_offset[0]), math.floor(center_offset[1]))
rectangle = Rectangle.from_rect(helper_rect)
try:
image = Image(image_pat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_image(filename, size=None, scale=None):\n img = Image.open(filename)\n if size is not None:\n img = img.resize((size, size), Image.ANTIALIAS)\n elif scale is not None:\n img = img.resize((int(img.size[0]*scale), int(img.size[1]*scale)), Image.ANTIALIAS)\n return img",
"def resi... | [
"0.6706996",
"0.64298004",
"0.6426886",
"0.6371011",
"0.6324446",
"0.63069695",
"0.6246008",
"0.6162379",
"0.61532795",
"0.61101043",
"0.5961461",
"0.5923129",
"0.58784187",
"0.57978344",
"0.5787534",
"0.57551265",
"0.57425076",
"0.5733246",
"0.57178885",
"0.57105076",
"0.568... | 0.6878524 | 0 |
Draws image on `camera`. | def draw(self, camera):
camera.draw_image(self._image, self._rectangle.center(),
self._rectangle.rotation, self._rectangle.size()[1]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw(self, surface, camera=None):\n if camera:\n surface.blit(self.image, camera.apply(self.rect))\n else:\n surface.blit(self.image, self.rect)",
"def draw(self):\r\n self.screen.blit(self.image, self.image.get_rect())",
"def draw(self):\n self.screen.blit... | [
"0.7799141",
"0.74061495",
"0.7195136",
"0.7036794",
"0.702391",
"0.70167786",
"0.6985645",
"0.6985645",
"0.6981896",
"0.6915494",
"0.6837632",
"0.6741059",
"0.6738758",
"0.6714936",
"0.66899335",
"0.66874295",
"0.6616246",
"0.6591839",
"0.65395546",
"0.6525555",
"0.64306164"... | 0.8553644 | 0 |
Decodes the given token and returns as a dict. Raises validation exceptions if verify is set to True. | async def decode(self, jwt_token: str, verify=True) -> dict:
try:
jwt_token = jwt_token.replace(f"{self.auth_schema} ", "")
payload = jwt.decode(
jwt_token,
self.jwt_secret,
algorithms=(self.jwt_algorithm,),
options={"verify... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _decode(token):\n if token is None:\n return None\n # Pad the token out to be divisible by 4.\n padded_token = bytes(token, 'utf8') + '='.encode() * (4 - (len(token) % 4))\n decoded_token = base64.urlsafe_b64decode(padded_token)\n token_dict = json.loads(decoded_token)\n if not token_d... | [
"0.699103",
"0.67951584",
"0.6747127",
"0.6574697",
"0.65727746",
"0.64592093",
"0.64371824",
"0.64273274",
"0.6335322",
"0.6305964",
"0.6270236",
"0.6226231",
"0.6224883",
"0.6180536",
"0.6163545",
"0.6154136",
"0.6105794",
"0.6073981",
"0.604408",
"0.602733",
"0.59990394",
... | 0.69250077 | 1 |
Moving forward. Operations for (input, hidden) to move through the network and eventually become the (output, hidden) | def forward(self, input, hidden):
combined = torch.cat((input, hidden), 1)
hidden = self.i2h(combined)
output = self.i2o(combined)
output = self.softmax(output)
return output, hidden | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, input, states):\n (hidden, cell) = states\n\n input = input + self.transform(hidden)\n\n forget_gate = torch.sigmoid(self.forget(input))\n input_gate = torch.sigmoid(self.input(input))\n output_gate = torch.sigmoid(self.output(input))\n state_gate = torch.tanh(self.state(input))... | [
"0.6909139",
"0.6828394",
"0.6801759",
"0.676014",
"0.676014",
"0.676014",
"0.6659819",
"0.66195196",
"0.66069174",
"0.65972805",
"0.6577097",
"0.65554935",
"0.6548392",
"0.6548304",
"0.6535518",
"0.65316015",
"0.6485727",
"0.64819837",
"0.64588064",
"0.6438102",
"0.64368284"... | 0.68476224 | 1 |
given rois, overlaps, gt labels, compute bounding box regression targets | def compute_bbox_regression_targets(rois, overlaps, labels):
# Ensure ROIs are floats
rois = rois.astype(np.float, copy=False)
# Sanity check
assert len(rois) == len(overlaps), '#rois != #max_overlaps'
# Indices of ground-truth ROIs
gt_inds = np.where(overlaps == 1)[0]
assert len(gt_inds) >... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _compute_targets(self, rois, overlaps, labels):\n # Indices of ground-truth ROIs\n gt_inds = np.where(overlaps == 1)[0]\n if len(gt_inds) == 0:\n # Bail if the image has no ground-truth ROIs\n return np.zeros((rois.shape[0], 5), dtype=np.float32)\n # Indices of... | [
"0.7716798",
"0.7435905",
"0.7332641",
"0.7300608",
"0.7259969",
"0.7246658",
"0.72253007",
"0.7202622",
"0.71419215",
"0.7104418",
"0.7076955",
"0.6910627",
"0.6849777",
"0.6815685",
"0.6813569",
"0.6738753",
"0.66949886",
"0.6684694",
"0.6615709",
"0.65847105",
"0.6437909",... | 0.8199325 | 0 |
given roidb, add ['bbox_targets'] and normalize bounding box regression targets | def add_bbox_regression_targets(roidb):
print('add bounding box regression targets')
assert len(roidb) > 0
assert 'max_classes' in roidb[0]
num_images = len(roidb)
num_classes = config.NUM_CLASSES
for im_i in range(num_images):
rois = roidb[im_i]['boxes']
max_overlaps = roidb[im... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expand_bbox_regression_targets(bbox_targets_data, num_classes):\n classes = bbox_targets_data[:, 0]\n bbox_targets = np.zeros((classes.size, 4 * num_classes), dtype=np.float32)\n bbox_weights = np.zeros(bbox_targets.shape, dtype=np.float32)\n indexes = np.where(classes > 0)[0]\n for index in ind... | [
"0.6682137",
"0.65630317",
"0.6381804",
"0.6370236",
"0.63553125",
"0.63320047",
"0.6326661",
"0.62620515",
"0.623318",
"0.6224797",
"0.62169766",
"0.62079716",
"0.60866284",
"0.604461",
"0.6041496",
"0.5970064",
"0.5953386",
"0.5905141",
"0.5858503",
"0.5804194",
"0.5776265"... | 0.83180285 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.