query stringlengths 9 9.05k | document stringlengths 10 222k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Add services Add the services that we're testing, where manila plugin is a subordinate to the manila charm, and is deployed locally, whereas the rest of the services are from lp branches that are compatible with the local charm (e.g. stable or next). | def _add_services(self):
this_service = {'name': '{{ metadata.package }}'}
other_services = [
{'name': 'mysql',
'location': 'cs:percona-cluster',
'constraints': {'mem': '3072M'}},
{'name': 'rabbitmq-server'},
{'name': 'keystone'},
... | [
"def _add_services(self):\n this_service = {\n 'name': 'odl-controller',\n 'constraints': {'mem': '8G'},\n }\n other_services = [\n {'name': 'percona-cluster', 'constraints': {'mem': '3072M'}},\n {'name': 'rabbitmq-server'},\n {'name': 'key... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configure all of the services. | def _configure_services(self):
keystone_config = {
'admin-password': 'openstack',
'admin-token': 'ubuntutesting',
}
manila_config = {
'default-share-backend': 'generic',
}
manila_generic_config = {
'driver-handles-share-servers': Fa... | [
"def _configure_services(self):\n keystone_config = {\n 'admin-password': 'openstack',\n 'admin-token': 'ubuntutesting'\n }\n swift_proxy_config = {\n 'zone-assignment': 'manual',\n 'replicas': '1',\n 'swift-hash': 'fdfef9d4-8b06-11e2-8ac0-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Yield the bonds in the batch. | def get_bonds(self) -> Iterable[Bond]:
yield from self._bonds | [
"def get_bonds(self) -> typing.Iterator[Bond]:\n\n for bond in self._bonds:\n yield bond",
"def get_bonds(self):\n\n yield from self._molecule_state.get_bonds()",
"def _iterBonds(self):\n\n ag = self._ag\n if ag._bmap is None:\n raise ValueError('bonds are not s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Yield info about the bonds in the batch. | def get_bond_infos(self) -> Iterable[BondInfo]:
yield from self._bond_infos | [
"def get_bonds(self):\n\n yield from self._molecule_state.get_bonds()",
"def get_bonds(self) -> Iterable[Bond]:\n\n yield from self._bonds",
"def get_bond_infos(self):\n\n yield from self._molecule_state.get_bond_infos()",
"def _iterBonds(self):\n\n ag = self._ag\n if ag._bm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get instance centroids given an input instance map. | def get_inst_centroid(inst_map):
inst_centroid_list = []
inst_id_list = list(np.unique(inst_map))
for inst_id in inst_id_list[1:]: # avoid 0 i.e background
mask = np.array(inst_map == inst_id, np.uint8)
inst_moment = cv2.moments(mask)
inst_centroid = [
(inst_moment["m10"... | [
"def get_centroids(self) -> Dict[str, np.ndarray]:\n assert self._centroids != {}\n return self._centroids",
"def _compute_centroids(self):\n\n for i in range(0, self.k):\n cluster = np.argwhere(self.assigned_clusters == i)\n cluster_points = self.data[cluster].squeeze()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove connected components smaller than the specified size. This function is taken from skimage.morphology.remove_small_objects, but the warning is removed when a single label is provided. | def remove_small_objects(pred, min_size=64, connectivity=1):
out = pred
if min_size == 0: # shortcut for efficiency
return out
if out.dtype == bool:
selem = ndimage.generate_binary_structure(pred.ndim, connectivity)
ccs = np.zeros_like(pred, dtype=np.int32)
ndimage.label(p... | [
"def remove_small_3d(labels,min_size = 500):\n # Generate statistics on detected objects and filter them\n stats = region_statistics(labels)\n labels2remove = stats[stats['num_pixel'] < min_size]['label']\n \n for l in labels2remove.tolist():\n labels[ labels == l] = 0\n \n return label... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the credentials in the fabric env. | def _set_credentials():
# Override credentials here if necessary
if env.user == 'ubuntu':
env.key_filename = [
os.path.expanduser('~/.ssh/ubuntu-id_dsa')]
env.abort_on_prompts = True
env.disable_known_hosts = True
env.use_shell = False | [
"def SetCredentials(self, password=None, username=None):\n self.password = password\n self.username = username",
"def expose_credentials(self, credentials):\n self.set_remote(**credentials)",
"def credentials(self, credentials):\n\n self._credentials = credentials",
"def SetCredentials(sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deploy the api package | def deploy_api(dist_file, apt_req_file):
_set_credentials()
provision()
_deploy_apt_requirements(apt_req_file)
_deploy_python_package(dist_file)
_sighup_api()
_verify_api_heartbeat()
send_build_stat(PROJECT_NAME, env.stage) | [
"def deploy():\n build()\n collect()\n commit()\n push()",
"def deploy():\n require('root', provided_by=('staging', 'production'))\n with cd(env.code_root):\n run('git pull')\n run('git checkout %(code_branch)s' % env)\n update_requirements()\n make_html()",
"def deploy():\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the host /heartbeat and aborts on failure. Only a status of 200 returned by the heartbeat is considered a success. If the heartbeat fails and `retry` is ``True``, the heartbeat will be tried again after a sleep of 2 seconds. If the heartbeat fails and `retry` is ``False``, the task is aborted. | def _verify_api_heartbeat(retry=True):
url = 'http://{0}/heartbeat'.format(env.host_string)
try:
resp = urllib2.urlopen(url)
status_code = resp.getcode()
except urllib2.HTTPError as error:
print '[{0}] Error while testing API: {1}'.format(env.host_string,
... | [
"def heartbeat() -> None:\n\n response = request('/heartbeat')\n if not response['result']:\n raise Exception('Heartbeat request failed!')",
"def test_heartbeat_failed_fast(self):\n self.mock_base_job_sleep.side_effect = time.sleep\n dag_id = \"test_heartbeat_failed_fast\"\n task... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deploy the worker package | def deploy_worker(dist_file):
_set_credentials()
provision()
_deploy_python_package(dist_file)
_reload_supervisor() | [
"def deploy():\n build()\n collect()\n commit()\n push()",
"def deploy():\n upload_static()\n compile_code()\n upload_code()\n upload_supervisor()\n start_server()",
"def run_deploy(self):\n self.event_loop.run_until_complete(self.deploy())",
"def deploy():\n execute(sync)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provision the node with Chef | def provision():
sudo('chef-client') | [
"def _provision_node(self, conn, node_cfg):\n # NOTE, general prepare for a node\n conn.run(f\"mkdir -p {EXPORTER_HOME}\")\n # docker, docker-compose\n conn.run(\"docker --help\")\n conn.run(\"docker-compose --help\")\n\n hostaddr = node_cfg.get(\"hostaddr\")\n usern... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send a metric to graphite that indicates a succesful build | def send_build_stat(project_name, environment):
timestamp = int(time.time())
# In graphite we can draw a non-zero value as an vertical asymptote
# The packet looks like: <metric> <value> <unix_timestamp>
metric = 'applications.{0}.build 1 {1}\n'.format(project_name, timestamp)
port = 2003
for ... | [
"def send_metric(model_id, metric, value):\n host, port, namespace = get_metric_endpoint()\n\n metric_name = '%s.%s' % (namespace, get_metric_name(metric, model_id))\n message = \"%s %f %d\\n\" % (metric_name, float(value), int(time.time()))\n send_tcp(host, port, message)\n\n build_no = get_build_nu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
each model instance has an individual port which has limited bandwidth. This bandwidth is calcuated as $MODEL_USER_BANDWIDHT $user_num_per_ins | def change_bandwidth(self,edge_notice):
#print("==============带宽控制=============",edge_notice)
ports_details = edge_notice["port_details"]
total_bd = edge_notice["bandwidth"]["mobilenet"]
self.reset_bandwidth()
print("########",total_bd)
#print("model_details+++++++++",mo... | [
"def bandwidth_limit_mb(self, bandwidth_limit_mb):\n self._bandwidth_limit_mb = bandwidth_limit_mb",
"def limit():\n bwc = BandwidthConfigurator()\n bwc.limit()",
"def limit_bandwidth(self):\n return self._limit_bandwidth",
"def bandwidth_limit_mb(self):\n return self._bandwidth_lim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ode_function_call(filename_coupling, filename_vib, amplitude, omega, cycles,extra_time) Constructor. | def __init__(self, filename_coupling, filename_vib,
amplitude, omega, cycles, extra_time):
#Laser info.
self.amplitude = amplitude
self.omega = omega
self.cycles = cycles
self.pulse_duration = 2 * pi /(self.omega) * self.cycles
self.total_duration = self.pulse_duration + extra_time
#Retrieve coupling inform... | [
"def callback(self):\n logger.debug( \"beginning dlic-evap callback\") \n if not self.initialised:\n return \"%s not initialised with init function. Cannot be called back until initialised. Doing nothing\" % self.hardwareActionName\n try:\n self.finalVariables = sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
dp_dt = dpsi_dt(psi, t) Method that serves as input to the odeint() function. Calculates dpsi/dt = i S1 H(t) psi. | def dpsi_dt(self, psi, t):
# #To avoid doing anything twice. (odeint tends to do that.)
# #---------------------------------------------------------
# novel, result = self.check_novelty(t,psi)
# if not novel:
# if self.my_id == 0:
# print "Time: %2.2f / %2.2f au. Runtime: %2.2f---"%(
# t, self.total_duration,... | [
"def dynstall_oye_dxdt(t,fs,u,p):\n alpha = u['alpha'](t)\n f_st = p['F_st'](alpha)\n return 1/p['tau'] * (f_st - fs)",
"def dif(t=None, h=None, x=None, dxdt=None, d2 = None):\r\n return d2 - (dxdt)**2 + x + 5",
"def __call__(self, x, t):\n x = validate_input(x, t=t)\n\n if isinst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
psi_final = mat_vec_product(psi, t) Does the matrix vector multiplication with the Hamiltonian. | def mat_vec_product(self, psi, t):
x = zeros(self.vib_basis_size * len(self.my_tasks), dtype = complex)
#Matrix vector product.
for i, j in enumerate(self.my_tasks):
slice_x = slice(i * self.vib_basis_size, (i + 1) * self.vib_basis_size)
slice_psi = slice(j * self.vib_basis_size, (j + 1) * self.vib_basis_... | [
"def test_multiply_tensor_hamiltonian(self):\n H = qml.PauliX(0) + qml.PauliY(0)\n t = qml.PauliZ(1) @ qml.PauliZ(2)\n out = t @ H\n\n expected = qml.Hamiltonian(\n [1, 1],\n [\n qml.PauliZ(1) @ qml.PauliZ(2) @ qml.PauliX(0),\n qml.Paul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
field_strength = time_function(t) Returns the electrical field strength at the time . Assumes an electrical field on the form E(t) = sin2(pi t / T) cos(omega t) | def time_function(self, t):
if type(t) == float:
if t > self.pulse_duration:
field_strength = 0.0
else:
field_strength = (self.amplitude *
sin(pi * t / self.pulse_duration)**2 *
cos(self.omega * t))
else:
field_strength = zeros(shape(t))
for i, time in enumerate(t):
if time >... | [
"def power_flux_to_field_strength(power: float) -> float:\n\n field_strength = (2 * power) / (speed_of_light * epsilon_0)\n field_strength = np.sqrt(field_strength)\n\n return field_strength",
"def field_strength_close_enough(field_strength, desired_value):\n\n if field_strength > 100: # assume it is... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hamilton_slice = retrieve_hamiltonian(file_handle) Retrieves this processors share of the hamiltonian. This is not entirely trivial, since only half the hamiltonian is stored. | def retrieve_hamiltonian(self, file_handle):
#WHEN THE ENTIRE MATRIX IS STORED.
hamilton_slice = file_handle.root.couplings[
self.my_tasks[0] * self.vib_basis_size:
(self.my_tasks[-1] + 1) * self.vib_basis_size, :]
# WHEN ONLY HALF THE MATRIX IS STORED:
# hamilton_slice = zeros([len(self.my_tasks) * sel... | [
"def read_hamiltonian(filename):\n lin = open(filename,\"r\").readlines()\n norb = int(lin[1])\n print \"Reading a hamiltonian of dimension \"+str(norb)\n import numpy as np\n onsite = np.matrix(np.zeros((norb,norb),dtype=np.complex))\n hopping = np.matrix(np.zeros((norb,norb),dtype=np.complex))\n nv = int(l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Propagation time = distance / speed of light | def get_propagation_time(self):
return 0.0 # self.get_distance_to_gateway() / (3 * pow(10,8)) | [
"def compute_propagation_delay(self):\n d = self.distance / 2e8\n return d",
"def ComputeLightTravelTime(Det1Pos, Det2Pos):\n\n # Get relative position vector\n Det21Pos = Det2Pos - Det1Pos\n \n # Dot difference vector into itself to get magnitude of detector separation\n dist = np.sq... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows the banner of Halive | def show_banner():
print("""
_ _ _ _ _____ _______
| | | | / \ | | |_ _\ \ / / ____|
| |_| | / _ \ | | | | \ \ / /| _|
| _ |/ ___ \| |___ | | \ V / | |___
|_| |_/_/ \_\_____|___| \_/ |_____|
A super fast asynchronous http and https prober, to check who is (h)alive.
Developed by g... | [
"def _show_welcome_banner() -> None:\r\n print(\"Welcome to the connectfour client!\")\r\n print()\r\n print(\"Please play game with your username.\")\r\n print()",
"def banner(*args):\n return _ida_kernwin.banner(*args)",
"def show_banner():\n from x84.bbs import showart, echo, getterminal\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function takes as input the list of files containing the hostnames and normalizes the format of the hostnames in order to be able to perform valid HTTP/HTTPS requests. | def get_urls(inputfiles):
urls = []
scheme_rgx = re.compile(r'^https?://')
for ifile in inputfiles:
urls.append(ifile.read().splitlines())
urls = set([n for l in urls for n in l])
urls = list(filter(None, urls))
for i in range(len(urls)):
if not scheme_rgx.match(urls[i]):
... | [
"async def resolve_hostnames(self, hostnames):\n hostnames = list(set(hostnames))\n verrors = ValidationErrors()\n\n results = await asyncio.gather(*[self._resolve_hostname(host) for host in hostnames])\n\n ips = []\n for host, result in zip(hostnames, results):\n if no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plots outputs, inputs and biases vs time for a closed loop simulation from a steady state to a set point | def plot():
ts, ys, lin_model, K, us, dt_control, biass, end_time = simulate()
matplotlib.rcParams.update({'font.size': 18})
fig, axes = plt.subplots(
1, 3,
figsize=(6.25 * 3, 5),
gridspec_kw={'wspace': 0.3}
)
ax = axes[0]
ax.plot(ts, us[:, lin_model.inputs[1]], 'k')
... | [
"def visualize_model_state(self, show=False):\n\n self.update_state_variables() \n\n # Plot in kilometers\n h = 1e-3\n (qMax, c) = (np.max(np.abs(self.q)), 0.8)\n (cmin, cmax) = (-c*qMax, c*qMax)\n\n fig, axArr = plt.subplots(ncols=2, figsize=(8, 4), sharex=True, sharey=Tru... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LCP 1. 猜数字 小A 和 小B 在玩猜数字。小B 每次从 1, 2, 3 中随机选择一个,小A 每次也从 1, 2, 3 中选择一个猜。他们一共进行三次这个游戏,请返回 小A 猜对了几次? 输入的guess数组为 小A 每次的猜测,answer数组为 小B 每次的选择。guess和answer的长度都等于3。 示例 1: 输入:guess = [1,2,3], answer = [1,2,3] 输出:3 解释:小A 每次都猜对了。 示例 2: 输入:guess = [2,2,3], answer = [3,2,1] 输出:1 解释:小A 只猜对了第二次。 限制: guess的长度 = 3 answer的长度 = 3 guess... | def game(guess, answer):
return 3 - len([i for i in range(3) if answer[i]^guess[i]]) | [
"def guessing(guess, count):",
"def comp_guess():\r\n # flag for correct answer\r\n wrong_answer = True\r\n\r\n # range for guesses\r\n high = 100\r\n low = 0\r\n # guess average/middle of search space\r\n guess = (high + low) / 2\r\n answer = random.randrange(low, high)\r\n\r\n #print ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LCP 2. 分式化简 有一个同学在学习分式。他需要将一个连分数化成最简分数,你能帮助他吗? a0 + 1/(a1 + (1/(a2 + 1/.... 连分数是形如上图的分式。在本题中,所有系数都是大于等于0的整数。 输入的cont代表连分数的系数(cont[0]代表上图的a0,以此类推)。返回一个长度为2的数组[n, m],使得连分数的值等于n / m,且n, m最大公约数为1。 示例 1: 输入:cont = [3, 2, 0, 2] 输出:[13, 4] 解释:原连分数等价于3 + (1 / (2 + (1 / (0 + 1 / 2))))。注意[26, 8], [13, 4]都不是正确答案。 示例 2: 输入:cont = ... | def fraction(cont):
n = len(cont)
ans = [0, 1]
for ri in range(n):
i = n - 1 - ri
ans = [ans[1], ans[1] * cont[i] + ans[0]]
return ans[::-1] | [
"def rat2cont_quot(x, y):\n\tcont = []\n\twhile y != 0:\n\t\tcont.append(x // y)\n\t\tx, y = y, x % y\n\treturn cont",
"def cont2frac(cont):\n\tif cont == [0]:\n\t\treturn None\n\tfrac = Fraction(0, 1)\n\tfor p in cont[::-1]:\n\t\tfrac = 1 / (frac + p)\n\treturn 1 / frac",
"def cont_frac(x : int, y : int) -> in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generator that yields available layers for registered models. | def get_available_layers(self, path):
now = datetime.now()
for model in self.models:
query = model.objects
query = query.filter(
Q(available_start__isnull=True) | Q(available_start__lte=now))
query = query.filter(
Q(available_stop__isn... | [
"def get_all_layers(model):\n layers = []\n for l in model.layers:\n if hasattr(l, 'layers'):\n layers += get_all_layers(l)\n else:\n layers.append(l)\n return layers",
"def layers(self):\r\n\r\n\t\tif self.numlayerdims == 0:\r\n\t\t\tyield 0\r\n\t\telse:\r\n\t\t\tfor ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that the signup view function can be resolved correctly by Django. | def test_signup_url_resolves_signup_view(self):
view = resolve('/signup/')
self.assertEquals(view.func, signup) | [
"def test_signup_url_resolves_signup_view(self):\r\n\t\tview = resolve('/signup/')\r\n\t\tself.assertEquals(view.func, signup)",
"def test_v1signup(self):\n pass",
"def test_user_sign_up_success(self):\n res = self.client.post(reverse('sign_up'), data={\n 'username': 'test@gmail.com',\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that the user is redirected to the home page. | def test_redirection(self):
self.assertRedirects(self.response, self.home_url) | [
"def test_home(self):\n\t\tresponse = self.client.get('/')\n\t\tself.assertContains(response, 'Home Page', 1, 200)",
"def test_tenant_home(self):\n tenant_home_url = reverse('tenant_home')\n response = self.client.get(tenant_home_url)\n\n # Should redirect to roommate_form\n self.asser... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that a user object has been created. | def test_user_creation(self):
self.assertTrue(User.objects.exists()) | [
"def test_create_user(self) -> None:\n\n u1 = self.register_user(\"u1\", \"pass\")\n\n u1stats = self._get_current_stats(\"user\", u1)\n\n assert u1stats is not None\n\n # not in any rooms by default\n self.assertEqual(u1stats[\"joined_rooms\"], 0)",
"def test_createUser_single(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that the system has detected that a user has been authenticated. | def test_user_authentication(self):
response = self.client.get(self.home_url)
user = response.context.get('user')
self.assertTrue(user.is_authenticated) | [
"def is_user_authenticated(self):\n pass",
"def assertUserAuthed(self, response):\n self.assertTrue(response.context[\"user\"].is_authenticated())",
"def test_user_can_login(self):\n user = authenticate(username='Marry', password='secret')\n self.assertFalse(user is None)\n se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up for the test cases. Submits an invalid signup case. | def setUp(self):
url = reverse('signup')
self.response = self.client.post(url, {}) # submit an empty dictionary | [
"def test_case2(self):\n\n valid_email = \"test2@email.com\"\n valid_password = \"asdasdasd\"\n valid_firstname = \"name1\"\n valid_familyname = \"name2\"\n valid_gender = \"Female\"\n valid_city = \"Testcity\"\n valid_country = \"Testcountry\"\n\n # Valid sig... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that a user has not been created. | def test_dont_create_user(self):
self.assertFalse(User.objects.exists()) | [
"def check_user_is_not_created(self):\n with self.assertRaises(User.DoesNotExist):\n User.objects.get(id=MOCK_USER_ID_1)\n with self.assertRaises(User.DoesNotExist):\n User.objects.get(id=MOCK_USER_ID_2)\n with self.assertRaises(User.DoesNotExist):\n User.object... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read metainfo. Only used for internal operations. | def readMetaInfo(self):
data = self._fileSystem.readMetaInfo()
return data | [
"def read_metadata(metapath):\r\n with open(metapath) as metaFile:\r\n metadata = {}\r\n for line in metaFile.readlines():\r\n if \"=\" in line: # Get only key-value pairs\r\n l = line.split(\"=\")\r\n metadata[l[0].strip()] = l[1].strip()\r\n\r\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read groups. Returns a dict. | def readGroups(self):
groups = self._fileSystem.readGroups()
if groups is None:
return
return groups | [
"def read_group():\n groups = list()\n with open(current_app.config[\"GROUP_PATH\"]) as group_file:\n for line in group_file:\n (name, _, gid, members) = [e.strip() for e in line.split(\":\")]\n if members:\n members = members.split(\",\")\n else:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read fontinfo. It requires an object that allows setting attributes with names that follow the fontinfo version 3 specification. This will write the attributes defined in the file into the object. | def readInfo(self, info):
infoDict = self._fileSystem.readFontInfo()
if infoDict is None:
return
for attr, value in infoDict.items():
setattr(info, attr, value) | [
"def read(self, f, endian='='):\n\n self.info = SPackedFontInfo()\n self.info.read( f, endian )\n\n len_chars, len_kernings = ReadFormat(f, endian + 'HH')\n\n pointeroffset_chars, pointeroffset_chars_glyphs, pointeroffset_kerning_chars, pointeroffset_kerning_values = ReadFormat(f, endian... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read kerning. Returns a dict. | def readKerning(self):
data = self._fileSystem.readKerning()
if data is None:
return
kerning = {}
for side1 in data:
for side2 in data[side1]:
value = data[side1][side2]
kerning[side1, side2] = value
return kerning | [
"def _parse_kern_pairs(fh):\n\n line = next(fh)\n if not line.startswith(b'StartKernPairs'):\n raise RuntimeError('Bad start of kern pairs data: %s' % line)\n\n d = {}\n for line in fh:\n line = line.rstrip()\n if not line:\n continue\n if line.startswith(b'EndKern... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read lib. Returns a dict. | def readLib(self):
data = self._fileSystem.readLib()
if data is None:
return
return data | [
"def _load_pemicro_lib_info(dll_path: str, lib_name: str) -> dict:\n try:\n lib_info = {}\n lib_info[\"path\"] = dll_path\n lib_info[\"name\"] = lib_name\n dll = cdll.LoadLibrary(os.path.join(dll_path, lib_name))\n\n # char * version(void);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read features. Returns a string. | def readFeatures(self):
return self._fileSystem.readFeatures() | [
"def get_features():\n # TODO: a copy of this method is in run_tclassify, consolidate\n script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))\n features_file = os.path.join(script_dir, \"features\", \"all.features\")\n content = open(features_file).read().strip()\n return content.split()",
"de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the ordered layer names. | def getLayerNames(self):
return self._fileSystem.getLayerNames() | [
"def layer_names(self):\n return list(self.layer_type_dict.keys())",
"def feature_layer_names(self):\n return self._feature_layer_names",
"def layer_names(request):\n if 'layers' in request.GET.keys():\n return get_layer_list(request.GET['layers'])\n else:\n return DATA_LAYERS.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the default layer name. | def getDefaultLayerName(self):
return self._fileSystem.getDefaultLayerName() | [
"def _get_layer_name(self):\n return self.__layer_name",
"def layer_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"layer_name\")",
"def get_layer_name(self, layer):\n return self.name + str(layer)",
"def layer_name(self) -> pulumi.Input[str]:\n return pulumi.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a list of glyph names. | def getGlyphNames(self, layerName):
return self._fileSystem.getGlyphNames(layerName) | [
"def get_glyphs(self):\n ll = self.font.glyphs()\n return sorted(map(lambda x: (x.unicode, x.glyphname), ll))",
"def listFontGlyphNames(self):\n from fontTools.ttLib import TTFont, TTLibError\n\n path = self.fontFilePath()\n if path is None:\n return []\n # loa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read a glyph from a layer. | def readGlyph(self, layerName, glyphName, glyphObject):
tree = self._fileSystem.getGlyphTree(layerName, glyphName)
readGlyphFromTree(tree, glyphObject, glyphObject) | [
"def get_glyph(lib, letter, layer=0):\n if not isinstance(letter, str) and len(letter) == 1:\n raise TypeError(f\"Letter must be a string of length 1. Got: ({letter}).\")\n\n if getattr(get_glyph, \"cache\", None) is None or get_glyph.doc is not lib:\n get_glyph.cache = {}\n get_glyph.doc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setup the Rotel platform, and the related transport Ask for async link as soon as transport is ready | def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
_LOGGER.debug('ROTEL : starting')
rotel = RotelDevice(config.get(CONF_NAME), config.get(CONF_HOST), config.get(CONF_PORT), hass.loop)
async_add_devices([rotel])
coro = hass.loop.create_connection(RotelProtocol, config.get(C... | [
"async def setup(self):\n load_base_templates()\n uris = URI.gather()\n for uri, resource in uris.items():\n methods = resource.methods\n if \"get\" not in methods:\n methods[\"get\"] = None\n\n for method in methods.keys():\n self.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function splits a text into paragraphs. It assumes paragraphs are separated by two line breaks. | def split_text_into_paragraphs(text: str) -> List[str]:
text_aux = text.strip()
paragraphs = text_aux.split('\n\n') # Strip any leading whitespaces
for p in paragraphs:
p = p.strip()
return [p.strip() for p in paragraphs if len(p) > 0] # Don't count empty paragraphs | [
"def split_into_paragraphs(input_text):\n return input_text.split('\\n')",
"def get_paragraphs(text):\n return [LINE_START.sub(' ', p) for p in PARAGRAPH_SEP.split(text)]",
"def paragraphify(text: str) -> str:\n text = text and text.replace('\\r', '').strip('\\n')\n\n if not text:\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
r"""Load dataset. This function loads graphstructured data from dgl's buildin spam review dataset and baidu's largescale website antifraud dataset. The implementation here is redundant and unnecessary, and can be handled directly using dgl's heterogeneous graph. Currently, each image is processed separately to be compa... | def load_graphs(dataset_name='amazon', raw_dir='~/.dgl/', train_size=0.4, val_size=0.1,
seed=717, norm=True, force_reload=False, verbose=True) -> dict:
if dataset_name in ['amazon', 'yelp', 'mimic']:
fraud_data = fraud_dataset.FraudDataset(dataset_name, train_size=train_size, val_size=val_si... | [
"def load_dataset(device, args):\n \n # dataset = DglNodePropPredDataset(name=args.dataset, root=args.root)\n # splitted_idx = dataset.get_idx_split()\n # train_nid = splitted_idx[\"train\"]\n # val_nid = splitted_idx[\"valid\"]\n # test_nid = splitted_idx[\"test\"]\n # g, labels = dataset[0]\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loading a subset of features for each relation as a batch. | def load_batch(batch, feat_list, device='cpu'):
batch_feat_list = []
for hop_feat_list in feat_list:
batch_feats = [feat[batch] for feat in hop_feat_list]
batch_feat_list.append(batch_feats)
batch_feat_list = [torch.stack(feat) for feat in batch_feat_list]
batch_feats = torch.cat(batch_... | [
"def _get_features_in_batches(self, clip_loader, feature_adapter_params, ops_counter=None, context=False): \n features = []\n self._set_model_state(context)\n for batch_clips in clip_loader:\n batch_clips = batch_clips.to(self.device, non_blocking=True)\n t1 = time.time()\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Split positive and negtive nodes in array nids . 大规模性能太差需要改进 | def _pos_neg_split(nids, labels):
# nids = nids.cpu().tolist()
pos_nids = []
neg_nids = []
for nid in nids:
if labels[nid] == 1:
pos_nids.append(nid.item())
else:
neg_nids.append(nid.item())
# torch.int64
pos_nids = torch.tensor(pos_nids)
neg_nids = to... | [
"def pos_neg_split(nids, labels):\n pos_idx = torch.where(labels == 1)[0]\n neg_idx = torch.where(labels == 0)[0]\n\n # 特殊判断孤立点的情况\n pos_nids = nids[pos_idx] if min(pos_idx.shape) != 0 else torch.LongTensor([])\n neg_nids = nids[neg_idx] if min(neg_idx.shape) != 0 else torch.LongTensor([])\n\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
r"""Split positive and negtive nodes in array nids . | def pos_neg_split(nids, labels):
pos_idx = torch.where(labels == 1)[0]
neg_idx = torch.where(labels == 0)[0]
# 特殊判断孤立点的情况
pos_nids = nids[pos_idx] if min(pos_idx.shape) != 0 else torch.LongTensor([])
neg_nids = nids[neg_idx] if min(neg_idx.shape) != 0 else torch.LongTensor([])
return pos_nids,... | [
"def _pos_neg_split(nids, labels):\n # nids = nids.cpu().tolist()\n pos_nids = []\n neg_nids = []\n for nid in nids:\n if labels[nid] == 1:\n pos_nids.append(nid.item())\n else:\n neg_nids.append(nid.item())\n # torch.int64\n pos_nids = torch.tensor(pos_nids)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Undersample the negative nodes based on scale. | def under_sample(pos_nids, neg_nids, scale=1):
index = np.arange(neg_nids.shape[0])
index = np.random.RandomState().permutation(index)
N = min(int(pos_nids.shape[0] * scale), neg_nids.shape[0])
index = index[0: N]
neg_sampled = neg_nids[index]
sampled_nids = torch.cat((pos_nids, neg_sampled))
... | [
"def undersample(X, y, tp): \n if tp < np.mean(y):\n return X, y\n neg_count, pos_count, X_pos, X_neg, y_pos, y_neg = div_count_pos_neg(X, y)\n neg_sample_rate = (pos_count*(1 - tp)) / (neg_count * tp)\n np.random.seed(3)\n neg_keepers = np.random.choice(a=[False, True], size=neg_count, \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
implements Listing 1.5. MATLAB Function "power_aperture.m" % This program implements Eq. (1.67) | def fn_power_aperture(snr,tsc,rcs,rho,te,nf,loss,az_angle,el_angle):
Tsc = RB.fn_Power_to_dB(tsc); # convert Tsc into dB
Sigma = RB.fn_Power_to_dB(rcs);# convert sigma to dB
four_pi = RB.fn_Power_to_dB(4.0 * math.pi); # (4pi) in dB
k_B = RC.boltzmann_constant;
k_db = RB.fn_Power_to_dB(k_B); # B... | [
"def power_list():",
"def get_power(frames, num_fft):\n #a = get_magnitude(frames, num_fft)\n #b = np.square(a)\n #print('max : ', np.max(a))\n #print('min : ', np.min(a))\n #print('sq max : ', np.max(b))\n #print('sq min : ', np.min(b))\n #print(a.shape)\n #print(b.shape)\n #return b/n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turn seed into np.random.RandomState instance | def seed_random_state(seed):
if (seed is None) or (isinstance(seed, int)):
return np.random.RandomState(seed)
elif isinstance(seed, np.random.RandomState):
return seed
raise ValueError("%r can not be used to generate numpy.random.RandomState"
" instance" % seed) | [
"def _RandomState(seed, level=1):\n if seed is None:\n return np.random.RandomState()\n else:\n return np.random.RandomState((seed, level))",
"def seed_rng(self, seed):\n # TODO: Adapt this to your algo\n self.rng = numpy.random.RandomState(seed)",
"def random_seed(seed):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the cost with given cost matrix | def calc_cost(y, yhat, cost_matrix):
return np.mean(cost_matrix[list(y), list(yhat)]) | [
"def costMatrix(row_feats, col_feats, row_labels, col_labels, metric=\"Pearson\"):\n\n # Get unique label values in non-moving and moving brain\n row_labs = np.asarray(list(set(row_labels).difference({-1, 0})))\n col_labs = np.asarray(list(set(col_labels).difference({-1, 0})))\n\n # Initialize cost matr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unregisters a task by removing it from the task registry. | def unregister_task(cls: Type[Task]):
for cls_reg in __registered_tasks:
if cls_reg.cls == cls:
__registered_tasks.remove(cls_reg)
return
raise ValueError(f"Task `{cls}` is not registered.") | [
"def unregister(cls, task_id):\n heartbeat.unregister(task_id)",
"def remove_task(self, task_id):\n with self.lock:\n self.task_map.pop(task_id)",
"def remove_task(self, task):\n entry = self.entry_finder.pop(task)\n entry[-1] = self._removed",
"def remove_task(self, tas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the OCR letters dataset. This is a chain classification task. Each example consists of a word, segmented into letters. The first letter of each word is ommited from the data, as it was a capital letter (in contrast to all other letters). References | def load_letters():
module_path = dirname(__file__)
data = _safe_unpickle(join(module_path, 'letters.pickle'))
# we add an easy to use image representation:
data['images'] = [np.hstack([l.reshape(16, 8) for l in word])
for word in data['data']]
return data | [
"def letter_recognition_data():\n # Fetch the data from the file\n with open(os.path.join(os.path.dirname(__file__),\n './data/letter_recognition.data.txt'),\n newline='') as data_file:\n data_reader = csv.reader(data_file, delimiter=',', quotecha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a list of numpy arrays from a npz file | def npz_to_array(npzfile):
nitems = len(npzfile.keys())
return [npzfile['arr_%s' % i] for i in range(nitems)] | [
"def load_data(npz_dir):\n files = glob.glob('%s/*.npz' % npz_dir)\n data_list = []\n for f in files:\n data_list += load_npz_to_data_list(f)\n return data_list",
"def loadnpz(file, name):\n if isinstance(file, str):\n file = open(str, \"rb\")\n handle = numpy.load(file)\n array... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate Pearson correlation coefficients and pvalues for testing noncorrelation of lon/lat/time xarray datasets for each lon/lat point. Heavily influenced by scipy.stats.pearsonr The Pearson correlation coefficient measures the linear relationship between two datasets. Strictly speaking, Pearson's correlation require... | def _pearsonr(x: xr.DataArray, y: xr.DataArray, monitor: Monitor) -> xr.Dataset:
with monitor.starting("Calculate Pearson correlation", total_work=6):
n = len(x['time'])
xm, ym = x - x.mean(dim='time'), y - y.mean(dim='time')
xm['time'] = [i for i in range(0, len(xm.time))]
ym['time... | [
"def pearsonCorrelation(x, y):\n\tsum_sq_x = 0\n\tsum_sq_y = 0\n\tsum_coproduct = 0\n\tmean_x = x[0]\n\tmean_y = y[0]\n\tif len(x) != len(y):\n\t\traise StatsError(\"Data sets are of different lengths.\")\n\tn = len(x)\n\tfor i in range(1,n):\n\t\tsweep = i / (i+1.0)\n\t\tdelta_x = x[i] - mean_x\n\t\tdelta_y = y[i]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the SaaS subscription will auto renew upon term end. | def auto_renew(self) -> Optional[bool]:
return pulumi.get(self, "auto_renew") | [
"def is_auto_renew(self):\n return self._is_auto_renew",
"def auto_renew(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"auto_renew\")",
"def auto_renew(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"auto_renew\")",
"def auto_renewable(self):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the current term is a Free Trial term | def is_free_trial(self) -> Optional[bool]:
return pulumi.get(self, "is_free_trial") | [
"def is_free_tier(self):\n return self._is_free_tier",
"def is_N_term(self, res: Residue) -> bool:\n return self.chains_data.get_chain_type(res) == mu.PROTEIN and\\\n res not in self.st_data.prev_residue",
"def is_free(self):\n return self.name == 'free' # (No coverage)",
"def... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The Payment channel for the SaasSubscription. | def payment_channel_type(self) -> Optional[str]:
return pulumi.get(self, "payment_channel_type") | [
"def getChannel(self):\r\n return self.channel",
"def channel(self):\n if not hasattr(self, '_channel'):\n self._channel = self.new_channel()\n return self._channel",
"def channel(self) -> Optional[pulumi.Input['GatewayAPIConfigChannel']]:\n return pulumi.get(self, \"chann... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The SaaS resource name. | def saas_resource_name(self) -> Optional[str]:
return pulumi.get(self, "saas_resource_name") | [
"def resource_name(self):\n return self._resource_name",
"def resource_name(self):\r\n raise NotImplementedError",
"def get_resource_name(self):\n return self._resource_name",
"def auth0_resource_name(self):\n name = re.sub(r'^Custom::Authz?0', '', self.resource_type)\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The saas session id used for dev service migration request. | def saas_session_id(self) -> Optional[str]:
return pulumi.get(self, "saas_session_id") | [
"def get_session_id(self):\n if not self.session_id:\n return uuid.uuid4()\n else:\n return self.session_id",
"def session_id():\n return str(uuid.uuid4())",
"def session_id(self):\n return self.get_argument('SESSID', None)",
"def get_session_id(self):\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The saas subscription id used for tenant to subscription level migration request. | def saas_subscription_id(self) -> Optional[str]:
return pulumi.get(self, "saas_subscription_id") | [
"def subscription_id(self) -> str:\n return pulumi.get(self, \"subscription_id\")",
"def subscription_id(self) -> Optional[str]:\n return pulumi.get(self, \"subscription_id\")",
"def subscription_id(self):\n return self._subscription_id",
"def subscription_id(self) -> pulumi.Input[str]:\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The current Term id. | def term_id(self) -> Optional[str]:
return pulumi.get(self, "term_id") | [
"def get_id(self, term):\n term = term.lower() if self.lower else term\n try:\n return self.term2id[term]\n except KeyError:\n return self.term2id[self.unk_term]",
"def get_term_id(self, term):\n query = self.db.execute('SELECT rowid FROM terms WHERE term = ?;', (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if goal is reached | def goal_reached(self, position):
return position >= self.goal | [
"def check_at_goal(self, currentLocation):\n pass",
"def reached_goal(self):\n for i in range(self.simulator_.num_agents):\n if rvo_math.abs_sq(self.simulator_.agents_[i].position_ - self.goals_[i]) > self.simulator_.agents_[i].radius_ * self.simulator_.agents_[i].radius_:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
run a given number of games and stores the results in the Simulation object. | def run_simulation(self, num_games=10):
for _ in range(num_games):
self.result.append(self.single_game()) | [
"def warmup(self, num_games):\n for i in range(num_games):\n self.run_game(1.0, 1.0)",
"def run_multiple_games(num_games, args):\n player1GamesWon = 0\n draws = 0\n for i in range(num_games):\n print(\"Game \" + str(i))\n node = play_game(args)\n winner = node.state... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a dictionary mapping player types to the number of wins with the key representing the player type and the value the number of wins for that specific type. | def winners_per_type(self):
winners = [winner[1] for winner in self.result]
# making a list of the type of winners
return Counter(winners)
# Using the Counter tool from the standard library to count the
# types in a dictionary | [
"def get_player_counts(self): \n retval = {}\n for k,v in self.game_sessions.items():\n retval[k] = v.get_player_count()\n return retval",
"def test_players_per_type_num_players(self):\n type_of_player = [ss.Player, ss.LazyPlayer, ss.ResilientPlayer]\n sim = ss.Simulation... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Payments used on a one time purchase. Same as single_payment but returns DB record as well | def single_payment_db(*args, **kwargs):
return _single_payment(*args, **kwargs) | [
"def get_payment(self):\n # TODO Use the embedded payment data, if available.\n return self.client.payments.get(self.payment_id)",
"def select_payment(self):\r\n return select_payment_by_id(self.__payment_id__)",
"def stripe_transaction(request):\n\n if request.param == \"booking_payment... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends width and height information to url | def calculate_width_and_height(url_parts, options):
width = options.get("width", 0)
has_width = width
height = options.get("height", 0)
has_height = height
flip = options.get("flip", False)
flop = options.get("flop", False)
if flip:
width = width * -1
if flop:
height = ... | [
"def _get_SIZE_url(self, size): # NOQA\n width, height = map(int, size.split('x'))\n if self.width is None or self.height is None:\n return ''\n crop_dims = self.smart_fill(width, height)\n if crop_dims == (0, 0, self.width, self.height) or crop_dims is None:\n pro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the unsafe url with the specified options | def unsafe_url(**options):
return f"unsafe/{plain_image_url(**options)}" | [
"def embed(url, **options):\n wrapper = match_wrapper(url)\n if wrapper:\n return wrapper.render(wrapper.clean_url(url), options)\n return ''",
"def urlsafe(self):\n # This is 3-4x faster than urlsafe_b64decode()\n urlsafe = base64.b64encode(self.reference().Encode())\n return urlsafe.rst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes command line parser arguments and formats them to display them in TensorBoard text. | def args_to_tensorboard(writer, args):
txt = ""
for arg in vars(args):
txt += arg + ": " + str(getattr(args, arg)) + "<br/>"
writer.add_text('command_line_parameters', txt, 0) | [
"def show_parameters(args):\n\n logging.basicConfig(format='%(message)s', level=args.logging)\n\n logging.info('\\n#{0}'.format('-'*60))\n logging.info('BUILD CONFIG : {0}'.format(args.config))\n logging.info('BUNDLE FILE : {0}'.format(args.bfile))",
"def _write_args_to_tensorboard():\r\n args = g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visualization of classification scores per dataset. | def visualize_classification_scores(data, other_data_dicts, dict_key, data_name, save_path):
data = [y for x in data for y in x]
plt.figure(figsize=(20, 20))
plt.hist(data, label=data_name, alpha=1.0, bins=20, color=colors[0])
c = 0
for other_data_name, other_data_dict in other_data_dicts.items()... | [
"def visualisation_of_dataset(self, dataset):\r\n print(\"Class Distribution\")\r\n x = dataset.groupby('Label').size()\r\n a = len(dataset['Label'])\r\n c = (x / a) * 100\r\n print(c.astype(str) + \"%\")\r\n tx = (dataset['Label'].value_counts(normalize=True, sort=True) * ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visualization of Weibull CDF outlier probabilites. | def visualize_weibull_outlier_probabilities(data_outlier_probs, other_data_outlier_probs_dict,
data_name, save_path, tailsize):
data_outlier_probs = np.concatenate(data_outlier_probs, axis=0)
data_weights = np.ones_like(data_outlier_probs) / float(len(data_outlier_p... | [
"def outlier_detection(self):\n\n try:\n fig, ax = plt.subplots(figsize=(20, 20))\n sns.boxplot(data=self.data, ax=ax)\n plt.title('Boxplot For Outlier Detection')\n plt.show()\n except Exception as e:\n log_obj.error(e)",
"def outliers_plot(sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visualization of percentage of datasets considered as statistical outliers evaluated for different entropy thresholds. | def visualize_entropy_classification(data, other_data_dicts, dict_key, data_name,
thresholds, save_path):
lw = 10
plt.figure(figsize=(20, 20))
plt.plot(thresholds, data, label=data_name, color=colors[0], linestyle='solid', linewidth=lw)
c = 0
for other_data_nam... | [
"def outliers_plot(self):\n if not self.ts_identifiers:\n pass\n else:\n if isinstance(self.get_outliers(), str):\n return self.get_outliers()\n else:\n break_value = [\n 0,\n 5,\n 1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test validates that literal I/O definitions only defined in the `CWL` package as `JSON` within the deployment body generates expected `WPS` process description I/O with corresponding formats and values. | def test_literal_io_from_package(self):
cwl = {
"cwlVersion": "v1.0",
"class": "CommandLineTool",
"inputs": {
"url": {
"type": "string"
}
},
"outputs": {
"values": {
... | [
"def test_deploy_merge_literal_io_from_package(self):\n cwl = {\n \"cwlVersion\": \"v1.0\",\n \"class\": \"CommandLineTool\",\n \"inputs\": {\n \"url\": {\n \"type\": \"string\"\n }\n },\n \"outputs\": {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test to validates if ``builtin`` process type is explicitly blocked during deployment from API. | def test_block_builtin_processes_from_api(self):
cwl = {
"cwlVersion": "v1.0",
"class": "CommandLineTool",
"baseCommand": ["python3"],
"inputs": {
"stringInput": "string"
},
"requirements": {
CWL_REQUIREMENT_... | [
"def test_deploy_block_builtin_processes_from_api(self):\n cwl = {\n \"cwlVersion\": \"v1.0\",\n \"class\": \"CommandLineTool\",\n \"baseCommand\": [\"python3\"],\n \"inputs\": {\n \"stringInput\": \"string\"\n },\n \"requiremen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test validates that various merging/resolution strategies of I/O definitions are properly applied for corresponding ``minOccurs`` and ``maxOccurs`` fields across `CWL` and `WPS` payloads. Also, fields that can help infer ``minOccurs`` and ``maxOccurs`` values such as ``default`` and ``type`` are tested. | def test_resolution_io_min_max_occurs(self):
cwl = {
"cwlVersion": "v1.0",
"class": "CommandLineTool",
"inputs": [
# although types are parsed in multiple ways to compare default/null/array/minOccurs/maxOccurs
# values, the original definitions... | [
"def test_deploy_merge_resolution_io_min_max_occurs(self):\n cwl = {\n \"cwlVersion\": \"v1.0\",\n \"class\": \"CommandLineTool\",\n \"inputs\": [\n # although types are parsed in multiple ways to compare default/null/array/minOccurs/maxOccurs\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test validates that I/O definitions with ``minOccurs`` and/or ``maxOccurs`` are permitted as both integer and string definitions in order to support (1, "1", "unbounded") variations. | def test_valid_io_min_max_occurs_as_str_or_int(self):
cwl = {
"cwlVersion": "v1.0",
"class": "CommandLineTool",
"inputs": [
{"id": "io_min_int_max_int", "type": "string"},
{"id": "io_min_int_max_str", "type": "string"},
{"id": "... | [
"def test_resolution_io_min_max_occurs(self):\n cwl = {\n \"cwlVersion\": \"v1.0\",\n \"class\": \"CommandLineTool\",\n \"inputs\": [\n # although types are parsed in multiple ways to compare default/null/array/minOccurs/maxOccurs\n # values, the... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that different accept language matching supported languages all successfully execute and apply them. Invalid accept languages must be correctly reported as not supported. | def test_execute_job_with_accept_languages(self):
cwl = {
"cwlVersion": "v1.0",
"class": "CommandLineTool",
"baseCommand": "echo",
"inputs": {"message": {"type": "string", "inputBinding": {"position": 1}}},
"outputs": {"output": {"type": "File", "outpu... | [
"def test_execute_job_with_accept_languages(self):\n cwl = {\n \"cwlVersion\": \"v1.0\",\n \"class\": \"CommandLineTool\",\n \"baseCommand\": \"echo\",\n \"inputs\": {\"message\": {\"type\": \"string\", \"inputBinding\": {\"position\": 1}}},\n \"outputs\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The test validates job can receive an array as input and process it as expected. | def test_execute_job_with_array_input(self):
cwl = {
"cwlVersion": "v1.0",
"class": "CommandLineTool",
"baseCommand": ["python3", "script.py"],
"inputs":
{
"test_int_array": {"type": {"type": "array", "items": "int"}, "inputBinding": {"... | [
"def test_execute_job_with_array_input(self):\n cwl = {\n \"cwlVersion\": \"v1.0\",\n \"class\": \"CommandLineTool\",\n \"baseCommand\": [\"python3\", \"script.py\"],\n \"inputs\":\n {\n \"test_int_array\": {\"type\": {\"type\": \"array\",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test verifies that ``minOccurs`` and/or ``maxOccurs`` definitions other than allowed formats are raised as invalid schemas. | def test_invalid_io_min_max_occurs_wrong_format(self):
cwl = {
"cwlVersion": "v1.0",
"class": "CommandLineTool",
"inputs": [{}], # updated after
"outputs": {"values": {"type": "string"}}
}
body = {
"processDescription": {
... | [
"def test_get_supported_schemas(self):\n supported_schemas = modelprop.get_supported_schemas()\n\n assumed_schemas = [\n \"HAZUS_v1.0\",\n \"SARA_v1.0\",\n \"SUPPASRI2013_v2.0\",\n \"Mavrouli_et_al_2014\",\n \"Torres_Corredor_et_al_2017\",\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test validates that complex I/O definitions only defined in the `CWL` package as `JSON` within the deployment body generates expected `WPS` process description I/O with corresponding formats and values. | def test_complex_io_from_package(self):
cwl = {
"cwlVersion": "v1.0",
"class": "CommandLineTool",
"inputs": {
"url": {
"type": "File"
}
},
"outputs": {
"files": {
"... | [
"def test_deploy_merge_complex_io_from_package(self):\n cwl = {\n \"cwlVersion\": \"v1.0\",\n \"class\": \"CommandLineTool\",\n \"inputs\": {\n \"url\": {\n \"type\": \"File\"\n }\n },\n \"outputs\": {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constrained Realizations has to be initialized with parameters and the desired mask. | def __init__(self, nside, weights_map, lmax_factor=1.5, mask=None):
self.params = sc.Parameters(nside, lmax_factor)
self.weights_map = weights_map
if mask is not None:
self.mask = sc.Mask(mask, nside)
else:
self.mask = sc.Mask(np.ones(self.params.npix)) | [
"def __init__(self, mask, scale, shift):\n\n super(ConditionalAffineCoupling, self).__init__()\n\n self.s = scale\n self.t = shift\n\n self.mask = nn.Parameter(mask, requires_grad=False)",
"def initialise_mask(self, mask: Tensor):\n self.mask = mask",
"def test_setup_bounds_an... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set signal cov from Cls and assignt quantities to .signal_cov atribute | def set_signal_cov(self, cl, fwhm = None):
if fwhm is not None:
bl = hp.gauss_beam(fwhm,lmax=len(cl)-1)
self.signal_cov = sc.SignalCov(bl**2 * cl, self.params.lmax)
else:
self.signal_cov = sc.SignalCov(cl, self.params.lmax)
try:
self.set_delta()
... | [
"def setCovariance(self,cov):\n self.setParams(sp.log(sp.diagonal(cov)))",
"def set_cov(self):\n v_mpart = self.d_vars['MPart']\n n_mpart = len(v_mpart)\n for p in combinations_with_replacement(range(n_mpart), 2):\n self.add_parameter('Cov', p[0], p[1])\n\n m_cov = np... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate one fluctuation field delta making use of already set parameters and covariances. | def gen_delta(self):
delta = self.delta.gen_delta(self.mask.good_pix, self.mask.bad_pix,
self.params.nside, self.params.npix)
return delta | [
"def get_domega_ddelta(alpha, delta, alpha_b, delta_b):\n\n z = (delta_b-delta) / ((alpha_b-alpha) * np.cos(delta_b))\n return - 1.0 / (1.0 + z*z) / ((alpha_b-alpha) * np.cos(delta_b))",
"def dmixed_vars(the_vars,tstep,coeffs):\n\n deltheta = theta_ft(the_vars[1],coeffs.ft_intercept,coeffs.ft_gamma) - th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Solve for flm for a specific delta, lambda and target precision | def solve_flm(self, tlm, delta, lamb, target_precision, wf = False):
flm = np.ones(len(tlm))
while True:
flm_i = np.copy(flm)
flm, tlm = self.do_transform(delta, tlm, lamb, wf)
conv = np.linalg.norm(flm-flm_i, ord=2)\
/ np.linalg.norm(flm_i, ord=2)
... | [
"def newton_update(f, df):\n def update(x):\n return x - f(x) / df(x)\n return update",
"def inexact_newton(f,x0,delta = 1.0e-7, epsilon=1.0e-6, LOUD=False):\n x = x0\n if (LOUD):\n print(\"x0 =\",x0)\n iterations = 0\n while (np.fabs(f(x)) > epsilon):\n fx = f(x)\n f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Outputs wiener filtered data in ell space, done with the messenger method, given the input data. | def wiener_filter_data(self, data):
# set up fields
t = np.copy(data)
t[self.mask.bad_pix] = hp.UNSEEN
t[self.mask.good_pix] *= self.weights_map[self.mask.good_pix]
tlm = hp.map2alm(t, self.params.lmax, iter=0)
# get cooling schedule
lamb_list = self.cs.lamb_list
... | [
"def filter(self, data):\n pass",
"def write(self, data):\n self.stream.write(self.filter(data))",
"def pd0_filter(receiver):\n\n data = '' # never None\n\n # the length of the current ensemble. Initialized with a\n # small number (but enough to extract the actual len):\n ensemble_len... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NumKeyLite(array, args, kwargs) create key from numpy.ndarray instance other. The input array argument is converted to NumKeyLite instance. To do this, numpy.asarray(array) is called first. This may or may not copy the input argument. See its docs for more. Extra positional and keyword arguments are passed to numpy.asa... | def __init__(self, array, hashfcn=hash, *nparray_args, **nparray_kwargs):
self.hashfcn = hashfcn
self.__value = numpy.asarray(array, *nparray_args, **nparray_kwargs)
# As long as we're holding the reference to key, we make it read-only,
# so that the key cannot be modified.
self.... | [
"def __init__(self, *args):\n _snap.TIntKd_swiginit(self, _snap.new_TIntKd(*args))",
"def new_double(*args, **kwargs):\n return array.array(DOUBLE_TYPECODE, *args, **kwargs)",
"def __init__(self, *args):\n _snap.TIntKdV_swiginit(self, _snap.new_TIntKdV(*args))",
"def default_numpy_number_seri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decoratorfactory that returns a decorator suitable for methods of a class that inherits ArrayMethodCacheMixin. | def memoized(cachetype=cachetools.LRUCache, cachesize=32,
keyfcn=NumKeyLite, *cargs, **ckwargs):
if cachetype is None:
# Do nothing, return identity decorator.
return lambda x: x
def decorator(arraymethod):
"""Method decorator to be returned by the enclosing factory functio... | [
"def redis_deco_wrapper_class_decorator(cls):\n\n for name, method in inspect.getmembers(cls, inspect.isfunction):\n if '_' not in name:\n setattr(cls, name, redis_conn_retry_deco(method))\n return cls",
"def decorator(cls):\n\n instance = cls(*args, **kwargs)\n caching_servi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback for the IMU message When init is running, sums the messages to average the offsets When init is done, removes the offsets and publish a new imu message | def imu_callback(self, msg):
if self.init_running:
self.offset_a_x += msg.linear_acceleration.x
self.offset_a_y += msg.linear_acceleration.y
self.offset_a_z += msg.linear_acceleration.z
self.offset_w_x += msg.angular_velocity.x
self.offset_w_y += msg.... | [
"def imu_callback(self, msg):\r\n self.imu_msg_buffer.append(msg)",
"def imu_callback(self, msg):\n self.mutex.acquire()\n\n self.ni[3] = msg.angular_rate.x\n self.ni[4] = msg.angular_rate.y\n self.ni[5] = msg.angular_rate.z\n\n self.eta2[0] = msg.orientation.roll\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the response_host of this TokenizeResponseSchema. | def response_host(self, response_host):
self._response_host = response_host | [
"def connection_host(self, connection_host):\n\n self._connection_host = connection_host",
"def setResponse(self, response):\n assert isinstance(response, Response);\n\n self.__response = response;",
"def set_host(self, host):\n\n self.host = host",
"def set_host(self, host):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the response_id of this TokenizeResponseSchema. | def response_id(self, response_id):
self._response_id = response_id | [
"def survey_response_id(self, survey_response_id):\n\n self._survey_response_id = survey_response_id",
"def response_status_id(self, response_status_id):\n\n self._response_status_id = response_status_id",
"def rc_response_sets_id(self, rc_response_sets_id):\n\n self._rc_response_sets_id = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the decision of this TokenizeResponseSchema. | def decision(self, decision):
self._decision = decision | [
"def response_spec(self, response_spec):\n\n self._response_spec = response_spec",
"def set_decision_thresh(self, decision_thresh) -> None:\n self.readout.set_decision_thresh(decision_thresh)",
"def set_response_variable(self, response_variable):\n\n transform, raw_variable = find_raw_varia... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the authentication_methods of this TokenizeResponseSchema. | def authentication_methods(self, authentication_methods):
self._authentication_methods = authentication_methods | [
"def setAuthMethod(self, auth_method):\n self.auth_method = auth_method\n if len(self.auth_credentials) == 2:\n username, password = self.auth_credentials\n if self.auth_method == \"basic\":\n from requests.auth import HTTPBasicAuth\n self.h.auth = H... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the token_unique_reference of this TokenizeResponseSchema. | def token_unique_reference(self, token_unique_reference):
self._token_unique_reference = token_unique_reference | [
"def token_unique_reference(self, token_unique_reference):\n if token_unique_reference is None:\n raise ValueError(\"Invalid value for `token_unique_reference`, must not be `None`\") # noqa: E501\n\n self._token_unique_reference = token_unique_reference",
"def unique_reference(self, uniq... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the pan_unique_reference of this TokenizeResponseSchema. | def pan_unique_reference(self, pan_unique_reference):
self._pan_unique_reference = pan_unique_reference | [
"def token_unique_reference(self, token_unique_reference):\n\n self._token_unique_reference = token_unique_reference",
"def unique_reference(self, unique_reference):\n\n self._unique_reference = unique_reference",
"def pan_sequence_number(self, pan_sequence_number):\n\n self._pan_sequence_n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the product_config of this TokenizeResponseSchema. | def product_config(self, product_config):
self._product_config = product_config | [
"def product(self, product):\n\n self._product = product",
"def product_version(self, product_version):\n\n self._product_version = product_version",
"def product_config(self):\n md = self.metadata\n if \"product\" in md:\n return config.products.get(md[\"product\"], {})\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the token_info of this TokenizeResponseSchema. | def token_info(self, token_info):
self._token_info = token_info | [
"def set_token(self, token):\n if token:\n self.token = token",
"def token(self, token):\n\n self._token = token",
"def token_data(self, token_data: TokenData):\n\n self._token_data = token_data",
"def token_detail(self, token_detail):\n\n self._token_detail = token_deta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the token_detail of this TokenizeResponseSchema. | def token_detail(self, token_detail):
self._token_detail = token_detail | [
"def include_token_detail(self, include_token_detail):\n\n self._include_token_detail = include_token_detail",
"def token_info(self, token_info):\n\n self._token_info = token_info",
"def set_token(self, token):\n if token:\n self.token = token",
"def error_detail(self, error_de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Synchronously waits until the cluster reaches the provided status. Upon timeout a LaunchError is thrown. | def wait_for_status(es, expected_cluster_status):
logger.info("Wait for cluster status [%s]" % expected_cluster_status)
start = time.perf_counter()
reached_cluster_status, relocating_shards = _do_wait(es, expected_cluster_status)
stop = time.perf_counter()
logger.info("Cluster reached status [%s] wi... | [
"def _wait_until_job_starts_on_cluster(self) -> Optional[float]:\n status = None\n job_checking_retry_cnt = 0\n while job_checking_retry_cnt < MAX_JOB_CHECKING_RETRY:\n # Avoid the infinite loop, if any bug happens.\n job_checking_retry_cnt += 1\n try:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates global throughput based on samples gathered from multiple load generators. | def calculate_global_throughput(samples, bucket_interval_secs=1):
samples_per_task = {}
# first we group all warmup / measurement samples by operation.
for sample in samples:
k = sample.task
if k not in samples_per_task:
samples_per_task[k] = []
samples_per_task[k].append... | [
"def distribute_sampling(numSamples, localDevices=None, numChainsPerDevice=1):\n\n global globNumSamples\n\n # Determine number of samples per process\n samplesPerProcess = numSamples // commSize\n\n if rank < numSamples % commSize:\n samplesPerProcess += 1\n\n if localDevices is None:\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates a flat list of all unique operations that are run in between join points. | def operations_per_joinpoint(self):
ops = []
current_ops = set()
allocs = self.allocations
# assumption: the shape of allocs is rectangular (i.e. each client contains the same number of elements)
for idx in range(0, len(allocs[0])):
for client in range(0, self.client... | [
"def combos(trace):\r\n return set((x, y) for x in trace for y in trace if x != y)",
"def _filter_execution_path_operations(self, operations, fetches):\n\n # If no fetch provided, then return all operations.\n if fetches is None:\n return set(operations)\n # Convert to list, if a single element i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |