text
string
label_name
string
labels
int64
to_iter() .map(|r| r.uri) .collect(); let expected_links = [ website("https://example.org/some-weird-element"), website("https://example.org/even-weirder-src"), website("https://example.org/even-weirder-href"), website("https://exa...
Rust
0
fault()).unwrap(); let c = b.as_any().downcast_ref::<PrimitiveArray<i32>>().unwrap(); let expected = &[Some(5), Some(6), None, Some(8), None]; let expected = Int32Array::from(expected); assert_eq!(c, &expected); } #[test] fn binary_to_i32_partial() { let array = BinaryArray::<i32>::from_slice(&["5...
Rust
0
bility::MutToMut => "_mut", }; let name = format!( "cast_{}_to_{}{}", from.get_final_item(), to.get_final_item(), suffix ); let name = make_ident(name); QualifiedName::new(from.get_namespace(), name) } // Copyright 2015 <NAME>. // Original code Copyright 2011 The Go A...
Rust
0
!RiskManagerParams::<T>::contains_key(currency_id), Error::<T>::PoolAlreadyCreated ); ensure!( Self::is_valid_liquidation_fee(liquidation_fee), Error::<T>::InvalidLiquidationIncentiveValue ); RiskManagerParams::<T>::insert( currency_id, RiskManagerData { max_attempts, min_partial_liqu...
Rust
0
: BlockNumber, } /// Details surrounding a specific instance of an announcement to make a call. #[derive(Encode, Decode, Clone, Copy, Eq, PartialEq, RuntimeDebug)] pub struct Announcement<AccountId, Hash, BlockNumber> { /// The account which made the announcement. real: AccountId, /// The hash of the call to be mad...
Rust
0
ms |= { "Start edit": BasicKeyHelp("⏎"), "Stop edit": BasicKeyHelp("esc"), "Add row": "Add a row after cursor", "Delete row": "Delete this row", } else: pass bottom_label = "Proxy:" bottom_items: HelpItems = { "Help": "View help", ...
Python
1
@property def vocab_size(self) ->int: """ :obj:`int`: Size of the base vocabulary (without the added tokens). """ raise NotImplementedError
Python
1
from __future__ import absolute_import, print_function, unicode_literals from wolframclient.language.expression import WLInputExpression, WLSymbolFactory wl = WLSymbolFactory() """A factory of :class:`~wolframclient.language.expression.WLSymbol` instances without any particular context. This instance of :class:`~wol...
Python
1
#[inline] pub fn set_NoBiPredFlag(&mut self, val: u32) { self._bitfield_1 &= !(1048576usize as u32); self._bitfield_1 |= ((val as u32 as u32) << 20u32) & (1048576usize as u32); } #[inline] pub fn ReservedBits(&self) -> u32 { unsafe { ::std::mem::transm...
Rust
0
c_Pu': test_mat_vec_Pu, 'test_mat_vec_x': test_mat_vec_x, 'test_mat_vec_y': test_mat_vec_y, 'test_mat_vec_Ax': test_mat_vec_Ax, 'test_mat_vec_Ax_cum': test_mat_vec_Ax_cum, 'test_mat_vec_ATy': test_mat_vec_ATy, 'test_mat_vec_ATy_cum': test_mat_vec_ATy_cum, 'test_ma...
Python
1
elf } } #[doc = "Bit 2 - Digital Comparator Interrupt 2"] #[inline(always)] pub fn adc_dcric_dcint2(&mut self) -> _ADC_DCRIC_DCINT2W { _ADC_DCRIC_DCINT2W { w: self } } #[doc = "Bit 3 - Digital Comparator Interrupt 3"] #[inline(always)] pub fn adc_dcric_dcint3(&mut self) -> _ADC_D...
Rust
0
Index<IVec2> for Array2D<T> { type Output = T; fn index(&self, index: IVec2) -> &Self::Output { &self.elems[index.x as usize][index.y as usize] } } impl<T> IndexMut<IVec2> for Array2D<T> { fn index_mut(&mut self, index: IVec2) -> &mut Self::Output { &mut self.elems[index.x as usize][i...
Rust
0
sc = _("Adding watches for %s") % (fsn2text(unexpand(fullpath))) with Task(_("Library"), desc) as task: normalised = Path(normalize_path(fullpath, True)).expanduser() if any( Path(exclude) in normalised.parents for exclude in exclude_dirs ...
Python
1
#'partition.py' is used to partition input data sets. import numpy as np def partition_data(total_sample_size, num_groups): """Returns an array with values that correspond to the assigned groupings. Parameters ---------- total_sample_size : int Length of the original data set. num_groups...
Python
1
new(folder).is_file() { vec![PathBuf::from(folder)] } else { let is_ps_file = |entry: &DirEntry| -> bool { entry .path() .extension() .map(|ext| { ext.to_st...
Rust
0
"); }, Instruction::EXITVM => { println!("Exit VM"); }, Instruction::STRING => { println!("Unsupported instruction 'STRING' "); } } } } } } fn push(&mut self, value: u8) -> (){ self.stack.push(value); } fn pop(&mut self) -> u8{ let a: Option<u8>=self...
Rust
0
import socket from pynput import keyboard import pygetwindow as gw # Or a similar library for your OS TARGET_TERMINAL_TITLE = "Windows PowerShell" # Replace with the actual title or a substring ctrl_pressed = False all_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`1234567890-=[]\\;',./~!@#$%^&*()_+{}|...
Python
1
move_file(&path); let now = Utc::now(); Data::save_to_file(&path, &now).expect("couldn't write to file"); let what_now: DateTime<Utc> = Data::load_from_file(path).expect("couldn't get value from test file"); assert_eq!(now, what_now); } #[test] fn it_overwrites_...
Rust
0
Layout(self.tab_labels) # Label information section self.label_info_group = QtWidgets.QGroupBox("标签信息") group_font = QFont() group_font.setPointSize(12) group_font.setBold(True) self.label_info_group.setFont(group_font) self.label_info_layout = QtWidgets....
Python
1
import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs, make_moons from sklearn.preprocessing import StandardScaler # Import the CLiMB algorithm and exploratory strategies from CLiMB.core.CLiMB import CLiMB from CLiMB.exploratory.HDBSCANExploratory import HDBSCANExploratory from CL...
Python
1
Self::OC => "OC", Self::SO => "SO", Self::NC => "NC", }.to_string() } } #[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] pub enum RecordType { #[serde(rename = "MEMBER")] Members, #[serde(rename = "DIR")] Directors, #[serde(rename = "DIRCONTR...
Rust
0
_ => { } } wlr_event.delta = libinput_event_pointer_get_axis_value(pevent, axes[i as usize]); wlr_event.delta_discrete = libinput_event_pointer_get_axis_value_discrete(pevent, ...
Rust
0
log_hex((*scb).m_uuidTop); ymh_log_str(" bottom \0"); ymh_log_hex((*scb).m_uuidBottom); ymh_log_nl();*/ // ymh_log_str("Found an SCB\n\0"); } else { ymh_log_str("No SCB-1\n\0"); loop{} } }*/ // only for microbenchmark // if uuid_top == 0x1111111188888888 && uuid_bottom == 0x8888888811111111 {...
Rust
0
sert(Proto::HTTP_CONNECT, cb.clone()); allocator.protocol.insert(Proto::HTTP_DOWNLOAD, cb.clone()); allocator.protocol.insert(Proto::HTTP_PROXY, cb.clone()); } allocator } pub fn default() -> Rc<RefCell<TCPDissector>> { Rc::new(RefCell::new(DefaultDissector {}))...
Rust
0
assert!(context.check_subtype(&bool_expr, &Type::boolean, &Type::boolean)); assert!(context.check_subtype(&string_expr, &Type::string, &Type::string)); assert!(context.check_subtype(&i32_expr, &Type::i32, &Type::i32)); assert!(!(context.check_subtype(&bool_expr, &Type::boolean, &Type::s...
Rust
0
MANIFEST_DIR"), "/tests/text_document_completion/scenarios"); static UPDATE_EXPECT: Lazy<bool> = Lazy::new(|| std::env::var("UPDATE_EXPECT").is_ok()); pub(crate) fn test_scenario(scenario_name: &str) { let mut path = String::with_capacity(SCENARIOS_PATH.len() + 12); let schema = { write!(path, "{}/{}/...
Rust
0
_int; } extern "C" { pub fn unpost_menu(arg1: *mut MENU) -> ::std::os::raw::c_int; } extern "C" { pub fn menu_request_by_name(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { pub fn set_menu_spacing( arg1: *mut MENU, arg2: ::std::os::raw::c_int, arg3: ::s...
Rust
0
:OneColumn), b"TwoColumnLeft" => Ok(PageLayout::TwoColumnLeft), b"TwoColumnRight" => Ok(PageLayout::TwoColumnRight), b"TwoPageLeft" => Ok(PageLayout::TwoPageLeft), b"TwoPageRight" => Ok(PageLayout::TwoPageRight), _ => bail!(ErrorKind::InvalidPageLayout(i.clone...
Rust
0
len = if column_iter.len() == 0 {1} else {column_iter.len()}; ValueIterator{ scope: table_id, table: table_rc.clone(), row_index: row_index, column_index: column_index, raw_row_iter: row_iter.clone(), raw_column_iter: column_iter.clone(), row_iter: IndexRepeater::new(row_it...
Rust
0
esultsCursor, ResultsVisitor, }; use crate::util::pretty::{create_dump_file, dump_enabled}; /// A dataflow analysis that has converged to fixpoint. pub struct Results<'tcx, A> where A: Analysis<'tcx>, { pub analysis: A, pub(super) entry_sets: IndexVec<BasicBlock, A::Domain>, } impl<A> Results<'tcx, A> whe...
Rust
0
pecs.append(spec) except json.JSONDecodeError: continue return specs async def handle_slack_query(event, say): user = event["user"] text = event.get("text", "") thread_ts = event.get("thread_ts") or event["ts"] channel = event["channel"] await say(text=f"<@{user}>: Let...
Python
1
elf.communication() # 接下来是写论文的过程 self.write() articles = [agent_group["content"] for agent_group in self.agent_groups] for idx in range(0, len(articles), 20): sub_articles = articles[idx:idx+20] return_msg = self.call_manager_agent_func(func_nam...
Python
1
# -*- coding: utf-8 -*- # Copyright 2025 Google LLC # # 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...
Python
1
, ( "total_time", stats.total_time.swap(0, Ordering::Relaxed) as i64, i64 ), ( "epoch_fetch", stats.epoch_fetch.swap(0, Ordering::Relaxed) as i64, i64 ), ( ...
Rust
0
try: from jose.backends.cryptography_backend import get_random_bytes # noqa: F401 except ImportError: try: from jose.backends.pycrypto_backend import get_random_bytes # noqa: F401 except ImportError: from jose.backends.native import get_random_bytes # noqa: F401 try: from jose.backen...
Python
1
# Copyright 2025 Bytedance Ltd. and/or its affiliates # # Copyright 2025 The Qwen Team and The HuggingFace Inc. team # # 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....
Python
1
a `GET` to the `/teams/{team_id}/repos/{owner}/{repo}` endpoint. * * **Note**: Repositories inherited through a parent team will also be checked. * * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use th...
Rust
0
} /// Computes the determinant of a matrix. pub fn mat2x3_det<T>(mat: Matrix2x3<T>) -> T where T: Copy + Mul<T, Output = T> + Sub<T, Output = T> { mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0] } /// Computes the determinant of a matrix. pub fn mat3x2_det<T>(mat: Matrix3x2<T>) -> T where T: Copy + M...
Rust
0
t can be stored in /// the heap can be sent to other threads (by sending the whole heap). So /// don't implement this trait for any type that isn't itself already /// `Send`. (The reason this trait doesn't *require* `Send` is that at /// present, `Ref` types must *not* be `Send` but must implement /// ...
Rust
0
for &'a Subcommand<'a> { fn from(parsed_subcommand: ParsedSubcommand<'a>) -> Self { parsed_subcommand.inner } } impl<'a> From<ParsedSubcommand<'a>> for Vec<ParsedSubcommand<'a>> { fn from(parsed_subcommand: ParsedSubcommand<'a>) -> Self { parsed_subcommand.subcommands } } impl<'a> Fro...
Rust
0
G': [('AC', 6), ('AF', 5), ('AK', 4)], 'AH': [('AD', 5), ('AL', 6), ('AI', 4)], 'AI': [('AE', 3), ('AH', 4), ('AM', 2)], 'AJ': [('AF', 2), ('AN', 5), ('AK', 4)], 'AK': [('AG', 4), ('AJ', 4), ('AO', 3)], 'AL': [('AH', 6), ('AP', 7), ('AM', 5)], 'AM': [('AI', 2), ('AL', 5), ('AQ', 5)], 'AN': [...
Python
1
""" Based on the differentiable Top-K operator from: Cordonnier, J., Mahendran, A., Dosovitskiy, A.: Differentiable patch selection for image recognition. In: IEEE Conference on Computer Vision and Pattern Recog- nition (CVPR 2021) https://openaccess.thecvf.com/content/CVPR2021/supplemental/Cordonnier_Differentiable_...
Python
1
., 9., 64., 50.]; let p = a.as_ptr(); let r = _mm512_loadu_pd(black_box(p)); let e = _mm512_setr_pd(4., 3., 2., 5., 8., 9., 64., 50.); assert_eq_m512d(r, e); } #[simd_test(enable = "avx512f")] unsafe fn test_mm512_storeu_pd() { let a = _mm512_set1_pd(9.); let...
Rust
0
#!/usr/bin/env python3 """ Script de prueba para validar los cálculos de temperatura NTC """ import math # Constantes del Arduino (mismo valores) SERIES_RESISTOR = 10000.0 # 10kΩ NOMINAL_RESISTANCE = 10000.0 # 10kΩ NOMINAL_TEMPERATURE = 25.0 # 25°C B_COEFFICIENT = 3950.0 def calculate_temperature_old(adc_value): ...
Python
1
y /// /// This is a C API function, so it is unsafe. #[no_mangle] pub unsafe extern "C" fn tectonic_flate_free_decompressor(handle: *mut libc::c_void) { let _dc = Box::from_raw(handle as *mut Decompressor); // The box will be freed as we exit. } <gh_stars>10-100 use crate::misc::WriteExt; use crate::ser::{to_wr...
Rust
0
# 6 - Algoritmo de Cálculo de Desconto: # Desenvolva um algoritmo que calcule o preço de um produto # após aplicar um desconto. Solicite o preço original e o percentual # de desconto. pre_ini = 0 desc =
Python
1
::ops::Deref for DIN1_NUM_R { type Target = crate::FieldReader<u8, u8>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `DIN1_NUM` writer - the input signals are delayed by SPI module clock cycles, 0: delayed by 1 cycle, 1: delayed by 2 cycles,... Can be configure...
Rust
0
, #[doc = "1: The EMC uses a clock at half the rate of the CPU."] THE_EMC_USES_A_CLOCK = 1, } impl From<EMCDIV_A> for bool { #[inline(always)] fn from(variant: EMCDIV_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `EMCDIV`"] pub type EMCDIV_R = crate::R<bool, EMCDIV_A>; impl EM...
Rust
0
one, for example. SetSequentialFocusNavigationStartingPoint, /// Replace the value of the control with the specified value and /// reset the selection, if applicable. Requires [`ActionRequest::data`] /// to be set to [`ActionData::Value`]. SetValue, ShowContextMenu, } #[derive(Clone, Copy, D...
Rust
0
use core::{ptr, mem, cmp, ops::Drop, time::Duration}; pub use self::addr::*; // TODO: There are no timeouts anywhere (e.g. connect, read, write etc.). Add timeouts at all those places pub struct TcpStream { tcp4_stream: Tcp4Stream, } fn for_ip4_only<A: ToSocketAddrs, F: FnMut(SocketAddrV4) -> Result<S>, S>(addr: ...
Rust
0
f.bar) // } // } impl<$($param),*> OptGetter<[<FIELD_ $field_name>]> for $struct_name<$($param),*> { fn get(&self) -> Option<&Field<Self, [<FIELD_ $field_name>]>> { match self { $cons_name(ref $field_name) => Some($field_name), _ ...
Rust
0
label_pair.get_name() == label_name && label_pair.get_value() == label_value }) }) .map(|mf| mf.get_counter().get_value() as u64) }) .next() .unwrap_or(0) } fn counts(metric_id: crate::metrics::MetricId) -> HashMap<ReqRepId, u6...
Rust
0
#!/usr/bin/env python3 # # MMGen Wallet, a terminal-based cryptocurrency wallet # Copyright (C)2013-2025 The MMGen Project <mmgen@tuta.io> # Licensed under the GNU General Public License, Version 3: # https://www.gnu.org/licenses # Public project repositories: # https://github.com/mmgen/mmgen-wallet # https://git...
Python
1
r1cs.num_inputs, r1cs.num_constraints, )?; let (encode, encode_comm) = super::spark::encode::<G, R>(&params, &r1cs, rng)?; Ok(Parameters { params, r1cs, encode, encode_comm, }) } pub fn create_random_proo...
Rust
0
append() { remove_output_file("./tests/append.txt"); assert_wait!( ubend!(echo "first line" > "./tests/append.txt"). expect("spawn failed")); assert_file_contens!("./tests/append.txt", "first line\n"); assert_wait!( ubend!(echo "second line" >> "./tests/append.txt"). expect("spawn failed")); assert_fi...
Rust
0
tcr) }); } fn init_led_ctrl() { let peripherals = unsafe { Peripherals::steal() }; // Setup pinmux for ct16b1 timer. peripherals.IOCON.pio0_21.write(|v| v .func().ct16b1_mat0() .mode().floating()); // Initialize ct16b1 timer. peripherals.SYSCON.sysahbclkctrl.modify(|_, v| v.ct16b1...
Rust
0
return for remote_odb, obj_ids in odb_to_obj_ids.items(): assert remote_odb is not None num_removed = ogc(remote_odb, obj_ids, jobs=jobs, dry=dry) if num_removed: get_index(remote_odb).clear() logger.info("Removed %d objects from remote.", num_removed) ...
Python
1
().mode(compu::decoder::zlib::ZlibMode::Zlib); impl_compu_bytes!(compu::decoder::zlib::ZlibDecoder::new(&options), body, limit); }, _ => { let mut buffer = bytes::BytesMut::with_capacity(buffer_size); while let Some(chunk) = matsu!(body.data()) { let ...
Rust
0
( 'client_ipv6_pool', vpn_config): if dict_search('server_type', vpn_config) == 'ipoe': if 'interface' in vpn_config: for interface, interface_config in vpn_config['interface'].items(): if dict_search('client_subnet', interface_conf...
Python
1
} #[derive(Debug, PartialEq, Clone)] pub struct BinaryOperation<'a> { pub left: Box<Expr<'a>>, pub operator: Span<'a>, pub right: Box<Expr<'a>>, } #[derive(Debug, PartialEq, Clone)] pub struct UnaryOperation<'a> { pub expr: Box<Expr<'a>>, pub operator: Span<'a>, pub is_post: bool, } #[derive...
Rust
0
# -*- coding: utf-8 -*- """ Test Russian language parsing. """ from nose.tools import assert_equal from aloe.parser import Feature SCENARIO = u""" Сценарий: Сохранение базы курсов универитета в текстовый файл Допустим имеем в базе университет следующие курсы: | Название | Длительность | ...
Python
1
from flask import Flask, request, jsonify import smtplib import os from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart app = Flask(__name__) # Email configuration sender_email = "2022kucp1033@iiitkota.ac.in" smtp_server = "smtp.gmail.com" smtp_port = 587 smtp_username = "2022kucp1033@i...
Python
1
bb, ba = list(map(int, input().replace(","," ").split())) sb,sa = list(map(int, input().replace(","," ").split())) gb, ga = list(map(int, input().replace(","," ").split())) pb, pa = list(map(int, input().replace(","," ").split())) sp = 0 gp = 0 pp = 0 newp = pa - pb pp += newp gb -= newp newg = ga - gb gp += newg sb -...
Python
1
gs) > 1: # pragma: no cover logger.warning( 'Message "%s" has too many unknown extra_tags: [%s]. Only one is expected.' ' Using [%s] as the message code.', message.message, cleaned_extra_tags, code, ) return...
Python
1
}] class EinsUndEinsTVLiveIE(EinsUndEinsTVBaseIE): _VALID_URL = _create_valid_url(EinsUndEinsTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live') _TYPE = 'live' _TESTS = [{ 'url': 'https://1und1.tv/channels/german?channel=srf_zwei', 'only_matching': True, }, { 'url': 'https://1u...
Python
1
s", default=1e-3) parser.add_argument("--meta_learning_rate", type=float, help="learning rate for warp-layers", default=1e-3) parser.add_argument("--meta_update_ival", type=int, help="Meta-update interval", default=30) args = parser.parse_args() argvars =...
Python
1
"&amp;"); } b'"' => { res.extend(b"&quot;"); } b'\'' => { res.extend(b"&#x27;"); } b'/' => { res.extend(b"&#x2f;"); } _ => panic!("incorrect indexing"), } } if ...
Rust
0
::key::Left if mods_are_active(xkb_state, vec![Modifier::Shift, Modifier::Control]) => { let wm = unsafe { &mut *_wm }; if let Some(focused_window) = wm.focused_window { let workspace = wm .workspaces .get_mut(&wm.get_workspace_id_by_window(focused_window).unwrap()) .u...
Rust
0
s != 0 { key = Key::Ctrl(Box::new(key)); } Some(key) }; let char_mod = |c: char| { if e.dwControlKeyState & wincon::SHIFT_PRESSED == 0 { Key::Char(c.to_lowercase().next().unwrap()) } else { Key::Char(c.to_uppercase().next().unwrap()) } ...
Rust
0
import gradio as gr import json from calculator_agent import executor # Load branding with open('branding.json') as f: brand = json.load(f)['brand'] def chat_with_agent(message, history): """Function to handle chat interactions with the agent""" try: result = executor.invoke({"input": message}) ...
Python
1
c3b723eb72a7b2695f0c5783967e4ada3c2e03063b6667")), // AccountId::from(hex_literal::hex!("8e6b05faae0439872dd8d8fd18f259fb69ba066f840d0b2c3c42ce68bee23a3c")), // AccountId::from(hex_literal::hex!("a8d7c781a475ffc836f64ccfebab805481d8978cc4ceec591fa3da61ad42c057")), // AccountId::from(hex_literal::hex!("6eb25d2d...
Rust
0
=> res, } } fn operator(&mut self) -> Result<Option<TokenType>, Error> { let start = self.pos; let mut prev_pos = self.pos; let mut op = self.current_char(); let mut res = None; loop { match OPERATORS.binary_search_by_key(&op, |t| t.0) { ...
Rust
0
izer_teacherHead, optimizer_studentHead=optimizer_studentHead, train_bagloader=train_loader_bag, train_instanceloader=train_loader_instance, test_bagloader=val_loader_bag, test_instanceloader=val_loader_instance, writer=writer, num_epoch=args.epochs, ...
Python
1
iddle_diff) # print 'cnn angle: %.4f, true angle: %.4f, diff: %.5f'%(cnn_laser[0], s[0][0], angle_diff) # print 'cnn to_middle: %.4f, true to_middle: %.4f, diff: %.5f'%(cnn_laser[1], s[0][1], to_middle_diff) # if ep_steps > 35: # # subplot 1 # fig.canvas.restore_region(...
Python
1
e [cap11](cap11) module"] pub type CAP11 = crate::Reg<u32, _CAP11>; #[allow(missing_docs)] #[doc(hidden)] pub struct _CAP11; #[doc = "`read()` method returns [cap11::R](cap11::R) reader structure"] impl crate::Readable for CAP11 {} #[doc = "`write(|w| ..)` method takes [cap11::W](cap11::W) writer structure"] impl crate...
Rust
0
g, PartialEq)] #[must_use] pub enum HashUpdate { /// Password verification succeeded, with new string if migration was /// performed Verified(Option<String>), /// Password verification failed Failed, } /// Verifies a supplied password against a previously computed password hash, /// and performs an...
Rust
0
entries, i) } else { entries } } fn reduce(mut entries: Vec<Entry>) -> Vec<Entry> { while can_reduce(&entries) { entries = reduce_once(entries); } entries } fn add(lhs: Vec<Entry>, rhs: Vec<Entry>) -> Vec<Entry> { let mut sum = Vec::with_capacity(lhs.len() + rhs.len()); for...
Rust
0
ignation for US securities options and Options Clearing Corporation #[serde(rename = "orderOrigination", skip_serializing_if = "Option::is_none")] pub order_origination: Option<f32>, /// order preview required #[serde(rename = "preview", skip_serializing_if = "Option::is_none")] pub preview: Option<...
Rust
0
let str_ptr = (*current_host_node).ai_canonname; if !str_ptr.is_null() { let canonname_cstr = std::ffi::CStr::from_ptr(str_ptr); let canonname_bytes = canonname_cstr.to_bytes_with_nul(); let str_size = canonname_bytes.len(); ...
Rust
0
impl std::fmt::Display for KeyringError { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { KeyringError::ParseConfig(s) => write!(f, "Failed to parse list of keys: {}", s), KeyringError::PublicKeyChecksum => write!(f, "Public key checksum did not match."...
Rust
0
::new(metaloadfn("glGenFramebuffers", &["glGenFramebuffersEXT"])), GenLists: FnPtr::new(metaloadfn("glGenLists", &[])), GenQueries: FnPtr::new(metaloadfn("glGenQueries", &["glGenQueriesARB"])), GenRenderbuffers: FnPtr::new(metaloadfn("glGenRenderbuffers", &["glGenRenderbuffersEXT"])), GenSamplers: FnPtr::new(metaloadfn...
Rust
0
crate rmp_serialize as msgpack_coders; pub mod hash; // https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/ #![allow(dead_code)] use std::rc::Rc; use std::cell::RefCell; type BSTNode = Option<Rc<RefCell<TreeNode>>>; #[derive(Debug, PartialEq, Eq)] pub struct TreeNode { pub va...
Rust
0
# market_data.py import yfinance as yf import streamlit as st def get_market_data(symbol): stock = yf.Ticker(symbol) hist = stock.history(period="2d") current_price = hist['Close'][-1] previous_price = hist['Close'][-2] change = ((current_price - previous_price) / previous_price) * 100 return ...
Python
1
widgets.push(Box::new(widget)); } } impl<'a> Widget for Scene<'a> { fn draw(&self, stdout: &mut Stdout, theme: &Theme) -> Result<()> { for widget in &self.widgets { widget.draw(stdout, theme)?; } Ok(()) } fn on_key_event(&mut self, event: KeyEvent) -> Result<()> { ...
Rust
0
import heapq def restricted_sorting(stacks, costs): # Step 1: Initialize a dictionary to keep track of the number of blocks of each color. colors_count = {} # Step 2: Iterate over the list of stacks and for each stack, iterate over each block. for i, stack in enumerate(stacks): for color in s...
Python
1
Replace any existing runner with the same name (default false) --pat GitHub personal access token used for checking network connectivity when executing `./run.sh --check` */ .arg("--unattended") .arg("--url") .arg(target.runner_fragment()) .arg("--t...
Rust
0
&Vector3::z_axis(), 0.0 ) ); } } }<filename>rust/src/7.rs // By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is // 13. // // What is the 10 001st prime number? fn is_prime(number:u32) -> bool { for i ...
Rust
0
new_df["Enabled"]].drop(columns=["Enabled"]) enabled_objects.columns = enabled_objects.columns.str.lower() try: _ = api_call.patch( endpoint="v1/selectai/objects", payload={"json": json.loads(enabled_objects.to_json(orient="records"))} ) logger.info("S...
Python
1
match_as_path_list = v.groupdict()['match_as_path_list'] rpl_route_policy_dict[name]['statements'][statements]['conditions'] \ ['match_as_path_list'] = match_as_path_list if 'as-path length' in m.groupdict()[cond]: ...
Python
1
import pytest from django.urls import reverse from adhocracy4.test.factories import PhaseFactory from adhocracy4.test.helpers import assert_template_response from adhocracy4.test.helpers import freeze_phase from adhocracy4.test.helpers import setup_phase from adhocracy4.test.helpers import setup_users from apps.mapide...
Python
1
"""In this example, the pipeline is defined in a JSON ('simple_kg_pipeline_config.json') or YAML ('simple_kg_pipeline_config.yaml') file. According to the configuration file, some parameters will be read from the env vars (Neo4j credentials and the OpenAI API key). """ import asyncio import logging ## If env vars ar...
Python
1
_path(&p[1..])?)), "Indian" => Ok(Self::Indian(Indian::try_from_path(&p[1..])?)), "Mexico" => Ok(Self::Mexico(Mexico::try_from_path(&p[1..])?)), "Pacific" => Ok(Self::Pacific(Pacific::try_from_path(&p[1..])?)), "US" => Ok(Self::US(US::try_from_path(&p[1..])?)), ...
Rust
0
# -*- coding: utf-8 -*- #Canto - RSS reader backend # Copyright (C) 2016 Jack Miller <jack@codezen.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. import logging log...
Python
1
WS_POLICY_PROPERTY_MAX_ALTERNATIVES: WS_POLICY_PROPERTY_ID = 2i32; #[doc = "*Required features: `\"Win32_Networking_WindowsWebServices\"`*"] pub const WS_POLICY_PROPERTY_MAX_DEPTH: WS_POLICY_PROPERTY_ID = 3i32; #[doc = "*Required features: `\"Win32_Networking_WindowsWebServices\"`*"] pub const WS_POLICY_PROPERTY_MAX_E...
Rust
0
""" the module to access networks この module はネットワークアクセスを行い、問題の HTML やサンプルケースを取得します。 """ from logging import getLogger from typing import * import requests import onlinejudge import onlinejudge.utils from onlinejudge_template.types import * logger = getLogger(__name__) def download_html(url: str, *, session: Opti...
Python
1
() { assert_eq!( self.last_vram_read.get(), expected_vram_read ); } } fn scanline( &self ) -> u16 { self.state.n_scanline } fn dot( &self ) -> u16 { self.state.n_dot } } rp2c02_testsuite!( Instance ); } use std::colle...
Rust
0
_MODULES_DIR_NAME).join("UNBUNDLE"); if !unbundle_file_path.is_file() { return false; } let mut unbundle_file = match File::open(unbundle_file_path) { Ok(file) => file, Err(_) => return false, }; let mut bundle_magic = [0; 4]; if unbundle_file.read_exact(&mut bundle_magi...
Rust
0
lHandlerId; } impl<O: IsA<DeviceParams>> DeviceParamsExt for O { fn period_denominator(&self) -> u64 { glib::ObjectExt::property(self.as_ref(), "period-denominator") } fn set_period_denominator(&self, period_denominator: u64) { glib::ObjectExt::set_property(self.as_ref(), "period-denominat...
Rust
0
.title.clone(), None, pages::Chapter::new( partials::StoryPartial::new(&id, story, None)?, &chapter, index, ), ); Ok(crate::res!(200; body)) }) } <filename>parameterized-macro/tests/cases.rs #[test] fn individual_ca...
Rust
0
}, got {:?}", i, wterm, t); } } } #[test] fn test_storage_entries() { let ents = vec![new_entry(3, 3), new_entry(4, 4), new_entry(5, 5), new_entry(6, 6)]; let max_u64 = u64::max_value(); let mut tests = vec![ (2, 6, max_u64, Err(RaftError::Store(Stora...
Rust
0