text
string
label_name
string
labels
int64
left = &node.left; let right = &node.right; if let Some(left_node) = left { let left_node = left_node.borrow(); if left_node.left.is_none() && left_node.right.is_none() { sum += left_node.val; } else { sum +...
Rust
0
o_markdown_result[page_1][elem_idx_1] text_2 = page_to_markdown_result[page_2][elem_idx_2] if text_1.startswith("<table>") and text_1.endswith("</table>") and text_2.startswith("<table>") and text_2.endswith("</table>"): html_table_merge_keys.append((page_1,page_2,ele...
Python
1
/// ``` #[derive(Clone, Debug)] pub struct RosLocalizationClientBuilder { amcl_pose_topic_name: String, nomotion_update_service_name: String, request_final_nomotion_update_hack: bool, } impl RosLocalizationClientBuilder { /// Create builder /// /// # Examples /// /// ``` /// let bui...
Rust
0
nsigned( "20", "# bins in outstanding " "requests histograms" ) disable_outstanding_hists = Param.Bool( False, "Disable outstanding " "requests histograms" ) # transactions (requests) observed per sample period transaction_bins = Param.Unsigned( "20", "# bins in transaction ...
Python
1
#24 class Shop: def __init__(self, base, dis_p, tax_p): self.base = base self.dis_p = dis_p self.tax_p = tax_p def cal_price(self): if self.base < 0 or self.dis_p < 0 or self.tax_p < 0: raise ValueError("Base price, discount percentage, and tax percentage cannot be n...
Python
1
import os import sys from setuptools import setup, find_packages from unicornherder import __version__ install_requires = [ 'psutil>=0.5.1', ] if sys.version_info < (2, 7): install_requires.append('argparse') HERE = os.path.dirname(__file__) try: long_description = open(os.path.join(HERE, 'README.rst'))....
Python
1
from collections import deque, defaultdict ROWS, COLS = map(int, input().split()) sy, sx = map(lambda n: int(n)-1, input().split()) py, px = map(lambda n: int(n)-1, input().split()) grid = [] for _ in range(ROWS): grid.append(input().strip()) assert len(grid[-1]) == COLS # print(grid) assert grid[py][px] ==...
Python
1
), "::", stringify!(sharedSystemAllocCapabilities) ) ); } extern "C" { #[doc = ""] #[doc = " @brief Retrieves memory access properties of the device."] #[doc = ""] #[doc = " @details"] #[doc = " - The application may call this function from simultaneous thread...
Rust
0
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from typing_extensions import Self from narwhals._spark_like.dataframe import SparkLikeLazyFrame from narwhals._spark_like.expr import SparkLikeExpr class SparkLikeLazyGroupBy: def __init__( self: Self, ...
Python
1
st' and installed is True: # Check depot version rc, version_depot = query_package(module, name, depot) if not rc: if compare_package(version_installed, version_depot) == -1: if module.check_mode: module.exit_json(changed=True) # I...
Python
1
-> TokenStream { match syn::parse(input) { Ok(ast) => impls::group_derive(&ast), Err(e) => e.to_compile_error().into(), } } #[proc_macro_derive(ChainSpecExtension, attributes(forks))] pub fn extensions_derive(input: TokenStream) -> TokenStream { match syn::parse(input) { Ok(ast) => impls::extension_derive(&a...
Rust
0
def cookbook(*cuisines): cuisines_dict = {} for cuisine in cuisines: if cuisine[1] not in cuisines_dict: cuisines_dict[cuisine[1]] = {} cuisines_dict[cuisine[1]].update({cuisine[0]: cuisine[2]}) sorted_cuisines = sorted(cuisines_dict.items(), key=lambda kvp: (-(len(kvp[1])), kvp...
Python
1
assert!(matches!(pool.get().await, Err(PoolError::Timeout))); } #[cfg(feature = "rt_tokio_1")] #[tokio::test] async fn test_rt_tokio_1() { _test_unmanaged_timeout_get(Runtime::Tokio1).await; _test_unmanaged_timeout_config(Runtime::Tokio1).await; } #[cfg(feature = "rt_async-std_...
Rust
0
"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WA...
Rust
0
""" ======================================= Contour plot of irregularly spaced data ======================================= Comparison of a contour plot of irregularly spaced data interpolated on a regular grid versus a tricontour plot for an unstructured triangular grid. Since `~.axes.Axes.contour` and `~.axes.Axes....
Python
1
import pickle import tqdm from metadrive.envs.metadrive_env import MetaDriveEnv from metadrive.utils import recursive_equal, setup_logger def test_gen_map_read(): env_num = 3 generate_config = {"num_scenarios": env_num, "start_seed": 0} restore_config = {"num_scenarios": env_num, "start_seed": 0} s...
Python
1
import re from typing import Dict, Any def get_combine_materials(materials: Dict[str, Any], avoid_vague=True) -> str: question = materials.get('task', 'No problem provided') for key, value in materials.items(): if "No useful information from WebSearch" in value: continue if isinst...
Python
1
import random import os random.seed(42) # 读取两个文件,分别存储为列表变量 with open("data/positive1.txt", 'r') as f: positive_sequences = f.readlines()[1::2] # 获取偶数行,即蛋白质序列 从索引为 1 的元素开始,以步长为 2 获取整个序列 with open("data/negative1.txt", 'r') as f: negative_sequences = f.readlines()[1::2] # 获取偶数行,即蛋白质序列 # 确定正样本的数量,将负样本序列列表随机打乱...
Python
1
X = data[col1].values.reshape(-1, 1) y = data[col2].values reg = LinearRegression().fit(X, y) spread = y - reg.predict(X) spread_df = pd.DataFrame({ "dt": data.index, "价差": spread }) fig = px.line(spread_df, x="dt", y="价差...
Python
1
..=1 { let (mut cpu, mut mem) = test_cpu(&vec![PLP_IMP]); let mut p = 0x20; p |= if carry != 0 { flags::C } else { 0 }; p |= if zero != 0 { flags::Z } else { 0 }; p |= if interrupt_disable != 0 {...
Rust
0
roximation becomes `4/pi x - 4/pi² x²`. Plotting this we get: //! > parabola.gif. This looks worse than the 4-term Taylor series, right? //! > Wrong! The maximum absolute error is 0.056. Furthermore, this //! > approximation will give us smooth wave motion, and can be calculated //! > in only 3 multiplications and 1 ad...
Rust
0
ec::from_slice(&[ // SubscribeTopic { // topic_path: String::from("some/topic"), // qos: QoS::AtLeastOnce, // }, // SubscribeTopic { // topic_path: String::from("some/other/topic"), // qos: Qo...
Rust
0
unsafe { &(*(::std::ptr::null::<ibv_rwq_ind_table_init_attr>())).comp_mask as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(ibv_rwq_ind_table_init_attr), "::", stringify!(comp_mask) ) ); } impl Def...
Rust
0
_max)) references_cluster.append(the_max) print("") print("") print("参考值:") print(references_cluster) print("") # 熵权法赋权 print("--------------熵权法赋权--------------") print("") all_data_normalized_cluster = [] p_cluster = [] d_cluster = [] for i in range(0,5): # 数据标准化 the_column = columns[i] the_n...
Python
1
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) sys.path.append(os.path.dirname(os.path.dirname(__file__))) sys.path.append(os.path.dirname(__file__)) sys.path.append('/home/yangjy/Study/ChatAgent_RAG/') import pytest from fastapi import HTTPException from server.know...
Python
1
en(cleaned_articles)} news articles") return cleaned_articles except requests.exceptions.RequestException as e: self.logger.error(f"Error fetching data: {e}") if attempt < max_retries - 1: self.logger.info(f"Retrying in {re...
Python
1
ter: Arc<FilePathConverter>, package_directory: impl AsRef<Path>, ) -> Self { Self { file_path_converter, package_directory: package_directory.as_ref().into(), } } } impl app::infra::FilePathDisplayer for FilePathDisplayer { fn display(&self, file_path: &app:...
Rust
0
onv(QDQOperatorBase): def __init__(self, onnx_quantizer, onnx_node): super().__init__(onnx_quantizer, onnx_node) def quantize(self): node = self.node assert node.op_type == "Conv" or node.op_type == "ConvTranspose" self.quantizer.quantize_activation_tensor(node.input[0]) ...
Python
1
T_ACCOUNT_ADDR]) .with_deploy_hash([42; 32]) .build(); ExecuteRequestBuilder::new().push_deploy(deploy).build() }); } #[ignore] #[test] fn should_run_gh_1688_regression_stored_contract_by_hash() { test(|_contract_package_hash, contract_hash| { let deploy = DeployItemBui...
Rust
0
2, -1), (-1, 2), (-1, -2), (-2, -1), (-2, 1), ]; // MVV-LVA score, see https://www.chessprogramming.org/MVV-LVA // addressed as [victim][attacker] #[rustfmt::skip] const MVV_LVA: [[i32; 7]; 7] = [ [0, 0, 0, 0, 0, 0, 0], [50, 51, 52, 53, 54, 55, 0], [40, 41, 42, 43, 44, 45, 0], [30...
Rust
0
Some(mv) } else { None } }).collect::<Vec<Move>>(); //println!("knight moves: {:?}", moves); MovesIter::from_vec(moves) } const KING_OFFSETS: [[i8; 2]; 8] = [ [-1, -1], [-1, 0], [-1, 1], [0, 1], [1, 1], [1, 0], [1, -1], [0, -1], ]; pub fn gen...
Rust
0
IRQPending: [ReadOnly<u32>; 2], FIQControl: Volatile<u32>, EnableIRQ: [Volatile<u32>; 2], EnableBasicIRQ: Volatile<u32>, DisableIRQ: [Volatile<u32>; 2], DisableBasicIRQ: Volatile<u32>, } /// Pending interrupts pub struct PendingInterrupts(u64); impl Iterator for PendingInterrupts { type It...
Rust
0
res = Some(client); } } pub fn block_on<T>(future: impl Future<Output = T> + 'static) { wasm_bindgen_futures::spawn_local(async { future.map(|_| ()).await }); } use crate::base64::byte_map::ENCODE_LUT; #[inline(always)] /// SAFETY: the caller must ensure that buf can hold AT LEAST ((s.len() * 4 + 2) / 3) more...
Rust
0
)); assert_eq!(4, s.byte_to_char(6)); assert_eq!(4, s.byte_to_char(7)); assert_eq!(4, s.byte_to_char(8)); assert_eq!(13, s.byte_to_char(33)); assert_eq!(13, s.byte_to_char(34)); assert_eq!(13, s.byte_to_char(35)); assert_eq!(14, s.byte_to_char(36)); } #...
Rust
0
::{ notify::infra::NotifyUnexpectedErrorInfra, proxy_notify::infra::NotifyUnexpectedErrorFieldsExtract, }; use super::event::NotifyUnexpectedErrorEvent; pub async fn notify_unexpected_error<S>( infra: &impl NotifyUnexpectedErrorInfra, fields: NotifyUnexpectedErrorFieldsExtract, post: impl Fn(Notif...
Rust
0
wagger_ui::create_endpoint(&self.spec()) } /// Create the Rapidoc endpoint. #[must_use] #[cfg(feature = "rapidoc")] pub fn rapidoc(&self) -> impl Endpoint where T: OpenApi, W: Webhook, { crate::ui::rapidoc::create_endpoint(&self.spec()) } /// Create the Redo...
Rust
0
://spec.commonmark.org/0.30/#link-reference-definition)\ A [link /// reference /// definition](https://spec.commonmark.org/0.30/#link-reference-definition) /// consists of a [link label](https://spec.commonmark.org/0.30/#link-label), /// optionally preceded by up to three spaces of indentation, followed by a /// colon ...
Rust
0
de_json::from_str(&s)); result.map(|r| r.data.first().unwrap().clone()) } pub fn fetch_albums(country: &str, ids: Vec<String>) -> serde_json::Result<Vec<Album>> { let params = "include=artists"; let path = format!("/catalog/{}/albums?ids={}&{}", country, ids.join(","), params); let result: serde_json::...
Rust
0
map(str::parse) .collect::<Result<_, _>>()?; Ok(Self { calls, boards }) } } impl Solver for Solution { fn solve(&self, part: Part) -> String { let mut boards = self.boards.clone(); match part { Part::One => { for called in &self.calls { ...
Rust
0
h, raw_time: time, time: time.ceil() as u32, gas, ceiling: ceiling.to_mbar() as i32, otu_cns, setpoint, compartments: new_comps, }, ) } fn calc_bottom_segment( dive: &Dive, comps_in: &Compartments, constants: &T...
Rust
0
from numpy import abs, exp, power, array, sqrt, pi from scipy.special import gamma #TODO: This file should eventually be replaced, by moving the existing functions (used for GARCH based models) # into the GARCH folder, with Cythonizations class Score(object): @staticmethod def score(y,loc,scale,shape): ...
Python
1
} }) .collect::<Vec<_>>(); let your = parse_to_vec(a_your.lines().into_iter().last().unwrap().split(',')); let nearby = a_nearby .lines() .skip(1) .map(|line| parse_to_vec(line.split(','))) .collect::<Vec<_>>(); Notes { fields: fields, your_...
Rust
0
e performed /// * `values` - values bound to the query /// * `paging_state` - previously received paging state or None pub async fn query_paged( &self, query: impl Into<Query>, values: impl ValueList, paging_state: Option<Bytes>, ) -> Result<QueryResult, QueryError> { ...
Rust
0
{}", user3.active); println!("{}", user3.sign_in_count); //tuples struct struct Color(i32, i32, i32); struct Point(i32, i32, i32); let black = Color(0, 0, 0); let origin = Point(0, 0, 0); println!("{}", black.0); println!("{}", origin.2); println!("{:#?}", user1); //Need ...
Rust
0
{ if let Some(inv_stack) = inventory.item_at(inv_slot) { if is_arrow_item(inv_stack.ty) { return Some((inv_slot, *inv_stack)); } } } None } fn is_arrow_item(item: Item) -> bool { match item { Item::Arrow | Item::SpectralArrow | Item::TippedAr...
Rust
0
/{}", crate::progenitor_support::encode_path(&key_id.to_string()), ); self.client.delete(&url, None).await } /** * Get Identity Provider. * * This function performs a `GET` to the `/api/v1/idps/{idpId}` endpoint. * * Fetches an IdP by `id`. * * **...
Rust
0
class Solution(object): def reverseList(self, head): prev=None x=head while x: next=x.next x.next=prev prev=x x=next return prev
Python
1
traffic. An administrator typically configures their router to be visible outside the cluster firewall, and may also add additional security, caching, or traffic controls on the service content. Routers usually talk directly to the service endpoints. /// /// Once a route is created, the `host` field may not be changed...
Rust
0
} }; } if plan.is_null() { return Err(FFTSError); } Ok(FFTSPlan { plan }) } ///Execute the FFT on the given slice of FFTSComplex and returns the output Vec<FFTSComplex> pub fn execute(&mut self, input: &mut [FFTSComplex]) -> Vec<FFTSCom...
Rust
0
"""Fully vectorial finite-difference mode solver example.""" import numpy import EMpy import pylab def epsfunc(x_, y_): """Similar to ex_modesolver.py, but using anisotropic eps.""" eps = numpy.zeros((len(x_), len(y_), 5)) for ix, xx in enumerate(x_): for iy, yy in enumerate(y_): if a...
Python
1
as char); } result } pub struct Icon<T> { pub image: T, pub aspect_ratio: f32, } <gh_stars>0 use ::fs::find_paths; use std::ffi::OsString; pub fn process(level: &str, root: &str) { for path in find_paths(root, level) { println!("{}", OsString::from(path).to_string_lossy()); } } <gh_st...
Rust
0
test', False) if not distributed: model = MMDataParallel(model, device_ids=[0]) outputs = single_gpu_test(model, data_loader, args.show, args.show_dir, efficient_test) else: model = MMDistributedDataParallel( model.cuda(), device...
Python
1
_repr__(self): txt = '(' + self.name + ': ' txt += 'start=' + str(self.start) txt += ', end=' + str(self.end) if len(self.children) > 0: txt += ', children=[' for c in self.children: child_txt = str(c).replace('\n', '\n ') txt +...
Python
1
t(); let key_range = build_key_range(start_key, end_key, reverse_scan); m.local_read_stats .add_query_num(region_id, peer, key_range, QueryKind::Coprocessor); }); } pub fn tls_collect_perf_stats(cmd: ReqTag, perf_stats: &PerfStatisticsDelta) { TLS_COP_METRICS.with(|m| { *(m....
Rust
0
%affirmative </segment_id> <segment_id=Geo_nios_2ch_0026> #गहराई के साथ तापमान में तेजी से वृद्धि के कारण अधिक गहराइयों तक खनन और वेधन कार्य करना संभव नहीं है । gaharAI_1 1 - - 12:rask7 - - - - wApamAna_1 2 - - 4:k7 - - - - wejI+se_1 3 - - 4:krvn - - - - vqxXi_1 4 - - 12:rh - - - - aXika_1 5 - - 6:mod - - - - gaharAI_1...
Python
1
""" Helper functions for overriding notification content for given notification type. """ from typing import Dict def get_notification_type_context_function(notification_type) -> callable: """ Returns: callable : The function that returns the context for the given notification type. """ try: ...
Python
1
def inverso_multiplicativo(a,m): #a numero, m modulo r0 = m r1 = a s0 = 0 s1 = 1 t0 = 1 t1 = 0 while r1 != 0: q = r0 // r1 #Actualizamos r, s y t r2 = r0 - q * r1 s2 = s0 - q * s1 t2 = t0 - q * t1 #Desplazamos los valores para el proximo cic...
Python
1
_stream: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { pub fn ferror(__stream: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { pub fn clearerr_unlocked(__stream: *mut FILE); } extern "C" { pub fn feof_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { pub fn ferror_unlocked...
Rust
0
xfd\x95'\xd3vY\x84\ \xdb\x22X%\x0c\x0c\x0c\xc0j\xad\xc6\x9a\xd65\xa9\x05\ \xa6\x86\x11\xb5+\xac~\xfe\x12\x17,\xb3\xd9l\xe8Z\ \xbf^\x91\xbf\xed\xf0\xd0\x10:\xbb\xba`6[`0\ \x18\xd0\xb5a=\xc6\xc7\xc71\xbd\xe0[\xbe\x1a\xa9\xae\ \xa9\xc1\x95W]\x85\x1bn\xbc\x11\xf5\x0d\xf5y\xcf\x8f\ \xa2e\xd7\x02\xc5\xf3\xb4\x95\x8a\xeb\xe1i...
Python
1
Returns the degree of a node. /// /// # Examples /// /// ``` /// use pixie_rust::recommender::graph::Graph; /// /// let mut graph: Graph<u32> = Graph::new(); /// /// graph.add_node(&1); /// graph.add_node(&2); /// graph.add_node(&3); /// assert_eq!(graph.degree(&1), 0); ...
Rust
0
hans_the_1" ; "mixed")] fn check_write_fmt(to_check: &str) -> String { let var: BlankNode<&str> = if let Ok(var) = BlankNode::new(to_check) { var } else { return "invalid name".to_owned(); }; let mut buf = String::new(); match var.write_fmt(&mut buf) ...
Rust
0
ou_list.append(iou) iou_list = np.array(iou_list) return iou_list # 识别不出手势就是0 def __compute_pose(self, key_point): """ 读取设置文件,匹配手势 """ angles = pose_to_angles(key_point) # [ 0.99953 -0.91983 -0.95382 -0.98989 -0.99999] for pose in self.po...
Python
1
Resources<T, B> where T: Target { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "TransferResources {{ .. }}") } } pub(crate) enum Direction { MemoryToPeripheral, PeripheralToMemory, } /// Implemented for all peripheral APIs that support DMA transfers /// /// This is an int...
Rust
0
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Python
1
d_list.pop(0) print(f"Using next txid from file: {txid}") else: next_txid, vout_index = find_next_ordinal_tx(txid, vout_index, depth, genesis_txid) if next_txid: txid = next_txid ...
Python
1
logger: &Logger) -> Result<(), AppError> { let setup_logger = logger.new(o!("workspace" => workspace_dir.to_owned())); debug!(setup_logger, "Entering setup"); let path = PathBuf::from(workspace_dir); let maybe_path = if path.exists() { Ok(path) } else { Err(AppError::UserError(format!("Given workspace...
Rust
0
t="127.0.0.1", port=11111, is_encrypt=None, security_firm=SecurityFirm.FUTUSECURITIES): super(OpenHKCCTradeContext, self).__init__(TrdMarket.HKCC, host, port, is_encrypt=is_encrypt, security_firm=security_firm, trd_category=TrdCategory.SECURITY) # A股交易接口 class OpenCNTradeContext(OpenTradeContextBase): def...
Python
1
ing whitespaces. /// * Punctuation - Characters representing ASCII punctuations. /// * Text - Everything else. /// /// For example, the string "Hi, number 42." is tokenized as "[Hi][,][ ][number][ ][42][.]". /// /// # Arguments /// /// * s - String slice to tokenize. /// /// # Returns /// /// A `Vec` of indices pointin...
Rust
0
MCs;userdata="; let suffix = ";comment2=%20like%20a%20pound%20of%20bacon"; let output = prefix.to_owned() + &input + suffix; cbc::encrypt(output.as_bytes(), &key, &iv).unwrap() } pub mod cbc_padding_oracle_attack { use crate::encoding; use rand::Rng; use rand::SeedableRng; use std::fs; ...
Rust
0
if head is None: raise IndexError("Index is out of bounds on the list.") # base case, when idx = 0 if index == 0: return head.value # recursive case, to get to the base case else: return value_at(head.next, index - 1) # print(value_at(Node(10, Node(20, Node(30, None))), 0)) # p...
Python
1
export DUMPSERVER=netdump.test-kickstart.invalid export NFSSERVERS="RHEL3,rhel3-nfs.test-kickstart.invalid:/export/home RHEL4,rhel4-nfs.test-kickstart.invalid:/export/home RHEL5,rhel5-nfs.test-kickstart.invalid:/export/home RHEL6,rhel6-nfs.test-kickstart.invalid:/export/home NETAPP, SOLARIS," export LOOKASIDE=http://do...
Python
1
try_line(r"p !-a"), Err(parse::Error::AttributeName { line_number: 1, .. }) )); assert!( matches!( try_line(r#"p !!a"#), Err(parse::Error::AttributeName { line_number: 1, .. }) ), "exclamation marks aren't allowed either" ); assert!( ...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import _, api, fields, models class MailResendCancel(models.TransientModel): _name = 'mail.resend.cancel' _description = 'Dismiss notification for resend by model' model = fields.Char(string='Mod...
Python
1
SEAL_GROW" | "F_SEAL_WRITE" => true, "QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1" if mips && linux => { true } // Only on MIPS "BOTHER" => true, "MFD_CLOEXEC" | "MFD_ALLOW_SEALING" if !mips && musl => true, ...
Rust
0
#!/usr/bin/python3 """ This module determines the winner of a prime game between Maria and Ben. """ def isWinner(x, nums): """ Determins the winner of a prime game """ if x < 1 or not nums: return None max_n = max(nums) primes = [True] * (max_n + 1) primes[0] = primes[1] = False ...
Python
1
(impls!( FdbFutureKey: Send & Future & !Clone & !Copy)); #[rustfmt::skip] assert!(impls!( FdbFutureMaybeValue: Send & Future & !Clone & !Copy)); #[rustfmt::skip] assert!(impls!( FdbFutureCStringArray: Send & Future & !Clo...
Rust
0
del: Model that was selected complexity_score: Complexity score from analysis selection_method: Method used for selection """ try: # Get cache instance cache = SharedPromptCache.get_instance() # Get existing stats stats_key = "agent_loader:model_selection...
Python
1
": dummy_func, "func": dummy_func, "lower_bounds": 1.0, "upper_bounds": 2.0, "tol": 1e-5, } assert constr._to_dict() == dict_repr def test_nonlinear_constraint_with_bounds_and_value(dummy_func): msg = "'value' cannot be used with 'lower_bound' or 'upper_bound'." with py...
Python
1
['navigation'].createDimension('lat', len(lats)) lonDim = ncFile['navigation'].createDimension('lon', len(lons)) lat = ncFile['navigation'].createVariable('lat', 'f4', ('lat',), zlib=True, complevel=9) lon = ncFile['navigation'].createVariable('lon', 'f4', ('lon',), zlib=True, comple...
Python
1
\.{\\leftskip} and \.{\\rightskip}. //! //! Suppose, for example, that the paragraph consists entirely of alternating //! boxes and glue skips; let the boxes have widths $x_1\ldots x_n$ and //! let the skips have widths $y_1\ldots y_n$, so that the paragraph can be //! represented by $x_1y_1\ldots x_ny_n$. Let $p_i$ b...
Rust
0
from opencompass.openicl.icl_prompt_template import PromptTemplate from opencompass.openicl.icl_retriever import ZeroRetriever from opencompass.openicl.icl_inferencer import GenInferencer from opencompass.datasets import ( LVEvalOPTF1Evaluator, LVEvalhotpotwikiqaDataset, ) LVEval_hotpotwikiqa_mixup_reader_cfg ...
Python
1
A signal number for use with [`kill_process`] and [`kill_process_group`]. /// /// [`kill_process`]: crate::process::kill_process /// [`kill_process_group`]: crate::process::kill_process_group #[derive(Copy, Clone, Debug, Eq, PartialEq)] #[repr(u32)] pub enum Signal { /// `SIGHUP` Hup = linux_raw_sys::general::S...
Rust
0
# Merging two sorted arrays without extra space # find next gap(means find the gap between two elements to be compared .) def findGap(gap): if (gap <= 1): return 0 return (gap // 2) + (gap % 2)# ceiling value of gap. #Lets merge arrays now. def merge(arr1, arr2, n, m): gap = n + m #sum of sizes of...
Python
1
ke: .. code-block:: python class StorageWithBackoff(gcloud.aio.storage.Storage): @backoff.on_exception(backoff.expo, aiohttp.ClientResponseError, max_tries=5, jitter=backoff.full_jitter) async def copy(self, *args: Any, **kwargs: Any): return await super()...
Python
1
/ig/userInfoByUsername/' + email).json() except: info = None try: Id = info['result']['user']['pk_id'] except: Id = None try: followers = info['result']['user']['follower_count'] except: followers = None try: following = info['result'...
Python
1
saturating_mul_int(amount) } /// This function must to be called in `with_transaction_result` scope to /// ensure atomic pub fn redeem_by_unbond(who: &T::AccountId, amount: Balance) -> DispatchResult { let mut liquid_amount_to_redeem = amount; let liquid_exchange_rate = Self::liquid_exchange_rate(); let mut ...
Rust
0
f sys == SYS_rdcall_notify_control_msg as i32 || sys == SYS_rdcall_init_preload as i32 { syscall_state.emulate_result(0); return Switchable::PreventSwitch; } if sys == Arch::SIGACTION || sys == Arch::RT_SIGACTION { syscall_state.reg_parameter::<kernel_sigaction<Arch>>( 2, ...
Rust
0
d return spd_dict def calculate_bias(y_pred, y_true, sensitive_dict, privileged_conditions, threshold): y_true = np.array(y_true) y_pred_class = [1 if y >= threshold else 0 for y in y_pred] y_pred_class = np.array(y_pred_class) performance_dict = {} performance_dict['di'] = calculate_di(y_pr...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the `pypath` python module # # Copyright 2014-2023 # EMBL, EMBL-EBI, Uniklinik RWTH Aachen, Heidelberg University # # Authors: see the file `README.rst` # Contact: Dénes Türei (turei.denes@gmail.com) # # Distributed under the GPLv3 License. #...
Python
1
f3\xfeF\x99\ \x8f\xa1\xa67\xe6\xab#\x93E\x81@\x0di\x141Q\ \xbdh\x04B~\xf4\x0d\x1a\xbd\x10<\x1afD\x7f(\ \xda\xcc\xf0~_|\xbd\xa3qzGt\xba\x17\x9b\xc9\ \xb6\xfa\xc3;V\xc3nit{`e\xdbI\xd8\x8e\ \xf5\xe1\x96\xfa\xe9\xeed\x7f\xf7\xf0`w\xc7\xcff\xd3\ \xa5Z\xb8\xc4\x12\xbfAX\x12\xc0%\x96\xf8\x0d\x84\x18\ \xc3`\xbcZ\xb8j86\xe5x#\x...
Python
1
n, * null and undefined values are represented by specific, invalid pointer values: * * False: 0x06 * True: 0x07 * Undefined: 0x0a * Null: 0x02 * * These values have the following properties: * - Bit 1 (OtherTag) is set for all four values, allo...
Rust
0
try": cucsPkiEpFsmStageEntry, "cucsPkiEpFsmStageInstanceId": cucsPkiEpFsmStageInstanceId, "cucsPkiEpFsmStageDn": cucsPkiEpFsmStageDn, "cucsPkiEpFsmStageRn": cucsPkiEpFsmStageRn, "cucsPkiEpFsmStageDescrData": cucsPkiEpFsmStageDescrData, "cucsPkiEpFsmStageLastUpdateTime": cucsPkiEpFsmSt...
Python
1
ListNeurons(list_neurons::ListNeuronsOpts), ListProposals(list_proposals::ListProposalsOpts), GetProposalInfo(get_proposal_info::GetProposalInfoOpts), /// Queries a ledger account balance. AccountBalance(account_balance::AccountBalanceOpts), /// Generate a mnemonic seed phrase and generate or recove...
Rust
0
.value_of("id") .ok_or("impossible")?; // Send to daemon let res = client::post::<String, String>(format!("/containers/stop/{}", container_id), None) .await?; let ids = serde_json::from_str(res.as_str())?; match id...
Rust
0
in(); let mut assert_cmd = stdin_cmd.buffer("{\"bid_request\":{\"imp\":[{\"pmp\":{\"deals\":[{\"id\":\"BIDDER-DEAL-1\"}],\"private_auction\":0}}]}}\n"); assert_cmd.assert().success().stdout("{\"bid_request\":{\"imp\":[{\"pmp\":{\"deals\":[{\"id\":\"BIDDER-DEAL-1\"}],\"private_auction\":0}}]}}\n"); ...
Rust
0
t, _x1: RayTracingFloat, _y0: RayTracingFloat, _y1: RayTracingFloat, _k: RayTracingFloat, mat: std::rc::Rc<dyn material::Material>, ) -> Self { return Self { mp: mat, x0: _x0, x1: _x1, y0: _y0, y1: _y1, ...
Rust
0
singleton_read(storage, b"config") } pub fn get_config(storage: &dyn Storage) -> StdResult<Config> { get_config_storage_read(storage).load() } pub fn set_config<'a>(storage: &'a mut dyn Storage, config: Config) -> Result<()> { get_config_storage(storage).save(&config)?; Ok(()) } pub const GAME: &[&str] = ...
Rust
0
# Copyright (c) 2021 Institute for Quantum Computing, Baidu Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
Python
1
import json import random import unittest from concurrent.futures import ThreadPoolExecutor import requests from sglang.srt.utils import kill_process_tree from sglang.test.test_utils import ( DEFAULT_SMALL_MODEL_NAME_FOR_TEST, DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, CustomTestCase, ...
Python
1
data: BytesMut, }, VideoData { data: BytesMut, }, SetBufferLength { stream_id: u32, buffer_length: u32, }, StreamBegin { stream_id: u32, }, StreamIsRecorded { stream_id: u32, }, Unknow, } pub mod msg_type_id { pub const AUDIO: u8 = 8;...
Rust
0