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 |
|---|---|---|---|---|---|---|
returns all LP variables in this block | def getVariables(self):
return [x for x in self.variables.values() if x is not None] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_variables(self):\n return []",
"def get_all_variables(self):\n raise NotImplementedError()",
"def get_variables(self):\n\t\treturn self.variables",
"def get_all_variables(self):\n return self.item.get_all_variables()",
"def get_variables(self):\n local_variables = se... | [
"0.7191287",
"0.7056163",
"0.70447665",
"0.70321906",
"0.70192355",
"0.7012739",
"0.7003141",
"0.693667",
"0.68904215",
"0.6856983",
"0.6855644",
"0.67880297",
"0.67828244",
"0.6781766",
"0.6777664",
"0.6777664",
"0.6777664",
"0.676953",
"0.6730037",
"0.67117995",
"0.668239",... | 0.68335456 | 11 |
Switches the DSLR camera off. | def turn_camera_off():
# Do command
consoleOutput = exec_console_command(constants.cameraOff + constants.getExitStatus)
if "2" in consoleOutput:
raise IOError(constants.cameraOffScriptNotFound)
# Parse output
feedbackOutput = constants.cameraSwitchedOff
return feedbackOutput | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_off(self, **kwargs):\n _LOGGER.debug(\"Turning off Motion Detection \")\n self.data.set_camera_recording(self._camera_id, \"never\")",
"def stop_realsense_camera():\n global realsense_enabled, camera\n if realsense_enabled:\n realsense_enabled = False\n camera.shutdown(... | [
"0.76465553",
"0.73951495",
"0.7328416",
"0.72134334",
"0.7092409",
"0.6981193",
"0.6944993",
"0.69231766",
"0.68681586",
"0.6858414",
"0.6857096",
"0.6845349",
"0.68326735",
"0.68085825",
"0.68014914",
"0.67925483",
"0.67918324",
"0.6789135",
"0.67778456",
"0.6769009",
"0.67... | 0.76930106 | 0 |
Stops the manager. If already stopped, this does nothing. | def stop(self):
if not self._started:
return
try:
self._unregister()
except Exception:
logger.exception("Failed to unregister profile.")
self._started = False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_running_manager(self) -> None:\n self.remove_value(self._manager_running_attribute)",
"def stopManager(self):\n\t\tself.sysPerfManager.stopManager()\n\t\tself.sensorAdapterManager.stopManager()\n\t\t\n\t\tif self.enableRedis:\n\t\t\tself.redisClient.disconnectClient()\n\t\tif self.enableMqtt:\n\t... | [
"0.77820915",
"0.74996704",
"0.74425155",
"0.7349998",
"0.70134443",
"0.699984",
"0.69884026",
"0.69884026",
"0.6930239",
"0.69301456",
"0.6906042",
"0.68907684",
"0.687026",
"0.6863562",
"0.6863562",
"0.68550754",
"0.6840644",
"0.6836216",
"0.6810615",
"0.6806286",
"0.680414... | 0.0 | -1 |
Function to convert an array to a list | def conver1D(array):
l = array.shape
total = np.zeros((0, l[1] * l[2]), dtype=np.float32)
i = 0
for i in range(24):
tempData = array[i]
array1D = []
for x in tempData:
for s in x:
array1D.append(s)
total = np.insert(total, i, array1D, axis=0)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def array2list(input_array):\r\n return [element for element in input_array]",
"def _as_list(arr):\n if not isinstance(arr, (list, tuple)):\n return [arr]\n return arr",
"def tolist(self) -> List[T]:\n if isinstance(self.array, list):\n return self.array\n return list(s... | [
"0.87548333",
"0.77649474",
"0.74885505",
"0.7416817",
"0.7287422",
"0.7183319",
"0.7107104",
"0.7064257",
"0.70120835",
"0.70059437",
"0.6974011",
"0.6959884",
"0.68792105",
"0.6875789",
"0.6870992",
"0.68560755",
"0.68255436",
"0.6810187",
"0.67955124",
"0.6772412",
"0.6760... | 0.0 | -1 |
The Poissions's ratio of the material | def v(self):
return self._properties['v'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quick_ratio(self):\n return (\n self.current_assets - self.inventory_net) / self.current_liabilities",
"def getRatio(probe_num, position_vector, shot_range, dir, day ='050119r'):\n ratio_x = 0\n ratio_y = 0\n ratio_z = 0\n # helm_B = [0,0,0]\n divideby = 0\n for sh... | [
"0.7036056",
"0.6948901",
"0.6879451",
"0.6731433",
"0.6696739",
"0.665922",
"0.6644493",
"0.6606865",
"0.65936935",
"0.65365607",
"0.64759105",
"0.64400405",
"0.6432035",
"0.64266753",
"0.6360179",
"0.63371134",
"0.6327878",
"0.63053447",
"0.6293324",
"0.6246972",
"0.6240028... | 0.0 | -1 |
Retur the output tensor at the given index. | def get_output_tensor(interpreter, index):
output_details = interpreter.get_output_details()[index]
tensor = np.squeeze(interpreter.get_tensor(output_details["index"]))
return tensor | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_output_tensor(self, index):\n output_details = self.model.get_output_details()[index]\n tensor = np.squeeze(self.model.get_tensor(output_details['index']))\n return tensor",
"def get_output_tensor(index):\n output_details = interpreter.get_output_details()[index]\n tensor = np.... | [
"0.8095785",
"0.8085678",
"0.80498403",
"0.80234796",
"0.7798135",
"0.70501757",
"0.7009183",
"0.66079545",
"0.6346569",
"0.61886317",
"0.618703",
"0.6052512",
"0.6041594",
"0.60324305",
"0.6031598",
"0.602657",
"0.6019419",
"0.59992254",
"0.5987431",
"0.59827626",
"0.5980572... | 0.7762317 | 6 |
Creates a numpy array from a pytorch dataloader. | def compose_array_from_dataloader(dataloader, key="original"):
sample = dataloader.dataset[0][key]
if key == "label":
dtype = np.int
output_shape = [len(dataloader.dataset)]
else:
dtype = np.float32
output_shape = [len(dataloader.dataset)] + list(sample.shape)
output_a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_torch(\n dataset: \"torch.utils.data.Dataset\",\n) -> Dataset:\n return from_items(list(dataset))",
"def _torch_to_numpy(tensor):\n return tensor.detach().cpu().numpy()",
"def create_dataloader(data):\r\n input_ids = torch.LongTensor([sent['input_ids'] for sent in data])\r\n input_mask ... | [
"0.65812135",
"0.6431134",
"0.62586975",
"0.6205869",
"0.61490285",
"0.61253387",
"0.60658705",
"0.6057681",
"0.60414004",
"0.6023869",
"0.6022091",
"0.59974366",
"0.58797956",
"0.5870438",
"0.58557445",
"0.5807153",
"0.57845795",
"0.57746464",
"0.57509243",
"0.5736571",
"0.5... | 0.64483047 | 1 |
NMSRotated for multiclass bboxes. This function helps exporting to onnx with batch and multiclass NMSRotated op. It only supports classagnostic detection results. That is, the scores is of shape (N, num_bboxes, num_classes) and the boxes is of shape (N, num_boxes, 5). | def _multiclass_nms_rotated(boxes: Tensor,
scores: Tensor,
max_output_boxes_per_class: int = 1000,
iou_threshold: float = 0.1,
score_threshold: float = 0.05,
pre_top_k: int = -1,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def multiclass_nms_rotated__tensorrt(ctx,\n boxes: Tensor,\n scores: Tensor,\n max_output_boxes_per_class: int = 1000,\n iou_threshold: float = 0.5,\n ... | [
"0.77371544",
"0.76001775",
"0.7589499",
"0.7335859",
"0.7096726",
"0.68485695",
"0.6472768",
"0.64197165",
"0.6329874",
"0.6294859",
"0.6267756",
"0.6262529",
"0.6173371",
"0.615191",
"0.6062007",
"0.6052582",
"0.6016087",
"0.59885454",
"0.59027684",
"0.59027684",
"0.586861"... | 0.80620366 | 0 |
Retrieve path to database file used during tests. | def get_test_database_path() -> str:
test_suite_dir = os.path.abspath(os.path.dirname(__file__))
return os.path.join(test_suite_dir, "testDb.sqlite") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_db_path():\n \n return(db_run.db_abs_path)",
"def getDBPath():\n return os.path.join(CONFIG_DIR, CONFIG_DICT['common']['local_db'])",
"def get_database_path():\n\treturn _paths[_DATABASE_PATH_KEY]",
"def db_file():\n return abspath('vmchecker.db')",
"def db_path_with_improper_files():\n... | [
"0.86843497",
"0.8196155",
"0.8130747",
"0.81137335",
"0.8094035",
"0.8066063",
"0.79412806",
"0.79035205",
"0.78862476",
"0.7824386",
"0.7632039",
"0.7539994",
"0.74590784",
"0.74590784",
"0.7449796",
"0.74291813",
"0.7422105",
"0.7344709",
"0.7149441",
"0.7103307",
"0.70793... | 0.8691721 | 0 |
Sessionwide test instance of `Flask` application. | def app() -> Flask:
settings_override = {
"DEBUG": True,
"SQLALCHEMY_DATABASE_URI": "sqlite:///" + get_test_database_path(),
"SQLALCHEMY_TRACK_MODIFICATIONS": False,
"PIPWATCH_API_RESET_DB_ON_START": False,
"PIPWATCH_API_SEED_DB": False
}
application = get_flask_appl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def app():\n os.environ[\"FLASK_ENV\"] = \"test\"\n return create_app()",
"def app() -> flask.Flask:\n test_app: flask.Flask = create_app(\"tests.conftest.TestConfig\")\n test_app.logger.setLevel(\"CRITICAL\")\n test_context = test_app.test_request_context()\n test_context.push()\n\n yield t... | [
"0.79128206",
"0.7478712",
"0.7424194",
"0.73786974",
"0.7375002",
"0.73037434",
"0.72877955",
"0.72877955",
"0.72877955",
"0.72490376",
"0.72362846",
"0.72218215",
"0.7215699",
"0.720117",
"0.719268",
"0.7191866",
"0.71684295",
"0.71569204",
"0.7133063",
"0.71169776",
"0.711... | 0.72913814 | 6 |
Sessionwide test instance of flask for testing resources. | def app_client(app) -> Flask:
app.testing = True
app.response_class = JSONResponse
return app.test_client() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\n self.app = Flask(__name__)\n self.app_context = self.app.app_context()\n self.app_context.push()\n self.client = self.app.test_client()",
"def client():\n flask_app = create_app(\"testing\")\n test_client = flask_app.test_client()\n\n # create app context\n... | [
"0.71228105",
"0.6990349",
"0.69546187",
"0.69276005",
"0.6809062",
"0.67765903",
"0.6727066",
"0.67026913",
"0.66966957",
"0.6696131",
"0.6696131",
"0.6696131",
"0.66736215",
"0.6640157",
"0.66071206",
"0.6605192",
"0.6568303",
"0.65502954",
"0.65262884",
"0.6506976",
"0.650... | 0.67280304 | 6 |
This function calculates the score of the winning player and starts the gameover screen. The screen contains a specific text and the players score, it is set by calling the method setGameOverText(). | def startGameOverScreen(self, player: int) -> None:
# calculate the score of the player based on the time it took to win
endTime = time()
score = int(
10000 // (endTime - self.startTime)) # the faster a player wins, the more points he gets
# generate gameover text
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_score(self, win, player, computer):\n font = pygame.font.SysFont('comicsans', 70)\n if player < 10 and computer < 10:\n pygame.draw.rect(win, black, (150, 30, 75, 50))\n pygame.draw.rect(win, black, (295, 30, 75, 50))\n text1 = font.render(str(player), 1, ... | [
"0.752947",
"0.72066504",
"0.70613796",
"0.7055396",
"0.7013651",
"0.70010763",
"0.68819296",
"0.68672925",
"0.68608516",
"0.68496084",
"0.6848664",
"0.68384767",
"0.6832321",
"0.68221104",
"0.67846245",
"0.66963893",
"0.66855586",
"0.6680751",
"0.6626224",
"0.66217256",
"0.6... | 0.8241849 | 0 |
This function checks if the ball collides with the top or the bottom of the window. It returns a Boolean if a collision happens. This is used for the wall collision. | def did_collide_top_bottom(self):
y_coord = self.getY()
return y_coord < 0 or (y_coord + self.ball_size[1]) > Configuration.windowHeight | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def detect_collision():\n # with the top and bottom of screen\n if ball.ycor() > GAME_Y_BARRIER or ball.ycor() < -GAME_Y_BARRIER:\n ball.bounce_y()\n # with the paddles\n if ball.distance(paddle_right) < 50 and ball.xcor() > GAME_X_BARRIER \\\n or ball.distance(paddle_left) < 50 and b... | [
"0.8109181",
"0.7738527",
"0.75354964",
"0.7328043",
"0.71924937",
"0.7183295",
"0.6977034",
"0.69342417",
"0.69218254",
"0.682005",
"0.682005",
"0.68005556",
"0.6771532",
"0.6671695",
"0.66464776",
"0.66360027",
"0.6632796",
"0.6624291",
"0.6615074",
"0.6607844",
"0.65926564... | 0.77959836 | 1 |
This function moves the ball in the direction of it's speed vector. | def move(self) -> None:
new_x = self.getX() + self.speed[0]
new_y = self.getY() + self.speed[1]
self.setX(new_x)
self.setY(new_y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ball_move(self):\n self.ball.move(self.__dx, self.__dy)",
"def move(self):\n if self.ycor() > 280: self.y_dir = -1 # Set vertical movement to down if ball at top of screen\n if self.xcor() > 380: self.x_dir = -1 # Set horizontal movement to left if ball at right of sc... | [
"0.79536545",
"0.7734326",
"0.7541688",
"0.74732924",
"0.7424091",
"0.73574185",
"0.7291175",
"0.7267382",
"0.7186292",
"0.71498966",
"0.7137175",
"0.7129246",
"0.7034208",
"0.70175105",
"0.70097125",
"0.6973449",
"0.6962155",
"0.69300544",
"0.689253",
"0.68866754",
"0.687966... | 0.7244413 | 8 |
Resets the the balls speed to a random velocity and places it in the middle of the screen. | def reset(self):
self.speed = self.getRandomVelocity()
self.setX(Configuration.windowWidth / 2)
self.setY(Configuration.windowHeight / 2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __set_ball_velocity(self):\n self.__dx = random.randint(1, MAX_X_SPEED) if random.random() < 0.5 else -random.randint(1, MAX_X_SPEED)\n self.__dy = INITIAL_Y_SPEED",
"def ball_reset(self):\n self.ball.x = (self.window.width - BALL_RADIUS)/2\n self.ball.y = (self.window.height - BA... | [
"0.7989206",
"0.7864066",
"0.74616367",
"0.7250461",
"0.7130087",
"0.6941494",
"0.6754551",
"0.6739035",
"0.67198485",
"0.6686306",
"0.66805613",
"0.6674803",
"0.66015613",
"0.65932643",
"0.65840435",
"0.65436494",
"0.653175",
"0.64707536",
"0.64601135",
"0.64597464",
"0.6456... | 0.7058706 | 5 |
Given a canonical Uri previously generated by canonicalize(Uri), convert it to its local noncanonical form. | def uncanonicalize(self, url):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalize_uri_result(uri):\n ref = uri_reference(uri).normalize()\n\n return ref._replace(\n authority=normalize_uri_authority(ref),\n query=normalize_uri_query(ref),\n path=normalize_uri_path(ref),\n )",
"def _urlnorm(self, uri):\r\n (scheme, authority, path, query, frag... | [
"0.66957015",
"0.66383135",
"0.6616021",
"0.66084063",
"0.6251189",
"0.61870515",
"0.60802704",
"0.5963964",
"0.5842112",
"0.57091516",
"0.56884515",
"0.5673124",
"0.5669776",
"0.56636876",
"0.56618106",
"0.564709",
"0.54959977",
"0.5446718",
"0.5407522",
"0.53778625",
"0.537... | 0.66045684 | 4 |
Return ``True`` if the url uses an allowed host and a safe scheme. Always return ``False`` on an empty url. If ``require_https`` is ``True``, only 'https' will be considered a valid scheme, as opposed to 'http' and 'https' with the default, ``False``. | def url_has_allowed_host_and_scheme(url, allowed_hosts, require_https=False):
if url is not None:
url = url.strip()
if not url:
return False
if allowed_hosts is None:
allowed_hosts = set()
elif isinstance(allowed_hosts, str):
allowed_hosts = {allowed_hosts}
# Chrome t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_url(self, v):\n u = urlparse.urlparse(v)\n if u.scheme.lower() not in ('http', 'https'):\n raise ValueError('URL scheme must be either http:// or https://')\n if not u.netloc:\n raise ValueError('URL must specify a network location.')\n return u.scheme.lower() == 'https'",
"def... | [
"0.6889683",
"0.68277",
"0.66037124",
"0.65521806",
"0.6502629",
"0.6483913",
"0.6347668",
"0.6337595",
"0.62586236",
"0.6253215",
"0.6245546",
"0.62151915",
"0.6194567",
"0.6159231",
"0.6146523",
"0.6145699",
"0.6118582",
"0.60990244",
"0.60932857",
"0.60932857",
"0.6074093"... | 0.7568037 | 0 |
Test code for 'Add', which succeeds. | def test_add_consistency1(self) -> None:
a = Constant(
'const1',
Float32(),
np.zeros([1, 3, 3])
)
b = Constant(
'const2',
Float32(),
np.zeros([3])
)
input_ops = {'A': cast(Operator, a), 'B': cast(Operator, b)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_add(self):\n self.assertEqual(3, foo.add(1, 2))\n self.assertNotEqual(3, foo.add(2, 2))",
"def test_add(self):\n self.assertEqual(3, add(1, 2))\n self.assertNotEqual(3, add(2, 2))",
"def test_add(self):\n print('test_add')\n \n self.assertEqual(120, add... | [
"0.850556",
"0.8499138",
"0.8330202",
"0.80424917",
"0.79449916",
"0.7914401",
"0.7832704",
"0.7831683",
"0.7545264",
"0.75025845",
"0.75025845",
"0.75025845",
"0.7440515",
"0.7435947",
"0.743426",
"0.7433815",
"0.7398683",
"0.7385611",
"0.7351922",
"0.7320632",
"0.7280953",
... | 0.0 | -1 |
Tokenize a location path into location steps. Return the list of steps. If two steps are separated by a double slash, the double slashes are part of the second step. If they are separated by only one slash, the slash is not included in any of the steps. | def tokenize_path(path):
# form a list of tuples that mark the start and end positions of steps
separators = []
last_position = 0
i = -1
in_string = False
while i < len(path) - 1:
i = i + 1
if path[i] == "'":
in_string = not in_string
if in_string:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_path(path):\n\n if type(path) != str:\n return []\n\n # replace multiple occurrences of \"/\" with just one,\n # i.e. \"page1//page2///page3\" -> \"page1/page2/page3\"\n path = re.sub('/+', '/', path)\n path = path.split(\"/\") # form a list of path steps\n ... | [
"0.6533598",
"0.61617476",
"0.58562195",
"0.5631687",
"0.56104606",
"0.5528021",
"0.5466391",
"0.54593325",
"0.5400127",
"0.5359845",
"0.53530943",
"0.53298235",
"0.5280596",
"0.52656025",
"0.52074987",
"0.52074844",
"0.5204325",
"0.5171299",
"0.5149742",
"0.51430225",
"0.512... | 0.78392994 | 0 |
Deletes the currentlyselected step. | def remove_step(self):
idx = self.stepsListWidget.currentRow()
if len(self.mgr.obj.steps) > 0:
del self.mgr.obj.steps[idx]
# Flag the Generator as changed
self.mgr.changed = True
# Refresh lists/tables
self.load_steps()
nsteps = l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deleteStep( self ):\n assert isinstance( self._env, Env )\n assert isinstance( self._steps, list )\n\n # Save the stuff we need\n oldSteps = self._steps\n oldSteps.pop( )\n\n # Reinitialize this instance\n self._initialize( oldSteps )",
"def deleteSelected(se... | [
"0.7908008",
"0.77256954",
"0.71777666",
"0.6782154",
"0.6641536",
"0.66104895",
"0.6581826",
"0.64740354",
"0.64605683",
"0.642405",
"0.638075",
"0.6380415",
"0.6309099",
"0.6234008",
"0.6223671",
"0.62140757",
"0.61724263",
"0.60498005",
"0.60322315",
"0.60313624",
"0.60221... | 0.7454499 | 2 |
Loads the list of measurements in measurementsListWidget. | def load_measurements(self):
# Clear measurementsListWidget
self.measurementsListWidget.clear()
measurements = self.mgr.obj.measurements
for i, measurement in enumerate(measurements):
item = QListWidgetItem('Measurement {:d}: {:s}'.format(i, measurement))
self.me... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_data_list(self, list=[]):\n self.panel.load_data_list(list=list)",
"def measurements():\n measurements_for_displaying = db.session.query(Measurement).all()\n return render_template('measurement/measurements.html', measurements=measurements_for_displaying)",
"def load_steps(self):\n ... | [
"0.65180516",
"0.6164685",
"0.60683453",
"0.57910126",
"0.56354964",
"0.5582714",
"0.55376685",
"0.5529365",
"0.5478463",
"0.5460274",
"0.5457863",
"0.54505706",
"0.54464054",
"0.54336715",
"0.53758967",
"0.53616655",
"0.53318405",
"0.53315115",
"0.5289577",
"0.52886707",
"0.... | 0.88159275 | 0 |
Loads a twocolumn tableWidget from a dictionary, with column1 = keys and column2 = values. Skips keys in `skip` and disables the first column from editing if `disable_first` is True. | def load_table_from_dict(d, tableWidget, skip=[], disable_first=True):
N_rows = len(d)-len(skip)
tableWidget.setRowCount(N_rows)
i = 0
for key, val in d.items():
if key in skip:
continue
item1, item2 = QTableWidgetItem(key), QTableWidgetItem(str(val))
if disable_first... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_table_widget_parser_with_two_columns_as_unique_key():\n execute_table_widget_parser_test('bh-management_operations_future-occupancy_future-move-ins-records')",
"def test_collected_columns_as_table_two_col_from_two(self):\n col_double, allow_colspan = True, True # as_type == 'table'\n c... | [
"0.53484654",
"0.51944304",
"0.49376056",
"0.49347544",
"0.47810358",
"0.4748945",
"0.46961328",
"0.46227226",
"0.45850357",
"0.45447883",
"0.45312482",
"0.45306456",
"0.45024112",
"0.44851166",
"0.43883666",
"0.43400222",
"0.43324092",
"0.43223786",
"0.4318936",
"0.428835",
... | 0.73431975 | 0 |
This function returns the euclidean distance between two points | def float_euclidean_dist(p, q):
px, py = p[0], p[1]
qx, qy = q[0], q[1]
diff_x = abs(qx - px)
diff_y = abs(qy - py)
return float(math.sqrt((diff_x * diff_x) + (diff_y * diff_y))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def euclidean_distance(point1, point2):\n\n return math.sqrt(sum([(x - y) ** 2 for x, y in zip(point1, point2)]))",
"def euclidean_distance(point_one, point_two):\n return np.linalg.norm(point_one-point_two)",
"def euclidean_distance(point1, point2):\n return np.linalg.norm(np.array(point1) - np.array... | [
"0.8717747",
"0.86847806",
"0.86628944",
"0.8581488",
"0.85644174",
"0.8479396",
"0.8474643",
"0.8468512",
"0.8417486",
"0.83825624",
"0.83328855",
"0.83127606",
"0.8299319",
"0.82879245",
"0.8284359",
"0.8184619",
"0.8175599",
"0.81532836",
"0.8143333",
"0.8123838",
"0.80933... | 0.0 | -1 |
Return dataframe type consist of image path and corresponding label. | def get_path_and_label(self):
DATA_SIZE = 700
category = os.listdir(os.path.join(self.root, 'NWPU-RESISC45'))
image_path = []
label = []
for cat in category:
cat_enc = self.class_enc[cat]
label += [cat_enc] * DATA_SIZE
for num in range(1, DATA_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_path_and_label(self):\n image_path = []\n label = []\n\n for image in glob.glob(os.path.join(self.root,self.data_mode,'*_photo.png')):\n image_path.append(image)\n \n for mask in glob.glob(os.path.join(self.root,self.data_mode,'*_mask.png')):\n label... | [
"0.69491714",
"0.6878861",
"0.6670336",
"0.6404782",
"0.6401222",
"0.63723546",
"0.6073299",
"0.58823705",
"0.579363",
"0.57913387",
"0.5778613",
"0.57586396",
"0.5708008",
"0.56818444",
"0.56663835",
"0.56016076",
"0.558694",
"0.5574119",
"0.55374455",
"0.55373615",
"0.55278... | 0.69997656 | 0 |
Return ``True`` if i is contained in PermutationGroup. Examples ======== >>> from sympy.combinatorics import Permutation, PermutationGroup >>> p = Permutation(1, 2, 3) >>> Permutation(3) in PermutationGroup(p) True | def __contains__(self, i):
if not isinstance(i, Permutation):
raise TypeError("A PermutationGroup contains only Permutations as "
"elements, not elements of type %s" % type(i))
return self.contains(i) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __contains__(self, i):\n if not isinstance(i, Permutation):\n raise TypeError(\"A SymmetricPermutationGroup contains only Permutations as \"\n \"elements, not elements of type %s\" % type(i))\n return i.size == self.degree",
"def __contains__(self, i):\n ... | [
"0.8083811",
"0.7035551",
"0.6997726",
"0.641585",
"0.6142141",
"0.6120278",
"0.6068374",
"0.60667783",
"0.6053663",
"0.60478914",
"0.6037574",
"0.6032641",
"0.6003731",
"0.59953153",
"0.59755164",
"0.5925492",
"0.5878249",
"0.58656996",
"0.58612627",
"0.5861004",
"0.58508414... | 0.85526246 | 0 |
Return ``True`` if PermutationGroup generated by elements in the group are same i.e they represent the same PermutationGroup. Examples ======== >>> from sympy.combinatorics import Permutation, PermutationGroup >>> p = Permutation(0, 1, 2, 3, 4, 5) >>> G = PermutationGroup([p, p2]) >>> H = PermutationGroup([p2, p]) >>> ... | def equals(self, other):
if not isinstance(other, PermutationGroup):
return False
set_self_gens = set(self.generators)
set_other_gens = set(other.generators)
# before reaching the general case there are also certain
# optimisation and obvious cases requiring less or... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def same_group(self,i,j):\n if self.group_number(i) == self.group_number(j):\n return True\n else:\n return False",
"def __eq__(self, other):\n group = self.group\n if not isinstance(other, group.dtype):\n return False\n return tuple.__eq__(self... | [
"0.7148045",
"0.6428978",
"0.6348889",
"0.6233025",
"0.61868286",
"0.60012996",
"0.594454",
"0.5882711",
"0.58398193",
"0.583714",
"0.58199316",
"0.58076143",
"0.58020765",
"0.5790643",
"0.5776977",
"0.5758111",
"0.57002354",
"0.57002354",
"0.568596",
"0.56756246",
"0.5651933... | 0.76402706 | 0 |
Returns the size of the permutations in the group. Explanation =========== The number of permutations comprising the group is given by ``len(group)``; the number of permutations that can be generated by the group is given by ``group.order()``. Examples ======== >>> from sympy.combinatorics import Permutation, Permutati... | def degree(self):
return self._degree | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_size_dist(self):\n return self.group_sizes() / self.group_sizes().sum()",
"def group_size(self):\n return self._gsize",
"def __len__(self):\n return len(self.group_list)",
"def getNumGroups(self):\n return len(np.unique(self._group_index))",
"def _lengths_groupings(mol... | [
"0.61951756",
"0.61205584",
"0.58797175",
"0.58232546",
"0.58132154",
"0.572008",
"0.57195204",
"0.5715405",
"0.56456685",
"0.5643447",
"0.5563576",
"0.5517634",
"0.55104053",
"0.55068445",
"0.54686826",
"0.54480344",
"0.5435533",
"0.5421014",
"0.5398256",
"0.53654635",
"0.53... | 0.0 | -1 |
Returns all the elements of the permutation group as a list Examples ======== >>> from sympy.combinatorics import Permutation, PermutationGroup >>> p = PermutationGroup(Permutation(1, 3), Permutation(1, 2)) >>> p._elements [(3), (3)(1 2), (1 3), (2 3), (1 2 3), (1 3 2)] | def _elements(self):
return list(islice(self.generate(), None)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def elements(self):\n if self.rank == 0:\n # A set containing Identity element of `FreeGroup` self is returned\n return {self.identity}\n else:\n raise ValueError(\"Group contains infinitely many elements\"\n \", hence cannot be represented\... | [
"0.6641791",
"0.6307228",
"0.6144966",
"0.6005542",
"0.6000048",
"0.5999121",
"0.59216756",
"0.5876004",
"0.5819913",
"0.5789152",
"0.5788266",
"0.575087",
"0.57392913",
"0.5701761",
"0.568067",
"0.56676453",
"0.56439203",
"0.5611275",
"0.55751663",
"0.55566734",
"0.5489515",... | 0.64250875 | 1 |
Test if the group is Abelian. Examples ======== >>> from sympy.combinatorics import Permutation, PermutationGroup >>> a = Permutation([0, 2, 1]) >>> b = Permutation([1, 0, 2]) >>> G = PermutationGroup([a, b]) >>> G.is_abelian False >>> a = Permutation([0, 2, 1]) >>> G = PermutationGroup([a]) >>> G.is_abelian True | def is_abelian(self):
if self._is_abelian is not None:
return self._is_abelian
self._is_abelian = True
gens = [p._array_form for p in self.generators]
for x in gens:
for y in gens:
if y <= x:
continue
if not _af... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_abelian(self):\n return self.rank in (0, 1)",
"def is_elementary(self, p):\n return self.is_abelian and all(g.order() == p for g in self.generators)",
"def combinatorial_automorphism_group(self):\n if '_combinatorial_automorphism_group' in self.__dict__:\n return self._co... | [
"0.7436968",
"0.571119",
"0.5194615",
"0.5097805",
"0.4981298",
"0.49598503",
"0.49556625",
"0.49286664",
"0.49244416",
"0.48920047",
"0.47892615",
"0.4789014",
"0.47734404",
"0.4744868",
"0.4738",
"0.47352126",
"0.47348446",
"0.47294724",
"0.469579",
"0.46637174",
"0.4663502... | 0.72759044 | 1 |
Return ``True`` if the group is elementary abelian. An elementary abelian group is a finite abelian group, where every nontrivial element has order `p`, where `p` is a prime. Examples ======== >>> from sympy.combinatorics import Permutation, PermutationGroup >>> a = Permutation([0, 2, 1]) >>> G = PermutationGroup([a]) ... | def is_elementary(self, p):
return self.is_abelian and all(g.order() == p for g in self.generators) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_abelian(self):\n if self._is_abelian is not None:\n return self._is_abelian\n\n self._is_abelian = True\n gens = [p._array_form for p in self.generators]\n for x in gens:\n for y in gens:\n if y <= x:\n continue\n ... | [
"0.60982305",
"0.6082831",
"0.5751585",
"0.5605928",
"0.5562551",
"0.5548205",
"0.53165245",
"0.521655",
"0.5181452",
"0.51115316",
"0.5090703",
"0.5050074",
"0.5026765",
"0.5025104",
"0.5007884",
"0.4974844",
"0.49330276",
"0.48667374",
"0.4859351",
"0.48257113",
"0.48203313... | 0.7273488 | 0 |
Test if the group is nilpotent. Explanation =========== A group `G` is nilpotent if it has a central series of finite length. Alternatively, `G` is nilpotent if its lower central series terminates with the trivial group. Every nilpotent group is also solvable ([1], p.29, [12]). Examples ======== >>> from sympy.combinat... | def is_nilpotent(self):
if self._is_nilpotent is None:
lcs = self.lower_central_series()
terminator = lcs[len(lcs) - 1]
gens = terminator.generators
degree = self.degree
identity = _af_new(list(range(degree)))
if all(g == identity for g in ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsEmpty(self):\n return not self._groups",
"def est_nul(self):\n\t\tif self.__valide:\n\t\t\treturn (self.degre() == 0) and (self.valuation().est_nul())\n\t\telse:\n\t\t\treturn False",
"def pd_isnan(val):\n return val is None or val != val",
"def group_is_surrounded(group, board):\n if group_ad... | [
"0.5891524",
"0.5789463",
"0.5759264",
"0.5681828",
"0.56555116",
"0.5652208",
"0.5624309",
"0.56036514",
"0.5602809",
"0.5542293",
"0.5475479",
"0.5455969",
"0.5442846",
"0.5441708",
"0.5440567",
"0.5423027",
"0.54097587",
"0.5381911",
"0.5364816",
"0.5352194",
"0.5342526",
... | 0.7086133 | 0 |
Test if the group is solvable. ``G`` is solvable if its derived series terminates with the trivial group ([1], p.29). Examples ======== >>> from sympy.combinatorics.named_groups import SymmetricGroup >>> S = SymmetricGroup(3) >>> S.is_solvable True See Also ======== is_nilpotent, derived_series | def is_solvable(self):
if self._is_solvable is None:
if self.order() % 2 != 0:
return True
ds = self.derived_series()
terminator = ds[len(ds) - 1]
gens = terminator.generators
degree = self.degree
identity = _af_new(list(ran... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_solvable(self):\n self_copy = deepcopy(self)\n return self_copy.solve()",
"def has_group(self, resolvable):\n group = self._resolve_group(resolvable)\n\n for g in self.groups.query(name=group.name):\n if g.name == group.name:\n return True\n\n r... | [
"0.5656866",
"0.5540562",
"0.53025675",
"0.5247994",
"0.51894885",
"0.5175105",
"0.5111701",
"0.50324947",
"0.5021636",
"0.49482435",
"0.4925885",
"0.48987862",
"0.4898412",
"0.48968303",
"0.4891872",
"0.48735893",
"0.48727146",
"0.4865633",
"0.48516348",
"0.48501644",
"0.484... | 0.6325311 | 0 |
Return ``True`` if a group is polycyclic. A group is polycyclic if it has a subnormal series with cyclic factors. For finite groups, this is the same as if the group is solvable. Examples ======== >>> from sympy.combinatorics import Permutation, PermutationGroup >>> a = Permutation([0, 2, 1, 3]) >>> b = Permutation([2,... | def is_polycyclic(self):
return self.is_solvable | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_cyclic(self):\n if self._is_cyclic is not None:\n return self._is_cyclic\n\n if len(self.generators) == 1:\n self._is_cyclic = True\n self._is_abelian = True\n return True\n\n if self._is_abelian is False:\n self._is_cyclic = False\... | [
"0.68404174",
"0.61363095",
"0.6080339",
"0.60345906",
"0.5724837",
"0.5724743",
"0.56917363",
"0.56802696",
"0.56782097",
"0.5526331",
"0.54841745",
"0.53206015",
"0.5272756",
"0.5248919",
"0.5193449",
"0.51193464",
"0.5099996",
"0.50994414",
"0.50944126",
"0.50937116",
"0.5... | 0.6990605 | 0 |
Test if the group is the trivial group. This is true if the group contains only the identity permutation. Examples ======== >>> from sympy.combinatorics import Permutation, PermutationGroup >>> G = PermutationGroup([Permutation([0, 1, 2])]) >>> G.is_trivial True | def is_trivial(self):
if self._is_trivial is None:
self._is_trivial = len(self) == 1 and self[0].is_Identity
return self._is_trivial | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_trivial(p: List[int]) -> bool:\n validate_permutation(p)\n\n for i in range(len(p)):\n if p[i] != i:\n return False\n return True",
"def _is_trivial(self):\n return self._.d <= 1",
"def is_trivial(self):\n return self.dims == 0",
"def IsEmpty(self):\n return... | [
"0.66887593",
"0.6437094",
"0.6419862",
"0.59163016",
"0.58395195",
"0.5817945",
"0.57887805",
"0.56908685",
"0.54201204",
"0.53624666",
"0.51903135",
"0.518788",
"0.51806164",
"0.5167625",
"0.5152729",
"0.5145636",
"0.5140972",
"0.5121065",
"0.5118098",
"0.50796044",
"0.5068... | 0.67697227 | 0 |
r"""Return the conjugacy classes of the group. Explanation =========== As described in the documentation for the .conjugacy_class() function, conjugacy is an equivalence relation on a group G which partitions the set of elements. This method returns a list of all these conjugacy classes of G. Examples ======== >>> from... | def conjugacy_classes(self):
identity = _af_new(list(range(self.degree)))
known_elements = {identity}
classes = [known_elements.copy()]
for x in self.generate():
if x not in known_elements:
new_class = self.conjugacy_class(x)
classes.append(ne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conjugacy_class(self, x):\n # Ref: \"Computing the conjugacy classes of finite groups\"; Butler, G.\n # Groups '93 Galway/St Andrews; edited by Campbell, C. M.\n new_class = {x}\n last_iteration = new_class\n\n while len(last_iteration) > 0:\n this_iteration = set(... | [
"0.73073655",
"0.59314555",
"0.5615055",
"0.55472714",
"0.55469334",
"0.5493729",
"0.5424037",
"0.5408812",
"0.54031736",
"0.5393563",
"0.53931713",
"0.53811055",
"0.53422934",
"0.53194016",
"0.5236853",
"0.5234166",
"0.5219209",
"0.5213968",
"0.5198761",
"0.51966",
"0.519176... | 0.7914107 | 0 |
Return ``True`` if the group is alternating. Examples ======== >>> from sympy.combinatorics import AlternatingGroup >>> g = AlternatingGroup(5) >>> g.is_alternating True >>> from sympy.combinatorics import Permutation, PermutationGroup >>> g = PermutationGroup( ... Permutation(0, 1, 2, 3, 4), ... Permutation(2, 3, 4)) ... | def is_alternating(self):
_is_alt = self._is_alt
if _is_alt is not None:
return _is_alt
n = self.degree
if n >= 8:
if self.is_transitive():
_is_alt_sym = self._eval_is_alt_sym_monte_carlo()
if _is_alt_sym:
if al... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_is_surrounded(group, board):\n if group_adjacents(group, board, filter_by=\"None\"):\n return False\n else:\n return True",
"def is_dihedral(self):\n if self._is_dihedral is not None:\n return self._is_dihedral\n\n order = self.order()\n\n if order % ... | [
"0.60255927",
"0.58316284",
"0.54881376",
"0.53885347",
"0.53048825",
"0.5174953",
"0.5105385",
"0.5057156",
"0.5057156",
"0.50517607",
"0.4976585",
"0.4943239",
"0.4866768",
"0.48620513",
"0.48462543",
"0.48302266",
"0.48067594",
"0.48014262",
"0.4767828",
"0.47516233",
"0.4... | 0.6943458 | 0 |
Subroutine to test if there is only one cyclic group for the order. | def _distinct_primes_lemma(cls, primes):
primes = sorted(primes)
l = len(primes)
for i in range(l):
for j in range(i+1, l):
if primes[j] % primes[i] == 1:
return None
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_cyclic(self):\n return self._.b[0] == 2 and self._.c[-1] in [1, 2] and \\\n all(x == 1 for x in self._.b[1:-1] + self._.c[1:-1])",
"def is_cyclic(self):\n if self._is_cyclic is not None:\n return self._is_cyclic\n\n if len(self.generators) == 1:\n self... | [
"0.68413395",
"0.65942216",
"0.638763",
"0.6307002",
"0.6263699",
"0.62443733",
"0.6229632",
"0.61361545",
"0.60000044",
"0.5934401",
"0.5872607",
"0.58281624",
"0.5792634",
"0.576959",
"0.5761982",
"0.574698",
"0.5742947",
"0.56767714",
"0.5673215",
"0.56517273",
"0.56429833... | 0.0 | -1 |
r""" Return ``True`` if the group is Cyclic. Examples ======== >>> from sympy.combinatorics.named_groups import AbelianGroup >>> G = AbelianGroup(3, 4) >>> G.is_cyclic True >>> G = AbelianGroup(4, 4) >>> G.is_cyclic False Notes ===== If the order of a group $n$ can be factored into the distinct primes $p_1, p_2, \dots ... | def is_cyclic(self):
if self._is_cyclic is not None:
return self._is_cyclic
if len(self.generators) == 1:
self._is_cyclic = True
self._is_abelian = True
return True
if self._is_abelian is False:
self._is_cyclic = False
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_cyclic(self):\n return self._.b[0] == 2 and self._.c[-1] in [1, 2] and \\\n all(x == 1 for x in self._.b[1:-1] + self._.c[1:-1])",
"def is_cyclic(self):\n return self.cyclic",
"def IsCyclic(self):\n\n visited = [False for i in range(self.NodesCount())]\n \n ... | [
"0.70683986",
"0.681011",
"0.67512846",
"0.6653446",
"0.6344659",
"0.60155123",
"0.5983192",
"0.5927948",
"0.58001685",
"0.5680574",
"0.562286",
"0.5528702",
"0.55150616",
"0.55137986",
"0.5497057",
"0.5479016",
"0.54095733",
"0.5361122",
"0.5332785",
"0.52799547",
"0.5271113... | 0.71914554 | 0 |
Return ``True`` if i is contained in SymmetricPermutationGroup. Examples ======== >>> from sympy.combinatorics import Permutation, SymmetricPermutationGroup >>> G = SymmetricPermutationGroup(4) >>> Permutation(1, 2, 3) in G True | def __contains__(self, i):
if not isinstance(i, Permutation):
raise TypeError("A SymmetricPermutationGroup contains only Permutations as "
"elements, not elements of type %s" % type(i))
return i.size == self.degree | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __contains__(self, i):\n if not isinstance(i, Permutation):\n raise TypeError(\"A PermutationGroup contains only Permutations as \"\n \"elements, not elements of type %s\" % type(i))\n return self.contains(i)",
"def __contains__(self, i):\n if not is... | [
"0.81576407",
"0.68310034",
"0.6502004",
"0.64061195",
"0.603598",
"0.6005269",
"0.59416896",
"0.5934221",
"0.583606",
"0.57717687",
"0.577011",
"0.57350177",
"0.5727993",
"0.5719934",
"0.57030296",
"0.5692162",
"0.5671197",
"0.56557655",
"0.5639756",
"0.5595685",
"0.5592905"... | 0.84934384 | 0 |
Computes the sum along segments of a tensor. Analogous to tf.unsorted_segment_sum. | def unsorted_segment_sum(self,data, segment_ids, num_segments):
# assert all([i in data.shape for i in segment_ids.shape]), "segment_ids.shape should be a prefix of data.shape"
#
# segment_ids is a 1-D tensor repeat it to have the same shape as data
if len(segment_ids.shape) == 1:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unsorted_segment_sum(data: torch.Tensor, segment_ids: torch.Tensor,\n num_segments: int) -> torch.Tensor:\n\n if len(segment_ids.shape) != 1:\n raise AssertionError(\"segment_ids have be a 1-D tensor\")\n\n if data.shape[0] != segment_ids.shape[0]:\n raise AssertionE... | [
"0.7578235",
"0.7506605",
"0.74699783",
"0.6586497",
"0.6506094",
"0.6485964",
"0.6485964",
"0.6485964",
"0.6485964",
"0.6485964",
"0.6312732",
"0.63053745",
"0.6110864",
"0.5963782",
"0.595026",
"0.59458345",
"0.5915711",
"0.57985264",
"0.55721176",
"0.551346",
"0.5353314",
... | 0.72073925 | 3 |
Determines whether the colorscale is a default palette | def autocolorscale(self):
return self["autocolorscale"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_colormap(cmap):\n names = set(['BrBG', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral',\n 'Blues', 'BuGn', 'BuPu', 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', 'PuBu',\n 'PuBuGn', 'PuRd', 'Purples', 'RdPu', 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'Yl... | [
"0.6546061",
"0.60376614",
"0.6028996",
"0.5843241",
"0.5843241",
"0.5843241",
"0.5829233",
"0.5810848",
"0.57491475",
"0.57466245",
"0.5702876",
"0.56838965",
"0.5587279",
"0.5570698",
"0.55618143",
"0.5542629",
"0.55189294",
"0.5512201",
"0.55093926",
"0.54862267",
"0.54862... | 0.54469985 | 22 |
Determines whether or not a colorbar is displayed for this trace. Has an effect only if colors is set to a numerical array. The 'showscale' property must be specified as a bool (either True, or False) Returns bool | def showscale(self):
return self["showscale"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ColorBarEnabled(self):\n sliceAnnotations = DataProbeLib.SliceAnnotations()\n sliceAnnotations.scalarBarEnabled = 1\n sliceAnnotations.updateSliceViewFromGUI()",
"def is_scale_enabled(self) -> bool:\r\n ...",
"def _colorBar(self):\n self.gc.show_colorscale(cmap=self.colormap, vmin=se... | [
"0.6442152",
"0.57893956",
"0.57860404",
"0.5407467",
"0.5315751",
"0.53125066",
"0.5308647",
"0.5259054",
"0.5188935",
"0.5172053",
"0.5144004",
"0.51225257",
"0.5089081",
"0.5080423",
"0.50774163",
"0.50639063",
"0.5062845",
"0.50456804",
"0.5038069",
"0.5036872",
"0.498336... | 0.5177513 | 9 |
Returns the rating of a player. | def __playerRating(player, db):
key = player['id']
if key not in __ratingCache:
c = db.cursor()
c.execute("SELECT rating FROM PLAYERS WHERE id='%s'" %
player['email-hash'])
rating = c.fetchone()[0]
__ratingCache[key] = rating
else:
rating = __ratingC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def player_ratio(self, ctx):\r\n player = ctx.message.content.split(' ')[1]\r\n if os.environ.get(\"WoW_Token\") is None:\r\n return\r\n else:\r\n async with aiohttp.ClientSession().get('https://us.api.battle.net/wow/character/zul\\'jin/' + player + '?fields=pvp&loc... | [
"0.7206802",
"0.70205957",
"0.69292367",
"0.69153583",
"0.690743",
"0.690743",
"0.68659246",
"0.68335265",
"0.6711524",
"0.66578525",
"0.66232824",
"0.6439895",
"0.64266515",
"0.6411005",
"0.63668424",
"0.6332875",
"0.63169366",
"0.63055617",
"0.6255785",
"0.6208215",
"0.6167... | 0.79001486 | 0 |
This method constructs a ConstrainedSketchDimension object between two ConstrainedSketchGeometry, or aConstrainedSketchVertex and ConstrainedSketchGeometry object. A distance dimension specifies the shortest distance between two entities. Notes | def DistanceDimension(
self,
entity1: ConstrainedSketchVertex,
entity2: ConstrainedSketchVertex,
textPoint: tuple[float],
value: float = None,
reference: Boolean = OFF,
):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance_to(self, other: Geometry[Scalar]) -> Scalar:\n return (self._distance_to_point(other)\n if isinstance(other, Point)\n else (non_negative_min(self._distance_to_point(point)\n for point in other.points)\n if ... | [
"0.50768846",
"0.50727236",
"0.48343235",
"0.48213935",
"0.4816937",
"0.47861072",
"0.4784957",
"0.4751665",
"0.47499803",
"0.47411647",
"0.47291628",
"0.471964",
"0.4718789",
"0.47185254",
"0.4672809",
"0.46667966",
"0.46525577",
"0.46486267",
"0.4640384",
"0.46340212",
"0.4... | 0.63587826 | 0 |
Tests the shape of the input gray_scale image after being scaled. | def test_scale_image_gray(self):
larger = scale_image(self.gray_image, 1.5)
self.assertEqual((150, 300), larger.shape)
smaller = scale_image(self.gray_image, 0.2)
self.assertEqual((20, 40), smaller.shape) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_scale_image_gray_identity(self):\n scaled = scale_image(self.gray_image, 1)\n self.assertEqual(self.gray_image.shape, scaled.shape)",
"def _isGrayscale(self, img: ndarray) -> bool:\n if len(np.squeeze(img).shape) == 2:\n return True\n else:\n return Fals... | [
"0.8235198",
"0.7525774",
"0.72988516",
"0.72745115",
"0.71634775",
"0.66533095",
"0.6517225",
"0.6517225",
"0.6503157",
"0.6463503",
"0.62938577",
"0.61596596",
"0.6070209",
"0.60074836",
"0.6003341",
"0.5987712",
"0.5964525",
"0.5918139",
"0.5786026",
"0.572659",
"0.5708784... | 0.8213616 | 1 |
Return a list of files for a Clowder Dataset. | def clowder_dataset_filelist(session, url, dataset):
try:
ret = session.get(posixpath.join(url, "api/datasets", dataset, "listFiles"))
except session.exceptions.RequestException as e:
print(e)
sys.exit(1)
return ret | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_data_files():\n data_files = []\n\n # Walk through the data directory, adding all files\n data_generator = os.walk('pypeit/data')\n for path, directories, files in data_generator:\n for f in files:\n data_path = '/'.join(path.split('/')[1:])\n data_files.append(os.p... | [
"0.70874727",
"0.69739914",
"0.69559693",
"0.6917234",
"0.6898795",
"0.683393",
"0.68042696",
"0.68031234",
"0.67194915",
"0.67011935",
"0.669388",
"0.666859",
"0.66581213",
"0.6629774",
"0.6623832",
"0.6606473",
"0.6583866",
"0.65796155",
"0.6576844",
"0.6548031",
"0.6534445... | 0.6933346 | 3 |
Build a metadata set for a Clowder dataset. | def get_metadata(session, url, filelist):
metadata = {}
# Loop over the Clowder dataset image ID list
for clowder_img in filelist.json():
# Get metadata for the image from Clowder
response = clowder_file_metadata(session, url, clowder_img['id'])
# Metadata from multiple extractors ma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_coco_dataset():\n ds = AttrDict()\n # classes = [\n # '__background__', 'person', 'bicycle', 'car', 'motorcycle', 'airplane',\n # 'bus', 'train', 'truck', 'boat', 'traffic light', 'fire hydrant',\n # 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse',\n # ... | [
"0.6121866",
"0.6067996",
"0.6050318",
"0.6043443",
"0.6031875",
"0.5986893",
"0.5936118",
"0.59099025",
"0.59066445",
"0.58893955",
"0.58571947",
"0.5831757",
"0.58133554",
"0.57721144",
"0.5758344",
"0.5758039",
"0.5722224",
"0.57057536",
"0.569839",
"0.56743157",
"0.567069... | 0.55038846 | 40 |
Retrieve event data copy. For use when data might be modified. | def get_data(self):
return self.data.copy() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data(self) -> dict:\n return self._event.get('data')",
"def get_data(self, dataset):\n loop_over_dataset(dataset, self.process_event,\n branch_selection=hax.config['basic_branches'] + list(self.extra_branches))\n self.check_cache(force_empty=True)\n if not... | [
"0.6768704",
"0.6699785",
"0.6466781",
"0.642404",
"0.6397607",
"0.63859856",
"0.63859856",
"0.63859856",
"0.63805395",
"0.6377945",
"0.6377945",
"0.6377945",
"0.6377945",
"0.6354474",
"0.63510245",
"0.63154787",
"0.6293756",
"0.6288185",
"0.62866694",
"0.6223724",
"0.6223724... | 0.7340263 | 0 |
Show image with landmarks | def show_landmarks(image, landmarks):
if Image.isImageType(image):
image = np.asarray(image)
plt.imshow(image)
plt.scatter(landmarks[:, 0], landmarks[:, 1], s=10, marker='.', c='r')
plt.pause(0.001) # pause a bit so that plots are updated | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_landmarks(image, landmarks):\n\n if isinstance(image, str):\n # image = io.imread(image)\n image = cv2.cvtColor(cv2.imread(image), cv2.COLOR_BGR2RGB)\n\n plt.imshow(image)\n\n plt.scatter(landmarks[:, 0], landmarks[:, 1], s=10, marker='.', c='r')\n plt.pause(0.001) # pause a bit... | [
"0.808608",
"0.7926357",
"0.7926357",
"0.7926357",
"0.778297",
"0.7465765",
"0.7464966",
"0.6598388",
"0.65567565",
"0.65280706",
"0.6492143",
"0.6483718",
"0.6477732",
"0.644593",
"0.64328134",
"0.63780797",
"0.6371934",
"0.6371934",
"0.6371934",
"0.636128",
"0.6348264",
"... | 0.78171635 | 4 |
Get configuration data from the environment variables set on process start | def get_config() -> (int, Optional[AppConfig]):
es_host = os.environ.get("ES_HOST", "")
if es_host == "":
logging.error("empty env value for ES Host")
return 1, None
es_port_str = os.environ.get("ES_PORT", "")
if es_port_str == "":
logging.error("empty env value for ES P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_environment(self):\n # Setup credentials\n if os.getenv(\"DO_API_TOKEN\"):\n self.api_token = os.getenv(\"DO_API_TOKEN\")\n if os.getenv(\"DO_API_KEY\"):\n self.api_token = os.getenv(\"DO_API_KEY\")",
"def load_environ(self):\n\t\tself.environ = {}\n\t\tf = fil... | [
"0.6961719",
"0.68344194",
"0.6787011",
"0.676659",
"0.6750006",
"0.6737289",
"0.6689082",
"0.66262776",
"0.6613089",
"0.6607369",
"0.66034573",
"0.66034573",
"0.66034573",
"0.66034573",
"0.66034573",
"0.66034573",
"0.6595306",
"0.65806925",
"0.6559515",
"0.65428424",
"0.6527... | 0.0 | -1 |
Merge several dictionaries into one. | def merge_dicts(*dicts):
counter = Counter()
for dict_ in dicts:
counter.update(dict_)
return counter | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_dicts(*dicts):\n result = {}\n for d in dicts:\n result.update(d)\n return result",
"def merge_animal_dicts(*dicts):\n full = dicts[0]\n for d in dicts:\n full.update(d)\n return full",
"def merge_dicts(*kwargs):\n result={}\n for dictionary in kwargs:\n r... | [
"0.8220934",
"0.79573613",
"0.79078454",
"0.7906643",
"0.7906643",
"0.7906643",
"0.7906643",
"0.7906643",
"0.7906643",
"0.78602487",
"0.7859505",
"0.7859279",
"0.78468275",
"0.7803648",
"0.779201",
"0.77595705",
"0.76888007",
"0.76522774",
"0.76167405",
"0.75851476",
"0.75387... | 0.72197926 | 29 |
Return an organization's data. | def get_org_data(org, session=None):
url = f'{GITHUB_API_URL}/orgs/{org}'
return get_whole_response_as_json(url, session) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_organization(organization):\n return fetch_json(organization_url, organization)",
"def organization(self):\n return self._tower.get_organization_by_id(self._data.get('organization'))",
"def get_organisation_metadata() -> pd.DataFrame:\n return GETTER.organisationmetadata",
"def test_re... | [
"0.7558276",
"0.7252696",
"0.70252955",
"0.6863689",
"0.6850609",
"0.6837887",
"0.6804756",
"0.67961556",
"0.67682517",
"0.65937",
"0.6562095",
"0.65403664",
"0.65403664",
"0.65403664",
"0.648654",
"0.64633554",
"0.6438782",
"0.6399565",
"0.63045293",
"0.62999815",
"0.6298788... | 0.7225232 | 2 |
Return all issues for a repository. Every pull request is an issue, but not every issue is a pull request. Identify pull requests by the `pull_request` key. [issue for issue in issues if 'pull_request' not in issue] | def get_repo_issues(owner, repo, session=None):
url = f'{GITHUB_API_URL}/repos/{owner}/{repo}/issues'
query_params = {'state': 'all'}
return get_one_item_at_a_time(url, query_params, session) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def get_issues(self) -> [\"AIOGitHubAPIRepositoryIssue\"]:\n _endpoint = f\"/repos/{self.full_name}/issues\"\n\n response = await self.client.get(endpoint=_endpoint)\n return [AIOGitHubAPIRepositoryIssue(self.client, x) for x in response or []]",
"async def get_pull_requests(self, issu... | [
"0.7393933",
"0.73270226",
"0.7288731",
"0.6998398",
"0.6956311",
"0.6888399",
"0.6877951",
"0.6769442",
"0.67618",
"0.6710431",
"0.655931",
"0.655931",
"0.64173347",
"0.63655007",
"0.63542646",
"0.6317172",
"0.62901556",
"0.6275704",
"0.622413",
"0.6196787",
"0.61126536",
... | 0.70291686 | 3 |
Return all comments for a repository. | def get_repo_comments(owner, repo, session=None):
url = f'{GITHUB_API_URL}/repos/{owner}/{repo}/comments'
return get_one_item_at_a_time(url, session=session) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_comments(self):\n\t\treturn self._client.get_comments(self)",
"def comments(self):\r\n return RepoCommitsComments(self)",
"def get_comments(self):\n url = \"https://api.imgur.com/3/gallery/{0}/comments\".format(self.id)\n resp = self._imgur._send_request(url)\n return [Comme... | [
"0.7014341",
"0.6909517",
"0.6906317",
"0.68616307",
"0.67992157",
"0.6734544",
"0.6728893",
"0.67281485",
"0.666008",
"0.6648531",
"0.66095585",
"0.6587428",
"0.6447026",
"0.6425748",
"0.6421766",
"0.63539976",
"0.6347292",
"0.6330964",
"0.63304913",
"0.6323777",
"0.63237005... | 0.7534347 | 0 |
Return all comments for an issue. | def get_comments_for_issue(owner, repo, issue_number, session=None):
url = (
f'{GITHUB_API_URL}/repos/{owner}/{repo}/issues/{issue_number}/comments'
)
return get_one_item_at_a_time(url, session=session) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_comments(self, issue_id):\n data = self._get(\"/issues/{}/comments\".format(issue_id))\n comments = []\n for item in data:\n comments.append(\n Comment(item['user']['login'], item['body'])\n )\n return comments",
"def comments(self):\r\n ... | [
"0.7898055",
"0.7578202",
"0.7578202",
"0.7289417",
"0.7157664",
"0.70946985",
"0.708791",
"0.70637983",
"0.6946413",
"0.6939914",
"0.69158703",
"0.6806353",
"0.677819",
"0.669866",
"0.6588503",
"0.65848476",
"0.6583723",
"0.6583723",
"0.6583723",
"0.6581249",
"0.6534684",
... | 0.7394774 | 3 |
Return all review comments for a pull request. | def get_review_comments_for_pr(owner, repo, pr_number, session=None):
url = f'{GITHUB_API_URL}/repos/{owner}/{repo}/pulls/{pr_number}/comments'
return get_one_item_at_a_time(url, session=session) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_repo_review_comments(owner, repo, session=None):\n url = f'{GITHUB_API_URL}/repos/{owner}/{repo}/pulls/comments'\n return get_one_item_at_a_time(url, session=session)",
"def _get_review_comments_body(\n self, pull_request_number: int) -> List[Tuple[str, str]]:\n review_comments = ... | [
"0.7207166",
"0.71001744",
"0.6341139",
"0.63153696",
"0.63118446",
"0.62846166",
"0.6258521",
"0.6258521",
"0.6249631",
"0.6193828",
"0.6180549",
"0.61573195",
"0.6155753",
"0.60618365",
"0.60229415",
"0.60078555",
"0.59520686",
"0.5950105",
"0.592043",
"0.59048486",
"0.5900... | 0.7485853 | 0 |
Return all review comments for a repository. | def get_repo_review_comments(owner, repo, session=None):
url = f'{GITHUB_API_URL}/repos/{owner}/{repo}/pulls/comments'
return get_one_item_at_a_time(url, session=session) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_repo_comments(owner, repo, session=None):\n url = f'{GITHUB_API_URL}/repos/{owner}/{repo}/comments'\n return get_one_item_at_a_time(url, session=session)",
"def get_review_comments_for_pr(owner, repo, pr_number, session=None):\n url = f'{GITHUB_API_URL}/repos/{owner}/{repo}/pulls/{pr_number}/com... | [
"0.69723296",
"0.6655196",
"0.6423206",
"0.6365476",
"0.6256596",
"0.6222393",
"0.62171125",
"0.61689156",
"0.60245496",
"0.60216296",
"0.6015133",
"0.5962868",
"0.59514827",
"0.5909328",
"0.58638304",
"0.58506525",
"0.58375275",
"0.5749344",
"0.57462585",
"0.57183295",
"0.56... | 0.75175816 | 0 |
Return all types of comments for a repository. | def get_all_types_of_comments(owner, repo, session=None):
commit_comments = list(get_repo_comments(owner, repo, session))
issue_comments = list(get_repo_issue_comments(owner, repo, session))
review_comments = list(get_repo_review_comments(owner, repo, session))
comments = []
comments.extend(commit_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_repo_comments(owner, repo, session=None):\n url = f'{GITHUB_API_URL}/repos/{owner}/{repo}/comments'\n return get_one_item_at_a_time(url, session=session)",
"def get_comments_by_genus_type(self, comment_genus_type):\n # Implemented from template for\n # osid.resource.ResourceLookupSess... | [
"0.6690958",
"0.63385016",
"0.629271",
"0.626892",
"0.6238859",
"0.62048715",
"0.6165963",
"0.61166203",
"0.61057264",
"0.6104717",
"0.60836273",
"0.6035692",
"0.6035692",
"0.6035692",
"0.60235614",
"0.6011993",
"0.59861696",
"0.598593",
"0.59828085",
"0.5977264",
"0.5939564"... | 0.7907325 | 0 |
Return total numbers of changes of `type` made by each user. | def get_total_changes_per_user(contributors, change_type):
total_changes_per_user = {}
for contribution in contributors:
login = contribution['login']
total_changes_per_user[login] = sum(
week[change_type] for week in contribution['weeks']
)
return total_changes_per_user | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upd_type_count(self, upd_type, ct_type):\n for hour in self.data_file.buckets:\n ct_type[hour] = Counter(pt['type'] for pt in self.data_file.buckets[hour])[upd_type]\n return ct_type",
"def increment_requests_count(self, type):\n if type not in self._requests_count:\n ... | [
"0.6182135",
"0.5529649",
"0.5433146",
"0.54329914",
"0.54206043",
"0.52382356",
"0.5224318",
"0.5208878",
"0.5094834",
"0.5089063",
"0.5082845",
"0.507002",
"0.5021882",
"0.49945062",
"0.49912483",
"0.49572998",
"0.49276263",
"0.49203",
"0.49159458",
"0.49067536",
"0.4884508... | 0.753881 | 0 |
convert RGB Image to an array | def _colored_img_to_arr(image, verbose=False):
height, width = image.size
arr = np.array(image.getdata())
arr = arr.reshape(3, height, width)
r = arr[0]
g = arr[1]
b = arr[2]
return r, g, b | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def carla_rgb_image_to_ndarray(image: carla.Image) -> np.ndarray: # pylint: disable=no-member\n image.convert(carla.ColorConverter.Raw) # pylint: disable=no-member\n array = np.frombuffer(image.raw_data, dtype=np.dtype(\"uint8\"))\n array = array.astype(np.float32) / 255\n array = np.reshape(array, (image.he... | [
"0.81679326",
"0.79077834",
"0.78170073",
"0.7754879",
"0.7714254",
"0.76597595",
"0.75661427",
"0.7477676",
"0.7442138",
"0.72853065",
"0.7280996",
"0.726241",
"0.7252153",
"0.7190613",
"0.71158046",
"0.7056543",
"0.70546174",
"0.7050424",
"0.7047874",
"0.70078224",
"0.70057... | 0.83822626 | 0 |
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. | def plot_confusion_matrix(cm, classes,
normalize=False,
title='Confusion matrix',
cmap=plt.cm.Blues):
if normalize:
cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]
print("Normalized confusion matrix")
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n... | [
"0.8194862",
"0.80949175",
"0.8029915",
"0.8019153",
"0.79941195",
"0.7991258",
"0.7980955",
"0.7976606",
"0.79610753",
"0.79590565",
"0.79378676",
"0.7934962",
"0.7934504",
"0.79313844",
"0.7926313",
"0.7924577",
"0.79241234",
"0.7923211",
"0.7923023",
"0.7921931",
"0.791787... | 0.78289187 | 74 |
Create a very simple SparseTensor with dimensions (batch, time). | def SimpleSparseTensorFrom(x):
x_ix = []
x_val = []
for batch_i, batch in enumerate(x):
for time, val in enumerate(batch):
x_ix.append([batch_i, time])
x_val.append(val)
x_shape = [len(x), np.asarray(x_ix).max(0)[1]+1]
x_ix = tf.constant(x_ix, tf.int64)
x_val = tf.constant(x_val, tf.int32)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SimpleSparseTensorFrom(x):\n x_ix = []\n x_val = []\n for batch_i, batch in enumerate(x):\n for time, val in enumerate(batch):\n x_ix.append([batch_i, time])\n x_val.append(val)\n x_shape = [len(x), np.asarray(x_ix).max(0)[1]+1]\n\n return x_ix, x_val, x_shape",
"def sparse_constructor(self... | [
"0.77144057",
"0.69885904",
"0.697697",
"0.6714194",
"0.6564656",
"0.65572447",
"0.64780253",
"0.6435694",
"0.6335496",
"0.6304249",
"0.6296127",
"0.62563014",
"0.6195476",
"0.618252",
"0.61651987",
"0.6125169",
"0.6121852",
"0.61040366",
"0.609892",
"0.60879636",
"0.60749507... | 0.8063575 | 0 |
Create a sparse representention of x. | def sparse_tuple_from(sequences, dtype=np.int32):
indices = []
values = []
for n, seq in enumerate(sequences):
indices.extend(zip([n]*len(seq), range(len(seq))))
values.extend(seq)
indices = np.asarray(indices, dtype=np.int64)
values = np.asarray(values, dtype=dtype)
shape = np... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_sparse(x):\n x_typename = torch.typename(x).split('.')[-1]\n sparse_tensortype = getattr(torch.sparse, x_typename)\n\n indices = torch.nonzero(x)\n if len(indices.shape) == 0: # if all elements are zeros\n return sparse_tensortype(*x.shape)\n indices = indices.t()\n values = x[tupl... | [
"0.75686485",
"0.7074417",
"0.7010392",
"0.7005248",
"0.6776821",
"0.6769516",
"0.6685081",
"0.6682845",
"0.6600969",
"0.6585346",
"0.658275",
"0.6573287",
"0.6444108",
"0.6443818",
"0.64427996",
"0.6438962",
"0.6436992",
"0.6384505",
"0.63345295",
"0.6333298",
"0.6276179",
... | 0.0 | -1 |
Craetes a dataset in a given project. If no project is specified, then the currently active project is used. | def create_dataset(dataset_name, project=None):
bigquery_client = bigquery.Client(project=project)
dataset = bigquery_client.dataset(dataset_name)
dataset.create()
print('Created dataset {}.'.format(dataset_name)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_dataset(project, dataset_name):\n dataset = dataset_name\n get_dataset = project.datasets.get(dataset_name=dataset)\n project.datasets.create(dataset_name=dataset_name)\n \n return get_dataset",
"def from_project(session: Session, project: Project) -> UnifiedDataset:\n url = URL(inst... | [
"0.6614971",
"0.5714235",
"0.5642387",
"0.5638796",
"0.56277835",
"0.5498516",
"0.5443267",
"0.5430378",
"0.54122466",
"0.54010534",
"0.53824764",
"0.53824764",
"0.5368268",
"0.5365405",
"0.5312255",
"0.5312255",
"0.5312255",
"0.5312255",
"0.5304169",
"0.5290291",
"0.52875614... | 0.55550903 | 5 |
Retrieves the list of all State objects | def get_states():
states = []
for state in storage.all("State").values():
states.append(state.to_dict())
return jsonify(states) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_states(self):\n return self._states",
"def all_states():\n dict = storage.all(State)\n list = []\n for state in dict.values():\n list.append(state.to_dict())\n return jsonify(list)",
"def all_states():\n states = []\n states_values = storage.all(\"State\").values()\n... | [
"0.8137676",
"0.8114916",
"0.81053764",
"0.80541945",
"0.79778695",
"0.7974168",
"0.79698193",
"0.78558934",
"0.77833647",
"0.7663341",
"0.765244",
"0.7569619",
"0.7534709",
"0.7502574",
"0.74869597",
"0.7467144",
"0.7464845",
"0.732207",
"0.7299296",
"0.7243289",
"0.72340447... | 0.77445245 | 9 |
Factory function that adds the headers necessary for Crossdomain calls. | def request_factory(environ):
request = Request(environ)
if request.is_xhr:
request.response = Response()
request.response.headerlist = []
request.response.headerlist.extend(
(
('Access-Control-Allow-Origin', '*'),
('Access-Control-Allow-Creden... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_header(response):\n response.headers[\"Access-Control-Allow-Origin\"] = \"*\"\n return response",
"def add_header(response):\n response.headers['Access-Control-Allow-Origin'] = '*'\n response.headers['Access-Control-Allow-Credentials'] = True\n response.headers['Access-Control-Allow-Method... | [
"0.7143249",
"0.70176864",
"0.6805945",
"0.6796034",
"0.6608607",
"0.6542308",
"0.6487631",
"0.64650875",
"0.64333093",
"0.64314204",
"0.63976884",
"0.63957304",
"0.6395087",
"0.6382656",
"0.63569975",
"0.63041323",
"0.6295552",
"0.62870955",
"0.62689996",
"0.62273765",
"0.62... | 0.6322607 | 15 |
Returns a noisy version of x | def add_noise(x, spatial_SIG, temporal_SIG, reject_cancelling_noise=False,
):
# in case x is empty
if not len(x):
return np.zeros(x.shape), x
if reject_cancelling_noise:
amps = amplitudes(x)
noise = make_noise(x.shape[0], spatial_SIG, temporal_SIG)
x_noise = x ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _make_noisy(x, the_noise):\n noise_sample = the_noise[np.random.choice(the_noise.shape[0],\n x.shape[0],\n replace=False)]\n return x + noise_sample",
"def noiseless_function(x):\n return 1/(1+np.exp(-x+5))-0.5... | [
"0.71909446",
"0.70813584",
"0.66522884",
"0.65134907",
"0.6246121",
"0.6122706",
"0.61223173",
"0.60926354",
"0.60461026",
"0.6001093",
"0.59999686",
"0.59974694",
"0.5992834",
"0.5955977",
"0.589495",
"0.5867696",
"0.5864332",
"0.58534425",
"0.5843041",
"0.5837097",
"0.5816... | 0.0 | -1 |
creates a MainThread object with attributes threadID, name, and running state | def __init__(self, threadID, name):
Thread.__init__(self)
self.threadID = threadID
self.name = name
self.window = MainWindow(None)
self.window.title("OpComms System IV Desktop Client") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, threadID, name, parent):\n\t\tThread.__init__(self)\n\t\tself.threadID = threadID\n\t\tself.name = name\n\t\tself.parent = parent\n\t\tself.out = queue.Queue()\n\n\t\tself.paused = True\n\t\tself.killed = False",
"def __init__(self, threadID, name, parent):\n\t\tThread.__init__(self)\n\t\tself... | [
"0.66082895",
"0.6566579",
"0.6103746",
"0.60274065",
"0.5874824",
"0.5867673",
"0.5819015",
"0.57838756",
"0.5749614",
"0.57245827",
"0.57206213",
"0.5665194",
"0.5641435",
"0.5621122",
"0.5577702",
"0.55678177",
"0.5562916",
"0.55504376",
"0.5480139",
"0.5409514",
"0.535950... | 0.66551983 | 0 |
creates a MessageThread object with attributes threadID, name, and running state | def __init__(self, threadID, name, parent):
Thread.__init__(self)
self.threadID = threadID
self.name = name
self.parent = parent
self.out = queue.Queue()
self.paused = True
self.killed = False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def create_thread(self, *content, **kwargs):\n name = kwargs.get('name')\n message = kwargs.get('message')\n if not name:\n raise TypeError('name is a required argument that is missing.')\n if not message and not content:\n raise TypeError('Must include messa... | [
"0.730866",
"0.6940065",
"0.6554311",
"0.62105256",
"0.6056624",
"0.5996912",
"0.58732146",
"0.5813934",
"0.57803005",
"0.576943",
"0.57468194",
"0.574365",
"0.5687982",
"0.5676704",
"0.5652166",
"0.5583179",
"0.55805045",
"0.55619234",
"0.55432403",
"0.5536569",
"0.5518572",... | 0.64269495 | 3 |
replacing dot surrounded square brackets with dot surrounded by spaces | def replace_dot(data):
data = re.sub("[.]", " . ", data)
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def escape_dot(s):\n\treturn s. \\\n\t\treplace(\"{\", \"\\\\{\").\\\n\t\treplace(\"}\", \"\\\\}\").\\\n\t\treplace(\"\\n\", \"\").\\\n\t\treplace(\"\\r\", \"\")",
"def replace_dots(filename):\n name = get_name_from_filename(filename)\n ext = get_extension_from_filename(filename)\n old, new = \".\", \" ... | [
"0.70834315",
"0.6570702",
"0.6555104",
"0.63227445",
"0.6299114",
"0.6271477",
"0.6126585",
"0.60470194",
"0.59950703",
"0.58877647",
"0.57587314",
"0.56974894",
"0.5677765",
"0.56715274",
"0.56649035",
"0.56329674",
"0.55436295",
"0.5506602",
"0.5417483",
"0.5377196",
"0.53... | 0.78181463 | 0 |
Dynamic sarch function that returns the first item in list where func(item) is True. | def find(func, list_seq):
for list_item in list_seq:
if func(list_item):
return list_item | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def finditem(func, seq):\n return next((item for item in seq if func(item)))",
"def return_first_item(func):\n\n # Define the wrapper function.\n def wrapper(self, *args, **kwargs):\n\n # Execute the decorated method with the provided arguments.\n result = func(self, *args, **kwargs)\n\n ... | [
"0.7394419",
"0.7277437",
"0.7006442",
"0.7002336",
"0.6949229",
"0.6814228",
"0.6799948",
"0.6765181",
"0.67093384",
"0.66964173",
"0.65369856",
"0.6535967",
"0.6526328",
"0.6524236",
"0.6507331",
"0.64476615",
"0.6420043",
"0.629425",
"0.629425",
"0.6278964",
"0.6019036",
... | 0.7101537 | 2 |
Given a sequence, this function should return a list of ngrams, where each ngram is a Python tuple. This should work for arbitrary values of 1 <= n < len(sequence). | def get_ngrams(sequence, n):
# Set prefix and postfix
prefix = "START"
postfix = "STOP"
# Append 1 prefix regardless of value of n
sequence.insert(0, prefix)
for i in range(n - 2) :
sequence.insert(0, prefix)
sequence.append(postfix)
# Check if 1 <= n <= len(sequence)
if (n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_ngrams(sequence, n):\n length = len(sequence)\n #if only require 1-gram, then we need to add one START and one END to the sequence. \n if n==1 or n==2:\n sequence=[\"START\"]*n+sequence+[\"STOP\"]\n end = n+1 #end i means that when n==1, we need to read one more data, that is to the... | [
"0.85974973",
"0.8311344",
"0.81443226",
"0.8081763",
"0.8033396",
"0.77599454",
"0.7690071",
"0.74221045",
"0.7383273",
"0.7370609",
"0.7300758",
"0.7277494",
"0.72621953",
"0.72605747",
"0.7251281",
"0.72374654",
"0.7211858",
"0.7207803",
"0.72011894",
"0.7150117",
"0.71498... | 0.8129707 | 3 |
Store the record to the collection. Async insert | def emit(self, record):
try:
record.created = datetime.fromtimestamp(record.created)
self._collection.insert_one(self.format(record))
except InvalidDocument as e:
logging.error("Unable to save log record: %s", e.message,
exc_info=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def insert(self, record, collection: str):\n db_record = await self.database[collection].insert_one(record.dict(exclude={'id'})) \n return record",
"def save(self, record):\n self.collection.insert(record)\n self.record = record\n\n return self",
"def insert(self):\n ... | [
"0.7204399",
"0.71294016",
"0.69999063",
"0.6777077",
"0.6766349",
"0.6617093",
"0.660267",
"0.660267",
"0.660267",
"0.65324557",
"0.64889383",
"0.64431226",
"0.63693964",
"0.6315872",
"0.6284576",
"0.61927414",
"0.61625874",
"0.61534274",
"0.61187947",
"0.610415",
"0.6099586... | 0.60705495 | 27 |
Computes the maximum of the absolute value of weights along the axis. | def max_abs_weights(x,
*,
axis = None):
abs_max_x = jnp.max(jnp.abs(x), axis=axis, keepdims=True)
return abs_max_x | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def absmax(self):\n raise NotImplementedError",
"def npmaxabs(arr: np.ndarray) -> float:\n return np.max(np.abs(arr))",
"def compare_max(values, weights):\n return np.max(values.numpy())",
"def abs_max(tensor):\n min_val, max_val = tensor.min(), tensor.max()\n return max(min_val.abs(), max... | [
"0.7344123",
"0.7276746",
"0.70640945",
"0.6989813",
"0.69824207",
"0.6816495",
"0.6760534",
"0.6720352",
"0.6548847",
"0.6545281",
"0.6545281",
"0.6544556",
"0.6544037",
"0.65207255",
"0.64946854",
"0.6485682",
"0.6462869",
"0.64537036",
"0.6399027",
"0.63534045",
"0.6351728... | 0.8440788 | 0 |
The ID of the region to which the disaster recovery site belongs. | def destination_region_id(self) -> pulumi.Input[str]:
return pulumi.get(self, "destination_region_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_id(self):\n return self._region_id",
"def region_id(self) -> str:\n return self._region_id",
"def cen_region_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"cen_region_id\")",
"def cen_region_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"cen_reg... | [
"0.82984614",
"0.8267928",
"0.74790233",
"0.7381154",
"0.73582983",
"0.73004425",
"0.72958887",
"0.7281946",
"0.72235215",
"0.72235215",
"0.72235215",
"0.72235215",
"0.72235215",
"0.72235215",
"0.7153409",
"0.7099484",
"0.7009604",
"0.7009604",
"0.6971082",
"0.69535637",
"0.6... | 0.7043348 | 16 |
The ID of the zone to which the disaster recovery site belongs. | def destination_zone_id(self) -> pulumi.Input[str]:
return pulumi.get(self, "destination_zone_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zon... | [
"0.85090685",
"0.85090685",
"0.85090685",
"0.85090685",
"0.85090685",
"0.8121567",
"0.80882436",
"0.8072766",
"0.8072766",
"0.8072766",
"0.8072766",
"0.80527264",
"0.80306095",
"0.7881317",
"0.7818607",
"0.7818607",
"0.7761701",
"0.7761701",
"0.7761701",
"0.7761701",
"0.77617... | 0.70965797 | 31 |
The ID of the region to which the production site belongs. | def source_region_id(self) -> pulumi.Input[str]:
return pulumi.get(self, "source_region_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_id(self) -> str:\n return self._region_id",
"def region_id(self):\n return self._region_id",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return p... | [
"0.81655294",
"0.81542003",
"0.74354404",
"0.74354404",
"0.74354404",
"0.74354404",
"0.74354404",
"0.74354404",
"0.7412194",
"0.73932964",
"0.7293291",
"0.72838306",
"0.7283172",
"0.72299236",
"0.71491444",
"0.71047604",
"0.71047604",
"0.71047604",
"0.71047604",
"0.7090598",
... | 0.68754995 | 29 |
The ID of the zone to which the production site belongs. | def source_zone_id(self) -> pulumi.Input[str]:
return pulumi.get(self, "source_zone_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zon... | [
"0.8467428",
"0.8467428",
"0.8467428",
"0.8467428",
"0.8467428",
"0.8143563",
"0.80288863",
"0.80288863",
"0.80288863",
"0.80288863",
"0.79312146",
"0.7909896",
"0.7754995",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7677578",
"0.7677578"... | 0.67194366 | 43 |
Consistent replication group name. | def group_name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")",
"def server_group_name(self) -> str:\n return pulumi.get(self, \"server_group_name\")",
"def get_group_name(self):\n return self.groupname",
"def group_name(self):\n\t\treturn \"DocumentChat-%s\" % self.id",
"def ... | [
"0.7933155",
"0.7735093",
"0.76396614",
"0.7613317",
"0.7592877",
"0.7551296",
"0.7516483",
"0.74923253",
"0.74923253",
"0.74154085",
"0.73908365",
"0.73908365",
"0.73554367",
"0.73538655",
"0.7329223",
"0.72777283",
"0.7219811",
"0.72131",
"0.71581364",
"0.7146304",
"0.71320... | 0.6985374 | 26 |
The ID of the region to which the disaster recovery site belongs. | def destination_region_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "destination_region_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_id(self):\n return self._region_id",
"def region_id(self) -> str:\n return self._region_id",
"def cen_region_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"cen_region_id\")",
"def cen_region_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"cen_reg... | [
"0.82984614",
"0.8267928",
"0.74790233",
"0.7381154",
"0.73582983",
"0.73004425",
"0.72958887",
"0.7281946",
"0.72235215",
"0.72235215",
"0.72235215",
"0.72235215",
"0.72235215",
"0.72235215",
"0.7153409",
"0.7099484",
"0.7043348",
"0.7009604",
"0.7009604",
"0.6971082",
"0.69... | 0.69535637 | 20 |
The ID of the zone to which the disaster recovery site belongs. | def destination_zone_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "destination_zone_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zon... | [
"0.85090685",
"0.85090685",
"0.85090685",
"0.85090685",
"0.85090685",
"0.8121567",
"0.80882436",
"0.8072766",
"0.8072766",
"0.8072766",
"0.8072766",
"0.80527264",
"0.80306095",
"0.7881317",
"0.7818607",
"0.7818607",
"0.7761701",
"0.7761701",
"0.7761701",
"0.7761701",
"0.77617... | 0.7011628 | 34 |
Consistent replication group name. | def group_name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")",
"def server_group_name(self) -> str:\n return pulumi.get(self, \"server_group_name\")",
"def get_group_name(self):\n return self.groupname",
"def group_name(self):\n\t\treturn \"DocumentChat-%s\" % self.id",
"def ... | [
"0.7933155",
"0.7735093",
"0.76396614",
"0.7613317",
"0.7592877",
"0.7551296",
"0.7516483",
"0.74923253",
"0.74923253",
"0.74154085",
"0.73908365",
"0.73908365",
"0.73554367",
"0.73538655",
"0.7329223",
"0.72777283",
"0.7219811",
"0.72131",
"0.71581364",
"0.7146304",
"0.71320... | 0.6985374 | 27 |
The ID of the region to which the production site belongs. | def source_region_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "source_region_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_id(self) -> str:\n return self._region_id",
"def region_id(self):\n return self._region_id",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return p... | [
"0.81655294",
"0.81542003",
"0.74354404",
"0.74354404",
"0.74354404",
"0.74354404",
"0.74354404",
"0.74354404",
"0.7412194",
"0.73932964",
"0.7293291",
"0.72838306",
"0.7283172",
"0.72299236",
"0.71491444",
"0.71047604",
"0.71047604",
"0.71047604",
"0.71047604",
"0.7090598",
... | 0.6794668 | 35 |
The ID of the zone to which the production site belongs. | def source_zone_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "source_zone_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zon... | [
"0.8467428",
"0.8467428",
"0.8467428",
"0.8467428",
"0.8467428",
"0.8143563",
"0.80288863",
"0.80288863",
"0.80288863",
"0.80288863",
"0.79312146",
"0.7909896",
"0.7754995",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7677578",
"0.7677578"... | 0.67046595 | 44 |
The ID of the region to which the disaster recovery site belongs. | def destination_region_id(self) -> pulumi.Output[str]:
return pulumi.get(self, "destination_region_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_id(self):\n return self._region_id",
"def region_id(self) -> str:\n return self._region_id",
"def cen_region_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"cen_region_id\")",
"def cen_region_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"cen_reg... | [
"0.82984614",
"0.8267928",
"0.74790233",
"0.7381154",
"0.73582983",
"0.73004425",
"0.7281946",
"0.72235215",
"0.72235215",
"0.72235215",
"0.72235215",
"0.72235215",
"0.72235215",
"0.7153409",
"0.7099484",
"0.7043348",
"0.7009604",
"0.7009604",
"0.6971082",
"0.69535637",
"0.69... | 0.72958887 | 6 |
The ID of the zone to which the disaster recovery site belongs. | def destination_zone_id(self) -> pulumi.Output[str]:
return pulumi.get(self, "destination_zone_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zon... | [
"0.85096675",
"0.85096675",
"0.85096675",
"0.85096675",
"0.85096675",
"0.8122231",
"0.8088714",
"0.80733925",
"0.80733925",
"0.80733925",
"0.80733925",
"0.80538684",
"0.80312735",
"0.788233",
"0.7819421",
"0.7819421",
"0.77624434",
"0.77624434",
"0.77624434",
"0.77624434",
"0... | 0.73546624 | 24 |
Consistent replication group name. | def group_name(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")",
"def server_group_name(self) -> str:\n return pulumi.get(self, \"server_group_name\")",
"def get_group_name(self):\n return self.groupname",
"def group_name(self):\n\t\treturn \"DocumentChat-%s\" % self.id",
"def ... | [
"0.7933155",
"0.7735093",
"0.76396614",
"0.7613317",
"0.7592877",
"0.7551296",
"0.7516483",
"0.74923253",
"0.74923253",
"0.74154085",
"0.73908365",
"0.73908365",
"0.73554367",
"0.7329223",
"0.72777283",
"0.7219811",
"0.72131",
"0.71581364",
"0.7146304",
"0.71320057",
"0.70532... | 0.73538655 | 13 |
The ID of the region to which the production site belongs. | def source_region_id(self) -> pulumi.Output[str]:
return pulumi.get(self, "source_region_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_id(self) -> str:\n return self._region_id",
"def region_id(self):\n return self._region_id",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return p... | [
"0.8167412",
"0.8155946",
"0.74367726",
"0.74367726",
"0.74367726",
"0.74367726",
"0.74367726",
"0.74367726",
"0.7414168",
"0.73944443",
"0.729511",
"0.7285465",
"0.7284187",
"0.71504843",
"0.71058524",
"0.71058524",
"0.71058524",
"0.71058524",
"0.70918024",
"0.69694847",
"0.... | 0.7231339 | 13 |
The ID of the zone to which the production site belongs. | def source_zone_id(self) -> pulumi.Output[str]:
return pulumi.get(self, "source_zone_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zone_id(self) -> str:\n return pulumi.get(self, \"zone_id\")",
"def zon... | [
"0.8467428",
"0.8467428",
"0.8467428",
"0.8467428",
"0.8467428",
"0.8143563",
"0.80288863",
"0.80288863",
"0.80288863",
"0.80288863",
"0.79312146",
"0.7909896",
"0.7754995",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7684146",
"0.7677578",
"0.7677578"... | 0.71066296 | 29 |
Return `User` object for the corresponding `user_id` | def load_user(user_id):
return Users.query.get(user_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_from_id(user_id):\n return Users.query.filter_by(id=user_id).first()",
"def get_user_by_id(user_id):\n\n return User.query.get(user_id)",
"def get_user_by_id(user_id):\n return User.query.get(user_id)",
"def get(self, user_id):\n return User.get(user_id)",
"def get_user... | [
"0.87559825",
"0.8600971",
"0.85578597",
"0.8499294",
"0.84741414",
"0.84741414",
"0.84741414",
"0.84741414",
"0.8436616",
"0.8332873",
"0.8284536",
"0.82838774",
"0.8251782",
"0.82112956",
"0.82112956",
"0.8204715",
"0.8186601",
"0.8185318",
"0.8165821",
"0.81409746",
"0.812... | 0.78143954 | 51 |
Returns a TFFeature of int64s. | def int64_feature(values):
if not isinstance(values, (tuple, list)):
values = [values]
return tf.train.Feature(int64_list=tf.train.Int64List(value=values)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int64_feature(value):\n return tf.train.Feature(int64_list=tf.train.Int64List(\n value=[int(v) for v in value]))",
"def _int64_feature(value):\n return tf.train.Feature(\n int64_list=tf.train.Int64List(value=[int(v) for v in value]))",
"def _int64_feature(value):\n return tf.train.Featu... | [
"0.688075",
"0.6862741",
"0.68326515",
"0.68326515",
"0.67430365",
"0.67394435",
"0.67394435",
"0.67394435",
"0.673107",
"0.67192674",
"0.67192674",
"0.67192674",
"0.67192674",
"0.67192674",
"0.67192674",
"0.6709931",
"0.6709931",
"0.6709931",
"0.6709931",
"0.67064357",
"0.66... | 0.66727054 | 20 |
Returns the status of the drone. | def getStatus(self, request, context):
statusDrone = str(self.vehicle.system_status).rpartition(':')[2]
return droneconnect_pb2.Status(status = statusDrone) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetStatus(self):\r\n return self.status",
"def get_status(self):\n return self.status",
"def get_status(self):\n return self.status",
"def get_status(self):\n return self.status",
"def getstatus(self):\n return self.__status",
"def get_status(self):\n return self... | [
"0.7703667",
"0.7640963",
"0.7640963",
"0.7640963",
"0.74732894",
"0.74485123",
"0.7446306",
"0.7385536",
"0.7378159",
"0.7378159",
"0.7378159",
"0.7378159",
"0.7378159",
"0.7378159",
"0.7378159",
"0.7378159",
"0.7378159",
"0.7378159",
"0.7378159",
"0.7378159",
"0.7378159",
... | 0.75574803 | 4 |
Returns the ground distance in metres between two LocationGlobal objects. This method is an approximation, and will not be accurate over large distances and close to the | def get_distance_metres(aLocation1, aLocation2):
dlat = aLocation2.lat - aLocation1.lat
dlong = aLocation2.lon - aLocation1.lon
return math.sqrt((dlat*dlat) + (dlong*dlong)) * 1.113195e5 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_distance_metres(aLocation1, aLocation2):\n dlat = aLocation2.lat - aLocation1.lat\n dlong = aLocation2.lon - aLocation1.lon\n return math.sqrt((dlat*dlat) + (dlong*dlong)) * 1.113195e5",
"def get_distance_metres(aLocation1, aLocation2):\n dlat = aLocation2.lat - aLocation1.lat\n dlong = aL... | [
"0.6617842",
"0.6617842",
"0.6617842",
"0.6617842",
"0.6617842",
"0.65892684",
"0.6560567",
"0.652038",
"0.6266742",
"0.6214332",
"0.6164589",
"0.61070013",
"0.606775",
"0.6046515",
"0.60020095",
"0.59448117",
"0.58561563",
"0.58524585",
"0.5799977",
"0.57406634",
"0.5704778"... | 0.658646 | 6 |
Computes raytarget distance error (signed). | def raydistance_error(motiontrajectory, ptstart, ptend):
assert len(motiontrajectory.shape) == 2
assert motiontrajectory.shape[1] == 2
mv = np.diff(motiontrajectory, axis=0) # motion vector
md = mv / np.linalg.norm(mv, axis=1)[:, np.newaxis] # motion direction
vgoal = (ptend - motiontrajector... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _calculate_error(self, targets):\n\n def hist(d):\n f, v = histogram(array(d))\n i = len(f) if argmax(f) == len(f) - 1 else argmax(f)\n return v[i]\n\n devxs, devys = list(zip(*[r.dev_centroid for r in targets]))\n\n if len(targets) > 2 and self.use_histogr... | [
"0.6628826",
"0.6597887",
"0.65147734",
"0.5993028",
"0.5834046",
"0.57699025",
"0.57500184",
"0.57492024",
"0.5733238",
"0.5722171",
"0.5544114",
"0.5516527",
"0.54841083",
"0.5470058",
"0.54671353",
"0.5422286",
"0.54147655",
"0.541331",
"0.5391581",
"0.5365913",
"0.535524"... | 0.6781174 | 0 |
Computes directional error for every time point. | def compute_trial_error(
motiontrajectory, times,
ptstart, ptend,
disturbancemode,
disturbancevalue,
disturbanceonsettime=None, # if none, reconstruct onset form the threshold ratio
disturbance_threshold=9.0):
assert len(motiontrajectory.shape) == 2
assert mot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def directional_error(motiontrajectory, ptstart, ptend):\n assert len(motiontrajectory.shape) == 2\n assert motiontrajectory.shape[1] == 2\n \n mv = np.diff(motiontrajectory, axis=0) # motion vector\n md = mv / np.linalg.norm(mv, axis=1)[:, np.newaxis] # motion direction\n vgoal = (ptend - moti... | [
"0.7234843",
"0.65465784",
"0.6515536",
"0.6483211",
"0.64557725",
"0.6205332",
"0.6194808",
"0.60606456",
"0.60562634",
"0.59962475",
"0.58858734",
"0.57368773",
"0.5734539",
"0.5732761",
"0.57061034",
"0.5704429",
"0.5701444",
"0.5684453",
"0.567966",
"0.5672363",
"0.566123... | 0.547526 | 38 |
Return the default profiler processing job (a rule) with a unique name. | def get_default_profiler_processing_job(instance_type=None, volume_size_in_gb=None):
default_rule = DetailedProfilerProcessingJobConfig()
custom_name = name_from_base(default_rule.rule_name)
return ProfilerRule.sagemaker(
default_rule,
name=custom_name,
instance_type=instance_type,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def jobName(self):\n return f\"{self.config.pipeline.name}-pypette\"[:12]",
"def getJobName(programPath=None):\n if programPath is None:\n return \"Bat_%d\" % os.getpid()\n else:\n return \"Bat_%s\" % (os.path.split(programPath)[1])",
"def name(self):\n return self._job",
"def j... | [
"0.63454264",
"0.6248222",
"0.6145511",
"0.5941044",
"0.59012073",
"0.589961",
"0.58114606",
"0.5775229",
"0.5774227",
"0.57245415",
"0.57245415",
"0.5687361",
"0.56229305",
"0.5599466",
"0.5586734",
"0.54964536",
"0.5440155",
"0.5430637",
"0.54028934",
"0.5387568",
"0.538169... | 0.7423895 | 0 |
Initialize a ``Rule`` object for a builtin debugging rule. | def sagemaker(
cls,
base_config,
name=None,
container_local_output_path=None,
s3_output_path=None,
other_trials_s3_input_paths=None,
rule_parameters=None,
collections_to_save=None,
actions=None,
):
merged_rule_params = {}
if ru... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(se... | [
"0.68905175",
"0.68905175",
"0.68905175",
"0.68905175",
"0.68905175",
"0.65694374",
"0.61744773",
"0.60006493",
"0.58970284",
"0.57832736",
"0.567995",
"0.5664033",
"0.5655786",
"0.56553686",
"0.56143886",
"0.5578432",
"0.5552469",
"0.5512899",
"0.5493921",
"0.54820335",
"0.5... | 0.0 | -1 |
Initialize a ``Rule`` object for a custom debugging rule. You can create a custom rule that analyzes tensors emitted during the training of a model and monitors conditions that are critical for the success of a training job. For more information, see `Create Debugger Custom Rules for Training Job Analysis | def custom(
cls,
name: str,
image_uri: Union[str, PipelineVariable],
instance_type: Union[str, PipelineVariable],
volume_size_in_gb: Union[int, PipelineVariable],
source: Optional[str] = None,
rule_to_invoke: Optional[Union[str, PipelineVariable]] = None,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(se... | [
"0.65211344",
"0.65211344",
"0.65211344",
"0.65211344",
"0.65211344",
"0.60647696",
"0.5863548",
"0.57502055",
"0.57025504",
"0.5580399",
"0.55004555",
"0.5453551",
"0.5391346",
"0.53888905",
"0.5321151",
"0.53156054",
"0.529613",
"0.52943116",
"0.52868265",
"0.52729607",
"0.... | 0.0 | -1 |
Initialize a ``ProfilerRule`` object for a builtin profiling rule. The rule analyzes system and framework metrics of a given training job to identify performance bottlenecks. | def sagemaker(
cls,
base_config,
name=None,
container_local_output_path=None,
s3_output_path=None,
instance_type=None,
volume_size_in_gb=None,
):
used_name = name or base_config.rule_name
if used_name.startswith("DetailedProfilerProcessingJobCo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def benchmark_profile(self):\n cb_bin = os.path.join(bin_path, 'compilebench')\n desc = \"benchmark\"\n test_name = \"compilebench_{0}\".format(to_safe_name(desc))\n test = TestProfile(\n name=test_name,\n desc=desc,\n test_path=self.test_path,\n ... | [
"0.58111393",
"0.54816806",
"0.5299381",
"0.5248985",
"0.5244924",
"0.51969767",
"0.5176213",
"0.51368123",
"0.51368123",
"0.51368123",
"0.51368123",
"0.51368123",
"0.51303405",
"0.5130136",
"0.5071168",
"0.50150687",
"0.49880642",
"0.49526647",
"0.49123028",
"0.4856964",
"0.... | 0.0 | -1 |
Initialize a ``ProfilerRule`` object for a custom profiling rule. You can create a rule that analyzes system and framework metrics emitted during the training of a model and monitors conditions that are critical for the success of a training job. | def custom(
cls,
name,
image_uri,
instance_type,
volume_size_in_gb,
source=None,
rule_to_invoke=None,
container_local_output_path=None,
s3_output_path=None,
rule_parameters=None,
):
merged_rule_params = super()._set_rule_paramet... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(self)\n self.__rule = rule",
"def __init__(self, rule):\n Rule.__init__(se... | [
"0.5745093",
"0.5745093",
"0.5745093",
"0.5745093",
"0.5745093",
"0.5360137",
"0.5358121",
"0.5334167",
"0.51945335",
"0.5148814",
"0.5103063",
"0.5053325",
"0.5022006",
"0.5009247",
"0.49889252",
"0.49834353",
"0.4966385",
"0.49576122",
"0.49575943",
"0.4952547",
"0.4933023"... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.