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 |
|---|---|---|---|---|---|---|
Equation that computes the value fpr every state s Designed after the Bellman Equation but in a simplified version. U(s) = R(s) + max(P(s'|s, a) U(s)) Computes the reward plus the max value of all neighbouring utilities multiplied by their respective probability to reach the stat s'. The index of the state in the mdp l... | def value(s):
utilities[s[0]][s[1]] = mdp[s[0]][s[1]] + max(
[0.8 * get_utility(s, up) + 0.1 * get_utility(s, left) + 0.1 * get_utility(s, right), # go up
0.8 * get_utility(s, down) + 0.1 * get_utility(s, left) + 0.1 * get_utility(s, right), # go down
0.8 * get_utility(s, right) + 0.1 * ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valueLookAhead(self, state, estState, action):\n # Get the state distribution, assuming we take action.\n newDist = {}\n for pState in range(self.P):\n for newState, prob in self.trans(state, pState)[action].iteritems():\n newF, newP = newState\n if... | [
"0.63959956",
"0.6275889",
"0.62462646",
"0.624482",
"0.5994246",
"0.599054",
"0.595541",
"0.5914437",
"0.59120923",
"0.5864018",
"0.5852646",
"0.585135",
"0.5838503",
"0.58197623",
"0.5814397",
"0.5808862",
"0.5795765",
"0.5792627",
"0.57912683",
"0.5786539",
"0.5786539",
... | 0.59883124 | 6 |
Returns the maximum fitness value amongst those classifiers that anticipated a change in environment. Returns float fitness value | def get_maximum_fitness(self) -> float:
anticipated_change_cls = [cl for cl in self
if cl.does_anticipate_change()]
if len(anticipated_change_cls) > 0:
best_cl = max(anticipated_change_cls, key=lambda cl: cl.fitness)
return best_cl.fitness
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fitness(self) -> float:\n return self._fitness",
"def fitness(self):\n # TO BE DECIDED\n return 1",
"def get_fitness(self) -> float:\n return self.fitness",
"def get_worst_fitness(self):\n f = min(self.characters, key=operator.attrgetter('fitness'))\n self.worst_... | [
"0.7238917",
"0.70598215",
"0.69860375",
"0.66767514",
"0.66764444",
"0.6626239",
"0.65374106",
"0.6536627",
"0.6483798",
"0.64808667",
"0.6463139",
"0.64199084",
"0.6406502",
"0.6397859",
"0.63965994",
"0.6394355",
"0.637886",
"0.6356183",
"0.62841016",
"0.62813205",
"0.6257... | 0.7876762 | 0 |
Reinforcement Learning. Applies RL according to current reinforcement `reward` and backpropagated reinforcement `maximum_fitness`. | def apply_reinforcement_learning(self, reward: int, p) -> None:
for cl in self:
cl.update_reward(reward + self.cfg.gamma * p)
cl.update_intermediate_reward(reward) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getReward(self):\n# def evaluateFitness(self):\n fitness = 0.0\n distance = self.env.getDistance()\n speed = self.env.getSpeed()\n theta = self.env.getOrientation()\n\n ## implementation 101\n timeBonus = (self.maxTime - self.t)/self.maxTime\n alpha = 1.... | [
"0.67312706",
"0.6447246",
"0.6411731",
"0.6369052",
"0.62057984",
"0.61347556",
"0.61018777",
"0.60757226",
"0.60350746",
"0.6016478",
"0.5993919",
"0.59733254",
"0.5926514",
"0.5853887",
"0.58522314",
"0.58331615",
"0.5822406",
"0.5822171",
"0.57918096",
"0.5756099",
"0.574... | 0.61856025 | 5 |
Tests that, when the response is 401 (Unauthorized), another token is created and the call is perfomed again | def test_access_token_refreshed_for_401_response_with_get_method(self):
with patch('hgw_common.models.OAuth2Session', MockOAuth2Session):
MockOAuth2Session.RESPONSES = [401]
proxy = OAuth2SessionProxy(self.service_url, self.client_id, self.client_secret)
session = proxy._sess... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_response(self, response, request):\n\n if (response.status_code == 401 or\n response.status_code == 403):\n login_request = (\"https://\" + self.gateway_address +\n \":\" + self.gateway_port + \"/api/login\")\n r = requests.get(login_re... | [
"0.7190846",
"0.7170655",
"0.7103575",
"0.6855896",
"0.68439335",
"0.681637",
"0.67957395",
"0.6778294",
"0.676298",
"0.6747194",
"0.6719986",
"0.67021424",
"0.66819054",
"0.6668197",
"0.6660556",
"0.6658461",
"0.6645287",
"0.66136867",
"0.6578641",
"0.6576014",
"0.65714955",... | 0.7135864 | 2 |
Tests that, when the response is 401 (Unauthorized), another token is created and the call is perfomed again | def test_access_token_refreshed_for_401_response_with_post_method(self):
with patch('hgw_common.models.OAuth2Session', MockOAuth2Session):
MockOAuth2Session.RESPONSES = [401]
proxy = OAuth2SessionProxy(self.service_url, self.client_id, self.client_secret)
session = proxy._ses... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_response(self, response, request):\n\n if (response.status_code == 401 or\n response.status_code == 403):\n login_request = (\"https://\" + self.gateway_address +\n \":\" + self.gateway_port + \"/api/login\")\n r = requests.get(login_re... | [
"0.7192073",
"0.7136403",
"0.7106031",
"0.68553257",
"0.6843194",
"0.6818554",
"0.67942506",
"0.6777294",
"0.6763374",
"0.6748142",
"0.6722547",
"0.6704803",
"0.6680899",
"0.6666373",
"0.6662378",
"0.66608983",
"0.6645817",
"0.6614437",
"0.6577182",
"0.6573821",
"0.6572467",
... | 0.71706575 | 1 |
Tests that, when the response is 401 (Unauthorized), another token is created and the call is perfomed again | def test_access_token_refreshed_for_token_expired_with_get_method(self):
with patch('hgw_common.models.OAuth2Session', MockOAuth2Session):
MockOAuth2Session.RESPONSES = [TokenExpiredError(), 200]
proxy = OAuth2SessionProxy(self.service_url, self.client_id, self.client_secret)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_response(self, response, request):\n\n if (response.status_code == 401 or\n response.status_code == 403):\n login_request = (\"https://\" + self.gateway_address +\n \":\" + self.gateway_port + \"/api/login\")\n r = requests.get(login_re... | [
"0.7190846",
"0.7170655",
"0.7135864",
"0.7103575",
"0.6855896",
"0.68439335",
"0.681637",
"0.67957395",
"0.6778294",
"0.676298",
"0.6747194",
"0.6719986",
"0.67021424",
"0.66819054",
"0.6668197",
"0.6660556",
"0.6658461",
"0.6645287",
"0.66136867",
"0.6578641",
"0.6576014",
... | 0.62612987 | 69 |
Tests that, when the response is 401 (Unauthorized), another token is created and the call is perfomed again | def test_access_token_refreshed_for_token_expired_with_post_method(self):
with patch('hgw_common.models.OAuth2Session', MockOAuth2Session):
MockOAuth2Session.RESPONSES = [TokenExpiredError(), 200]
proxy = OAuth2SessionProxy(self.service_url, self.client_id, self.client_secret)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_response(self, response, request):\n\n if (response.status_code == 401 or\n response.status_code == 403):\n login_request = (\"https://\" + self.gateway_address +\n \":\" + self.gateway_port + \"/api/login\")\n r = requests.get(login_re... | [
"0.71926534",
"0.7169823",
"0.7135783",
"0.71044725",
"0.6854456",
"0.68421334",
"0.6818287",
"0.6794015",
"0.677644",
"0.6762949",
"0.6746784",
"0.672147",
"0.6703483",
"0.6680659",
"0.6665427",
"0.6660891",
"0.666036",
"0.66455686",
"0.6613312",
"0.65760314",
"0.6573344",
... | 0.6338577 | 52 |
Infer the shape of array_reduce. | async def infer_shape_array_reduce(track, fn, ary, shp):
shp_i = await ary['shape']
shp_v = await shp['value']
if shp_v == ANYTHING:
raise AssertionError(
'We currently require knowing the shape for reduce.'
)
# return (ANYTHING,) * (len(shp_i) - 1)
else:
delt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def infer_shape(self, node, input_shapes):\r\n \"\"\"TODO: Your code here\"\"\"\r\n assert len(input_shapes) == 1\r\n N, C, H, W = input_shapes[0]\r\n p_H = (H + 2 * self.padding - self.kernel_H) / self.stride + 1\r\n p_W = (W + 2 * self.padding - self.kernel_W) / self.stride + 1... | [
"0.6328844",
"0.6306545",
"0.6263927",
"0.6262722",
"0.62377214",
"0.62300354",
"0.61975724",
"0.61384225",
"0.60474706",
"0.6032049",
"0.59896344",
"0.59608215",
"0.5956608",
"0.5942316",
"0.5921671",
"0.58987516",
"0.5894919",
"0.5894919",
"0.5894919",
"0.58867025",
"0.5875... | 0.7044601 | 0 |
Infer the shape of dot. | async def infer_shape_dot(track, a, b):
a_shp = await a['shape']
b_shp = await b['shape']
if len(a_shp) != 2 or len(b_shp) != 2:
raise MyiaShapeError("dot needs matrix inputs")
if (a_shp[1] != b_shp[0] and
a_shp[1] is not ANYTHING and b_shp[0] is not ANYTHING):
raise MyiaShap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_dot_different_sizes():\n dot(Vector(1.0), Vector(2.0, 3.0))",
"def reshape_dot(A, X, Y, tag=None):\n badshape = False\n ashape = (1,) if A.shape == () else A.shape\n xshape = (1,) if X.shape == () else X.shape\n if A.shape == ():\n incshape = X.shape\n elif X.shape == ():\n ... | [
"0.6697334",
"0.63953537",
"0.63561803",
"0.5966471",
"0.5857642",
"0.58226895",
"0.5798699",
"0.5791612",
"0.5787322",
"0.5726738",
"0.56945175",
"0.5682704",
"0.5668489",
"0.566832",
"0.56639963",
"0.56341195",
"0.554692",
"0.5509915",
"0.5507279",
"0.55062914",
"0.54740286... | 0.66271454 | 1 |
Infer the shape of broadcast_shape. | async def infer_shape_broadcast_shape(track, shpx, shpy):
tx = await shpx['type']
ty = await shpy['type']
n = max(len(tx.elements), len(ty.elements))
return TupleShape([NOSHAPE] * n) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _infer_ndim_bcast(ndim, shape, *args):\r\n\r\n # Find the minimum value of ndim required by the *args\r\n if args:\r\n args_ndim = max(arg.ndim for arg in args)\r\n else:\r\n args_ndim = 0\r\n\r\n if isinstance(shape, (tuple, list)):\r\n # there is a convention that -1 means th... | [
"0.6999175",
"0.6916093",
"0.652834",
"0.64898235",
"0.6434872",
"0.6428737",
"0.64267635",
"0.6426141",
"0.6414804",
"0.61560327",
"0.6105694",
"0.6069225",
"0.6038896",
"0.5941974",
"0.59314483",
"0.5897054",
"0.58680534",
"0.5842986",
"0.58233726",
"0.5798773",
"0.5796319"... | 0.62289345 | 9 |
Read the data into pandas dataframe | def read_data(path):
data = pd.read_csv(path)
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_data(self) -> pd.DataFrame:\n data = pd.read_csv(self.data_path)\n assert isinstance(data, pd.DataFrame)\n return data",
"def read_data(self) -> pd.DataFrame:\n data = pd.read_csv(self.data_path)\n assert isinstance(data, pd.DataFrame)\n return data",
"def cre... | [
"0.7515747",
"0.7515747",
"0.7326457",
"0.7305769",
"0.72697955",
"0.70986766",
"0.7002844",
"0.6975786",
"0.6968007",
"0.6913065",
"0.6909649",
"0.6909649",
"0.6909649",
"0.6886862",
"0.6867014",
"0.6859178",
"0.6850545",
"0.68407345",
"0.68407345",
"0.68263054",
"0.6819939"... | 0.63621944 | 78 |
Split the dataset with train_percentage and valid_percentage | def split_dataset(dataset, train_percentage, valid_percentage):
# Split dataset into train and test dataset
train_x, test_x, train_y, test_y = train_test_split(dataset[:, :-1], dataset[:, -1],
train_size=train_percentage + valid_percentage,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_train_test_by_percentage(dataset, train_percentage=0.8):\n train_length = int(len(dataset) * train_percentage)\n return torch.utils.data.random_split(dataset, (train_length, len(dataset) - train_length))",
"def split_data(train_percentage, *data):\n train = [entry[0:int(train_percentage * len(... | [
"0.7936056",
"0.78927046",
"0.7766579",
"0.7762623",
"0.77200615",
"0.76278967",
"0.74983263",
"0.7473945",
"0.7468452",
"0.7447927",
"0.7447927",
"0.7447927",
"0.7411032",
"0.73409545",
"0.73409545",
"0.73253465",
"0.7312945",
"0.73109406",
"0.7271129",
"0.72421694",
"0.7242... | 0.86284775 | 0 |
Y = InputTensor KernelTensor + Bias, where '' is the convolution operator | def forward(self, in_tensors: List[Tensor], out_tensors: List[Tensor]):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def net_input(self, X):\n return np.dot(X, self.weight_[1:]) + self.weight_[0]",
"def net_input(self, X):\n return np.dot(X, self.weight_[1:]) + self.weight_[0]",
"def dot_product(x, kernel):\n return K.squeeze(K.dot(x, K.expand_dims(kernel)), axis=-1)",
"def conv2d(self, x, W, b, stride... | [
"0.61924565",
"0.61924565",
"0.61705303",
"0.6160084",
"0.61120224",
"0.60937726",
"0.6070947",
"0.6034044",
"0.6030031",
"0.60256094",
"0.60256094",
"0.60256094",
"0.60256094",
"0.6022201",
"0.5989617",
"0.59869367",
"0.59802604",
"0.5977874",
"0.5971373",
"0.5970373",
"0.59... | 0.0 | -1 |
Applies network layers and ops on input image(s) x. | def forward(self, x):
# sources保存特征图,loc与conf保存所有PriorBox的位置与类别预测特征
sources = list()
loc = list()
conf = list()
# 对输入图像卷积到conv4_3,将特征添加到sources中
for k in range(23):
x = self.vgg[k](x)
s = self.L2Norm(x)
sources.append(s)
# 继续卷积到conv7... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_network(inputs):\n return apply_layer(tf.sigmoid(apply_layer(inputs, 64)), 1)",
"def forward(self, x):\n for task_module_name in self.task_module_name_path[self.task_idx]:\n for layer in self.task_modules[task_module_name]:\n x = layer(x)\n #x = self.task_... | [
"0.65635645",
"0.6369926",
"0.6366342",
"0.6353145",
"0.6308525",
"0.63080144",
"0.6259044",
"0.6207936",
"0.61983746",
"0.6192247",
"0.6176785",
"0.6163958",
"0.61539495",
"0.61442596",
"0.61295325",
"0.61276245",
"0.6121304",
"0.6115892",
"0.61109567",
"0.60991436",
"0.6084... | 0.5751633 | 95 |
Returns absolute number of rows in the grid. | def rowCount(self):
return abs(self.minRow) + abs(self.maxRow) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rows(self) -> int:\n return self.__squares.__len__()",
"def num_cells_for_rows(self, rows):\r\n return (rows * rows + rows) // 2",
"def row_count(self):\n return self.well_count // self.col_count",
"def number_of_rows(self):\n if self.number_of_columns():\n return s... | [
"0.7804376",
"0.77589786",
"0.76827997",
"0.7606225",
"0.75964206",
"0.7586814",
"0.7421772",
"0.73453814",
"0.73331654",
"0.7332422",
"0.7307966",
"0.72849387",
"0.723987",
"0.7201067",
"0.71970165",
"0.71309996",
"0.71226245",
"0.71226245",
"0.70973474",
"0.70826036",
"0.70... | 0.80579096 | 0 |
Returns absolute number of columns in the grid. | def columnCount(self):
return abs(self.minCol) + abs(self.maxCol) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def columns(self) -> int:\n return self.__squares[0].__len__()",
"def n_cols(self):\n ch = self.children\n return 1 if not ch else sum([c.n_cols for c in ch])",
"def num_cols(self):\n return (len(self.rows[0]))",
"def num_cols(self):\n return len(self.rows[0])",
"def ncol... | [
"0.8077689",
"0.77736115",
"0.7680731",
"0.76398987",
"0.754315",
"0.7478485",
"0.7290526",
"0.7256126",
"0.72508126",
"0.72467464",
"0.7177205",
"0.71602553",
"0.71590674",
"0.7126985",
"0.7100675",
"0.7076613",
"0.7067494",
"0.70548874",
"0.70025945",
"0.6988807",
"0.692737... | 0.8008744 | 1 |
Convert data_dict5 from fetch data to a DataFrame | def to_dataframe(self, data_dict):
return pd.DataFrame.from_dict(data_dict, orient='index') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_into_df(data: dict) -> pd.DataFrame:\n data = data['data']\n data = pd.DataFrame(data)\n return data",
"def dict_to_DataFrame(data):\n return pd.DataFrame.from_dict(data)",
"def _fetch_data(url: str, d: datetime) -> pd.DataFrame:\n return pd.read_json(url)",
"def FetchQueryResultToDF(... | [
"0.69817686",
"0.6694534",
"0.65843105",
"0.6536168",
"0.6534915",
"0.6522982",
"0.64867085",
"0.6468476",
"0.63374615",
"0.6318027",
"0.6278911",
"0.6247464",
"0.6216652",
"0.62146693",
"0.6173521",
"0.61723185",
"0.6139726",
"0.61310965",
"0.6128753",
"0.61042124",
"0.60866... | 0.6272986 | 11 |
Top Left of the rect | def p1(self):
return tuple(self.rect[:2]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _rect_left(self):\n\treturn min(self.x, self.x + self.w)",
"def get_pos(self):\n return self.rect.midtop",
"def getupperleft(self):\n return (self.rect.x, self.rect.y)",
"def top_left(self):\n return Point(self.left, self.top)",
"def _rect_top(self):\n\treturn max(self.y, self.y + ... | [
"0.8035909",
"0.76862305",
"0.76860917",
"0.75175405",
"0.738069",
"0.72833216",
"0.72814554",
"0.72353387",
"0.7221124",
"0.69826585",
"0.6981852",
"0.6954852",
"0.68892753",
"0.6829311",
"0.6791437",
"0.67738724",
"0.67738724",
"0.6756044",
"0.6728253",
"0.6722845",
"0.6703... | 0.0 | -1 |
Top Right of the rect | def p2(self):
return tuple(self.rect[2:]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _rect_right(self):\n\treturn max(self.x, self.x + self.w)",
"def _rect_top(self):\n\treturn max(self.y, self.y + self.h)",
"def topRightCorner(self):\n self._updateExtents()\n return (self._mMaxX,self._mMinY)",
"def getRect(self):\n return self.rect",
"def getRect(self):\n r... | [
"0.8114361",
"0.7912345",
"0.74609035",
"0.7297045",
"0.7247714",
"0.7143074",
"0.71086615",
"0.70746887",
"0.7065676",
"0.7062324",
"0.7062324",
"0.7048336",
"0.6961353",
"0.69486403",
"0.69486403",
"0.689747",
"0.6879008",
"0.68281925",
"0.6810133",
"0.67962074",
"0.6774698... | 0.0 | -1 |
Constructor for the Data class | def __init__(self,
external_ids=None,
harsh_accel_setting=None,
name=None):
# Initialize members of the class
self.external_ids = external_ids
self.harsh_accel_setting = harsh_accel_setting
self.name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, dat):\n self.data = dat",
"def __init__(self, data):\n self.data = data\n return",
"def __init__(self, data=None):\n self.data = data",
"def __init__(self, data):\n self.data = data",
"def __init__(self, data):\n self.data = data",
"def __init_... | [
"0.83237803",
"0.8132194",
"0.80846316",
"0.80845857",
"0.80845857",
"0.80845857",
"0.80845857",
"0.7906321",
"0.7782925",
"0.7768739",
"0.7738014",
"0.76551765",
"0.76392835",
"0.75857204",
"0.7547089",
"0.7529738",
"0.75049067",
"0.74773717",
"0.7470606",
"0.74258775",
"0.7... | 0.0 | -1 |
Creates an instance of this model from a dictionary | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
# Extract variables from the dictionary
external_ids = dictionary.get('externalIds')
harsh_accel_setting = dictionary.get('harsh_accel_setting')
name = dictionary... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction... | [
"0.83181584",
"0.8168118",
"0.8168118",
"0.8118749",
"0.79787344",
"0.7949278",
"0.79231393",
"0.7898951",
"0.78923255",
"0.788838",
"0.7882321",
"0.7882212",
"0.7876749",
"0.78585315",
"0.7836853",
"0.7801407",
"0.7801407",
"0.7801407",
"0.7801407",
"0.7801407",
"0.7801407",... | 0.8089047 | 4 |
Render the subject of the message to a string. | def subject(self):
subject = loader.render_to_string(self.subject_template_name,
self.get_context())
return ''.join(subject.splitlines()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subject(template_name):\n subject = loader.render_to_string(template_name,\n self.get_context())\n return ''.join(subject.splitlines())",
"def getSubject(self):\r\n return self.msg[\"Subject\"]",
"def subject(self) -> pulumi.Output[str]:\n return pul... | [
"0.71755385",
"0.71561915",
"0.6786266",
"0.6657449",
"0.66417027",
"0.66417027",
"0.654454",
"0.6521709",
"0.6473842",
"0.6458076",
"0.63981247",
"0.63971317",
"0.63539356",
"0.63169706",
"0.627697",
"0.62676024",
"0.62638736",
"0.62637544",
"0.62261665",
"0.62240094",
"0.62... | 0.7857806 | 0 |
Generate the various parts of the message and return them in a dictionary, suitable for passing directly as keyword arguments to ``django.core.mail.send_mail()``. | def get_message_dict(self):
if not self.is_valid():
raise ValueError("Message cannot be sent from invalid contact form")
message_dict = {}
for message_part in ('from_email', 'message', 'recipient_list', 'subject'):
attr = getattr(self, message_part)
message_di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_message(message):\n return {\n \"subject\": message.subject,\n \"sender\": message.sender_name,\n \"header\": message.transport_headers,\n \"body\": message.plain_text_body,\n \"creation_time\": message.creation_time,\n \"submit_time\": message.client_submit... | [
"0.64509135",
"0.64036316",
"0.64036316",
"0.6396527",
"0.6374369",
"0.62945116",
"0.6290742",
"0.62677175",
"0.62500894",
"0.62500894",
"0.61899275",
"0.61875933",
"0.61548764",
"0.6137926",
"0.6134927",
"0.61183155",
"0.6013581",
"0.59692734",
"0.5924273",
"0.5912907",
"0.5... | 0.6891371 | 0 |
Format minutes from midnight in 12 hr format. | def format_12hr(minutes):
hours = (minutes // 60) % 24
minutes %= 60
#am_pm = 'AM' if hours < 12 else 'PM'
#hours = (hours - 1) % 12 + 1
return '{}:{:02}'.format(hours, minutes)
#return '{}:{:02} {}'.format(hours, minutes, am_pm) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_time(self):\n now = datetime.datetime.now()\n hour = 12 if now.hour % 12 == 0 else now.hour % 12\n meridiem = \"AM\" if now.hour < 12 else \"PM\"\n return \"%d:%02d %s\" % (hour, now.minute, meridiem)",
"def add_minutes(self):\n r = self.minute + self.value\n x =... | [
"0.6826055",
"0.6746184",
"0.6588419",
"0.65766263",
"0.65569407",
"0.644617",
"0.64460003",
"0.63875264",
"0.62584984",
"0.61600626",
"0.61466664",
"0.60845155",
"0.6018475",
"0.59599817",
"0.59234595",
"0.5826179",
"0.58253443",
"0.57914937",
"0.57887346",
"0.5783135",
"0.5... | 0.77135885 | 0 |
Takes the column x from the dataframe df and takes the value from x to the power n | def poly(df, n):
poly = pd.Series(df.x**n, name="poly_" + str(n))
df = df.join(poly)
return df | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def power(x, n):\n value = 1\n for i in range(n):\n value = multiply(value, x)\n return value",
"def power(x, n):\n power = 1\n for i in range(abs(n)):\n power = multiply(power, x) \n return power",
"def signedpower(x: pd.Series, a) -> pd.Series:\n return x.pow(a)",
"def po... | [
"0.6898769",
"0.68551344",
"0.6658289",
"0.6646529",
"0.6637664",
"0.6556317",
"0.6543414",
"0.6538073",
"0.6495036",
"0.64834565",
"0.6468284",
"0.642525",
"0.6413629",
"0.63185465",
"0.6283585",
"0.6208683",
"0.61759835",
"0.6163627",
"0.6160184",
"0.61013806",
"0.6095624",... | 0.6445911 | 11 |
Draw n cards from a deck but skip any cards listed in exclusions. Please note this func always returns a list, unlike native deuces draw function. | def draw_sure(deck, n, exclusions):
drawn = []
while len(drawn) < n:
c = deck.draw()
if c in exclusions + drawn:
continue
drawn.append(c)
return drawn | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drawN(self,n):\n c = self.cards[:n]\n self.cards = self.cards[n:]\n self.discards += c\n return(c)",
"def draw(self, count=1):\n try:\n for i in range(count):\n yield self.deck.pop()\n except IndexError:\n yield None",
"def test... | [
"0.7362264",
"0.6499554",
"0.62972665",
"0.6264942",
"0.6016332",
"0.6013867",
"0.5983034",
"0.59069717",
"0.5791131",
"0.57727516",
"0.5760312",
"0.57263887",
"0.56593496",
"0.5623744",
"0.5619953",
"0.5619711",
"0.5612314",
"0.56044114",
"0.55818534",
"0.5570277",
"0.556425... | 0.8341839 | 0 |
Given a post id, update it's num_replies. | def update_post(reply_to, connection):
database = connection['test']
collection = database['posts']
collection.update({"_id" : ObjectId(reply_to)},
{"$inc" : {"num_replies" : 1}}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_reply(name, title, reply_id):\n reply = reply_service.get_reply(reply_id)\n if reply:\n if reply.user_id != current_user.id:\n return redirect(url_for(\"post.post\", name=name, title=title))\n form = ReplyForm()\n if form.validate_on_submit():\n reply_ser... | [
"0.5925652",
"0.5892608",
"0.5685023",
"0.5659814",
"0.55749756",
"0.5495586",
"0.54039484",
"0.53174335",
"0.5291571",
"0.5266144",
"0.5250236",
"0.52115464",
"0.5190164",
"0.5146563",
"0.51212406",
"0.510447",
"0.4998886",
"0.49860176",
"0.49762118",
"0.49233162",
"0.492122... | 0.73623997 | 0 |
Given image data, shrink it to no greater than 1024 for its larger dimension. | def adjust_image_resolution(data):
output_large = cStringIO.StringIO()
output_default = cStringIO.StringIO()
output_tiny = cStringIO.StringIO()
try:
im0 = Image.open(cStringIO.StringIO(data))
im0.thumbnail((1280, 1280), Image.ANTIALIAS)
im0.save(output_large, 'JPEG')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __resize_to_512(input_data):\n test_size = 720\n\n if DataAugmentor._is_synthtext(input_data):\n input_data['contour'] = [[np.cast['int32'](np.stack([contour[:, :, 0] * 512 / input_data['img'].shape[0],\n contour[:, :, 1] ... | [
"0.71494573",
"0.6800072",
"0.6752898",
"0.6508731",
"0.64812744",
"0.643141",
"0.63709295",
"0.6265624",
"0.62093174",
"0.61572236",
"0.6130931",
"0.60843366",
"0.6073214",
"0.607063",
"0.6028588",
"0.60252136",
"0.6021699",
"0.6004815",
"0.59916234",
"0.59826267",
"0.593327... | 0.5410976 | 71 |
Test that if the endpoint returns 400, no version is created. | def test_add_400_doesnt_create_a_new_version(self):
assert Version.objects.count() == 0
response = self.api_client.post(
reverse('api-v4:company:collection'),
data={'name': 'Acme'},
)
assert response.status_code == status.HTTP_400_BAD_REQUEST
assert Vers... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bad_requests_give_400(self):\n self.assertEqual(self._request({}), 400)",
"def test_archive_400_doesnt_create_a_new_version(self):\n company = CompanyFactory()\n assert Version.objects.get_for_object(company).count() == 0\n\n url = reverse('api-v4:company:archive', kwargs={'p... | [
"0.7091784",
"0.6988419",
"0.6935331",
"0.6877457",
"0.6859045",
"0.6843883",
"0.68005425",
"0.67946255",
"0.67858624",
"0.67699283",
"0.6725788",
"0.6701022",
"0.6684612",
"0.6645155",
"0.6622762",
"0.6579261",
"0.65285784",
"0.6525312",
"0.6519343",
"0.6519226",
"0.6516835"... | 0.73233515 | 0 |
Test that updating a company creates a new version. | def test_update_creates_a_new_version(self):
company = CompanyFactory(name='Foo ltd.')
assert Version.objects.get_for_object(company).count() == 0
response = self.api_client.patch(
reverse('api-v4:company:item', kwargs={'pk': company.pk}),
data={'name': 'Acme'},
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_website_companies_update(self):\n pass",
"def test_add_creates_a_new_version(self):\n assert Version.objects.count() == 0\n\n response = self.api_client.post(\n reverse('api-v4:company:collection'),\n data={\n 'name': 'Acme',\n 'tr... | [
"0.80215794",
"0.7531917",
"0.746801",
"0.7121284",
"0.7082447",
"0.70714617",
"0.70493877",
"0.70230037",
"0.70163417",
"0.70163417",
"0.70163417",
"0.6965089",
"0.6965089",
"0.6955313",
"0.6921981",
"0.69101757",
"0.68684804",
"0.6843579",
"0.67602545",
"0.67395025",
"0.671... | 0.84506714 | 0 |
Test that if the endpoint returns 400, no version is created. | def test_update_400_doesnt_create_a_new_version(self):
company = CompanyFactory()
response = self.api_client.patch(
reverse('api-v4:company:item', kwargs={'pk': company.pk}),
data={'trading_names': ['a' * 600]},
)
assert response.status_code == status.HTTP_400_B... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_add_400_doesnt_create_a_new_version(self):\n assert Version.objects.count() == 0\n\n response = self.api_client.post(\n reverse('api-v4:company:collection'),\n data={'name': 'Acme'},\n )\n\n assert response.status_code == status.HTTP_400_BAD_REQUEST\n ... | [
"0.73233515",
"0.7091784",
"0.6988419",
"0.6935331",
"0.6877457",
"0.6859045",
"0.6843883",
"0.68005425",
"0.67946255",
"0.67858624",
"0.67699283",
"0.6725788",
"0.6684612",
"0.6645155",
"0.6622762",
"0.6579261",
"0.65285784",
"0.6525312",
"0.6519343",
"0.6519226",
"0.6516835... | 0.6701022 | 12 |
Test that if the endpoint returns 400, no version is created. | def test_archive_400_doesnt_create_a_new_version(self):
company = CompanyFactory()
assert Version.objects.get_for_object(company).count() == 0
url = reverse('api-v4:company:archive', kwargs={'pk': company.id})
response = self.api_client.post(url)
assert response.status_code == ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_add_400_doesnt_create_a_new_version(self):\n assert Version.objects.count() == 0\n\n response = self.api_client.post(\n reverse('api-v4:company:collection'),\n data={'name': 'Acme'},\n )\n\n assert response.status_code == status.HTTP_400_BAD_REQUEST\n ... | [
"0.73233515",
"0.7091784",
"0.6935331",
"0.6877457",
"0.6859045",
"0.6843883",
"0.68005425",
"0.67946255",
"0.67858624",
"0.67699283",
"0.6725788",
"0.6701022",
"0.6684612",
"0.6645155",
"0.6622762",
"0.6579261",
"0.65285784",
"0.6525312",
"0.6519343",
"0.6519226",
"0.6516835... | 0.6988419 | 2 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, NicOrderByInput):
return False
return self.to_dict() == other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
if not isinstance(other, NicOrderByInput):
return True
return self.to_dict() != other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
... | 0.0 | -1 |
Get a model object from the cache. If the object is not in cache gets it from the database and also populates it in the cache. | def get(model_class, id):
key = build_key(model_class, id)
user = cache.get(key)
if user is None: # Not in cache
logger.info(" CACHE MISS key=%s", key)
user = User.objects.filter(id=id).first()
if user is not None: # Found in DB
logger.info(" CACHE POPULATE key=%s", k... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(cls, obj: Model):\n return cache.get(cls._construct_key(obj))",
"def _get_cached_instance(self):\n\n try:\n identifier = self._get_identifier()\n except (ValueError, ObjectDoesNotExist) as error:\n if self._fail_silently:\n return None\n ... | [
"0.8195093",
"0.7850789",
"0.7659025",
"0.7151221",
"0.7017604",
"0.699025",
"0.69631517",
"0.6893821",
"0.68212175",
"0.680952",
"0.67751163",
"0.6747229",
"0.6668772",
"0.66621184",
"0.66026354",
"0.6550757",
"0.65413266",
"0.65309036",
"0.65137017",
"0.6505941",
"0.6488995... | 0.73587143 | 3 |
Removes model object from the database and invalidates any cached version. | def remove(model_class, id):
key = build_key(model_class, id)
logger.info(" CACHE INVALIDATE key=%s", key)
cache.delete(key) # Invalidate from cache
User.objects.filter(id=id).delete() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete(self):\n self.dbm().model_delete(self)",
"def delete(self, model):\n self._isinstance(model)\n db.session.delete(model)\n db.session.commit()",
"def delete_model(self):\n os.remove(self.filepath)\n self.cmodel = None",
"def model_delete(self, db):\n ... | [
"0.7763112",
"0.727174",
"0.72315556",
"0.7185891",
"0.70813644",
"0.70813644",
"0.7045541",
"0.70288724",
"0.70222336",
"0.70206976",
"0.69877464",
"0.6973504",
"0.69595337",
"0.69389176",
"0.6891114",
"0.6875338",
"0.68462616",
"0.68211985",
"0.6781254",
"0.6751494",
"0.674... | 0.645703 | 53 |
converts a 'YYYYMMDD' date string into a datetime.date instance | def trost2date(trost_date):
year, month, day = (int(val) for val in trost_date.split('-'))
return datetime.date(year, month, day) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_str2date(date):\n import datetime\n date = str(date)\n year = int(date[0:4])\n month = int(date[4:6])\n day = int(date[6:8])\n return datetime.datetime(year,month,day)",
"def string_to_date(string):\n params = string.strip().split('-')\n year = int(params[0])\n ... | [
"0.81115305",
"0.78631806",
"0.7722719",
"0.76183206",
"0.7563316",
"0.75320166",
"0.75243413",
"0.7497385",
"0.74518746",
"0.7444318",
"0.74200547",
"0.74096715",
"0.7360298",
"0.73536086",
"0.7352574",
"0.73381245",
"0.73323494",
"0.7299964",
"0.72990555",
"0.7274473",
"0.7... | 0.67366326 | 53 |
converts a datetime.date instance into a 'YYYYMMDD' date string | def date2trost(datetime_date):
# '0>2' means: add leading zero(s) if the int is less than two digits long
return '{0}-{1:0>2}-{2:0>2}'.format(datetime_date.year, datetime_date.month, datetime_date.day) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date_to_final_str(date_obj: datetime) -> str:\n return date_obj.strftime(\"%Y-%m-%d\")",
"def convert_datetime_to_string(dt):\n\treturn '{0}-{1}-{2}'.format(dt.year, dt.month, dt.day)",
"def convert_datetime_to_string(dt):\n\treturn '{0}-{1}-{2}'.format(dt.year, dt.month, dt.day)",
"def format_dat... | [
"0.7577513",
"0.75459224",
"0.75459224",
"0.7369762",
"0.7199356",
"0.71808517",
"0.71612895",
"0.7115672",
"0.69677943",
"0.6905097",
"0.6904665",
"0.68750745",
"0.686822",
"0.68602747",
"0.6847188",
"0.6808656",
"0.6765186",
"0.6765186",
"0.67605585",
"0.67285174",
"0.67041... | 0.6245926 | 64 |
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 | 63 |
Set the measurement time for all measurements in seconds or number of PLCs | def set_meas_time_all(instrument, time_meas):
set_meas_time_current(instrument, time_meas)
set_meas_time_voltage(instrument, time_meas)
set_meas_time_resistance(instrument, time_meas) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_time(self, value: float):\n raise NotImplementedError()",
"def set_time(self, value: float):\n if value < 0:\n value = 0\n\n self.controller.row = self.rps * value",
"def set_analysis_time(self, t):\n for z in self.zones:\n z.set_demand_rate_per_t(t)",
... | [
"0.6343147",
"0.6336835",
"0.6270319",
"0.6248847",
"0.6220612",
"0.62039334",
"0.6172039",
"0.61621517",
"0.61248773",
"0.6107487",
"0.60990936",
"0.60889274",
"0.60378313",
"0.6035957",
"0.60323703",
"0.6010769",
"0.5993412",
"0.59791756",
"0.5977888",
"0.5955699",
"0.59386... | 0.7607404 | 0 |
Turns voltage measured into pressure in bars | def volt_to_pressure(volt):
return volt/10 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_pressure(self): # This function implements the equations needed to convert the digital data into mbars\n self.digital_pressure_data()\n C_1, C_2, C_3, C_4, C_5, C_6=self.calibration_constants()\n temperature, dT=self.get_temperature()\n OFF = ((C_2 * (2**16)) + ((C_4 * dT)/2**7)... | [
"0.6864251",
"0.6453888",
"0.6392035",
"0.624221",
"0.61990255",
"0.61630654",
"0.61309296",
"0.6026565",
"0.6026565",
"0.6026565",
"0.5995043",
"0.5971631",
"0.59542996",
"0.5890677",
"0.5785599",
"0.57339394",
"0.57283366",
"0.57034266",
"0.56933784",
"0.56883925",
"0.56601... | 0.7050259 | 0 |
Gets the id of this CustomerDataAddressInterface. ID | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_address_id(self):\n return self.complete_address[-1]",
"def id(self):\n return self.data.id",
"def id(self):\n return self.get_data(\"id\")",
"def id(self) -> int:\n return self._id",
"def id(self) -> int:\n return self._id",
"def id(self) -> int:\n retur... | [
"0.682819",
"0.65155554",
"0.63645846",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.62999654",
"0.6249951",
"0.62380916",
"0.62063897",
... | 0.6076512 | 83 |
Sets the id of this CustomerDataAddressInterface. ID | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, id):\n self.data['id'] = id",
"def set_id(self, id_):\n\n self.id_ = id_",
"def set_id(self, id):\n self.__id = id",
"def address_id(self, address_id):\n\n self._address_id = address_id",
"def address_id(self, address_id):\n\n self._address_id = address_i... | [
"0.6792004",
"0.6755937",
"0.6695045",
"0.6678956",
"0.6678956",
"0.66564316",
"0.6611567",
"0.6505768",
"0.64088255",
"0.64088255",
"0.64088255",
"0.64088255",
"0.64088255",
"0.64088255",
"0.64088255",
"0.64088255",
"0.64088255",
"0.64088255",
"0.6407045",
"0.6407045",
"0.64... | 0.6359891 | 92 |
Sets the customer_id of this CustomerDataAddressInterface. Customer ID | def customer_id(self, customer_id):
self._customer_id = customer_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def customer_id(self, customer_id: str):\n self._customer_id = customer_id",
"def customer_id(self, customer_id):\n if customer_id is None:\n raise ValueError(\"Invalid value for `customer_id`, must not be `None`\") # noqa: E501\n\n self._customer_id = customer_id",
"def custom... | [
"0.816843",
"0.78088653",
"0.78088653",
"0.68915325",
"0.68710107",
"0.6818259",
"0.66023535",
"0.66023535",
"0.65923584",
"0.63956434",
"0.6387998",
"0.63204587",
"0.6107052",
"0.6102946",
"0.6046443",
"0.60400087",
"0.60400087",
"0.59454525",
"0.59404796",
"0.5817029",
"0.5... | 0.81606346 | 3 |
Gets the region of this CustomerDataAddressInterface. | def region(self):
return self._region | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region(self):\n # type: () -> string_types\n return self._region",
"def region(self):\n return self._get(\"region\")",
"def geo_region(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"geo_region\")",
"def geo_region(self) -> pulumi.Output[str]:\n return pulumi.g... | [
"0.7059831",
"0.69885665",
"0.6927399",
"0.6927399",
"0.6883999",
"0.6713514",
"0.6713514",
"0.6713514",
"0.6702879",
"0.6702879",
"0.6702879",
"0.6702879",
"0.6702879",
"0.6702879",
"0.66888773",
"0.6683018",
"0.6683018",
"0.6683018",
"0.6683018",
"0.6683018",
"0.6683018",
... | 0.7007811 | 2 |
Gets the region_id of this CustomerDataAddressInterface. Region ID | def region_id(self):
return self._region_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_id(self) -> str:\n return self._region_id",
"def cen_region_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"cen_region_id\")",
"def cen_region_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"cen_region_id\")",
"def region(self):\n return... | [
"0.78765",
"0.6818813",
"0.6758867",
"0.6703481",
"0.6702419",
"0.6680769",
"0.6680769",
"0.66756785",
"0.66518897",
"0.6594691",
"0.6594691",
"0.6594691",
"0.6594691",
"0.6594691",
"0.6594691",
"0.6547776",
"0.6532324",
"0.6523012",
"0.6494858",
"0.64697117",
"0.6460245",
... | 0.80575335 | 0 |
Gets the street of this CustomerDataAddressInterface. Street | def street(self):
return self._street | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def street_address(self):\n if \"streetAddress\" in self._prop_dict:\n return self._prop_dict[\"streetAddress\"]\n else:\n return None",
"def street(self):\n if \"street\" in self._prop_dict:\n return self._prop_dict[\"street\"]\n else:\n re... | [
"0.79375285",
"0.79227364",
"0.70314324",
"0.69911814",
"0.69517547",
"0.6804679",
"0.67222214",
"0.6517667",
"0.648356",
"0.64687985",
"0.6437355",
"0.6437355",
"0.64059055",
"0.63728523",
"0.6301748",
"0.62221766",
"0.6221261",
"0.61685723",
"0.61685723",
"0.61419874",
"0.6... | 0.81314886 | 0 |
Gets the company of this CustomerDataAddressInterface. Company | def company(self):
return self._company | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_company(self, name):\n return self.instance.company.id",
"def get_company(self, name):\n return self.website.company.id",
"def get_company(self, name):\n return self.store.company.id",
"def get_company(self, company_referece):\n url = 'companies/{0}'.format(company_referec... | [
"0.6726592",
"0.6721949",
"0.66835284",
"0.66748154",
"0.6314727",
"0.59953064",
"0.5983446",
"0.5958916",
"0.59562314",
"0.5946536",
"0.5885877",
"0.58071154",
"0.57800084",
"0.5642553",
"0.5623332",
"0.55560964",
"0.555422",
"0.5516543",
"0.5476469",
"0.54762566",
"0.544625... | 0.74450135 | 1 |
Sets the company of this CustomerDataAddressInterface. Company | def company(self, company):
self._company = company | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def company(self, company):\n self._company = company",
"def design_company(self, design_company):\n\n self._design_company = design_company",
"def set_CompanyName(self, value):\n super(AddressValidationInputSet, self)._set_input('CompanyName', value)",
"def company_name(self, company_na... | [
"0.74536395",
"0.6540079",
"0.6434683",
"0.62899077",
"0.6161135",
"0.6039475",
"0.5861563",
"0.5861563",
"0.54881966",
"0.54319745",
"0.52515304",
"0.5224434",
"0.51109457",
"0.5058227",
"0.5012829",
"0.49740857",
"0.49712974",
"0.4965515",
"0.494854",
"0.4939852",
"0.493443... | 0.7456263 | 0 |
Gets the telephone of this CustomerDataAddressInterface. Telephone number | def telephone(self):
return self._telephone | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def telephone(self) -> str:\n return self._telephone",
"def phone(self):\n return self._phone",
"def phone(self):\n return self._phone",
"def phone(self):\n return self._phone",
"def phone(self):\n\n return self._phone",
"def phone_number(self):\n\n return self._... | [
"0.7809867",
"0.6902751",
"0.6902751",
"0.6902751",
"0.6853429",
"0.6832103",
"0.6818223",
"0.67859256",
"0.66086394",
"0.6542314",
"0.6498496",
"0.6495328",
"0.6363214",
"0.62654895",
"0.6255027",
"0.6161126",
"0.6159408",
"0.6159408",
"0.6098511",
"0.6098511",
"0.60974705",... | 0.7947165 | 0 |
Sets the telephone of this CustomerDataAddressInterface. Telephone number | def telephone(self, telephone):
self._telephone = telephone | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def telephone(self, telephone: str):\n\n self._telephone = telephone",
"def setPhone(self,phone):\r\n self.phone = phone",
"def phone(self, new_number):\n self._phone.number = new_number",
"def setPhone(self, phone):\n self.phone = phone\n return self",
"def telephone(sel... | [
"0.7624022",
"0.65913314",
"0.6464244",
"0.64262176",
"0.63962036",
"0.6375898",
"0.6300662",
"0.6300662",
"0.6300662",
"0.6300662",
"0.6300662",
"0.6206605",
"0.619952",
"0.61410004",
"0.61368835",
"0.61368835",
"0.61368835",
"0.61368835",
"0.60012984",
"0.59724396",
"0.5929... | 0.78000355 | 0 |
Gets the postcode of this CustomerDataAddressInterface. Postcode | def postcode(self):
return self._postcode | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postal_code(self):\n return self._postal_code",
"def postal_code(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"postal_code\")",
"def postal_code(self):\n if \"postalCode\" in self._prop_dict:\n return self._prop_dict[\"postalCode\"]\n else:\n ... | [
"0.7527976",
"0.7401798",
"0.72494",
"0.72494",
"0.6992797",
"0.6953358",
"0.6953358",
"0.6953358",
"0.66479707",
"0.6565552",
"0.6251187",
"0.6241421",
"0.6193039",
"0.6124864",
"0.6124864",
"0.60068965",
"0.59880805",
"0.5966017",
"0.59659135",
"0.59401274",
"0.57912326",
... | 0.8083002 | 0 |
Sets the postcode of this CustomerDataAddressInterface. Postcode | def postcode(self, postcode):
self._postcode = postcode | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_code(self, post_code):\n\n self._post_code = post_code",
"def postal_code(self, postal_code):\n\n self._postal_code = postal_code",
"def postal_code(self, postal_code):\n\n self._postal_code = postal_code",
"def postal_code(self, postal_code):\n\n self._postal_code = post... | [
"0.74411196",
"0.7251725",
"0.7251725",
"0.7251725",
"0.7093361",
"0.6674712",
"0.6398645",
"0.6398645",
"0.58854604",
"0.5856356",
"0.56992316",
"0.56903064",
"0.56903064",
"0.56133443",
"0.55849665",
"0.5469704",
"0.54298115",
"0.53656393",
"0.53656393",
"0.53656393",
"0.53... | 0.7907968 | 0 |
Gets the firstname of this CustomerDataAddressInterface. First name | def firstname(self):
return self._firstname | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_first_name(self):\n return self._first_name",
"def get_first_name(self) -> str:\n return self.first_name",
"def first_name(self) -> str:\n return self._first_name",
"def first_name(self):\n return self._first_name",
"def first_name(self):\n return self._first_name... | [
"0.8033568",
"0.8017473",
"0.7964822",
"0.7907452",
"0.7907452",
"0.7907452",
"0.7829355",
"0.75435305",
"0.7399718",
"0.7399718",
"0.73918355",
"0.73918355",
"0.73918355",
"0.73918355",
"0.73918355",
"0.73918355",
"0.73918355",
"0.73918355",
"0.73918355",
"0.73918355",
"0.73... | 0.7893197 | 7 |
Sets the firstname of this CustomerDataAddressInterface. First name | def firstname(self, firstname):
self._firstname = firstname | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_first_name(self, first_name):\n self.first_name = first_name",
"def first_name(self, name):\n self._first_name = name",
"def first_name(self, first_name):\n\n self._first_name = first_name",
"def first_name(self, first_name):\n\n self._first_name = first_name",
"def firs... | [
"0.82470214",
"0.8191754",
"0.8026349",
"0.8026349",
"0.8026349",
"0.8026349",
"0.8026349",
"0.8026349",
"0.8026349",
"0.8026349",
"0.8026349",
"0.759076",
"0.75647986",
"0.7561237",
"0.73894304",
"0.7318518",
"0.6929384",
"0.6835254",
"0.68103296",
"0.68103296",
"0.68103296"... | 0.79682356 | 12 |
Gets the lastname of this CustomerDataAddressInterface. Last name | def lastname(self):
return self._lastname | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_last_name(self) -> str:\n return self.last_name",
"def get_last_name(self):\n return self._last_name",
"def last_name(self) -> str:\n return self._last_name",
"def last_name(self):\n return self._last_name",
"def last_name(self):\n return self._last_name",
"def ... | [
"0.80300844",
"0.8019614",
"0.78986144",
"0.7891447",
"0.7891447",
"0.7891447",
"0.7891447",
"0.78174335",
"0.7768745",
"0.7768661",
"0.7690427",
"0.7690427",
"0.7690427",
"0.7690427",
"0.7690427",
"0.7487577",
"0.7487577",
"0.7319077",
"0.7246993",
"0.7191571",
"0.7115412",
... | 0.78381413 | 7 |
Sets the lastname of this CustomerDataAddressInterface. Last name | def lastname(self, lastname):
self._lastname = lastname | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_last_name(self, last_name):\n self.last_name = last_name",
"def setLastname(self, lastname):\n self.lastname = lastname\n return self",
"def last_name(self, last_name):\n\n self._last_name = last_name",
"def last_name(self, last_name):\n\n self._last_name = last_nam... | [
"0.8034893",
"0.8021523",
"0.78383803",
"0.78383803",
"0.78383803",
"0.78383803",
"0.78383803",
"0.78383803",
"0.78383803",
"0.78383803",
"0.78383803",
"0.78383803",
"0.7775",
"0.73388815",
"0.72537047",
"0.71616507",
"0.6780859",
"0.67502713",
"0.6731542",
"0.670332",
"0.670... | 0.7917034 | 2 |
Gets the middlename of this CustomerDataAddressInterface. Middle name | def middlename(self):
return self._middlename | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def middle_name(self):\n return self._middle_name",
"def sap_name(self) -> str:\n return self._sap_name",
"def customer_name(self):\n return self._customer_name",
"def getiddname(self):\n return self.iddname",
"def street_name(self):\n return self._street_name",
"de... | [
"0.63098264",
"0.6262604",
"0.6261084",
"0.6256774",
"0.6203625",
"0.61866546",
"0.61844784",
"0.61243546",
"0.6122465",
"0.60390335",
"0.6026307",
"0.60112864",
"0.600081",
"0.5957956",
"0.5953315",
"0.59526885",
"0.59510344",
"0.59510344",
"0.59510344",
"0.5943346",
"0.5923... | 0.7459449 | 0 |
Sets the middlename of this CustomerDataAddressInterface. Middle name | def middlename(self, middlename):
self._middlename = middlename | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def middlename(self):\n return self._middlename",
"def customer_name(self, customer_name):\n self._customer_name = customer_name",
"def set_name(self, PersonName):\r\n self.name = PersonName",
"def set_name(self, name):\n\t\tself.name_ = name",
"def setName(self,value):\n assert... | [
"0.63684237",
"0.6015595",
"0.59679157",
"0.59174705",
"0.5897371",
"0.5895338",
"0.58433807",
"0.5824203",
"0.57916695",
"0.57916695",
"0.57916695",
"0.57916695",
"0.5777652",
"0.57755774",
"0.5772877",
"0.5757974",
"0.57432985",
"0.57432985",
"0.57432985",
"0.57432985",
"0.... | 0.73627985 | 0 |
Gets the suffix of this CustomerDataAddressInterface. Suffix | def suffix(self):
return self._suffix | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def suffix(self):\n return self[\"suffix\"]",
"def suffix(self):\n return self[\"suffix\"]",
"def suffix ( self ) :\n return self.__suffix",
"def suffix ( self ) :\n return self.__suffix",
"def suffix(self) -> typing.Optional[str]:\n return self._values.get('suffix')",
... | [
"0.7721101",
"0.7721101",
"0.757444",
"0.757444",
"0.7383885",
"0.70245904",
"0.6973952",
"0.6880763",
"0.6863969",
"0.6713823",
"0.66029525",
"0.6528862",
"0.65145504",
"0.6398529",
"0.6398529",
"0.63395447",
"0.62771136",
"0.627308",
"0.59499204",
"0.59439343",
"0.5932413",... | 0.75717604 | 5 |
Sets the suffix of this CustomerDataAddressInterface. Suffix | def suffix(self, suffix):
self._suffix = suffix | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setSuffix(self, value):\n return self._set(suffix=value)",
"def suffix(self):\n return self[\"suffix\"]",
"def suffix(self):\n return self[\"suffix\"]",
"def payee_suffix(self, payee_suffix):\n\n self._payee_suffix = payee_suffix",
"def setSuffixPattern(self, value):\n ... | [
"0.74399126",
"0.64798456",
"0.64798456",
"0.6328393",
"0.6327234",
"0.62999403",
"0.62999403",
"0.62999403",
"0.62093496",
"0.62093496",
"0.6195643",
"0.6178935",
"0.6163272",
"0.6147481",
"0.59588075",
"0.5911083",
"0.5788201",
"0.5783584",
"0.57691765",
"0.5679238",
"0.554... | 0.7349735 | 2 |
Gets the vat_id of this CustomerDataAddressInterface. Vat id | def vat_id(self):
return self._vat_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vat_id(self) -> str:\n return self._vat_id",
"def vat_number(self):\n return self._vat_number",
"def vat_id(self, vat_id: str):\n\n self._vat_id = vat_id",
"def id(self):\n return self.vdu_info.vdu_id",
"def vat_id(self, vat_id):\n\n self._vat_id = vat_id",
"def vpd... | [
"0.7618268",
"0.6324597",
"0.6265055",
"0.6228179",
"0.60314524",
"0.59794664",
"0.59794664",
"0.5785695",
"0.55019873",
"0.54352415",
"0.5409176",
"0.53845394",
"0.533139",
"0.52863204",
"0.5280331",
"0.5275617",
"0.5253734",
"0.52338684",
"0.5214847",
"0.5177992",
"0.516719... | 0.7881072 | 0 |
Sets the vat_id of this CustomerDataAddressInterface. Vat id | def vat_id(self, vat_id):
self._vat_id = vat_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vat_id(self, vat_id: str):\n\n self._vat_id = vat_id",
"def vat(self, vat):\n if vat is None:\n raise ValueError(\"Invalid value for `vat`, must not be `None`\") # noqa: E501\n\n self._vat = vat",
"def vat_id(self):\n return self._vat_id",
"def vat_number(self, vat... | [
"0.82168615",
"0.690578",
"0.65481997",
"0.6431998",
"0.6431998",
"0.63035166",
"0.5954082",
"0.5763487",
"0.57228065",
"0.57228065",
"0.55420965",
"0.5540439",
"0.5525479",
"0.5384544",
"0.5348871",
"0.5236304",
"0.5236304",
"0.5236304",
"0.5236304",
"0.5227517",
"0.51992357... | 0.8239571 | 0 |
Gets the default_shipping of this CustomerDataAddressInterface. If this address is default shipping address. | def default_shipping(self):
return self._default_shipping | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_shipping(self, default_shipping):\n\n self._default_shipping = default_shipping",
"def shipping_address(self):\n return Address(self._dict.get('shipping_address'))",
"def shipping_address(self) -> 'outputs.ShippingAddressResponse':\n return pulumi.get(self, \"shipping_address\"... | [
"0.7040513",
"0.66861963",
"0.64512503",
"0.64512503",
"0.64512503",
"0.64483804",
"0.6065361",
"0.5974689",
"0.5918821",
"0.578229",
"0.57629925",
"0.57321644",
"0.5715375",
"0.5610502",
"0.5580904",
"0.5500612",
"0.53808856",
"0.5373133",
"0.53708553",
"0.5343912",
"0.52988... | 0.8341829 | 0 |
Sets the default_shipping of this CustomerDataAddressInterface. If this address is default shipping address. | def default_shipping(self, default_shipping):
self._default_shipping = default_shipping | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_shipping(self):\n return self._default_shipping",
"def default_billing(self, default_billing):\n\n self._default_billing = default_billing",
"def shipping(self, shipping):\n\n self._shipping = shipping",
"def shipping_address(self, shipping_address):\n\n self._shipping... | [
"0.73232675",
"0.6017496",
"0.58289564",
"0.56107455",
"0.5565651",
"0.55127007",
"0.5484566",
"0.5306247",
"0.5306247",
"0.53046495",
"0.5288797",
"0.5269799",
"0.523855",
"0.5223251",
"0.5171661",
"0.50965214",
"0.50965214",
"0.50965214",
"0.50958866",
"0.5075812",
"0.50714... | 0.8496313 | 0 |
Gets the default_billing of this CustomerDataAddressInterface. If this address is default billing address | def default_billing(self):
return self._default_billing | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_billing(self, default_billing):\n\n self._default_billing = default_billing",
"def default_gateway(self) -> Optional[pulumi.Input[Union[str, 'DefaultGateway']]]:\n return pulumi.get(self, \"default_gateway\")",
"def get_default_ip_address():\r\n gws = netifaces.gateways() # get al... | [
"0.68346417",
"0.6542145",
"0.65068716",
"0.6484696",
"0.6331025",
"0.6322188",
"0.61216474",
"0.6100087",
"0.60719615",
"0.60530746",
"0.60530746",
"0.60042226",
"0.59968716",
"0.59176236",
"0.58504236",
"0.57407844",
"0.56402016",
"0.55643636",
"0.5541844",
"0.5518452",
"0.... | 0.80798995 | 0 |
Sets the default_billing of this CustomerDataAddressInterface. If this address is default billing address | def default_billing(self, default_billing):
self._default_billing = default_billing | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_billing(self):\n return self._default_billing",
"def default_shipping(self, default_shipping):\n\n self._default_shipping = default_shipping",
"def set_default_gateway(self, sNewDefaultGateway):\n\t\tcall_sdk_function('PrlVmDevNet_SetDefaultGateway', self.handle, sNewDefaultGateway)",... | [
"0.7023742",
"0.6438301",
"0.60716784",
"0.5751523",
"0.5717351",
"0.55586475",
"0.5553943",
"0.5553943",
"0.5553943",
"0.5469861",
"0.5461872",
"0.5451373",
"0.53464633",
"0.53277296",
"0.53277296",
"0.5308643",
"0.5296661",
"0.5262796",
"0.52472806",
"0.5220163",
"0.5207437... | 0.84249556 | 0 |
Gets the custom_attributes of this CustomerDataAddressInterface. Custom attributes values. | def custom_attributes(self):
return self._custom_attributes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_custom_attributes(cls):\n custom_attributes = cls.soap_client.service.listCustomAttributes()\n\n return custom_attributes",
"def get_custom_data(self):\n return self._get_custom_data()",
"def attrs(self) -> dict:\n return self._obj.coords[GEO_MAP_COORD].attrs",
"def getCu... | [
"0.75514734",
"0.61190474",
"0.6075698",
"0.6045227",
"0.5813726",
"0.5813726",
"0.5811293",
"0.580783",
"0.5790602",
"0.5784457",
"0.5783543",
"0.5759554",
"0.57043624",
"0.568656",
"0.568656",
"0.568656",
"0.5657207",
"0.5655808",
"0.5594878",
"0.5591823",
"0.55873847",
"... | 0.7493245 | 1 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, CustomerDataAddressInterface):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Returns json instead of HTML in case of 404. | def not_found(error):
message = {
'status': 404,
'message': 'Not Found: ' + request.url,
'error': error}
resp = jsonify(message)
return resp | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normal404(e):\n return jsonify({\"error\": \"Not found\"}), 404",
"def page_not_found(e):\n\n # Respons to api request\n if request.accept_mimetypes.accept_json and \\\n not request.accept_mimetypes.accept_html:\n resp = jsonify({'error': 'not found'})\n resp.status_code = 404\n ... | [
"0.77127695",
"0.7710775",
"0.76824695",
"0.76824695",
"0.76824576",
"0.7610471",
"0.75539166",
"0.747821",
"0.7355142",
"0.7315916",
"0.7272594",
"0.71524066",
"0.71254724",
"0.7034868",
"0.696906",
"0.6965516",
"0.6937877",
"0.6931669",
"0.69231516",
"0.68645275",
"0.680033... | 0.7180387 | 11 |
Test loading native sktime model from mock S3 bucket. | def test_load_from_remote_uri_succeeds(auto_arima_model, model_path, mock_s3_bucket):
flavor.save_model(sktime_model=auto_arima_model, path=model_path)
artifact_root = f"s3://{mock_s3_bucket}"
artifact_path = "model"
artifact_repo = S3ArtifactRepository(artifact_root)
artifact_repo.log_artifacts(mo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_s3():\n vc = vtec.parse(EX1)\n assert vc[0].s3() == \"TO.W.130\"",
"def test_get_s3_file_object_http_400_error():\n load_method = MagicMock(\n side_effect=botocore.exceptions.ClientError(\n {\"Error\": {\"Code\": \"400\", \"Message\": \"Bad Request\"}},\n operation_... | [
"0.6573262",
"0.6441068",
"0.6293835",
"0.61995226",
"0.6147518",
"0.6111824",
"0.60869163",
"0.6007866",
"0.60023546",
"0.5947459",
"0.59380156",
"0.58700025",
"0.5865326",
"0.5849065",
"0.58462673",
"0.57967484",
"0.5772943",
"0.5772307",
"0.5756766",
"0.574543",
"0.5734435... | 0.65963125 | 0 |
This function returns whether a given number is a valid phone number or not. | def is_phone_number_valid(phone_number):
phone_number = str(phone_number)
if(phone_number==""):
return True
else:
international_pattern = re.compile(
r'\(?\+[0-9]{1,3}\)? ?-?[0-9]{1,3} ?-?[0-9]{3,5} ?-?[0-9]{4}( ?-?[0-9]{3})? ?(\w{1,10}\s?\d{1,6})?')
pattern = re.compile(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_phone(phone_number):\n return bool(re.match(r\"^\\+?\\d{10,15}$\", phone_number))",
"def is_valid_phone(phone):\n assert phone is not None\n phone = str(phone)\n return len(phone) == 10 and is_valid_integer(phone)",
"def is_valid_phone_number(phone_number):\n\n is_number_valid = False\... | [
"0.8796141",
"0.85438526",
"0.8515543",
"0.8459764",
"0.84569615",
"0.8413435",
"0.81696326",
"0.81026375",
"0.80145204",
"0.7679494",
"0.7608385",
"0.7543264",
"0.7543264",
"0.7543264",
"0.7543264",
"0.7543264",
"0.7543264",
"0.75390625",
"0.74553156",
"0.74255866",
"0.74235... | 0.81956756 | 6 |
Sets the range of the accelerometer to range. accel_range the range to set the accelerometer to. Using a predefined range is advised. | def set_accel_range(self, accel_range):
# First change it to 0x00 to make sure we write the correct value later
self.bus.write_byte_data(self.address, self.ACCEL_CONFIG, 0x00)
# Write the new range to the ACCEL_CONFIG register
self.bus.write_byte_data(self.address, self.ACCEL_CONFIG, accel_range) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_accel_range(self, accel_range):\n # First change it to 0x00 to make sure we write the correct value later\n self.bus.write_byte_data(self.address, self.ACCEL_CONFIG, 0x00)\n\n # Write the new range to the ACCEL_CONFIG register\n self.bus.write_byte_data(self.address, self.ACCEL_... | [
"0.8517812",
"0.8427434",
"0.7138803",
"0.7018156",
"0.69972533",
"0.69572246",
"0.66492575",
"0.65974206",
"0.641652",
"0.64160043",
"0.6369739",
"0.63350284",
"0.6248923",
"0.616954",
"0.61229205",
"0.6036239",
"0.5976116",
"0.5966313",
"0.5953783",
"0.59347814",
"0.5847526... | 0.856105 | 0 |
Extract a local view from an environment at the given pose | def extract_view(env, h, w, ang90, view_range):
# get coordinates of window to extract
hs = torch.arange(h - view_range, h + view_range + 1, dtype=torch.long)
ws = torch.arange(w - view_range, w + view_range + 1, dtype=torch.long)
# get coordinate 0 instead of going out of bounds
h_env, w_env = env... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def viewPlace(*args, animate: bool=True, eyePoint: List[float, float, float]=None, fieldOfView:\n float=0.0, lookAt: List[float, float, float]=None, ortho: bool=True, perspective:\n bool=True, upDirection: List[float, float, float]=None, viewDirection: List[float,\n float, fl... | [
"0.5724226",
"0.5612507",
"0.55441463",
"0.54840994",
"0.54678065",
"0.54571193",
"0.54501367",
"0.5446049",
"0.54237765",
"0.5414969",
"0.5414334",
"0.54036134",
"0.5392745",
"0.53853005",
"0.5360669",
"0.535507",
"0.53548175",
"0.5342199",
"0.5327232",
"0.5327232",
"0.53272... | 0.61176777 | 0 |
Builds a convolutional autoencoder model, returning both the encoder and decoder models | def build_model(encode_size):
# Build the encoder
encoder = Sequential()
encoder.add(InputLayer((1000,4)))
encoder.add(Conv1D(5, 11, activation="tanh", padding="same"))
encoder.add(Conv1D(7, 7, activation="relu", padding="same"))
encoder.add(MaxPooling1D(2))
encoder.add(Conv1D(11, 5, activat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_full_conv_autoencoder():\n input_img = Input(shape=(84, 84, 3))\n\n x = Convolution2D(48, 8, 8, activation='relu', border_mode='same', name='c1')(input_img)\n x = MaxPooling2D((2, 2), border_mode='same')(x)\n x = Convolution2D(32, 4, 4, activation='relu', border_mode='same', name='c2')(x)\n ... | [
"0.8460345",
"0.8353938",
"0.8019785",
"0.795292",
"0.75751996",
"0.74735934",
"0.746464",
"0.73321825",
"0.73059875",
"0.7257855",
"0.7164758",
"0.7158472",
"0.7151894",
"0.71298724",
"0.7112213",
"0.69386303",
"0.693397",
"0.6927279",
"0.6923184",
"0.68813574",
"0.68276906"... | 0.74976164 | 5 |
Calculates the upper and lower Poisson confidence limits for extremely low counts i.e., n << 50. These equations are outlined in [Gehrels1986]_. | def small_poisson(n, S=1):
# Parameters for the lower limit equation. These are for the 1, 2, and 3-sigma levels.
beta = [0.0, 0.06, 0.222]
gamma = [0.0, -2.19, -1.88]
# Upper confidence level using equation 9 in Gehrels 1986.
lambda_u = (n + 1.) * (1. - 1. / (9. * (n + 1.)) + S / (3. * np.sqrt(n ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wilson_lower_bound(pos, neg, confidence=0.95):\n n = pos + neg\n if n == 0:\n return 0\n z = st.norm.ppf(1 - (1 - confidence) / 2)\n phat = 1.0 * pos / n\n return (phat + z * z / (2 * n) - z * math.sqrt((phat * (1 - phat) + z * z / (4 * n)) / n)) / (1 + z * z / n)",
"def get_exact_poiss... | [
"0.59790426",
"0.5958298",
"0.5868375",
"0.5792146",
"0.57255346",
"0.5673943",
"0.5609956",
"0.5595066",
"0.5588677",
"0.5582858",
"0.55817014",
"0.55730826",
"0.5573064",
"0.5567115",
"0.5564258",
"0.555321",
"0.55516243",
"0.55408645",
"0.55236876",
"0.54959935",
"0.549420... | 0.6904098 | 0 |
Bisect until we find a value smaller than delta | def bisect_root(V, y0, rng, Eleft, E0left, Eright, E0right, delta):
E0mid = (E0left + E0right) / 2.0
func = schroed_system(E0mid, V)
[Emid, _] = one_step(func, y0, rng)
# If we try to bisect too much, we can reach the machine's limit
# and one of the sides will be equal to the middle
if E0mid ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def example_ten():\n x = list(range(10**6))\n i = bisect_left(x, 991234)",
"def _bisect_left(*args, **kwargs): # real signature unknown\n pass",
"def bisect(f, lo=0, hi=None, eps=1e-9):\n lo_bool = f(lo)\n if hi is None:\n offset = 1\n while f(lo+offset) == lo_bool:\n of... | [
"0.66196173",
"0.65070903",
"0.64067364",
"0.6359064",
"0.63470256",
"0.6324879",
"0.62172264",
"0.6201793",
"0.606926",
"0.6059419",
"0.59639674",
"0.59571916",
"0.59349966",
"0.5904186",
"0.58813065",
"0.5877779",
"0.58718836",
"0.5839684",
"0.5820428",
"0.5793076",
"0.5771... | 0.5328845 | 70 |
Date time of right now, formatted as string | def now():
return datetime.now().strftime(FORMAT) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_date_time():\n date_time = datetime.now()\n date_time_string = date_time.strftime(\"%b-%d-%Y (%H:%M:%S)\")\n return date_time_string",
"def get_now():\r\n now = dt.datetime.now()\r\n now_str = now.strftime(\"%d/%m %H:%M\")\r\n return now_str",
"def now(self):\n return time.strf... | [
"0.8119969",
"0.808704",
"0.7959211",
"0.795286",
"0.79362243",
"0.79066664",
"0.7886171",
"0.7813555",
"0.7811029",
"0.78079545",
"0.77791005",
"0.776687",
"0.7753571",
"0.77409405",
"0.77292776",
"0.77152425",
"0.76826245",
"0.7667052",
"0.76620257",
"0.76588136",
"0.763751... | 0.7295111 | 56 |
timedelta formatted as string | def delta_fmt(delta):
secs = delta.total_seconds()
if secs < 60:
return '%0.2d secs' % secs
hours = 0
if secs > 3600:
hours = secs / 3600.0
secs -= int(hours) * 3600
mins = secs / 60
secs -= mins * 60
return '%0.2d:%0.2d' % (hours, mins) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timedelta_to_string(td: datetime.timedelta) -> str:\n return str(td)",
"def convert_timedelta_to_string(td):\n # type: (datetime.timedelta) -> str\n days = td.days\n hours = td.seconds // 3600\n minutes = (td.seconds - (hours * 3600)) // 60\n seconds = (td.seconds - (hours * 3600) - (minute... | [
"0.7665503",
"0.7597434",
"0.7560489",
"0.7536878",
"0.7408814",
"0.7254352",
"0.72005516",
"0.71633935",
"0.71607614",
"0.7141917",
"0.70976484",
"0.7060128",
"0.68318987",
"0.68304",
"0.67453396",
"0.66987574",
"0.66376716",
"0.6630574",
"0.6629196",
"0.6597192",
"0.6572155... | 0.67024326 | 15 |
Filter vocabulary words which do not occur in the translation lexicon. This reduces the size of the vocabulary and adjusts the context samples accordingly. | def filter_sample_vocab(lang_pair):
sample_hdf_fname = config["sample"][lang_pair]["samples_fname"]
log.info("opening original samples file " + sample_hdf_fname)
sample_hdfile = h5py.File(sample_hdf_fname, "r")
filtered_hdf_fname = config["sample"][lang_pair]["samples_filt_fname"]
log.i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def keep_words(self, idx):\n print('{} words have been removed'.format(self.data.shape[1] - len(idx)))\n self.data = self.data[:, idx]\n self.vocab = [self.vocab[i] for i in idx]",
"def stopword_filter(words):\n new_words = []\n for w in words:\n if w in stopwords.words(\"german... | [
"0.67386913",
"0.6629027",
"0.65661955",
"0.64367545",
"0.6425047",
"0.64067817",
"0.6400455",
"0.6378137",
"0.6371107",
"0.63667613",
"0.63625044",
"0.63625044",
"0.63625044",
"0.63625044",
"0.6362274",
"0.63541424",
"0.63520104",
"0.6342701",
"0.630897",
"0.6281195",
"0.627... | 0.0 | -1 |
This function calculates the area of a cube. | def cube_area(side_length):
area = side_length ** 3
return area | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def surface_area_of_cube(side):\n return side",
"def cube_area(edge : number) -> number:\n area = 6*edge*edge\n\n return area",
"def surface_area_cube(side_length: float) -> float:\r\n if side_length < 0:\r\n raise ValueError(\"surface_area_cube() only accepts non-negative values\")\r\n r... | [
"0.7731614",
"0.75891894",
"0.75345063",
"0.7178706",
"0.71619225",
"0.7103598",
"0.7076419",
"0.7068805",
"0.7057",
"0.7049407",
"0.7036696",
"0.6920387",
"0.68922013",
"0.68857485",
"0.6860873",
"0.67667484",
"0.6746991",
"0.6725058",
"0.6721581",
"0.67126703",
"0.6706674",... | 0.7843364 | 0 |
Get the endpoint for this DB instance. Raises RdsNotReadyError if the instance is not ready. | def get_endpoint(db_instance):
rds = boto3.client('rds')
instances = rds.describe_db_instances(
DBInstanceIdentifier=db_instance.aws_instance_identifier)['DBInstances']
assert len(instances) == 1
if instances[0]['DBInstanceStatus'] != 'available':
raise RdsNotReadyError('RDS instance {} ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __get_endpoint(self):\n return self._endpoint",
"def get_endpoint(self):\r\n return self._endpoint",
"def get_endpoint(cls):\n raise NotImplementedError(\n \"%s must have implemented get_endpoint.\" % cls.__name__,\n )",
"def get_endpoint(self, session, **kwargs):\n... | [
"0.7085749",
"0.7017911",
"0.666801",
"0.6554385",
"0.6505624",
"0.63673806",
"0.6320066",
"0.6316497",
"0.63131297",
"0.63131297",
"0.62833726",
"0.62345475",
"0.62231874",
"0.6218776",
"0.62110776",
"0.62110776",
"0.61863685",
"0.61863685",
"0.61749953",
"0.61511576",
"0.61... | 0.7485274 | 0 |
Gets a collection of `InputExample`s for the train set. | def get_train_examples(self, data_dir):
raise NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_train_inputs(self, example):\n return example",
"def get_train_examples(self):\n raise NotImplementedError()",
"def get_train_examples(self, input_file):\r\n raise NotImplementedError()",
"def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en... | [
"0.73499966",
"0.7173421",
"0.7126833",
"0.65602446",
"0.64204013",
"0.64052176",
"0.63422555",
"0.6290186",
"0.6282746",
"0.625262",
"0.62499267",
"0.6233708",
"0.62225735",
"0.62225735",
"0.6205607",
"0.6205607",
"0.6205607",
"0.6205607",
"0.6205607",
"0.6205607",
"0.620560... | 0.62466323 | 18 |
Gets a collection of `InputExample`s for the dev set. | def get_dev_examples(self, data_dir):
raise NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_dev_examples(self, input_file):\r\n raise NotImplementedError()",
"def get_train_inputs(self, example):\n return example",
"def get_examples(self, env):\n return self.fam.c_get_examples(self, env)",
"def get_dev_examples(self):\n raise NotImplementedError()",
"def _create_ex... | [
"0.6810809",
"0.6588584",
"0.65586174",
"0.65525424",
"0.6426688",
"0.6382163",
"0.6254418",
"0.6191699",
"0.6115675",
"0.6092811",
"0.6054734",
"0.6050867",
"0.5990466",
"0.5927518",
"0.5921264",
"0.5920788",
"0.5919371",
"0.5915555",
"0.5915555",
"0.5915555",
"0.5915555",
... | 0.59946835 | 21 |
Returns the image from img path as a np array using PIL. | def loadImage(img_path):
img = Image.open(img_path)
np_img = np.array(img)
return (np_img) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_img(path: str) -> np.ndarray:\n \n return np.array(Image.open(path))",
"def read_img(img_path):\n return sitk.GetArrayFromImage(sitk.ReadImage(img_path))",
"def read_img(img_path): \n return sitk.GetArrayFromImage(sitk.ReadImage(img_path))",
"def img_to_array(img, path=True):\n glo... | [
"0.80861306",
"0.7763873",
"0.77231324",
"0.7561176",
"0.7539234",
"0.7450956",
"0.7411781",
"0.7411781",
"0.7384811",
"0.7382134",
"0.7376199",
"0.73761624",
"0.73685986",
"0.73509145",
"0.73343945",
"0.73120505",
"0.72934663",
"0.7264339",
"0.7183795",
"0.71813357",
"0.7134... | 0.8144754 | 0 |
Takes a np array as input and saves it to output path using PIL. | def saveImage(np_img, output_path, mode=None, scale=255.0):
if mode is not None:
if mode == 'dist_norm':
np_img *= scale/np_img.max()
np_out = Image.fromarray((np_img).astype('uint8'))
elif mode == 'blob_labels':
np_out = Image.fromarray((np_img*255).astype(np.ui... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_npimg(array: np.ndarray, path: str) -> None:\r\n img = Image.fromarray(array.squeeze())\r\n img.save(path)",
"def save_array_as_image(array, save_location):\n image = Image.fromarray(array)\n image.save(save_location)\n image.close()",
"def save_img(img: np.ndarray, path: str) -> None:\... | [
"0.7358044",
"0.7307529",
"0.7270866",
"0.7214427",
"0.6929979",
"0.69102573",
"0.6783901",
"0.6765995",
"0.66709435",
"0.6659278",
"0.6607639",
"0.6592848",
"0.6577694",
"0.6574548",
"0.65708405",
"0.6553658",
"0.6538897",
"0.65314126",
"0.6523138",
"0.6518195",
"0.6513297",... | 0.6451224 | 29 |
This function is used to calculate the offset of the upper left corner after trimming. The threshold should be the same as whatever is used in trim2DArray. | def calculateTrimOffsetForward(input_arr, threshold=0):
ul_x, ul_y = 0, 0
row_sum = np.sum(input_arr, axis=1)
col_sum = np.sum(input_arr, axis=0)
for i in range(0, len(col_sum)):
if col_sum[i] > threshold:
ul_x = i
break
for j in range(0, len(row_sum)):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculateTrimOffsetBackward(input_arr, threshold=0): \n\n y,x = input_arr.shape\n lr_x, lr_y = 0, 0\n\n row_sum = np.sum(np.flip(input_arr), axis=1)\n col_sum = np.sum(np.flip(input_arr), axis=0)\n\n for i in range(0, len(col_sum)):\n if col_sum[i] > threshold:\n lr_x = i\n ... | [
"0.75691175",
"0.6997579",
"0.634021",
"0.56727326",
"0.54787457",
"0.545807",
"0.54051197",
"0.53599125",
"0.5281328",
"0.5269701",
"0.5265642",
"0.52104384",
"0.5207829",
"0.5173694",
"0.5145322",
"0.5145136",
"0.5141332",
"0.51386756",
"0.51317936",
"0.5109577",
"0.5108348... | 0.7778575 | 0 |
This function is used to calculate the offset of the lower right corner after trimming. The threshold should be the same as whatever is used in trim2DArray. Returns the x and y of the lower right corner. | def calculateTrimOffsetBackward(input_arr, threshold=0):
y,x = input_arr.shape
lr_x, lr_y = 0, 0
row_sum = np.sum(np.flip(input_arr), axis=1)
col_sum = np.sum(np.flip(input_arr), axis=0)
for i in range(0, len(col_sum)):
if col_sum[i] > threshold:
lr_x = i
break
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculateTrimOffsetForward(input_arr, threshold=0): \n\n ul_x, ul_y = 0, 0\n\n row_sum = np.sum(input_arr, axis=1)\n col_sum = np.sum(input_arr, axis=0)\n\n for i in range(0, len(col_sum)):\n if col_sum[i] > threshold:\n ul_x = i\n break\n for j in range(0, len(ro... | [
"0.73438895",
"0.63865656",
"0.6069612",
"0.60610044",
"0.5832267",
"0.5672293",
"0.56418204",
"0.55652165",
"0.5476554",
"0.5474053",
"0.5363825",
"0.53606397",
"0.5333332",
"0.53065693",
"0.5256097",
"0.52454495",
"0.5244693",
"0.52409524",
"0.5226961",
"0.5222945",
"0.5168... | 0.7074264 | 1 |
Return default configuration. You can also run other commands here but they will not print to stdout and they cannot use the config yet. | def bootstrap_default():
return default_configuration | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_default_config():\n # Swallow STDERR if it says\n # \"No config file found, using default configuration\"\n result = subprocess.check_output(['pylint', '--generate-rcfile'],\n stderr=subprocess.PIPE)\n # On Python 3, this returns bytes (from STDOUT), so we\n ... | [
"0.776297",
"0.752898",
"0.7200582",
"0.71658057",
"0.7129334",
"0.71267587",
"0.70061505",
"0.6997721",
"0.6965123",
"0.69416976",
"0.69258684",
"0.6903281",
"0.6857291",
"0.6848054",
"0.6845162",
"0.6812819",
"0.68118995",
"0.67995507",
"0.6742179",
"0.67121",
"0.6705789",
... | 0.76233333 | 1 |
Return a numpy ndarray with the shape (num_tracks, num_frames, num_features), where each track's feature matrix is padded and scaled adequately to the offsets and SNR used in ``add_to_mix`` call. | def unmixed_feats(self) -> np.ndarray:
return np.stack(self.tracks) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mixed_feats(self) -> np.ndarray:\n result = self.tracks[0]\n for feats_to_add, gain in zip(self.tracks[1:], self.gains):\n result = self.feature_extractor.mix(\n features_a=result, features_b=feats_to_add, energy_scaling_factor_b=gain\n )\n return resul... | [
"0.58985525",
"0.5716369",
"0.54975736",
"0.53640956",
"0.5248201",
"0.5193592",
"0.5120061",
"0.51146674",
"0.5035956",
"0.5015494",
"0.49846932",
"0.49292728",
"0.4924143",
"0.48904282",
"0.48805803",
"0.48793742",
"0.48606023",
"0.4841406",
"0.48380885",
"0.48077723",
"0.4... | 0.61110467 | 0 |
Calculate the Intersection over Union (IoU) of two bounding boxes. | def get_iou(bb1, bb2):
assert bb1['x1'] <= bb1['x2']
assert bb1['y1'] <= bb1['y2']
assert bb2['x1'] <= bb2['x2']
assert bb2['y1'] <= bb2['y2']
# determine the coordinates of the intersection rectangle
x_left = max(bb1['x1'], bb2['x1'])
y_top = max(bb1['y1'], bb2['y1'])
x_right = min(bb1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def iou(bbox1, bbox2):\n\n bbox1 = [float(x) for x in bbox1]\n bbox2 = [float(x) for x in bbox2]\n\n (x0_1, y0_1, x1_1, y1_1) = bbox1\n (x0_2, y0_2, x1_2, y1_2) = bbox2\n\n # get the overlap rectangle\n overlap_x0 = max(x0_1, x0_2)\n overlap_y0 = max(y0_1, y0_2)\n overlap_x1 = min(x1_1, x1_... | [
"0.8126557",
"0.8126557",
"0.8000075",
"0.79864234",
"0.7982592",
"0.79382795",
"0.78974587",
"0.78944886",
"0.7870608",
"0.7860787",
"0.7846316",
"0.7838642",
"0.77846825",
"0.7748033",
"0.7741612",
"0.7681046",
"0.76689774",
"0.76456106",
"0.76325715",
"0.76228815",
"0.7554... | 0.796185 | 5 |
Initialize a `PhoneSensor` object | def __init__(self,
*,
qrcode: bool = False,
host: str = "0.0.0.0",
port: int = 8000,
logger: logging.Logger = logging.getLogger(
'mvt.phone_sensor'),
log_level: int = logging.WARN,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, device_id, interior_sensor=\"null\", exterior_sensor=\"null\"):\r\n self.device_id = device_id\r\n self.interior_sensor = interior_sensor\r\n self.exterior_sensor = exterior_sensor",
"def __init__(self) -> None:\n self.sensor = serial.Serial(config.DEVICE)\n ... | [
"0.7070855",
"0.68953145",
"0.6562698",
"0.65501523",
"0.6521072",
"0.6521072",
"0.6521072",
"0.6521072",
"0.6521072",
"0.6501486",
"0.6446356",
"0.64167565",
"0.6404498",
"0.6396288",
"0.636478",
"0.6355426",
"0.63007003",
"0.6266154",
"0.6259083",
"0.62328213",
"0.6197915",... | 0.0 | -1 |
Close the server and relinquish control of the port. Use of `PhoneSensor` as a context manager is preferred to this, where suitable. May be called automatically by the garbage collector. | def close(self):
self.loop.call_soon_threadsafe(self.stop_flag.set_result, True)
self.server_thread.join() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def server_close(self):\n\t\tself.socket.close()",
"def _close(self):\n \n # Close device\n logger.debug(\"%s: TCP port closing started...\" % \\\n self.__class__.__name__)\n self._router = None\n self._platform = None\n self._tcp_socket.close()\n ... | [
"0.698479",
"0.6957577",
"0.6891686",
"0.68290913",
"0.6820715",
"0.6805529",
"0.6666319",
"0.66126716",
"0.65447193",
"0.6496726",
"0.6479551",
"0.6479088",
"0.6479088",
"0.6479088",
"0.6479088",
"0.6479088",
"0.6479088",
"0.646284",
"0.64404106",
"0.64403725",
"0.64156145",... | 0.64108557 | 21 |
Return the coefficient as a function of the density and the beam energy\ of the attenuation[beam stopping coefficient]/emission file | def get_coef_density(self,typ,file_number):
if typ == 'emis':
return self.beam_emis[file_number].coef_dens
elif typ == 'atte':
return self.beam_atte[file_number].coef_dens
else:
raise NameError('No list with this name: {0}'.format(typ)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def energy_func(self):\n i = self.inl[0].to_flow()\n o = self.outl[0].to_flow()\n\n T_m = (T_mix_ph(i, T0=self.inl[0].T.val_SI) +\n T_mix_ph(o, T0=self.outl[0].T.val_SI)) / 2\n\n iam = (\n 1 - self.iam_1.val * abs(self.aoi.val) -\n self.iam_2.val * se... | [
"0.6376765",
"0.61176986",
"0.60912484",
"0.58874834",
"0.5846625",
"0.58127314",
"0.579241",
"0.57703596",
"0.5746576",
"0.5683004",
"0.5671842",
"0.5642635",
"0.5628368",
"0.5613743",
"0.56120884",
"0.55563843",
"0.5541505",
"0.5514427",
"0.55105627",
"0.5460426",
"0.545166... | 0.61645406 | 1 |
defines a list of avaiable indicators. | def get(self):
response = {}
response[b'cmd_temperature'] = self.cmd_temperature
response[b'idle_temperature'] = self.idle_temperature
return response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_indicator_values(self):\n self.indicators = [\"flood safety\", \"biodiversity\", \"costs\"]\n self.flood_safety = []\n self.biodiversity = []\n self.cost_score = []\n self.total_costs = []\n self.turn = []\n self.biosafe_percentage = None\n self.b... | [
"0.69639635",
"0.6175285",
"0.5849137",
"0.5838761",
"0.5593533",
"0.55661714",
"0.55120975",
"0.53811723",
"0.5346254",
"0.53238654",
"0.5287126",
"0.5256839",
"0.5222337",
"0.515608",
"0.51393",
"0.5132562",
"0.5128372",
"0.50980735",
"0.5068071",
"0.5046045",
"0.5024021",
... | 0.0 | -1 |
Check if the given user is a member of the blog | def check_membership(self, user):
if user.is_anonymous():
return None
return Membership.objects.filter(blog=self, user=user).with_rating().first() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_func(self):\r\n post = self.get_object()\r\n if self.request.user == post.author:\r\n return True\r\n return False",
"def test_func(self):\r\n post = self.get_object()\r\n if self.request.user == post.author:\r\n return True\r\n return Fals... | [
"0.71491796",
"0.71491796",
"0.71491796",
"0.71333545",
"0.7021597",
"0.6994001",
"0.684726",
"0.684726",
"0.67687124",
"0.67196363",
"0.6679149",
"0.66641974",
"0.6659519",
"0.6614831",
"0.6614542",
"0.6592539",
"0.65663105",
"0.6563946",
"0.6562556",
"0.65597886",
"0.651661... | 0.65880686 | 16 |
Check if the user is a moderator with profile editing rights | def can_be_moderated_by(user):
return user.is_active and user.is_staff and (
user.has_perm('blog.change_membership') or
user.has_perm('blog.change_blog')) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_can_edit(self, user):\n return user == self.owner",
"def can_edit(self, user):\n return self.author_id == user.id or user.is_staff",
"def can_edit_user(user):\n\tu = current_user._get_current_object()\n\treturn u==user or u.is_admin()",
"def is_moderator(self):\n return self.user_ty... | [
"0.80539227",
"0.7844865",
"0.7685346",
"0.76684934",
"0.7605101",
"0.7567075",
"0.74969614",
"0.74621654",
"0.7354093",
"0.72424525",
"0.71678793",
"0.7163223",
"0.7106607",
"0.7053011",
"0.6978234",
"0.6970855",
"0.6968557",
"0.69531447",
"0.69531447",
"0.69523245",
"0.6946... | 0.72951454 | 9 |
Check if the given user is banned in this blog Nomembers (membership==None) considered to be not banned. | def is_banned(membership):
if membership is not None and not membership.is_left():
return membership.is_banned()
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_membership(self, user):\n if user.is_anonymous():\n return None\n return Membership.objects.filter(blog=self, user=user).with_rating().first()",
"def check_can_ban(membership):\n if membership is not None and not membership.is_left():\n return membership.can_b... | [
"0.65185785",
"0.6459197",
"0.62340915",
"0.6122301",
"0.6093805",
"0.60376376",
"0.60129315",
"0.59991336",
"0.5951145",
"0.5931465",
"0.59008205",
"0.57997066",
"0.57958925",
"0.5781482",
"0.5708886",
"0.5704836",
"0.5692922",
"0.56628627",
"0.5644575",
"0.56255597",
"0.560... | 0.73325217 | 0 |
Check if the given user has permissions delete posts in the blog Nomembers (membership==None) considered to have no rights. | def check_can_delete_posts(membership):
if membership is not None and not membership.is_left():
return membership.can_delete_posts()
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_can_delete_comments(membership):\n if membership is not None and not membership.is_left():\n return membership.can_delete_comments()\n else:\n return False",
"def test_has_perm_post_delete(self):\n self.context['request'].user = User.objects.get(pk=47963)\n ... | [
"0.6893279",
"0.68357843",
"0.67731833",
"0.6624216",
"0.6555188",
"0.6426255",
"0.6422157",
"0.6417998",
"0.6361062",
"0.63397264",
"0.63397264",
"0.6268033",
"0.624713",
"0.62251645",
"0.62221736",
"0.6212654",
"0.61916935",
"0.6132678",
"0.6111071",
"0.61080563",
"0.609742... | 0.8179065 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.