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 all the fun holidays on the specified date | def date(m=0,d=0):
holidays = holidays_date(m, d)
if not holidays:
return jsonify(holidays), status.HTTP_400_BAD_REQUEST
return jsonify({"day": d, "month": m, "holidays": [h.holiday for h in holidays]}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_fed_holidays(start_date, end_date):\n\n dr = pd.date_range(start=start_date, end=end_date)\n df = pd.DataFrame()\n df['Date'] = dr\n\n cal = calendar()\n holidays = cal.holidays(start=dr.min(), end=dr.max())\n\n df['Holiday'] = df['Date'].isin(holidays)\n df_holiday = df[df['Holiday'] ... | [
"0.7507622",
"0.7443515",
"0.7419723",
"0.70898676",
"0.70355105",
"0.6992652",
"0.6837357",
"0.6833632",
"0.6811635",
"0.6743887",
"0.6626922",
"0.65622556",
"0.6559653",
"0.6555274",
"0.6496742",
"0.64685947",
"0.6439641",
"0.6437206",
"0.64266557",
"0.64248073",
"0.6421599... | 0.590846 | 34 |
Getter for the immutable configuration. | def config(self):
return self._config | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_config(self):\n return self.config",
"def config(self):\r\n return self._config",
"def get_configuration(self) -> dict:\n return self.config",
"def _get_config(self):\n return self.__config",
"def _get_config(self):\n return self.__config",
"def _get_config(self):\n retu... | [
"0.7532254",
"0.7434306",
"0.7398484",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"0.7383885",
"... | 0.74967396 | 1 |
Run the model at the current parameters for the given input tensor. | def run(self, data, training=False):
# Set mode
if training:
self._model.train()
else:
self._model.eval()
# Compute
return self._model(data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _runModel(self, traj):\n if self.useRandomICs:\n logging.warn(\"Random initial conditions not implemented yet\")\n # get parameters of this run from pypet trajectory\n runParams = self.getParametersFromTraj(traj)\n if self.parameterSpace.star:\n runParams = fla... | [
"0.6784108",
"0.63637334",
"0.62719077",
"0.6251277",
"0.61519927",
"0.6146099",
"0.61226237",
"0.6091181",
"0.6090533",
"0.6084896",
"0.6049843",
"0.604827",
"0.60355306",
"0.6026336",
"0.59748954",
"0.5956508",
"0.5920939",
"0.588473",
"0.58554643",
"0.5839202",
"0.58378446... | 0.5551012 | 63 |
Return elements from the iterable in `chunksize`ed lists. The last returned element may be smaller (if length of collection is not divisible by `chunksize`). >>> print(list(grouper(range(10), 3))) [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]] | def chunkize_serial(iterable, chunksize, as_numpy=False):
it = iter(iterable)
while True:
if as_numpy:
# convert each document to a 2d numpy array (~6x faster when transmitting
# chunk data over the wire, in Pyro)
wrapped_chunk = [[np.array(doc) for doc in itertools.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lazy_groups_of(iterator: Iterator[A], group_size: int) -> Iterator[List[A]]:\n return iter(lambda: list(islice(iterator, 0, group_size)), [])",
"def chunk_list(iterable: Iterable[T], size: int) -> Iterable[List[T]]:\n\n iterable = iter(iterable)\n\n item = list(itertools.islice(iterable, size))\n ... | [
"0.78571784",
"0.7711082",
"0.7703459",
"0.7516081",
"0.74998665",
"0.74790996",
"0.74395496",
"0.737066",
"0.73287255",
"0.7297081",
"0.72181064",
"0.71567935",
"0.7150554",
"0.7124817",
"0.7111618",
"0.7092187",
"0.708389",
"0.7070267",
"0.70699847",
"0.70699847",
"0.706998... | 0.0 | -1 |
Whether or not a bitmap should be created on the array. If the the array is sufficiently small, a bitmap yields no benefit. If the array has no redundancy, a bitmap is just pointless. | def createBitmap(self):
return self.level.has_redundancy and self.size >= 1000 and self.format.type != "swap" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def boolean(operation, bitmaps):\n\n maxX, maxY = size = bitmaps[0].size()\n result = bitmap(size)\n for x in range(maxX):\n for y in range(maxY):\n pixel = bitmaps[0].get(x,y)\n for b in bitmaps[1:]:\n pixel = apply(operation, (pixel, b.get(x,y)))\n ... | [
"0.5711391",
"0.5578023",
"0.5522623",
"0.55190635",
"0.5416681",
"0.5410643",
"0.5383515",
"0.534708",
"0.53022337",
"0.52064997",
"0.51892835",
"0.51621425",
"0.51530045",
"0.51455915",
"0.51396513",
"0.5137458",
"0.5131842",
"0.5128583",
"0.5120213",
"0.5111307",
"0.508589... | 0.7070911 | 0 |
Closure function for np.quantile | def quantile_func(q):
def f(x):
return np.quantile(x, q)
return f | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_quantile():\n return np.logspace(-5, 0, 100)",
"def test__quantile(self):\r\n # regular cases\r\n sample_data = array(range(25, 42))\r\n assert_almost_equal(_quantile(sample_data, 0.5), median(sample_data))\r\n\r\n # sorted data is assumed for this function\r\n s... | [
"0.6775677",
"0.67522997",
"0.6492043",
"0.64537555",
"0.6434359",
"0.637416",
"0.6288685",
"0.6286637",
"0.62539876",
"0.6169628",
"0.6156031",
"0.61249554",
"0.6086439",
"0.60459363",
"0.60375434",
"0.6035999",
"0.6030225",
"0.60297734",
"0.6017067",
"0.6005929",
"0.5984996... | 0.8043225 | 0 |
Return a pandas with the performances of the last train epoch, for every model. | def get_pivot_last_epoch(self):
df = self.get_results()
df_max_epoch = df.groupby('method')['epoch'].max().reset_index()
df_max_epoch = df.merge(df_max_epoch, on=['method', 'epoch'], how='inner')
df_pivot = df_max_epoch.pivot('method', 'statistics', 'value')
return df_pivot | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_model(epoch):\n model.eval()\n test_metrics = {\"loss\": [], \"acc\": []}\n timer = Timer()\n for batch_i, (X, y) in enumerate(test_dataloader):\n batch_i += 1\n image_sequences = Variable(X.to(device), requires_grad=False)\n ... | [
"0.630389",
"0.6246479",
"0.6238033",
"0.61550957",
"0.6094963",
"0.60822016",
"0.5987446",
"0.59416205",
"0.59079486",
"0.58948",
"0.58773017",
"0.5867679",
"0.5823293",
"0.5823293",
"0.5818272",
"0.581328",
"0.57954997",
"0.57907915",
"0.57899797",
"0.57815355",
"0.57630694... | 0.0 | -1 |
Plot different statistics about performances during the training process. | def plot_time_advances(self, path: str = None, methods: list = None, title=None):
df = self.get_results(methods)
ax = plt.axes()
sns.lineplot(x='epoch', y='value', data=df, hue='statistics', style='method', ax=ax)
plt.ylim(-31, 11)
plt.ylabel('test statistics of log-lkl')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visualize_training(features, labels, pl):\n print(\"Visualizing training\")\n fig = plt.figure()\n ax = fig.add_subplot(111)\n\n # Take out each feature type, one at a time\n label_map = get_label_map(labels)\n\n for key in label_map.keys():\n like_ind = label_map[key]\n like_da... | [
"0.72996265",
"0.71247",
"0.7012992",
"0.69597846",
"0.6938674",
"0.6814664",
"0.6753957",
"0.67483485",
"0.6746367",
"0.67413867",
"0.67245805",
"0.6694166",
"0.66809523",
"0.6664628",
"0.6592164",
"0.6584538",
"0.6570581",
"0.6558657",
"0.6538086",
"0.6532169",
"0.6524955",... | 0.0 | -1 |
Property for the initital velocity | def initial_velocity(self) -> float:
return self._initial_velocity | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_velocity(self) -> int:\r\n ...",
"def velocity(self):\n return self._velocity",
"def velocity(self):\n return self._velocity",
"def getVelocity(self):\n return self.v",
"def velocity(self):\n return self.base_platform.velocity",
"def get_velocity(self):\n ... | [
"0.80913043",
"0.75396353",
"0.75396353",
"0.74211264",
"0.73711056",
"0.7323714",
"0.7313467",
"0.7154016",
"0.71083623",
"0.7086254",
"0.708309",
"0.70829433",
"0.70633",
"0.7061763",
"0.70503867",
"0.7015866",
"0.6983591",
"0.6909269",
"0.6857057",
"0.6843088",
"0.6833641"... | 0.80985844 | 0 |
Property for the starting time | def start_time(self) -> float:
return self._start_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __get_starting_time(self):\n return self.__starting_time",
"def start_time(self):\n pass",
"def start_time(self) -> float:\r\n ...",
"def start_time(self):\n return self._meta['start_time']",
"def time_start(self):\n return self._time_start",
"def start_time(self):\... | [
"0.8672813",
"0.84502894",
"0.83216965",
"0.8315453",
"0.82757616",
"0.82375443",
"0.82375443",
"0.82375443",
"0.82375443",
"0.82375443",
"0.82375443",
"0.82375443",
"0.82375443",
"0.82336855",
"0.82264686",
"0.81857497",
"0.81857497",
"0.8129581",
"0.7987574",
"0.79502046",
... | 0.8170339 | 17 |
Returns a string representation of a path | def render_path(path_to_item):
result = ""
for pth in path_to_item:
if isinstance(pth, six.integer_types):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
return result | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def path_str(path):\n\toutput = \"PATH: \"\n\tif path:\n\t\tfor i in path:\n\t\t\toutput += str(i.data) + \" -> \"\n\telse:\n\t\toutput += \"Empty\"\n\treturn output",
"def path_to_str(path):\n if hasattr(path, '__fspath__'):\n path = as_str_any(path.__fspath__())\n return path",
"def as_string(pa... | [
"0.79917634",
"0.7773636",
"0.7598062",
"0.74989223",
"0.7465561",
"0.73832566",
"0.7245672",
"0.7176694",
"0.71533084",
"0.7073232",
"0.70665455",
"0.7064198",
"0.7044345",
"0.7029259",
"0.6942743",
"0.6941461",
"0.69066596",
"0.69066596",
"0.6903992",
"0.6888772",
"0.686682... | 0.0 | -1 |
Exports workspace dataframe to CSV | def workspace_df_to_csv(df, workspace_name):
file_name = workspace_name + '_questions.csv'
script_dir = os.path.dirname(__file__)
output_dir = os.path.join(script_dir, data_dir, 'workspace_training/')
output_path = os.path.join(output_dir, file_name)
df.to_csv(output_path, i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def export_csv(self, outpath):\n\n\t\tself.df.to_csv(outpath)",
"def export_to_csv(da_locals, selection_widget, out):\n df_name = selection_widget.value\n da_locals[df_name].to_csv(\"output/{}.csv\".format(df_name), index=False)\n out.clear_output()\n out.append_display_data(FileLinks(\"output\"))",
... | [
"0.77670306",
"0.7490905",
"0.74451315",
"0.7382341",
"0.73440903",
"0.73373663",
"0.7329099",
"0.72609687",
"0.7222006",
"0.72018445",
"0.71686333",
"0.7152943",
"0.71271056",
"0.7059147",
"0.7058712",
"0.7050394",
"0.7043992",
"0.6994114",
"0.6987132",
"0.69830644",
"0.6970... | 0.76266104 | 1 |
Decorator to set custom name, tags and argument types to keywords. This decorator creates ``robot_name``, ``robot_tags`` and ``robot_types`` attributes on the decorated keyword method or function based on the provided arguments. Robot Framework checks them to determine the keyword's name, tags, and argument types, resp... | def keyword(name=None, tags=(), types=()):
if callable(name):
return keyword()(name)
def decorator(func):
func.robot_name = name
func.robot_tags = tags
func.robot_types = types
return func
return decorator | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def keyword_only(func):\n\n @wraps(func)\n def wrapper(self, *args, **kwargs):\n if len(args) > 0:\n raise TypeError(\"Method %s forces keyword arguments.\" % func.__name__)\n self._input_kwargs = kwargs\n return func(self, **kwargs)\n\n return wrapper",
"def keyword_only... | [
"0.5872583",
"0.58191925",
"0.5574885",
"0.5375452",
"0.52900344",
"0.52860206",
"0.52121574",
"0.51214725",
"0.5098565",
"0.5096106",
"0.5078854",
"0.50692254",
"0.5045434",
"0.5044237",
"0.50398177",
"0.50364095",
"0.50164104",
"0.5001243",
"0.49819806",
"0.49507403",
"0.49... | 0.770149 | 0 |
Purpose To find the empty cells indicated by a zero in the inputted board | def find_empty(board):
for ii in range(len(board)):
for jj in range(len(board[ii])):
if board[ii][jj] == 0:
print('Empty: ', (jj , ii)) # column, row
return jj, ii # column, row
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_empty(self):\n num_rows = len(self.board)\n num_cols = len(self.board[0])\n\n for i in range(num_rows):\n for j in range(num_cols):\n if self.board[i][j] == 0:\n return (i, j)",
"def findEmpty(grid):\n for x in range(len(grid.board)):\n for y in range(len(grid.boa... | [
"0.83605415",
"0.8221251",
"0.82155234",
"0.8042995",
"0.79373753",
"0.7897345",
"0.7796445",
"0.7758446",
"0.7744416",
"0.77175593",
"0.7640728",
"0.7597139",
"0.75771457",
"0.7569384",
"0.7496108",
"0.7403353",
"0.73846495",
"0.7372411",
"0.73713326",
"0.7347248",
"0.725624... | 0.7979302 | 4 |
Returns the interval that contains the given value. | def find(self, value):
index = self.intervals.bisect_left(value)
if index < len(self.intervals) and self.intervals[index].lower == value:
return self.intervals[index]
if index > 0 and self.intervals[index - 1].contains(value):
return self.intervals[index - 1]
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sInterval(self, val):\n\n # NB: the support attribute has been added by precomputing __levels__\n if val in self.support:\n return self.support[val]\n else:\n return ()",
"def bucket_for_value(self, value):\n\n # bisect.bisect_left is wrong because the buckets ar... | [
"0.6415075",
"0.640243",
"0.6171111",
"0.58560824",
"0.5777766",
"0.5751155",
"0.5747634",
"0.5731073",
"0.57169926",
"0.5665486",
"0.56112486",
"0.5604937",
"0.5587684",
"0.5583798",
"0.5580682",
"0.554691",
"0.5525837",
"0.5458978",
"0.5443137",
"0.5435141",
"0.54153574",
... | 0.6968875 | 0 |
Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results). | def AnnotateVideo(self, request, context):
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AnnotateVideo(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()",
"def AnnotateVideo(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)",
"def main(path):\n video_client = (video_intelligence_service_cli... | [
"0.7315971",
"0.70176625",
"0.65501726",
"0.6327487",
"0.59404576",
"0.5624183",
"0.52494824",
"0.5219432",
"0.5201209",
"0.5173514",
"0.51656777",
"0.51656777",
"0.50802267",
"0.50043",
"0.49611413",
"0.4937006",
"0.490764",
"0.49012944",
"0.48988557",
"0.4893339",
"0.487196... | 0.723071 | 1 |
Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results). | def AnnotateVideo(self, request, context):
context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AnnotateVideo(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()",
"def AnnotateVideo(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplement... | [
"0.7315024",
"0.7229139",
"0.65496886",
"0.63269484",
"0.59401774",
"0.5622829",
"0.5250395",
"0.52176964",
"0.519997",
"0.51727754",
"0.51647973",
"0.51647973",
"0.5079136",
"0.5003357",
"0.49601293",
"0.49375713",
"0.49065349",
"0.49004942",
"0.48976195",
"0.48941717",
"0.4... | 0.70161855 | 2 |
Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results). | def AnnotateVideo(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
raise NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AnnotateVideo(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedError('Method not implemented!')",
"def AnnotateVideo(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEM... | [
"0.72307897",
"0.70175517",
"0.6549578",
"0.63271254",
"0.59403425",
"0.56237847",
"0.52499396",
"0.521891",
"0.5198639",
"0.5172917",
"0.5165079",
"0.5165079",
"0.5078916",
"0.5003412",
"0.49612385",
"0.49378994",
"0.4906793",
"0.4901073",
"0.4897856",
"0.4893443",
"0.487146... | 0.73167396 | 0 |
Returns the DCT of the normal distribution | def dct(self, z, out=None):
z = np.asfarray(z)
out = np.multiply(z, z, out)
out *= -0.5
np.exp(out, out)
return out | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dctmtx(n):\n x,y = np.meshgrid(range(n), range(n))\n D = np.sqrt(2.0/n) * np.cos(np.pi * (2*x+1) * y / (2*n))\n D[0] /= np.sqrt(2)\n return D",
"def gen_dct(size):\n\n D=tor.from_numpy(dct(np.eye(size),norm=\"ortho\",axis=0)) ## Generate DCT basis\n D=D.view(1,1,D.size(0),-1).type(t... | [
"0.65576184",
"0.6283682",
"0.6231064",
"0.6167966",
"0.6030402",
"0.59521663",
"0.5892097",
"0.58824664",
"0.5793533",
"0.57827556",
"0.5760009",
"0.5747463",
"0.57464606",
"0.5721647",
"0.5720851",
"0.56546414",
"0.5643961",
"0.5625474",
"0.5625269",
"0.561517",
"0.56081873... | 0.5914731 | 6 |
Return the probability density of the function. | def pdf(self, xs):
xs = np.atleast_2d(xs)
return self.factor * np.exp(-0.5 * np.sum(xs * xs, axis=0)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def probability_density(self, X):\n raise NotImplementedError",
"def density(self, x):\n\t\tN = len(self.train_data)\n\t\tpoints = list(self.train_data)\n\t\tdists = [np.linalg.norm(x-point)**2 for point in points]\n\t\texps = [np.exp(-dist / (2 * (self.bandwidth ** 2))) for dist in dists]\n\t\tunnormaliz... | [
"0.7857527",
"0.74666923",
"0.7355199",
"0.7337028",
"0.7146193",
"0.708334",
"0.70591",
"0.7030751",
"0.6944011",
"0.692521",
"0.6880944",
"0.6853398",
"0.68492424",
"0.6810568",
"0.6793625",
"0.67730623",
"0.67730623",
"0.67730623",
"0.6728247",
"0.664365",
"0.6634577",
"... | 0.6359698 | 52 |
Create a circle mask. | def make_circle_mask(width, ratio):
mask = np.zeros((width, width), dtype=np.float32)
center = width // 2
radius = ratio * center
y, x = np.ogrid[-center:width - center, -center:width - center]
mask_check = x * x + y * y <= radius * radius
mask[mask_check] = 1.0
return mask | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _generate_circle_mask(center_y, center_x, radius):\n\n circle = draw.circle(center_y, center_x, radius)\n\n return circle",
"def createCircularMask(shape, radius=4, center=None):\n w = shape[0]\n h = shape[1]\n if center is None: \n center = [int(w/2), int(h/2)]\n ... | [
"0.8766884",
"0.81500834",
"0.7790507",
"0.77203965",
"0.76388115",
"0.76090956",
"0.75531393",
"0.7359383",
"0.72413415",
"0.7224996",
"0.72002417",
"0.6873268",
"0.68332684",
"0.68059593",
"0.6794593",
"0.67885506",
"0.67329526",
"0.67173964",
"0.6679737",
"0.66779953",
"0.... | 0.7766674 | 3 |
Apply a filter to a component of the wavelet decomposition of an image. | def apply_filter_to_wavelet_component(data, level=None, order=1, method=None,
para=None):
n_level = len(data[1:])
level = check_level(level, n_level)
order = np.clip(order, 0, 2)
data = [list(i_data) for i_data in data]
if method is None:
method = "gauss... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_filter(self, image):\n pass",
"def apply_filter(image: np.ndarray) -> np.ndarray:\n # choose filters to apply\n return clahe(image)",
"def apply_filter(image, filter):\n filteredImage = create_image(image)\n # Apply Filter:\n # FIXME!\n \n return filteredImage",
... | [
"0.7221741",
"0.7066382",
"0.6792776",
"0.66723967",
"0.6652178",
"0.65775853",
"0.65643746",
"0.6475567",
"0.63914925",
"0.6295675",
"0.6241073",
"0.6228166",
"0.62013674",
"0.61563456",
"0.6154016",
"0.61451054",
"0.6144864",
"0.6104057",
"0.6037804",
"0.6034888",
"0.598603... | 0.62077993 | 12 |
For visually finding the centerofrotation (COR) using reconstructed slices at different CORs. | def find_center_visual_slices(sinogram, output, start, stop, step=1, zoom=1.0,
method="dfi", gpu=False, angles=None,
ratio=1.0, filter_name="hann", apply_log=True,
ncore=None):
output_name = losa.make_folder_name(output, name_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resetCoronalSegment(self):\r\n #research\r\n profprint()\r\n sGreen = slicer.mrmlScene.GetNodeByID(\"vtkMRMLSliceNodeGreen\")\r\n if sGreen == None :\r\n sGreen = slicer.mrmlScene.GetNodeByID(\"vtkMRMLSliceNode3\")\r\n reformatLogic = slicer.vtkSlicerReformatLogic()\r\n #sGreen.SetSliceV... | [
"0.6325203",
"0.58658427",
"0.56629187",
"0.5608353",
"0.5597403",
"0.55535376",
"0.55319536",
"0.5510736",
"0.5472733",
"0.5467159",
"0.54252744",
"0.5421264",
"0.5417943",
"0.541789",
"0.5403625",
"0.5399282",
"0.53945535",
"0.53796023",
"0.5379341",
"0.53721356",
"0.537169... | 0.62349164 | 1 |
Make sure WSGI header HTTP_AUTHORIZATION is detected correctly. | def test_from_request_works_with_wsgi(self):
url = "http://sp.example.com/"
params = {
'oauth_version': "1.0",
'oauth_nonce': "4572616e48616d6d65724c61686176",
'oauth_timestamp': "137131200",
'oauth_consumer_key': "0685bd9184jfhq22",
'oauth_si... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _filter_headers(self):\n return [\"Authorization\"]",
"def before(self):\n access_token = self.request.header(\"HTTP_AUTHORIZATION\")\n\n if utils.validate_token(access_token) is True:\n token = re.sub(\"Bearer \", \"\", access_token)\n creator_info = utils.decode_t... | [
"0.7049931",
"0.6598398",
"0.6572405",
"0.65535265",
"0.65389746",
"0.64369434",
"0.6407825",
"0.63494396",
"0.6242009",
"0.61941487",
"0.618318",
"0.6173666",
"0.61679435",
"0.6167339",
"0.6147641",
"0.6099214",
"0.6088233",
"0.60665655",
"0.6044282",
"0.6024928",
"0.5993601... | 0.5463115 | 91 |
Test getting an access token via GET. | def test_access_token_get(self):
client = oauth.Client(self.consumer, None)
resp, content = client.request(self._uri('request_token'), "GET")
self.assertEqual(int(resp['status']), 200) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_read_o_auth_access_token(self):\n pass",
"def test_get_token(self):\n token = self.client.get_token()\n assert_equals(token, self.client.token)",
"def test_get_main_route_auth():\n set_token(client, \"user0011\")\n\n response = client.get(url)\n assert response.status_cod... | [
"0.76568395",
"0.7429985",
"0.73414433",
"0.73345524",
"0.7263971",
"0.7200799",
"0.71125346",
"0.7103763",
"0.7101721",
"0.70631826",
"0.69881374",
"0.69393295",
"0.6927918",
"0.69090766",
"0.6886684",
"0.6856418",
"0.68210703",
"0.6714766",
"0.66905516",
"0.6686085",
"0.666... | 0.8664422 | 0 |
Test getting an access token via POST. | def test_access_token_post(self):
client = oauth.Client(self.consumer, None)
resp, content = client.request(self._uri('request_token'), "POST")
self.assertEqual(int(resp['status']), 200)
res = dict(parse_qsl(content))
self.assertTrue(b'oauth_token' in res)
self.assertTr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_access_token_get(self):\n client = oauth.Client(self.consumer, None)\n resp, content = client.request(self._uri('request_token'), \"GET\")\n\n self.assertEqual(int(resp['status']), 200)",
"def test_access_methods_with_token(self):\n\n print(\" --------------------------- Test... | [
"0.7674852",
"0.7449955",
"0.7377488",
"0.73707163",
"0.72851264",
"0.7250134",
"0.7222699",
"0.71662414",
"0.7144512",
"0.7139295",
"0.7127388",
"0.7072923",
"0.69646573",
"0.6958414",
"0.69164485",
"0.69096816",
"0.6883355",
"0.68730617",
"0.67757076",
"0.6771992",
"0.67618... | 0.8571272 | 0 |
Create a Python instance from the given DOM node. The node tag must correspond to an element declaration in this module. | def CreateFromDOM (node, default_namespace=None):
if default_namespace is None:
default_namespace = Namespace.fallbackNamespace()
return pyxb.binding.basis.element.AnyCreateFromDOM(node, default_namespace) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def CreateFromDOM (node, default_namespace=None):\n if default_namespace is None:\n default_namespace = Namespace.fallbackNamespace()\n return pyxb.binding.basis.element.AnyCreateFromDOM(node, _fallback_namespace=default_namespace)",
"def CreateFromDOM (node, default_namespace=None):\n if default... | [
"0.6950765",
"0.6950765",
"0.6950765",
"0.69477284",
"0.6701061",
"0.6701061",
"0.6701061",
"0.66993064",
"0.6668104",
"0.6654085",
"0.6623878",
"0.6596939",
"0.6586701",
"0.65665585",
"0.65102917",
"0.64922833",
"0.6474485",
"0.64247984",
"0.6325874",
"0.631508",
"0.6312153"... | 0.70125836 | 10 |
Return atomic positions flattened to a single long vector. | def position(self):
return self.atoms.reshape((1,-1)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extractCoords(self):\n if not self.rank:\n logging.info('Extracting atomic poitions')\n\n # Extract coordinates from liggghts\n self.lmp.command('variable x atom x')\n x = Rxn.lmp.extract_variable(\"x\", \"group1\", 1)\n\n self.lmp.command('variable y atom y')\n y = Rxn.lmp.extract_varia... | [
"0.6010096",
"0.5818172",
"0.55662423",
"0.5398406",
"0.536053",
"0.5349115",
"0.5345898",
"0.53417856",
"0.5341239",
"0.5317327",
"0.5244844",
"0.5206288",
"0.5156032",
"0.51075137",
"0.5106316",
"0.508289",
"0.5074672",
"0.5070674",
"0.50612575",
"0.5057421",
"0.5051576",
... | 0.6047393 | 0 |
Performs Gaussian mutation operation on single individual in floating point gene representation, Mutation works by drawing N samples from random normal distribution add adding in to individual | def gaussian_standard_mutation(individual: np.array, mutation_strength: float = 0.1) -> np.array:
offset = np.random.randn(individual.shape[0])
return mutation_strength * offset + individual | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GausianMutator(individual, sigma, indpb):\n for idx, gene in enumerate(individual):\n if rand.random() > indpb:\n dtype = gene.type\n if dtype == bool:\n gene.value(not gene.value())\n continue\n\n min_value, max_value = gene.min, gene.ma... | [
"0.6953742",
"0.6785388",
"0.6733355",
"0.6634463",
"0.6590448",
"0.6504163",
"0.6475615",
"0.6459582",
"0.6452504",
"0.6423",
"0.64207935",
"0.63494",
"0.63157177",
"0.6290326",
"0.61561704",
"0.6119536",
"0.61141557",
"0.60903174",
"0.60860413",
"0.607217",
"0.60557055",
... | 0.71980053 | 0 |
set a MPL 2D line with the current properties | def refresh_mpl_line(self, line=None):
if line:
self.set_label(self.label,line=line)
self.set_color(self.color,line=line)
self.set_style(self.style,line=line)
self.set_marker(self.marker,line=line)
self.set_markersize(self.markersize,line=line)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def proxy_line(**kwargs):\r\n return matplotlib.lines.Line2D(range(1), range(1), **kwargs)",
"def line_layer(self):\n screen_origin = self.ids.mapview.get_window_xy_from(lat1, lon1, self.ids.mapview.zoom)\n screen_destination = self.ids.mapview.get_window_xy_from(lat2, lon2, self.ids.mapview.zoo... | [
"0.6784515",
"0.6469363",
"0.6380737",
"0.6380691",
"0.63785547",
"0.6337284",
"0.63101614",
"0.63029855",
"0.6286078",
"0.62731916",
"0.6246099",
"0.6189246",
"0.61175376",
"0.6097782",
"0.6095507",
"0.6092207",
"0.60890585",
"0.6074678",
"0.60609996",
"0.6051972",
"0.604790... | 0.67503726 | 1 |
Initialize this hash table with the given initial size | def __init__(self, init_size=8):
self.size = 0
self.buckets = [LinkedList() for i in range(init_size)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.size = 1000\n self.hash_table = [None] * self.size",
"def __init__(self):\n self.size = 10000\n self.hashmap = [None] * self.size",
"def __init__(self):\n self.size = 997\n self.hash_set = [None] * self.size",
"def __init__(self, init_size=... | [
"0.7625478",
"0.7113677",
"0.70874226",
"0.69846207",
"0.69701767",
"0.6797548",
"0.66975087",
"0.6619758",
"0.6565475",
"0.6541959",
"0.65221006",
"0.6510889",
"0.65039045",
"0.65039045",
"0.64488906",
"0.64266133",
"0.64266133",
"0.64266133",
"0.6391668",
"0.63877314",
"0.6... | 0.71887976 | 1 |
Return a string representation of this hash table | def __repr__(self):
# return 'HashTable({})'.format(self.length())
return 'HashTable({})'.format(str(self.buckets)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n return 'HashTable({!r})'.format(self.items())",
"def __str__(self):\n sorted_table = InferenceUtils.get_n_best(self._table, max(len(self._table), 1))\n\n result = []\n for key, value in sorted_table.items():\n result.append('P(%s):=%f\\n' % (str(key), ... | [
"0.79308164",
"0.74436367",
"0.7432012",
"0.73263085",
"0.72215545",
"0.7204184",
"0.7199753",
"0.70514524",
"0.69706225",
"0.69571924",
"0.6938565",
"0.69228333",
"0.69082063",
"0.6906212",
"0.69056886",
"0.6889079",
"0.6888168",
"0.68758166",
"0.68698984",
"0.6867483",
"0.6... | 0.7646024 | 1 |
Set all control inputs at once, removing anything that was there previously. | def set_control_inputs(self, new_control_inputs: Iterable[Node]):
self._control_inputs = list(new_control_inputs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_inputs(self):\n for widget in self.frame.winfo_children():\n if isinstance(widget, tkinter.Entry):\n widget.delete(0, tkinter.END)\n widget.insert(0, \"\")\n elif isinstance(widget, tkinter.Checkbutton):\n widget.deselect()",
"de... | [
"0.7452032",
"0.69115007",
"0.68875706",
"0.6887214",
"0.66668487",
"0.6629474",
"0.6548615",
"0.6333645",
"0.6224006",
"0.61597747",
"0.6145552",
"0.6119209",
"0.60762745",
"0.60501075",
"0.5998392",
"0.59841377",
"0.5969505",
"0.595932",
"0.5949295",
"0.59385175",
"0.592862... | 0.6523925 | 7 |
Set all outputs at once, removing anything that was there previously. Note that information about outputs is not stored in the serialized graph. When instantiating a serialized graph, TensorFlow will use its own shape inference to infer the number, type, and shape of the operator's outputs. | def set_outputs_from_pairs(self, new_outputs: Iterable[Tuple[tf.DType,
tf.shape]]):
self._outputs = []
i = 0
for (dtype, shape) in new_outputs:
self._outputs.append(tensor.Tensor(self, i, dtype, shape))
i += 1
self._graph.increme... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_outputs(self):\n self.outputs = []",
"def __set_outputs__(self):\n self.__set_in_out_var__(None, 1)",
"def _transform_outputs(self) -> None:\n self.outputs = None if self.outputs == {} else self.outputs",
"def remove_all_outputs(self):\n self._outs.clear()",
"def infer... | [
"0.7129268",
"0.6815716",
"0.67562294",
"0.6748822",
"0.6679875",
"0.65920573",
"0.6488515",
"0.64647996",
"0.627314",
"0.6230754",
"0.6196514",
"0.6119864",
"0.6037847",
"0.60307074",
"0.598133",
"0.5952038",
"0.5944296",
"0.5926865",
"0.592278",
"0.59152335",
"0.588814",
... | 0.68547803 | 1 |
Convert a Python object or scalar value to a TensorFlow `tf.AttrValue` protocol buffer message. | def _python_type_to_attr_value(value: Any) -> tf.AttrValue:
# TODO(frreiss): Handle AttrValues that are lists
if isinstance(value, tf.AttrValue):
# TODO(frreiss): Should this case result in an error?
return value
# Scalar types, in the order they appear in the .proto file
elif isinstance(value, str):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(value):\n proto_value = proto.Value()\n if isinstance(value, int):\n proto_value.integer_value = value\n elif isinstance(value, float):\n proto_value.real_value = value\n elif isinstance(value, str):\n proto_value.string_value = value\n else:\n raise ProtoEr... | [
"0.6182536",
"0.59340006",
"0.5897383",
"0.5832336",
"0.57794446",
"0.57212096",
"0.57212096",
"0.56961167",
"0.5683621",
"0.5634957",
"0.56344485",
"0.56235605",
"0.56235605",
"0.5622986",
"0.5599108",
"0.559871",
"0.559871",
"0.559871",
"0.559871",
"0.55764854",
"0.55764854... | 0.7488524 | 0 |
Generates the headers to use for the API invocation. Attemps to use a Query API key, if it exists, then falls back to a User API if no query API key is returned. | def _build_headers(self, params: Dict) -> None:
api_key = self._get_query_api_key(params) or self.user_api_key
if api_key is None:
raise RedashApiKeyNotProvidedException('No API key provided')
self.headers = {"Authorization": "Key {}".format(api_key)} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _build_common_headers(apikey: str):\n return {\n \"Authorization\": f\"token {apikey}\",\n \"User-Agent\": \"sharing-api-fetcher\",\n \"Accept-Encoding\": \"gzip\",\n \"Accept\": \"application/json\",\n }",
"def _get_headers() -> dict:\n api_key = ... | [
"0.6608862",
"0.6515079",
"0.63939565",
"0.61925447",
"0.6093824",
"0.602265",
"0.5996472",
"0.5959184",
"0.59449047",
"0.59408766",
"0.5939129",
"0.59307647",
"0.5928254",
"0.5927411",
"0.5919036",
"0.58882684",
"0.5884055",
"0.58772504",
"0.58772504",
"0.5845113",
"0.582315... | 0.73137933 | 0 |
Returns a FlaskResponse object, where the response data represents a json object with the preview data accessible on 'preview_data' key. The preview data should match amundsen_application.models.preview_data.PreviewDataSchema | def get_preview_data(self, params: Dict, optionalHeaders: Dict = None) -> FlaskResponse:
LOGGER.debug('Retrieving preview data from Redash with params: %s', params)
try:
query_id = self.get_redash_query_id(params)
if query_id is None:
raise RedashQueryTemplateDoes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getPreviewStatus(self) -> dict:\n if self.loggingEnabled:\n self.logger.debug(f\"Starting getPreviewStatus\")\n path = \"/previewsamplestatus\"\n privateHeader = deepcopy(self.header)\n privateHeader[\"Accept\"] = \"application/json\"\n res = self.connector.getData... | [
"0.6352922",
"0.6307447",
"0.609098",
"0.6019505",
"0.57551557",
"0.57525045",
"0.5701352",
"0.5687577",
"0.5634645",
"0.56210864",
"0.5586955",
"0.5566232",
"0.55552495",
"0.5417472",
"0.5392133",
"0.53805906",
"0.53805906",
"0.5363474",
"0.53467715",
"0.5332995",
"0.5312453... | 0.6645567 | 0 |
Update target parameters to be closer to those of source parameters using an exponential moving average. | def update_ema(target_params, source_params, rate=0.99):
for targ, src in zip(target_params, source_params):
targ.detach().mul_(rate).add_(src, alpha=1 - rate) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_average(source, target, tau=0.005):\n for target_param, param in zip(target.parameters(), source.parameters()):\n target_param.data.copy_(\n target_param.data * (1.0 - tau) + param.data * tau\n )",
"def exponentialMovingAverage(self,new,old, alpha):\n return alpha * ne... | [
"0.65540874",
"0.63846195",
"0.60326076",
"0.5953432",
"0.5940762",
"0.589877",
"0.58710045",
"0.5857003",
"0.57975394",
"0.5707032",
"0.5690643",
"0.5686295",
"0.5622819",
"0.5593131",
"0.5593131",
"0.55850744",
"0.5550918",
"0.5540762",
"0.55254173",
"0.55038905",
"0.549471... | 0.7388066 | 0 |
Take the mean over all nonbatch dimensions. | def mean_flat(tensor):
return tensor.mean(axis=list(range(1, len(tensor.shape)))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mean_allcnnc():\n # TODO implement pre forward hook to adapt to arbitary image size for other data sets than cifar100\n return nn.Sequential(\n nn.AvgPool2d(kernel_size=(6, 6)),\n flatten()\n )",
"def mean_flat(tensor):\n return tensor.mean(dim=list(range(1, len(tensor.shape))))",
... | [
"0.69110435",
"0.67947525",
"0.6781341",
"0.67624015",
"0.6731038",
"0.67190164",
"0.67012674",
"0.66761786",
"0.66351634",
"0.65871763",
"0.65857583",
"0.6555452",
"0.6552374",
"0.6535818",
"0.6497036",
"0.64801466",
"0.6465107",
"0.6448588",
"0.6445976",
"0.64292395",
"0.64... | 0.67724854 | 3 |
Read the DataFrame and return the number of rows. | def get_rows(df):
return df.shape[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rowCount(self, index=QtCore.QModelIndex()):\n # len(df.index) is faster, so use it:\n # In [12]: %timeit df.shape[0]\n # 1000000 loops, best of 3: 437 ns per loop\n # In [13]: %timeit len(df.index)\n # 10000000 loops, best of 3: 110 ns per loop\n # In [14]: %timeit df.... | [
"0.75915545",
"0.7528851",
"0.7174786",
"0.71410966",
"0.6974211",
"0.6974211",
"0.69015694",
"0.68761593",
"0.68680775",
"0.6829799",
"0.6824078",
"0.6814878",
"0.6781822",
"0.6759802",
"0.6703716",
"0.67016476",
"0.6676153",
"0.6658497",
"0.664334",
"0.6640812",
"0.66393113... | 0.72066563 | 2 |
Generate a random positive definite symmetric matrix, with all entries positive. | def generate_pos_def_all_pos(n):
A = np.random.uniform(size=(n,n))
A += A.T
# Add just enough of an identity matrix to make all eigenvalues positive
A += -1.01*np.min(np.linalg.eigvalsh(A))*np.identity(n)
return A | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_positive_semi_definite_matrix(n_dim):\n cov = np.random.randn(n_dim, n_dim)\n return np.dot(cov, cov.T)",
"def gen_positive_definite_matrix(dim: int) -> np.ndarray:\n pdmatrix = np.random.random(size=(dim, dim))\n pdmatrix = np.dot(pdmatrix, pdmatrix.T)\n pdmatrix /= pdmat... | [
"0.7346851",
"0.68077797",
"0.679069",
"0.6674386",
"0.6470993",
"0.6416835",
"0.6365562",
"0.63138735",
"0.62766635",
"0.625799",
"0.6256904",
"0.62565666",
"0.6162988",
"0.59638536",
"0.594631",
"0.5837493",
"0.5828848",
"0.58099043",
"0.5796327",
"0.57730633",
"0.5754725",... | 0.5997281 | 13 |
Generate a fourdigit captcha string | def generate_code(self):
seeds = "1234567890"
random_str = []
for i in range(4):
random_str.append(choice(seeds))
return "".join(random_str) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pwgen(length=16, ichars=string.ascii_letters+string.digits):\n return ''.join(random.choice(ichars) for i in range(length))",
"def randompassword():\n characters = string.ascii_uppercase + string.ascii_lowercase + string.digits\n size = random.randint(8, 12)\n return ''.join(random.choice(charact... | [
"0.69752574",
"0.6893933",
"0.6874771",
"0.6847418",
"0.6843329",
"0.6841973",
"0.6699867",
"0.66612184",
"0.66050386",
"0.6589786",
"0.6567301",
"0.6532262",
"0.65305144",
"0.652956",
"0.6518652",
"0.65036166",
"0.650272",
"0.64566344",
"0.64555275",
"0.6442882",
"0.6438",
... | 0.6326308 | 31 |
Overrides the default implementation for equality. | def __eq__(self, other):
if isinstance(other, Action):
return self.__dict__.items() == other.__dict__.items()
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n pass",
"def __eq__(self, other):\n pass",
"def __eq__(self, other):\n return equal(self, other)",
"def __eq__(self, other):\n raise NotImplementedError",
"def __eq__(self, other):\n raise NotImplementedError",
"def __eq__(self, other):\n ... | [
"0.84188855",
"0.84188855",
"0.83910173",
"0.8301474",
"0.8301474",
"0.8301474",
"0.8267702",
"0.8238731",
"0.8238731",
"0.8226201",
"0.8226201",
"0.8226201",
"0.8226201",
"0.8226201",
"0.8226201",
"0.8226201",
"0.8226201",
"0.8226201",
"0.8226201",
"0.8226201",
"0.82174826",... | 0.0 | -1 |
Create an Action instance from a dataframe row. | def create_from_row(cls, row: pd.Series) -> "Action":
fields = [
key
for key, value in cls.__dataclass_fields__.items()
if value.type != ClassVar
]
d = {key: value for key, value in row.to_dict().items() if key in fields}
return cls(**d) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_from_df(df: pd.DataFrame) -> \"Actions\":\n actions = Actions()\n for i, row in df.iterrows():\n action = Action.create_from_row(row)\n actions.append(action)\n return actions",
"def from_dataframe(cls, dataframe):\n return cls(dataframe)",
"def FromRo... | [
"0.7450033",
"0.6170774",
"0.5990652",
"0.58422154",
"0.5713543",
"0.55582273",
"0.5490763",
"0.54875004",
"0.5413658",
"0.539996",
"0.5394156",
"0.53519624",
"0.5331359",
"0.5267999",
"0.52194196",
"0.52122515",
"0.51671094",
"0.51299727",
"0.5126559",
"0.5064013",
"0.506401... | 0.78083163 | 0 |
Overrides the default implementation for equality. | def __eq__(self, other):
if isinstance(other, Actions):
return self.actions == other.actions
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n pass",
"def __eq__(self, other):\n pass",
"def __eq__(self, other):\n return equal(self, other)",
"def __eq__(self, other):\n raise NotImplementedError",
"def __eq__(self, other):\n raise NotImplementedError",
"def __eq__(self, other):\n ... | [
"0.8419311",
"0.8419311",
"0.83910495",
"0.83018637",
"0.83018637",
"0.83018637",
"0.826798",
"0.8238922",
"0.8238922",
"0.8227885",
"0.8227885",
"0.8227885",
"0.8227885",
"0.8227885",
"0.8227885",
"0.8227885",
"0.8227885",
"0.8227885",
"0.8227885",
"0.8227885",
"0.8218155",
... | 0.0 | -1 |
Converts this instance of Actions to a df. | def to_df(self) -> pd.DataFrame:
data = []
for action in self.actions:
data.append(action.to_df())
df = pd.read_json(json.dumps(data), orient="list")
return df[self.fields] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_df(self):\n return pd.DataFrame([dict(self)])",
"def to_df(self):\n return pd.DataFrame([dict(self)])",
"def to_df(self):\n return pd.DataFrame([dict(self)])",
"def to_df(self):\n return pd.DataFrame([dict(self)])",
"def to_df(self):\n return pd.DataFrame([dict(sel... | [
"0.7052811",
"0.7052811",
"0.7052811",
"0.7052811",
"0.7052811",
"0.704461",
"0.66909885",
"0.65945745",
"0.6583666",
"0.65026647",
"0.6496791",
"0.64873725",
"0.64673084",
"0.6423704",
"0.6396283",
"0.63379693",
"0.6311073",
"0.6303729",
"0.62922996",
"0.62855774",
"0.627629... | 0.86642236 | 0 |
return the topic string used to publish telemetry | def _get_topic_for_response():
return _get_topic_base() + "res/" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __get_topic(self) -> str:\n\t\treturn os.getenv('MQTT_DRIVEN_TOPIC', 'app/event')",
"def __get_topic(self) -> str:\n\t\treturn os.getenv('MQTT_DRIVER_TOPIC', 'app/book/#')",
"def topic(self):\n return self.config.get('topic', f'{NAMESPACE}/{self.id}')",
"def topic(self) -> str:\n return sel... | [
"0.80575335",
"0.7820737",
"0.7709569",
"0.76968056",
"0.75241995",
"0.7345035",
"0.7274381",
"0.72364366",
"0.71681803",
"0.71116406",
"0.6964819",
"0.68161917",
"0.66888684",
"0.65743035",
"0.64316106",
"0.6430563",
"0.64077574",
"0.63142544",
"0.62933433",
"0.62681323",
"0... | 0.661172 | 13 |
Returns true for array attribute whose dimensions can change every event | def sizeIsVlen(self):
return self.rank > 0 and 'vlen' in self.tags | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_array(self):\n return len(self.descriptor) > 1",
"def vectorized(self):\n return False",
"def isscalar(array):\n arr = ma.array(array)\n if not hasattr(arr, '__len__') or arr.shape == () or len(arr) == 1:\n return True\n return False",
"def is_array(a):\n try:\n ... | [
"0.6569329",
"0.5988319",
"0.5977881",
"0.5940368",
"0.5916887",
"0.58391917",
"0.5837839",
"0.5825186",
"0.5740685",
"0.5731491",
"0.5710401",
"0.570414",
"0.5699754",
"0.5694828",
"0.56365365",
"0.5632225",
"0.56319743",
"0.56299895",
"0.5611868",
"0.558285",
"0.55637807",
... | 0.0 | -1 |
Find the robot's row and column in the room | def robot_location(room):
for r in range(WIDTH):
for c in range(WIDTH):
if room[r][c] == "robot":
return (r, c) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def locateRobot(self):\n logging.info(\"Display Carte : {}\".format(self.name))\n for r, row in enumerate(self.map):\n #print(row)\n for c, cell in enumerate(row):\n if (cell == \"X\"):\n logging.info(\"r={} / c={}\".format(r, c))\n ... | [
"0.7209209",
"0.68491966",
"0.67484796",
"0.6742116",
"0.66422343",
"0.65613884",
"0.6508796",
"0.64626616",
"0.645346",
"0.64490324",
"0.64116305",
"0.64116305",
"0.64116305",
"0.64116305",
"0.6384425",
"0.6384425",
"0.6384425",
"0.6382094",
"0.63803464",
"0.63532513",
"0.63... | 0.83412594 | 0 |
Shrinks learning rate by a specified factor. | def adjust_learning_rate(optimizer, shrink_factor):
print("\nDECAYING learning rate.")
for param_group in optimizer.param_groups:
param_group['lr'] = param_group['lr'] * shrink_factor
print("The new learning rate is %f\n" % (optimizer.param_groups[0]['lr'],)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _shrink_main(self, amt):\n self.ratio -= amt\n self.ratio = max(self.min_ratio, self.ratio)",
"def increase_learning(self, factor):\n pass",
"def adjust_learning_rate(optimizer, lr_factor, epoch):\n #lr = args.lr * (0.1 ** (epoch // 30))\n print('the learning rate is set to {0:.5... | [
"0.621651",
"0.6192596",
"0.61244947",
"0.6090921",
"0.6086119",
"0.6037739",
"0.6035497",
"0.6027836",
"0.59555835",
"0.58451587",
"0.5829488",
"0.58293223",
"0.5815257",
"0.5783322",
"0.5766719",
"0.5764448",
"0.5741555",
"0.573596",
"0.5732485",
"0.57179576",
"0.5712487",
... | 0.73205805 | 1 |
conv2d returns a 2d convolution layer with full stride. | def conv2d(x, W):
return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_conv2d():\n img = np.array([\n [0.3, 0.5, 0.7, 0.9],\n [0.1, 0.3, 0.5, 0.7],\n [0.9, 0.7, 0.5, 0.3],\n ])\n template = np.array([\n [1, 0],\n [1, 0],\n ])\n template = np.flipud(np.fliplr(template))\n return fftconvolve(img, template, mode='valid')",
... | [
"0.763011",
"0.7626646",
"0.75784826",
"0.7463977",
"0.74255186",
"0.74255186",
"0.74255186",
"0.74255186",
"0.738611",
"0.73377377",
"0.73304254",
"0.7329959",
"0.731406",
"0.73021233",
"0.7296823",
"0.72701716",
"0.72465515",
"0.72311795",
"0.7208086",
"0.71958727",
"0.7189... | 0.74572504 | 5 |
weight_variable generates a weight variable of a given shape. | def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def weight_variable(shape):\n initial = tf.truncated_normal(shape, stddev=0.1)\n return tf.get_variable(\n 'weight', initializer=initial, regularizer=tf.nn.l2_loss)",
"def weight_variable(shape):\n initial = tf.truncated_normal(shape)\n return tf.Variable(initial)",
"def create_weight_variable(shape):... | [
"0.82682097",
"0.8235508",
"0.8158841",
"0.8156995",
"0.8137802",
"0.81348443",
"0.81348443",
"0.81348443",
"0.81348443",
"0.81348443",
"0.81348443",
"0.81348443",
"0.81348443",
"0.81348443",
"0.81348443",
"0.812119",
"0.80655366",
"0.7983301",
"0.79793143",
"0.79584336",
"0.... | 0.81399417 | 6 |
Performs histogram equalization of a given RGB image. | def _histogram_equalize_rgb(im_orig):
imYIQ = utils.rgb2yiq(im_orig)
hist_orig = utils.get_histogram(imYIQ[:, :, 0])
imYIQ[:, :, 0] = _histogram_equalize_image(imYIQ[:, :, 0], hist_orig)
hist_eq = utils.get_histogram(imYIQ[:, :, 0])
im_eq = utils.yiq2rgb(imYIQ)
return [im_eq, hist_orig, his... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def histogram_equalization(img):\n\n if len(img.shape) == 3:\n img_copy = np.copy(img)\n\n blue = img_copy[:,:,0]\n blue = histogram_equalize(blue)\n\n green = img_copy[:,:,1]\n green = histogram_equalize(green)\n\n red = img_copy[:,:,2]\n red = histogram_equaliz... | [
"0.79236877",
"0.77263165",
"0.7703193",
"0.757129",
"0.7451327",
"0.74336374",
"0.7433323",
"0.7427606",
"0.73931915",
"0.7384596",
"0.7383182",
"0.7324698",
"0.72184783",
"0.7170541",
"0.70633906",
"0.7060091",
"0.70532674",
"0.6983348",
"0.6972312",
"0.6958702",
"0.695395"... | 0.7645059 | 3 |
Performs histogram equalization of a given grayscale image. | def _histogram_equalize_grayscale(im_orig):
image = im_orig.copy()
hist_orig = utils.get_histogram(image)
im_eq = _histogram_equalize_image(image, hist_orig)
hist_eq = utils.get_histogram(im_eq)
return [im_eq, hist_orig, hist_eq] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def histogram_equalize(im_orig):\n if im_orig.ndim == 3:\n return _histogram_equalize_rgb(im_orig)\n return _histogram_equalize_grayscale(im_orig)",
"def histogram_equalization(img):\n\n if len(img.shape) == 3:\n img_copy = np.copy(img)\n\n blue = img_copy[:,:,0]\n blue = his... | [
"0.7873027",
"0.77112335",
"0.76775825",
"0.7435667",
"0.7402457",
"0.73376405",
"0.7337502",
"0.73315907",
"0.73265445",
"0.7312433",
"0.7262344",
"0.723707",
"0.7201633",
"0.7110826",
"0.70894635",
"0.7026571",
"0.691227",
"0.6881661",
"0.6865407",
"0.68376863",
"0.6797993"... | 0.762442 | 3 |
Performs histogram equalization of a given grayscale or RGB image. | def histogram_equalize(im_orig):
if im_orig.ndim == 3:
return _histogram_equalize_rgb(im_orig)
return _histogram_equalize_grayscale(im_orig) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def histogram_equalization(img):\n\n if len(img.shape) == 3:\n img_copy = np.copy(img)\n\n blue = img_copy[:,:,0]\n blue = histogram_equalize(blue)\n\n green = img_copy[:,:,1]\n green = histogram_equalize(green)\n\n red = img_copy[:,:,2]\n red = histogram_equaliz... | [
"0.78980786",
"0.7792403",
"0.7586312",
"0.75559366",
"0.7529373",
"0.7455406",
"0.7434594",
"0.73722005",
"0.7365525",
"0.7349805",
"0.7252676",
"0.72253525",
"0.721632",
"0.7205233",
"0.7183504",
"0.7164575",
"0.70882064",
"0.70414686",
"0.700131",
"0.6878102",
"0.6867632",... | 0.7982988 | 0 |
Convert the class properties defined in the enum_class into list of keyvalue pair | def as_choices(cls, key_type=None):
if key_type is None:
key_type = cls.get_default_choice_type()
return cls.enum_class.as_choices(key_type) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_enum(enum_annotations: Any) -> list:\n result = []\n for attribute in list(enum_annotations):\n result.append(attribute.value)\n return result",
"def _enumerate_message(self, name, message_class):\n key_value_pair = []\n assert(message_class is not None) ... | [
"0.6567826",
"0.61094123",
"0.60046977",
"0.59038085",
"0.5813817",
"0.5802839",
"0.5768112",
"0.5719736",
"0.566406",
"0.56441116",
"0.56357074",
"0.5609803",
"0.5585767",
"0.5584094",
"0.55627424",
"0.5542438",
"0.55334777",
"0.55046064",
"0.5502425",
"0.5471877",
"0.546770... | 0.55373675 | 16 |
This only works if you are referring to one and only one enum | def single_flag_name(self):
return self.enum_class.to_representation(self.flags.name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enum(self):\r\n raise NotImplementedError",
"def test_test_enum_parameters(self):\n pass",
"def test_get_enum_by_value():\n assert BusinessType.get_enum_by_value('CP') == BusinessType.COOPERATIVE\n assert BusinessType.get_enum_by_value('FM') == BusinessType.PARTNERSHIP_AND_SOLE_PROP\n ... | [
"0.76251066",
"0.7110258",
"0.6530013",
"0.6522255",
"0.6425308",
"0.6418364",
"0.64164054",
"0.64134383",
"0.64094687",
"0.6332652",
"0.6324254",
"0.63136464",
"0.6296608",
"0.6283194",
"0.62829894",
"0.6276698",
"0.6256552",
"0.62522113",
"0.6242993",
"0.62247485",
"0.62184... | 0.0 | -1 |
Return xcoordinate of turret | def Getxcoord(self):
return self.x_coord | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_x(self):\n return self.position.x",
"def x(self):\r\n return self.position.x",
"def get_x_position(self):\n return self.rect.x",
"def get_x(self):\n return self.posX",
"def get_alien_x(self):\n return self.x",
"def get_x_position(self):\n return self.actual_... | [
"0.7378945",
"0.731268",
"0.7009716",
"0.69394356",
"0.68851876",
"0.68819356",
"0.6842187",
"0.67623675",
"0.6754803",
"0.6730076",
"0.66444147",
"0.66420156",
"0.66246307",
"0.6580915",
"0.6580915",
"0.65778947",
"0.65697944",
"0.6532489",
"0.6498885",
"0.63734895",
"0.6348... | 0.653106 | 18 |
Returns xcoordinate of end of turret barrel | def Getbarrelendx(self):
return self.barrel_endx | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def x(self):\r\n return self.position.x",
"def get_x(self):\n\t\treturn self._collision_rect.x + 14",
"def _get_x(self):\n return self.position.x",
"def DrawTurret(self):\n pygame.draw.rect(self.displaysurf, self.color, (int(self.x_coord - T_W1 / 2), WINHEIGHT - T_H1 - GR_HEIGHT, T_W1, T_H1)... | [
"0.6625401",
"0.6425607",
"0.6390025",
"0.63447297",
"0.6216635",
"0.6216635",
"0.6185033",
"0.61149156",
"0.60586065",
"0.6020744",
"0.6009489",
"0.5985946",
"0.59616584",
"0.59415406",
"0.59267324",
"0.5922315",
"0.5886675",
"0.5875472",
"0.5874113",
"0.5874113",
"0.585469"... | 0.53759754 | 60 |
Returns ycoordinate of end of turret barrel | def Getbarrelendy(self):
return self.barrel_endy | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bottom_y(self):\r\n return self.position.y - self.size.y - self.bulk",
"def get_y(self):\n\t\treturn self._collision_rect.y + 25",
"def y(self):\r\n return self.position.y",
"def _get_y(self):\n return self.position.y",
"def get_alien_y(self):\n return self.y",
"def top_y(self):... | [
"0.71090966",
"0.7031665",
"0.69679034",
"0.69383585",
"0.67833567",
"0.67041516",
"0.67000526",
"0.66991776",
"0.6624893",
"0.65654343",
"0.6522966",
"0.6476214",
"0.6451229",
"0.64136136",
"0.64136136",
"0.63953817",
"0.639346",
"0.63800764",
"0.62939143",
"0.62939143",
"0.... | 0.5967732 | 38 |
Sets the date of this PostPurchaseInvoicesPurchaseInvoice. | def date(self, date):
if self.local_vars_configuration.client_side_validation and date is None: # noqa: E501
raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501
self._date = date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def receipt_date(self, receipt_date):\n\n self._receipt_date = receipt_date",
"def receipt_date(self, receipt_date):\n\n self._receipt_date = receipt_date",
"def set_date(self, date):\n self.date = date\n return",
"def set_date(self, date):\n self.date = date",
"def date(... | [
"0.6712213",
"0.6712213",
"0.6674705",
"0.66728663",
"0.65305245",
"0.65305245",
"0.65305245",
"0.65305245",
"0.65305245",
"0.6492838",
"0.64487684",
"0.63659644",
"0.63659644",
"0.63334423",
"0.63334423",
"0.6280316",
"0.6253416",
"0.62296027",
"0.62146926",
"0.6207872",
"0.... | 0.59566015 | 22 |
Sets the due_date of this PostPurchaseInvoicesPurchaseInvoice. | def due_date(self, due_date):
if self.local_vars_configuration.client_side_validation and due_date is None: # noqa: E501
raise ValueError("Invalid value for `due_date`, must not be `None`") # noqa: E501
self._due_date = due_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def due_date(self, due_date: date):\n\n self._due_date = due_date",
"def due_date(self, due_date):\n\n self._due_date = due_date",
"def date_due(self, date_due):\n\n self._date_due = date_due",
"def set_statement_due_date(self, due_date):\n due_date_to_set = None\n if due_d... | [
"0.8268273",
"0.82593894",
"0.7945194",
"0.7414522",
"0.7264256",
"0.6772027",
"0.57151383",
"0.5685275",
"0.55952746",
"0.5585019",
"0.54522556",
"0.5381746",
"0.5381746",
"0.5356795",
"0.5295356",
"0.52731264",
"0.52731264",
"0.5260908",
"0.5260908",
"0.5214779",
"0.5124477... | 0.795006 | 2 |
Sets the postponed_accounting of this PostPurchaseInvoicesPurchaseInvoice. | def postponed_accounting(self, postponed_accounting):
self._postponed_accounting = postponed_accounting | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def planned_purge_date(self, planned_purge_date):\n\n self._planned_purge_date = planned_purge_date",
"def planned_purge_date(self, planned_purge_date):\n\n self._planned_purge_date = planned_purge_date",
"def billing(self, billing):\n\n self._billing = billing",
"def stripe_invoices(sel... | [
"0.5164518",
"0.5164518",
"0.5129151",
"0.510779",
"0.50539356",
"0.48352224",
"0.48083425",
"0.48063827",
"0.47485515",
"0.47256663",
"0.47247475",
"0.46916565",
"0.4663355",
"0.46363682",
"0.45863387",
"0.45349258",
"0.44853544",
"0.44791558",
"0.44712302",
"0.43583533",
"0... | 0.85412544 | 0 |
Sets the contact_name of this PostPurchaseInvoicesPurchaseInvoice. | def contact_name(self, contact_name):
self._contact_name = contact_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contact_name(self) -> str:\n return pulumi.get(self, \"contact_name\")",
"def contact(self, contact):\n\n self.logger.debug(\"In 'contact' setter.\")\n\n self._contact = contact",
"def primary_contact_name(self, primary_contact_name):\n\n self._primary_contact_name = primary_con... | [
"0.622506",
"0.6194355",
"0.6183277",
"0.59499365",
"0.59499365",
"0.5937808",
"0.5937808",
"0.5915116",
"0.5810493",
"0.5577777",
"0.5577777",
"0.55287033",
"0.54999256",
"0.544679",
"0.53931767",
"0.5383851",
"0.5381487",
"0.53345734",
"0.53317356",
"0.53317356",
"0.5275610... | 0.79246986 | 1 |
Sets the contact_reference of this PostPurchaseInvoicesPurchaseInvoice. | def contact_reference(self, contact_reference):
self._contact_reference = contact_reference | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contact(self, contact):\n\n self.logger.debug(\"In 'contact' setter.\")\n\n self._contact = contact",
"def contact(self, contact):\n\n self._contact = contact",
"def contact(self, contact):\n\n self._contact = contact",
"def billing_contact(self, billing_contact):\n\n s... | [
"0.6713272",
"0.6480639",
"0.6480639",
"0.63949925",
"0.6050419",
"0.59468305",
"0.59468305",
"0.5923061",
"0.5904237",
"0.57644933",
"0.57644933",
"0.56140673",
"0.55840105",
"0.55726564",
"0.55439264",
"0.55439264",
"0.5491725",
"0.5442325",
"0.5413189",
"0.5404995",
"0.540... | 0.7702224 | 0 |
Sets the reference of this PostPurchaseInvoicesPurchaseInvoice. | def reference(self, reference):
self._reference = reference | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invoice_ids(self, invoice_ids):\n\n self._invoice_ids = invoice_ids",
"def setReference(self, *args):\n return _libsbml.Association_setReference(self, *args)",
"def stripe_invoices(self, stripe_invoices):\n\n self._stripe_invoices = stripe_invoices",
"def instrument_ref(self, instrum... | [
"0.5986959",
"0.5846162",
"0.57322234",
"0.53838366",
"0.5367223",
"0.5334236",
"0.515882",
"0.51314694",
"0.5052817",
"0.4972813",
"0.4908925",
"0.49049535",
"0.48497072",
"0.48353693",
"0.48321584",
"0.47238892",
"0.4696454",
"0.46590412",
"0.46104282",
"0.460777",
"0.45875... | 0.54489547 | 4 |
Sets the vendor_reference of this PostPurchaseInvoicesPurchaseInvoice. | def vendor_reference(self, vendor_reference):
self._vendor_reference = vendor_reference | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vendor(self, vendor):\n\n self._vendor = vendor",
"def vendor_id(self, vendor_id):\n\n self._vendor_id = vendor_id",
"def vendorid(self, vendorid):\n\n self._vendorid = vendorid",
"def preview_vendor_hash(self, preview_vendor_hash):\n\n self._preview_vendor_hash = preview_vend... | [
"0.6127532",
"0.6047234",
"0.60127974",
"0.5142039",
"0.47634998",
"0.47176838",
"0.46963373",
"0.46252054",
"0.46232238",
"0.43928522",
"0.43740016",
"0.43684146",
"0.43338934",
"0.42771545",
"0.4275448",
"0.42525345",
"0.425153",
"0.42063642",
"0.42063642",
"0.41791555",
"0... | 0.7597187 | 0 |
Sets the notes of this PostPurchaseInvoicesPurchaseInvoice. | def notes(self, notes):
self._notes = notes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def notes(self, notes):\n if notes is None:\n raise ValueError(\"Invalid value for `notes`, must not be `None`\") # noqa: E501\n\n self._notes = notes",
"def notes(self, notes: str):\n self._notes = notes",
"def setNotes(self, *args):\n return _libsbml.SBase_setNotes(sel... | [
"0.6967804",
"0.6942551",
"0.68292516",
"0.623447",
"0.59814185",
"0.5686879",
"0.5444578",
"0.5426621",
"0.53484076",
"0.53484076",
"0.53419954",
"0.53353024",
"0.5334114",
"0.5332539",
"0.53089243",
"0.52705026",
"0.52042764",
"0.51900387",
"0.51637334",
"0.5131907",
"0.512... | 0.72806025 | 3 |
Sets the total_quantity of this PostPurchaseInvoicesPurchaseInvoice. | def total_quantity(self, total_quantity):
self._total_quantity = total_quantity | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_sold_quantity(self, total_sold_quantity):\n\n self._total_sold_quantity = total_sold_quantity",
"def trash_item_quantity(self, trash_item_quantity):\n\n self._trash_item_quantity = trash_item_quantity",
"def total_amount(self, total_amount):\n\n self._total_amount = total_amount"... | [
"0.65348953",
"0.6143091",
"0.6062372",
"0.5747401",
"0.5747401",
"0.5747401",
"0.5747401",
"0.57295144",
"0.57295144",
"0.57295144",
"0.57295144",
"0.57295144",
"0.57295144",
"0.57295144",
"0.57295144",
"0.57032037",
"0.5658872",
"0.5599074",
"0.5587467",
"0.5582165",
"0.554... | 0.765062 | 0 |
Sets the net_amount of this PostPurchaseInvoicesPurchaseInvoice. | def net_amount(self, net_amount):
self._net_amount = net_amount | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def base_currency_net_amount(self, base_currency_net_amount):\n\n self._base_currency_net_amount = base_currency_net_amount",
"def netincome_multiple(self, netincome_multiple):\n\n self._netincome_multiple = netincome_multiple",
"def netTrdQtyLot(self, netTrdQtyLot):\n\n self._netTrdQtyLot... | [
"0.681148",
"0.6227932",
"0.57708323",
"0.5584708",
"0.52162313",
"0.52098954",
"0.5072743",
"0.5061319",
"0.50505716",
"0.49473023",
"0.4923785",
"0.4920528",
"0.4904878",
"0.48799494",
"0.48773444",
"0.48637554",
"0.48637554",
"0.48637554",
"0.48637554",
"0.48637554",
"0.48... | 0.8174647 | 0 |
Sets the total_amount of this PostPurchaseInvoicesPurchaseInvoice. | def total_amount(self, total_amount):
self._total_amount = total_amount | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_charges_amount(self, total_charges_amount):\n\n self._total_charges_amount = total_charges_amount",
"def total_quantity(self, total_quantity):\n\n self._total_quantity = total_quantity",
"def total(self, total):\n\n self._total = total",
"def total(self, total):\n\n self... | [
"0.6557493",
"0.6501971",
"0.6490655",
"0.6490655",
"0.6490655",
"0.6490655",
"0.6490655",
"0.6490655",
"0.6490655",
"0.6490655",
"0.6475942",
"0.6179905",
"0.6130284",
"0.60660183",
"0.60392946",
"0.60348994",
"0.602849",
"0.5908025",
"0.5854423",
"0.5752895",
"0.5752191",
... | 0.7552586 | 0 |
Sets the currency_id of this PostPurchaseInvoicesPurchaseInvoice. | def currency_id(self, currency_id):
self._currency_id = currency_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def set_currency(self, currency: str):\n json = {**self.get_data(), \"currencyId\": currency}\n return await self.easee.put(f\"/api/sites/{self.id}\", json=json)",
"def currency(self, currency):\n\n self._currency = currency",
"def currency(self, currency):\n\n self._currency ... | [
"0.63991755",
"0.6175038",
"0.6175038",
"0.6175038",
"0.6175038",
"0.61173224",
"0.6096327",
"0.5886752",
"0.5815854",
"0.5607985",
"0.555162",
"0.555162",
"0.555162",
"0.555162",
"0.555162",
"0.5453619",
"0.54468846",
"0.5404383",
"0.53864294",
"0.53787655",
"0.5371533",
"... | 0.7584371 | 2 |
Sets the base_currency_total_amount of this PostPurchaseInvoicesPurchaseInvoice. | def base_currency_total_amount(self, base_currency_total_amount):
self._base_currency_total_amount = base_currency_total_amount | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def base_row_total(self, base_row_total):\n\n self._base_row_total = base_row_total",
"def base_discount_amount(self, base_discount_amount):\n\n self._base_discount_amount = base_discount_amount",
"def base_currency(self, base_currency):\n\n self._base_currency = base_currency",
"def bas... | [
"0.6678808",
"0.66203034",
"0.66065305",
"0.65990907",
"0.6465834",
"0.6432214",
"0.64186174",
"0.6417187",
"0.6088956",
"0.6038598",
"0.58702946",
"0.5646479",
"0.55989957",
"0.5529933",
"0.5402454",
"0.5397846",
"0.5319007",
"0.52826804",
"0.52421385",
"0.51199967",
"0.5061... | 0.8098732 | 0 |
Sets the status_id of this PostPurchaseInvoicesPurchaseInvoice. | def status_id(self, status_id):
self._status_id = status_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id_status(self, id_status):\n self._id_status = id_status",
"def status_ids(self, status_ids):\n\n self._status_ids = status_ids",
"def status(self, status: int):\n if status is None:\n raise ValueError(\"Invalid value for `status`, must not be `None`\") # noqa: E501\n\n ... | [
"0.66867805",
"0.6269005",
"0.60735667",
"0.6006876",
"0.6006876",
"0.6006876",
"0.5977543",
"0.59016436",
"0.58946407",
"0.58686817",
"0.5849853",
"0.58398247",
"0.58384484",
"0.57777655",
"0.57777655",
"0.57777655",
"0.57777655",
"0.57777655",
"0.57777655",
"0.57777655",
"0... | 0.68944526 | 0 |
Sets the invoice_lines of this PostPurchaseInvoicesPurchaseInvoice. | def invoice_lines(self, invoice_lines):
if self.local_vars_configuration.client_side_validation and invoice_lines is None: # noqa: E501
raise ValueError("Invalid value for `invoice_lines`, must not be `None`") # noqa: E501
self._invoice_lines = invoice_lines | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invoice_ids(self, invoice_ids):\n\n self._invoice_ids = invoice_ids",
"def stripe_invoices(self, stripe_invoices):\n\n self._stripe_invoices = stripe_invoices",
"def invoice_line_create(self, invoice_id, qty):\n invoice_lines = self.env['account.invoice.line']\n precision = self... | [
"0.7089234",
"0.63822126",
"0.6080149",
"0.59047717",
"0.58448255",
"0.5641987",
"0.56416446",
"0.5589948",
"0.5580606",
"0.5540686",
"0.5474156",
"0.5368353",
"0.53361195",
"0.5256505",
"0.5207284",
"0.5125516",
"0.5105482",
"0.50821394",
"0.50798434",
"0.50782615",
"0.50628... | 0.82710296 | 0 |
Sets the tax_analysis of this PostPurchaseInvoicesPurchaseInvoice. | def tax_analysis(self, tax_analysis):
self._tax_analysis = tax_analysis | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tax(self, tax_dict: dict):\n if tax_dict:\n self._tax = SalesTransactionTaxModel(**tax_dict)\n else:\n self._tax = None",
"def tax_id(self, tax_id):\n\n self._tax_id = tax_id",
"def tax_amount(self, tax_amount):\n\n self._tax_amount = tax_amount",
"def ta... | [
"0.6248358",
"0.62429315",
"0.6214527",
"0.6214527",
"0.6038242",
"0.5996619",
"0.5962267",
"0.59383696",
"0.5884016",
"0.5773423",
"0.57103175",
"0.5688809",
"0.55462104",
"0.5465174",
"0.54630834",
"0.54471326",
"0.5442984",
"0.5407754",
"0.5372956",
"0.53676564",
"0.532534... | 0.8053622 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, PostPurchaseInvoicesPurchaseInvoice):
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, PostPurchaseInvoicesPurchaseInvoice):
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 |
Describes an InputOption instance. | def _describe_input_option(self, option, **options):
accept_value = option.accept_value()
default = option.get_default()
if accept_value and default is not None and (not isinstance(default, list) or len(default)):
default = '<comment> [default: %s]</comment>' % self._format_default_v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def option_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"option_name\")",
"def option_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"option_name\")",
"def _describe_input_argument(self, argument, **options):\n default = argument.get_default()\n if defaul... | [
"0.64484894",
"0.64484894",
"0.5869311",
"0.5820671",
"0.5737298",
"0.5725624",
"0.57092786",
"0.56956017",
"0.569341",
"0.5663559",
"0.5578332",
"0.5526767",
"0.54862744",
"0.54690254",
"0.5443656",
"0.5431728",
"0.5431728",
"0.5431728",
"0.5431728",
"0.5431728",
"0.54199153... | 0.7317485 | 0 |
Describes an InputDefinition instance. | def _describe_input_definition(self, definition, **options):
definition_options = definition.get_options()
definition_arguments = definition.get_arguments()
total_width = self._calculate_total_width_for_options(definition_options)
for argument in definition_arguments:
total_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def definition(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"definition\")",
"def validate_input(self, definition):\n \"\"\"Implement your own validation logic to validate the input stanza configurations\"\"\"\n # This example accesses the modular input variable\n opt_labels... | [
"0.66014844",
"0.6400844",
"0.59794855",
"0.59771925",
"0.5836755",
"0.5828988",
"0.5828988",
"0.5828988",
"0.5828988",
"0.5828988",
"0.5823333",
"0.5816482",
"0.5776391",
"0.5660998",
"0.5528685",
"0.55202717",
"0.550304",
"0.5479787",
"0.5437394",
"0.54349285",
"0.53951913"... | 0.73851436 | 0 |
The features of the dataset. | def features(self) -> Union[np.ndarray, Dict[str, np.ndarray]]:
return self._features | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def features(self):\n return self._features",
"def features(self):\n\n return self._features",
"def features(self) -> List[np.ndarray]:\n return None",
"def get_features(self):\n return self._features",
"def get_features(self):\n return []",
"def features(self):\n ... | [
"0.8264497",
"0.8168662",
"0.8047238",
"0.8015781",
"0.7947788",
"0.7881909",
"0.7780807",
"0.776702",
"0.7729387",
"0.76793516",
"0.7368265",
"0.72611797",
"0.72479254",
"0.72422135",
"0.7058605",
"0.7047382",
"0.704296",
"0.7031613",
"0.70226854",
"0.6993405",
"0.6980397",
... | 0.7495839 | 10 |
Converts the dataset to a collection of pyfunc inputs and outputs for model evaluation. Required for use with mlflow.evaluate(). | def to_pyfunc(self) -> PyFuncInputsOutputs:
return PyFuncInputsOutputs(self._features, self._targets) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input_fn():\n features = {\n feature_name: tf.constant(features_np_list[i])\n for i, feature_name in enumerate(feature_names)\n }\n return tf.data.Dataset.zip((tf.data.Dataset.from_tensors(features),\n tf.data.Dataset.from_tensors(la... | [
"0.61746734",
"0.61374897",
"0.6083815",
"0.6053833",
"0.6007179",
"0.59673",
"0.5955934",
"0.59508663",
"0.5942239",
"0.5942239",
"0.5942239",
"0.59358454",
"0.5880781",
"0.58665",
"0.5807461",
"0.5754803",
"0.57299024",
"0.56901157",
"0.5661878",
"0.56292754",
"0.56081635",... | 0.6980432 | 0 |
Return of seconds spent generating rolls. Raises an error if accessed before roll generation is complete. | def elapsed(self):
if self.begin and self.end:
return (self.end - self.begin).total_seconds()
else:
raise ValueError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def secondsPassed(self)->int:\n return 0 if not self.used else int((datetime.utcnow() - self.firstAccessDate).total_seconds())",
"def roll(self):\n self.rolled = random.randint(1, 6)\n return self.rolled",
"def total_seconds(self):\n return 0",
"def getTimeLeftSec(self):\n ... | [
"0.6694343",
"0.65143144",
"0.63828814",
"0.63389534",
"0.6273794",
"0.6261561",
"0.6261561",
"0.6220488",
"0.6193792",
"0.61919886",
"0.6165759",
"0.6155328",
"0.61336946",
"0.6124221",
"0.61203986",
"0.6071687",
"0.6050412",
"0.6040727",
"0.60181576",
"0.5986745",
"0.595114... | 0.5520723 | 66 |
This function cleans the user description, removing all but alphabetical characters, and casting everything to lowercase. | def clean_user_desc(self):
desc = self.data['user']['description']
if desc is not None:
desc = ' '.join(re.sub("(RT : )|(@[\S]+)|(&\S+)|(http\S+)", " ", desc).split())
desc = " ".join(re.sub("(#\S+)", ' ', desc).split())
desc = ''.join(list(filter(lambda x: x.isalpha(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_data(s):\n s = s.strip()\n s = s.lower()\n return s",
"def clean_title(self):\n # split into tokens by white space\n tokens = self.title.split(\" \")\n # remove punctuation from each token\n table = str.maketrans('', '', punctuation)\n tokens = [w.translate(t... | [
"0.6863414",
"0.6794864",
"0.67131686",
"0.6657555",
"0.66470045",
"0.6622348",
"0.6603716",
"0.65749097",
"0.6541394",
"0.6529431",
"0.65282935",
"0.64713013",
"0.64514095",
"0.6423274",
"0.64184916",
"0.64184916",
"0.64184916",
"0.64184916",
"0.64184916",
"0.64184916",
"0.6... | 0.7214416 | 0 |
Test editing section of firearms question failure by providing an expiry date not in the future. | def test_edit_category_two_section_question_and_invalid_expiry_date_failure(self):
good = self.create_good(
"a good", self.organisation, item_category=ItemCategory.GROUP2_FIREARMS, create_firearm_details=True
)
url = reverse("goods:good_details", kwargs={"pk": str(good.id)})
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_stock_with_expiry(self):\n\n # First, ensure that the expiry date feature is enabled!\n InvenTreeSetting.set_setting('STOCK_ENABLE_EXPIRY', True, self.user)\n\n url = reverse('stock-item-create')\n\n response = self.client.get(url, {'part': 25}, HTTP_X_REQUESTED_WITH='XM... | [
"0.6860377",
"0.6752006",
"0.6708926",
"0.6609202",
"0.65771455",
"0.653889",
"0.6531817",
"0.6504963",
"0.6498255",
"0.6476075",
"0.636503",
"0.63563675",
"0.63105726",
"0.6238271",
"0.62278044",
"0.62008595",
"0.6172056",
"0.6167649",
"0.61553735",
"0.6135939",
"0.6128295",... | 0.67505896 | 2 |
Validates url for correctness using regex | def is_valid_url(url: str) -> bool:
if not url:
return False
regex = ("((http|https)://)(www.)?" +
"[a-zA-Z0-9@:%._\\+~#?&//=]" +
"{2,256}\\.[a-z]" +
"{2,6}\\b([-a-zA-Z0-9@:%" +
"._\\+~#?&//=]*)")
p = re.compile(regex)
return True if re.search... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validaURL(url: AnyStr) -> bool:\n\n return re.compile(patternURL).search(url) != None # Linea 1",
"def validateURL(url):\n pattern = re.compile(\"^https*:\\/\\/\\w+(\\.\\w+){2}[\\/A-Za-z\\d\\?\\=]*$\")\n match = pattern.match(url)\n\n return True if match else False",
"def IsValidURL(s):\n ret... | [
"0.842197",
"0.82203555",
"0.8160331",
"0.8131571",
"0.80509156",
"0.80161273",
"0.7973505",
"0.7785172",
"0.77653235",
"0.7728433",
"0.77222437",
"0.7691576",
"0.7679181",
"0.7653613",
"0.7619671",
"0.76175654",
"0.76095974",
"0.7600288",
"0.75867254",
"0.7566172",
"0.751960... | 0.7764227 | 9 |
This method returns true if the heap is empty | def empty(self):
if len(self.store) == 0:
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return self.heap_size <= 0",
"def is_empty(self) -> bool:\n return self.heap.length() == 0",
"def is_empty(self) -> bool:\n return self.heap.length() == 0",
"def is_empty(self):\n return len(self.__heap) == 0",
"def empty(heap):\n return size(heap) == 0"... | [
"0.8834946",
"0.8831924",
"0.8831924",
"0.8813047",
"0.8778203",
"0.86477107",
"0.8603258",
"0.8556092",
"0.83129936",
"0.75782984",
"0.7503838",
"0.74549085",
"0.74531853",
"0.7437399",
"0.7435095",
"0.7386161",
"0.7384469",
"0.73776305",
"0.73524195",
"0.7337468",
"0.733605... | 0.0 | -1 |
This helper method takes an index and moves the corresponding element up the heap, if it is less than it's parent node until the Heap property is reestablished. This could be very helpful for the add method. | def heap_up(self, index):
# how can we do this recursively?
parent_node_index = (index - 1)//2
while self.store[index].key < self.store[parent_node_index].key and index > 0:
self.swap(index, parent_node_index)
index = parent_node_index
parent_node_index = (ind... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shift_item_up(self, index):\n while index > 0:\n parent_index = index // 2\n if parent_index > 0 and self.heaplist[parent_index] < self.heaplist[index]:\n self.heaplist[parent_index], self.heaplist[index] = self.heaplist[index], self.heaplist[parent_index]\n ... | [
"0.8414655",
"0.8388845",
"0.8373547",
"0.8233108",
"0.7830247",
"0.76928973",
"0.768859",
"0.76337385",
"0.76337385",
"0.7574433",
"0.75519353",
"0.7497384",
"0.7444691",
"0.7410258",
"0.73945534",
"0.7364185",
"0.73500985",
"0.7307942",
"0.7174093",
"0.7159081",
"0.713784",... | 0.81291056 | 4 |
This helper method takes an index and moves the corresponding element down the heap if it's larger than either of its children and continues until the heap property is reestablished. | def heap_down(self, index):
left_child = (2*index) + 1
right_child = (2*index) + 2
if left_child < len(self.store):
if right_child >= len(self.store):
min_child = left_child
elif self.store[left_child].key < self.store[right_child].key:
m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shift_item_up(self, index):\n while index > 0:\n parent_index = index // 2\n if parent_index > 0 and self.heaplist[parent_index] < self.heaplist[index]:\n self.heaplist[parent_index], self.heaplist[index] = self.heaplist[index], self.heaplist[parent_index]\n ... | [
"0.78819776",
"0.78374714",
"0.775684",
"0.7716298",
"0.76782036",
"0.76622623",
"0.7653643",
"0.7625856",
"0.76255757",
"0.75629497",
"0.7516674",
"0.74774665",
"0.74676585",
"0.74305683",
"0.7408693",
"0.7344564",
"0.7340051",
"0.72780806",
"0.7258266",
"0.7112251",
"0.7103... | 0.7925526 | 0 |
Swaps two elements in self.store at index_1 and index_2 used for heap_up & heap_down | def swap(self, index_1, index_2):
temp = self.store[index_1]
self.store[index_1] = self.store[index_2]
self.store[index_2] = temp | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __swap(self, index1, index2):\n self.heap[index1], self.heap[index2] = self.heap[index2], self.heap[index1]",
"def swap_values(self, index1, index2):\n self.heap[index1], self.heap[index2] = self.heap[index2], self.heap[index1]",
"def _swap(self, i, j):\n tmp = self._heap[i]\n s... | [
"0.8012094",
"0.7985881",
"0.7506282",
"0.7362025",
"0.73105276",
"0.7171906",
"0.702643",
"0.69282603",
"0.6924733",
"0.6838948",
"0.68340915",
"0.67832184",
"0.67832184",
"0.67156845",
"0.6685417",
"0.664469",
"0.66366124",
"0.66053545",
"0.6600271",
"0.65554285",
"0.648878... | 0.7699302 | 2 |
Quotes a string in such a way that it is usable inside XPath expressions. | def quote(s):
return unescape(quoteattr(s)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quot(string):\r\n return string.replace('\"', \"'\")",
"def _quote(self, arg):\n arg = arg.replace('\\\\', '\\\\\\\\')\n arg = arg.replace('\"', '\\\\\"')\n return '\"%s\"' % arg",
"def esc_quotes(strng):\n\n return strng.replace('\"','\\\\\"').replace(\"'\",\"\\\\'\")",
... | [
"0.78552115",
"0.7686785",
"0.7469685",
"0.73990375",
"0.7382401",
"0.7328361",
"0.73023176",
"0.72553223",
"0.7226501",
"0.7220017",
"0.7155501",
"0.7149063",
"0.71264",
"0.71164215",
"0.7075476",
"0.7074296",
"0.6980368",
"0.69722193",
"0.6961191",
"0.6933679",
"0.69206977"... | 0.74542576 | 3 |
Filter an image using the selected kernel or a userprovided kernel | def filter(image: np.array,
method: str=None,
krnsize: int=11,
krnsigma: int=2,
krn: np.array=None):
if method is None and krn is not None:
return _filter_custom(image, krn)
if method == 'gaussx':
return _filter_gauss(image, 'x', krnsize, krnsigma)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def custom_filter(image: Image) -> Image:\n image = image.filter(ImageFilter.Kernel(\n size=(3, 3), kernel=(1, 0, 1, 0, 0, 0, 1, 0, 1)))\n return image",
"def filter2D(img, kernel = (5,5)):\n\ttmp = img.copy()\n\tk = np.ones((kernel[0], kernel[1]), np.float32) / (kernel[0]*kernel[1])\n\tdst = cv2.fi... | [
"0.7493466",
"0.7478836",
"0.7471942",
"0.7423842",
"0.73553777",
"0.71614385",
"0.6959463",
"0.686667",
"0.6834054",
"0.679263",
"0.6740113",
"0.6709373",
"0.66557944",
"0.65660936",
"0.6560162",
"0.648718",
"0.6455824",
"0.64544344",
"0.640167",
"0.6361154",
"0.6350759",
... | 0.5613917 | 87 |
The Sobel kernel filtering | def _filter_sobel(image: np.array,
axis: str,
krnsize: int):
assert(axis == 'x' or axis == 'y')
if axis == 'x':
return cv.Sobel(image.astype(np.float32), cv.CV_32F, 1, 0,
ksize=krnsize)
elif axis == 'y':
return cv.Sobel(image.astype... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_sobel(data_):\n return sobel(data_)",
"def sobelY(img):\r\n f = np.array([-1, -2, -1, 0, 0, 0, 1, 2, 1]).reshape([3, 3])\r\n return cv2.filter2D(img, cv2.CV_64F, f)",
"def cs4243_filter(image, kernel):\n Hi, Wi = image.shape\n Hk, Wk = kernel.shape\n filtered_image = np.zeros((Hi, W... | [
"0.6999492",
"0.6999435",
"0.68672156",
"0.6853495",
"0.67074746",
"0.6643939",
"0.66372776",
"0.6594696",
"0.6591498",
"0.6581288",
"0.65644866",
"0.6524512",
"0.64775646",
"0.64520884",
"0.6385282",
"0.6367613",
"0.63625956",
"0.63233334",
"0.6306801",
"0.62970424",
"0.6282... | 0.6800923 | 4 |
Return a friendly HTTP greeting. | def hello():
return 'Hello World!' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_greeting(name):\n\n greeting = (f\"Hello, {name.title()}. It's nice to meet you!\")\n return greeting",
"def welcome():\n return 'Welcome to Flask!'",
"def greeting_message(name):\n print('My name is ' + name)",
"def Welcome():\n return (\n f\"Welcome to the Surf's Up API!\... | [
"0.67860854",
"0.6719625",
"0.67095745",
"0.6680697",
"0.6663219",
"0.6638394",
"0.6633062",
"0.6628187",
"0.6556032",
"0.6536937",
"0.64776874",
"0.6477268",
"0.64715713",
"0.64644194",
"0.6443056",
"0.6435385",
"0.6400719",
"0.6400167",
"0.637615",
"0.637615",
"0.6367243",
... | 0.0 | -1 |
Warmup step learning rate. | def warmup_step_lr(lr, lr_epochs, steps_per_epoch, warmup_epochs, max_epoch, gamma=0.1):
base_lr = lr
warmup_init_lr = 0
total_steps = int(max_epoch * steps_per_epoch)
warmup_steps = int(warmup_epochs * steps_per_epoch)
if lr_epochs[-1] != max_epoch:
lr_epochs = lr_epochs[:-1]
lr_epo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rate(self, step=None):\n if step is None:\n step = self._step\n learning_rate = (\n self.factor *\n self.model_size ** (-0.5) *\n min(step ** (-0.5), step * self.warmup ** (-1.5))\n )\n return learning_rate",
"def warmup_step(ckpt_step: int) -> float:\n retu... | [
"0.76330644",
"0.7345791",
"0.72041625",
"0.69826674",
"0.696698",
"0.69266504",
"0.6911939",
"0.68691677",
"0.6822029",
"0.6817778",
"0.67954785",
"0.6794942",
"0.67852956",
"0.6778299",
"0.6737836",
"0.67233735",
"0.6693815",
"0.669045",
"0.6680223",
"0.6647177",
"0.6619356... | 0.0 | -1 |
Show an index page. | def index_page():
return render_template("index.html") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_index_page():\n\n return render_template('index.html')",
"def index():\n return render_template(\"index.html\",\n title='Index')",
"def index():\n return render_template('pages/index.html', isNav=True)",
"def index():\n return render_template('index.html')",... | [
"0.8531908",
"0.80338854",
"0.7943412",
"0.77842605",
"0.77842605",
"0.7766452",
"0.7744886",
"0.76850814",
"0.76816297",
"0.7678797",
"0.7672546",
"0.7672546",
"0.7667954",
"0.7667954",
"0.7667954",
"0.7657335",
"0.7628134",
"0.76141024",
"0.76105523",
"0.75957036",
"0.75957... | 0.76573086 | 16 |
Load an image from file into a numpy array. Puts image into numpy array to feed into tensorflow graph. Note that by convention we put it into a numpy array with shape (height, width, channels), where channels=3 for RGB. | def load_image_into_numpy_array(img):
img_data = tf.io.gfile.GFile(img, 'rb').read()
image = Image.open(BytesIO(img_data)).resize(INPUT_SIZE)
(im_width, im_height) = image.size
arr = np.array(image.getdata()).reshape(
(im_height, im_width, 3)).astype(np.uint8)
return arr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_image_into_numpy_array(path):\n img_data = tf.io.gfile.GFile(path, 'rb').read()\n image = Image.open(BytesIO(img_data))\n (im_width, im_height) = image.size\n return np.array(image.getdata()).reshape(\n (im_height, im_width, 3)).astype(np.uint8)",
"def load_image_into_numpy_array(path... | [
"0.7865995",
"0.77741086",
"0.77741086",
"0.7717213",
"0.77153385",
"0.77037317",
"0.7700105",
"0.7622205",
"0.74999326",
"0.74515367",
"0.7429376",
"0.74002403",
"0.7347807",
"0.73116565",
"0.7294435",
"0.7272696",
"0.72398543",
"0.72197",
"0.7202012",
"0.7185439",
"0.718168... | 0.76124656 | 8 |
Get a tf.function for detection. | def get_model_detection_function(model):
@tf.function
def detect_fn(image):
"""Detect objects in image."""
image, shapes = model.preprocess(image)
prediction_dict = model.predict(image, shapes)
detections = model.postprocess(prediction_dict, shapes)
return detections, prediction_dict, tf.resh... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_model_detection_function(model):\n\n @tf.function\n def detect_fn(image):\n \"\"\"Detect objects in image.\"\"\"\n\n image, shapes = model.preprocess(image)\n prediction_dict = model.predict(image, shapes)\n detections = model.postprocess(prediction_dict, shapes)\n\n ... | [
"0.71129197",
"0.7112774",
"0.71027005",
"0.6684678",
"0.65463984",
"0.65268725",
"0.6505286",
"0.63129324",
"0.61612254",
"0.6149816",
"0.6118471",
"0.60945255",
"0.6056584",
"0.6024163",
"0.5923366",
"0.5874666",
"0.57565945",
"0.57503176",
"0.5718735",
"0.5704753",
"0.5693... | 0.7107963 | 2 |
Calculates the cartesian 3d vector of velocity from the momentum and mass of the particle. | def calcVelocityFromMomentum(self):
if self.mass is None:
raise CoordinateVector("The particle mass needs to be specified to calculate the particle velocity from momentum.")
values = {}
for direction in self.p.order:
gamma = self.calcLorentzGammaFromMomentum(direction)
values[direction] = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calcMomentumFromVelocity(self):\n if self.mass is None:\n raise CoordinateVector(\"The particle mass needs to be specified to calculate the particle momentum from velocity.\")\n values = {}\n for direction in self.v.order:\n gamma = self.calcLorentzGammaFromVelocity(direction)\n values[... | [
"0.765322",
"0.6983609",
"0.6934949",
"0.6848278",
"0.68200105",
"0.6760848",
"0.6575514",
"0.65244144",
"0.6488385",
"0.6468821",
"0.64489025",
"0.64413357",
"0.6396954",
"0.63301325",
"0.6261955",
"0.62590843",
"0.6190308",
"0.6189779",
"0.6171905",
"0.6155788",
"0.6147371"... | 0.8236748 | 0 |
Advances the particle's momentum over the provided time. | def advanceVelocity(self,time,acceleration):
if not isinstance(acceleration,Cartesian3DVector):
raise CoordinateException("Advancing particle momentum with the incorrect acceleration type.")
return self.v + time*acceleration | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def advancePosition(self,time):\n velocity = self.getVelocity()\n return self.x + time*velocity",
"def update(self, delta_time):\n self.total_time += delta_time",
"def advance(self, dt):\n self.workTill(self.currentTime + dt)",
"def advance(self, delta_t: float) -> None:\n pass",
... | [
"0.6614696",
"0.6302206",
"0.6300793",
"0.61861223",
"0.61745685",
"0.59607273",
"0.5883146",
"0.5883146",
"0.5878725",
"0.58402485",
"0.5823741",
"0.5773462",
"0.573509",
"0.572411",
"0.57118416",
"0.5706244",
"0.5687493",
"0.56628245",
"0.56571454",
"0.56478083",
"0.559684"... | 0.70574886 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.