text
string
label_name
string
labels
int64
"Calculated from NRCan comprehensive DB; 'n.a.' split evenly; " "if total > 100%, smallest share trimmed." ), "[I1]", # data_source 2, 1, 2, 3, 3, # data quality ...
Python
1
ftware, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI...
Rust
0
passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> WatchProviderListResponse: """ Get the list of streaming providers we have...
Python
1
# Página principal de Python: http://www.python.org #######TIPOS DE COMENTARIOS####### # Esta es la forma para hacer un comentario de una sola línea. """ Las comillas dobles nos sirven para escribir comentarios de más de una línea. """ ''' Las comillas simples tambien nos sirven para escribir comentarios de más d...
Python
1
a field like this to the radar_se radar object radar_se.add_field_like( "reflectivity_horizontal", field_name="reflectivity_bias", data=reflectivity_difference, ) # Setup our figure fig = plt.figure(figsize=(8, 6)) ax = plt.subplot(111, projection=ccrs.PlateCarree()) # Plot the difference field disp1 = py...
Python
1
# Copyright (c) 2018-2020 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
Python
1
if let Ok(ctx_dir) = context_dir(None) { get_default_context(&ctx_dir).ok() } else { None }; let lattice_prefix = opts.lattice_prefix.unwrap_or_else(|| { ctx.as_ref() .map(|c| c.ctl_lattice_prefix.clone()) .unwrap_or_else(|| DEFAULT_LATTICE_PREFIX.to_string(...
Rust
0
u want to to grant access to the SNOWFLAKE share (Account Usage, etc.) to the Genesis application -- uncomment this by removing the // and run it: // grant imported privileges on database SNOWFLAKE to application IDENTIFIER($APP_DATABASE); --- once granted, Genesis will automatically start to catalog this...
Python
1
#!/usr/bin/python3 # -*- coding: utf-8 -*- # @Time : 2019/11/5 13:31 # @Author : qizai # @File : baidu_index.py # @Software : PyCharm import execjs js = """function decrypt(t, e) { for (var n = t.split(""), i = e.split(""), a = {}, r = [], o = 0; o < n.length / 2; o++) a[n[o]] =...
Python
1
pMinus, Key::Minus), (Keycode::KpMultiply, Key::Star), (Keycode::KpPeriod, Key::OemPeriod), (Keycode::KpPlus, Key::Plus), (Keycode::F1, Key::F1), (Keycode::F2, Key::F2), (Keycode::F3, Key::F3), (Keycode::F4, Key::F4), (Keycode::F5, Key::F5), (Keyco...
Rust
0
input1 = DFP { amount: vec![1], exp: 1, sign: Sign::Positive }; input2 = DFP { amount: vec![1], exp: 0, sign: Sign::Negative }; output1 = DFP { amount: vec![0,1], exp: 0, sign: Sign::Positive }; output2 = DFP { amount: vec![1], exp: 0, sign: Sign::Negative }; assert_eq!((output1, output2...
Rust
0
('\u2022', '\u093d'), # • -> ऽ ('\xb7', '\u093d'), # · -> ऽ ('\u2219', '\u093d'), # ∙ -> ऽ ('\xb7', '\u093d'), # · -> ऽ ('~j', '\u094d\u0930'), # ~j -> ्र ('~', '\u094d'), # ~ -> ् ('\\', '?'), # \ -> ? ('+', '\u093c'), # + -> ़ ('^', '\u2018'), # ^ -> ‘ ...
Python
1
framebuffer { let p = vec3!( pixel.x.powf(1.0 / 2.2), pixel.y.powf(1.0 / 2.2), pixel.z.powf(1.0 / 2.2) ) * 255.0; let x = (p.x as i32).min(255).max(0) as u8; let y = (p.y as i32).min(255).max(0) as u8; let z = (p.z as i32).min(255).max(0) as u...
Rust
0
nge, 2 => HostFormatResult::Error, _ => unreachable!("Unexpected host format result: {}", orig), } } } pub enum MessagePart<'a> { VariableData(Cow<'a, [u8]>), Number(u32), } impl<'a> From<&'a Path> for MessagePart<'a> { fn from(value: &'a Path) -> Self { match value.to_string_lossy() { ...
Rust
0
= Vec::with_capacity(NUM_TIMEZONES_WITH_GLOBAL_CATEGORY); pub static mut NEXT_MONTHS_POLL_ID_BYTE_COUNTS: Vec<u8> = Vec::with_capacity(NUM_TIMEZONES_WITH_GLOBAL_CATEGORY); pub static mut LAST_WEEKS_POLL_ID_BYTE_COUNTS: Vec<u8> = Vec::with_capacity(NUM_TIMEZONES_WITH_GLOBAL_CATEGORY); pub static mut THIS_WEEKS_POLL_ID_...
Rust
0
_pixmap_reply_fds` could be loaded. #[cfg(feature = "has_symbol")] pub fn has_xcb_dri3_buffer_from_pixmap_reply_fds(&self) -> bool { has_sym!(self, xcb_dri3_buffer_from_pixmap_reply_fds) } /// Sends a `DRI3::FenceFromFD` request (checked). /// /// This request generates a reply. You mus...
Rust
0
""" Configuration settings for pyzxing. """ import os class Config: """Configuration constants and settings.""" # Version information from .__version__ import __version__ VERSION = __version__ MIN_PYTHON_VERSION = '>=3.8.0' # ZXing settings DEFAULT_ZXING_VERSION = '3.4.1' JAR...
Python
1
32, y: i32) -> Result<(), Error> { std::io::stdout().write_fmt(format_args!("\x1B[{};{}H", y, x))?; Ok(()) } pub fn get_cursor_pos() -> Result<(i32, i32), Error> { let mut stdout = std::io::stdout(); // Set noncanonical mode let orig = Termios::from_fd(FD_STDIN)?; ...
Rust
0
def initialize(): try: import mmpretrain except ModuleNotFoundError: print('Initializing zoo...') install_mim_dependencies()
Python
1
w| { // w.cwuf1().set_bit(); // w.cwuf2().set_bit(); // w.cwuf3().set_bit(); // w.cwuf4().set_bit(); // w.cwuf5().set_bit(); // }) // Or, unimplemented: // On return from ISR while: // – SLE...
Rust
0
end_time = time.perf_counter() duration = end_time - start_time # Reorganizar pacotes e criar o arquivo completo data_received = b"".join(buffer[i] for i in sorted(buffer)) total_packets = max(received_packets) + 1 if received_packets else 0 lost_packets = total_packet...
Python
1
Domain Error Word3 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--wr...
Rust
0
port: PortNumber::NormalPort(2), len: PACKET_QUEUE_LENGTH as u16, properties: Vec::new(), }; let bytes = Into::<Vec<u8>>::into(testee.clone()); let from = PacketQueue::try_from(&bytes[..]).expect("Error while decoding Port from bytes."); a...
Rust
0
# This file is MACHINE GENERATED! Do not edit. # Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. """Public API for tf_estimator._api.v1 namespace """ import sys as _sys from tensorflow_estimator._api.v1 import estimator from tensorflow.python.util import module_wrapper as _module_...
Python
1
ing up", current_size_mb=current_size_mb, limit_mb=self.config.max_cache_size_mb, ) # Get all cache files with their modification times cache_files = [] for directory in [ self.html_dir, self.image_dir, self.metadata_dir, ...
Python
1
re, doc_id): " + str(sorted_pairs)) reranked_docs, scores = [], [] for i in range(num_docs): score, doc_id = sorted_pairs[i] reranked_docs.append(docs[int(doc_id)]) scores.append(score) if run_type == "msmarco": lines.append("query" + "\t" + str(doc_id) + "\t" + str(i...
Python
1
captures: 131_393, en_passants: 0, castles: 7795, promotions: 60032, checks: 15492, // checkmates: 5, }, PerftResult { total: 15_833_292, captures: 2_046_173, en_passants: 6512, castles: 0, promotions: 329_464, checks: ...
Rust
0
#!/usr/bin/python3 """ function that divides all elements of a matrix. """ def matrix_divided(matrix, div): """ Parameters: matrix: matrix its elements to be divided dix: number to be used in the division Returns: list: a new matrix hose elements have been divided by div Exampl...
Python
1
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import os import pathlib import uuid from datetime import datetime from torchrl.record.loggers.common im...
Python
1
str>, pub arch: &'a str, pub file_type: FileType, pub num_jobs: usize, pub mapping_var: Option<Vec<&'a str>>, pub mapping_src: Option<Vec<&'a str>>, pub mapping_dest: Option<Vec<&'a str>>, pub mapping_file: Option<&'a str>, } pub(crate) trait Creator: Mergeable + Dumpable + Sized { fn ...
Rust
0
c_type: Type, builder: BuilderRef_res, crate_map: ValueRef, crate_map_name: ~str, // Set when at least one function uses GC. Needed so that // decl_gc_metadata knows whether to link to the module metadata, which // is not emitted by LLVM's GC pass when no functions use GC. uses_gc: bo...
Rust
0
list value".to_string()) } } else { Atom::Error(format!( "Wrong number of parameters for 'loop': was expecting 1, found {}", parameters.len() )) } } /// The naml token enum represents all possible tokens defined by the language grammar. #[derive(PartialEq, Debug)] pub enum NamlToken { Bl...
Rust
0
: GFn, fun3: HFn, } struct Block0State { f_state: FState, g_state: GState, h_state: HState } impl<X: IType, Z: IType, S: IState<X, Y>> IFn<X, Z, S> for Block0Fn { fn init(self, input: X) -> (S, Z) { let (z_state, z_out) = if input < 2 { self.fun1.init(input.clone()); B...
Rust
0
"""Test version output.""" import template_python def test_version_output(): """Test that version can be accessed and printed.""" print(f'Version: {template_python.__version__}') assert template_python.__version__ is not None
Python
1
AGE_FILE) # Every patch-worth of predictions we"ll dump an example into the output # file with a single feature that holds our predictions. Since our predictions # are already in the order of the exported data, the patches we create here # will also be in the right order. # patch = [[]] patch = [[], [], [], [], [], []...
Python
1
whole //! underlying array with `as_ref` (see [`std::convert::AsRef`]) and //! `as_mut` (see [`std::convert::AsMut`]). //! //! Usage example: //! //! ```rust //! type Sqrid = sqrid::sqrid_create!(3, 3, false); //! type Qa = sqrid::qa_create!(Sqrid); //! type Grid = sqrid::grid_create!(Sqrid, i32); //! //! // The grid ...
Rust
0
utput).expect("Read sample"), SAMPLE.len()); //!assert_eq!(format!("{0}{0}", SAMPLE), output); //! //!``` //! //!## Simplified API //! //!``` //!use clipboard_win::{formats, get_clipboard, set_clipboard}; //! //!let text = "my sample ><"; //! //!set_clipboard(formats::Unicode, text).expect("To set clipboard...
Rust
0
import json from scipy.spatial import distance import numpy as np def load_tweets_from_json(file_path): with open(file_path, 'r') as file: tweets = json.load(file) # Ensure all embeddings are lists of floats for tweet in tweets: if 'embeddings' in tweet: try: # ...
Python
1
from ...cuda_extension import _CudaExtension from ...utils import get_cuda_cc_flag class InferenceOpsCudaExtension(_CudaExtension): def __init__(self): super().__init__(name="inference_ops_cuda") def sources_files(self): ret = [ self.csrc_abs_path(fname) for fname in [...
Python
1
ost.created_utc, "url": f"https://reddit.com{post.permalink}", "sentiment": sentiment }) posts_analyzed += 1 if posts_...
Python
1
# tests/campaigns/integration/__init__.py """Integration tests for the campaign management module."""
Python
1
4775808; pub const INT_FAST32_MIN: i64 = -9223372036854775808; pub const INT_FAST8_MAX: u32 = 127; pub const INT_FAST16_MAX: u64 = 9223372036854775807; pub const INT_FAST32_MAX: u64 = 9223372036854775807; pub const UINT_FAST8_MAX: u32 = 255; pub const UINT_FAST16_MAX: i32 = -1; pub const UINT_FAST32_MAX: i32 = -1; pub ...
Rust
0
import json import math from tqdm import tqdm # # Đọc file dữ liệu đầu vào laf file jsonl # with open("/home/huuhungn/tuanna/rankllama_eval/tevatron/src/rankllama/patchfinder_phase2/top_100_fusion/top_100_fusion.jsonl", "r") as f: # data = [json.loads(line) for line in f] raw_json_file = "/raid/data/hung/tuanna/...
Python
1
Err(RequestTokenError::Other(_))`. /// pub fn new( client_id: ClientId, client_secret: Option<ClientSecret>, auth_url: AuthUrl, token_url: Option<TokenUrl>, ) -> Self { Client { client_id, client_secret, auth_url, auth_t...
Rust
0
mTrees", 10, 500), "maxDepth": hp.uniformint("maxDepth", 2, 10), } print(f"Tuning the model for {conf['tuning_rounds']} rounds") best_params = tune_rf( train=df_train, val=df_val, string_indexer=ind, vector_assembler=va, evaluator=roc, param_grid=searc...
Python
1
graph, &edges); let pure_edges = compute_edges(&graph, construct_edge_if_pure); add_edges(&mut graph, &pure_edges); let jump_edges = StatefulEdgeBuilder::new().compute_stateful_edges(&graph); add_edges(&mut graph, &jump_edges); let exit = fix_exit_ecall(&mut graph)?; ...
Rust
0
:?}", e))); } } Menu(menu) } } trait ResultNeverExt<T> { fn never_unwrap(self) -> T; } impl<T> ResultNeverExt<T> for Result<T, Infallible> { fn never_unwrap(self) -> T { match self { Ok(inner) => inner, Err(never) => match never {}, } ...
Rust
0
err(); assert_eq!(table.delete(|_k, _v| true).len(), 1); table .insert(|_| 1i64.to_le_bytes().to_vec(), "v5".to_string()) .unwrap(); commit(stash, collection, table.pending())?; let items = stash.peek(collection)?; assert_eq!( items, vec![(1i64.to_le_bytes().to_vec(),...
Rust
0
iteration() { let mut index = ChunkIndex::new(); let pos_a = ChunkPos::new(0, 1, 2); let pos_b = ChunkPos::new(3, 4, 5); let pos_c = ChunkPos::new(15, 15, 15); index.mark(pos_a); index.mark(pos_b); index.mark(pos_c); let considerables: Vec<ChunkPos> = index.iter().collect(); asse...
Rust
0
} } impl PartialOrd for Node { fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.index.cmp(&other.index)) } } impl Ord for Node { fn cmp(&self, other: &Self) -> Ordering { self.index.cmp(&other.index) } } impl From<NodeParts<Hash>> for Node { fn from(parts: No...
Rust
0
32> { // This is quadratic because there are N comparisons for each LCP. // But it is done in constant space. // The first LCP is always 0 because of the definition: // LCP_LENS[i] = lcp_len(suf[i-1], suf[i]) let mut lcps = vec![0u32; table.len()]; let text = text.as_bytes(); for (i, win)...
Rust
0
import torch import torch.nn as nn class TextEncoder(torch.nn.Module): def __init__(self, hidden_size, input_dim, n_layers=1, dropout=0): super(TextEncoder, self).__init__() self.n_layers = n_layers self.hidden_size = hidden_size self.embedding = nn.Embedding(input_dim, sel...
Python
1
: StencilFaceFlags, _write_mask: u32, ); /// <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetVertexInputEXT.html> pub type PFN_vkCmdSetVertexInputEXT = unsafe extern "system" fn( _command_buffer: CommandBuffer, _vertex_binding_description_count: u32, _vertex_binding_descr...
Rust
0
r']).get_ordered_members_list(): unattended_upgrades_config = cluster.fake_fs.read(node.get_host(), '/etc/apt/apt.conf.d/51unattended-upgrades-kubemarine') self.assertIsNotNone(unattended_upgrades_config) self.assertEqual(...
Python
1
on failed:\n{output}') from None def test_cqa_rust_rustfmt(self): edgepath = find_edgedb_root() config_path = os.path.join(edgepath, 'Cargo.toml') if not os.path.exists(config_path): raise RuntimeError('could not locate Cargo.toml file') try: subprocess.run(...
Python
1
desired.shape = (-1, 2) weights = np.ones(len(desired)) M = int(numtaps / 2) # Compute M x M matrix Q (actually twice Q). n = np.arange(numtaps)[:, np.newaxis, np.newaxis] q = np.dot(np.diff(np.sinc(bands * n) * bands, axis=2)[:, :, 0], weights) Q1 = linalg.toeplitz(q[:M]) Q2 = lina...
Python
1
id(80).unwrap(); assert_eq!("Message-Authenticator", dict_attr.name()); assert_eq!("80", dict_attr.code()); assert_eq!(&Some(SupportedAttributeTypes::AsciiString), dict_attr.code_type()); } #[test] fn test_get_dictionary_attr...
Rust
0
mode, offset, len)`—Adjusts file allocation. /// /// This is a more general form of `posix_fallocate`, adding a `mode` argument /// which modifies the behavior. On platforms which only support /// `posix_fallocate` and not the more general form, no `FallocateFlags` values /// are defined so it will always be empty. ///...
Rust
0
e_nonce(&self, kp: &Keypair, input: &H) -> ScalarField { let mut blake_hasher = Blake2bVar::new(32).unwrap(); let mut roi: ROInput = input.to_roinput(); roi.append_field(kp.public.into_point().x); roi.append_field(kp.public.into_point().y); roi.append_scalar(kp.secret.into_scala...
Rust
0
import torch import numpy as np import torch.nn.functional as F from sklearn.cluster import KMeans from sklearn.metrics.pairwise import euclidean_distances from .utils import ActualSequentialSampler from .sampler import register_strategy, SamplingStrategy @register_strategy('LAS') class LASSampling(SamplingStrategy):...
Python
1
tput_dir={output_dir} ' f'--algorithms ERM --datasets Debug28 --n_hparams 1 --n_trials 1 ' f'--command_launcher dummy --skip_confirmation', shell=True, capture_output=True) result = subprocess.run(f'python -m domainbed.scripts.sweep launch ' f'--data_dir={os.envi...
Python
1
a dQ@sddlZddlZddlZddlZddlZddlTddlm Z Gdddej Z e ej ddGdd d ej Zed kredS) N)*) find_libraryc@sDeZdZeddZeddZddZddZd d Zd d Z d S)Test_OpenGL_libsc...
Python
1
nts for source file "b" mock.enqueue( ViceRequest::CheckpointSet(cp(30..34)), &[ViceResponse::CheckpointResponse(cr(30..34, 3))], ); let b_bps = vec![MachineBreakpoint { line: 3, column: None, range: Range { start: 30.i...
Rust
0
x25E3248EDC83190, 0x2BAABD11AA26424, 0x161D23BAC418D32, 0x5B3258247CBFF7, 0xED295CADE03C1F, 0x3A84758C5C741A2, 0x3D207E205E02B9E, 0x86743E24EA6513, 0x1DAA8E268EFA1C4, 0x9E72CE4F, ]; pub const CURVE_PYABA: [Chunk; NLEN] = [ 0x1DC5FD041985C0D, 0x2350136864770FA, 0x3179A5F54...
Rust
0
are `keys` and `values` methods that /// can be used to express that don't need the values or keys. /// /// **Known problems:** None. /// /// **Example:** /// ```ignore /// for (k, _) in &map { /// .. /// } /// ``` /// /// could be replaced by /// /// ```ignor...
Rust
0
5],[5],[5],[5],[5],[5],[5]]).astype(np.float64).transpose()#第一结构 #parameter_mat = np.mat([[5],[5],[5],[5],[4],[4]]).astype(np.float64).transpose() #第二结构 #AFS结构生成 afsstructure = AFS.gen_structure(parameter_mat, mcc) Str_Mat = afsstructure #模糊概念集合,即M集合元素个数 Fuzzy_Set= np.mat([[0,3]]).transpose() #算子选择 Logic_Ind= 1 #ei组合生成...
Python
1
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
nline] pub fn audio_stream_has_finished(stream_id: AudioStreamId) -> bool { get_audio().stream_has_finished(stream_id) } #[inline] pub fn audio_stream_forget(stream_id: AudioStreamId) { get_audio().stream_forget(stream_id) } #[inline] pub fn audio_group_mute(group_id: AudioGroupId) { get_audio().group_mut...
Rust
0
n uncompressed public key must be 65 bytes long" ) with self.assertRaises(InvalidSEC1PublicKey) as e: # invalid prefix value SEC1Encoder.decode_public_key( unhexlify( b"05e5e2c01985aafb6e2c3ad49f3db5ccc54b2e63343af405b521303d0f35835062" ...
Python
1
_ascension_epsilon.sin() / lunar_inclination_sine; // cos Ωₗ = (1 - sin²Ωₗ)¹ᐟ² let lunar_right_ascension_cosine = (1.0 - lunar_right_ascension_sine.powi(2)).sqrt(); // ωₗ = 5.8351514 + 0.001944368 d₁₉₀₀ // 0.39785416 sin Ωₗₑ / sin Iₗ // + tan⁻¹ ----------------------------...
Rust
0
# General DOCKER_ANDROID_VERSION = "DOCKER_ANDROID_VERSION" USER_BEHAVIOR_ANALYTICS = "USER_BEHAVIOR_ANALYTICS" APPIUM = "APPIUM" APPIUM_ADDITIONAL_ARGS = "APPIUM_ADDITIONAL_ARGS" DISPLAY = "DISPLAY" SCREEN_DEPTH = "SCREEN_DEPTH" SCREEN_HEIGHT = "SCREEN_HEIGHT" SCREEN_NUMBER = "SCREEN_NUMBER" SCREEN_WIDTH = "SCREEN_WID...
Python
1
: VkPhysicalDevice, pPropertyCount: *mut u32, pProperties: *mut VkCooperativeMatrixPropertiesNV, ) -> VkResult ; pub const VK_COVERAGE_REDUCTION_MODE_MERGE_NV: VkCoverageReductionModeNV = 0; pub const VK_COVERAGE_REDUCTION_MODE_TRUNCATE_NV: VkCoverageReductionModeNV = 1; pub const VK_COVERAG...
Rust
0
\xfeP#\xbc%\xbe\x9e\xac\x9a&\ \xe595Hs\x0d\x99+?-\xf3\x87\xb3;jI\ \xbd%\xcc\x8b6K\x14\xcf\xac\xcd\xf2>I\x92\xcd@\ \x91\x80\xa4\x19\xa3\xeeO3:iK\xc0\xac&\x90<\ hn\x0d\x02\xcd\xbd$\xef\x11@\xd8\x904IL\xfc\ \xbebpD\x8b0'\x88\xf2\x89\x95\xdds\xa1\xd9\x00\ \xb2\x0b\xb9y\xbf\x00\xed!\xd7\x18I/\x12i\xba(\ Z\x94\x0c(\xf6\xd2\x...
Python
1
ufferEndReached, _MalformedVarint7, _MalformedVarint32, _MalformedVarint64, _MalformedVaruint7, _MalformedVaruint1, _MalformedVaruint32, } <gh_stars>1-10 /// A SOP is a structure that defines a specific plan of transitions / operations that can be used /// by both operations and intentions. The ...
Rust
0
e " + material_name_in_assignation_table + " could not be found in the materials list.") elif pair[1].IsInt(): material_id = pair[1].GetInt() else: raise Exception("While reading the materials assignation table, the material was not identified with a string or an...
Python
1
.map(|_| {}) .map_err(|e| error!("failed to route chat: {:?}", e)); ctx.spawn(f) } } fn main() { let _guard = log_util::init_log(None); let env = Arc::new(Environment::new(2)); let instance = RouteGuideService { data: Arc::new(load_db()), }; let service = route_guide...
Rust
0
xt_item.strip() print(8, write_item) f.write(write_item + '\n') idx += 1 else: while next_item != entities_id_list[entities_idx] and idx < len(content) and '【篇章标识符】' not in next_item: if '登场篇章' in next_item and '【' not in co...
Python
1
5: Agent Swarm Context Enhancement agent_results = await test_instance.test_agent_swarm_context_enhancement(catalog_tools) # Test 6: Cursor Rule Intelligence rule_results = await test_instance.test_cursor_rule_intelligence_enhancement(catalog_tools) # Test 7: MCP Serve...
Python
1
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
Penrose inverse, if it can be computed by /// left or right inverse. SVD as used in Matlab or GNU Octave `pinv` /// is not yet implemented. /// ``` /// let matrix = aicourse::matrix::Matrix::new(3, 5, vec![-1.0, 8.0, 2.0, 8.0, 7.0, /// 5.0, 6.0, ...
Rust
0
""" Database package for the automation framework This package contains database testing base classes and utilities. """ from .base_database_manager import BaseDatabaseManager from .database_managers import ( PostgreSQLManager, MySQLManager, SQLiteManager, MongoDBManager, RedisManager ) __all__ = [ 'Bas...
Python
1
= LunisolarDate::from_solar_date(solar_date).unwrap(); assert_eq!(SolarYear::from_u16(1993), lunisolar_date.get_solar_year()); assert_eq!(LunisolarYear::from_solar_year(1992).unwrap(), lunisolar_date.get_lunisolar_year()); assert_eq!(LunarYear::from_str("壬申").unwrap(), lunisolar_date.get_lunar_year()); ...
Rust
0
def modp(n: int, p: int): """Return 2^n modulo p (be aware of numerics). >>> modp(3, 5) 3 >>> modp(1101, 101) 2 >>> modp(0, 101) 1 >>> modp(3, 11) 8 >>> modp(100, 101) 1 """ return pow(2, n, p) def modp_inv(n: int, p: int): """Return the inverse of n modulo p. ...
Python
1
# Copyright 2020 The HuggingFace Team. 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 # # Unless required by applicabl...
Python
1
5[ US55 US$)Nrr|rrr 3args[0] mask and args[1] mask must match but do notr/rrr(r)rr)r*s r.copy_r1gd.B4&,ITUV Q0/$q'2J K KNOO47 YtAw/0 7Nr1c4[XSU3S...
Python
1
); } #[test] fn it_parse_another_specific_character() { let response = not('b').parse(b"a", 0); assert_eq!(response.fold(|v, _| v == 'a', || false), true); } #[test] fn it_cannot_parse_another_specific_character() { let response = not('a').parse(b"a", 0); asse...
Rust
0
box_center.x + 1.0, box_center.y - 2.4, -1.0 ])); colliders.insert_with_parent(ColliderBuilder::cuboid(0.5, 0.1, 0.5), gravel, bodies); } pub fn init_world(testbed: &mut Testbed) { /* * World */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); ...
Rust
0
# Copyright 2020-, Gavin E. Crooks and contributors # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. import numpy as np import pytest from quantumflow import var funcnames = ["arccos", "arcsin", "arctan", "cos", "exp", "...
Python
1
ld_alias":{}}' } # 验证 RedisTools.hmset_to_redis 是否被正确调用 mock_hmset_to_redis.assert_called_once_with("bkmonitorv3:spaces:result_table_detail", expected) # 验证 RedisTools.publish 是否被正确调用 mock_publish.assert_called_once_with( "bkmonitorv3:spaces:...
Python
1
}; if opt_present(HELP) { println!("{}", usage(&args[0], &opts)); exit(0); } if opt_present(VERSION) { println!("{}", get_version_string()); exit(0); } setup_logging(opt_present(QUIET), opt_present(VERBOSE)); info!("{}", get_version_string()); if !env...
Rust
0
e.timestamp() * 1000) params_1h.size=2 Kline_response_data=fetch_kline(params_1h) if(Kline_response_data.data[1].start_time==unix_time*1000): Kline_response_data.data[0] = Kline_response_data.data[1] # 将 Kline_response_data 转换为字典 # Klinedata_dict = Kline_response_data.model_dump() ...
Python
1
d().expect("dom has no head"); let element = dom.create_element(web_str::style()).expect("can't create style element"); head.append_child(&element).expect("can't append child"); self.style_elements.push(element); } } <reponame>fbsource/mockall // vim: ts=80 #![deny(warnings)] use mockall::*; trait Bar { f...
Rust
0
from django.urls import path from .views import ( AnimalListAPIView, UsuarioListAPIView, SolicitudAdopcionListAPIView, RegistroUsuarioView, SolicitudAdopcionListCreate, SolicitudAdopcionUpdate, PerfilAdoptanteView, EjemploView, ) from rest_framework_simplejwt.views import ( TokenOb...
Python
1
#[derive(Hash, PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] pub struct RootPath(pub AbsPathBuf); impl RootPath { /// `display` the path. pub fn display(&self) -> std::path::Display { self.0.display() } } impl OutputPath<RootPath> { /// Check whether all all GC roots exist. pub fn ...
Rust
0
words = ["Hello,", "Python", "Programming!"] joined_string = "-".join(words) # Join words with a hyphen print("Joined with '-':", joined_string) # List of words words = ["Apple", "Banana", "Cherry", "Date"] # Joining with different characters comma_joined = ", ".join(words) # Using comma and space space_joined = ...
Python
1
mod serde_impls { use serde::{de::Error as DeError, Deserialize, Deserializer, Serialize, Serializer}; use super::LocalCostMatrix; impl Serialize for LocalCostMatrix { fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error> where S: Serializer, { self.bits....
Rust
0
error_type=ParseErrorType.INVALID_FORMAT, ) self.content_pos = match.end() if yaml_dict: try: self.task_status = FrontMatter.model_validate({'task_status': yaml_dict}).task_status except ValidationError as e: self.log.err...
Python
1
N> { fn from(p: &Point<T, N>) -> Self { Self::from_point(*p) } } impl<T: Copy, const N: usize> From<Vector<T, N>> for Point<T, N> { fn from(v: Vector<T, N>) -> Self { Self::from_vector(v) } } impl<T: Copy, const N: usize> From<&Vector<T, N>> for Point<T, N> { fn from(v: &Vector<T,...
Rust
0
).downcast_unchecked(), from_glib(type_), count) } #[cfg(any(feature = "v3_16", feature = "dox"))] unsafe extern "C" fn extend_selection_trampoline<P>(this: *mut ffi::GtkTextView, granularity: ffi::GtkTextExtendSelection, location: *mut ffi::GtkTextIter, start: *mut ffi::GtkTextIter, end: *mut ffi::GtkTextIter, f: gli...
Rust
0
_VERSION != self.checked_with { return NeedsCheck::Yes; } // if true, it is already known that most self version is not latest so // no check is necessary; flag will be reset after updated if self.update_needed { return NeedsCheck::KnownOutdated; } ...
Rust
0