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 |
|---|---|---|---|---|---|---|
Return the number of subject members for this subject | def subject_member_count(context, subject_id):
session = get_session()
if not subject_id:
msg = _("Subject id is required.")
raise exception.Invalid(msg)
query = session.query(models.SubjectMember)
query = query.filter_by(deleted=False)
query = query.filter(models.SubjectMember.sub... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def member_count(self):\n return len(self.members)",
"def nb_subjects(self) -> int:\n return 0",
"def getNumMembers(self):\n return _libsbml.Group_getNumMembers(self)",
"def getNumMembers(self):\n return _libsbml.ListOfMembers_getNumMembers(self)",
"def get_members_count(self, *... | [
"0.772104",
"0.74138516",
"0.736991",
"0.72562224",
"0.68163705",
"0.67959434",
"0.6596146",
"0.65303284",
"0.6507669",
"0.6457859",
"0.6423427",
"0.64205056",
"0.640804",
"0.6380624",
"0.6347884",
"0.63121754",
"0.62402576",
"0.6160997",
"0.61510974",
"0.61480117",
"0.614164... | 0.7710199 | 1 |
Decides which direction the numbers should move and which function to use. Takes a field (list) and a direction (string) as arguments | def Transform(field, dir):
if dir == "w":
field = TransformUpMovement(field)
elif dir == "s":
field = TransformDownMovement(field)
elif dir == "a":
field = TransformLeftMovement(field)
elif dir == "d":
field = TransformRightMovement(field)
return field | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def motorsDirection(self, direction):\n\n print (direction)\n if direction == 'r' or direction == 'R':\n self.motorDirection(self.motor1DirectionPin, self.motorReverse)\n self.motorDirection(self.motor2DirectionPin, self.motorReverse)\n print (\"Direction reverse\")\n else:\n self.moto... | [
"0.6022935",
"0.5904038",
"0.58467376",
"0.5798845",
"0.5735596",
"0.5735596",
"0.5720787",
"0.5689735",
"0.5684878",
"0.5579244",
"0.5538586",
"0.5538111",
"0.54772305",
"0.5432082",
"0.5423685",
"0.53911453",
"0.53749377",
"0.53623766",
"0.5355661",
"0.5354094",
"0.5321425"... | 0.65193075 | 0 |
Checks the given direction. Takes a field (list) and a direction (string) as arguments | def TurnCheck(field, dir):
global sym
sym = 1
temp_list = field[:]
field_copy = field[:]
if temp_list == Transform(field_copy, dir):
sym = 0
return False
else:
sym = 0
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invalid_direction(direction):\n valid_directions = [\"forwards\", \"backwards\"]\n\n if direction not in valid_directions:\n return f\"`direction` must be one of [{', '.join(valid_directions)}]\"\n\n return False",
"def __isDirection__(self, word):\n self.directions = ('north', 'south'... | [
"0.6416556",
"0.60414803",
"0.58753735",
"0.58546865",
"0.58014697",
"0.5784472",
"0.56669724",
"0.5533791",
"0.5529238",
"0.54971635",
"0.5430529",
"0.5380655",
"0.5322589",
"0.53053087",
"0.5268107",
"0.526434",
"0.52259505",
"0.52011395",
"0.5165153",
"0.51473004",
"0.5103... | 0.5623845 | 7 |
Check if a list of matrices forms an orthonormal basis. | def check_orthonormal(mats):
mats = np.stack((mat for mat in mats))
nb_matrices = len(mats)
dot = np.eye(nb_matrices, dtype=np.float64)
for i in range(nb_matrices):
for j in range(i, nb_matrices):
dot[i, j] = np.trace(mats[i, ...] @ mats[j, ...].transpose())
dot[j, i] = d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_mat_list(list_matrices):\n flag = True\n if isinstance(list_matrices, list):\n for matrix in list_matrices:\n if not isinstance(matrix, np.matrix):\n flag = False\n # TODO Check for matrix dimensions?\n else:\n flag = False\n return flag",
... | [
"0.68600386",
"0.64700145",
"0.63169473",
"0.5977321",
"0.5859525",
"0.5731614",
"0.5651928",
"0.5617208",
"0.557992",
"0.553658",
"0.55348724",
"0.55106556",
"0.54960275",
"0.5460473",
"0.5455496",
"0.5454142",
"0.54330325",
"0.54206663",
"0.5403764",
"0.54003906",
"0.540005... | 0.72912705 | 0 |
Tests whether ``.ChannelMetadataGuildMainBase.__eq__`` works as intended. | def test__ChannelMetadataGuildMainBase__eq():
parent_id = 202209170024
name = 'Armelyrics'
permission_overwrites = [
PermissionOverwrite(202209170026, target_type = PermissionOverwriteTargetType.user)
]
position = 7
keyword_parameters = {
'parent_id': parent_id,
'nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n if not isinstance(other, WrappedChannel):\n return False\n\n return self.__dict__ == other.__dict__",
"def __eq__(self, other):\n return isinstance(other, type(self)) and set(self.channels) == set(other.channels)",
"def __eq__(self, other: object) -> b... | [
"0.67958033",
"0.65078115",
"0.6484208",
"0.64335704",
"0.6409005",
"0.6355463",
"0.63350314",
"0.6317273",
"0.63166475",
"0.6309817",
"0.6308102",
"0.6306244",
"0.6306244",
"0.6259636",
"0.62531966",
"0.62531966",
"0.62531966",
"0.62531966",
"0.62531966",
"0.62531966",
"0.62... | 0.7348498 | 0 |
Posts message to Webex Teams Space via Teams API. | def post_message(room_id, message):
url = 'https://api.ciscospark.com/v1/messages'
msg_data = {'roomId': room_id, 'text': message}
data = json.dumps(msg_data).encode('utf8')
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % BOT_TOKEN}
request = urllib.request.Request(url... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def POST(self):\n\t\t\n\t\tjson_data = web.data()\t\t# Get the POST data sent from Webex Teams\n\t\t#print(\"\\nWEBHOOK POST RECEIVED:\")\n\t\t#print(json_data, \"\\n\")\n\n\t\twebhook_obj = Webhook(json_data)\t\t\t\t\t# Create a Webhook object from the JSON data\n\t\troom = api.rooms.get(webhook_obj.data.roomId)\... | [
"0.7260894",
"0.6730366",
"0.6399684",
"0.6363027",
"0.6303861",
"0.63001585",
"0.62660867",
"0.6256721",
"0.6224647",
"0.62149286",
"0.61287177",
"0.6087486",
"0.6047124",
"0.604167",
"0.602124",
"0.60182124",
"0.59959775",
"0.59786326",
"0.59661853",
"0.5948993",
"0.5899369... | 0.568731 | 32 |
Instantiate an ASVspoof dataset. | def __init__(self, root, train=True, filt=None, transform=None):
self.train = train
self._spkr_table = spkrinfo(
os.path.join(root, 'TIMIT/DOC/SPKRINFO.TXT'), train)
if train:
root = os.path.join(root, 'TIMIT/TRAIN')
else:
root = os.path.join(root, 'TI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, dataset):\n self._dataset = dataset",
"def __init__(self, dataset: Dataset):\n self.dataset = dataset",
"def __init__(self, data, v1, v2):\n self.data = data\n self.v1 = v1\n self.v2 = v2",
"def _create_dataset(source=''):\n return ExperimentalData... | [
"0.56679356",
"0.55737174",
"0.5539805",
"0.55116534",
"0.5410488",
"0.5373269",
"0.53664124",
"0.5346616",
"0.5346616",
"0.5338754",
"0.5332249",
"0.5323143",
"0.53092664",
"0.5307395",
"0.52873755",
"0.52870107",
"0.5281569",
"0.5251314",
"0.5217191",
"0.52141094",
"0.51925... | 0.0 | -1 |
Formats a datetime, date or string as an ISO8601 string | def format_date(value):
if isinstance(value, datetime):
return value.strftime(SERVER_DATE_FORMAT)
elif isinstance(value, date):
return value.strftime(SERVER_DATE_FORMAT)
elif (isinstance(value, int) or
isinstance(value, float)):
return datetime \
.fromtimestamp(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_iso8601(obj):\n return obj.strftime('%Y-%m-%dT%H:%M:%SZ')",
"def format_datetime(self, datetime):\n return datetime.isoformat()",
"def format_datetime(self, data):\r\n data = make_naive(data)\r\n if self.datetime_formatting == 'rfc-2822':\r\n return format_datetime... | [
"0.812086",
"0.75518924",
"0.7392109",
"0.73067963",
"0.729053",
"0.72904897",
"0.7132998",
"0.7093537",
"0.7091279",
"0.7050992",
"0.70505095",
"0.7045866",
"0.6931054",
"0.6894664",
"0.6890694",
"0.6887499",
"0.6828062",
"0.6783544",
"0.6760374",
"0.67411095",
"0.667677",
... | 0.0 | -1 |
Gets the updated learning rate, where both the size and direction of change depends on where the current iterations falls in the LR cycle | def get_lr(self, iteration: int) -> float:
cycle_perc = iteration / self.full_cycle
# Normal cycle
# Increase
if cycle_perc <= 0.5:
# starts @ 0 for baseline LR
lr = self.init_lr + iteration * self.increment
# Decrease
elif 0.5 < cycle_perc <= 1:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def learning_rate(epoch):\n self.lr = self.lr / 1.00000001\n return self.lr",
"def get_learning_rate(self):\n config = self.config\n cur_lr = Train_model_pipeline.adjust_learning_rate(\n self.optimizer,\n self.epoch,\n config[\"training\"][\"le... | [
"0.78187853",
"0.7785106",
"0.77401835",
"0.7728709",
"0.7622573",
"0.75150746",
"0.74915457",
"0.74766344",
"0.7467334",
"0.7460882",
"0.7456292",
"0.74437195",
"0.7294708",
"0.7278568",
"0.7201488",
"0.7201488",
"0.7200297",
"0.7200297",
"0.7171246",
"0.7152182",
"0.7145887... | 0.68816733 | 30 |
Overwrite the optimiser LR and momentum (if applicable) to what's specified in this callback | def on_train_begin(self, batch: int, logs={}) -> None:
print(f"Updating LR to callback init LR: {self.init_lr}")
self.model.optimizer.lr.assign(self.init_lr)
if self.cyclic_momentum:
print(f"Updating momentum to callback init momentum:"
f" {self.init_momentum}")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def step(self):\n\n self.compute_lr()\n\n self.optimizer.param_groups[self.param_group]['lr'] = self.lr\n self.optimizer.param_groups[self.param_group]['momentum'] = self.momentum",
"def update_lr(self, *args, **kwargs):\n raise NotImplementedError",
"def update_lr(self, *args, **kw... | [
"0.7096096",
"0.7083641",
"0.7083641",
"0.67919034",
"0.6785857",
"0.67111427",
"0.6663379",
"0.6653025",
"0.6633548",
"0.6593658",
"0.6560677",
"0.655529",
"0.6553427",
"0.6552752",
"0.6537889",
"0.6486289",
"0.6475922",
"0.646475",
"0.64041394",
"0.63940114",
"0.6365639",
... | 0.63653934 | 21 |
Gets the number of iterations required to achieve the maximum learning rate, provided both the initial learning rate and the increment size (which is on a log base 10 scale) | def get_iterations(train_length: int, batch_size: int, epochs: int) -> int:
return train_length // batch_size * epochs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_max_iters():\n return 2000",
"def get_learning_rate():\n return 0.00001",
"def compute_effective_steps_per_epoch(dataloader: Iterable, accumulate_size: int) -> int:\n return len(dataloader) // accumulate_size",
"def runtime(self):\n return self.tmax_epochs - self.tmin_epochs",
"... | [
"0.7032233",
"0.66875947",
"0.667666",
"0.6495764",
"0.6415308",
"0.6415308",
"0.6376867",
"0.6318192",
"0.63148457",
"0.62815166",
"0.62557095",
"0.62294275",
"0.61517715",
"0.61355764",
"0.6118113",
"0.6112622",
"0.6108275",
"0.60991913",
"0.60991913",
"0.6084063",
"0.60781... | 0.64215267 | 4 |
Performs operations on the eye frame to isolate the iris | def image_processing(eye_frame, threshold):
kernel = np.ones((3, 3), np.uint8)
new_frame = cv2.bilateralFilter(eye_frame, 10, 15, 15)
new_frame = cv2.erode(new_frame, kernel, iterations=3)
new_frame = cv2.threshold(new_frame, threshold, 255, cv2.THRESH_BINARY)[1]
return new_fram... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def detect_iris(self, eye_frame):\n self.iris_frame = self.image_processing(eye_frame, self.threshold)\n\n contours, _ = cv2.findContours(self.iris_frame, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)[-2:]\n contours = sorted(contours, key=cv2.contourArea)\n try:\n moments = cv2.mome... | [
"0.7296892",
"0.647295",
"0.63905966",
"0.619666",
"0.60340935",
"0.588351",
"0.5873989",
"0.57799286",
"0.57169574",
"0.56637853",
"0.56582534",
"0.55783826",
"0.5560803",
"0.55563104",
"0.53972054",
"0.5389131",
"0.53548276",
"0.5308359",
"0.52839845",
"0.52753854",
"0.5274... | 0.60038483 | 5 |
Returns the percentage of space that the iris takes up on the surface of the eye. | def iris_size(frame):
frame = frame[5:-5, 5:-5]
height, width = frame.shape[:2]
nb_pixels = height * width
nb_blacks = nb_pixels - cv2.countNonZero(frame)
return nb_blacks / nb_pixels | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def horizontal_ratio(self):\n if self.pupils_located:\n pupil_left = self.eye_left.pupil.x / (self.eye_left.center[0] * 2 - 10)\n pupil_right = self.eye_right.pupil.x / (self.eye_right.center[0] * 2 - 10)\n return (pupil_left + pupil_right) / 2",
"def density(self):\r\n ... | [
"0.64891875",
"0.6354588",
"0.63132066",
"0.61837536",
"0.6149222",
"0.60943633",
"0.6046352",
"0.6026906",
"0.6017602",
"0.5980879",
"0.5956626",
"0.59555954",
"0.5933781",
"0.5933781",
"0.5933781",
"0.5931633",
"0.58839655",
"0.5840578",
"0.58396274",
"0.58396274",
"0.58396... | 0.5966948 | 10 |
Returns the middle point (x,y) between two points | def _middle_point(p1, p2):
x = int((p1.x + p2.x) / 2)
y = int((p1.y + p2.y) / 2)
return (x, y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def midpoint(point1, point2):\n\n x, y = (int((point1[0] + point2[0]) / 2), int((point1[1] + point2[1]) / 2))\n return (x, y)",
"def mid_point(a: Point, b: Point) -> Point:\n return Point((a.x + b.x) / 2, (a.y + b.y) / 2)",
"def _mid(pt1, pt2):\n (x0, y0), (x1, y1) = pt1, pt2\n return 0.5 * (x0 ... | [
"0.8332387",
"0.832619",
"0.80376065",
"0.7855965",
"0.77383506",
"0.7694335",
"0.761417",
"0.7549157",
"0.73095095",
"0.7287564",
"0.7153021",
"0.71367353",
"0.7130825",
"0.71296805",
"0.70716804",
"0.6961621",
"0.68734384",
"0.67816556",
"0.67264247",
"0.6706939",
"0.670399... | 0.88593143 | 0 |
Get value from package/project configuration settings. | def get_value(key, default_value=None):
# Get value from project configuration
value = get_project_value(key)
# Use package configuration when value has not been found
if value is None:
value = get_package_value(key)
# Return package/project value
if value is not None:
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_package_value(key, default_value=None):\r\n try:\r\n config = sublime.load_settings(S.FILE_PACKAGE_SETTINGS)\r\n if config and config.has(key):\r\n return config.get(key)\r\n except RuntimeError:\r\n sublime.set_timeout(lambda: load_package_values(), 0)\r\n if S... | [
"0.7372877",
"0.73065704",
"0.71638405",
"0.7117794",
"0.70552105",
"0.69296044",
"0.6906995",
"0.6880387",
"0.686294",
"0.6832302",
"0.6735246",
"0.6722489",
"0.6700523",
"0.66744435",
"0.666836",
"0.66381544",
"0.6605854",
"0.65933394",
"0.6579853",
"0.6573926",
"0.65435594... | 0.6702843 | 12 |
Get value from default/user package configuration settings. | def get_package_value(key, default_value=None):
try:
config = sublime.load_settings(S.FILE_PACKAGE_SETTINGS)
if config and config.has(key):
return config.get(key)
except RuntimeError:
sublime.set_timeout(lambda: load_package_values(), 0)
if S.CONFIG_PACKAGE:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value(key, default_value=None):\r\n # Get value from project configuration\r\n value = get_project_value(key)\r\n # Use package configuration when value has not been found\r\n if value is None:\r\n value = get_package_value(key)\r\n # Return package/project value\r\n if value is no... | [
"0.71989745",
"0.7113931",
"0.7026636",
"0.6831768",
"0.68213725",
"0.6797336",
"0.67946523",
"0.6753318",
"0.6746971",
"0.6725576",
"0.6695343",
"0.6694983",
"0.66856986",
"0.6609533",
"0.65969265",
"0.65899867",
"0.65829045",
"0.65431464",
"0.65360355",
"0.6515875",
"0.6461... | 0.80719346 | 0 |
Get value from project configuration settings. | def get_project_value(key, default_value=None):
# Load project coniguration settings
try:
load_project_values()
except RuntimeError:
sublime.set_timeout(lambda: load_project_values(), 0)
# Find value in project configuration
if S.CONFIG_PROJECT:
if key in S.CONFIG_P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_setting_value(self, title, setting):\r\n return self.parser.get(title, setting)",
"def settings():\n return _get_settings()[1]",
"def get_value(self, instance):\n try:\n return ParameterSetting.objects.get(\n base_parameter=instance,\n project=sel... | [
"0.7294889",
"0.7209854",
"0.71413344",
"0.7135972",
"0.70718896",
"0.70299363",
"0.68946207",
"0.68454206",
"0.68304175",
"0.6797999",
"0.6759331",
"0.6723995",
"0.66781276",
"0.6677022",
"0.6604862",
"0.6552394",
"0.6526165",
"0.65131354",
"0.65056795",
"0.65033174",
"0.646... | 0.7473363 | 0 |
Open or focus file in window, which is currently being debugged. | def show_file(filename, row=None):
# Check if file exists if being referred to file system
if os.path.exists(filename):
# Get active window
window = sublime.active_window()
window.focus_group(0)
# Check if file is already open
found = False
view = window.f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def openFile(self):\n\n file_path = self.openFileExplorer()\n\n if file_path is not None:\n file_name = self.getFileNameFromPath(file_path)\n print('open file')\n\n self.add_new_tab(file_path=file_path, file_name=file_name)",
"def open_and_raise(filename, line, col)... | [
"0.70374054",
"0.7001625",
"0.6728387",
"0.67087793",
"0.6633132",
"0.6571457",
"0.6564465",
"0.655614",
"0.6480915",
"0.6480411",
"0.6476841",
"0.64765257",
"0.6471493",
"0.6360822",
"0.6340648",
"0.6301309",
"0.62916464",
"0.6210858",
"0.6183451",
"0.6158362",
"0.6098057",
... | 0.58484375 | 35 |
Scroll the view to center on the given row (line number). | def show_at_row(view, row=None):
if row is not None:
try:
# Convert row (line number) to region
row_region = rows_to_region(row)[0].a
# Scroll the view to row
view.show_at_center(row_region)
except:
# When defining row_region index ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def goto_line(editor, lineno, scroll=False):\n count = editor.blockCount()\n if lineno > count:\n lineno = count\n lineno = lineno-1\n pos = editor.document(\n ).findBlockByNumber(\n lineno).position()\n\n goto_position(editor, pos)\n \n if scroll:\n bar = editor.ve... | [
"0.61264294",
"0.60592645",
"0.5895141",
"0.5608004",
"0.5565074",
"0.5558783",
"0.54682994",
"0.5464183",
"0.54525656",
"0.53794324",
"0.5370704",
"0.5338742",
"0.53369683",
"0.5336963",
"0.5314059",
"0.5277507",
"0.5255978",
"0.52061677",
"0.51960325",
"0.518687",
"0.518395... | 0.6779723 | 0 |
Gets the transport_call_sequence_number of this TransportCall. | def transport_call_sequence_number(self) -> TransportCallSequenceNumber:
return self._transport_call_sequence_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sequence_number(self):\n return self._sequence_number",
"def transport_call_sequence_number(self, transport_call_sequence_number: TransportCallSequenceNumber):\n\n self._transport_call_sequence_number = transport_call_sequence_number",
"def sequence_number(self):\n # type: () -> int\n ... | [
"0.6963038",
"0.67741954",
"0.6749771",
"0.6677467",
"0.6429742",
"0.5921302",
"0.59178203",
"0.5893854",
"0.58414215",
"0.58299685",
"0.5824347",
"0.5793729",
"0.5741379",
"0.5716518",
"0.57060516",
"0.56729215",
"0.56632364",
"0.5628967",
"0.55962527",
"0.5595896",
"0.55705... | 0.9205537 | 0 |
Sets the transport_call_sequence_number of this TransportCall. | def transport_call_sequence_number(self, transport_call_sequence_number: TransportCallSequenceNumber):
self._transport_call_sequence_number = transport_call_sequence_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transport_call_sequence_number(self) -> TransportCallSequenceNumber:\n return self._transport_call_sequence_number",
"def sequence_number(self, sequence_number):\n # type: (int) -> None\n\n if sequence_number is not None:\n if not isinstance(sequence_number, int):\n ... | [
"0.71706456",
"0.62719053",
"0.612321",
"0.600532",
"0.600532",
"0.600532",
"0.600532",
"0.5963724",
"0.59230554",
"0.57909703",
"0.57386893",
"0.55959123",
"0.55951446",
"0.55877894",
"0.55337256",
"0.54906124",
"0.54462594",
"0.5418023",
"0.5405004",
"0.53730154",
"0.536835... | 0.8826703 | 0 |
Gets the un_location_code of this TransportCall. | def un_location_code(self) -> UNLocationCode1:
return self._un_location_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def un_location_code(self, un_location_code: UNLocationCode1):\n\n self._un_location_code = un_location_code",
"def zip_code(self):\n return self._zip_code",
"def get_code(self):\n return self.code",
"def get_code(self):\n return self.code",
"def get_code(self):\n return ... | [
"0.6622405",
"0.5913561",
"0.5826909",
"0.5826909",
"0.5826909",
"0.5826909",
"0.56042856",
"0.5551572",
"0.554241",
"0.5427338",
"0.53895587",
"0.53895587",
"0.53895587",
"0.53895587",
"0.53355235",
"0.5309055",
"0.5294797",
"0.5292849",
"0.528643",
"0.5209685",
"0.5198675",... | 0.77014303 | 0 |
Gets the facility_code of this TransportCall. | def facility_code(self) -> FacilityCode:
return self._facility_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility_type_code(self) -> FacilityTypeCodeTRN:\n return self._facility_type_code",
"def facility_id(self):\n return self.facility_names.get(\n self.facility, self.facility_names['user'])",
"def facility_type_code(self, facility_type_code: FacilityTypeCodeTRN):\n\n self._fa... | [
"0.76306325",
"0.63968474",
"0.6062447",
"0.59766823",
"0.5936451",
"0.58175796",
"0.56413954",
"0.5449211",
"0.5346333",
"0.52893835",
"0.52063215",
"0.52063215",
"0.52063215",
"0.52063215",
"0.52063215",
"0.52063215",
"0.52063215",
"0.52063215",
"0.5197882",
"0.5197882",
"0... | 0.8236776 | 0 |
Gets the facility_code_list_provider of this TransportCall. | def facility_code_list_provider(self) -> FacilityCodeListProvider:
return self._facility_code_list_provider | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility_code_list_provider(self, facility_code_list_provider: FacilityCodeListProvider):\n\n self._facility_code_list_provider = facility_code_list_provider",
"def facility_code(self) -> FacilityCode:\n return self._facility_code",
"def facility_type_code(self) -> FacilityTypeCodeTRN:\n ... | [
"0.6927874",
"0.6314324",
"0.5720347",
"0.5131594",
"0.51165104",
"0.5051455",
"0.49435464",
"0.49236757",
"0.48180133",
"0.4743",
"0.47290778",
"0.47071797",
"0.46978357",
"0.46914044",
"0.46867642",
"0.46514556",
"0.4645628",
"0.45946458",
"0.4540872",
"0.45404473",
"0.4532... | 0.86604375 | 0 |
Gets the facility_type_code of this TransportCall. | def facility_type_code(self) -> FacilityTypeCodeTRN:
return self._facility_type_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility_code(self) -> FacilityCode:\n return self._facility_code",
"def facility_type_code(self, facility_type_code: FacilityTypeCodeTRN):\n\n self._facility_type_code = facility_type_code",
"def type_code(self):\n return self._TYPE_CODE",
"def getTypeCode(self):\n return _li... | [
"0.7469634",
"0.70491064",
"0.6334726",
"0.6140814",
"0.60163283",
"0.5955726",
"0.59346575",
"0.5934325",
"0.5921057",
"0.5814628",
"0.5803388",
"0.5802081",
"0.57825863",
"0.57601184",
"0.57542807",
"0.5747234",
"0.5746684",
"0.5710185",
"0.56925726",
"0.5640349",
"0.563424... | 0.84395015 | 0 |
Sets the facility_type_code of this TransportCall. | def facility_type_code(self, facility_type_code: FacilityTypeCodeTRN):
self._facility_type_code = facility_type_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility_code(self, facility_code: FacilityCode):\n\n self._facility_code = facility_code",
"def facility_type_code(self) -> FacilityTypeCodeTRN:\n return self._facility_type_code",
"def facility_code_list_provider(self, facility_code_list_provider: FacilityCodeListProvider):\n\n self.... | [
"0.7423072",
"0.68273073",
"0.5729778",
"0.5681416",
"0.5639891",
"0.54400724",
"0.5416981",
"0.5416981",
"0.54142743",
"0.54113394",
"0.538243",
"0.53485966",
"0.5314421",
"0.52826625",
"0.52826625",
"0.5275592",
"0.52329594",
"0.52232313",
"0.51419693",
"0.5137019",
"0.5119... | 0.8590951 | 0 |
Gets the other_facility of this TransportCall. | def other_facility(self) -> OtherFacility:
return self._other_facility | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility(self):\n return getattr(self, '_facility', 'user')",
"def other_facility(self, other_facility: OtherFacility):\n\n self._other_facility = other_facility",
"def get_other_end_trunk_party(self, otherDN):\n thisSiteTrunkParty = self.Call.findTrunkPartyToOtherSite(otherDN)\n ... | [
"0.62173206",
"0.6215546",
"0.60112906",
"0.5618352",
"0.55308914",
"0.55186707",
"0.5360198",
"0.5327582",
"0.520508",
"0.5185801",
"0.5175611",
"0.50265193",
"0.502354",
"0.4877988",
"0.4853956",
"0.4838288",
"0.47945",
"0.47939295",
"0.47162384",
"0.47103912",
"0.4699951",... | 0.8507804 | 0 |
Sets the other_facility of this TransportCall. | def other_facility(self, other_facility: OtherFacility):
self._other_facility = other_facility | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def other_facility(self) -> OtherFacility:\n return self._other_facility",
"def facility_name(self, facility_name):\n\n self._facility_name = facility_name",
"def facility_code(self, facility_code: FacilityCode):\n\n self._facility_code = facility_code",
"def setConnectPortal(self,otherP... | [
"0.6466638",
"0.5448923",
"0.54050916",
"0.51941055",
"0.50108624",
"0.49428844",
"0.48733217",
"0.47866112",
"0.47462025",
"0.47439834",
"0.4608091",
"0.45922807",
"0.45272255",
"0.45255762",
"0.4491326",
"0.44810724",
"0.44152954",
"0.44091251",
"0.4404139",
"0.44013253",
"... | 0.8593055 | 0 |
Gets the mode_of_transport of this TransportCall. | def mode_of_transport(self) -> ModeOfTransport:
return self._mode_of_transport | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mode_of_transport(self, mode_of_transport: ModeOfTransport):\n if mode_of_transport is None:\n raise ValueError(\"Invalid value for `mode_of_transport`, must not be `None`\") # noqa: E501\n\n self._mode_of_transport = mode_of_transport",
"def operation_mode(self):\n return se... | [
"0.6922612",
"0.6919277",
"0.6914625",
"0.68750006",
"0.6809099",
"0.68015593",
"0.67928",
"0.6741832",
"0.67172074",
"0.67172074",
"0.67172074",
"0.67147106",
"0.6696603",
"0.66642433",
"0.6643494",
"0.6643494",
"0.6643494",
"0.66030246",
"0.6578615",
"0.6506838",
"0.6487486... | 0.89913356 | 0 |
Gets the location of this TransportCall. | def location(self) -> Object:
return self._location | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getLocation(self):\n return self._Location",
"def get_location(self):\n return self.location",
"def get_location(self):\r\n return self.__location",
"def get_location(self) -> tuple:\n return self.__location",
"def get_location(self):\n\t\treturn self.location",
"def locat... | [
"0.7750524",
"0.76978517",
"0.76392424",
"0.7535657",
"0.7446825",
"0.7426462",
"0.7426462",
"0.7389858",
"0.7348277",
"0.7268434",
"0.7104591",
"0.7087535",
"0.7081364",
"0.7081364",
"0.7081364",
"0.7080595",
"0.7072766",
"0.70353323",
"0.697734",
"0.69753605",
"0.69753605",... | 0.7245504 | 10 |
Gets the vessel of this TransportCall. | def vessel(self) -> Vessel:
return self._vessel | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_vsolar(self):\n return self.read_register(4098, 1, 3)",
"def picked_equity(self):\n if self._swarm_series is None:\n raise ValueError(\"Run pick() method before access this property\")\n return self._swarm_series['equity']",
"def vessel(self, vessel: Vessel):\n\n ... | [
"0.560301",
"0.5569039",
"0.55634546",
"0.52054715",
"0.49749368",
"0.49590352",
"0.49332634",
"0.48401356",
"0.48102656",
"0.48093945",
"0.47924298",
"0.47185913",
"0.47121373",
"0.46898058",
"0.46894285",
"0.46704713",
"0.46704713",
"0.46704713",
"0.46312952",
"0.46303323",
... | 0.7892122 | 0 |
Function to split data into train and val sets | def split_data(data, labels, val_size):
# Shuffle index
index = np.random.permutation(len(data))
# Split into Datasets
X_val = data[index][-val_size:]
X_train = data[index][:-val_size]
y_val = labels[index][-val_size:].ravel()
y_train = labels[index][:-val_size].ravel()
return X_train,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def train_val_test_split(data):\n raise NotImplementedError",
"def __split_dataset(self):\n self.train, self.valid, _, _ = train_test_split(self.data, self.data, test_size=0.2)\n self.valid, self.test, _, _ = train_test_split(self.valid, self.valid, test_size=0.5)",
"def split_data_into_train_... | [
"0.8379278",
"0.7890254",
"0.7878437",
"0.77447265",
"0.77147746",
"0.77090174",
"0.7700599",
"0.7699981",
"0.7680631",
"0.7614884",
"0.75980246",
"0.7575293",
"0.74876386",
"0.748571",
"0.748436",
"0.74659514",
"0.74533266",
"0.74352497",
"0.7428148",
"0.7426668",
"0.7425453... | 0.787688 | 3 |
Helper Function to Partition Training and Val Data | def partition_data(data, folds, fold_n, fold_size):
# Training Data Partition
train_1 = data[:(folds - fold_n) * fold_size]
train_2 = data[(folds - fold_n + 1) * fold_size:]
train = np.concatenate((train_1, train_2), axis=0)
# Validation Data Partition
val = data[(folds - fold_n) * fold_size:(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def partition(self, data, labels):\n\t\traise Exception(\"Not implmented\")",
"def train_val_test_split(data):\n raise NotImplementedError",
"def partition(self, data, labels):\n\t\treturn self.kfold.split(labels)",
"def partition_dataset_val():\n dataset = datasets.MNIST(\n './data',\n t... | [
"0.69507563",
"0.69246083",
"0.6822113",
"0.6767803",
"0.6760928",
"0.6736863",
"0.6716522",
"0.6709685",
"0.66771686",
"0.6621921",
"0.6614691",
"0.6572576",
"0.65240484",
"0.64933664",
"0.6479558",
"0.64308786",
"0.63831043",
"0.636406",
"0.63617957",
"0.63549644",
"0.63293... | 0.682899 | 2 |
For normal servers, return our project landing page. For maint servers, show our maintenance page. Hiring shows a little banner stripe. | def landing(request):
hiring=True
context = RequestContext(request)
""" if logged in show institution courses if appropriate
other rules: superuser - sees all
staff - sees all from institution?
"""
if not request.user.is_authenticated():
course_list = Course.o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_homepage():\n\n return render_template(\"blank-slate.html\")",
"def landing_page():\n\n return render_template('index.html')",
"def view_landing_page():\n return render_template(\"index.html\")",
"def landing():\n return render_template(\"landing.html\")",
"def display():\n\n #still... | [
"0.69910353",
"0.69026303",
"0.68853486",
"0.6730065",
"0.6710997",
"0.65941024",
"0.65666854",
"0.6537216",
"0.6475628",
"0.6431378",
"0.6420248",
"0.64127135",
"0.6380948",
"0.6380948",
"0.6366023",
"0.6355956",
"0.6345088",
"0.633177",
"0.6325091",
"0.6307524",
"0.62918663... | 0.0 | -1 |
Applies binary thresholding to the picture + gaussian blurring for smoothing. | def bin_thresh(img, threshold):
_, new_img = cv2.threshold(img, threshold, 255, cv2.THRESH_BINARY) # 255 is the max value
# make some smoothing to get rid of unnecessary ~splashes of color
# parameters are the width and height of gaussian kernel, and standard deviation in X and Y direction,
# sig... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def binarize(img):\n image = cv.cvtColor(img, cv.COLOR_BGR2GRAY)\n image = cv.GaussianBlur(image, (3, 3), 0)\n ret, image = cv.threshold(image, 0, 255, cv.THRESH_BINARY_INV | cv.THRESH_OTSU)\n return image",
"def bin_thres_img(img, ksize=3):\n # Apply each of the thresholding functions\n gradx ... | [
"0.7324092",
"0.71054596",
"0.7091587",
"0.70801264",
"0.69444305",
"0.6869273",
"0.68644875",
"0.6819687",
"0.67708397",
"0.6760809",
"0.6723325",
"0.6708034",
"0.6666469",
"0.6664369",
"0.6654734",
"0.66252667",
"0.6604466",
"0.6575203",
"0.6574955",
"0.65726924",
"0.657177... | 0.77002597 | 0 |
Inverted binary thresholding + gaussian blurring. | def inv_bin_thresh(img, threshold):
# the 1st returned val = our threshold; if we use cv.THRESH_OTSU, it's optimal threshold val found by the algorithm
_, new_img = cv2.threshold(img, threshold, 255, cv2.THRESH_BINARY_INV)
# make some smoothing to get rid of unnecessary ~splashes of color
# parame... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bin_thresh(img, threshold):\r\n _, new_img = cv2.threshold(img, threshold, 255, cv2.THRESH_BINARY) # 255 is the max value\r\n\r\n # make some smoothing to get rid of unnecessary ~splashes of color\r\n # parameters are the width and height of gaussian kernel, and standard deviation in X and Y directio... | [
"0.7171413",
"0.6945607",
"0.6749838",
"0.6737633",
"0.66952235",
"0.66482",
"0.66207457",
"0.6548103",
"0.65038043",
"0.63922507",
"0.63674086",
"0.63362736",
"0.63297504",
"0.63142514",
"0.62994534",
"0.627683",
"0.62472445",
"0.6229089",
"0.620847",
"0.6207186",
"0.62064",... | 0.73282987 | 0 |
Ensure that the languages listed in nlpaug indeed work. | def test_keyboard_lang(tmp_path, lang):
cmd = [
"keyboard",
"augment",
"tests/data/nlu/nlu.yml",
f"{tmp_path}/nlu.yml",
"--lang",
lang,
]
runner.invoke(app, cmd)
expected = nlu_path_to_dataframe("tests/data/nlu/nlu.yml").shape
assert nlu_path_to_datafr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_language_fix(self):\n #TODO\n \n for lang in self.LANGUAGES:\n activate(lang)\n \n self.assertEqual(lang, get_language())",
"def test_languages(self):\n for i, item in enumerate(self._letters_proto.item):\n for code in item.language:\n ... | [
"0.6886704",
"0.6731473",
"0.66793776",
"0.66151744",
"0.6364525",
"0.63556397",
"0.6352976",
"0.6299135",
"0.62039703",
"0.62039703",
"0.61872655",
"0.60416514",
"0.5985111",
"0.5968464",
"0.59533936",
"0.5934374",
"0.59145063",
"0.5877543",
"0.5865784",
"0.585461",
"0.58064... | 0.5651712 | 22 |
Set the value of the element. | def set_accuracy(self, accuracy):
self._set_sub_text('accuracy', text=str(accuracy))
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(self, val):\n self.value = val",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value (self):\n raise NotImplementedError",
"def setValue(... | [
"0.7725017",
"0.7628555",
"0.7628555",
"0.7628555",
"0.76222175",
"0.76029366",
"0.76018035",
"0.76018035",
"0.75786823",
"0.7552966",
"0.74916303",
"0.74770766",
"0.74770766",
"0.7456504",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0... | 0.0 | -1 |
Set the value of the element. | def set_alt(self, alt):
self._set_sub_text('alt', text=str(alt))
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(self, val):\n self.value = val",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value (self):\n raise NotImplementedError",
"def setValue(... | [
"0.7725017",
"0.7628555",
"0.7628555",
"0.7628555",
"0.76222175",
"0.76029366",
"0.76018035",
"0.76018035",
"0.75786823",
"0.7552966",
"0.74916303",
"0.74770766",
"0.74770766",
"0.7456504",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0... | 0.0 | -1 |
Set the value of the element. | def set_bearing(self, bearing):
self._set_sub_text('bearing', text=str(bearing))
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(self, val):\n self.value = val",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value (self):\n raise NotImplementedError",
"def setValue(... | [
"0.7725017",
"0.7628555",
"0.7628555",
"0.7628555",
"0.76222175",
"0.76029366",
"0.76018035",
"0.76018035",
"0.75786823",
"0.7552966",
"0.74916303",
"0.74770766",
"0.74770766",
"0.7456504",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0... | 0.0 | -1 |
Set the value of the element. | def set_error(self, error):
self._set_sub_text('error', text=str(error))
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(self, val):\n self.value = val",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value (self):\n raise NotImplementedError",
"def setValue(... | [
"0.7725017",
"0.7628555",
"0.7628555",
"0.7628555",
"0.76222175",
"0.76029366",
"0.76018035",
"0.76018035",
"0.75786823",
"0.7552966",
"0.74916303",
"0.74770766",
"0.74770766",
"0.7456504",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0... | 0.0 | -1 |
Set the value of the element. | def set_lat(self, lat):
self._set_sub_text('lat', text=str(lat))
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(self, val):\n self.value = val",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value (self):\n raise NotImplementedError",
"def setValue(... | [
"0.7725017",
"0.7628555",
"0.7628555",
"0.7628555",
"0.76222175",
"0.76029366",
"0.76018035",
"0.76018035",
"0.75786823",
"0.7552966",
"0.74916303",
"0.74770766",
"0.74770766",
"0.7456504",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0... | 0.0 | -1 |
Set the value of the element. | def set_lon(self, lon):
self._set_sub_text('lon', text=str(lon))
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(self, val):\n self.value = val",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value (self):\n raise NotImplementedError",
"def setValue(... | [
"0.7725017",
"0.7628555",
"0.7628555",
"0.7628555",
"0.76222175",
"0.76029366",
"0.76018035",
"0.76018035",
"0.75786823",
"0.7552966",
"0.74916303",
"0.74770766",
"0.74770766",
"0.7456504",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0... | 0.0 | -1 |
Set the value of the element. | def set_speed(self, speed):
self._set_sub_text('speed', text=str(speed))
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(self, val):\n self.value = val",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value (self):\n raise NotImplementedError",
"def setValue(... | [
"0.7725017",
"0.7628555",
"0.7628555",
"0.7628555",
"0.76222175",
"0.76029366",
"0.76018035",
"0.76018035",
"0.75786823",
"0.7552966",
"0.74916303",
"0.74770766",
"0.74770766",
"0.7456504",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0... | 0.0 | -1 |
Set the value of the element. | def set_timestamp(self, timestamp):
self._set_sub_text('timestamp', text=str(xep_0082.datetime(timestamp)))
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(self, val):\n self.value = val",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value(self, value):\n self.value = value",
"def set_value (self):\n raise NotImplementedError",
"def setValue(... | [
"0.7725017",
"0.7628555",
"0.7628555",
"0.7628555",
"0.76222175",
"0.76029366",
"0.76018035",
"0.76018035",
"0.75786823",
"0.7552966",
"0.74916303",
"0.74770766",
"0.74770766",
"0.7456504",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0.74443126",
"0... | 0.0 | -1 |
Return the value of the element as a DateTime. | def get_timestamp(self):
p = self._get_sub_text('timestamp')
if not p:
return None
else:
return xep_0082.datetime(p) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getValue(self):\n return qDateTime2Datetime(self.field.dateTime())",
"def datetime_to_date(element):\r\n try:\r\n result = element.date()\r\n except AttributeError:\r\n result = element\r\n return result",
"def DateTime(self):\n if self.force_auto_sync:\n sel... | [
"0.74458444",
"0.71636486",
"0.69656014",
"0.6959164",
"0.6937993",
"0.6704545",
"0.6685312",
"0.66019374",
"0.6577931",
"0.65257037",
"0.626202",
"0.6234023",
"0.6202789",
"0.59984785",
"0.59536016",
"0.594662",
"0.59457314",
"0.59334636",
"0.592878",
"0.59268194",
"0.592119... | 0.5287838 | 81 |
Parses the value. Raises ValueError if parsing fails. | def parse(value):
return int(value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse(self, value):\n raise NotImplementedError(\"Please implement the Class\")",
"def parse_value(cls, value):\n return value",
"def parse_value(cls, value):\n return value",
"def parse_value(cls, value):\n raise NotImplementedError(\"subclass must implement parse_value()\")"... | [
"0.7712643",
"0.76329917",
"0.76329917",
"0.75979906",
"0.67994577",
"0.6639061",
"0.6451681",
"0.6408441",
"0.63805354",
"0.636819",
"0.6299918",
"0.62814987",
"0.6275649",
"0.6200453",
"0.61872405",
"0.6145554",
"0.6105957",
"0.6089924",
"0.6009777",
"0.6002752",
"0.5993424... | 0.67508763 | 5 |
Returns the value of the SettingValue. | def value(self):
return self._value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_val(self):\n return self.value",
"def get_value(self):\n return self.value",
"def get_value(self):\n return self.value",
"def get_value(self):\n return self.value",
"def value(self, setting_id):\n if setting_id not in self.values:\n return False\n ... | [
"0.76539737",
"0.76385814",
"0.76385814",
"0.76385814",
"0.7610085",
"0.76061416",
"0.76061416",
"0.76061416",
"0.7596555",
"0.7596555",
"0.75596535",
"0.75438493",
"0.7467237",
"0.7450214",
"0.73725134",
"0.7366295",
"0.7365986",
"0.73579204",
"0.73533213",
"0.7301487",
"0.7... | 0.71748954 | 51 |
Dictionary representation of this project. | def to_dict(self):
return {key: getattr(self, key) for key in self.keys} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_dict(self):\n return {\n 'name': self.get_name(),\n 'description': self.get_description()\n }",
"def to_dict(self):\n\n output = {}\n\n output['project_id'] = self.project_id\n output['bootstrap'] = self.bootstrap\n\n output['platform'] = {\n... | [
"0.7331125",
"0.7319767",
"0.7072824",
"0.70597804",
"0.70558727",
"0.7050699",
"0.7045143",
"0.7041281",
"0.7041281",
"0.7041281",
"0.7041281",
"0.7041281",
"0.7041281",
"0.7041281",
"0.7019967",
"0.7003105",
"0.69807714",
"0.69570297",
"0.6953881",
"0.69253945",
"0.69217277... | 0.0 | -1 |
Build a stopwords list | def query_stopwords():
if len(flask.request.args) == 0:
# default response when no arguments are given
return flask.jsonify({'stopwords': []})
feature = flask.request.args.get('feature', 'lemmata')
list_size = flask.request.args.get('list_size', 10)
try:
list_size = int(list_siz... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def construct_stop_words():\n stop_words_list = [\"uk\", \"ceo\", \"apple\", \"wal\", \"st\", \"q1\", \"q2\", \"q3\", \"q4\",\n \"bp\", \"wednesday\", \"tuesday\", \"monday\", \"thursday\", \"friday\", \"sept\", \"johnson\", \"inc\",\n \"david\", \"amazon.com\"]\n\n ... | [
"0.84718066",
"0.81502926",
"0.7368397",
"0.734562",
"0.7298387",
"0.72909045",
"0.7273551",
"0.7248969",
"0.721835",
"0.7206313",
"0.7153189",
"0.70930934",
"0.7086754",
"0.7086754",
"0.7086754",
"0.7086754",
"0.7068293",
"0.70550996",
"0.70040023",
"0.6939101",
"0.69388634"... | 0.6498178 | 70 |
Report curated stopwords lists in database | def query_stopwords_lists():
found = flask.g.db.find(tesserae.db.entities.StopwordsList.collection)
return flask.jsonify({'list_names': [a.name for a in found]}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getStopWords(self):\n\t\treturn self.stop_words",
"def build_stopwords():\r\n\tprint('\\nbuilding stopwords')\r\n\t\r\n\tif load_stopwords():\r\n\t\treturn\r\n\r\n\tglobal stopwords\r\n\tstopwords = nltk.corpus.stopwords.words('english')\r\n\tfor f in os.listdir(paths.path_data_stopwords):\r\n\t\tpath_stopwo... | [
"0.678712",
"0.6768676",
"0.6751135",
"0.67284197",
"0.6684778",
"0.6610801",
"0.6582758",
"0.6491409",
"0.6442",
"0.6439823",
"0.643774",
"0.638284",
"0.63779664",
"0.6335158",
"0.6313454",
"0.63112855",
"0.6294782",
"0.62929267",
"0.6278759",
"0.62734073",
"0.6237022",
"0... | 0.7189156 | 0 |
Retrieve specified stopwords list | def get_stopwords_list(name):
found = flask.g.db.find(tesserae.db.entities.StopwordsList.collection,
name=name)
if not found:
return apitess.errors.error(
404,
name=name,
message=(f'No list with the provided name ({name}) was found in '
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stopwords(self):\n with open(STOPWORDS_LIST, 'r') as content:\n return content.read().splitlines()",
"def query_stopwords_lists():\n found = flask.g.db.find(tesserae.db.entities.StopwordsList.collection)\n return flask.jsonify({'list_names': [a.name for a in found]})",
"def getStopW... | [
"0.7733438",
"0.76901925",
"0.7557667",
"0.75352925",
"0.74828464",
"0.74636143",
"0.7456854",
"0.733596",
"0.73337615",
"0.73041207",
"0.72865635",
"0.7219653",
"0.7185563",
"0.71824616",
"0.7173927",
"0.7085109",
"0.70840603",
"0.7034223",
"0.699293",
"0.69697964",
"0.69683... | 0.73716027 | 7 |
Validates the given password in a request data. First, checks if it exists, then check if the password has the necessary length | def validate_password(data):
if "password" not in data:
return False
password = data["password"]
if len(password) < 4 or len(password) > 16:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate(self, data):\n password = data['password']\n if data['password'] == data['password2'] and re.fullmatch(r'[A-Za-z0-9@#$%^&+=]{8,}', password):\n return data\n raise serializers.ValidationError(\"Password should be match and password must have number,special char,1-capita... | [
"0.75851166",
"0.74440527",
"0.7292162",
"0.72649544",
"0.7264225",
"0.72577757",
"0.7219791",
"0.7198216",
"0.71466994",
"0.7124518",
"0.711993",
"0.7094221",
"0.70784444",
"0.70513403",
"0.70257604",
"0.702355",
"0.70204043",
"0.70114267",
"0.70080715",
"0.7007405",
"0.7006... | 0.8300383 | 0 |
Sets the description of this Project. | def description(self, description):
self._description = description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_description(self, description):\n self.description = description",
"def set_description(self, description):\n self._description = description",
"def set_description(self, description):\n self.__description = description",
"def set_description(self, description):\r\n self._... | [
"0.8326279",
"0.8233822",
"0.820304",
"0.81822044",
"0.8106443",
"0.7996521",
"0.7969712",
"0.7969712",
"0.7969712",
"0.7969712",
"0.7922449",
"0.7922449",
"0.7922449",
"0.7922449",
"0.77929175",
"0.7745738",
"0.77238005",
"0.7722391",
"0.7705753",
"0.7447976",
"0.7434066",
... | 0.790941 | 50 |
Sets the id of this Project. | def id(self, id):
if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, id_):\n\n self.id_ = id_",
"def SetId(self, id):\n self.id = int(id)",
"def set_id(self, id):\n self.__id = id",
"def set_project_id(self, project_id):\n self._project_id = project_id",
"def set_id(self, id):\n self.data['id'] = id",
"def project_id(sel... | [
"0.7772495",
"0.7674228",
"0.76577675",
"0.7616995",
"0.7566155",
"0.7248082",
"0.7248082",
"0.7230967",
"0.72056055",
"0.72056055",
"0.72056055",
"0.72056055",
"0.72056055",
"0.72056055",
"0.72056055",
"0.72056055",
"0.72056055",
"0.72056055",
"0.7199541",
"0.71982116",
"0.7... | 0.0 | -1 |
Sets the name of this Project. | def name(self, name):
if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, name: str):\n self._name = name",
"def set_name(self, name):\n self._name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name... | [
"0.80039996",
"0.7973277",
"0.79648304",
"0.79648304",
"0.79648304",
"0.79648304",
"0.79648304",
"0.7946682",
"0.79346",
"0.78753656",
"0.7843701",
"0.7843701",
"0.7790657",
"0.7738944",
"0.769561",
"0.7684395",
"0.7683468",
"0.76475775",
"0.7641765",
"0.7641765",
"0.7625993"... | 0.0 | -1 |
Sets the slug of this Project. | def slug(self, slug):
if self.local_vars_configuration.client_side_validation and slug is None: # noqa: E501
raise ValueError("Invalid value for `slug`, must not be `None`") # noqa: E501
self._slug = slug | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_slug(self, slug):\n if self.slug is None:\n self.slug = slug",
"def set_slug(self):\n if not self.slug:\n self.slug = slugify(self.name)[:50]",
"def slug(self, slug):\n if slug is None:\n raise ValueError(\"Invalid value for `slug`, must not be `Non... | [
"0.796629",
"0.7526107",
"0.6902236",
"0.681357",
"0.6725959",
"0.65915906",
"0.6463094",
"0.64255965",
"0.63822144",
"0.62079984",
"0.61545795",
"0.615259",
"0.6099709",
"0.6099709",
"0.59585214",
"0.582201",
"0.5819328",
"0.5795239",
"0.5752186",
"0.56858486",
"0.5665566",
... | 0.7589352 | 1 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, Project):
return False
return self.to_dict() == other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
if not isinstance(other, Project):
return True
return self.to_dict() != other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.8456082",
"0.83912885",
"0.81436425",
"0.81406975",
"0.8131807",
"0.8093013",
"0.80912536",
"0.80912536",
"0.80912536",
"0.8084505",
"0.8084505",
"0.8075543",
"0.8075543",
"0.8065009",
"0.80417395",
"0.80417395",
"0.80417395",
"0.80417395",
"0.80417395",
"0.80417395",
"0.8... | 0.0 | -1 |
Return GUIDs for TreeNode representing specified types of colors | def ColorRefGUID(*args):
return _XCAFDoc.xcafdoc_ColorRefGUID(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_groups(nodes):\n return list(set([node.color for node in nodes]))",
"def get_color(self, node: Node) -> str:\n\n idx = hash(node.get_kind_name()) % len(self.colors_)\n return self.colors_[idx]",
"def node_set_colors(nodes, spanset, gapset, preset, postset):\n\n node_colors = []\n ... | [
"0.6007038",
"0.58863235",
"0.56884056",
"0.5642995",
"0.5642661",
"0.56409585",
"0.5529217",
"0.5507591",
"0.54908097",
"0.5480614",
"0.54575694",
"0.54047924",
"0.53328854",
"0.5276417",
"0.523753",
"0.52040595",
"0.5201383",
"0.51968473",
"0.518619",
"0.51773876",
"0.51555... | 0.48994026 | 57 |
Return GUIDs for TreeNode representing specified types of colors | def xcafdoc_ColorRefGUID(*args):
return _XCAFDoc.xcafdoc_ColorRefGUID(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_groups(nodes):\n return list(set([node.color for node in nodes]))",
"def get_color(self, node: Node) -> str:\n\n idx = hash(node.get_kind_name()) % len(self.colors_)\n return self.colors_[idx]",
"def node_set_colors(nodes, spanset, gapset, preset, postset):\n\n node_colors = []\n ... | [
"0.6007038",
"0.58863235",
"0.56884056",
"0.5642995",
"0.5642661",
"0.56409585",
"0.5529217",
"0.5507591",
"0.54908097",
"0.5480614",
"0.54575694",
"0.54047924",
"0.53328854",
"0.5276417",
"0.523753",
"0.52040595",
"0.5201383",
"0.51968473",
"0.518619",
"0.51773876",
"0.51555... | 0.0 | -1 |
Finds a color definition in a colortable and returns its label if found Returns False if color is not found in colortable | def FindColor(self, *args):
return _XCAFDoc.XCAFDoc_ColorTool_FindColor(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def color_label(color):\n\n key_colors = {**kelvin_temperature_colors, **background_colors, **strip_colors}\n nearest_color = lambda key_colors: color_distance(color, key_colors[1])\n\n label, key_color = min(key_colors.items(), key=nearest_color)\n is_backgound_color = label in background_colors or la... | [
"0.6638148",
"0.62774116",
"0.60693693",
"0.59829086",
"0.58847404",
"0.5855688",
"0.58091444",
"0.58039564",
"0.5776507",
"0.57630765",
"0.5752084",
"0.5740827",
"0.57349503",
"0.5718995",
"0.55776227",
"0.5574417",
"0.5569173",
"0.5510618",
"0.5508209",
"0.54885733",
"0.548... | 0.6224437 | 2 |
Returns color defined by label lab Returns False if the label is not in colortable or does not define a color | def GetColor(self, *args):
return _XCAFDoc.XCAFDoc_ColorTool_GetColor(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def label_color(label):\n if label < len(colors):\n return colors[label]\n else:\n warnings.warn('Label {} has no color, returning default.'.format(label))\n return (0, 255, 0)",
"def lab2col(lab, colors):\n col = np.zeros((lab.shape + (3,))).astype(np.uint8)\n labels = np.unique... | [
"0.715765",
"0.67294234",
"0.6618089",
"0.64845157",
"0.6280782",
"0.62696034",
"0.62650335",
"0.62279165",
"0.62279165",
"0.62279165",
"0.62279165",
"0.61729056",
"0.61168206",
"0.6038487",
"0.6015551",
"0.6015551",
"0.5998318",
"0.5973941",
"0.5961747",
"0.5951904",
"0.5915... | 0.0 | -1 |
Gets the color of component that styled with SHUO structure Returns False if no sush component or color type | def GetInstanceColor(self, *args):
return _XCAFDoc.XCAFDoc_ColorTool_GetInstanceColor(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _is_color(cls, obj: Any) -> bool:\n\n return isinstance(obj, Color)",
"def get_color(self) -> Optional[str]:\n return self.color",
"def color(self):\n if \"color\" in self._prop_dict:\n return self._prop_dict[\"color\"]\n else:\n return None",
"def get_co... | [
"0.59983885",
"0.59932554",
"0.59599376",
"0.5956125",
"0.5920354",
"0.58937716",
"0.5891139",
"0.58761173",
"0.5865105",
"0.5865105",
"0.5865105",
"0.5865105",
"0.5865105",
"0.5865105",
"0.5865105",
"0.5865105",
"0.5865105",
"0.5865105",
"0.5865105",
"0.5865105",
"0.5865105"... | 0.0 | -1 |
Returns True if label belongs to a dimtoltable and is a DimTol definition | def IsDimTol(self, *args):
return _XCAFDoc.XCAFDoc_DimTolTool_IsDimTol(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_dimension(self, dim):\n\n return self.units.dimensions == dim",
"def is_label_dataframe(label, df):\n\n setdiff = set(label) - set(df.columns.tolist())\n\n if len(setdiff) == 0:\n return True\n else:\n return False",
"def IsDatum(self, *args):\n return _XCAFDoc.XCAF... | [
"0.58551264",
"0.5809031",
"0.5772506",
"0.5668312",
"0.55064434",
"0.54686344",
"0.5461858",
"0.5439535",
"0.5414709",
"0.54123586",
"0.5410039",
"0.54077226",
"0.5405389",
"0.5403629",
"0.5369551",
"0.5365091",
"0.536253",
"0.5361802",
"0.53552604",
"0.5322496",
"0.5321924"... | 0.7310294 | 0 |
Returns True if label belongs to a dimtoltable and is a Datum definition | def IsDatum(self, *args):
return _XCAFDoc.XCAFDoc_DimTolTool_IsDatum(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isDataLabel(self, label):\n\n if label in self._data:\n return True\n else:\n try:\n return self._getData(label) is not None\n except:\n return False",
"def is_label_dataframe(label, df):\n\n setdiff = set(label) - set(df.columns... | [
"0.6272274",
"0.617111",
"0.60161626",
"0.5917395",
"0.58208036",
"0.5818427",
"0.56999505",
"0.56813335",
"0.5640628",
"0.56257695",
"0.5604382",
"0.5597692",
"0.55590403",
"0.55531365",
"0.5552956",
"0.55464333",
"0.55000174",
"0.5476007",
"0.54670805",
"0.54667634",
"0.543... | 0.67929995 | 0 |
Returns label where the DocumentTool attribute is or 0.1 if DocumentTool is not yet set. | def DocLabel(*args):
return _XCAFDoc.XCAFDoc_DocumentTool_DocLabel(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetToolLabel(self, tool_id):\r\n\r\n tool = self.FindTool(tool_id)\r\n if not tool:\r\n return \"\"\r\n \r\n return tool.label",
"def tool(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"tool\")",
"def XCAFDoc_DocumentTool_DocLabel(*args):\n ... | [
"0.6451488",
"0.61219174",
"0.5963713",
"0.5887194",
"0.57602453",
"0.57087994",
"0.5693222",
"0.5667882",
"0.56523716",
"0.56515676",
"0.56515676",
"0.56515676",
"0.56515676",
"0.56515676",
"0.56515676",
"0.56515676",
"0.56515676",
"0.56515676",
"0.56515676",
"0.5651109",
"0... | 0.57830614 | 4 |
Returns label where the DocumentTool attribute is or 0.1 if DocumentTool is not yet set. | def XCAFDoc_DocumentTool_DocLabel(*args):
return _XCAFDoc.XCAFDoc_DocumentTool_DocLabel(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetToolLabel(self, tool_id):\r\n\r\n tool = self.FindTool(tool_id)\r\n if not tool:\r\n return \"\"\r\n \r\n return tool.label",
"def tool(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"tool\")",
"def get_current_label(self):\n if self... | [
"0.64526844",
"0.6121123",
"0.5887257",
"0.5783792",
"0.57611674",
"0.570822",
"0.569347",
"0.566903",
"0.5653072",
"0.56517494",
"0.56517494",
"0.56517494",
"0.56517494",
"0.56517494",
"0.56517494",
"0.56517494",
"0.56517494",
"0.56517494",
"0.56517494",
"0.5651355",
"0.5651... | 0.59644496 | 2 |
Return GraphNode by index from GraphNodeSequence. | def GetFather(self, *args):
return _XCAFDoc.XCAFDoc_GraphNode_GetFather(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_node(self, index):\r\n\t\tself._validate_index(index)\r\n\t\treturn self._traverse(lambda i, list: i < index)[\"node\"]",
"def __get_node_at_index(self, index: int) -> Node[T]:\n if 0 <= index and index < len(self):\n current = self.head\n for i in range(index):\n ... | [
"0.71678686",
"0.70901066",
"0.700305",
"0.6776235",
"0.67746633",
"0.6752227",
"0.66951156",
"0.66657037",
"0.6592431",
"0.6564482",
"0.65563196",
"0.65389574",
"0.6504534",
"0.6367809",
"0.63006437",
"0.6276945",
"0.6276945",
"0.6139375",
"0.60848457",
"0.60806125",
"0.6078... | 0.0 | -1 |
Return GraphNode by index from GraphNodeSequence. | def GetChild(self, *args):
return _XCAFDoc.XCAFDoc_GraphNode_GetChild(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_node(self, index):\r\n\t\tself._validate_index(index)\r\n\t\treturn self._traverse(lambda i, list: i < index)[\"node\"]",
"def __get_node_at_index(self, index: int) -> Node[T]:\n if 0 <= index and index < len(self):\n current = self.head\n for i in range(index):\n ... | [
"0.7167873",
"0.7089386",
"0.7003276",
"0.6776899",
"0.677368",
"0.67516685",
"0.6694344",
"0.6664556",
"0.65925425",
"0.65643096",
"0.6557",
"0.65396553",
"0.6504139",
"0.636647",
"0.62991685",
"0.6278262",
"0.6278262",
"0.61394364",
"0.60841256",
"0.6080557",
"0.60794115",
... | 0.0 | -1 |
return Number of Fathers GraphNodes. | def NbFathers(self, *args):
return _XCAFDoc.XCAFDoc_GraphNode_NbFathers(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def number_of_nodes(self) -> int:\n return self.graph.number_of_nodes()",
"def number_of_nodes(self):\n return int(self._data['number_of_nodes'])",
"def count_nodes(self):\n\t\treturn self.__count_nodes(self)",
"def count(self):\n\t\treturn len(list(self.nodes))",
"def numNodes(self):\n ... | [
"0.7840989",
"0.77312326",
"0.7700809",
"0.7646173",
"0.758326",
"0.75163996",
"0.7467742",
"0.74669427",
"0.7417904",
"0.7416373",
"0.73986816",
"0.7394252",
"0.7382747",
"0.7382747",
"0.73818046",
"0.73510295",
"0.73471075",
"0.7332647",
"0.7332647",
"0.7312237",
"0.726276"... | 0.75431675 | 5 |
returns the label under which Layers are stored | def BaseLabel(self, *args):
return _XCAFDoc.XCAFDoc_LayerTool_BaseLabel(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def LayersLabel(*args):\n return _XCAFDoc.XCAFDoc_DocumentTool_LayersLabel(*args)",
"def label(self):\n return self._label_shape",
"def _get_label(self):\n return self.label",
"def get_label(self, name):\n label_list = self.wls_board.get_labels()\n for label in label_list:\... | [
"0.7305261",
"0.7174403",
"0.69660157",
"0.68727964",
"0.68723834",
"0.68504304",
"0.68498194",
"0.68498194",
"0.68498194",
"0.68498194",
"0.68348396",
"0.68211335",
"0.6799484",
"0.6780205",
"0.67765886",
"0.67686343",
"0.6761628",
"0.6761628",
"0.6754593",
"0.6738645",
"0.6... | 0.0 | -1 |
Returns True if label belongs to a Layertable and is a Layer definition | def IsLayer(self, *args):
return _XCAFDoc.XCAFDoc_LayerTool_IsLayer(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_layer(obj):\n # TODO(b/110718070): Replace with isinstance(obj, base_layer.Layer).\n return hasattr(obj, \"_is_layer\") and not isinstance(obj, type)",
"def is_feature_layer(layer):\n return getattr(layer, '_is_feature_layer', False)",
"def allowAnyInternalLabel(self):\n if self.layer == None:... | [
"0.72597086",
"0.717514",
"0.64073163",
"0.6315872",
"0.6269294",
"0.62413585",
"0.6177271",
"0.6167678",
"0.6147258",
"0.6131498",
"0.6058632",
"0.5984433",
"0.5939117",
"0.58794117",
"0.58748317",
"0.5871396",
"0.5864355",
"0.58469296",
"0.5841688",
"0.58057815",
"0.5801177... | 0.7117209 | 2 |
Returns Layer defined by label lab Returns False if the label is not in Layertable or does not define a Layer | def GetLayer(self, *args):
return _XCAFDoc.XCAFDoc_LayerTool_GetLayer(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsLayer(self, *args):\n return _XCAFDoc.XCAFDoc_LayerTool_IsLayer(self, *args)",
"def is_feature_layer(layer):\n return getattr(layer, '_is_feature_layer', False)",
"def FindLayer(self, *args):\n return _XCAFDoc.XCAFDoc_LayerTool_FindLayer(self, *args)",
"def is_layer(obj):\n # TODO(b/110... | [
"0.6794115",
"0.64904666",
"0.63007873",
"0.62994665",
"0.62331444",
"0.61474574",
"0.6022754",
"0.6010588",
"0.5978684",
"0.5977223",
"0.5965809",
"0.5948878",
"0.59138876",
"0.58788997",
"0.58695006",
"0.5842679",
"0.5832513",
"0.5789507",
"0.5782567",
"0.5769022",
"0.57591... | 0.5958513 | 11 |
Returns a sequence of Layers currently stored in the Layertable | def GetLayerLabels(self, *args):
return _XCAFDoc.XCAFDoc_LayerTool_GetLayerLabels(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getLayers(self):\n return self.__layers",
"def layers(self):\n return self['layers']",
"def get_layers(self):\n layers = set()\n for element in itertools.chain(self.polygons, self.paths):\n layers.update(element.layers)\n for reference in self.references:\n ... | [
"0.7574833",
"0.75626385",
"0.74707234",
"0.7460342",
"0.73940665",
"0.7386443",
"0.73820937",
"0.73162496",
"0.729484",
"0.7184732",
"0.69885683",
"0.69847053",
"0.68539304",
"0.6788586",
"0.6750125",
"0.6684561",
"0.6633579",
"0.66200095",
"0.66026944",
"0.65794235",
"0.656... | 0.55681163 | 72 |
Returns True if label has a Layer assosiated with the . | def IsSet(self, *args):
return _XCAFDoc.XCAFDoc_LayerTool_IsSet(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_feature_layer(layer):\n return getattr(layer, '_is_feature_layer', False)",
"def IsLayer(self, *args):\n return _XCAFDoc.XCAFDoc_LayerTool_IsLayer(self, *args)",
"def has_label(self, label):\n return label in self.get_labels()",
"def is_layer(obj):\n # TODO(b/110718070): Replace with isins... | [
"0.72547203",
"0.71938986",
"0.70850843",
"0.7005739",
"0.68992484",
"0.68377554",
"0.6722553",
"0.6676552",
"0.66693735",
"0.66662335",
"0.6610267",
"0.6609136",
"0.6595597",
"0.6577025",
"0.6574007",
"0.654396",
"0.65159285",
"0.6505082",
"0.6475423",
"0.6465186",
"0.646257... | 0.0 | -1 |
Find referred material and return density from it if no material > return 0 | def GetDensityForShape(*args):
return _XCAFDoc.XCAFDoc_MaterialTool_GetDensityForShape(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Density(material):\n if material == \"mild\":\n return 7850.0\n else:\n if material == \"al\":\n return 2700.0\n else:\n raise ValueError(\"Invalid material `\"+material+\"'\")",
"def XCAFDoc_MaterialTool_GetDensityForShape(*args):\n return _XCAFDoc.XCAFDoc_M... | [
"0.7589303",
"0.6404603",
"0.6287548",
"0.6157043",
"0.600737",
"0.59554124",
"0.59223014",
"0.5875551",
"0.5841476",
"0.5841476",
"0.5841476",
"0.57612145",
"0.57465774",
"0.57465774",
"0.5664744",
"0.5647462",
"0.5645596",
"0.56376344",
"0.5614028",
"0.5613048",
"0.55980957... | 0.63411677 | 2 |
Find referred material and return density from it if no material > return 0 | def XCAFDoc_MaterialTool_GetDensityForShape(*args):
return _XCAFDoc.XCAFDoc_MaterialTool_GetDensityForShape(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Density(material):\n if material == \"mild\":\n return 7850.0\n else:\n if material == \"al\":\n return 2700.0\n else:\n raise ValueError(\"Invalid material `\"+material+\"'\")",
"def GetDensityForShape(*args):\n return _XCAFDoc.XCAFDoc_MaterialTool_Get... | [
"0.7589287",
"0.63408643",
"0.62882704",
"0.6159724",
"0.6006733",
"0.5957398",
"0.5923891",
"0.58745974",
"0.58428085",
"0.58428085",
"0.58428085",
"0.57628113",
"0.57490605",
"0.57490605",
"0.5667478",
"0.5646339",
"0.5644401",
"0.5639201",
"0.56154007",
"0.561445",
"0.5597... | 0.64043057 | 1 |
Returns current autonaming mode. See SetAutoNaming() for description. | def AutoNaming(*args):
return _XCAFDoc.XCAFDoc_ShapeTool_AutoNaming(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auto_mode(self):\n return self._auto_mode",
"def mode(self) -> str:\r\n return self._mode",
"def sequential_naming(self):\n return self.config.get('sequential_naming', False)",
"def autoname(self):\n raise NotImplementedError()",
"def mode(self) -> str:\n return pulum... | [
"0.743814",
"0.61352056",
"0.6123015",
"0.60728717",
"0.60191494",
"0.60191494",
"0.5999241",
"0.59228325",
"0.59228325",
"0.5888671",
"0.5853696",
"0.58071184",
"0.57757866",
"0.5775104",
"0.5774754",
"0.5774754",
"0.5774754",
"0.5721926",
"0.5716574",
"0.5716574",
"0.571657... | 0.56756026 | 22 |
Returns current autonaming mode. See SetAutoNaming() for description. | def XCAFDoc_ShapeTool_AutoNaming(*args):
return _XCAFDoc.XCAFDoc_ShapeTool_AutoNaming(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auto_mode(self):\n return self._auto_mode",
"def mode(self) -> str:\r\n return self._mode",
"def sequential_naming(self):\n return self.config.get('sequential_naming', False)",
"def autoname(self):\n raise NotImplementedError()",
"def mode(self) -> str:\n return pulum... | [
"0.7438423",
"0.61344475",
"0.61221355",
"0.6071697",
"0.6017755",
"0.6017755",
"0.59987944",
"0.59215635",
"0.59215635",
"0.5887868",
"0.585269",
"0.5806449",
"0.57760835",
"0.57745266",
"0.5774099",
"0.5774099",
"0.5774099",
"0.5719754",
"0.5715905",
"0.5715905",
"0.5715905... | 0.517801 | 87 |
Return cumulative minimum over a DataFrame or Series axis. Returns a DataFrame or Series of the same size containing the cumulative minimum. | def cummin(self: FrameLike, skipna: bool = True) -> FrameLike:
return self._apply_series_op(lambda psser: psser._cum(F.min, skipna), should_resolve=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cummin(self):\n return self._lift(lambda c: c.cummin)",
"def idxmin(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.idxmin)(self, **kwargs)",
"def argmin(self, axis: str = 'rows') -> 'DataFrame':\n return self._stat_funcs('argmin', axis)",
"def min(... | [
"0.739754",
"0.70453143",
"0.7016353",
"0.70126134",
"0.6791421",
"0.66697174",
"0.6666445",
"0.6643355",
"0.64552176",
"0.6437716",
"0.6398935",
"0.63874406",
"0.62631714",
"0.6200742",
"0.6159252",
"0.6154657",
"0.61493796",
"0.6117522",
"0.61076707",
"0.61076707",
"0.60595... | 0.7585967 | 0 |
Return cumulative sum over a DataFrame or Series axis. Returns a DataFrame or Series of the same size containing the cumulative sum. | def cumsum(self: FrameLike, skipna: bool = True) -> FrameLike:
return self._apply_series_op(lambda psser: psser._cumsum(skipna), should_resolve=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cumsum(x, axis=None):\r\n return CumsumOp(axis=axis)(x)",
"def cumsum(self):\n return self._lift(lambda c: c.cumsum)",
"def cumsum(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) ->... | [
"0.7741634",
"0.7147195",
"0.71459645",
"0.71459645",
"0.71459645",
"0.7029837",
"0.7029837",
"0.7029837",
"0.66848856",
"0.6604129",
"0.6560074",
"0.64467186",
"0.6279074",
"0.61817634",
"0.6137653",
"0.6074509",
"0.6010351",
"0.5992311",
"0.5956006",
"0.5950399",
"0.5888530... | 0.6905384 | 8 |
Return cumulative product over a DataFrame or Series axis. Returns a DataFrame or Series of the same size containing the cumulative product. | def cumprod(self: FrameLike, skipna: bool = True) -> FrameLike:
return self._apply_series_op(lambda psser: psser._cumprod(skipna), should_resolve=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cumprod(x, axis=None):\r\n return CumprodOp(axis=axis)(x)",
"def cumprod(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep_attrs: bool | None = None,\n **kwargs: Any,\n ) -> Dataset:\n return self.reduce(\n duck_array_ops.... | [
"0.699747",
"0.666648",
"0.666648",
"0.666648",
"0.66341347",
"0.66341347",
"0.66341347",
"0.6607763",
"0.6401141",
"0.6277303",
"0.6239852",
"0.61488396",
"0.59956336",
"0.57941806",
"0.5720094",
"0.570178",
"0.56991553",
"0.5688277",
"0.55851746",
"0.55851746",
"0.55851746"... | 0.62393934 | 11 |
A NumPy ndarray representing the values in this DataFrame or Series. | def to_numpy(self) -> np.ndarray:
log_advice(
"`to_numpy` loads all data into the driver's memory. "
"It should only be used if the resulting NumPy ndarray is expected to be small."
)
return cast(np.ndarray, self._to_pandas().values) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def values(self):\n arr = self.view(np.ndarray).copy()\n return arr",
"def values(self) -> np.ndarray:\n warnings.warn(\"We recommend using `{}.to_numpy()` instead.\".format(type(self).__name__))\n return self.to_numpy()",
"def __array__(self, dtype=None) -> np.ndarray:\n ret... | [
"0.84322095",
"0.819512",
"0.8101782",
"0.80988616",
"0.79888934",
"0.79709244",
"0.7884687",
"0.78689176",
"0.7677712",
"0.76741",
"0.75888973",
"0.751859",
"0.74769187",
"0.7370216",
"0.73377085",
"0.7325179",
"0.72890234",
"0.7271158",
"0.72505873",
"0.7196986",
"0.7141554... | 0.73286706 | 15 |
Return a Numpy representation of the DataFrame or the Series. | def values(self) -> np.ndarray:
warnings.warn("We recommend using `{}.to_numpy()` instead.".format(type(self).__name__))
return self.to_numpy() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_dataframe_to_array(df_or_series):\n if isinstance(df_or_series, pd.DataFrame) or isinstance(\n df_or_series, pd.Series\n ):\n dat = np.array(df_or_series)\n if len(dat.shape) == 1:\n return dat[:, np.newaxis]\n else:\n ... | [
"0.72666794",
"0.70938534",
"0.67864925",
"0.6688264",
"0.6658773",
"0.6651338",
"0.6628807",
"0.6592032",
"0.6438475",
"0.6432916",
"0.6421437",
"0.6386224",
"0.63618976",
"0.62746245",
"0.6247806",
"0.62388873",
"0.6233178",
"0.621456",
"0.61810726",
"0.6167275",
"0.6162103... | 0.62275046 | 17 |
Return the minimum of the values. | def min(
self, axis: Optional[Axis] = None, skipna: bool = True, numeric_only: bool = None
) -> Union[Scalar, "Series"]:
axis = validate_axis(axis)
if numeric_only is None and axis == 0:
numeric_only = True
elif numeric_only is True and axis == 1:
numeric_onl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min(self, values):\n return self.aggregate(values, \"min\")",
"def min(self):\n return self._reduce_for_stat_function(F.min, only_numeric=False)",
"def minimum(self):\n return min(self.numbers)",
"def argmin(self, values):\n return self.aggregate(values, \"argmin\")",
"def m... | [
"0.83978",
"0.8332655",
"0.8230079",
"0.8043136",
"0.7969123",
"0.7936901",
"0.7839196",
"0.78359723",
"0.7834269",
"0.77928054",
"0.77928054",
"0.77876437",
"0.7752022",
"0.7715334",
"0.76965827",
"0.76965827",
"0.7693423",
"0.7648815",
"0.7647906",
"0.76460445",
"0.7645249"... | 0.0 | -1 |
Return the maximum of the values. | def max(
self, axis: Optional[Axis] = None, skipna: bool = True, numeric_only: bool = None
) -> Union[Scalar, "Series"]:
axis = validate_axis(axis)
if numeric_only is None and axis == 0:
numeric_only = True
elif numeric_only is True and axis == 1:
numeric_onl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_max_value(self):\n max_value = max(self.values)\n return max_value",
"def max(self):\n return self._reduce_for_stat_function(F.max, only_numeric=False)",
"def max(self, values):\n return self.aggregate(values, \"max\")",
"def Max(data):\n return data.max()",
"def max(... | [
"0.861361",
"0.8368582",
"0.82056725",
"0.8195368",
"0.8030303",
"0.8026219",
"0.80253047",
"0.8000192",
"0.79589725",
"0.7929461",
"0.7918513",
"0.7885027",
"0.78828853",
"0.78446436",
"0.783085",
"0.78232515",
"0.78148794",
"0.7809508",
"0.7768719",
"0.7766544",
"0.7760731"... | 0.0 | -1 |
Retrieves the index of the first valid value. Returns scalar, tuple, or None Examples Support for DataFrame | def first_valid_index(self) -> Optional[Union[Scalar, Tuple[Scalar, ...]]]:
data_spark_columns = self._internal.data_spark_columns
if len(data_spark_columns) == 0:
return None
cond = reduce(lambda x, y: x & y, map(lambda x: x.isNotNull(), data_spark_columns))
with sql_conf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def first_valid_index(self):\n return (\n DataFrameDefault.register(pandas.DataFrame.first_valid_index)(self)\n .to_pandas()\n .squeeze()\n )",
"def last_valid_index(self) -> Optional[Union[Scalar, Tuple[Scalar, ...]]]:\n data_spark_columns = self._internal.d... | [
"0.6924053",
"0.66161823",
"0.65560144",
"0.64668363",
"0.64263797",
"0.6421347",
"0.63923746",
"0.62542737",
"0.6219861",
"0.62142843",
"0.61727315",
"0.6169093",
"0.6134989",
"0.61293644",
"0.61064273",
"0.6058676",
"0.6031218",
"0.60283",
"0.60248256",
"0.6012006",
"0.5999... | 0.76989704 | 0 |
Return index for last nonNA/null value. Returns scalar, tuple, or None Notes This API only works with PySpark >= 3.0. Examples Support for DataFrame | def last_valid_index(self) -> Optional[Union[Scalar, Tuple[Scalar, ...]]]:
data_spark_columns = self._internal.data_spark_columns
if len(data_spark_columns) == 0:
return None
cond = reduce(lambda x, y: x & y, map(lambda x: x.isNotNull(), data_spark_columns))
last_valid_row... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def first_valid_index(self) -> Optional[Union[Scalar, Tuple[Scalar, ...]]]:\n data_spark_columns = self._internal.data_spark_columns\n\n if len(data_spark_columns) == 0:\n return None\n\n cond = reduce(lambda x, y: x & y, map(lambda x: x.isNotNull(), data_spark_columns))\n\n ... | [
"0.6803496",
"0.6440539",
"0.6205881",
"0.59493214",
"0.56690997",
"0.55862904",
"0.5338115",
"0.5327893",
"0.53059",
"0.5290752",
"0.52524054",
"0.5245491",
"0.52171314",
"0.52170146",
"0.52158266",
"0.5210693",
"0.5109578",
"0.5073314",
"0.5067518",
"0.5067154",
"0.5056564"... | 0.77271783 | 0 |
Provide exponentially weighted window transformations. | def ewm(
self: FrameLike,
com: Optional[float] = None,
span: Optional[float] = None,
halflife: Optional[float] = None,
alpha: Optional[float] = None,
min_periods: Optional[int] = None,
ignore_na: bool_type = False,
) -> "ExponentialMoving[FrameLike]":
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exponential_window_lssm(self):\n self.A = np.array([self.decay])\n self.s = np.ones(1)\n self.C = np.ones(1)",
"def update_w(self, w):\n # Need to update the scaled weights\n if self.scale_weights:\n self._scale_weights_to_degree(w)\n self._generate_we... | [
"0.62235516",
"0.5960921",
"0.5806746",
"0.57232994",
"0.56933546",
"0.5693142",
"0.5657988",
"0.56482065",
"0.56337553",
"0.5596308",
"0.5506115",
"0.5502661",
"0.54754305",
"0.54708815",
"0.54591584",
"0.54547393",
"0.5440947",
"0.5439174",
"0.542947",
"0.5420827",
"0.54077... | 0.5280309 | 35 |
Synonym for `DataFrame.fillna()` or `Series.fillna()` with ``method=`ffill```. | def ffill(
self: FrameLike,
axis: Optional[Axis] = None,
inplace: bool_type = False,
limit: Optional[int] = None,
) -> FrameLike:
return self.fillna(method="ffill", axis=axis, inplace=inplace, limit=limit) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ffill_nans(df):\n return df.fillna(method='ffill', axis=0)",
"def fill_forward(df):\n df = df.fillna(method='ffill')\n df = df.fillna(method='bfill').fillna(0)\n return df",
"def fillna(df, col: str, forward: bool):\n na_prev = len(df)\n report = f'fillna(\"{col}\") ' + ('forward' if forw... | [
"0.80995023",
"0.7896216",
"0.67279595",
"0.6621111",
"0.65681976",
"0.6553907",
"0.62127376",
"0.61201257",
"0.60313535",
"0.6025343",
"0.6022036",
"0.59736234",
"0.5959759",
"0.5889158",
"0.58389384",
"0.58251727",
"0.58100146",
"0.57938766",
"0.5755879",
"0.575473",
"0.574... | 0.7037063 | 2 |
Test that Azure manifest is created. | def test_get_manifest(self):
expected_start, expected_end = self.mock_data.month_range.split("-")
manifest, _ = self.downloader._get_manifest(self.mock_data.test_date)
self.assertEqual(manifest.get("assemblyId"), self.mock_data.export_uuid)
self.assertEqual(manifest.get("reportKeys"), ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_deployment(self):\n pass",
"def testGetManifest(self):\n manifest = self.dl_object._GetManifest()\n self.assertEqual(manifest.get('mediaType'),\n 'application/vnd.docker.distribution.manifest.v2+json')\n self.assertIn('layers', manifest)",
"def test_create_de... | [
"0.68584496",
"0.6731882",
"0.6569586",
"0.6486185",
"0.63024664",
"0.6290466",
"0.62501264",
"0.61309797",
"0.6130966",
"0.6032041",
"0.60068464",
"0.5949564",
"0.58919036",
"0.5891625",
"0.58551913",
"0.58317274",
"0.5762419",
"0.5752456",
"0.57469535",
"0.5746054",
"0.5717... | 0.5851719 | 15 |
Test that error is thrown when getting manifest with an unexpected report name. | def test_get_manifest_unexpected_report_name(self):
with self.assertRaises(AzureReportDownloaderError):
self.downloader._get_manifest(self.mock_data.bad_test_date) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_invalid_manifest_filepath(self):\n load_manifest(\"./ehiiehaiehnatheita\")",
"def test_sa_invalid_manifest_file_unknown_error(self, _mock_depfinder):\n with open(str(Path(__file__).parent.parent.parent) +\n '/data/manifests/400/npmlist.json', 'rb') as fp:\n fs =... | [
"0.6667474",
"0.6577864",
"0.6442794",
"0.6417424",
"0.64108133",
"0.6280289",
"0.6221659",
"0.6167222",
"0.6077581",
"0.6064105",
"0.60215175",
"0.6004537",
"0.5949171",
"0.5923836",
"0.5915513",
"0.5878765",
"0.5867618",
"0.58581245",
"0.5856836",
"0.58340645",
"0.58209306"... | 0.83767325 | 0 |
Test that Azure report is not downloaded for incorrect key. | def test_download_missing_file(self):
key = "badkey"
with self.assertRaises(AzureReportDownloaderError):
self.downloader.download_file(key) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_report_wrong_api_key(self):\n vt_analyses_wrong_api_key = VirusTotalAPIAnalyses('test_api_key')\n vt_analyses_wrong_api_key.get_report('test_object_id')\n http_err = vt_analyses_wrong_api_key.get_last_http_error()\n self.assertEqual(http_err, vt_analyses_wrong_api_key.HTTP_... | [
"0.72874945",
"0.65340036",
"0.6392282",
"0.6335407",
"0.6285832",
"0.62685525",
"0.6220093",
"0.6134964",
"0.6126072",
"0.61171114",
"0.6113606",
"0.6110157",
"0.59444654",
"0.5941738",
"0.59193254",
"0.5917145",
"0.58990806",
"0.58965915",
"0.58551496",
"0.5852845",
"0.5847... | 0.7490197 | 0 |
Test that Azure report report is not downloaded with matching etag. | def test_download_file_matching_etag(self, mock_download_cost_method):
expected_full_path = "{}/{}/azure/{}/{}".format(
Config.TMP_DIR, self.customer_name.replace(" ", "_"), self.mock_data.container, self.mock_data.export_file
)
full_file_path, etag, _, __ = self.downloader.download_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_etagMatchedNot(self):\n self.channel.lineReceived(\"If-None-Match: unmatchedTag\")\n self.channel.lineReceived('')\n result = self.transport.getvalue()\n self.failUnlessEqual(httpCode(result), http.OK)\n self.failUnlessEqual(httpBody(result), \"correct\")",
"def test_e... | [
"0.6585256",
"0.6370321",
"0.6356344",
"0.6338208",
"0.6333184",
"0.61438024",
"0.5987135",
"0.5928787",
"0.5841444",
"0.5769215",
"0.5736188",
"0.57337487",
"0.57212156",
"0.571304",
"0.57106864",
"0.5700322",
"0.56946594",
"0.5693875",
"0.5677892",
"0.565196",
"0.5644763",
... | 0.62326217 | 5 |
Tokenize sentences into tokens (words) | def tokenize_sentences(sentences):
# Initialize the list of lists of tokenized sentences
tokenized_sentences = []
for sentence in sentences:
# Convert to lowercase letters
sentence = sentence.lower()
# Convert into a list of words
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tokenize(sentence):\n tokens = nltk.word_tokenize(sentence)\n return tokens",
"def get_tokens(sent):\n return word_tokenize(sent)",
"def tokenize(sentence):\n return nltk.word_tokenize(sentence)",
"def tokenize(text):\n sentence = Sentence(text)\n return sentence.tokens()",
"def token... | [
"0.81810564",
"0.81695443",
"0.8125897",
"0.80647105",
"0.8031472",
"0.79473704",
"0.7822261",
"0.7811255",
"0.7758345",
"0.77136296",
"0.7704841",
"0.7659628",
"0.7634914",
"0.76327354",
"0.7578256",
"0.7510274",
"0.75056523",
"0.7470089",
"0.74608606",
"0.7456935",
"0.74569... | 0.75266856 | 15 |
Make a list of tokenized sentences | def get_tokenized_data(data):
# Get the sentences by splitting up the data
sentences = split_to_sentences(data)
# Get the list of lists of tokens by tokenizing the sentences
tokenized_sentences = tokenize_sentences(sentences)
return tokenized_sentences | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sentences(self) -> List[str]:\n\t\treturn [self.text[start:end] for start, end in self.tokenizations]",
"def sentences(self) -> List[str]:\n\t\treturn [self.text[start:end] for start, end in self.tokenizations]",
"def tokenize(self, sentences):\n tokenized = []\n en = []\n prog = re.co... | [
"0.8154739",
"0.8154739",
"0.7901521",
"0.774528",
"0.764139",
"0.75744385",
"0.7562174",
"0.75384367",
"0.7431874",
"0.74140984",
"0.73599356",
"0.7348926",
"0.7331786",
"0.731823",
"0.73125464",
"0.73125464",
"0.7311208",
"0.7268759",
"0.7246582",
"0.72322893",
"0.72180104"... | 0.69454634 | 49 |
Replace words not in the given vocabulary with '' token. | def replace_oov_words_by_unk(tokenized_sentences, vocabulary, unknown_token="<unk>"):
# Place vocabulary into a set for faster search
vocabulary = set(vocabulary)
# Initialize a list that will hold the sentences
# after less frequent words are replaced by the unknown token
replaced_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _replace_oov(original_vocab, line):\n return u\" \".join([\n word if word in original_vocab else u\"<UNK>\" for word in line.split()\n ])",
"def remove_unused_words(text_list, vocab):\n vocabset = set(vocab)\n for i in range(0, len(text_list)):\n tokens = word_tokenize(text_list[i])... | [
"0.6602431",
"0.6342179",
"0.6128151",
"0.611547",
"0.60829765",
"0.5990552",
"0.59486204",
"0.59422237",
"0.59266746",
"0.59201443",
"0.59078217",
"0.5900242",
"0.5871093",
"0.5836927",
"0.5815773",
"0.5811374",
"0.5806493",
"0.57967186",
"0.578845",
"0.5749576",
"0.5745214"... | 0.7081734 | 0 |
Check if value is a block hash. | def is_bh(v) -> bool:
try:
_validate(v, prefixes=[b'B'])
except (ValueError, TypeError):
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_block(block_data, block_hash, block_nonce):\n hashing_value = block_data + str(block_nonce)\n new_hash = hashlib.sha256(hashing_value.encode()).hexdigest()\n if new_hash == block_hash:\n return True\n else:\n return False",
"def get_blockHash(self, dat... | [
"0.6825397",
"0.6368288",
"0.6066931",
"0.60269296",
"0.60067713",
"0.5980416",
"0.5902937",
"0.5870085",
"0.58273214",
"0.58210754",
"0.5807664",
"0.57752234",
"0.57642764",
"0.5752886",
"0.57332146",
"0.57311237",
"0.5706678",
"0.57054305",
"0.5704643",
"0.5683187",
"0.5673... | 0.5374995 | 56 |
Check if value is an operation group hash. | def is_ogh(v) -> bool:
try:
_validate(v, prefixes=[b'o'])
except (ValueError, TypeError):
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_hash(data, shasum):\n from hashlib import sha1\n digest = sha1(data).hexdigest()\n if digest == shasum:\n return True\n else:\n print('Invalid shasum, got: {} , expected: {}'.format(digest, shasum))\n return False",
"def is_group(obj) ->... | [
"0.5815826",
"0.5812406",
"0.57094544",
"0.5656622",
"0.56334144",
"0.54147464",
"0.53879386",
"0.5371221",
"0.5277382",
"0.5243935",
"0.5240626",
"0.5219513",
"0.52157193",
"0.51772887",
"0.51384795",
"0.5111211",
"0.51097107",
"0.50856537",
"0.50782484",
"0.50520694",
"0.50... | 0.50124204 | 24 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.