text
string
label_name
string
labels
int64
er] #[doc = "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetRasterizerDiscardEnableEXT.html) · Function"] #[doc(alias = "vkCmdSetRasterizerDiscardEnableEXT")] pub unsafe fn cmd_set_rasterizer_discard_enable_ext(&self, command_buffer: crate::vk1_0::CommandB...
Rust
0
n<i32>, /// Filters results using the equals query parameter operator (`eq`). You can filter results that are equal to `id`, `userName`, `emails`, and `external_id`. For example, to search for an identity with the `userName` Octocat, you would use this query: `?filter=userName%20eq%20\\\"Octocat\\\"`. To filter ...
Rust
0
ings.png") plt.show() def sample_poison_data(poisoned_indices, frac): assert frac <= 1.0, "frac must be between 0 and 1" if frac <= 0.0: num_to_sample = 1 else: num_to_sample = int(frac * len(poisoned_indices)) sampled_nodes = torch.tensor(np.random.choice(poisoned_indices.cpu().n...
Python
1
on page {current_page} - stopping") break # Add new links to dictionary (automatically removes duplicates) new_count = self._add_new_links(page_links) duplicates_count = len(page_links) - new_count ...
Python
1
""" Write a python function which takes a list of integers and only returns the odd ones. assert Split([1,2,3,4,5,6]) == [1,3,5] """ def Split(lst): """ Takes a list of integers and returns only the odd ones. """ return [num for num in lst if num % 2 != 0] # assert Split([1,2,3,4,5,6]) == [1,3,5] prin...
Python
1
sleep intervals: {:#?}", sleep_intervals); // If no data there, fallback to config defined day start time if sleep_intervals.is_empty() { sleep_intervals.push(SleepInterval { start: NaiveTime::from_hms(0, 0, 0), end: self.config.day.day_begins_at, ...
Rust
0
from flask_app import app from flask_app.controllers import users, quotes, favorites # aqui importamos los controladores if __name__ == "__main__": app.run(debug=True)
Python
1
', TxtCtl.Enter, ), ) CloseMessageWindow() ChrSetSubChip(0x0010, 29) ChrSetSubChip(0x0014, 29) ChrTalk( 0x0000, ( '29', TxtCtl.Enter, ), ) CloseMessageWindow() ChrSetSubChip(0x0010, 30) ChrSetSubChip(0x0014, 30) ...
Python
1
Ok(NAN.into()) } fn max<'gc>( avm: &mut Avm1<'gc>, context: &mut UpdateContext<'_, 'gc, '_>, _this: Object<'gc>, args: &[Value<'gc>], ) -> Result<ReturnValue<'gc>, Error> { if let Some(a) = args.get(0) { return if let Some(b) = args.get(1) { match a.abstract_lt(b.to_owned(), avm...
Rust
0
ptr::read(&self.positions_buffer))); for p in self.cmd_pools.drain(..) { self.device.destroy_command_pool(p); } for s in self.submission_complete_semaphores.drain(..) { self.device.destroy_semaphore(s); } for f in self.submissio...
Rust
0
[doc = "SR register accessor: an alias for `Reg<SR_SPEC>`"] pub type SR = crate::Reg<sr::SR_SPEC>; #[doc = "Status register"] pub mod sr; /// A proof/receipt that a value exists in the database so it can be used in a triple #[derive(Debug, PartialEq)] pub struct Encoded<T> { pub(crate) rowid: i64, p: std::marke...
Rust
0
#!/usr/bin/env python3 import argparse import sys from ..core.ssh_config import get_ssh_config_host def suggest_port_forwarding(host: str, ssh_config_path: str | None = None): """Suggest SSH port forwarding setup for ProxyJump hosts""" ssh_host = get_ssh_config_host(host, ssh_config_path) if not ssh_hos...
Python
1
""" // @author: ComPleHN // @file: sankey.vue // @time: 2025/5/29 10:24 // @description: 本文件是对于echarts的 桑葚图 图表的测试,本文件有注意事项请看本目录下 README.md """ # ---------------------------------------------- Sankey - Sankey_base ---------------------------------------------- from pyecharts import options as opts from pyecharts.charts ...
Python
1
ndleARB_t>, glGetVertexAttribLui64vARB_p: Option<glGetVertexAttribLui64vARB_t>, glIsImageHandleResidentARB_p: Option<glIsImageHandleResidentARB_t>, glIsTextureHandleResidentARB_p: Option<glIsTextureHandleResidentARB_t>, glMakeImageHandleNonResidentARB_p: Option<glMakeImageHandleNonResidentARB_t>, glMakeImageH...
Rust
0
# Copyright (c) 2021 PaddlePaddle Authors. 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 appli...
Python
1
ops[1].version, value: (ops[0].value < ops[1].value) as u64, } } 7 => { debug_assert_eq!(ops.len(), 2); Packet { version: ops[0].version + ops[1].version, value: (ops[0].value == ops[1].value) as u64, } ...
Rust
0
# pylint: disable=fixme,logging-too-many-args,logging-fstring-interpolation,missing-docstring,no-else-return # pylint: disable=too-few-public-methods # Disabled because of a bug with pypy 3.8 see # https://github.com/pylint-dev/pylint/pull/7918#issuecomment-1352737369 # pylint: disable=multiple-statements from abc im...
Python
1
der_len); let header = LayoutVerified::<_, nlmsghdr>::new(header).expect("invalid buffer"); Self { ty: header.nlmsg_type, flags: header.nlmsg_flags, seq: header.nlmsg_seq, pid: header.nlmsg_pid, payload, } } } <reponame>Eric-Arellan...
Rust
0
if tile.is_visible() { match tile.tile_type { TileType::Floor => ".", TileType::Wall => "#", TileType::Empty => " ", TileType::StairsDown => ">", TileType::StairsUp => "<", TileType::Player => "@", TileType::Character(t) => t, ...
Rust
0
PRange('234.0.0.0', '238.255.255.255'), IPRange('225.0.0.0', '231.255.255.255'), ) + (IPV4_LOOPBACK, IPV4_6TO4) #----------------------------------------------------------------------------- # Cached IPv6 address range lookups. #----------------------------------------------------------------------------- IPV6_L...
Python
1
(); let reset = Utc::now() .checked_add_signed(duration); if body.global { *global.lock() = reset; } else { (*bkt.lock()).reset = reset }; ResponseStatus::Ratelimited ...
Rust
0
""" Script to plot random data samples (the beamformed fingerprints) (Instructions to run: `python path/to/plot_samples.py <path to .yaml file>`) """ #pylint: disable=wrong-import-position import sys import logging import yaml import numpy as np import matplotlib matplotlib.use('agg') import matplotlib.pyplot as pl...
Python
1
ontract.init_state.as_bytes()) .expect("Failed to decode account state"); let store = Storage::from_raw(&store); Some(three_em_evm::ContractInfo { store, bytecode }) })); match machine.execute(&bytecode, block_info) { ExecutionState::Abort(_) | ExecutionState...
Rust
0
pose_list, config, table=table_trans, voxel_size=0.008, TOP_K = TOP_K) grasp_list = [x for x in grasp_list if len(x) != 0] score_list = [x for x in score_list if len(x) != 0] collision_mask_list = [x for x in collision_mask_list if len(x)!=0] grasp_list = np.array(gras...
Python
1
""" Bus scheduling in cpmpy. Problem from Taha "Introduction to Operations Research", page 58. This is a slightly more general model than Taha's. The model first finds the optimal value (26) and then shows all the 145 optimal solutions. Model created by Hakan Kjellerstrand, hakank@hakank.com See also my cpmpy page:...
Python
1
} match unsafe { WaitForSingleObject(**self.handle(), 15_000) } { WAIT_OBJECT_0 => Ok(()), _ => Err(io::Error::last_os_error()), } } } // One is the loneliest number pub fn one_player_match() -> rlbot::MatchSettings<'static> { rlbot::MatchSettings::new().player_...
Rust
0
255), cv.FILLED) t, _ = net.getPerfProfile() freq = cv.getTickFrequency() / 1000 cv.putText(frame, '%.2fms' % (t / freq), (10, 20), cv.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 0)) neck = points[BODY_PARTS['Neck']] left_wrist = points[BODY_PARTS['LWrist']] right_wrist = points[BODY_PARTS['RWrist']] ...
Python
1
print_log.message("DONE!", timer_name="start") sub.call("touch {0}/RUN_FINISHED && rm {0}/RUNNING".format(self.directory), shell=True) class ExhaustiveSearch(GradientAscent): def __init__(self, sim, env, pop, vox_types): GradientAscent.__init__(self, sim, env, pop, None) self.search_...
Python
1
::DIV => { row.add_cell(Cell::new("")); row.add_cell(Cell::new_align(&format!("{:.2}", t.amount_settled), RIGHT)); row.add_cell(Cell::new_align(&format!("{:.2}", t.net_profit), RIGHT).with_style(ForegroundColor(color::GREEN))); table.add_row(row); ...
Rust
0
ed] } response = requests.post( self.config["webhook_url"], json=payload, timeout=10 ) if response.status_code in [200, 204]: self.logger.info(f"📱 Discord notification sent: {title}...
Python
1
lect for #struct_name #ty_generics #where_from_reflect_clause { fn from_reflect(reflect: &dyn #bevy_reflect_path::Reflect) -> Option<Self> { use #bevy_reflect_path::TupleStruct; if let #bevy_reflect_path::ReflectRef::TupleStruct(ref_tuple_struct) = reflect.reflect_ref...
Rust
0
res || not_b_res || a_plus_b_res; (res, carry_out) } pub fn alu_32(a: Bus32, b: Bus32, control: AluControl) -> (Bus32, bool, bool) { let mut result = [false; 32]; let mut carry = control.inc; for i in 0..32 { let (res, alu_carry) = alu_unit(a.data[i], b.data[i], control.inv_a, control.en_a, c...
Rust
0
le.RESET_ALL}Checking single target: {args.target}") exploit.check_target(args.target) # Handle targets from file elif args.file: targets = exploit.load_targets_from_file(args.file) if not targets: print(f"{Fore.RED}[!] {Style.RESET_ALL}No valid targets found in the file...
Python
1
from .. import Provider as CompanyProvider class Provider(CompanyProvider): formats = ( "{{last_name}} {{company_suffix}}", "{{last_name}} {{last_name}} {{company_suffix}}", "{{last_name}}", ) company_suffixes = ( "AG", "AG", "AG", "AG", "AG...
Python
1
atures: 'Win32_Graphics_Imaging'*"] pub const WICBITMAPLOCKFLAGS_FORCE_DWORD: WICBitmapLockFlags = 2147483647i32; #[doc = "*Required features: 'Win32_Graphics_Imaging'*"] pub type WICBitmapPaletteType = i32; #[doc = "*Required features: 'Win32_Graphics_Imaging'*"] pub const WICBitmapPaletteTypeCustom: WICBitmapPaletteT...
Rust
0
import im import time server= im.IMServerProxy("https://web.cs.manchester.ac.uk/a65914zc/comp28112_ex1/IMserver.php") server_tag = 1 # lock Robert_time = 0 Ned_time = 0 def Robert(): global server_tag, Robert_time, Ned_time if (server_tag == 1): print("Ned just said: " + str(server["Ned" ...
Python
1
m[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2."] #[doc = " @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen)."] pub fn arm_conv_opt_q15( pSrcA: *const q15_t, srcALen: u32, pSrcB: *const q15_t, sr...
Rust
0
"+" Factor (*) [")"] // Expr = Expr "+" Factor (*) ["+"] // Expr = Expr "+" Factor (*) ["-"] // Factor = Factor (*) "*" Term [")"] // Factor = Factor (*) "*" Term ["*"] // Factor = Factor (*) "*" Term ["+"] // Factor = Factor (*) "*" Term ["-"] // Factor = Factor (*) "*" Term ...
Rust
0
, 1, 1), ); } } impl Transform { pub const IDENTITY: Transform = Transform { mat: [1.0, 0.0, 0.0, 1.0], translate: [0.0, 0.0], }; pub fn from_kurbo(a: Affine) -> Transform { let c = a.as_coeffs(); Transform { mat: [c[0] as f32, c[1] as f32, c[2] as f...
Rust
0
tr], int] | None = None, is_added: bool = False, is_removed: bool = False, **kwargs: Any, ) -> set[PotentialSecret]: secrets: set[PotentialSecret] = set() if context is None or raw_context is None: return secrets value_secrets = extract_from_string(pattern=secret_pattern, str...
Python
1
ES, source, edge_id, target_id, i, ) }) .collect::<Result<Vec<_>, _>>() .unwrap(); assert_eq!(point_results, [source; 4]); } #[...
Rust
0
# Fine-tuned model setup def fine_tune_model(model, dataset, config): print("Fine-tuning the model...") # Add fine-tuning logic here
Python
1
st.components = r.read_u8().unwrap() as usize; println!("[SOF] marker:{:x} len:{} width:{} height:{} components:{}", x, len, dst.width, dst.height, dst.components); // 成分を順番に読み出す assert_eq!(len as usize, 3 * dst.components); // 1Componentの長さは8byteのはず ...
Rust
0
break for Time in range(Repeat): try_num = 0 while True: semaphore_acquired = None try: if semaphore1.acquire(blocking=False): semaphore_acquired = semaphore1 ...
Python
1
(&g0), Vf2State::new(&g1)); self::matching::try_match(&mut st, &mut NoSemanticMatch, &mut NoSemanticMatch).unwrap_or(false) } /// \[Generic\] Return `true` if `g0` is isomorphic to a subgraph of `g1`. /// /// Using the VF2 algorithm, examining both syntactic and semantic /// graph isomorphism (graph structure and ...
Rust
0
%SrSSKJr SSKrSSKrSSKrSSKrSSKrSSKrSSK r SSK r SSK J r SSK JrJrJrJr SSKJr SSKrSSKrSSKrSSKJr SSKJrJrJrJr SSK J!r! SS K"J#r# SS K$J%r%J&r& \(aSSK'r'SS K(J)r) SS K*J+r+J,r, ...
Python
1
#\!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Sage Core Interfaces - 接口定义 """ from .core_service import ( ISageService, MemoryContent, SearchOptions, SessionInfo, AnalysisResult ) from .memory import IMemoryProvider __all__ = [ 'ISageService', 'IMemoryProvider', 'MemoryContent', ...
Python
1
CC1 register"] PPW, #[doc = "Period capture value in CC1 register, pulse width capture value in CC0 register"] PWP, #[doc = "Non-recoverable fault"] FAULT, } impl EVACT1R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { ...
Rust
0
match res.status() { StatusCode::OK => Ok(res.json::<SearchResponse>().await?), code => Err(format_err!("failed to request: {}", code)), } } } pub struct Downloader { client: PexelClient, download_path: PathBuf, } impl Downloader { pub fn new(client: PexelClient, downlo...
Rust
0
panic!("Unknown loader type encountered in config"), } } loaders } pub fn init_excludes(&mut self) { self.exclude_patterns = self.exclude .iter() .map(|pat_str| Pattern::new(pat_str).expect("Invalid exclude glob pattern!")) .collect(); ...
Rust
0
self, text: str, analysis_type: str = "summary") -> str: """Analyze text with different analysis types""" prompts = { "summary": f"Please provide a concise summary of the following text:\n\n{text}", "sentiment": f"Analyze the sentiment of the following text (positive, negative, n...
Python
1
import pyttsx3 #pip install pyttsx3 import speech_recognition as sr #pip install speechRecognition import datetime import wikipedia #pip install wikipedia import webbrowser import os import smtplib engine = pyttsx3.init('sapi5') voices = engine.getProperty('voices') # print(voices[1].id) engine.setProperty('voice', vo...
Python
1
Can not approve a linked token"); // Get and verify approval range let key = StorageKey::TokenApproval { index }.try_to_vec().unwrap(); let range = match TokenApproval::try_from_slice( &env::storage_read(&key).expect(ERR_TOKEN_APPROVAL_NOTFOUND), ) { Err(_) => env::panic_str(ERR_TOKEN_A...
Rust
0
omId(self, RoomId): self._RoomId = RoomId @property def PushUserId(self): r"""用于白板推流服务进入白板房间的用户ID。在没有额外指定`IMAuthParam`和`TRTCAuthParam`的情况下,这个用户ID同时会用于IM登录、IM加群、TRTC进房推流等操作。 用户ID最大长度不能大于60个字节,该用户ID必须是一个单独的未同时在其他地方使用的用户ID,白板推流服务使用这个用户ID进入房间进行白板音视频推流,若该用户ID和其他地方同时在使用的用户ID重复,会导致白板推流服务与其他使用场景账号互踢,影响...
Python
1
Could not convert invalid file attributes") } } impl error::Error for FileAttrTryFromError {} /// File attributes. /// /// Holds metadata required to represent a file in a filesystem. Besides the /// inode number, which uniquely identifies a file, attributes contain more /// useful metadata like file size, owner...
Rust
0
to `park_timeout`. pub fn park_for(&self, duration: Duration) { self.inner.lock().unwrap().park_for = Some(duration); } } impl Park for MockPark { type Unpark = MockUnpark; type Error = (); fn unpark(&self) -> Self::Unpark { let inner = self.inner.clone(); MockUnpark { inn...
Rust
0
=> get_api_key(), None => get_api_key(), }; let password = match &configuration.service.password { Some(v) if !v.trim().is_empty() => Ok(v.to_owned()), Some(_) => get_password(), None => get_password(), }; AbstractServiceConfig::build( api_token, config...
Rust
0
import random first_names=('Shani','Feni','Shania') last_names=('Indira','Fitriyanti','Gracia') member=random.choice(first_names)+random.choice(last_names) user=member
Python
1
from django.db import models from django.utils import timezone # Create your models here. class Temperature(models.Model): """ Temperature: - id: Int. Id - device_name: String. Name of the device - timestamp: Datetime. Datetime when it was registered - temperature: Decimal. Tempe...
Python
1
efix2 0x07,// W 0x42,// VW_er 0x4D,// XMM0 0x87, 0x09,// EVEX_Vcomiss_xmm_xmmm32_sae 0x02,// N4 0x00,// Invalid 0x07,// W 0x00,// Invalid 0x42,// VW_er 0x4D,// XMM0 0x88, 0x09,// EVEX_Vcomisd_xmm_xmmm64_sae 0x03,// N8 0x00,// Invalid 0x00,// Invalid // 48 = 0x30 0x02,// Du...
Rust
0
15, 0> velocity=<-2, 0> position=< 1, 6> velocity=< 1, 0> position=< 8, 9> velocity=< 0, -1> position=< 3, 3> velocity=<-1, 1> position=< 0, 5> velocity=< 0, -1> position=<-2, 2> velocity=< 2, 0> position=< 5, -2> velocity=< 1, 2> position=< 1, 4> velocity=< 2, 1> position=<-2, 7> velocity=< 2, -2> positi...
Rust
0
{ #[inline] pub fn disable(&self) -> u8 { unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } } #[inline] pub fn set_disable(&mut self, val: u8) { unsafe { let val: u8 = ::core::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val...
Rust
0
is.read_uint64()?; self.region_id = tmp; }, _ => { ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } ::std::result::Result::Ok(()) } //...
Rust
0
unique_names = set() for _ in range(int(input())): name = input() if name not in unique_names: unique_names.add(name) print(*unique_names, sep='\n')
Python
1
# esto sirve tanto como lista y como tupla # las tuplas son inmutables y las listas mutables # los que etsamos haciendo en ver los valores de una lista y tupla animales = ("Perro", "Gato", "León", "Tigre", "Elefante") # Animales frutas = ["Manzana", "Banana", "Naranja", "Fresa", "Sandía"] # Frutas verduras = ["Zan...
Python
1
, x.epoch); } } println!("ERR> Please remove the above packages before continuing."); remove_lock().expect("Failed to remove lock file."); std::process::exit(1); } println!("\nPackages to remove [{}]: {}\n", packages.len(), display_removing_packages(packages.clone()...
Rust
0
name:ident(&mut self $(, $arg_name:ident : $arg_ty:ty )*) $(-> $ret:ty)? ) => { fn $name(&mut self $(, $arg_name : $arg_ty )*) $(-> $ret)? { (**self).$name( $($arg_name),* ) } }; } #[macro_export] macro_rules! impl_trait_for_boxed { ( $( #[$attr:meta] )* $vis:vis...
Rust
0
# mypy: allow-untyped-defs import torch class ConstrainAsValueExample(torch.nn.Module): """ If the value is not known at tracing time, you can provide hint so that we can trace further. Please look at torch._check and torch._check_is_size APIs. torch._check is used for values that don't need to be use...
Python
1
Self { unsafe { ::std::mem::zeroed() } } } pub type HPDF_Xref_Rec = Struct__HPDF_Xref_Rec; pub type HPDF_EmbeddedFile = HPDF_Dict; pub type HPDF_NameDict = HPDF_Dict; pub type HPDF_NameTree = HPDF_Dict; pub type HPDF_Pages = HPDF_Dict; pub type HPDF_Page = HPDF_Dict; pub type HPDF_Annotation = HPDF_Dict; pub type HPDF...
Rust
0
println!("Unexpected end of text."); break; } Some(&current) => { if current == quote { result = self.sub_str(start, self.pos); self.pos += 1; break; } ...
Rust
0
/// }; /// /// assert_eq!(Some("Value"), props.get("Key")); /// assert_eq!(Some("OtherValue"), props.get("OtherKey")); /// ``` pub struct Properties { ptr: *mut pw_sys::pw_properties, } /// A macro for creating a new `Properties` struct with predefined key-value pairs. /// /// The macro accepts a list of `Key => V...
Rust
0
ckout.subtotal.net == net assert checkout.subtotal_gross_amount == gross_amount assert checkout.subtotal.gross == gross assert checkout.subtotal.tax == gross - net def test_checkout_shipping_price_setter(): # given currency = "USD" net_amount = Decimal(10) net = Money(net_amount, currency)...
Python
1
= data_loader.create_data_generator(train_paths, train_labels, batch_size) val_data_gen = data_loader.create_data_generator(val_paths, val_labels, batch_size) # Calculate steps steps_per_epoch = max(100, len(train_paths) // batch_size) val_steps = max(50, len(val_paths) // batch_size) prin...
Python
1
unwrap(); acc + scores.get(&upper).unwrap_or(&0) }) } <gh_stars>0 use super::BaseHandler; use pyo3::prelude::*; use std::sync::{Arc, Mutex}; use streamson_lib::handler; #[pyclass(extends=BaseHandler)] #[derive(Clone)] pub struct AnalyserHandler { pub analyser_inner: Arc<Mutex<handler::Analyser>>, } #[...
Rust
0
sageCopyOptionsBuilder { inner } } pub fn send_copy(&self) -> bool { self.send_copy } pub fn replace_caption(&self) -> bool { self.replace_caption } pub fn new_caption(&self) -> &FormattedText { &self.new_caption } } #[doc(hidden)] pub struct RTDMessageCopyOptionsBuilder { inner: MessageCopyOptions } im...
Rust
0
pub(crate) fn new( services: HashMap< String, Buffer<BoxService<SubgraphRequest, SubgraphResponse, BoxError>, SubgraphRequest>, >, ) -> Self { Self { services } } pub fn get( &self, name: &str, ) -> Option<BoxCloneService<SubgraphRequest, ...
Rust
0
s = get_number_from_user_input("NUMBER OF COLORS", "", 1, COLORS.len()); num_positions = get_number_from_user_input("NUMBER OF POSITIONS", "", 2, 10); num_rounds = get_number_from_user_input("NUMBER OF ROUNDS", "", 1, 10); num_guesses = get_number_from_user_input("NUMBER OF GUESSES", "", 10, 0); //pri...
Rust
0
(None, None, None, None, None, 51, 52, 53, 54, 55, 56), # (None,None,None,None, 57,58,59) ) class TentTerrain(pbge.scenes.terrain.TerrSetTerrain): image_top = 'terrain_terrset_tent.png' blocks = (Walking, Skimming, Rolling, Flying, Cruising, SpaceFlight) class TentTerrset(pbge.randmaps.terrs...
Python
1
, 0) raise Exception(error_msg) class LLMProviderFactory: """LLM提供商工厂类""" _instance = None _provider = None _config_hash = None def __new__(cls): if cls._instance is None: cls._instance = super().__new__(cls) return cls._instance def __ini...
Python
1
than supported by MySql integer types but it'll be serialized anyway (as decimal bytes string). | //! //! [1]: https://dev.mysql.com/doc/internals/en/binary-protocol-value.html #![cfg_attr(feature = "nightly", feature(test, const_fn))] #[macro_use] extern crate bitflags; #[macro_use] extern crate lazy_static; #[cfg(f...
Rust
0
.is_empty() && indent_level.is_none() { indent_level = line.find(|s| !char::is_whitespace(s)); } // if we have already found indent level if indent_level.is_some() { FutilResult += indent_level .map(|pre| { ...
Rust
0
/// # use eos::Weekday; /// assert_eq!(date!(2021-12-25).weekday(), Weekday::Saturday); /// assert_eq!(date!(2012-2-29).weekday(), Weekday::Wednesday); /// # Ok::<_, eos::Error>(()) /// ``` pub fn weekday(&self) -> Weekday { let days = self.epoch_days(); let d = (days + 4).rem_euclid...
Rust
0
for _ in 1..300 { if let Ok(res) = engine.get_value_cf(cf, &keys::data_key(key)) { if value.is_some() && res.is_some() { assert_eq!(value.unwrap(), &*res.unwrap()); return; } if value.is_none() && res.is_none() { return; ...
Rust
0
[ Patch::CopyElement(leaked_e("div")), Patch::UnsetInnerHtml, Patch::Up, ] ); } #[wasm_bindgen_test] fn inner_html_replace() { let old; unsafe { old = Dom::<_, _, &()>::elem("div") .inner_html("html"); } let new = Dom::elem("di...
Rust
0
, 0, cos), } } const fn rotz(Angle(sin, cos): Angle) -> Self { Self { col1: Vec3::new(cos, sin, 0), col2: Vec3::new(-sin, cos, 0), col3: Vec3::new(0, 0, 1), } } const ALL_ROTATIONS: [Self; 24] = [ Self::ID, Self::rotx(Angle::D...
Rust
0
from __future__ import absolute_import from __future__ import division from __future__ import print_function from yacs.config import CfgNode as CN _C = CN() _C.PRINT_FREQ = 20 _C.VAL_FREQ = 20 # Cudnn related params _C.CUDNN = CN() _C.CUDNN.BENCHMARK = True _C.CUDNN.DETERMINISTIC = False _C.CUDNN.ENABLED = True #...
Python
1
result[i] = b'\''; i += 1; let repeats = self.r.to_string(); for b in repeats.bytes() { result[i] = b; i += 1; } match self.t { TFormType::Logical => result[i] = b'L', TFormType::Bit => result[i] = b'X', TFormType::Unsig...
Rust
0
self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); self.w } } #[doc = "Fault Control Mode\n\nValue on reset: 0"] #[derive(Clone...
Rust
0
name: name.clone(), var_type: TypeDebug::from_annotation(&v.var.type_), }); } Declaration::FuncDef(f) => { let method_name = &f.name.name; let link_name = class_name.clone() + "." + method_name; if let Some...
Rust
0
cal_page_id ) .exclude(variant_id=self.variant_id) .exclude(variant_id=self.canonical_page_id) ) @cached_property def is_canonical(self): """Return a boolean indicating whether or not the personalisable page is a canonical page. :returns: A b...
Python
1
; const WATCHA_HAPPENED = 0b1000_0000; } } const ABRTCMC_CONTROL3: u8 = 0x02; bitflags! { pub struct Control3: u8 { const BATTLOW_INT = 0b0000_0001; const BATTSWITCH_INT = 0b0000_0010; const BATTLOW_STAT = 0b0000_0100; cons...
Rust
0
import os import yaml import logging import argparse import torch import numpy as np from torch.utils.tensorboard import SummaryWriter import gymnasium as gym from gymnasium.wrappers import RecordEpisodeStatistics from utils.logger import configure_logger from algos.mg_a2c.learning import train_mg_a2c from algos.rl2...
Python
1
let mut sm = new_test_raft(1, vec![1, 2, 3], 10, 1, store, &l); // sm term is 2 after it becomes the leader. sm.become_candidate(); sm.become_leader(); sm.read_messages(); let mut m = new_message(2, 0, MessageType::MsgAppendResponse, 0); m.index = index; m.term ...
Rust
0
logger.debug(f"Response: {self.response_st}") else: self.response = func(val) logger.debug(f"Response: {self.response}") self.queue.task_done() @Slot() def refreshGUI(self): # print("Timed out.") self.queue.put((self.ps1.get_status, None)...
Python
1
ntryFlags::PRESENT | EntryFlags::WRITABLE | EntryFlags::NO_EXECUTE ); } unsafe { temporary_page.unmap(active_table); } InactivePageMap { p4_frame: frame } } } use anyhow::Result; use clap::ArgMatches; use drawio_exporter::ops::exporter::{exporter, Exporter...
Rust
0
#[cfg_attr(rustfmt, rustfmt_skip)] cfg_write!(f, cfg, buf, state, If(ind, &IncIndent(None)), Hint(&locs[2], ""), n2, If(ind, &DecIndent())) } VarSuffixList(span, _) => { out_of_range_only_write!(f, cfg, buf, state, span); cfg_write_lis...
Rust
0
} } impl<T: StaticType + FromGlib<i32> + IntoGlib<GlibType = i32>> glib::StaticVariantType for EnumReprValue<T> { fn static_variant_type() -> std::borrow::Cow<'static, glib::VariantTy> { std::borrow::Cow::Borrowed(glib::VariantTy::INT32) } } impl<T: StaticType + FromGlib<i32> + IntoGlib<GlibType ...
Rust
0
ules(self) -> List[PortForwardRule]: """获取所有netsh portproxy规则""" try: netsh_rules = self.netsh_manager.get_all_portproxy_rules() port_forward_rules = [] for rule in netsh_rules: # 将netsh规则转换为PortForwardRule格式 name = getattr...
Python
1
# Part of Odoo. See LICENSE file for full copyright and licensing details. { "name": "Cloud Storage Azure", "summary": """Store chatter attachments in the Azure cloud""", "category": "Technical Settings", "version": "1.0", "depends": ["cloud_storage"], "data": [ "views/settings.xml", ...
Python
1
91: 65,#'vertebrae_L4', 92: 66,#'vertebrae_L5', 93: 50,#'vertebrae_T1', 94: 59,#'vertebrae_T10', 95: 60,#'vertebrae_T11', 96: 61,#'vertebrae_T12', 9...
Python
1