query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
check if ndarray has 2 dimensions only and if it has float or int dtypes | def validate_common(ndarray, name):
validate_ndarray(ndarray,(np.float, np.int), (2,) , name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _is_1d_varray(arr):\r\n return len(arr.shape) < 2 or arr.shape[1] == 1",
"def is_array(a):\n try:\n shape = a.shape\n return len(shape) >= 1\n except AttributeError:\n return False",
"def _is_double(arr):\n\n # Figure out which dtype for data\n if arr.dtype == np.float32... | [
"0.73486024",
"0.6962764",
"0.6876656",
"0.6859714",
"0.6846378",
"0.68397707",
"0.67156184",
"0.6705501",
"0.66635436",
"0.66286635",
"0.6608184",
"0.65864426",
"0.6547088",
"0.65391356",
"0.65080184",
"0.6491807",
"0.6487964",
"0.6478655",
"0.6457786",
"0.64527905",
"0.6399... | 0.70410544 | 1 |
Stamp pixels according to a brush, you can choose the brush pivot and stamp point | def stamp2D(ndarray, brush, brush_pivot, stamp_point, neutral_value = 0):
#check if ndarray inputs has valid propierties
validate_common(ndarray, 'ndarray')
validate_common(brush, 'brush')
#check if we have a valid stamp point
point_into_bound(ndarray.shape, stamp_point, 'ndarray')
#check if the brush pivot poi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_brush(self):\r\n \r\n brushset = self.brushset\r\n \r\n self.grfx[0].brushset = brushset\r\n pass",
"def pixel(self, x: int, y: int, colour: int, /) -> None:",
"def shift(self, t=0, px=0, sx=0):\n t, px, sx = self.convertArgs(t, px, sx)\n self.tile += t \n self.p... | [
"0.59835535",
"0.55198157",
"0.5482089",
"0.5435805",
"0.54289764",
"0.5424146",
"0.54201245",
"0.5274401",
"0.5267655",
"0.5181688",
"0.51765895",
"0.51542014",
"0.50866365",
"0.506753",
"0.505965",
"0.5050119",
"0.5048875",
"0.5039558",
"0.50147456",
"0.50074136",
"0.500596... | 0.71556205 | 0 |
Testing SourceForge service support capabilities | def test_service_support(self):
self.assertTrue(self.service_class.supports_bug_trackers)
self.assertTrue(self.service_class.supports_repositories) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_software(self):\n pass",
"def test_service_support(self):\n self.assertFalse(self.service_class.supports_bug_trackers)\n self.assertTrue(self.service_class.supports_repositories)",
"def test_for_client():",
"def test_functionality(self):\n self.browserObject = globalV... | [
"0.69227266",
"0.6693233",
"0.6373736",
"0.62986314",
"0.6256759",
"0.6224789",
"0.62143135",
"0.6179373",
"0.61085504",
"0.6057353",
"0.6040974",
"0.6033115",
"0.6012317",
"0.60122204",
"0.6010104",
"0.5957611",
"0.5949765",
"0.59437525",
"0.593273",
"0.59144694",
"0.5905565... | 0.6801454 | 1 |
Testing SourceForge.get_repository_fields for Bazaar | def test_get_repository_fields_with_bazaar(self):
self.assertEqual(
self.get_repository_fields(
'Bazaar',
fields={
'sourceforge_project_name': 'myproj',
}
),
{
'path': 'bzr://myproj.bzr.source... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_repository_fields_with_svn(self):\n self.assertEqual(\n self.get_repository_fields(\n 'Subversion',\n fields={\n 'sourceforge_project_name': 'myproj',\n }\n ),\n {\n 'path': 'http://m... | [
"0.72959095",
"0.7099818",
"0.70340616",
"0.695484",
"0.6945559",
"0.62843263",
"0.6145122",
"0.5821826",
"0.5762664",
"0.575234",
"0.57023877",
"0.56683767",
"0.56152296",
"0.5610711",
"0.5605335",
"0.5573614",
"0.5553995",
"0.55373716",
"0.55210626",
"0.55176175",
"0.550844... | 0.8278541 | 0 |
Testing SourceForge.get_repository_fields for CVS | def test_get_repository_fields_with_cvs(self):
self.assertEqual(
self.get_repository_fields(
'CVS',
fields={
'sourceforge_project_name': 'myproj',
}
),
{
'path': (':pserver:anonymous@myproj.cv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_repository_fields_with_svn(self):\n self.assertEqual(\n self.get_repository_fields(\n 'Subversion',\n fields={\n 'sourceforge_project_name': 'myproj',\n }\n ),\n {\n 'path': 'http://m... | [
"0.6863913",
"0.6410039",
"0.6088037",
"0.5979059",
"0.59609425",
"0.5861417",
"0.55706716",
"0.54229075",
"0.536948",
"0.5341525",
"0.53379655",
"0.53187394",
"0.5284372",
"0.52370536",
"0.52255654",
"0.5184932",
"0.51680344",
"0.51280266",
"0.5050754",
"0.5028386",
"0.50226... | 0.85957175 | 0 |
Testing SourceForge.get_repository_fields for Mercurial | def test_get_repository_fields_with_mercurial(self):
self.assertEqual(
self.get_repository_fields(
'Mercurial',
fields={
'sourceforge_project_name': 'myproj',
}
),
{
'path': 'http://myproj.hg.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_repository_fields_with_svn(self):\n self.assertEqual(\n self.get_repository_fields(\n 'Subversion',\n fields={\n 'sourceforge_project_name': 'myproj',\n }\n ),\n {\n 'path': 'http://m... | [
"0.7633886",
"0.70817554",
"0.68226165",
"0.67855734",
"0.6539939",
"0.63614696",
"0.600498",
"0.5905528",
"0.5826302",
"0.57685614",
"0.5687912",
"0.5679595",
"0.5666374",
"0.5548074",
"0.5535038",
"0.54961586",
"0.5487816",
"0.54737407",
"0.5449937",
"0.5389966",
"0.5388888... | 0.89236623 | 0 |
Testing SourceForge.get_repository_fields for Subversion | def test_get_repository_fields_with_svn(self):
self.assertEqual(
self.get_repository_fields(
'Subversion',
fields={
'sourceforge_project_name': 'myproj',
}
),
{
'path': 'http://myproj.svn.sour... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_repo_field_values_subversion(self):\n fields = self._get_repository_fields('Subversion', fields={\n 'beanstalk_account_domain': 'mydomain',\n 'beanstalk_repo_name': 'myrepo',\n })\n self.assertEqual(\n fields['path'],\n 'https://mydomain.svn... | [
"0.8087647",
"0.76529366",
"0.7217535",
"0.70159984",
"0.6739738",
"0.6695045",
"0.6261979",
"0.6045239",
"0.60357016",
"0.6018077",
"0.59775853",
"0.5939187",
"0.5930188",
"0.5927323",
"0.5778743",
"0.5682831",
"0.5637555",
"0.5626451",
"0.56083924",
"0.5600792",
"0.559945",... | 0.88799465 | 0 |
Search function will search a node into tree. | def search(self, node, data):
# if root is None or root is the search data.
if node is None or node.data == data:
return node
if node.data < data:
return self.search(node.right, data)
else:
return self.search(node.left, data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search(self):\r\n #get the initial state\r\n initialState = State()\r\n \r\n #create root node\r\n rootNode = Node(initialState)\r\n \r\n #show the search tree explored so far\r\n treeplot = TreePlot()\r\n treeplot.generateDiagram(rootNode, rootNod... | [
"0.732473",
"0.72729814",
"0.72291726",
"0.7178203",
"0.71748567",
"0.7156459",
"0.71024144",
"0.70252347",
"0.6997943",
"0.6962141",
"0.69579214",
"0.69251233",
"0.6910981",
"0.6910981",
"0.69095063",
"0.6906096",
"0.6883479",
"0.68785363",
"0.6844738",
"0.6839486",
"0.67471... | 0.7507819 | 0 |
Converts a ROS PointCloud2 message to a pcl PointXYZRGB | def pcl_to_ros(pcl_array, frame_id, stamp):
pcl_array = np.array(pcl_array, dtype=np.float32)
# print(pcl_array)
pcl_array = pcl_array.reshape(-1, 4)
ros_msg = PointCloud2()
ros_msg.header.stamp = stamp
ros_msg.header.frame_id = frame_id
ros_msg.height = 1
ros_msg.width = pcl_array.si... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_to_point_cloud2(cloud):\n header = Header()\n header.frame_id = \"base_link\"\n header.stamp = rospy.Time.now()\n return point_cloud2.create_cloud_xyz32(header, cloud)",
"def o3dpc_to_rospc(o3dpc, frame_id=None, stamp=None):\n\n cloud_npy = np.asarray(copy.deepcopy(o3dp... | [
"0.62980944",
"0.6143812",
"0.5940625",
"0.5845577",
"0.57586324",
"0.5725049",
"0.5674427",
"0.54363084",
"0.53386486",
"0.5192354",
"0.5108763",
"0.5093929",
"0.50935894",
"0.50869155",
"0.50597835",
"0.503335",
"0.5031037",
"0.50220346",
"0.49883816",
"0.49872372",
"0.4963... | 0.70991236 | 0 |
Prevents percents inside hashes from being treated as comments | def preprocess_hashes(tex):
blocks = catlist()
rx = hash_rx
m = rx.search(tex)
while m:
if len(m.group(2)) > 40:
tex2htm.warn("Possible runaway hash: {}".format(text_sample(m.group(2))))
raise(None)
blocks.append(tex[:m.start()])
blocks.append(re.sub(r'(^|... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visit_comment(self, node):\n self.body.append('\\n%% %s \\n' % COMMENT_RE_SUB('\\n% ', node.astext()))\n raise nodes.SkipNode",
"def removeComment(line):\n ind = line.find('%')\n while True:\n if ind < 0:\n return line\n elif (ind > 0 and line[ind-1] != '\\\\') or... | [
"0.59150434",
"0.58676803",
"0.57014954",
"0.56458783",
"0.55955195",
"0.5576913",
"0.5573911",
"0.5573817",
"0.55316484",
"0.55162364",
"0.5394775",
"0.53919935",
"0.5390776",
"0.5384116",
"0.53789926",
"0.5363991",
"0.5348407",
"0.53222734",
"0.5309507",
"0.53046936",
"0.53... | 0.6046166 | 0 |
set_timeout Sets the timeout (in seconds) of the read | def set_timeout(self, timeout):
self.timeout = timeout | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def settimeout(self, timeout):\r\n self.sock.settimeout(timeout)",
"def set_timeout(self, timeout):\n pass",
"def settimeout(self, timeout):\n assert timeout > 0.0\n self.__timeout = timeout\n self.sock.settimeout(timeout)\n # We don't query the socket's timeout or che... | [
"0.742158",
"0.7273775",
"0.70609385",
"0.6984327",
"0.69824314",
"0.6974225",
"0.6943636",
"0.68636084",
"0.68259835",
"0.6743001",
"0.6723039",
"0.6699705",
"0.6696877",
"0.66192055",
"0.66097164",
"0.6584852",
"0.65630037",
"0.6549444",
"0.64416623",
"0.64216036",
"0.63620... | 0.7320112 | 1 |
read_register Reads a single register from the read command and then converts it to an integer | def read_register(self, device_id, address):
register_array = self.read(device_id, address, 1)
return register_array[0] << 24 | register_array[1] << 16 | register_array[2] << 8 | register_array[3] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _read(self, register):\n\n assert register in _registers, 'Not a valid register. Register must be passed as string.'\n\n # send read command to register\n self.spi.writebytes([READ | _registers[register]])\n\n # return values in register\n return self.spi.readbytes(_register_... | [
"0.7474401",
"0.7080555",
"0.7074939",
"0.70655316",
"0.70555407",
"0.702198",
"0.69836134",
"0.69543463",
"0.6922582",
"0.6922576",
"0.6913573",
"0.6889973",
"0.6784303",
"0.67757404",
"0.6730901",
"0.6668612",
"0.6588589",
"0.6588589",
"0.6585995",
"0.6585633",
"0.65075",
... | 0.7300364 | 1 |
read_memory Reads a byte array of the specified size from the specified address from memory | def read_memory(self, address, size):
return self.read(0, address, size, mem_device=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def memory_read(self, addr: str) -> Byte:\n print(f\"memory read {addr}\")\n _parsed_addr = self._parse_addr(addr)\n if _parsed_addr:\n return _parsed_addr.read(addr)\n data = self.memory.read(addr)\n return data",
"def read_memory(self, address):\n return sel... | [
"0.7806055",
"0.7736442",
"0.7676365",
"0.7601956",
"0.76009345",
"0.75871277",
"0.74586606",
"0.74348634",
"0.74348634",
"0.73781717",
"0.7210574",
"0.7205152",
"0.71989906",
"0.71544933",
"0.70536613",
"0.6845303",
"0.6804689",
"0.67451096",
"0.6735209",
"0.6664399",
"0.666... | 0.8605254 | 0 |
set_register_bit Sets an individual bit in a register | def set_register_bit(self, device_id, address, bit):
register = self.read_register(device_id, address)
bit_mask = 1 << bit
register |= bit_mask
self.write_register(device_id, address, register) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_bit(self, register, bit_index, state):\n oldvalue = self.device.readregister(register)\n if state:\n newvalue = oldvalue | 2 ** bit_index\n else:\n newvalue = oldvalue & ~(2 ** bit_index)\n \n self.device.writeregister(register, newvalue)",
"def se... | [
"0.8242907",
"0.81627",
"0.7520253",
"0.746749",
"0.7446049",
"0.72392696",
"0.71773344",
"0.7068195",
"0.7023352",
"0.69295865",
"0.6729111",
"0.67066884",
"0.669121",
"0.6618833",
"0.6566342",
"0.65097004",
"0.64613277",
"0.6454506",
"0.64274085",
"0.64161575",
"0.64115506"... | 0.86691505 | 0 |
clear_register_bit Clear an individual bit in a register | def clear_register_bit(self, device_id, address, bit):
register = self.read_register(device_id, address)
bit_mask = 1 << bit
register &= ~bit_mask
self.write_register(device_id, address, register) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clr_bit(self, port, bit):\n hw = self.device.peripherals[port]\n hw.BSRR.wr(1 << ((bit & 15) + 16))",
"def clear_bit(num, i):\n return num & ~(1 << i)",
"def set_bit(self, register, bit_index, state):\n oldvalue = self.device.readregister(register)\n if state:\n newvalue =... | [
"0.8002426",
"0.7408542",
"0.6479617",
"0.6281127",
"0.62140816",
"0.61690193",
"0.5904704",
"0.5798788",
"0.56769925",
"0.56328434",
"0.5539453",
"0.5474844",
"0.54529935",
"0.5365986",
"0.5349872",
"0.5342354",
"0.53117216",
"0.5278196",
"0.5275775",
"0.5253986",
"0.5232702... | 0.87003523 | 0 |
is_register_bit_set returns true if an individual bit is set, false if clear | def is_register_bit_set(self, device_id, address, bit):
register = self.read_register(device_id, address)
bit_mask = 1 << bit
return ((register & bit_mask) > 0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bit_set(i, bit):\n return ((i >> bit) & 1) != 0",
"def isset(flag, bit):\n return (flag & (1 << bit)) != 0",
"def is_set(x, k):\n\n return get_bit(x, k) == 1",
"def _check_bit(self, bit, mask=1, errmsg=None):\n if self.mot_type == \"ims\":\n if self._msta_bit(bit, mask):\n ... | [
"0.76308006",
"0.69270027",
"0.6759574",
"0.63582957",
"0.6230073",
"0.61256903",
"0.5876367",
"0.58359134",
"0.5833481",
"0.58329314",
"0.5825747",
"0.5821639",
"0.57985073",
"0.5703961",
"0.5682228",
"0.5646558",
"0.56419086",
"0.5640212",
"0.5601906",
"0.55903983",
"0.5579... | 0.8478202 | 0 |
write_memory Writes the byte of array of bytes down to the memory of the bus | def write_memory(self, address, data):
self.write(0, address, data, mem_device = True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def writeMemory(memory,message): # static method\n\t\tmessage += chr(0)\n\t\tbytesMessage = message.encode('ascii')\n\t\tmemory.write(bytesMessage)\n\t\treturn",
"def write_mem(self):\n request = 'commands/writemem'\n return self._post(request)",
"def memory_write(self, addr, data, zone=None, nbi... | [
"0.6935612",
"0.6898725",
"0.687767",
"0.6764152",
"0.6689634",
"0.6681689",
"0.6614973",
"0.64897287",
"0.6301275",
"0.6281355",
"0.6257101",
"0.62447315",
"0.6227853",
"0.6153291",
"0.6149863",
"0.61338675",
"0.61338675",
"0.60785735",
"0.6074531",
"0.60421634",
"0.5964537"... | 0.7749853 | 0 |
read_drt Read the contents of the DRT | def read_drt(self):
data = Array('B')
data = self.read(0, 0, 8)
num_of_devices = drt_controller.get_number_of_devices(data)
len_to_read = num_of_devices * 8
data = self.read(0, 0, len_to_read + 8)
self.drt_manager.set_drt(data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read():\n # TODO",
"def rd_dr(self, rd):\n # add bits for the bypassed devices\n tdi = bits.bits(rd.n + self.ndevs_before + self.ndevs_after)\n self.driver.scan_dr(tdi, rd)\n # strip bits from the bypassed devices\n rd.drop_msb(self.ndevs_after)\n rd.drop_lsb(self.ndevs_before)",
"def ... | [
"0.6179409",
"0.5852733",
"0.5831673",
"0.5760436",
"0.5717687",
"0.571745",
"0.5603796",
"0.5560624",
"0.5555739",
"0.55379117",
"0.5471166",
"0.5454054",
"0.5445213",
"0.54226756",
"0.5409205",
"0.5402778",
"0.53766173",
"0.5358609",
"0.5336026",
"0.5334574",
"0.5319163",
... | 0.7972392 | 0 |
pretty_print_drt Prints out the DRT with colors and beauty | def pretty_print_drt(self):
self.drt_manager.pretty_print_drt() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pretty_print(self):\n for dtr in self.dtrs:\n dtr.pretty_print(indent=2)",
"def print_report(d):\n report_data = d.get_report_data()\n title = \"{:24} | {:12} | {:10} | {:20}\"\n dashes=67*('-');print(dashes)\n print(title.format('Donor Name','Total Given','Num Gifts','Average G... | [
"0.6453225",
"0.6259471",
"0.57071704",
"0.56372404",
"0.5578684",
"0.5571408",
"0.5532173",
"0.5487727",
"0.54446816",
"0.5429877",
"0.53897995",
"0.536408",
"0.5324093",
"0.53238434",
"0.53232133",
"0.5283827",
"0.528115",
"0.5233671",
"0.5230023",
"0.5229752",
"0.52210903"... | 0.83004236 | 0 |
get_number_of_devices Returns the number of devices found on the DRT | def get_number_of_devices(self):
return self.drt_manager.get_number_of_devices() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_count():\n _check_init()\n return _pypm.CountDevices()",
"def get_device_count():\n debug(\"MpOrLibUsb.get_device_count()\")\n num = MpOrLibUsb.__get_device_count_Mpusb()\n num = num + MpOrLibUsb.__get_device_count_Libusb()\n return num\n #end get_device_count()",... | [
"0.8197719",
"0.7806609",
"0.76976454",
"0.7696784",
"0.7658798",
"0.76573914",
"0.7449678",
"0.7136651",
"0.71324015",
"0.70096284",
"0.67992604",
"0.6779974",
"0.6697782",
"0.6642638",
"0.6554823",
"0.6524591",
"0.6513282",
"0.6495262",
"0.64668775",
"0.64312977",
"0.642168... | 0.9092576 | 0 |
get_device From the index within the DRT return the ID of this device | def get_device_id(self, device_index):
return self.drt_manager.get_id_from_index(device_index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_id(self):\n return self._id[0]",
"def device_index(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"device_index\")",
"def device_id(self):\n return self.unique_id",
"def _get_device(self, dev_id):\n tuya = self.hass.data[DOMAIN][TUYA_DATA]\n return tuya.g... | [
"0.72367877",
"0.7197104",
"0.6970419",
"0.6948768",
"0.6811029",
"0.67966664",
"0.67294854",
"0.66873586",
"0.6673303",
"0.6669543",
"0.6639969",
"0.6589002",
"0.657828",
"0.65497106",
"0.6499786",
"0.6477944",
"0.64726025",
"0.64275587",
"0.63993573",
"0.63986725",
"0.63687... | 0.82133114 | 0 |
get_device_address From the index within the DRT return the address of where to find this device | def get_device_address(self, device_index):
return self.drt_manager.get_address_from_index(device_index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getAddressAtIndex(self, index: int) -> ghidra.program.model.address.Address:\n ...",
"def get_device_id(self, device_index):\n return self.drt_manager.get_id_from_index(device_index)",
"def getAddressOfIndex(self) -> long:\n ...",
"def device_index(self) -> pulumi.Input[str]:\n re... | [
"0.6733713",
"0.6699868",
"0.6425227",
"0.63098496",
"0.6268481",
"0.6103588",
"0.6075266",
"0.6064029",
"0.5987742",
"0.5972704",
"0.59298176",
"0.5882485",
"0.5855838",
"0.5829728",
"0.5815816",
"0.5795995",
"0.5767931",
"0.5751209",
"0.5748051",
"0.57414186",
"0.5737537",
... | 0.86128855 | 0 |
get_device_size Gets the size of the peripheral/memory if peripheral gets the number of registers associated with ti if memory gets the size of the memory | def get_device_size(self, device_index):
return self.drt_manager.get_size_from_index(device_index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_number_of_devices(self):\n return self.drt_manager.get_number_of_devices()",
"def deviceMemory(self):\n return 1",
"def dev_size(device):\n device_path = \"/sys/block/\"\n num_sectors = open(device_path + device + \"/size\").read().rstrip(\"\\n\")\n sector_size = (\n open(devi... | [
"0.7003832",
"0.6979596",
"0.69751596",
"0.6956093",
"0.6703184",
"0.66195875",
"0.6403171",
"0.63353014",
"0.6328089",
"0.62966233",
"0.6265862",
"0.6249727",
"0.6245275",
"0.6244539",
"0.62272525",
"0.6212857",
"0.6208661",
"0.61988574",
"0.6167219",
"0.6146095",
"0.6146095... | 0.72076064 | 0 |
is_memory_device Queries the DRT to see if the device is on the memory bus or the peripheral bus | def is_memory_device(self, device_index):
return self.drt_manager.is_memory_device(device_index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_out_of_memory(self) -> bool:\n return pulumi.get(self, \"device_out_of_memory\")",
"def deviceMemory(self):\n return 1",
"def device_out_of_memory(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"device_out_of_memory\")",
"def is_cuda_device(device):\n\tretur... | [
"0.6416678",
"0.6390123",
"0.6185664",
"0.5853664",
"0.58481354",
"0.5767353",
"0.57446575",
"0.57203233",
"0.55757165",
"0.5524163",
"0.5518658",
"0.54736555",
"0.54702324",
"0.5460847",
"0.5448126",
"0.5421345",
"0.54081154",
"0.5397421",
"0.53900725",
"0.53512543",
"0.5329... | 0.766284 | 0 |
get_total_memory_size adds all the contiguous memory peripherals together and returns the total size | def get_total_memory_size(self):
return self.drt_manager.get_total_memory_size() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_total_memory_size(self):\n memory = 0\n for i in range(4):\n for j in range(4):\n memory += self.system.operator[i, j].memory\n return memory",
"def get_total_memory():\n try:\n with open(LINUX_MEM_INFO_LOCATION, 'r') as f:\n mem_entries... | [
"0.8037758",
"0.7566034",
"0.7346364",
"0.72690254",
"0.72373205",
"0.7224274",
"0.70762634",
"0.70297307",
"0.6995834",
"0.699576",
"0.6856961",
"0.68113935",
"0.6800184",
"0.6800184",
"0.67656213",
"0.6764275",
"0.6712863",
"0.6701607",
"0.6650779",
"0.65977496",
"0.6536994... | 0.79419494 | 1 |
dump_core reads the state of the wishbone master prior to a reset, useful for debugging | def dump_core(self):
raise AssertionError("Core Dump function not implemented") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def collect_core_dump(self, log_dir):\n pass",
"def dump(self):\n return self.dump_internal(0)",
"def dump_pre(self,status):\n pass",
"def core_dump(self):\r\r\n loggerModem = logging.getLogger(__name__ + 'core_dump')\r\r\n cmd_l=[r'at%debug=0', r'at%debug=2']\r\r\n ... | [
"0.5930102",
"0.5783696",
"0.57801324",
"0.5759413",
"0.5738014",
"0.566101",
"0.56378603",
"0.5629576",
"0.5576555",
"0.55085874",
"0.5505015",
"0.54887176",
"0.5463867",
"0.5442185",
"0.53786504",
"0.536504",
"0.5356372",
"0.53363353",
"0.5297702",
"0.5293932",
"0.5275712",... | 0.7005282 | 0 |
wait_for_interrupts listen for interrupts for the specified amount of time | def wait_for_interrupts(self, wait_time = 1):
raise AssertionError("wait_for_interrupts function i not implemented") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def watchdog_timer(state, wait=3):\n time.sleep(wait)\n if not state['completed']:\n _thread.interrupt_main()",
"def wait_inner():\n if (\n kernel32.WaitForMultipleObjects(\n 2,\n ctypes.pointer((HANDLE * 2)(cancel_event, timer)),\n ... | [
"0.6248022",
"0.6173608",
"0.59917414",
"0.5924643",
"0.59020823",
"0.5856036",
"0.58311045",
"0.5738875",
"0.5725346",
"0.5678184",
"0.56615454",
"0.56615454",
"0.56615454",
"0.5640299",
"0.5639662",
"0.56370324",
"0.56134665",
"0.5582829",
"0.55701977",
"0.556798",
"0.55529... | 0.8238832 | 0 |
is_interrupt_for_slave Test to see if the interrupt is for the specified slave | def is_interrupt_for_slave(self, device_id):
#print "interrupts: %X" % self.interrupts
if ( (1 << device_id) & self.interrupts) > 0:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _do_has_slave(self, args):\r\n bus_type = args[1]\r\n slave_id = int(args[2])\r\n try:\r\n if bus_type == 'rtu':\r\n self.server._servers[0].get_slave(slave_id)\r\n elif bus_type == 'tcp':\r\n self.server._servers[1].get_slave(slave_id)\r... | [
"0.63171035",
"0.57447404",
"0.56389064",
"0.5445232",
"0.5382953",
"0.52882266",
"0.52523154",
"0.51516694",
"0.5113602",
"0.5082273",
"0.5077156",
"0.50416076",
"0.4967075",
"0.4961504",
"0.49324226",
"0.49276352",
"0.49275413",
"0.49213493",
"0.48987693",
"0.487197",
"0.48... | 0.8389085 | 0 |
Teleport to the destination tile if we're standing on it | def check_teleport(self):
if self.level.get_tile(self.nearest_node).teleport():
self.nearest_node = self.level.get_tile(self.nearest_node).teleport_to_tile
self.pos = self.node_to_pixel(self.nearest_node) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move(argument, player):\n current_tile = world.tile_exists(player.location_x, player.location_y)\n if argument == \"north\":\n if world.tile_exists(player.location_x, player.location_y-1):\n new_tile = world.tile_exists(player.location_x, player.location_y-1)\n if new_tile.__... | [
"0.69407177",
"0.643204",
"0.6427765",
"0.63773406",
"0.6318449",
"0.6226308",
"0.6222305",
"0.6177151",
"0.61488974",
"0.6140859",
"0.6102988",
"0.6084434",
"0.607867",
"0.6056312",
"0.6056312",
"0.6021107",
"0.59884423",
"0.5979466",
"0.59458447",
"0.5909287",
"0.59066164",... | 0.74955755 | 0 |
Generates a tokens file and basic interfaces. It returns the tokens code and filename | def generate(self, token_names: List[str]) -> Tuple[str, str]:
return self._codegen.generate(token_names), self._codegen.tokens_filename | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tokens():\n pass",
"def __gen_tokenization_file(self):\n paula_id = '{}.{}.tok'.format(self.corpus_name, self.name)\n E, tree = gen_paula_etree(paula_id)\n self.paulamap['tokenization'] = paula_id\n\n base_paula_id = '{}.{}.text'.format(self.corpus_name, self.name)\n mli... | [
"0.6281108",
"0.61487335",
"0.59650594",
"0.59461534",
"0.59119046",
"0.59074944",
"0.58351403",
"0.5789067",
"0.57600987",
"0.57053685",
"0.56063414",
"0.5580585",
"0.55637497",
"0.5537699",
"0.5531575",
"0.5525693",
"0.5508637",
"0.54536194",
"0.5450545",
"0.54484177",
"0.5... | 0.69935143 | 0 |
Add the 'instance' argument to the parser. | def AddInstanceArgument(parser):
parser.add_argument(
'instance', completer=InstanceCompleter, help='Cloud SQL instance ID.'
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddInstanceFlag(parser, required=False):\n help_text = \"\"\"\\\n If the source is a Cloud SQL database, use this field to provide the Cloud\n SQL instance ID of the source.\n \"\"\"\n parser.add_argument('--instance', help=help_text, required=required)",
"def register_instance(self, instance):\n ... | [
"0.6948706",
"0.62389904",
"0.60656315",
"0.60656315",
"0.60656315",
"0.60656315",
"0.60656315",
"0.57796246",
"0.5767405",
"0.5753263",
"0.5647783",
"0.564248",
"0.56083095",
"0.55646574",
"0.5464248",
"0.5462849",
"0.5393457",
"0.5381054",
"0.5365273",
"0.5360532",
"0.53513... | 0.7662812 | 0 |
Add the 'host' flag to the parser. | def AddHost(parser):
parser.add_argument(
'--host',
help=(
"Cloud SQL user's hostname expressed as a specific IP address or"
' address range. `%` denotes an unrestricted hostname. Applicable'
' flag for MySQL instances; ignored for all other engines. Note, if'
' you... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddHostFlag(parser, required=False):\n help_text = \"\"\"\\\n IP or hostname of the database.\n When `--psc-service-attachment` is also specified, this field value should be:\n 1. For Cloud SQL PSC enabled instance - the dns_name field (e.g <uid>.<region>.sql.goog.).\n 2. For Cloud SQL PSA instanc... | [
"0.76604104",
"0.64905113",
"0.63961065",
"0.6395434",
"0.63680506",
"0.63680506",
"0.63680506",
"0.63680506",
"0.62689656",
"0.62531596",
"0.6232219",
"0.62018406",
"0.61583894",
"0.61549026",
"0.6083637",
"0.60569",
"0.60296434",
"0.58764833",
"0.58764833",
"0.58378303",
"0... | 0.76152074 | 1 |
Add the 'availabilitytype' flag to the parser. | def AddAvailabilityType(parser):
availabilty_type_flag = base.ChoiceArgument(
'--availability-type',
required=False,
choices={
'regional': (
'Provides high availability and is recommended for '
'production instances; instance automatically fails over '
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def availability_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"availability_type\")",
"def AddEventTypeFlagArg(parser):\n parser.add_argument(\n '--type',\n required=True,\n help='Type of event (e.g. com.google.cloud.auditlog.event).')",
"def add_availability(sel... | [
"0.62091607",
"0.5289764",
"0.5282935",
"0.5115059",
"0.5093512",
"0.5070567",
"0.5020381",
"0.49373484",
"0.48957112",
"0.4870502",
"0.48256987",
"0.48106056",
"0.47792646",
"0.4700552",
"0.46895313",
"0.467878",
"0.4653159",
"0.46427098",
"0.46102673",
"0.4605125",
"0.45758... | 0.8283101 | 0 |
Add the root password field to the parser. | def AddRootPassword(parser):
parser.add_argument(
'--root-password', required=False, help="Root Cloud SQL user's password."
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def root_password(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"root_password\")",
"def root_password(self) -> str:\n return pulumi.get(self, \"root_password\")",
"def root_password(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"root_password\")",
"def enabl... | [
"0.63901985",
"0.6269362",
"0.6127681",
"0.5883558",
"0.5819812",
"0.58135384",
"0.58135384",
"0.58135384",
"0.58135384",
"0.576288",
"0.574868",
"0.57398283",
"0.5728829",
"0.57215476",
"0.5720188",
"0.56995404",
"0.5681931",
"0.5675549",
"0.5657455",
"0.56436104",
"0.563173... | 0.7137616 | 0 |
Adds the `authorizednetworks` flag. | def AddAuthorizedNetworks(parser, update=False):
cidr_validator = arg_parsers.RegexpValidator(
_CIDR_REGEX,
(
'Must be specified in CIDR notation, also known as '
"'slash' notation (e.g. 192.168.100.0/24)."
),
)
help_ = (
'The list of external networks that are allowed ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddNetworkFlag(parser):\n help_text = \"\"\"\\\n The VPC network from which the AlloyDB instance is accessible via private\n IP. For example, projects/myProject/global/networks/default. This setting\n cannot be updated after it is set.\n \"\"\"\n parser.add_argument('--network', help=help_text)",... | [
"0.58401304",
"0.5265187",
"0.51808554",
"0.5153473",
"0.50601035",
"0.4984594",
"0.4984594",
"0.4967094",
"0.49115896",
"0.49052155",
"0.48991242",
"0.48847353",
"0.4877635",
"0.48750907",
"0.48630336",
"0.48529854",
"0.48478016",
"0.48254016",
"0.48254016",
"0.48254016",
"0... | 0.7356384 | 0 |
Adds the `databaseflags` flag. | def AddDatabaseFlags(parser, update=False):
help_ = (
'Comma-separated list of database flags to set on the '
'instance. Use an equals sign to separate flag name and value. '
'Flags without values, like skip_grant_tables, can be written '
'out without a value after, e.g., `skip_grant_tables=`.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddDatabaseFlagsFlag(parser):\n help_text = \"\"\"\\\n Comma-separated list of database flags to set on the AlloyDB primary\n instance. Use an equals sign to separate the flag name and value. Flags\n without values, like skip_grant_tables, can be written out without a value,\n e.g., `skip_grant_ta... | [
"0.86675704",
"0.71289545",
"0.69100744",
"0.64274937",
"0.6336482",
"0.61435574",
"0.61176306",
"0.6062886",
"0.5960255",
"0.5575114",
"0.5573639",
"0.55451864",
"0.5407796",
"0.5338071",
"0.5333606",
"0.53126067",
"0.5302182",
"0.52999735",
"0.5279229",
"0.5236537",
"0.5226... | 0.8086966 | 1 |
Adds `databaseversion` to the parser with choices restricted or not. | def AddDatabaseVersion(
parser, restrict_choices=True, hidden=False, support_default_version=True
):
# Section for engine-specific content.
# This section is auto-generated by //cloud/storage_fe/sql/sync_engines.
# Do not make manual edits.
choices = [
'MYSQL_5_6',
'MYSQL_5_7',
'MYSQL_8_0'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_database_version(db, version):\n if not isinstance(version, int):\n raise TypeError(\"Version must be integer, not %s : %s\" % (\n version, type(version)))\n create_metadata = \\\n \"CREATE TABLE %s (version INT)\" % METADATA_COLUMN_NAME\n execute_sql(db, create_metadata)... | [
"0.6137412",
"0.57101154",
"0.53948134",
"0.5392527",
"0.5319123",
"0.53049004",
"0.52753377",
"0.52202904",
"0.5209845",
"0.5205972",
"0.5174368",
"0.51651174",
"0.51520216",
"0.5114212",
"0.50933826",
"0.5050371",
"0.5028357",
"0.5023651",
"0.5019566",
"0.50113094",
"0.5008... | 0.6880815 | 0 |
Adds the `network` flag to the parser. | def AddNetwork(parser):
parser.add_argument(
'--network',
help=(
'Network in the current project that the instance will be part '
'of. To specify using a network with a shared VPC, use the full '
"URL of the network. For an example host project, 'testproject', "
"an... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddNetworkFlag(parser):\n help_text = \"\"\"\\\n The VPC network from which the AlloyDB instance is accessible via private\n IP. For example, projects/myProject/global/networks/default. This setting\n cannot be updated after it is set.\n \"\"\"\n parser.add_argument('--network', help=help_text)",... | [
"0.82614785",
"0.74441427",
"0.7165131",
"0.65390617",
"0.65099496",
"0.6350283",
"0.62226874",
"0.61401385",
"0.5946246",
"0.59298396",
"0.5921964",
"0.5862368",
"0.58112574",
"0.5809751",
"0.57892287",
"0.57621217",
"0.5706179",
"0.567271",
"0.56154907",
"0.5572775",
"0.556... | 0.7745656 | 1 |
Adds the `allocatediprangename` flag to the parser. | def AddAllocatedIpRangeName(parser):
parser.add_argument(
'--allocated-ip-range-name',
required=False,
help=(
'The name of the IP range allocated for a Cloud SQL instance with '
'private network connectivity. For example: '
"'google-managed-services-default'. If set, th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddLocal(offset, name):\r\n return _hiew.HiewGate_Names_AddLocal(offset, name)",
"def make_name(self, offset, name, flags=0):\n self.ret = idc.set_name(offset, str(name), idc.SN_NOCHECK | idc.SN_NOWARN | 0x800)\n return self.ret",
"def add_contig_ena_attrib(self, log_pfx, cs_name = \"c... | [
"0.47430474",
"0.47005302",
"0.46748593",
"0.45487225",
"0.4522813",
"0.45146823",
"0.44278622",
"0.44076908",
"0.43772072",
"0.43767506",
"0.43720314",
"0.4369003",
"0.43367782",
"0.43362957",
"0.43298212",
"0.43283516",
"0.43263528",
"0.42938596",
"0.42938596",
"0.4293758",
... | 0.6203864 | 0 |
Adds the `maintenanceversion` flag to the parser. | def AddMaintenanceVersion(parser):
parser.add_argument(
'--maintenance-version',
required=False,
help='The desired maintenance version of the instance.',
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maintenance_version(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"maintenance_version\")",
"def _add_display_version(self, parser):\n\n version_flag = parser.add_argument_group(\"display the version number\")\n version_flag.add_argument(\n \"-v\", \"--versi... | [
"0.5982532",
"0.59237367",
"0.57169753",
"0.54743034",
"0.5460425",
"0.5371173",
"0.5350861",
"0.5213626",
"0.51769096",
"0.5051018",
"0.5030545",
"0.50135577",
"0.49990684",
"0.49458328",
"0.48658147",
"0.48404834",
"0.4810857",
"0.4757165",
"0.47542253",
"0.4723838",
"0.472... | 0.8363555 | 0 |
Adds SQL Server audit related flags to the parser. | def AddSqlServerAudit(parser):
parser.add_argument(
'--audit-bucket-path',
required=False,
help=(
'The location, as a Cloud Storage bucket, to which audit files are '
'uploaded. The URI is in the form gs://bucketName/folderName. Only '
'available for SQL Server instance... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_audit_monitoring():\n __enable_data_access_logging()\n __enable_log_streaming()\n __create_audit_alerts()\n __get_incidents_history()",
"def add_logging_flags(parser):\n parser.add_argument('--log-file',\n help='Write the log to file. By default, write to stdout.')\n parse... | [
"0.5754726",
"0.55487347",
"0.54940635",
"0.52709097",
"0.523885",
"0.5073111",
"0.50477314",
"0.501838",
"0.49518797",
"0.4942386",
"0.4932688",
"0.49228618",
"0.49121013",
"0.49015543",
"0.48863268",
"0.48664945",
"0.4863374",
"0.48230302",
"0.4771217",
"0.4754976",
"0.4737... | 0.6623401 | 0 |
Adds 'tier' flag to the parser. | def AddTier(parser, is_patch=False):
help_text = (
"Machine type for a shared-core instance e.g. ``db-g1-small''. "
'For all other instances, instead of using tiers, customize '
'your instance by specifying its CPU and memory. You can do so '
'with the `--cpu` and `--memory` flags. Learn more ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tier(self):\n\n if not hasattr(self, \"_tier\"):\n self._tier = self.opts.get(\"tier\")\n return self._tier",
"def run_on_tier(self, tier, tierY=None):\n raise NotImplementedError",
"def tier(self, tier):\n\n self._tier = tier",
"def GachaCraftNodeExcelAddTier(build... | [
"0.6795742",
"0.6580652",
"0.6401834",
"0.6323448",
"0.6322441",
"0.61200035",
"0.6117197",
"0.5952465",
"0.5952465",
"0.5952465",
"0.5940327",
"0.59163105",
"0.59163105",
"0.59163105",
"0.59163105",
"0.5909706",
"0.5776433",
"0.56890434",
"0.5660989",
"0.56511307",
"0.562082... | 0.74208856 | 0 |
Adds 'edition' flag to the parser. | def AddEdition(parser):
edition_flag = base.ChoiceArgument(
'--edition',
required=False,
choices=['enterprise', 'enterprise-plus'],
default=None,
help_str='Specifies the edition of Cloud SQL instance.',
)
edition_flag.AddToParser(parser) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddShowEdition(parser):\n kwargs = _GetKwargsForBoolFlag(False)\n parser.add_argument(\n '--show-edition',\n required=False,\n help='Show the edition field.',\n **kwargs\n )",
"def add_edition(self, edition): \n self.editions[edition.id] = edition",
"def _is_extra(self, editio... | [
"0.7278577",
"0.6643277",
"0.60177374",
"0.5387527",
"0.5289902",
"0.4946935",
"0.49363872",
"0.48631573",
"0.48231626",
"0.48188984",
"0.48120546",
"0.47593874",
"0.47245878",
"0.46514538",
"0.4630206",
"0.4583102",
"0.45528492",
"0.45310742",
"0.45007223",
"0.4497896",
"0.4... | 0.77131265 | 0 |
Adds the mutually exclusive `gcezone` and `zone` to the parser. | def AddZone(parser, help_text):
zone_group = parser.add_mutually_exclusive_group()
zone_group.add_argument(
'--gce-zone',
required=False,
action=actions.DeprecationAction(
'--gce-zone',
removed=False,
warn=(
'Flag `{flag_name}` is deprecated and will be ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddZonesPrimarySecondary(parser, help_text):\n\n zone_group = parser.add_group(required=False)\n zone_group.add_argument('--zone', required=False, help=help_text)\n zone_group.add_argument(\n '--secondary-zone',\n required=False,\n help=(\n 'Preferred secondary Compute Engine zone '\... | [
"0.5679664",
"0.5652884",
"0.5569741",
"0.5150994",
"0.509176",
"0.48873827",
"0.48614383",
"0.47953865",
"0.4763971",
"0.47557074",
"0.47435212",
"0.4736883",
"0.47045422",
"0.47029346",
"0.47029346",
"0.46325237",
"0.46181464",
"0.46000424",
"0.458795",
"0.4578816",
"0.4545... | 0.6797434 | 0 |
Adds the `zone` and `secondaryzone` to the parser. | def AddZonesPrimarySecondary(parser, help_text):
zone_group = parser.add_group(required=False)
zone_group.add_argument('--zone', required=False, help=help_text)
zone_group.add_argument(
'--secondary-zone',
required=False,
help=(
'Preferred secondary Compute Engine zone '
'(e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddZone(parser, help_text):\n zone_group = parser.add_mutually_exclusive_group()\n zone_group.add_argument(\n '--gce-zone',\n required=False,\n action=actions.DeprecationAction(\n '--gce-zone',\n removed=False,\n warn=(\n 'Flag `{flag_name}` is deprecate... | [
"0.6601153",
"0.59946895",
"0.5909362",
"0.5268667",
"0.51557803",
"0.50763166",
"0.50582975",
"0.5056213",
"0.5050436",
"0.5036316",
"0.50328624",
"0.5004188",
"0.49928698",
"0.49830547",
"0.49161947",
"0.48599792",
"0.4798615",
"0.47870925",
"0.4780119",
"0.47605637",
"0.47... | 0.72060263 | 0 |
Add the 'uri' argument to the parser, with help text help_text. | def AddUriArgument(parser, help_text):
parser.add_argument('uri', help=help_text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddBakImportUriArgument(parser, help_text):\n parser.add_argument('uri', help=help_text, nargs='?', default='')",
"def set_uri(self, uri):\r\n self.uri = uri",
"def parser(self):\n if 'Url' in self.options:\n self.options['u'] = self.options['Url']",
"def uri(self, uri):\n ... | [
"0.744633",
"0.60369056",
"0.5911336",
"0.58935505",
"0.58935505",
"0.5839622",
"0.58366394",
"0.5809489",
"0.57940567",
"0.5775622",
"0.5775622",
"0.57292265",
"0.56722283",
"0.5651382",
"0.56085885",
"0.56020755",
"0.557563",
"0.5575323",
"0.55470836",
"0.5526254",
"0.55177... | 0.8673255 | 0 |
Add the 'uri' argument to the parser, with help text help_text. | def AddBakImportUriArgument(parser, help_text):
parser.add_argument('uri', help=help_text, nargs='?', default='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddUriArgument(parser, help_text):\n parser.add_argument('uri', help=help_text)",
"def set_uri(self, uri):\r\n self.uri = uri",
"def parser(self):\n if 'Url' in self.options:\n self.options['u'] = self.options['Url']",
"def uri(self, uri):\n self._uri = uri",
"def uri(s... | [
"0.86736596",
"0.6040896",
"0.5912826",
"0.5897504",
"0.5897504",
"0.5843568",
"0.5841082",
"0.58123887",
"0.57960224",
"0.5779411",
"0.5779411",
"0.57267725",
"0.56697655",
"0.5646246",
"0.56105435",
"0.5600879",
"0.55722135",
"0.5571824",
"0.5550868",
"0.55290186",
"0.55211... | 0.7447248 | 1 |
Add the 'offload' argument to the parser. | def AddOffloadArgument(parser):
parser.add_argument(
'--offload',
action='store_true',
help=(
'Offload an export to a temporary instance. Doing so reduces strain '
'on source instances and allows other operations to be performed '
'while the export is in progress.'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_args(parser):\n # fmt: off\n parser.add_argument('--pixel-loss-type', type=str, default='l1')\n # fmt: on",
"def add_args(parser):\n parser.add_argument(\n \"--zero-infinity\", action=\"store_true\", help=\"zero inf loss\"\n )\n try:\n parse... | [
"0.5244468",
"0.4926412",
"0.4894443",
"0.4893504",
"0.4839896",
"0.48121524",
"0.48106474",
"0.4795272",
"0.47818068",
"0.47590706",
"0.47477973",
"0.47196978",
"0.46892172",
"0.4664385",
"0.4649746",
"0.4645236",
"0.4640426",
"0.4620128",
"0.46164766",
"0.46010393",
"0.4569... | 0.7350838 | 0 |
Add the 'quote' argument to the parser. | def AddQuoteArgument(parser):
parser.add_argument(
'--quote',
help=(
'Specifies the character that encloses values from columns that have '
'string data type. The value of this argument has to be a character '
'in Hex ASCII Code. For example, "22" represents double quotes. '
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def addquote(self, ctx, *, quote : str):\n if not self.addquote_regex.match(quote):\n await ctx.send(\"`Quote must be in this format (including surrounding single quotes):\\n'some quote here - quote author'`\")\n else:\n with open(\"data/quotes.txt\", \"a\") as text_file:\... | [
"0.66271794",
"0.625424",
"0.60960406",
"0.5961926",
"0.58721024",
"0.57281125",
"0.5623154",
"0.5579323",
"0.54628325",
"0.54578215",
"0.5440817",
"0.5380102",
"0.52957565",
"0.52779496",
"0.52731305",
"0.5230325",
"0.5228598",
"0.5221712",
"0.52080035",
"0.52071714",
"0.518... | 0.7811726 | 0 |
Add the 'escape' argument to the parser. | def AddEscapeArgument(parser):
parser.add_argument(
'--escape',
help=(
'Specifies the character that should appear before a data character '
'that needs to be escaped. The value of this argument has to be a '
'character in Hex ASCII Code. For example, "22" represents double '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def escape(self):\n pass",
"def escape(self) :\n #self.logdebug(\"ESCAPE\")\n self.handleTag(self.esctags)",
"def _escapeArg(arg):\n #XXX There is a *lot* more that we should escape here.\n return arg.replace('\"', r'\\\"')",
"def AddQuoteArgument(parser):\n parser.add_argument(\n... | [
"0.6242349",
"0.6027748",
"0.5942918",
"0.58683044",
"0.56702167",
"0.56318194",
"0.55915904",
"0.5550471",
"0.5481451",
"0.5433678",
"0.5335679",
"0.5334224",
"0.52747405",
"0.52683616",
"0.5262852",
"0.5260482",
"0.52314687",
"0.5185602",
"0.518417",
"0.5114768",
"0.5109612... | 0.7779628 | 0 |
Add the 'fieldsterminatedby' argument to the parser. | def AddFieldsDelimiterArgument(parser):
parser.add_argument(
'--fields-terminated-by',
help=(
'Specifies the character that splits column values. The value of this'
' argument has to be a character in Hex ASCII Code. For example, "2C"'
' represents a comma. This flag is only ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_select_fields(self, params: Dict) -> str:\n return '*'",
"def is_union(self) -> bool:\n return bool(AnnotationWrapper.union_field_re.match(self.data))",
"def add_parser_from_field(self, name, field_cls):\n self.__parser_map__[name] = _field2method(field_cls, method_name=name)",
"... | [
"0.42923656",
"0.42118046",
"0.4199833",
"0.41979244",
"0.4160975",
"0.4160975",
"0.4150832",
"0.4150832",
"0.41121146",
"0.4108938",
"0.40325537",
"0.40260315",
"0.4015834",
"0.4012623",
"0.4010266",
"0.3949837",
"0.39343375",
"0.38837972",
"0.38774404",
"0.38750327",
"0.385... | 0.53323764 | 0 |
Add the 'linesterminatedby' argument to the parser. | def AddLinesDelimiterArgument(parser):
parser.add_argument(
'--lines-terminated-by',
help=(
'Specifies the character that split line records. The value of this '
'argument has to be a character in Hex ASCII Code. For example, '
'"0A" represents a new line. This flag is only a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def doomed_parser(line):\n raise exceptions.LineParseException('Error occurred')",
"def parse_line(self, line):\n raise NotImplementedError",
"def lineparse(inline, options=None, **keywargs):\n p = LineParser(options, **keywargs)\n return p.feed(inline)",
"def on_new_line(self, line, is_full_... | [
"0.5180503",
"0.50595725",
"0.5052065",
"0.49872667",
"0.4950422",
"0.4916276",
"0.4916276",
"0.49115512",
"0.4906298",
"0.4823618",
"0.48152936",
"0.4776384",
"0.4742913",
"0.4722949",
"0.4716269",
"0.47105917",
"0.45992926",
"0.4574679",
"0.45705557",
"0.4546088",
"0.453815... | 0.5333101 | 0 |
Add the 'user' flag to the parser, with help text help_text. | def AddUser(parser, help_text):
parser.add_argument('--user', help=help_text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddUsernameFlag(parser, required=False):\n help_text = \"\"\"\\\n Username that Database Migration Service uses to connect to the\n database. Database Migration Service encrypts the value when storing it.\n \"\"\"\n parser.add_argument('--username', help=help_text, required=required)",
"def add_he... | [
"0.66041774",
"0.58101714",
"0.5800177",
"0.57064",
"0.56632084",
"0.56596696",
"0.56322503",
"0.5620333",
"0.5590513",
"0.55446875",
"0.55446875",
"0.5486328",
"0.54733646",
"0.5457554",
"0.54313874",
"0.5410428",
"0.5398567",
"0.5394291",
"0.5392334",
"0.538072",
"0.5355218... | 0.824093 | 0 |
Add the flags for importing encrypted BAK files. Add the certpath, pvkpath, pvkpassword and promptforpvkpassword flags to the parser | def AddEncryptedBakFlags(parser):
enc_group = parser.add_group(
mutex=False,
required=False,
help='Encryption info to support importing an encrypted .bak file',
)
enc_group.add_argument(
'--cert-path',
required=True,
help=(
'Path to the encryption certificate file in ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_keypass_options(subcmd, pfx):\n\n keypass_grp = subcmd.add_argument_group('Key / Password Select')\n\n kpg = keypass_grp.add_mutually_exclusive_group(required=True)\n\n kpg.add_argument(\n '--use-key', action='store_true', dest='use_key',\n help='enables usage of key for {}cryption ... | [
"0.5710628",
"0.5361637",
"0.51329273",
"0.50375926",
"0.50209004",
"0.49915224",
"0.49597734",
"0.49313658",
"0.49163488",
"0.48998457",
"0.48909655",
"0.48850897",
"0.48352158",
"0.48277882",
"0.48221573",
"0.47659805",
"0.47292712",
"0.46956238",
"0.46956238",
"0.46901417",
... | 0.70911825 | 0 |
Add the 'stripe_count' argument to the parser for striped export. | def AddBakExportStripeCountArgument(parser):
parser.add_argument(
'--stripe_count',
type=int,
default=None,
help='Specifies the number of stripes to use for SQL Server exports.',
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_count_filter(source, args, index):\n tags = hxl.TagPattern.parse_list(args.get('count-tags%02d' % index, ''))\n row_query = args.get('count-where%02d' % index, None)\n\n aggregators = []\n for n in range(1, 25):\n suffix = '%02d-%02d' % (index, n,)\n count_type = args.get('count-t... | [
"0.47055963",
"0.44180313",
"0.43728918",
"0.4362503",
"0.42809635",
"0.42556268",
"0.424526",
"0.41946474",
"0.41866273",
"0.41834158",
"0.41787595",
"0.4173754",
"0.41513705",
"0.41339618",
"0.4115049",
"0.40781346",
"0.40751508",
"0.40690935",
"0.40413123",
"0.40388232",
"... | 0.71469784 | 0 |
Add the 'striped' argument to the parser for striped export. | def AddBakExportStripedArgument(parser, show_negated_in_help=True):
kwargs = _GetKwargsForBoolFlag(show_negated_in_help)
parser.add_argument(
'--striped',
required=False,
help='Whether SQL Server export should be striped.',
**kwargs
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddBakImportStripedArgument(parser, show_negated_in_help=True):\n kwargs = _GetKwargsForBoolFlag(show_negated_in_help)\n parser.add_argument(\n '--striped',\n required=False,\n help='Whether SQL Server import should be striped.',\n **kwargs\n )",
"def quickWipe(strip):\n for i in ra... | [
"0.6455419",
"0.4690204",
"0.4688822",
"0.4648297",
"0.4407309",
"0.4391965",
"0.433227",
"0.42911524",
"0.42151272",
"0.41858506",
"0.41839904",
"0.4160355",
"0.41490537",
"0.41469353",
"0.41331798",
"0.41016704",
"0.40896225",
"0.40806228",
"0.40093362",
"0.40000468",
"0.39... | 0.71108663 | 0 |
Add the 'baktype' argument to the parser for bak import. | def AddBakExportBakTypeArgument(parser):
choices = [
messages.ExportContext.BakExportOptionsValue.BakTypeValueValuesEnum.FULL.name,
messages.ExportContext.BakExportOptionsValue.BakTypeValueValuesEnum.DIFF.name,
]
help_text = (
'Type of bak file that will be exported, FULL or DIFF. SQL Server onl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddBakImportBakTypeArgument(parser):\n choices = [\n messages.ImportContext.BakImportOptionsValue.BakTypeValueValuesEnum.FULL.name,\n messages.ImportContext.BakImportOptionsValue.BakTypeValueValuesEnum.DIFF.name,\n ]\n help_text = (\n 'Type of bak file that will be imported, FULL or DIFF. SQL... | [
"0.7940913",
"0.5407361",
"0.518261",
"0.508193",
"0.49488503",
"0.492458",
"0.4888737",
"0.48081475",
"0.47686827",
"0.46175164",
"0.46175164",
"0.45891565",
"0.45891353",
"0.45832282",
"0.45665452",
"0.4546566",
"0.4458011",
"0.43795037",
"0.4376776",
"0.43753543",
"0.43706... | 0.7217621 | 1 |
Add the 'dfferentialbase' argument to the parser for export. | def AddBakExportDifferentialBaseArgument(parser):
parser.add_argument(
'--differential-base',
required=False,
default=False,
action='store_true',
help=(
'Whether the bak file export can be used as differential base for'
' future differential backup. SQL Server only'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_base(self, base):\n self.base = base",
"def add_biodata_args(parser):\n parser.add_argument(\"--genomes\", help=\"Genomes to download\",\n action=\"append\", default=[],\n choices=SUPPORTED_GENOMES)\n parser.add_argument(\"--aligners\", help=\"Al... | [
"0.5075229",
"0.48574767",
"0.47521338",
"0.4744729",
"0.47424608",
"0.47375286",
"0.4728745",
"0.47184315",
"0.46976683",
"0.4679318",
"0.4659806",
"0.46155065",
"0.45566046",
"0.45293504",
"0.45283028",
"0.45123765",
"0.44951785",
"0.4482304",
"0.44652253",
"0.4456376",
"0.... | 0.652165 | 0 |
Add the 'striped' argument to the parser for striped import. | def AddBakImportStripedArgument(parser, show_negated_in_help=True):
kwargs = _GetKwargsForBoolFlag(show_negated_in_help)
parser.add_argument(
'--striped',
required=False,
help='Whether SQL Server import should be striped.',
**kwargs
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddBakExportStripedArgument(parser, show_negated_in_help=True):\n kwargs = _GetKwargsForBoolFlag(show_negated_in_help)\n parser.add_argument(\n '--striped',\n required=False,\n help='Whether SQL Server export should be striped.',\n **kwargs\n )",
"def open_strip(self, x):\n self... | [
"0.6506912",
"0.4974384",
"0.44501916",
"0.4444506",
"0.43988526",
"0.4309472",
"0.43084028",
"0.41405934",
"0.41309607",
"0.4111585",
"0.40899467",
"0.40512374",
"0.4043084",
"0.40214506",
"0.399438",
"0.3989201",
"0.39442655",
"0.39439312",
"0.3931987",
"0.39316702",
"0.390... | 0.7013856 | 0 |
Add the 'norecovery' argument to the parser for import with no recovery option. | def AddBakImportNoRecoveryArgument(parser):
parser.add_argument(
'--no-recovery',
required=False,
default=False,
action='store_true',
help=(
'Whether or not the SQL Server import '
'is execueted with NORECOVERY keyword.'
),
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddBakImportRecoveryOnlyArgument(parser):\n parser.add_argument(\n '--recovery-only',\n required=False,\n default=False,\n action='store_true',\n help=(\n 'Whether or not the SQL Server import '\n 'skip download and bring database online.'\n ),\n )",
"def dis... | [
"0.66011393",
"0.5517377",
"0.51031774",
"0.47874084",
"0.47269878",
"0.47240013",
"0.4713448",
"0.45914173",
"0.45450297",
"0.453761",
"0.45181933",
"0.44986486",
"0.4483504",
"0.44138035",
"0.44061086",
"0.43912563",
"0.43912563",
"0.43859637",
"0.43828723",
"0.4358921",
"0... | 0.70562875 | 0 |
Add the 'recoveryonly' argument to the parser for bak import. | def AddBakImportRecoveryOnlyArgument(parser):
parser.add_argument(
'--recovery-only',
required=False,
default=False,
action='store_true',
help=(
'Whether or not the SQL Server import '
'skip download and bring database online.'
),
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddBakImportNoRecoveryArgument(parser):\n parser.add_argument(\n '--no-recovery',\n required=False,\n default=False,\n action='store_true',\n help=(\n 'Whether or not the SQL Server import '\n 'is execueted with NORECOVERY keyword.'\n ),\n )",
"def AddBakImpo... | [
"0.70548034",
"0.53845555",
"0.47780085",
"0.47283888",
"0.46117136",
"0.46112975",
"0.4588539",
"0.45837978",
"0.45787892",
"0.45683828",
"0.45673585",
"0.45451322",
"0.45103556",
"0.45097846",
"0.4493411",
"0.44906193",
"0.4485185",
"0.44715965",
"0.44666964",
"0.44586945",
... | 0.7706456 | 0 |
Add the 'baktype' argument to the parser for bak import. | def AddBakImportBakTypeArgument(parser):
choices = [
messages.ImportContext.BakImportOptionsValue.BakTypeValueValuesEnum.FULL.name,
messages.ImportContext.BakImportOptionsValue.BakTypeValueValuesEnum.DIFF.name,
]
help_text = (
'Type of bak file that will be imported, FULL or DIFF. SQL Server onl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddBakExportBakTypeArgument(parser):\n choices = [\n messages.ExportContext.BakExportOptionsValue.BakTypeValueValuesEnum.FULL.name,\n messages.ExportContext.BakExportOptionsValue.BakTypeValueValuesEnum.DIFF.name,\n ]\n help_text = (\n 'Type of bak file that will be exported, FULL or DIFF. SQL... | [
"0.72169626",
"0.5404604",
"0.51787686",
"0.5078016",
"0.49511313",
"0.49201402",
"0.4886562",
"0.48055965",
"0.47654018",
"0.46195787",
"0.46195787",
"0.45887697",
"0.45869341",
"0.4582101",
"0.4567508",
"0.45427778",
"0.44553012",
"0.4380127",
"0.4375898",
"0.43758497",
"0.... | 0.79403734 | 0 |
Add the flag to specify reschedule type. | def AddRescheduleType(parser):
choices = [
messages.Reschedule.RescheduleTypeValueValuesEnum.IMMEDIATE.name,
messages.Reschedule.RescheduleTypeValueValuesEnum.NEXT_AVAILABLE_WINDOW.name,
messages.Reschedule.RescheduleTypeValueValuesEnum.SPECIFIC_TIME.name,
]
help_text = 'The type of reschedule o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def schedule_type(self, schedule_type):\n\n self._schedule_type = schedule_type",
"def schedule_type(self, schedule_type):\n\n self._schedule_type = schedule_type",
"def add_flag(self, flag):\n self.flags.append(flag)",
"def type(self, type):\n allowed_values = [\"RETRIEVAL\", \"T... | [
"0.60877156",
"0.60877156",
"0.5678477",
"0.5609437",
"0.5590203",
"0.55642927",
"0.55174804",
"0.5430078",
"0.5417818",
"0.533532",
"0.5324069",
"0.52786005",
"0.5221365",
"0.52029437",
"0.5197706",
"0.51934063",
"0.50866306",
"0.5036165",
"0.4960266",
"0.49541867",
"0.49502... | 0.74558413 | 0 |
Add the flag for maintenance reschedule schedule time. | def AddScheduleTime(parser):
parser.add_argument(
'--schedule-time',
type=arg_parsers.Datetime.Parse,
help=(
'When specifying SPECIFIC_TIME, the date and time at which to '
'schedule the maintenance in ISO 8601 format.'
),
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_reschedule(self) -> bool:\n return pulumi.get(self, \"can_reschedule\")",
"def set_schedule(self, new_schedule):\n #first, set all the others to inactive\n\n new_schedule.deprecated=False\n if new_schedule.started == None or new_schedule.started <= datetime.utcnow():\n ... | [
"0.62519795",
"0.62485415",
"0.60083526",
"0.5909267",
"0.56841016",
"0.5580091",
"0.55792874",
"0.5538592",
"0.5504612",
"0.5498011",
"0.5492185",
"0.548266",
"0.5464063",
"0.5427234",
"0.5410349",
"0.53988063",
"0.5382641",
"0.5368062",
"0.5311639",
"0.5293654",
"0.5266905"... | 0.6298715 | 0 |
Add the flag for ID of backup run. | def AddBackupRunId(parser):
parser.add_argument(
'id',
type=arg_parsers.BoundedInt(lower_bound=1, unlimited=True),
help=(
'The ID of the backup run. You can find the ID by running '
'$ gcloud sql backups list -i {instance}.'
),
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_flag(self, flag):\n self.flags.append(flag)",
"def flag_ID(self, username, video_ID):\n done = self.cur.execute(\"SELECT video_ID from flags WHERE video_ID = \\\"{}\\\"\".format(video_ID))\n if done == 0: # Not yet flagged by any user.\n try:\n self.cur.exec... | [
"0.59954417",
"0.59428287",
"0.5894306",
"0.5426864",
"0.5311643",
"0.52666116",
"0.5221735",
"0.51967144",
"0.5195558",
"0.5184444",
"0.51438767",
"0.50937104",
"0.5055998",
"0.50469786",
"0.49788308",
"0.49583656",
"0.49523938",
"0.49367768",
"0.49352047",
"0.4910939",
"0.4... | 0.6458485 | 0 |
Add the flag to specify password policy min length. | def AddPasswordPolicyMinLength(parser):
parser.add_argument(
'--password-policy-min-length',
type=int,
required=False,
default=None,
help='Minimum number of characters allowed in the password.',
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def password_min_length(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"password_min_length\")",
"def password_min_length(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"password_min_length\")",
"def password_min_length(self) -> pulumi.Output[Optional[int]]:\n ... | [
"0.7338615",
"0.7338615",
"0.7297102",
"0.70198464",
"0.6973155",
"0.65584165",
"0.6516192",
"0.6469833",
"0.6349671",
"0.627157",
"0.6250086",
"0.62438023",
"0.62075853",
"0.61517984",
"0.6104707",
"0.61007947",
"0.61007947",
"0.6088677",
"0.6084145",
"0.60801446",
"0.606849... | 0.8394822 | 0 |
Add the flag to specify password policy complexity. | def AddPasswordPolicyComplexity(parser):
parser.add_argument(
'--password-policy-complexity',
choices={
'COMPLEXITY_UNSPECIFIED': (
'The default value if COMPLEXITY_DEFAULT is not specified. It'
' implies that complexity check is not enabled.'
),
'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddPasswordFlag(parser):\n parser.add_argument(\n '--password',\n required=True,\n help=\"Initial password for the 'postgres' user.\")",
"def AddPasswordPolicyMinLength(parser):\n parser.add_argument(\n '--password-policy-min-length',\n type=int,\n required=False,\n defau... | [
"0.65033937",
"0.6355364",
"0.633643",
"0.61298424",
"0.60696745",
"0.60396177",
"0.59739697",
"0.5964365",
"0.5960089",
"0.59228206",
"0.58141667",
"0.56435525",
"0.56347096",
"0.5622266",
"0.5593483",
"0.5580163",
"0.557231",
"0.5569042",
"0.55366737",
"0.55162835",
"0.5508... | 0.7779152 | 0 |
Add the flag to specify password policy reuse interval. | def AddPasswordPolicyReuseInterval(parser):
parser.add_argument(
'--password-policy-reuse-interval',
type=arg_parsers.BoundedInt(lower_bound=0, upper_bound=100),
required=False,
default=None,
help=(
'Number of previous passwords that cannot be reused. The valid range'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_login_password_reuse_interval(device,interval):\n cmd = f\"login password-reuse-interval {interval}\"\n try:\n device.configure(cmd)\n except SubCommandFailure as e:\n raise SubCommandFailure(\n f'Could not configure login password-reuse-interval:\\n{e}'\n )",
... | [
"0.6599917",
"0.62419116",
"0.60906726",
"0.5944288",
"0.5583044",
"0.55295885",
"0.5474902",
"0.5308878",
"0.5293277",
"0.527923",
"0.525907",
"0.52517194",
"0.5216365",
"0.5189878",
"0.5183518",
"0.5137723",
"0.5102832",
"0.5092627",
"0.5046123",
"0.5032257",
"0.49781278",
... | 0.82080066 | 0 |
Add the flag to specify password policy disallow username as substring. | def AddPasswordPolicyDisallowUsernameSubstring(
parser, show_negated_in_help=True
):
kwargs = _GetKwargsForBoolFlag(show_negated_in_help)
parser.add_argument(
'--password-policy-disallow-username-substring',
required=False,
help='Disallow username as a part of the password.',
**kwargs
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disallow_username_substring(self) -> bool:\n return pulumi.get(self, \"disallow_username_substring\")",
"def acceptsPassword(self):\r\n raise NotImplementedError()",
"def get_allowed_auths(self, username):\n return 'password'",
"def password_exclude_username(self) -> Optional[pulumi.... | [
"0.70240325",
"0.6628872",
"0.6437872",
"0.62350005",
"0.62350005",
"0.60877174",
"0.6063737",
"0.59973085",
"0.59960824",
"0.5968133",
"0.5867298",
"0.58435595",
"0.5809912",
"0.5809912",
"0.57951665",
"0.57690203",
"0.5755491",
"0.5742729",
"0.5742729",
"0.5722654",
"0.5719... | 0.81435615 | 0 |
Add the flag to specify password policy password change interval. | def AddPasswordPolicyPasswordChangeInterval(parser):
parser.add_argument(
'--password-policy-password-change-interval',
default=None,
type=arg_parsers.Duration(lower_bound='1s'),
required=False,
help="""\
Minimum interval after which the password can be changed, for example,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddPasswordPolicyReuseInterval(parser):\n parser.add_argument(\n '--password-policy-reuse-interval',\n type=arg_parsers.BoundedInt(lower_bound=0, upper_bound=100),\n required=False,\n default=None,\n help=(\n 'Number of previous passwords that cannot be reused. The valid rang... | [
"0.7057645",
"0.6974068",
"0.66888136",
"0.63394636",
"0.5967842",
"0.59546196",
"0.59208876",
"0.58907443",
"0.5755655",
"0.57435614",
"0.57421327",
"0.57052374",
"0.5672057",
"0.5627041",
"0.5622442",
"0.55982",
"0.5585433",
"0.55552644",
"0.5514934",
"0.5505389",
"0.548693... | 0.81387085 | 0 |
Add the flag to enable password policy. | def AddPasswordPolicyEnablePasswordPolicy(parser, show_negated_in_help=False):
kwargs = _GetKwargsForBoolFlag(show_negated_in_help)
parser.add_argument(
'--enable-password-policy',
required=False,
help="""\
Enable the password policy, which enforces user password management with
th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_password_policy(self) -> bool:\n return pulumi.get(self, \"enable_password_policy\")",
"def AddPasswordPolicyEnablePasswordVerification(\n parser, show_negated_in_help=True\n):\n kwargs = _GetKwargsForBoolFlag(show_negated_in_help)\n parser.add_argument(\n '--password-policy-enable-pa... | [
"0.7625952",
"0.7287185",
"0.71293885",
"0.70516557",
"0.6513838",
"0.6412303",
"0.6398679",
"0.6367954",
"0.6337875",
"0.63157564",
"0.62955236",
"0.6264876",
"0.62484324",
"0.6237766",
"0.6184039",
"0.61382765",
"0.6127616",
"0.6077503",
"0.6012887",
"0.60056275",
"0.597863... | 0.7418626 | 1 |
Add the flag to clear password policy. | def AddPasswordPolicyClearPasswordPolicy(parser, show_negated_in_help=False):
kwargs = _GetKwargsForBoolFlag(show_negated_in_help)
parser.add_argument(
'--clear-password-policy',
required=False,
help=(
'Clear the existing password policy. This flag is only available for'
' Post... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_password(self, e):\n\n self.password.label.config(show='*')\n if self.password.get() == 'Enter Enovia Password':\n self.password.clear()",
"def onPasswordFocusIn(self,event):\n if self.obj2.get() == \"New Password\":\n self.obj2.delete(0,END)",
"def on_limpi... | [
"0.66407937",
"0.60847825",
"0.60481185",
"0.6038799",
"0.60043156",
"0.5975018",
"0.59346485",
"0.5879609",
"0.5846929",
"0.58411086",
"0.5825385",
"0.57936054",
"0.57784045",
"0.57533014",
"0.57261795",
"0.57011634",
"0.5679182",
"0.56746274",
"0.5674589",
"0.5665729",
"0.5... | 0.69269943 | 0 |
Add the flag to specify expiration duration after password is updated. | def AddPasswordPolicyPasswordExpirationDuration(parser):
parser.add_argument(
'--password-policy-password-expiration-duration',
default=None,
type=arg_parsers.Duration(lower_bound='1s'),
required=False,
help="""\
Expiration duration after a password is updated, for example,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def password_expiration_time(self) -> str:\n return pulumi.get(self, \"password_expiration_time\")",
"def password_expiration_duration(self) -> str:\n return pulumi.get(self, \"password_expiration_duration\")",
"def test_password_expire(self):\n user_dn = \"cn=skip,ou=nerdherd,dc=bonsai,dc... | [
"0.6815433",
"0.6763244",
"0.6377349",
"0.6323702",
"0.62815243",
"0.6259745",
"0.6178476",
"0.6175795",
"0.6174373",
"0.60759944",
"0.6055065",
"0.60074884",
"0.5906114",
"0.5864695",
"0.58205926",
"0.5804013",
"0.5788109",
"0.5764239",
"0.57447624",
"0.5732011",
"0.57283974... | 0.7193262 | 0 |
Add the flag to enable the failed login attempts check. | def AddPasswordPolicyEnableFailedAttemptsCheck(
parser, show_negated_in_help=True
):
kwargs = _GetKwargsForBoolFlag(show_negated_in_help)
parser.add_argument(
'--password-policy-enable-failed-attempts-check',
required=False,
help=(
'Enables the failed login attempts check if set to t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_failed_attempts_check(self) -> bool:\n return pulumi.get(self, \"enable_failed_attempts_check\")",
"def reste_login_attempts(self):\n self.login_attempts = 0",
"def AddPasswordPolicyAllowedFailedAttempts(parser):\n parser.add_argument(\n '--password-policy-allowed-failed-attempts... | [
"0.7457105",
"0.6436934",
"0.6209583",
"0.61616445",
"0.61545736",
"0.6059729",
"0.6059729",
"0.6023052",
"0.59677154",
"0.59677154",
"0.59677154",
"0.59677154",
"0.59677154",
"0.59677154",
"0.59677154",
"0.5908376",
"0.5810325",
"0.57646906",
"0.5748309",
"0.5692883",
"0.568... | 0.6952247 | 1 |
Add the flag to specify password policy password verification. | def AddPasswordPolicyEnablePasswordVerification(
parser, show_negated_in_help=True
):
kwargs = _GetKwargsForBoolFlag(show_negated_in_help)
parser.add_argument(
'--password-policy-enable-password-verification',
required=False,
help=(
'The current password must be specified when alteri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddPasswordFlag(parser):\n parser.add_argument(\n '--password',\n required=True,\n help=\"Initial password for the 'postgres' user.\")",
"def AddPasswordPolicyEnablePasswordPolicy(parser, show_negated_in_help=False):\n kwargs = _GetKwargsForBoolFlag(show_negated_in_help)\n parser.add_argume... | [
"0.7104645",
"0.68122107",
"0.6706708",
"0.6651802",
"0.6501447",
"0.6442186",
"0.6418242",
"0.6330845",
"0.6251018",
"0.6233185",
"0.6230664",
"0.6160115",
"0.61288124",
"0.60708183",
"0.60418785",
"0.6016241",
"0.6008064",
"0.59894454",
"0.5989153",
"0.59353906",
"0.5934026... | 0.7786479 | 0 |
Will discard the user's secondary password. | def AddUserDiscardDualPassword(parser):
kwargs = _GetKwargsForBoolFlag(False)
parser.add_argument(
'--discard-dual-password',
required=False,
help=(
"Discard the user's secondary password. Cannot set password and set"
' this flag. This flag is only available for MySQL 8.0.'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide_passwords(text):\n return None if text is None else PASSWORD_PATTERN.sub(r'\\1{}\\3'.format(PASSWORD_REPLACEMENT), text)",
"def password_exclude_username(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"password_exclude_username\")",
"def clean_password(self):\n retur... | [
"0.6878464",
"0.65010697",
"0.6410548",
"0.6363237",
"0.6363237",
"0.63359314",
"0.6178232",
"0.6153914",
"0.6066207",
"0.60348785",
"0.6021872",
"0.59848",
"0.5965269",
"0.5958525",
"0.5936875",
"0.59186625",
"0.59080577",
"0.5904041",
"0.58897215",
"0.5867987",
"0.5867861",... | 0.66905 | 1 |
Adds the `timezone` flag to the parser. | def AddSqlServerTimeZone(parser):
parser.add_argument(
'--time-zone',
required=False,
help=(
'Set a non-default time zone. '
'Only available for SQL Server instances.'
),
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add(timezone: str):\n utils.validate_timezone(timezone)\n config_file = variables.config_file\n\n if not utils.check_config():\n with open(config_file, \"w+\") as newfile:\n pass\n\n with open(config_file, \"r+\") as file:\n data: List = [line.rstrip() for line in file]\n\n... | [
"0.6048807",
"0.5776214",
"0.57642853",
"0.5586408",
"0.55384123",
"0.55141443",
"0.54885036",
"0.5443314",
"0.53075206",
"0.53068864",
"0.5224209",
"0.5182866",
"0.5160024",
"0.5160024",
"0.5160024",
"0.5160024",
"0.5160024",
"0.5137101",
"0.5120673",
"0.5115645",
"0.4994564... | 0.61372286 | 0 |
Adds the `threadspercore` flag to the parser. | def AddThreadsPerCore(parser):
parser.add_argument(
'--threads-per-core',
type=int,
required=False,
help="""\
The number of threads per core. The value of this flag can be 1 or 2.
To disable SMT, set this flag to 1. Only available in Cloud SQL for SQL Server instances.
""... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_core(self, core):\n self.core = core\n mask = 1 << core\n self.cmd += ' --cores {}'.format(str(hex(mask)))",
"def threads_per_core(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"threads_per_core\")",
"def __init__(__self__, *,\n threads_per... | [
"0.62071705",
"0.56629515",
"0.56616366",
"0.55816096",
"0.54096925",
"0.5367205",
"0.53397936",
"0.5212968",
"0.517704",
"0.51498383",
"0.50940293",
"0.49997082",
"0.4927794",
"0.4835412",
"0.48109323",
"0.47707593",
"0.476235",
"0.47535443",
"0.47513196",
"0.47026443",
"0.4... | 0.76944137 | 0 |
Adds the `showsqlnetworkarchitecture` flag to the parser. | def AddShowSqlNetworkArchitecture(parser):
kwargs = _GetKwargsForBoolFlag(False)
parser.add_argument(
'--show-sql-network-architecture',
hidden=True,
required=False,
help="""Show the instance's current SqlNetworkArchitecture backend""",
**kwargs
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddNetworkFlag(parser):\n help_text = \"\"\"\\\n The VPC network from which the AlloyDB instance is accessible via private\n IP. For example, projects/myProject/global/networks/default. This setting\n cannot be updated after it is set.\n \"\"\"\n parser.add_argument('--network', help=help_text)",... | [
"0.60939467",
"0.4896822",
"0.4840449",
"0.46413997",
"0.46394232",
"0.4637761",
"0.46119648",
"0.45424688",
"0.45417345",
"0.4514086",
"0.45050585",
"0.4475097",
"0.4473381",
"0.4426959",
"0.44091964",
"0.4405925",
"0.4376561",
"0.43761155",
"0.43761155",
"0.43300697",
"0.43... | 0.8340917 | 0 |
Returns the table format for listing instances with current network architecture field. | def GetInstanceListFormatForNetworkArchitectureUpgrade():
table_format = '{} table({})'.format(
INSTANCES_USERLABELS_FORMAT,
','.join(INSTANCES_FORMAT_COLUMNS_WITH_NETWORK_ARCHITECTURE),
)
return table_format | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetInstanceListFormat():\n table_format = '{} table({})'.format(\n INSTANCES_USERLABELS_FORMAT, ','.join(INSTANCES_FORMAT_COLUMNS)\n )\n return table_format",
"def GetInstanceListFormatEdition():\n table_format = '{} table({})'.format(\n INSTANCES_USERLABELS_FORMAT, ','.join(INSTANCES_FORMAT_CO... | [
"0.6528403",
"0.62991047",
"0.600538",
"0.5725569",
"0.57014483",
"0.5675609",
"0.5646435",
"0.5646435",
"0.5532929",
"0.5471471",
"0.5437365",
"0.54218966",
"0.538598",
"0.5359808",
"0.53277946",
"0.5316713",
"0.53031075",
"0.52964413",
"0.52958065",
"0.52760535",
"0.5243386... | 0.76076734 | 0 |
Returns the table format for listing instances. | def GetInstanceListFormat():
table_format = '{} table({})'.format(
INSTANCES_USERLABELS_FORMAT, ','.join(INSTANCES_FORMAT_COLUMNS)
)
return table_format | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetInstanceListFormatEdition():\n table_format = '{} table({})'.format(\n INSTANCES_USERLABELS_FORMAT, ','.join(INSTANCES_FORMAT_COLUMNS_EDITION)\n )\n return table_format",
"def GetInstanceListFormatForNetworkArchitectureUpgrade():\n table_format = '{} table({})'.format(\n INSTANCES_USERLABELS... | [
"0.7541823",
"0.68287516",
"0.66987664",
"0.65236723",
"0.6451521",
"0.6425967",
"0.640869",
"0.6330788",
"0.63290924",
"0.6323528",
"0.627085",
"0.6231355",
"0.620855",
"0.6166326",
"0.614493",
"0.6108468",
"0.61037034",
"0.6092221",
"0.60826206",
"0.60582066",
"0.6056901",
... | 0.8227547 | 0 |
Returns the table format for listing instances. | def GetInstanceListFormatEdition():
table_format = '{} table({})'.format(
INSTANCES_USERLABELS_FORMAT, ','.join(INSTANCES_FORMAT_COLUMNS_EDITION)
)
return table_format | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetInstanceListFormat():\n table_format = '{} table({})'.format(\n INSTANCES_USERLABELS_FORMAT, ','.join(INSTANCES_FORMAT_COLUMNS)\n )\n return table_format",
"def GetInstanceListFormatForNetworkArchitectureUpgrade():\n table_format = '{} table({})'.format(\n INSTANCES_USERLABELS_FORMAT,\n ... | [
"0.82272476",
"0.68286514",
"0.66990334",
"0.65245306",
"0.6451547",
"0.6426776",
"0.6408712",
"0.63309085",
"0.63289624",
"0.6324102",
"0.6270906",
"0.6230387",
"0.62092745",
"0.6166894",
"0.61448044",
"0.6109043",
"0.6103975",
"0.60930336",
"0.6082717",
"0.6058054",
"0.6056... | 0.75419563 | 1 |
Show the instance or tier edition. | def AddShowEdition(parser):
kwargs = _GetKwargsForBoolFlag(False)
parser.add_argument(
'--show-edition',
required=False,
help='Show the edition field.',
**kwargs
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show(self):\n\n pass",
"def show(self):\n pass",
"def do_instance_show(cs, args):\n try:\n instance = cs.instances.detail(args.instance)\n except exceptions.NotFound as e:\n msg = \"No server with an id of '%s' exists\" % args.instance\n e.message = msg\n rai... | [
"0.58486897",
"0.5842355",
"0.5747348",
"0.57060516",
"0.5631468",
"0.5590416",
"0.5590416",
"0.5575981",
"0.55603606",
"0.555044",
"0.55342674",
"0.5531974",
"0.55221295",
"0.5517041",
"0.5514111",
"0.5485537",
"0.54780686",
"0.5463824",
"0.5389704",
"0.5330737",
"0.5330737"... | 0.6012348 | 0 |
Adds the 'activedirectorydomain' flag to the parser. | def AddActiveDirectoryDomain(parser):
help_text = (
'Managed Service for Microsoft Active Directory domain this instance is '
'joined to. Only available for SQL Server instances.'
)
parser.add_argument('--active-directory-domain', help=help_text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_the_active_directory_page_input_the_domain_name_ad_domain(driver, ad_domain):\n global domain\n domain = ad_domain\n assert wait_on_element(driver, 5, '//h3[@class=\"formtitle\" and text()=\"Active Directory\"]')\n assert wait_on_element(driver, 7, '//input[@ix-auto=\"input__Domain Name\"]', 'in... | [
"0.5383578",
"0.52658004",
"0.525058",
"0.5196755",
"0.5173804",
"0.51051277",
"0.51029754",
"0.50984037",
"0.50984037",
"0.5056741",
"0.50081563",
"0.49235505",
"0.49235505",
"0.4920365",
"0.49186933",
"0.49149638",
"0.49149638",
"0.49118942",
"0.48782635",
"0.48633948",
"0.... | 0.757386 | 0 |
Adds the 'deletionprotection' flag to the parser for instances patch action. | def AddDeletionProtection(parser):
help_text = 'Enable deletion protection on a Cloud SQL instance.'
parser.add_argument(
'--deletion-protection',
action=arg_parsers.StoreTrueFalseAction,
help=help_text,
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deletion_protection_enabled(self) -> bool:\n return pulumi.get(self, \"deletion_protection_enabled\")",
"def change_protection(self, delete):\n # type: (LoadBalancerService) -> List[BoundAction]\n return self._client.change_protection(self, delete)",
"def enable_instance_modification(s... | [
"0.55515045",
"0.54819936",
"0.5323141",
"0.51380247",
"0.49029085",
"0.48648274",
"0.48485172",
"0.48352373",
"0.48126626",
"0.48030642",
"0.47987062",
"0.47714457",
"0.4698853",
"0.46082997",
"0.46013996",
"0.45180023",
"0.44641966",
"0.44435316",
"0.44413272",
"0.44384068",
... | 0.69046205 | 0 |
Adds the 'connectorenforcement' flag to the parser. | def AddConnectorEnforcement(parser):
help_text = (
'Cloud SQL Connector enforcement mode. It determines how Cloud SQL '
'Connectors are used in the connection. See the list of modes '
'[here](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances#connectorenforcement).'
)
parse... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddNetworkFlag(parser):\n help_text = \"\"\"\\\n The VPC network from which the AlloyDB instance is accessible via private\n IP. For example, projects/myProject/global/networks/default. This setting\n cannot be updated after it is set.\n \"\"\"\n parser.add_argument('--network', help=help_text)",... | [
"0.5008784",
"0.48784173",
"0.48324332",
"0.47075242",
"0.4703251",
"0.4673739",
"0.46578002",
"0.45606083",
"0.4539469",
"0.4498859",
"0.4498859",
"0.44902074",
"0.44805157",
"0.44754124",
"0.44750026",
"0.44624954",
"0.44512856",
"0.44100595",
"0.43902212",
"0.43621567",
"0... | 0.5296608 | 0 |
Adds 'enabledatacache' flag to the parser. | def AddEnableDataCache(parser, show_negated_in_help=False):
kwargs = _GetKwargsForBoolFlag(show_negated_in_help)
parser.add_argument(
'--enable-data-cache',
required=False,
help=(
'Enable use of data cache for accelerated read performance. This flag'
' is only available for Ent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_cache(self, **kwargs: Dict[str, Any]) -> None:\n pass",
"def enable_caching_acts_data() -> bool:\n return True",
"def mark_if_cached(self, args):\n pass",
"def enable() -> dict:\n return {\"method\": \"ApplicationCache.enable\", \"params\": {}}",
"def pytest_addoption(par... | [
"0.66430765",
"0.6428555",
"0.5521472",
"0.5510445",
"0.5439165",
"0.5379784",
"0.5336274",
"0.53146446",
"0.5312009",
"0.5244381",
"0.5229706",
"0.5164126",
"0.5161372",
"0.5023887",
"0.49402595",
"0.4896303",
"0.48914146",
"0.4889524",
"0.48867643",
"0.48753622",
"0.4856096... | 0.8115891 | 0 |
Adds the 'replicationlagmaxsecondsforrecreate' flag to the parser for instances patch action. | def AddReplicationLagMaxSecondsForRecreate(parser):
parser.add_argument(
'--replication-lag-max-seconds-for-recreate',
type=arg_parsers.BoundedInt(lower_bound=300, upper_bound=31536000),
hidden=True,
action=arg_parsers.StoreOnceAction,
required=False,
help=(
'Set a maximu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_instance_modification(self):\n self._request({\"enable-instance-modification\": True})",
"def set_max_reps(self, max_reps):\n self.max_reps = int(max_reps)",
"def get_maxlag(self, showall=False):\n params = {\"action\": \"query\", \"meta\": \"siteinfo\", \"siprop\": \"dbrepllag\... | [
"0.48064655",
"0.47694302",
"0.47565347",
"0.46035618",
"0.45209035",
"0.4496381",
"0.44741425",
"0.44659346",
"0.44561067",
"0.43847725",
"0.4376666",
"0.4356363",
"0.43381876",
"0.43308914",
"0.431084",
"0.42995045",
"0.42995045",
"0.42819878",
"0.427773",
"0.42768097",
"0.... | 0.740545 | 0 |
normalize_rtsp. Return cv2 capturable str/integer | def normalize_rtsp(rtsp: str, raise_exception: bool = False) -> str:
if not is_valid_rtsp(rtsp=rtsp, raise_exception=raise_exception):
return rtsp
if rtsp in [0, "0"]:
return 0
if rtsp in [1, "1"]:
return 1
result = rtsp
if isinstance(rtsp, str) and rtsp.lower().find("rtsp") ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __normalize(input, type, a, b):\n return cv2.normalize(input, None, a, b, type)",
"def from_rtsp_stream(ip, port):\n url = f\"rtsp://{ip}:{port}/h264_pcm.sdp\"\n vcap = cv2.VideoCapture(url)\n while True:\n ret, frame = vcap.read()\n if ret == False:\n print(\"Frame i... | [
"0.56964177",
"0.5388285",
"0.5218667",
"0.5180522",
"0.51219255",
"0.5051189",
"0.5038831",
"0.5024226",
"0.50223434",
"0.5019079",
"0.49846247",
"0.49737942",
"0.49600953",
"0.49583334",
"0.49568412",
"0.49533123",
"0.4946835",
"0.49402887",
"0.4922003",
"0.491937",
"0.4872... | 0.7633221 | 0 |
Build a model matrix G for a fault slip rate inversion. | def build_model_matrix(vels, faults):
n_faults = len(faults)
n_vels = len(vels)
G = pd.DataFrame(np.zeros((n_vels, n_faults)),
columns=faults.index,
index=vels.index)
G.index.names = ['vel']
G.columns.names = ['fault']
G_shear = G.copy(deep=True)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Matrix_G(r,xi,E,ops,j):\r\n #Array of multipliers for operators in V14\r\n #----------------------------------------\r\n raw_pot = av14.V14(r)\r\n #----------------------------------------\r\n \r\n #Operator Values \r\n #---------------------------------------- \r\n op00,op01,op10,op... | [
"0.58354366",
"0.55744755",
"0.54887855",
"0.54491454",
"0.54023373",
"0.5396898",
"0.53532493",
"0.53254825",
"0.5305867",
"0.5297119",
"0.52844906",
"0.5239794",
"0.52206945",
"0.51983273",
"0.5157917",
"0.51451254",
"0.5108106",
"0.5104218",
"0.50900036",
"0.50773257",
"0.... | 0.6591873 | 0 |
function expects an array of dictionaries of Entry type, loops through and tries to match to provided User in match | def has_user(value, match):
if isinstance(value, Iterable):
for entry in value:
if entry.user and entry.user == match:
return entry
else:
return False
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_user_entries(entry_by_user):\n\n ranks=Counter(dict())\n entry_by_user=entry_by_user.split()\n #complete_file_set=set()\n for entry in entry_by_user:\n availability_info=search_hash(entry,hashtable)\n if availability_info:\n ranks+=ranking(availability_info,fileID_to... | [
"0.6351329",
"0.5627283",
"0.5581255",
"0.5490852",
"0.5442872",
"0.54183507",
"0.5401491",
"0.5316373",
"0.5220555",
"0.5217781",
"0.5201108",
"0.5144255",
"0.5135948",
"0.51189655",
"0.51025975",
"0.5090549",
"0.50541365",
"0.5044755",
"0.50443965",
"0.50188345",
"0.5017649... | 0.6794516 | 0 |
take rating value and divide by 3 return decimal percentage value | def percent_rating(value):
value = Decimal(value)
value = round(value / 3, 2) * 100
return value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def average_rating(self):\n return ( self.rating_1 + self.rating_2 + self.rating_3) / 3",
"def get_percent(self):\n if not (self.votes and self.score):\n return 0\n return 100 * (self.get_rating() / self.field.range)",
"def value_to_percent(value):\n return ...",
"def perce... | [
"0.7097882",
"0.7050447",
"0.68410295",
"0.6604343",
"0.6592647",
"0.65332496",
"0.65269786",
"0.6509448",
"0.6508358",
"0.64935976",
"0.64658964",
"0.6457952",
"0.64513075",
"0.6436776",
"0.64340144",
"0.6406238",
"0.63857913",
"0.637789",
"0.63716877",
"0.63590354",
"0.6353... | 0.8633087 | 0 |
Create an interactive animation of the given StateVectorTrajectory. Usage >>> import numpy as np >>> X = np.linspace(0.5, 0.5, 100) >>> svs = [pycppqed.gaussian(x) for x in X] >>> svtraj = pycppqed.StateVectorTrajectory(svs) >>> animate_statevector(svtraj) Arguments svtraj | def animate_statevector(svtraj, x=None, y=None, re=False, im=False, abs=True):
ndim = len(svtraj.dimensions)
if ndim>2:
raise ValueError("StateVectors have too many dimensions.")
length = len(svtraj.time)
if x is None:
x = numpy.arange(svtraj.dimensions[0])
titles = []
data = []
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transition_func(\n self,\n state: np.ndarray,\n state_noise: Optional[np.ndarray] = None,\n control_vect: Optional[np.ndarray] = None\n ) -> np.ndarray:\n pass",
"def plot_ins_state(time, state):\n pylab.ion()\n\n plot_trajectory(state[:,0], state[:... | [
"0.5632888",
"0.5567157",
"0.54702437",
"0.5410434",
"0.5406414",
"0.5363713",
"0.5309421",
"0.52472216",
"0.5215532",
"0.5214611",
"0.5179156",
"0.5173904",
"0.5164393",
"0.515138",
"0.514757",
"0.51405126",
"0.511877",
"0.511724",
"0.5091966",
"0.5081555",
"0.5058831",
"0... | 0.79245096 | 0 |
Interpret the value of the p_type field in the Elf64_Phdr. | def _ptype(ptype_value, verbose=True):
types = {
0:["PT_NULL","Program header table entry unused"],
1:["PT_LOAD","Loadable program segment"],
2:["PT_DYNAMIC","Dynamic linking information"],
3:["PT_INTERP","Program interpreter"],
4:[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_elf_type(afile):\n if afile in g_elf_type_db:\n return g_elf_type_db[afile]\n cmd = 'readelf -h ' + cmd_quote(afile) + ' | grep \"Type:\" || true'\n output = get_shell_cmd_output(cmd)\n tokens = output.split(\":\")\n elf_type = tokens[1].split()[0]\n #verbose(afile + \" ELF Type is... | [
"0.6045981",
"0.5781098",
"0.5773773",
"0.5596677",
"0.5553094",
"0.54355955",
"0.5405111",
"0.53793424",
"0.5275272",
"0.52602917",
"0.5245775",
"0.5231063",
"0.52275795",
"0.5205764",
"0.5201912",
"0.520068",
"0.5200382",
"0.5196938",
"0.5162261",
"0.5162089",
"0.5155312",
... | 0.65665644 | 0 |
Check a single host. | def check_host(host):
try:
request = requests.get(host[0], timeout=3)
host[1] = bool(re.search(host[1], request.text))
except Exception:
host[1] = False
if host[1] is False:
os.system(CONFIG['mail_command'].format(
'CRITICAL: {} is critical'.format(host[0])))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _hostOK(self, host):\n if os.system(\"ping -c 1 $node &> /dev/null\"):\n # No access to host\n return False\n elif os.system(\"ssh -n -a -x $node 'ls' &> /dev/null\"):\n # No route to host\n return False\n else:\n return True",
"def ping_one(self, host):... | [
"0.7279984",
"0.7182869",
"0.71206784",
"0.70280164",
"0.69471025",
"0.68040854",
"0.6780533",
"0.67723995",
"0.67253196",
"0.6704733",
"0.6690993",
"0.6688167",
"0.66655815",
"0.6611461",
"0.6565912",
"0.65310514",
"0.6528221",
"0.65262145",
"0.6507934",
"0.64840245",
"0.648... | 0.759618 | 0 |
Caculate the number of minutes gone between two keys/datetimes. | def calculate_minutes_between_keys(start, end):
if isinstance(start, str):
start = datetime.datetime.strptime(start, '%Y%m%d%H%M')
if isinstance(end, str):
end = datetime.datetime.strptime(end, '%Y%m%d%H%M')
return (end - start).total_seconds() // 60 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def minutesSinceLastUpdate(self):\n if self.seenTimes == []:\n return 0\n latestTime = max(self.seenTimes)\n return int(self.timeCode())-int(latestTime)",
"def _subtract_times(self, a, b):\n td = a - b\n return td.days * 24 * 60 + td.seconds // 60",
"def computeUpd... | [
"0.6249782",
"0.61801934",
"0.61097604",
"0.60516816",
"0.5917513",
"0.5909372",
"0.5890375",
"0.5673943",
"0.566243",
"0.5657384",
"0.5641803",
"0.5600153",
"0.5599244",
"0.55948913",
"0.5572131",
"0.5554096",
"0.55358285",
"0.5512647",
"0.5506891",
"0.54932517",
"0.5445749"... | 0.71438277 | 0 |
Fetch the status for all hosts. | def renew_status():
status = []
for host, host_pattern in CONFIG['hosts']:
status.append({
'host': host,
'status': check_host([host, host_pattern])[1],
})
return status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_hosts(self):\n ...",
"def get_host_stats(self, refresh=False):\n return self.host_status",
"def get(self): # noqa\n\n response = get_hosts()\n\n return response.__dict__, self.state_to_http[response.status]",
"def check_all_hosts (self, repo_version_id, version_name):\n ... | [
"0.7002855",
"0.6894413",
"0.66000026",
"0.6567391",
"0.646867",
"0.6444974",
"0.64366555",
"0.6340886",
"0.63127804",
"0.6264648",
"0.62451977",
"0.622805",
"0.6193121",
"0.6133661",
"0.61294687",
"0.6114206",
"0.6105105",
"0.60492307",
"0.6048421",
"0.60266393",
"0.6013078"... | 0.69396645 | 1 |
Add statistics data to status. | def add_statistics_to_status(status):
return [{
'host': h['host'],
'status': h['status'],
'stats': get_statistics_for_host(h['host']),
} for h in status] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_stats(self):\n units = self.get_unit_map()\n for metric in self.raw_metrics:\n unit, metric_type = units.get(metric, (DEFAULT_UNIT, DEFAULT_TYPE))\n if metric_type == \"counter\":\n # Unit/Second\n unit = \"/\".join((unit, \"Second\"))\n ... | [
"0.7071191",
"0.7006782",
"0.6597341",
"0.6583464",
"0.6583464",
"0.64812946",
"0.6472771",
"0.64535975",
"0.643629",
"0.63830954",
"0.63642603",
"0.6349893",
"0.6301071",
"0.62564635",
"0.62083316",
"0.6203835",
"0.6167934",
"0.6167452",
"0.6136802",
"0.6132935",
"0.6124932"... | 0.703488 | 1 |
Get all downtimes of specified host. | def get_downtimes(host):
if os.path.isfile(CONFIG['stats_file']):
with open(CONFIG['stats_file'], 'r') as stats_file:
stats = json.loads(stats_file.read())
if host not in stats:
return []
stats = stats[host]
downtimes = []
sorted_keys = sorted(stats.keys())
last_dow... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_preemptibles_from_host(self, host, request):\n preemptibles = [i for i in host.instances.values()\n if i.system_metadata.get(\"preemptible\")]\n if not preemptibles:\n # Log the details but don't put those into the reason since\n # we don't want to giv... | [
"0.5234632",
"0.5100507",
"0.49562603",
"0.48812392",
"0.4856143",
"0.48375577",
"0.47843593",
"0.4781128",
"0.47727948",
"0.47633258",
"0.4750764",
"0.4731318",
"0.47046375",
"0.46946478",
"0.46946478",
"0.46646905",
"0.46639574",
"0.46552408",
"0.4642957",
"0.46384245",
"0.... | 0.76769817 | 0 |
Generate a html page containing the status of the pages. | def generate_status_page():
status = renew_status()
now = datetime.datetime.now()
# update statistics
update_statistics(status)
# add stats to status
status = add_statistics_to_status(status)
# calculate datetime from oldest key
stats_first = datetime.datetime.strptime(
overal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home_page():\n return \"pong\", 201, {'Content-Type': 'text/html'}",
"def generate_webpages(self):\n if self.add_to_existing:\n self.add_existing_data()\n self.make_home_pages()\n self.make_1d_histogram_pages()\n self.make_corner_pages()\n self.make_config_pag... | [
"0.6420337",
"0.63231677",
"0.62768465",
"0.6269445",
"0.61645293",
"0.61370116",
"0.6119914",
"0.6058053",
"0.6050544",
"0.6050544",
"0.6050544",
"0.60407054",
"0.6040668",
"0.60271776",
"0.6014081",
"0.6004917",
"0.598273",
"0.5978781",
"0.59780174",
"0.5971095",
"0.5969813... | 0.7396192 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.