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 |
|---|---|---|---|---|---|---|
Returns a random color that is guaranteed to have lowish saturation. Brightness of output is ceilinged at 253 to contrast with pure white, and floored at 40 to contrast with pure black (outlines of sprites etc.) The 'saturation' input controls how desaturated the color should be. This value should both be in the range ... | def desaturated_randcol(saturation,brightness=100):
# begin with greyscale
brightness = clamp(brightness,40,255)
sat = clamp(saturation,0,255-brightness)
col = [brightness,brightness,brightness]
for i in range(3):
r = randint(-sat,sat)
if abs(r-brightness) < sat//2: # minimum sa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def saturated_randcol(value=255):\n # one channel is zero, one is random and one is max\n channels = [0,randint(0,255),255]\n col = [0,0,0]\n value = clamp(value,40,255)\n \n for i in range(3):\n channel = choice(channels)\n col[i] = channel*value//255\n channels.remove(chann... | [
"0.65370274",
"0.6521516",
"0.6467848",
"0.6419299",
"0.6298796",
"0.6178765",
"0.6177154",
"0.61520714",
"0.61471254",
"0.6135859",
"0.6056515",
"0.59852934",
"0.59727925",
"0.5963029",
"0.59549916",
"0.59314835",
"0.5901054",
"0.58933413",
"0.58916295",
"0.5887236",
"0.5875... | 0.7329998 | 0 |
80 % R8_F1 evaluates the derivative for the ODE. | def r8_f1(t, y):
yp = np.zeros(np.size(y))
yp[0] = 0.25 * y[0] * (1.0 - y[0] / 20.0)
return(yp) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_partial_derivative_f1(self):\r\n # Verified with Wolfram Alpha.\r\n\r\n # f2 > 0\r\n obs = self.estimator1._partial_derivative_f1(2, 3, 10, 42)\r\n assert_almost_equal(obs, 1.22672908818)\r\n\r\n # f2 == 0\r\n obs = self.estimator1._partial_derivative_f1(2, 0, 10,... | [
"0.61537206",
"0.60028386",
"0.58640146",
"0.5859632",
"0.5859632",
"0.5780367",
"0.56796837",
"0.56695616",
"0.5624581",
"0.55979663",
"0.5589726",
"0.5526847",
"0.5501776",
"0.5496829",
"0.54539514",
"0.5441381",
"0.5437156",
"0.54300207",
"0.5405728",
"0.5402945",
"0.53982... | 0.54143834 | 18 |
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. | def plot_confusion_matrix(plotaxis, cm, classes,
normalize=False,
title='Confusion matrix',
cmap=plt.cm.Blues):
if normalize:
cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]
#print("Normalized confusion matrix")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n... | [
"0.8193067",
"0.8093563",
"0.80270845",
"0.80171025",
"0.7992049",
"0.79890734",
"0.79785955",
"0.7973588",
"0.7959112",
"0.79545826",
"0.79353666",
"0.7932262",
"0.79320717",
"0.79288954",
"0.792416",
"0.7922282",
"0.7921632",
"0.79207784",
"0.7920719",
"0.79201275",
"0.7915... | 0.0 | -1 |
Initialise the iterator after the session has been created. | def after_create_session(self, session, coord):
self.iterator_initializer_func(session) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_session(self):\n pass",
"def init_session(self):\n pass",
"def after_create_session(self, session, coord):\r\n print(\"interator session after created..........\", config._task_type)\r\n self.iterator_initializer_func(session)",
"def after_create_session(self, session, c... | [
"0.7154914",
"0.7154914",
"0.6880919",
"0.6747339",
"0.6677135",
"0.6412246",
"0.6376045",
"0.6362696",
"0.6277933",
"0.6266516",
"0.6255239",
"0.6247051",
"0.62424946",
"0.6233093",
"0.62212116",
"0.6186286",
"0.6172497",
"0.6155909",
"0.610087",
"0.60536087",
"0.6041701",
... | 0.7544628 | 1 |
Generate a seed to replace every ASCII character with two other ASCII characters, including whitespace, etc. | def generate_seed():
global seed
seed = []
for char_id in range(0, len(printable)):
while True:
char_sequence = [printable[randint(0, len(printable)-1)], printable[randint(0, len(printable)-1)]]
if char_sequence not in seed:
break
seed.append(char_seq... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_seed(chars, nb_chars):\n s = ''\n for i in range(nb_chars):\n s += chars[random.randint(0, len(chars) - 1)]\n\n return s",
"def gen_char(filename):\n random.seed()\n with open(filename, \"w\") as f:\n for i in range(1000):\n a=random.randint(33,122)\n ... | [
"0.6871188",
"0.6533983",
"0.6506076",
"0.6432568",
"0.6386268",
"0.6356019",
"0.6263809",
"0.62414604",
"0.6240308",
"0.6180066",
"0.61752886",
"0.61422104",
"0.61014",
"0.6075874",
"0.6067415",
"0.60297894",
"0.60184515",
"0.6016958",
"0.5998327",
"0.5968732",
"0.5938383",
... | 0.6748473 | 1 |
converts 1d array to 2d binary one hot labels (n, ) to (n, 2) | def label_to_one_hot(label, num_of_class=2):
import numpy as np
one_hot = np.zeros((len(label), num_of_class), dtype=np.uint8)
for i in range(len(label)):
one_hot[i, int(label[i] - 1)] = 1 # label is 1 and 2
return one_hot | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def binary_to_one_hot(arr: np.ndarray) -> np.ndarray:\n res = np.zeros((arr.shape[0], 2))\n res[np.where(arr == 1)[0], 0] = 1\n res[np.where(arr == 0)[0], 1] = 1\n return res",
"def one_hot_encode(self, arr, n_labels):\n one_hot = np.zeros((np.multiply(*arr.shape), n_labels), dtype=np.float32)... | [
"0.78879476",
"0.7762561",
"0.76071036",
"0.75405365",
"0.7510667",
"0.7475169",
"0.74586153",
"0.7436399",
"0.7426505",
"0.73947406",
"0.7376666",
"0.7376666",
"0.7338348",
"0.7316789",
"0.73042995",
"0.73042995",
"0.73042995",
"0.73042995",
"0.73035395",
"0.7293729",
"0.729... | 0.7698762 | 2 |
Creates grid of sudoku squares. | def create_grid(self, main_frame: tk.LabelFrame) -> None:
for square_row in range(3):
for square_column in range(3):
square = tk.Frame(main_frame, highlightbackground='black', highlightcolor='red',
highlightthickness=1, width=120, heigh=120, padx=0)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_sudoku(self)->list:\n grid = [[None for x in range(9)] for row in range(9)]\n for row in range(0,9):\n for column in range(0,9):\n if row <= 2 and column <=2:\n grid[row][column] = cell.Cell(0)\n elif row <= 2 and 3 <= column <= 5... | [
"0.7825245",
"0.7644965",
"0.76216215",
"0.73928297",
"0.7385003",
"0.73691475",
"0.734688",
"0.72752833",
"0.72070986",
"0.71402174",
"0.71079075",
"0.7079716",
"0.70737207",
"0.7046125",
"0.7021769",
"0.6967047",
"0.69537073",
"0.6933975",
"0.6932374",
"0.6893544",
"0.68796... | 0.6496239 | 45 |
Creates 9 cells inside a square. | def create_cells_and_entries(self, frame: tk.Frame, square_row: int) -> None:
for row in range(3):
for column in range(3):
cell = tk.Frame(frame, bg='white', highlightbackground='black',
highlightcolor='black', highlightthickness=0.5,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _generate_cells(self) -> None:\n for i in range(15):\n for j in range(15):\n c = Cell(x=i, y=j)\n c.answer = self.puzzle.solution[j*self.width+i]\n self.cells[(j, i)] = c # row, col",
"def create_grid(grid):\r\n for i in range(4):\r\n ... | [
"0.80183166",
"0.7333119",
"0.72710603",
"0.7226427",
"0.721491",
"0.7151066",
"0.7150289",
"0.71392226",
"0.70853066",
"0.7078756",
"0.702974",
"0.7028925",
"0.69885725",
"0.69750667",
"0.6965203",
"0.69625527",
"0.69319725",
"0.69057924",
"0.6887337",
"0.6848871",
"0.680568... | 0.64863807 | 48 |
Clears grid in window. | def clear(self) -> None:
for row in self.entries:
for entry in row:
entry.text = ''
entry.entry.config(fg='black')
self.status_bar.config(text='Ready', fg='black')
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self._grid = [[None]]",
"def clear(self):\r\n\t\tself.grid.fill(False)",
"def clear_screen(self):\r\n lst_grid = self.root.grid_slaves()\r\n for widget in lst_grid:\r\n widget.destroy()\r\n lst_pack = self.root.pack_slaves()\r\n for widget in lst... | [
"0.81331325",
"0.7774781",
"0.77320975",
"0.76596695",
"0.760806",
"0.7480095",
"0.7323623",
"0.7273143",
"0.717598",
"0.71712685",
"0.71124977",
"0.70945334",
"0.7044101",
"0.702784",
"0.7024382",
"0.7010731",
"0.69602823",
"0.696009",
"0.69089794",
"0.6888585",
"0.6876752",... | 0.6116762 | 96 |
Check if Accept Header of a request is application/json in order to return response in JSON format | def acceptjson(vcf_object):
def in_acceptjson(func):
@wraps(func)
def return_json(*args, **kwargs):
g.payload_json = retrieve_json(
request.base_url,
int(request.args.get('page', 1)),
int(request.args.get('limit', 20)),
vcf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_wants_json():\n best = request.accept_mimetypes.best_match(['application/json', 'text/html'])\n return best == 'application/json' and request.accept_mimetypes[best] > request.accept_mimetypes['text/html']",
"def client_accepts_json(self):\n\n accept = self.get_header('Accept')\n i... | [
"0.7883284",
"0.7875374",
"0.7820734",
"0.73891056",
"0.71350056",
"0.6772048",
"0.66897035",
"0.6588762",
"0.64647615",
"0.62576765",
"0.62546843",
"0.6246131",
"0.6186",
"0.6180169",
"0.61416197",
"0.61238724",
"0.611312",
"0.61111355",
"0.6080678",
"0.60626996",
"0.6003838... | 0.6270414 | 9 |
Check if two DataFrames are equal, ignoring nans | def df_equal( df1, df2 ):
return df1.fillna(1).sort(axis=1).eq(df2.fillna(1).sort(axis=1)).all().all() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _(x: DataFrame, y: DataFrame) -> bool:\n _check_xy(x, y)\n\n x = x.sort_values(by=x.columns.to_list()).reset_index(drop=True)\n y = y.sort_values(by=y.columns.to_list()).reset_index(drop=True)\n return x.equals(y)",
"def df_equal(left: pd.DataFrame, right: pd.DataFrame, **kwargs) -> bool:\n ... | [
"0.7307047",
"0.7099791",
"0.69640166",
"0.68150663",
"0.679693",
"0.6757473",
"0.6723302",
"0.6719358",
"0.6664906",
"0.66355497",
"0.6595601",
"0.6496155",
"0.64491886",
"0.6419732",
"0.6409442",
"0.6399923",
"0.6334049",
"0.63161796",
"0.6305343",
"0.62961596",
"0.6277356"... | 0.8167052 | 0 |
Format an integer type according to the size_cells value of this state. | def sizeCells(self, size):
return self.int_to_cells(size, self.size_cells) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def int_format(self):\n ...",
"def _cell_dimensions_string(self):\n return_str = ''\n return_str += '0.0 {:2.6f} xlo xhi\\n0.0 {:2.6f} ylo yhi\\n0.0 {:2.6f} zlo zhi\\n\\n'.format(*self.cell_lengths)\n return_str += '{:2.5f} {:2.5f} {:2.5f} xy xz yz \\n\\n'.format(*self.tilt_factors)\n... | [
"0.5645204",
"0.5566389",
"0.53543615",
"0.53325284",
"0.5312322",
"0.5178628",
"0.50593954",
"0.5046174",
"0.5046174",
"0.50443166",
"0.50329465",
"0.5008882",
"0.49690804",
"0.4885719",
"0.48765025",
"0.48586413",
"0.4856998",
"0.4838581",
"0.48291057",
"0.48270828",
"0.481... | 0.55052084 | 2 |
Return an sizecells property with the value of this state. | def sizeCellsProperty(self):
return FdtPropertyWords("#size-cells", self.size_cells) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _cell_state_size(self):\n state_sizes = self._cells[0].state_size\n if isinstance(state_sizes, tuple):\n return sum(state_sizes)\n return state_sizes",
"def sizeCells(self, size):\n return self.int_to_cells(size, self.size_cells)",
"def ncells(self):\n return self.izone.size",
... | [
"0.7587956",
"0.7120129",
"0.6693734",
"0.65943986",
"0.6573986",
"0.6512703",
"0.64992183",
"0.63927454",
"0.636854",
"0.636501",
"0.627863",
"0.62760824",
"0.6257721",
"0.6246222",
"0.62232256",
"0.62025326",
"0.6200617",
"0.61280704",
"0.61280704",
"0.61197406",
"0.6098245... | 0.83490896 | 0 |
Get the breakdown of cases and deaths by age. | def get_breakdown_age(page: MarinDashboardPage, chart_id: str) -> Tuple[List, List]:
csv_reader = page.get_chart_data(chart_id)
keys = csv_reader.fieldnames
if keys != ['Age Category', 'POPULATION', 'Cases', 'Hospitalizations', 'Deaths']:
raise FormatError(f'Data headers for chart "{chart_id}" have... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_age_fields():\n under_18_fields = CensusFields.get_under_18_fields()\n\n age_18_to_29_fields = [ \n 'B01001_007E', # Male:!!18 and 19 years\n 'B01001_008E', # Male:!!20 years\n 'B01001_009E', # Male:!!21 years\n 'B010... | [
"0.64958847",
"0.58913636",
"0.58495563",
"0.57829887",
"0.5696755",
"0.5681117",
"0.56701267",
"0.5615883",
"0.54715014",
"0.54325634",
"0.5431407",
"0.5426443",
"0.54182404",
"0.54079217",
"0.53830934",
"0.5382307",
"0.5379723",
"0.53761256",
"0.5331623",
"0.53004307",
"0.5... | 0.62657493 | 1 |
Get the breakdown of cases and deaths by race/ethnicity. | def get_breakdown_race_eth(page: MarinDashboardPage, chart_id: str) -> Tuple[Dict, Dict]:
csv_reader = page.get_chart_data(chart_id)
keys = csv_reader.fieldnames
if keys != ['Race/Ethnicity', 'COUNTY POPULATION', 'Cases', 'Case Percent', 'Hospitalizations', 'Hospitalizations Percent', 'Deaths', 'Deaths Per... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def structure(self):\n return self.cases_and_deaths",
"def user_story_6(self):\n for family in self.families.values():\n if family.divorced != 'NA':\n if family.wife_id != 'NA':\n if self.individuals[family.wife_id].death != 'NA':\n ... | [
"0.6638214",
"0.56316614",
"0.54585356",
"0.5456081",
"0.5444334",
"0.5438529",
"0.53763014",
"0.53622985",
"0.532632",
"0.52593315",
"0.5257816",
"0.522914",
"0.5215705",
"0.51490057",
"0.50972",
"0.50905484",
"0.5083932",
"0.5063276",
"0.50499374",
"0.5025228",
"0.5013523",... | 0.65057105 | 1 |
Set global rnd weight. | def setSeqRndWeight(ln):
global seqRndWeight
seqRndWeight = getweights(ln, "SeqRndWeight") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def randomize(self):\n self.weights = np.random.rand(*self.weights.shape) - 0.5",
"def _random_weight(self):\n return random.uniform(MIN_WEIGHT, MAX_WEIGHT)",
"def _random_weight_initialization(self, mean=0, stddev=1):\n self.slp_weights = np.random.normal(mean, stddev, size=(self.n_rbfs, ... | [
"0.72211975",
"0.7121694",
"0.6953704",
"0.68624514",
"0.66731507",
"0.6640844",
"0.65950865",
"0.65950865",
"0.65818435",
"0.65618676",
"0.6544794",
"0.6531439",
"0.65107375",
"0.6475483",
"0.64699405",
"0.6439595",
"0.64133257",
"0.6374897",
"0.6374897",
"0.6374897",
"0.636... | 0.71595395 | 1 |
Calculate and return the area | def area(self):
return self.width * self.height | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def area(self) -> float:\n raise NotImplementedError",
"def area(self):\n return 0.5*np.abs(np.dot(self.x,np.roll(self.y,1))-np.dot(self.y,np.roll(self.x,1)))",
"def area(self):\n\n return (self.x1 - self.x0) * (self.y1 - self.y0)",
"def area(self):\n area = 0\n last = self... | [
"0.8358778",
"0.8335303",
"0.82346594",
"0.8231262",
"0.81868184",
"0.81041855",
"0.8093867",
"0.80396014",
"0.802577",
"0.8000845",
"0.79531467",
"0.79003274",
"0.7890841",
"0.7866712",
"0.78450066",
"0.7824937",
"0.77941525",
"0.77843225",
"0.7775194",
"0.7773701",
"0.77544... | 0.7307581 | 94 |
Overloads object attribute accessory proxy to the currently used operator and parent test instance. | def __getattr__(self, name):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def base_operator(self):\n raise NotImplementedError()",
"def my_operator(self):\n return self._my_operator",
"def __init__(self):\n super(OperatorCodegen, self).__init__()",
"def __init__(self, op, value):\n self.op = op\n self.value = value",
"def test_operator_set(self... | [
"0.59909177",
"0.5733056",
"0.56281555",
"0.5461271",
"0.5390292",
"0.5340436",
"0.5301387",
"0.5294273",
"0.5292773",
"0.5266461",
"0.52658826",
"0.52589196",
"0.523769",
"0.52145237",
"0.51716053",
"0.5158231",
"0.51469713",
"0.514107",
"0.51311016",
"0.51062816",
"0.509965... | 0.0 | -1 |
Return bool if h is a valid SuperGenPass hash | def valid(h):
h = bytes.decode(h)
if h[0].islower():
if set(h).issubset(ALNUM):
# Yes! Digits, Upper- and lowercase are present
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_hash(h):\n if len(h) not in (32, 40, 64, 128):\n return False\n\n return bool(re.match(\"[0-9a-fA-F]*$\", h))",
"def has_hash(self, h):\n rsp = h.hashlist(self.path)\n if re.search(\"\\n[0-9a-f]+\\smd5\\s%s\" % self.path, rsp):\n rval = True\n else:\n ... | [
"0.77823746",
"0.74537295",
"0.71317226",
"0.698026",
"0.69349676",
"0.69269544",
"0.6827861",
"0.67655087",
"0.6720754",
"0.66332656",
"0.65748125",
"0.65443283",
"0.6425588",
"0.63308233",
"0.63229537",
"0.62980896",
"0.62298644",
"0.6191752",
"0.61810315",
"0.61360216",
"0... | 0.63120514 | 15 |
Return the last player attributes of the this player | def get_last_player_attributes(self):
max_date = "0000-00-00"
last_player_attributes = None
for player_attributes in self.get_player_attributes():
if player_attributes.date > max_date:
max_date = player_attributes.date
last_player_attributes = player_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_player_attributes(self):\n return Player_Attributes.read_by_player_fifa_api_id(self.player_fifa_api_id)",
"def player_properties(self):\n return self.properties.GetAll(self.player_interface)",
"def _get_player_info(self):\n return [player._player_info() for player in self.players.v... | [
"0.7148126",
"0.62618923",
"0.61304057",
"0.61034083",
"0.5985911",
"0.58640313",
"0.58331674",
"0.58170587",
"0.5701343",
"0.5637061",
"0.55794674",
"0.5539473",
"0.5517986",
"0.55102307",
"0.546593",
"0.5464596",
"0.5462154",
"0.546124",
"0.5455674",
"0.5449686",
"0.5419448... | 0.823953 | 0 |
Set the player api id of this player | def set_api_id(self, player_api_id, persist=True):
self.player_api_id = player_api_id
if persist:
update(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, player_id):\n pass",
"def set_player_id(self, player_id):\n self.player_id = player_id",
"def player_id(self, player_id):\n\n self._player_id = player_id",
"def player_id(self, player_id):\n\n self._player_id = player_id",
"def set_api_key(api_key):\n Mov... | [
"0.79238474",
"0.7414452",
"0.7039076",
"0.7039076",
"0.6485748",
"0.639856",
"0.6347894",
"0.62413013",
"0.6121917",
"0.6121917",
"0.6057271",
"0.6041767",
"0.59828573",
"0.59801525",
"0.59524554",
"0.5929171",
"0.591856",
"0.59121805",
"0.58741266",
"0.58223504",
"0.5810405... | 0.8032993 | 0 |
Constructs a ResNet50 model. | def resnet50(pretrained=True, **kwargs):
model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs)
if pretrained:
print("=> using pre-trained model '{}'".format('resnet_50'))
pretrained_state = model_zoo.load_url(model_urls['resnet50'])
model_state = model.state_dict()
pretrained_state ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resnet50(pretrained=False, **kwargs):\n model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs)\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['resnet50']))\n fc = transfer_fc(model.fc)\n model.fc = fc\n return model",
"def resnet50(**kwargs):\n model = ResNet(... | [
"0.7557751",
"0.75548905",
"0.74759895",
"0.74759895",
"0.74759895",
"0.74759895",
"0.74557495",
"0.7386862",
"0.7386862",
"0.73601955",
"0.7355623",
"0.724254",
"0.724254",
"0.7191571",
"0.7101107",
"0.70165247",
"0.69687796",
"0.68687624",
"0.6822836",
"0.6801022",
"0.67330... | 0.7158499 | 14 |
Initializes afsc_bot_detector object and sets several internal properties. | def __init__(self, search_min=10, window_len=11, backstep=35):
super(afsc_bot_detector, self).__init__()
# specify the minimum range OR depth that we'll consider searching for the max Sv/sv. Set
# this to a value that will put the search beyond the range/depth of the ringdown.
self.se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.detector = dlib.get_frontal_face_detector()",
"def setup_class(cls):\n super().setup_class()\n cls.detector = cls.faceEngine.createFaceDetector(DetectorType.FACE_DET_V3)\n cls.headPoseEstimator = cls.faceEngine.createHeadPoseEstimator()\n cls.liveness... | [
"0.65793914",
"0.6431861",
"0.63363224",
"0.6096426",
"0.603754",
"0.60207164",
"0.6011042",
"0.598621",
"0.598621",
"0.59762526",
"0.59762526",
"0.5968597",
"0.5920151",
"0.59010917",
"0.5877114",
"0.5863274",
"0.5819648",
"0.5795581",
"0.5779546",
"0.5774484",
"0.5765434",
... | 0.56328374 | 42 |
Set the default wavelength bounds. | def set_wl_bounds(self):
wls = self.xds['wl'].values
min_wl, max_wl = min(wls), max(wls)
center = (max_wl+min_wl)/2
min_wl, max_wl, center = round(min_wl), round(max_wl), round(center)
self.param.band.bounds = (min_wl, max_wl)
self.band = center - self.bw/2, center + self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_bounds_to_default(self) -> None:\n self.write_to_experiment_file(self.DEFAULT_BOUNDS, is_motor_bounds=True)",
"def set_bounds(self, bounds_to_set=None):\n\n # For the curl model, bounds are hard coded\n if self.wake.velocity_model.model_string == 'curl':\n coords = self.... | [
"0.69249725",
"0.63754153",
"0.62614655",
"0.6230657",
"0.6151848",
"0.6124962",
"0.60087925",
"0.59856224",
"0.5947194",
"0.59178245",
"0.59124184",
"0.5868511",
"0.5868511",
"0.5825758",
"0.58025837",
"0.5748203",
"0.5726916",
"0.57149327",
"0.57050383",
"0.56886274",
"0.56... | 0.71371454 | 0 |
Get a DynamicMap which is an Overlay of the aggregated spectrum with a shaded box defining the current band selection. | def get_band_dmap(self):
agg_spec = self.xds.sum(('x','y'))
def band_selection(band):
agg_spec_curve = hv.Curve(agg_spec)
band_vspan = hv.VSpan(*band).opts(color='gray', alpha=0.5)
band_opts = opts.Overlay(toolbar=None, hooks=[transp_hook, y_bare_hook], xlabel='',\
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_dmap(self, band_override=None):\n def plot_img(thresholds, band):\n if band_override:\n band = band_override\n img_data = self.xds.cts.sel(wl=slice(*band)).mean('wl')\n return self.img_proc(img_data, thresholds)\n dmap = hv.DynamicMap(plot_img, ... | [
"0.686264",
"0.6692132",
"0.56647944",
"0.56435263",
"0.54472685",
"0.5401443",
"0.5381755",
"0.53569067",
"0.5240962",
"0.5189682",
"0.518016",
"0.5175418",
"0.51539713",
"0.5133386",
"0.50881815",
"0.5055106",
"0.5032919",
"0.50296",
"0.50170803",
"0.50153095",
"0.50086856"... | 0.7282745 | 0 |
Sets up initial conditions corresponding to Keplerian rotation about the origin. | def keplerian_ics(nparticles,zscale=0,vzscatter=0,radialprof='exponential',
zprof='gaussian',centermass=1):
from core import Particles,PointPotential
if radialprof == 'exponential':
r = -np.log(1-np.random.rand(nparticles))
elif radialprof == 'gaussian':
r =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initRelativeRotation(self):\n self.__relRotationStartValue = self.rotation()",
"def rad_field_initial_condition(self):\n\n # revert in viewing direct\n angle, _ = f.convert_direction(self.receiver_elevation, self.receiver_azimuth)\n # Looking at the sky\n if angle < 90:\n ... | [
"0.6101528",
"0.58480334",
"0.5842993",
"0.5842993",
"0.5842993",
"0.57854134",
"0.5717849",
"0.57006776",
"0.5678485",
"0.56402814",
"0.558733",
"0.5584821",
"0.5578024",
"0.5554569",
"0.55389524",
"0.5521185",
"0.55122685",
"0.5477887",
"0.54662526",
"0.54349494",
"0.542102... | 0.0 | -1 |
Take differentiable crops of feats specified by bbox. | def crop_bbox(feats, bbox, HH, WW=None):
N = tf.shape(feats)[0]
if WW is None:
WW = HH
# change box from [0, 1] to [-1, 1] coordinate system
bbox = 2 * bbox - 1
x0, y0 = bbox[:, 0], bbox[:, 1]
x1, y1 = bbox[:, 2], bbox[:, 3]
X = tensor_linspace(x0, x1, steps=WW)
X = tf.broadcas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def crop(self, bbox):\n return self.__pyramid[0].crop(bbox)",
"def crop(self, bbox):\n if self.__huge: # image is huge and not totally in RAM\n band = bbox[3] - bbox[1] # width of the tile band\n self.__tile[1][3] = band # set the tile height\n self.__tile[2] = s... | [
"0.6644342",
"0.61777437",
"0.60692763",
"0.60080546",
"0.5910312",
"0.58398086",
"0.58105093",
"0.5808855",
"0.57569695",
"0.5736877",
"0.5731441",
"0.570972",
"0.56064534",
"0.55887985",
"0.55697125",
"0.55580723",
"0.55572194",
"0.5556059",
"0.5525075",
"0.54586345",
"0.54... | 0.61316544 | 2 |
At the end of the web request, this makes sure to close the database connection. If you don't, the database could run out of memory! | def teardown_request(exception):
try:
g.conn.close()
except Exception as e:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def after_request():\n db.close()",
"def close(self):\r\n self.conn.close()\r\n gc.collect()",
"def cleanup(_):\n self.db.close()",
"def close(self): \n self.connection.close()",
"def after_request(response):\n g.db.close()\n return response",
"def after_reque... | [
"0.794892",
"0.7742855",
"0.7562285",
"0.74584246",
"0.7452385",
"0.7452385",
"0.7452385",
"0.7452385",
"0.7452385",
"0.7452385",
"0.7452385",
"0.7452385",
"0.7452385",
"0.7452385",
"0.7452385",
"0.7359762",
"0.73332506",
"0.73332506",
"0.73313606",
"0.73309183",
"0.73297346"... | 0.0 | -1 |
Load test data from .npy files. | def load_test_data():
X_test = np.load('data/test/X_test.npy')
scaling_test = np.load('data/test/scaling_test.npy')
ids_test = np.load('data/test/ids_test.npy')
y_test = np.load('data/test/y_test.npy')
seed = np.random.randint(1, 10e6)
np.random.seed(seed)
np.random.shuffle(X_test)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_test_data():\n X = []\n y = []\n for fname in os.listdir(test_dir):\n label = int(fname.split(\"_\")[0])\n img = plt.imread(os.path.join(test_dir, fname))\n X.append(img)\n y.append(label)\n X = np.stack(X)\n y = np.stack(y)\n return X, y",
"def _load_datase... | [
"0.75998604",
"0.7382166",
"0.7227819",
"0.7077668",
"0.70334023",
"0.69358736",
"0.68978894",
"0.6863019",
"0.6800378",
"0.67736155",
"0.6771009",
"0.6762829",
"0.66781235",
"0.66729796",
"0.66094834",
"0.657563",
"0.65707785",
"0.65564597",
"0.6548969",
"0.6537208",
"0.6529... | 0.7381047 | 2 |
Crops the given image at the center. If the image is opencv image, it is expected to have [H, W, C] shape. If image size is smaller than output size along any edge, image is padded with 0 and then center cropped. | def center_crop(img:np.array,output_size:List[int])->np.array:
if isinstance(output_size,numbers.Number):
output_size = (int(output_size),int(output_size))
elif isinstance(output_size,(tuple,list)) and len(output_size)==1:
output_size =(output_size[0],output_size[0])
image_height,image... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def center_crop(img, output_size, data_format='CHW'):\n _assert_image_tensor(img, data_format)\n\n if isinstance(output_size, numbers.Number):\n output_size = (int(output_size), int(output_size))\n\n image_width, image_height = _get_image_size(img, data_format)\n crop_height, crop_width = output... | [
"0.7745518",
"0.7723266",
"0.7591834",
"0.7513113",
"0.74159324",
"0.7384134",
"0.7337529",
"0.72434264",
"0.7241375",
"0.71964645",
"0.71693075",
"0.7162877",
"0.7123077",
"0.7109457",
"0.7107611",
"0.7083056",
"0.704522",
"0.70360154",
"0.70360154",
"0.7022385",
"0.6992393"... | 0.7601449 | 2 |
Whether this channel is enabled for the bot | def is_enabled(self) -> pulumi.Input[bool]:
return pulumi.get(self, "is_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return bool(int(utils.readstr_all(os.path.join(_CHANNEL_PATH(self._chip,\n self._channel),\n 'enable'))))",
"def is_enabled(self):\n return self.enabled",
... | [
"0.77967495",
"0.7194274",
"0.715387",
"0.7112897",
"0.7112897",
"0.7105665",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7036278",
"0.7008644",
"0.70012516",
"0.70012516",
"0.70012516",
"0.70012516",
"0.69754267",
"0.69403154",
"0.6889403... | 0.680531 | 29 |
Microsoft App Type for the bot | def msa_app_type(self) -> Optional[pulumi.Input[Union[str, 'MsaAppType']]]:
return pulumi.get(self, "msa_app_type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _app_type(self):\n return self._event['app_type']",
"def bot_type(self):\n return self._bot_type",
"def app_type(self, app_type):\n\n self._app_type = app_type",
"def type(self):\n\n return self.manifest[\"type\"]",
"def get_target_type():\n is_cli = prompt_yn(\"is this a... | [
"0.73728245",
"0.6709414",
"0.64158046",
"0.6391653",
"0.616209",
"0.61567163",
"0.60071933",
"0.5948724",
"0.5777172",
"0.57591677",
"0.573961",
"0.5674926",
"0.5618708",
"0.5609716",
"0.55956733",
"0.5581338",
"0.5579065",
"0.5576999",
"0.5576999",
"0.5576999",
"0.5576999",... | 0.61590964 | 5 |
Value associated with the Connection Setting Parameter. | def value(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "value") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value(self, instance):\n try:\n return ParameterSetting.objects.get(\n base_parameter=instance,\n project=self.context.get(\"view\").kwargs.get(\"project\"),\n ).raw_value\n except ParameterSetting.DoesNotExist:\n return None",
... | [
"0.6532342",
"0.6450776",
"0.61894816",
"0.61655635",
"0.6063933",
"0.60561305",
"0.6020978",
"0.59887284",
"0.59426504",
"0.5925664",
"0.5918749",
"0.59150255",
"0.5907382",
"0.58932096",
"0.5844421",
"0.5824632",
"0.5796985",
"0.57956594",
"0.57364464",
"0.57364464",
"0.573... | 0.0 | -1 |
Id of the Connection Setting. | def id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connection_id(self) -> Optional[PublicId]:\n return self._connection_id",
"def connection_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"connection_id\")",
"def get_conn_id(self):\n return self._conn_id",
"def connection_id(self) -> pulumi.Output[str]:\n return pul... | [
"0.73552686",
"0.7346267",
"0.73246783",
"0.730905",
"0.72383666",
"0.719669",
"0.70875674",
"0.6947296",
"0.6802291",
"0.67003816",
"0.6699485",
"0.66650784",
"0.66650784",
"0.66650784",
"0.66650784",
"0.6653798",
"0.6653378",
"0.6632648",
"0.6632648",
"0.6622117",
"0.661892... | 0.0 | -1 |
Name of the Connection Setting. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connection_name(self) -> str:\n return pulumi.get(self, \"connection_name\")",
"def connection_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"connection_name\")",
"def name(self):\n return self.__class__.get_setting_name(self.key, **self.get_kwargs())",
"def getConnect... | [
"0.80702615",
"0.76584655",
"0.7495144",
"0.7315085",
"0.7313436",
"0.72336155",
"0.70027846",
"0.68911695",
"0.6879117",
"0.68311715",
"0.6789516",
"0.6763043",
"0.6756674",
"0.673246",
"0.66744804",
"0.66653264",
"0.66653264",
"0.659812",
"0.6592104",
"0.65851665",
"0.65808... | 0.0 | -1 |
The cognitive service region with this channel registration. | def cognitive_service_region(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "cognitive_service_region") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_region(self):\n return self.creds.get('region_name')",
"def region(self):\n return self.config.region",
"def region(self):\n return self._get(\"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.... | [
"0.74415404",
"0.7222918",
"0.71568716",
"0.7121072",
"0.7121072",
"0.7121072",
"0.7121072",
"0.7121072",
"0.7121072",
"0.6898123",
"0.6849046",
"0.6849046",
"0.6849046",
"0.6849046",
"0.6849046",
"0.6849046",
"0.68063945",
"0.68063945",
"0.6802268",
"0.6802268",
"0.6802268",... | 0.80800104 | 2 |
The cognitive service subscription key to use with this channel registration. | def cognitive_service_subscription_key(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "cognitive_service_subscription_key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def client_key(self) -> str:\n return pulumi.get(self, \"client_key\")",
"def client_key(self) -> str:\n return pulumi.get(self, \"client_key\")",
"def subscription_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"subscription_id\")",
"def cognitive_service_resource_id(self) ->... | [
"0.62541103",
"0.62541103",
"0.62073225",
"0.6174006",
"0.6174006",
"0.6174006",
"0.6104396",
"0.59415346",
"0.59415346",
"0.5872108",
"0.57910514",
"0.57655513",
"0.5749639",
"0.5749639",
"0.5605745",
"0.5469363",
"0.5469363",
"0.5469363",
"0.5469363",
"0.5469363",
"0.546936... | 0.83411396 | 1 |
Whether this channel is enabled or not. | def is_enabled(self) -> Optional[pulumi.Input[bool]]:
return pulumi.get(self, "is_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return bool(int(utils.readstr_all(os.path.join(_CHANNEL_PATH(self._chip,\n self._channel),\n 'enable'))))",
"def is_enabled(self):\n return self.enabled",
... | [
"0.8680775",
"0.818273",
"0.81630343",
"0.81630343",
"0.81169635",
"0.8072283",
"0.8011474",
"0.8011474",
"0.8011474",
"0.8011474",
"0.8002759",
"0.79829174",
"0.79829174",
"0.79829174",
"0.79829174",
"0.79829174",
"0.79829174",
"0.7930625",
"0.7892039",
"0.7891205",
"0.78533... | 0.0 | -1 |
Whether this channel is enabled for the bot | def is_enabled(self) -> pulumi.Input[bool]:
return pulumi.get(self, "is_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return bool(int(utils.readstr_all(os.path.join(_CHANNEL_PATH(self._chip,\n self._channel),\n 'enable'))))",
"def is_enabled(self):\n return self.enabled",
... | [
"0.77967495",
"0.7194274",
"0.715387",
"0.7112897",
"0.7112897",
"0.7105665",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7036278",
"0.7008644",
"0.70012516",
"0.70012516",
"0.70012516",
"0.70012516",
"0.69754267",
"0.69403154",
"0.6889403... | 0.680531 | 35 |
Whether this channel is enabled for the bot | def is_enabled(self) -> pulumi.Input[bool]:
return pulumi.get(self, "is_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return bool(int(utils.readstr_all(os.path.join(_CHANNEL_PATH(self._chip,\n self._channel),\n 'enable'))))",
"def is_enabled(self):\n return self.enabled",
... | [
"0.77967495",
"0.7194274",
"0.715387",
"0.7112897",
"0.7112897",
"0.7105665",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7036278",
"0.7008644",
"0.70012516",
"0.70012516",
"0.70012516",
"0.70012516",
"0.69754267",
"0.69403154",
"0.6889403... | 0.680531 | 31 |
Whether this channel is enabled for the bot | def is_enabled(self) -> pulumi.Input[bool]:
return pulumi.get(self, "is_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return bool(int(utils.readstr_all(os.path.join(_CHANNEL_PATH(self._chip,\n self._channel),\n 'enable'))))",
"def is_enabled(self):\n return self.enabled",
... | [
"0.77967495",
"0.7194274",
"0.715387",
"0.7112897",
"0.7112897",
"0.7105665",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7036278",
"0.7008644",
"0.70012516",
"0.70012516",
"0.70012516",
"0.70012516",
"0.69754267",
"0.69403154",
"0.6889403... | 0.680531 | 32 |
Kik API key. Value only returned through POST to the action Channel List API, otherwise empty. | def api_key(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "api_key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def API_KEY(self):\n return 9",
"def API_KEY(self):\n return 11",
"def API_KEY(self):\n return 10",
"def API_KEY(self):\n return 3",
"def API_KEY(self):\n return 2",
"def API_KEY(self):\n return 1",
"def API_KEY(self):\n return 8",
"def API_KEY(self):\... | [
"0.6433922",
"0.6324005",
"0.6313138",
"0.62627953",
"0.62592894",
"0.6250773",
"0.6226529",
"0.62181467",
"0.6210752",
"0.6155917",
"0.6148222",
"0.6120211",
"0.611817",
"0.6094911",
"0.6094911",
"0.6094911",
"0.6094911",
"0.6054138",
"0.5937113",
"0.5936004",
"0.5928082",
... | 0.58712775 | 23 |
Whether this channel is enabled for the bot | def is_enabled(self) -> pulumi.Input[bool]:
return pulumi.get(self, "is_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return bool(int(utils.readstr_all(os.path.join(_CHANNEL_PATH(self._chip,\n self._channel),\n 'enable'))))",
"def is_enabled(self):\n return self.enabled",
... | [
"0.77967495",
"0.7194274",
"0.715387",
"0.7112897",
"0.7112897",
"0.7105665",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7036278",
"0.7008644",
"0.70012516",
"0.70012516",
"0.70012516",
"0.70012516",
"0.69754267",
"0.69403154",
"0.6889403... | 0.680531 | 33 |
The channel name Expected value is 'OutlookChannel'. | def channel_name(self) -> pulumi.Input[str]:
return pulumi.get(self, "channel_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channel_name(self) -> str:\n return self._channel_name",
"def channelName(self):\n channel_list = (\"Neutral\",\n \"BBC1\",\n \"BBC2\",\n \"ITV\",\n \"Channel 4\",\n \"Channel 5\")... | [
"0.7318839",
"0.7307306",
"0.6910716",
"0.6910716",
"0.67474526",
"0.661312",
"0.65147746",
"0.64994913",
"0.64994913",
"0.64994913",
"0.64160293",
"0.63808316",
"0.63808316",
"0.63808316",
"0.63808316",
"0.63198876",
"0.6274628",
"0.622694",
"0.6189089",
"0.61839384",
"0.618... | 0.73959297 | 11 |
The SKU of the cognitive services account. | def __init__(__self__, *,
name: pulumi.Input[Union[str, 'SkuName']]):
pulumi.set(__self__, "name", name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sku(self):\n return self._sku",
"def sku(self) -> 'outputs.SkuResponse':\n return pulumi.get(self, \"sku\")",
"def sku(self) -> 'outputs.SkuResponse':\n return pulumi.get(self, \"sku\")",
"def sku(self) -> pulumi.Output['outputs.IotHubDpsSku']:\n return pulumi.get(self, \"sku\... | [
"0.77987945",
"0.7623654",
"0.7623654",
"0.7604307",
"0.76016825",
"0.76016825",
"0.76016825",
"0.7592613",
"0.7497853",
"0.7462012",
"0.7462012",
"0.735476",
"0.735476",
"0.734632",
"0.7301862",
"0.72782916",
"0.72782916",
"0.72023255",
"0.71862",
"0.7138038",
"0.7138038",
... | 0.4967797 | 97 |
Whether this channel is enabled for the bot | def is_enabled(self) -> pulumi.Input[bool]:
return pulumi.get(self, "is_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return bool(int(utils.readstr_all(os.path.join(_CHANNEL_PATH(self._chip,\n self._channel),\n 'enable'))))",
"def is_enabled(self):\n return self.enabled",
... | [
"0.77967495",
"0.7194274",
"0.715387",
"0.7112897",
"0.7112897",
"0.7105665",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7036278",
"0.7008644",
"0.70012516",
"0.70012516",
"0.70012516",
"0.70012516",
"0.69754267",
"0.69403154",
"0.6889403... | 0.680531 | 30 |
Whether this channel is enabled for the bot | def is_enabled(self) -> pulumi.Input[bool]:
return pulumi.get(self, "is_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return bool(int(utils.readstr_all(os.path.join(_CHANNEL_PATH(self._chip,\n self._channel),\n 'enable'))))",
"def is_enabled(self):\n return self.enabled",
... | [
"0.77967495",
"0.7194274",
"0.715387",
"0.7112897",
"0.7112897",
"0.7105665",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7036278",
"0.7008644",
"0.70012516",
"0.70012516",
"0.70012516",
"0.70012516",
"0.69754267",
"0.69403154",
"0.6889403... | 0.680531 | 28 |
Whether this channel is enabled for the bot | def is_enabled(self) -> pulumi.Input[bool]:
return pulumi.get(self, "is_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return bool(int(utils.readstr_all(os.path.join(_CHANNEL_PATH(self._chip,\n self._channel),\n 'enable'))))",
"def is_enabled(self):\n return self.enabled",
... | [
"0.77967495",
"0.7194274",
"0.715387",
"0.7112897",
"0.7112897",
"0.7105665",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7036278",
"0.7008644",
"0.70012516",
"0.70012516",
"0.70012516",
"0.70012516",
"0.69754267",
"0.69403154",
"0.6889403... | 0.680531 | 37 |
Whether this channel is enabled for the bot | def is_enabled(self) -> pulumi.Input[bool]:
return pulumi.get(self, "is_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n return bool(int(utils.readstr_all(os.path.join(_CHANNEL_PATH(self._chip,\n self._channel),\n 'enable'))))",
"def is_enabled(self):\n return self.enabled",
... | [
"0.77967495",
"0.7194274",
"0.715387",
"0.7112897",
"0.7112897",
"0.7105665",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7054029",
"0.7036278",
"0.7008644",
"0.70012516",
"0.70012516",
"0.70012516",
"0.70012516",
"0.69754267",
"0.69403154",
"0.6889403... | 0.680531 | 36 |
The cognitive service region. | def cognitive_service_region(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "cognitive_service_region") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_region(self):\n return self.creds.get('region_name')",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) ... | [
"0.80564266",
"0.7995846",
"0.7995846",
"0.7995846",
"0.7995846",
"0.7995846",
"0.7995846",
"0.785011",
"0.7780966",
"0.7741575",
"0.7741575",
"0.7741575",
"0.7741575",
"0.751679",
"0.7499312",
"0.7499312",
"0.7499312",
"0.7499312",
"0.7499312",
"0.7499312",
"0.7482813",
"0... | 0.8342572 | 2 |
The cognitive service subscription key. | def cognitive_service_subscription_key(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "cognitive_service_subscription_key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def client_key(self) -> str:\n return pulumi.get(self, \"client_key\")",
"def client_key(self) -> str:\n return pulumi.get(self, \"client_key\")",
"def subscription_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"subscription_id\")",
"def key(self):\n return self.accoun... | [
"0.663846",
"0.663846",
"0.64298874",
"0.6390105",
"0.6390105",
"0.6350466",
"0.62976795",
"0.6284764",
"0.62641793",
"0.62458414",
"0.62458414",
"0.62458414",
"0.6103303",
"0.60962284",
"0.60962284",
"0.60962284",
"0.60962284",
"0.60962284",
"0.60962284",
"0.60962284",
"0.60... | 0.85822374 | 2 |
The id of config. | def id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def config_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"config_id\")",
"def config_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"config_id\")",
"def id(self):\n return self.config['key']",
"def id(self):\n return self.config.get('key').lower()",
"def ... | [
"0.8637382",
"0.8567023",
"0.85027707",
"0.82509",
"0.80666703",
"0.76685303",
"0.7656851",
"0.7656851",
"0.7656851",
"0.7656851",
"0.76036453",
"0.75691",
"0.75691",
"0.74059683",
"0.7309113",
"0.72706836",
"0.72154444",
"0.72154444",
"0.7186581",
"0.7123275",
"0.7121402",
... | 0.0 | -1 |
The service region of cognitive service. | def cognitive_service_region(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "cognitive_service_region") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_region(self):\n return self.creds.get('region_name')",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) ... | [
"0.775027",
"0.7690749",
"0.7690749",
"0.7690749",
"0.7690749",
"0.7690749",
"0.7690749",
"0.75957316",
"0.74758804",
"0.7376575",
"0.7376575",
"0.7376575",
"0.7376575",
"0.7279742",
"0.72302866",
"0.72302866",
"0.72302866",
"0.72302866",
"0.72302866",
"0.72302866",
"0.718655... | 0.85668373 | 0 |
The subscription key of cognitive service. | def cognitive_service_subscription_key(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "cognitive_service_subscription_key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def client_key(self) -> str:\n return pulumi.get(self, \"client_key\")",
"def client_key(self) -> str:\n return pulumi.get(self, \"client_key\")",
"def subscription_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"subscription_id\")",
"def key(self):\n return self.accoun... | [
"0.68711066",
"0.68711066",
"0.676297",
"0.66826",
"0.66826",
"0.6670587",
"0.6543709",
"0.6543709",
"0.6543709",
"0.65288",
"0.6316754",
"0.6248256",
"0.6240785",
"0.6240785",
"0.6240785",
"0.6240785",
"0.6240785",
"0.6240785",
"0.6240785",
"0.6240785",
"0.6240785",
"0.624... | 0.8660471 | 0 |
Return the element stored at this Position. | def element(self):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_element(self):\n return self.element",
"def get_element(self):\n return self.element",
"def get_element(self):\n return self._element",
"def element(self):\n return self._element",
"def element(self):\n return self._element",
"def element(self):\n ... | [
"0.7991133",
"0.7991133",
"0.79683876",
"0.78909487",
"0.7818736",
"0.7818736",
"0.7818736",
"0.75961065",
"0.75703907",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7486983",
"0.7221839",
"0.72033703",
"0.72033703",
"0.72033703",
"0.72033703",
"0.70869... | 0.7271655 | 15 |
Return True if other Position represents the same location. | def __eq__(self, other):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sameLocation(self, other):\n if not isinstance(other,Point):\n return False\n return self.longitude == other.getLongitude() and self.latitude == other.getLatitude()",
"def is_same_as(self, other) -> bool:\n return self.x == other.x and self.y == other.y",
"def __eq__(self, o... | [
"0.8415754",
"0.8079227",
"0.7786437",
"0.7786437",
"0.7691206",
"0.76797974",
"0.7602571",
"0.7565954",
"0.7451115",
"0.7379772",
"0.7364974",
"0.73446333",
"0.7325784",
"0.7313829",
"0.7292145",
"0.72854483",
"0.7234374",
"0.72016287",
"0.71943915",
"0.7135114",
"0.7130683"... | 0.0 | -1 |
Return True if other does not represent the same location. | def __ne__(self, other):
return not (self == other) # opposite of __eq__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: 'LocationOutput') -> bool:\n return not self == other",
"def sameLocation(self, other):\n if not isinstance(other,Point):\n return False\n return self.longitude == other.getLongitude() and self.latitude == other.getLatitude()",
"def __ne__(self, other: 'L... | [
"0.8481706",
"0.8321418",
"0.8180398",
"0.7766625",
"0.77369577",
"0.7694653",
"0.7679855",
"0.76547265",
"0.7635153",
"0.7606302",
"0.7606302",
"0.75837845",
"0.7537069",
"0.753608",
"0.7514961",
"0.7494394",
"0.7478932",
"0.74395025",
"0.73839253",
"0.7242845",
"0.71579045"... | 0.0 | -1 |
Return Position representing p's parent (or None if p is root). | def parent(self, p):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parent(self, p):\n node = self._validate(p)\n return self._make_position(node._parent)",
"def parent(self, p):\n node = self._validate_position(p)\n return self._make_position(node)",
"def parent(self, p):\n node = self._validate(p)\n return self._make_position(node.parent... | [
"0.8724605",
"0.8647921",
"0.86457145",
"0.86071634",
"0.86071634",
"0.86071634",
"0.8466291",
"0.749229",
"0.742937",
"0.739244",
"0.7344775",
"0.7343782",
"0.72972333",
"0.72337985",
"0.7195726",
"0.7195726",
"0.7169738",
"0.7156756",
"0.7131003",
"0.7124905",
"0.71045357",... | 0.0 | -1 |
Return the total number of elements in the tree. | def __len__(self):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size(self) -> int:\n #binary search tree == empty\n if self.root is None:\n return 0\n\n #recursive helper count nodes\n return self.size_helper(self.root)",
"def count(self):\n return self.__tree.node_count",
"def tree_size(self) -> int:\n Q = Queue()\n... | [
"0.82806945",
"0.8237969",
"0.8194857",
"0.81456095",
"0.81141615",
"0.79324174",
"0.7896753",
"0.7888584",
"0.7883656",
"0.7883183",
"0.7838633",
"0.78125507",
"0.7799082",
"0.7753667",
"0.772821",
"0.77164763",
"0.7714283",
"0.771321",
"0.7678607",
"0.76691777",
"0.7658198"... | 0.0 | -1 |
Return a Position representing p's left child. Return None if p does not have a left child. | def left(self, p):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def left(self, p):\n node = self._validate_position(p)\n return self._make_position(node.left)",
"def left(self, p):\n node = self._validate(p)\n return self._make_position(node._left)",
"def left(self, p):\n node = self._validate(p)\n return self._make_position(node.left)",
... | [
"0.8620991",
"0.8563931",
"0.85632145",
"0.8528951",
"0.8528951",
"0.81108725",
"0.7891028",
"0.78896725",
"0.77040464",
"0.7652949",
"0.762416",
"0.7623946",
"0.75850433",
"0.7545657",
"0.7545657",
"0.7526716",
"0.7473045",
"0.7468302",
"0.74537134",
"0.7407409",
"0.73230255... | 0.6788138 | 55 |
Return a Position representing p's right child. Return None if p does not have a right child. | def right(self, p):
raise NotImplementedError('must be implemented by subclass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def right(self, p):\n node = self._validate_position(p)\n return self._make_position(node.right)",
"def right(self, p):\n node = self._validate(p)\n return self._make_position(node._right)",
"def right(self, p):\n node = self._validate(p)\n return self._make_position(node.righ... | [
"0.8230741",
"0.8161419",
"0.81497097",
"0.812458",
"0.80755824",
"0.77981424",
"0.77951294",
"0.7656341",
"0.7483409",
"0.7450042",
"0.7450042",
"0.71582574",
"0.7147719",
"0.7132824",
"0.71306837",
"0.7127419",
"0.71190786",
"0.711243",
"0.71009034",
"0.70921326",
"0.709084... | 0.60686994 | 73 |
Generate an inorder iteration of positions in subtree rooted at p. | def _subtree_inorder(self, p):
if self.left(p) is not None: # if left child exists, traverse its subtree
for other in self._subtree_inorder(self.left(p)):
yield other
yield p # visit p between its subtrees
if self.right(p) is not None: # if right ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _subtree_preorder(self, p):\n yield p # visit p first before visiting its subtrees\n for c in self.children(p):\n for pos in self._subtree_preorder(c):\n yield pos",
"def _subtree_postorder(self, p):\n for c in self.children(p):\n for pos in self._su... | [
"0.7068551",
"0.6812203",
"0.6667489",
"0.65897244",
"0.65579027",
"0.65164727",
"0.62634265",
"0.6216082",
"0.6177996",
"0.61417764",
"0.5991597",
"0.5944958",
"0.586507",
"0.58446544",
"0.58423084",
"0.5819531",
"0.58091927",
"0.58091927",
"0.57952887",
"0.5771734",
"0.5766... | 0.7196207 | 0 |
Return the element stored at this Position. | def element(self):
return self._node._element | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_element(self):\n return self.element",
"def get_element(self):\n return self.element",
"def get_element(self):\n return self._element",
"def element(self):\n return self._element",
"def element(self):\n return self._element",
"def element(self):\n ... | [
"0.7991133",
"0.7991133",
"0.79683876",
"0.78909487",
"0.7818736",
"0.7818736",
"0.7818736",
"0.75961065",
"0.75703907",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7495175",
"0.7271655",
"0.7221839",
"0.72033703",
"0.72033703",
"0.72033703",
"0.72033703",
"0.70869... | 0.7486983 | 14 |
Return True if other is a Position representing the same location. | def __eq__(self, other):
return type(other) is type(self) and other._node is self._node | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sameLocation(self, other):\n if not isinstance(other,Point):\n return False\n return self.longitude == other.getLongitude() and self.latitude == other.getLatitude()",
"def is_same_as(self, other) -> bool:\n return self.x == other.x and self.y == other.y",
"def __eq__(self, o... | [
"0.8375726",
"0.7963154",
"0.7680126",
"0.7680126",
"0.7654848",
"0.7579365",
"0.7465109",
"0.7343548",
"0.7315395",
"0.73144364",
"0.72930986",
"0.7281304",
"0.727859",
"0.72441643",
"0.7229009",
"0.7228473",
"0.71951085",
"0.71835446",
"0.71659315",
"0.71549267",
"0.7135935... | 0.0 | -1 |
Return the total number of elements in the tree. | def __len__(self):
return self._size | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size(self) -> int:\n #binary search tree == empty\n if self.root is None:\n return 0\n\n #recursive helper count nodes\n return self.size_helper(self.root)",
"def count(self):\n return self.__tree.node_count",
"def tree_size(self) -> int:\n Q = Queue()\n... | [
"0.82806945",
"0.8237969",
"0.8194857",
"0.81456095",
"0.81141615",
"0.79324174",
"0.7896753",
"0.7888584",
"0.7883656",
"0.7883183",
"0.7838633",
"0.78125507",
"0.7799082",
"0.7753667",
"0.772821",
"0.77164763",
"0.7714283",
"0.771321",
"0.7678607",
"0.76691777",
"0.7658198"... | 0.0 | -1 |
Return the Position of p's parent (or None if p is root). | def parent(self, p):
node = self._validate(p)
return self._make_position(node._parent) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parent(self, p):\n node = self._validate(p)\n return self._make_position(node.parent)",
"def parent(self, p):\n node = self._validate(p)\n return self._make_position(node._parent)",
"def parent(self, p):\n node = self._validate(p)\n return self._make_position(node.... | [
"0.86332345",
"0.8585579",
"0.8585579",
"0.8585579",
"0.8561717",
"0.8457227",
"0.7550976",
"0.73753154",
"0.7375314",
"0.7373594",
"0.72877836",
"0.72606564",
"0.72606564",
"0.72144693",
"0.7195201",
"0.7166647",
"0.7150406",
"0.7106718",
"0.7093113",
"0.70348966",
"0.703349... | 0.8664372 | 0 |
Return the Position of p's left child (or None if no left child). | def left(self, p):
node = self._validate(p)
return self._make_position(node._left) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def left(self, p):\n node = self._validate_position(p)\n return self._make_position(node.left)",
"def left(self, p):\n node = self._validate(p)\n return self._make_position(node.left)",
"def left(self, p):\n node = self._validate(p)\n return self._make_position(node._l... | [
"0.8242705",
"0.8222059",
"0.81770074",
"0.81770074",
"0.79586065",
"0.79495573",
"0.770442",
"0.76300657",
"0.76300657",
"0.7448692",
"0.73823774",
"0.7375141",
"0.7368798",
"0.73518646",
"0.73385125",
"0.7326691",
"0.73166406",
"0.7289645",
"0.727695",
"0.72332084",
"0.7226... | 0.82008016 | 2 |
Return the Position of p's right child (or None if no right child). | def right(self, p):
node = self._validate(p)
return self._make_position(node._right) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def right(self, p):\n node = self._validate_position(p)\n return self._make_position(node.right)",
"def right(self, p):\n node = self._validate(p)\n return self._make_position(node.right)",
"def right_child(self, position):\n child = 2 * position + 2\n if child > len(s... | [
"0.77787644",
"0.77639914",
"0.77347696",
"0.77311033",
"0.7675908",
"0.75368047",
"0.75368047",
"0.7443582",
"0.7323119",
"0.7301952",
"0.69393224",
"0.69292396",
"0.6919928",
"0.69034195",
"0.69034195",
"0.6858714",
"0.685022",
"0.6836057",
"0.68163663",
"0.6798013",
"0.679... | 0.77666533 | 1 |
Create a new left child for Position p, storing element e. Return the Position of new node. Raise ValueError if Position p is invalid or p already has a left child. | def _add_left(self, p, e):
node = self._validate(p)
if node._left is not None:
raise ValueError('Left child exists')
self._size += 1
node._left = self._Node(e, node) # node is its parent
return self._make_position(node._left) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _add_left(self, p, e):\n node = self._validate_position(p)\n if node.left is not None:\n raise ValueError(\"left child exists\")\n self._size += 1\n node.left = self._Node(e, parent=node)\n return self._make_position(node.left)",
"def _add_left(self, p, e):\n ... | [
"0.8765982",
"0.87230587",
"0.87113464",
"0.8318201",
"0.8176805",
"0.81402314",
"0.81331927",
"0.8113352",
"0.81026125",
"0.81026125",
"0.78892493",
"0.7888376",
"0.7186896",
"0.7186896",
"0.70878273",
"0.7048444",
"0.70117044",
"0.6998483",
"0.6897435",
"0.6867759",
"0.6805... | 0.87198704 | 2 |
Create a new right child for Position p, storing element e. Return the Position of new node. Raise ValueError if Position p is invalid or p already has a right child. | def _add_right(self, p, e):
node = self._validate(p)
if node._right is not None:
raise ValueError('Right child exists')
self._size += 1
node._right = self._Node(e, node) # node is its parent
return self._make_position(node._right) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _add_right(self, p, e):\n node = self._validate(p)\n if node._right is not None:\n raise ValueError('Right child exists')\n self._size += 1\n node._right = self._Node(e, node) # node is its parent\n return self._make_position(node._right)",
"def _add_right(sel... | [
"0.8336215",
"0.8292775",
"0.8214211",
"0.7693552",
"0.7568276",
"0.75080097",
"0.7297188",
"0.7212001",
"0.7189861",
"0.7183435",
"0.7178977",
"0.69921786",
"0.69921786",
"0.6960991",
"0.69532543",
"0.6945526",
"0.69263697",
"0.68481374",
"0.68473655",
"0.6539151",
"0.644612... | 0.8359153 | 0 |
Attach trees t1 and t2, respectively, as the left and right subtrees of the external Position p. As a side effect, set t1 and t2 to empty. Raise TypeError if trees t1 and t2 do not match type of this tree. Raise ValueError if Position p is invalid or not external. | def _attach(self, p, t1, t2):
node = self._validate(p)
if not self.is_leaf(p):
raise ValueError('position must be leaf')
if not type(self) is type(t1) is type(t2): # all 3 trees must be same type
raise TypeError('Tree types must match')
self._size += len(t1) + len(t2)
if not t1.is_emp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _attach(self, p, t1, t2):\n node = self._validate_position(p)\n if not self.is_leaf(p):\n raise ValueError(\"position must be external p\")\n if not type(self) is type(t1) is type(t2):\n raise ValueError(\"three types must be the same\")\n self._size += len(t1)... | [
"0.8130965",
"0.8059476",
"0.7936335",
"0.760227",
"0.75190294",
"0.56287193",
"0.556705",
"0.5468125",
"0.5441355",
"0.5421543",
"0.5387275",
"0.5386543",
"0.5346073",
"0.53063256",
"0.5303532",
"0.5272384",
"0.52123237",
"0.5130333",
"0.51019216",
"0.5073765",
"0.50399184",... | 0.7939472 | 2 |
Test if nonexistant users are able to log in | def test_validating_login_serializer_of_unexistant_user(self):
login_data = {"email": "bob@email.com", "password": "harpassword"}
serializer = LoginSerializer(data=login_data)
with self.assertRaises(ValidationError) as e:
serializer.validate(login_data)
self.assertEqual(e.e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_user_login_attempt_when_user_already_logged_in(self):\n\t\tpass",
"def can_log_in_without_cas(self):\n return self.password is not None and self.password != \"\"",
"def check_my_users(user):\n user_data = my_users.get(user['username'])\n if not user_data:\n return False # <--- inv... | [
"0.7544129",
"0.71694636",
"0.71693563",
"0.7018952",
"0.6996784",
"0.69897497",
"0.6966305",
"0.6939505",
"0.6918522",
"0.69094175",
"0.68800914",
"0.68306804",
"0.68058974",
"0.6802665",
"0.6791325",
"0.67638135",
"0.6750684",
"0.6700589",
"0.66877985",
"0.6682037",
"0.6682... | 0.0 | -1 |
The serializer should return a payload containing the user data if the user provides valid data | def test_serializer_returns_payload_when_user_passes_valid_data(self):
User.objects.create_user(username='real_user',
email='real@mail.com', password='password')
data = {'email': 'real@mail.com', 'username': 'real_user',
'callback_url': 'http://www.exam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate(self, attrs):\n data = super().validate(attrs)\n\n # Get the fields from the user profile serializer.\n serializer = UserSerializerWithToken(self.user).data\n\n for fields, values in serializer.items():\n data[fields] = values\n\n #print('token:', data)\n\... | [
"0.722645",
"0.7086572",
"0.7011451",
"0.6825851",
"0.6655294",
"0.6577349",
"0.65112275",
"0.6496482",
"0.6475659",
"0.64564884",
"0.6402021",
"0.6372894",
"0.63677776",
"0.6320945",
"0.6284413",
"0.626551",
"0.6261359",
"0.626081",
"0.62478733",
"0.6238985",
"0.62293464",
... | 0.72319806 | 0 |
Sets the learning rate to the initial LR decayed by 10 every 30 epochs | def adjust_learning_rate(optimizer, epoch):
lr = args.lr * (1 ** (epoch // change))
for param_group in optimizer.param_groups:
if epoch >= change3:
param_group['lr'] = 0.2 * 0.2 * 0.2 * lr
elif epoch >= change2:
param_group['lr'] = 0.2 * 0.2 * lr
elif epoch >=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr",
"def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l... | [
"0.7913536",
"0.7906521",
"0.7849834",
"0.777524",
"0.77338326",
"0.77306354",
"0.7722718",
"0.77224237",
"0.771982",
"0.77092624",
"0.7693604",
"0.76742035",
"0.7665748",
"0.7665748",
"0.7665748",
"0.7655329",
"0.76419765",
"0.76399755",
"0.7637868",
"0.7626077",
"0.76247585... | 0.0 | -1 |
Computes the precision for the specified values of k | def accuracy(output, target, topk=(1,)):
maxk = max(topk)
batch_size = target.size(0)
_, pred = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.view(1, -1).expand_as(pred))
res = []
for k in topk:
correct_k = correct[:k].view(-1).float().sum(0)
res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def precision(gt, pred, k):\n k = min(len(pred), k)\n den = min(len(gt), k)\n return sum([int(pred[i] in gt) for i in range(k)]) / den",
"def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\... | [
"0.76427615",
"0.74189496",
"0.7418079",
"0.72710466",
"0.72456723",
"0.72446615",
"0.7237539",
"0.72213703",
"0.7210107",
"0.7058935",
"0.6852219",
"0.6786084",
"0.67836976",
"0.6768417",
"0.67273885",
"0.67181736",
"0.67181736",
"0.67181736",
"0.67181736",
"0.67181736",
"0.... | 0.0 | -1 |
Get the component type. | def component_type(self) -> ComponentType:
return self.configuration.component_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def component_type(self):\n return self._component_type",
"def get_type (self):\n return self._stype",
"def get_type(self):\n return self._type",
"def get_type(self):\n return self._type",
"def component_type(self):\n return 'ct'",
"def get_type(self) -> str:\n r... | [
"0.889304",
"0.74369437",
"0.7422558",
"0.7422558",
"0.7381055",
"0.737939",
"0.7378559",
"0.7378559",
"0.7377766",
"0.7377766",
"0.73719895",
"0.73358744",
"0.73134214",
"0.7278505",
"0.7237626",
"0.71577215",
"0.71357745",
"0.7077095",
"0.70603544",
"0.70603544",
"0.7060354... | 0.8700163 | 1 |
Get the public id. | def public_id(self) -> PublicId:
return self.configuration.public_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_public_id(self):\n return self._public_id",
"def internal_id(self) -> str:\n return pulumi.get(self, \"internal_id\")",
"def generate_public_ID(self, mapping):\n raise exception.NotImplemented() # pragma: no cover",
"def id(self):\n\n return sha256(self.pub.export()).dige... | [
"0.87610006",
"0.74311393",
"0.7358243",
"0.73485696",
"0.7338252",
"0.7338252",
"0.7338252",
"0.7338252",
"0.7338252",
"0.7338252",
"0.72976834",
"0.71575475",
"0.7137903",
"0.71276313",
"0.71276313",
"0.71276313",
"0.71276313",
"0.70899236",
"0.70899236",
"0.7066995",
"0.70... | 0.8597659 | 1 |
Get the component configuration. | def configuration(self) -> ComponentConfiguration:
if self._configuration is None: # pragma: nocover
raise ValueError("The component is not associated with a configuration.")
return self._configuration | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_config(self):\n return self.config",
"def getConfig(self):\n \n return self.config",
"def get_configuration(self) -> dict:\n return self.config",
"def config(self):\r\n return self._config",
"def config(self):\n return self._cfg",
"def config(self):\n ... | [
"0.8249551",
"0.80148387",
"0.79343045",
"0.79049677",
"0.78933305",
"0.7882079",
"0.7882079",
"0.7882079",
"0.7881452",
"0.7881452",
"0.7868093",
"0.7868093",
"0.7868093",
"0.7868093",
"0.7868093",
"0.7868093",
"0.7868093",
"0.7868093",
"0.7868093",
"0.7868093",
"0.7868093",... | 0.76863754 | 87 |
This method initializes a resnet model but appends a layer to the beginning of the model. | def __init__(self, out_size=2, freeze=False, pretrained=True, arch='resnet50'):
super().__init__()
if arch == 'resnet50':
model = torchvision.models.resnet50(pretrained=pretrained)
self.model_name = 'resnet50'
elif arch == 'resnet18':
model = torchvision.mod... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_network(self):\n # intermediate layer size\n ils = int((self.specbinnum + self.numfilters) / 2)\n\n network = lasagne.layers.InputLayer((None, 1, self.specbinnum, self.numtimebins), self.input_var)\n\n network = NormalisationLayer(network, self.specbinnum)\n self.n... | [
"0.6284397",
"0.6261246",
"0.62237996",
"0.62197053",
"0.61831796",
"0.6174074",
"0.611729",
"0.61078256",
"0.6098128",
"0.6087835",
"0.60807127",
"0.6062437",
"0.6043313",
"0.6035492",
"0.6028856",
"0.6005181",
"0.6003816",
"0.6001964",
"0.6000247",
"0.5986679",
"0.59815854"... | 0.0 | -1 |
The center of the platform is a function of the vertices and the shape. For an equilateral triangle, label the vertices by 1, 2, 3. The midpoint on one side is M = P1 + 1/2 (P2P1). The center (C) is on the line MP3, with CM = (x/2) tan(30) = x/(2 sqrt(3)) with x being the side length of the triangle. | def compute_platform_center(self):
base = self.platform_vertices[1] - self.platform_vertices[0] # base of triangle, vector
x = np.linalg.norm(base) # base length, scalar
m = self.platform_vertices[0] + base/2 # midpoint on the base, vector
cm = x/(2*np.sqrt(3)) # length from m to cen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def center_of_mass(points):\n # break into many triangles\n # each point is part of two triangles\n cor = [sum(points) / len(points)]\n mass_points = []\n area = 0\n for i in range(len(points) - 1):\n triangle = cor + points[i:i + 2]\n # print(triangle)\n mass_points.append(b... | [
"0.7009188",
"0.695404",
"0.68762577",
"0.6821206",
"0.65722626",
"0.6501291",
"0.6404322",
"0.6374591",
"0.63194793",
"0.63146704",
"0.63034004",
"0.62989527",
"0.62945837",
"0.62881327",
"0.6268188",
"0.6248614",
"0.62233853",
"0.621514",
"0.62042457",
"0.6188179",
"0.61857... | 0.79681677 | 0 |
Given a distribution of x values and the ecdf of the distribution, return the ECDF evaluated at x. | def eval_ecdf(self, vx, ecdf, x):
if len(vx) != len(ecdf):
raise ValueError('eval_ecdf: distribution and ecdf lengths don\'t match')
i = np.searchsorted(vx, x, side = 'right') - 1
if i < 0:
return 0.
else:
return ecdf[i] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ecdf(data):\n # Number of data points: n\n n = len(data)\n # x-data for the ECDF: x\n x = np.sort(data)\n # y-data for the ECDF: y\n y = np.arange(1, n+1) / float(n)\n return x, y",
"def ecdf(data):\n\n # Number of data points: n\n n = len(data)\n\n # x-data for the ECDF: x\n ... | [
"0.77027225",
"0.76669717",
"0.76669717",
"0.76568186",
"0.76533484",
"0.76533484",
"0.7648156",
"0.7641984",
"0.7640872",
"0.7640872",
"0.76398414",
"0.7619592",
"0.7615021",
"0.75923085",
"0.7553293",
"0.72557044",
"0.7185953",
"0.7165949",
"0.71222943",
"0.7098813",
"0.693... | 0.7996845 | 0 |
r""" String representation of self. | def _repr_(self):
return repr(self.element()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__ (self) :\n\n return self.as_string()",
"def toString(self) -> str:\n raise NotImplementedError",
"def to_string(self):\r\n return self.__str__()",
"def __str__(self):\n return repr(self)",
"def as_string(self):\n return self.__repr__()",
"def serialize(self)... | [
"0.87007374",
"0.8687484",
"0.8612693",
"0.8503645",
"0.8468772",
"0.8432385",
"0.8417963",
"0.8373915",
"0.8373915",
"0.8373915",
"0.8373915",
"0.83711535",
"0.8361675",
"0.83524346",
"0.83524346",
"0.83524346",
"0.8345499",
"0.83382237",
"0.83382237",
"0.83382237",
"0.83382... | 0.0 | -1 |
r""" The ambient group in which this abelian group lives. | def universe(self):
return self._universe | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group(self):\n return self._group",
"def group(self):\n return self._group",
"def group(self):\n return self._group",
"def get_group(self):\n\t\treturn self.variables.get('group')",
"def ambient_dim(self):\n return self._ambient_dim",
"def group(self):\n return self... | [
"0.661658",
"0.661658",
"0.661658",
"0.6616478",
"0.6494669",
"0.6435188",
"0.633541",
"0.63063747",
"0.6248174",
"0.62030846",
"0.6123049",
"0.6101109",
"0.6093275",
"0.60738516",
"0.6040131",
"0.60384846",
"0.6010968",
"0.5932744",
"0.59262085",
"0.5920485",
"0.5883987",
... | 0.0 | -1 |
gets the name of this tag. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_name(self):\n return self.tagnode",
"def tag_name(self) -> str:\n return pulumi.get(self, \"tag_name\")",
"def tag(self) -> str:\n return self.name or ''",
"def get_tag_name(self):\n\n pass",
"def get_name(self):\n return self.attributes[\"name\"]",
"def get_nam... | [
"0.87919927",
"0.8683098",
"0.8505666",
"0.8501227",
"0.83532816",
"0.83174634",
"0.83174634",
"0.83174634",
"0.8302937",
"0.82810956",
"0.82810956",
"0.82810956",
"0.82712346",
"0.82712346",
"0.8228052",
"0.8228052",
"0.82259077",
"0.82259077",
"0.82259077",
"0.82259077",
"0... | 0.0 | -1 |
gets the tag name of this tag. | def tag(self):
return self._tag | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tag_name(self) -> str:\n return pulumi.get(self, \"tag_name\")",
"def get_name(self):\n return self.tagnode",
"def get_tag_name(self):\n\n pass",
"def tag(self) -> str:\n return self.name or ''",
"def tag_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"ta... | [
"0.884993",
"0.86592025",
"0.85886556",
"0.82853407",
"0.81310564",
"0.7833707",
"0.7729478",
"0.7698324",
"0.76952356",
"0.7686501",
"0.7663397",
"0.7663397",
"0.76047456",
"0.76047456",
"0.76047456",
"0.7592509",
"0.7582682",
"0.7570978",
"0.7570119",
"0.75486356",
"0.75486... | 0.0 | -1 |
Set up AstroWeather platforms as config entry. | async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
_LOGGER.debug("Starting up")
if (
not entry.options
or not entry.options.get(CONF_LATITUDE)
or not entry.options.get(CONF_LONGITUDE)
or not entry.options.get(CONF_ELEVATION)
or entry.optio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_platform(\n hass: HomeAssistant,\n config: Dict,\n add_devices: Callable,\n discovery_info: Optional[Dict] = None,\n) -> None:\n havdalah = config[HAVDALAH_MINUTES]\n candle_light = config[CANDLE_LIGHT_MINUTES]\n cities = config[GEONAMES]\n cities_list = cities.split(\",\")\n\n ... | [
"0.6696398",
"0.6530134",
"0.6499877",
"0.64337575",
"0.64162964",
"0.6362635",
"0.62975264",
"0.62474054",
"0.62267214",
"0.62210786",
"0.62007576",
"0.61980873",
"0.6167424",
"0.614472",
"0.61374325",
"0.61107016",
"0.60901755",
"0.6062258",
"0.60607994",
"0.6060552",
"0.60... | 0.0 | -1 |
InlineResponse201 a model defined in Swagger | def __init__(self, status: int=None, title: Title=None, applications: List[ApplicationRequestResponse]=None, topic_id: TopicId=None): # noqa: E501
self.swagger_types = {
'status': int,
'title': Title,
'applications': List[ApplicationRequestResponse],
'topic_id': ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def opt_model_create_rest_api():\n request_json = request.get_json()\n OptimModelRequestAPI(request_json).validate()\n return create_model_data(request_json)",
"def _create_response_model(self, data):\n pass",
"def test_basic_api_inline_openapi(self):\n self.create_and_verify_stack(\"sin... | [
"0.5989621",
"0.580162",
"0.57909155",
"0.5753123",
"0.5727388",
"0.5697784",
"0.5688931",
"0.5681504",
"0.5654229",
"0.563743",
"0.56268144",
"0.5619129",
"0.54649264",
"0.54621583",
"0.5425548",
"0.5380274",
"0.5321659",
"0.52964556",
"0.52725905",
"0.52725905",
"0.52725905... | 0.0 | -1 |
Gets the status of this InlineResponse201. | def status(self) -> int:
return self._status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def response_status(self):\n return self.__response_status",
"def get_status_code(self, response):\n if hasattr(response, 'status_int'):\n return response.status_int\n return response.status",
"def get_status_code(self):\n return self.__response.status_code",
"def get_s... | [
"0.72744554",
"0.697228",
"0.69041365",
"0.6832248",
"0.6832248",
"0.6763265",
"0.674729",
"0.67362607",
"0.66855586",
"0.66855586",
"0.66855586",
"0.66698927",
"0.6665969",
"0.66160566",
"0.66079694",
"0.66079694",
"0.66079694",
"0.6607764",
"0.6580701",
"0.6580701",
"0.6580... | 0.6620639 | 13 |
Gets the topic_id of this InlineResponse201. | def topic_id(self) -> TopicId:
return self._topic_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def topic_arn(self) -> str:\n return pulumi.get(self, \"topic_arn\")",
"def topic_arn(self) -> Optional[str]:\n return pulumi.get(self, \"topic_arn\")",
"def topic_arn(self) -> str:\n return self[\"Sns\"][\"TopicArn\"]",
"def get_topic_identifier(self):\n if 'topic_identifier' in ... | [
"0.63324493",
"0.6318908",
"0.61760104",
"0.6095182",
"0.60805106",
"0.60076916",
"0.5996359",
"0.5982361",
"0.59710556",
"0.59689593",
"0.58841366",
"0.5784745",
"0.57445025",
"0.5723097",
"0.5676103",
"0.56273437",
"0.5561249",
"0.55259717",
"0.55259717",
"0.54920954",
"0.5... | 0.73486835 | 0 |
Sets the topic_id of this InlineResponse201. | def topic_id(self, topic_id: TopicId):
self._topic_id = topic_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def topic(self, topic: str):\n if topic is None:\n raise ValueError(\"Invalid value for `topic`, must not be `None`\") # noqa: E501\n\n self._topic = topic",
"def kafka_topic(self, kafka_topic: str):\n \n self._kafka_topic = kafka_topic",
"def topic_id(self) -> TopicId:\... | [
"0.6095997",
"0.594684",
"0.5862239",
"0.58352447",
"0.581254",
"0.5692959",
"0.5691687",
"0.5620875",
"0.55455613",
"0.54782426",
"0.527419",
"0.5201805",
"0.5097555",
"0.50940436",
"0.5068349",
"0.503616",
"0.50098884",
"0.5001485",
"0.5001485",
"0.5001485",
"0.4940085",
... | 0.7609036 | 0 |
r"""Retrieves a jwt by its jti Returns str A JSON web token | def get(cls, jti):
with qdb.sql_connection.TRN:
sql = """SELECT jwt FROM qiita.{0}
WHERE jti=%s""".format(cls._table)
qdb.sql_connection.TRN.add(sql, [jti])
return qdb.sql_connection.TRN.execute_fetchlast() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_jwt() -> str:\n LOGGER.debug(\"Retrieving JWT...\")\n\n args = {\n \"url\": \"{0}/auth\".format(CONFIG['dojot']['url']),\n \"data\": json.dumps({\n \"username\": CONFIG['dojot']['user'],\n \"passwd\": CONFIG['dojot']['passwd'],\n ... | [
"0.8098099",
"0.74195987",
"0.7219842",
"0.7214673",
"0.7200299",
"0.7195657",
"0.7178851",
"0.7167261",
"0.71639985",
"0.70642054",
"0.70072734",
"0.6990219",
"0.69779307",
"0.6958919",
"0.6937453",
"0.69223386",
"0.6915493",
"0.6899356",
"0.6899356",
"0.6899356",
"0.6859692... | 0.0 | -1 |
Not using infinity float('inf'), returning last item from the list that we assume is max val. Recursive function builds a call stack which increments i and gives us the last item first. Each result is then compared with A[i]. | def recursive_max(A, i):
if i >= len(A):
return A[i - 1]
return max(A[i], recursive_max(A, i + 1)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_val_rec(alist):\n ln = len(alist)\n mid = ln//2\n if ln > 2:\n left = max_val_rec(alist[:mid])\n right = max_val_rec(alist[mid:])\n return left if left > right else right\n else:\n return max(alist)",
"def find_max(A):\n\n def rmax(lo, hi):\n \"\"\"Use re... | [
"0.7492405",
"0.72297865",
"0.71833676",
"0.7073333",
"0.6891824",
"0.68816036",
"0.6810575",
"0.6783933",
"0.6723047",
"0.66729504",
"0.6672938",
"0.66624045",
"0.65939707",
"0.6592105",
"0.6584815",
"0.65583956",
"0.65492254",
"0.65439403",
"0.6536988",
"0.65214133",
"0.650... | 0.7843822 | 0 |
Sum given properties from units to region. Sums the properties both in total and by unit type (absolute and relative). | def unit_prop_sums(labeled_units: pd.DataFrame) -> pd.DataFrame:
# Also count units implicitly.
if 'unit_count' not in labeled_units.columns:
labeled_units = labeled_units.assign(unit_count=1)
props = [
col for col in labeled_units.columns
if col not in ('region', 'is_core', 'name') ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calc_region_sum(cube, coord_names, aux_coord_names, grid_type, area_cube, region):\n\n if grid_type == 'curvilinear':\n assert area_cube, \"Must provide an area cube of curvilinear data\"\n\n cube = cube.copy() \n coord_names = coord_names.copy()\n lat_bounds = region_bounds[region]\n\n #... | [
"0.64232886",
"0.547275",
"0.54347354",
"0.5400488",
"0.5390649",
"0.5334661",
"0.5319874",
"0.5312299",
"0.52890813",
"0.52828896",
"0.52815276",
"0.5248052",
"0.5244122",
"0.5219818",
"0.51872563",
"0.51618505",
"0.5160953",
"0.5150361",
"0.5148111",
"0.5141914",
"0.5127154... | 0.6246035 | 1 |
Called before a character traverses an exit. If returns true, the character can pass the exit, else the character can not pass the exit. | def at_character_traverse(self, character):
if not character:
return True
if self.can_bypass(character):
return True
triggered = False
if defines.EVENT_TRIGGER_TRAVERSE in self.events:
for event in self.events[defines.EVENT_TRIGGER_TRAVERSE]:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_if_exit_is_reached(character: dict) -> bool:\n if character[\"Position\"][0] == 4 and character[\"Position\"][1] == 4:\n return True\n else:\n return False",
"def can_exit(self) -> bool:\n return False",
"def at_character_move_in(self, character):\n if not character:... | [
"0.62716216",
"0.6112219",
"0.5984671",
"0.5979515",
"0.5797643",
"0.5754321",
"0.54901594",
"0.5478929",
"0.5478929",
"0.5478929",
"0.5462568",
"0.5456383",
"0.54474187",
"0.5390973",
"0.53720593",
"0.53451264",
"0.53275186",
"0.53222626",
"0.53222626",
"0.53180385",
"0.5301... | 0.615542 | 1 |
Issue request to create an Instance. | def Create(self, name, zone, machine_type, disk_size, preemptible, gce_image,
network, use_with_notebook):
request = self.messages.ComputeInstancesInsertRequest(
project=properties.VALUES.core.project.Get(required=True),
zone=zone,
instance=self.BuildInstanceSpec(
na... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_new_instance( self ):\n\n request_id = self.az_commands.invoke( \"add\",\n background=True,\n bg_callback=self.process_new_instance,\n name=\"{0}-{1}\".format( s... | [
"0.7211795",
"0.6775682",
"0.67273647",
"0.6636322",
"0.6636322",
"0.6464374",
"0.63778275",
"0.6292735",
"0.62738633",
"0.6261031",
"0.6261031",
"0.6261031",
"0.6261031",
"0.6261031",
"0.6261031",
"0.6261031",
"0.6261031",
"0.6261031",
"0.6261031",
"0.6261031",
"0.6261031",
... | 0.0 | -1 |
Combine dicts. If there are duplicate keys, raise an error. | def add_dicts(*args):
new = {}
for arg in args:
for key in arg:
if key in new:
raise ValueError("Duplicate key: %r" % key)
new[key] = arg[key]
return new | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_unique_dicts(*args, **kwargs):\n args = list(args) + [dict(kwargs)]\n conflicts = set()\n result = {}\n for arg in args:\n conflicts |= set(arg.keys()) & set(result.keys())\n result.update(arg)\n if conflicts:\n raise ValueError('Multiple dicts contain the same keys: {... | [
"0.71623373",
"0.7040959",
"0.68217",
"0.68120253",
"0.68120253",
"0.671623",
"0.66430485",
"0.65968674",
"0.656641",
"0.6529817",
"0.64575344",
"0.645125",
"0.6449972",
"0.640711",
"0.63956034",
"0.6371136",
"0.6353436",
"0.6332998",
"0.63303256",
"0.6322103",
"0.6307029",
... | 0.637788 | 15 |
Collect an iterable of key, value pairs into a dict whose keys are the first entries in the pairs and whose values are lists of all the associated values, in the order they appeared. EXAMPLES >>> collect_by_key([(1, 2), (3, 4), (3, 5), (3, 5)]) | def collect_by_key(pair_iter):
out = {}
for (k, v) in pair_iter:
out[k] = out.get(k, [])
out[k].append(v)
return out | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group(iterable, key=None):\n\n groups = collections.defaultdict(list)\n if key is None:\n for k, v in iterable:\n groups[k].append(v)\n else:\n for x in iterable:\n groups[key(x)].append(x)\n return groups",
"def groupbylist(\n iterable: Iterable[_T],\n k... | [
"0.6770039",
"0.6747016",
"0.6368007",
"0.62982696",
"0.607246",
"0.5941471",
"0.58256185",
"0.5619542",
"0.55498075",
"0.5536236",
"0.5508657",
"0.55079126",
"0.54602283",
"0.54170144",
"0.53540736",
"0.53531605",
"0.53498507",
"0.5302084",
"0.5301023",
"0.5288296",
"0.52677... | 0.7277962 | 0 |
Hide messages from the console. | def hide_messages():
print("Keep uncertainty data?")
print("NewDatabase(..., keep_uncertainty_data=True)")
print("")
print("Hide these messages?")
print("NewDatabase(..., quiet=True)") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide(self) -> None:\n thr_is_alive = self._spin_thread and self._spin_thread.is_alive()\n if self._hide_spin is None:\n raise RuntimeError(\"hide_spin is None\")\n\n if thr_is_alive and not self._hide_spin.is_set():\n with self._stdout_lock:\n # set the... | [
"0.70121723",
"0.6999438",
"0.6967163",
"0.6824919",
"0.6814042",
"0.67702603",
"0.67663497",
"0.67161876",
"0.6660189",
"0.65671253",
"0.6518018",
"0.6492463",
"0.6436223",
"0.6427843",
"0.640935",
"0.6350139",
"0.63473463",
"0.6314627",
"0.6299861",
"0.6275983",
"0.62655437... | 0.76987743 | 0 |
creates the tdigest tool for tests the kwargs are not used in this configuration setup | def _config_tdigest(self, **kwargs):
tdigesttool = TDigestTool("tdigesttool")
self._tools.append(tdigesttool.to_msg()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_tang_2(self):\n command_line = (\n self._MENU\n + [self._POOLNAME]\n + self._DEVICES\n + [\"--clevis=tang\", \"--thumbprint=print\", \"--tang-url=http\"]\n )\n TEST_RUNNER(command_line)",
"def test_create_tang_1(self):\n comm... | [
"0.5926641",
"0.5887506",
"0.57642835",
"0.57290447",
"0.5649437",
"0.56484",
"0.55928457",
"0.5585818",
"0.5565449",
"0.5550596",
"0.55396473",
"0.5483852",
"0.547363",
"0.5467479",
"0.5461598",
"0.5437806",
"0.543028",
"0.54164284",
"0.5413375",
"0.54088014",
"0.5401888",
... | 0.70950586 | 0 |
Test get list with invalid credentials. | def test_get_list_with_invalid_credentials(self, m):
url = "https://www.cellartracker.com/xlquery.asp?User=invalid-username&Password=invalid-password&Table=List&Format=tab&Location=1"
file = open("./tests/fixtures/not_logged.html", "r")
m.register_uri("GET", url, status_code=200, text=file.read(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_list_not_authenticated(self):\n response = self.client.get('/api/products/')\n expected = {'detail': 'Authentication credentials were not provided.'}\n self.assertEqual(response.status_code, 401)\n self.assertEqual(response.json(), expected)",
"def test_unauthenticated_get(se... | [
"0.7707388",
"0.76246023",
"0.74490106",
"0.734142",
"0.72727096",
"0.72531587",
"0.71748555",
"0.71159106",
"0.7084084",
"0.7058687",
"0.70243883",
"0.6995761",
"0.6982655",
"0.6969046",
"0.69617116",
"0.69306076",
"0.6907382",
"0.6882749",
"0.6855066",
"0.6825152",
"0.68183... | 0.74695885 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.