query stringlengths 9 9.05k | document stringlengths 10 222k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
test shifting translation to and from the center of coordinates of the master ncs copy | def test_center_of_coordinates_shift():
# print sys._getframe().f_code.co_name
# c = commons()
pdb_inp = iotbx.pdb.input(source_info=None, lines=test_pdb_str_2)
ncs_obj_phil = ncs.input(
hierarchy=pdb_inp.construct_hierarchy())
ncs_restraints_group_list = ncs_obj_phil.get_ncs_restraints_group_list()
... | [
"def test_pose_shifter(self):\n self.dyn_client.update_configuration({\"linear_offset_x\":0.1, \"linear_offset_y\":0.0, \"linear_offset_z\":0.05})\n pose_in = geometry_msgs.msg.PoseStamped()\n expected = geometry_msgs.msg.PoseStamped()\n pose_in.header.frame_id = \"base_link\"\n e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
verify that extended_ncs_selection, which include the master ncs copy and the portion of the protein we want to refine. | def test_ncs_selection():
pdb_inp = iotbx.pdb.input(source_info=None, lines=test_pdb_str_2)
ncs_obj_phil = ncs.input(
hierarchy=pdb_inp.construct_hierarchy())
ncs_restraints_group_list = ncs_obj_phil.get_ncs_restraints_group_list()
# ncs_restraints_group_list._show()
refine_selection = flex.size_t(range... | [
"def test_selection():\n pdb_inp = iotbx.pdb.input(source_info=None, lines=pdb_answer_0)\n ncs_obj_phil = ncs.input(\n hierarchy=pdb_inp.construct_hierarchy())\n nrg = ncs_obj_phil.get_ncs_restraints_group_list()\n\n m1 = list(nrg[0].master_iselection)\n c1 = list(nrg[0].copies[0].iselection)\n c2 = list... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test that a atom selection propagates correctly to ncs_restraints_group_list | def test_selection():
pdb_inp = iotbx.pdb.input(source_info=None, lines=pdb_answer_0)
ncs_obj_phil = ncs.input(
hierarchy=pdb_inp.construct_hierarchy())
nrg = ncs_obj_phil.get_ncs_restraints_group_list()
m1 = list(nrg[0].master_iselection)
c1 = list(nrg[0].copies[0].iselection)
c2 = list(nrg[0].copie... | [
"def ncs_groups_selection(ncs_restraints_group_list,selection):\n if isinstance(selection,flex.bool): selection = selection.iselection(True)\n sel_set = set(selection)\n new_nrg_list = ncs_restraints_group_list_copy(ncs_restraints_group_list)\n # check what are the selection that shows in both master and all co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test of split_by_chains where chains are splitted, e.g. protein and ligand are separated by TER | def test_split_by_chain_2():
pdb_str = """\
CRYST1 174.866 238.091 243.466 90.00 90.00 90.00 P 21 21 21
SCALE1 0.005719 0.000000 0.000000 0.00000
SCALE2 0.000000 0.004200 0.000000 0.00000
SCALE3 0.000000 0.000000 0.004107 0.00000
ATOM 15295 N SER D 74 59.475 -... | [
"def test_get_chains(self):\n pass",
"def detect_chains(input_pdb):\n opened_pdb = open(input_pdb, \"r\").readlines()\n chains = []\n for value in opened_pdb[1:]:\n try:\n if value[21] not in chains:\n chains.append(value[21])\n except:\n continue... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query the google api for the given address and try to receive latitude and longitude information. The result is a dictionary with keys latitude and longitude where each value is set according to the response of the request. If the request was not successful because no or more than one address were returned or any other... | def fetch_address(address):
geo_location = {"latitude": None, "longitude": None}
logger.info("Querying for address '%s'", address)
response = requests.get(GOOGLE_URL, params={'address': address})
time.sleep(1)
try:
body = response.json()
except:
logger.error(response.status_cod... | [
"def get_address(address):\r\n apiKey = \"cjnRYfXH9Zv5vYT94e1hu5so2JhUAHT3\"\r\n url = \"https://www.mapquestapi.com/geocoding/v1/address?key={0}&location={1}&outFormat=json&maxResults=1&thumbMaps=false\".format(apiKey, address)\r\n request = requests.get(url)\r\n if request.status_code != 200:\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load files to kv | def load_files(self, flist, key_count, in_mem):
#change a filename to a list.
if not isinstance(flist, list):
flist = [flist]
fcnt = len(flist)
c_kvdict.load_files(self.__dict_handle, fcnt, flist, key_count, in_mem) | [
"def load_kv_from_py(f):\n filename = os.path.basename(os.path.splitext(f)[0])\n Builder.load_file(\n os.path.join(\n os.path.dirname(os.path.abspath(f)),\n filename + '.kv'\n )\n )",
"def load_files(self):\n\n # Load YAML files\n try:\n self.k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will count the length of your name | def length_of_name(self, name):
length = len(name)
if length > 10:
self.show_message_when_name_very_long()
return length | [
"def __len__(self):\n return(len(self.full_name()))",
"def lecturename_len(self, text):\n length = 0\n for c in text:\n if unicodedata.east_asian_width(c) in 'FWA':\n length += 2\n else:\n length += 1\n return length",
"def __len__(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will sleep based on the length of your name. | def sleep_based_on_name_length(self, name):
length = int(self.length_of_name(name))
time.sleep(length + 0.001)
return True | [
"def sleep(secs):\n return 'sleep {}'.format(secs)",
"def sleepDelay(ms):\n time.sleep(ms/1000.0)",
"def delay(ms):\n pass",
"def dname(namelength = 15):\n\tresult = \"\"\n\tfor x in range(namelength):\n\t\tresult += random.choice(\"0123456789\")\n\treturn result",
"def delay():\r\n time.sleep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts your name to all lower case. | def lowercase_name(name):
return name.lower() | [
"def strip_lower(self, name):\n return re.sub(\"[^a-zA-Z]+\", \"\",name).lower()",
"def lower_name_filter(name):\n return name.lower()",
"def to_lower(s):\n return s.lower()",
"def name_to_snake_case(name: str) -> str:\n\n # From COBOL entity\n if '-' in name or name.isupper():\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). | def zigzagLevelOrder(self, root):
if not root:
return []
# create direction variable
going_right = False
# initialize a level stack
level_stack = [root]
# initialize a result array
result = []
# loop while level stack is not empry
w... | [
"def zig_zag_traversal(root):\n return",
"def levelOrderTraversal(root):\n\tif not root:\n\t return []\n\t\n\tcurrent_level = 1\n\t_queue = [(root, current_level)]\n\tresult = []\n\tlevel_result = []\n\t\n\twhile _queue:\n\t node, level = _queue.pop(0)\n\t if node.left:\n\t _queue.append((node.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detect if we are done. Either all cells are open or the mine field is unsolvable. | def done(self):
return not self.get_all_closed_cells() or self.unsolvable | [
"def isFinish(self, cell):\n \n return self.inBounds(cell) and self.layout[cell[0]][cell[1]] == MAZE_DEFS['finish'];",
"def is_solved(self):\n return not self.grid",
"def did_solve(self) -> bool:\n return self._solution.info.status == \"solved\"",
"def _game_finished(self):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all closed cells that are adjacent to a list of cells given as input. | def get_adjacent_closed_cells(self, numbered_cells):
adjacent_closed_cells = []
for row, col in numbered_cells:
_, closed_cells, _, _ = self.get_cells(row, col)
adjacent_closed_cells += closed_cells
return list(set(adjacent_closed_cells)) | [
"def get_numbered_cells_adjacent_closed_cells(self):\r\n numbered_cells_adjacent_closed_cells = []\r\n numbered_cells = self.get_all_numbered_cells()\r\n for row, col in numbered_cells:\r\n _, closed_cells, _, _ = self.get_cells(row, col)\r\n if closed_cells:\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test all possible combinations of mines in the given list of closed cells. | def combinations(self, closed_cells):
made_progress = False
mine_combinations = self.get_combinations(closed_cells)
combination_cells = [cell for combination in mine_combinations
for cell in combination]
safe_cells = set(closed_cells) - set(combination_c... | [
"def test_combinations(self, combinations, cells):\r\n mine_combinations = []\r\n for combination in combinations:\r\n combination_fit = False\r\n for row, col in cells:\r\n # Test whether a combination of mines satisfies the number of\r\n # know min... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return all numbered cells that are next to closed cells. | def get_numbered_cells_adjacent_closed_cells(self):
numbered_cells_adjacent_closed_cells = []
numbered_cells = self.get_all_numbered_cells()
for row, col in numbered_cells:
_, closed_cells, _, _ = self.get_cells(row, col)
if closed_cells:
numbered_ce... | [
"def get_adjacent_closed_cells(self, numbered_cells):\r\n adjacent_closed_cells = []\r\n for row, col in numbered_cells:\r\n _, closed_cells, _, _ = self.get_cells(row, col)\r\n adjacent_closed_cells += closed_cells\r\n return list(set(adjacent_closed_cells))",
"def get_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test a list of mine field combinations and return only the ones that are valid. | def test_combinations(self, combinations, cells):
mine_combinations = []
for combination in combinations:
combination_fit = False
for row, col in cells:
# Test whether a combination of mines satisfies the number of
# know mines for neighbouri... | [
"def allowed_mods():\n mods = [Mod.EZ, Mod.HD, Mod.HR, Mod.DT, Mod.HT, Mod.FL]\n mod_powerset = chain.from_iterable(combinations(mods, r) for r in range(len(mods) + 1))\n combos = []\n for p in mod_powerset:\n combined_mod = Mod(0)\n for m in p:\n combined_mod |= m\n comb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load a queue with all cells that are open and have closed cells around them and are a number cell (= not a mine). | def initialise_queue(self):
self.cells_to_process = []
for row, col in self.get_all_open_cells():
_, closed_cells, _, _ = self.get_cells(row, col)
if not self.mine_field[row][col] == 'x' and closed_cells:
self.queue_cells([(row, col)])
return | [
"def queue_is_crowded(self):\n a = [self.model.grid.is_cell_empty(a) for a in self.queue_list] #check if cells are empty in queue list\n if sum(a)>4: #if less than 4 cells are non-empty return false\n return False\n else:\n return True",
"def queue_cells(self, cells):\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the next cell from the processing queue. | def get_next_cell(self):
cell = self.cells_to_process.pop(0)
return cell | [
"def next(self):\n if self.pointer > len(self.queue) - 1:\n self.pointer = 0\n raise StopIteration\n val = self.queue[self.pointer]\n self.pointer += 1\n return val",
"def next_ele(self):\n\t\ttry:\n\t\t\tret = self._queue.get(block = True, timeout=0.5)\n\t\t\tsel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Queue safe cells for processing. | def queue_cells(self, cells):
self.cells_to_process += [cell for cell in cells
if not cell in self.cells_to_process]
return | [
"def initialise_queue(self):\r\n self.cells_to_process = []\r\n for row, col in self.get_all_open_cells():\r\n _, closed_cells, _, _ = self.get_cells(row, col)\r\n if not self.mine_field[row][col] == 'x' and closed_cells:\r\n self.queue_cells([(row, col)])\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return all cells of same type in given list of cells. | def filter_cells(self, cells, cell_type):
cells = [(row, col) for row, col in cells
if self.mine_field[row][col] == cell_type]
return cells | [
"def all_cells(items):\n for item in items:\n if isinstance(item, types.GeneratorType):\n for cell_value in item:\n yield cell_value\n else:\n yield item",
"def get_all_cells(self):\n\n cells = OrderedDict()\n\n if self._type == 'fill' or self._t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all open cells. | def get_all_open_cells(self):
num_rows = len(self.mine_field)
num_cols = len(self.mine_field[0])
open_cells = [(row, col)
for row in range(num_rows)
for col in range(num_cols)
if not self.mine_field[row][col] == '?']
... | [
"def get_all_closed_cells(self):\r\n num_rows = len(self.mine_field)\r\n num_cols = len(self.mine_field[0])\r\n closed_cells = [(row, col)\r\n for row in range(num_rows)\r\n for col in range(num_cols)\r\n if self.mine_field[ro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all numbered cells. | def get_all_numbered_cells(self):
num_rows = len(self.mine_field)
num_cols = len(self.mine_field[0])
numbered_cells = [(row, col)
for row in range(num_rows)
for col in range(num_cols)
if self.mine_field[row][col]... | [
"def GetCells(self, p_int):\n ...",
"def cells(self):\n return self.container['cells']",
"def cells(self):\r\n return Cells(self)",
"def cells(self):\n for cell in self.row:\n yield Cell(self.sheet, cell)",
"def _cells(self, nb):\n if nb.nbformat < 4:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all closed cells. | def get_all_closed_cells(self):
num_rows = len(self.mine_field)
num_cols = len(self.mine_field[0])
closed_cells = [(row, col)
for row in range(num_rows)
for col in range(num_cols)
if self.mine_field[row][col] == '?']
... | [
"def get_all_cells(self):\n\n cells = OrderedDict()\n\n if self._type == 'fill' or self._type == 'lattice':\n cells.update(self._fill.get_all_cells())\n\n return cells",
"def cells(self):\r\n return Cells(self)",
"def get_all_open_cells(self):\r\n num_rows = len(sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a list of coordinates of cells that surround a cell specified by row and column. | def get_surrounding_cells(self, cell_row, cell_col):
positions = [(-1, 0), (-1, 1), (0, 1), (1, 1),
(1, 0), (1, -1), (0, -1), (-1, -1)]
surrounding_cells = []
max_row = len(self.mine_field) - 1
max_col = len(self.mine_field[0]) - 1
for pos in positions:... | [
"def getCellCoords(self, row, col):\n\n h = self.height/self.rows\n x_start=0\n y_start=0\n #get nearest rect co-ords for that row/col\n w = self.width/self.cols\n x1 = w*col\n y1=y_start+h*row\n x2=x1+w\n y2=y1+h\n return x1,y1,x2,y2",
"def ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return state of the mine field. Used to visualise the mine filed with print to console. | def get_state(self):
result = []
for row in self.mine_field:
result.append(' '.join([str(col) for col in row]))
return '\n'.join(result) | [
"def isMine(self):\n return self.mine",
"def state(self):\n return '%i%i%02i' % (self._coord.row, self._coord.col, self.walls)",
"def get_power_state(self, node):",
"def powerState_calculator(self):\r\n\r\n return self.vm_obj.runtime.powerState",
"def power_state(self) -> const.PowerSta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests if contains_point determines relationship between line_segment and point correctly. Tests both common and edge cases. | def test_contains_point() -> None:
point_1 = Point(1, 2)
point_2 = Point(-2, -4)
point_3 = Point(3, 3)
point_4 = Point(0, 0)
line_segment = LineSegment(first=point_1, second=point_2)
assert line_segment.does_contain(point_1)
assert line_segment.does_contain(point_2)
assert not line_seg... | [
"def can_fix_intersection(self, segment):\n\n points = segment.points\n points = [points[1], points[2], points[3], points[2], points[1], points[0]]\n path = create_path(points)\n layer = GSLayer()\n layer.paths.append(path)\n\n if layer.paths[0].insertNodeWithPathTime_(2.5)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets of N Msided dice, ignoring order, with relative frequencies. | def dice_set_freqs(n, m):
# The total number of permutations of N dice is N!
permutations = factorial(n)
# Use itertools to get the sets.
for outcome in combinations_with_replacement(range(1, m+1), n):
# For each set, the weight is N!/a!b!c!... where a, b, c... are
# the sizes of each g... | [
"def dice_unordered(n, m):\n return Lea.fromValFreqs(*dice_set_freqs(n, m))",
"def getNoiseSets(D, Y, K, nExamples):\r\n\t\r\n\t# split in k arrays\r\n\tsets = []\r\n\texampleLst = [idx for idx in range(nExamples)]\t# list of all example id\r\n\trandom.shuffle(exampleLst)\r\n\r\n\ti = 0\r\n\twhile len(exampleL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A Lea distribution representing an ordered set of N Msided dice. | def dice(n, m):
return Lea.interval(1, m).cprodTimes(n) | [
"def dice_unordered(n, m):\n return Lea.fromValFreqs(*dice_set_freqs(n, m))",
"def roll_die(self,n):\r\n return [randint(1,self.sidedness) for t in range(n)]",
"def randomdice(self):\n self.numdice = max(1, self.townsize - 2)\n self.diesize = 6",
"def rollDices():\n for i in range(5):\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A Lea distribution representing an unordered set of N Msided dice. Combinations of dice which are the same apart from order are considered equal. The particular value used is chosen to be in order from smallest to largest. | def dice_unordered(n, m):
return Lea.fromValFreqs(*dice_set_freqs(n, m)) | [
"def rand_order_size():\n return poisson(2.0) + 1",
"def dgenerate(n):\n result = [i * .1 for i in range(n)]\n shuffle(result)\n return result",
"def random_derangement(n, ds):\n perm = list(range(n))\n mask = [False] * n\n\n i, u = n - 1, n - 1\n while u >= 1:\n if not mask[i]:\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract top and bottom features from a dataframe | def extract_top_bottom_features(matrix, n_up_features, n_dn_features):
N = matrix.shape[0]
up_features = list(range(0, n_up_features))
dn_features = list(range(N - n_dn_features, N))
all_features = up_features + dn_features
return matrix.ix[all_features, :].index | [
"def dfTopFeatures(features: List[str], headers: List[str], values: np.ndarray,\r\n subHeaders: List[str], targetType: str, nTop: int = 20) -> DataFrame:\r\n rawPairs = (seq(values)\r\n .map(lambda sq: list(zip(features, sq)))\r\n .map(lambda sq: sorted(sq, reverse=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Atualiza os dados de um aluno | def atualizar(self, **kwargs):
p_id_aluno = kwargs.get('id_aluno')
p_nome = kwargs.get('nome')
p_cpf = kwargs.get('cpf')
p_data_nasc = kwargs.get('data_nasc')
p_telefone = kwargs.get('telefone')
sql = f"""
UPDATE public.Alunos
SET ... | [
"def actualizaAlumno(self, alumno):",
"def _adicionar_aluno(self, dict_values):\n # inserir na base de dados Mongo, coluna \"Aluno\"\n self.database[\"Aluno\"].insert_one(dict_values)",
"def pruebasAlumno(self, alumno):",
"def data_cadastro(self, data_cadastro):\n self._data_cadastro = da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exclui um aluno a partir de seu ID | def excluir(self, id_aluno):
conn = None
deleted_rows = 0
try:
sql = f"""
DELETE FROM public.Alunos
WHERE id_aluno = '{id_aluno}';
"""
params = config(filename=".\database.ini") # local do arquivo datab... | [
"def excluir_questao():\n try:\n if current_user.is_administrator():\n cod_id = request.args.get('id')\n questao = Questao.query.filter_by(cod_questao = cod_id).one()\n db.session.delete(questao)\n db.session.commit()\n return listar_questoes()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pergunta ao usuário se quer incluir um aluno. Caso a resposta seja sim, executa o loop de inclusão | def listaVazia(self):
opcao_adicionar = input("A lista está vazia. Deseja incluir um novo aluno? 'S' ou 's' para incluir: ")
if opcao_adicionar.lower().startswith('s'):
self.loopIncluir() | [
"def inscreverAluno(self, aluno):\n if len(self.alunos) < self.vagas and aluno not in self.alunos:\n self.alunos.append(aluno)\n elif aluno in self.alunos:\n print(\"aluno {} já está inscrito na disciplina\".format(aluno.nome))\n else:\n print(\"Vagas esgotadas\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Busca alunos a partir de um nome. | def buscarAluno(self, nome_pesquisado):
conn = None
try:
params = config()
conn = psycopg2.connect(**params)
cur = conn.cursor()
cur.execute("SELECT id_aluno, nome_aluno, cpf_aluno, data_nasc_aluno, telefone_aluno FROM Alunos")
row = c... | [
"def __ui_search_persons_by_name(self):\n searched_name = input(\"Introduce the name: \").strip().lower()\n if searched_name == \"\":\n print(\"You cannot search persons by an empty name!\\n\")\n return\n\n searched_persons = self.__person_service.find_persons_by_name(sear... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check for more pages. The last item will be sliced off. | def _check_for_more_pages(self):
self._has_more = len(self._items) > self.per_page
self._items = self._items[0:self.per_page] | [
"def has_more_pages(self):\n return self._has_more",
"def has_small_last_page(self):\n return (self.count() % self.items_per_page) <= int(\n self.items_per_page / 3)",
"def HasMultiplePages(self):\r\n\r\n return True",
"def has_next(self):\n return self.page < self.p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if there are more items in the data source. | def has_more_pages(self):
return self._has_more | [
"def _check_for_more_pages(self):\n self._has_more = len(self._items) > self.per_page\n\n self._items = self._items[0:self.per_page]",
"def canFetchMore(self, QModelIndex):\n if QModelIndex.isValid():\n return\n self.next_row = self.cursor.fetchone()\n return self.nex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempt to connect to the Qlik Sense server specified in the arguments. | def connect():
# print ('Testing connection..')
get_qlik_sense.get_about() | [
"def do_connect( self, args = '' ):\n if not args or type( args ) not in types.StringTypes:\n self.masterURL = gConfigurationData.getMasterServer()\n if self.masterURL != \"unknown\" and self.masterURL:\n self._tryConnection()\n else:\n self._setStatus( False )\n else:\n spli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the Qlik Sense Engine information | def engine():
document.add_heading('Engine details', 1)
engine_metrics = ['customProperties','listenerPorts','autosaveInterval', 'tableFilesDirectory', 'genericUndoBufferMaxSize', 'documentTimeout','documentDirectory',
'allowDataLineage', 'qrsHttpNotificationPort', 'standardReload',
... | [
"def catalog():",
"def get_engines_details(self):\n if not \"engines\" in self.data:\n raise ValueError(\"This recipe doesn't have engines\")\n return self.data[\"engines\"]",
"def __updateEngines(self):\n currentEngine = self.engineComboBox.itemData(\n self.engineComb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the Qlik Sense Proxy information | def proxy():
document.add_heading('Proxy details', 1)
proxy_metrics = ['customProperties','listenPort','restListenPort', 'allowHttp','unencryptedListenPort','authenticationListenPort',
'kerberosAuthentication', 'unencryptedAuthenticationListenPort', 'keepAliveTimeoutSeconds', 'maxHeaderS... | [
"def _get_esxi_proxy_details():\n det = __proxy__[\"esxi.get_details\"]()\n host = det.get(\"host\")\n if det.get(\"vcenter\"):\n host = det[\"vcenter\"]\n esxi_hosts = None\n if det.get(\"esxi_host\"):\n esxi_hosts = [det[\"esxi_host\"]]\n return (\n host,\n det.get(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the Qlik Sense Virtual Proxy information | def vp():
section = document.add_section()
new_width, new_height = section.page_height, section.page_width
section.orientation = WD_ORIENT.LANDSCAPE
section.page_width = 10058400
section.page_height = 7772400
document.add_heading('Virtual Proxy details', 1)
virtualproxy_metrics= ['des... | [
"def proxy():\r\n document.add_heading('Proxy details', 1)\r\n proxy_metrics = ['customProperties','listenPort','restListenPort', 'allowHttp','unencryptedListenPort','authenticationListenPort',\r\n 'kerberosAuthentication', 'unencryptedAuthenticationListenPort', 'keepAliveTimeoutSeconds', ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the Qlik Sense Virtual Proxy Load Balancer information | def vplb():
section = document.add_section()
new_width, new_height = section.page_height, section.page_width
section.orientation = WD_ORIENT.LANDSCAPE
section.page_width = 7772400
section.page_height = 10058400
document.add_heading('Virtual Proxy Load Balancing details', 1)
virtualpro... | [
"def get_local_lbs(self):\r\n mask = ('mask[loadBalancerHardware[datacenter],ipAddress]')\r\n return self.account.getAdcLoadBalancers(mask=mask)",
"def get_load_balancers(pageToken=None):\n pass",
"def _transform_loadbalancer(loadbalancer, haproxy_base_dir):\n listeners = [_transform_listene... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the Qlik Sense Scheduler information | def scheduler():
document.add_heading('Scheduler details', 1)
scheduler_metrics = ['customProperties', 'schedulerServiceType', 'maxConcurrentEngines', 'engineTimeout', 'tags', 'hostname',
'logVerbosityAuditActivity','logVerbosityAuditSecurity','logVerbosityService','logVerbosityApplic... | [
"def _create_schedules(self):\n\n ''''''",
"def getIrriSchedule():",
"def get_sv_pri_snap_sched(self):\n\n out = self.filer.invoke(\n 'snapvault-primary-snapshot-schedule-list-info',\n 'volume-name', self.name)\n\n scheds = {}\n\n for schedxml in out.child_get('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the applications in the Qlik Sense Site | def apps():
section = document.add_section()
new_width, new_height = section.page_height, section.page_width
section.orientation = WD_ORIENT.LANDSCAPE
section.page_width = 10058400
section.page_height = 7772400
document.add_heading('Applications', level=1)
apps = get_qlik_sense.get_ap... | [
"def get_applications(site) -> list:\n collection = site.Collection\n result = []\n for i in range(collection.Count):\n prop = collection[i].Properties\n result.append(SiteApplication(\n prop[\"path\"].Value,\n prop[\"applicationPool\"].Value\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the data connections in the Qlik Sense Site | def data_connections():
section = document.add_section()
new_width, new_height = section.page_height, section.page_width
section.orientation = WD_ORIENT.LANDSCAPE
section.page_width = 10058400
section.page_height = 7772400
document.add_heading('Data connections', level=1)
connections ... | [
"def generate_connections(self):\n yield from self.dbs",
"def initConnections(self):\n raise NotImplementedError",
"def allSiteData():\n Session.connect()\n Session.start_transaction()\n resourceControlDB = ResourceControlDB()\n _SiteList = resourceControlDB.siteNames()\n siteData =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the user directories in the Qlik Sense Site | def user_directories():
section = document.add_section()
new_width, new_height = section.page_height, section.page_width
section.orientation = WD_ORIENT.LANDSCAPE
section.page_width = 10058400
section.page_height = 7772400
document.add_heading('User Directories', level=1)
userdirector... | [
"def build_user_paths():\n for path in USER_DIRLIST:\n if os.path.islink(path):\n pass # ok\n elif not os.path.isdir(path):\n os.makedirs(path)",
"def get_disassembler_user_directory(self):\n pass",
"def addusersitepackages(known_paths):\n # get the per user site... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the license rules in the Qlik Sense Site | def licenserules():
section = document.add_section()
new_width, new_height = section.page_height, section.page_width
section.orientation = WD_ORIENT.LANDSCAPE
section.page_width = 10058400
section.page_height = 7772400
document.add_heading('License Rules', level=1)
systemrules = get... | [
"def qs_license():\r\n paragraph = document.add_paragraph('')\r\n document.add_heading('License', level=1)\r\n lic_metric = ['lef', 'serial', 'name', 'organization', 'product', 'numberOfCores', 'isExpired', 'expiredReason', 'isBlacklisted', 'isInvalid']\r\n qs_lic = get_qlik_sense.get_license()\r\n n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the custom properties in the Qlik Sense Site | def custom_props():
section = document.add_section()
new_width, new_height = section.page_height, section.page_width
section.orientation = WD_ORIENT.LANDSCAPE
section.page_width = 7772400
section.page_height = 10058400
document.add_heading('Custom Properties', level=1)
custompropert... | [
"def add_custom_properties(product):\n \n # TODO: may override property of object\n if product['properties']:\n for p in product['properties']:\n product[p['name']] = p['value']\n \n return product",
"def _extract_properties_from_context(context: mlrun.MLClientCtx) -> Dict[str, An... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the license in the Qlik Sense Site | def qs_license():
paragraph = document.add_paragraph('')
document.add_heading('License', level=1)
lic_metric = ['lef', 'serial', 'name', 'organization', 'product', 'numberOfCores', 'isExpired', 'expiredReason', 'isBlacklisted', 'isInvalid']
qs_lic = get_qlik_sense.get_license()
num_of_metric = ... | [
"def custom_licenses(self):\n buf = (ctypes.c_char * self.MAX_BUF_SIZE)()\n result = self._dll.JLINK_EMU_GetLicenses(buf, self.MAX_BUF_SIZE)\n if result < 0:\n raise errors.JLinkException(result)\n return ctypes.string_at(buf).decode()",
"def _parse_license(self, doc):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the service cluster in the Qlik Sense Site | def qs_servicecluster():
paragraph = document.add_paragraph('')
document.add_heading('Service Cluster', level=1)
sc_metric = ['name', 'root folder', 'app folder', 'static content',
'32bit Connector', '64bit Connector', 'archived logs',
'database host', 'database port']... | [
"def cluster_by_partitioning(active_sites):\n # Fill in your code here!\n\n return []",
"def __getSiteCandidates( self, okReplicas ):\n\n lfnSEs = {}\n for lfn in okReplicas:\n replicas = okReplicas[ lfn ]\n siteSet = set()\n for seName in replicas:\n result = self.__getSitesForS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the node configuration in the Qlik Sense Site | def node_config():
paragraph = document.add_paragraph('')
document.add_heading('Server node details', 1)
node_metrics = ['host name','central','purpose', 'engine', 'proxy', 'printing', 'scheduler']
nodes = get_qlik_sense.get_nodeconfig()
num_of_nodes = len(nodes)
num_of_node_metrics = len(... | [
"def init_nodes(self):\n self.nodes = {}\n app.logger.warning(\"init LogViewer\")\n with open(\"./config\",\"r\") as f:\n self.nodes_addrs = json.loads(f.read().replace('\\n',''))\n for node in self.nodes_addrs:\n self.create_node(node)",
"def node_config(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the repository configuration in the Qlik Sense Site | def repository_config():
paragraph = document.add_paragraph('')
document.add_heading('Repository details', 1)
node_metrics = ['logVerbosityAuditActivity',
'logVerbosityAuditSecurity',
'logVerbosityService',
'logVerbosityApplication',
... | [
"def replace_vars(self):\n # DJANGO_REPOSITORY_URL in requirements-prod.txt\n f = '%s/requirements-prod.txt' % self.path\n for line in fileinput.input(f, inplace=1):\n print line.replace(\n '{{DJANGO_REPOSITORY_URL}}', \n self.django_repository_url)",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect and collate the Qlik Sense Printing Service information | def printing():
document.add_heading('Printing Service details', 1)
printing_metrics = ['customproperties',
'workingSetSizeHiPct',
'logVerbosityAuditActivity',
'logVerbosityService',
'hostname',
... | [
"def write_services_info():\r\n worksheet_title, coord = get_coordinate(\"SERVICE\")\r\n worksheet = ptu_workbook[worksheet_title]\r\n row_counter = 0\r\n for service in ptu_obj.services:\r\n # Writing service name and conditions\r\n cell = worksheet.cell(coord.row ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect the master Roles from Qlik Sense | def masterRoles():
document.add_heading('Node Roles', 1)
role= get_qlik_sense.masterRoles()
num_of_nodes = len(role)
table = document.add_table(rows=num_of_nodes+1, cols=2)
table.style = 'Grid Table 1 Light Accent 1'
row = table.rows[0]
row = table.rows[0]
row.cells[0].text = 'Ho... | [
"def _get_roles(self):\n return api.tuskar.OvercloudRole.list(self.request)",
"def roles():\n pass",
"def get_roles(role):",
"def get_roles(self) -> List[RoleObj]:\n ...",
"def test_list_cluster_role(self):\n pass",
"async def raList(self, ctx: Context):\n async with self.co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate randomly shuffled slides actions for each ROUNDLEN times SLIDE_SAMPLEN | def slides_foreachlen(direction, username):
slide_actions = []
for rlen in range(ROUNDLEN):
for idx_slide_sample in range(SLIDE_SAMPLEN):
startpos = random.randrange(ROUNDLEN)
slide_actions.append(
'%s_%s-%s-%s_%s' % (
username, direction, star... | [
"def slides(direction, username):\n slide_actions = []\n for _ in range(SAMPLEN):\n startpos = random.randrange(ROUNDLEN)\n endpos = random.randrange(ROUNDLEN)\n slide_actions.append(\n '%s_%s-[%s]-[%s]' % (username, direction, startpos, endpos))\n random.shuffle(slide_actio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate random startend slides actions times SAMPLEN | def slides(direction, username):
slide_actions = []
for _ in range(SAMPLEN):
startpos = random.randrange(ROUNDLEN)
endpos = random.randrange(ROUNDLEN)
slide_actions.append(
'%s_%s-[%s]-[%s]' % (username, direction, startpos, endpos))
random.shuffle(slide_actions)
retu... | [
"def _random_sequences(precursor, start= None, end=None):\n return 0",
"def slides_foreachlen(direction, username):\n slide_actions = []\n for rlen in range(ROUNDLEN):\n for idx_slide_sample in range(SLIDE_SAMPLEN):\n startpos = random.randrange(ROUNDLEN)\n slide_actions.appe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate randomly located clicks actions times SAMPLEN | def clicks(username):
click_actions = []
for pos in BUTTONS_DICT:
for _ in range(SAMPLEN):
click_actions.append(
'%s_%s-%s' % (username, 'click', pos))
random.shuffle(click_actions)
return click_actions | [
"def random_action(env, ob):\n return env.action_space.sample()",
"def get_random_action():\n # Define an array containing the available actions for the UAV\n # in the final work, takeoff and land must be added\n action_list = ['left', 'right', 'forward', 'backward', 'stop', 'descend']\n # Choose a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
randomly insert seq into lst with keeping original order of lst lst changed inplace | def random_insert_seq(lst, seq):
insert_locations = random.sample(range(len(lst) + len(seq)), len(seq))
inserts = dict(zip(insert_locations, seq))
iter_lst = iter(lst)
lst[:] = [
inserts[pos]
if pos in inserts else next(iter_lst)
for pos in range(len(lst) + len(seq))] | [
"def shuffle_with_seed(lst, seed=None):\n # Create our own Random object so we can mess with its state without\n # affecting global random state\n r = random.Random()\n r.seed(seed)\n # .shuffle shuffles in place, this is the best way to shuffle not in place\n shuffled = sorted(lst, key=lambda ite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the ground_truth_label_facet of this InitLabeler. Name of the answer field that contains correct labels of a document | def ground_truth_label_facet(self):
return self._ground_truth_label_facet | [
"def ground_truth_label_facet(self, ground_truth_label_facet):\n if ground_truth_label_facet is None:\n raise ValueError(\"Invalid value for `ground_truth_label_facet`, must not be `None`\")\n\n self._ground_truth_label_facet = ground_truth_label_facet",
"def predicted_label_facet(self):\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the ground_truth_label_facet of this InitLabeler. Name of the answer field that contains correct labels of a document | def ground_truth_label_facet(self, ground_truth_label_facet):
if ground_truth_label_facet is None:
raise ValueError("Invalid value for `ground_truth_label_facet`, must not be `None`")
self._ground_truth_label_facet = ground_truth_label_facet | [
"def ground_truth_label_facet(self):\n return self._ground_truth_label_facet",
"def predicted_label_facet(self, predicted_label_facet):\n if predicted_label_facet is None:\n raise ValueError(\"Invalid value for `predicted_label_facet`, must not be `None`\")\n\n self._predicted_labe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the predicted_label_facet of this InitLabeler. Name of the field that contains predicted labels given by this labeler | def predicted_label_facet(self):
return self._predicted_label_facet | [
"def predicted_label_facet(self, predicted_label_facet):\n if predicted_label_facet is None:\n raise ValueError(\"Invalid value for `predicted_label_facet`, must not be `None`\")\n\n self._predicted_label_facet = predicted_label_facet",
"def prediction_name(self) -> (str, None):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the predicted_label_facet of this InitLabeler. Name of the field that contains predicted labels given by this labeler | def predicted_label_facet(self, predicted_label_facet):
if predicted_label_facet is None:
raise ValueError("Invalid value for `predicted_label_facet`, must not be `None`")
self._predicted_label_facet = predicted_label_facet | [
"def predicted_label_facet(self):\n return self._predicted_label_facet",
"def set_pred_label(\n self, value: Union[np.ndarray, torch.Tensor, Sequence[Number], Number]\n ) -> 'ActionDataSample':\n label_data = getattr(self, '_pred_label', LabelData())\n label_data.item = format_label... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the source_dataset_id of this InitLabeler. ID of the training dataset provided when creating this labeler | def source_dataset_id(self):
return self._source_dataset_id | [
"def get_datasetID(self):\n\t\treturn self.prDoc['inputs']['data'][0]['datasetID']",
"def data_source_id(self):\n return self._data_source_id",
"def dataset_id(self) -> int:\n return self._dataset_id",
"def dataset_id(self) -> str:\n return pulumi.get(self, \"dataset_id\")",
"def source... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the source_dataset_id of this InitLabeler. ID of the training dataset provided when creating this labeler | def source_dataset_id(self, source_dataset_id):
if source_dataset_id is None:
raise ValueError("Invalid value for `source_dataset_id`, must not be `None`")
self._source_dataset_id = source_dataset_id | [
"def training_dataset_id(self, training_dataset_id):\n\n self._training_dataset_id = training_dataset_id",
"def set_data_source(self, source_id):\n self.data_source = source_id",
"def source_dataset_id(self):\n return self._source_dataset_id",
"def update_dataset_source(self, source=DATAS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get bs and stroke ids in these bs of this char | def get_char_bs_tag_and_stroke_ids_dict_list(root, ch):
if root is None or ch == "":
return []
char_bs_tag_stroke_ids_dict_list = []
# find bs and his stroke ids
for child in root:
tag = child.attrib['TAG'].strip()
if tag != ch:
continue
# frist level : 相 和... | [
"def strokes(self):\n\n # Expecting 8-byte chords (4 bytes of steno, 4 of timestamp.)\n assert self.data_length % 8 == 0\n # Steno should only be present on ACTION_READ packets\n assert self.packet_id == self.ID_READ\n\n strokes = []\n for stroke_data in grouper(8, self.dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the chain_independent of this Store. | def chain_independent(self, chain_independent):
if self.local_vars_configuration.client_side_validation and chain_independent is None: # noqa: E501
raise ValueError("Invalid value for `chain_independent`, must not be `None`") # noqa: E501
self._chain_independent = chain_independent | [
"def set_chain(self, chain):\n self.chain = list(chain)\n return self",
"def set_chain(self, val):\n self.__chain = val",
"def setChain(self, entry):\n self._chain = entry",
"def set_chain_id(self, chain_id):\n assert isinstance(chain_id, str)\n for atm in self.iter_a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the chainless_name of this Store. | def chainless_name(self, chainless_name):
if self.local_vars_configuration.client_side_validation and chainless_name is None: # noqa: E501
raise ValueError("Invalid value for `chainless_name`, must not be `None`") # noqa: E501
self._chainless_name = chainless_name | [
"def payee_name(self, payee_name):\n\n self._payee_name = payee_name",
"def bag_store_name(self, bag_store_name):\n self._bag_store_name = bag_store_name",
"def name_lt(self, name_lt):\n\n self._name_lt = name_lt",
"def chain_name(self) -> str:\n return pulumi.get(self, \"chain_nam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the store_url of this Store. | def store_url(self, store_url):
self._store_url = store_url | [
"def store_id(self, store_id):\n\n self._store_id = store_id",
"def store_id(self, store_id):\n self._store_id = store_id\n return self",
"def setSessionStore(self, store):\n pass",
"def store(self, store):\n\n self._store = store",
"def setURL(self, url):\n\t\tself.url = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the facebook_url of this Store. | def facebook_url(self, facebook_url):
self._facebook_url = facebook_url | [
"def facebook(self, facebook):\n\n self._facebook = facebook",
"def store_url(self, store_url):\n\n self._store_url = store_url",
"def set_callback_url(self, callback_url):\n self.callback_url = callback_url",
"def setURL(self, url):\n\t\tself.url = url",
"def set_album_url(self, album_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the post_code of this Store. | def post_code(self, post_code):
self._post_code = post_code | [
"def postcode(self, postcode):\n\n self._postcode = postcode",
"def zip_post_code(self, zip_post_code):\n\n self._zip_post_code = zip_post_code",
"def postal_code(self, postal_code):\n\n self._postal_code = postal_code",
"def postal_state_code(self, postal_state_code):\n\n self._po... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the municipality of this Store. | def municipality(self, municipality):
self._municipality = municipality | [
"def municipal_no(self, municipal_no):\n\n self._municipal_no = municipal_no",
"def municipal_name(self, municipal_name):\n\n self._municipal_name = municipal_name",
"def municipality(self, municipality):\n if municipality is None:\n raise ValueError(\"Invalid value for `municipa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the municipality_swedish of this Store. | def municipality_swedish(self, municipality_swedish):
self._municipality_swedish = municipality_swedish | [
"def municipality(self, municipality):\n\n self._municipality = municipality",
"def municipal_no(self, municipal_no):\n\n self._municipal_no = municipal_no",
"def municipal_name(self, municipal_name):\n\n self._municipal_name = municipal_name",
"def municipality_list(self, municipality_li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the district of this Store. | def district(self, district):
self._district = district | [
"def set_state_district(cfg, state_name, district_name, force_reset=False):\n cfg['state_name'] = state_name\n cfg['district_name'] = district_name\n\n if force_reset:\n states_district_info = force_reset_state_district_data(cfg)\n else:\n states_districts_info = pd.read_csv(cfg['states_di... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the shopping_center of this Store. | def shopping_center(self, shopping_center):
self._shopping_center = shopping_center | [
"def set_station_data_center(self, data_center):\n if data_center != self.station_data_center or not self.station_client:\n # Use the event client if they're the same, otherwise create a client\n if data_center == self.event_data_center and self.event_client:\n client = s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the phone_number_pricing of this Store. | def phone_number_pricing(self, phone_number_pricing):
self._phone_number_pricing = phone_number_pricing | [
"def service_phone_number_pricing(self, service_phone_number_pricing):\n\n self._service_phone_number_pricing = service_phone_number_pricing",
"def set_pricing(self, priceobj):\n\n self.pricing = priceobj",
"def phone(self, new_number):\n self._phone.number = new_number",
"def phone_numbe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the service_phone_number of this Store. | def service_phone_number(self, service_phone_number):
self._service_phone_number = service_phone_number | [
"def service_phone_number_info(self, service_phone_number_info):\n\n self._service_phone_number_info = service_phone_number_info",
"def phone_number(self, phone_number):\n \n self._phone_number = phone_number",
"def phone_number(self, phone_number):\n\n self._phone_number = phone_num... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the service_phone_number_info of this Store. | def service_phone_number_info(self, service_phone_number_info):
self._service_phone_number_info = service_phone_number_info | [
"def service_phone_number(self, service_phone_number):\n\n self._service_phone_number = service_phone_number",
"def service_phone_number_pricing(self, service_phone_number_pricing):\n\n self._service_phone_number_pricing = service_phone_number_pricing",
"def contact_phone(self, contact_phone):\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the service_phone_number_pricing of this Store. | def service_phone_number_pricing(self, service_phone_number_pricing):
self._service_phone_number_pricing = service_phone_number_pricing | [
"def phone_number_pricing(self, phone_number_pricing):\n\n self._phone_number_pricing = phone_number_pricing",
"def service_phone_number(self, service_phone_number):\n\n self._service_phone_number = service_phone_number",
"def service_phone_number_info(self, service_phone_number_info):\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the kruoka_url_slug of this Store. | def kruoka_url_slug(self, kruoka_url_slug):
self._kruoka_url_slug = kruoka_url_slug | [
"def set_slug(self, slug):\n if self.slug is None:\n self.slug = slug",
"def set_slug(self):\n if not self.slug:\n self.slug = slugify(self.name)[:50]",
"def slug(self, slug):\n\n self._slug = slug",
"def _set_slug(self):\n if self.slug == '':\n sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the prices_available of this Store. | def prices_available(self, prices_available):
self._prices_available = prices_available | [
"def price_sets(self, price_sets):\n\n self._price_sets = price_sets",
"def sales_prices(self, sales_prices):\n\n self._sales_prices = sales_prices",
"def __updatePrices(self):\n\t\t# compute market prices\n\t\tself.__getPrices()\n\t\t# update it\n\t\tself.__showMarketPrice()\n\t\tself.__showMaxMi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the business_unit_ids of this Store. | def business_unit_ids(self, business_unit_ids):
if self.local_vars_configuration.client_side_validation and business_unit_ids is None: # noqa: E501
raise ValueError("Invalid value for `business_unit_ids`, must not be `None`") # noqa: E501
self._business_unit_ids = business_unit_ids | [
"def business_unit(self, business_unit):\n\n self._business_unit = business_unit",
"def staff_ids(self, staff_ids):\n\n self._staff_ids = staff_ids",
"def orderbook_units(self, orderbook_units):\n\n self._orderbook_units = orderbook_units",
"def business_id(self, business_id):\n se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the branch_code of this Store. | def branch_code(self, branch_code):
if self.local_vars_configuration.client_side_validation and branch_code is None: # noqa: E501
raise ValueError("Invalid value for `branch_code`, must not be `None`") # noqa: E501
self._branch_code = branch_code | [
"def branch_code(self, branch_code):\n if branch_code is not None and len(branch_code) > 3:\n raise ValueError(\"Invalid value for `branch_code`, length must be less than or equal to `3`\") # noqa: E501\n if branch_code is not None and len(branch_code) < 3:\n raise ValueError(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the opening_hours of this Store. | def opening_hours(self, opening_hours):
if self.local_vars_configuration.client_side_validation and opening_hours is None: # noqa: E501
raise ValueError("Invalid value for `opening_hours`, must not be `None`") # noqa: E501
self._opening_hours = opening_hours | [
"def open_hours_detail(self, open_hours_detail):\n\n self._open_hours_detail = open_hours_detail",
"def active_hours(self, active_hours):\n\n self._active_hours = active_hours",
"def hours(self, new_hours):\n\n if (type(new_hours) != int and type(new_hours) != float) or new_hours < 0:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the shopkeeper of this Store. | def shopkeeper(self, shopkeeper):
self._shopkeeper = shopkeeper | [
"def setSessionStore(self, store):\n pass",
"def shop(self, shop):\n\n self._shop = shop",
"def _set_store(self, store):\n for method in list(self.methods.values()):\n method.__servicemethod__['store'] = store\n self._store = store",
"def store_id(self, store_id):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the delivery of this Store. | def delivery(self, delivery):
if self.local_vars_configuration.client_side_validation and delivery is None: # noqa: E501
raise ValueError("Invalid value for `delivery`, must not be `None`") # noqa: E501
self._delivery = delivery | [
"def delivery(self, value: dict):\n self._delivery = value\n # Ensure the correct key is updated and object is set as dirty\n flag_modified(self, '_delivery')",
"def delivery_discount(self, delivery_discount):\n\n self._delivery_discount = delivery_discount",
"def set_delivery(reques... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the service_ids of this Store. | def service_ids(self, service_ids):
self._service_ids = service_ids | [
"def service_ids(self, service_ids):\n if service_ids is None:\n raise ValueError(\"Invalid value for `service_ids`, must not be `None`\") # noqa: E501\n\n self._service_ids = service_ids",
"def services(self, services):\n\n self._services = services",
"def service_groups(self, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the sort of this Store. | def sort(self, sort):
self._sort = sort | [
"def sort_order(self, sort_order):\n self._sort_order = sort_order",
"def sort_order(self, sort_order):\n\n self._sort_order = sort_order",
"def sort_by(self, sort_by):\n self._sort_by = sort_by",
"def sort_order(self, sort_order: int):\n\n self._sort_order = sort_order",
"def so... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process an individual asset document. | def process_documents(session, endpoint, docs, id_map):
for doc in docs:
original_asset = doc['asset']
if original_asset['name'] == '' or original_asset['name'] is None:
LOG.warn('Skipping asset {} with empty name'.format(original_asset['id']))
asset = {}
asset.update(o... | [
"def process_document(self, doc):\n self.extract(doc)\n self.discover_people(doc)",
"def process(submitted_doc):\n\n submitted_data = submitted_doc.data\n url = submitted_data.get('originalUrl')\n if not url:\n raise ProcessingInputError('POST[\"data\"] does not have \"originalUrl\" ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open a file given an option value. | def open_from_opt(opt, mode='r'):
if opt is None or opt == '-':
return sys.stdout if 'w' in mode else sys.stdin
return open(opt, mode) | [
"def open_file(f):\n if sys.platform == \"win32\":\n os.startfile(f)\n else:\n opener = \"open\" if sys.platform == \"darwin\" else \"xdg-open\"\n subprocess.call([opener, f])",
"def open_file(path):\n if platform.system() == \"Windows\":\n os.startfile(path)\n elif platfor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compares two xml etrees | def xml_compare(x1, x2, excludes=[]):
if x1.tag != x2.tag:
return False
for name, value in x1.attrib.items():
if not name in excludes:
if x2.attrib.get(name) != value:
return False
for name in x2.attrib.keys():
if not name in excludes:
if name... | [
"def xml_documents_equal(first, second):\n parser = XMLParser(encoding=\"utf-8\", remove_blank_text=True)\n first_document = etree.fromstring(first, parser=parser)\n second_document = etree.fromstring(second, parser=parser)\n return xml_elements_equal(first_document, second_document)",
"def xml_compar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compare two text strings | def text_compare(t1, t2):
if not t1 and not t2:
return True
if t1 == '*' or t2 == '*':
return True
return (t1 or '').strip() == (t2 or '').strip() | [
"def _strings_are_equal(self, value1, value2):\n if value1.lower().strip().replace('_', ' ') == value2.lower().strip().replace('_', ' '):\n return 1\n return 0",
"def compare(text1, text2):\n diff = difflib.ndiff(text1.splitlines(True), text2.splitlines(True))\n return '\\n' + '\\n'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the index by searching in a rotated sorted array | def rotated_array_search(arr, number):
low = 0
high = len(arr) - 1
while low <= high:
mid = (low + high) // 2
if arr[mid] == number:
return mid
if arr[low] < arr[mid]:
if arr[low] <= number and number < arr[mid]:
high = mid - 1
else... | [
"def search_sorted_rotated(arr , value):\r\n low_index = 0\r\n high_index = len(arr)-1\r\n while low_index <= high_index:\r\n mid_index = low_index + (high_index - low_index)//2\r\n if arr[mid_index] == value:\r\n return mid_index\r\n elif arr[low_index] <= arr[mid_index]:\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
! Receives qdot vector and sents q vector obtained by integration. | def qdot_callback (qdot_data):
global q,qdot,eff,key,pub,qdotprev,qdotprevprev,qold,qdotpnone,qdotppnone,qmin,qmax
qdot = np.array([qdot_data.velocity]).transpose() # store received vector in global variable
eff = qdot_data.effort[0] # store new seq number
tosend = JointState() # joint state object to b... | [
"def using_quad():\n return scipy.integrate.quad(lambda x: x ** 2, -1, 2)",
"def quatdot(q_1,q_2):\n dot = np.zeros((1,4))\n dot = q_1[0,0]*q_2[0,0] + q_1[0,1]*q_2[0,1] + q_1[0,2]*q_2[0,2] + q_1[0,3]*q_2[0,3]\n return dot",
"def get_quad_strike_vector(q):\n P0, P1, P2, P3 = q\n p0 = Vector.fro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the cabling data of the given device, where the name of the device may be that of a detector, tracker or control, that was valid at the given timestamp. | def get_cabling_for_date(self, device, timestamp):
if self._detectors.__contains__(device):
_data = b64decode(self._server.getDetectorCablingForDate(device,
timestamp))
try:
# check for error or warning tag
parseString(_data, self._... | [
"def get_current_cabling(self, device):\n if self._detectors.__contains__(device):\n _data = b64decode(self._server.getCurrentDetectorCabling(device))\n try:\n # check for error or warning tag\n parseString(_data, self._status_handler)\n except S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the cabling data of the given device, where the name of the device may be that of a detector, tracker or control, that was valid for the given run number. | def get_cabling_for_run(self, device, run_number):
if self._detectors.__contains__(device):
_data = b64decode(self._server.getDetectorCablingForRun(device,
run_number))
try:
# check for error or warning tag
parseString(_data, self._... | [
"def get_current_cabling(self, device):\n if self._detectors.__contains__(device):\n _data = b64decode(self._server.getCurrentDetectorCabling(device))\n try:\n # check for error or warning tag\n parseString(_data, self._status_handler)\n except S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the cabling data of the given device, where the name of the device may be that of a detector, tracker or control. | def get_current_cabling(self, device):
if self._detectors.__contains__(device):
_data = b64decode(self._server.getCurrentDetectorCabling(device))
try:
# check for error or warning tag
parseString(_data, self._status_handler)
except SAXParseExce... | [
"def get_cabling_for_run(self, device, run_number):\n if self._detectors.__contains__(device):\n _data = b64decode(self._server.getDetectorCablingForRun(device,\n run_number))\n try:\n # check for error or warning tag\n parseString(_d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the cabling data for a detector for the given id. | def get_cabling_for_id(self, id_):
_data = b64decode(self._server.getDetectorCablingForId(id_))
try:
# check for error or warning tag
parseString(_data, self._status_handler)
except SAXParseException:
pass # no tag found so as expected could not parse data
... | [
"def get_detector(self, DetectorId: str) -> Dict:\n pass",
"def get_cabling_for_run(self, device, run_number):\n if self._detectors.__contains__(device):\n _data = b64decode(self._server.getDetectorCablingForRun(device,\n run_number))\n try:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a list of ids of the detector cabling data sets that were valid during the given time period. N.B. if the stop_time is None then only the ids that were valid at the start_time will be returned. | def get_ids(self, start_time, stop_time=None):
start_time = _get_string_from_date(start_time)
if stop_time == None:
stop_time = start_time
else:
stop_time = _get_string_from_date(stop_time)
xml = str(self._server.getCablingIds(start_time, stop_time))
parse... | [
"def _get_subset_timesteps_idxs(timesteps, subset_timesteps, strict_match=True):\n # Check timesteps format\n subset_timesteps = _check_timesteps(subset_timesteps)\n timesteps = _check_timesteps(timesteps)\n # Ensure same time precision for comparison\n subset_timesteps = subset_timesteps.astype(time... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parser for cabling data. | def _parse_cabling_xml(self, xml):
parseString(xml, self._cabling_handler)
return self._cabling_handler.get_data() | [
"def parsed_channel(cls, data):\n\n attributes = {}\n waveforms = {}\n for i in data.keys():\n if i == \"Enabled\":\n enabled = Waveform.from_waveform_dict(data[\"Enabled\"])\n elif type(data[i]) is dict and not i == \"Enabled\":\n waveforms[i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Embedding labels to onehot form. | def one_hot_embedding(labels, num_classes, device="cuda:0"):
y = torch.eye(num_classes).to(device)
return y[labels] | [
"def one_hot_embedding(labels, num_classes):\n y = torch.eye(num_classes) \n return y[labels]",
"def one_hot_embedding(labels, num_classes):\n y = torch.eye(num_classes) \n return y[labels]",
"def _one_hot_embeding(self, labels):\n\n y = torch.eye(self.num_classes) # [D, D]\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This script uses bioblend to import .ga workflow files into a running instance of Galaxy | def main():
parser = argparse.ArgumentParser()
parser.add_argument("-w", "--workflow_path", help='Path to workflow file')
parser.add_argument("-g", "--galaxy",
dest="galaxy_url",
help="Target Galaxy instance URL/IP address (required "
... | [
"def run_download_and_se_pe_illumina_covid_variation_workflow(accessions_file, nc_45512_2_fasta_file, api_key, galaxy_url, history_id, new_history_name, publish, monitor_invocation, workflow_id_override, quiet):\n if quiet:\n log.setLevel(logging.ERROR)\n gi = bioblend.galaxy.GalaxyInstance(galaxy_url,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get sid from body | def get_sid(self) -> Optional[str]:
# Extract "sid" from request body.
body = request.json or {}
return body.get("sid") | [
"def get_sid(self):\n resdat = self.req().read() #phew, that was easy :)\n print resdat\n resdat = self.parse_response(resdat)\n if (resdat[0][1][0] != \"c\"):\n return None\n sid = resdat[0][1][1]\n return sid",
"def sid(self):\n return self.data[''].si... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |