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 |
|---|---|---|---|---|---|---|
Turn the pin to low/off. | def turn_off(self, **kwargs):
_LOGGER.error("DALI TURN OFF")
self._state = False
url = self.urlx + '/toggle'
headers = {'x-ha-access': 'raspberry',
'content-type': 'application/json'}
response = get(url, headers=headers)
_LOGGER.error(response.text)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_off(self):\n self.set_pin(0, -1)\n self.set_pin(1, -1)\n self.set_pin(2, -1)",
"def turn_off(self):\n self._interrupt_flash()\n if self.on:\n GPIO.output(self.pin, GPIO.LOW)\n self.on = False",
"def light_off(self, pin='D13'):\n self.ligh... | [
"0.80316585",
"0.7946093",
"0.77970463",
"0.7686845",
"0.7652943",
"0.75224423",
"0.7519865",
"0.7333036",
"0.7307057",
"0.73027813",
"0.7237032",
"0.7235535",
"0.7052807",
"0.704091",
"0.7023609",
"0.70184636",
"0.70013076",
"0.69993037",
"0.69974446",
"0.6988674",
"0.698582... | 0.6390026 | 66 |
Calculte the FD value of point[pos] in left boundary, in which asymmetric FD scheme is used | def fd_pasym_head(self,pos):
value = 0.0
y = self.y
#print('point:%d' % pos)
for j in range(-pos, 0):
#print( " y[%d] - y[%d] * c[%d][%d] " % (pos+j, pos, pos, j) )
value = value + ( y[pos+j] - y[pos] ) * self.coef_asym[pos][j]
for j in range(1,self.order - pos+1):
#print( " y[%d] - y[%d] * c[%d][%d]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_fk(self, sigma, sigma_des, C, offset):\n if sigma >= sigma_des:\n # push robot away\n f = -((sigma - sigma_des) ** 2)/C + offset\n elif sigma < sigma_des:\n # pull robot in\n f = ((sigma - sigma_des) ** 2)/C + offset\n else:\n ... | [
"0.6438451",
"0.628076",
"0.5945176",
"0.59432834",
"0.57899934",
"0.5771594",
"0.57464105",
"0.5726062",
"0.57239544",
"0.5719862",
"0.56809855",
"0.56580704",
"0.55809176",
"0.5564975",
"0.5555088",
"0.55312455",
"0.552637",
"0.5511657",
"0.549678",
"0.5494884",
"0.5492041"... | 0.58204293 | 4 |
r"""Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. | def GetIamPolicy(self, request, global_params=None):
config = self.GetMethodConfig('GetIamPolicy')
return self._RunMethod(
config, request, global_params=global_params) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def policy(self) -> Optional[str]:\n return pulumi.get(self, \"policy\")",
"def GetPolicy(self, request, global_params=None):\n config = self.GetMethodConfig('GetPolicy')\n return self._RunMethod(\n config, request, global_params=global_params)",
"def policy(self) -> Optional[pulumi.I... | [
"0.640301",
"0.63286483",
"0.6309936",
"0.6309936",
"0.6295018",
"0.6246381",
"0.62400377",
"0.62400377",
"0.6232821",
"0.6223758",
"0.6179479",
"0.6175378",
"0.6175378",
"0.6175378",
"0.6169328",
"0.6141064",
"0.61235094",
"0.6117845",
"0.6114739",
"0.6114542",
"0.60892385",... | 0.0 | -1 |
Get the layer that is used for the cell's memory. | def layer(self):
return self._layer | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def layer(self):\n return self.GetLayer()",
"def layer( self ):\n return self._layer",
"def get_layer(self):\n return self._border",
"def get_layer(self, i):\n return self.layers[i]",
"def get_current_render_layer(scene):\r\n active_layer_index = scene.luxcore.active_layer_in... | [
"0.7126262",
"0.7027121",
"0.6664988",
"0.6577178",
"0.6491727",
"0.6468917",
"0.63259256",
"0.6236407",
"0.6210281",
"0.6202382",
"0.6194571",
"0.6179582",
"0.61726063",
"0.61161417",
"0.60862726",
"0.6063828",
"0.5982607",
"0.5978691",
"0.5934011",
"0.58874506",
"0.5877915"... | 0.70834863 | 1 |
Generate a batch of a random states. Similar to zero_state(), except that the result is nondeterministic. | def random_state(self, batch_size, dtype):
randoms = zip(*[self._layer.init_params(dtype=dtype)
for _ in range(batch_size)])
return tuple(map(tf.stack, randoms)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_random_states(states):\n return [torch.randn(w.size()) for k, w in states.items()]",
"def random_states(self, num_of_states):\n return numpy.random.choice([-1, 1], size=(num_of_states, ) + self.hilbert_state_shape)",
"def random_state(state):\n old_state = RandomState()\n state.set_glob... | [
"0.7513039",
"0.7096308",
"0.6849645",
"0.67768556",
"0.6751533",
"0.66992307",
"0.65681684",
"0.65230244",
"0.64810294",
"0.64668673",
"0.642381",
"0.6351716",
"0.634013",
"0.6307613",
"0.629759",
"0.6262389",
"0.6243682",
"0.6228847",
"0.6225089",
"0.62104297",
"0.62049717"... | 0.6854587 | 2 |
Helper to create a temp directory and clean it | def tempdir():
dirpath = tempfile.mkdtemp()
try:
yield dirpath
finally:
shutil.rmtree(dirpath) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tmp_dir():\n tmpdir = tempfile.mkdtemp()\n yield tmpdir\n shutil.rmtree(tmpdir)",
"def tempdir():\n\n # Create a directory and return the path\n return tempfile.mkdtemp()",
"def mktemp(self):\n newDir = tempfile.mkdtemp(dir=tempfile.gettempdir())\n self.addCleanup(shutil.rmtree... | [
"0.83871645",
"0.81844944",
"0.814895",
"0.811773",
"0.808722",
"0.8056758",
"0.80531925",
"0.8039697",
"0.80353504",
"0.8015798",
"0.80106664",
"0.79338",
"0.78873944",
"0.78817946",
"0.78798074",
"0.7856957",
"0.78442717",
"0.7841067",
"0.7835073",
"0.78239405",
"0.78105694... | 0.81134945 | 4 |
Create trainable weights for the attention matrix `W`, the bias vector `b`, and the "context vector" `u`. See equations (5) and (8) page 1482 from abovereferenced HAN paper. | def build(self, input_shape):
hidden_dim = input_shape[2]
self.W = self.add_weight(
name='{}_W'.format(self.name),
shape=(hidden_dim, hidden_dim,),
initializer='uniform',
trainable=True)
self.b = self.add_weight(
name='{}_b'.format(self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instantiate_weights(self):\n self.product_embeddings = tf.get_variable(\n name='product_embeddings',\n shape=[50000, 300],\n dtype=tf.float32\n )\n self.aisle_embeddings = tf.get_variable(\n name='aisle_embeddings',\n shape=[250, 50],\... | [
"0.67972434",
"0.6773988",
"0.6656601",
"0.6541126",
"0.6519107",
"0.6499815",
"0.6465545",
"0.6447873",
"0.63882357",
"0.63140273",
"0.6272218",
"0.62525225",
"0.61739886",
"0.6171724",
"0.6164531",
"0.61379296",
"0.61369973",
"0.61103857",
"0.60761195",
"0.60623735",
"0.606... | 0.59393585 | 32 |
Softmax computed with an optional mask | def softmax_masked(x, mask=None):
if mask is None:
sm = K.softmax(x)
else:
casted_mask = K.cast(mask, dtype=x.dtype)
# subtract min first so that, after masking, the masked elements are the smallest
z = (x - K.min(x, axis=1, keepdims=True)) * casted_mask
# Now subtract max of... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def softmax(x):\n # (n_samples, n_classes)\n if len(x.shape) == 2:\n row_max = np.max(x, axis=1)\n x -= row_max.reshape((x.shape[0], 1))\n x = np.exp(x)\n row_sum = np.sum(x, axis=1)\n x /= row_sum.reshape((x.shape[0], 1))\n # (n_samples, n_tasks, n_classes)\n elif len(x.shape) == 3:\n row_ma... | [
"0.72789204",
"0.7201535",
"0.7195611",
"0.71704304",
"0.7133485",
"0.71176416",
"0.7067893",
"0.7030348",
"0.70042354",
"0.7002102",
"0.6991075",
"0.6977732",
"0.69734037",
"0.69595504",
"0.6945912",
"0.6943218",
"0.69231313",
"0.6920353",
"0.69004697",
"0.6897743",
"0.68866... | 0.7307302 | 0 |
Load a JSON file to python dictionary. | def util_load_json(path):
with io.open(path, mode="r", encoding="utf-8") as f:
return json.loads(f.read()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dictionary_from_json_file(_json_file):\n with open(_json_file) as _f:\n _dict = json.load(_f)\n return _dict",
"def load_json(filename: str) -> Dict:\n \n with open(filename, 'r') as json_file:\n return json.load(json_file)",
"def json_load(path):\n with open(path) as f:\n ... | [
"0.850715",
"0.8452998",
"0.8383174",
"0.8364303",
"0.8301872",
"0.8257733",
"0.8143502",
"0.81237555",
"0.8115057",
"0.8104029",
"0.8101596",
"0.8035239",
"0.79901457",
"0.79641527",
"0.7828641",
"0.78281164",
"0.7825266",
"0.78160167",
"0.7753249",
"0.7753249",
"0.7751632",... | 0.75306064 | 42 |
Retrieve the humanreadable for object provision. | def object_provision_success_hr():
with open(os.path.join(TEST_DATA_DIRECTORY, "object_provision_success.md")) as f:
expected_hr_output = f.read()
return expected_hr_output | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_name(self, obj):\n return six.text_type(obj)",
"def get_str(self, obj):\n if self.pretty:\n return pprint.pformat(obj)\n else:\n return str(obj)",
"def to_short_string(self):\n return f'{self.name} - {self.resource_type}'",
"def __str__(self):\n ... | [
"0.63628525",
"0.6244717",
"0.61814266",
"0.6160012",
"0.6106587",
"0.6079266",
"0.60592484",
"0.6020866",
"0.6015048",
"0.6010466",
"0.59362614",
"0.5905936",
"0.59033483",
"0.5882117",
"0.58551717",
"0.5853971",
"0.58305943",
"0.58256245",
"0.58133245",
"0.58045936",
"0.578... | 0.0 | -1 |
Retrieve the humanreadable response for workloads list. | def workloads_list_success_hr():
with open(
os.path.join(TEST_DATA_DIRECTORY, "workloads_list_success_response_hr.md")
) as f:
expected_hr_output = f.read()
return expected_hr_output | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def workloads_list_success():\n return util_load_json(\n os.path.join(TEST_DATA_DIRECTORY, \"workloads_list_success_response.json\")\n )",
"def test_get_work_list(self):\n # Login as simple user\n self.authenticate(self.user)\n\n # Get works list\n response = self.client.... | [
"0.72525084",
"0.5950602",
"0.5837002",
"0.56452143",
"0.5630886",
"0.55151355",
"0.5513305",
"0.5489361",
"0.5448302",
"0.53902304",
"0.5382408",
"0.53737736",
"0.53682685",
"0.5359088",
"0.5301275",
"0.5301065",
"0.5286004",
"0.52766216",
"0.526421",
"0.52385604",
"0.523134... | 0.6332207 | 1 |
Retrieve the expected json response for enforcement mode update failure. | def enforcement_mode_failure_expected():
return util_load_json(
os.path.join(
TEST_DATA_DIRECTORY,
"enforcement_mode_update_failure_expected_response.json",
)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enforcement_mode_failure():\n return util_load_json(\n os.path.join(\n TEST_DATA_DIRECTORY, \"enforcement_mode_update_failure_response.json\"\n )\n )",
"def enforcement_mode_success():\n return util_load_json(\n os.path.join(\n TEST_DATA_DIRECTORY,\n ... | [
"0.81995344",
"0.7537273",
"0.648842",
"0.6332244",
"0.627828",
"0.62293833",
"0.616678",
"0.61460453",
"0.60884345",
"0.60880136",
"0.6059842",
"0.60178936",
"0.59800035",
"0.597177",
"0.5968831",
"0.5944907",
"0.5873574",
"0.5866615",
"0.58336955",
"0.58210063",
"0.58028233... | 0.78668946 | 1 |
Retrieve the humanreadable for rule create. | def rule_create_success_hr():
with open(os.path.join(TEST_DATA_DIRECTORY, "create_rule_success_hr.md")) as file:
hr_output = file.read()
return hr_output | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return \"{ %s }\" % str(self.__rule)",
"def __str__(self):\n return \"[ %s ]\" % str(self.__rule)",
"def __str__(self):\n return \"{ %s }1\" % str(self.__rule)",
"def rule(self) -> str:\n if self._rule:\n return self._rule\n return self._make... | [
"0.67963547",
"0.6788484",
"0.67810667",
"0.60754657",
"0.59458333",
"0.5945815",
"0.5945815",
"0.5945815",
"0.59041697",
"0.59041697",
"0.58311355",
"0.5822154",
"0.57718253",
"0.57261795",
"0.5701005",
"0.56852573",
"0.56718314",
"0.5612719",
"0.5601418",
"0.5577834",
"0.55... | 0.53775036 | 54 |
Test case scenario for execution of virtualservicecreatecommand when valid and all arguments are provided. | def test_virtual_service_create_command_for_success(
mock_client, virtual_service_create_success, monkeypatch
):
monkeypatch.setattr(
illumio.pce.PolicyComputeEngine._PCEObjectAPI,
"create",
lambda *a: VirtualService.from_json(virtual_service_create_success),
)
resp = virtual_ser... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_virtual_service_create_command_when_invalid_arguments_provided(\n err_msg, args, err_type, mock_client\n):\n with pytest.raises(err_type) as err:\n virtual_service_create_command(mock_client, args)\n assert str(err.value) == err_msg",
"def test_create_service_binding_when_blank_argum... | [
"0.68623406",
"0.66596854",
"0.65635973",
"0.6366084",
"0.6303426",
"0.6241544",
"0.6202749",
"0.6195039",
"0.60186183",
"0.59935635",
"0.59229076",
"0.59149957",
"0.59039104",
"0.5893756",
"0.5878508",
"0.58656853",
"0.5863631",
"0.58597064",
"0.58502877",
"0.58264786",
"0.5... | 0.5786621 | 20 |
Test case scenario for execution of virtualservicecreatecommand when valid and all arguments are provided. | def test_virtual_service_create_command_for_human_readable(
virtual_service_create_success, virtual_service_success_hr
):
resp = prepare_virtual_service_output(virtual_service_create_success)
assert resp == virtual_service_success_hr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_virtual_service_create_command_when_invalid_arguments_provided(\n err_msg, args, err_type, mock_client\n):\n with pytest.raises(err_type) as err:\n virtual_service_create_command(mock_client, args)\n assert str(err.value) == err_msg",
"def test_create_service_binding_when_blank_argum... | [
"0.68633395",
"0.6660614",
"0.65653574",
"0.6366843",
"0.62427604",
"0.62034357",
"0.61963147",
"0.60182893",
"0.599439",
"0.59239393",
"0.59154963",
"0.59040844",
"0.58950335",
"0.58796203",
"0.5865736",
"0.58644265",
"0.5861074",
"0.58516634",
"0.58277607",
"0.57880944",
"0... | 0.63042086 | 4 |
Test case scenario for execution of virtualservicecreatecommand when invalid argument provided. | def test_virtual_service_create_command_when_invalid_arguments_provided(
err_msg, args, err_type, mock_client
):
with pytest.raises(err_type) as err:
virtual_service_create_command(mock_client, args)
assert str(err.value) == err_msg | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_service_binding_when_blank_arguments_provided(\n err_msg, args, mock_client\n):\n with pytest.raises(Exception) as err:\n service_binding_create_command(mock_client, args)\n\n assert str(err.value) == err_msg",
"def test_error_creating_service(self):\n self.AnalyticsSer... | [
"0.73324776",
"0.67384547",
"0.67378217",
"0.67316264",
"0.6723336",
"0.6642578",
"0.6599235",
"0.65829116",
"0.6570646",
"0.6541894",
"0.6406768",
"0.63995993",
"0.63835704",
"0.6363146",
"0.6347831",
"0.6305097",
"0.6269647",
"0.6256696",
"0.6249497",
"0.61777425",
"0.61586... | 0.77544254 | 0 |
Test case scenario for successful execution of servicebindingcreatecommand. | def test_service_binding_create_command_for_human_readable(service_binding_success_hr):
create_service_binding_expected_resp_output = util_load_json(
os.path.join(
TEST_DATA_DIRECTORY, "create_service_binding_success_response_output.json"
)
)
response = prepare_service_binding_o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_binding_success():\n return util_load_json(\n os.path.join(TEST_DATA_DIRECTORY, \"create_service_binding_success_resp.json\")\n )",
"def test_service_binding_create_command_for_success(\n mock_client, service_binding_success, monkeypatch, service_binding_reference_success\n):\n mon... | [
"0.6989066",
"0.67997056",
"0.6626358",
"0.6329813",
"0.63070285",
"0.62055415",
"0.6015054",
"0.5995221",
"0.5956202",
"0.58443975",
"0.58267736",
"0.5799658",
"0.57370776",
"0.572833",
"0.57258075",
"0.5715969",
"0.57159305",
"0.56957144",
"0.5694465",
"0.5579825",
"0.55747... | 0.7374198 | 0 |
Test case scenario for execution of iplistgetcommand when invalid arguments are provided. | def test_ip_list_get_when_blank_arguments_provided(err_msg, args, mock_client):
with pytest.raises(Exception) as err:
ip_list_get_command(mock_client, args)
assert str(err.value) == err_msg | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_ip_lists_get_command_when_invalid_arguments_provided(\n err_msg, args, err_type, mock_client\n):\n from IllumioCore import ip_lists_get_command\n\n with pytest.raises(err_type) as err:\n ip_lists_get_command(mock_client, args)\n assert str(err.value) == err_msg",
"def test_invalid... | [
"0.77227026",
"0.69971925",
"0.6912796",
"0.68632257",
"0.6814845",
"0.6724352",
"0.6518258",
"0.6515232",
"0.6467805",
"0.64438546",
"0.6418485",
"0.6350435",
"0.63149434",
"0.63041013",
"0.62667465",
"0.61971545",
"0.61924493",
"0.6187058",
"0.6129619",
"0.61207694",
"0.611... | 0.8055833 | 0 |
Add copy of a book to the current login user | def post(self):
body = request.get_json()
username = body.get('user')
user = query_user_by_name(username)
if user is None:
return 'User does not exist', 404
if invalid_user(username):
return 'Unauthorized User', 401
book_id = body.get('book_id')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login_and_add_book(self):\n\t\t# create book\n\t\tadd_book = {\n\t\t\t'title': 'Hello Books',\n\t\t\t'isbn': '5698745124'\n\t\t}\n\n\t\tlogin_data = self.register_and_login_in_user()\n\t\ttoken = login_data['auth_token']\n\t\tres = self.client.post(\n\t\t\tf'{URL_BOOKS}',\n\t\t\theaders=dict(Authorization=f'Be... | [
"0.71586144",
"0.6808251",
"0.6575831",
"0.6468271",
"0.6176452",
"0.61478764",
"0.61348474",
"0.6131994",
"0.610988",
"0.60715586",
"0.5971617",
"0.5872657",
"0.5866024",
"0.58407193",
"0.5797716",
"0.5795217",
"0.5735135",
"0.5707612",
"0.5693633",
"0.56659067",
"0.56630886... | 0.6329282 | 4 |
Creates a new grid object. | def __init__(
self, rows, columns, header_row=False, header_column=False, style=''
):
self.rows = rows
self.columns = columns
self.header_row = header_row
self.header_column = header_column
self._id = _util.get_locally_unique_id()
self._style = style
super(Grid, self).__init__() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_grid(self):\n\n # If called when a grid already exists create a new grid\n if self.grid:\n self.grid = []\n\n grid_pen = QPen(QColor(215, 215, 215), 1)\n w = 10000\n h = 10000\n self.addLine(-10000, 0, 10000, 0, QPen(QColor(0, 0, 0), 2))\n self... | [
"0.7629969",
"0.7307449",
"0.71421134",
"0.6882858",
"0.68336123",
"0.68192756",
"0.6750904",
"0.67189705",
"0.668877",
"0.6659855",
"0.66591316",
"0.6631605",
"0.6602514",
"0.6599866",
"0.65906525",
"0.65796095",
"0.65389687",
"0.6459479",
"0.64506316",
"0.64275",
"0.6417132... | 0.6618308 | 12 |
draw box on image | def draw_box(img, box):
draw_img = img.copy()
cv2.polylines(draw_img, np.int32([box]), True, (255, 0, 0), 4)
show(draw_img) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _draw_single_box_on_image(self,box,label,id):\n p1 = (box[1], box[0])\n p2 = (box[3], box[2])\n if self.config.DISCO_MODE:\n color = random.choice(self.STANDARD_COLORS)\n else:\n color = self.STANDARD_COLORS[id]\n cv2.rectangle(self.image, p1, p2, color,... | [
"0.7973654",
"0.7885319",
"0.7877402",
"0.78306836",
"0.77795213",
"0.7675343",
"0.76074404",
"0.75936306",
"0.757549",
"0.7544039",
"0.75231785",
"0.75221074",
"0.75140613",
"0.7451806",
"0.7321973",
"0.72518003",
"0.724991",
"0.712579",
"0.7076809",
"0.7074483",
"0.69979995... | 0.80046266 | 0 |
The output shape of the batchnorm should be (None, nr_timesteps, nr_filters) | def test_cnn_batchnorm_dim(self):
model = modelgen.generate_CNN_model((None, 20, 3), 2, [32, 32], 100)
batchnormlay = model.layers[2]
assert batchnormlay.output_shape == (None, 20, 32) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_cnn_batchnorm_dim(self):\n model_type = CNN((None, 20, 3), 2)\n model = model_type.create_model(**{\"filters\": [32, 32],\n \"fc_hidden_nodes\": 100})\n\n batchnormlay = model.layers[2]\n assert batchnormlay.output_shape == (None, 20, 3... | [
"0.7170049",
"0.70639926",
"0.64937425",
"0.6474978",
"0.6445733",
"0.6427917",
"0.63735825",
"0.6368648",
"0.63580936",
"0.63469017",
"0.63227",
"0.63131726",
"0.6310409",
"0.63055235",
"0.6303537",
"0.62703",
"0.62560695",
"0.6213246",
"0.6201817",
"0.6143636",
"0.61007637"... | 0.7030568 | 2 |
The output shape of the batchnorm should be (None, nr_timesteps, nr_channels, nr_filters) | def test_deepconvlstm_batchnorm_dim(self):
model = modelgen.generate_DeepConvLSTM_model(
(None, 20, 3), 2, [32, 32], [32, 32])
batchnormlay = model.layers[3]
assert batchnormlay.output_shape == (None, 20, 3, 32) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_cnn_batchnorm_dim(self):\n model_type = CNN((None, 20, 3), 2)\n model = model_type.create_model(**{\"filters\": [32, 32],\n \"fc_hidden_nodes\": 100})\n\n batchnormlay = model.layers[2]\n assert batchnormlay.output_shape == (None, 20, 3... | [
"0.73158455",
"0.7286792",
"0.686023",
"0.6507115",
"0.6482312",
"0.641685",
"0.6408995",
"0.6394905",
"0.63825524",
"0.6297672",
"0.62683594",
"0.62612593",
"0.624451",
"0.6179781",
"0.6138038",
"0.6134277",
"0.61068785",
"0.6099154",
"0.6082081",
"0.60761374",
"0.6072374",
... | 0.6430981 | 5 |
Return the raw persisted user info object, or None if not "logged in" | def info(self) -> Optional[Dict[str, Any]]:
return self._state.get("info", None) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_info(self):\n return self.auth.get_user_by_session()",
"def user_info(self):\n \n return self.auth.get_user_by_session()",
"def GetUserInformation(self):\n if _USER_INFO_KEY in self._session:\n return self._session[_USER_INFO_KEY]\n return self._ReCreateUserInfo()",
"def ... | [
"0.7899015",
"0.7612346",
"0.7382615",
"0.7360011",
"0.72213954",
"0.715276",
"0.70767295",
"0.70375115",
"0.70077145",
"0.6978183",
"0.6978183",
"0.69671607",
"0.69626796",
"0.6957017",
"0.695615",
"0.69326353",
"0.6918795",
"0.6903266",
"0.68983036",
"0.6894509",
"0.6867093... | 0.0 | -1 |
Get the time stamp the login state was last saved at as a unix time code, or None if there was no saved state | def state_stamp(self) -> Optional[float]:
return self._appstate.state_stamp | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_state_time(self) -> str:\n return pulumi.get(self, \"last_state_time\")",
"def get_timestamp():\n return int(time.time())",
"def _get_timestamp():\n return str(int(time.time()))",
"def get_time() -> int:\n return store.time",
"def get_time_of_last_turn() -> int:\n return sto... | [
"0.6879874",
"0.6623887",
"0.6591582",
"0.6575216",
"0.6561874",
"0.64946145",
"0.6462648",
"0.6393259",
"0.63554895",
"0.63172716",
"0.6307094",
"0.6305699",
"0.6280989",
"0.62510806",
"0.6233712",
"0.6225585",
"0.6190283",
"0.61791515",
"0.61709535",
"0.6144552",
"0.6119487... | 0.6542602 | 5 |
Get the time stamp the login state was last saved at as a datetime in UTC, or None if there was no saved state | def state_datetime(self) -> Optional[datetime]:
return self._appstate.state_datetime | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_state_time(self) -> str:\n return pulumi.get(self, \"last_state_time\")",
"def lasttime(self):\n if hasattr(self, \"_lasttime\"):\n return self._lasttime\n else:\n return None",
"def last_updated_time_utc(self) -> Optional[pulumi.Input[str]]:\n return ... | [
"0.7133724",
"0.7003885",
"0.69596565",
"0.68114895",
"0.6811214",
"0.6778449",
"0.6680462",
"0.6672647",
"0.66486174",
"0.65888053",
"0.6562685",
"0.6562155",
"0.6562155",
"0.654445",
"0.65342855",
"0.6495738",
"0.6485539",
"0.64834714",
"0.6443717",
"0.64274883",
"0.6426226... | 0.6767642 | 6 |
The host AppState (corresponding to the folder where state files are stored) | def state_host(self) -> AppState:
return self._appstate.host | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def appstate(self) -> NamedAppState:\n return self._appstate",
"def _state_dir(self) -> Path:\n assert self._project_root is not None\n return Path(self._project_root, '.cache/bacloud')",
"def _state_data_path(self) -> Path:\n return Path(self._state_dir, 'state')",
"def get_state... | [
"0.72547126",
"0.68620235",
"0.6618846",
"0.63421553",
"0.6316474",
"0.621989",
"0.61307406",
"0.6073155",
"0.6026088",
"0.6012343",
"0.59345806",
"0.5830781",
"0.5816022",
"0.5786531",
"0.5771212",
"0.57640934",
"0.5702058",
"0.5679066",
"0.56623226",
"0.56623226",
"0.566232... | 0.7083798 | 1 |
Format/Beautify a JSON file. | def json_format(filename, indent=DEFAULT_INDENT_SIZE, **kwargs):
console = kwargs.get("console", logging.getLogger("console"))
encoding = kwargs.get("encoding", None)
dry_run = kwargs.get("dry_run", False)
if indent is None:
sort_keys = False
else:
sort_keys = True
message = "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reformat_json_file(infilename, outfilename, clobber=False):\n # open input json file\n with open(infilename) as json_file:\n json_string = json_file.read()\n json_data = json.loads(json_string)\n\n # see if output file already exists and determine course of action\n if os.path.exists(... | [
"0.73858976",
"0.7210946",
"0.71210015",
"0.67388135",
"0.67202884",
"0.66328174",
"0.6555727",
"0.6492695",
"0.6489918",
"0.6458252",
"0.64550006",
"0.644703",
"0.6434088",
"0.6405078",
"0.64045715",
"0.63997877",
"0.6398663",
"0.6380338",
"0.6376097",
"0.6376097",
"0.634849... | 0.750338 | 0 |
Format/Beautify a JSON file. | def json_formatall(filenames, indent=DEFAULT_INDENT_SIZE, dry_run=False):
errors = 0
console = logging.getLogger("console")
for filename in filenames:
try:
result = json_format(filename, indent=indent, console=console,
dry_run=dry_run)
if not ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def json_format(filename, indent=DEFAULT_INDENT_SIZE, **kwargs):\n console = kwargs.get(\"console\", logging.getLogger(\"console\"))\n encoding = kwargs.get(\"encoding\", None)\n dry_run = kwargs.get(\"dry_run\", False)\n if indent is None:\n sort_keys = False\n else:\n sort_keys = T... | [
"0.750338",
"0.73858976",
"0.7210946",
"0.71210015",
"0.67388135",
"0.67202884",
"0.66328174",
"0.6555727",
"0.6492695",
"0.6489918",
"0.6458252",
"0.64550006",
"0.644703",
"0.6434088",
"0.6405078",
"0.64045715",
"0.63997877",
"0.6398663",
"0.6380338",
"0.6376097",
"0.6376097... | 0.0 | -1 |
Setup our flask test app, this only gets executed once. | def app():
db_uri = '{0}_test'.format(settings.SQLALCHEMY_DATABASE_URI)
params = {
'DEBUG': False,
'TESTING': True,
'WTF_CSRF_ENABLED': False,
'SQLALCHEMY_DATABASE_URI': db_uri
}
_app = create_app(settings_override=params)
# Establish an application context before r... | {
"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 setUp(self):\n\n # Get the Flask test client\n self.client = app.test_client()\n\n # Show Flask errors... | [
"0.84288335",
"0.805143",
"0.805143",
"0.80450994",
"0.8024067",
"0.8014924",
"0.8012134",
"0.79947126",
"0.79078525",
"0.78592104",
"0.7854418",
"0.77523375",
"0.7732521",
"0.77270484",
"0.7688471",
"0.7646974",
"0.76466537",
"0.76466537",
"0.7638454",
"0.7627283",
"0.762680... | 0.72122014 | 56 |
Setup an app client, this gets executed for each test function. | def client(app):
yield app.test_client() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_up_client():\n #creating new flask app and a test client\n app = create_app('test')\n client = app.test_client()\n\n #creating the application context and\n #allowing test functions to run by calling test client\n #and finally cleaning house\n ctx = app.app_context()\n ctx.push()\n ... | [
"0.81311405",
"0.8118297",
"0.8017618",
"0.79712063",
"0.79712063",
"0.79712063",
"0.79712063",
"0.79712063",
"0.79712063",
"0.79712063",
"0.79712063",
"0.79712063",
"0.79610276",
"0.79062593",
"0.79062593",
"0.78820467",
"0.7873871",
"0.78696066",
"0.7869239",
"0.7771249",
"... | 0.7670471 | 24 |
Determines whether or not this filter is equal to the object that is passed in. obj the object to compare this one with. true if the filter matches this one. | def equals(self, obj: object) -> bool:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, obj):\r\n return assert_(self.obj == obj, '%r != %r' % (self.obj, obj))",
"def __eq__(self, obj):\n if not obj:\n return False\n\n return str(self.key()) == str(obj.key())",
"def __eq__(self, obj: \"Property\") -> bool:\n return self.name == obj.name and ... | [
"0.6263235",
"0.6259288",
"0.61521566",
"0.61425006",
"0.6082308",
"0.60813224",
"0.5983175",
"0.58762336",
"0.5866641",
"0.58407956",
"0.5833772",
"0.57078445",
"0.5647146",
"0.56408834",
"0.56178784",
"0.56178784",
"0.5578709",
"0.5569881",
"0.5538809",
"0.55373025",
"0.553... | 0.6941908 | 0 |
typeToName() returns the name of a predefined merge type. Only predefined types, as specified in ProgramMergeFilter, will return a name. Otherwise, an empty string is returned. type the type of merge difference whose name is wanted. | def typeToName(type: int) -> unicode:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_type_name(type_):\n # type: (type) -> str\n name = repr(type_)\n if name.startswith(\"<\"):\n name = getattr(type_, \"__qualname__\", getattr(type_, \"__name__\", \"\"))\n return name.rsplit(\".\", 1)[-1] or repr(type_)",
"def _get_type_name(self, st_type):\n if st_type <= 244:... | [
"0.6613858",
"0.6412084",
"0.6362737",
"0.63255835",
"0.625548",
"0.62409055",
"0.62185127",
"0.6215204",
"0.6191406",
"0.61318237",
"0.6058004",
"0.60353166",
"0.60258776",
"0.60129327",
"0.5993243",
"0.5893031",
"0.5884042",
"0.5824946",
"0.58245486",
"0.5817961",
"0.579156... | 0.652772 | 1 |
Initialize an Allocation data model instance. | def __init__(self, dao):
RAMSTKDataModel.__init__(self, dao)
# Initialize private dictionary attributes.
# Initialize private list attributes.
# Initialize private scalar attributes.
# Initialize public dictionary attributes.
# Initialize public list attributes.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, memory_size, batch_size, alpha):\n self.tree = sum_tree.SumTree(memory_size)\n self.memory_size = memory_size\n self.batch_size = batch_size\n self.alpha = alpha",
"def __init__(self):\n self.model = None\n self.joined_datasets = None\n self.id_... | [
"0.62976867",
"0.628852",
"0.60603577",
"0.60145473",
"0.6001329",
"0.6000122",
"0.5999795",
"0.59058565",
"0.5840203",
"0.5837262",
"0.58168787",
"0.58164024",
"0.5813925",
"0.5804042",
"0.5803147",
"0.57985777",
"0.57814074",
"0.57676804",
"0.57612044",
"0.57518905",
"0.574... | 0.58214825 | 10 |
Get list of valid statuses. | def status_enum(self):
return self.valid_statuses() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def available_statuses(self):\n return self.pipeline.get(self.status, ())",
"def available_statuses(self):\n return self.pipeline.get(self.status, ())",
"def valid_statuses(self):\n return [\n \"dish_maintenance\",\n \"dish_ok\",\n \"RF_maintenance\",\n ... | [
"0.7495914",
"0.7495914",
"0.7432835",
"0.70941466",
"0.69846505",
"0.6759446",
"0.6741484",
"0.6612966",
"0.659707",
"0.65730226",
"0.6564691",
"0.6564691",
"0.65500057",
"0.6357309",
"0.63396454",
"0.633388",
"0.6316126",
"0.6300359",
"0.62240094",
"0.62006605",
"0.61991817... | 0.72706026 | 3 |
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes. | def add_header(r):
r.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
r.headers["Pragma"] = "no-cache"
r.headers["Expires"] = "0"
r.headers['Cache-Control'] = 'public, max-age=0'
return r | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response",
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m... | [
"0.8221727",
"0.8220911",
"0.8220911",
"0.8220911",
"0.8220911",
"0.81940746",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
"0.8161616",
... | 0.7126684 | 52 |
Make a copy of the given seed and then shuffle the cells in the seed. The new shuffled seed will have the same dimensions and the same density of 1s and 0s as the given seed, but the locations of the 1s and 0s will be different. (There is a very small probability that shuffling might not result in any change, just as s... | def shuffle(self):
#
shuffled_seed = copy.deepcopy(self)
#
# for each location [x0][y0], randomly choose another location
# [x1][y1] and swap the values of the cells in the two locations.
#
for x0 in range(self.xspan):
for y0 in range(self.yspan):
x1 = rand.randrange(s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shuffle(self, seed=0):\n if isinstance(seed, numbers.Integral): # also allow for np.int8(n) and the like\n if seed != -1:\n if seed == 0:\n random.seed()\n else:\n random.seed(seed)\n random.shuffle(self.idxs)\n ... | [
"0.70846015",
"0.6473684",
"0.6456202",
"0.6380643",
"0.63726234",
"0.6346158",
"0.6314321",
"0.6305366",
"0.6242642",
"0.6242642",
"0.62065405",
"0.62064785",
"0.62023556",
"0.6165149",
"0.6144792",
"0.6132608",
"0.611198",
"0.60842264",
"0.60840344",
"0.6078485",
"0.6055898... | 0.7536539 | 0 |
Calculate the density of ones in a seed. | def density(self):
return self.count_ones() / float(self.xspan * self.yspan) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def density(self):\n return self.nnz / self.size",
"def density(self):\n return self.nnz/self.dim",
"def mask_density(mask):\n return get_number_of_unpruned_weights(mask).float() / get_number_of_weights(mask).float()",
"def probability_density(self, X):\n raise NotImplementedError",
... | [
"0.66832596",
"0.65374804",
"0.6480395",
"0.6246515",
"0.6171471",
"0.6171101",
"0.611859",
"0.60701853",
"0.60014653",
"0.59577864",
"0.5950641",
"0.5945021",
"0.59352106",
"0.5930767",
"0.5924668",
"0.5916315",
"0.5915407",
"0.59144235",
"0.58692515",
"0.5855669",
"0.584629... | 0.7188862 | 0 |
Convert dictionaries to strings | def _str_converter(self, code):
return """{}""".format(code) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _dict_to_string(self, dictionary):\n st = ''\n for i in range(len(dictionary)):\n st = st + dictionary[i]\n return st",
"def get_dict_str(d: dict) -> str:\n\treturn str({str(u): str(v) for u, v in d.items()})",
"def dict_2_string(d):\n buff = io.StringIO()\n print_dict... | [
"0.8349118",
"0.8235896",
"0.7898089",
"0.77462065",
"0.7543955",
"0.7541095",
"0.75002915",
"0.74359995",
"0.73949105",
"0.72595274",
"0.72369593",
"0.7185629",
"0.7154453",
"0.7140561",
"0.7025522",
"0.7001714",
"0.6995815",
"0.69844276",
"0.6900927",
"0.6858781",
"0.681005... | 0.0 | -1 |
Test endpoint access invalid `uid` and `token` fails. | def test_endpoint_access_fail(self):
url = reverse('users:activate-from-email', args=(1, 1))
res = self.client.get(url)
self.assertEqual(res.status_code, status.HTTP_503_SERVICE_UNAVAILABLE) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_fail_token(client, request):\n res = client.get('/token?uid=1')\n\n assert res.status_code == 400\n assert 'User does not exist' in res.data.decode('utf-8')",
"def test_get_non_valid_token(self):\r\n\r\n user = UserFactory.create_batch(2)[1]\r\n res = self.app.get('/api/token/non-... | [
"0.7979331",
"0.74125904",
"0.7019884",
"0.6913863",
"0.6839228",
"0.68267584",
"0.67539835",
"0.67149204",
"0.66990286",
"0.6672646",
"0.66653",
"0.66465753",
"0.66429234",
"0.6630233",
"0.662363",
"0.66161627",
"0.6605471",
"0.6599737",
"0.65971214",
"0.65884465",
"0.654213... | 0.6300543 | 51 |
Given two labels this returns a pair of a data matrix and a y vector, where lPos features have +1 and lNeg features have 1. Features that do not have one of these two labels will not be included. | def getTrainData(self, lNeg, lPos):
# Convert the given labels to label numbers...
if lNeg in self.labelToNum:
ln = self.labelToNum[lNeg]
else:
ln = -1
if lPos in self.labelToNum:
lp = self.labelToNum[lPos]
else:
lp = -1
# Go through the blocks and extract the relevant i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_and_generate_labels(X_pos, X_neg):\r\n X_pos = np.asarray(X_pos, dtype=np.float32)\r\n print(\"X_pos: \", X_pos.shape)\r\n X_pos = X_pos.reshape((X_pos.shape[0], -1))\r\n\r\n X_neg = np.asarray(X_neg, dtype=np.float32)\r\n print(\"X_neg: \", X_neg.shape)\r\n X_neg = X_neg.reshape((X_neg... | [
"0.6965727",
"0.69143885",
"0.6388012",
"0.632314",
"0.6306446",
"0.6304071",
"0.6224717",
"0.61976516",
"0.6147345",
"0.6111708",
"0.6082727",
"0.6066967",
"0.6066831",
"0.5952913",
"0.59486574",
"0.59474397",
"0.5941935",
"0.5767825",
"0.57640886",
"0.5742065",
"0.5713552",... | 0.57348627 | 20 |
Create batch of decoder hidden states given a list of new states. | def create_batch_states(
self,
new_states: List[
Union[
List[Dict[str, Optional[torch.Tensor]]],
List[List[torch.Tensor]],
Tuple[torch.Tensor, Optional[torch.Tensor]],
],
],
) -> Union[
List[Dict[str, torch.Tenso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build(self, unused_input_shapes):\n self.layers = []\n for i in range(self.num_hidden_layers):\n self.layers.append(\n TransformerDecoderBlock(\n hidden_size=self.hidden_size,\n num_attention_heads=self.num_attention_heads,\n intermediate_size=self.int... | [
"0.64061993",
"0.6091314",
"0.6082939",
"0.59834677",
"0.59160805",
"0.5873423",
"0.586568",
"0.5856704",
"0.582744",
"0.582744",
"0.582744",
"0.57796085",
"0.5733037",
"0.5702138",
"0.5625633",
"0.55734247",
"0.55703056",
"0.55572844",
"0.55319226",
"0.5523144",
"0.5520766",... | 0.6854059 | 0 |
get_current_zone_plex_id() Retrieve the plex id of the current zone. | def get_current_zone_plex_id() -> int:
from services import get_plex_service
return get_plex_service().get_active_zone_plex_id() or 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_plex_id(zone_id: int) -> int:\n plex_service = services.get_plex_service()\n if zone_id not in plex_service._zone_to_master_map:\n return 0\n (_, plex_id) = plex_service._zone_to_master_map[zone_id]\n return plex_id",
"def get_plex_id_for_zone(zone: Zone) -> int:\n ... | [
"0.79059505",
"0.72109234",
"0.6748341",
"0.631738",
"0.631738",
"0.631738",
"0.631738",
"0.625917",
"0.625917",
"0.625917",
"0.625917",
"0.625917",
"0.6227145",
"0.61555976",
"0.6036364",
"0.6019165",
"0.60099334",
"0.60099334",
"0.60099334",
"0.60099334",
"0.60099334",
"0... | 0.89258975 | 0 |
get_plex_id_for_zone(zone) Retrieve the plex id for a Zone. | def get_plex_id_for_zone(zone: Zone) -> int:
zone_id = CommonLocationUtils.get_zone_id(zone)
return CommonLocationUtils.get_plex_id(zone_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_plex_id(zone_id: int) -> int:\n plex_service = services.get_plex_service()\n if zone_id not in plex_service._zone_to_master_map:\n return 0\n (_, plex_id) = plex_service._zone_to_master_map[zone_id]\n return plex_id",
"def get_zone_id(zone: Zone) -> int:\n re... | [
"0.8263622",
"0.71382886",
"0.68095875",
"0.62249553",
"0.6208806",
"0.6208806",
"0.6208806",
"0.6208806",
"0.6189392",
"0.6189392",
"0.61106384",
"0.60380435",
"0.60380435",
"0.60380435",
"0.60380435",
"0.60380435",
"0.60380435",
"0.6028034",
"0.6028034",
"0.6028034",
"0.602... | 0.90433246 | 0 |
get_plex_id(zone_id) Retrieve the plex id of a Zone. | def get_plex_id(zone_id: int) -> int:
plex_service = services.get_plex_service()
if zone_id not in plex_service._zone_to_master_map:
return 0
(_, plex_id) = plex_service._zone_to_master_map[zone_id]
return plex_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_plex_id_for_zone(zone: Zone) -> int:\n zone_id = CommonLocationUtils.get_zone_id(zone)\n return CommonLocationUtils.get_plex_id(zone_id)",
"def get_current_zone_plex_id() -> int:\n from services import get_plex_service\n return get_plex_service().get_active_zone_plex_id() or 0... | [
"0.8300803",
"0.70409524",
"0.6605837",
"0.6156578",
"0.61235076",
"0.61235076",
"0.61235076",
"0.61235076",
"0.6048142",
"0.60144347",
"0.6005134",
"0.6005134",
"0.6005134",
"0.6005134",
"0.6005134",
"0.59901756",
"0.59901756",
"0.59460574",
"0.59199715",
"0.5915228",
"0.591... | 0.8705815 | 0 |
get_block_id_in_current_zone(position, level) Retrieve the decimal identifier of the block containing the position. | def get_block_id_in_current_zone(position: CommonVector3, surface_level: int) -> int:
return CommonLocationUtils.get_block_id(CommonLocationUtils.get_current_zone_id(), position, surface_level) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_block_id(zone_id: int, position: CommonVector3, surface_level: int) -> int:\n return build_buy.get_block_id(zone_id, position, surface_level)",
"def get_block_id(self):\n return self._block_id",
"def _get_block(self, pos):\n return _get_mc().getBlock(pos)",
"def get_all_block_ids... | [
"0.81812286",
"0.61448497",
"0.5975192",
"0.5829732",
"0.58143246",
"0.5810112",
"0.5734445",
"0.5595565",
"0.5555376",
"0.5540459",
"0.55289465",
"0.5516834",
"0.55009115",
"0.5436285",
"0.543245",
"0.543245",
"0.543245",
"0.543245",
"0.543245",
"0.5357072",
"0.5357072",
"... | 0.87042564 | 0 |
get_block_id(zone_id, position, surface_level) Retrieve the decimal identifier of the block containing the position. | def get_block_id(zone_id: int, position: CommonVector3, surface_level: int) -> int:
return build_buy.get_block_id(zone_id, position, surface_level) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_block_id_in_current_zone(position: CommonVector3, surface_level: int) -> int:\n return CommonLocationUtils.get_block_id(CommonLocationUtils.get_current_zone_id(), position, surface_level)",
"def get_block_id(self):\n return self._block_id",
"def _get_block_from_structure(self, structure, ... | [
"0.8680601",
"0.63782233",
"0.5979768",
"0.5891491",
"0.57915664",
"0.56913036",
"0.55681074",
"0.5532242",
"0.5446087",
"0.54119074",
"0.53891015",
"0.5353094",
"0.5351028",
"0.53402776",
"0.53124785",
"0.52720934",
"0.5257526",
"0.5254379",
"0.52284384",
"0.5221697",
"0.520... | 0.90732616 | 0 |
get_current_zone() Retrieve the current zone. | def get_current_zone() -> Zone:
return services.current_zone() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_current_zone_id() -> int:\n return services.current_zone_id()",
"def local_zone():\n return get_localzone()",
"def zone(self) -> str:\n return pulumi.get(self, \"zone\")",
"def zone(self) -> str:\n return pulumi.get(self, \"zone\")",
"def zone(self):\n return self... | [
"0.7957104",
"0.76730645",
"0.7587967",
"0.7587967",
"0.7500078",
"0.74197364",
"0.7209196",
"0.70474654",
"0.70474654",
"0.6929436",
"0.6830919",
"0.67775255",
"0.67383987",
"0.66984814",
"0.66502297",
"0.6625353",
"0.66169715",
"0.660578",
"0.660578",
"0.660578",
"0.660578"... | 0.887062 | 0 |
get_current_zone_id() Retrieve the current zone id. | def get_current_zone_id() -> int:
return services.current_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.807132",
"0.807132",
"0.807132",
"0.807132",
"0.807132",
"0.78833294",
"0.7839841",
"0.7829708",
"0.780376",
"0.7801405",
"0.7801405",
"0.7801405",
"0.7801405",
"0.7617896",
"0.7436741",
"0.7436741",
"0.7436741",
"0.7436741",
"0.7436741",
"0.7436741",
"0.73929995",
"0.73... | 0.9035179 | 0 |
get_current_lot_id() Retrieve the decimal identifier of the current Lot. | def get_current_lot_id() -> int:
return services.active_lot_id() or -1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_current_lot() -> Lot:\n return services.active_lot()",
"def get_lot_id(lot: Lot) -> int:\n if lot is None:\n return -1\n return lot.lot_id",
"def _http_get_current_id(self):\n return self._http_request('').json()['currentplid']",
"def getId(self):\n retur... | [
"0.76781046",
"0.7128079",
"0.6463846",
"0.5997988",
"0.5761112",
"0.56205964",
"0.5602054",
"0.557035",
"0.55628484",
"0.55475867",
"0.5538145",
"0.5454778",
"0.5439524",
"0.54173243",
"0.5412431",
"0.5411615",
"0.54107136",
"0.5405197",
"0.5397853",
"0.53905815",
"0.5390234... | 0.85730654 | 0 |
is_position_on_current_lot(position) Determine if a sim is on the current lot. | def is_position_on_current_lot(position: CommonVector3) -> bool:
return position is not None and services.active_lot().is_position_on_lot(position) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_position_on_lot(position: CommonVector3, lot: Lot) -> bool:\n return position is not None and lot.is_position_on_lot(position)",
"def has_current_location(self):\n return self.location_set.current_location is not None",
"def is_location_outside_current_lot(location: CommonLocation) -> bool... | [
"0.7793426",
"0.64080423",
"0.6146074",
"0.61004645",
"0.60982203",
"0.60601926",
"0.5979206",
"0.59581435",
"0.58079964",
"0.5762173",
"0.5730456",
"0.572303",
"0.56833273",
"0.5641122",
"0.56034774",
"0.55250806",
"0.55091155",
"0.54717916",
"0.5461277",
"0.54329145",
"0.53... | 0.88774896 | 0 |
get_lot_traits(lot_id) Retrieve the Lot Traits of a Lot with the specified identifier. | def get_lot_traits(zone_id: int) -> Tuple[ZoneModifier]:
return tuple(services.get_zone_modifier_service().get_zone_modifiers(zone_id)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_lot_has_trait(lot_trait_id: int) -> bool:\n return CommonLocationUtils.current_lot_has_all_traits((lot_trait_id,))",
"def get_lot_traits_of_current_lot() -> Tuple[ZoneModifier]:\n return CommonLocationUtils.get_lot_traits(CommonLocationUtils.get_current_zone_id())",
"def get_traits_by... | [
"0.628994",
"0.60440475",
"0.50752026",
"0.5060594",
"0.47399738",
"0.46874145",
"0.46763676",
"0.46576455",
"0.45534682",
"0.45526797",
"0.45227844",
"0.45120382",
"0.4486146",
"0.44799536",
"0.43895265",
"0.43701735",
"0.43076542",
"0.43014383",
"0.42980558",
"0.4249404",
"... | 0.64298177 | 0 |
current_lot_has_all_traits(lot_trait_ids) Determine if the Current Lot has all of the specified Lot Traits. | def current_lot_has_all_traits(lot_trait_ids: Tuple[int]) -> bool:
current_lot_trait_ids = [getattr(current_lot_trait, 'guid64', None) for current_lot_trait in CommonLocationUtils.get_lot_traits_of_current_lot()]
if len(current_lot_trait_ids) == 0:
return False
for lot_trait_id in lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_lot_has_any_traits(lot_trait_ids: Tuple[int]) -> bool:\n current_lot_trait_ids = [getattr(current_lot_trait, 'guid64', None) for current_lot_trait in CommonLocationUtils.get_lot_traits_of_current_lot()]\n for lot_trait_id in lot_trait_ids:\n if lot_trait_id in current_lot_trait... | [
"0.806986",
"0.72907716",
"0.53570944",
"0.50164527",
"0.48939648",
"0.48908615",
"0.48456126",
"0.4787882",
"0.476508",
"0.46679705",
"0.46623847",
"0.46187234",
"0.46019912",
"0.46019912",
"0.45669824",
"0.45538765",
"0.45234713",
"0.4509857",
"0.4495354",
"0.44729212",
"0.... | 0.8679414 | 0 |
get_current_venue_type() Retrieve the type of the current venue. | def get_current_venue_type() -> VenueTypes:
return build_buy.get_current_venue(CommonLocationUtils.get_current_zone_id()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_venue_of_current_lot() -> Venue:\n return CommonResourceUtils.load_instance(Types.VENUE, CommonLocationUtils.get_current_venue_type())",
"def get_type(self):\n return self.event_type",
"def get_type (self):\n return self._stype",
"def type(self) -> str:\n return self._even... | [
"0.6208833",
"0.6010218",
"0.56467634",
"0.55973893",
"0.5585273",
"0.5585273",
"0.5549157",
"0.5549157",
"0.55409974",
"0.5535127",
"0.5529839",
"0.5529839",
"0.5507129",
"0.5489949",
"0.54157174",
"0.5402936",
"0.539096",
"0.5388431",
"0.53806347",
"0.5379987",
"0.5374156",... | 0.8860081 | 0 |
is_position_on_lot(position, lot) Determine if a Position is located on a Lot. | def is_position_on_lot(position: CommonVector3, lot: Lot) -> bool:
return position is not None and lot.is_position_on_lot(position) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_position_on_current_lot(position: CommonVector3) -> bool:\n return position is not None and services.active_lot().is_position_on_lot(position)",
"def is_location_outside_current_lot(location: CommonLocation) -> bool:\n return CommonLocationUtils.is_location_outside_lot(location, CommonLocati... | [
"0.74858004",
"0.55267054",
"0.5422456",
"0.5397289",
"0.5373981",
"0.5332166",
"0.5258159",
"0.52489614",
"0.52395165",
"0.52011424",
"0.5191376",
"0.51909816",
"0.51867115",
"0.51555556",
"0.5123081",
"0.5089714",
"0.50538963",
"0.502179",
"0.50196755",
"0.50156784",
"0.498... | 0.90610784 | 0 |
get_current_zone_world_id() Retrieve the world id of the current Zone. | def get_current_zone_world_id() -> int:
return CommonLocationUtils.get_zone_world_id(CommonLocationUtils.get_current_zone_id()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_zone_world_id(zone_id: int) -> int:\n return services.get_persistence_service().get_world_id_from_zone(zone_id)",
"def get_current_zone_world_description_id() -> int:\n return CommonLocationUtils.get_zone_world_description_id(CommonLocationUtils.get_current_zone_id())",
"def get_current_z... | [
"0.8122771",
"0.7737908",
"0.7049975",
"0.6525568",
"0.6525568",
"0.6525568",
"0.6525568",
"0.6525568",
"0.6482431",
"0.6474592",
"0.6384735",
"0.6380912",
"0.6380912",
"0.6380912",
"0.6380912",
"0.628735",
"0.62012726",
"0.6084933",
"0.5989302",
"0.59891075",
"0.59891075",
... | 0.9081573 | 0 |
get_current_zone_world_description_id() Retrieve the world description id of the current Zone. | def get_current_zone_world_description_id() -> int:
return CommonLocationUtils.get_zone_world_description_id(CommonLocationUtils.get_current_zone_id()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_zone_world_description_id(zone_id: int) -> int:\n return services.get_world_description_id(CommonLocationUtils.get_zone_world_id(zone_id))",
"def get_current_zone_world_id() -> int:\n return CommonLocationUtils.get_zone_world_id(CommonLocationUtils.get_current_zone_id())",
"def get_zone_w... | [
"0.8469447",
"0.74412537",
"0.6930639",
"0.59589475",
"0.5916581",
"0.5916581",
"0.5916581",
"0.5916581",
"0.5909352",
"0.5909352",
"0.5909352",
"0.5909352",
"0.5909352",
"0.56789875",
"0.5653768",
"0.56330895",
"0.5627472",
"0.55613554",
"0.5554403",
"0.5440486",
"0.5439679"... | 0.92239577 | 0 |
get_zone_world_id(zone_id) Retrieve the world id of the a Zone. | def get_zone_world_id(zone_id: int) -> int:
return services.get_persistence_service().get_world_id_from_zone(zone_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_zone_world_description_id(zone_id: int) -> int:\n return services.get_world_description_id(CommonLocationUtils.get_zone_world_id(zone_id))",
"def get_current_zone_world_id() -> int:\n return CommonLocationUtils.get_zone_world_id(CommonLocationUtils.get_current_zone_id())",
"def get_zone_i... | [
"0.7407384",
"0.7174606",
"0.7155925",
"0.65946025",
"0.63860744",
"0.6328335",
"0.6328335",
"0.6328335",
"0.6328335",
"0.6328335",
"0.6281885",
"0.6281885",
"0.6281885",
"0.6281885",
"0.6270713",
"0.6253646",
"0.6211172",
"0.6140011",
"0.6136426",
"0.61270624",
"0.6118044",
... | 0.9146884 | 0 |
get_zone_world_description_id(zone_id) Retrieve the world description id of the a Zone. | def get_zone_world_description_id(zone_id: int) -> int:
return services.get_world_description_id(CommonLocationUtils.get_zone_world_id(zone_id)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_current_zone_world_description_id() -> int:\n return CommonLocationUtils.get_zone_world_description_id(CommonLocationUtils.get_current_zone_id())",
"def get_zone_world_id(zone_id: int) -> int:\n return services.get_persistence_service().get_world_id_from_zone(zone_id)",
"def get_zone_id(z... | [
"0.7726652",
"0.77062154",
"0.6466728",
"0.6095813",
"0.5930577",
"0.5930577",
"0.5930577",
"0.5930577",
"0.59284854",
"0.5827772",
"0.58157116",
"0.58157116",
"0.58157116",
"0.58157116",
"0.58157116",
"0.58042884",
"0.5707568",
"0.56452507",
"0.56077045",
"0.5573461",
"0.551... | 0.92481786 | 0 |
Returns a dictionarylike object containing all the columns properties of the specified `model` class. | def _get_columns(model):
return {c.key: c for c in _get_mapper(model).iterate_properties
if isinstance(c, ColumnProperty)} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize(model):\n # first we get the names of all the columns on your model\n columns = [c.key for c in class_mapper(model.__class__).columns]\n # then we return their values in a dict\n return dict((c, getattr(model, c)) for c in columns)",
"def serialize(model):\n # first we get the names ... | [
"0.7323938",
"0.7323938",
"0.7323938",
"0.6866386",
"0.6819382",
"0.6737417",
"0.6565742",
"0.6553126",
"0.647206",
"0.647206",
"0.647206",
"0.647206",
"0.6447859",
"0.64460367",
"0.64460367",
"0.64460367",
"0.64460367",
"0.64460367",
"0.64025253",
"0.6392586",
"0.63680696",
... | 0.79494375 | 0 |
Delete a collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. | def delete_collection(self, bucket_id, collection_id, **kwargs):
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.delete_collection_with_http_info(bucket_id, collection_id, **kwargs)
else:
(data) = self.delete_collection_with_http_info(bucket... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_collection(self, collection_name: str):\n return self.http.collections_api.update_collections(\n storage_operations=StorageOperationsAnyOf2(\n delete_collection=collection_name\n )\n )",
"def delete(self, collection_id, **kwargs):\n kwargs['_re... | [
"0.73902166",
"0.72649336",
"0.7228781",
"0.682885",
"0.67966485",
"0.6784657",
"0.66895825",
"0.66052836",
"0.6289791",
"0.6271328",
"0.62697726",
"0.62267435",
"0.6224826",
"0.6207615",
"0.61212915",
"0.61210287",
"0.60918427",
"0.6079721",
"0.6011482",
"0.5986952",
"0.5968... | 0.60155725 | 18 |
Delete a collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. | def delete_collection_with_http_info(self, bucket_id, collection_id, **kwargs):
all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'fields']
all_params.append('callback')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_collection(self, collection_name: str):\n return self.http.collections_api.update_collections(\n storage_operations=StorageOperationsAnyOf2(\n delete_collection=collection_name\n )\n )",
"def delete(self, collection_id, **kwargs):\n kwargs['_re... | [
"0.73877585",
"0.72627366",
"0.72268814",
"0.67957675",
"0.6784596",
"0.66875285",
"0.66048604",
"0.62904644",
"0.6270123",
"0.62692034",
"0.62262356",
"0.6224728",
"0.6206705",
"0.61218786",
"0.61180973",
"0.60881275",
"0.6077091",
"0.60121375",
"0.60114616",
"0.59843594",
"... | 0.68283486 | 3 |
Delete a group. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. | def delete_group(self, bucket_id, group_id, **kwargs):
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.delete_group_with_http_info(bucket_id, group_id, **kwargs)
else:
(data) = self.delete_group_with_http_info(bucket_id, group_id, **kwargs)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_group(self, group_name):\r\n params = {'GroupName' : group_name}\r\n return self.get_response('DeleteGroup', params)",
"def delete_group(self, group_id):\n url = self.groups_url + \"/%s\" % group_id\n return requests.delete(url, headers=self.headers)",
"def delete_group(s... | [
"0.822755",
"0.8159283",
"0.8016138",
"0.7882289",
"0.7774973",
"0.7734542",
"0.7704395",
"0.7690937",
"0.7623602",
"0.7563062",
"0.7544578",
"0.75321084",
"0.74963456",
"0.7483457",
"0.7418888",
"0.7267857",
"0.72360975",
"0.7223503",
"0.72114384",
"0.7197457",
"0.71150595",... | 0.74448025 | 14 |
Delete a group. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. | def delete_group_with_http_info(self, bucket_id, group_id, **kwargs):
all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match', 'fields']
all_params.append('callback')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_group(self, group_name):\r\n params = {'GroupName' : group_name}\r\n return self.get_response('DeleteGroup', params)",
"def delete_group(self, group_id):\n url = self.groups_url + \"/%s\" % group_id\n return requests.delete(url, headers=self.headers)",
"def delete_group(s... | [
"0.8225153",
"0.8157203",
"0.80140257",
"0.77729404",
"0.77318186",
"0.77016336",
"0.76893926",
"0.762258",
"0.7561885",
"0.75422883",
"0.7528128",
"0.7494092",
"0.74810594",
"0.7443909",
"0.7415993",
"0.7265743",
"0.72353804",
"0.72202647",
"0.720908",
"0.7194117",
"0.711240... | 0.7882206 | 3 |
Modify an existing group. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. | def patch_group(self, bucket_id, group_id, group, **kwargs):
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.patch_group_with_http_info(bucket_id, group_id, group, **kwargs)
else:
(data) = self.patch_group_with_http_info(bucket_id, group_id,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ModifyGroup(self, group, reason=None, **kwargs):\n query = []\n _AppendReason(query, reason)\n\n return self._SendRequest(HTTP_PUT,\n (\"/%s/groups/%s/modify\" %\n (GANETI_RAPI_VERSION, group)), query, kwargs)",
"def update_group():\n _id =... | [
"0.78009075",
"0.7630886",
"0.7440576",
"0.7391666",
"0.7362028",
"0.73317546",
"0.7091353",
"0.7049765",
"0.69960296",
"0.68246895",
"0.6795817",
"0.6720059",
"0.6672128",
"0.6589066",
"0.6588412",
"0.65377295",
"0.650428",
"0.6461618",
"0.6441009",
"0.64289284",
"0.6386583"... | 0.66311824 | 13 |
Modify an existing group. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. | def patch_group_with_http_info(self, bucket_id, group_id, group, **kwargs):
all_params = ['bucket_id', 'group_id', 'group', 'if_match', 'if_none_match', 'fields']
all_params.append('callback')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ModifyGroup(self, group, reason=None, **kwargs):\n query = []\n _AppendReason(query, reason)\n\n return self._SendRequest(HTTP_PUT,\n (\"/%s/groups/%s/modify\" %\n (GANETI_RAPI_VERSION, group)), query, kwargs)",
"def update_group():\n _id =... | [
"0.77993214",
"0.762801",
"0.74388176",
"0.7390263",
"0.7359374",
"0.73290074",
"0.7090447",
"0.7047063",
"0.699209",
"0.6821285",
"0.67169976",
"0.6667505",
"0.6629657",
"0.65861243",
"0.65859985",
"0.65366274",
"0.6501965",
"0.64586836",
"0.64373",
"0.64287",
"0.63854635",
... | 0.6791838 | 10 |
Update a group. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. | def update_group(self, bucket_id, group_id, group, **kwargs):
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.update_group_with_http_info(bucket_id, group_id, group, **kwargs)
else:
(data) = self.update_group_with_http_info(bucket_id, group_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_group(self, group_id, **kwargs):\n post_body = json.dumps({'group': kwargs})\n resp, body = self.patch('groups/%s' % group_id, post_body)\n self.expected_success(200, resp.status)\n body = json.loads(body)\n return rest_client.ResponseBody(resp, body)",
"def group_up... | [
"0.8130147",
"0.8025697",
"0.79763883",
"0.7820258",
"0.7644497",
"0.74936885",
"0.74889785",
"0.73996276",
"0.73540974",
"0.71529466",
"0.7107474",
"0.70325387",
"0.6966613",
"0.68966925",
"0.6853346",
"0.6582608",
"0.64963007",
"0.6481964",
"0.6414075",
"0.6370509",
"0.6322... | 0.7909404 | 3 |
Update a group. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. | def update_group_with_http_info(self, bucket_id, group_id, group, **kwargs):
all_params = ['bucket_id', 'group_id', 'group', 'if_match', 'if_none_match', 'fields']
all_params.append('callback')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_group(self, group_id, **kwargs):\n post_body = json.dumps({'group': kwargs})\n resp, body = self.patch('groups/%s' % group_id, post_body)\n self.expected_success(200, resp.status)\n body = json.loads(body)\n return rest_client.ResponseBody(resp, body)",
"def group_up... | [
"0.8132495",
"0.80290335",
"0.7979395",
"0.79090506",
"0.7645788",
"0.7494438",
"0.749208",
"0.7403594",
"0.7355763",
"0.715457",
"0.711067",
"0.70355225",
"0.69700384",
"0.69017524",
"0.68567014",
"0.65840495",
"0.64983827",
"0.64848834",
"0.64143854",
"0.6374142",
"0.632439... | 0.7823278 | 4 |
Get IAM Policy request. | def GetIamPolicy(task_ref):
get_iam_policy_req = dataplex_api.GetMessageModule().DataplexProjectsLocationsLakesTasksGetIamPolicyRequest(
resource=task_ref.RelativeName()
)
return dataplex_api.GetClientInstance().projects_locations_lakes_tasks.GetIamPolicy(
get_iam_policy_req
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetPolicy(self, request, global_params=None):\n config = self.GetMethodConfig('GetPolicy')\n return self._RunMethod(\n config, request, global_params=global_params)",
"def get_iam_policy(\n self,\n ) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]:\n #... | [
"0.7521018",
"0.7244735",
"0.7244735",
"0.68981344",
"0.6841711",
"0.6841711",
"0.67839354",
"0.67711675",
"0.67711675",
"0.67711675",
"0.6762114",
"0.6762114",
"0.6716755",
"0.6680649",
"0.6661408",
"0.66367954",
"0.6611776",
"0.6591175",
"0.65762836",
"0.65719587",
"0.65683... | 0.0 | -1 |
Add IAM policy binding request. | def AddIamPolicyBinding(task_ref, member, role):
policy = GetIamPolicy(task_ref)
iam_util.AddBindingToIamPolicy(
dataplex_api.GetMessageModule().GoogleIamV1Binding, policy, member, role
)
return SetIamPolicy(task_ref, policy) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddIamPolicyBinding(asset_ref, member, role):\n policy = GetIamPolicy(asset_ref)\n iam_util.AddBindingToIamPolicy(\n dataplex_api.GetMessageModule().GoogleIamV1Binding, policy, member, role)\n return SetIamPolicy(asset_ref, policy)",
"def create_policy_binding(self, body, **kwargs):\n\n all_pa... | [
"0.6528111",
"0.6250034",
"0.6218016",
"0.61798275",
"0.6158761",
"0.59556127",
"0.592268",
"0.5879903",
"0.58151335",
"0.58151335",
"0.57771933",
"0.5658714",
"0.5642751",
"0.56243944",
"0.5529512",
"0.54940563",
"0.54604834",
"0.54514277",
"0.54169565",
"0.53544635",
"0.533... | 0.61170816 | 5 |
Convert a CompoundCamera object to a Cheetah h5 pixel map. The CompoundCamera must be the a (4,8,185,388) shape representing a CSPAD cheetah can only understand CSPAD geometries. | def to_cheetah_file(self, filename):
translate.write_cheetah(self, filename)
return | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_pixel_map_COCO_type(element: np.ndarray) -> Dict:\n p = maskUtils.encode(np.asfortranarray(element).astype(np.uint8))\n return p",
"def build_camera_info(attributes):\n camera_info = CameraInfo()\n # store info without header\n camera_info.header.frame_id = \"velodyne\"\n ca... | [
"0.5206007",
"0.51947725",
"0.51641196",
"0.51489097",
"0.5129875",
"0.5126132",
"0.51010346",
"0.5090856",
"0.50430167",
"0.5000608",
"0.49627444",
"0.49521497",
"0.49412954",
"0.4911694",
"0.4911694",
"0.4896498",
"0.4895649",
"0.489321",
"0.487297",
"0.4871121",
"0.4862077... | 0.0 | -1 |
Returns the minimum value of the tree | def min(self):
return self.root.leftmost | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peek_min(self):\n if self.root:\n return self.root.min().value\n raise ValueError(\"cannot perform peek_min on an empty tree\")",
"def get_min(self):\n\t\tif self.left:\n\t\t\treturn self.left.get_min()\n\t\treturn self.value",
"def get_min(self):\n if not self:\n ... | [
"0.86566764",
"0.8591249",
"0.84068096",
"0.83914924",
"0.8391411",
"0.83159083",
"0.81251055",
"0.7992393",
"0.7935127",
"0.7886748",
"0.787235",
"0.78687066",
"0.78545004",
"0.7844223",
"0.78293157",
"0.7809387",
"0.77360797",
"0.76854753",
"0.76672167",
"0.76672167",
"0.76... | 0.7499191 | 25 |
Returns the maximum value of the tree | def max(self):
return self.root.rightmost | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_maximum_value(self):\n if self.root: \n self.max_val = self.root.value\n else:\n return 'No tree found'\n def inner(root):\n if root.left:\n inner(root.left)\n\n if root.right:\n inner(root.right)\n\n if self.max_val < root.value:\n self.max_val = roo... | [
"0.89828146",
"0.8905391",
"0.85722023",
"0.85629547",
"0.8470545",
"0.8433439",
"0.8316199",
"0.8268486",
"0.8193513",
"0.81535554",
"0.81135267",
"0.8072291",
"0.8012554",
"0.79781044",
"0.7970367",
"0.79393303",
"0.7893216",
"0.7868273",
"0.77913827",
"0.7713181",
"0.77007... | 0.7485022 | 28 |
Parses the vm's XML to return just the mac address as a string | def mac_from_vm(vm: libvirt.virDomain = None) -> str:
doc = minidom.parseString(vm.XMLDesc())
interfaces = doc.getElementsByTagName('mac')
return interfaces[0].getAttribute('address') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_mac_address(self, result, host):\n if \"mac\" in result['scan'][host][\"addresses\"]:\n return result['scan'][host][\"addresses\"][\"mac\"]\n else:\n return \"\"",
"def get_mac_address(self):\n\t\treturn call_sdk_function('PrlVmDevNet_GetMacAddress', self.handle)",
"... | [
"0.67457503",
"0.6343735",
"0.6235948",
"0.62052613",
"0.6189928",
"0.61830455",
"0.6155982",
"0.61030704",
"0.600678",
"0.60052574",
"0.5912135",
"0.58938605",
"0.58617115",
"0.5853533",
"0.5819747",
"0.58083963",
"0.57866204",
"0.57866204",
"0.5780958",
"0.5754513",
"0.5751... | 0.8033576 | 0 |
Return the severity color code as a list of RGB values. | def color_rgb(self):
return tuple(int(self.color[i : i + 2], 16) for i in (0, 2, 4)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def colors(self):\n\t\treturn [(0, 30, 255),(0, 30, 120)]",
"def getColors():\n return ['#8c99fc', '#cacefd', '#fff1d7', '#feda98', '#fda85a', '#fc6647']",
"def getColor(self,number):\n if number >= 0:\n if self.inverse:\n ret = cs.hsv_to_rgb(0,0,abs(number/self.maxp))\n else:\n r... | [
"0.72988135",
"0.69976026",
"0.6864234",
"0.683223",
"0.6688133",
"0.66509646",
"0.6620192",
"0.6620192",
"0.65852064",
"0.65826684",
"0.65826523",
"0.653455",
"0.65093434",
"0.64758974",
"0.6435971",
"0.64219594",
"0.6415876",
"0.6408188",
"0.6407682",
"0.6405482",
"0.640164... | 0.66628164 | 5 |
Return the severity color code as a list of hexadecimal. | def color_hex(self):
n = 2
return tuple(
hex(int(self.color[i : i + n], 16)) for i in range(0, len(self.color), n)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hex_colors(cls):\n return ['#{:02x}{:02x}{:02x}'.format(*cls._COLORS[s])\n for s in cls._STATES]",
"def colors(self):\n\t\treturn [(0, 30, 255),(0, 30, 120)]",
"def getColors():\n return ['#8c99fc', '#cacefd', '#fff1d7', '#feda98', '#fda85a', '#fc6647']",
"def get_color_data(self... | [
"0.6682066",
"0.65473986",
"0.65112936",
"0.6439164",
"0.63295966",
"0.62589115",
"0.6257781",
"0.62101775",
"0.6185344",
"0.61844784",
"0.6159732",
"0.6083937",
"0.6064616",
"0.6064616",
"0.6060073",
"0.6037633",
"0.60257983",
"0.6012793",
"0.60090137",
"0.6008983",
"0.59639... | 0.65943146 | 1 |
Merge two clusters together and shuffle data points | def prepare(self):
A = np.append(self.a1, self.a2, axis=0)
b = np.append(self.b1, self.b2, axis=0)
A, b = shuffle(A, b, random_state=0)
return A, b | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def combine_cluster_from_to(cl1, cl2):\n for node_id in clusters[cl1]:\n nodes[node_id] = cl2\n clusters[cl2].append(node_id)\n clusters.pop(cl1)",
"def _merge_clusters(self, cl1, cl2):\n label = ''\n to_delete = ''\n if cl1 < cl2:\n label = cl1... | [
"0.6878953",
"0.6630963",
"0.6603613",
"0.6458217",
"0.63411653",
"0.60349107",
"0.59860694",
"0.5969316",
"0.5939699",
"0.5928853",
"0.5925194",
"0.5899908",
"0.5883713",
"0.5816686",
"0.5794167",
"0.57889664",
"0.5784298",
"0.57836425",
"0.5779654",
"0.5761986",
"0.5761986"... | 0.528567 | 91 |
Show the scatter of two clusters | def show_scatter(self):
plt.scatter(self.a1[:, 0], self.a1[:, 1], c="red", alpha=0.5, s=10)
plt.scatter(self.a2[:, 0], self.a2[:, 1], c="blue", alpha=0.5, s=10)
plt.scatter(0, 0, marker="D", c="black", alpha=0.8)
plt.scatter(2, 2, marker="D", c="black", alpha=0.8)
plt.show() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scatter_plot(group1, group2):\n plt.scatter(group1, group2)\n plt.show()",
"def plot_clusters(ax, component1, component2, df, name):\n\n # Plot input data onto first two components at given axes\n y_colors = sns.color_palette('hls', len(np.unique(df['y'])))\n c_colors = sns.color_palette('hls'... | [
"0.7267227",
"0.71044856",
"0.70592934",
"0.69652903",
"0.69095",
"0.6861453",
"0.6857553",
"0.67343366",
"0.67027974",
"0.6653685",
"0.65977365",
"0.659231",
"0.6589431",
"0.6547689",
"0.65258867",
"0.6520667",
"0.6493751",
"0.6482379",
"0.64447504",
"0.64294875",
"0.6410003... | 0.7180687 | 1 |
Gets package and OS information for a single OS | def get_package_os(fixes):
packages = []
if fixes.get('packages') is None or fixes.get('os') is None:
return packages
for package in fixes['packages']:
packages.append({"name": package['name'], 'version': package['version'],
'release': package['release'], 'os_name': fixes['os']['name'],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_os_info(hass: HomeAssistant) -> dict[str, Any] | None:\n return hass.data.get(DATA_OS_INFO)",
"def parse_os_info(self):\n pipe = subprocess.Popen([self.core_exe, '-o'], 0, None, None, subprocess.PIPE)\n lines = pipe.stdout.readlines()\n x = 0\n json_str = ''\n while ... | [
"0.7777131",
"0.72845274",
"0.71370924",
"0.6911061",
"0.68983614",
"0.6895821",
"0.6825771",
"0.673507",
"0.6733606",
"0.6727741",
"0.66971666",
"0.6688006",
"0.6687894",
"0.6648661",
"0.66430396",
"0.66193604",
"0.6611778",
"0.6590302",
"0.65656817",
"0.65596426",
"0.653994... | 0.6749589 | 7 |
Return the new model to be trained. The model will contain the `data_augmentation` layer to reduce overfitting. | def get_model(imgsize: ImageSize, classes_count: int) -> keras.Model:
data_augmentation = keras.Sequential(
[
layers.experimental.preprocessing.RandomFlip("horizontal", input_shape=(imgsize.height, imgsize.width, 3)),
layers.experimental.preprocessing.RandomRotation(0.1),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_original_model():\n model = Sequential()\n model.add(Embedding(max_features,\n embedding_dims,\n input_length=maxlen))\n model.add(Dropout(0.2))\n model.add(Conv1D(filters,\n kernel_size,\n padding='valid',... | [
"0.6876495",
"0.6511109",
"0.64640474",
"0.6360676",
"0.63055176",
"0.6293428",
"0.624854",
"0.6239176",
"0.6233263",
"0.6227688",
"0.6217629",
"0.6185703",
"0.6129408",
"0.60758996",
"0.60594976",
"0.6045541",
"0.6041023",
"0.594086",
"0.59311795",
"0.59213597",
"0.5911578",... | 0.64579993 | 3 |
Check if http_urlsplit validates scheme. | def test_check_http_url_split_validation():
with pytest.raises(ValueError):
http_urlsplit('https://aaa.cz')
with pytest.raises(ValueError):
http_urlsplit('ftp://ddd.cz') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _urlparse_splitscheme(url):\r\n # The scheme is valid only if it contains these characters.\r\n scheme_chars = \\\r\n \"abcdefghijklmnopqrstuvwxyz0123456789+-.\"\r\n\r\n scheme = \"\"\r\n rest = url\r\n\r\n spart = url.split(\":\", 1)\r\n if len(spart) == 2:\r\n\r\n # Normalize the scheme.\r\n s... | [
"0.73603594",
"0.73498774",
"0.73201174",
"0.7288844",
"0.7261334",
"0.7199318",
"0.7102915",
"0.70989996",
"0.70252347",
"0.69826406",
"0.69254917",
"0.689444",
"0.68165946",
"0.67890465",
"0.67890465",
"0.6766569",
"0.6724019",
"0.66934127",
"0.66926396",
"0.6683227",
"0.66... | 0.72606075 | 5 |
Sets the Batch Image Order archive name. | def set_batch_archive_name(self, archive_name):
self._basket.set_batch_archive_name(archive_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_archive_name(self, archive_name):\n self._basket.set_archive_name(archive_name)",
"def archive_name(self, archive_name):\n\n self._archive_name = archive_name",
"def change_image_name(self, name):\n self.image.name = name",
"def image_name(self, image_name: str):\n\n self.... | [
"0.7539247",
"0.7433239",
"0.6423878",
"0.6280286",
"0.61773443",
"0.5856597",
"0.57379955",
"0.5703637",
"0.5673109",
"0.56302947",
"0.5574008",
"0.5531783",
"0.55063117",
"0.55062187",
"0.5500449",
"0.5500449",
"0.5500449",
"0.5500449",
"0.54909104",
"0.5481367",
"0.5473442... | 0.78911555 | 0 |
Load graphs from gml files. | def _preprocess_graphs(self, X: List[ig.Graph]):
# initialize
node_features = []
adj_mat = []
n_nodes = []
# Iterate across graphs and load initial node features
for graph in X:
if not 'label' in graph.vs.attribute_names():
graph.vs['label'] =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_graph(self, path):\n if path.split('.')[-1]=='gexf':\n self.graph = nx.read_gexf(path)\n else:\n self.graph = nx.read_gpickle(path)",
"def load_graph(self, filename):\n try:\n file_extention = list(filename.split(\".\"))[-1]\n if file_exte... | [
"0.7465299",
"0.7434942",
"0.7230763",
"0.7193848",
"0.70390224",
"0.6798788",
"0.66384006",
"0.64025086",
"0.63996094",
"0.6323842",
"0.63210505",
"0.63210505",
"0.63126075",
"0.62223655",
"0.62205863",
"0.61839",
"0.617893",
"0.6178025",
"0.61739576",
"0.6149579",
"0.613021... | 0.0 | -1 |
Sets the reply_request of this SendMmsRequest. | def reply_request(self, reply_request):
if reply_request is None:
raise ValueError("Invalid value for `reply_request`, must not be `None`") # noqa: E501
self._reply_request = reply_request | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reply_to(self, reply_to):\n\n self._reply_to = reply_to",
"def set_reply(msg):\n \n result = Message(msg.content, correlation_id=msg.correlation_id ) \n return result",
"def _set_request(self, request):\n self._request = request",
"def reply(self, comment=None):\n ... | [
"0.62746906",
"0.5732463",
"0.53872806",
"0.5311535",
"0.5289871",
"0.52832884",
"0.52832884",
"0.52832884",
"0.5215264",
"0.51990014",
"0.51845187",
"0.514634",
"0.50458634",
"0.49902204",
"0.49240556",
"0.4917538",
"0.48980576",
"0.4880476",
"0.48757765",
"0.48600683",
"0.4... | 0.7873583 | 0 |
Sets the notify_url of this SendMmsRequest. | def notify_url(self, notify_url):
self._notify_url = notify_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method_notification_url(self, method_notification_url):\n\n self._method_notification_url = method_notification_url",
"def transaction_notification_url(self, transaction_notification_url):\n\n self._transaction_notification_url = transaction_notification_url",
"def setRemoteUrl(self, value, *... | [
"0.6166995",
"0.6015392",
"0.50982684",
"0.50833386",
"0.5017234",
"0.49507457",
"0.49297693",
"0.49142036",
"0.48429403",
"0.48098516",
"0.477082",
"0.47158262",
"0.46993542",
"0.4669321",
"0.46541572",
"0.46327883",
"0.46327883",
"0.46319416",
"0.4623827",
"0.4623827",
"0.4... | 0.81545186 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, SendMmsRequest):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Return whether MNPuzzle self is equivalent to other. | def __eq__(self, other):
return (type(self) == type(other) and
self.n == other.n and self.m == other.m and
self.from_grid == other.from_grid and
self.to_grid == other.to_grid) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n for i in range(len(self.puzzle)):\n for j in range(len(self.puzzle[0])):\n if(self.puzzle[i][j] != other.puzzle[i][j]):\n return False\n return True",
"def equals(self, other: InputTransform) -> bool:\n return super().eq... | [
"0.7884084",
"0.7809546",
"0.7805344",
"0.7694956",
"0.75914407",
"0.7474761",
"0.7468896",
"0.74044824",
"0.7375316",
"0.73414105",
"0.73191506",
"0.73190105",
"0.7264524",
"0.7263841",
"0.7250105",
"0.7250105",
"0.72085124",
"0.71788704",
"0.7175089",
"0.71745455",
"0.71743... | 0.7229176 | 16 |
Return whether Puzzle self is solved. | def is_solved(self):
return self.from_grid == self.to_grid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_solution(self) -> bool:\n if self in [self.SATISFIED, self.ALL_SOLUTIONS, self.OPTIMAL_SOLUTION]:\n return True\n return False",
"def has_solution(self) -> bool:\n pass",
"def did_solve(self) -> bool:\n return self._solution.info.status == \"solved\"",
"def did_... | [
"0.8234097",
"0.79921037",
"0.79141784",
"0.78646594",
"0.78364027",
"0.77967095",
"0.7794249",
"0.77819085",
"0.7668467",
"0.7663832",
"0.7557076",
"0.75298476",
"0.73814994",
"0.7375928",
"0.7336519",
"0.73149145",
"0.73143846",
"0.727756",
"0.71769005",
"0.71401644",
"0.70... | 0.7258521 | 19 |
Export queryset using SpreadsheetQuerysetExporter() | def export_any_queryset(request, queryset, filename, excluded_fields=[], included_fields=[], csv_field_delimiter = ";"):
name, extension = os.path.splitext(filename)
file_format = extension[1:]
output = None
if file_format == 'csv':
content_type = 'text/csv'
output = io.StringIO()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def export_to_excel(self, worksheet, row_start, col_start, queryset, date_time=timezone.now()):\n\t\tif queryset:\n\t\t\t[row_write, col_write] = self.excel_write_header_and_format(worksheet, row_start, col_start)\n\t\t\tfor q in queryset:\n\t\t\t\t# object_excel_write function---date_time uyiin history objectiig ... | [
"0.7342386",
"0.6501301",
"0.6470069",
"0.6442946",
"0.64135826",
"0.63767457",
"0.60784805",
"0.6071982",
"0.60229945",
"0.602165",
"0.59443706",
"0.59019446",
"0.58639264",
"0.5819428",
"0.5743513",
"0.5729794",
"0.5727017",
"0.57222134",
"0.5708493",
"0.5672931",
"0.566691... | 0.7718735 | 0 |
Row length should be greater than 0 | def test_load_points_simple_length():
df = leiap.get_points_simple()
assert df.shape[0] > 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_row_length(self):\n\n row_data = []\n for row in self._extract_data():\n if len(row) < self.row_length:\n row_data.append(row + [\"\" for _ in range(self.row_length - len(row))])\n else:\n row_data.append(row)\n\n return row_data",... | [
"0.75632495",
"0.70500714",
"0.6616089",
"0.6526584",
"0.6466225",
"0.6461273",
"0.64502984",
"0.6418513",
"0.6401328",
"0.6396882",
"0.63564134",
"0.63549715",
"0.6332553",
"0.6326681",
"0.6322982",
"0.6259874",
"0.6245428",
"0.6169558",
"0.61387384",
"0.610155",
"0.6088026"... | 0.0 | -1 |
Row length should be greater than 0 | def test_load_points_by_year_length():
years = ['2014','2015','2016','2017','2018']
for year in years:
df = leiap.get_points_by_year([year])
assert df.shape[0] > 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_row_length(self):\n\n row_data = []\n for row in self._extract_data():\n if len(row) < self.row_length:\n row_data.append(row + [\"\" for _ in range(self.row_length - len(row))])\n else:\n row_data.append(row)\n\n return row_data",... | [
"0.75632495",
"0.70500714",
"0.6616089",
"0.6526584",
"0.6466225",
"0.6461273",
"0.64502984",
"0.6418513",
"0.6401328",
"0.6396882",
"0.63564134",
"0.63549715",
"0.6332553",
"0.6326681",
"0.6322982",
"0.6259874",
"0.6245428",
"0.6169558",
"0.61387384",
"0.610155",
"0.6088026"... | 0.0 | -1 |
Row length should be greater than 0 | def test_load_artifacts_simple_length():
df = leiap.get_artifacts_simple()
assert df.shape[0] > 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_row_length(self):\n\n row_data = []\n for row in self._extract_data():\n if len(row) < self.row_length:\n row_data.append(row + [\"\" for _ in range(self.row_length - len(row))])\n else:\n row_data.append(row)\n\n return row_data",... | [
"0.75632495",
"0.70500714",
"0.6616089",
"0.6526584",
"0.6466225",
"0.6461273",
"0.64502984",
"0.6418513",
"0.6401328",
"0.6396882",
"0.63564134",
"0.63549715",
"0.6332553",
"0.6326681",
"0.6322982",
"0.6259874",
"0.6245428",
"0.6169558",
"0.61387384",
"0.610155",
"0.6088026"... | 0.0 | -1 |
Row length should be greater than 0 | def test_load_artifacts_by_year_length():
years = ['2015','2016','2017','2018']
for year in years:
df = leiap.get_artifacts_by_year([year])
assert df.shape[0] > 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_row_length(self):\n\n row_data = []\n for row in self._extract_data():\n if len(row) < self.row_length:\n row_data.append(row + [\"\" for _ in range(self.row_length - len(row))])\n else:\n row_data.append(row)\n\n return row_data",... | [
"0.75632495",
"0.70500714",
"0.6616089",
"0.6526584",
"0.6466225",
"0.6461273",
"0.64502984",
"0.6418513",
"0.6401328",
"0.6396882",
"0.63564134",
"0.63549715",
"0.6332553",
"0.6326681",
"0.6322982",
"0.6259874",
"0.6245428",
"0.6169558",
"0.61387384",
"0.610155",
"0.6088026"... | 0.0 | -1 |
Row length should be greater than 0 | def test_load_productions_simple_length():
df = leiap.get_productions_simple()
assert df.shape[0] > 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_row_length(self):\n\n row_data = []\n for row in self._extract_data():\n if len(row) < self.row_length:\n row_data.append(row + [\"\" for _ in range(self.row_length - len(row))])\n else:\n row_data.append(row)\n\n return row_data",... | [
"0.75632495",
"0.70500714",
"0.6616089",
"0.6526584",
"0.6466225",
"0.6461273",
"0.64502984",
"0.6418513",
"0.6401328",
"0.6396882",
"0.63564134",
"0.63549715",
"0.6332553",
"0.6326681",
"0.6322982",
"0.6259874",
"0.6245428",
"0.6169558",
"0.61387384",
"0.610155",
"0.6088026"... | 0.0 | -1 |
Row length should be greater than 0 | def test_load_production_cts_wts_length():
df = leiap.get_production_cts_wts()
assert df.shape[0] > 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_row_length(self):\n\n row_data = []\n for row in self._extract_data():\n if len(row) < self.row_length:\n row_data.append(row + [\"\" for _ in range(self.row_length - len(row))])\n else:\n row_data.append(row)\n\n return row_data",... | [
"0.75632495",
"0.70500714",
"0.6616089",
"0.6526584",
"0.6466225",
"0.6461273",
"0.64502984",
"0.6418513",
"0.6401328",
"0.6396882",
"0.63564134",
"0.63549715",
"0.6332553",
"0.6326681",
"0.6322982",
"0.6259874",
"0.6245428",
"0.6169558",
"0.61387384",
"0.610155",
"0.6088026"... | 0.0 | -1 |
Row length should be greater than 0 | def test_load_points_times_length():
df = leiap.get_points_times(warn='disable')
assert df.shape[0] > 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_row_length(self):\n\n row_data = []\n for row in self._extract_data():\n if len(row) < self.row_length:\n row_data.append(row + [\"\" for _ in range(self.row_length - len(row))])\n else:\n row_data.append(row)\n\n return row_data",... | [
"0.75632495",
"0.70500714",
"0.6616089",
"0.6526584",
"0.6466225",
"0.6461273",
"0.64502984",
"0.6418513",
"0.6401328",
"0.6396882",
"0.63564134",
"0.63549715",
"0.6332553",
"0.6326681",
"0.6322982",
"0.6259874",
"0.6245428",
"0.6169558",
"0.61387384",
"0.610155",
"0.6088026"... | 0.0 | -1 |
Plots an explantion of a single prediction as a waterfall plot. The SHAP value of a feature represents the impact of the evidence provided by that feature on the model's output. The waterfall plot is designed to visually display how the SHAP values (evidence) of each feature move the model output from our prior expecta... | def waterfall(shap_values, max_display=10, show=True, y_reverse=False, rank_absolute=True, raw_ascending=True):
# Turn off interactive plot
if show is False:
plt.ioff()
base_values = shap_values.base_values
features = shap_values.display_data if shap_values.display_data is not None else shap_va... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wfall(shap_values, max_display=10, show=True):\n dark_o= mpl.colors.to_rgb('dimgray')\n dim_g= mpl.colors.to_rgb('darkorange')\n\n base_values = shap_values.base_values\n \n features = shap_values.data\n feature_names = shap_values.feature_names\n lower_bounds = getattr(shap_values, \"lowe... | [
"0.7552197",
"0.6487499",
"0.59388584",
"0.58855724",
"0.5784341",
"0.5755554",
"0.57258266",
"0.54678655",
"0.5397535",
"0.5310707",
"0.52994573",
"0.52885133",
"0.5283744",
"0.5252056",
"0.5242549",
"0.52383363",
"0.5231653",
"0.5231378",
"0.52284336",
"0.52165335",
"0.5168... | 0.7543823 | 1 |
Returns instance of database browser | def _browser(wh_conn):
util = Utility()
config = util.CONFIG
br = util.get_plugin(config.PATH_BROWSER)
br.connect(wh_conn)
return br | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def database_browser(Database):\n QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)\n if hasattr(QtWidgets.QStyleFactory, \"AA_UseHighDpiPixmaps\"):\n QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)\n app = QtWidgets.QApplication(sys.argv)\n ui = database... | [
"0.6988154",
"0.6919361",
"0.6903497",
"0.6867201",
"0.6862192",
"0.68511224",
"0.68449754",
"0.68336517",
"0.68336517",
"0.68336517",
"0.68336517",
"0.68336517",
"0.68336517",
"0.68336517",
"0.68336517",
"0.68336517",
"0.68336517",
"0.68336517",
"0.68336517",
"0.68336517",
"... | 0.610393 | 100 |
Returns an instance of repository manager | def _repo_manager(repo_conn):
util = Utility()
config = util.CONFIG
repo_mgr = util.get_plugin(config.PATH_REPO_MGR)
repo_mgr.connect(repo_conn)
return repo_mgr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetManager(self):\r\n\r\n return self.manager",
"def getManager(self):\n return self._manager",
"def repo(self):\n if not hasattr(self, '_repo'):\n self._repo = Repo(self.path)\n return self._repo",
"def get_repository(self, model_name):\n model = self.get_mo... | [
"0.7011911",
"0.69088995",
"0.68863064",
"0.68238807",
"0.6777066",
"0.6713002",
"0.66024584",
"0.6589624",
"0.6493085",
"0.63914603",
"0.6335091",
"0.6333407",
"0.6332586",
"0.6316686",
"0.6287266",
"0.6273444",
"0.62642944",
"0.6252956",
"0.6247965",
"0.62475324",
"0.623563... | 0.7475611 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.