query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
thresholds a grayscale image to a binary image. | def threshold_image(img, threshold=THRESHOLD):
return cv2.threshold(img, threshold, MAX_GRAY_SCALE, cv2.THRESH_BINARY) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def binarize(self, image, threshold):\n\n bin_img = image.copy()\n [h, w] = bin_img.shape\n opt_threshold = threshold\n print(opt_threshold)\n for row in range(h):\n for col in range(w):\n if bin_img[row, col] > opt_threshold: #greater than threshld whit... | [
"0.7555683",
"0.73864496",
"0.71793264",
"0.7158029",
"0.70775515",
"0.69993556",
"0.69715166",
"0.6928067",
"0.68441004",
"0.68359464",
"0.6771333",
"0.6745976",
"0.6704027",
"0.6582386",
"0.65818775",
"0.65701693",
"0.6550687",
"0.65359485",
"0.6466406",
"0.63850933",
"0.63... | 0.68359834 | 9 |
Check through the puzzle array in the range delimited by top left (tl) and bottom right (br) for values in 'potential'. Any value found that is in 'potential' is removed so only missing values remain when it is returned. | def rm_pot(potential, puzzle, tl, br):
for y in range(tl[1], br[1]+1):
for x in range(tl[0], br[0]+1):
if puzzle[y][x] in potential:
potential.remove(puzzle[y][x])
return potential | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def searchDeadEnd(self):\n boundaries = []\n if not self.red:\n i = self.midWidth - 1\n else:\n i = self.midWidth + 1\n boudaries = [(i, j) for j in range(self.height)]\n validPositions = []\n for i in boudaries:\n if not (i[0], i[1]) in se... | [
"0.588401",
"0.5613431",
"0.5605046",
"0.5547881",
"0.544818",
"0.5424087",
"0.53872746",
"0.5362563",
"0.53606844",
"0.53606844",
"0.53370255",
"0.5326348",
"0.53133196",
"0.5296384",
"0.52813685",
"0.5255672",
"0.52168256",
"0.52042156",
"0.5199848",
"0.51857",
"0.51857",
... | 0.66826487 | 0 |
Returns True if at least one of the digits of k is a 7, False otherwise. >>> has_seven(3) False >>> has_seven(7) True >>> has_seven(2734) True >>> has_seven(2634) False >>> has_seven(734) True >>> has_seven(7777) True | def has_seven(k):
if k % 10 == 7:
return True
elif k < 10:
return False
else:
return has_seven(k // 10) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_seven(k):\n if k == 0:\n return False\n else:\n if k%10 == 7:\n return True\n return has_seven(k//10)",
"def has_seven(k):\n \n if k % 10 == 7:\n return True\n else:\n if k<10:\n return False\n return has_seven(k//10)",
"def... | [
"0.8716564",
"0.8706798",
"0.8690393",
"0.8690393",
"0.8690393",
"0.61994755",
"0.58175665",
"0.57838863",
"0.57414204",
"0.5732691",
"0.55530447",
"0.5547129",
"0.55352366",
"0.5535023",
"0.5497758",
"0.5434485",
"0.5352723",
"0.53297573",
"0.5328972",
"0.5325144",
"0.531923... | 0.8931878 | 0 |
return a list with items with the same student | def get_all_by_student(self, stud_id):
l = []
for item in self._items:
if item.get_student() == stud_id:
l.append(item)
return l[:] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def students(self):\n\t\treturn self.grade_set.all().distinct()",
"def find_duplicate(student_list):\r\n place_holder = student_info('null', 'null', '0', '0')\r\n current = place_holder\r\n dupe = []\r\n final = []\r\n for student in student_list:\r\n previous = current\r\n current =... | [
"0.6781505",
"0.65362155",
"0.6199378",
"0.60326993",
"0.601739",
"0.5969962",
"0.5895063",
"0.583807",
"0.5774767",
"0.57600665",
"0.5728087",
"0.57097805",
"0.5650832",
"0.56497097",
"0.5617477",
"0.560614",
"0.55885255",
"0.55699545",
"0.55072105",
"0.5501444",
"0.5463087"... | 0.6604642 | 1 |
Returns the number of anchors per spatial location. | def num_anchors_per_location(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_anchors_per_localization(self):\n num_rot = len(self._rotations)\n num_size = np.array(self._sizes).reshape([-1, 3]).shape[0]\n return num_rot * num_size",
"def num_locations(self):\n return len(self.locations)",
"def get_location_count(self):\n return len(self.matrix... | [
"0.749816",
"0.6937425",
"0.66813695",
"0.6656154",
"0.6582445",
"0.6582445",
"0.6582445",
"0.6580193",
"0.65188473",
"0.65087336",
"0.6447474",
"0.63943326",
"0.6365181",
"0.6354651",
"0.6345681",
"0.6322735",
"0.6313625",
"0.6276137",
"0.62072563",
"0.6178259",
"0.61153775"... | 0.8555305 | 0 |
Decay learning rate by a factor of 0.1 every lr_decay_epoch epochs. | def lr_scheduler(optimizer, epoch, init_lr=0.1, lr_decay_epoch=50):
if epoch % lr_decay_epoch == 0 and epoch > 1:
for param_group in optimizer.param_groups:
param_group['lr'] = param_group['lr'] * 0.1
return optimizer | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def step_decay(epoch):\n # initial_lrate = 1.0 # no longer needed\n #drop = 0.5\n #epochs_drop = number_epoch_drop\n #lrate = init_lr * math.pow(drop,\n #math.floor((1+epoch)/epochs_drop))\n lr = learning_rate\n if epoch >= 60:\n lr *= 1e-1\n print('Learning rate: ', lr)\n return ... | [
"0.82671946",
"0.8177712",
"0.78125453",
"0.776122",
"0.77204937",
"0.769362",
"0.769362",
"0.7605489",
"0.7586371",
"0.7553462",
"0.7524087",
"0.74985766",
"0.7488579",
"0.746741",
"0.7410183",
"0.73949593",
"0.7391513",
"0.7390644",
"0.738622",
"0.73834085",
"0.7376012",
... | 0.0 | -1 |
Instantiate a Shortcut from a dict source. | def from_dict(cls: T, source: dict[str, Any], connection: Connection) -> T:
return super(Entity, cls).from_dict(source=source, connection=connection) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, dct):\n return cls(**dct)",
"def from_dict(cls, dict_, archive_reader):\n\n obj = Source.__new__(cls)\n super().__init__(obj)\n obj.to_natives(dict_, archive_reader)\n return obj",
"def from_dict(cls, dictionary: Dict[str, Any]):\n return cls(**dicti... | [
"0.637175",
"0.62771887",
"0.6227301",
"0.6226135",
"0.6226135",
"0.6168764",
"0.61653435",
"0.61620283",
"0.6129901",
"0.61157286",
"0.6028373",
"0.5986423",
"0.5981265",
"0.5953646",
"0.5939503",
"0.57930434",
"0.57930434",
"0.57930434",
"0.57930434",
"0.57930434",
"0.57930... | 0.57157874 | 63 |
A view to return the contact page and form | def contact(request):
form = ContactForm(request.POST or None)
if request.method == "POST":
if form.is_valid():
form.save()
message = request.POST['message']
subject = request.POST['subject']
email = request.POST['email']
send_mail(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contact():\n\n\treturn render_template('contact.html', title='Contact',\n\t\t\t\t\t\t year=datetime.now().year,\n\t\t\t\t\t\t message='Your contact page.')",
"def contact():\n if request.method == \"POST\":\n flash(\"{}, Thank you for getting in touch! We appreciate you contacting us, one of ou... | [
"0.80070364",
"0.8000395",
"0.79602474",
"0.7916738",
"0.7915305",
"0.7893425",
"0.78804237",
"0.78671783",
"0.78426486",
"0.7841965",
"0.783166",
"0.7831423",
"0.7811117",
"0.78103983",
"0.78103983",
"0.7807718",
"0.78075504",
"0.779761",
"0.7794387",
"0.7794387",
"0.7794387... | 0.71437573 | 61 |
Return the name of the sensor. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._sensor.name",
"def get_sensor_name(self):\n return self.data[1]",
"def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'",
"def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso... | [
"0.91896784",
"0.9168378",
"0.890185",
"0.8770976",
"0.8511273",
"0.8479953",
"0.844435",
"0.8299758",
"0.8186503",
"0.8105667",
"0.8079737",
"0.8066149",
"0.8049647",
"0.7700968",
"0.7612295",
"0.7611456",
"0.7600605",
"0.7600605",
"0.7600605",
"0.75392073",
"0.75166553",
... | 0.0 | -1 |
Return the state attributes of the sensor. | def device_state_attributes(self):
return {ATTR_ATTRIBUTION: ATTRIBUTION} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_state_attributes(self):\r\n return self.attributes",
"def device_state_attributes(self):\r\n return self._attributes",
"def device_state_attributes(self):\n return self.attr",
"def device_state_attributes(self):\n return self.attr",
"def device_state_attributes(self) ... | [
"0.8418945",
"0.82497084",
"0.8243777",
"0.8243777",
"0.8200083",
"0.8169021",
"0.8169021",
"0.8159991",
"0.8159991",
"0.8145903",
"0.8145903",
"0.8145903",
"0.8145903",
"0.8145903",
"0.8145903",
"0.8145903",
"0.8145903",
"0.8145903",
"0.8145903",
"0.8145903",
"0.8145903",
... | 0.7686955 | 51 |
Get the latest state of the sensor. | def update(self):
self._state = get_balance(self.addresses) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state(self):\n if self.coordinator.data:\n return self.coordinator.data[self._sensor]",
"def state(self):\n if self.ticker.values is not None:\n return round(\n float(\n self.ticker.values.get(\"last\")\n ),\n ... | [
"0.753419",
"0.74876356",
"0.74765736",
"0.72214586",
"0.7112677",
"0.6995063",
"0.69775915",
"0.6945787",
"0.69136775",
"0.68911135",
"0.68863803",
"0.6863116",
"0.6858303",
"0.6834618",
"0.6774382",
"0.67590016",
"0.6746638",
"0.6699024",
"0.6691935",
"0.6685089",
"0.666090... | 0.0 | -1 |
Implementing set vendor price list detail grid settings functionality | def set_vendor_price_list_detail_grid_settings(self, grid_settings):
self.wait_for_ajax_spinner_load(300)
self.set_grid_settings(self.vendor_price_list_detail_rates_grid_div_id, grid_settings) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_vendor_price_lists_grid_settings(self, grid_settings):\n self.set_grid_settings(self.view_price_list_div_id, grid_settings)",
"def set_vendor_price_list_detail_dial_digits_grid_settings(self, grid_settings):\n self.wait_for_ajax_spinner_load(300)\n self.set_grid_settings(self.vendor_... | [
"0.77079743",
"0.68698335",
"0.66079444",
"0.62743175",
"0.61391824",
"0.58130604",
"0.5678278",
"0.5415286",
"0.5406315",
"0.52782065",
"0.52499175",
"0.52450347",
"0.5245008",
"0.5205424",
"0.51688457",
"0.5167661",
"0.50984377",
"0.50653815",
"0.5056066",
"0.5037856",
"0.5... | 0.7649835 | 1 |
Implementing set start date functionality | def set_start_date(self, start_date):
self.set_value_into_input_field(self.start_date_inputbox_locator, start_date) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_start_date(self, date):\n pass",
"def start_date(self, start_date):\n self._start_date = start_date",
"def start_date(self, start_date):\n \n self._start_date = start_date",
"def start_date(self, start_date):\n\n self._start_date = start_date",
"def start_date(sel... | [
"0.86141276",
"0.80457026",
"0.7868022",
"0.7836363",
"0.7836363",
"0.7836363",
"0.7836363",
"0.7836363",
"0.7836363",
"0.7836363",
"0.7836363",
"0.7836363",
"0.7739041",
"0.749863",
"0.74370885",
"0.7398391",
"0.729659",
"0.7160086",
"0.70503116",
"0.70105284",
"0.69417137",... | 0.80691314 | 1 |
Implementing set bulk edit end date functionality | def set_bulk_edit_end_date(self, end_date, future_date):
if future_date is True:
end_date = self.get_date(future_date=True, number_of_days_to_add=30)
self.set_value_into_input_field(self.bulk_edit_end_date_inputbox_locator, end_date) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_bulk_add_end_date(self, end_date):\n global bulk_add_begin_date\n if end_date != \"\" and datetime.datetime.strptime(end_date, \"%m/%d/%Y\") > bulk_add_begin_date:\n self.set_value_into_input_field(self.bulk_add_end_date_inputbox_locator, str(end_date))\n elif end_date == \"... | [
"0.7402478",
"0.7031963",
"0.67778796",
"0.6563116",
"0.64243233",
"0.63864547",
"0.63864547",
"0.63864547",
"0.63864547",
"0.63864547",
"0.63864547",
"0.63864547",
"0.63864547",
"0.63433135",
"0.629675",
"0.6284176",
"0.61299545",
"0.604149",
"0.6033477",
"0.59961516",
"0.59... | 0.74479747 | 0 |
Get a `DatasetSentinel` representing an Experiment's `fold_train_input` Returns | def train_input(self):
return DatasetSentinel("train_input", **self._dataset_sentinel_helper()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validation_input(self):\n return DatasetSentinel(\"validation_input\", **self._dataset_sentinel_helper())",
"def train_target(self):\n return DatasetSentinel(\"train_target\", **self._dataset_sentinel_helper())",
"def validation_target(self):\n return DatasetSentinel(\"validation_targe... | [
"0.7197259",
"0.7058317",
"0.6581115",
"0.63265425",
"0.62734795",
"0.61224383",
"0.61224383",
"0.609924",
"0.59627235",
"0.5961343",
"0.58399856",
"0.5539047",
"0.55349284",
"0.5525194",
"0.54774237",
"0.54644793",
"0.5406239",
"0.540372",
"0.5370397",
"0.5369286",
"0.535446... | 0.81839544 | 0 |
Get a `DatasetSentinel` representing an Experiment's `fold_train_target` Returns | def train_target(self):
return DatasetSentinel("train_target", **self._dataset_sentinel_helper()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validation_target(self):\n return DatasetSentinel(\"validation_target\", **self._dataset_sentinel_helper())",
"def train_input(self):\n return DatasetSentinel(\"train_input\", **self._dataset_sentinel_helper())",
"def holdout_target(self):\n return DatasetSentinel(\n \"holdo... | [
"0.72998613",
"0.713837",
"0.66336054",
"0.6162712",
"0.5902305",
"0.57828236",
"0.5423811",
"0.5414221",
"0.53984654",
"0.5350862",
"0.52556276",
"0.52556276",
"0.5214808",
"0.5211418",
"0.51941895",
"0.51866794",
"0.5174885",
"0.5166052",
"0.51568496",
"0.5156731",
"0.51362... | 0.81183374 | 0 |
Get a `DatasetSentinel` representing an Experiment's `holdout_target_data` Returns | def holdout_target(self):
return DatasetSentinel(
"holdout_target", self.cross_experiment_key.parameters["holdout_dataset"]
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def holdout_input(self):\n return DatasetSentinel(\n \"holdout_input\", self.cross_experiment_key.parameters[\"holdout_dataset\"]\n )",
"def train_target(self):\n return DatasetSentinel(\"train_target\", **self._dataset_sentinel_helper())",
"def validation_target(self):\n ... | [
"0.7770308",
"0.7121358",
"0.64517236",
"0.6015566",
"0.54749423",
"0.5369748",
"0.5230045",
"0.52188426",
"0.5049947",
"0.49974164",
"0.49770722",
"0.49149367",
"0.48960745",
"0.48660335",
"0.4858429",
"0.47984567",
"0.47667906",
"0.47544086",
"0.47335964",
"0.47325793",
"0.... | 0.84920114 | 0 |
Make an instance of the api and attempts to authenticate the user. Return the authenticated api. | def authenticate():
# We are uploading and then downloading so we want Musicmanager
api = Musicmanager()
# Attempt to authenticate and log in
logged_in = api.login()
# If login() returns false, you have not performed oauth yet, or did not
# write your credentials to your disk. Using oauth all... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api_authentication():\r\n apikey = request.args.get('api_key', None)\r\n from flask import _request_ctx_stack\r\n if 'Authorization' in request.headers:\r\n apikey = request.headers.get('Authorization')\r\n if apikey:\r\n user = db.session.query(model.user.User... | [
"0.72514385",
"0.7194521",
"0.66663784",
"0.66555786",
"0.6583456",
"0.6552307",
"0.6540641",
"0.64537",
"0.6420162",
"0.64155054",
"0.6405242",
"0.63488394",
"0.6289332",
"0.62696224",
"0.62566435",
"0.62319964",
"0.6192098",
"0.6162103",
"0.61557543",
"0.61531574",
"0.61462... | 0.65322834 | 7 |
Retrieve all conferences matching one or more given topics. | def _getConferencesByTopicSearch(self, request):
# Generate list of filters from the topic arguments
filters = [Conference.topics == topic for topic in request.topics]
if not filters:
raise endpoints.BadRequestException(
'At least one topic must be specified'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getConferencesByTopicSearch(self, request):\n conferences = self._getConferencesByTopicSearch(request)\n # Need to fetch organiser displayName from profiles\n # Get all keys and use get_multi for speed\n organisers = [\n (ndb.Key(Profile, conf.organizerUserId)) for conf i... | [
"0.6711613",
"0.6230136",
"0.61121726",
"0.60039115",
"0.5985098",
"0.5940796",
"0.58975244",
"0.58861005",
"0.5882982",
"0.5880553",
"0.5836876",
"0.58033025",
"0.57397395",
"0.5726651",
"0.5705699",
"0.5686112",
"0.56527764",
"0.56140727",
"0.54820526",
"0.5472352",
"0.5471... | 0.790961 | 0 |
Return formatted query from the submitted filters. | def _getQuery(self, request):
q = Conference.query()
inequality_filter, filters = self._formatFilters(request.filters)
# If exists, sort on inequality filter first
if not inequality_filter:
q = q.order(Conference.name)
else:
q = q.order(ndb.GenericProperty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_query(self):\n columns = ','.join(['\"{}\"'.format(x) for x in self.columns])\n query = 'SELECT {} FROM \"{}\"'.format(columns, self.table)\n filter_params = []\n if self.filters:\n filter_sql, filter_params = filter_postgis(self.filters)\n query += ' WHERE... | [
"0.67433846",
"0.67309666",
"0.66847456",
"0.6650939",
"0.6648182",
"0.64935666",
"0.6440689",
"0.63192457",
"0.6306208",
"0.628635",
"0.62689066",
"0.62631875",
"0.6200151",
"0.6186324",
"0.6155119",
"0.61444587",
"0.61128426",
"0.60982704",
"0.6098094",
"0.6062554",
"0.6021... | 0.62215513 | 12 |
Get list of conferences matching one or more of the given topics. | def getConferencesByTopicSearch(self, request):
conferences = self._getConferencesByTopicSearch(request)
# Need to fetch organiser displayName from profiles
# Get all keys and use get_multi for speed
organisers = [
(ndb.Key(Profile, conf.organizerUserId)) for conf in conferen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _getConferencesByTopicSearch(self, request):\n # Generate list of filters from the topic arguments\n filters = [Conference.topics == topic for topic in request.topics]\n if not filters:\n raise endpoints.BadRequestException(\n 'At least one topic must be specified... | [
"0.80247796",
"0.6207768",
"0.6082327",
"0.60714567",
"0.60658276",
"0.5967323",
"0.5963362",
"0.59466356",
"0.59359396",
"0.59351933",
"0.5891676",
"0.5859516",
"0.5841561",
"0.5830634",
"0.57371825",
"0.5714454",
"0.57058376",
"0.56997335",
"0.5605298",
"0.54814893",
"0.542... | 0.67396516 | 1 |
Copy relevant fields from Profile to ProfileForm. | def _copyProfileToForm(self, prof):
pf = ProfileForm()
for field in pf.all_fields():
if hasattr(prof, field.name):
# Convert t-shirt string to Enum; just copy others
if field.name == 'teeShirtSize':
setattr(pf, field.name,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_form_kwargs(self):\n kwargs = super(ProfileUpdate, self).get_form_kwargs()\n self.profile = self.get_object()\n extra_kwargs = {'profile': self.profile}\n kwargs.update(extra_kwargs)\n return kwargs",
"def _doProfile(self, save_request=None):\n prof = self._getPr... | [
"0.6958025",
"0.68784887",
"0.64856434",
"0.63592464",
"0.6284996",
"0.6272869",
"0.6269607",
"0.6214233",
"0.62111384",
"0.6183875",
"0.6135155",
"0.612614",
"0.61004287",
"0.6085827",
"0.60856766",
"0.6062952",
"0.59629256",
"0.58970684",
"0.5893775",
"0.5886109",
"0.587434... | 0.79479015 | 0 |
Get Profile and return to user, possibly updating it first. | def _doProfile(self, save_request=None):
prof = self._getProfileFromUser()
# If saveProfile(), process user-modifyable fields
if save_request:
for field in ('displayName', 'teeShirtSize'):
if hasattr(save_request, field):
val = getattr(save_request... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getProfile(self):\n # GET /profile\n debugMain('getProfile')\n return self._genericGet('/profile')",
"def get_user_profile(self):\n return self.user.profile",
"def _getProfileFromUser(self):\n # Make sure user is authenticated\n user = endpoints.get_current_user()\... | [
"0.7561392",
"0.7465786",
"0.7449008",
"0.740987",
"0.728692",
"0.72677916",
"0.71766216",
"0.71651495",
"0.70508856",
"0.7031329",
"0.695271",
"0.6945094",
"0.6902091",
"0.68805087",
"0.6845255",
"0.6826616",
"0.6815199",
"0.6798655",
"0.6770665",
"0.67508954",
"0.67319983",... | 0.0 | -1 |
Return Profile from datastore, creating new one if nonexistent. | def _getProfileFromUser(self):
# Make sure user is authenticated
user = endpoints.get_current_user()
if not user:
raise endpoints.UnauthorizedException('Authorization required')
# Get Profile from datastore
user_id = user.email()
p_key = ndb.Key(Profile, user_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, name='default'):\r\n if name not in self._cache:\r\n full_path = os.path.join(self._base_folder, name)\r\n self._create_if_needed(full_path)\r\n self._cache[name] = Profile(full_path, name)\r\n return self._cache[name]",
"def create_or_update_profile(s... | [
"0.67713064",
"0.6432612",
"0.638044",
"0.6346034",
"0.6343368",
"0.62816966",
"0.6173148",
"0.61137223",
"0.61025006",
"0.61001056",
"0.6060391",
"0.6048729",
"0.60413766",
"0.601181",
"0.5955292",
"0.5921494",
"0.5829891",
"0.58183765",
"0.5805473",
"0.5801193",
"0.5772561"... | 0.70515484 | 0 |
Gets the default device | def get_device(args: dict) -> torch.device:
if is_distributed(args):
device = torch.device("cuda", args.local_rank)
else:
if torch.cuda.is_available():
device = torch.device("cuda", 0)
else:
device = torch.device("cpu")
return device | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_default_device():\n global _default_device\n\n if _default_device is None:\n import wgpu.backends.rs # noqa\n\n adapter = wgpu.request_adapter(canvas=None, power_preference=\"high-performance\")\n _default_device = adapter.request_device()\n return _default_device",
"def ge... | [
"0.85560495",
"0.8509156",
"0.81830615",
"0.7949495",
"0.7936597",
"0.7936597",
"0.7936597",
"0.7936597",
"0.765728",
"0.75626457",
"0.7489031",
"0.74441177",
"0.7370417",
"0.73445976",
"0.72786206",
"0.72608113",
"0.72608113",
"0.72608113",
"0.72608113",
"0.72608113",
"0.722... | 0.0 | -1 |
Get Seconds from time. | def get_sec(time_str):
h, m, s = time_str.split(':')
return int(h) * 3600 + int(m) * 60 + int(s) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_seconds(time):\n return 3600 * time",
"def time_to_int(self):\n minutes = self.hour * 60 + self.minute\n seconds = minutes * 60 + self.second\n return seconds",
"def time_to_int(time):\n minutes = time.hour * 60 + time.minute\n seconds = minutes * 60 + time.second\n retu... | [
"0.78827816",
"0.7511598",
"0.74796194",
"0.73971415",
"0.7275454",
"0.7262169",
"0.718104",
"0.71555495",
"0.7036447",
"0.69965965",
"0.6980901",
"0.6879055",
"0.6844431",
"0.6838192",
"0.6817343",
"0.67910403",
"0.67888385",
"0.6770099",
"0.67639846",
"0.67639846",
"0.67117... | 0.70772296 | 9 |
Returns the theoretical probability that x_n will be between the values a and b. | def get_confidence_interval(self,a,b):
k_vals,prob_vals = self.tuple_of_probabilities
working_indices = [i for i,v in enumerate(k_vals) if (v >= a and v<= b)]
working_prob_vals = [prob_vals[i] for i in working_indices]
return sum(working_prob_vals) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def probability(s, a, b):\r\n return s.cdf(b) - s.cdf(a)",
"def theoretical_distribution(x):\n a = 0\n b = 1\n if x < a:\n return 0\n elif x > b:\n return 1\n else:\n return float(x - a) / (b - a)",
"def interval_prob(x1, x2, a, b):\n with mp.extradps(5):\n ... | [
"0.7519538",
"0.7352858",
"0.7060859",
"0.68735635",
"0.68382454",
"0.67430097",
"0.6606817",
"0.6601517",
"0.65820867",
"0.6561573",
"0.6522591",
"0.64544326",
"0.6453946",
"0.6387221",
"0.6384941",
"0.63692117",
"0.63621324",
"0.63278866",
"0.632063",
"0.6309425",
"0.630878... | 0.633067 | 17 |
Returns the theoretical average distance from x_initial. | def _calculate_mean_distance_theoretical(self):
x_mean_distance = 0
x_vals,prob_vals = self.tuple_of_probabilities
for i in range(len(x_vals)):
x_val, prob = x_vals[i], prob_vals[i]
x_distance = abs(x_val - self.x_initial)
x_weighted = x_distance * prob
x_mean_distance += x_weighted
return x_mean_di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avgX(self):\n return np.mean(self.getx())",
"def _avg_sample(self):\n samples = [0] * self.num_samples\n for i in range(self.num_samples):\n samples[i] = self.sensor.measure_distance()\n time.sleep(self.sample_delay)\n if self.drop_extremes:\n samp... | [
"0.65964574",
"0.6528893",
"0.65209246",
"0.63227236",
"0.6232084",
"0.62193644",
"0.61996084",
"0.61704206",
"0.6161522",
"0.61305714",
"0.61239797",
"0.6103318",
"0.6088901",
"0.5991759",
"0.59127855",
"0.59127855",
"0.59127855",
"0.59074956",
"0.58808935",
"0.58742917",
"0... | 0.80323946 | 0 |
Get the MAC of Server Hardware's iLO controller. | def _get_server_hardware_mac_from_ilo(server_hardware):
try:
client = get_ilorest_client(server_hardware)
ilo_path = "/rest/v1/systems/1"
hardware = jsonutils.loads(client.get(ilo_path).text)
hardware_mac = hardware['HostCorrelation']['HostMACAddress'][0]
except redfish.JsonDecod... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMac(self):\n # Import netifaces here to prevent error importing this module in setup.py\n import netifaces\n interfaces = ['eth0', 'wlan0']\n try:\n interfaces.append(netifaces.gateways()['default'][netifaces.AF_INET][1])\n except:\n pass\n for... | [
"0.7558255",
"0.7499342",
"0.7251188",
"0.7216513",
"0.7197244",
"0.7197244",
"0.71224785",
"0.7062655",
"0.7039275",
"0.68878335",
"0.68746555",
"0.677884",
"0.67500824",
"0.67455614",
"0.6697018",
"0.6639741",
"0.662569",
"0.6582134",
"0.6567028",
"0.6560305",
"0.648537",
... | 0.74903506 | 2 |
This function prints and plots the confusion matrix. | def plot_confusion_matrix(cm,classes,title='Confusion matrix',cmap=plt.cm.Blues):
x_classes=classes+ ['Recall']
y_classes=classes+ ['Precision']
plt.imshow(cm, interpolation='nearest', cmap=cmap)
plt.title(title,fontname='Times New Roman',fontsize = 16, y=1.03)
cbar=plt.colorbar(fraction=0.046)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()",
"def showConfusionMatrix(self): \r\n sn.heatmap(self.conf_matrix, annot=True)\r\n plt.plot( label=\"Accuracy\")\r\n plt.plot( label=\"Error\"... | [
"0.80894613",
"0.80770946",
"0.79976976",
"0.7946727",
"0.7921785",
"0.78448296",
"0.7833224",
"0.7781221",
"0.7775631",
"0.77574563",
"0.77061635",
"0.77016985",
"0.7692213",
"0.76785815",
"0.76588994",
"0.7641414",
"0.7622791",
"0.7611233",
"0.7610989",
"0.7598244",
"0.7587... | 0.75652844 | 24 |
Returns a frozenset of variables used in given terms. Note that this returns all used variables, not just free ones. | def used_variables(*terms):
t = terms[0] if len(terms) == 1 else terms
if type(t) is Var:
return frozenset((t,))
elif type(t) in (tuple, Const, Apply, Eq, Ite, Not, And, Or,
Implies, Iff):
return union(*(used_variables(x) for x in t))
elif type(t) in (ForAll, Exi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def free_variables(*terms, **kwargs):\n by_name = kwargs.get('by_name', False)\n _free_variables = partial(free_variables, by_name=by_name)\n\n t = terms[0] if len(terms) == 1 else terms\n\n if type(t) is Var:\n return frozenset((t.name if by_name else t,))\n\n elif type(t) in (tuple, Const, ... | [
"0.7428986",
"0.6987549",
"0.69048446",
"0.6717069",
"0.6559568",
"0.63589525",
"0.62739486",
"0.6270176",
"0.61921215",
"0.6188963",
"0.61090964",
"0.5963275",
"0.5938047",
"0.5924042",
"0.589158",
"0.5881121",
"0.5876238",
"0.5858637",
"0.56572014",
"0.5639939",
"0.56199235... | 0.7920552 | 0 |
Returns a frozenset of variables free in given terms. | def free_variables(*terms, **kwargs):
by_name = kwargs.get('by_name', False)
_free_variables = partial(free_variables, by_name=by_name)
t = terms[0] if len(terms) == 1 else terms
if type(t) is Var:
return frozenset((t.name if by_name else t,))
elif type(t) in (tuple, Const, Apply, Eq, Ite... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def used_variables(*terms):\n\n t = terms[0] if len(terms) == 1 else terms\n\n if type(t) is Var:\n return frozenset((t,))\n\n elif type(t) in (tuple, Const, Apply, Eq, Ite, Not, And, Or,\n Implies, Iff):\n return union(*(used_variables(x) for x in t))\n\n elif type(t)... | [
"0.7301436",
"0.6923216",
"0.66222817",
"0.6540475",
"0.6467375",
"0.63554454",
"0.6250781",
"0.61498994",
"0.5961769",
"0.58668995",
"0.5840457",
"0.5688273",
"0.5672531",
"0.5552212",
"0.5511896",
"0.55101573",
"0.54558146",
"0.5436367",
"0.5431674",
"0.54288334",
"0.541791... | 0.7726464 | 0 |
Returns a frozenset of variables bound in given terms. | def bound_variables(*terms):
t = terms[0] if len(terms) == 1 else terms
if type(t) is Var:
return frozenset()
elif type(t) in (tuple, Const, Apply, Eq, Ite, Not, And, Or,
Implies, Iff):
return union(*(bound_variables(x) for x in t))
elif type(t) in (ForAll, Exist... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def used_variables(*terms):\n\n t = terms[0] if len(terms) == 1 else terms\n\n if type(t) is Var:\n return frozenset((t,))\n\n elif type(t) in (tuple, Const, Apply, Eq, Ite, Not, And, Or,\n Implies, Iff):\n return union(*(used_variables(x) for x in t))\n\n elif type(t)... | [
"0.72198117",
"0.70041084",
"0.6517899",
"0.59218013",
"0.5741847",
"0.57111204",
"0.5670193",
"0.5647711",
"0.5632197",
"0.5581976",
"0.55689853",
"0.55376583",
"0.54729617",
"0.5426977",
"0.5418284",
"0.5415937",
"0.5402921",
"0.53907967",
"0.5385815",
"0.53603476",
"0.5360... | 0.8032309 | 0 |
Returns a frozenset of constants used in given terms. | def used_constants(*terms):
t = terms[0] if len(terms) == 1 else terms
if type(t) is Const:
return frozenset((t,))
elif type(t) in (tuple, Var, Apply, Eq, Ite, Not, And, Or,
Implies, Iff, ForAll, Exists, Lambda, NamedBinder):
return union(*(used_constants(x) for x in ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_constants():\n return filter(\n lambda key: key.upper() == key and type(globals()[key]) in _ALLOWED,\n\n filter( # filter _PRIVATE variables\n lambda x: not x.startswith(\"_\"),\n globals()\n )\n )",
"def used_variables(*t... | [
"0.63245064",
"0.5992687",
"0.59890866",
"0.59641623",
"0.5806408",
"0.56888586",
"0.56451476",
"0.55847293",
"0.5571786",
"0.55393314",
"0.55284834",
"0.5504401",
"0.54954517",
"0.54566354",
"0.54400617",
"0.5428424",
"0.54196256",
"0.5411198",
"0.53967535",
"0.53961635",
"0... | 0.80427533 | 0 |
Create the final HTML oxygen files, with the common header, a specific left menu and the main body. | def create_html_file(body_left_menu, body_main_content):
# Get the header fie and get it contents
path_header = path.join(
SITE_ROOT,
'schema_viewer',
'templates',
'schema_viewer',
'oxygen',
'header_oxygen_template.html'
)
file_header = open(path_header, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def common_header_part1(outfile: TextIO, title: str, indexpath: str = \"\") -> None:\n outfile.write(\"<!DOCTYPE HTML>\\n\")\n outfile.write(\"<html lang=\\\"en\\\">\\n\")\n outfile.write(\" <head>\\n\")\n outfile.write(\" <!-- Google tag (gtag.js) -->\\n\")\n outfile.write(\" <script async src=\... | [
"0.61840135",
"0.615706",
"0.6106681",
"0.59005207",
"0.58948696",
"0.5833731",
"0.57632947",
"0.57230896",
"0.57106525",
"0.57040775",
"0.56784046",
"0.5634475",
"0.56243837",
"0.5544781",
"0.5540921",
"0.5534541",
"0.55281717",
"0.55029094",
"0.5502361",
"0.5495124",
"0.549... | 0.7858279 | 0 |
Check if the files are name the right way. | def is_correct_name(name_left_menu, name_main_content, schema_name):
return name_main_content.startswith(schema_name.replace(".", "_")) and name_left_menu.startswith(schema_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_valid_file_name(self, file_name, input_output):\n if self.check_file_exists (file_name):\n if self.check_file_name_extensions (file_name, input_output):\n return True\n else:\n return False\n else:\n print (\"File does not exist... | [
"0.71929294",
"0.7132529",
"0.7119266",
"0.7111831",
"0.70485663",
"0.6969248",
"0.6935903",
"0.69152814",
"0.69132406",
"0.68058664",
"0.6759821",
"0.67477936",
"0.67245626",
"0.6688093",
"0.6649612",
"0.6649612",
"0.6649612",
"0.6649267",
"0.6627869",
"0.6600657",
"0.653856... | 0.0 | -1 |
Get data location from Rucio. Location is mapped to the actual sites associated with them, so PSNs are actually returned | def locationsFromRucio(self, dataItems, rucioAcct):
result = defaultdict(set)
self.logger.info("Fetching location from Rucio for account: %s", rucioAcct)
for dataItem in dataItems:
try:
dataLocations = self.rucio.getDataLockedAndAvailable(name=dataItem,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_location(self):\n\t\treturn self.location",
"def location_data(self) -> pulumi.Output[Optional['outputs.LocationDataResponse']]:\n return pulumi.get(self, \"location_data\")",
"def get_location(self):\n return self.request({\n \"path\": \"/\" + UUID + \"/location\"\n })"... | [
"0.66687316",
"0.66027284",
"0.65894485",
"0.6579517",
"0.6561672",
"0.6553024",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
"0.6507655",
... | 0.6383166 | 35 |
Creates a color palette compatible with Bokeh from a matplotlib cmap name. | def get_bokeh_palette(cmap):
from bokeh.colors import RGB
from matplotlib import cm
# Solution adapted from
# https://stackoverflow.com/questions/31883097/elegant-way-to-match-a-string-to-a-random-color-matplotlib
m_RGB = (255 * plt.get_cmap(cmap)(range(256))).astype("int")
return [RGB(*tuple(r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def palette_from_mpl_name(name):\n if name in CMAPS:\n return CMAPS[name]\n\n rgba = plt.get_cmap(name)(np.linspace(0, 1, 256))\n palette = [to_hex(color) for color in rgba]\n return palette",
"def get_palette(palette_name):\n\n if hasattr(plt.cm, palette_name):\n cmap = getattr(plt.... | [
"0.8101128",
"0.6942909",
"0.6776598",
"0.6741528",
"0.6741528",
"0.66666794",
"0.66659963",
"0.66659963",
"0.66659963",
"0.6503461",
"0.6470813",
"0.6413775",
"0.63696545",
"0.6352337",
"0.631037",
"0.61285675",
"0.61251086",
"0.6121512",
"0.6044165",
"0.60116994",
"0.601053... | 0.6990008 | 1 |
Aggregate columns programmatically by key. | def aggregate(self, **named_exprs):
agg_base = self._parent.columns[0] # FIXME hack
named_exprs = {k: to_expr(v) for k, v in named_exprs.items()}
strs = []
base, cleanup = self._parent._process_joins(*(tuple(v for _, v in self._groups) + tuple(named_exprs.values())))
for k, v ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _aggregate(self, method, column, keys=None, **kwds_filter):\n fn = lambda src: getattr(src, method)(column, keys, **kwds_filter)\n results = (fn(source) for source in self._sources) # Perform aggregation.\n\n if not keys:\n return sum(results) # <- EXIT!\n\n total = def... | [
"0.624569",
"0.6182713",
"0.5959669",
"0.585134",
"0.58205134",
"0.58175886",
"0.5809809",
"0.57893384",
"0.5758293",
"0.57507086",
"0.5689084",
"0.565568",
"0.55807096",
"0.5495027",
"0.5494613",
"0.5443911",
"0.54225457",
"0.542183",
"0.52948076",
"0.52925116",
"0.5273306",... | 0.536521 | 18 |
Sequence slicing should work as expected | def test_slice(self):
r = self.RNA("UCAGG")
self.assertEqual(r[0], "U")
self.assertEqual(r[-1], "G")
self.assertEqual(r[1:3], "CA") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def slicer(seq, start=None, stop=None, step=None):\n return seq[start:stop:step]",
"def SliceView(sequence, start=None, stop=None, step=1):\n start, stop, step = slice(start, stop, step).indices(len(sequence))\n for i in range(start, stop, step):\n yield sequence[i]",
"def _shifted(self, aslice... | [
"0.76085573",
"0.6842696",
"0.6784009",
"0.6566867",
"0.64801246",
"0.6462902",
"0.6415221",
"0.6349267",
"0.6320076",
"0.62818056",
"0.6269232",
"0.6247975",
"0.6244434",
"0.6231251",
"0.6221761",
"0.62118554",
"0.62083834",
"0.6200476",
"0.6195259",
"0.61610466",
"0.6138917... | 0.5722164 | 59 |
Returns copy of self as RNA. | def test_to_rna(self):
r = self.DNA("UCA")
self.assertEqual(str(r), "TCA")
self.assertEqual(str(r.to_rna()), "UCA") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_rna(self):\n return \"\".join(self._DNA_TO_RNA[nt] for nt in self.strand)",
"def rna(self):\n return self.seq.replace('T', 'U').replace('t', 'u')",
"def to_rna(self):\n thymidine = 'T'\n uracil = 'U'\n return self.dna.replace(thymidine, uracil)",
"def to_rna(self):\n retu... | [
"0.7086926",
"0.6499243",
"0.6490486",
"0.63800514",
"0.63091546",
"0.6080952",
"0.57973856",
"0.57460046",
"0.57460046",
"0.5709716",
"0.56820047",
"0.5672864",
"0.5625302",
"0.5621346",
"0.55915904",
"0.554945",
"0.5540344",
"0.5539744",
"0.5526546",
"0.5500591",
"0.54775",... | 0.54868966 | 20 |
Creates a filename for the diff image. | def __diff_filename(self):
diff_dir = os.path.join(self.__folder, Reference.DIFF_OUT)
if not os.path.exists(diff_dir):
os.makedirs(diff_dir)
return os.path.join(diff_dir, self.__name +'.jpg') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_image_filename():\n now = datetime.now().strftime('%a-%w-%b-%H:%M:%S')\n return 'CCTV_{0}.jpg'.format(now)",
"def create_file_name(self):\n # create a unique id for the file name\n index = self.helpers.alpha_uuid()\n\n filename = self.form['FieldStorage'][self.image_cid].f... | [
"0.7496504",
"0.70392674",
"0.6811171",
"0.68030304",
"0.6780318",
"0.6759815",
"0.6705021",
"0.6657758",
"0.66381377",
"0.663154",
"0.6581436",
"0.656019",
"0.6552397",
"0.64273417",
"0.64220864",
"0.64080304",
"0.6396402",
"0.6372434",
"0.6313289",
"0.6312673",
"0.62726647"... | 0.80227315 | 0 |
Returns true if the list contains a similar rect. | def __has_similar_rect(rect, rect_list):
for i in reversed(range(len(rect_list))):
if Reference.__is_similar(rect_list[i], rect):
del(rect_list[i])
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __is_similar(rect, another):\n area1 = rect[2]*rect[3]\n area2 = another[2]*another[3]\n intersect_width = min(rect[0]+rect[2], another[0]+another[2]) - max(rect[0],another[0])\n if not intersect_width > 0:\n return False\n intersect_height = min(rect[1]+rect[3], a... | [
"0.6806085",
"0.65448457",
"0.6458573",
"0.6406005",
"0.6380805",
"0.6235643",
"0.6211002",
"0.6206766",
"0.615934",
"0.6149881",
"0.61256045",
"0.6114601",
"0.6105064",
"0.60557085",
"0.60360897",
"0.60351527",
"0.60016364",
"0.5986043",
"0.59527403",
"0.5941617",
"0.5937699... | 0.8229332 | 0 |
Test when project gets deleted. | def test_log_delete(self):
project_id = self.project.id
project_name = self.project.name
log_count_init = LoggerHistory.objects.count()
self.project.delete()
log_count = LoggerHistory.objects.count()
self.assertEqual(log_count, log_count_init + 2)
logs = LoggerH... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_delete_project(self):\n pass",
"def test_delete_project(self):\n pass",
"def test_remove_project(self):\n pass",
"def test_delete_project(self):\n self.assertEqual(Project.objects.count(), 1)\n self.assertEqual(Group.objects.count(), 2)\n\n delete_project(Pr... | [
"0.8945626",
"0.8945626",
"0.8373581",
"0.8258003",
"0.7921199",
"0.78197724",
"0.75639015",
"0.7360813",
"0.7317375",
"0.7300423",
"0.72148603",
"0.72126514",
"0.71026635",
"0.7097451",
"0.7096935",
"0.70813435",
"0.7003509",
"0.6982068",
"0.6978296",
"0.69615585",
"0.693842... | 0.67966235 | 33 |
Test when multiple model fields changes. | def test_log_update_multiple_fields(self):
log_count_init = LoggerHistory.objects.count()
original_isprivate = self.project.isprivate
original_islocked = self.project.islocked
self.project.isprivate = False
self.project.islocked = True
self.project.save()
log_cou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_fields_updated_with_computed(self):\n pass",
"def _validate_fields(self, change_fields):\n pass",
"def _field_was_changed(self):\n field_map = self._field_map\n for field in field_map.itervalues():\n if field.was_changed():\n return True\n r... | [
"0.69400656",
"0.6714582",
"0.64557713",
"0.62088406",
"0.6202799",
"0.61854094",
"0.6156362",
"0.61393243",
"0.6132215",
"0.61121684",
"0.6104089",
"0.60721403",
"0.6061349",
"0.6043818",
"0.6033619",
"0.6031339",
"0.6025014",
"0.60222876",
"0.6019186",
"0.60170436",
"0.6014... | 0.693425 | 1 |
Return the negative of __eq__(), implemented by concrete classes | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other):\n return not (self == other) # opposite of __eq__",
"def __eq__(self, other):\n return super().__ne__(other)",
"def __ne__(self, other):\n return not (self == other) # opposite of __eq__",
"def __eq__(self,*args):\r\n pass",
"def __eq__(self,... | [
"0.7841935",
"0.7838963",
"0.78300256",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
"0.7813462",
... | 0.0 | -1 |
Residual block described in paper | def residual_block(layer_input, filters):
d = Conv2D(filters, kernel_size=3, strides=1, padding='same')(layer_input)
d = Activation('relu')(d)
d = BatchNormalization(momentum=0.8)(d)
d = Conv2D(filters, kernel_size=3, strides=1, padding='same')(d)
d = BatchNor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _compute_residuals(self):\n residuls = self.I - self.E\n return residuls",
"def calculateElementResidual(self):\n import pdb\n\n for ci in range(self.nc):\n self.elementResidual[ci].fill(0.0)\n #\n self.ellamDiscretization.updateElementResidual(self.elemen... | [
"0.7339091",
"0.7072034",
"0.70234454",
"0.6885977",
"0.6880569",
"0.6876191",
"0.68473864",
"0.6829634",
"0.6631433",
"0.66043603",
"0.6594716",
"0.6505566",
"0.6351166",
"0.634814",
"0.6325655",
"0.6318231",
"0.63133407",
"0.6311214",
"0.62727916",
"0.6271527",
"0.6249097",... | 0.59564304 | 39 |
Precision metric. Only computes a batchwise average of precision. Computes the precision, a metric for multilabel classification of how many selected items are relevant. | def keras_precision(y_true, y_pred):
true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1)))
predicted_positives = K.sum(K.round(K.clip(y_pred, 0, 1)))
precision = true_positives / (predicted_positives + K.epsilon())
return precision | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def precision(self):\n self.overall_precision = precision_score(\n self.y_true, self.y_pred, average = self.average_type).round(self.digits_count_fp)\n self.classes_precision = precision_score(\n self.y_true, self.y_pred, average = None).round(self.digits_count_fp)",
"def comp... | [
"0.7490921",
"0.72890615",
"0.7158933",
"0.7153277",
"0.7066191",
"0.698819",
"0.696778",
"0.69555235",
"0.6834697",
"0.6818974",
"0.6810516",
"0.68061554",
"0.68061554",
"0.68061554",
"0.68061554",
"0.68061554",
"0.68061554",
"0.6786765",
"0.6758681",
"0.6758681",
"0.6758681... | 0.691368 | 8 |
Recall metric. Only computes a batchwise average of recall. Computes the recall, a metric for multilabel classification of how many relevant items are selected. | def keras_recall(y_true, y_pred):
true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1)))
possible_positives = K.sum(K.round(K.clip(y_true, 0, 1)))
recall = true_positives / (possible_positives + K.epsilon())
return recall | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recall(y_true, y_pred, average, labels):\n\n y_true, y_pred = check_metric_args(y_true, y_pred, average, labels)\n\n result = None\n\n m = len(y_true)\n n = len(labels)\n\n confusion_matrix = get_confusion_matrix(y_true, y_pred, labels).T\n\n if average == \"micro\":\n numerator = np.t... | [
"0.7605524",
"0.74488467",
"0.7404089",
"0.7280915",
"0.72097343",
"0.7165874",
"0.7157609",
"0.7145226",
"0.7145226",
"0.7145226",
"0.7145226",
"0.7145226",
"0.7145226",
"0.71317255",
"0.71007556",
"0.70970625",
"0.70970625",
"0.70970625",
"0.70970625",
"0.70970625",
"0.7097... | 0.6768482 | 54 |
3x3conv filter preserves fmap dimensions if stride=1 exactly halves fmap dimensions if stride=2 requires padding=dilation=1, kernel_size=3 becomes depthwise convolution when in_planes = out_planes = groups | def conv3x3(in_planes, out_planes, stride=1, groups=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, groups=groups,
padding=1, dilation=1, bias=False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conv3x3(in_planes, out_planes, stride=1, dilation=1, padding=1):\n return nn.Conv2d(in_planes,\n out_planes,\n kernel_size=3,\n stride=stride,\n padding=padding,\n dilation=dilation,\n bia... | [
"0.77772915",
"0.7751898",
"0.7708785",
"0.7708785",
"0.7708785",
"0.7696468",
"0.76708174",
"0.76697737",
"0.76697737",
"0.76697737",
"0.76697737",
"0.76697737",
"0.76697737",
"0.76697737",
"0.76697737",
"0.76697737",
"0.76697737",
"0.76697737",
"0.76697737",
"0.76697737",
"... | 0.7554087 | 29 |
Create Dataset subclass on cityscapes dataset | def __init__(self, dataset_dir, mode='train', transforms=None):
self.dataset = dataset_dir
self.transforms = transforms
require_file = ['trainImages.txt', 'trainLabels.txt',
'valImages.txt', 'valLabels.txt',
'testImages.txt', 'testLabels.txt']
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, dataset: Dataset):\n self.dataset = dataset",
"def __init__(self, name_dataset, reduce=False):\n dataset = TUDataset(root='data/TUDataset', name=name_dataset)\n if reduce:\n new_dataset = []\n for i in tqdm(range(len(dataset))):\n aux_g... | [
"0.7318747",
"0.7070812",
"0.705741",
"0.69346154",
"0.6801784",
"0.67992985",
"0.6797068",
"0.675288",
"0.67364866",
"0.6648119",
"0.6614223",
"0.6611031",
"0.65885764",
"0.65562135",
"0.6517669",
"0.65067214",
"0.6500058",
"0.64421076",
"0.64387065",
"0.6411031",
"0.6365106... | 0.0 | -1 |
Adjust learning rate at each epoch | def adjust_lr(self):
learning_rate = self.params.base_lr * (1 - float(self.epoch) / self.params.num_epoch) ** self.params.power
for param_group in self.opt.param_groups:
param_group['lr'] = learning_rate
print('Change learning rate into %f' % (learning_rate))
self.summary_wri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjust_learning_rate(self, epoch):\n lr = self.lr * (0.5 ** (epoch // 2))\n for param_group in self.optimizer.param_groups:\n param_group['lr'] = lr",
"def adjust_learning_rate(optimizer, epoch):\n lr = opt.lr * (0.5 ** (epoch // opt.step))\n return lr",
"def adjust_learning... | [
"0.82811373",
"0.82739276",
"0.8209765",
"0.81924576",
"0.8177442",
"0.81709737",
"0.8161613",
"0.8161521",
"0.8161521",
"0.8161521",
"0.81576496",
"0.8155148",
"0.8144319",
"0.81242913",
"0.81204253",
"0.8119406",
"0.81193167",
"0.81014806",
"0.81010354",
"0.8084342",
"0.808... | 0.78228253 | 74 |
Return the remainder of a list in src, starting before an element or ). >>> read_tail(Buffer(tokenize_lines([')']))) nil >>> read_tail(Buffer(tokenize_lines(['2 3)']))) Pair(2, Pair(3, nil)) >>> read_tail(Buffer(tokenize_lines(['2 (3 4))']))) Pair(2, Pair(Pair(3, Pair(4, nil)), nil)) | def read_tail(src):
if src.current() is None:
raise SyntaxError('unexpected end of file')
if src.current() == ')':
src.pop()
return nil
first = scheme_read(src)
rest = read_tail(src)
return Pair(first, rest) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def take(self, line, head, tail):\n data = None\n rest = line\n begin = line.find(head)\n if begin != -1:\n line = line[begin + len(head):]\n end = line.find(tail)\n if end != -1:\n data = line[:end]\n rest = line[end + len(... | [
"0.62023",
"0.5961643",
"0.5870388",
"0.5625115",
"0.559991",
"0.55696696",
"0.55203354",
"0.5368489",
"0.5332481",
"0.5304666",
"0.5293615",
"0.5290877",
"0.5275637",
"0.5255011",
"0.52535564",
"0.51826555",
"0.5160872",
"0.5157932",
"0.51445717",
"0.5142943",
"0.51237637",
... | 0.7980613 | 0 |
Initializes the topic model | def __init__(self, min_topics, max_topics, step):
super(TopicOptimizer, self).__init__()
self.min_topics = min_topics
self.max_topics = max_topics
self.step = step | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, topic):\n self.topic = topic",
"def __init__(self):\n self.topics = {}",
"def __init__( self, weights, topics ):\n\n # Number of topics and dictionary size\n self.W, self.K = topics.shape\n assert( self.W > self.K )\n\n self.topics = topics\n ... | [
"0.75878173",
"0.7326735",
"0.7317074",
"0.7296003",
"0.7248847",
"0.7173298",
"0.70417184",
"0.67718774",
"0.6764849",
"0.6759086",
"0.6741697",
"0.66902506",
"0.66195655",
"0.65756196",
"0.65608066",
"0.65159005",
"0.6511945",
"0.64816284",
"0.6464826",
"0.64429224",
"0.643... | 0.60266024 | 28 |
Add a handler to an existing logging.Logger object | def _add_handler(logger, handler=None, loglevel=None):
handler.setLevel(loglevel or DEFAULT_LOGLEVEL)
if handler.level <= logging.DEBUG:
_fmt = '%(asctime)s| %(levelname)-4.3s|%(threadName)10.9s/' \
'%(lineno)04d@%(module)-10.9s| %(message)s'
handler.setFormatter(logging.Formatter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_file_handler_to_logger(logger):\n # This makes \n if AppState().log_file is None:\n return\n\n # Create file handler which logs even DEBUG messages.\n fh = logging.FileHandler(AppState().log_file)\n\n # Set logging level for this file.\n fh.setLevel(logging.DEBUG)\n\n # Create f... | [
"0.730158",
"0.7083873",
"0.70768595",
"0.69950664",
"0.67779076",
"0.67307496",
"0.6639868",
"0.6612778",
"0.6585183",
"0.65658885",
"0.6468931",
"0.64650214",
"0.6443481",
"0.64255625",
"0.63551295",
"0.63521326",
"0.634116",
"0.63212717",
"0.63015157",
"0.62598276",
"0.625... | 0.74555445 | 0 |
Remove dictionary keys whose value is None | def _remove_none_values(dictionary):
return list(map(dictionary.pop,
[i for i in dictionary if dictionary[i] is None])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_none_values(dict_):\r\n\r\n res = {}\r\n res.update((key, value) for key, value in dict_.iteritems() \\\r\n if value is not None)\r\n return res",
"def _drop_none_values(dictionary: Dict) -> Dict:\n return {key: value for key, value in dictionary.items() if value is not None... | [
"0.82933813",
"0.8234842",
"0.81453615",
"0.7987498",
"0.7972441",
"0.79094595",
"0.78908825",
"0.7887798",
"0.77657074",
"0.7746054",
"0.7739094",
"0.76895493",
"0.7611383",
"0.75638944",
"0.753068",
"0.742391",
"0.7329428",
"0.7286233",
"0.72591496",
"0.72389627",
"0.723101... | 0.7719699 | 11 |
Test leave days sufficient. | def test_leaveform_max_days(self):
user = mommy.make("auth.User", first_name="Bob", last_name="Ndoe")
staffprofile = mommy.make("small_small_hr.StaffProfile", user=user)
staffprofile.leave_days = 21
staffprofile.sick_days = 10
staffprofile.save()
request = self.factory.g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Daysleftverification():\n pass",
"def isLeaveLeft(self,leave_type,days):\n if leave_type == 1 :\n return days<=self.earned_balance\n elif leave_type == 2 :\n return days<=self.hp_balance\n elif leave_type == 3 :\n return days*2<=self.hp_balance \n ... | [
"0.7283778",
"0.69937253",
"0.69766676",
"0.6856982",
"0.6750773",
"0.66546655",
"0.6651582",
"0.6467872",
"0.6376243",
"0.6373224",
"0.6355564",
"0.635506",
"0.6275747",
"0.6274649",
"0.62272155",
"0.6193317",
"0.6190739",
"0.6174433",
"0.6147189",
"0.6145103",
"0.6110374",
... | 0.7107806 | 1 |
Test StaffProfileUserForm image not required on update. | def test_staffprofile_user_form_no_image(self):
user = mommy.make("auth.User")
staffprofile = mommy.make("small_small_hr.StaffProfile", user=user)
request = self.factory.get("/")
request.session = {}
request.user = AnonymousUser()
path = os.path.join(BASE_DIR, "tests", ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_staffprofile_admin_form_no_image(self):\n user = mommy.make(\"auth.User\")\n staffprofile = mommy.make(\"small_small_hr.StaffProfile\", user=user)\n\n request = self.factory.get(\"/\")\n request.session = {}\n request.user = AnonymousUser()\n\n path = os.path.join... | [
"0.7652241",
"0.6728502",
"0.66071117",
"0.6606162",
"0.6591402",
"0.6577869",
"0.6530034",
"0.64637095",
"0.640589",
"0.6283228",
"0.61998254",
"0.61802197",
"0.6131706",
"0.6127896",
"0.612147",
"0.6116664",
"0.6115772",
"0.6107535",
"0.60589457",
"0.60509855",
"0.6047661",... | 0.78006655 | 0 |
Test StaffProfileAdminForm image not required when editting. | def test_staffprofile_admin_form_no_image(self):
user = mommy.make("auth.User")
staffprofile = mommy.make("small_small_hr.StaffProfile", user=user)
request = self.factory.get("/")
request.session = {}
request.user = AnonymousUser()
path = os.path.join(BASE_DIR, "tests",... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_staffprofile_user_form_no_image(self):\n user = mommy.make(\"auth.User\")\n staffprofile = mommy.make(\"small_small_hr.StaffProfile\", user=user)\n\n request = self.factory.get(\"/\")\n request.session = {}\n request.user = AnonymousUser()\n\n path = os.path.join(... | [
"0.7230931",
"0.65301496",
"0.60166913",
"0.6003747",
"0.5991661",
"0.59901386",
"0.5923907",
"0.5909916",
"0.58569574",
"0.58297867",
"0.57913953",
"0.5783393",
"0.5762155",
"0.57606184",
"0.5758113",
"0.569092",
"0.5689196",
"0.56693393",
"0.56252676",
"0.5616211",
"0.55839... | 0.7694595 | 0 |
return a subset of the all_variables by prefix. | def variable_parser(var_list, prefix):
ret_list = []
for var in var_list:
varname = var.name
varprefix = varname.split('/')[0]
if varprefix == prefix:
ret_list.append(var)
return ret_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_vars_by_prefix(self, prefix):\n\n t_vars = tf.global_variables()\n return [var for var in t_vars if prefix in var.name]",
"def variable_parser(var_list, prefix):\r\n ret_list = []\r\n for var in var_list:\r\n varname = var.name\r\n varprefix = varname.split('/')[0]\r\n if varpref... | [
"0.8116482",
"0.6835347",
"0.63726485",
"0.6177495",
"0.60232663",
"0.59492016",
"0.5925924",
"0.59243375",
"0.5875041",
"0.58261853",
"0.5819193",
"0.5804013",
"0.57915413",
"0.57557017",
"0.5747941",
"0.5744697",
"0.57416284",
"0.56466186",
"0.5612707",
"0.55958796",
"0.559... | 0.67632866 | 2 |
Start date until 20170823 or a 404 if not. | def from_start_date_to_august_2017(start):
canonicalized = start.replace(" ", "").lower()
for start_date in temperature_parameters_list:
search_date = start_date["date"].replace(" ", "").lower()
all_dates_after_start_date = [multiple_dates for multiple_dates in temperature_parameters_list if m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def starting_date(self):\n return datetime.date(2016, 1, 4)",
"def get_start_date():\n\n\tprint()\n\tprint('Getting the first start date to query for.')\n\tprint()\n\tprint('The date must be greater than Jan 1st, 2018')\n\tyear = int(input('Enter a value for the year: '))\n\tmonth = int(input('Enter a val... | [
"0.62898207",
"0.6102839",
"0.60328037",
"0.6010952",
"0.6002709",
"0.59757394",
"0.59757394",
"0.5923541",
"0.5909359",
"0.5903214",
"0.57976615",
"0.579471",
"0.57743955",
"0.5741619",
"0.57394296",
"0.57363695",
"0.5697981",
"0.56959206",
"0.5692512",
"0.56789994",
"0.5667... | 0.0 | -1 |
Return the exposure time in seconds. | def exptime(self):
exptime = float(self.get('TRUITIME')) * int(self.get('COADDONE'))
return exptime | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_exposure(self):\n exposure = float(self._driver.ExposureTime)\n\n return exposure",
"def exposuretime(self):\n _, = self.exposuretimes\n return _",
"def exposuretime(self) -> ErrorValue:\n return ErrorValue(self._data['ExpTime'], self._data.setdefault('ExpTimeError',0.0))",
... | [
"0.7363663",
"0.7276466",
"0.71463877",
"0.6887475",
"0.68450737",
"0.6844163",
"0.6723883",
"0.6701503",
"0.67011184",
"0.66474575",
"0.66254306",
"0.6620939",
"0.6619225",
"0.6606661",
"0.65857524",
"0.6573928",
"0.65723",
"0.65713686",
"0.65686315",
"0.65556556",
"0.654065... | 0.62541884 | 65 |
Getter method for locator_id, mapped from YANG variable /input/LocatorRecord/locator_id (string) | def _get_locator_id(self):
return self.__locator_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_locator_id(self, v, load=False):\n parent = getattr(self, \"_parent\", None)\n if parent is not None and load is False:\n raise AttributeError(\"Cannot set keys directly when\" +\n \" within an instantiated list\")\n\n try:\n t = YANGDynClass(v,base=unicode, ... | [
"0.7350876",
"0.60492724",
"0.55044645",
"0.5292573",
"0.5196207",
"0.5154262",
"0.5143212",
"0.510555",
"0.510013",
"0.5021925",
"0.49630928",
"0.49584314",
"0.49514553",
"0.48948523",
"0.4884165",
"0.4883817",
"0.48638391",
"0.48410615",
"0.48236477",
"0.48236477",
"0.48236... | 0.678453 | 1 |
Setter method for locator_id, mapped from YANG variable /input/LocatorRecord/locator_id (string) | def _set_locator_id(self, v, load=False):
parent = getattr(self, "_parent", None)
if parent is not None and load is False:
raise AttributeError("Cannot set keys directly when" +
" within an instantiated list")
try:
t = YANGDynClass(v,base=unicode, is_leaf=True, yang... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_LocatorRecord(self, v, load=False):\n try:\n t = YANGDynClass(v,base=YANGListType(\"locator_id\",yc_LocatorRecord_pyangbind_example__input_LocatorRecord, yang_name=\"LocatorRecord\", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper), is_container='list', yang_nam... | [
"0.63118845",
"0.6116834",
"0.541008",
"0.5226008",
"0.52146155",
"0.52146155",
"0.52146155",
"0.52146155",
"0.52146155",
"0.52146155",
"0.5208086",
"0.5208086",
"0.5208086",
"0.5208086",
"0.5208086",
"0.5208086",
"0.5152715",
"0.5113063",
"0.5104444",
"0.51016283",
"0.505076... | 0.8190384 | 0 |
Getter method for weight, mapped from YANG variable /input/LocatorRecord/weight (uint8) | def _get_weight(self):
return self.__weight | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_weight(self, v, load=False):\n try:\n t = YANGDynClass(v,base=np.uint8, is_leaf=True, yang_name=\"weight\", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True)\n except (TypeError, ValueError):\n raise ValueError(\"\"\"weight must be of a type comp... | [
"0.6755693",
"0.67394847",
"0.6637276",
"0.6507941",
"0.6507941",
"0.64790034",
"0.64714485",
"0.6462987",
"0.6430881",
"0.64253485",
"0.6390043",
"0.6390043",
"0.6390043",
"0.6360452",
"0.62894845",
"0.6286088",
"0.6286088",
"0.6221909",
"0.62105703",
"0.6202522",
"0.6136967... | 0.6419557 | 17 |
Setter method for weight, mapped from YANG variable /input/LocatorRecord/weight (uint8) | def _set_weight(self, v, load=False):
try:
t = YANGDynClass(v,base=np.uint8, is_leaf=True, yang_name="weight", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True)
except (TypeError, ValueError):
raise ValueError("""weight must be of a type compatible with ba... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_weight(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), is_leaf=True, yang_name=\"weight\", rest_name=\"weight\", parent=self, pat... | [
"0.7173742",
"0.71261907",
"0.71261907",
"0.71261907",
"0.7124982",
"0.7124982",
"0.7124982",
"0.6930075",
"0.6854091",
"0.6854091",
"0.6854091",
"0.654635",
"0.65132165",
"0.6213096",
"0.60744756",
"0.60718274",
"0.606918",
"0.6024914",
"0.6020157",
"0.5972273",
"0.5965551",... | 0.774903 | 0 |
Getter method for multicastWeight, mapped from YANG variable /input/LocatorRecord/multicastWeight (uint8) | def _get_multicastWeight(self):
return self.__multicastWeight | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_multicastWeight(self, v, load=False):\n try:\n t = YANGDynClass(v,base=np.uint8, is_leaf=True, yang_name=\"multicastWeight\", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True)\n except (TypeError, ValueError):\n raise ValueError(\"\"\"multicastWe... | [
"0.7588154",
"0.5257662",
"0.5250413",
"0.5210578",
"0.5175591",
"0.5127283",
"0.5110381",
"0.50396127",
"0.50396127",
"0.50396127",
"0.5034055",
"0.5034055",
"0.5034055",
"0.5029845",
"0.5006056",
"0.4981525",
"0.49774846",
"0.49774846",
"0.49386257",
"0.49386257",
"0.493862... | 0.70765233 | 1 |
Setter method for multicastWeight, mapped from YANG variable /input/LocatorRecord/multicastWeight (uint8) | def _set_multicastWeight(self, v, load=False):
try:
t = YANGDynClass(v,base=np.uint8, is_leaf=True, yang_name="multicastWeight", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True)
except (TypeError, ValueError):
raise ValueError("""multicastWeight must be o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_multicastWeight(self):\n return self.__multicastWeight",
"def _set_weight(self, v, load=False):\n try:\n t = YANGDynClass(v,base=np.uint8, is_leaf=True, yang_name=\"weight\", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True)\n except (TypeError, ... | [
"0.6678886",
"0.5881262",
"0.5806964",
"0.5806964",
"0.5806964",
"0.58052194",
"0.58052194",
"0.58052194",
"0.5402897",
"0.5298001",
"0.5271714",
"0.5237159",
"0.5237159",
"0.5237159",
"0.5186103",
"0.51658547",
"0.4932866",
"0.49096778",
"0.48995125",
"0.48133203",
"0.481126... | 0.84586775 | 0 |
Setter method for localLocator, mapped from YANG variable /input/LocatorRecord/localLocator (boolean) | def _set_localLocator(self, v, load=False):
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="localLocator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True)
except (TypeError, ValueError):
raise ValueError("""localLocator must be of a type ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_localLocator(self):\n return self.__localLocator",
"def local(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"local\")",
"def local(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"local\")",
"def local(self) -> pulumi.Output[Optional[bool]]:\n ... | [
"0.6287664",
"0.5828949",
"0.5828949",
"0.55667734",
"0.5547197",
"0.553913",
"0.54638076",
"0.52337706",
"0.52014136",
"0.51928854",
"0.51270527",
"0.51270527",
"0.51270527",
"0.51270527",
"0.50773776",
"0.5034757",
"0.5028427",
"0.5021666",
"0.50191003",
"0.49850848",
"0.49... | 0.8276338 | 0 |
Getter method for rlocProbed, mapped from YANG variable /input/LocatorRecord/rlocProbed (boolean) | def _get_rlocProbed(self):
return self.__rlocProbed | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_rlocProbed(self, v, load=False):\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"rlocProbed\", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True)\n except (TypeError, ValueError):\n raise ValueError(\"\"\"rlocProbed must be of... | [
"0.73260176",
"0.46317473",
"0.46158537",
"0.45694757",
"0.45441782",
"0.45398918",
"0.45247114",
"0.45137352",
"0.44872126",
"0.44861192",
"0.4473698",
"0.44509727",
"0.44429824",
"0.44327995",
"0.4392198",
"0.4387672",
"0.4379323",
"0.43745342",
"0.43587065",
"0.43559256",
... | 0.7142277 | 1 |
Getter method for routed, mapped from YANG variable /input/LocatorRecord/routed (boolean) | def _get_routed(self):
return self.__routed | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_route_throu(self):\n\n # VPR stores route-through LUTs as \"open\" blocks with mode set to\n # \"wire\".\n return self.is_leaf and self.name == \"open\" and self.mode == \"wire\"",
"def can_location_be_routed_to(location: CommonLocation) -> bool:\n return CommonLocationUtils.ca... | [
"0.57929003",
"0.57313263",
"0.56877166",
"0.5655214",
"0.5447337",
"0.54195905",
"0.54025376",
"0.54025376",
"0.54015297",
"0.5378665",
"0.5280592",
"0.5280592",
"0.52611727",
"0.5238895",
"0.5148455",
"0.50744885",
"0.50203764",
"0.5011416",
"0.49734855",
"0.49599394",
"0.4... | 0.5745694 | 1 |
Getter method for action, mapped from YANG variable /input/mapping_record/action (enumeration) | def _get_action(self):
return self.__action | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_action(self, v, load=False):\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type=\"dict_key\", restriction_arg={u'Drop': {}, u'NativelyForward': {}, u'SendMapRequest': {}, u'NoAction': {}},... | [
"0.6726955",
"0.66544145",
"0.6651963",
"0.6489662",
"0.64806074",
"0.6460034",
"0.64220244",
"0.63789093",
"0.63123024",
"0.63082045",
"0.63082045",
"0.63082045",
"0.63082045",
"0.63082045",
"0.63082045",
"0.6260747",
"0.6260747",
"0.6260747",
"0.6216058",
"0.6177274",
"0.61... | 0.62875503 | 15 |
Getter method for authoritative, mapped from YANG variable /input/mapping_record/authoritative (boolean) | def _get_authoritative(self):
return self.__authoritative | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_authoritative(self, v, load=False):\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"authoritative\", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True)\n except (TypeError, ValueError):\n raise ValueError(\"\"\"authoritative m... | [
"0.6718088",
"0.5188267",
"0.48823407",
"0.4824742",
"0.48030117",
"0.4789381",
"0.46382806",
"0.44682306",
"0.4430279",
"0.44179815",
"0.43863338",
"0.4384197",
"0.4380008",
"0.4363615",
"0.4360782",
"0.43460184",
"0.43358245",
"0.43231368",
"0.43094635",
"0.43013746",
"0.42... | 0.6757098 | 0 |
Setter method for authoritative, mapped from YANG variable /input/mapping_record/authoritative (boolean) | def _set_authoritative(self, v, load=False):
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="authoritative", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True)
except (TypeError, ValueError):
raise ValueError("""authoritative must be of a ty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_authoritative(self):\n return self.__authoritative",
"def is_authorised_representative(self):\n if not hasattr(self, '_is_authorised_representative'):\n self._is_authorised_representative = hasattr(self, 'authorised_representative')\n\n return self._is_authorised_representati... | [
"0.6427643",
"0.49042958",
"0.48028368",
"0.46999156",
"0.4692326",
"0.46825922",
"0.45674053",
"0.44718954",
"0.44571823",
"0.44474322",
"0.4403648",
"0.43995556",
"0.4394256",
"0.4390693",
"0.43134287",
"0.43096423",
"0.43039706",
"0.4281209",
"0.42597413",
"0.42550257",
"0... | 0.75602883 | 0 |
Getter method for mapping_record, mapped from YANG variable /input/mapping_record (container) | def _get_mapping_record(self):
return self.__mapping_record | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_mapping_record(self, v, load=False):\n try:\n t = YANGDynClass(v,base=yc_mapping_record_pyangbind_example__input_mapping_record, is_container='container', yang_name=\"mapping-record\", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True)\n except (TypeEr... | [
"0.71528155",
"0.6570029",
"0.49631503",
"0.48740909",
"0.48525885",
"0.4783413",
"0.47829446",
"0.47790676",
"0.47216207",
"0.4719149",
"0.4693326",
"0.46838725",
"0.46826375",
"0.46717525",
"0.4661885",
"0.46412706",
"0.46412706",
"0.46040523",
"0.45518145",
"0.45385614",
"... | 0.65431213 | 2 |
Returns the number of mesh bodies in the collection. | def count(self):
return int() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def numnems(self):\n count = 0\n for o in self._objs.values():\n count += len(o.netifs())\n return count",
"def n_rays(self):\n try: \n return self._n_rays\n except AttributeError:\n self._n_rays = 0\n for r in self.rays(): self._n_ra... | [
"0.6592899",
"0.6562196",
"0.6492465",
"0.6490426",
"0.6490426",
"0.63891214",
"0.6374162",
"0.6371211",
"0.6367845",
"0.6366196",
"0.6363674",
"0.63497156",
"0.63456136",
"0.6343821",
"0.6334106",
"0.6313597",
"0.6312238",
"0.6303904",
"0.6288599",
"0.62479997",
"0.62390107"... | 0.0 | -1 |
Returns the number of mesh bodies in the collection. | def count(self):
return int() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def numnems(self):\n count = 0\n for o in self._objs.values():\n count += len(o.netifs())\n return count",
"def n_rays(self):\n try: \n return self._n_rays\n except AttributeError:\n self._n_rays = 0\n for r in self.rays(): self._n_ra... | [
"0.6592899",
"0.6562196",
"0.6492465",
"0.6490426",
"0.6490426",
"0.63891214",
"0.6374162",
"0.6371211",
"0.6367845",
"0.6366196",
"0.6363674",
"0.63497156",
"0.63456136",
"0.6343821",
"0.6334106",
"0.6313597",
"0.6312238",
"0.6303904",
"0.6288599",
"0.62479997",
"0.62390107"... | 0.0 | -1 |
List of the valid units of measure for this type. | def unitsofmeasure(self):
return self._unitsofmeasure | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_units(self, obj: Dimension) -> [Unit]:\n try:\n return obj.units()\n except KeyError as e:\n logging.error(str(e))\n return []",
"def list_data_units(self):\n return self.data_units.items()",
"def units(self):\n return self._units",
"def un... | [
"0.78333354",
"0.7298863",
"0.72212994",
"0.72212994",
"0.71799505",
"0.7144857",
"0.7069483",
"0.69528997",
"0.6926764",
"0.6894928",
"0.6879163",
"0.68667114",
"0.68334574",
"0.67959476",
"0.67511106",
"0.6689399",
"0.664782",
"0.6642333",
"0.6621156",
"0.6603523",
"0.66010... | 0.7202679 | 4 |
Checks that when we have no more candidates, that our path 'endpoints' are cyclical. | def have_cycle(candidates, path):
return (not candidates and path[0].prefix == path[-1].suffix) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_paths(self):\n for path in self.paths:\n # check that arc starts at s\n arc = path[0]\n arc_start = self.arc_info[arc][\"start\"]\n assert(arc_start == self.source()), \"Path does not start at s\"\n # check that internal arcs are valid\n ... | [
"0.64591026",
"0.64028496",
"0.62922645",
"0.6263719",
"0.62504596",
"0.6250248",
"0.62022024",
"0.6092906",
"0.60610884",
"0.6022989",
"0.6006082",
"0.5956604",
"0.595369",
"0.5885716",
"0.58702284",
"0.58571595",
"0.5837033",
"0.5828162",
"0.5810018",
"0.5783266",
"0.576298... | 0.6560611 | 0 |
Get the definition of this managed folder. The definition contains name, description checklists, tags, connection and path parameters, metrics and checks setup. | def get_definition(self):
return self.client._perform_json(
"GET", "/projects/%s/managedfolders/%s" % (self.project_key, self.odb_id)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_definition(self):\n return self.definition",
"def get_definition(self):\n return self.client._perform_json(\n \"GET\", \"/admin/groups/%s\" % self.name)",
"def definition(self):\n\n return self._definition",
"def definition(self):\n\n return self._definition",
... | [
"0.5817693",
"0.57296735",
"0.5583368",
"0.5583368",
"0.5496289",
"0.5493704",
"0.5425934",
"0.5191441",
"0.51887023",
"0.51887023",
"0.51505697",
"0.5133599",
"0.5114542",
"0.511077",
"0.510388",
"0.50844294",
"0.5081377",
"0.5072677",
"0.5038703",
"0.5038015",
"0.50089884",... | 0.65869796 | 0 |
Get the flow zone of this managed folder. | def get_zone(self):
return self.project.get_flow().get_zone_of_object(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zone(self):\n return self._zone",
"def access_zone(self):\n return self._access_zone",
"def zone(self) -> str:\n return self._zone",
"def zone(self) -> str:\n return pulumi.get(self, \"zone\")",
"def zone(self) -> str:\n return pulumi.get(self, \"zone\")",
"def loca... | [
"0.64082503",
"0.6311886",
"0.6157333",
"0.6036838",
"0.6036838",
"0.59640765",
"0.59602046",
"0.5879423",
"0.58616424",
"0.58191",
"0.5772731",
"0.5772731",
"0.5696067",
"0.56114745",
"0.55910367",
"0.55511653",
"0.55193275",
"0.54935896",
"0.5492465",
"0.54857844",
"0.54575... | 0.75278246 | 0 |
Get the recipes referencing this folder. | def get_usages(self):
return self.client._perform_json("GET", "/projects/%s/managedfolders/%s/usages" % (self.project_key, self.odb_id)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recipes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Recipe]:\n pass",
"def recipe(self):\n return self.__recipe",
"def used_in_recipes(self):\n Recipe = apps.get_model('recipes','Recipe')\n values = {}\n rqset = Recipe.objects.filter(co... | [
"0.6679568",
"0.6539516",
"0.65215296",
"0.62811166",
"0.60671085",
"0.6007505",
"0.6002195",
"0.59581256",
"0.5914185",
"0.58589774",
"0.5787091",
"0.5786681",
"0.5779459",
"0.5712589",
"0.55811965",
"0.5561164",
"0.55499417",
"0.5543476",
"0.55397946",
"0.5537948",
"0.55229... | 0.0 | -1 |
Add a time partitioning dimension. | def add_time_partitioning_dimension(self, dim_name, period="DAY"):
self.settings["partitioning"]["dimensions"].append({"name": dim_name, "type": "time", "params":{"period": period}}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_discrete_partitioning_dimension(self, dim_name):\n self.settings[\"partitioning\"][\"dimensions\"].append({\"name\": dim_name, \"type\": \"value\"})",
"def add_timedim(data, date=\"1970-01-01\"):\n if isinstance(data, xr.DataArray):\n if \"time\" in data.dims:\n raise ValueErr... | [
"0.63332134",
"0.6205126",
"0.56875503",
"0.5681772",
"0.5438656",
"0.5215479",
"0.52103144",
"0.52042055",
"0.5199717",
"0.5189618",
"0.5118998",
"0.5118998",
"0.511268",
"0.5108713",
"0.50541395",
"0.5043726",
"0.50367475",
"0.5027835",
"0.5004906",
"0.49656916",
"0.4962021... | 0.8382509 | 0 |
Predict an action given a context. | def predict(
self,
context: np.ndarray,
epsilon: Prob = 0.05,
exploration_width: int = 1,
exploration_strategy: str = "smart",
) -> Tuple[Action, Prob]:
def _get_direction(action_change: Action) -> Optional[str]:
if action_change < 0:
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict_fn(future_action, state):\n model = get_model()\n rewards = model((state, future_action))\n return {\"reward\": rewards}",
"def fit_predict(\n self,\n context: np.ndarray,\n action: np.ndarray,\n reward: np.ndarray,\n pscore: Optional[np.ndarray] = None,\n ... | [
"0.68578327",
"0.66418797",
"0.66278553",
"0.6600217",
"0.6558365",
"0.6513659",
"0.6338011",
"0.6164591",
"0.6121328",
"0.61089677",
"0.61044675",
"0.6058313",
"0.6042822",
"0.601579",
"0.59879005",
"0.59817743",
"0.5955881",
"0.5951787",
"0.5791318",
"0.5769036",
"0.5753873... | 0.6694794 | 1 |
Tests if invalid data structure raises exception. | def test_translate_invalid_struct(self):
root = netapp_api.NaElement('root')
child = 'random child element'
self.assertRaises(ValueError, root.translate_struct, child) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_with_invalid_input(self):\n for dataset_type in ['ruler', 'pencil', 'cheese']:\n with self.assertRaises(ValueError) as exc:\n check_dataset_type(dataset_type)\n self.assertEqual(\"Dataset type not 'regular' or 'raw' is %s\" % dataset_type,\n ... | [
"0.69549423",
"0.6800185",
"0.67051315",
"0.66807365",
"0.6600718",
"0.65539765",
"0.6551458",
"0.65252626",
"0.6507101",
"0.65033543",
"0.650226",
"0.6499803",
"0.6486112",
"0.6415248",
"0.6384",
"0.6347746",
"0.6316549",
"0.6275802",
"0.6264271",
"0.62269646",
"0.62124825",... | 0.59542996 | 71 |
Get github access token | def get_token(self, code):
token_url = get_config('login.github.access_token_url')
data_to_post = {
"client_id": get_config("login.github.client_id"),
"client_secret": get_config("login.github.client_secret"),
"code": str(code)
}
headers = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_github_credendial(cls) -> 'ApiCredential':\n return cls.select_token_for_api(GITHUB_API_NAME)",
"def get_github_credentials():\n\n p = subprocess.Popen(\"git config github.accesstoken\",\n shell=True,\n stdout=subprocess.PIPE,\n ... | [
"0.7889109",
"0.7756136",
"0.77456725",
"0.767006",
"0.7652787",
"0.74576634",
"0.7299358",
"0.7048512",
"0.7019856",
"0.6951362",
"0.6916727",
"0.68040997",
"0.67905265",
"0.67753285",
"0.67421544",
"0.6734485",
"0.6664523",
"0.6646364",
"0.6640968",
"0.66376317",
"0.6619797... | 0.71718204 | 7 |
Create an Nbin discrete colormap from a specified input map | def discrete_cmap(N, base_cmap=None):
base = plt.get_cmap(base_cmap)
color_list = base(np.linspace(0, 1, N))
cmap_name = base.name + str(N)
return base.from_list(cmap_name, color_list, N) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def discrete_cmap(N, base_cmap=None):\n # see https://gist.github.com/jakevdp/91077b0cae40f8f8244a\n base = plt.cm.get_cmap(base_cmap)\n color_list = base(np.linspace(0, 1, N))\n cmap_name = base.name + str(N)\n return base.from_list(cmap_name, color_list, N)",
"def discrete_cmap(N, base_cmap=None... | [
"0.72187954",
"0.69491076",
"0.6924096",
"0.6924096",
"0.6924096",
"0.6920645",
"0.69188344",
"0.69188344",
"0.69188344",
"0.69188344",
"0.69142735",
"0.69021994",
"0.67898613",
"0.6699816",
"0.6696647",
"0.6689399",
"0.6646159",
"0.6633695",
"0.65624946",
"0.65356964",
"0.64... | 0.73025054 | 0 |
Gets private y attribute | def y(self):
return self.__y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getY(self):\n return self.__y",
"def get_y(self):\n return self.__y",
"def getY(self):\r\n\t\treturn self._y",
"def getY(self):\n y = self.getAttribute('y')\n kind = self.getKind()\n self._y = y if kind == 'pie' else None\n return self._y",
"def y ( self ) :... | [
"0.841883",
"0.8398741",
"0.83670765",
"0.8316007",
"0.82583463",
"0.82080144",
"0.82080144",
"0.8157799",
"0.8075069",
"0.80740833",
"0.80477303",
"0.8026044",
"0.7950843",
"0.7929073",
"0.79166466",
"0.79166466",
"0.79166466",
"0.79166466",
"0.79166466",
"0.79166466",
"0.79... | 0.8127693 | 17 |
Sets y attribute with exceptions | def y(self, value):
self.data_validator("y", value)
self.__y = value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setY(self, y):\n self.y = y\n pass",
"def setY(self, y):\r\n\t\tself._y=y",
"def set_y(self, y: float):\n self.y = y",
"def y(self, value):\n self.validate_input(y=value)\n self.__y = value",
"def set_y(self, new_y):\r\n self.y = new_y",
"def y(self, value):\... | [
"0.73010266",
"0.7284235",
"0.7217349",
"0.7144914",
"0.7122965",
"0.71036816",
"0.7090068",
"0.707471",
"0.70422107",
"0.70308393",
"0.7030658",
"0.7030658",
"0.68635017",
"0.68199414",
"0.68199414",
"0.67532015",
"0.6728125",
"0.6710675",
"0.6618399",
"0.6606974",
"0.653372... | 0.740591 | 0 |
List topics under an Azure subscription. List all the topics under an Azure subscription. | def list_by_subscription(
self, filter=None, top=None, custom_headers=None, raw=False, **operation_config):
def prepare_request(next_link=None):
if not next_link:
# Construct URL
url = self.list_by_subscription.metadata['url']
path_format_a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_topics(project_id):\n project_path = f\"projects/{project_id}\"\n for topic in PUBLISHER_CLIENT.list_topics(request={\"project\": project_path}):\n print(topic)",
"def getSubscriptionTopics(self) -> List[str]:\n return self.cpp.getSubscriptionTopics()",
"def list(self, topic, **opt... | [
"0.6736064",
"0.62780625",
"0.6222821",
"0.61687106",
"0.6118089",
"0.60156256",
"0.6014105",
"0.5942633",
"0.5940105",
"0.5926205",
"0.5869012",
"0.58526254",
"0.58135444",
"0.5807725",
"0.57842153",
"0.57534415",
"0.5664178",
"0.5650704",
"0.5627084",
"0.56049913",
"0.55736... | 0.49367982 | 45 |
Place a sell limit order with given quantity and price. | def limit_sell(self, order_id, quantity, price):
Library.functions.limit_sell(self._book, order_id, quantity, price) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sell_limit_order(self, price=0, volume=0):\n auth = CoinbaseExchangeAuth(self.api_key, self.secret_key, self.passphrase)\n data = {\n \"size\": volume,\n \"price\": price,\n \"side\": \"sell\",\n \"product_id\": self.rate,\n \"type\": \"limit... | [
"0.7925371",
"0.78168416",
"0.75428194",
"0.7417188",
"0.7071134",
"0.70346624",
"0.6954648",
"0.69130063",
"0.69096357",
"0.6874446",
"0.6859875",
"0.6753681",
"0.66568744",
"0.6572149",
"0.6491404",
"0.6474029",
"0.64717853",
"0.6457523",
"0.6403897",
"0.64003015",
"0.63966... | 0.7997252 | 0 |
Place a sell limit order with given quantity and price. | def limit_buy(self, order_id, quantity, price):
Library.functions.limit_buy(self._book, order_id, quantity, price) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def limit_sell(self, order_id, quantity, price):\n Library.functions.limit_sell(self._book, order_id, quantity, price)",
"def sell_limit_order(self, price=0, volume=0):\n auth = CoinbaseExchangeAuth(self.api_key, self.secret_key, self.passphrase)\n data = {\n \"size\": volume,\n ... | [
"0.7997252",
"0.7925371",
"0.78168416",
"0.75428194",
"0.7071134",
"0.70346624",
"0.6954648",
"0.69130063",
"0.69096357",
"0.6874446",
"0.6859875",
"0.6753681",
"0.66568744",
"0.6572149",
"0.6491404",
"0.6474029",
"0.64717853",
"0.6457523",
"0.6403897",
"0.64003015",
"0.63966... | 0.7417188 | 4 |
Place a sell limit order with given quantity and price. | def limit(self, side, order_id, quantity, price):
Library.functions.limit(self._book, side, order_id, quantity, price) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def limit_sell(self, order_id, quantity, price):\n Library.functions.limit_sell(self._book, order_id, quantity, price)",
"def sell_limit_order(self, price=0, volume=0):\n auth = CoinbaseExchangeAuth(self.api_key, self.secret_key, self.passphrase)\n data = {\n \"size\": volume,\n ... | [
"0.7997252",
"0.7925371",
"0.78168416",
"0.75428194",
"0.7417188",
"0.7071134",
"0.70346624",
"0.6954648",
"0.69130063",
"0.6874446",
"0.6859875",
"0.6753681",
"0.66568744",
"0.6572149",
"0.6491404",
"0.6474029",
"0.64717853",
"0.6457523",
"0.6403897",
"0.64003015",
"0.639665... | 0.69096357 | 9 |
Return true if the order with given ID is in the book, false otherwise. | def has(self, order_id):
return Library.functions.has(self._book, order_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_bookid(self,book_id):\r\n if int(book_id) in [i.book_id for i in self.issued_books]:\r\n return True\r\n else:\r\n return False",
"def has_book(self, book):\n return self.books.filter(lists_books.c.book_id == book.id).count() > 0",
"def check_if_exists(se... | [
"0.7184754",
"0.67059475",
"0.66672266",
"0.6560992",
"0.6473398",
"0.6266325",
"0.6255005",
"0.62520516",
"0.6207968",
"0.60897744",
"0.59901696",
"0.5943703",
"0.5933619",
"0.5922701",
"0.5920018",
"0.5893061",
"0.5883331",
"0.5859028",
"0.5831498",
"0.5804595",
"0.58011097... | 0.8160919 | 0 |
Place a market sell order. | def market_sell(self, order_id, quantity):
Library.functions.market_sell(self._book, order_id, quantity) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def place_sell_order(self):\n price = request.form[\"price\"]\n stocks = request.form[\"stocks\"]\n trader_id = request.form[\"trader_id\"]\n self.market.place_sell_order(trader_id, price, stocks)\n return \"\"",
"def market_sell(self, symbol: Symbol, quantity: str,\n ... | [
"0.7930447",
"0.7572596",
"0.74668825",
"0.74021333",
"0.7328512",
"0.71016085",
"0.70995575",
"0.7032074",
"0.7010187",
"0.69835454",
"0.69822085",
"0.69458824",
"0.6895653",
"0.6854374",
"0.68069553",
"0.67670125",
"0.67350507",
"0.67321897",
"0.6717197",
"0.6653469",
"0.66... | 0.703232 | 7 |
Place a market buy order. | def market_buy(self, order_id, quantity):
Library.functions.market_buy(self._book, order_id, quantity) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def place_buy_order(self):\n price = request.form[\"price\"]\n stocks = request.form[\"stocks\"]\n trader_id = request.form[\"trader_id\"]\n self.market.place_buy_order(trader_id, price, stocks)\n return \"\"",
"def market_buy(self, symbol: Symbol, quantity: str,\n ... | [
"0.7915061",
"0.76987463",
"0.7456805",
"0.7420727",
"0.73668903",
"0.73653954",
"0.721675",
"0.7157601",
"0.7151941",
"0.6919067",
"0.6892058",
"0.68738705",
"0.68698674",
"0.6852184",
"0.6849464",
"0.68483245",
"0.68466145",
"0.6835547",
"0.6833255",
"0.681506",
"0.6805769"... | 0.76428556 | 2 |
Convert second to minute | def second_to_minute(time):
if time % 60 != 0:
time = time + 60
return time // 60 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def int_convert_to_minute(value):\n min = int(int(value) / 60)\n sec = int(int(value) % 60)\n return \"%02d\" % min + \":\" + \"%02d\" % sec",
"def get_minute(self):\n\n # First we get the first 8 bits stored in the minute register\n # and translate it to an integer\n minute_bcd = s... | [
"0.81158906",
"0.7529537",
"0.7427662",
"0.7400211",
"0.7394658",
"0.73557305",
"0.725303",
"0.7242647",
"0.7215991",
"0.7102178",
"0.70426196",
"0.69982487",
"0.6993329",
"0.69814235",
"0.6980721",
"0.6963728",
"0.6873445",
"0.6735053",
"0.6705921",
"0.66999775",
"0.66999775... | 0.8488949 | 0 |
Returns true iff the candidate password equals the stored one. | def is_password(self, candidate):
if self.rate_limit_remaining() > 0:
with open(self.password_filename, 'r') as f:
hashed = f.read().strip()
if hashed == pbkdf2.crypt(candidate, unicode(hashed)):
return True
else:
# Increment ra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_password(self, password):\n return self.password == password",
"def do_passwords_match(self, password1, password2):\n return password1 == password2",
"def verify_password(self, password):\n return self.PASS == password",
"def verify_password(self, password):\n return sel... | [
"0.75234157",
"0.7371934",
"0.72819686",
"0.72519046",
"0.72246903",
"0.70825803",
"0.704436",
"0.698168",
"0.6954732",
"0.69302136",
"0.6905826",
"0.6901915",
"0.68608254",
"0.6840604",
"0.6808323",
"0.6777243",
"0.67617476",
"0.6687569",
"0.6681926",
"0.66676414",
"0.666382... | 0.72442955 | 4 |
Return true iff candidate authentication token matches stored one. | def is_authentication_token(self, candidate):
current_token = self.__current_authentication_token()
# TODO: Add expiry checking
if (current_token and
self.__valid_token_format(current_token) and
self.__valid_token_format(candidate) and
constant_tim... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authenticated(self):\n return self.token is not None",
"def check_token(self, user, token):\n try:\n data = signing.loads(token, max_age=properties.TOKEN_LOGIN_TIMEOUT)\n except signing.BadSignature:\n return False\n\n return (\n (\n ... | [
"0.6938202",
"0.68884546",
"0.6865633",
"0.68002206",
"0.6707966",
"0.66578394",
"0.6657788",
"0.6632563",
"0.6583302",
"0.6578111",
"0.65751725",
"0.65728736",
"0.6560326",
"0.6539685",
"0.6510684",
"0.649782",
"0.649383",
"0.64898247",
"0.64779943",
"0.64613837",
"0.6455331... | 0.84338975 | 0 |
This function plots image and intensity of image through time | def plot_image_and_brightness(axis, image, imageintensity, framecount):
# Plot RGB Image
axis[0].imshow(image)
axis[0].axis('off')
axis[0].set_title(f'Frame Number {framecount}')
# Plot intensity
axis[1].plot(imageintensity, '.-')
axis[1].set_ylabel('Average Intensity')
# Stuff to sho... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def imshow(img):\n imadd(img)\n plt.ion()\n plt.show()",
"def fn_intensitytrace(file_name,folder,data,time,i,x,y):\n import numpy as np\n import matplotlib.pyplot as plt\n\n\n figure_name=file_name+'_intensity_trace'\n for a in range(0,len(data),int(len(data)/2)):\n if i==a:\n ... | [
"0.69218147",
"0.6863551",
"0.668293",
"0.667952",
"0.66168284",
"0.657051",
"0.6569345",
"0.65316135",
"0.65316135",
"0.65316135",
"0.6529275",
"0.6461676",
"0.64531654",
"0.6427083",
"0.64266634",
"0.640738",
"0.6397536",
"0.63804084",
"0.63659954",
"0.63561183",
"0.6350481... | 0.71107686 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.