query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Checks if a substate has already been visited in a branch development. | def is_cycle(self, state, visited):
substate = (state.getPacmanPosition(),
state.getGhostPositions(),
state.getFood())
if substate in visited:
return True
else:
visited.append(substate)
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stateAlreadyVisited(kState):\n\n visited = False\n \n for st in visitedStates:\n #check if both states are same\n visited = areStatesSame(st,kState)\n if visited == True:\n return visited\n\n return visited",
"def has_branch(self, branch):\n if self.branch =... | [
"0.6242016",
"0.618626",
"0.6019165",
"0.5765065",
"0.5723522",
"0.5625592",
"0.5608321",
"0.5593507",
"0.55687916",
"0.5556473",
"0.5554559",
"0.5488278",
"0.5481852",
"0.54778093",
"0.5393281",
"0.5385669",
"0.5378496",
"0.53639996",
"0.53441024",
"0.53441024",
"0.53331286"... | 0.5851164 | 3 |
Given an agent game state, returns a numerical value that estimates this state. | def utility(self, state, player):
if state.isWin() or state.isLose():
return state.getScore()
# In case of cycle.
if player == PACMAN:
return INFINITY
else:
return -INFINITY | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value(self, state):\n epsilon = self.epsilon\n possible_actions = self.get_legal_actions(state)\n\n #If there are no legal actions, return 0.0\n if len(possible_actions) == 0:\n return 0.0\n\n optimal_action = possible_actions[\n np.argmax([self.get_... | [
"0.6993187",
"0.69219285",
"0.68711835",
"0.683842",
"0.6740356",
"0.67376345",
"0.66950214",
"0.6659275",
"0.66460663",
"0.6619388",
"0.66037446",
"0.6547869",
"0.6535572",
"0.6523137",
"0.65092814",
"0.6488072",
"0.6477427",
"0.64462644",
"0.64315224",
"0.64230734",
"0.6419... | 0.6282397 | 27 |
Returns the numerical value associated with the state chosen by the MAX player. | def max_player(self, state, player, visited, alpha, beta):
max_v = -INFINITY
successors = state.generatePacmanSuccessors()
for child, action in successors:
next_p = self.player(state, player)
next_v = self.deepcopy_list(visited)
value = self.minimax(child, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_value(gameState):\n if terminal_test(gameState): return -1",
"def get_value(self, state):\n possible_actions = self.get_legal_actions(state)\n\n # If there are no legal actions, return 0.0\n if len(possible_actions) == 0:\n return 0.0\n\n #\n # INSERT CODE... | [
"0.8016364",
"0.7548027",
"0.7299372",
"0.72961676",
"0.71845376",
"0.7098836",
"0.693209",
"0.68775475",
"0.68732864",
"0.686689",
"0.68150526",
"0.6761921",
"0.67598486",
"0.6704822",
"0.6696646",
"0.66552097",
"0.6610439",
"0.6610214",
"0.6607608",
"0.6571373",
"0.65530646... | 0.62729645 | 60 |
Returns the numerical value associated with the state chosen by the MIN player. | def min_player(self, state, player, visited, alpha, beta):
min_v = INFINITY
successors = state.generateGhostSuccessors(player)
for child, action in successors:
next_p = self.player(state, player)
next_v = self.deepcopy_list(visited)
value = self.minimax(chi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min_value(gameState):\n if terminal_test(gameState): return 1\n return min( max_value(gameState.forecast_move(move)) for move in gameState.get_legal_moves() )",
"def min_value(policy_lookup, state, player):\n\taction_values = list(get_policy_actions(policy_lookup, state, player).values())\n\tif action_... | [
"0.7333864",
"0.7274705",
"0.7139104",
"0.7098517",
"0.6812494",
"0.6727385",
"0.66132283",
"0.66132283",
"0.66051954",
"0.65055245",
"0.6499824",
"0.64857304",
"0.6454941",
"0.6418529",
"0.6408731",
"0.64086705",
"0.64027745",
"0.63933474",
"0.637627",
"0.6353276",
"0.633600... | 0.60446495 | 53 |
Return the flow rate from the stock of material. | def Q_stock(self):
return self._Q_stock | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flowrate(self):\n return {'lvad': self._q}",
"def flowrate(self):\n q = {'ao': self._qao, 'mv': self._qmv, 'per': self._qper}\n if self._lvad is not None:\n q['lvad'] = self._lvad.flowrate['lvad']\n return q",
"def flowrate(self):\n q = {'ao': self._qao, 'mv': ... | [
"0.6545745",
"0.64949226",
"0.64949226",
"0.6487419",
"0.64570606",
"0.633024",
"0.6179958",
"0.6134117",
"0.6123501",
"0.6103679",
"0.60823053",
"0.605197",
"0.60496455",
"0.60220456",
"0.60084975",
"0.5997531",
"0.5996971",
"0.5936919",
"0.59270066",
"0.5911436",
"0.5895289... | 0.0 | -1 |
Return the required concentration of material in the stock given a reactor's desired system flow rate, system concentration, and stock flow rate. | def C_stock(self):
return self._C_sys * (self._Q_sys / self._Q_stock).to(u.dimensionless) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def opt(self, demands: Demand) -> float:\n # Create the linear solver with the GLOP backend.\n solver = pywraplp.Solver('multicommodity_flow_lp',\n pywraplp.Solver.GLOP_LINEAR_PROGRAMMING)\n\n ## VARIABLES\n # Flow variables, the splitting ratios for each... | [
"0.5642803",
"0.5584936",
"0.5577683",
"0.5554234",
"0.553538",
"0.5489478",
"0.5411179",
"0.53657496",
"0.5364913",
"0.5331608",
"0.5305916",
"0.526134",
"0.52515954",
"0.52499425",
"0.51970553",
"0.51827013",
"0.5169865",
"0.5155381",
"0.51455855",
"0.51219964",
"0.5110487"... | 0.65557456 | 0 |
Return the mass of undiluted material required for the stock concentration. | def M_stock(self, V_stock):
return Stock.M_stock(self, V_stock, self.C_stock()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mass(self):\n\t\treturn self.volume*self.density",
"def getMass(self):\n return self.mass",
"def intEnergy_mass(self):\n return _cantera.reactor_intEnergy_mass(self.__reactor_id)",
"def get_mass(self):\n return self.m",
"def getMolecularMass(self):\n dataDict = self.__dict__\n # ... | [
"0.7769052",
"0.7232947",
"0.7190209",
"0.71602464",
"0.7018305",
"0.6999149",
"0.6975665",
"0.6975665",
"0.691813",
"0.6880519",
"0.6858123",
"0.681166",
"0.68089944",
"0.67415166",
"0.6694117",
"0.6598947",
"0.658228",
"0.6533314",
"0.65262026",
"0.6524805",
"0.65108377",
... | 0.0 | -1 |
Return the required flow rate from the stock of material given a reactor's desired system flow rate, system concentration, and stock concentration. | def Q_stock(self):
return self._Q_sys * (self._C_sys / self._C_stock).to(u.dimensionless) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __receiving_flow(self, w, rhoc, rhom, qmax, rho):\n if rho > rhoc:\n return float(w * (rho - rhom))\n else:\n return float(qmax)",
"def get_variable_OM_costs(fs, production_rate, resources, rates, prices={}):\n\n # check the units on production_rate\n if isinstance(p... | [
"0.5923482",
"0.5861297",
"0.5662263",
"0.5640015",
"0.5634874",
"0.55290496",
"0.5519321",
"0.5464206",
"0.5443838",
"0.5443838",
"0.54211026",
"0.5408113",
"0.54059756",
"0.5404543",
"0.5379538",
"0.53003806",
"0.52493703",
"0.5246347",
"0.5238954",
"0.52116865",
"0.5181678... | 0.54127717 | 11 |
Return the mass of undiluted material required for the stock concentration. | def M_stock(self, V_stock):
return Stock.M_stock(self, V_stock, self._C_stock) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mass(self):\n\t\treturn self.volume*self.density",
"def getMass(self):\n return self.mass",
"def intEnergy_mass(self):\n return _cantera.reactor_intEnergy_mass(self.__reactor_id)",
"def get_mass(self):\n return self.m",
"def getMolecularMass(self):\n dataDict = self.__dict__\n # ... | [
"0.7768431",
"0.7232738",
"0.7190354",
"0.7160507",
"0.70185375",
"0.69992936",
"0.6975595",
"0.6975595",
"0.6918905",
"0.6880725",
"0.68575174",
"0.68105495",
"0.68091553",
"0.6741758",
"0.6694819",
"0.65997994",
"0.65818685",
"0.6533253",
"0.6526898",
"0.65244454",
"0.65112... | 0.0 | -1 |
Gets the language from the plugin filename. | def get_language_from_file_name(filename: str) -> str:
return Path(filename).resolve().with_suffix("").name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_language(fn):\n # FIXME - this expects the fn to be '.../XX/LC_MESSAGES/messages.po'\n return fn.split(os.sep)[-3]",
"def get_lang(self):\n\n path = self.get_lang_path()\n for language in self.languages:\n if language in path:\n return language",
"def get_l... | [
"0.7754916",
"0.716426",
"0.6845256",
"0.6770846",
"0.67384243",
"0.6711115",
"0.6705009",
"0.66996783",
"0.6607404",
"0.65987134",
"0.65885794",
"0.65514463",
"0.6547181",
"0.6505041",
"0.6468041",
"0.6454221",
"0.64363754",
"0.6395054",
"0.63568366",
"0.63273275",
"0.632306... | 0.7564138 | 1 |
States whether licence headers can be added. | def can_add_licence_headers(self) -> bool:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isLicensed(self):\r\n return True",
"def isLicensed(self):\r\n return True",
"def isLicensed(self):\r\n return True",
"def isLicensed(self):\r\n return True",
"def isLicensed(self):\r\n return True",
"def isLicensed(self):\r\n return True",
"def isLicensed(... | [
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6126938",
"0.6069631",
"0.6069631",
"0.6069631",
"0.6069631",
"0.6069631",
"0.6069631",
"... | 0.87154984 | 0 |
States whether the SPDX documents should be included in the package. | def should_include_spdx_in_package(self) -> bool:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isLicensed(self):\n return True",
"def isLicensed(self):\n return True",
"def isLicensed(self):\n return True",
"def isLicensed(self):\n return True",
"def isLicensed(self):\n return True",
"def isLicensed(self):\n return True",
"def isLicensed(self):\n ... | [
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"0.6486629",
"... | 0.63902473 | 46 |
Extract a list of values by concatenating text in subelements of all matching elements, unless there is only one element returned; in that case use that element's children. Sometimes each item in a list will be tagged with schema fields, but sometimes only the container will be, in which case, we want it's child elemen... | def extract_list(self, property, data):
values = self.get_property(property, data)
if len(values) == 1:
return [ self.concat_text(child) for child in values[0].getchildren() ]
else:
return [ self.concat_text(val) for val in values ] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_text(parent, tag, plural = False):\n text = None\n for item in parent.findall(tag):\n t = item.text\n if not text:\n if plural:\n text = [t]\n else:\n text = t\n elif isinstance(text, list):\n text.append(t)\n ... | [
"0.6273863",
"0.62471145",
"0.61149466",
"0.5640055",
"0.55085135",
"0.5455701",
"0.5401418",
"0.537015",
"0.5343929",
"0.52796423",
"0.52705777",
"0.52628595",
"0.52620727",
"0.5243459",
"0.51969194",
"0.51589835",
"0.515349",
"0.51468027",
"0.51317555",
"0.51254296",
"0.510... | 0.6517781 | 0 |
Concatenate text from all children, stripping extra whitespace. | def concat_text(self, elem):
s = u" ".join([ frag.strip() for frag in elem.itertext() if re.search("\S", frag) ])
return re.sub(" (\W )", "\\1", s) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allText(node):\n return \"\".join(allTextGenerator(node))",
"def _text_of(self, elem):\n if isinstance(elem, Tag):\n text = [ ]\n for sub_elem in elem:\n text.append(self._text_of(sub_elem))\n\n return \" \".join(text)\n else:\n retu... | [
"0.66178346",
"0.6367323",
"0.635393",
"0.6313497",
"0.6308935",
"0.6219595",
"0.6135117",
"0.6108854",
"0.6083563",
"0.60474586",
"0.60206246",
"0.6020191",
"0.59689933",
"0.59253573",
"0.591877",
"0.5883913",
"0.5880653",
"0.5873393",
"0.58330333",
"0.58095056",
"0.5795601"... | 0.69048434 | 0 |
From the input X, calculate the activations at the hidden layer and the output layer. | def feed_forward(self, X):
Z = self._activation(dot(c_[X, ones((X.shape[0], 1))], self.W_hidden))
return self._activation(dot(c_[Z, ones((X.shape[0], 1))], self.W_output)), Z | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, X):\n X = np.asarray(X)\n \n if (len(X.shape) == 1):\n X = np.reshape(X, (1, len(X)))\n \n if (self.inputBias == True):\n # add a bias unit to each row\n rows = []\n \n for i in range(0, X.shape[0]):\n ... | [
"0.73137915",
"0.7189904",
"0.7136144",
"0.7106957",
"0.70927054",
"0.7056907",
"0.70448816",
"0.6982528",
"0.6966721",
"0.69446534",
"0.69283813",
"0.68609005",
"0.68587756",
"0.6783559",
"0.67334926",
"0.6703211",
"0.666927",
"0.666927",
"0.6664914",
"0.66404325",
"0.664029... | 0.68053234 | 13 |
Backpropagate the errors and update the weights. | def back_propagate(self, inputs, hidden, output, errors):
d_output = self._da(output) * errors
d_hidden = self._da(hidden) * dot(d_output, self.W_output[:-1].T)
n_samples = inputs.shape[0]
bias = ones((n_samples, 1))
# Update momentum and weights
self.V_output = self.out... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_weights(self):\n\n self.weights -= self.loss_grads\n self.loss_grads = np.zeros(self.weights.shape)",
"def update_weights(self):\n\t\tpass",
"def update_weights(self):\n self._weights = self._weights + self.update_weights_value",
"def update_weights(self):\n self._weigh... | [
"0.73473144",
"0.7206131",
"0.6706899",
"0.6673246",
"0.6593266",
"0.6541832",
"0.65311146",
"0.65311146",
"0.6491329",
"0.647321",
"0.6379258",
"0.62920314",
"0.6289422",
"0.62617856",
"0.62614566",
"0.6245207",
"0.6242581",
"0.6238977",
"0.62146944",
"0.6194389",
"0.618977"... | 0.6650728 | 4 |
Interpret C{relpath} relative to the last included config file (or the current working directory if no config file is being processed) and return the full path. Additionally, paths like ~/foo where the current user's home directory is substituted for the ~ are supported. | def _absPath(self, relpath):
# Pass through URIs and absolute paths.
if self.isUrl(relpath) or relpath[0] == '/':
return relpath
# This won't deal with ~user/ syntax, but it's much less
# common anyway.
if relpath.startswith('~/') and 'HOME' in os.environ:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_repo_relpath(self):\n from os import path\n repodir = \"~/codes/ci/tests\"\n relpath = \"../pyci/config.py\"\n result = path.expanduser(\"~/codes/ci/pyci/config.py\")\n self.assertEqual(result, get_repo_relpath(repodir, relpath))",
"def _ensure_path_absolute(maybe_relp... | [
"0.6920829",
"0.67630833",
"0.6725792",
"0.67080855",
"0.6699892",
"0.66549546",
"0.6641804",
"0.65129095",
"0.6512263",
"0.64710873",
"0.6431524",
"0.64170545",
"0.64096814",
"0.63788944",
"0.63601804",
"0.63560045",
"0.63347214",
"0.6328272",
"0.6321612",
"0.628525",
"0.628... | 0.7505428 | 0 |
Regex/function matches nonempty text (string). | def test_valid_text_str(self):
f = lws.valid_text
assert f('string', r'[a-z]*') is True
assert f('string', r'string') is True
assert f('string', r'[0-9]*') is False
assert f('', r'.*') is False
assert f('abcde', lambda x: 'e' in x) is True
assert f('abcde', lambda... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_empty_string_is_also_a_match(self):\n pattern = \"\"\n s = \"abcdef\"\n self.assertEqual(__, re.search(pattern, s).group())",
"def test_empty_string_is_also_a_match(self):\n empty_string = \"\"\n s = \"abcdef\"\n self.assertEqual(__, re.match(empty_string, s).gr... | [
"0.71870106",
"0.71468127",
"0.6825596",
"0.6734984",
"0.67312646",
"0.6438654",
"0.63549334",
"0.6322763",
"0.632127",
"0.6242362",
"0.61733043",
"0.6131614",
"0.6126538",
"0.6123965",
"0.61204576",
"0.5997847",
"0.59732664",
"0.59632313",
"0.59355",
"0.59338725",
"0.5914373... | 0.5398441 | 62 |
Valid key is a string that matches the regex. | def test_valid_key(self):
f = lws.valid_data_key
assert f('string', int, r'string') is False
assert f('string', str, r'test') is False
assert f(123, int, '123') is False
assert f(123.00, float, '123') is False
assert f('123', str, r'[0-9]*') is True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_valid(key):\n return key[0:2] == \"MR\" and key[2:].isdigit() and len(key) in [9, 10]",
"def isValidKey(key):\n return True",
"def test_generate_key(self): \n k = Key().generate()\n self.assertRegex(k, \"[a-zA-Z0-9+\\/]+={0,2}\")",
"def is_key_valid(self,key):\n if n... | [
"0.74445486",
"0.7298128",
"0.68690723",
"0.6826933",
"0.6772416",
"0.6770362",
"0.67521554",
"0.6721232",
"0.66679317",
"0.6645989",
"0.6641343",
"0.66336364",
"0.6618555",
"0.66130024",
"0.6539414",
"0.6484469",
"0.6474315",
"0.63922536",
"0.63814443",
"0.63745844",
"0.6374... | 0.6798626 | 4 |
Test if account creation with empty string for parameter fails as expected. | def test_account_creation_empty(flask_server):
import requests
datas = (
{'name': '', 'password': 'bar', 'code': '123'},
{'name': 'foo', 'password': '', 'code': '123'},
{'name': 'foo', 'password': 'bar', 'code': ''},
)
for data in datas:
req = requests.post('{}/account/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_user_invalid_username(self):\r\n print(\"Create user invalid username (already taken)\")\r\n u_id = 3\r\n username = \"100\"\r\n password = \"test9999\"\r\n u_type = 1\r\n\r\n prev_noUsers = len(User.query.all())\r\n self.assertEqual(self.system.crea... | [
"0.6957949",
"0.68849814",
"0.6766087",
"0.6673291",
"0.6599482",
"0.65720046",
"0.6557529",
"0.6546525",
"0.65454924",
"0.6534993",
"0.6519123",
"0.6513456",
"0.6503913",
"0.6501081",
"0.6480589",
"0.64775",
"0.6455434",
"0.6444594",
"0.6428433",
"0.6425856",
"0.6425776",
... | 0.69134486 | 1 |
Test if account modification with wrong superuser pw fails as expected. | def test_account_modification_superuser_wrong_pw(flask_server, create_account):
import requests
config = flask_server
data = {
'superuserpassword': '123',
'name': create_account['name'],
'new_name': 'foo2',
'new_password': 'bar2',
'new_code': '456',
}
req = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_replacePasswordWrong(self):\n self.realm._txCryptContext, perform = getTestContext()\n account = self.realm.addAccount(\n self.localpart, self.domain, self.password)\n d = account.replacePassword(u'blahblah', u'blah')\n perform()\n perform()\n self.fail... | [
"0.71980155",
"0.70657223",
"0.69420695",
"0.681869",
"0.67412823",
"0.6737752",
"0.6715256",
"0.66572005",
"0.6578799",
"0.65284264",
"0.647053",
"0.64520705",
"0.6444444",
"0.6427927",
"0.6402236",
"0.63994974",
"0.63713825",
"0.6368577",
"0.6328388",
"0.63178885",
"0.63131... | 0.78668606 | 0 |
Test if account view with wrong pw fails as expected. | def test_account_view_wrong_pw(flask_server, create_account):
import requests
data = create_account
data['password'] += '123'
req = requests.post('{}/account/view'.format(API_URL), data=data)
assert req.content == b'Wrong password'
assert req.status_code == 400 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_invalid_password(self):\n pass",
"def test_invalid_password(self):\n self.signup('Bo', 'Theo', 'Bo_theo5@example.com', 'Bo1995', 'Bo1995')\n rv = self.login('Bo_theo5@example.com', 'Bo1905')\n self.assertIn(b'Invalid password! Please try again', rv.data)",
"def test_bad_pas... | [
"0.7014653",
"0.6694399",
"0.66710836",
"0.6594336",
"0.6481692",
"0.64417285",
"0.63635635",
"0.6333669",
"0.62967485",
"0.62738353",
"0.6249868",
"0.62362957",
"0.6229103",
"0.6215371",
"0.62137276",
"0.6183013",
"0.6169891",
"0.61672413",
"0.6150554",
"0.61269516",
"0.6121... | 0.7123576 | 0 |
End time of audio that can be returned from this accessor. Return value is in seconds. | def end_time(self):
return RPR.GetAudioAccessorEndTime(self.id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def duration(self):\r\n return (self.end_time or time.time()) - self.start_time",
"def end_abs(self):\n if self.end == float('inf'):\n return self.track.duration\n else:\n return self.end",
"def end_time(self):\n return from_ts(self.end_time_ms)",
"def end_time(s... | [
"0.7681271",
"0.763079",
"0.759133",
"0.7577253",
"0.757333",
"0.75021076",
"0.7465625",
"0.74528515",
"0.7438744",
"0.743213",
"0.74169916",
"0.74169916",
"0.74169916",
"0.74169916",
"0.74169916",
"0.74169916",
"0.73767245",
"0.73540586",
"0.7351222",
"0.7279076",
"0.7252126... | 0.86164665 | 0 |
Whether underlying state has changed. | def has_state_changed(self):
return bool(RPR.AudioAccessorValidateState(self.id)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_changed(self):\n return bool(self.changed_data)",
"def has_changed(self):\n return self.get_old_value() != self.get_current_value()",
"def has_state_changed(self) -> bool:\r\n ...",
"def changed(self) -> bool:\n return self._changed",
"def has_been_changed(self):\n ... | [
"0.848632",
"0.8434987",
"0.83928776",
"0.83255196",
"0.825811",
"0.81393313",
"0.80782294",
"0.80782294",
"0.80360293",
"0.8028253",
"0.7956109",
"0.7744479",
"0.7661217",
"0.76159716",
"0.74815",
"0.74815",
"0.74815",
"0.73818296",
"0.73151785",
"0.730645",
"0.72741395",
... | 0.77362454 | 12 |
Start time of audio that can be returned from this accessor. Return value is in seconds. | def start_time(self):
return RPR.GetAudioAccessorStartTime(self.id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_time(self) -> float:\n return self._start_time",
"def start_time(self) -> float:\n return float(self.get_from_redis(\"start_time\"))",
"def startTime(self) -> float:\n try: return self.times[0]\n except IndexError: return 0.0",
"def start_time(self):\n return self... | [
"0.76508814",
"0.7642453",
"0.7462602",
"0.731443",
"0.72887915",
"0.72281724",
"0.7181859",
"0.7179158",
"0.7158398",
"0.7158398",
"0.7158398",
"0.7158398",
"0.7158398",
"0.7158398",
"0.7158398",
"0.7158398",
"0.7146073",
"0.71175563",
"0.7111585",
"0.7090733",
"0.7074571",
... | 0.84035933 | 0 |
Shell escape the given string Implementation borrowed from nowdeprecated commands.mkarg() in the stdlib | def escape(x):
if '\'' not in x:
return '\'' + x + '\''
s = '"'
for c in x:
if c in '\\$"`':
s = s + '\\'
s = s + c
s = s + '"'
return s | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _escapeArg(arg):\n #XXX There is a *lot* more that we should escape here.\n return arg.replace('\"', r'\\\"')",
"def shellquote(arg):\n if re.match('^[-_.:/=a-zA-Z0-9]*$', arg):\n return arg\n else:\n return \"'%s'\" % arg.replace(\"'\", r\"'\\''\")",
"def EncodePOSIXShellArgument... | [
"0.74553555",
"0.73201764",
"0.6991493",
"0.6954239",
"0.6900728",
"0.68758225",
"0.68636274",
"0.6813894",
"0.6812185",
"0.6752599",
"0.6742212",
"0.6722397",
"0.6641635",
"0.6609566",
"0.66063076",
"0.65629905",
"0.655883",
"0.65519536",
"0.65472156",
"0.6472492",
"0.640144... | 0.575265 | 50 |
Sets the name of this Order. | def name(self, name):
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, name):\n self._name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n ... | [
"0.82648826",
"0.8240307",
"0.8240307",
"0.8240307",
"0.8240307",
"0.8240307",
"0.8205807",
"0.81975687",
"0.81878763",
"0.8156773",
"0.8156773",
"0.8135476",
"0.8105759",
"0.8058243",
"0.8058243",
"0.8055882",
"0.8055882",
"0.80465496",
"0.7987892",
"0.7977889",
"0.7962881",... | 0.0 | -1 |
Sets the ride of this Order. | def ride(self, ride):
self._ride = ride | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ride(self):\n print(\"Riding\")\n self.miles += 10\n return self",
"def setOrdinate(self, ordinate):\n if abs(self.angle) == math.pi / 2:\n raise ValueError(\"Impossible to set an ordinate because the line is parallel to the y axis. \")\n self.point.y += ordinate... | [
"0.621602",
"0.58814394",
"0.58329767",
"0.54311824",
"0.5386418",
"0.5379777",
"0.5371981",
"0.5350862",
"0.53216684",
"0.5311554",
"0.52330667",
"0.5163513",
"0.5144215",
"0.5130599",
"0.5087394",
"0.50845456",
"0.50696373",
"0.50696373",
"0.5065141",
"0.5061489",
"0.502307... | 0.83167446 | 0 |
Sets the demand2 of this Order. | def demand2(self, demand2):
self._demand2 = demand2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def demand(self, demand):\n\n self._demand = demand",
"def street_2(self, street_2):\n\n self._street_2 = street_2",
"def address_2(self, address_2):\n\n self._address_2 = address_2",
"def address2(self, address2):\n\n self._address2 = address2",
"def street_line_2(self, street_... | [
"0.64149886",
"0.633905",
"0.6269987",
"0.6135948",
"0.6017517",
"0.59513915",
"0.59513915",
"0.59513915",
"0.59415203",
"0.58601356",
"0.56750596",
"0.56512445",
"0.5647104",
"0.5621098",
"0.5570401",
"0.553985",
"0.54653645",
"0.53647447",
"0.53596485",
"0.5350659",
"0.5307... | 0.9112267 | 0 |
Sets the date_windows of this Order. | def date_windows(self, date_windows):
self._date_windows = date_windows | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_windows(self, time_windows):\n\n self._time_windows = time_windows",
"def windows(self, windows):\n\n self._windows = windows",
"def dates(self, dates):\n\n self._dates = dates",
"def set_course_start_end_dates(cls, start_date, end_date, env, course):\n courses.Course.set... | [
"0.65749073",
"0.6123321",
"0.5608745",
"0.5477951",
"0.5445921",
"0.5219535",
"0.5219535",
"0.5163603",
"0.5047111",
"0.4946459",
"0.4855974",
"0.48484346",
"0.48043135",
"0.4768365",
"0.4762878",
"0.4732343",
"0.47220406",
"0.4714741",
"0.46595985",
"0.46559376",
"0.4655937... | 0.85224766 | 0 |
Sets the allowed_vehicles of this Order. | def allowed_vehicles(self, allowed_vehicles):
self._allowed_vehicles = allowed_vehicles | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disallowed_vehicles(self, disallowed_vehicles):\n\n self._disallowed_vehicles = disallowed_vehicles",
"def disallowed_vehicles(self, disallowed_vehicles):\n\n self._disallowed_vehicles = disallowed_vehicles",
"def vehicle(self, vehicle: Vehicle) -> None:\n self.controlled_vehicles = [v... | [
"0.8050837",
"0.8050837",
"0.64763683",
"0.54872227",
"0.5441688",
"0.5398962",
"0.5387786",
"0.5378929",
"0.5378929",
"0.525168",
"0.51113904",
"0.5094039",
"0.5083932",
"0.5041607",
"0.49824876",
"0.4955959",
"0.49170044",
"0.48962492",
"0.48825344",
"0.47503355",
"0.472858... | 0.8951996 | 1 |
Sets the disallowed_vehicles of this Order. | def disallowed_vehicles(self, disallowed_vehicles):
self._disallowed_vehicles = disallowed_vehicles | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_vehicles(self, allowed_vehicles):\n\n self._allowed_vehicles = allowed_vehicles",
"def allowed_vehicles(self, allowed_vehicles):\n\n self._allowed_vehicles = allowed_vehicles",
"def vehicle(self, vehicle: Vehicle) -> None:\n self.controlled_vehicles = [vehicle]",
"def restric... | [
"0.83724105",
"0.83724105",
"0.62155324",
"0.53236806",
"0.5173283",
"0.5169744",
"0.5105587",
"0.5005991",
"0.49751323",
"0.4907587",
"0.4907587",
"0.48994005",
"0.4859041",
"0.48465118",
"0.47969198",
"0.47922418",
"0.47922418",
"0.4792057",
"0.47875392",
"0.47723186",
"0.4... | 0.8894529 | 1 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, Order):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Get configuration for training by name. | def get_config_by_name(name):
attrs = get_config_attributes(name)
if attrs['online']:
config = CONFIGS[name]()
else:
config = CONFIGS[name]
# setting the Tune Run name attribute
config['_call']['name'] = name
return config | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_config(self, name):\n return self.configs[name][0]",
"def get_config(name: str):\n conf_file = Path(__file__).parent.joinpath(\"configs\").joinpath(name)\n return console.read_config(conf_file)",
"def __getitem__(self, name : str) -> Any:\n return self._client.get_config()[name]",
... | [
"0.7452226",
"0.67589253",
"0.6409758",
"0.6397484",
"0.6343872",
"0.62930256",
"0.6284134",
"0.6260815",
"0.6254454",
"0.6204225",
"0.6203628",
"0.6186255",
"0.61788213",
"0.6140215",
"0.61020285",
"0.6018425",
"0.60173905",
"0.59994936",
"0.59492266",
"0.59285957",
"0.59098... | 0.7599749 | 0 |
Get config for agent models (pretrained/from scratch/from scratch stable baselines. | def get_agent_config(agent_id, which, obs_space, act_space, config):
agent_config_pretrained = (POLICIES[config['_trainer']], obs_space, act_space, {
'model': {
"custom_model": "GymCompetePretrainedModel",
"custom_model_config": {
"agent_id": agent_id - 1,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_model_config(self, model_num=0):\n return [], resources.get_file(\n \"config/tests/methods/unsupervised/train_test.gin\")",
"def get_model_config(model_name, args):\n if model_name == 'Tacotron2':\n model_config = dict(\n # optimization\n mask_padding=args.mask_p... | [
"0.64450806",
"0.6322704",
"0.6154922",
"0.61464125",
"0.6087813",
"0.601911",
"0.5965947",
"0.59622693",
"0.59563386",
"0.59386015",
"0.5863932",
"0.5768834",
"0.5746014",
"0.57258797",
"0.5722078",
"0.5635623",
"0.56311667",
"0.55874664",
"0.55678475",
"0.55404234",
"0.5530... | 0.73628634 | 0 |
Returns the color for this record. | def get_color(self, record):
if record.level >= logbook.ERROR:
return 'red'
elif record.level >= logbook.NOTICE:
return 'yellow'
elif record.level >= logbook.INFO:
return 'green'
elif record.level >= logbook.DEBUG:
return 'darkblue'
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_color(self):\n\n return self.color",
"def color(self):\n return self['color']",
"def get_color(self):\n return self.color",
"def get_color(self):\n return self._color",
"def get_color(self):\n return self._color",
"def get_color(self):\r\n return self._co... | [
"0.8570491",
"0.8560105",
"0.8553639",
"0.8508012",
"0.8508012",
"0.8468174",
"0.8463534",
"0.8455492",
"0.8443696",
"0.84204817",
"0.8394403",
"0.8381473",
"0.8381473",
"0.8381473",
"0.8341364",
"0.8341364",
"0.83403397",
"0.82998437",
"0.82034767",
"0.8193535",
"0.816576",
... | 0.7692276 | 36 |
Return list v of length bound such that v[n] is 0 if n is multiplicative even, and v[n] is 1 if n is multiplicatively odd. Also v[0] is None. This goes up to bound=`10^7` in about 30 seconds. | def mult_parities_python(bound, verbose=False):
v = [None] * bound
v[0] = None
v[1] = int(0)
P = [int(p) for p in prime_range(bound)]
for p in P:
v[p] = int(1)
last = P
last_parity = int(1)
loops = floor(log(bound, 2)) + 1
bound = int(bound)
for k in range(loops):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solution(num):\n \n res = [0] * (num + 1)\n for i in range(1,len(res)):\n res[i] = res[i>>1] + (i%2)\n \n return res",
"def primi(n):\n numVec = []\n for x in range(n-1):\n numVec.append(x+2)\n for num in numVec[:(n//2-1)]:\n if numVec[num-2] != 0:\n numVec[slice(2... | [
"0.6229817",
"0.60646546",
"0.5947819",
"0.5879538",
"0.5867471",
"0.58053505",
"0.57916903",
"0.5783961",
"0.57752395",
"0.5758268",
"0.5693424",
"0.5677511",
"0.564173",
"0.56410253",
"0.56161827",
"0.56001776",
"0.5591532",
"0.5588608",
"0.55883527",
"0.55845463",
"0.55815... | 0.6686395 | 0 |
Distance to the decision boundary of a logistic regression classifier. By default the distance is w.r.t. L1 norm. This means that the denominator has to be in terms of the Holder dual norm (`q_norm`), so Linf. I know, this interface is horrible. | def heuristic_fn(x, clf, manifest_set, epsilon, q_norm=np.inf):
# Debug.
counter = Counter.get_default()
count = counter.count()
if count % DEBUG_FREQ == 0:
logger.debug(">> (heuristic_fn start) Node counter is: {}.".format(count))
score = clf.decision_functio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance(cls, q0, q1):\n q = Quaternion.log_map(q0, q1)\n return q.norm",
"def estimated_distance(self, log=False):\n\t\t\n\t\tx0 = GRAVITY - self.thrust*.95 / (self.total_mass - self.fuel_consumption * 0.0)\n\t\tx1 = GRAVITY - self.thrust*.95 / (self.total_mass - self.fuel_consumption * 1.0)\n... | [
"0.6301092",
"0.6209596",
"0.5950848",
"0.57876134",
"0.5777478",
"0.57513964",
"0.5739145",
"0.573442",
"0.57284826",
"0.5667302",
"0.56659484",
"0.56534505",
"0.56495434",
"0.5649369",
"0.56389743",
"0.56198674",
"0.56081104",
"0.56050664",
"0.56025594",
"0.5596793",
"0.558... | 0.0 | -1 |
Get the match start tick from the _matchstart.csv | def _get_match_start_tick(file):
with file.open("r") as fh:
lines = fh.read().splitlines()
return int(lines[1]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_track_start(line):\n\n assert line is not None\n # each index line for title should begin with this ' INDEX 0'\n assert line[:11] == ' INDEX 0'\n # there could higher-numbered indexes but I haven't seen any in QUE files\n assert line[11] == '0' or line[11] == '1'\n # were not intere... | [
"0.56773263",
"0.55945176",
"0.5584506",
"0.5569953",
"0.5547617",
"0.5545415",
"0.5502045",
"0.54885906",
"0.54600555",
"0.54543483",
"0.5385271",
"0.53356755",
"0.5307885",
"0.5253845",
"0.52449626",
"0.5238114",
"0.52334565",
"0.52215487",
"0.5204952",
"0.51517326",
"0.513... | 0.7633372 | 0 |
The name of the Resource Group where the Log Analytics Cluster should exist. Changing this forces a new Log Analytics Cluster to be created. | def resource_group_name(self) -> pulumi.Input[str]:
return pulumi.get(self, "resource_group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")",
"def log_group_name(self) -> str:\n return jsii.get(self, \"logGroupName\")",
"def log_group_name(self) -> str:\n return jsii.get(self, \"logGroupName\")",
"def log_group_name(self) -> str:\n ... | [
"0.6899867",
"0.68074614",
"0.68074614",
"0.67291266",
"0.671613",
"0.66918695",
"0.6642707",
"0.6642707",
"0.6642707",
"0.6642707",
"0.6642707",
"0.6642707",
"0.6642707",
"0.6642707",
"0.6642707",
"0.6642707",
"0.6642707",
"0.6642707",
"0.66249186",
"0.66249186",
"0.66249186... | 0.66508317 | 33 |
The Azure Region where the Log Analytics Cluster should exist. Changing this forces a new Log Analytics Cluster to be created. | def location(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "location") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region(self):\n return self.config.region",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n ... | [
"0.6063227",
"0.57005304",
"0.57005304",
"0.57005304",
"0.57005304",
"0.57005304",
"0.57005304",
"0.56410944",
"0.56410944",
"0.56410944",
"0.56410944",
"0.5582563",
"0.5550295",
"0.5550295",
"0.5550295",
"0.55070853",
"0.55000925",
"0.546841",
"0.546841",
"0.546841",
"0.5468... | 0.0 | -1 |
The name which should be used for this Log Analytics Cluster. Changing this forces a new Log Analytics Cluster to be created. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_name(self):\n return self.name",
"def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")",
"def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")",
"def cluster_name(self):\n return self._data['cluster_name']",
"def cluster_na... | [
"0.81044704",
"0.80277586",
"0.80277586",
"0.78492236",
"0.7447251",
"0.7447251",
"0.7429812",
"0.7334784",
"0.7334784",
"0.7334784",
"0.7334784",
"0.7334784",
"0.70163107",
"0.693203",
"0.67455006",
"0.6613543",
"0.6577319",
"0.651852",
"0.6489287",
"0.6462977",
"0.64446443"... | 0.0 | -1 |
The GUID of the cluster. | def cluster_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "cluster_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")",
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")",
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")",
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cl... | [
"0.8206752",
"0.8206752",
"0.8206752",
"0.8206752",
"0.8206752",
"0.79815733",
"0.79815733",
"0.79815733",
"0.79815733",
"0.78486013",
"0.74347633",
"0.73714894",
"0.73714894",
"0.73284006",
"0.73284006",
"0.7283499",
"0.72495484",
"0.72495484",
"0.72241676",
"0.72117215",
"0... | 0.7104706 | 23 |
The Azure Region where the Log Analytics Cluster should exist. Changing this forces a new Log Analytics Cluster to be created. | def location(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "location") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region(self):\n return self.config.region",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n ... | [
"0.60648334",
"0.570232",
"0.570232",
"0.570232",
"0.570232",
"0.570232",
"0.570232",
"0.56427073",
"0.56427073",
"0.56427073",
"0.56427073",
"0.558404",
"0.5551991",
"0.5551991",
"0.5551991",
"0.5508515",
"0.55013114",
"0.54701805",
"0.54701805",
"0.54701805",
"0.54701805",
... | 0.0 | -1 |
The name which should be used for this Log Analytics Cluster. Changing this forces a new Log Analytics Cluster to be created. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_name(self):\n return self.name",
"def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")",
"def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")",
"def cluster_name(self):\n return self._data['cluster_name']",
"def cluster_na... | [
"0.81056577",
"0.8029101",
"0.8029101",
"0.7850788",
"0.7448295",
"0.7448295",
"0.7431408",
"0.7335934",
"0.7335934",
"0.7335934",
"0.7335934",
"0.7335934",
"0.7017745",
"0.6933729",
"0.6745742",
"0.6613743",
"0.657859",
"0.6518583",
"0.64892256",
"0.64624846",
"0.6444656",
... | 0.0 | -1 |
The name of the Resource Group where the Log Analytics Cluster should exist. Changing this forces a new Log Analytics Cluster to be created. | def resource_group_name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "resource_group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")",
"def log_group_name(self) -> str:\n return jsii.get(self, \"logGroupName\")",
"def log_group_name(self) -> str:\n return jsii.get(self, \"logGroupName\")",
"def log_group_name(self) -> str:\n ... | [
"0.68979996",
"0.68056697",
"0.68056697",
"0.6728122",
"0.67140484",
"0.6689719",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",... | 0.6622993 | 70 |
Get an existing Cluster resource's state with the given name, id, and optional extra properties used to qualify the lookup. | def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
cluster_id: Optional[pulumi.Input[str]] = None,
identity: Optional[pulumi.Input[pulumi.InputType['ClusterIdentityArgs']]] = None,
location: Optional[pulumi.Input[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None) -> 'Cluster':\n opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))\n\n __props__ = ClusterArgs.__new__(ClusterArgs)\n\n __props__.__dict__[\"allocat... | [
"0.68857956",
"0.6762663",
"0.6269104",
"0.6147567",
"0.5752078",
"0.5747889",
"0.56971806",
"0.5690962",
"0.56189775",
"0.54786617",
"0.54459435",
"0.5440927",
"0.542167",
"0.5419507",
"0.53841496",
"0.5382412",
"0.5325774",
"0.52932465",
"0.52818096",
"0.52761203",
"0.52416... | 0.7054605 | 0 |
The GUID of the cluster. | def cluster_id(self) -> pulumi.Output[str]:
return pulumi.get(self, "cluster_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")",
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")",
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")",
"def cluster_id(self) -> str:\n return pulumi.get(self, \"cl... | [
"0.8206752",
"0.8206752",
"0.8206752",
"0.8206752",
"0.8206752",
"0.78486013",
"0.74347633",
"0.73714894",
"0.73714894",
"0.73284006",
"0.73284006",
"0.7283499",
"0.72495484",
"0.72495484",
"0.72241676",
"0.72117215",
"0.7134123",
"0.7108181",
"0.7104706",
"0.7104706",
"0.710... | 0.79815733 | 6 |
The Azure Region where the Log Analytics Cluster should exist. Changing this forces a new Log Analytics Cluster to be created. | def location(self) -> pulumi.Output[str]:
return pulumi.get(self, "location") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region(self):\n return self.config.region",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n ... | [
"0.60648334",
"0.570232",
"0.570232",
"0.570232",
"0.570232",
"0.570232",
"0.570232",
"0.56427073",
"0.56427073",
"0.56427073",
"0.56427073",
"0.558404",
"0.5551991",
"0.5551991",
"0.5551991",
"0.5508515",
"0.55013114",
"0.54701805",
"0.54701805",
"0.54701805",
"0.54701805",
... | 0.0 | -1 |
The name which should be used for this Log Analytics Cluster. Changing this forces a new Log Analytics Cluster to be created. | def name(self) -> pulumi.Output[str]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_name(self):\n return self.name",
"def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")",
"def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")",
"def cluster_name(self):\n return self._data['cluster_name']",
"def cluster_na... | [
"0.81056577",
"0.8029101",
"0.8029101",
"0.7850788",
"0.7448295",
"0.7448295",
"0.7431408",
"0.7335934",
"0.7335934",
"0.7335934",
"0.7335934",
"0.7335934",
"0.7017745",
"0.6933729",
"0.6745742",
"0.6613743",
"0.657859",
"0.6518583",
"0.64892256",
"0.64624846",
"0.6444656",
... | 0.0 | -1 |
The name of the Resource Group where the Log Analytics Cluster should exist. Changing this forces a new Log Analytics Cluster to be created. | def resource_group_name(self) -> pulumi.Output[str]:
return pulumi.get(self, "resource_group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")",
"def log_group_name(self) -> str:\n return jsii.get(self, \"logGroupName\")",
"def log_group_name(self) -> str:\n return jsii.get(self, \"logGroupName\")",
"def log_group_name(self) -> str:\n ... | [
"0.68979996",
"0.68056697",
"0.68056697",
"0.6728122",
"0.67140484",
"0.6689719",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",
"0.6648886",... | 0.66406405 | 54 |
Returns the chunk immediately prior (and adjacent) to this one, if that chunk is free. If the prior chunk is not free, then its base cannot be located and this method raises an error. | def prev_chunk(self):
if self.is_prev_free():
return PTChunk(self.base - self.prev_size(), self.state)
else:
raise SimHeapError("Attempted to access the previous chunk, but it was not free") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _find_bck(self, chunk):\n cur = self.free_head_chunk\n if cur is None:\n return None\n fwd = cur.fwd_chunk()\n if cur == fwd:\n return cur\n # At this point there should be at least two free chunks in the heap\n if cur < chunk:\n while ... | [
"0.6739727",
"0.6521309",
"0.6435245",
"0.6250908",
"0.6151895",
"0.59513235",
"0.5927833",
"0.5909641",
"0.5860597",
"0.58382",
"0.5828593",
"0.58237606",
"0.58129776",
"0.5744253",
"0.57187504",
"0.5688842",
"0.5659023",
"0.56492937",
"0.5648891",
"0.56473315",
"0.5608461",... | 0.7249195 | 0 |
Returns the chunk following this chunk in the list of free chunks. If this chunk is not free, then it resides in no such list and this method raises an error. | def fwd_chunk(self):
if self.is_free():
base = self.state.memory.load(
self.base + 2 * self._chunk_size_t_size, self._chunk_size_t_size, endness=self.state.arch.memory_endness
)
return PTChunk(base, self.state)
else:
raise SimHeapError("Att... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bck_chunk(self):\n if self.is_free():\n base = self.state.memory.load(\n self.base + 3 * self._chunk_size_t_size, self._chunk_size_t_size, endness=self.state.arch.memory_endness\n )\n return PTChunk(base, self.state)\n else:\n raise SimHe... | [
"0.7230324",
"0.7141201",
"0.6772742",
"0.62905204",
"0.62062675",
"0.6173802",
"0.5944966",
"0.59138644",
"0.586021",
"0.58293843",
"0.5822257",
"0.5796732",
"0.5775129",
"0.5760009",
"0.57204014",
"0.5674012",
"0.5660685",
"0.5660685",
"0.5652517",
"0.56497085",
"0.56471485... | 0.6913154 | 2 |
Returns the chunk backward from this chunk in the list of free chunks. If this chunk is not free, then it resides in no such list and this method raises an error. | def bck_chunk(self):
if self.is_free():
base = self.state.memory.load(
self.base + 3 * self._chunk_size_t_size, self._chunk_size_t_size, endness=self.state.arch.memory_endness
)
return PTChunk(base, self.state)
else:
raise SimHeapError("Att... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _find_bck(self, chunk):\n cur = self.free_head_chunk\n if cur is None:\n return None\n fwd = cur.fwd_chunk()\n if cur == fwd:\n return cur\n # At this point there should be at least two free chunks in the heap\n if cur < chunk:\n while ... | [
"0.67708063",
"0.67703253",
"0.6490286",
"0.6169037",
"0.61648965",
"0.6131261",
"0.6129225",
"0.5992427",
"0.5968614",
"0.5966581",
"0.59509045",
"0.59414023",
"0.593857",
"0.5928625",
"0.5916857",
"0.59029496",
"0.58884025",
"0.5870517",
"0.5859937",
"0.5852013",
"0.5842876... | 0.7287688 | 0 |
Sets the freedom of the final chunk. Since no proper chunk follows the final chunk, the heap itself manages this. Nonetheless, for now it is implemented as if an additional chunk followed the final chunk. | def _set_final_freeness(self, flag):
if flag:
self.state.memory.store(
self.heap_base + self.heap_size - self._chunk_size_t_size, ~CHUNK_P_MASK, size=self.state.arch.bytes
)
else:
self.state.memory.store(
self.heap_base + self.heap_size... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_prev_freeness(self, is_free):\n level = silence_logger()\n size_field = self.state.memory.load(self.base + self._chunk_size_t_size, self._chunk_size_t_size)\n unsilence_logger(level)\n if is_free:\n self.state.memory.store(\n self.base + self._chunk_siz... | [
"0.5948114",
"0.54712105",
"0.53969675",
"0.5382715",
"0.5264448",
"0.52503955",
"0.5098263",
"0.5095544",
"0.5073785",
"0.50644153",
"0.50485027",
"0.501041",
"0.50016767",
"0.49913973",
"0.49460727",
"0.49327362",
"0.49307442",
"0.49161735",
"0.4906533",
"0.48933858",
"0.48... | 0.6257527 | 0 |
Creates a ``AvalancheDataset`` instance. | def __init__(
self,
datasets: Sequence[IDataset[T_co]],
*,
indices: Optional[List[int]] = None,
data_attributes: Optional[List[DataAttribute]] = None,
transform_groups: Optional[TransformGroups] = None,
frozen_transform_groups: Optional[TransformGroups] = None,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_avalanche_dataset(\n dataset: IDataset[T_co],\n *,\n data_attributes: Optional[List[DataAttribute]] = None,\n transform_groups: Optional[TransformGroups] = None,\n frozen_transform_groups: Optional[TransformGroups] = None,\n collate_fn: Optional[Callable[[List], Any]] = None,\n) -> Avala... | [
"0.76401573",
"0.6776784",
"0.6726462",
"0.67147267",
"0.65308857",
"0.649754",
"0.64542747",
"0.63987994",
"0.62993234",
"0.62379515",
"0.6233564",
"0.6206527",
"0.6108701",
"0.60328156",
"0.6029136",
"0.5995433",
"0.5948197",
"0.59308594",
"0.5906971",
"0.58810735",
"0.5856... | 0.5928357 | 18 |
Return a new dataset with the added or replaced data attribute. | def update_data_attribute(
self: TAvalancheDataset, name: str, new_value
) -> TAvalancheDataset:
assert len(new_value) == len(
self
), f"Size mismatch when updating data attribute {name}"
datacopy = self._shallow_clone_dataset()
datacopy._data_attributes = copy.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copy_attrs(data_orig, data_new):\n\n if isinstance(data_orig, Dataset):\n\n # Variables\n for v in data_orig.data_vars:\n field = data_orig[v]\n for attr, val in field.attrs.items():\n data_new[v].attrs[attr] = val\n\n # Coordinates\n for c in... | [
"0.6383584",
"0.6284142",
"0.6264239",
"0.6245375",
"0.6239434",
"0.623688",
"0.6225956",
"0.61806816",
"0.61334246",
"0.6127098",
"0.6107833",
"0.60464406",
"0.60130364",
"0.5986759",
"0.5986407",
"0.5961638",
"0.59089535",
"0.5902995",
"0.58856267",
"0.5838741",
"0.5828159"... | 0.7056546 | 0 |
Returns a new dataset with the transformations of the 'train' group loaded. The current dataset will not be affected. | def train(self):
return self.with_transforms("train") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def with_transforms(self: TAvalancheDataset, group_name: str) -> TAvalancheDataset:\n datacopy = self._shallow_clone_dataset()\n datacopy._flat_data = datacopy._flat_data.with_transforms(group_name)\n return datacopy",
"def get_train_data(batch_size=8):\n transform_train = transforms.Comp... | [
"0.676412",
"0.6622502",
"0.65713394",
"0.6510697",
"0.64629513",
"0.6420208",
"0.6353117",
"0.6271212",
"0.62441593",
"0.621921",
"0.6182917",
"0.6177743",
"0.61645496",
"0.61464673",
"0.6139943",
"0.6127927",
"0.61174965",
"0.60736495",
"0.6046308",
"0.6041769",
"0.5997495"... | 0.68283784 | 0 |
Avalanche Dataset. Creates a ``AvalancheDataset`` instance. See ``AvalancheDataset`` for more details. | def make_avalanche_dataset(
dataset: IDataset[T_co],
*,
data_attributes: Optional[List[DataAttribute]] = None,
transform_groups: Optional[TransformGroups] = None,
frozen_transform_groups: Optional[TransformGroups] = None,
collate_fn: Optional[Callable[[List], Any]] = None,
) -> AvalancheDataset[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_dataset(self):\n self.dataset = KITTIBEVDataset(self.dataset_config, self.transform)\n return self.dataset",
"def make_dataset(self, df, **kwargs):\n\t\treturn df",
"def create_dataset(opt):\n\tdata_loader = CustomDatasetDataLoader(opt)\n\tdataset = data_loader.load_data()\n\treturn dat... | [
"0.61842227",
"0.6082506",
"0.6066769",
"0.60336804",
"0.6019875",
"0.5997657",
"0.5933955",
"0.5854805",
"0.5824472",
"0.5783517",
"0.5752961",
"0.5709295",
"0.5690842",
"0.5673246",
"0.5657834",
"0.564969",
"0.5629147",
"0.5560812",
"0.55595803",
"0.5550338",
"0.55310917",
... | 0.7583778 | 0 |
Tests an API call to get a user info | def test_user_info(user_keys):
pyme_instance = PyMe(206946886)
response = pyme_instance.display()
assert isinstance(response, dict)
assert response['id'] == 206946886, "The ID of the user should be in the response"
assert set(user_keys).issubset(response.keys()), "All keys should be in the respons... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_api_user_get(self):\n pass",
"def test_getUser(self):\n\t\turl = \"/users/2/\"\n\t\tresponse = self.client.get(url, format='json')\n\t\tself.assertEqual(response.status_code, status.HTTP_200_OK)\n\t\tself.assertEqual(response.data[\"id\"], 2)\n\t\tself.assertEqual(response.data[\"username\"], \"t... | [
"0.84643024",
"0.7923204",
"0.77909374",
"0.7743428",
"0.77351236",
"0.7567337",
"0.75108653",
"0.749089",
"0.74283755",
"0.7412849",
"0.73279744",
"0.7325879",
"0.73205143",
"0.7281177",
"0.7249741",
"0.7233568",
"0.71882504",
"0.7175849",
"0.71713126",
"0.7163014",
"0.71387... | 0.66782457 | 60 |
gives all primes <=n | def primes(n: int) -> list:
primes = [2]
pot_primes = list(range(2,n+1))
for number in pot_primes:
for prime in primes:
if number // prime == 0:
continue
else:
primes += [x]
print (primes) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def primes(n):\n return [i for i in xrange(1, n + 1) if mr_prime(i)]",
"def get_primes(n):\n\n return list(primes_sieve(n))",
"def make_primes(n):\n out_list = []\n for i in range(2, n):\n if is_prime(i):\n out_list.append(i)\n return out_list",
"def primes(n):\n if n == 0... | [
"0.87482494",
"0.86952657",
"0.84333956",
"0.83444345",
"0.8342542",
"0.82970667",
"0.82060283",
"0.8199539",
"0.8199539",
"0.8195856",
"0.81926244",
"0.8187084",
"0.8182257",
"0.81811315",
"0.8179422",
"0.8176728",
"0.8124121",
"0.8123227",
"0.81110287",
"0.8071508",
"0.8044... | 0.7501948 | 69 |
Returns x and error estimate thereof | def inv_y(y, abstol=1e-13, itermax=30, conv=None):
if invertible_fitter:
pass
else:
x_ = y0+y*DxDy # guess (linear over xspan)
dy = cb_y(x_)-y
i=0
dx=0.0 # could skip while-loop
while abs(dy) > abstol and i < itermax:
dx = -dy/cb_dydx(x... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error(Y, X):\n return (Y - X) ** 2",
"def error(beta_0: float, beta_1: float, x_i: float, y_i: float) -> float:\n return predict(beta_0, beta_1, x_i) - y_i",
"def error_function(x):\n T = [9.60497373987051638749E0,\n 9.00260197203842689217E1,\n 2.23200534594684319226E3,\n 7... | [
"0.66395056",
"0.66101885",
"0.6590583",
"0.6572673",
"0.6479675",
"0.6418561",
"0.6402628",
"0.6263016",
"0.6260379",
"0.625273",
"0.6235225",
"0.6221353",
"0.62135327",
"0.6193837",
"0.6191688",
"0.61092705",
"0.61085325",
"0.6103939",
"0.60558265",
"0.6036493",
"0.6023301"... | 0.0 | -1 |
Calculate the euclidean distance whne given two points (x1,y1) & (x2,y2) | def euclideanDistance(x1,y1,x2,y2):
distance = math.sqrt(abs(math.pow((x2-x1),2)) + abs(math.pow((y2-y1),2)))
return distance | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def euclidean_distance(x1, y1, x2, y2):\n distance = math.sqrt(((x2 - x1) ** 2) + ((y2 - y1) ** 2))\n return distance",
"def euclidean_distance(point1, point2):\n\n return math.sqrt(sum([(x - y) ** 2 for x, y in zip(point1, point2)]))",
"def distance(x1, y1, x2, y2):\n return ((x2 - x1) ** ... | [
"0.8627741",
"0.8431432",
"0.8408465",
"0.832826",
"0.83005786",
"0.8295182",
"0.8293297",
"0.8289106",
"0.827331",
"0.8251059",
"0.82306075",
"0.81927794",
"0.8148658",
"0.8135282",
"0.8118735",
"0.81160355",
"0.8068486",
"0.80680084",
"0.8019211",
"0.79522884",
"0.79490346"... | 0.8791461 | 0 |
Returns the VarCollection of the wrapped module. | def vars(self, scope: str = '') -> VarCollection:
return self.__wrapped__.vars(scope=scope) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vars(self, scope: str = '') -> VarCollection:\n vc = VarCollection()\n scope += f'({self.__class__.__name__}).'\n for k, v in self.__dict__.items():\n if isinstance(v, BaseVar):\n vc[scope + k] = v\n elif isinstance(v, Module):\n if k == ... | [
"0.70691246",
"0.68775046",
"0.6417145",
"0.6360135",
"0.6243516",
"0.61562425",
"0.6150755",
"0.6110369",
"0.604031",
"0.5986304",
"0.59617937",
"0.593429",
"0.5915338",
"0.58190966",
"0.5818179",
"0.581717",
"0.57682383",
"0.56744236",
"0.56226027",
"0.5622196",
"0.5599347"... | 0.6865874 | 2 |
Return the VarCollection of the variables used by the function. | def vars(self, scope: str = '') -> VarCollection:
if scope:
return VarCollection((scope + k, v) for k, v in self.vc.items())
return VarCollection(self.vc) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def variables(self):\n return {u for u in self if u.type == 'var'}",
"def get_all_variables(self):\n return []",
"def vars(self, scope: str = '') -> VarCollection:\n return self.__wrapped__.vars(scope=scope)",
"def vars(self):\n return [Var(i,self.dims[i]) for i in range(self.nvar)] ... | [
"0.7559844",
"0.7478491",
"0.74654114",
"0.74014294",
"0.73995835",
"0.73664683",
"0.73602045",
"0.7294193",
"0.7279656",
"0.72559124",
"0.72493297",
"0.7231599",
"0.7230316",
"0.71086866",
"0.709824",
"0.7081276",
"0.7075124",
"0.70687777",
"0.7028275",
"0.70204973",
"0.7020... | 0.7486616 | 1 |
Utility to reshape an input array in order to broadcast to multiple devices. | def device_reshape(self, x: JaxArray) -> JaxArray:
assert hasattr(x, 'ndim'), f'Expected JaxArray, got {type(x)}. If you are trying to pass a scalar to ' \
f'parallel, first convert it to a JaxArray, for example np.float(0.5)'
if x.ndim == 0:
return np.broa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reshape_to_batch(array):\n if len(array.shape) == 2:\n array = numpy.expand_dims(array, axis=2)\n array = numpy.expand_dims(array, axis=0)\n return array",
"def reshape(input):\n\n input = input / 255\n input = trans.resize(input, (args.size, args.size))\n input = np.reshape(input, i... | [
"0.71891135",
"0.7091737",
"0.7016443",
"0.696897",
"0.69149935",
"0.6911399",
"0.6824757",
"0.6815497",
"0.6796378",
"0.6782199",
"0.6782199",
"0.6705896",
"0.6580548",
"0.64910996",
"0.64861894",
"0.64594185",
"0.6431378",
"0.63681036",
"0.63589054",
"0.63227814",
"0.623102... | 0.6735575 | 11 |
Initialises a new 'PendingCalculation' instance. | def __init__(self, scalarNumerator=0, multiplyBeforeAdd=False, scalarDenominator=0, scalarFloat=0.0, offset=0, IntervalBlocks=None, ReadingType=None, *args, **kw_args):
#: (if scalar is integer or rational number) When the scalar is a simple integer, and this attribute is presented alone and multiplied with 'I... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, created_at=None):\n super(StatePending, self).__init__(\n type_id=STATE_PENDING,\n created_at=created_at\n )",
"def _init_calculation(self):\n # count number of previous calculations\n self.ctx.running_calc += 1\n\n # set the structure\n... | [
"0.5833618",
"0.5674528",
"0.5571382",
"0.53659016",
"0.5345722",
"0.5337999",
"0.5320642",
"0.5320642",
"0.52803034",
"0.527802",
"0.5277454",
"0.52562463",
"0.5250982",
"0.5240429",
"0.5225318",
"0.5212049",
"0.5195182",
"0.51923645",
"0.519024",
"0.51610416",
"0.5138548",
... | 0.65330714 | 0 |
Compute softmax values for each sets of scores in x. | def softmax(x):
e_x = np.exp(x - np.max(x))
return e_x / e_x.sum(axis=0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def softmax(self, scores):\n\n\n # for each sample, for each class ,caclulate\n # np.exp(scores) : still (n_samples, n_classes)\n\n # axis = 1\n # a00, a01, a02 as a sinlge one to perfrom np_sum\n # which is the same sample \n # sum_exp : still (n_samples, 1)\n\n # ... | [
"0.77965075",
"0.77608246",
"0.7759328",
"0.7757032",
"0.76580364",
"0.76580364",
"0.76580364",
"0.76580364",
"0.7585873",
"0.743174",
"0.74079806",
"0.7394367",
"0.7358405",
"0.73176855",
"0.72691524",
"0.7262539",
"0.72616005",
"0.7257189",
"0.7230358",
"0.7215222",
"0.7201... | 0.7061904 | 66 |
Returns starting state of the board. | def getInitialState():
return [[EMPTY, EMPTY, EMPTY],
[EMPTY, EMPTY, EMPTY],
[EMPTY, EMPTY, EMPTY]] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_state(self):\r\n return np.zeros(self.board_size, dtype=np.int8)",
"def start_state():\n return chess.Board()",
"def startingState(self):\n # Returns starting position and 4 false because no corners are visited yet\n return (self.startingPosition, (False, False, False, False))... | [
"0.8081974",
"0.789134",
"0.75339407",
"0.72773534",
"0.72773534",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
"0.7224644",
... | 0.0 | -1 |
Returns player who has the next turn on a board. Player X is always starting. | def getPlayer(board):
count_x, count_o = 0, 0
for row in board:
count_x += row.count(X)
count_o += row.count(O)
if count_x > count_o:
return O
return X | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_player(self):\n # Counter is a useful class that counts objects.\n count = Counter(self.board)\n if count.get('X', 0) > count.get('O', 0):\n return 'O'\n return 'X'",
"def next_player(board, prev_player):\n opp = Othello.opponent(prev_player)\n if Oth... | [
"0.76980597",
"0.7605448",
"0.75094336",
"0.74354905",
"0.72666013",
"0.7237328",
"0.71856785",
"0.71827954",
"0.7145635",
"0.7090568",
"0.7087428",
"0.7026365",
"0.7007532",
"0.6998657",
"0.6913283",
"0.6892157",
"0.6877069",
"0.68342906",
"0.6820439",
"0.6820439",
"0.678737... | 0.706045 | 11 |
Returns the optimal action for the current player on the board. | def minimax(board):
optimal_action = None
player = getPlayer(board)
if player == X:
# Player X tries to find the action that maximizes his score.
# He must therefore look how player O tries to minimize the score after each available action.
# From all available actions, the action wi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_best_action(self):\n if self.bestAction is None:\n self.calculate_best_action()\n return self.bestAction",
"def getAction(self, gameState: GameState):\n _max = float(\"-inf\")\n action = None\n for move in gameState.getLegalActions(0):\n util = min... | [
"0.7766856",
"0.76323676",
"0.75855315",
"0.75285065",
"0.75175256",
"0.74667144",
"0.74263537",
"0.7416421",
"0.73943585",
"0.7375846",
"0.7333894",
"0.73147565",
"0.7306611",
"0.7284639",
"0.72650313",
"0.72650313",
"0.7250975",
"0.72331834",
"0.7203267",
"0.71732694",
"0.7... | 0.7460485 | 6 |
Set the DHW to follow the schedule. | def set_dhw_auto(self):
data = {"Mode": "FollowSchedule", "State": "", "UntilTime": None}
self._set_dhw(data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_schedule(self, day, week, schedule):\n self.schedule['schedule'][day][week] = schedule",
"def set_dhw_on(self, until=None):\n if until is None:\n data = {\"Mode\": \"PermanentOverride\", \"State\": \"On\", \"UntilTime\": None}\n else:\n data = {\n ... | [
"0.6246013",
"0.5818637",
"0.56434053",
"0.5642498",
"0.5373371",
"0.52095324",
"0.5179568",
"0.5150776",
"0.5132043",
"0.5132043",
"0.5113041",
"0.5044487",
"0.50389427",
"0.5037211",
"0.50341535",
"0.50309134",
"0.50230217",
"0.4970477",
"0.49598724",
"0.49178386",
"0.49132... | 0.7934776 | 0 |
Return duple of handle definition and encoding or None duple if not a handle handle is a possible file handle The return is (handle definition, encoding) or a None duple if this is not a known handle | def getdef(self, handle):
return self.fhdict.get(handle.lower(), (None, None)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def guess_rdf_format(fname):\n\n if fname is None:\n return None, None\n\n extension = _get_extension(fname)\n\n # if compressed, needs content encoding\n content_encoding = _COMPRESSION_EXTENSIONS.get(extension)\n if content_encoding:\n # remove encoding extension\n extension =... | [
"0.5360577",
"0.5255213",
"0.5188898",
"0.5159582",
"0.5147309",
"0.513703",
"0.51299644",
"0.5081016",
"0.49880522",
"0.49835837",
"0.49625415",
"0.49593022",
"0.4936775",
"0.48624855",
"0.4858554",
"0.48534927",
"0.48458427",
"0.48150045",
"0.4805964",
"0.48054904",
"0.4805... | 0.56236774 | 0 |
This method is called when the agents are build. It can be overwritten by the user, to initialize the agents. parameters and agent_parameters are the parameters given in | def init(self, parameters, agent_parameters):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def agent_init(self):\n pass",
"def _init_agents(self):\n self.agents = [Agent(e=0.1, a=0.1, row=self.row, col=self.col) for i in range(2)]",
"def agent_init(self, agent_info):\n\n # First, we get the relevant information from agent_info \n # NOTE: we use np.random.RandomState(seed)... | [
"0.72151494",
"0.6663",
"0.66094863",
"0.65945065",
"0.6516566",
"0.6426929",
"0.63656723",
"0.63632447",
"0.6358823",
"0.63246685",
"0.6312075",
"0.623338",
"0.6214334",
"0.6191401",
"0.6182455",
"0.61509305",
"0.61505723",
"0.61403817",
"0.61379075",
"0.61313826",
"0.609022... | 0.8251342 | 0 |
Get day months and year differences between dates | def diffDates(d1, d2, units):
if units not in ["days", "months", "years"]:
error("Invalid unit type: " + str(units))
divisors = {"days":1, "months":30.4, "years":365.25}
divNum = divisors[units]
diffDays = abs((d2-d1).days)
return int(diffDays/divNum) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def month_difference(start_date, end_date):\n diff = get_date_difference(start_date, end_date, date_format=app_constant.DATE_FORMAT)\n return (diff.years * 12) + diff.months",
"def diff_month(d1, d2):\n return ceil(abs((d1.year - d2.year) * 12 + d1.month - d2.month))",
"def month_diff(date1, date2):\n... | [
"0.6987735",
"0.69277537",
"0.67518675",
"0.6684063",
"0.65516883",
"0.64748985",
"0.6378188",
"0.63703674",
"0.6360468",
"0.6286766",
"0.62316036",
"0.6192492",
"0.6186307",
"0.6148199",
"0.6116816",
"0.6098557",
"0.60652864",
"0.6064737",
"0.6061227",
"0.597224",
"0.5955158... | 0.6522908 | 5 |
Gets regex with groups and ends with ``\\z`` to match target suffix. Returns str The suffix pattern | def getSuffixPattern(self):
return self.getOrDefault("suffixPattern") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_suffix_ml_model():\n suffix = ''\n \n # consider if the model uses tail or not\n if gml.USE_TAIL: \n suffix += '_use_tail'\n else: \n suffix += '_no_tail'\n\n # consider the way of picking target variable for the model\n if gml.WAY_MODEL_TGT == 'absolute':\n suffix... | [
"0.56613475",
"0.56411755",
"0.56411755",
"0.56411755",
"0.55363405",
"0.55363405",
"0.55051965",
"0.55051965",
"0.54414606",
"0.54355556",
"0.5344791",
"0.5344791",
"0.53204",
"0.53006077",
"0.52948916",
"0.5268836",
"0.52538824",
"0.5248414",
"0.52029204",
"0.5201612",
"0.5... | 0.679943 | 0 |
Sets pattern to grab from text as token candidates, by default ``\\S+``. | def setTargetPattern(self, value):
return self._set(targetPattern=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tokenize_corpus(text, pattern):\n tokens = nltk.regexp_tokenize(text, pattern)\n return tokens",
"def __init__(self, text: str):\n self.words = WORDS_RE.findall(text)",
"def __init__(self, pattern):\n self._pattern = pattern.lower()",
"def matching_regex_pattern(self):\n if not... | [
"0.5929916",
"0.59224397",
"0.5662446",
"0.5558155",
"0.5542746",
"0.517427",
"0.5157613",
"0.5119881",
"0.51077336",
"0.50938475",
"0.50715846",
"0.50452334",
"0.49799564",
"0.49753013",
"0.4955305",
"0.4940583",
"0.4928961",
"0.49161047",
"0.4915082",
"0.4901924",
"0.487852... | 0.0 | -1 |
Sets words that won't be affected by tokenization rules. | def setExceptions(self, value):
return self._set(exceptions=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setOwnTokens(self):\n\t\tself.removeOwnPunctuation()\n\t\tself.removeOwnStopWords()",
"def setWordKnown(self):\n self.wordKnown = ''.join(['_ ' if w not in self.guessedRight else w for w in self.getWord()])",
"def _setCleanString(self, words):\n \n if self.type=='DIAGNOSIS':\n ... | [
"0.7415955",
"0.6952087",
"0.6950947",
"0.68814147",
"0.67158085",
"0.66769695",
"0.6612828",
"0.6513896",
"0.64850664",
"0.6479143",
"0.6382393",
"0.6370426",
"0.6339125",
"0.63258755",
"0.63212067",
"0.6289311",
"0.6287283",
"0.6251924",
"0.62306666",
"0.62306565",
"0.62280... | 0.0 | -1 |
Gets words that won't be affected by tokenization rules. Returns List[str] Words that won't be affected by tokenization rules | def getExceptions(self):
return self.getOrDefault("exceptions") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def interestingWords(self):\n words = set([])\n for token in self.importantTokenList():\n if token.isStopWord() == False:\n words.add(token.text.lower())\n return words",
"def filterWords(text):\n words = text.split()\n out = []\n for w in words:\n w = normalizeOrRemoveWord(w... | [
"0.78293425",
"0.7388257",
"0.7378749",
"0.72831744",
"0.72766083",
"0.7270191",
"0.7265354",
"0.72441757",
"0.72324914",
"0.72225565",
"0.7219836",
"0.7195111",
"0.71845174",
"0.7184133",
"0.71755683",
"0.71595865",
"0.71472317",
"0.712717",
"0.7100701",
"0.70664644",
"0.704... | 0.0 | -1 |
Sets pattern to separate from the inside of tokens. Takes priority over splitChars. | def setSplitPattern(self, value):
return self._set(splitPattern=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delimiter(self) -> \"pattern\":\n raise NotImplementedError",
"def patterngenerator(self, corpus, tokensperpattern, **kwargs):\n # Pre-tokenized all corpus documents, for efficiency\n tokenizedcorpus = [self.tokenizer.transform(doc) for doc in corpus]\n for pattern in self._tokeni... | [
"0.60127646",
"0.5720355",
"0.5702593",
"0.5692438",
"0.5552301",
"0.54941744",
"0.54671013",
"0.54601145",
"0.5455173",
"0.5345393",
"0.5338574",
"0.533558",
"0.5321088",
"0.52936316",
"0.52627397",
"0.5208205",
"0.5175203",
"0.5152153",
"0.5152153",
"0.5071862",
"0.5059671"... | 0.6615424 | 0 |
Sets the maximum allowed legth for each token, by default 99999. | def setMaxLength(self, value):
return self._set(maxLength=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setMaxTokens(self, value):\n return self._set(maxTokens=value)",
"def _set_maximum(self):\n self._level_gen.maximum_length = self._maximum_length_spinbox.value()\n self._refresh_view()",
"def setmaxsize(self, maxsize):\n self.maxsize = maxsize",
"def set_max_nb_robots(nb): #p... | [
"0.6942922",
"0.680115",
"0.6503058",
"0.6459999",
"0.63402814",
"0.63402814",
"0.6240434",
"0.6178947",
"0.6170668",
"0.6151255",
"0.61305356",
"0.61172724",
"0.60697144",
"0.6056842",
"0.60011375",
"0.59801924",
"0.5978601",
"0.58801407",
"0.5860224",
"0.5830532",
"0.580508... | 0.57344186 | 28 |
Sets pattern to separate from the inside of tokens. Takes priority over splitChars. | def setSplitPattern(self, value):
return self._set(splitPattern=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delimiter(self) -> \"pattern\":\n raise NotImplementedError",
"def patterngenerator(self, corpus, tokensperpattern, **kwargs):\n # Pre-tokenized all corpus documents, for efficiency\n tokenizedcorpus = [self.tokenizer.transform(doc) for doc in corpus]\n for pattern in self._tokeni... | [
"0.60127646",
"0.5720355",
"0.5702593",
"0.5692438",
"0.5552301",
"0.54941744",
"0.54671013",
"0.54601145",
"0.5455173",
"0.5345393",
"0.5338574",
"0.533558",
"0.5321088",
"0.52936316",
"0.52627397",
"0.5208205",
"0.5175203",
"0.5152153",
"0.5152153",
"0.5071862",
"0.5059671"... | 0.6615424 | 1 |
Sets the maximum allowed legth for each token. | def setMaxLength(self, value):
return self._set(maxLength=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_maximum(self):\n self._level_gen.maximum_length = self._maximum_length_spinbox.value()\n self._refresh_view()",
"def setMaxTokens(self, value):\n return self._set(maxTokens=value)",
"def setmaxsize(self, maxsize):\n self.maxsize = maxsize",
"def _set_max_steps(self, mx):\... | [
"0.6933104",
"0.67468673",
"0.6419099",
"0.6325806",
"0.6289092",
"0.6286208",
"0.62857956",
"0.62857956",
"0.61723024",
"0.612657",
"0.61048114",
"0.6078063",
"0.59744036",
"0.5955925",
"0.5940171",
"0.5908336",
"0.59000224",
"0.5891313",
"0.5881514",
"0.5851287",
"0.5809892... | 0.5637081 | 30 |
Sets the maximum allowed legth for each token. | def setMaxLength(self, value):
return self._set(maxLength=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_maximum(self):\n self._level_gen.maximum_length = self._maximum_length_spinbox.value()\n self._refresh_view()",
"def setMaxTokens(self, value):\n return self._set(maxTokens=value)",
"def setmaxsize(self, maxsize):\n self.maxsize = maxsize",
"def _set_max_steps(self, mx):\... | [
"0.6933104",
"0.67468673",
"0.6419099",
"0.6325806",
"0.6289092",
"0.6286208",
"0.62857956",
"0.62857956",
"0.61723024",
"0.612657",
"0.61048114",
"0.6078063",
"0.59744036",
"0.5955925",
"0.5940171",
"0.5908336",
"0.59000224",
"0.5891313",
"0.5881514",
"0.5851287",
"0.5809892... | 0.5637081 | 31 |
Sets external resource to rules, needs 'delimiter' in options. | def setExternalRules(self, path, delimiter, read_as=ReadAs.TEXT, options={"format": "text"}):
opts = options.copy()
if "delimiter" not in opts:
opts["delimiter"] = delimiter
return self._set(externalRules=ExternalResource(path, read_as, opts)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_rule(self, client, *args, **keyword_args):\n pass",
"def setup_rule(self, client, *args, **keyword_args):\n pass",
"def setup_rule(self, client):\n pass",
"def setup_rule(self, client):\n pass",
"def set_rules(rules, overwrite=True, use_conf=False): # pragma: no cover... | [
"0.57064635",
"0.57064635",
"0.5675133",
"0.5675133",
"0.5460084",
"0.5459312",
"0.54122496",
"0.532189",
"0.53013927",
"0.52802545",
"0.52601534",
"0.5245513",
"0.5245513",
"0.5245513",
"0.5245513",
"0.5245513",
"0.5228362",
"0.519679",
"0.5128836",
"0.5124839",
"0.51207614"... | 0.77379024 | 0 |
Sets whether to parse the date in mm/dd/yyyy format instead of dd/mm/yyyy, by default True. For example July 5th 2015, would be parsed as 07/05/2015 instead of 05/07/2015. | def setReadMonthFirst(self, value):
return self._set(readMonthFirst=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date_format_correct(self):\n valid_format = True\n try:\n new_val = self.date_edit.text()\n datetime_object = datetime.strptime(new_val, \"%Y-%m-%d\")\n except BaseException:\n valid_format = False\n return valid_format",
"def convert_date(self, da... | [
"0.60482407",
"0.5812935",
"0.5795009",
"0.5690697",
"0.5668029",
"0.5632126",
"0.562029",
"0.562029",
"0.5526658",
"0.5461529",
"0.5406106",
"0.5359038",
"0.5311286",
"0.5301336",
"0.52850413",
"0.5283639",
"0.5233545",
"0.5204311",
"0.5204059",
"0.5200141",
"0.5189358",
"... | 0.0 | -1 |
Sets an anchor month for the relative dates such as a day after tomorrow. If not set it will use the current month. | def setAnchorDateMonth(self, value):
normalizedMonth = value - 1
return self._set(anchorDateMonth=normalizedMonth) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setMonth(self, *args):\n return _libsbml.Date_setMonth(self, *args)",
"def _next_month(self):\n self._canvas.place_forget()\n\n year, month = self._date.year, self._date.month\n self._date = self._date + self.timedelta(\n days=calendar.monthrange(year, month)[1] + 1)\n ... | [
"0.628867",
"0.60595614",
"0.60135895",
"0.59516186",
"0.564721",
"0.5639745",
"0.56392854",
"0.56219184",
"0.5595049",
"0.5568303",
"0.555252",
"0.55226934",
"0.5473782",
"0.5472456",
"0.54565424",
"0.5453102",
"0.5430861",
"0.54199123",
"0.5387466",
"0.5337742",
"0.5332324"... | 0.83501244 | 0 |
Sets an anchor day of the day for the relative dates such as a day after tomorrow. If not set it will use the current day. | def setAnchorDateDay(self, value):
return self._set(anchorDateDay=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setDay(self, *args):\n return _libsbml.Date_setDay(self, *args)",
"def setAnchorDateMonth(self, value):\n normalizedMonth = value - 1\n return self._set(anchorDateMonth=normalizedMonth)",
"def Anchor_day(year):\r\n day = (5 * ((year // 100) % 4) + 2) % 7\r\n return day",
"def d... | [
"0.6182741",
"0.56285065",
"0.5529314",
"0.540226",
"0.540226",
"0.54009134",
"0.5396998",
"0.5369027",
"0.53335136",
"0.53335136",
"0.5253803",
"0.52393943",
"0.5233588",
"0.520227",
"0.5195527",
"0.5168494",
"0.51591825",
"0.51198655",
"0.50870115",
"0.50719106",
"0.5046702... | 0.8381516 | 0 |
Sets TokenizerModel to use to tokenize input file for building a Trie. | def setTokenizer(self, tokenizer_model):
tokenizer_model._transfer_params_to_java()
return self._set(tokenizer_model._java_obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tokenize(self):\n\n x = [] # input documents\n for file_path in glob.glob(self.train_dir + '*.txt'):\n file_as_string = open(file_path).read()\n x.append(file_as_string)\n\n self.tokenizer.fit_on_texts(x)\n print('input vocabulary size:', len(self.tokenizer.word_index))\n pickle_file =... | [
"0.60258204",
"0.59469104",
"0.5725507",
"0.5637215",
"0.56240195",
"0.5614295",
"0.5583916",
"0.5576202",
"0.5412135",
"0.54113585",
"0.53697526",
"0.5333523",
"0.5242711",
"0.52235425",
"0.5222251",
"0.52115285",
"0.52022016",
"0.5158442",
"0.51493186",
"0.5127048",
"0.5120... | 0.712567 | 0 |
Sets length at which sentences will be forcibly split. | def setSplitLength(self, value):
return self._set(splitLength=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setMaxSentenceLength(self, value):\n return self._set(maxSentenceLength=value)",
"def setMaxSentenceLength(self, value):\n return self._set(maxSentenceLength=value)",
"def setMaxSentenceLength(self, value):\n return self._set(maxSentenceLength=value)",
"def setMaxSentenceLength(self,... | [
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"0.6865042",
"... | 0.6662465 | 24 |
Sets minimum allowed length for each sentence, by default 0 | def setMinLength(self, value):
return self._set(minLength=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_min_sentence_length(self):\n new_min = int(self.set_min_sentence.get())\n cur_max = self.max_sentence_length\n\n if new_min < cur_max:\n self.min_sentence_length = new_min\n else:\n old_min = self.min_sentence_length\n old_min_var = tk.StringVar(... | [
"0.7627903",
"0.7156304",
"0.6837284",
"0.67570573",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
"0.66353697",
... | 0.6407058 | 30 |
Sets name of column for data labels. | def setLabelColumn(self, value):
return self._set(labelColumn=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_column_name(self, name):\r\n self.column_name = name",
"def set_column_name(self, name):\r\n self.column_name = name",
"def column_name(self, label):\n self.output_label = label\n return self",
"def setLabelColumn(self, v):\n return self._set(labelColumn=v)",
"def... | [
"0.7711343",
"0.7711343",
"0.74903476",
"0.7224172",
"0.70832473",
"0.6838743",
"0.6631946",
"0.6574716",
"0.6557649",
"0.64363885",
"0.6297389",
"0.6184849",
"0.6166829",
"0.6135585",
"0.61154836",
"0.611353",
"0.6105123",
"0.606296",
"0.606296",
"0.6055398",
"0.60361886",
... | 0.7029037 | 7 |
Sets minimum weight value. Features with less weights then this param value will be filtered. | def setMinW(self, w):
return self._set(minW=w) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_weights(self,weights):\n for i,layer in enumerate(weights):\n #checking for any values equal to minval\n if np.any(layer==self.minval):\n weights[i]=np.where(weights[i]==self.minval,self.replace_min,weights[i])\n super().set_weights(list(weights))",
"def... | [
"0.73393",
"0.6973091",
"0.67955333",
"0.67955333",
"0.67955333",
"0.6777445",
"0.6710003",
"0.6657979",
"0.6657979",
"0.6657979",
"0.65866613",
"0.65741",
"0.64773965",
"0.64773965",
"0.64716136",
"0.64621645",
"0.64484024",
"0.64484024",
"0.6376731",
"0.63380915",
"0.622261... | 0.71151185 | 1 |
Sets configProto from tensorflow, serialized into byte array. | def setConfigProtoBytes(self, b):
return self._set(configProtoBytes=b) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setConfigProtoBytes(self, v):\n return self._set(configProtoBytes=v)",
"def make_config_proto(c):\n # tensorflow config\n use_gpu = os.environ.get('use_gpu', c.get('tf.config.use_gpu', c.get('use_gpu', 1)))\n cfg = tf.ConfigProto(device_count={'GPU': use_gpu})\n\n # scan config for tf conf... | [
"0.75618696",
"0.6219305",
"0.6167628",
"0.59814763",
"0.59055257",
"0.5844697",
"0.5599306",
"0.55863786",
"0.5412146",
"0.53233427",
"0.5217989",
"0.52129155",
"0.51678354",
"0.51494646",
"0.50938296",
"0.5053427",
"0.50138324",
"0.49860623",
"0.4972503",
"0.49635026",
"0.4... | 0.7518328 | 24 |
Sets Learning Rate, by default 0.001. | def setLr(self, v):
self._set(lr=v)
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_learning_rate(self, rate):\n self.SGD.set_learning_rate(rate)",
"def learning_rate(epoch):\n self.lr = self.lr / 1.00000001\n return self.lr",
"def get_learning_rate():\n return 0.00001",
"def adjust_lr(self):\n learning_rate = self.params.base_lr * (1 - float(s... | [
"0.79922676",
"0.76068604",
"0.7550042",
"0.7423539",
"0.7380186",
"0.72877944",
"0.71704733",
"0.717002",
"0.71413094",
"0.71413094",
"0.7134791",
"0.7103761",
"0.70970416",
"0.7069047",
"0.70606893",
"0.70606893",
"0.70531285",
"0.7052301",
"0.7050756",
"0.70486426",
"0.703... | 0.0 | -1 |
Sets Learning rate decay coefficient, by default 0.005. Real Learning Rage is lr / (1 + po epoch). | def setPo(self, v):
self._set(po=v)
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjust_learning_rate(lr, optimizer, lr_decay, epoch):\n\n if epoch >= lr_decay[0]:\n lr = lr * 0.1\n if epoch >= lr_decay[1]:\n lr = lr * 0.01\n for param_group in optimizer.param_groups:\n param_group['lr'] = lr\n\n return lr",
"def adjust_learning_rate(optimizer, epoch, arg... | [
"0.79850817",
"0.78057677",
"0.7796848",
"0.777169",
"0.77335143",
"0.772527",
"0.77146715",
"0.7686081",
"0.76853544",
"0.761567",
"0.75811327",
"0.75772136",
"0.7576445",
"0.75698596",
"0.75351804",
"0.7532264",
"0.75320476",
"0.7530885",
"0.75126946",
"0.7510866",
"0.75025... | 0.0 | -1 |
Sets dropout coefficient, by default 0.5. | def setDropout(self, v):
self._set(dropout=v)
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dropout(self, dropout):\n if dropout >= 1.0:\n raise ValueError('The `dropout` must be < 1.')\n self._internal.set_dropout(float(dropout))",
"def _Dropout(self, name, drop_prob):\n return super()._Dropout(name, keep_prob=1.0 - drop_prob)",
"def set_drop_rate(self, drop_rate=0.0)... | [
"0.74401724",
"0.6599109",
"0.6288559",
"0.6223161",
"0.6138355",
"0.6060847",
"0.59498876",
"0.591671",
"0.584302",
"0.5831263",
"0.5802445",
"0.5768129",
"0.56373876",
"0.55592215",
"0.55451894",
"0.5474174",
"0.5460874",
"0.5435045",
"0.5423101",
"0.5395062",
"0.5371357",
... | 0.68939245 | 1 |
Sets Path to test dataset. If set used to calculate statistic on it during training. | def setTestDataset(self, path, read_as=ReadAs.SPARK, options={"format": "parquet"}):
return self._set(testDataset=ExternalResource(path, read_as, options.copy())) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\n\n self.test_data_path = 'testing/test_data/'",
"def set_test_path(self):\n\n self.test_input.delete(0, END)\n path = set_path()\n self.test_input.insert(0, path)",
"def autogen_dataset_dir_with_test():\n return TabularDataset.autogen('tests/data/dummy_tabular',... | [
"0.68377954",
"0.6679652",
"0.66725093",
"0.6558004",
"0.6514127",
"0.6506715",
"0.64552486",
"0.64429045",
"0.6385298",
"0.6381583",
"0.6373969",
"0.63368386",
"0.6326638",
"0.6269291",
"0.6258689",
"0.6254526",
"0.6228686",
"0.61948246",
"0.6181072",
"0.6130394",
"0.6129675... | 0.67092884 | 1 |
Sets whether to use stdout in addition to Spark logs, by default False. | def setEnableOutputLogs(self, value):
return self._set(enableOutputLogs=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable(self):\n self.out = StringIO()\n self._stdout = sys.stdout\n sys.stdout = self.out",
"def setEnableOutputLogs(self, v):\n return self._set(enableOutputLogs=v)",
"def logToStdout(timestamp=False):\n logs['console'] = MyLogObserver(sys.stdout)\n if not timestamp:\n ... | [
"0.625057",
"0.60649985",
"0.59921265",
"0.590379",
"0.5868902",
"0.58132875",
"0.580797",
"0.5750399",
"0.5697567",
"0.5687111",
"0.5673425",
"0.56369936",
"0.5593075",
"0.55734223",
"0.5555929",
"0.5551917",
"0.55395275",
"0.55261093",
"0.5512869",
"0.54802465",
"0.5461263"... | 0.6049015 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.