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 |
|---|---|---|---|---|---|---|
step function, returns reward and checks if done reward is given based on difference of hp health and enemy_health. | def step(self,action):
observation, reward, done, info = self.env.step(action)
if info["health"] <= 0 or info["enemy_health"] <= 0:
self.player_hp = 120
self.enemy_hp = 120
reward = 0
else:
self.player_hp = info['health']
self.enemy_hp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_reward(self, state, reward, done):\n\n # simple reward = position. Don't explicitly incentivise agent to take left hill as well as right hill\n # let it figure it out by itself\n if done and self.success:\n return 100\n else:\n return (state[0]-0.5)/3",
"... | [
"0.67342377",
"0.6714184",
"0.6713342",
"0.66855854",
"0.66546464",
"0.65771836",
"0.6575581",
"0.65544325",
"0.65281224",
"0.651338",
"0.6480194",
"0.6478867",
"0.64767617",
"0.64761925",
"0.6475791",
"0.6457583",
"0.64453596",
"0.6411538",
"0.6410074",
"0.63607997",
"0.6355... | 0.7379983 | 0 |
Return all pull requests merged since `tag` was created. Pull requests are sorted in ascending order of merge date. | def get_prs_merged_since(auth_token, repo, tag):
tag_date = get_tag_date(tag)
prs = []
def merge_date(pr):
if pr.get('merged_at'):
return dateutil.parser.parse(pr['merged_at'])
else:
return None
# The GitHub API does not provide a `since` parameter to retrieve P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_pull_requests():\n pull_requests = []\n url_base = f\"https://github.com/{GITHUB_OWNER}/{GITHUB_REPO}/pull/\"\n repo = GITHUB.get_user(GITHUB_OWNER).get_repo(GITHUB_REPO)\n pulls = repo.get_pulls(base=\"main\", state=\"closed\")\n last_release_date = repo.get_latest_release().published_at\n ... | [
"0.61700565",
"0.5560174",
"0.5424253",
"0.52951276",
"0.5281406",
"0.52067375",
"0.5114785",
"0.5067681",
"0.5035338",
"0.5024907",
"0.4973277",
"0.4964292",
"0.49352896",
"0.49306938",
"0.49181768",
"0.48836792",
"0.48522216",
"0.48514563",
"0.48493055",
"0.48340136",
"0.48... | 0.78479284 | 0 |
Find by artist name, handles the case where 'Artist' and 'The Artist' are regarded as the same artist depending on how pretentious you are. | def search(cls, criteria=None):
qry = cls.query()
if criteria:
qry = qry.filter(or_(
FileRecord.artist.like(u"%s" % criteria),
FileRecord.artist.like(u"The %s" % criteria)))
results = []
for result in qry.all():
results.append(cl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_for_artist(name):\n\ttoken = get_token()\n\tif token:\n\t\theaders = {\"Content-Type\": \"application/json\", \"Authorization\": \"Bearer \" + token}\n\t\toptions = {\n\t\t\t'q': name, 'type': 'artist', 'limit': '1'\n\t\t}\n\n\t\tresponse = requests.get(\n\t\t\t'https://api.spotify.com/v1/search',\n\t\t... | [
"0.77721673",
"0.76879257",
"0.74840313",
"0.7447461",
"0.72898066",
"0.727154",
"0.6736797",
"0.6704865",
"0.6698834",
"0.66909367",
"0.66591674",
"0.6658803",
"0.6572951",
"0.6503963",
"0.64872855",
"0.6482738",
"0.64690715",
"0.6454616",
"0.6439652",
"0.6405999",
"0.639022... | 0.0 | -1 |
Test if a character is always masked by quote characters >>> masked_by_quotechar('A"B&C"A', '"', '', '&') True >>> masked_by_quotechar('A"B&C"A&A', '"', '', '&') False >>> masked_by_quotechar('A|"B&C"A', '"', '|', '&') False >>> masked_by_quotechar('A"B"C', '"', '', '') False | def masked_by_quotechar(S, quotechar, escapechar, test_char):
if test_char == "":
return False
escape_next = False
in_quotes = False
i = 0
while i < len(S):
s = S[i]
if s == quotechar:
if escape_next:
i += 1
continue
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __is_quote(cls, char):\n return char in (\"'\", '\"')",
"def is_allowed_char(ch):\n\treturn ch.isalnum() or ch in \"#.>+*:$-_!@\"",
"def is_apostrophe(ch):\n if (ch == '\\'' or ch == '\\u2019' or ch == '\\u02bc'): return True\n return False",
"def _requires_quotes(self, value):\n lc_v... | [
"0.698272",
"0.6315679",
"0.6016935",
"0.5880996",
"0.5829546",
"0.5797558",
"0.5777645",
"0.5770634",
"0.57601047",
"0.57381916",
"0.5719019",
"0.56738186",
"0.5646707",
"0.5633362",
"0.5607075",
"0.5601769",
"0.55907553",
"0.55570906",
"0.5532519",
"0.55187666",
"0.5492497"... | 0.7905155 | 0 |
Returns the residual for the given measurement (z). Does not alter the state of the filter. | def residual_of(self, z):
return np.subtract(z, self.HJacob(self.x)@self.x_prior) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def residual_of(self, z):\n raise \"Not implemented yet\"\n return z - dot(self._H, self._x)",
"def residual(us):\n return self.h_S(z0, us) - h_P",
"def residuals(x, z=None, max_time=np.inf):\n if z is None:\n return x\n n_samples = x.shape[0]\n residuals = np.zeros_lik... | [
"0.81050634",
"0.7359329",
"0.68362373",
"0.61846864",
"0.5905667",
"0.584297",
"0.57898045",
"0.5666996",
"0.56548804",
"0.5650321",
"0.5620207",
"0.557072",
"0.55695504",
"0.5561623",
"0.552926",
"0.5510087",
"0.5488305",
"0.5481774",
"0.54516584",
"0.5401915",
"0.5395614",... | 0.7544876 | 1 |
Load instance masks for the given image. Different datasets use different ways to store masks. This function converts the different mask format to one format in the form of a bitmap [height, width, instances]. | def load_mask(self, image_id):
# TODO: build dict **self.image_info** in this form
# self.image_info.keys() = ['objects', 'imgWidth', 'imgHeight']
# objects is a list which contains label and polygon (same as annotations form below)
# imgHeight and imgWidth are numbers (usually 1024, 204... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_mask(self, image_id):\n info = self.image_info[image_id]\n # Get mask directory from image path\n mask_dir = os.path.join(os.path.dirname(os.path.dirname(info['path'])), \"masks\")\n\n # Read mask files from .png image\n mask = []\n # for f in next(os.walk(mask_di... | [
"0.75810945",
"0.7571226",
"0.74643034",
"0.745006",
"0.7399186",
"0.7394673",
"0.7331872",
"0.72806925",
"0.72679096",
"0.7246814",
"0.72276896",
"0.71930295",
"0.71721375",
"0.7096463",
"0.7043556",
"0.69916236",
"0.68893343",
"0.68865323",
"0.68803877",
"0.6802019",
"0.678... | 0.7389704 | 6 |
Wrapper that returns elastic parameters for the various Earth models provided below. rho, A, C, F, L, N = models(r, model) Everything in SI units, i.e. radius in m | def models(r, model):
if model=="PREM":
return model_prem(r)
elif model=="PREM_iso":
return model_prem_iso(r)
elif model=="ONELAYER":
return model_onelayer(r)
elif model=="ONELAYER_pert":
return model_onelayer_pert(r)
elif model=="GUTENBERG":
return model_gutenberg(r) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def model_onelayer(r):\n\n\t#- march through the various depth levels -----------------------------------------------------\n\n\tif (r > 6361000.0):\n\t\trho = 2.7\n\t\tvpv = 5.8\n\t\tvph = vpv\n\t\tvsv = 2.0\n\t\tvsh = vsv\n\t\teta = 1.0\n\n\telse:\n\t\trho = 3.1\n\t\tvpv = 7.8\n\t\tvph = vpv\n\t\tvsv = 3.0\n\t\t... | [
"0.6277009",
"0.60373896",
"0.5926237",
"0.5879212",
"0.58611995",
"0.58251417",
"0.5607757",
"0.5605041",
"0.5585019",
"0.546262",
"0.5457621",
"0.5446322",
"0.5433811",
"0.5427902",
"0.5419761",
"0.5418256",
"0.54150933",
"0.53973573",
"0.5372657",
"0.53724986",
"0.5367674"... | 0.0 | -1 |
Returns the to/target node of the edge. | def getToNode(self):
return self.to_node | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def target(self) -> Node:\r\n return self._target",
"def _targetof(node):\r\n if node is None: return None\r\n return node.target",
"def get_edge(self, from_, to):\n pass",
"def get_edge(self, source: Node, target: Node) -> Optional[Edge]:\r\n return self.get_edge_by_index(source.i... | [
"0.7189749",
"0.7140672",
"0.6578508",
"0.6506723",
"0.6502358",
"0.64421606",
"0.64421606",
"0.6438283",
"0.6352479",
"0.6311121",
"0.63088334",
"0.6288965",
"0.6267955",
"0.62494516",
"0.6230648",
"0.62167996",
"0.62167996",
"0.62063813",
"0.6165733",
"0.6161592",
"0.613263... | 0.7667334 | 0 |
Returns the to/target node of the edge. | def getFromNode(self):
return self.from_node | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getToNode(self):\n return self.to_node",
"def target(self) -> Node:\r\n return self._target",
"def _targetof(node):\r\n if node is None: return None\r\n return node.target",
"def get_edge(self, from_, to):\n pass",
"def get_edge(self, source: Node, target: Node) -> Optional[E... | [
"0.7667334",
"0.7189749",
"0.7140672",
"0.6578508",
"0.6506723",
"0.6502358",
"0.64421606",
"0.64421606",
"0.6438283",
"0.6352479",
"0.6311121",
"0.63088334",
"0.6288965",
"0.6267955",
"0.62494516",
"0.6230648",
"0.62167996",
"0.62167996",
"0.62063813",
"0.6165733",
"0.616159... | 0.6055727 | 25 |
Loads a graph from an YAML file. | def readGraphFromYAMLFile(self, filename):
self.G = nx.read_yaml(filename)
# TODO: buiild up the indexes !!! | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_taskgraph(filename):\n\n with open(filename) as f:\n yaml = ruamel.yaml.YAML(typ='safe')\n yaml.constructor.yaml_constructors[\n u'tag:yaml.org,2002:timestamp'] = \\\n yaml.constructor.yaml_constructors[u'tag:yaml.org,2002:str']\n obj =... | [
"0.7126366",
"0.7037721",
"0.70128274",
"0.69399786",
"0.6938876",
"0.6938876",
"0.67783594",
"0.6554469",
"0.6497626",
"0.6484761",
"0.6466152",
"0.63907164",
"0.63731444",
"0.6357152",
"0.6354666",
"0.63339",
"0.6332298",
"0.63299507",
"0.6328987",
"0.6325156",
"0.63095266"... | 0.7951714 | 0 |
Remove a dict and all of its pairs | def drem(self, name):
return self.rem(name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def task_2_remove_dict_fields(data: DT, redundant_keys: List[str]) -> DT:\n dict2 = copy.deepcopy(data)\n for item in dict2:\n for key in redundant_keys:\n item.pop(key)\n return dict2",
"def CleanUpDict(dct):\n SanityCheck.ValidateTypes(((dct, dict),))\n\n new_dct = {}\n for key in... | [
"0.74274445",
"0.7242386",
"0.7116767",
"0.6992244",
"0.69630325",
"0.6884586",
"0.68669134",
"0.6835962",
"0.68300647",
"0.6817015",
"0.68011045",
"0.66947067",
"0.66867733",
"0.6647744",
"0.66353726",
"0.661644",
"0.6591351",
"0.6561211",
"0.65455675",
"0.6535431",
"0.65320... | 0.0 | -1 |
takes a list of buttons and makes a keyboard markup with n columns out of it | def build_menu(buttons,
n_cols,
header_buttons=None,
footer_buttons=None):
menu = [buttons[i:i + n_cols] for i in range(0, len(buttons), n_cols)]
if header_buttons:
menu.insert(0, [header_buttons])
if footer_buttons:
menu.append([footer_buttons])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_button(letters):\r\n global button_lst\r\n for i in range(16):\r\n row = i // 4\r\n column = i % 4\r\n button_1 = tk.Button(button_frame, text=letters[row][column],\r\n bg='white')\r\n button_1.place(relheight=0.25, relwidth=0.25, relx=(i %... | [
"0.6601814",
"0.651146",
"0.64604795",
"0.63535744",
"0.6331423",
"0.63180315",
"0.628489",
"0.6252942",
"0.61459744",
"0.60867506",
"0.60817647",
"0.6078499",
"0.6037204",
"0.5955517",
"0.59541655",
"0.58235174",
"0.5799365",
"0.5792171",
"0.5785325",
"0.5646041",
"0.5604982... | 0.64422405 | 3 |
Scale data with zero mean and unit variance. | def scale_data(x):
mu = x.mean(axis=0)
sigma = x.std(axis=0)
x = (x - mu) / sigma
return (x, mu, sigma) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scale_data(self, data):\n return (data - self.mean)/self.std",
"def unscale_data(self, data):\n return (data + self.mean)*self.std",
"def test_set_scale():\n data = io.create_sample_Dataset()\n tmp = data.piv.set_scale(1.0)\n assert np.allclose(tmp[\"x\"], data[\"x\"])\n\n tmp = d... | [
"0.7523405",
"0.7250864",
"0.7234231",
"0.6947155",
"0.6926661",
"0.68744195",
"0.68697506",
"0.68697506",
"0.6853649",
"0.68116",
"0.67715436",
"0.6705842",
"0.6703061",
"0.658396",
"0.6559544",
"0.65550596",
"0.65380085",
"0.6503565",
"0.6489532",
"0.6464284",
"0.64523405",... | 0.6928446 | 4 |
Does "nice" formatting of floatingpoint numbers. numlabels is ignored in this method. | def format(self, ticks, numlabels=None, char_width=None, fill_ratio=0.3):
if len(ticks) == 0:
return []
ticks = asarray(ticks)
if self.use_scientific:
scientific = (((ticks % 10 ** self.scientific_limits[1]) == 0) |
(abs(ticks) <= 10 ** self.sci... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def oldformat(self, ticks, numlabels=None, char_width=None):\n labels = []\n if len(ticks) == 0:\n return []\n\n d = abs(ticks[-1] - ticks[0])\n for x in ticks:\n if abs(x)<1e4 and x==int(x):\n labels.append('%d' % x)\n continue\n\n ... | [
"0.6925162",
"0.68380547",
"0.6832076",
"0.6591992",
"0.63700604",
"0.6086992",
"0.60497206",
"0.60012174",
"0.5973584",
"0.59700036",
"0.5923976",
"0.5923976",
"0.5918933",
"0.5912674",
"0.58350873",
"0.583176",
"0.5754841",
"0.5752752",
"0.57449657",
"0.5716037",
"0.5709455... | 0.56387734 | 29 |
Round to the nearest Jan 1, roughly. | def _two_digit_year(t):
dt = safe_fromtimestamp(t)
year = dt.year
if dt.month >= 7:
year += 1
return "'%02d" % (year % 100) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ceil_start_month(date):\n if date.month == 12:\n date = datetime(date.year + 1, 1, 1)\n else:\n date = datetime(date.year, date.month + 1, 1)\n return date",
"def to_fixed(self):\n approx = OldHindu.EPOCH - 3 + ifloor(((self.year + HinduSolarDate.SOLAR_ERA) + ((self.month - 1) /... | [
"0.6047534",
"0.57934874",
"0.57694274",
"0.56214935",
"0.5447763",
"0.5416792",
"0.53937256",
"0.5329499",
"0.5310919",
"0.5264666",
"0.5255814",
"0.52463686",
"0.52463686",
"0.52135396",
"0.5210392",
"0.5205163",
"0.5203973",
"0.5203375",
"0.52000576",
"0.5133203",
"0.51146... | 0.0 | -1 |
Round to the nearest Jan 1, roughly. | def _four_digit_year(t):
dt = safe_fromtimestamp(t)
year = dt.year
if dt.month >= 7:
year += 1
return str(year) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ceil_start_month(date):\n if date.month == 12:\n date = datetime(date.year + 1, 1, 1)\n else:\n date = datetime(date.year, date.month + 1, 1)\n return date",
"def to_fixed(self):\n approx = OldHindu.EPOCH - 3 + ifloor(((self.year + HinduSolarDate.SOLAR_ERA) + ((self.month - 1) /... | [
"0.6047534",
"0.57934874",
"0.57694274",
"0.56214935",
"0.5447763",
"0.5416792",
"0.53937256",
"0.5329499",
"0.5310919",
"0.5264666",
"0.5255814",
"0.52463686",
"0.52463686",
"0.52135396",
"0.5210392",
"0.5205163",
"0.5203973",
"0.5203375",
"0.52000576",
"0.5133203",
"0.51146... | 0.0 | -1 |
Call a Method thats not Allowed | def test_method_not_allowed(self):
resp = self.app.post('/inventories/0')
self.assertEqual(resp.status_code, status.HTTP_405_METHOD_NOT_ALLOWED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def http_method_not_allowed(self, *args, **kwargs):\n\t\treturn self.abort(status.HTTP_405_METHOD_NOT_ALLOWED)",
"def _call_method(self, call, method):\n raise Exception(\"_call_method must be implemented by subclasses.\")",
"def _create_method_not_allowed(self):\n body = self.server.create_error... | [
"0.71572983",
"0.70552915",
"0.6974696",
"0.6946565",
"0.68651634",
"0.6722294",
"0.661599",
"0.6606388",
"0.65820783",
"0.6574595",
"0.6542057",
"0.6532796",
"0.6521045",
"0.6495997",
"0.64835817",
"0.6476692",
"0.6452625",
"0.64513665",
"0.64501095",
"0.6437827",
"0.6399624... | 0.658347 | 8 |
Tokenize the text using nltk. | def tokenize(text):
text = text.decode('utf-8')
return nltk.word_tokenize(text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tokenize_text(text):\n return nltk.tokenize.word_tokenize(text)",
"def tokenize(raw_text):\n tokenized_text = nltk.tokenize.word_tokenize(raw_text)\n return tokenized_text",
"def tokenize(text):\n tokens=word_tokenize(text)\n lemmatizer=WordNetLemmatizer()\n \n clean_tokens=[]\n fo... | [
"0.7924332",
"0.7722084",
"0.77198863",
"0.77132255",
"0.77132255",
"0.76855266",
"0.7666423",
"0.75866884",
"0.75648314",
"0.754807",
"0.7524781",
"0.7512556",
"0.75125384",
"0.7507399",
"0.749771",
"0.74714035",
"0.7467465",
"0.7443582",
"0.7434844",
"0.7426343",
"0.7402768... | 0.7564946 | 8 |
Get the path of the Firefox executable If the path could not be found, returns None. You may still be able to launch using "firefox" though. | def get_firefox_exe():
paths = []
# Collect possible locations
if sys.platform.startswith('win'):
for basepath in ('C:\\Program Files\\', 'C:\\Program Files (x86)\\'):
paths.append(basepath + 'Mozilla Firefox\\firefox.exe')
paths.append(basepath + 'Mozilla\\Firefox\\firefox.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _firefox_path():\n return _application_path('firefox.exe')",
"def _get_geckodriver_filename() -> str:\n if _PLATFORM == \"win\":\n return \"geckodriver.exe\"\n return \"geckodriver\"",
"def executable():\n return sys.executable",
"def test_firefox_installed(host):\n ff_bin_location ... | [
"0.84510803",
"0.66495526",
"0.6335337",
"0.6283611",
"0.6259588",
"0.6171719",
"0.6019932",
"0.6004209",
"0.5995697",
"0.5939878",
"0.59328544",
"0.59182626",
"0.5883824",
"0.5867426",
"0.5854916",
"0.58463",
"0.5845628",
"0.58404523",
"0.5801765",
"0.5791208",
"0.578199",
... | 0.86398923 | 0 |
Attempt to find the HTTPS port that the SpotifyWebHelper process is listening on. If SpotifyWebHelper.exe is not running, this function will atempt to find the listening port for Spotify.exe as a backup. If neither process is running, exceptions.SpotifyNotRunningError will be raised. Otherwise it will return the port n... | def find_listening_port():
# Find all Spotify processes with at least one active connection
spotify_processes = (seq(psutil.process_iter())
.filter(lambda proc: proc.name() in SPOTIFY_PROCESSES and any(proc.connections()))
)
if not spotify_processes:
raise exceptions.SpotifyNotRunningEr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_port_number():\n try:\n return os.environ[\"PORT\"]\n except Exception:\n return None",
"def get_port():\n return int(os.getenv(\"PORT\", \"7840\"))",
"def get_safe_port():\n sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n sock.bind((LOCALHOST, 0))\n port = so... | [
"0.69016117",
"0.6486438",
"0.6388321",
"0.63662523",
"0.6344648",
"0.63297665",
"0.6259112",
"0.6259112",
"0.6259112",
"0.6259112",
"0.6259112",
"0.6259112",
"0.6259112",
"0.6251584",
"0.62121207",
"0.62039816",
"0.6198789",
"0.6175413",
"0.6165449",
"0.61642694",
"0.6105819... | 0.8198774 | 0 |
Find the date in a list closest to the target date. An optional parameter can be given to get the closest before or after. | def _closest_date(target_dt, date_list, before_target=None) -> datetime.date | None:
def time_before(d):
return target_dt - d if d <= target_dt else datetime.timedelta.max
def time_after(d):
return d - target_dt if d >= target_dt else datetime.timedelta.max
def any_time(d):
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _nearest_datetime(self, datetime_list, target_datetime):\n if not datetime_list:\n raise errors.ParserError(\n \"Input parameter datetime_list length is zero. Required\"\n \" parameters: [datetime.datetime], datetime.datetime\")\n work_list = [entry for entry in datetime_list if en... | [
"0.72085893",
"0.63554364",
"0.628993",
"0.6210695",
"0.6156246",
"0.6092507",
"0.60609597",
"0.60306764",
"0.59612817",
"0.5948118",
"0.59275585",
"0.577997",
"0.57212955",
"0.5694975",
"0.5687013",
"0.55450505",
"0.55448663",
"0.5534926",
"0.5509934",
"0.5509463",
"0.547866... | 0.8190658 | 0 |
Find the date in a list closest to the target date. An optional parameter can be given to get the closest before or after. | def closest_ds_partition(
table, ds, before=True, schema="default", metastore_conn_id="metastore_default"
) -> str | None:
from airflow.providers.apache.hive.hooks.hive import HiveMetastoreHook
if "." in table:
schema, table = table.split(".")
hive_hook = HiveMetastoreHook(metastore_conn_id=met... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _closest_date(target_dt, date_list, before_target=None) -> datetime.date | None:\n\n def time_before(d):\n return target_dt - d if d <= target_dt else datetime.timedelta.max\n\n def time_after(d):\n return d - target_dt if d >= target_dt else datetime.timedelta.max\n\n def any_time(d):\n... | [
"0.8191049",
"0.7209887",
"0.63533384",
"0.6287586",
"0.6208891",
"0.6155656",
"0.60936",
"0.60584646",
"0.60291505",
"0.59635377",
"0.59474826",
"0.59297013",
"0.5778673",
"0.57200503",
"0.5693366",
"0.5687823",
"0.5545757",
"0.55443114",
"0.553393",
"0.55108136",
"0.5508875... | 0.0 | -1 |
The pipeline duration in seconds | def build_seconds_used(self):
return self.get_data("build_seconds_used") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def duration(self):\n pass",
"def duration(self):\n pass",
"def duration(self) -> int:\n return 0",
"def duration():\r\n elapsed_time, duration = video_time()\r\n return duration",
"def get_time_elapsed(self, pipeline_run):\n begin = pipeline_run[\"steps\"][0][\"method_cal... | [
"0.74728346",
"0.74728346",
"0.71983963",
"0.71104527",
"0.69561285",
"0.6911451",
"0.688739",
"0.6863187",
"0.68466765",
"0.68374306",
"0.681891",
"0.6726202",
"0.6726202",
"0.6712315",
"0.6685252",
"0.66836315",
"0.66836315",
"0.66836315",
"0.66836315",
"0.66836315",
"0.668... | 0.5980724 | 93 |
The step end time | def completed_on(self):
return self.get_time("completed_on") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_time(self) -> float:\r\n ...",
"def end_time(self):\n pass",
"def time_step(self):\n return self._time_step",
"def endTime(self) -> float:\n try: return self.times[-1]\n except IndexError: return 0.0",
"def timeStep(self):\n return self.params['h']",
"def... | [
"0.8219832",
"0.7663077",
"0.7586827",
"0.7573523",
"0.75639564",
"0.7490077",
"0.7386538",
"0.7364562",
"0.73617476",
"0.72591186",
"0.7254211",
"0.7254211",
"0.7254211",
"0.7254211",
"0.7254211",
"0.7254211",
"0.7243668",
"0.72239906",
"0.71868944",
"0.7184041",
"0.71834946... | 0.0 | -1 |
Computes IOU (Intersection Over Union) between two bounding boxes in the form [x1,y1,x2,y2] | def iou(bb_det, bb_trk):
xx1 = np.maximum(bb_det[0], bb_trk[0])
xx2 = np.minimum(bb_det[2], bb_trk[2])
w = np.maximum(0., xx2 - xx1)
if w == 0:
return 0
yy1 = np.maximum(bb_det[1], bb_trk[1])
yy2 = np.minimum(bb_det[3], bb_trk[3])
h = np.maximum(0., yy2 - yy1)
if h == 0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_iou(box, boxes):\n\n x_min_A, y_min_A, x_max_A, y_max_A = box[:4]\n x_min_B, y_min_B = boxes[:, 0], boxes[:, 1]\n x_max_B, y_max_B = boxes[:, 2], boxes[:, 3]\n # calculating the intersection\n inner_x_min = np.maximum(x_min_B, x_min_A)\n inner_y_min = np.maximum(y_min_B, y_min_A)\n ... | [
"0.82381094",
"0.8211735",
"0.82104224",
"0.8203365",
"0.8166946",
"0.8157483",
"0.8125503",
"0.80584586",
"0.79902273",
"0.7988257",
"0.7984452",
"0.7979674",
"0.79787046",
"0.79787046",
"0.797833",
"0.7952294",
"0.7950211",
"0.79182243",
"0.79117113",
"0.78883916",
"0.78631... | 0.0 | -1 |
The Bucket where the actual secrets/credentials will be kept. | def secrets_bucket(self):
return self.s3.get_bucket(self.secrets_bucket_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bucket(self):\n if not hasattr(self, '_bucket'):\n self._bucket = self.s3.get_bucket(self.bucket_name)\n return self._bucket",
"def bucket(self):\n if not hasattr(self, \"_bucket\"):\n self._bucket = self._get_or_create_bucket(self.bucket_name)\n return self.... | [
"0.77135056",
"0.76443577",
"0.7636842",
"0.7571006",
"0.75357956",
"0.7445017",
"0.7367007",
"0.73658645",
"0.73658645",
"0.73349637",
"0.73349637",
"0.73349637",
"0.73349637",
"0.73349637",
"0.7309404",
"0.7309404",
"0.7301199",
"0.7236666",
"0.6886479",
"0.68732756",
"0.68... | 0.83080566 | 0 |
The name of the bucket where secrets/credentials will be kept. | def secrets_bucket_name(self):
return self.config.secrets_bucket | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bucket_name(self) -> str:\n return pulumi.get(self, \"bucket_name\")",
"def bucket_name(self) -> str:\n return jsii.get(self, \"bucketName\")",
"def bucket_name(self) -> str:\n return jsii.get(self, \"bucketName\")",
"def bucket_name(self) -> str:\n ...",
"def bucket_name(se... | [
"0.80566627",
"0.789448",
"0.789448",
"0.78934604",
"0.7876609",
"0.7751307",
"0.7751307",
"0.7751307",
"0.7751307",
"0.7751307",
"0.7641039",
"0.76218647",
"0.7599976",
"0.7599976",
"0.7599976",
"0.7599976",
"0.7599976",
"0.7599976",
"0.7599976",
"0.7599976",
"0.7599976",
... | 0.84540105 | 0 |
The Bucket where the encryption keys will be kept. | def keys_bucket(self):
return self.s3.get_bucket(self.keys_bucket_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bucket(self):\n return self._bucket",
"def bucket(self):\n if not hasattr(self, \"_bucket\"):\n self._bucket = self._get_or_create_bucket(self.bucket_name)\n return self._bucket",
"def bucket(self):\n if not hasattr(self, '_bucket'):\n self._bucket = self.s... | [
"0.76203406",
"0.7575642",
"0.7518674",
"0.74899244",
"0.74741405",
"0.7470684",
"0.74408776",
"0.7411322",
"0.73369485",
"0.73369485",
"0.733551",
"0.733551",
"0.733551",
"0.733551",
"0.733551",
"0.7249835",
"0.72284377",
"0.72284377",
"0.716479",
"0.71576345",
"0.69921356",... | 0.77463233 | 0 |
The _name of the bucket where the encryption keys will be kept. | def keys_bucket_name(self):
return self.config.keys_bucket | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bucket_name(self) -> str:\n ...",
"def bucket_name(self) -> str:\n return pulumi.get(self, \"bucket_name\")",
"def bucket_name(self) -> str:\n return jsii.get(self, \"bucketName\")",
"def bucket_name(self) -> str:\n return jsii.get(self, \"bucketName\")",
"def bucket_name(se... | [
"0.83780956",
"0.8012532",
"0.79730797",
"0.79730797",
"0.78511673",
"0.76933426",
"0.76933426",
"0.76933426",
"0.76933426",
"0.76933426",
"0.75405216",
"0.74383736",
"0.74383736",
"0.74383736",
"0.74383736",
"0.74383736",
"0.74383736",
"0.74383736",
"0.74383736",
"0.74383736",... | 0.7992886 | 2 |
return the hamming distance between two vectors x and y. | def hamming(x, y):
# The implem is 'symbolic', meaning that vectors can be coded not with just
# zeros and ones, but with anything at all.
# hamming([0, 1], [0, 1]) = 0 + 0
# hamming([0, 1], [0, 2]) = 0 + 1
# hamming([0, 1], [0, 5]) = 0 + 1
# This is usefull for the monk2 dataset for ex., where... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance(self, x, y):\n\n return distance.hamming(x, y)",
"def hammingDist(x, y):\n hd = 0\n for ch1, ch2 in zip(x, y):\n if ch1 != ch2:\n hd += 1\n return hd",
"def hellinger_distance(x, y):\n assert (x.dtype == np.float64 and y.dtype == np.float64) or (\n x.dty... | [
"0.82139295",
"0.79980195",
"0.7569855",
"0.7542742",
"0.7313097",
"0.7280396",
"0.7262405",
"0.7217327",
"0.70986986",
"0.7042906",
"0.7041838",
"0.6986864",
"0.69795406",
"0.6977791",
"0.69458824",
"0.69034505",
"0.68966454",
"0.6849831",
"0.68460613",
"0.6843089",
"0.68311... | 0.72002816 | 8 |
Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. byteorder The byte order used to rep... | def from_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)",
"def bytes_to_int(byte_array, big_endian=True, signed=False):\n if six.PY3:\n order = 'little'\n if big_endian:\n order = 'big'\n return int.from_byt... | [
"0.76516354",
"0.76189303",
"0.70857483",
"0.7002604",
"0.6829388",
"0.6733379",
"0.6615719",
"0.66090757",
"0.6564178",
"0.6559681",
"0.65326977",
"0.6528074",
"0.64677227",
"0.63955",
"0.6329495",
"0.61789596",
"0.61577725",
"0.61080104",
"0.6077882",
"0.6036822",
"0.596371... | 0.0 | -1 |
Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte ... | def to_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)",
"def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ... | [
"0.7394093",
"0.64829594",
"0.6452316",
"0.63511336",
"0.6289732",
"0.62400556",
"0.61796063",
"0.6171117",
"0.6158413",
"0.6147844",
"0.6110905",
"0.5770546",
"0.57657367",
"0.5683442",
"0.5681397",
"0.5662447",
"0.56502986",
"0.55438304",
"0.5539375",
"0.5531966",
"0.553095... | 0.0 | -1 |
Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. byteorder The byte order used to rep... | def from_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)",
"def bytes_to_int(byte_array, big_endian=True, signed=False):\n if six.PY3:\n order = 'little'\n if big_endian:\n order = 'big'\n return int.from_byt... | [
"0.765123",
"0.7617635",
"0.70881665",
"0.70046175",
"0.6829069",
"0.6732588",
"0.661696",
"0.66092545",
"0.65656394",
"0.65603185",
"0.6534007",
"0.65298843",
"0.64680517",
"0.6394148",
"0.6330669",
"0.61798865",
"0.61589193",
"0.61086076",
"0.6078745",
"0.60366607",
"0.5963... | 0.0 | -1 |
Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte ... | def to_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)",
"def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ... | [
"0.739455",
"0.64817655",
"0.64522445",
"0.6351074",
"0.6289548",
"0.62403125",
"0.6179839",
"0.6170469",
"0.61575294",
"0.61462665",
"0.6111587",
"0.57706845",
"0.5765351",
"0.56842935",
"0.5683242",
"0.5662891",
"0.56505936",
"0.55446386",
"0.55395013",
"0.5532264",
"0.5532... | 0.0 | -1 |
Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. byteorder The byte order used to rep... | def from_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)",
"def bytes_to_int(byte_array, big_endian=True, signed=False):\n if six.PY3:\n order = 'little'\n if big_endian:\n order = 'big'\n return int.from_byt... | [
"0.7650732",
"0.7616687",
"0.7087043",
"0.7003013",
"0.6828052",
"0.6731873",
"0.6615405",
"0.6607667",
"0.65643954",
"0.65604615",
"0.65333414",
"0.65284014",
"0.6467056",
"0.6394117",
"0.6330589",
"0.6179297",
"0.6157716",
"0.610665",
"0.60766137",
"0.6036042",
"0.5961824",... | 0.0 | -1 |
Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte ... | def to_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)",
"def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ... | [
"0.7394093",
"0.64829594",
"0.6452316",
"0.63511336",
"0.6289732",
"0.62400556",
"0.61796063",
"0.6171117",
"0.6158413",
"0.6147844",
"0.6110905",
"0.5770546",
"0.57657367",
"0.5683442",
"0.5681397",
"0.5662447",
"0.56502986",
"0.55438304",
"0.5539375",
"0.5531966",
"0.553095... | 0.0 | -1 |
Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. byteorder The byte order used to rep... | def from_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)",
"def bytes_to_int(byte_array, big_endian=True, signed=False):\n if six.PY3:\n order = 'little'\n if big_endian:\n order = 'big'\n return int.from_byt... | [
"0.765123",
"0.7617635",
"0.70881665",
"0.70046175",
"0.6829069",
"0.6732588",
"0.661696",
"0.66092545",
"0.65656394",
"0.65603185",
"0.6534007",
"0.65298843",
"0.64680517",
"0.6394148",
"0.6330669",
"0.61798865",
"0.61589193",
"0.61086076",
"0.6078745",
"0.60366607",
"0.5963... | 0.0 | -1 |
Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte ... | def to_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)",
"def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ... | [
"0.7394184",
"0.64822793",
"0.6450739",
"0.6351877",
"0.6289915",
"0.6240933",
"0.6178487",
"0.61694837",
"0.6156758",
"0.61455405",
"0.6111802",
"0.5770274",
"0.576569",
"0.56839347",
"0.56819427",
"0.5661651",
"0.56510377",
"0.55452347",
"0.55390286",
"0.553172",
"0.5531115... | 0.0 | -1 |
Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. byteorder The byte order used to rep... | def from_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)",
"def bytes_to_int(byte_array, big_endian=True, signed=False):\n if six.PY3:\n order = 'little'\n if big_endian:\n order = 'big'\n return int.from_byt... | [
"0.765123",
"0.7617635",
"0.70881665",
"0.70046175",
"0.6829069",
"0.6732588",
"0.661696",
"0.66092545",
"0.65656394",
"0.65603185",
"0.6534007",
"0.65298843",
"0.64680517",
"0.6394148",
"0.6330669",
"0.61798865",
"0.61589193",
"0.61086076",
"0.6078745",
"0.60366607",
"0.5963... | 0.0 | -1 |
Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte ... | def to_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)",
"def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ... | [
"0.7394184",
"0.64822793",
"0.6450739",
"0.6351877",
"0.6289915",
"0.6240933",
"0.6178487",
"0.61694837",
"0.6156758",
"0.61455405",
"0.6111802",
"0.5770274",
"0.576569",
"0.56839347",
"0.56819427",
"0.5661651",
"0.56510377",
"0.55452347",
"0.55390286",
"0.553172",
"0.5531115... | 0.0 | -1 |
Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. byteorder The byte order used to rep... | def from_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)",
"def bytes_to_int(byte_array, big_endian=True, signed=False):\n if six.PY3:\n order = 'little'\n if big_endian:\n order = 'big'\n return int.from_byt... | [
"0.76516354",
"0.76189303",
"0.70857483",
"0.7002604",
"0.6829388",
"0.6733379",
"0.6615719",
"0.66090757",
"0.6564178",
"0.6559681",
"0.65326977",
"0.6528074",
"0.64677227",
"0.63955",
"0.6329495",
"0.61789596",
"0.61577725",
"0.61080104",
"0.6077882",
"0.6036822",
"0.596371... | 0.0 | -1 |
Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte ... | def to_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)",
"def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ... | [
"0.7394093",
"0.64829594",
"0.6452316",
"0.63511336",
"0.6289732",
"0.62400556",
"0.61796063",
"0.6171117",
"0.6158413",
"0.6147844",
"0.6110905",
"0.5770546",
"0.57657367",
"0.5683442",
"0.5681397",
"0.5662447",
"0.56502986",
"0.55438304",
"0.5539375",
"0.5531966",
"0.553095... | 0.0 | -1 |
Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. byteorder The byte order used to rep... | def from_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)",
"def bytes_to_int(byte_array, big_endian=True, signed=False):\n if six.PY3:\n order = 'little'\n if big_endian:\n order = 'big'\n return int.from_byt... | [
"0.7650732",
"0.7616687",
"0.7087043",
"0.7003013",
"0.6828052",
"0.6731873",
"0.6615405",
"0.6607667",
"0.65643954",
"0.65604615",
"0.65333414",
"0.65284014",
"0.6467056",
"0.6394117",
"0.6330589",
"0.6179297",
"0.6157716",
"0.610665",
"0.60766137",
"0.6036042",
"0.5961824",... | 0.0 | -1 |
Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte ... | def to_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)",
"def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ... | [
"0.7394093",
"0.64829594",
"0.6452316",
"0.63511336",
"0.6289732",
"0.62400556",
"0.61796063",
"0.6171117",
"0.6158413",
"0.6147844",
"0.6110905",
"0.5770546",
"0.57657367",
"0.5683442",
"0.5681397",
"0.5662447",
"0.56502986",
"0.55438304",
"0.5539375",
"0.5531966",
"0.553095... | 0.0 | -1 |
get_current_container_name(self) > str or None | def get_current_container_name(self): # real signature unknown; restored from __doc__
return "" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_container_name(self) -> str:\n dirname = os.path.basename(os.getcwd())\n default_container_name = f\"{dirname}_{self.config_name}\"\n container_name = self.config_options.get(\"container_name\", default_container_name)\n return container_name",
"def container_name(self):\n ... | [
"0.7808543",
"0.77778274",
"0.77698684",
"0.7382756",
"0.7382756",
"0.738186",
"0.7216654",
"0.72074115",
"0.71749175",
"0.7129519",
"0.71137106",
"0.7048898",
"0.69866395",
"0.68240124",
"0.68028235",
"0.67439055",
"0.6740383",
"0.6733521",
"0.6597061",
"0.65578914",
"0.6467... | 0.9249755 | 0 |
Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. byteorder The byte order used to rep... | def from_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)",
"def bytes_to_int(byte_array, big_endian=True, signed=False):\n if six.PY3:\n order = 'little'\n if big_endian:\n order = 'big'\n return int.from_byt... | [
"0.765123",
"0.7617635",
"0.70881665",
"0.70046175",
"0.6829069",
"0.6732588",
"0.661696",
"0.66092545",
"0.65656394",
"0.65603185",
"0.6534007",
"0.65298843",
"0.64680517",
"0.6394148",
"0.6330669",
"0.61798865",
"0.61589193",
"0.61086076",
"0.6078745",
"0.60366607",
"0.5963... | 0.0 | -1 |
Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte ... | def to_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)",
"def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ... | [
"0.739455",
"0.64817655",
"0.64522445",
"0.6351074",
"0.6289548",
"0.62403125",
"0.6179839",
"0.6170469",
"0.61575294",
"0.61462665",
"0.6111587",
"0.57706845",
"0.5765351",
"0.56842935",
"0.5683242",
"0.5662891",
"0.56505936",
"0.55446386",
"0.55395013",
"0.5532264",
"0.5532... | 0.0 | -1 |
Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. byteorder The byte order used to rep... | def from_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)",
"def bytes_to_int(byte_array, big_endian=True, signed=False):\n if six.PY3:\n order = 'little'\n if big_endian:\n order = 'big'\n return int.from_byt... | [
"0.7650732",
"0.7616687",
"0.7087043",
"0.7003013",
"0.6828052",
"0.6731873",
"0.6615405",
"0.6607667",
"0.65643954",
"0.65604615",
"0.65333414",
"0.65284014",
"0.6467056",
"0.6394117",
"0.6330589",
"0.6179297",
"0.6157716",
"0.610665",
"0.60766137",
"0.6036042",
"0.5961824",... | 0.0 | -1 |
Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte ... | def to_bytes(self, *args, **kwargs): # real signature unknown
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)",
"def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ... | [
"0.7394093",
"0.64829594",
"0.6452316",
"0.63511336",
"0.6289732",
"0.62400556",
"0.61796063",
"0.6171117",
"0.6158413",
"0.6147844",
"0.6110905",
"0.5770546",
"0.57657367",
"0.5683442",
"0.5681397",
"0.5662447",
"0.56502986",
"0.55438304",
"0.5539375",
"0.5531966",
"0.553095... | 0.0 | -1 |
Result page for finished archery game. Allows redirecting to homepage. | def wyniki():
return render_template('results.html', result=request.args.get('result')) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def homepage():\n return redirect('index.html')",
"def game_home():\n game = current_user.get_active_game()\n if game is None:\n game = current_user.get_last_ended_game()\n if game is None:\n flash('If you want to join a game, click the Join button.')\n return redirec... | [
"0.6734154",
"0.666111",
"0.6565387",
"0.6507193",
"0.64892864",
"0.6454006",
"0.64432096",
"0.6397638",
"0.63834363",
"0.6372787",
"0.63294417",
"0.6329062",
"0.63212544",
"0.63078344",
"0.62933683",
"0.62933683",
"0.62918466",
"0.6277393",
"0.6262391",
"0.625826",
"0.624538... | 0.5849134 | 78 |
Returns the string s, with bold removed. | def stripBold(self, s):
return s.replace('\x02', '') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _remove_bold(text) -> StyledStr:\n return _remove_regex(BOLD_REGEX, text)",
"def bold(self, s):\n return '\\x02%s\\x02' % s",
"def stripFormatting(self, s):\n # stripColor has to go first because of some strings, check the tests.\n s = stripColor(s)\n s = stripBold(s)\n ... | [
"0.77394384",
"0.7142781",
"0.67703974",
"0.6673154",
"0.6659943",
"0.65222937",
"0.6518702",
"0.6255303",
"0.62208617",
"0.618965",
"0.6167462",
"0.60175586",
"0.58389837",
"0.5792279",
"0.5792279",
"0.57773125",
"0.5699481",
"0.5683698",
"0.56784934",
"0.56320107",
"0.56309... | 0.8308 | 0 |
Returns the string s, with reversevideo removed. | def stripReverse(self, s):
return s.replace('\x16', '') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reverse_string(s):\n s.reverse()",
"def reverse(s):\n return s[::-1]",
"def reverse_string(sen):\n return sen[::-1]",
"def reverseString(s):\n return s[::-1]",
"def reverse_string(s):\n return \"\".join(reversed(list(s)))",
"def without_end(s):\n string = s[1:-1]\n return string"... | [
"0.71870315",
"0.68998647",
"0.6813448",
"0.6788196",
"0.676568",
"0.6755511",
"0.67349195",
"0.6707619",
"0.66769004",
"0.6669977",
"0.6665822",
"0.6620884",
"0.65504086",
"0.6530705",
"0.6530114",
"0.6529124",
"0.6390115",
"0.63890994",
"0.6348964",
"0.6335412",
"0.63347965... | 0.72487324 | 0 |
Generates a nonguessable OAuth token OAuth (1 and 2) does not specify the format of tokens except that they should be strings of random characters. Tokens should not be guessable and entropy when generating the random characters is important. Which is why SystemRandom is used instead of the default random.choice method... | def generate_token(length=30, chars=UNICODE_ASCII_CHARACTER_SET):
rand = random.SystemRandom()
return ''.join(rand.choice(chars) for x in range(length)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_token(self):\n token = randint(100000000000000000, 999999999999999999)\n return str(token)",
"def generateToken():\n token_length = random.randint(MIN_TOKEN_LEN, MAX_TOKEN_LEN)\n token = ''.join(random.choice(POSS_TOKEN_CHARS) for _ in range(token_length))\n return tok... | [
"0.7280815",
"0.7210102",
"0.7144751",
"0.7113874",
"0.7085513",
"0.707469",
"0.66978616",
"0.66765684",
"0.66717994",
"0.664714",
"0.6564806",
"0.65511876",
"0.6510805",
"0.6496579",
"0.6145005",
"0.6117187",
"0.61127836",
"0.61082625",
"0.61027896",
"0.6093291",
"0.6089623"... | 0.6792246 | 7 |
Returns torch.utils.data.DataLoader for custom coco dataset. | def get_precomp_loader(data_path, data_split, opt, batch_size=100,
shuffle=True, num_workers=16):
dset = PrecompDataset(data_path, data_split, opt)
data_loader = torch.utils.data.DataLoader(dataset=dset,
batch_size=batch_size,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _custom_data_loader(self) -> DataLoader:\n dataloaders = DataLoader(self.dataset, batch_size=1)\n return dataloaders",
"def get_loader(root, path, vocab_con,transform, batch_size, shuffle, num_workers):\n # COCO caption dataset\n clef = ClefDataset(root=root,\n csv= ... | [
"0.706884",
"0.67343783",
"0.6700204",
"0.6608589",
"0.65977734",
"0.6420919",
"0.6350591",
"0.6312818",
"0.630868",
"0.6241737",
"0.6239535",
"0.6176202",
"0.6158511",
"0.61519736",
"0.6137938",
"0.61256766",
"0.6123274",
"0.6088658",
"0.60801905",
"0.6079132",
"0.6015288",
... | 0.62598914 | 9 |
Given a schedule for a changing parameter (e.g. learning rate) get the values for this parameter at a given time. | def __init__(self, schedule, print_variable_name = None):
if isinstance(schedule, (int, float, np.ndarray)):
schedule = {0: schedule}
if isinstance(schedule, dict):
assert all(isinstance(num, (int, float)) for num in schedule.keys())
self._reverse_sorted_schedule_chec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getValueAt(self, time):\n return self.valueSchedule.getValueAt(time)",
"def mutate(lr_schedule):\n for i in range(2): # mutate two to increase variance\n # Choose a random key.\n idx = randint(0, len(lr_schedule)-1)\n # Mutate one of the params. Will be within (1/10, 10)*Old pa... | [
"0.6394642",
"0.5740354",
"0.5633014",
"0.55989504",
"0.5557058",
"0.5515191",
"0.5465724",
"0.544397",
"0.5375002",
"0.53705853",
"0.53646654",
"0.5347535",
"0.53116643",
"0.5266051",
"0.52514446",
"0.5248687",
"0.5238496",
"0.5198883",
"0.5171145",
"0.51066303",
"0.5080886"... | 0.48662704 | 61 |
Load YAML Convenience function to allow for providing YAML inputs either as filename or as dictionary. | def load_yaml(yaml_config: Union[Dict, str]) -> Dict:
if isinstance(yaml_config, str):
with open(yaml_config) as f:
return yaml.full_load(f)
return yaml_config | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _yaml_load(src):\n if not isinstance(src, str):\n try:\n src_name = src.name\n except AttributeError:\n src_name = '<yaml stringio>'\n # Force-load file streams as that allows the parser to print\n # much more context when it encounters an error\n src... | [
"0.7184081",
"0.7180464",
"0.7026563",
"0.69982475",
"0.6989003",
"0.69419295",
"0.692662",
"0.6906415",
"0.68830526",
"0.68307054",
"0.6828259",
"0.6729709",
"0.67108303",
"0.6709845",
"0.6675494",
"0.66551304",
"0.66472924",
"0.6643919",
"0.6634345",
"0.6626919",
"0.6610958... | 0.7274171 | 0 |
Get a user. Fetches the details of a user. | async def get(self, user_id: str, /) -> Union[r200[UserResponse], r404]:
try:
user = await get_data_from_req(self.request).administrators.get(user_id)
except ResourceNotFoundError:
raise NotFound()
return json_response(user) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, id):\n\t\ttry:\n\t\t\tflask_app.logger.debug('We are getting the user: %d', id)\n\t\t\treturn user_service.get(id)\n\t\texcept AssertionError as e:\n\t\t\tuser_space.abort(400, e.args[0], status = \"Could not get user\", statusCode = \"400\")\n\t\texcept Exception as e:\n\t\t\tuser_space.abort(500, e... | [
"0.81746036",
"0.8140494",
"0.8068625",
"0.7925986",
"0.7853338",
"0.77758116",
"0.770866",
"0.77042407",
"0.7703023",
"0.76989263",
"0.7648121",
"0.7646187",
"0.7640432",
"0.759052",
"0.7587502",
"0.7578968",
"0.755803",
"0.7557973",
"0.7554959",
"0.7549086",
"0.7539787",
... | 0.0 | -1 |
Check if an administrator user has sufficient permissions to update another user Returns True if the user to be edited is not an administrator or if the requesting user is a full administrator. | async def check_can_edit_user(
authorization_client: AuthorizationClient, req_user_id: str, user_id: str
):
admin_tuple, req_admin_tuple = await asyncio.gather(
authorization_client.get_administrator(user_id),
authorization_client.get_administrator(req_user_id),
)
if admin_tuple[1] is N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_admin_only(self, request):\r\n api_key = request.params.get(self.api_field, None)\r\n\r\n if request.user is None:\r\n user = self.user_fetcher(api_key=api_key)\r\n else:\r\n user = request.user\r\n\r\n if user is not None and user.is_admin:\r\n ... | [
"0.72281516",
"0.71847856",
"0.71412754",
"0.6997528",
"0.6976907",
"0.69739306",
"0.6943084",
"0.69329405",
"0.6915471",
"0.6849716",
"0.68262583",
"0.68143773",
"0.67773926",
"0.67773926",
"0.6708476",
"0.6697857",
"0.66882575",
"0.66871417",
"0.6668432",
"0.66266847",
"0.6... | 0.7755212 | 0 |
Yield successive chunks from iterable of length size. | def chunker(iterable, size):
for i in range(0, len(iterable), size):
yield iterable[i:i + size] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chunks(iterator, size):\n for index in range(0, len(iterator), size):\n yield iterator[index:index + size]",
"def iter_chunks(iterable, size):\n it = iter(iterable)\n while True:\n chunk = tuple(itertools.islice(it, size))\n if len(chunk) == 0:\n break\n yield ... | [
"0.8773219",
"0.8520928",
"0.8467599",
"0.841324",
"0.8410151",
"0.8247795",
"0.8213483",
"0.8210779",
"0.810383",
"0.8072789",
"0.8064006",
"0.80410075",
"0.7970535",
"0.79383165",
"0.79333675",
"0.7927991",
"0.7896404",
"0.7862617",
"0.77980405",
"0.7778066",
"0.7762152",
... | 0.8812423 | 0 |
Generate an authorization header using the audience and additional claims specified during the objects initialization. | def get_authorization_header(self):
return {"Authorization": "Bearer {}".format(self.get_jwt())} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_authorization_header(self, **kwargs):\n return {\"Authorization\": \"Bearer {}\".format(self.create_jwt(**kwargs))}",
"def generate_oauth_headers(access_token: str) -> dict:\n return {'Authorization': 'Bearer ' + access_token}",
"def build_header(self):\n authstring = \"Bearer \" + ... | [
"0.7289764",
"0.6516872",
"0.6508694",
"0.63948554",
"0.6330595",
"0.6313006",
"0.6254178",
"0.62234914",
"0.61930233",
"0.6156881",
"0.6156881",
"0.61538696",
"0.6114552",
"0.6114552",
"0.61000293",
"0.60749173",
"0.6058747",
"0.6021708",
"0.5963398",
"0.59511334",
"0.595098... | 0.6591012 | 1 |
Generates a new JWT with the kwargs provided and returns it in an authorization header. Use this function when you need to generate a head that does not use the audience or additional_claims specified when the object was initialized. | def create_authorization_header(self, **kwargs):
return {"Authorization": "Bearer {}".format(self.create_jwt(**kwargs))} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_jwt(self, audience: List[str], additional_claims=None) -> str:\n iat = time.time()\n exp = iat + self.lifetime\n payload = additional_claims or {}\n payload.update({'iss': self.credentials[\"client_email\"],\n 'sub': self.credentials[\"client_email\"],\... | [
"0.6482287",
"0.62340146",
"0.6190718",
"0.6165699",
"0.6127454",
"0.59442586",
"0.5924296",
"0.589253",
"0.5874966",
"0.58674014",
"0.58356994",
"0.5823293",
"0.57866836",
"0.57835567",
"0.57813793",
"0.5713089",
"0.5711712",
"0.5710375",
"0.57051605",
"0.5703723",
"0.569766... | 0.7599865 | 0 |
Build a subject. The underlying implementation use an named tuple. | def subject(
subscribe: Subscribe, on_next: NextHandler, on_error: ErrorHandler = default_error, on_completed: CompleteHandler = default_on_completed
) -> Subject:
return SubjectDefinition(subscribe=subscribe, on_next=on_next, on_error=on_error, on_completed=on_completed) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instantiate_subject(cls, *args, **kwargs) -> Any:\n return cls.subject_type()(*args, **kwargs)",
"def create_subject(name=\"Basket Weaving\"):\n subj = Subject(name=name)\n subj.save()\n return subj",
"def create(subdomain, subject_type_or_type_name, subject_name, author):\n return S... | [
"0.65331507",
"0.6455414",
"0.6319482",
"0.61962545",
"0.5960392",
"0.58203477",
"0.5683861",
"0.5614033",
"0.56069326",
"0.55766976",
"0.55124485",
"0.52240115",
"0.5165838",
"0.51537824",
"0.51479",
"0.51337326",
"0.51194334",
"0.5111695",
"0.5099347",
"0.50588197",
"0.5041... | 0.5496768 | 11 |
Returns the key name for a Subscription entity. | def create_key_name(callback, topic):
return utils.get_hash_key_name(u'%s\n%s' % (callback, topic)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def natural_key(self):\n return (self.email_subscription_name)",
"def key_name(self) -> str:\n return pulumi.get(self, \"key_name\")",
"def key_name(self):\n return self._key_name",
"def kms_key_name(self) -> str:\n return pulumi.get(self, \"kms_key_name\")",
"def kms_key_name(s... | [
"0.733704",
"0.69352096",
"0.65735424",
"0.6523987",
"0.6523987",
"0.6523987",
"0.65233785",
"0.6514386",
"0.6500739",
"0.6500739",
"0.6404413",
"0.6395472",
"0.62992954",
"0.6282718",
"0.6282718",
"0.6282718",
"0.6282718",
"0.6282718",
"0.6282718",
"0.6282718",
"0.6282718",
... | 0.0 | -1 |
Records that a callback URL needs verification before being subscribed. Creates a new subscription request (for asynchronous verification) if None already exists. Any existing subscription request will not be modified; for instance, if a subscription has already been verified, this method will do nothing. | def request_insert(cls,
callback,
topic,
verify_token,
secret,
hash_func='sha1',
lease_seconds=constants.DEFAULT_LEASE_SECONDS,
now=datetime.datetime.now):
key_name = cls.create_key_name(callback, topic)
def txn():
sub_is_new = False
sub = cls.get_by_key... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_subscribe(self, request, ssn):\n if 'hub.challenge' not in request.GET:\n logger.error(f'Missing hub.challenge in subscription verification {ssn.pk}!')\n tasks.save.delay(\n pk = ssn.pk,\n subscribe_status = 'verifyerror',\n verifyerr... | [
"0.6623969",
"0.5933586",
"0.58333606",
"0.5778781",
"0.5722158",
"0.5637505",
"0.5620359",
"0.55773234",
"0.55345964",
"0.55088305",
"0.5473807",
"0.54363626",
"0.5389502",
"0.53827477",
"0.53814393",
"0.5373814",
"0.5339315",
"0.53220844",
"0.5317451",
"0.52827626",
"0.5234... | 0.0 | -1 |
Retrieves a FeedRecord by its topic or creates it if nonexistent. | def get_or_create(cls, topic):
return cls.get_or_insert(FeedRecord.create_key_name(topic), topic=topic) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_by_topic(cls, topic):\n\t\treturn cls.get_by_key_name(get_hash_key_name(topic))",
"def get(cls, topic_info):\n try: #to treat topic info as topic.id\n return Topic.query.get(int(topic_info))\n except Exception: #treat topic info as topic.name\n return Topic.query.filte... | [
"0.6046425",
"0.59767455",
"0.5552616",
"0.5494906",
"0.54641545",
"0.5463768",
"0.5380294",
"0.5299673",
"0.52679616",
"0.5236685",
"0.52106774",
"0.5160348",
"0.5094194",
"0.50598115",
"0.5058626",
"0.5054792",
"0.50506926",
"0.5036885",
"0.4974556",
"0.49042195",
"0.489916... | 0.8325038 | 0 |
Returns the current PollingMarker, creating it if it doesn't exist. | def get(cls, now=datetime.datetime.utcnow):
key_name = 'The Mark'
the_mark = db.get(datastore_types.Key.from_path(cls.kind(), key_name))
if the_mark is None:
next_start = now() - datetime.timedelta(seconds=60)
the_mark = PollingMarker(key_name=key_name,
next_start=next_start,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_start_point_marker(self) -> PositionMarker: # pragma: no cover\n assert self.pos_marker\n return self.pos_marker.start_point_marker()",
"def current_if_exists(cls):\n ret_val = gxapi_cy.WrapEMAPTEMPLATE._current_if_exists(GXContext._get_tls_geo())\n return GXEMAPTEMPLATE(ret_... | [
"0.55973244",
"0.5483283",
"0.54744536",
"0.53841496",
"0.53207636",
"0.5171374",
"0.5144951",
"0.50563437",
"0.50185823",
"0.50064486",
"0.49968737",
"0.49319124",
"0.49237773",
"0.4914125",
"0.48826537",
"0.48613292",
"0.48328462",
"0.47802806",
"0.47751778",
"0.47629866",
... | 0.7404881 | 0 |
Propagates any changes made to mu. | def _propagate_mu(self):
self.w = self.h-self.mu
self.mu_pad = np.pad(self.mu, (self.P, 0), 'constant')
self.M_mu = np.lib.stride_tricks.as_strided(self.mu_pad,
shape=[self.L_h, self.P+1],
strides=[sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __update_mu(self, mu):\n assert mu.shape in [(self.n_components, self.n_features), (1, self.n_components,\n self.n_features)], \"Input mu does not have required tensor dimensions (%i, %i) or (1, %i, %i)\" % (\n self.n_components, ... | [
"0.6657745",
"0.63117456",
"0.6183381",
"0.57871443",
"0.5775559",
"0.5736074",
"0.5702546",
"0.56689394",
"0.5577454",
"0.5571399",
"0.5569254",
"0.5564467",
"0.5539384",
"0.5495651",
"0.5468292",
"0.54655015",
"0.54344314",
"0.54321194",
"0.542594",
"0.542594",
"0.542594",
... | 0.670455 | 0 |
Compute the Kalman filterbased version of the Expectation step. | def E_Kalman(self):
print("E step", file=self.logfile)
# Computes the estimated mu and R using an RTS smoother after a Kalman filtering
self.P = self.P+1
self.R[:] = 0
self.mu[:] = 0
F = np.eye(self.P, k=-1)
F[0,:-1] = self.alpha_g
Q = np.eye(self.P, 1)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def KFilt(sample,fs=25):\n\t#kalman filter inputs\n \n # Dimensions of parameters:\n # 'transition_matrices': 2,\n # 'transition_offsets': 1,\n # 'observation_matrices': 2,\n # 'observation_offsets': 1,\n # 'transition_covariance': 2,\n # 'observation_covariance': 2,\n # 'initial_sta... | [
"0.71983254",
"0.67230684",
"0.66656446",
"0.64920974",
"0.6282487",
"0.6257055",
"0.6232854",
"0.62046194",
"0.6168706",
"0.6149025",
"0.61241084",
"0.607973",
"0.59901506",
"0.5979076",
"0.5876219",
"0.5749214",
"0.5732269",
"0.5693207",
"0.56922436",
"0.5677335",
"0.566051... | 0.6576441 | 3 |
Computes the maximization step for the parameter lambda. | def M_la(self):
print("", file=self.logfile)
print("Updating lambda", file=self.logfile)
self.la = 1/self.L_h*(np.square(np.linalg.norm((self.e*self.pie))))
self.la = self.la + 1/self.L_h*(np.sum(self.e2*self.pie_var)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def step_maxL_penalized_gradient_descent(y, tx, w, gamma, lambda_):\n grad=calculate_maxL_gradient(y,tx,w)+ 2*lambda_*w \n loss=loss_maxL(y, tx, w)+ lambda_* np.linalg.norm(w)**2\n # update w by gradient\n w=w-gamma*grad\n return w, loss",
"def lr_lambda_fun(current_iteration: int) -> float:\n ... | [
"0.65344006",
"0.6295392",
"0.6199797",
"0.617172",
"0.60305315",
"0.60215044",
"0.5955391",
"0.5954874",
"0.59376204",
"0.59092736",
"0.58647287",
"0.5860521",
"0.57884306",
"0.57516867",
"0.5717844",
"0.5679143",
"0.56520706",
"0.56347716",
"0.5634323",
"0.5628194",
"0.5621... | 0.0 | -1 |
If parent has assigned_group, set it as default value | def get_parent_assigned_group(context):
# Are we in add form ?
if not context.REQUEST.get('PATH_INFO', '/').split('/')[-1].startswith('++add++'):
return None
if base_hasattr(context, 'assigned_group') and context.assigned_group:
return context.assigned_group
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def any_parent_is_group(self):\n if self._any_parent_is_group is None:\n return super(SettingObject, self).any_parent_is_group\n return self._any_parent_is_group",
"def update(self, instance, validated_data):\r\n default_task = instance.task\r\n default_group = instance.gro... | [
"0.64933604",
"0.63970774",
"0.6282518",
"0.60632646",
"0.6000185",
"0.58996195",
"0.5798345",
"0.5743123",
"0.5681911",
"0.56557286",
"0.5604083",
"0.5560004",
"0.55031407",
"0.5489976",
"0.5488226",
"0.5482679",
"0.54802006",
"0.54637504",
"0.5419672",
"0.53966296",
"0.5393... | 0.63281715 | 2 |
Diagonalizes a list of mutually qubitwise commutative Pauli words. | def diagonalize_qwc_pauli_words(qwc_grouping):
m_paulis = len(qwc_grouping)
all_wires = Wires.all_wires([pauli_word.wires for pauli_word in qwc_grouping])
wire_map = {label: ind for ind, label in enumerate(all_wires)}
for i in range(m_paulis):
for j in range(i + 1, m_paulis):
if not ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diagonalize_pauli_word(pauli_word):\n\n if not is_pauli_word(pauli_word):\n raise TypeError(\"Input must be a Pauli word, instead got: {}.\".format(pauli_word))\n\n paulis_with_identity = (qml.PauliX, qml.PauliY, qml.PauliZ, qml.Identity)\n diag_term = None\n\n if isinstance(pauli_word, Tens... | [
"0.6608789",
"0.58212364",
"0.5770959",
"0.5747174",
"0.56244",
"0.5595353",
"0.5586733",
"0.5574194",
"0.5555871",
"0.5531824",
"0.55267495",
"0.5465446",
"0.5441289",
"0.5379405",
"0.530741",
"0.53046787",
"0.5260597",
"0.5243404",
"0.52363354",
"0.523541",
"0.5229329",
"... | 0.6755318 | 0 |
Makes sure that the field refers to an existing template defined in the root presenter. | def copy_validator(template_type_name, templates_dict_name):
def validator_fn(field, presentation, context):
field.default_validate(presentation, context)
# Make sure type exists
value = getattr(presentation, field.name)
if value is not None:
copy = context.presentation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_template_subsciption(self):\n pass",
"def test_register_template(self):\n pass",
"def clean_plain_template(self):\r\n template = self.cleaned_data[\"plain_template\"]\r\n self._validate_template(template)\r\n return template",
"def test_no_template(self):\n ... | [
"0.60145575",
"0.59973496",
"0.58228254",
"0.5769803",
"0.5709559",
"0.5700367",
"0.5696077",
"0.5691094",
"0.5689864",
"0.568727",
"0.5619647",
"0.56121933",
"0.5583535",
"0.557275",
"0.55471444",
"0.5545808",
"0.5525163",
"0.55220735",
"0.5517152",
"0.55129254",
"0.54937834... | 0.0 | -1 |
This function is responsible for populating the course with the data found in the JSON. | def read_json_contents(self, body: dict):
for section in body:
new_section = Section(section['id'], section['name'], self.__download)
new_section.read_json_contents(section['modules'])
self.__sections.append(new_section) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_data():\n f=open('json/course.json', 'r')\n temp=json.load(f)\n # print (temp[0])\n for i in temp:\n courses[i['id']]=i\n # print(courses[1])",
"def _get_courses(self) -> None:\n\n courses_content: NavigableString = self.soup.find(\"div\", \n {\"class\": \"courses... | [
"0.7493401",
"0.6648532",
"0.6328403",
"0.6296501",
"0.6246701",
"0.61949843",
"0.6164645",
"0.6060327",
"0.600188",
"0.59941304",
"0.59927803",
"0.5989241",
"0.5987638",
"0.5969869",
"0.5916811",
"0.5905216",
"0.5833533",
"0.5803521",
"0.57653904",
"0.57629395",
"0.57384104"... | 0.5172868 | 86 |
take 1D float array of rewards and compute discounted reward | def discount_rewards(r):
discounted_r = np.zeros_like(r)
running_add = 0
for t in reversed(xrange(0, r.size)):
running_add = running_add * .99 + r[t]
discounted_r[t] = running_add
return discounted_r | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def discount_rewards(rewards):\r\n discounted_r = np.zeros_like(rewards)\r\n running_add = 0\r\n for t in reversed(range(0, len(rewards))): \r\n running_add = running_add * reward_discount + rewards[t]\r\n discounted_r[t] = running_add\r\n return discounted_r",
"def discoun... | [
"0.8100212",
"0.783924",
"0.7792183",
"0.77409095",
"0.76533574",
"0.75981396",
"0.7581257",
"0.75789416",
"0.75355667",
"0.751851",
"0.75042635",
"0.7467215",
"0.7456203",
"0.7434142",
"0.74261945",
"0.7405802",
"0.7394918",
"0.73699874",
"0.7356076",
"0.7328147",
"0.7201904... | 0.7582812 | 6 |
Remaps prefixes from prefixmaps in order to match the prefixes in Minerva. | def remap_prefixes(cmap):
cmap["MGI"] = "http://identifiers.org/mgi/MGI:"
cmap["WB"] = "http://identifiers.org/wormbase/"
return cmap | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_prefixes(context: str = \"go\"):\n context = load_context(context)\n extended_prefix_map = context.as_extended_prefix_map()\n converter = Converter.from_extended_prefix_map(extended_prefix_map)\n cmaps = converter.prefix_map\n # hacky solution to: https://github.com/geneontology/go-site/issu... | [
"0.686596",
"0.6718923",
"0.6568298",
"0.638404",
"0.6309707",
"0.62905544",
"0.62554383",
"0.61278117",
"0.6122168",
"0.6094869",
"0.59724367",
"0.596222",
"0.58957607",
"0.58860445",
"0.58485925",
"0.5787066",
"0.57824713",
"0.57680345",
"0.57435447",
"0.5736785",
"0.572999... | 0.6860012 | 1 |
Plots a confusion matrix. | def plot_confusion_matrix(cm, classes=None, title='Confusion matrix'):
if classes is not None:
sns.heatmap(cm, xticklabels=classes, yticklabels=classes, vmin=0., vmax=1., annot=True)
else:
sns.heatmap(cm, vmin=0., vmax=1.)
plt.title(title)
plt.ylabel('True label')
plt.xlabel('Predict... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()",
"def plot_confusion_matrix(cm, classes=None, title='Confusion matrix'):\n if classes is not None:\n sns.heatmap(cm, cmap=\"YlGnBu\", xticklabels=classes... | [
"0.82883036",
"0.8022995",
"0.79712653",
"0.7959058",
"0.7953848",
"0.7933933",
"0.79080147",
"0.7894345",
"0.7859723",
"0.7843164",
"0.7830489",
"0.78277344",
"0.78086394",
"0.7807704",
"0.7802325",
"0.7792034",
"0.7786378",
"0.77674615",
"0.7762487",
"0.77535874",
"0.775021... | 0.8057375 | 1 |
Get the directory containing the results of the last pipeline stage. | def get_last_stage_directory(
last_stage_version: Union[str, Path],
last_stage_directory: Union[str, Path] = None,
last_stage_root: Path = None,
) -> Path:
if last_stage_directory:
warn(
f'Usage of the "last_stage_directory" argument is deprecated. Please use "last_stage_version inst... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def output_path():\n folder = path.join(path.curdir, \"stages\")\n folder = path.abspath(folder)\n return ensure_path(folder)",
"def GetOutSubDir(cls):\n return PipelineConfig.Instance().pipeline_subdirs().get('PIPELINE_OUT_DIR', '')",
"def get_output_directory(self):\n return self.__output_... | [
"0.7160099",
"0.70986307",
"0.6691624",
"0.6617881",
"0.6600701",
"0.65052813",
"0.64731085",
"0.64059126",
"0.6402417",
"0.64019364",
"0.6378444",
"0.6367307",
"0.63172233",
"0.62276334",
"0.6223181",
"0.62227595",
"0.6204799",
"0.61948425",
"0.616431",
"0.61543804",
"0.6152... | 0.6020597 | 32 |
Marks a run as a production run. Raises ValueError If date is not in the format YYYY_MM_DD | def mark_production(run_directory: Union[str, Path], date: str = None) -> None:
run_directory = Path(run_directory).resolve()
mark_production_explicit(run_directory, run_directory.parent / paths.PRODUCTION_RUN, date) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mark_production_explicit(\n run_directory: Union[str, Path], version_root: Union[str, Path], date: str = None\n) -> None:\n if date is None:\n date = datetime.datetime.now().strftime(\"%Y_%m_%d\")\n else:\n # Will raise a Value error if not the correct format.\n datetime.datetime.... | [
"0.6577681",
"0.5417433",
"0.5118489",
"0.50626105",
"0.49991918",
"0.49705222",
"0.49705222",
"0.49334168",
"0.49313644",
"0.4892481",
"0.48655158",
"0.4779642",
"0.47138977",
"0.4711732",
"0.47098365",
"0.46814996",
"0.46408454",
"0.46364152",
"0.46325138",
"0.4631548",
"0.... | 0.6982733 | 0 |
Inicializa la ventana de MainWindow. | def __init__(self, ventana):
self.v = ventana
self.constantes = Constantes()
self.titulo_dispersion = self.constantes.get_titulo_dispersion()
self.titulo_dispersion_1 = self.constantes.get_titulo_dispersion_1()
self.titulo_dispersion_2 = self.constantes.get_titulo_dispersion_2(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, parent=None):\n super(MainWindow, self).__init__(parent)\n self.setupUi(self)",
"def __init__(self, parent=None):\n super(MainWindow, self).__init__(parent)\n self.setupUi(self)",
"def __init__(self, parent=None):\n super(MainWindow, self).__init__(parent)\... | [
"0.7771981",
"0.7771981",
"0.7771981",
"0.7771981",
"0.7771981",
"0.76508695",
"0.7647471",
"0.753425",
"0.74909854",
"0.74256027",
"0.7406312",
"0.7359374",
"0.7320045",
"0.7317408",
"0.73079115",
"0.7299603",
"0.7266943",
"0.7219141",
"0.72186023",
"0.721719",
"0.7201905",
... | 0.0 | -1 |
Yield successive nsized chunks from l. | def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]",
"def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def get_chunks(self, ... | [
"0.8038813",
"0.79248375",
"0.7923423",
"0.7885103",
"0.78773195",
"0.7815877",
"0.77655786",
"0.77556044",
"0.77441615",
"0.7731815",
"0.77288336",
"0.772473",
"0.77028215",
"0.76889825",
"0.76889825",
"0.7664208",
"0.76570904",
"0.7655856",
"0.7655856",
"0.76458347",
"0.764... | 0.7448925 | 53 |
Generate a neatly formatted full name. | def get_formatted_name(first, last):
full_name = first + ' ' + last
return full_name.title() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_name(self):\n\t\tself.full_name = self.first + \" \" + self.last",
"def full_name(self) -> str:\r\n\t\tname = f'{self.last_name} {self.first_name}'\r\n\t\tif self.middle_name:\r\n\t\t\tname += ' ' + self.middle_name\r\n\t\treturn name",
"def get_formatted_name(first, last):\n full_name = f'{first... | [
"0.8401958",
"0.82627344",
"0.8231034",
"0.82291716",
"0.8199919",
"0.8169009",
"0.8143725",
"0.81324613",
"0.81316644",
"0.81233275",
"0.8071748",
"0.8071748",
"0.8071748",
"0.8023245",
"0.80207664",
"0.8016283",
"0.7999134",
"0.7997014",
"0.7997014",
"0.7997014",
"0.7983081... | 0.81909496 | 5 |
Initializes a stochastic competitive LotkaVolterra model with n species | def __init__(self, r, k, alpha, sigma, init_x, init_t=0, steps=10**3):
# set attributes
self._r = r
self._alpha = alpha
self._k = k
self._init_x = copy.copy(init_x)
self._init_t = float(init_t)
self._x = copy.copy(init_x)
self._time = float(init... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, number_of_cheeses, number_of_stools):\n self.model = TOAHModel(number_of_stools)\n self.model.fill_first_stool(number_of_cheeses)",
"def init_sequential(self, no_species): \n \n if not self.no_species is None and self.no_species != no_species:\n ra... | [
"0.635463",
"0.5967424",
"0.5933793",
"0.59239614",
"0.59039813",
"0.5824516",
"0.5758504",
"0.5743066",
"0.56695163",
"0.56644744",
"0.56553596",
"0.564783",
"0.5636317",
"0.56136787",
"0.56114763",
"0.56096643",
"0.5602673",
"0.5601885",
"0.5594789",
"0.55781484",
"0.555334... | 0.0 | -1 |
Wraps TF ops for BLEURT preprocessing. | def create_bleurt_preprocessing_ops(tokenizer, max_seq_length):
def _py_encode(references, candidates):
input_ids, input_mask, segment_ids = encoding.encode_batch(
references, candidates, tokenizer, max_seq_length)
return input_ids, input_mask, segment_ids
def bleurt_preprocessing_ops(references, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bleurt_ops(*args, references=None, candidates=None):\n logging.info(\"Creating BLEURT TF Ops...\")\n\n assert not args, (\n \"This function does not accept positional arguments. Please \"\n \"specify the name of the arguments explicitly, i.e., \"\n \"`bleurt_ops(references=..., candi... | [
"0.6304167",
"0.6231387",
"0.6019955",
"0.5986009",
"0.5957527",
"0.5892002",
"0.5866368",
"0.58107346",
"0.5756988",
"0.5732158",
"0.5717393",
"0.5698883",
"0.5690159",
"0.56888425",
"0.56749153",
"0.5659303",
"0.56559545",
"0.56349444",
"0.5632153",
"0.5632008",
"0.5617877"... | 0.5965615 | 4 |
Returns the status of the pump controller. | def status(self):
return self.readvar('\x5F\x95',0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getStatus(self):\r\n return self.controller.getStatus()",
"def get_status(self):\n return self.read_register(259, 0, 3)",
"async def get_status(self) -> str:\n return await self.hw_device.status()",
"def GetStatus(self):\r\n return self.status",
"def status(self):\n ret =... | [
"0.7769672",
"0.7499693",
"0.7237724",
"0.721962",
"0.7196414",
"0.7157351",
"0.71151376",
"0.71052426",
"0.71052426",
"0.71052426",
"0.7079566",
"0.7067912",
"0.70673937",
"0.70413584",
"0.7041224",
"0.7024376",
"0.69887304",
"0.69887304",
"0.69887304",
"0.69887304",
"0.6988... | 0.0 | -1 |
Mock controller setup function | def setup(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\n class TestHandler(BaseHandler):\n urlconf = 'conman.routes.tests.urls'\n\n self.route = mock.Mock()\n self.request = mock.Mock()\n self.handler = TestHandler(self.route)\n self.view = 'conman.routes.tests.urls.dummy_view'",
"def setUp(self):\n ... | [
"0.73025566",
"0.73004264",
"0.714685",
"0.71167564",
"0.71167564",
"0.71167564",
"0.7063951",
"0.70534176",
"0.69937587",
"0.6922805",
"0.68911135",
"0.68911135",
"0.6885162",
"0.6860672",
"0.6845059",
"0.6826259",
"0.6826259",
"0.6826259",
"0.68257916",
"0.6807242",
"0.6800... | 0.0 | -1 |
Initialize properly model weights | def reset_weights(self):
self.policy_backbone.reset_weights()
self.value_backbone.reset_weights()
self.action_head.reset_weights()
self.critic_head.reset_weights() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_weights(model):\n ...",
"def _initialize_weights(self):\n pass",
"def initialize_weights(self):\n weights_initializer.WeightsInitializer.initialize_layer_or_model(\n self._batch)",
"def init_weights_(self):\n raise NotImplementedError",
"def init_weights(self):\n ... | [
"0.91334826",
"0.8868493",
"0.8538572",
"0.8500881",
"0.8344508",
"0.82538724",
"0.8202537",
"0.8166107",
"0.8162442",
"0.8142537",
"0.8142537",
"0.8142537",
"0.80979735",
"0.8058972",
"0.8029661",
"0.8002371",
"0.79921496",
"0.797569",
"0.79012406",
"0.7898109",
"0.78881156"... | 0.0 | -1 |
Calculate value for given state | def value(self, observation, input_actions=None):
action, value = self(observation, input_actions)
return value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value(self, state):\n return 0",
"def value(self, state):\n raise NotImplementedError",
"def value(self, state):\n raise NotImplementedError",
"def get_value(self, state):\n epsilon = self.epsilon\n possible_actions = self.get_legal_actions(state)\n\n #If there a... | [
"0.77466685",
"0.7629716",
"0.7629716",
"0.7588197",
"0.7477965",
"0.74721044",
"0.7447457",
"0.74079406",
"0.7350855",
"0.73394865",
"0.7315244",
"0.73014396",
"0.7285198",
"0.726843",
"0.7259418",
"0.7259418",
"0.7259418",
"0.7259418",
"0.7259418",
"0.7259418",
"0.7259418",... | 0.0 | -1 |
Calculate value for given state | def action(self, observations):
observations = observations.float()
policy_hidden = self.policy_backbone(observations)
action = self.action_head(policy_hidden)
return action | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value(self, state):\n return 0",
"def value(self, state):\n raise NotImplementedError",
"def value(self, state):\n raise NotImplementedError",
"def get_value(self, state):\n epsilon = self.epsilon\n possible_actions = self.get_legal_actions(state)\n\n #If there a... | [
"0.77458274",
"0.76296407",
"0.76296407",
"0.75886005",
"0.747786",
"0.7472037",
"0.74476016",
"0.74079156",
"0.7350574",
"0.7339822",
"0.7315574",
"0.73022056",
"0.7285767",
"0.72688633",
"0.7259881",
"0.7259881",
"0.7259881",
"0.7259881",
"0.7259881",
"0.7259881",
"0.725988... | 0.0 | -1 |
Convert this Ingredient instance into an IngredientDto. | def to_ingredient_dto(self):
availability = [_convert_availability_string_to_enum_value(a)
for a in self.availability_per_month]
return IngredientDto(self.name, availability) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_model(self):\n\n ingredient = models.Ingredient()\n # Set attributes to none rather than empty strings if not present\n if self.amount.data:\n ingredient.amount = float(self.amount.data)\n else:\n ingredient.amount = None\n\n if self.measure.data:\n ... | [
"0.684668",
"0.66687506",
"0.6007327",
"0.5605353",
"0.552919",
"0.53335935",
"0.5259978",
"0.51355386",
"0.5066315",
"0.49894005",
"0.46729335",
"0.46341065",
"0.46321547",
"0.46273476",
"0.4587148",
"0.45809296",
"0.45391035",
"0.44715375",
"0.44706494",
"0.44348773",
"0.44... | 0.79962105 | 0 |
Function to read data from SQL. Args are comma separated DataFrames names. Returns list of loaded DataFrames or None if no data found. | def read_database(db_path, db_file, *args):
db_filepath = os.path.join(db_path, db_file)
# list to store loaded data
data_imported = []
conn = sqlite3.connect(db_filepath)
for data_name in args:
info = f'Reading {data_name} from database................'
print(info, end="")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_data_sql(): \r\n conn = mysql.connect(**st.secrets[\"mysql\"])\r\n\r\n data = pd.read_sql('SELECT * FROM song_data', conn)\r\n lookup_table = pd.read_sql('SELECT * FROM lookup_table', conn)\r\n \r\n return data, lookup_table",
"def read(name, db):\n \n # Make connection with the database\n\tc... | [
"0.66094047",
"0.6593286",
"0.6257653",
"0.61900944",
"0.61646146",
"0.6141749",
"0.6058842",
"0.60507196",
"0.59977597",
"0.593072",
"0.5926144",
"0.5915932",
"0.5897753",
"0.58839583",
"0.5867902",
"0.58593464",
"0.57912195",
"0.5755108",
"0.5736122",
"0.57324886",
"0.57220... | 0.64140725 | 2 |
Function to fill null values with values from another DataFrame with the same column names. Function accepts left Dataframe with null values, right DataFrame with filled values, list of columns join_lst used to join left and right DataFrames on, list of columns filled_lst where null values need to be filled. join_lst c... | def dataframe_fillna(left_df, right_df, join_lst, filled_lst, remove_duplicates=True, drop_na=True):
# add missing columns to left_df from filled_lst if required
left_df_columns_lst = left_df.columns.to_list()
add_columns_lst = [column for column in filled_lst if column not in left_df_columns_lst]
if a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _join_on_col_with_na(left, right, col_name):\n tmp_col_name = \"tmp.\" + col_name\n left[tmp_col_name] = left[col_name].astype(\"O\")\n merged = pd.merge(\n left, right, left_on=tmp_col_name, right_index=True, how=\"left\"\n )\n del merged[tmp_col_name]\n return merged",
"def join(se... | [
"0.6373919",
"0.6358068",
"0.6335539",
"0.57236063",
"0.5719637",
"0.569857",
"0.5676574",
"0.5529435",
"0.55144423",
"0.5486231",
"0.54702175",
"0.5438236",
"0.54369044",
"0.53803",
"0.53638065",
"0.5344871",
"0.5325655",
"0.5321272",
"0.531591",
"0.5291397",
"0.5287502",
... | 0.9241257 | 0 |
Function to create list with files. Takes directory, regex_pattern to verify if filename contains that pattern (default empty string) and filename extension (default is empty string) as parameters. If filename extension is None then filename shouldn't contain any extension. Returns list of files with the extension dete... | def find_files(folder, max_title, filename_contains='', filename_extension=''):
info = f'Checking {os.path.basename(folder)} folder for configuration files'
print(info, end =" ")
# check if ssave_path folder exist
check_valid_path(folder)
# list to save configuration data files
files_lst ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_files(directory='.', pattern='.*', recursive=True):\n if recursive:\n return (os.path.join(directory, filename)\n for directory, subdirectories, filenames in os.walk(directory)\n for filename in filenames if re.match(pattern, filename))\n else:\n return (os.path.j... | [
"0.71971",
"0.7173517",
"0.7119436",
"0.70263296",
"0.70263296",
"0.70081717",
"0.69896394",
"0.6984383",
"0.68916893",
"0.6891138",
"0.68319875",
"0.68008804",
"0.674031",
"0.6683945",
"0.66755044",
"0.6673045",
"0.6668471",
"0.6648358",
"0.66375494",
"0.6618548",
"0.6615191... | 0.0 | -1 |
Function to replace wwnn in wwn_column (column with presumably mixed wwnn and wwnp values) of wwn_df DataFrame with corresponding wwnp value if wwnn is present. wwnn_wwnp_df DataFrame contains strictly defined wwnn and wwnp values in corresponding columns which passed as wwnn_wwnp_columns parameter. fabric_columns cont... | def replace_wwnn(wwn_df, wwn_column: str, wwnn_wwnp_df, wwnn_wwnp_columns: list, fabric_columns: list=[]):
wwnn_column, wwnp_column = wwnn_wwnp_columns
join_columns = [*fabric_columns, wwnn_column]
if wwnp_column in wwn_df.columns:
wwn_df[wwnp_column] = np.nan
# assume that all values in ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_wwn(df, wwn_columns: list):\n\n for wwn_column in wwn_columns:\n if wwn_column in df.columns and df[wwn_column].notna().any():\n mask_wwn = df[wwn_column].notna()\n df.loc[mask_wwn, wwn_column] = df.loc[mask_wwn, wwn_column].apply(lambda wwn: ':'.join(re.findall('..', w... | [
"0.6477153",
"0.46549058",
"0.4599464",
"0.4567799",
"0.45412034",
"0.45325714",
"0.45224285",
"0.4500188",
"0.44889596",
"0.44178906",
"0.43763497",
"0.43749997",
"0.43628815",
"0.43511468",
"0.42961964",
"0.42944983",
"0.42844954",
"0.42836842",
"0.42696458",
"0.42557228",
... | 0.89471537 | 0 |
reads text files, returns a list. | def loadWords():
inFile = open(wordFile, 'r')
wordlist = []
for line in inFile:
wordlist.append(line)
return wordlist | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getlistfromtext(self,filename):\n l=[]\n\n if self.encoding:\n f = codecs.open(filename,\"r\",encoding=self.encoding)\n for line in f:\n l.append(line.rstrip())\n f.close()\n\n else:\n f = open(filename,\"r\")\n for line... | [
"0.7957345",
"0.78901637",
"0.76355684",
"0.76324415",
"0.7536411",
"0.7446523",
"0.7377588",
"0.7327897",
"0.73256785",
"0.7297696",
"0.7295883",
"0.7253994",
"0.7253994",
"0.72524434",
"0.71997803",
"0.7189902",
"0.71761173",
"0.7158605",
"0.71391594",
"0.70936805",
"0.7063... | 0.0 | -1 |
gets a list, gives a random member of it. | def chosen():
wordList = loadWords()
w = random.choice(wordList)
word = w[:-1]
return word | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _random_pick(lst):\n\n choice = random.randint(0, len(lst) - 1)\n return lst[choice]",
"def spinit(list):\n return (random.choice(list))",
"def getRandom(self) -> int:\n return random.choice(self.list)",
"def getRandom(self) -> int:\n return random.choice(self.list)",
"def getRan... | [
"0.72674084",
"0.71024597",
"0.68967414",
"0.68967414",
"0.68967414",
"0.68967414",
"0.6877258",
"0.6867943",
"0.6855395",
"0.6847979",
"0.67815155",
"0.67792493",
"0.6760331",
"0.6736516",
"0.6725596",
"0.66490877",
"0.66448796",
"0.6582777",
"0.6569434",
"0.6497451",
"0.648... | 0.0 | -1 |
Use the ScreenManager to go to the next level and clear out the current level. | def goto_next_level(self, *args):
self.manager.current = self.manager.next()
self.reset() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_step(self):\n # reset all levels\n for l in self.levels:\n l.reset_level()",
"def level_down(self):\n if self.level > 1:\n self.level = self.level - 1\n self.update_level_buttons()",
"def change_level(self):\n new_level = GameLevel[self.sco... | [
"0.6757158",
"0.6505874",
"0.6386938",
"0.6225707",
"0.61157113",
"0.6094638",
"0.60715604",
"0.60455245",
"0.6013625",
"0.5969923",
"0.59564114",
"0.59154975",
"0.5886964",
"0.58863616",
"0.5846349",
"0.5830255",
"0.5811067",
"0.57428604",
"0.57371503",
"0.5726065",
"0.57162... | 0.69289434 | 0 |
Required. Immutable. A unique ID within the site that identifies the channel. | def channel_id(self) -> pulumi.Input[str]:
return pulumi.get(self, "channel_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channel_id(self):\n return self._channel_id",
"def channel_id(self) -> int:\n try:\n return self.channel.channel_id # type: ignore\n except AttributeError:\n return 0",
"def get_channel_ID(self):\n return self._CHANNEL_ID",
"def channel_id(self) -> pulum... | [
"0.8028421",
"0.7817131",
"0.77866226",
"0.7611632",
"0.75191027",
"0.7062347",
"0.6921226",
"0.6921226",
"0.6921226",
"0.68184716",
"0.6757423",
"0.6744554",
"0.65380514",
"0.65086836",
"0.64691025",
"0.6464008",
"0.6453553",
"0.64480144",
"0.6442368",
"0.6395679",
"0.638572... | 0.76447135 | 6 |
Input only. A timetolive for this channel. Sets `expire_time` to the provided duration past the time of the request. | def ttl(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "ttl") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expire_time(self, expire_time):\n\n self._expire_time = expire_time",
"def expire_time(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"expire_time\")",
"def expire_time(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"expire_time\")",
"def expire(se... | [
"0.6673385",
"0.6286793",
"0.6286793",
"0.611786",
"0.610054",
"0.60567194",
"0.6001484",
"0.6001484",
"0.6001484",
"0.597138",
"0.5926036",
"0.5869429",
"0.5869429",
"0.5778801",
"0.5709964",
"0.5660402",
"0.56507486",
"0.56296474",
"0.5601115",
"0.5538305",
"0.55261755",
... | 0.0 | -1 |
Get an existing Channel 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) -> 'Channel':
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = ChannelArgs.__new__(ChannelArgs)
__props__.__dict__["channel_id"] = None
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n account_id: Optional[pulumi.Input[int]] = None,\n active: Optional[pulumi.Input[bool]] = None,\n destination_id: Optional[pulumi.Input[str]] = None,\n ... | [
"0.649718",
"0.5928513",
"0.5756362",
"0.5748768",
"0.57232153",
"0.5549273",
"0.5397546",
"0.5336968",
"0.5329586",
"0.5322087",
"0.518869",
"0.51713175",
"0.51453924",
"0.5139787",
"0.513224",
"0.5108584",
"0.5106204",
"0.5103474",
"0.5094989",
"0.5083442",
"0.5080568",
"... | 0.67174685 | 0 |
Required. Immutable. A unique ID within the site that identifies the channel. | def channel_id(self) -> pulumi.Output[str]:
return pulumi.get(self, "channel_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channel_id(self):\n return self._channel_id",
"def channel_id(self) -> int:\n try:\n return self.channel.channel_id # type: ignore\n except AttributeError:\n return 0",
"def get_channel_ID(self):\n return self._CHANNEL_ID",
"def channel_id(self) -> pulum... | [
"0.8028421",
"0.7817131",
"0.77866226",
"0.76447135",
"0.76447135",
"0.76447135",
"0.76447135",
"0.75191027",
"0.7062347",
"0.6921226",
"0.6921226",
"0.6921226",
"0.68184716",
"0.6757423",
"0.6744554",
"0.65380514",
"0.65086836",
"0.64691025",
"0.6464008",
"0.6453553",
"0.644... | 0.7611632 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.