query stringlengths 9 9.05k | document stringlengths 10 222k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Guess a poem's meter via Levenshtein distance from candidates | def guess_meter(tokenized_poem):
joined_lines = [''.join(line) for line in scanscion(tokenized_poem) if line]
line_lengths = [len(line) for line in joined_lines]
num_lines = len(joined_lines)
meters = []
for line in joined_lines:
meters.append(levenshtein(line, POSSIBLE_METERS))
guess... | [
"def levenshtein(string, candidates):\n\n distances = defaultdict(int)\n num_lines = len(string)\n\n for k, v in candidates.items():\n expanded = False\n # Expands the length of each candidate to match the length of the compared string\n if len(v) != len(string):\n v = (v * ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Guess a poem's rhyme via Levenshtein distance from candidates | def guess_rhyme_type(tokenized_poem):
joined_lines = ''.join(rhyme_scheme(tokenized_poem))
no_blanks = joined_lines.replace(' ', '')
guessed_rhyme = levenshtein(no_blanks, POSSIBLE_RHYMES)
return joined_lines, guessed_rhyme | [
"def levenshtein(string, candidates):\n\n distances = defaultdict(int)\n num_lines = len(string)\n\n for k, v in candidates.items():\n expanded = False\n # Expands the length of each candidate to match the length of the compared string\n if len(v) != len(string):\n v = (v * ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Propagates a state vector | def propagate_state(r,v,t0,tf,bstar=0.21109E-4):
kep = state_kep(r,v)
return propagate_kep(kep,t0,tf,bstar) | [
"def apply_state(self, state):",
"def forward(self, t, state):\n xs = state[:, :-1]\n dlogp = state[:, -1:]\n state = (xs, dlogp)\n *dxs, div = self._dynamics(t, state)\n state = torch.cat([*dxs, div], dim=-1)\n return state",
"def _unwrap_state_vector(self):\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
kep_to_sat(kep,epoch,bstar=0.21109E4,whichconst=wgs72,afspc_mode=False) Converts a set of keplerian elements into a Satellite object. | def kep_to_sat(kep,epoch,bstar=0.21109E-4,whichconst=wgs72,afspc_mode=False):
deg2rad = np.pi / 180.0; # 0.0174532925199433
xpdotp = 1440.0 / (2.0 * np.pi); # 229.1831180523293
tumin = whichconst.tumin
satrec = Satellite()
satrec.error = 0;
satrec.whichconst = whichconst # P... | [
"def save_ephem(sat, tle_dir, cadence, location, alpha, out_dir):\n\n # instantiate an empty dict\n sat_ephem = {}\n sat_ephem[\"sat_id\"] = sat\n sat_ephem[\"time_array\"] = []\n sat_ephem[\"sat_alt\"] = []\n sat_ephem[\"sat_az\"] = []\n\n # Make output directory tree\n Path(f\"{out_dir}/ep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Propagates a set of keplerian elements. | def propagate_kep(kep,t0,tf,bstar=0.21109E-4):
sat = kep_to_sat(kep,t0,bstar=bstar)
tf = datetime.utcfromtimestamp(tf).timetuple()
pos, vel = sat.propagate(
tf.tm_year, tf.tm_mon, tf.tm_mday, tf.tm_hour, tf.tm_min, tf.tm_sec)
return np.array(list(pos)),np.array(list(vel)) | [
"def propagate(self):\n generations = {}\n nodes = self.getAllNodes()\n\n for n in nodes:\n nGen = len(self.ancestors(n))\n generations.setdefault(nGen, []).append(n)\n\n nGen = range(1, max(generations.keys())+1)\n for gen in nGen:\n thisGeneratio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DPP Network Introduction and protocol version | def test_dpp_network_intro_version(dev, apdev):
check_dpp_capab(dev[0], min_ver=3)
try:
id, hapd = run_dpp_auto_connect(dev, apdev, 1, stop_after_prov=True)
dev[0].select_network(id, freq=2412)
dev[0].wait_connected()
finally:
dev[0].set("dpp_config_processing", "0", allow_f... | [
"def protocolVersion():",
"def eth_protocolVersion(self):\n self.payload[\"method\"] = \"eth_protocolVersion\"\n self.payload[\"id\"] = 67\n response = requests.post(self.url, data=json.dumps(self.payload), headers=self.headers).json()\n result = int(response[\"result\"], 16)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DPP Network Introduction and protocol version change | def test_dpp_network_intro_version_change(dev, apdev):
check_dpp_capab(dev[0], min_ver=3)
try:
dev[0].set("dpp_version_override", "2")
id, hapd = run_dpp_auto_connect(dev, apdev, 1, stop_after_prov=True)
dev[0].set("dpp_version_override", "3")
dev[0].select_network(id, freq=2412... | [
"def protocolVersion():",
"def eth_protocolVersion(self):\n self.payload[\"method\"] = \"eth_protocolVersion\"\n self.payload[\"id\"] = 67\n response = requests.post(self.url, data=json.dumps(self.payload), headers=self.headers).json()\n result = int(response[\"result\"], 16)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DPP Network Introduction and protocol version missing from request | def test_dpp_network_intro_version_missing_req(dev, apdev):
check_dpp_capab(dev[0], min_ver=3)
try:
dev[0].set("dpp_version_override", "2")
id, hapd = run_dpp_auto_connect(dev, apdev, 1, stop_after_prov=True)
dev[0].set("dpp_version_override", "3")
dev[0].set("dpp_test", "92")
... | [
"def request_version_and_flags(self, req, msg):",
"def protocolVersion():",
"def extract_data_protocol(request_data):\n data_list = request_data.split()\n method = data_list[1]\n version = data_list[2]\n try:\n assert version == PROTOCOL, 'Exception: Undefined App Layer Protocol...'\n exce... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DPP/PKEXv2 over TCP and automatic connection | def test_dpp_tcp_pkex_auto_connect_2(dev, apdev, params):
run_dpp_tcp_pkex_auto_connect_2(dev, apdev, params, False) | [
"def __connect_NN_socket(self):\n if self.mode == \"one2many\":\n # This allows only use one publisher connected at the same endpoint\n if self.ip == '127.0.0.1':\n ip = \"*\"\n endpoint = \"tcp://\" + ip + \":\" + str(self.port)\n self.sock.bind(end... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DPP/PKEXv2 over TCP and automatic connection status | def test_dpp_tcp_pkex_auto_connect_2_status(dev, apdev, params):
run_dpp_tcp_pkex_auto_connect_2(dev, apdev, params, True) | [
"def startProtocol(self):\n self.transport.connect(self.host, self.port)\n logging.info(\"Connect with %s:%d\" % (self.host, self.port))",
"def connect(self):\n\n # Open TCP connection to GPIB-ETHERNET\n self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DPP/PKEXv2 over TCP and automatic connection status for failure | def test_dpp_tcp_pkex_auto_connect_2_status_fail(dev, apdev, params):
run_dpp_tcp_pkex_auto_connect_2(dev, apdev, params, True, start_ap=False) | [
"def Check_Communications(self):\n self.comm_status = False\n try:\n self.ser.close()\n self.ser.open()\n if self.ser.isOpen():\n self.ser.flushInput()\n self.ser.write('SYS:ERR?\\r\\n')\n time.sleep(0.1)\n st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DPP/PKEXv2 over TCP while associated (conn status) | def test_dpp_tcp_pkex_while_associated_conn_status(dev, apdev, params):
try:
run_dpp_tcp_pkex_while_associated(dev, apdev, params, True)
finally:
dev[1].request("DPP_CONTROLLER_STOP")
dev[0].set("dpp_config_processing", "0", allow_fail=True) | [
"def keep_alive(self):\n self.send_tcp_msg('00')",
"def __connect_NN_socket(self):\n if self.mode == \"one2many\":\n # This allows only use one publisher connected at the same endpoint\n if self.ip == '127.0.0.1':\n ip = \"*\"\n endpoint = \"tcp://\" +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DPP Controller/Relay with PKEX | def test_dpp_controller_relay_pkex(dev, apdev, params):
try:
run_dpp_controller_relay_pkex(dev, apdev, params)
finally:
dev[0].set("dpp_config_processing", "0", allow_fail=True)
dev[1].request("DPP_CONTROLLER_STOP") | [
"def _dmvpn(self, _):\r\n logger = LoggingMessageHandler(bool(), self._log_viewer)\r\n command = 'show crypto ikev2 sa'\r\n self.command_thread.command = command\r\n logger.clear()\r\n logger.status_message(\"Running....\")\r\n self.ping.setEnabled(False)\r\n self.tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Conecta las salas sin puertas | def salasSinConectar(self):
habitaciones = []
for i in self.puertas:
habitaciones.append(i.habitacion1.numero)
habitaciones.append(i.habitacion2.numero)
# Mirar todas la habitaciones
for i in range(2, len(self.listaHabitaciones)):
# Si no tienen las h... | [
"def saludo():\r\n\tprint (\"Hola! Bienvenido al juego Luces Afuera.\")\r\n\tprint (\"El objetivo es muy simple, apagar todas las luces.\") \r\n\tprint (\"Las luces prendidas son los puntos o y las apagadas los puntos ·\")\r\n\tprint (\"Cuando presionás una luz, escribiendo su posicion, como por ejemplo D4 o A3, és... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generar Enemigos y Tesoros de manera aleatoria | def generar_Enemigos_Tesoros(self):
for i in range(2, len(self.listaHabitaciones)):
"""
Aquí definirías como poner los enemigos si tienes un gráfo de enemigos etc
mirando las puertas y poniendo enemigo o no
"""
enemigoOTesoro = random.uniform... | [
"def enem():\r\n global esl, xyz, h, POW, punt2, puntaje2, livesl, m, punt1, puntaje1, ene, en, en1, n, esn, lives,contene, xz, x, contene2, esm \r\n for o in range(len(ene)):\r\n \r\n # golpear tortuga mario\r\n if((c.coords(mario)[0]> c.coords(ene[o][0])[0]-50 and c.coords(ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set variables to represent the common column names used in this class directly. This should make future schema changes a little easier to handle. It is NOT meant to function as a general column map, just to abstract values which are used within this class. | def _colNames(self):
self.mjdCol = 'expMJD'
self.fieldIdCol = 'fieldID'
self.raCol = 'fieldRA'
self.decCol = 'fieldDec'
self.propIdCol = 'propID'
self.propConfCol = 'propConf'
self.propNameCol = 'propName' #(propname == proptype)
# For config parsing.
... | [
"def _get_column_mapping(cls) -> Dict[str, str]:\n pass",
"def _populate_table_keywords(self):\n for idx, column in enumerate(self.columns):\n for keyword, attr in KEYWORD_TO_ATTRIBUTE.items():\n val = getattr(column, attr)\n if val is not None:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch 'colnames' from 'tableName'. colnames = the columns to fetch from the table. sqlconstraint = sql constraint to apply to data (minus "WHERE"). distinctExpMJD = group by expMJD to get unique observations only (default True). groupBy = group by col 'groupBy' (will override group by expMJD). tableName = the opsim tab... | def fetchMetricData(self, colnames, sqlconstraint, distinctExpMJD=True, groupBy='expMJD',
tableName='Summary'):
# To fetch data for a particular proposal only, add 'propID=[proposalID number]' as constraint,
# and to fetch data for a particular filter only, add 'filter ="[filter... | [
"def getColumns(self, tableName):\n #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n c = self.conn.execute('pragma table_info(%s)' % tableName)\n return c.fetchall()",
"def fetchFieldsFromSummaryTable(self, sqlconstraint, raColName=None, decColName=None):\n # ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch field information (fieldID/RA/Dec) from Output table. | def fetchFieldsFromSummaryTable(self, sqlconstraint, raColName=None, decColName=None):
# Fetch field info from the Output table, by selecting unique fieldID + ra/dec values.
# This implicitly only selects fields which were actually observed by opsim.
if raColName is None:
raColName =... | [
"def _output_field_columns(self):\n return sql.SQL(', ').join(map(sql.Identifier, self._output_field_names))",
"def readZTFfields(fielddef_file=\"/home/matteo/work/ZTF/Calibration/ZTF_Fields.txt\"):\n ftab_cols=[\n \"ID\", \"RA\", \"Dec\", \"Ebv\", \"Gal Long\", \n \"Gal Lat\", \"Ecl Long\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch field information (fieldID/RA/Dec) from Field (+Proposal_Field) tables. propID = the proposal ID (default None), if selecting particular proposal can be a list degreesToRadians = RA/Dec values are in degrees in the Field table (so convert to radians). | def fetchFieldsFromFieldTable(self, propID=None, degreesToRadians=True):
# Note that you can't select any other sql constraints (such as filter).
# This will select fields which were requested by a particular proposal or proposals,
# even if they didn't get any observations.
tableName ... | [
"def get_fields(self):\n config = self.config['locations']['arcGIS']\n url = f\"{config['url']}{config['fields']['endpoint']}\"\n params = config['fields']['params']\n field_coordinates = self.get_converted_coordinates(\n url, params, self.proj_3857\n )\n\n field... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch the proposal IDs as well as their (short) proposal names and science type tags from the full opsim database. Returns dictionary of propID / propname, and dictionary of propTag / propID. If not using a full database, will return dict of propIDs with empty propnames + empty propTag dict. | def fetchPropInfo(self):
propIDs = {}
# Add WFD and DD tags by default to propTags as we expect these every time. (avoids key errors).
propTags = {'WFD':[], 'DD':[]}
# If do not have full database available:
if 'Proposal' not in self.tables:
propData = self.tables['Su... | [
"def testOpsimDbPropID(self):\n propids, propTags = self.oo.fetchPropInfo()\n self.assertTrue(len(list(propids.keys())) > 0)\n self.assertTrue(len(propTags['WFD']) > 0)\n self.assertTrue(len(propTags['DD']) > 0)\n for w in propTags['WFD']:\n self.assertTrue(w in propids... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the run length for a particular opsim run (years). runLengthParam = the 'paramName' in the config table identifying the run length (default nRun). | def fetchRunLength(self, runLengthParam='nRun'):
if 'Config' not in self.tables:
print('Cannot access Config table to retrieve runLength; using default 10 years')
runLength = 10.0
else:
table = self.tables['Config']
runLength = table.query_columns_Array(co... | [
"def encode_as_run_length_string(self):\n self._create_lookup()\n column_map = self.__get_column_map()\n row_number, column_number = self.__get_scanning_dimension(column_map)\n suffix = '_%i' % (row_number)\n run_length_list = self.__convert_1D_to_run_length_list(row_number,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the latitude, longitude, and height of the telescope used by the config file. | def fetchLatLonHeight(self):
if 'Config' not in self.tables:
print('Cannot access Config table to retrieve site parameters; using sims.utils.Site instead.')
site = Site(name='LSST')
lat = site.latitude_rad
lon = site.longitude_rad
height = site.elev
... | [
"def DefaultConfig(self) -> str:\n cfg = \\\n\"\"\"[Location]\nlat = 15.3\nlon = -120.2\nalt = 50\nname = Arayat\ntz = Asia/Manila\n\n[Track]\nsats = AO-92,SO-50,ISS,FO-29,FOX-1B,IO-86,AO-7,AO-27,AO-73,XW-2B,XW-2F,LILACSAT-2\n\n[Pass]\nminalt = 20.0\n\n[Tle]\nfiles = 'https://www.celestrak.com/NORAD/elements... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether the seeing column is 'seeing' or 'finSeeing' (v2.x simulator vs v3.0 simulator). Returns the name of the seeing column. | def fetchSeeingColName(self):
# Really this is just a bit of a hack to see whether we should be using seeing or finseeing.
# With time, this should probably just go away.
table = self.tables['Summary']
try:
table.query_columns_Array(colnames=['seeing',], numLimit=1)
... | [
"def testOpsimDbSeeingColName(self):\n seeingcol = self.oo.fetchSeeingColName()\n self.assertTrue(seeingcol, 'finSeeing')",
"def bhbe_col(heroes):\n heroes = clean_heroes(heroes)\n cond = heroes[(heroes['Eye color'].str.contains('blue',\n case... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns opsim run name (machine name + session ID) from Session table. | def fetchOpsimRunName(self):
if 'Session' not in self.tables:
print('Could not access Session table to find this information.')
runName = 'opsim'
else:
table = self.tables['Session']
res = table.query_columns_Array(colnames=['sessionID', 'sessionHost'])
... | [
"def get_next_session_name_stura():\n config = settings.VOTING_SESSIONS_CONFIG\n return get_next_session_name(config['weekday'])",
"def get_session_key(self):\n return self.model['session_key']",
"def redis_session_key(self):\n return RedisKeys.session_info.format(session_id=self.session_id)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the requested number of visits for proposals in propId. Returns a dictionary Nvisits{u/g/r/i/z/y} | def fetchRequestedNvisits(self, propId=None):
visitDict = {}
if propId is None:
# Get all the available propIds.
propData = self.tables['Proposal'].query_columns_Array(colnames=[self.propIdCol, self.propNameCol], constraint='')
else:
# Get the propType info to... | [
"def count_votes(votes):\r\n diction = {}\r\n for vote in votes:\r\n if not vote.celebrity:\r\n pass\r\n elif vote.celebrity in diction:\r\n diction[vote.celebrity] = diction[vote.celebrity] + 1\r\n else:\r\n diction[vote.celebrity] = 1\r\n return dicti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compute the intersectionoverunion score both inputs should be categorical (as opposed to onehot) | def iou_score(pred_cls, true_cls, nclass=7, drop=drop):
intersect_ = []
union_ = []
for i in range(nclass):
if i not in drop:
intersect = ((pred_cls == i) + (true_cls == i)).eq(2).sum().item()
union = ((pred_cls == i) + (true_cls == i)).ge(1).sum().item()
intersec... | [
"def intersection_over_union(heatmap1: np.ndarray, heatmap2: np.ndarray) -> float:\n intersection = np.bitwise_and(heatmap1, heatmap2)\n union = np.bitwise_or(heatmap1, heatmap2)\n\n count_inter = float(np.count_nonzero(intersection))\n count_union = float(np.count_nonzero(union))\n\n iou = count_int... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that establishes the connection with Appium server and loads the Application to emulator via Appium server. Appium server used Android UIAutomator/adb_server to enable the automated testing | def setUp(self):
"Setup for the test"
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '9'
desired_caps['deviceName'] = 'Pixel (Edited)'
desired_caps['newCommandTimeout'] = '3000'
desired_caps['automationName'] ='uiautom... | [
"def launch_appium(args, emulator):\n # prepare cmd\n cmd = ['appium', '--no-reset', '-p', str(args.appium_port), '-U', emulator.serial,\n '--session-override', '--log-level', 'info', '-bp', str(args.appium_back_port)]\n Appium = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if the checkbox is enabled return True if enabled else False | def checkbox_enabled(self):
return self.driver.find_element_by_id("android:id/checkbox").get_attribute("checked") | [
"def _get_isEnabledCheckBoxChecked(self) -> \"bool\" :\n return _core.GroupCommandInput__get_isEnabledCheckBoxChecked(self)",
"def is_enabled(self):\n return self.element_info.enabled #and self.top_level_parent().element_info.enabled",
"def _is_enabled(self, state):\n enabled = True\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the difference between tof for extrapolation and recon (recon_tof_2 recon_tof_1) (extrap_tof_2 extrap_tof_1) | def get_delta_tof(self, event, det_1, det_2):
times = [None, None, None, None]
dets = (det_1, det_2, self.global_key(det_1), self.global_key(det_2))
# find times for each detector type in dets and fill into times
for hit in event["data"]:
for i, det in enumerate(dets):
... | [
"def error(self, F):\n return abs((F(self.b) - F(self.a)) - self.approx)",
"def backward_differences(T):\n\tnumOfTimes = len(T)\n\t#the number of steps in the method\n\tm = numOfTimes - 1\n\t#generate the initial differences, which\n\t#is just the standard basis.\n\tD = np.array([ [np.float64((i+1)==(numOf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
subtract time from specified detector or set to None if not found | def time_offset(self, detector_hits):
reco_delta_t = None
global_delta_t = None
for hit in detector_hits:
if hit["detector"] == self.config.time_from:
reco_delta_t = hit["hit"]["t"]
elif hit["detector"] == self.global_key(self.config.time_from):
... | [
"def _elapsed_time_to_timestamp(probe: MeaterProbe) -> datetime | None:\n if not probe.cook or not hasattr(probe.cook, \"time_elapsed\"):\n return None\n return dt_util.utcnow() - timedelta(seconds=probe.cook.time_elapsed)",
"def dispatchTime(inc):\n\tif len(FDNY[inc][dti])==0 or len(FDNY[inc][ati])=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate a data source. Based on the inferred data source type it will validate resource or package. Default output format is YAML with a front matter. | def console_validate(
# Source
source: List[str] = common.source,
name: str = common.resource_name,
type: str = common.type,
path: str = common.path,
scheme: str = common.scheme,
format: str = common.format,
encoding: str = common.encoding,
innerpath: str = common.innerpath,
comp... | [
"def main(source):\n if source is None:\n click.echo(\n \"You need to supply a file or url to a schema to a swagger schema, for\"\n \"the validator to work.\"\n )\n return 1\n try:\n load(source)\n click.echo(\"Validation passed\")\n return 0\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper method that takes in a sentence and the current spacy entity type, and returns a true if that type is in the given sentence (used for filtering) | def sentence_has_type(sentence, type):
for word in sentence.ents:
if word .label_ == type:
return True
return False | [
"def is_sentence(self):\n return self.parent == 'S'",
"def is_content_sentence(symbol_stream):\n return any(symbol[0] is not None and in_ranges(symbol[0], WORD_RANGES)\n for symbol in symbol_stream)",
"def __contains__(self, s):\n search_by_expression = self._valid_search(s)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Go through all sentences in parsed and extract regex matchings, return the most frequent of these | def extract_frequent_regex_match(parsed, regex):
regex_matches = []
for sentence in parsed:
matches = re.findall(regex, sentence.text)
if matches:
regex_matches.extend(matches)
if regex_matches:
return Counter(regex_matches)
else:
return '___no_match___' | [
"def most_frequent(s):\n words=[]\n words=s.split(\" \")\n words=sorted(words)\n word_count={}\n counts=[]\n for word in words:\n counts.append(words.count(word))\n m=counts.index(max(counts))\n return (words[m])\n \n # USING OrderedDict\n '''\n for word in words:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filter parsed to only contain sentences with a matching regex form | def filter_regex_match_sentences(parsed, pattern):
matches = list(filter(lambda sent: re.findall(pattern, sent.text), parsed))
return matches | [
"def __filter_text(self, text):\r\n analyzer_num_tag = self.analyzer_type.num\r\n analyzer_noun_tag = self.analyzer_type.noun\r\n analyzer_loc_tag = self.analyzer_type.loc\r\n surname = clean_text.get_surname(self.url)\r\n sentence = []\r\n out_text = []\r\n surname_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a list of dates, extract the average date given | def get_average_date(date_list):
month_count = [0] * 12
month_dates = [[], [], [], [], [], [], [], [], [], [], [], []]
# Count frequency of each month, and sort dates by their month
for date in date_list:
for i in range(12):
if constants.MONTH_NAMES[i] in date:
month... | [
"def get_avg(input_list):\n return sum(input_list)/len(input_list)",
"def find_average(input_list):\r\n return sum(input_list)/len(input_list)",
"def __calculate_average(self, list):\n return reduce(lambda x, y: x + y, list) / len(list)",
"def average_calculation(stocklist):\n total_volume = 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a list of dates, extract the average month and year | def get_average_month_year(date_list):
month_count = [0] * 12
month_dates = [[], [], [], [], [], [], [], [], [], [], [], []]
# Count frequency of each month, and sort dates by their month
for date in date_list:
for i in range(12):
if constants.MONTH_NAMES[i] in date:
... | [
"def get_average_date(date_list):\n month_count = [0] * 12\n month_dates = [[], [], [], [], [], [], [], [], [], [], [], []]\n\n # Count frequency of each month, and sort dates by their month\n for date in date_list:\n for i in range(12):\n if constants.MONTH_NAMES[i] in date:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a list of dates, extract the lowest | def get_lowest_date(date_list):
min_date = [9999, '', 9999, 9999]
for date in date_list:
nums = re.findall('([0-9]+)', date)
year = -1
month = ''
month_num = -1
day = -1
for i in range(12):
if constants.MONTH_NAMES[i] in date:
month =... | [
"def min_value(my_list):\n aux = ordered_values(my_list)\n return aux[0]",
"def findClosestDate(date, array):\n diff = [abs(date - x).days for x in array]\n return np.argmin(diff)",
"def earliestDateStamp():",
"def start_date_path(path):\n all_files = get_dirs(path)\n all_dates = [dt.strptim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allowed device management levels, an empty list allows all management levels. | def allowed_device_management_levels(self) -> Sequence[str]:
return pulumi.get(self, "allowed_device_management_levels") | [
"def allowed_mosaics(self):\n return []",
"def management_groups(self) -> Optional[Sequence['outputs.ResourceIdResponse']]:\n return pulumi.get(self, \"management_groups\")",
"def capabilities(self):\n return []",
"def _checkManageCapabilities(self, irc, msg, channel):\n if cha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allowed encryptions statuses, an empty list allows all statuses. | def allowed_encryption_statuses(self) -> Sequence[str]:
return pulumi.get(self, "allowed_encryption_statuses") | [
"def getValidValuesForVpgStatuses(self):\n\n return requests.get(self.zvmip + self.endPoint + '/statuses', headers=self.headerwithkey, verify=False)",
"def __init__status_choices__(self):\n self.fields['status'].choices = flag_settings.get_for_model(\n self.target_object, 'STATUSES')"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the device needs to be approved by the customer admin. | def require_admin_approval(self) -> bool:
return pulumi.get(self, "require_admin_approval") | [
"def is_customer_initiated_maintenance_allowed(self) -> Optional[bool]:\n return pulumi.get(self, \"is_customer_initiated_maintenance_allowed\")",
"def should_auto_approve():\n if settings.MODERATION_POLICY == moderation_policies.automatic.value:\n return True\n return False",
"def can_charg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the device needs to be corp owned. | def require_corp_owned(self) -> bool:
return pulumi.get(self, "require_corp_owned") | [
"def chargeable(self):\n return not self.internal",
"def is_owner_or_server_owner():\r\n return commands.check(is_owner_or_server_owner_check)",
"def chargeable(self):\n return not self.internal and self.charged",
"def is_owner_check(ctx):\r\n return ctx.bot.owner_id == ctx.message.author.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether or not screenlock is required for the DevicePolicy to be true. Defaults to `false`. | def require_screenlock(self) -> bool:
return pulumi.get(self, "require_screenlock") | [
"def allow_screen_capture(self):\n if \"allowScreenCapture\" in self._prop_dict:\n return self._prop_dict[\"allowScreenCapture\"]\n else:\n return None",
"def can_device_lock_front_panel(self):\n return self.sdk.SCC_CanDeviceLockFrontPanel(self._serial)",
"def is_locke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The allowed OS type. | def os_type(self) -> str:
return pulumi.get(self, "os_type") | [
"def determine_os(self):\n system_type=\"\"\n try: #Linux check\n release_file = file(\"/etc/os-release\")\n for line in release_file:\n if re.search(\"^NAME\", line):\n system = line.split(\"=\")[-1]\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Only allows requests from devices with a verified Chrome OS. Verifications includes requirements that the device is enterprisemanaged, conformant to domain policies, and the caller has permission to call the API targeted by the request. | def require_verified_chrome_os(self) -> bool:
return pulumi.get(self, "require_verified_chrome_os") | [
"def _check_permission_ha(self, request):\n if request[REQUEST_FROM] != self.sys_homeassistant:\n raise APIForbidden(\"Only HomeAssistant can use this API!\")",
"def test_authorize_door_granted():\n result = requests.get(API_ENTRY_authorize_door.format(\"CB06.01.01\", \"729\")).content\n a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Google Cloud services that are not subject to the Service Perimeter restrictions. Deprecated. Must be set to a single wildcard "". The wildcard means that unless explicitly specified by "restricted_services" list, any service is treated as unrestricted. | def unrestricted_services(self) -> Sequence[str]:
warnings.warn("""Google Cloud services that are not subject to the Service Perimeter restrictions. Deprecated. Must be set to a single wildcard \"*\". The wildcard means that unless explicitly specified by \"restricted_services\" list, any service is treated as ... | [
"def AddImplicitUnrestrictedServiceWildcard(ref, args, req):\n del ref, args # Unused in AddImplicitServiceWildcard\n\n m = util.GetMessages(version='v1beta')\n if req.servicePerimeter.perimeterType == (\n m.ServicePerimeter.PerimeterTypeValueValuesEnum.PERIMETER_TYPE_REGULAR):\n service_perimeter_confi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Specifies how APIs are allowed to communicate within the Service Perimeter. | def __init__(__self__, *,
allowed_services: Sequence[str],
enable_restriction: bool):
pulumi.set(__self__, "allowed_services", allowed_services)
pulumi.set(__self__, "enable_restriction", enable_restriction) | [
"def test_allow(self):\n self.validate_test(self.v1_controller.allow() == 'GET')",
"def write_allow():\n return 'write-allow', PermissionConfig",
"def getAllow(self):\n return self.base.get(\"allow\", [])",
"def get_allowed_operations(cls, course_key: CourseKey, user: Optional[User] = Non... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The list of APIs usable within the Service Perimeter. Must be empty unless 'enable_restriction' is True. You can specify a list of individual services, as well as include the 'RESTRICTEDSERVICES' value, which automatically includes all of the services protected by the perimeter. | def allowed_services(self) -> Sequence[str]:
return pulumi.get(self, "allowed_services") | [
"def unrestricted_services(self) -> Sequence[str]:\n warnings.warn(\"\"\"Google Cloud services that are not subject to the Service Perimeter restrictions. Deprecated. Must be set to a single wildcard \\\"*\\\". The wildcard means that unless explicitly specified by \\\"restricted_services\\\" list, any servi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detect a face and return a cropped image singling out a face. | def crop_face(img):
try:
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
face_cascade = cv2.CascadeClassifier('xml/haarcascade_frontalface_alt2.xml')
faces = face_cascade.detectMultiScale(gray, 1.05, 5)
face = np.array(0)
# if face found
if len(faces) > 0:
... | [
"def __extract_face_crop(self, image, face_data):\n face_x, face_y, face_w, face_h = face_data[:4]\n\n start_x = int(face_x)\n end_x = start_x + int(face_w)\n start_y = int(face_y)\n end_y = start_y + int(face_h)\n\n start_x = max(0, start_x)\n end_x = min(image.shape[1], end_x)\n start_y = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open video, analyze face using the `model` | def start_video(model, model_vars):
vid = cv2.VideoCapture(0)
counter = 0
text = ""
frame_title = "Press q to quit"
while True:
# Capture video
_, frame = vid.read()
# send image to CNN model every 50 iterations
if counter == 50:
try:
... | [
"def run_model(model_path, **args):\r\n if args['model_type'] == 'normal':\r\n model_path = 'saved_models/normal_model'\r\n\r\n print(f\"Retrieving {args['model_type']} model...\")\r\n model = get_model(model_path)\r\n print(\"Model retrieved.\")\r\n model_vars = get_model_vars()\r\n # start... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load model, start live video or individual picture analysis via model | def run_model(model_path, **args):
if args['model_type'] == 'normal':
model_path = 'saved_models/normal_model'
print(f"Retrieving {args['model_type']} model...")
model = get_model(model_path)
print("Model retrieved.")
model_vars = get_model_vars()
# start video analysis using mod... | [
"def start_video(model, model_vars):\r\n vid = cv2.VideoCapture(0)\r\n counter = 0\r\n text = \"\"\r\n frame_title = \"Press q to quit\"\r\n while True:\r\n # Capture video\r\n _, frame = vid.read()\r\n \r\n # send image to CNN model every 50 iterations\r\n if count... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches the feature.feature_id of the specified scaffold feature from Chado. This function assumes that only one unique scaffold per organism exists. | def get_scaffold_id(conn, scaffold_name: str = None, genus: str = 'Drosophila', species: str = 'melanogaster',
scaffold_type: str = 'golden_path'):
if scaffold_name is None:
raise ValueError("No scaffold name specified.")
scaffold_id_query = """
select feature_id
from fe... | [
"def get_alice_cds_193_seqfeature():\n seq_ftr = create_1_part_seqfeature(110297, 110537, 1, \"CDS\")\n return seq_ftr",
"def get_alice_cds_124_seqfeature():\n seq_ftr = create_2_part_seqfeature(70374, 70902, 1, 70901, 71285, 1, \"CDS\")\n return seq_ftr",
"def get_alice_cds_252_seqfeature():\n s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes a Chado database connection, a location, and returns a dictionary of all miRNA / mRNA features that overlap the given location. | def get_overlapping_miRNA_mRNA(conn, location: dict = {}):
# SQL query to look for overlapping transcript features.
miRNA_mRNA_query = """
select f.uniquename,
flybase.current_symbol(f.uniquename),
cvt.name
from featureloc_slice(%s, %s, %s) as fl join feature f on fl.feature_id... | [
"def generate_connectivity(conn, location_map):\n\n import networkx as nx\n\n df_cluster = pd.read_sql(\"\"\"\n SELECT\n m.user_id, m.cluster_id\n FROM\n media_events AS m, cluster AS c\n WHERE\n cluster_id IS NOT NULL AND m.cluster_id = c.id;\n \"\"\", conn)\n\n df_edge = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
switch on 5.1 mode | def set_mode51(cls):
cls.mode_51 = True | [
"def mode51(cls):\r\n return cls.mode_51",
"def test_mode_toggle(self, caplog, api_mock):\n self.mock_api.return_value = ({'code': 0}, 200)\n fan = VeSyncAir131(DEV_LIST_DETAIL, self.vesync_obj)\n f = fan.auto_mode()\n assert f\n assert fan.mode == 'auto'\n f = fan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
either mode 5.1 or 5.2/5.3/6.1 | def mode51(cls):
return cls.mode_51 | [
"def getRSelMode(self,targetDevice):\n if (targetDevice in self.adc_based_acquisition):\n return \"e5x\"\n elif (targetDevice in [\"SAML22\"]):\n return \"l22\"\n elif (targetDevice in [\"PIC32CZCA80\", \"PIC32CZCA90\"]):\n return \"pic32cz\"\n else:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get command ids of given class | def cmd_ids(cls):
ids = []
for command in cls.commands():
ids.append(CommandMapper.text2num()[command])
return ids | [
"def cmd_commands(self):\r\n return self.commands()",
"def get_ids():",
"def get_command_list (self):\r\n # Currently this is only used on Mac OS, for the Mac-only GUI\r\n # Distutils interface (by Jack Jansen)\r\n\r\n import distutils.command\r\n std_commands = distutils.comm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stop the process of splitting off a clone from its parent volume and snapshot. All of the blocks that were formerly shared between the given clone and its parent volume that have already been split off will remain that way. This command fails if applied to a traditional volume. Cloning is a new capability that applies ... | def volume_clone_split_stop(self, volume):
return self.request( "volume-clone-split-stop", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
} ) | [
"def volume_clone_split_start(self, volume):\n return self.request( \"volume-clone-split-start\", {\n 'volume': [ volume, 'volume', [ basestring, 'None' ], False ],\n }, {\n 'result-error-message': [ basestring, False ],\n 'result-jobid': [ int, False ],\n '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the name of an Infinite Volume, either return its current size or set the Infinite Volume's size to the stated amount. This API is not supported for Flexible Volumes. This API is not supported on Infinite Volume constituents. | def volume_size_async(self, volume_name, new_size=None):
return self.request( "volume-size-async", {
'new_size': [ new_size, 'new-size', [ basestring, 'None' ], False ],
'volume_name': [ volume_name, 'volume-name', [ basestring, 'None' ], False ],
}, {
'result-error-m... | [
"def volume_size(self, volume, new_size=None):\n return self.request( \"volume-size\", {\n 'volume': [ volume, 'volume', [ basestring, 'None' ], False ],\n 'new_size': [ new_size, 'new-size', [ basestring, 'None' ], False ],\n }, {\n 'is-fixed-size-flex-volume': [ bool... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display an estimate of additional storage required in the underlying aggregate to perform a volume clone split operation. This command fails if applied to a traditional volume. Cloning is a new capability that applies exclusively to flexible volumes. | def volume_clone_split_estimate(self, volume):
return self.request( "volume-clone-split-estimate", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
'clone-split-estimate': [ CloneSplitEstimateInfo, True ],
} ) | [
"def test_copy_vm_disks_after_cloned_as_thin(self, storage):\n self.copy_with_template(storage=storage, clone=False)",
"def test_copy_vm_disks_after_cloned_as_clone(self, storage):\n self.copy_with_template(storage=storage)",
"def test_create_cloned_volume(self):\n self.mox.StubOutWithMock(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the given volume's language mapping. | def volume_get_language(self, volume):
return self.request( "volume-get-language", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
'language-code': [ basestring, False ],
'nfs-character-set': [ basestring, False ],
'oem-character-set'... | [
"def get_language_pack(locale: str) -> dict:\n if check_locale(locale):\n for entry_point in entry_points(group=JUPYTERLAB_LANGUAGEPACK_ENTRY):\n if locale == entry_point.name:\n return entry_point.load()\n else:\n return {}\n else:\n print(\"Locale '{... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to see if a desired volume transition can be performed from one volume type to another. Only 7mode flexible volume to clustermode flexible volume and vice versa with limited options are supported at this time. | def volume_transition_check(self, source_node, volumes, operation_type=None, override_warnings=None, destination_vserver_name=None, non_disruptive=None):
return self.request( "volume-transition-check", {
'source_node': [ source_node, 'source-node', [ basestring, 'None' ], False ],
'opera... | [
"def _validate_manage_existing_vol_type(self, volume):\n replication_type = self._get_replication_type_from_vol_type(\n volume.volume_type)\n if replication_type == REPLICATION_TYPE_SYNC:\n raise exception.ManageExistingVolumeTypeMismatch(\n _(\"Unable to managed v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the progress in separating clones from their underlying parent volumes and snapshots. If a clone name is specified, then the split status for that clone is provided. If no clone name is provided, then status is provided for all clones currently being split. This command fails if applied to a traditional volume,... | def volume_clone_split_status(self, volume=None):
return self.request( "volume-clone-split-status", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
'clone-split-details': [ CloneSplitDetailInfo, True ],
} ) | [
"def wait_for_clone(client, clone, timeout=600):\n clone_status_cmd = f\"ceph fs clone status {clone.get('vol_name')} {clone.get('target_subvol_name')} \"\n clone_status_cmd = (\n clone_status_cmd + f\"--group_name {clone.get('group_name')} --format json\"\n )\n cmd_out, cmd_rc = client.exec_comm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resume RAID parity scrubbing on the named traditional volume, plex, or RAID group. If no name is given, then resume scrubbing on all RAID groups for which it is suspended. | def volume_scrub_resume(self, name=None):
return self.request( "volume-scrub-resume", {
'name': [ name, 'name', [ basestring, 'None' ], False ],
}, {
} ) | [
"def volume_scrub_suspend(self, name=None):\n return self.request( \"volume-scrub-suspend\", {\n 'name': [ name, 'name', [ basestring, 'None' ], False ],\n }, {\n } )",
"def resume(shelf=None):\n\n _act_on_guests(shelf, \"resume\")",
"def volume_scrub_start(self, name=None):\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the options that have been set for the specified volume. | def volume_options_list_info(self, volume):
return self.request( "volume-options-list-info", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
'options': [ VolumeOptionInfo, True ],
} ) | [
"def get_volume_options(mnode, volname, option=None):\n if not option:\n _, get_vol_options, err = RestClient(mnode).handle_request(\n \"GET\", \"/v1/volumes/%s/options\" % volname, httplib.OK, None)\n else:\n _, get_vol_options, err = RestClient(mnode).handle_request(\n \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a list of volumes and a breakdown of their space usage. This information is only available for online volumes. If no volume is specified, status is displayed for all online volumes on the filer. Note that if space status information for more than 20 volumes is desired, the volumespacelistinfoiter ZAPIs will be m... | def volume_space_list_info(self, volume=None):
return self.request( "volume-space-list-info", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
'vol-space-infos': [ VolSpaceInfo, True ],
} ) | [
"def _display_oci_volume_list(volumes, output_mode, details, truncate):\n\n def _get_displayable_size(_, volume):\n return volume.get_size(format_str=OCI_VOLUME_SIZE_FMT.HUMAN.name)\n\n def _get_attached_instance_name(_, volume):\n global _this_instance_ocid\n if not volume.is_attached():... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Restrict the specified Infinite Volume making it unavailable for data access. This API is not supported for Flexible Volumes. This API is not supported on Infinite Volume constituents. | def volume_restrict_async(self, volume_name):
return self.request( "volume-restrict-async", {
'volume_name': [ volume_name, 'volume-name', [ basestring, 'None' ], False ],
}, {
'result-error-message': [ basestring, False ],
'result-jobid': [ int, False ],
... | [
"def volume_restrict(self, name, cifs_delay=None):\n return self.request( \"volume-restrict\", {\n 'name': [ name, 'name', [ basestring, 'None' ], False ],\n 'cifs_delay': [ cifs_delay, 'cifs-delay', [ int, 'None' ], False ],\n }, {\n } )",
"def narrow(self, *args):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get information on what possibilities and parameters exist for volumes on a given filer. | def volume_get_filer_info(self):
return self.request( "volume-get-filer-info", {
}, {
'disk-types': [ basestring, False ],
'default-raidtype': [ basestring, False ],
'checksum-types': [ basestring, False ],
'root-volume': [ basestring, False ],
... | [
"def volume_wafl_info(self):\n return self.request( \"volume-wafl-info\", {\n }, {\n 'root-volume': [ basestring, False ],\n 'disk-types': [ basestring, False ],\n 'snapshots-max': [ int, False ],\n 'checksum-types': [ basestring, False ],\n } )",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove the specified plex from a mirrored traditional volume and create a new unmirrored traditional volume with the specified name that contains the splitoff plex. The original mirrored traditional volume becomes unmirrored. The plex to be split from the original traditional volume must be functional (not partial), bu... | def volume_split(self, new_volume_name, plex):
return self.request( "volume-split", {
'new_volume_name': [ new_volume_name, 'new-volume-name', [ basestring, 'None' ], False ],
'plex': [ plex, 'plex', [ basestring, 'None' ], False ],
}, {
} ) | [
"def volume_clone_split_stop(self, volume):\n return self.request( \"volume-clone-split-stop\", {\n 'volume': [ volume, 'volume', [ basestring, 'None' ], False ],\n }, {\n } )",
"def remove_segmented_mirror(self):\n self.sm = SegmentedMirror(indexed_aperture=self.aper_ind, s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stop RAID parity scrubbing on the named volume, plex, or group; if no name is given, on all RAID groups currently undergoing parity scrubbing. | def volume_scrub_stop(self, name=None):
return self.request( "volume-scrub-stop", {
'name': [ name, 'name', [ basestring, 'None' ], False ],
}, {
} ) | [
"def stop():\n # report operation\n llecho('Stopping all LVM volume groups')\n\n # make 10 tries to stop all volume groups\n status = 0\n\n for i in range(0, 10):\n\n # run the command to stop volume groups\n status = run(CMD_STOP_LVM)\n\n # stopped successfully: quit\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Suspend RAID parity scrubbing on the named traditional volume, plex, or RAID group. If no name is given, suspend scrubbing on all RAID groups currently being scrubbed. | def volume_scrub_suspend(self, name=None):
return self.request( "volume-scrub-suspend", {
'name': [ name, 'name', [ basestring, 'None' ], False ],
}, {
} ) | [
"def volume_scrub_resume(self, name=None):\n return self.request( \"volume-scrub-resume\", {\n 'name': [ name, 'name', [ basestring, 'None' ], False ],\n }, {\n } )",
"def volume_scrub_stop(self, name=None):\n return self.request( \"volume-scrub-stop\", {\n 'name'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the junctionpath of the volume. | def volume_get_volume_path(self, volume, is_style_cifs):
return self.request( "volume-get-volume-path", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
'is_style_cifs': [ is_style_cifs, 'is-style-cifs', [ bool, 'None' ], False ],
}, {
'junction': [ ba... | [
"def _get_volume_path(self):\n return heconflib.get_volume_path(\n self._parent.environment[ohostedcons.StorageEnv.SP_UUID],\n self._parent.environment[ohostedcons.StorageEnv.SD_UUID],\n self._parent.environment[ohostedcons.StorageEnv.IMG_UUID],\n self._parent.envi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Aborts the volume move operation of the specified source volume. This is a synchronous API. | def volume_move_abort(self, source_volume):
return self.request( "volume-move-abort", {
'source_volume': [ source_volume, 'source-volume', [ basestring, 'None' ], False ],
}, {
} ) | [
"def volume_move_pause(self, source_volume):\n return self.request( \"volume-move-pause\", {\n 'source_volume': [ source_volume, 'source-volume', [ basestring, 'None' ], False ],\n }, {\n } )",
"def volume_move_resume(self, source_volume, cutover_window=None, is_manual_cutover=None... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the name of a flexible volume, get the autosize settings. This API is not supported for Infinite Volumes. | def volume_autosize_get(self, volume):
return self.request( "volume-autosize-get", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
'increment-size': [ basestring, False ],
'minimum-size': [ basestring, False ],
'grow-threshold-percent... | [
"def volume_autosize_set(self, volume, reset=None, increment_size=None, minimum_size=None, grow_threshold_percent=None, maximum_size=None, shrink_threshold_percent=None, is_enabled=None, mode=None):\n return self.request( \"volume-autosize-set\", {\n 'reset': [ reset, 'reset', [ bool, 'None' ], Fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resumes a previously paused volume move operation of a specified source volume. his is an asynchronous API. It will run a series of checks to determine if the volume move can be resumed. If there are no errors or warnings, the API will return successfully. The move will be resumed. The status of the move can be obtaine... | def volume_move_resume(self, source_volume, cutover_window=None, is_manual_cutover=None, is_override_warnings=None, cutover_attempts=None, is_keep_source=None):
return self.request( "volume-move-resume", {
'cutover_window': [ cutover_window, 'cutover-window', [ int, 'None' ], False ],
's... | [
"def volume_move_pause(self, source_volume):\n return self.request( \"volume-move-pause\", {\n 'source_volume': [ source_volume, 'source-volume', [ basestring, 'None' ], False ],\n }, {\n } )",
"async def resume_(self, ctx):\r\n vc = ctx.voice_client\r\n\r\n if not vc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start RAID parity scrubbing on the named traditional volume, plex, or RAID group. RAID parity scrubbing compares the data disks to the parity disk in a RAID group, correcting the parity disk's contents as necessary. If a plex name is given, then scrubbing is started on all RAID groups contained in the plex. If a RAID g... | def volume_scrub_start(self, name=None):
return self.request( "volume-scrub-start", {
'name': [ name, 'name', [ basestring, 'None' ], False ],
}, {
} ) | [
"def volume_split(self, new_volume_name, plex):\n return self.request( \"volume-split\", {\n 'new_volume_name': [ new_volume_name, 'new-volume-name', [ basestring, 'None' ], False ],\n 'plex': [ plex, 'plex', [ basestring, 'None' ], False ],\n }, {\n } )",
"def volume_sc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns an unmirrored traditional volume into a mirrored traditional volume by adding a plex to it. The plex is either newly formed from disks chosen from a spare pool or, if the "victimvolume" option is specified, is taken from another existing unmirrored volume. The volume must currently be unmirrored. Disks may be spe... | def volume_mirror(self, volume, mirror_disks=None, force=None, victim_volume=None):
return self.request( "volume-mirror", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
'mirror_disks': [ mirror_disks, 'mirror-disks', [ DiskInfo, 'None' ], True ],
'force': [ ... | [
"def set_mirror_volume_mounts(self, mirror_volume_mounts=True):\n\n self.mirror_volume_mounts = mirror_volume_mounts\n return self",
"def volume_split(self, new_volume_name, plex):\n return self.request( \"volume-split\", {\n 'new_volume_name': [ new_volume_name, 'new-volume-name',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the list of guarantee types that are supported on this volume. This just does semantic checks and so enabling supported guarantees can still fail because of space checks. | def volume_get_supported_guarantees(self, volume):
return self.request( "volume-get-supported-guarantees", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
'guarantee-types': [ Guarantee, True ],
} ) | [
"def _get_supportedProductTypes(self) -> \"std::vector< std::string,std::allocator< std::string > >\" :\n return _core.Application__get_supportedProductTypes(self)",
"def supported_types(self) -> List[BundleType]:",
"def _get_io_supported_types(opset_version: target) -> Set[type]:\n supported_types = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Associate a charmap description with a specified volume. | def volume_charmap_set(self, volume, charmap=None):
return self.request( "volume-charmap-set", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
'charmap': [ charmap, 'charmap', [ basestring, 'None' ], False ],
}, {
} ) | [
"def volume_charmap_get(self, volume):\n return self.request( \"volume-charmap-get\", {\n 'volume': [ volume, 'volume', [ basestring, 'None' ], False ],\n }, {\n 'charmap': [ basestring, False ],\n } )",
"def set_description(self, room_description):\n self.description... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DEFINED HERE FOR BACKWARDS COMPATIBILITY ONLY. CHANGE OVER TO USING THE NEW 'volumegetfilerinfo' AS SOON AS POSSIBLE. Get WAFL status information. | def volume_wafl_info(self):
return self.request( "volume-wafl-info", {
}, {
'root-volume': [ basestring, False ],
'disk-types': [ basestring, False ],
'snapshots-max': [ int, False ],
'checksum-types': [ basestring, False ],
} ) | [
"def volume_get_filer_info(self):\n return self.request( \"volume-get-filer-info\", {\n }, {\n 'disk-types': [ basestring, False ],\n 'default-raidtype': [ basestring, False ],\n 'checksum-types': [ basestring, False ],\n 'root-volume': [ basestring, False ]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the given volume's language mapping. | def volume_set_language(self, volume, language_code):
return self.request( "volume-set-language", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
'language_code': [ language_code, 'language-code', [ basestring, 'None' ], False ],
}, {
} ) | [
"def _set_language(self, language):\n self.m_language = language",
"def update(self,language):\n\n for key, value in language.items():\n self.language[key] = value",
"def change_lang(self, new_lang: str):\r\n self.lang = new_lang",
"def lang(self, language):\r\n doc.lang... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mount a volume on another volume (parent) with a junctionpath. This API is not supported on Infinite Volume constituents. | def volume_mount(self, volume_name, junction_path, export_policy_override=None, activate_junction=None):
return self.request( "volume-mount", {
'export_policy_override': [ export_policy_override, 'export-policy-override', [ bool, 'None' ], False ],
'volume_name': [ volume_name, 'volume-n... | [
"def mount(device, mountpoint, *args, readonly=False, mkfs=False):\n raise NotImplementedError(\"Contribute on github.com/alej0varas/pybolator\")",
"def attach_to_instance(self, volume, instance, mountpoint):\r\n return volume.attach_to_instance(instance, mountpoint)",
"def attach_volume(self, instanc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a list of volumes and a breakdown of their data and metadata footprints in their parent aggregates. The term footprint is used to refer to the portion of aggregate used space that will be freed when the relevant volume is destroyed. This can exceed the size of the volume due to metadata. If no volume is specifie... | def volume_footprint_list_info(self, volume=None):
return self.request( "volume-footprint-list-info", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
'vol-footprint-infos': [ VolFootprintInfo, False ],
} ) | [
"def _display_oci_volume_list(volumes, output_mode, details, truncate):\n\n def _get_displayable_size(_, volume):\n return volume.get_size(format_str=OCI_VOLUME_SIZE_FMT.HUMAN.name)\n\n def _get_attached_instance_name(_, volume):\n global _this_instance_ocid\n if not volume.is_attached():... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set a volume's 'filestotal' value to the given quantity. This specifies the maximum number of uservisible files that the given volume can hold, | def volume_set_total_files(self, volume, requested_total_files, force=None):
return self.request( "volume-set-total-files", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
'force': [ force, 'force', [ bool, 'None' ], False ],
'requested_total_files': [ reques... | [
"def total_vol(self, total_vol):\n\t\tself._total_vol = total_vol",
"def files_count(self, value):\n self.logger.warn(\n \"Setting values on files_count will NOT update the remote Canvas instance.\"\n )\n self._files_count = value",
"def set_total_sent(buf, total):\n buf[TOTAL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starts an iteration through the list of volumes. | def volume_list_info_iter_start(self, volume=None, verbose=None):
return self.request( "volume-list-info-iter-start", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
'verbose': [ verbose, 'verbose', [ bool, 'None' ], False ],
}, {
'records': [ int, Fa... | [
"def _iter_volumes(self):\n if self.volumes:\n for volume_name, container_path in self.volumes.iteritems():\n if \"/\" in volume_name:\n # if a / is found in the name, assume it's a full path specified on the host\n host_path = volume_name\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds disks to the given traditional volume. Specify the disks to add in the same way as for 'volumecreate'. Disks cannot be added to a mirrored traditional volume if one of its plexes is offline. Addition of the specified disk(s) may not have completed by the time the API returns. Use 'volumelistinfo' to query the trad... | def volume_add(self, volume, disk_size_with_unit=None, mirror_disks=None, disk_size=None, force=None, disks=None, raid_group=None, disk_count=None):
return self.request( "volume-add", {
'disk_size_with_unit': [ disk_size_with_unit, 'disk-size-with-unit', [ basestring, 'None' ], False ],
... | [
"def add(self, *params):\n if not params or len(params)==0:\n raise TypeError(\"add takes at lease 1 argument 0 given.\")\n elif params and len(params)>2:\n raise TypeError(\"add takes at lease 1 argument %u given.\" %(len(params)))\n disk=params[0]\n return self._a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transition a volume between 7Mode and ClusterMode. Currently the only supported operation type is transitioning a 7Mode Flexible Volume that has been copied from a 7Mode Filer for the purpose of transitioning it to a ClusterMode Flexible Volume. A jobid will be returned that can be used to query to progress of the tran... | def volume_transition(self, source_node, volumes, affinity_node=None, operation_type=None, override_warnings=None, destination_vserver_name=None, non_disruptive=None):
return self.request( "volume-transition", {
'affinity_node': [ affinity_node, 'affinity-node', [ basestring, 'None' ], False ],
... | [
"def modify_cluster(ClusterId=None, StepConcurrencyLevel=None):\n pass",
"def intTransition(self):\n \n state = self.state.get()\n\n if state == \"idle\":\n return PolicemanMode(\"working\")\n elif state == \"working\":\n return PolicemanMode(\"idle\")\n else:\n raise DEVSException(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return charmap information for a specified volume. | def volume_charmap_get(self, volume):
return self.request( "volume-charmap-get", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
'charmap': [ basestring, False ],
} ) | [
"def volume_charmap_set(self, volume, charmap=None):\n return self.request( \"volume-charmap-set\", {\n 'volume': [ volume, 'volume', [ basestring, 'None' ], False ],\n 'charmap': [ charmap, 'charmap', [ basestring, 'None' ], False ],\n }, {\n } )",
"def volume_options_l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start RAID mirror verification on the named traditional volume. RAID mirror verification compares the data in both plexes of a mirrored aggregate (whether it's freestanding or embedded in a traditional volume). In the default case, any blocks that differ are logged and no changes are made. The fixplex option is used to... | def volume_verify_start(self, volume=None, fix_plex=None, log_only=None):
return self.request( "volume-verify-start", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
'fix_plex': [ fix_plex, 'fix-plex', [ int, 'None' ], False ],
'log_only': [ log_only, 'log-on... | [
"def execute(self):\n to_trigger = ValidateVerification(content = self.content).run()\n\n logger.info('Sending gp_primarymirror requests...')\n pool = WorkerPool(min(len(to_trigger), self.batch_default))\n\n for pseg in to_trigger:\n host, port = pseg.getSegmentHostName(), pse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Suspend RAID mirror verification on the named traditional volume. If no name is given, suspend mirror verification on all aggregates (including those embedded in traditional volumes) currently being verified. | def volume_verify_suspend(self, volume=None):
return self.request( "volume-verify-suspend", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
} ) | [
"def volume_scrub_suspend(self, name=None):\n return self.request( \"volume-scrub-suspend\", {\n 'name': [ name, 'name', [ basestring, 'None' ], False ],\n }, {\n } )",
"def volume_scrub_resume(self, name=None):\n return self.request( \"volume-scrub-resume\", {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Volume Storage Service Rename | def volume_storage_service_rename(self, volume, storage_service, new_storage_service):
return self.request( "volume-storage-service-rename", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
'storage_service': [ storage_service, 'storage-service', [ basestring, 'None' ], F... | [
"def rename(nitro, service):\n __service = NSService()\n __service.set_name(service.get_name())\n __service.set_newname(service.get_newname())\n return __service.perform_operation(nitro, \"rename\")",
"def rename(cls, client, resource, new_servicename) :\n\t\ttry :\n\t\t\trenameresourc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterate over a list of volumestorageservice objects. | def volume_storage_service_get_iter(self, max_records=None, query=None, tag=None, desired_attributes=None):
return self.request( "volume-storage-service-get-iter", {
'max_records': max_records,
'query': [ query, 'query', [ StorageServiceInfo, 'None' ], False ],
'tag': tag,
... | [
"def iter_storages(self) -> Iterator[Storage]:\n raise NotImplementedError",
"def _iter_volumes(self):\n if self.volumes:\n for volume_name, container_path in self.volumes.iteritems():\n if \"/\" in volume_name:\n # if a / is found in the name, assume it'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transition a volume from one type to another. Delete the logged information about a transition operation. | def volume_transition_log_delete(self, volume_name, operation_type=None, destination_vserver_name=None, source_node=None):
return self.request( "volume-transition-log-delete", {
'volume_name': [ volume_name, 'volume-name', [ basestring, 'None' ], False ],
'operation_type': [ operation_ty... | [
"def volume_transition(self, source_node, volumes, affinity_node=None, operation_type=None, override_warnings=None, destination_vserver_name=None, non_disruptive=None):\n return self.request( \"volume-transition\", {\n 'affinity_node': [ affinity_node, 'affinity-node', [ basestring, 'None' ], Fals... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtains the status of the volume move operation. This is a synchronous API. | def volume_move_status(self, source_volume=None, is_verbose=None):
return self.request( "volume-move-status", {
'source_volume': [ source_volume, 'source-volume', [ basestring, 'None' ], False ],
'is_verbose': [ is_verbose, 'is-verbose', [ bool, 'None' ], False ],
}, {
... | [
"def is_moving(self):\n mcl_is_moving = self.madlib['MCL_MicroDriveMoveStatus']\n mcl_is_moving.restype = c_int\n mcl_is_moving(self.isMoving_pointer, c_int(self.handler))\n return self.isMoving.value",
"def volume_status(self, volume):\r\n volume = self._get_volume(volume)\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Continues an iteration through the list of volumes. | def volume_list_info_iter_next(self, tag, maximum):
return self.request( "volume-list-info-iter-next", {
'tag': tag,
'maximum': [ maximum, 'maximum', [ int, 'None' ], False ],
}, {
'records': [ int, False ],
'volumes': [ VolumeInfo, True ],
} ) | [
"def _iter_volumes(self):\n if self.volumes:\n for volume_name, container_path in self.volumes.iteritems():\n if \"/\" in volume_name:\n # if a / is found in the name, assume it's a full path specified on the host\n host_path = volume_name\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Begin the process by which the given clone is split off from its underlying parent volume and snapshot. New storage is allocated for the clone that is distinct from its parent. This process may take some time and proceeds in the background. Use the 'volumeclonesplitstatus' command to view the operation's progress. Both... | def volume_clone_split_start(self, volume):
return self.request( "volume-clone-split-start", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
}, {
'result-error-message': [ basestring, False ],
'result-jobid': [ int, False ],
'result-error-... | [
"def volume_clone_split_status(self, volume=None):\n return self.request( \"volume-clone-split-status\", {\n 'volume': [ volume, 'volume', [ basestring, 'None' ], False ],\n }, {\n 'clone-split-details': [ CloneSplitDetailInfo, True ],\n } )",
"def volume_clone_split_est... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the name of the "root" volume on the filer. If this request is executed in the context of a vfiler, the "root" volume of the vfiler will be returned. If this request is executed in the context of a Vserver the "namespace root" volume of the Vserver will be returned. If the "namespace root" volume of the Admin Vs... | def volume_get_root_name(self):
return self.request( "volume-get-root-name", {
}, {
'volume': [ basestring, False ],
} ) | [
"def get_gluster_default_volume_name():\n # type: (None) -> str\n return _GLUSTER_DEFAULT_VOLNAME",
"def get_file_server_glusterfs_volume_name(sc):\n # type: (StorageClusterSettings) -> str\n try:\n volname = sc.file_server.server_options['glusterfs']['volume_name']\n except KeyError:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the option named 'optionname' to the value specified by 'optionvalue' in the specified volume. The change remains effective even after the filer is rebooted. Some options have values that are numbers or strings, and others have values that are 'on' (also expressible as 'yes', 'true', or '1' ) or "off" (also express... | def volume_set_option(self, volume, option_value, option_name):
return self.request( "volume-set-option", {
'volume': [ volume, 'volume', [ basestring, 'None' ], False ],
'option_value': [ option_value, 'option-value', [ basestring, 'None' ], False ],
'option_name': [ option_... | [
"def set_option(a_option_name, a_value):\n if a_value is None or str(a_value) == \"\":\n execute(\"let &\" + a_option_name + \" = \\\"\\\"\")\n else:\n execute(\"let &\" + a_option_name + \" = \\\"\" + str(a_value) + \"\\\"\")",
"def setOption(name, value):\n \n if _fwk is not None:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initiates a manual cutover operation on the specified source volume. This is a synchronous API. Cutover is the final phase of volume move operation after which destination volume takes the identity of the source volume. If cutover cannot be initiated or completed, the API will return with an error. The move will pause ... | def volume_move_cutover(self, source_volume, cutover_window=None):
return self.request( "volume-move-cutover", {
'cutover_window': [ cutover_window, 'cutover-window', [ int, 'None' ], False ],
'source_volume': [ source_volume, 'source-volume', [ basestring, 'None' ], False ],
}, ... | [
"def volume_move_resume(self, source_volume, cutover_window=None, is_manual_cutover=None, is_override_warnings=None, cutover_attempts=None, is_keep_source=None):\n return self.request( \"volume-move-resume\", {\n 'cutover_window': [ cutover_window, 'cutover-window', [ int, 'None' ], False ],\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return calculated volume limits, which are based on the current configuration of the Vserver. If an Infinite Volume already exists on the Vserver, the values returned are in relation to the existing volume. This API is not supported for Flexible Volumes. | def volume_get_limits(self, space_guarantee=None, data_aggr_list=None, enable_snapdiff=None, namespace_mirror_aggr_list=None, max_data_constituent_size=None, max_namespace_constituent_size=None, namespace_aggregate=None):
return self.request( "volume-get-limits", {
'space_guarantee': [ space_guarant... | [
"def get_limits(self):\n self.LOG.info(\"Get Limits\")\n limits = {}\n limits.update(self.conn.get_compute_limits())\n limits.update(self.conn.get_volume_limits()[\"absolute\"])\n\n return {\n \"max_total_cores\": str(limits[\"max_total_cores\"]),\n \"max_tot... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the name of a flexible volume, set the autosize settings. This API is not supported for Infinite Volumes. | def volume_autosize_set(self, volume, reset=None, increment_size=None, minimum_size=None, grow_threshold_percent=None, maximum_size=None, shrink_threshold_percent=None, is_enabled=None, mode=None):
return self.request( "volume-autosize-set", {
'reset': [ reset, 'reset', [ bool, 'None' ], False ],
... | [
"def volume_autosize_get(self, volume):\n return self.request( \"volume-autosize-get\", {\n 'volume': [ volume, 'volume', [ basestring, 'None' ], False ],\n }, {\n 'increment-size': [ basestring, False ],\n 'minimum-size': [ basestring, False ],\n 'grow-thre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take the specified Infinite Volume offline, thereby making it unavailable for data access. The Infinite Volume must be unmounted before it can be made offline. This API is not supported for Flexible Volumes. This API is not supported on Infinite Volume constituents. | def volume_offline_async(self, volume_name):
return self.request( "volume-offline-async", {
'volume_name': [ volume_name, 'volume-name', [ basestring, 'None' ], False ],
}, {
'result-error-message': [ basestring, False ],
'result-jobid': [ int, False ],
'r... | [
"def async_turn_off_ac_volume(self):\n yield from self._try_command(\n \"Setting volume off of the miio AC failed.\",\n self._device.set_volume, \"off\")",
"def detach(self, volume):\r\n return volume.detach()",
"def _wait_for_unattachedvol(volume, sleep_time=5.0):\n stat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |