text
string
label_name
string
labels
int64
_refresh=true&markers=size:mid%7Ccolor:0x009fff%7Clabel:B%7C{2},{3}&key={4}">" <table> <tr> <th>P</th> <th>Lat</th> <th>Lng</th> </tr> <tr> <td>1</td> <td>{0}</td> <td>{1}</td> </tr> <tr> <t...
Rust
0
t_doc_from_string(s: String) -> document_Document { document_Document {x: Document::from(s)} } pub fn document_doc_from_u64(u: u64) -> document_Document { document_Document {x: Document::from(u)} } pub fn document_doc_from_s64(s: i64) -> document_Document { document_Document {x: Document::from(s)} } pub ...
Rust
0
serError> { self.read_demand_whitespace("Expected space after ON")?; self.read_demand_keyword(Keyword::Error)?; self.read_demand_whitespace("Expected space after ERROR")?; self.read_demand_keyword(Keyword::GoTo)?; self.read_demand_whitespace("Expected space after GOTO")?; ...
Rust
0
erBuilder<'b, S, F, R> where 'a: 'b, C: FnMut(&Context<F>) + 'b, { SolverBuilder { callback: Box::new(callback), ..self } } /// Create the task and run the algorithm, which may takes a lot of time. #[must_use = "the result cannot access unless...
Rust
0
def get_constant_schedule_with_warmup(*args, **kwargs): requires_backends(get_constant_schedule_with_warmup, ['torch'])
Python
1
from django.contrib import admin from watchlist_app.models import WatchList, StreamPlatform # Register your models here. admin.site.register(WatchList) admin.site.register(StreamPlatform)
Python
1
e(User.telegram_id == message.from_user.id) ) if not user: await message.reply( "❌ Пользователь не найден. Пожалуйста, используйте /start для создания аккаунта.", reply_markup=InlineKeyboardMarkup(inline_keyboard=[ [InlineKeyboardButton(text="⬅️ Отмена", callback...
Python
1
viewport_transform, layer_handle, &mut render_state); render_layer.extend(render_state.update_from_state(&RenderStreamState::new())); render_layer.extend(send_vertex_buffers); Some(render_layer) }) }; // Update the layer ID to continue iterat...
Rust
0
import openpyxl import pandas as pd from openpyxl.utils.dataframe import dataframe_to_rows def create_pivot_table(excel_path, source_sheet, target_sheet, row_labels, col_labels, aggfunc): """ Creates a simulated pivot table in an Excel file using openpyxl and pandas. Args: - excel_path: str - Path to...
Python
1
e(),b).len() == 0 } }, } }).count() == 0 }, _ => false, } } #[allow(dead_code)] fn is_win(banmen:&Banmen,teban:&Teban,m:&Move) -> bool { match m { &Move::To(_,KomaDstToPosition(dx,dy,_)) => { match banmen { &Banmen(ref kinds) => { match teban { &Teban::Sente =...
Rust
0
values } => ( DataType::Unsigned, Data::UnsignedPoints(UnsignedPointsFrame { timestamps, values }), ), series::Data::BooleanPoints { timestamps, values } => ( DataType::Boolean, Data::BooleanPoints(BooleanPointsFrame { timestamps, values }), ), ...
Rust
0
ataLoader. Here we use the h_wntr to get h_star by masking all values other than the reservoirs. """ test_dataset, h_wntr = load_dataset(wds_test, n_nodes, reservoirs) test_loader = DataLoader(test_dataset, batch_size=args.batch_size, shuffle=False) """" Evaluating and saving the results f...
Python
1
import numpy as np import matplotlib.pyplot as plt from pyhawkes.models import DiscreteTimeNetworkHawkesModelSpikeAndSlab, DiscreteTimeStandardHawkesModel def sample_from_network_hawkes(C, K, T, dt, B): # Create a true model p = 0.8 * np.eye(C) v = 10.0 * np.eye(C) + 20.0 * (1-np.eye(C)) c = (0.0 * (...
Python
1
ts_v9/fdiv_v4_anglebased_top5", valid_vs=[ np.array([0.965926, 0.258819]), # 15° np.array([0.984808, 0.173648]), # 10° np.array([0.939693, 0.342020]), # 20° np.array([0.996195, 0.087156]), # 5° np.array([0.906308, 0.422618]) # 25° ], valid_angles=[15, 10, 20, 5,...
Python
1
filename) with open(basename + '.json', "w", encoding="utf8") as file: json.dump(metadata, file, indent=4, ensure_ascii=False) def save_user_metadata(self, name, desc, notes): user_metadata = self.get_user_metadata(name) user_metadata["description"] = desc user_metadata...
Python
1
assert_eq!(map.get("c"), None); /// # } /// ``` /// /// [`BTreeMap`]: std::collections::BTreeMap #[macro_export] macro_rules! btmap { () => { ::std::collections::BTreeMap::new() }; ( $($key: expr => $value: expr),+ $(,)? ) => {{ let mut map = ::std::collections::BTreeMap::new(); $( ...
Rust
0
eate a udev rule to allow user of a certain /// group to write to the file. The example below will allow all users in /// the `input` group to change the brightness of all devices in `/sys/class/leds/`. /// /// ```ignore /// ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chgrp input /sys/class/leds/%k...
Rust
0
retriever = db.as_retriever( search_type="similarity_score_threshold", search_kwargs={"k": 1, "score_threshold": 0.1}, ) relevant_docs = retriever.invoke(query) # Display the relevant results with metadata print(f"\n--- Relevant Documents for {store_name} ---") ...
Python
1
[ pem::Pem { tag: "CERTIFICATE".to_owned(), contents: cert.to_owned(), }, pem::Pem { // Technically it can be non-RSA PRIVATE KEY tag: "RSA PRIVATE KEY".to_owned(), contents: key.to_owned(), }, ]); fs::write(&cert_file,...
Rust
0
ange_frame(Slot(2), SlotDuration::from_secs(4)) /// ``` /// pub fn change_frame(&self, slot: Slot, duration_per_slot: SlotDuration) -> Self { let d = Duration::from_secs(slot.0 * self.slot_duration.0); let new_timeline = self.timeline.advance(d); TimeFrame { timeline: new...
Rust
0
ch64", target_arch = "x86_64"))] impl ::core::clone::Clone for SCSI_PASS_THROUGH_DIRECT32 { fn clone(&self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: `\"Win32_Storage_IscsiDisc\"`*"] #[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))] pub struct SCSI_PASS_THROUGH_DIRECT32_EX {...
Rust
0
# https://leetcode.com/problems/binary-trees-with-factors/ # Explanation: https://raw.githubusercontent.com/SamirPaulb/assets/main/823-Binary-Trees-With-Factors_explanation.png ''' class Solution: def numFactoredBinaryTrees(self, arr: List[int]) -> int: arr.sort() countDict = {ch:1 for ch in arr} ...
Python
1
s=1e-6, loss_window=100, no_improvement_patience=1000, patience=5, randomize_parameter=1e-6, info_string_every=10) ...
Python
1
# Apply testing limit if set max_properties = TEST_MAX_PROPERTIES if TEST_MAX_PROPERTIES else 500 property_urls = scrape_property_urls(search_urls, max_links=max_properties) if not property_urls: print("No properties found") return print(f"Found {len(property_urls)} properties") ...
Python
1
s-site', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Linux; Android 12; RMX2121) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Mobile Safari/537.36', 'sec-ch-ua': '"Chromium";v="107", "Not=A?Brand";v="24"', 'sec-ch-ua-mobile': '?1', 'sec-ch-ua-platform': '"Android"',}) as resp: ...
Python
1
h, d0, self.disp_jitter, alpha, rng=self.rng, bump_ratio=self.bump_ratio, tilt_ratio=0.0, noise_ratio=self.noise_ratio ) # 회전 patch_r, alpha_r, disp_r = _rotate_triplet(patch, alpha, disp_patch, rot_angle) rh, rw = patch_r.shape[:2] # 코너 정렬 x‑tilt 추가 (이미지 좌표계) ...
Python
1
import random # s_char for small letters s_char = "abcdefghijklmnopqrstuvwxyz" # b_char for capital letters b_char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" # d_char for digits d_char = "123456789" class Otp: def __init__(self, len): self.len = len # this method generate number otp @property def digits...
Python
1
8aa6437e90f04, "r7nbnt1rx47h", -28.096233881, 156.02985314}, {0x6bb2d8cdc72ad95e, "eftejmf75cdp", 14.621953772, -3.281658328}, {0x971e33c2b61d343e, "kwg37hpq3nu3", -6.788441405, 27.2121537}, {0xa006ff78ee7f75ca, "n03gyy7fgxuw", -87.899723375, 92.762874736}, {0x715fcd43e48514f9, "f5gwuhz4...
Rust
0
g level tokens. pub stack: Vec<StackTokens>, // Track the object names of the current object level. // This structure operates together with the `stack` vector // assigning each element of `object_member_names` to a // distinct element on `stack` when the `stack` element is // `StackTokens::BeginObject`. ...
Rust
0
kernel text for phys_addr in (__text.address()..__text_end.address()).step_by(paging::L0_PAGE_SIZE) { let virt_addr = phys_addr + virt_offset; paging::map(virt_addr, phys_addr, paging::Permissions::ReadExecute, true).unwrap(); } // Map the read-only data for phys_addr in (__ro_data.add...
Rust
0
info.data.borrow_mut())?; assert_uninitialized(&pack_card)?; let token_metadata_program_id = mpl_token_metadata::id(); // Check for v2 let master_edition = MasterEditionV2::from_account_info(master_edition_info)?; pack_set.add_card_volume(weight.into(), max_supply, &master_edition)?; let mas...
Rust
0
from models_app.models.comment.models import Comment from models_app.models.image.models import Image from models_app.models.like.models import Like from models_app.models.post.models import Post from models_app.models.status.models import Status from models_app.models.user.models import User
Python
1
from_u32(1) } /// Generate a random field element uniformly. pub fn random<R: Rng>(rng: &mut R) -> Self { Self([ Fp::random(rng), Fp::random(rng), Fp::random(rng), Fp::random(rng), ]) } /// Returns the constant portion of a [Fp]. ...
Rust
0
import pywikibot, json, re # Protege blocos sensíveis (<nowiki>, <pre>, <code>, comentários etc.) def proteger_blocos(texto): blocos_protegidos = {} def proteger(match): chave = f"__BLOCO_{len(blocos_protegidos)}__" blocos_protegidos[chave] = match.group(0) return chave padrao = r'...
Python
1
if test_loss < best_test_loss: best_test_loss = test_loss model_dict = model.state_dict() if save_path: torch.save(model_dict, os.path.join(save_path, f'best_{prefix}_{best_test_loss}.pth')) print(f"Model saved at {os.path.join(save_path, f'best_{prefix}_{best_...
Python
1
"""FourDirections""" def main(): """FourDirections main""" text = input() up = [ " * ", " *** ", "* * *", " * ", " * " ] down = [ " * ", " * ", "* * *", " *** ", " * " ] left = [ " * ", ...
Python
1
checkpoint).mkdir(parents=True, exist_ok=True) # ============================== # Launch Distributed Environment # ============================== colossalai.launch_from_torch() coordinator = DistCoordinator() # update the learning rate with linear scaling # old_gpu_num / old_lr = new_gpu_n...
Python
1
{} /// Called when the plugin is about to be unloaded. /// Any clean-up should be done here. fn on_unload(&mut self) {} } /// Declares the required functions for initialising a plugin. #[macro_export] macro_rules! declare_plugin { ($plugin_type:ty, $constructor:path) => { #[no_mangle] ...
Rust
0
linux_raw) unsafe fn syscall5_readonly( nr: SyscallNumber, a0: ArgReg<A0>, a1: ArgReg<A1>, a2: ArgReg<A2>, a3: ArgReg<A3>, a4: ArgReg<A4>, ) -> RetReg<R0> { rsix_reordered_syscall5(a0, a1, a2, a3, a4, nr) } #[inline] #[must_use] pub(in crate::i...
Rust
0
import pickle import numpy as np import scipy.sparse as sp import networkx as nx from scipy.sparse import identity, spdiags, linalg def directed_laplacian_matrix(G, nodelist=None, weight='weight',alpha=0.95): import scipy as sp M = nx.to_scipy_sparse_matrix(G, nodelist=nodelist, weight=weight, ...
Python
1
up(sys.argv[1:]) try: args, openvpn_args, preexisting_routeup = parse_validate_args(sys.argv[1:]) except InvalidArgs: return 1 setup_namespace(args.namespace) execv_args = ['openvpn'] execv_args += openvpn_args # OK, don't bother assigning an IP to the tun, or creating routes;...
Python
1
500); let ret = builder.ins().iadd(a, b); builder.ins().return_(&[ret]); builder.seal_block(entry); }, |res: i32| -> bool { res == 3000 }, ) } #[test] /// Test some basic usage of the relooper algorithm. fn test_simple_control_flow() { run_test( (), ...
Rust
0
x<Error>> { let mut tn = Tensor::new(&[b.len() as u64, 192]); for j in 0..(b.len()) { let (mut ps, mut os) = b[j].pieces(); let (mut pm, mut _om) = b[j].mobility(); let jj = 192*j; for i in 0..64 { let ii = 3*i; tn[jj+ii+...
Rust
0
import os def create_directory_structure(root_dir): # Définition de la structure de répertoires directories = { 'data': ['brute', 'preparee'], 'code': [], 'documentation': [], 'models': [], 'notebooks': [], 'rapport': [] } # Création des répertoires ...
Python
1
()); pub fn codename(&self) -> Option<&str> { self.codename.as_ref().map(String::as_ref) } /// Returns operating system bitness. See `Bitness` for details. /// /// # Examples /// /// ``` /// use os_info::{Info, Bitness}; /// /// let info = Info::unknown(); /// assert...
Rust
0
from mlflow.entities.view_type import ViewType from mlflow.exceptions import MlflowException class LifecycleStage: ACTIVE = "active" DELETED = "deleted" _VALID_STAGES = {ACTIVE, DELETED} @classmethod def view_type_to_stages(cls, view_type=ViewType.ALL): stages = [] if view_type ==...
Python
1
eholder is not used, we can safely ignore it and put # None as placeholder. meta_value = None else: raise RuntimeError( "Cannot fetch symbolic fake args from fx graph. " "I...
Python
1
oreign => write!(f, "foreign"), K::If => write!(f, "if"), K::Import => write!(f, "import"), K::Is => write!(f, "is"), K::Return => write!(f, "return"), K::Static => write!(f, "static"), K::Super => ...
Rust
0
dir.join("quotes.json"); let mut manager = QuoteManager::load(quotes_path, app.config.max_quotes)?; manager.push(quote); manager.save()?; Ok(()) } /// Fetch quote from quote vendor. fn fetch_quote(app: &App, vendor_key: &str) -> Result<Quote> { let vendor = &app .config .vendors ...
Rust
0
_user(&mut self, user: ir::VarId) { self.variables.insert(user); } } <filename>tests/tunnel.rs #![cfg(feature = "local-tunnel")] use std::str; use byte_string::ByteStr; use tokio::{ self, net::{TcpStream, UdpSocket}, prelude::*, time::{self, Duration}, }; use shadowsocks::{ config::{C...
Rust
0
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1 import typing, winrt import enum _ns_module = winrt._import_ns_module("Windows.Devices.Bluetooth.Background") try: import winrt.windows.devices.bluetooth except: pass try: import winrt.windows.devices.bluetooth.advert...
Python
1
, /* 0x_4326_bbe4 */ ]; const QS3: [f32; 6] = [ 4.875_887_298_6_e+01, /* 0x_4243_0916 */ 7.096_892_089_8_e+02, /* 0x_4431_6c1c */ 3.704_148_193_4_e+03, /* 0x_4567_825f */ 6.460_425_293_0_e+03, /* 0x_45c9_e367 */ 2.516_333_740_2_e+03, /* 0x_451d_4557 */ -1.492_474_517_8_e+02, /* 0x_c315_3f59...
Rust
0
#!/usr/bin/env python3 import sys from collections import deque from operator import itemgetter def parse_input(fin): sections = fin.read().split('\n\n') seeds = sections[0] seeds = list(map(int, seeds[6:].split())) mappings = [] for section in sections[1:]: mapping = [] mappings.append(mapping) fo...
Python
1
ratio = (1 - current_achievement / v3_1_benchmark) * 100 print(f" ⚠️ 低于v3.1: -{decline_v3_1:,.2f}% (-{decline_ratio:.2f}%)") # 最终评估 if current_achievement > pine_script_target: print("🎉🎉🎉 恭喜!成功超越Pine Script目标!") elif current_achievement > v3_1_benchmark * 5:...
Python
1
self.0 } } #[doc = "Field `TO_INTR_AON` writer - "] pub struct TO_INTR_AON_W<'a> { w: &'a mut W, } impl<'a> TO_INTR_AON_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)]...
Rust
0
_monotonic().into_nanos() as input_device::EventTime; let input_events = vec![testing_utilities::create_consumer_controls_event( vec![ fidl_input_report::ConsumerControlButton::VolumeUp, fidl_input_report::ConsumerControlButton::VolumeDown, fidl_input_...
Rust
0
DocumentedType>> for DocumentedType { fn from(map: HashMap<String, DocumentedType>) -> Self { object(map) } } #[derive(Clone, Debug)] pub enum InternalDocumentedType { Boolean, Float, Integer, String, } pub trait ToDocumentedType { fn document() -> DocumentedType; } macro_rules! d...
Rust
0
numpy.array Array of k-nearest neighbors and corresponding distances for the given query. """ neighbors, distances = self.index.knn_query(query, k=k) return neighbors, distances def save(self, save_dir=None): saved_path = super().save(save_dir) self.index.save_i...
Python
1
_xmm_xmm_xmmm128 0x22CA_00DD,// VEX_Vpaddusw_ymm_ymm_ymmm256 0x224A_00DD,// EVEX_Vpaddusw_xmm_k1z_xmm_xmmm128 0x22CA_00DD,// EVEX_Vpaddusw_ymm_k1z_ymm_ymmm256 0x234A_00DD,// EVEX_Vpaddusw_zmm_k1z_zmm_zmmm512 0x2002_00DE,// Pmaxub_mm_mmm64 0x200A_00DE,// Pmaxub_xmm_xmmm128 0x224A_00DE,// VEX_Vpmaxub_xmm_xmm_xmmm1...
Rust
0
import sys, json input = sys.stdin object = json.loads(input.read()) def findNumbers(object): if type(object) == type(1): return object if type(object) == type('ads'): return 0 sum = 0 isObj = type(object) == type({}) if isObj and 'red' in object.values(): return 0 for i...
Python
1
"""Tests for RSTExporter""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import re import nbformat from nbformat import v4 from ...tests.utils import onlyif_cmds_exist from ..rst import RSTExporter from .base import ExportersTestsBase class TestRSTExporter(E...
Python
1
wchar_t; pub fn Py_GetPrefix() -> *mut wchar_t; pub fn Py_GetExecPrefix() -> *mut wchar_t; pub fn Py_GetPath() -> *mut wchar_t; pub fn Py_SetPath(arg1: *const wchar_t); #[cfg_attr(PyPy, link_name = "PyPy_GetVersion")] pub fn Py_GetVersion() -> *const c_char; pub fn Py_GetPlatform() -> *co...
Rust
0
OURCE")] /// - use reserved space on ext2 filesystems /// - make [ioctl(2)](https://man7.org/linux/man-pages/man2/ioctl.2.html) /// calls controlling ext3 journaling /// - override disk quota limits /// - increase resource limits (see /// [setrlimit(2)](https://man7.org/linux/man-pages/man2/...
Rust
0
import torch import triton import triton.language as tl @triton.jit def shared_mem_kernel(M, N, K, alpha, beta, a_ptr, b_ptr, c_ptr, stride_a_row, stride_a_col, stride_b_row, stride_b_col, stride_c_row, stride_c_col, ...
Python
1
import spglib from ase.build import sort import sys from ase.visualize import * def check_prev_structure(atoms,prev_start_points): try: sort(atoms) shift=[-atoms[0].position[0],-atoms[0].position[1],-atoms[0].position[2]] atoms.translate(shift) std_cell=spglib.standardize_cell(atoms,to_primitive=True,symprec=1...
Python
1
self, forum_id: i16, topic: &Topic) -> Result<Option<i32>> { let messages = self.get_bbcode_message(forum_id, MESSAGE_LEN)?; let posts = topic.get_user_posts()?; let name = self.db.forum.user.name.as_str(); let post_id = { let mut message = messages.iter(); let mu...
Rust
0
# 分析完当前形势后,挑选下一步的行动 choose_message = choose_template choose_message.append( {"role": "user", "content": str(message[-1])}) choice = askLLM(choose_message) answer_article += choice + "\n" print(choice) # 将选择行动的str解析为list ...
Python
1
ace, ) }; let pdf = uniform_sample_cone_pdf(cos_theta_max); let spectral_sample = col.to_spectral_sample(wavelength) * surface_area_inv as f32; return ( spectral_sample, (sample_point, normal, sample_point_err), ...
Rust
0
'JournalEntry', 'JournalEntryLine', 'JournalEntryLineList', 'AdvInterCompanyJournalEntry', 'AdvInterCompanyJournalEntryLine', 'AdvInterCompanyJournalEntryLineList' ], 'ns32': [ 'CustomRecord', 'CustomRecordCustomField', 'CustomRecordSearch', ...
Python
1
." ) with pytest.raises(ValueError, match=msg): ts.between_time(stime, etime, include_start, include_end, inclusive="left") def test_between_time_same_functionality_old_and_new_args(self): # GH40245 rng = date_range("1/1/2000", "1/5/2000", freq="5min") ts = DataF...
Python
1
computing the vtable base for an upcast trait of a trait object. pub fn count_own_vtable_entries(self, trait_ref: ty::PolyTraitRef<'tcx>) -> usize { let mut entries = 0; // Count number of methods and add them to the total offset. // Skip over associated types and constants. for tra...
Rust
0
_crom_config(); let mut f = File::open(file_path).expect("file not found"); let mut contents = String::new(); f.read_to_string(&mut contents); let docs = YamlLoader::load_from_str(contents.as_str()).unwrap(); let doc = &docs[0]; doc.h let apiServer = doc["crom"]["api-server"].as_str().unw...
Rust
0
, 'space-around'], ['letter-spacing', '2px'], ['line-height', '2', '90%'], ['list-style', 'circle', 'square', 'disc', 'upper-alpha', 'lower-alpha', 'upper-roman', 'lower-roman', 'decimal', 'inside', 'outside', 'none'], ['list-sty...
Python
1
cmap='coolwarm', vmin=clevs.min(), vmax=clevs.max()) # Add the zero contours line_c = axs[axis_count].contour(np.radians(longs), np.radians(lats), elements[compone...
Python
1
: ::libc::c_long, pub ru_nivcsw: ::libc::c_long, } impl ::std::clone::Clone for Struct_rusage { fn clone(&self) -> Self { *self } } impl ::std::default::Default for Struct_rusage { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } pub type rusage_info_t = *mut ::libc::c_void; #[repr(C)] #[derive(Co...
Rust
0
"""This module implements some workarounds for dependencies Authors * Aku Rouhe 2022 """ import warnings import weakref import torch WEAKREF_MARKER = "WEAKREF" def _cycliclrsaver(obj, path): state_dict = obj.state_dict() if state_dict.get("_scale_fn_ref") is not None: state_dict["_scale_fn_ref"] ...
Python
1
send(); ResultFuture { answer_port : answer_port, answer_result : answer_result, pipeline : FromTypelessPipeline::new(pipeline) } } } pub trait FromClientHook { fn new(Box<ClientHook+Send>) -> Self; } pub trait ClientHook : Send { fn copy(&self) -> Box<ClientHook+Send>; ...
Rust
0
impl From<Json> for String { fn from(json: Json) -> Self { json.0 } } impl From<String> for Json { fn from(string: String) -> Self { Self(string) } } /// A Rust type corresponding to the [Enum logical type](https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#enum). #[derive(Clone, PartialEq, ...
Rust
0
Ok(Self { bits_per_coordinate, bits_per_component, vertices_per_row, decode, function, }) } } <gh_stars>1-10 // edition:2018 #![feature(must_not_suspend)] #![deny(must_not_suspend)] #[must_not_suspend] struct No {} async fn shushspend() {} ...
Rust
0
throttle: sm.mThrottle, brake: sm.mBrake, clutch: sm.mClutch, steering: sm.mSteering, } } } // ignore-windows: Concurrency on Windows is not supported yet. use std::thread::spawn; #[derive(Copy, Clone)] struct EvilSend<T>(pub T); unsafe impl<T> Send for Ev...
Rust
0
Implementing custom iterators Recommended readings for this module: * Lifetimes: https://doc.rust-lang.org/rust-by-example/scope/lifetime.html * Slice type: https://doc.rust-lang.org/book/ch04-03-slices.html * Iterators: https://doc.rust-lang.org/rust-by-example/trait/iter.html */ pub struct Row<'a,...
Rust
0
sec1::*; use k256::{PublicKey as PubKey, Secp256k1}; use wasm_bindgen::{prelude::*, throw_str, JsStatic}; use crate::PrivateKey; #[wasm_bindgen] #[derive(Debug, Clone, PartialEq, Eq)] pub struct PublicKey { point: Vec<u8>, is_compressed: bool, } impl PublicKey { pub(crate) fn from_private_key_impl(priv_ke...
Rust
0
page_id] = {} app_ns = app.app_name, page_url.page.application_namespace with override(page_url.language): hooked_applications[page_url.page_id][page_url.language] = ( app_ns, get_patterns_for_page_url(page_url), app) included.append(mix_id) # Build the app pa...
Python
1
fy_store, &cache)?; // Update the previous phase store path to the current cache_path. let mut config = StoreConfig::from_config( &seal_precommit_phase1_output.config, &seal_precommit_phase1_output.config.id, seal_precommit_phase1_output.config.size, ); config.path = cache_path....
Rust
0
2: async for club in cursor2: clubs.append(club) return clubs async def get_owner_by_club_id(self, club_id): async with aiosqlite.connect(self.db_name) as db: async with db.execute("SELECT owner_id FROM clubs WHERE id = ?;", (club_id,...
Python
1
root_state.clone(), VertexData::default()), }; RolloutPhase { rng, settings, graph, root_node, } } pub fn rollout<S: RolloutSelector>( mut self, ) -> Result<ScoringPhase<'a, 'id, R, G>, rollout::RolloutError<G, S::Error>> { let result = rollout::rollout( &self.gr...
Rust
0
) if plot_legend: plt.legend(fontsize=fontsize) plt.tight_layout(pad=1) plt.show() def draw_learning_curve(path_tensorboard_files, architecture_names, figsize=(11, 6), fontsize=18, y_lim=None, remove_legend=False): """This function draws the learning curve of several tr...
Python
1
alue: String, } #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct BatchNote { pub id: i32, pub batch_id: i32, pub target: String, pub time: String, pub value: String, } impl BatchNote { pub async fn insert(db: &PgPool, input: NewBatchNote) -> Result<Self, ApiError> { ...
Rust
0
) return COMPAT_CALLGRIND_BINDINGS def _compile_template( *, stmt: str, setup: str, global_setup: str, src: str, is_standalone: bool ) -> Any: for before, after, indentation in ( ("// GLOBAL_SETUP_TEMPLATE_LOCATION", global_setup, 0), ("// SETUP_TEMPLATE_LOCATION", set...
Python
1
import os import colorama from colorama import init, Fore, Back, Style colorama.init(autoreset = True) def create_txt(): if not os.path.isfile("combo.txt"): with open("combo.txt", "w") as f: f.close() def hit(): string = (Fore.GREEN + "[ HIT ] ") return string def fail(): st...
Python
1
玩家摸牌 is_player_turn = False # 玩家回合结束,轮到怪物 is_buff_execute = True # 回合结束,重置buff状态 is_debuff_execute = True ##回合结束,重置debuff状态 else: choose_card = True ...
Python
1
PollFd}; use std::process::Command; use std::cell::RefCell; use std::env; use std::os::unix::io::{AsRawFd, RawFd}; use std::rc::Rc; use std::thread; use std::time::Duration; use std::os::raw::c_int; use std::fs; #[cfg(feature = "pcap")] use std::io; use std::io::Read; use std::path::Path; use std::str; use std::st...
Rust
0
from collections import deque dx = [-1, 0, 1, 0] dy = [0, -1, 0, 1] def solution(rectangle, characterX, characterY, itemX, itemY): answer = 0 graph = [[-1] * 101 for _ in range(101)] distance = [[-1] * 101 for _ in range(101)] for r in rectangle: lx, ly, rx, ry = map(lambda x: x * 2,...
Python
1
::Character); check_file_type(Path::new("/dev/zero"), FileType::Character); } #[test] fn test_file_types_dir() { check_file_type(Path::new("/dev"), FileType::Directory); } #[test] fn test_file_types_file() { check_file_type(Path::new("/etc/passwd"), FileType::File); } fn check_file_type(path: &Path, ftyp...
Rust
0
terner<Interner = I> + CastTo<U>, U: HasInterner<Interner = I>, I: Interner, { fn cast_to(self, interner: &U::Interner) -> InEnvironment<U> { self.map(|v| v.cast(interner)) } } impl<T, U, E> CastTo<Result<U, E>> for Result<T, E> where T: CastTo<U>, U: HasInterner, { fn cast_to(self,...
Rust
0
ro for Galois Field //! //! # Quick Start //! //! ``` //! use macro_galois_field::Field; //! //! #[derive(Field, Debug, Default, Copy, Clone)] //! #[prime = 2] //! struct Fp2(u64); //! //! let a = Fp2(3); //! let b = Fp2(3); //! assert_eq!(a + b, Fp2(0), "{} + {}", a.0, b.0); //! assert_eq!(a - b, Fp2(0), "{} - {}", a....
Rust
0
''' Utilizando listas faça um programa que faça 5 perguntas para uma pessoa sobre um crime. As perguntas são: 'Telefonou para a vítima?' 'Esteve no local do crime?' 'Mora perto da vítima?' 'Devia para a vítima?' 'Já trabalhou com a vítima?' O programa deve no final emit...
Python
1
iphertext { type Output = Ciphertext; fn add(self, other: &'b Ciphertext) -> Ciphertext { Ciphertext { e1: &self.e1 + &other.e1, e2: &self.e2 + &other.e2, } } } impl<'a> Mul<Scalar> for &'a Ciphertext { type Output = Ciphertext; fn mul(self, rhs: Scalar) -> ...
Rust
0
from __future__ import annotations import asyncio from typing import Any, AsyncIterator, Dict, List, Literal, Union, cast from langchain_core.callbacks import AsyncCallbackHandler from langchain_core.outputs import LLMResult # TODO If used by two LLM runs in parallel this won't work as expected class AsyncIterator...
Python
1
src/gh.rs mod intersect; mod polygon; mod vertex; pub use self::intersect::intersect; pub use self::polygon::Polygon; pub use self::vertex::Vertex; // Copyright (c) 2016 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (th...
Rust
0