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 True if we have initial data. | def has_changed(self):
has_changed = forms.ModelForm.has_changed(self)
return bool(self.initial or has_changed) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_data(self):\n return len(self.data) > 0",
"def has_data(self) -> bool:\n return bool(self.data)",
"def has_data(self):\n return self._data is not None",
"def has_data(self):\n\n return self._data is not None",
"def has_data(self):\n\n return self._data is not None... | [
"0.7813909",
"0.76047194",
"0.75483805",
"0.75055367",
"0.75055367",
"0.74933934",
"0.74187225",
"0.74176073",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.73431593",
"0.73294735",
"0.7313465",
"0.7310018",
"0.72718793",
"0.726... | 0.0 | -1 |
Returns True if we have initial data. | def has_changed(self):
has_changed = forms.ModelForm.has_changed(self)
return bool(self.initial or has_changed) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_data(self):\n return len(self.data) > 0",
"def has_data(self) -> bool:\n return bool(self.data)",
"def has_data(self):\n return self._data is not None",
"def has_data(self):\n\n return self._data is not None",
"def has_data(self):\n\n return self._data is not None... | [
"0.7813909",
"0.76047194",
"0.75483805",
"0.75055367",
"0.75055367",
"0.74933934",
"0.74187225",
"0.74176073",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.73431593",
"0.73294735",
"0.7313465",
"0.7310018",
"0.72718793",
"0.726... | 0.0 | -1 |
Returns True if we have initial data. | def has_changed(self):
has_changed = forms.ModelForm.has_changed(self)
return bool(self.initial or has_changed) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_data(self):\n return len(self.data) > 0",
"def has_data(self) -> bool:\n return bool(self.data)",
"def has_data(self):\n return self._data is not None",
"def has_data(self):\n\n return self._data is not None",
"def has_data(self):\n\n return self._data is not None... | [
"0.7813909",
"0.76047194",
"0.75483805",
"0.75055367",
"0.75055367",
"0.74933934",
"0.74187225",
"0.74176073",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.7343985",
"0.73431593",
"0.73294735",
"0.7313465",
"0.7310018",
"0.72718793",
"0.726... | 0.0 | -1 |
Test __iadd__ operation of OffloadArray with array operand. | def test_op_iadd_array_int(self):
device = pymic.devices[0]
stream = device.get_default_stream()
a = numpy.arange(1, 4711 * 1024, dtype=int)
o = a + 1
old_a = numpy.empty_like(a)
old_o = numpy.empty_like(o)
old_a[:] = a[:]
old_o[:] = o[:]
expect ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_op_iadd_offload_array_int(self):\n\n device = pymic.devices[0]\n stream = device.get_default_stream()\n a = numpy.arange(1, 4711 * 1024, dtype=int)\n o = a + 1\n\n old_a = numpy.empty_like(a)\n old_o = numpy.empty_like(o)\n old_a[:] = a[:]\n old_o[:]... | [
"0.80069935",
"0.76581126",
"0.7465149",
"0.7357593",
"0.72299457",
"0.7210197",
"0.6862638",
"0.6849571",
"0.6842844",
"0.68405235",
"0.6819778",
"0.6714261",
"0.6540254",
"0.65005344",
"0.64399177",
"0.64169675",
"0.6405334",
"0.6364464",
"0.63229233",
"0.62895286",
"0.6236... | 0.77765125 | 1 |
Test __iadd__ operation of OffloadArray with array operand. | def test_op_iadd_array_float(self):
device = pymic.devices[0]
stream = device.get_default_stream()
a = numpy.arange(1, 4711 * 1024, dtype=float)
o = a + 1.3
old_a = numpy.empty_like(a)
old_o = numpy.empty_like(o)
old_a[:] = a[:]
old_o[:] = o[:]
e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_op_iadd_offload_array_int(self):\n\n device = pymic.devices[0]\n stream = device.get_default_stream()\n a = numpy.arange(1, 4711 * 1024, dtype=int)\n o = a + 1\n\n old_a = numpy.empty_like(a)\n old_o = numpy.empty_like(o)\n old_a[:] = a[:]\n old_o[:]... | [
"0.80069935",
"0.77765125",
"0.76581126",
"0.7465149",
"0.7357593",
"0.7210197",
"0.6862638",
"0.6849571",
"0.6842844",
"0.68405235",
"0.6819778",
"0.6714261",
"0.6540254",
"0.65005344",
"0.64399177",
"0.64169675",
"0.6405334",
"0.6364464",
"0.63229233",
"0.62895286",
"0.6236... | 0.72299457 | 5 |
Test __iadd__ operation of OffloadArray with array operand. | def test_op_iadd_array_complex(self):
device = pymic.devices[0]
stream = device.get_default_stream()
a = numpy.arange(1, 4711 * 1024, dtype=complex)
o = a + complex(1.2, -1.3)
old_a = numpy.empty_like(a)
old_o = numpy.empty_like(o)
old_a[:] = a[:]
old_o[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_op_iadd_offload_array_int(self):\n\n device = pymic.devices[0]\n stream = device.get_default_stream()\n a = numpy.arange(1, 4711 * 1024, dtype=int)\n o = a + 1\n\n old_a = numpy.empty_like(a)\n old_o = numpy.empty_like(o)\n old_a[:] = a[:]\n old_o[:]... | [
"0.80069935",
"0.77765125",
"0.76581126",
"0.7465149",
"0.7357593",
"0.72299457",
"0.7210197",
"0.6862638",
"0.6849571",
"0.6842844",
"0.68405235",
"0.6819778",
"0.6714261",
"0.6540254",
"0.65005344",
"0.64399177",
"0.64169675",
"0.6364464",
"0.63229233",
"0.62895286",
"0.623... | 0.6405334 | 17 |
Test zero operation of OffloadArray with integer data. | def test_op_zero_int(self):
device = pymic.devices[0]
stream = device.get_default_stream()
a = numpy.arange(1, 4711 * 1024, dtype=int)
offl_a = stream.bind(a)
offl_a.zero()
offl_a.update_host()
stream.sync()
self.assertEqual(sum(a), 0,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_op_zero_float(self):\n\n device = pymic.devices[0]\n stream = device.get_default_stream()\n a = numpy.arange(1.0, 4711.0 * 1024, dtype=float)\n offl_a = stream.bind(a)\n offl_a.zero()\n offl_a.update_host()\n stream.sync()\n self.assertEqual(sum(a), ... | [
"0.6675806",
"0.6453604",
"0.6162198",
"0.61589617",
"0.60987455",
"0.60506386",
"0.60419023",
"0.6020307",
"0.6018948",
"0.59781927",
"0.59588003",
"0.5956332",
"0.5950944",
"0.5944043",
"0.59398335",
"0.59352005",
"0.59215236",
"0.5912178",
"0.58942133",
"0.58687705",
"0.58... | 0.7754547 | 0 |
Test zero operation of OffloadArray with complex data. | def test_op_zero_complex(self):
device = pymic.devices[0]
stream = device.get_default_stream()
a = numpy.arange(1.0, 4711.0 * 1024, dtype=complex)
offl_a = stream.bind(a)
offl_a.zero()
offl_a.update_host()
stream.sync()
self.assertEqual(sum(a), 0.0 + 0.0j... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_op_zero_float(self):\n\n device = pymic.devices[0]\n stream = device.get_default_stream()\n a = numpy.arange(1.0, 4711.0 * 1024, dtype=float)\n offl_a = stream.bind(a)\n offl_a.zero()\n offl_a.update_host()\n stream.sync()\n self.assertEqual(sum(a), ... | [
"0.6860906",
"0.6774098",
"0.6705572",
"0.66279066",
"0.6518342",
"0.6514786",
"0.6455679",
"0.63385254",
"0.6316621",
"0.6284464",
"0.62823874",
"0.6246639",
"0.62156945",
"0.6207486",
"0.61884123",
"0.6155841",
"0.6133402",
"0.6095903",
"0.6061063",
"0.6060156",
"0.60380113... | 0.81045526 | 0 |
Test fill operation of OffloadArray with complex data. | def test_op_fill_complex(self):
device = pymic.devices[0]
stream = device.get_default_stream()
value = complex(7342.0, -2137.0)
a = numpy.arange(1.0, 4711.0 * 1024, dtype=complex)
expect = numpy.empty_like(a)
expect[:] = value
offl_a = stream.bind(a)
offl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_op_fill_float(self):\n\n device = pymic.devices[0]\n stream = device.get_default_stream()\n value = 7342.2137\n a = numpy.arange(1.0, 4711.0 * 1024, dtype=float)\n expect = numpy.empty_like(a)\n expect[:] = value\n offl_a = stream.bind(a)\n offl_a.fi... | [
"0.65252644",
"0.63076735",
"0.62712646",
"0.60795486",
"0.60613483",
"0.60235363",
"0.5988645",
"0.59886265",
"0.59714526",
"0.5969847",
"0.59319514",
"0.59007895",
"0.58798224",
"0.5839223",
"0.57573146",
"0.57258505",
"0.57226324",
"0.57059634",
"0.5674284",
"0.567394",
"0... | 0.7363297 | 0 |
To be used in an `apply` pandas func to shuffle columns around a datafame Import only | def shuffle_columns(gene):
import numpy as np
return np.random.permutation(gene.tolist()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choose_random_columns(columns: List[str]) -> List[str]:\n\n temp = copy.deepcopy(columns)\n random.shuffle(temp)\n return temp[0:random.randint(1, len(temp))]",
"def randomize(df):\n df=df.iloc[np.random.permutation(df.index)].reset_index(drop=True)\n return df",
"def shuffle_field(dframe, f... | [
"0.6655048",
"0.6574868",
"0.6302455",
"0.61218965",
"0.6036648",
"0.5718251",
"0.57010967",
"0.56804",
"0.56418425",
"0.56118625",
"0.5545083",
"0.55221397",
"0.55123526",
"0.55050105",
"0.54981023",
"0.5456648",
"0.5455022",
"0.54535615",
"0.5439009",
"0.53788537",
"0.53643... | 0.683826 | 0 |
Convert index to hour. | def convert_index_to_hour(index, time_span, remainder):
# This needs -1 because the end hour is inclusive. For example, if the period
# represents [2, 26), the end hour is 25.
#
# Index is added 1 because, in our SQL, we subtract the remainder, divide,
# and floor. So, in order to get the original hour, we ne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hour(self) -> Index:\n warnings.warn(\n \"`hour` will return int32 index instead of int 64 index in 4.0.0.\",\n FutureWarning,\n )\n return Index(self.to_series().dt.hour)",
"def get_hour(time_index):\n return np.array(time_index.hour).reshape(-1,1)",
"def dayH... | [
"0.7478962",
"0.7451854",
"0.61648214",
"0.61319596",
"0.60821366",
"0.5939503",
"0.57647264",
"0.5666339",
"0.5666339",
"0.5660181",
"0.5589689",
"0.55811244",
"0.5578381",
"0.5538815",
"0.5527387",
"0.54767084",
"0.5391979",
"0.53694856",
"0.5360243",
"0.53277993",
"0.53209... | 0.79338133 | 0 |
Get the last hour that can be selected by the datetime picker. | def get_max_hour():
hour = get_last_successful_hour()
# `hour` is None when we haven't run build_crash_stats at all.
# Therefore, there's no crash stats data.
#
# On the UI, the date-time picker choose a point of time. Therefore,
# if we choose, say, 3pm, this means we want the crash stats until 2:59pm.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_last_successful_hour():\n return _get_first_or_last_successful_hour(is_last=True)",
"def hour(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"hour\")",
"def hour(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"hour\")",
"def hour(self) -> Optional[pu... | [
"0.72376955",
"0.69011843",
"0.69011843",
"0.69011843",
"0.6789998",
"0.6789998",
"0.67081624",
"0.6698631",
"0.6573679",
"0.6568068",
"0.6530942",
"0.648888",
"0.648888",
"0.62680656",
"0.6131896",
"0.609238",
"0.6056501",
"0.6050994",
"0.60298216",
"0.60247093",
"0.59974027... | 0.6224502 | 14 |
takes 1D input sequences returns X_embed `(time,batch,edim)`[torch] Y_embed `(time,batch)`[torch] | def embed_seq(self,X_seq,Y_seq):
X_embed = -tr.ones(len(X_seq),self.og_signal_dim+self.og_noise_dim)
# find trials of corresponding types
pm_trials_bool = X_seq >= self.ntokens_og
pm_trials = np.where(pm_trials_bool)
og_trials = np.where(np.logical_not(pm_trials_bool))
# take signal_dim (time,ed... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, mel, mel_len, duration, src_len):\n batch = []\n for m, m_l, d, s_l in zip(mel, mel_len, duration, src_len):\n b = []\n for m_p in torch.split(m[:m_l], list(d[:s_l].int()), dim=0):\n b.append(self.get_prosody_embedding(m_p.unsqueeze(0)).squeeze(0... | [
"0.6151226",
"0.61303383",
"0.6127643",
"0.6121227",
"0.61015415",
"0.6061882",
"0.60433084",
"0.5979971",
"0.5960586",
"0.59463465",
"0.5941641",
"0.5930654",
"0.5919199",
"0.58753616",
"0.5874207",
"0.5844348",
"0.584287",
"0.5822249",
"0.5808976",
"0.57956576",
"0.5787509"... | 0.7688334 | 0 |
Get the status string of the database. The return value is the status message of the database.The message format is a dictionary. | def get_stats(self):
return dict(l.split('\t', 1) \
for l in wait(self.proto.stat()).splitlines() if l) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status(self):\n return self.rpc.call(MsfRpcMethod.DbStatus)",
"def status(self):\n return self._dbattr('status')",
"def status_message(self) -> str:\n return pulumi.get(self, \"status_message\")",
"def _get_status(self):\n held_msg=\"\"\n return u'%s%s' % (self.get_stat... | [
"0.71828115",
"0.70393693",
"0.686012",
"0.68197674",
"0.68121153",
"0.67865413",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",
"0.6767079",... | 0.0 | -1 |
Converts string date to date date | def str_to_date(date_str):
if date_str == 'today':
date = datetime.date.today()
else:
date = datetime.datetime.strptime(date_str, "%Y-%m-%d").date()
return date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _str_to_date(self, date):\n return datetools.date_parser(date)",
"def string_to_date(string):\n params = string.strip().split('-')\n year = int(params[0])\n month = int(params[1])\n day = int(params[2])\n d = date(year, month, day)\n return d",
"def string_t... | [
"0.8309989",
"0.8179387",
"0.8145851",
"0.8127108",
"0.80452627",
"0.7936607",
"0.7907635",
"0.7891534",
"0.7872163",
"0.7861885",
"0.7847876",
"0.7841631",
"0.7758958",
"0.7694821",
"0.76506823",
"0.7617419",
"0.76095253",
"0.75645137",
"0.75213873",
"0.74882734",
"0.7483122... | 0.79787743 | 5 |
Constructor, calls the superclass BaseDataType | def __init__(self, value: Optional[str] = None, **kwargs: Any):
super().__init__(**kwargs)
self.set_value(value=value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, data_type=None):\n self.type = data_type",
"def __init__(self, parent, type_id):\n super(RecordTypeData, self).__init__(parent, type_id)\n return",
"def __init__(self):\n dict.__init__(self)\n self.datatype = None",
"def __init_subclass__(cls) -> None:\n ... | [
"0.75387365",
"0.71804094",
"0.7141472",
"0.7045807",
"0.69973093",
"0.68914104",
"0.68599564",
"0.67827946",
"0.6759935",
"0.67399687",
"0.6719352",
"0.6719352",
"0.6719352",
"0.6719352",
"0.67105407",
"0.6678145",
"0.6629711",
"0.66269034",
"0.6620092",
"0.66123736",
"0.660... | 0.0 | -1 |
Plots predicted bounding boxes on the image | def plot_image(image_origin, boxes, pad_h, pad_w):
cmap = plt.get_cmap("Set1")
class_labels = config.CUSTOM_CLASSES
colors = [cmap(i) for i in np.linspace(0, 1, len(class_labels))]
origin_h, origin_w, _ = image_origin.shape
# Create figure and axes
fig, ax = plt.subplots(1)
# Display t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_pred_gt_boxes(image_outname, img, boxes, labels, scores, image_name=None, figsize=(15,15)):\n fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, figsize=figsize)\n if image_name is not None:\n fig.suptitle(image_name)\n if isinstance(img, torch.Tensor):\n img = img.numpy().squeeze().t... | [
"0.7221695",
"0.70395166",
"0.7036144",
"0.6970583",
"0.69319826",
"0.6917753",
"0.68724614",
"0.6755849",
"0.668966",
"0.66610396",
"0.66610396",
"0.6622663",
"0.65560836",
"0.6545348",
"0.6522647",
"0.6512622",
"0.6504384",
"0.65015507",
"0.6500133",
"0.6486647",
"0.6464143... | 0.64248085 | 24 |
Wrapper Function for npz_to_pd for easier usage. Returns the data from a npz file as pd.DataFrame. | def load_data(npz_name, test_print=False, **kwargs):
if test_print:
smp = npz_to_pd(npz_name, is_dir=False)
print_test_df(smp)
return smp
else:
return npz_to_pd(npz_name, is_dir=False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _pq2df(data_file):\n df = pd.read_parquet(data_file)\n return df",
"def xarray_to_df(file_path):\n df = xr.open_dataset(file_path).to_dataframe()\n df = df.reset_index()\n return df",
"def pandas_vertices_from_plyfile(filename):\n xyz = vertex_dict_from_plyfile(filename)\n retu... | [
"0.66428524",
"0.6347353",
"0.6235372",
"0.6084713",
"0.60711515",
"0.60629636",
"0.60506445",
"0.60174376",
"0.60170615",
"0.5998747",
"0.5995379",
"0.5995379",
"0.59659964",
"0.5936114",
"0.59027326",
"0.5879977",
"0.5852948",
"0.5833284",
"0.5817145",
"0.58052355",
"0.5794... | 0.6798128 | 0 |
To get the number of vertices in the graph | def get_V(self):
return self.V | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_vertices(self):\r\n return len(self.__graph_dict.keys())",
"def num_vertices(self):\n return self._top_exp.number_of_vertices()",
"def get_num_vertices(self):\n\n return self._graph_state.get_num_vertices()",
"def num_vertices(self):\n return len(self.vertices)",
"def nu... | [
"0.8748549",
"0.847775",
"0.84314346",
"0.8410034",
"0.8410034",
"0.83974767",
"0.8380043",
"0.8362905",
"0.8354664",
"0.83494455",
"0.8298607",
"0.8212692",
"0.8191882",
"0.81722146",
"0.7908373",
"0.7873626",
"0.78264993",
"0.774158",
"0.76043916",
"0.7600205",
"0.7592791",... | 0.0 | -1 |
To get the number of edges in the graph | def get_E(self):
return self.E | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_of_edge(self):\n try:\n return self.edges\n except:\n print(\"ERROR: No graph exists\")",
"def return_num_edges(self):\n return sum(map(lambda x: len(x),self.__adj))",
"def number_of_edges(self) -> int:\n return self.graph.number_of_edges()",
"def num... | [
"0.873703",
"0.8625181",
"0.8540467",
"0.85396636",
"0.8514939",
"0.84878886",
"0.84797275",
"0.84365827",
"0.84152657",
"0.8409866",
"0.8378322",
"0.8374103",
"0.8355196",
"0.8324073",
"0.83044904",
"0.8293895",
"0.82905716",
"0.82485783",
"0.81709534",
"0.81674206",
"0.8133... | 0.0 | -1 |
Sets the graph's number of edges. This methods is defined as private since we don't want the number of edges to be modified outside the graph object methods. | def __set_E(self, E):
self.E = int(E)
if self.E < 0:
self.E = 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_max_edges(self, edges):\n self.max_edges = edges",
"def number_of_edges(self) -> int:\n return self.graph.number_of_edges()",
"def set_edges(self, edges):\n if (not isinstance(edges, None.__class__) and (edges.size != 0)):\n if ((np.shape(edges)[0] != self.E) or (np.shap... | [
"0.7216815",
"0.7146103",
"0.71014524",
"0.7073468",
"0.7015687",
"0.6761763",
"0.6749867",
"0.67313945",
"0.6705572",
"0.66146827",
"0.65971845",
"0.6579008",
"0.65354365",
"0.65164113",
"0.65039414",
"0.6492799",
"0.6490674",
"0.64761287",
"0.64740014",
"0.64648354",
"0.644... | 0.0 | -1 |
returns a compact representation of self Returns | def compact_neighb(self):
order = np.argsort(self.edges[:, 0] * float(self.V) + self.edges[:, 1])
neighb = self.edges[order, 1].astype(np.int_)
weights = self.weights[order]
degree, _ = self.degrees()
idx = np.hstack((0, np.cumsum(degree))).astype(np.int_)
return idx, nei... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compact(self):\n raise NotImplementedError",
"def __str__(self):\n return self.make_flat()",
"def __str__(self):\n from nodepy.utils import array2strings\n\n c = array2strings(self.c,printzeros=True)\n A = array2strings(self.A)\n b = array2strings(self.b,printzeros... | [
"0.75781703",
"0.7018059",
"0.68677795",
"0.68628794",
"0.66041535",
"0.6595923",
"0.659476",
"0.6558225",
"0.65450567",
"0.65277493",
"0.65273356",
"0.6517363",
"0.6499718",
"0.6489912",
"0.6488973",
"0.6488973",
"0.6488973",
"0.6488973",
"0.6488973",
"0.6488973",
"0.6488973... | 0.0 | -1 |
returns the set of neighbors of self as a list of arrays | def list_of_neighbors(self):
return self.to_coo_matrix().tolil().rows.tolist() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_neighbours(self):\n return []",
"def neighbors(self):\n return self._neighbors",
"def get_neighbors(self):\n \n return [neighbor for neighbor,_ in self.neighbors.items()]",
"def get_neighbors(self):\n return self.neighbors",
"def get_neighbors(self):\n ... | [
"0.79354256",
"0.77831155",
"0.7773513",
"0.7712279",
"0.7712279",
"0.7712279",
"0.7712279",
"0.7645392",
"0.75979936",
"0.7559428",
"0.7507979",
"0.7489569",
"0.7455962",
"0.7424859",
"0.7390005",
"0.73836154",
"0.73753846",
"0.7368211",
"0.73675835",
"0.73650724",
"0.731506... | 0.79688543 | 0 |
Return area of a square | def area(self):
return self.__size ** 2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def square_area(side):\n return side**2",
"def area(width, height):\n return width * height",
"def rectangle_area(width : number, height : number) ->number:\n area = width*height\n #print(\"The area of rectangle is =\", area, \"sq. units\")\n return area",
"def findArea(self):\n\n a, b ... | [
"0.85047084",
"0.82512414",
"0.8083759",
"0.8015399",
"0.7951969",
"0.78147846",
"0.779922",
"0.7739501",
"0.7737459",
"0.7722969",
"0.7689003",
"0.7682115",
"0.76772124",
"0.7657304",
"0.7633596",
"0.7631285",
"0.76221925",
"0.7608999",
"0.7607736",
"0.76053107",
"0.75893855... | 0.73434806 | 61 |
Assert the basic aioswitcher.api.messages.SwitcherV2BaseResponseMSG. | async def assert_api_messege_base_type(
msg: Optional[SwitcherV2BaseResponseMSG],
msg_type: ResponseMessageType) -> None:
assert msg
assert isinstance(msg.unparsed_response, bytes)
assert msg.successful
assert msg.msg_type == msg_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_has_output(self):\n irc_message = 'This message goes to IRC'\n\n only_irc_response = ActionResponse(irc_message)\n self.assertFalse(only_irc_response.has_output)\n\n no_output_response = ActionResponse(irc_message, value=1.0)\n self.assertFalse(no_output_response.has_out... | [
"0.5829261",
"0.57002074",
"0.5527566",
"0.54761827",
"0.53980005",
"0.53886867",
"0.53824323",
"0.5368619",
"0.53578866",
"0.5338054",
"0.5325141",
"0.53174245",
"0.53042835",
"0.5301589",
"0.5294187",
"0.5271765",
"0.5267937",
"0.52347606",
"0.52243274",
"0.5185153",
"0.514... | 0.7192459 | 0 |
Checks whether current date is a holiday. Criteria is based on the ascii values (not english) of the headline | def is_holiday(self) -> bool:
return set(self._get_date_text_ascii()) == set([int(x) for x in self.params['holiday']['holiday_text']]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_holdiay_eve(self) -> bool:\n return set(self._get_date_text_ascii()) == set([int(x) for x in self.params['holiday']['holiday_eve_text']])",
"def is_holiday(date):\n \n return date.day in __get_holidays(date.year)[date.month]",
"def holiday(self):\n \n holidays = [] # array of holidays fo... | [
"0.762431",
"0.7321051",
"0.72864735",
"0.7100161",
"0.6931451",
"0.6928979",
"0.68762165",
"0.68468183",
"0.68450207",
"0.6753004",
"0.66600174",
"0.6372226",
"0.6293564",
"0.62460536",
"0.61794007",
"0.6176722",
"0.6162333",
"0.61567503",
"0.6031304",
"0.6028047",
"0.599075... | 0.84416264 | 0 |
Checks whether current date is a holiday eve. Criteria is based on the ascii values (not english) of the headline | def is_holdiay_eve(self) -> bool:
return set(self._get_date_text_ascii()) == set([int(x) for x in self.params['holiday']['holiday_eve_text']]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_holiday(self) -> bool:\n return set(self._get_date_text_ascii()) == set([int(x) for x in self.params['holiday']['holiday_text']])",
"def is_holiday(date):\n \n return date.day in __get_holidays(date.year)[date.month]",
"def holiday(self):\n \n holidays = [] # array of holidays for the or... | [
"0.81096554",
"0.7022505",
"0.68876207",
"0.6800841",
"0.67155474",
"0.66973895",
"0.65977615",
"0.65098405",
"0.6471388",
"0.6412864",
"0.6297277",
"0.61799383",
"0.6148777",
"0.60756534",
"0.6025431",
"0.6001269",
"0.5991369",
"0.5933612",
"0.59287226",
"0.59143496",
"0.586... | 0.8104809 | 1 |
Determine whether a given box is on a page within search bounds. | def _allowed_page(self, box):
if self._max_page:
return self._min_page <= box.page <= self._max_page
else:
return self._min_page <= box.page | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pointInBox(x, y, box):\n e = boxToExtent(box)\n return x >= e[0] and x <= e[2] and y >= e[1] and y <= e[3]",
"def is_point_in_box(x, y, bbox):\n if x < 200 and y < 200:\n return True\n return False",
"def isinsidebbox(bbox,p):\n return p[0] >= bbox[0][0] and p[0] <= bbox[1][0] and\\\n... | [
"0.7056806",
"0.70478976",
"0.6800106",
"0.67573434",
"0.6711614",
"0.66953933",
"0.66879153",
"0.6642184",
"0.6628595",
"0.65851504",
"0.6530976",
"0.6520192",
"0.63967526",
"0.63793635",
"0.6372346",
"0.6344302",
"0.6344007",
"0.63416797",
"0.63148236",
"0.6309377",
"0.6271... | 0.687852 | 2 |
Internal function to check if a func, specified as a CodeLocation exists in our known propagations | def exists(self, func_loc):
exists = False
for props in self._propagations:
if props.block_addr == func_loc.block_addr:
exists = True
return exists | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_function_code(self):\n return self.lscope is not None and self.sscope is None",
"def isValidFunction(self):\n for token in self.value:\n if token.type == 'defFunction' or token.type == 'callFunction':\n if token.value.split('(')[0] == self.name:\n ... | [
"0.6438703",
"0.64141476",
"0.60738426",
"0.60439444",
"0.5937086",
"0.5871674",
"0.5865145",
"0.5805023",
"0.57657695",
"0.5754222",
"0.57407165",
"0.5706182",
"0.5704465",
"0.5657664",
"0.5617737",
"0.56090283",
"0.55685943",
"0.5553184",
"0.5546556",
"0.5539112",
"0.553227... | 0.74438125 | 0 |
max_noutput_items(my_qpsk_demod_cb_sptr self) > int | def max_noutput_items(self):
return _TestA_swig.my_qpsk_demod_cb_sptr_max_noutput_items(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_max_noutput_items(self, *args, **kwargs):\n return _TestA_swig.my_qpsk_demod_cb_sptr_set_max_noutput_items(self, *args, **kwargs)",
"def max_noutput_items(self) -> \"int\":\n return _beamforming_swig.doaesprit_sptr_max_noutput_items(self)",
"def max_noutput_items(self) -> \"int\":\n ... | [
"0.8468043",
"0.80200493",
"0.80167806",
"0.80032414",
"0.7980286",
"0.79790896",
"0.7948264",
"0.7900677",
"0.7879976",
"0.7865784",
"0.78601414",
"0.78479123",
"0.78257",
"0.78238934",
"0.78160954",
"0.7806298",
"0.77884996",
"0.7769807",
"0.7728796",
"0.7685805",
"0.768424... | 0.88225144 | 0 |
set_max_noutput_items(my_qpsk_demod_cb_sptr self, int m) | def set_max_noutput_items(self, *args, **kwargs):
return _TestA_swig.my_qpsk_demod_cb_sptr_set_max_noutput_items(self, *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_max_noutput_items(self, m):\n return _spacegrant_swig.hdlc_framer_sptr_set_max_noutput_items(self, m)",
"def set_max_noutput_items(self, m: \"int\") -> \"void\":\n return _beamforming_swig.phasedarray_sptr_set_max_noutput_items(self, m)",
"def set_max_noutput_items(self, m: \"int\") -> \"... | [
"0.8729283",
"0.8690982",
"0.8673235",
"0.86722744",
"0.8667262",
"0.8662744",
"0.86188155",
"0.86164176",
"0.86052763",
"0.85815054",
"0.85783815",
"0.8552426",
"0.8533968",
"0.85333806",
"0.85104394",
"0.8486141",
"0.8448319",
"0.841888",
"0.8299023",
"0.8298922",
"0.816340... | 0.89730966 | 0 |
is_set_max_noutput_items(my_qpsk_demod_cb_sptr self) > bool | def is_set_max_noutput_items(self):
return _TestA_swig.my_qpsk_demod_cb_sptr_is_set_max_noutput_items(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_max_noutput_items(self, *args, **kwargs):\n return _TestA_swig.my_qpsk_demod_cb_sptr_set_max_noutput_items(self, *args, **kwargs)",
"def is_set_max_noutput_items(self) -> \"bool\":\n return _beamforming_swig.doaesprit_sptr_is_set_max_noutput_items(self)",
"def is_set_max_noutput_items(sel... | [
"0.8540965",
"0.8490947",
"0.84645706",
"0.84328115",
"0.83864415",
"0.8360439",
"0.8346538",
"0.8338798",
"0.83206916",
"0.82877773",
"0.827914",
"0.82680607",
"0.82590485",
"0.82581466",
"0.82361996",
"0.8207617",
"0.8187514",
"0.8177418",
"0.81270224",
"0.8109328",
"0.8057... | 0.90029395 | 0 |
set_min_noutput_items(my_qpsk_demod_cb_sptr self, int m) | def set_min_noutput_items(self, *args, **kwargs):
return _TestA_swig.my_qpsk_demod_cb_sptr_set_min_noutput_items(self, *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_min_noutput_items(self, m: \"int\") -> \"void\":\n return _beamforming_swig.doaesprit_sptr_set_min_noutput_items(self, m)",
"def set_min_noutput_items(self, m: \"int\") -> \"void\":\n return _beamforming_swig.randomsampler_sptr_set_min_noutput_items(self, m)",
"def set_min_noutput_items(s... | [
"0.85705954",
"0.85626805",
"0.85462564",
"0.85408133",
"0.8513019",
"0.84650296",
"0.84322",
"0.8374426",
"0.8361366",
"0.83572507",
"0.8313803",
"0.8297058",
"0.8294701",
"0.8265891",
"0.8265587",
"0.82391566",
"0.82113296",
"0.81863844",
"0.80573875",
"0.8053769",
"0.78685... | 0.8795212 | 0 |
min_noutput_items(my_qpsk_demod_cb_sptr self) > int | def min_noutput_items(self):
return _TestA_swig.my_qpsk_demod_cb_sptr_min_noutput_items(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_min_noutput_items(self, *args, **kwargs):\n return _TestA_swig.my_qpsk_demod_cb_sptr_set_min_noutput_items(self, *args, **kwargs)",
"def min_noutput_items(self) -> \"int\":\n return _beamforming_swig.doaesprit_sptr_min_noutput_items(self)",
"def min_noutput_items(self) -> \"int\":\n ... | [
"0.8198051",
"0.80577385",
"0.79972523",
"0.79867584",
"0.7962964",
"0.7900752",
"0.76565117",
"0.7635231",
"0.7625792",
"0.761294",
"0.7543835",
"0.75274277",
"0.7509733",
"0.749357",
"0.74893034",
"0.7488749",
"0.74443394",
"0.741743",
"0.7383584",
"0.7326129",
"0.72947365"... | 0.8649412 | 0 |
max_output_buffer(my_qpsk_demod_cb_sptr self, int i) > long | def max_output_buffer(self, *args, **kwargs):
return _TestA_swig.my_qpsk_demod_cb_sptr_max_output_buffer(self, *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_output_buffer(self, i):\n return _spacegrant_swig.ax25_udp_pdu_gen_sptr_max_output_buffer(self, i)",
"def max_output_buffer(self, i):\n return _spacegrant_swig.G3RUH_descramble_sptr_max_output_buffer(self, i)",
"def max_output_buffer(self, i):\n return _spacegrant_swig.ax25_udp_pdu... | [
"0.79836637",
"0.79674256",
"0.79568934",
"0.7946607",
"0.7890878",
"0.7884437",
"0.7873474",
"0.7853879",
"0.7828902",
"0.78217196",
"0.7804683",
"0.78006643",
"0.7794092",
"0.77897525",
"0.77511793",
"0.7671584",
"0.7649711",
"0.76072305",
"0.760161",
"0.7559226",
"0.747615... | 0.84113073 | 0 |
min_output_buffer(my_qpsk_demod_cb_sptr self, int i) > long | def min_output_buffer(self, *args, **kwargs):
return _TestA_swig.my_qpsk_demod_cb_sptr_min_output_buffer(self, *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min_output_buffer(self, i):\n return _spacegrant_swig.ax25_udp_pdu_receiver_sptr_min_output_buffer(self, i)",
"def min_output_buffer(self, i: \"int\") -> \"long\":\n return _beamforming_swig.phasedarray_sptr_min_output_buffer(self, i)",
"def min_output_buffer(self, i: \"int\") -> \"long\":\n ... | [
"0.7781967",
"0.7773081",
"0.7754177",
"0.77466196",
"0.7723945",
"0.7709323",
"0.7700883",
"0.7661881",
"0.7621146",
"0.7584609",
"0.7576922",
"0.75454205",
"0.7507753",
"0.74804056",
"0.74646616",
"0.73787695",
"0.7335598",
"0.7314942",
"0.73039144",
"0.6925768",
"0.6898723... | 0.79691094 | 0 |
pc_noutput_items(my_qpsk_demod_cb_sptr self) > float | def pc_noutput_items(self):
return _TestA_swig.my_qpsk_demod_cb_sptr_pc_noutput_items(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_noutput_items(self) -> \"float\":\n return _beamforming_swig.doaesprit_sptr_pc_noutput_items(self)",
"def pc_noutput_items(self) -> \"float\":\n return _beamforming_swig.beamformer_sptr_pc_noutput_items(self)",
"def pc_noutput_items(self) -> \"float\":\n return _beamforming_swig.pha... | [
"0.7770028",
"0.7737175",
"0.76050395",
"0.7583354",
"0.7526948",
"0.75131685",
"0.74283683",
"0.7398685",
"0.712296",
"0.711613",
"0.7068397",
"0.68861014",
"0.6818357",
"0.68108726",
"0.6785303",
"0.67803776",
"0.66606236",
"0.6550942",
"0.6526321",
"0.6520581",
"0.6515783"... | 0.7203045 | 8 |
pc_noutput_items_var(my_qpsk_demod_cb_sptr self) > float | def pc_noutput_items_var(self):
return _TestA_swig.my_qpsk_demod_cb_sptr_pc_noutput_items_var(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_noutput_items_var(self) -> \"float\":\n return _beamforming_swig.doaesprit_sptr_pc_noutput_items_var(self)",
"def pc_noutput_items_var(self) -> \"float\":\n return _beamforming_swig.beamformer_sptr_pc_noutput_items_var(self)",
"def pc_noutput_items_var(self) -> \"float\":\n return _... | [
"0.79304403",
"0.79204476",
"0.781612",
"0.77719223",
"0.744187",
"0.73534966",
"0.7319453",
"0.7260336",
"0.6899127",
"0.67816955",
"0.6760469",
"0.67461216",
"0.67408955",
"0.6718824",
"0.6714915",
"0.6708343",
"0.67078465",
"0.6639351",
"0.6636823",
"0.6631633",
"0.6626105... | 0.7354257 | 5 |
pc_input_buffers_full(my_qpsk_demod_cb_sptr self, int which) > float pc_input_buffers_full(my_qpsk_demod_cb_sptr self) > pmt_vector_float | def pc_input_buffers_full(self, *args):
return _TestA_swig.my_qpsk_demod_cb_sptr_pc_input_buffers_full(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_input_buffers_full(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.doaesprit_sptr_pc_input_buffers_full(self, *args)",
"def pc_input_buffers_full(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.beamform... | [
"0.7552193",
"0.7494647",
"0.7479763",
"0.7353395",
"0.71984744",
"0.7196262",
"0.7184927",
"0.718135",
"0.71780205",
"0.7155473",
"0.71224153",
"0.71109",
"0.70811784",
"0.70395935",
"0.70373505",
"0.7003454",
"0.69805974",
"0.6936356",
"0.686501",
"0.6845943",
"0.6845466",
... | 0.74993706 | 1 |
pc_input_buffers_full_var(my_qpsk_demod_cb_sptr self, int which) > float pc_input_buffers_full_var(my_qpsk_demod_cb_sptr self) > pmt_vector_float | def pc_input_buffers_full_var(self, *args):
return _TestA_swig.my_qpsk_demod_cb_sptr_pc_input_buffers_full_var(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_input_buffers_full_var(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.beamformer_sptr_pc_input_buffers_full_var(self, *args)",
"def pc_input_buffers_full_var(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_... | [
"0.78041023",
"0.7803343",
"0.7793283",
"0.7648477",
"0.7558844",
"0.73878026",
"0.73803765",
"0.73783064",
"0.7358478",
"0.73397887",
"0.73388034",
"0.73254246",
"0.72771",
"0.72768176",
"0.7268832",
"0.7255305",
"0.72485375",
"0.7178073",
"0.7177266",
"0.71746755",
"0.71498... | 0.7559118 | 4 |
pc_output_buffers_full(my_qpsk_demod_cb_sptr self, int which) > float pc_output_buffers_full(my_qpsk_demod_cb_sptr self) > pmt_vector_float | def pc_output_buffers_full(self, *args):
return _TestA_swig.my_qpsk_demod_cb_sptr_pc_output_buffers_full(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_output_buffers_full(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.doaesprit_sptr_pc_output_buffers_full(self, *args)",
"def pc_output_buffers_full(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.beamf... | [
"0.7789591",
"0.77355933",
"0.77169997",
"0.7546452",
"0.7489274",
"0.74352074",
"0.7419717",
"0.7407771",
"0.74075615",
"0.736095",
"0.7347984",
"0.73470366",
"0.73352265",
"0.730445",
"0.72831553",
"0.726967",
"0.7266574",
"0.7249572",
"0.7204871",
"0.7204808",
"0.7184736",... | 0.7754391 | 1 |
pc_output_buffers_full_avg(my_qpsk_demod_cb_sptr self, int which) > float pc_output_buffers_full_avg(my_qpsk_demod_cb_sptr self) > pmt_vector_float | def pc_output_buffers_full_avg(self, *args):
return _TestA_swig.my_qpsk_demod_cb_sptr_pc_output_buffers_full_avg(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_output_buffers_full_avg(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.doaesprit_sptr_pc_output_buffers_full_avg(self, *args)",
"def pc_output_buffers_full_avg(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamformin... | [
"0.81568766",
"0.8138801",
"0.8096556",
"0.80833393",
"0.79645646",
"0.79262525",
"0.788476",
"0.78807056",
"0.78463614",
"0.78413904",
"0.7833113",
"0.7817426",
"0.78122306",
"0.7806583",
"0.77695215",
"0.7765277",
"0.77579904",
"0.77409863",
"0.7739111",
"0.77307785",
"0.77... | 0.807802 | 4 |
pc_output_buffers_full_var(my_qpsk_demod_cb_sptr self, int which) > float pc_output_buffers_full_var(my_qpsk_demod_cb_sptr self) > pmt_vector_float | def pc_output_buffers_full_var(self, *args):
return _TestA_swig.my_qpsk_demod_cb_sptr_pc_output_buffers_full_var(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_output_buffers_full_var(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.doaesprit_sptr_pc_output_buffers_full_var(self, *args)",
"def pc_output_buffers_full_var(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamformin... | [
"0.7974723",
"0.7974376",
"0.79512614",
"0.77927035",
"0.77711177",
"0.75578266",
"0.7557599",
"0.7555271",
"0.7544511",
"0.75240636",
"0.7514861",
"0.7509099",
"0.7470181",
"0.7425919",
"0.7405968",
"0.7396682",
"0.7389732",
"0.73887235",
"0.7388485",
"0.738192",
"0.7345168"... | 0.776182 | 5 |
nitems_written(cleanslate_sptr self, unsigned int which_output) > uint64_t | def nitems_written(self, *args, **kwargs):
return _TestA_swig.cleanslate_sptr_nitems_written(self, *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nitems_written(self, which_output):\n return _spacegrant_swig.invert_bit_sptr_nitems_written(self, which_output)",
"def nitems_written(self, which_output: \"unsigned int\") -> \"uint64_t\":\n return _beamforming_swig.doaesprit_sptr_nitems_written(self, which_output)",
"def nitems_written(self... | [
"0.8244607",
"0.8170424",
"0.81433463",
"0.8075045",
"0.8067205",
"0.80497664",
"0.80456936",
"0.7994826",
"0.7987469",
"0.7966976",
"0.79422027",
"0.78623605",
"0.7830034",
"0.7777338",
"0.77603203",
"0.77558094",
"0.77377325",
"0.7721335",
"0.75515777",
"0.7400436",
"0.7339... | 0.7808811 | 13 |
max_noutput_items(cleanslate_sptr self) > int | def max_noutput_items(self):
return _TestA_swig.cleanslate_sptr_max_noutput_items(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_noutput_items(self):\n return _spacegrant_swig.G3RUH_descramble_sptr_max_noutput_items(self)",
"def max_noutput_items(self) -> \"int\":\n return _beamforming_swig.beamformer_sptr_max_noutput_items(self)",
"def max_noutput_items(self) -> \"int\":\n return _beamforming_swig.doaesprit... | [
"0.8147364",
"0.8146803",
"0.81130636",
"0.8019731",
"0.79944146",
"0.7988828",
"0.79789734",
"0.7972822",
"0.7972298",
"0.79295295",
"0.7901343",
"0.7898159",
"0.7876352",
"0.78758097",
"0.78743804",
"0.78638434",
"0.7838922",
"0.77920026",
"0.77747583",
"0.76924473",
"0.767... | 0.8674421 | 0 |
set_max_noutput_items(cleanslate_sptr self, int m) | def set_max_noutput_items(self, *args, **kwargs):
return _TestA_swig.cleanslate_sptr_set_max_noutput_items(self, *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_max_noutput_items(self, m):\n return _spacegrant_swig.G3RUH_descramble_sptr_set_max_noutput_items(self, m)",
"def set_max_noutput_items(self, m):\n return _spacegrant_swig.DeNRZI_sptr_set_max_noutput_items(self, m)",
"def set_max_noutput_items(self, m: \"int\") -> \"void\":\n retur... | [
"0.87749",
"0.87315995",
"0.8717382",
"0.8703663",
"0.8668009",
"0.8667097",
"0.8648274",
"0.8647567",
"0.86101276",
"0.85543305",
"0.8552128",
"0.85328823",
"0.8463399",
"0.84521806",
"0.8446751",
"0.83381516",
"0.83158153",
"0.82459635",
"0.82432353",
"0.81800956",
"0.80465... | 0.8705472 | 3 |
is_set_max_noutput_items(cleanslate_sptr self) > bool | def is_set_max_noutput_items(self):
return _TestA_swig.cleanslate_sptr_is_set_max_noutput_items(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_set_max_noutput_items(self) -> \"bool\":\n return _beamforming_swig.beamformer_sptr_is_set_max_noutput_items(self)",
"def is_set_max_noutput_items(self) -> \"bool\":\n return _beamforming_swig.doaesprit_sptr_is_set_max_noutput_items(self)",
"def is_set_max_noutput_items(self) -> \"bool\":\... | [
"0.8641517",
"0.8635376",
"0.85434794",
"0.84792763",
"0.84736365",
"0.8452503",
"0.84220475",
"0.8405605",
"0.83939105",
"0.8392866",
"0.83839333",
"0.8369475",
"0.8363548",
"0.835813",
"0.8339648",
"0.8337508",
"0.83211356",
"0.82999706",
"0.8204332",
"0.8165789",
"0.811884... | 0.8769254 | 0 |
set_min_noutput_items(cleanslate_sptr self, int m) | def set_min_noutput_items(self, *args, **kwargs):
return _TestA_swig.cleanslate_sptr_set_min_noutput_items(self, *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_min_noutput_items(self, m: \"int\") -> \"void\":\n return _beamforming_swig.beamformer_sptr_set_min_noutput_items(self, m)",
"def set_min_noutput_items(self, m):\n return _spacegrant_swig.G3RUH_descramble_sptr_set_min_noutput_items(self, m)",
"def set_min_noutput_items(self, m: \"int\") -... | [
"0.8715376",
"0.87095857",
"0.8634908",
"0.8600197",
"0.8572869",
"0.85716647",
"0.85584754",
"0.854388",
"0.8510908",
"0.8504354",
"0.844566",
"0.84317344",
"0.8388467",
"0.83328146",
"0.8294652",
"0.8195598",
"0.818363",
"0.80927086",
"0.8082007",
"0.800389",
"0.79207206",
... | 0.85096526 | 9 |
min_noutput_items(cleanslate_sptr self) > int | def min_noutput_items(self):
return _TestA_swig.cleanslate_sptr_min_noutput_items(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min_noutput_items(self) -> \"int\":\n return _beamforming_swig.beamformer_sptr_min_noutput_items(self)",
"def min_noutput_items(self) -> \"int\":\n return _beamforming_swig.doaesprit_sptr_min_noutput_items(self)",
"def min_noutput_items(self) -> \"int\":\n return _beamforming_swig.phas... | [
"0.82367194",
"0.82062954",
"0.7935548",
"0.79011834",
"0.78265387",
"0.7820854",
"0.7760261",
"0.7735351",
"0.77248985",
"0.7711487",
"0.7691022",
"0.76900434",
"0.7685492",
"0.7672467",
"0.7639364",
"0.7623765",
"0.76079154",
"0.7599583",
"0.75499284",
"0.7427995",
"0.74106... | 0.8389012 | 0 |
max_output_buffer(cleanslate_sptr self, int i) > long | def max_output_buffer(self, *args, **kwargs):
return _TestA_swig.cleanslate_sptr_max_output_buffer(self, *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_output_buffer(self, i):\n return _spacegrant_swig.G3RUH_descramble_sptr_max_output_buffer(self, i)",
"def max_output_buffer(self, i: \"int\") -> \"long\":\n return _beamforming_swig.doaesprit_sptr_max_output_buffer(self, i)",
"def max_output_buffer(self, i: \"int\") -> \"long\":\n ... | [
"0.81159717",
"0.80130035",
"0.79757446",
"0.7934864",
"0.7881507",
"0.787262",
"0.7870142",
"0.78503066",
"0.7814417",
"0.78141725",
"0.7801584",
"0.7742246",
"0.7733616",
"0.7689285",
"0.7668367",
"0.76287425",
"0.7620742",
"0.75823987",
"0.75590855",
"0.7456351",
"0.745200... | 0.81541556 | 0 |
set_max_output_buffer(cleanslate_sptr self, long max_output_buffer) set_max_output_buffer(cleanslate_sptr self, int port, long max_output_buffer) | def set_max_output_buffer(self, *args):
return _TestA_swig.cleanslate_sptr_set_max_output_buffer(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_max_output_buffer(self, *args):\n return _spacegrant_swig.hdlc_framer_sptr_set_max_output_buffer(self, *args)",
"def set_max_output_buffer(self, *args):\n return _spacegrant_swig.ax25_udp_pdu_gen_sptr_set_max_output_buffer(self, *args)",
"def set_max_output_buffer(self, *args):\n r... | [
"0.7845635",
"0.780104",
"0.7744596",
"0.77277094",
"0.77240735",
"0.76952",
"0.766455",
"0.7654684",
"0.7653285",
"0.76462066",
"0.7621423",
"0.7614807",
"0.7594203",
"0.75488615",
"0.7518844",
"0.7509936",
"0.7408411",
"0.7402337",
"0.73919344",
"0.7314326",
"0.7294961",
... | 0.79242676 | 0 |
min_output_buffer(cleanslate_sptr self, int i) > long | def min_output_buffer(self, *args, **kwargs):
return _TestA_swig.cleanslate_sptr_min_output_buffer(self, *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min_output_buffer(self, i: \"int\") -> \"long\":\n return _beamforming_swig.doaesprit_sptr_min_output_buffer(self, i)",
"def min_output_buffer(self, i: \"int\") -> \"long\":\n return _beamforming_swig.beamformer_sptr_min_output_buffer(self, i)",
"def min_output_buffer(self, i):\n retur... | [
"0.7921987",
"0.7921346",
"0.78276056",
"0.77350044",
"0.7720525",
"0.7692746",
"0.7689611",
"0.76620615",
"0.7620886",
"0.75503755",
"0.754326",
"0.7514875",
"0.7455218",
"0.7420939",
"0.74062794",
"0.7381551",
"0.73508894",
"0.72889596",
"0.7262124",
"0.7160839",
"0.7061437... | 0.7624815 | 8 |
pc_noutput_items(cleanslate_sptr self) > float | def pc_noutput_items(self):
return _TestA_swig.cleanslate_sptr_pc_noutput_items(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_noutput_items(self) -> \"float\":\n return _beamforming_swig.beamformer_sptr_pc_noutput_items(self)",
"def pc_noutput_items(self) -> \"float\":\n return _beamforming_swig.doaesprit_sptr_pc_noutput_items(self)",
"def pc_noutput_items_var(self) -> \"float\":\n return _beamforming_swig... | [
"0.8026017",
"0.8019789",
"0.7760217",
"0.77268964",
"0.7724564",
"0.765785",
"0.7518396",
"0.7464442",
"0.6810941",
"0.6802239",
"0.6731122",
"0.6724018",
"0.671205",
"0.6653203",
"0.66398674",
"0.66305536",
"0.66118044",
"0.66072065",
"0.6579659",
"0.6573867",
"0.6565729",
... | 0.6883132 | 8 |
pc_nproduced_avg(cleanslate_sptr self) > float | def pc_nproduced_avg(self):
return _TestA_swig.cleanslate_sptr_pc_nproduced_avg(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_nproduced_avg(self) -> \"float\":\n return _beamforming_swig.beamformer_sptr_pc_nproduced_avg(self)",
"def pc_nproduced_avg(self) -> \"float\":\n return _beamforming_swig.phasedarray_sptr_pc_nproduced_avg(self)",
"def pc_nproduced_avg(self) -> \"float\":\n return _beamforming_swig.d... | [
"0.8333041",
"0.8154686",
"0.81492823",
"0.8067569",
"0.7649717",
"0.7505052",
"0.7458782",
"0.74563766",
"0.7443935",
"0.7435257",
"0.7403087",
"0.740232",
"0.7401016",
"0.73743993",
"0.7338171",
"0.73274183",
"0.72760653",
"0.7255744",
"0.7228772",
"0.71417576",
"0.7114562"... | 0.7754709 | 4 |
pc_input_buffers_full_var(cleanslate_sptr self, int which) > float pc_input_buffers_full_var(cleanslate_sptr self) > pmt_vector_float | def pc_input_buffers_full_var(self, *args):
return _TestA_swig.cleanslate_sptr_pc_input_buffers_full_var(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_input_buffers_full_var(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.beamformer_sptr_pc_input_buffers_full_var(self, *args)",
"def pc_input_buffers_full_var(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_... | [
"0.7971278",
"0.7893885",
"0.77946323",
"0.7737842",
"0.76526767",
"0.7506636",
"0.7380608",
"0.7308758",
"0.7212768",
"0.71923596",
"0.7161308",
"0.7094367",
"0.70935464",
"0.70909995",
"0.70794415",
"0.7071458",
"0.70542186",
"0.7052636",
"0.70487267",
"0.6998051",
"0.69768... | 0.7074942 | 15 |
pc_output_buffers_full(cleanslate_sptr self, int which) > float pc_output_buffers_full(cleanslate_sptr self) > pmt_vector_float | def pc_output_buffers_full(self, *args):
return _TestA_swig.cleanslate_sptr_pc_output_buffers_full(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_output_buffers_full(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.doaesprit_sptr_pc_output_buffers_full(self, *args)",
"def pc_output_buffers_full(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.beamf... | [
"0.81102496",
"0.80952555",
"0.78709984",
"0.7865147",
"0.7844248",
"0.7840203",
"0.77251786",
"0.7630051",
"0.7495713",
"0.7444028",
"0.7401918",
"0.74008596",
"0.737039",
"0.73279345",
"0.7325727",
"0.73197937",
"0.7276382",
"0.7240215",
"0.7238816",
"0.72386914",
"0.722045... | 0.73040164 | 16 |
pc_output_buffers_full_avg(cleanslate_sptr self, int which) > float pc_output_buffers_full_avg(cleanslate_sptr self) > pmt_vector_float | def pc_output_buffers_full_avg(self, *args):
return _TestA_swig.cleanslate_sptr_pc_output_buffers_full_avg(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_output_buffers_full_avg(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.doaesprit_sptr_pc_output_buffers_full_avg(self, *args)",
"def pc_output_buffers_full_avg(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamformin... | [
"0.8373646",
"0.83619326",
"0.8291778",
"0.82258224",
"0.8186649",
"0.8027492",
"0.79849434",
"0.7949675",
"0.7934073",
"0.79137313",
"0.78989226",
"0.7865863",
"0.786512",
"0.7863367",
"0.7854044",
"0.7828454",
"0.7826941",
"0.7806892",
"0.78057057",
"0.77824205",
"0.7771405... | 0.7981245 | 7 |
pc_output_buffers_full_var(cleanslate_sptr self, int which) > float pc_output_buffers_full_var(cleanslate_sptr self) > pmt_vector_float | def pc_output_buffers_full_var(self, *args):
return _TestA_swig.cleanslate_sptr_pc_output_buffers_full_var(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pc_output_buffers_full_var(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamforming_swig.beamformer_sptr_pc_output_buffers_full_var(self, *args)",
"def pc_output_buffers_full_var(self, *args) -> \"std::vector< float,std::allocator< float > >\":\n return _beamformi... | [
"0.8125006",
"0.808088",
"0.79755944",
"0.7870311",
"0.78630537",
"0.7524353",
"0.75195765",
"0.74657905",
"0.7440499",
"0.74340576",
"0.7416888",
"0.74113804",
"0.7399782",
"0.7386339",
"0.73590815",
"0.7357751",
"0.7328304",
"0.730541",
"0.7285185",
"0.7225293",
"0.7213701"... | 0.7334039 | 16 |
Split path by \\ or / to obtain parts | def pathSplit(path):
path = re.split('/|\\\\', path)
return path | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __split_path(path: str) -> List[str]:\n return [part for part in path.split('/') if part] # Splits path at '/', handles extra slashes in the process",
"def splitpath(path):\n\n # FIXME perhaps call op.split repetitively would be better.\n #s = string.split( path, '/' ) # we work with fwd slash... | [
"0.77459204",
"0.77029777",
"0.75313014",
"0.7454083",
"0.7422721",
"0.7399593",
"0.7309511",
"0.7225344",
"0.72124505",
"0.72119975",
"0.7119191",
"0.7081523",
"0.6987801",
"0.69732434",
"0.6913136",
"0.6911409",
"0.6899992",
"0.68780786",
"0.6806732",
"0.6796347",
"0.678893... | 0.8532439 | 0 |
Constructs COCO evaluation class. GT is being loaded at initialization time from JSON. Rescaling of bboxes is being done to correspond with the preprocessing where the images went through "resize_and_pad" operator. | def __init__(self, **kwargs):
dataset_name = kwargs.get('dataset_name', None)
self.reset()
image_height, image_width, _ = kwargs['input_shape']
dataset_info = get_dataset_info(dataset_name=dataset_name)
self._label_inv_map = {v: k for k, v in dataset_info.label_map.items()}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, boxes, anchors, scales, decode_clip, reversed_box,\n kernel_name):\n self.tik_instance = tik.Tik(tik.Dprofile())\n self.boxes_shape = boxes.get(\"shape\")\n self.boxes_dtype = boxes.get(\"dtype\").lower()\n self.anchors_shape = anchors.get(\"shape\")\n... | [
"0.6229467",
"0.5874896",
"0.5841279",
"0.57546943",
"0.5731727",
"0.57293075",
"0.5708182",
"0.5703228",
"0.56913143",
"0.5671521",
"0.5659812",
"0.5649642",
"0.56477994",
"0.56447756",
"0.56259304",
"0.56166995",
"0.56128263",
"0.560349",
"0.5594562",
"0.55536604",
"0.55534... | 0.6145043 | 1 |
Set the root_state of the tree to the passed gamestate, this clears all the information stored in the tree since none of it applies to the new state. | def set_gamestate(self, state: GameState) -> None:
self.root_state = deepcopy(state)
self.root = Node() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_tree(self):\n self.root = None\n self.action = None\n self.dist_probability = None",
"def reset(self):\r\n self.key = None\r\n self.value = None\r\n self.parent = None\r\n self.left_child = None\r\n self.right_child = None\r\n self.color = ... | [
"0.66198593",
"0.642887",
"0.6213962",
"0.6178111",
"0.6165556",
"0.6148402",
"0.60877436",
"0.6086903",
"0.6075498",
"0.59792346",
"0.59318805",
"0.591242",
"0.5907274",
"0.5867194",
"0.58651465",
"0.5835625",
"0.5835625",
"0.5832716",
"0.5830407",
"0.5804247",
"0.5803777",
... | 0.8192172 | 0 |
Parser for list of annotated variables, parsing annotation with prs Missing annotation added as a metavariable. Variables within the parentheses are constrained to have the same type. | def annotated_vars(prs):
def trt(acc):
vs,ann = acc
if len(ann)==0:
return vs
assert(len(ann)==1)
return [c.copy_token(v,ann[0]) for v in vs]
return c.paren(var().plus() + colon_annotation_or_meta()).treat(trt) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def annotated_var(prs):\n def trt(acc):\n v,ann = acc \n if len(ann) > 0:\n return c.copy_token(v,{'annotation':ann[0]})\n return v\n return c.paren(var() + colon_annotation(prs)).treat(trt)",
"def variable_parser(var_list, prefix):\r\n ret_list = []\r\n for var in var_lis... | [
"0.59462374",
"0.5559178",
"0.5486175",
"0.54789513",
"0.5476632",
"0.53237116",
"0.52786887",
"0.52295095",
"0.51861274",
"0.5139445",
"0.51172787",
"0.5080187",
"0.5028797",
"0.5002494",
"0.49723697",
"0.49612734",
"0.49539796",
"0.49525622",
"0.49361315",
"0.49285755",
"0.... | 0.67335314 | 0 |
Parser for let_annotations. Terminating punctuation not included. | def let_annotation():
return ((first_word( 'fix let') + c.comma_nonempty_list(annotated_sort_vars)) |
let_annotation_prefix() + post_colon_balanced()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compile_let(self) -> None:\n self._consume('let')\n name = self._get_current_token()\n kind = convert_kind(self.table.kind_of(name))\n index = self.table.index_of(name)\n\n self._consume(TokenTypes.IDENTIFIER)\n if self._get_current_token() == '[':\n self._c... | [
"0.55026305",
"0.5396084",
"0.5285978",
"0.521872",
"0.50235564",
"0.50221014",
"0.50203323",
"0.4976488",
"0.49732462",
"0.49364364",
"0.4919952",
"0.48645124",
"0.48486638",
"0.48469508",
"0.48377788",
"0.48331526",
"0.4801502",
"0.47898072",
"0.47277427",
"0.4681047",
"0.4... | 0.6735892 | 0 |
parser for 'word (or word) (paren stuff)'. (or word) gives a synonym as a parenthetical within a word pattern. Side effect is a new global synonym. | def _nonkey_extended():
p = ((Pattern._nonkey() +
c.paren((next_word('or') + Pattern._nonkey()).treat(lib.snd).plus()).possibly()) +
c.paren(Pattern._nonkey().plus()).many())
def f(item):
item1 = p.process(item)
((a,bs),cs) = item1.acc
vals ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sqpp_paren_expr1_and_expr2_or_expr3_WORDS(self):\n self.assertEqual(self.parser.parse_query('(expr1 and expr2) or expr3'),\n ['+', 'expr1 + expr2', '|', 'expr3'])\n #['+', '+ expr1 | expr3', '+', '+ expr2 | expr3'])",
"def simplify_or_no... | [
"0.5915112",
"0.58078974",
"0.5580038",
"0.5549057",
"0.5522555",
"0.5430088",
"0.5379919",
"0.53741246",
"0.5315197",
"0.52980024",
"0.5273501",
"0.521362",
"0.5203585",
"0.5184946",
"0.5178341",
"0.51314265",
"0.50961405",
"0.50634813",
"0.5028717",
"0.5003986",
"0.49952772... | 0.52278244 | 11 |
Default location for XDG_DATA_HOME should be respected. | def test_xdg_data_home_default_location(monkeypatch):
xdg = XDG()
default_dir = xdg.data_home
assert default_dir == Path('~/.local/share/astrality').expanduser()
assert default_dir.is_dir() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def platform_data_dir():\n if POSIX: # nocover\n dpath_ = os.environ.get('XDG_DATA_HOME', '~/.local/share')\n elif DARWIN: # nocover\n dpath_ = '~/Library/Application Support'\n elif WIN32: # nocover\n dpath_ = os.environ.get('APPDATA', '~/AppData/Roaming')\n else: # nocover\n... | [
"0.72619945",
"0.7074596",
"0.7041045",
"0.6995045",
"0.690163",
"0.6894032",
"0.6851172",
"0.6762189",
"0.6687058",
"0.6683091",
"0.6634823",
"0.6620935",
"0.65889674",
"0.65248495",
"0.6496656",
"0.6470753",
"0.6460727",
"0.64457846",
"0.64425856",
"0.64087516",
"0.6400644"... | 0.8273838 | 0 |
Returns the data at index idx. | def read_data(self, index):
attr = self.dataset.get_attr(index)
if self.cache_convert:
data = self.cache_convert(attr['name'])
elif self.preprocess:
data = self.preprocess(self.dataset.get_data(index), attr)
else:
data = self.dataset.get_data(index)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __getitem__(self, idx):\n return self._data[idx]",
"def __getitem__(self, idx):\n assert(isinstance(idx, int))\n nidx = self._normalize_idx(idx)\n if nidx >= len(self.data):\n raise IndexError\n return self.data[nidx]",
"def __getitem__ ( self , index ):\n\t\tr... | [
"0.7986831",
"0.79163516",
"0.7748127",
"0.77480066",
"0.7640151",
"0.7640151",
"0.76013696",
"0.75766176",
"0.75597006",
"0.7494179",
"0.7450656",
"0.74458677",
"0.73713493",
"0.7291821",
"0.71980345",
"0.71788514",
"0.71490014",
"0.7142985",
"0.7084804",
"0.7084804",
"0.708... | 0.64153916 | 69 |
given decimal hours names it look nice in human | def human_travel(hours):
import math
m = int((hours % 1) * 60)
h = int(math.floor(hours))
if h > 24:
d = int(math.floor(h/24))
h = h % 24
else:
d = 0
st = ""
if d:
st += "{0} Day".format(d)
if d > 1:
st += "s"
if h:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_hours(self, data):\n return unicode('%f' % data).rstrip('0').rstrip('.')",
"def human_seconds(seconds):\n if seconds < 60:\n return '{: >5.1f} seconds'.format(seconds)\n if seconds < 60*60:\n return '{: >5.1f} minutes'.format(seconds / 60)\n return '{... | [
"0.7611349",
"0.6739795",
"0.6517632",
"0.6517528",
"0.64868015",
"0.64533496",
"0.6353347",
"0.6350108",
"0.6335695",
"0.62702173",
"0.62453794",
"0.6215599",
"0.6213443",
"0.6208212",
"0.61813235",
"0.61386913",
"0.6127547",
"0.6088821",
"0.6083568",
"0.6083467",
"0.6051155... | 0.6872026 | 1 |
Returns list of all products. | def return_products():
with MY_CONNECTION as connection:
cursor = connection.cursor()
cursor.execute(
"""
SELECT id_product, product_name, product_price, in_stock, description
FROM Products
""")
return cursor.fetchall() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_products(self):\n\t\tpass",
"def get_all_products():\n products = app.session.query(models.Product).all()\n return products",
"def list_products(self):\n return self._make_get_request(self._urls['products'])",
"def get_all_products():\n data = order_obj.get_all_products()\n ret... | [
"0.88331366",
"0.8658989",
"0.8569795",
"0.85566694",
"0.84089065",
"0.83678234",
"0.8353813",
"0.79811674",
"0.79731077",
"0.79008645",
"0.78920037",
"0.78651536",
"0.77809787",
"0.77586204",
"0.77582324",
"0.77531487",
"0.76937777",
"0.768204",
"0.7676661",
"0.75090563",
"0... | 0.6691945 | 52 |
Updates Customer by given id. | def update_product(product_id, name, price, stock, description):
with MY_CONNECTION as connection:
connection.execute(
"""
UPDATE Products
SET product_name=?, product_price=?, in_stock=?, description=?
WHERE id_product=?
""",
(name, pri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updateCustomer(self, **params):\n self.__requireParams(params, ['id'])\n return self.__req('update_customer', params)",
"def edit_customer(cls, api, id, **data):\n return api.update_customer(id, **data)",
"def put(self, customer_id):\n data = request.json\n return edit_customer(c... | [
"0.87363094",
"0.84829235",
"0.84509194",
"0.7944978",
"0.76272047",
"0.7388434",
"0.7159237",
"0.7129901",
"0.71060747",
"0.70350033",
"0.70290554",
"0.7001015",
"0.69285494",
"0.69285494",
"0.69285494",
"0.69285494",
"0.68951154",
"0.68812764",
"0.68409187",
"0.6773204",
"0... | 0.0 | -1 |
Returns specialized columns from Orders and products by given id. Returns order id, product name, quantity, total price of order. | def orders_product_info(customer_id):
with MY_CONNECTION as connection:
cursor = connection.cursor()
cursor.execute(
"""
SELECT o.id_order,p.product_name,o.quantity,o.total_price
FROM Orders AS o
NATURAL JOIN Products AS p
WHERE o.id_custom... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_order_detail(self, order_id):\n\n data = cur.execute(\"\"\"SELECT productid, productname, quantity, location FROM orderitems WHERE orderid = ?\"\"\",\n (order_id,)).fetchall()\n print(tabulate(data, headers=[\"Product ID\", \"Name\", \"Quantity\", \"Location\"]))",
... | [
"0.63719517",
"0.6286009",
"0.59406656",
"0.5804217",
"0.57000524",
"0.5644469",
"0.5610042",
"0.5582495",
"0.54792225",
"0.5462834",
"0.54015976",
"0.53714913",
"0.53600734",
"0.5344053",
"0.53379124",
"0.5268942",
"0.5225207",
"0.5165338",
"0.5143801",
"0.5114278",
"0.50976... | 0.6463404 | 0 |
Load data from a JSON file. | def load_json(file_path):
try:
with open(file_path, "r", encoding="utf-8") as f:
data = json.load(f)
except json.JSONDecodeError as e:
raise ValueError(f"Invalid JSON format in file {file_path}") from e
except FileNotFoundError as e:
raise ValueError(f"File not found: {fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_data_from_json(self, filename):\n with open(filename, 'r') as f:\n self.data = json.load(f, object_pairs_hook=OrderedDict)",
"def load_json(self, filename):\n with open(filename, 'r', encoding='utf-8') as f:\n data_dict = json.load(f)\n return data_dict",
"def... | [
"0.8209026",
"0.81863016",
"0.81456125",
"0.80497307",
"0.80251986",
"0.79896885",
"0.79310125",
"0.79226065",
"0.79226065",
"0.79197145",
"0.78916705",
"0.7847835",
"0.78451556",
"0.7844927",
"0.7831677",
"0.78285027",
"0.7817083",
"0.78140146",
"0.77941585",
"0.7773541",
"0... | 0.7796883 | 18 |
Display images in a grid format using matplotlib. | def display_images_in_grid(imgs, row, col):
if len(imgs) != (row * col):
raise ValueError(f"Invalid imgs len:{len(imgs)} col:{row} row:{col}")
for i, img in enumerate(imgs):
plot_num = i + 1
plt.subplot(row, col, plot_num)
plt.tick_params(labelbottom=False) # remove x axis
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_image_grid(imgs):\n grd = make_grid(imgs)\n npimg = grd.numpy()\n plt.imshow(np.transpose(npimg, (1,2,0)), interpolation='nearest')\n plt.ion()\n plt.show()",
"def imshow_grid(images, shape=[2, 8]):\n fig = plt.figure(1)\n grid = ImageGrid(fig, 111, nrows_ncols=shape, axes_pad=0.05)... | [
"0.84882283",
"0.8100651",
"0.8100651",
"0.78179336",
"0.7658079",
"0.76546526",
"0.7635028",
"0.7629128",
"0.76201797",
"0.75688076",
"0.75048995",
"0.7488107",
"0.7405608",
"0.73798454",
"0.7356226",
"0.73450166",
"0.7303493",
"0.7283508",
"0.72553986",
"0.7246716",
"0.7243... | 0.80286324 | 3 |
Reads source and target sequences from txt files. | def __init__(self, data, vocab):
self.src = []
self.cands = []
self.trg = []
self.persona = []
self.max_len_sent = 0
self.max_len_words = 0
self.max_len_answer = 0
for d in data:
if(len(d[0]) > self.max_len_sent):
self.max_len_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_examples(source_file, target_file):\n sources = []\n targets = []\n\n with gfile.GFile(source_file, \"r\") as txt_file:\n for line in txt_file:\n sources.append(line.rstrip(\"\\n\"))\n\n with gfile.GFile(target_file, \"r\") as txt_file:\n for line in txt_file:\n targets.append(line.rst... | [
"0.7004346",
"0.6208018",
"0.61497456",
"0.6132846",
"0.6076196",
"0.60475314",
"0.6025892",
"0.5775756",
"0.56896174",
"0.5674089",
"0.5657116",
"0.56105125",
"0.5501782",
"0.5494425",
"0.5476749",
"0.5456228",
"0.54284465",
"0.54284143",
"0.5420703",
"0.5415088",
"0.5394724... | 0.0 | -1 |
Convert a datetime to bus time. Bus time is seconds since the given start point. | def dt_to_bustime(start, dt):
return (dt - start).total_seconds() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bustime_to_dt(start, bustime):\n\treturn start + datetime.timedelta(seconds=bustime)",
"def realtime_to_ingame(sec: float, start_dt: datetime) -> datetime:\n return start_dt + realtime_to_ingame_delta(sec)",
"def _time_to_datetime(value):\r\n assert isinstance(value, datetime.time)\r\n return date... | [
"0.6158209",
"0.56238735",
"0.551101",
"0.54902667",
"0.54724216",
"0.5332458",
"0.5323227",
"0.527221",
"0.527221",
"0.524157",
"0.52401334",
"0.52295464",
"0.5208859",
"0.52002376",
"0.51596487",
"0.51093906",
"0.50953364",
"0.5095077",
"0.5091824",
"0.50715584",
"0.5071496... | 0.6541492 | 0 |
Convert from bus time to a datetime | def bustime_to_dt(start, bustime):
return start + datetime.timedelta(seconds=bustime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _time_to_datetime(value):\r\n assert isinstance(value, datetime.time)\r\n return datetime.datetime(1970, 1, 1,\r\n value.hour, value.minute, value.second,\r\n value.microsecond)",
"def convert_datetime(date, time):\n return datetime.datetime.st... | [
"0.6674446",
"0.6520953",
"0.6492954",
"0.64041257",
"0.6372595",
"0.62666076",
"0.62204605",
"0.6193746",
"0.6119679",
"0.6097914",
"0.6095712",
"0.60802674",
"0.60695803",
"0.6036124",
"0.6022237",
"0.6013587",
"0.6010904",
"0.59286404",
"0.59060884",
"0.58575785",
"0.58442... | 0.5706581 | 34 |
Replaces all substrings that look like window IDs with a fixed string. | def strip_winids(string):
return re.sub(r'0x([0-9a-f]+)', '<windowid>', string) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _winfix(s):\n return s.replace('2L', '2').replace('3L', '3').replace('4L', '4').replace('5L', '5')",
"def _clean_id(self, dirty_id):\n return self.wsid_regex.sub(\"\", dirty_id.replace(\" \", \"_\"))",
"def figure_id_filter(text):\n def fn(m):\n s = m.group(1) or \"\"\n s += m.gr... | [
"0.62442964",
"0.59707296",
"0.56507605",
"0.5625161",
"0.5404568",
"0.53610873",
"0.53184026",
"0.5267574",
"0.5241126",
"0.5134601",
"0.5120752",
"0.5115084",
"0.51088154",
"0.50965625",
"0.5073346",
"0.50682366",
"0.50539",
"0.50426763",
"0.50231194",
"0.50177664",
"0.4965... | 0.7428588 | 0 |
Coefficients of the quadratic and constant terms in the Bernoulli relation. | def get_coeffs(b, q0, hL, g):
C0 = q0 * q0 / (2. * g)
C1 = b - C0 / (hL * hL) - hL
return C0, C1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_coeff(self):\n return bernoulli(self.degree+1) / factorial(self.degree + 1)",
"def b_coefficients(x1,x2,x3,y1,y2,y3,CCoefficients,DCoefficients):\n\tBCoefficients = np.array([\t((y2-y1)/(x2-x1)-CCoefficients[0]*(x2-x1) - DCoefficients[0]*((x2-x1)**2)), \\\n\t\t\t\t\t\t\t\t((y3-y2)/(x3-x2)-CCoeff... | [
"0.6857981",
"0.66643137",
"0.6382548",
"0.637478",
"0.628859",
"0.6176805",
"0.6085962",
"0.6049601",
"0.59216726",
"0.59187555",
"0.58633614",
"0.5790377",
"0.57706434",
"0.57499945",
"0.5695265",
"0.5690302",
"0.5682188",
"0.5678729",
"0.5666879",
"0.5661153",
"0.5660131",... | 0.0 | -1 |
Returns the name of the uploaded file without the extension | def filename(self):
filename, ext = os.path.splitext(self.file.name)
return filename.split('/')[-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_file_name(self):\n return self.upload.name[6:]",
"def get_filename(self):\n name, ext = self.fkit.filename.rsplit('.', 1)\n if self._field.extension():\n ext = self._field.extension()\n return '.'.join((name, ext))",
"def get_file_name(file):\n return os.path.s... | [
"0.86806726",
"0.7841413",
"0.77402383",
"0.77267313",
"0.7693219",
"0.7650377",
"0.7571138",
"0.7456755",
"0.7424246",
"0.7366159",
"0.73341227",
"0.7328669",
"0.72825634",
"0.7280094",
"0.7273225",
"0.72627217",
"0.72439784",
"0.7243577",
"0.7214615",
"0.71960276",
"0.71960... | 0.7892259 | 1 |
Returns a diff between ``left_struc`` and ``right_struc``. If ``left_struc`` and ``right_struc`` are both serializable as arrays, this function will use NeedlemanWunsch sequence alignment to find a minimal diff between them. Otherwise, the inputs are | def needle_diff(left_struc, right_struc, key, minimal=True):
if type(left_struc) not in (list, tuple):
return keyset_diff(left_struc, right_struc, key, minimal)
assert type(right_struc) in (list, tuple)
down_col = 0
lastrow = [
[[key + [sub_i]] for sub_i in range(i)]
for i in ra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diff(left_struc, right_struc, minimal=True, verbose=True, key=None):\n if key is None:\n key = []\n\n if structure_worth_investigating(left_struc, right_struc):\n common = commonality(left_struc, right_struc)\n if minimal:\n my_diff = needle_diff(left_struc, right_struc, k... | [
"0.7642022",
"0.64446455",
"0.630818",
"0.62612844",
"0.61736184",
"0.6010537",
"0.6005346",
"0.5992586",
"0.5979341",
"0.5926923",
"0.5915353",
"0.5904664",
"0.5904664",
"0.58857566",
"0.5881161",
"0.58752775",
"0.58752775",
"0.58693796",
"0.58630466",
"0.58595085",
"0.58527... | 0.6452178 | 1 |
Test whether it is worth looking at the internal structure of `left_struc` and `right_struc` to see if they can be efficiently diffed. | def structure_worth_investigating(left_struc, right_struc):
if type(left_struc) is not type(right_struc):
return False
if type(left_struc) in TERMINALS:
return False
if len(left_struc) == 0 or len(right_struc) == 0:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commonality(left_struc, right_struc):\n assert type(left_struc) is type(right_struc), (left_struc, right_struc)\n assert left_struc and right_struc, (left_struc, right_struc)\n if type(left_struc) is dict:\n (overlap, left, right) = compute_keysets(left_struc, right_struc)\n com = float(... | [
"0.69071007",
"0.66768944",
"0.6247868",
"0.6100577",
"0.60741043",
"0.602561",
"0.5950381",
"0.5950346",
"0.5915146",
"0.5890434",
"0.5841225",
"0.5810433",
"0.5777874",
"0.57624817",
"0.5739839",
"0.57333237",
"0.5684197",
"0.564713",
"0.5634275",
"0.5617334",
"0.56050366",... | 0.7230655 | 0 |
Return a float between 0.0 and 1.0 representing the amount that the structures left_struc and right_struc have in common. It is assumed (and ``assert``ed!) that ``left_struc`` and ``right_struc`` are of the same type, and nonempty (check this | def commonality(left_struc, right_struc):
assert type(left_struc) is type(right_struc), (left_struc, right_struc)
assert left_struc and right_struc, (left_struc, right_struc)
if type(left_struc) is dict:
(overlap, left, right) = compute_keysets(left_struc, right_struc)
com = float(len(overla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_frac_same(self):\n s1 = self.RNA(\"ACGU\")\n s2 = self.RNA(\"AACG\")\n s3 = self.RNA(\"GG\")\n s4 = self.RNA(\"A\")\n e = self.RNA(\"\")\n self.assertEqual(s1.frac_same(e), 0)\n self.assertEqual(s1.frac_same(s2), 0.25)\n self.assertEqual(s1.frac_same... | [
"0.60538256",
"0.602482",
"0.59803027",
"0.590693",
"0.5904152",
"0.58436525",
"0.57463646",
"0.57372504",
"0.57314163",
"0.5656794",
"0.5539435",
"0.54758626",
"0.53830963",
"0.53568125",
"0.5344502",
"0.5341234",
"0.52629197",
"0.5258413",
"0.52491224",
"0.5231562",
"0.5209... | 0.66473913 | 0 |
POST /api/ratings/ should create a rating | def test_post_rating(self):
rating_data = {
'user': self.user.pk,
'book': self.book.pk,
'rating': random.randint(1, 5)
}
self.client.post(self.list_url, data=rating_data)
self.book.refresh_from_db()
assert self.book.ratings.count() == 1
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_rating():\n\n id = request.args.get('id')\n\n rating = request.args.get('rating')\n\n record = mod.provide_rating(id, int(rating))\n\n return jsonify(record)",
"def post(self, request, *args, **kwargs):\n rating = request.data['rating']\n if rating < 0 or rating > 5:\n ... | [
"0.79232687",
"0.7525612",
"0.7338081",
"0.73155296",
"0.70679736",
"0.68852425",
"0.67558235",
"0.6716744",
"0.67073214",
"0.66902936",
"0.6522498",
"0.65145445",
"0.6314756",
"0.63020647",
"0.6266136",
"0.62592757",
"0.62469137",
"0.62248814",
"0.62016267",
"0.61911225",
"0... | 0.7135769 | 4 |
gets a value indicating that cross origin resource sharing is enabled. | def enabled(self):
return self._enabled | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def http_header_access_control_allow_origin():\n return 'Access-Control-Allow-Origin'",
"def get_access_control_allow_origin(self):\n return self.access_control_allow_origin",
"def access_control_allow_origin(self) -> str:\n if self._access_control_allow_origin is None:\n access... | [
"0.6648981",
"0.66390294",
"0.657958",
"0.6244583",
"0.59494656",
"0.5945031",
"0.58968073",
"0.58770764",
"0.58449167",
"0.57684845",
"0.5700655",
"0.5690261",
"0.5591824",
"0.5587052",
"0.5506835",
"0.5502143",
"0.5442767",
"0.54336244",
"0.5413615",
"0.53950435",
"0.538633... | 0.0 | -1 |
Computes area under semilog ROC for random distribution. | def random_roc_log_auc(log_min=..., log_max=...):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logAUC(points):\n\t# assumes we have previously interpolated to get y-value at x = 0.1% \n\t# generate new points array clamped between 0.1% and 100%\n\n\t# constants\n\t## if you modify also change in plots.py \n\tLOGAUC_MAX = 1.0 ## this should not change\n\tLOGAUC_MIN = 0.001 ## this you may want t... | [
"0.6498211",
"0.61465794",
"0.589327",
"0.58885807",
"0.57851547",
"0.56775576",
"0.5629351",
"0.56085825",
"0.5559155",
"0.55582905",
"0.5533559",
"0.5520297",
"0.55115086",
"0.54863244",
"0.5453192",
"0.5417759",
"0.5411874",
"0.53937155",
"0.5356336",
"0.535305",
"0.535092... | 0.6934566 | 0 |
Gets the dimensionality of a bonded structure. The dimensionality of the structure is the highest dimensionality of all structure components. This method is very robust and can handle many tricky structures, regardless of structure type or improper connections due to periodic boundary conditions. Requires a StructureGr... | def get_dimensionality_larsen(bonded_structure):
return max([c['dimensionality'] for c in
get_structure_components(bonded_structure)]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getDimensionality(self):\n dimensionality = self._distribution.returnDimensionality()\n return dimensionality",
"def get_dimensionality(self) -> int:\n return self.dimensionality",
"def _get_ndim(self):\n return len(self.level_shapes[0])",
"def get_dimensionality_gorai(structure, max_... | [
"0.6333886",
"0.6095515",
"0.6090437",
"0.5985313",
"0.5928324",
"0.5849952",
"0.58251673",
"0.58087116",
"0.5794508",
"0.5793405",
"0.5671947",
"0.5654971",
"0.56462026",
"0.5636846",
"0.56238556",
"0.5623584",
"0.5614457",
"0.5604083",
"0.55899423",
"0.55854464",
"0.5575418... | 0.77560365 | 0 |
Creates temporary database and applies migrations. Database can be used as template to fast creation databases for tests. Has "session" scope, so is called only once per tests run. | def migrated_postgres_template(pg_url):
with tmp_database(pg_url, 'template') as tmp_url:
alembic_config = alembic_config_from_url(tmp_url)
upgrade(alembic_config, 'head')
yield tmp_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def database_session_wide(app) -> SQLAlchemy:\n if os.path.exists(get_test_database_path()):\n os.unlink(get_test_database_path())\n\n from pipwatch_api.datastore.models import DATABASE\n DATABASE.init_app(app=app)\n DATABASE.create_all()\n yield DATABASE\n\n DATABASE.drop_all()\n DATAB... | [
"0.75633156",
"0.73563945",
"0.7038542",
"0.70277417",
"0.6954078",
"0.6898281",
"0.68796134",
"0.68426746",
"0.68334997",
"0.68254733",
"0.6803669",
"0.6763404",
"0.67625505",
"0.6750525",
"0.6743844",
"0.67382413",
"0.67382413",
"0.67382413",
"0.67319703",
"0.67148054",
"0.... | 0.0 | -1 |
Creates aiohttp application and client for it. | async def api_client(migrated_postgres, aiohttp_client):
app = create_app(migrated_postgres)
client = await aiohttp_client(app)
try:
yield client
finally:
await client.close() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cli(app, aiohttp_client):\n return asyncio.get_event_loop().run_until_complete(aiohttp_client(app.app))",
"def get_http_client() -> httpx.AsyncClient:\n app = basic_app.API()\n return httpx.AsyncClient(\n app=app,\n base_url='http://localhost'\n )",
"def create_app():\n app = F... | [
"0.73146266",
"0.7113234",
"0.66870934",
"0.66828114",
"0.6494592",
"0.6421812",
"0.6392582",
"0.63747454",
"0.63147813",
"0.62628835",
"0.6227376",
"0.6221562",
"0.6209936",
"0.61990863",
"0.6198364",
"0.6195666",
"0.6191246",
"0.6190973",
"0.6156727",
"0.6142221",
"0.609445... | 0.64733565 | 5 |
This is the update of bullet class | def update(self):
if self.control:
self.rect.centery += self.__dy
if self.rect.right > 1060:
self.rect.right = 1060
if self.rect.left < 20:
self.rect.left = 20
if self.rect.centery > 750:
self.kill() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _update_bullet(self):\n\n # update position of old bullets\n self.bullets.update()\n\n # Get rid of bullets that are off screen\n for bullet in self.bullets.copy():\n if bullet.rect.left >= self.screen_width:\n self.bullets.remove(bullet)\n\n # see i... | [
"0.77002984",
"0.7646449",
"0.7646449",
"0.7621552",
"0.755201",
"0.7450057",
"0.7450057",
"0.7450057",
"0.7442351",
"0.7418554",
"0.73915446",
"0.73815066",
"0.7376684",
"0.7305511",
"0.7302441",
"0.728887",
"0.72797567",
"0.7139614",
"0.7137689",
"0.7031175",
"0.70175064",
... | 0.0 | -1 |
This is the init of the zone class, it positions the zone | def __init__(self, y):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.Surface((1081, 17))
self.image = self.image.convert()
self.image.fill((255, 255, 255))
self.rect = self.image.get_rect()
self.rect.top = y
self.rect.left = -1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_middle_zone(self):\n self.middle_zone_rect = pg.rect.Rect(275, 0, 225, 60)\n self.middle_zone_image = pg.Surface(\n self.middle_zone_rect.size).convert()\n self.middle_zone_image.fill(pg.Color('#82A6CB'))\n self.middle_zone_bottom_rect = pg.rect.Rect(275, 50, 225, 10... | [
"0.67030376",
"0.6671042",
"0.6610417",
"0.6599532",
"0.6563545",
"0.6563176",
"0.65614915",
"0.65196323",
"0.6489817",
"0.64511096",
"0.6436302",
"0.6402672",
"0.6394371",
"0.63464606",
"0.6339301",
"0.63299775",
"0.63108236",
"0.6309381",
"0.63038576",
"0.62854075",
"0.6274... | 0.0 | -1 |
This is the init of the game menu class. It loads in an image and positions it at (540, 200) | def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load("./background stuff/space invader sign thing.png")
self.rect = self.image.get_rect()
self.rect.center = (540, 200) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, MENUWIDTH, MENUHEIGHT):\n \n self._menu_items = []\n self.menu_Text = []\n #Background\n self.menuRect = pygame.Rect((0, 0), (MENUWIDTH, MENUHEIGHT))",
"def __init__(self,ai_settings,screen):\n super().__init__()\n self.screen = screen\n ... | [
"0.73939896",
"0.73099697",
"0.7277008",
"0.7277008",
"0.7266537",
"0.7208695",
"0.71512425",
"0.7133994",
"0.7120225",
"0.71094316",
"0.7099301",
"0.7043745",
"0.7036262",
"0.70028025",
"0.6995329",
"0.69225997",
"0.6897826",
"0.68682796",
"0.6852055",
"0.68324697",
"0.68228... | 0.7305807 | 2 |
Return today's post_time as a fully qualified datetime. | def post_time_today(dt):
return dt.replace(hour=post_time.hour,
minute=post_time.minute,
second=0, microsecond=0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_date():\n return (datetime.now() - TIMEDELTA).isoformat()",
"def datetime(self):\n\n time = self.time()\n if time is None or time < 0 or time >= 24:\n time = 0\n\n try:\n d = datetime(self.year(), self.month(), self.day()) + timedelta(hours=time)\n ... | [
"0.6332554",
"0.62812936",
"0.6255645",
"0.6225347",
"0.61645013",
"0.61515343",
"0.6150678",
"0.61282516",
"0.6098745",
"0.60708714",
"0.6068737",
"0.6040034",
"0.6037104",
"0.59988356",
"0.5988908",
"0.59696925",
"0.5960391",
"0.5954927",
"0.5935534",
"0.59344435",
"0.59277... | 0.7531445 | 0 |
Save the user config | def set(key, value):
# TODO this should be implemented with a lock
config = _get_config_dict()
config[key] = value
_save_config_dict(config) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_config(self):\n if not os.path.exists(USER_CONFIG_PATH):\n os.makedirs(USER_CONFIG_PATH)\n\n # obtener el config actual\n config = self.get_config()\n\n # obtener el cliente\n client = self._args.get('client')\n\n # ciertos parametros no se tienen que s... | [
"0.80890536",
"0.773148",
"0.7598759",
"0.75020045",
"0.7497291",
"0.744761",
"0.7369341",
"0.72563285",
"0.7237286",
"0.72207326",
"0.721027",
"0.71662694",
"0.7161977",
"0.7158864",
"0.71194476",
"0.7101445",
"0.709706",
"0.70860463",
"0.7069613",
"0.7062766",
"0.70354116",... | 0.0 | -1 |
take 1D float array of rewards and compute discounted reward | def discount_rewards(self, r):
discounted_r = np.zeros_like(r)
running_add = 0
for t in reversed(range(0, r.size)):
if r[t] != 0:
running_add = 0 # Pong-specific
running_add = running_add * self.gamma + r[t]
discounted_r[t] = running_add
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def discount_rewards(rewards):\r\n discounted_r = np.zeros_like(rewards)\r\n running_add = 0\r\n for t in reversed(range(0, len(rewards))): \r\n running_add = running_add * reward_discount + rewards[t]\r\n discounted_r[t] = running_add\r\n return discounted_r",
"def discoun... | [
"0.8100923",
"0.78397125",
"0.7792625",
"0.7742053",
"0.7653779",
"0.75987715",
"0.7583268",
"0.75820553",
"0.7579539",
"0.7536054",
"0.7519005",
"0.75047183",
"0.7467692",
"0.7456702",
"0.7426565",
"0.74062765",
"0.73950297",
"0.7370545",
"0.73564714",
"0.7328519",
"0.720184... | 0.7433794 | 14 |
Compute a_n = (1 + a^1 + ... + a^{n1}) % mod using that a_{2n} = ((x_n + 1) a_n) % mod a_{2n+1} = (x^{2n} + a_{2n}) % mod | def modular_geometric_sum(x, n, mod):
if n == 1:
return 1 % mod
elif n % 2 == 0:
return ((pow(x, n // 2, mod) + 1) * modular_geometric_sum(x, n // 2, mod)) % mod
else:
return (pow(x, n - 1, mod) + modular_geometric_sum(x, n - 1, mod)) % mod | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modExp(a, b, n):\n c = 0\n d = 1\n for bi in bin(b)[2:]:\n c = 2 * c\n d = (d * d) % n\n if bi == '1':\n c += 1\n d = (d * a) % n\n return d",
"def exp_mod( a, b, n):\n r = int(1)\n while(b):\n if(b&1):\n r=(r*a)%n\n a=(a*a... | [
"0.7249057",
"0.700424",
"0.69201976",
"0.6912114",
"0.69120437",
"0.6876787",
"0.6867003",
"0.68205106",
"0.68068963",
"0.68028724",
"0.67995465",
"0.678503",
"0.6773424",
"0.6762343",
"0.6726102",
"0.6660713",
"0.66455764",
"0.66354746",
"0.66302586",
"0.6536498",
"0.649822... | 0.6293605 | 28 |
Render the home page | def index():
return render_template("index.html") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_home():\r\n\treturn render_template(\"index.html\")",
"def home():\n\n return render_template('home_page.html')",
"def home():\n\n return render_template(\"home.html\")",
"def home():\n return render_template(\"home.html\")",
"def home():\n return render_template(\"home.html\")",
"... | [
"0.88861233",
"0.8787603",
"0.86562115",
"0.86191314",
"0.86191314",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",
"0.8614767",... | 0.0 | -1 |
plot keras training history | def plot_history(history,*key,**kwargs):
logy = kwargs.pop('logy',False)
if all((isintance(k,string_types) for k in keys)):
w,keys =1,[keys]
else:
w= len(keys)
plt.gcf()
for i,group in enumerate(keys):
plt.subplot(1,w,i+1)
for k in ([group] if isinstance... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_training_history(self):\n hist = [i.history[\"loss\"][0] for i in self.history]\n plt.plot(hist)",
"def visualize_train_history(history):\n cat_acc = history.history['categorical_accuracy']\n val_cat_acc = history.history['val_categorical_accuracy']\n loss = history.history['loss'... | [
"0.7884695",
"0.76013833",
"0.75530976",
"0.7485741",
"0.74137115",
"0.7385006",
"0.7379989",
"0.73551935",
"0.73118675",
"0.7230781",
"0.7169477",
"0.7140726",
"0.7125415",
"0.70186555",
"0.7010064",
"0.6968789",
"0.6953782",
"0.690702",
"0.6886822",
"0.6882139",
"0.6873589"... | 0.59419054 | 94 |
This function calculates the clustering coefficient c_omega of all nodes in [df_list] | def clustering(df, mode):
# split into list of dfs containing only one reference node
df_list = [df.loc[i : i + 8 - 1, :] for i in range(0, len(df), 8)]
df_coefficient = pd.DataFrame()
# loop over every single node
for df_single in df_list:
df_single = df_single.reset_index()
total... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_cal(self):\n self.Cluster = []\n for i in range(self.nodenum):\n neighborhood_node = self.neighbor_node(i)\n Node_num = len(neighborhood_node)\n Count = self.neighbor_edge(neighborhood_node)\n if(Node_num == 0 or Node_num == 1):\n ... | [
"0.629901",
"0.60111684",
"0.579559",
"0.57712746",
"0.57674277",
"0.57304394",
"0.57157284",
"0.5714862",
"0.5695131",
"0.5553209",
"0.55413574",
"0.55384016",
"0.5531925",
"0.5503415",
"0.5493682",
"0.5430072",
"0.5425206",
"0.5420474",
"0.5419919",
"0.5398611",
"0.5388555"... | 0.6816966 | 0 |
Validates whether the given string is a URL or not. | def validate_url(attribute_name, url):
if not url:
return
try:
result = urlparse(url=url)
if [result.scheme, result.netloc, result.path]:
return True
except:
raise ValueError('{attribute_name}: The given string {url} is not a '
'valid url... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_url(string):\n try:\n urlparse(string)\n return True\n except:\n return False",
"def _is_url(string):\n return \"http\" in string",
"def check_url(value):\n\n valid = validators.url(value)\n if valid != True:\n return False",
"def check_url(value):\n\n val... | [
"0.8366442",
"0.8335756",
"0.80749184",
"0.80495435",
"0.79648",
"0.7817309",
"0.77373827",
"0.7731292",
"0.7729939",
"0.76788574",
"0.7666101",
"0.76553607",
"0.76469076",
"0.7640986",
"0.761386",
"0.7610878",
"0.7607057",
"0.76011676",
"0.7588066",
"0.75879973",
"0.75668424... | 0.79399407 | 5 |
Returns the PTB Variable name to MaskGAN Variable dictionary mapping. | def dis_encoder_seq2seq(hparams):
assert FLAGS.discriminator_model == 'seq2seq_vd'
assert hparams.dis_num_layers == 2
## Encoder forward variables.
encoder_lstm_w_0 = [
v for v in tf.trainable_variables() if v.op.name ==
'dis/encoder/rnn/multi_rnn_cell/cell_0/basic_lstm_cell/kernel'
][0]
encode... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMaskVariableNames(self, product):\r\n\r\n h = product.getSceneRasterHeight()\r\n\r\n # 10m resolution\r\n if h == 10980:\r\n return self.return_available_variables(product, MASK_VARIABLE_NAMES_10m)\r\n\r\n # 20m resolution\r\n elif h == 5490:\r\n retu... | [
"0.61389023",
"0.57913154",
"0.5763236",
"0.57536155",
"0.5693242",
"0.5644826",
"0.5634559",
"0.5619496",
"0.5611912",
"0.5581783",
"0.5581783",
"0.5581783",
"0.5576989",
"0.5570125",
"0.5567037",
"0.55311596",
"0.55183023",
"0.55123144",
"0.54950464",
"0.549156",
"0.5478017... | 0.0 | -1 |
add a larger point | def addFid(data, Dim=.5, nodName="N", lableName="1", color="red", GlyphType=1):
xyz = tuple(data)
tipFiducial = slicer.mrmlScene.AddNode(slicer.vtkMRMLMarkupsFiducialNode())
tipFiducial.SetName(nodName)
tipFiducial.AddFiducial(xyz[0], xyz[1], xyz[2])
tipFiducial.SetNthFiducialLabel(0, lableName)
slicer.mrml... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def point_add(self, a, b):\n\n if a.at_inf and b.at_inf: return point.inf()\n if a.at_inf: return b.dup()\n if b.at_inf: return a.dup()\n if a == b: return self.point_double(a)\n if a.x == b.x and a.y == -b.y: return point.inf()\n\n x1, y1, x2, y2 = modp(self.p, a.x, a.y, ... | [
"0.75514096",
"0.7545744",
"0.7284572",
"0.7261382",
"0.7248941",
"0.71872526",
"0.689278",
"0.68775016",
"0.6868018",
"0.6836199",
"0.6833244",
"0.68127966",
"0.6810513",
"0.67124474",
"0.6647033",
"0.66391486",
"0.6636049",
"0.6629765",
"0.6618565",
"0.6590834",
"0.6582825"... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.