text
string
label_name
string
labels
int64
import os import re from math import ceil base_dir = os.path.dirname(os.path.abspath(__file__)) def GetSelection(list_name): rs='' for i in list_name: rs+=str(i) rs=rs+' ' rs.strip(' ') command = r'py {0}\delete_mark_ui.py {1}'.format(base_dir,rs) r = os.popen(command) output = r...
Python
1
y)a Open the specified file and use it as the stream for logging. By default, the file grows indefinitely. You can specify particular values of maxBytes and backupCount to allow the file to rollover at a predetermined size. Rollover occurs whenever the current log...
Python
1
_outputs, neurons), Initializer::He => gen_he(self.num_outputs, neurons), Initializer::Const(val) => vec![vec![val; self.num_outputs+1]; neurons], }; self.num_outputs = neurons; let layer = Layer::Dense(weights); self.layers.push(layer); self } ...
Rust
0
('Xác minh danh tính thủ công')) def manually_verify_identity(self, request, queryset): with transaction.atomic(): for user in queryset: task_with_args = partial( notifications.send_notification_to_user.delay, user_id=user.id, category="ver...
Python
1
:Annotation { lang: "or", tts: Some( "ତଳ\u{b41}ଆ ଥ\u{b3f}ବ\u{b3e} ପତ\u{b3e}କ\u{b3e} ସହ\u{b3f}ତ ଖୋଲ\u{b3e} ମେଲ\u{b4d}\u{200c}ବ\u{b3e}କ\u{b4d}ସ", ), keywords: &[ "ଏକ ଉଦ\u{b4d}ଧଗ\u{b3e}ମୀ ପତ\u{b3e}କ\u{b3e} ସହ\u{b3f}ତ ମେଲ\u{b4d}\u{200c}ବ\u{b3e}...
Rust
0
tDOMHTMLDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) where P: IsA<DOMHTMLDocument> { let f: &F = &*(f as *const F); f(&DOMHTMLDocument::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_<F> = Box_::new(f); ...
Rust
0
import time # 1H -> 60 min # 5H -> 1 2 3 4 5 6 7 # aqrabeye bozorg sawt for hour in range(1, 25, 1): print(f"Hour = {hour}") # aqrabeye daqiqe shomar for minute in range(1, 61, 1): print(minute, end=" ") # print("Sleep 4 seconds !") # time.sleep(4)
Python
1
) def test_ellipsis_start(self): dataset = h5.VirtualSource('test','test',(20,30,30)) sliced = dataset[...,0:1] self.assertEqual(dataset.shape[:-1]+(1,),sliced.shape) def test_ellipsis_sandwich(self): dataset = h5.VirtualSource('test','test',(20,30,30,40)) sliced = data...
Python
1
:%M:%S') result = [ 'user 4', ','.join(map(str, train_acc_list)), # Converte a lista em string separada por vírgulas ','.join(map(str, val_acc_list)), timestamp ] csv_writer.writerow(result) print(result) ...
Python
1
Ensure the box is within frame boundaries. x1 = max(0, x1) y1 = max(0, y1) x2 = min(frame.shape[1], x2) y2 = min(frame.shape[0], y2) face_img = frame[y1:y2, x1:x2] # Construct the output filename for the fa...
Python
1
xt_workers.items(): if count > 3 and count < len(ext_workers) - 1: str_output += " and {0} other workers".format(len(ext_workers) - count) break str_output += " - {0} ran {1} tasks\n".format(ext_worker, len(task_dict)) count += 1 str_outp...
Python
1
memory::kernel_memory_end()); memory::remap_the_kernel(&mut frame_allocator); println!("It did not crash!"); loop {} } #[lang = "eh_personality"] extern "C" fn eh_personality() {} #[lang = "panic_fmt"] extern "C" fn panic_fmt(fmt: core::fmt::Arguments, file: &str, line: u32) -> ! { use vga_...
Rust
0
#!/usr/bin/env python3 """ IntelliDoc Streamlit Application Runner This script provides a convenient way to run the IntelliDoc Streamlit application with proper environment setup and configuration. """ import os import sys import subprocess from pathlib import Path def check_dependencies(): """Check if required ...
Python
1
write!(buf, "{}", port) .expect("should have space for 5 digits"); uri::Authority::from_shared(buf.freeze()) .expect("valid host + :port should be valid authority") } else { self.host().parse() .expect("valid host without port ...
Rust
0
netlify::DnsRecord; arg_enum! { #[derive(Debug)] pub enum IpType { Ipv4, Ipv6, } } #[derive(Debug, StructOpt)] #[structopt( about, setting(AppSettings::ColoredHelp), setting(AppSettings::ColorAuto) )] pub struct Args { /// The full domain for the DNS record #[structopt...
Rust
0
import typing as t from bot.api.api_client import ApiClient from bot.api.base_route import BaseRoute from bot.models.role_models import Role, RoleFull class RoleRoute(BaseRoute): def __init__(self, api_client: ApiClient): super().__init__(api_client) async def create_role( self, role_id: int...
Python
1
::new(year, month, day)?)) } else { Ok(Self::YearMonth(YearMonth::new(year, month))) } } else { Ok(Self::Year(year.into())) } } } #[derive(Debug, Clone, Eq, PartialEq)] pub enum ParsePartialDateError { InvalidSyntax(InvalidPartialDateSyntax), InvalidDate(InvalidDate), } #[derive(Debug, Clone, Eq, ...
Rust
0
::cell::RefCell; use std::ops; pub mod color; pub mod primitive; pub mod spatial; use self::spatial::dimension; pub use self::color::{IntoRgba, SetColor}; pub use self::primitive::{Ellipse, Line, Primitive, Quad, Rect, Tri}; pub use self::spatial::dimension::SetDimensions; pub use self::spatial::orientation::SetOrie...
Rust
0
.path predict_result_saving_path 1.use logisticreg train to get the logisticreg.predict.mode.file.id file,then 2.logisticreg.predict.test.data format: f32,f32,f32,f32 ... f32,f32,f32,f32 ... ... "; println!("logisticreg_predict usage: \n{}", msg); } fn print_usage() { print...
Rust
0
category_file = config_path / "category.yaml" if category_file.exists(): shutil.copy(category_file, backup_path) userdb_file = config_path / "user.db" if userdb_file.exists(): shutil.copy(userdb_file, backup_path) zip_file = str(b...
Python
1
1 as libc::c_int; pub const EXT_RGB_GREEN: libc::c_int = 1 as libc::c_int; pub const EXT_BGR_GREEN: libc::c_int = 1 as libc::c_int; pub const EXT_RGBX_GREEN: libc::c_int = 1 as libc::c_int; pub const EXT_BGRX_GREEN: libc::c_int = 1 as libc::c_int; pub const EXT_XBGR_GREEN: libc::c_int = 2 as libc::c_int; pub const EXT...
Rust
0
import tensorflow as tf def kabsch(X, Y): A = tf.matmul(X, Y, transpose_a=True) _, U, V = tf.linalg.svd(A) T = tf.matmul(U, V, transpose_b=True) has_reflection = (tf.linalg.det(T) < 0)[..., tf.newaxis, tf.newaxis] T_mirror = T - 2 * tf.matmul(U[..., -1:], V[..., -1:], transpose_b=True) return ...
Python
1
a = finstore.read.symbol_list(symbol_list=self.symbol_list, merged_dataframe=False) if self.progress_callback: self.progress_callback(50, "Running strategy") entries, exits, close_data, open_data = self.strategy_object.run(ohlcv_data) if self.progress_callb...
Python
1
import numpy as np import torch class EarlyStopping(object): def __init__(self, model, save_path, mode='min', min_delta=0, patience=10, percentage=False): self.mode = mode self.min_delta = min_delta self.patience = patience self.best = None self.best_epoch = None sel...
Python
1
# coding=utf-8 """ OneForAll自定义配置 """ import pathlib # 路径设置 relative_directory = pathlib.Path(__file__).parent.parent # OneForAll代码相对路径 data_storage_dir = relative_directory.joinpath('data') # 数据存放目录 # OneForAll入口参数设置 enable_check_version = True # 开启最新版本检查 enable_brute_module = True # 使用爆破模块(默认True) enable_dns_r...
Python
1
struct.TcpKeepalive.html /// [keepalive time]: ../struct.TcpKeepalive.html#method.with_time pub fn set_keepalive_params(&self, keepalive: TcpKeepalive) -> io::Result<()> { self.set_keepalive(true)?; sys::tcp::set_keepalive_params(self.sys, keepalive) } /// Returns the amount of time aft...
Rust
0
ion' + self.task_data['name'] self.task_data['max_queries'] *= 2 self.num_choices = len(self._ds[0]['choice']) self.task_data['max_input_length'] = max([ len(re.findall(r'\w+', sample['input'] + sample['target'][0])) for sample in self._ds ]) self.input_prefix = self.task_data.get('e...
Python
1
_client_recv_msg_ret_t { success: salty_client_recv_success_t::RECV_OK, msg: msg_ptr, } } match msg { MessageEvent::Data(val) => _data_or_application(val, salty_msg_type_t::MSG_TASK), MessageEvent::Application(val) => _data_or_applicat...
Rust
0
self.print_to_log_file("Mean: %0.4f" % here) # now we need to figure out if we are done fully_trained_nnunet = (0.911, 0.8739, 0.7848) mean_dice = np.mean(fully_trained_nnunet) target = 0.97 * mean_dice self.all_val_eval_metrics.append(here) sel...
Python
1
display. It will have the following positional arguments: * Push2 object instance Examples: @push2_python.on_display_disconnected() def function(push): print('Connection with Push2 display was just lost!') """ return action_handler(ACTION_DISPLAY_DISCONNECTED) def on_midi_conne...
Python
1
let tree_array = Self::generate_boarding_pass_tree(4); let mut node = Node::new(tree_array, s); node.traverse_tree_array(); node.get_current_value() - node.offset // faked it and it passed; now we need to remove duplication } /// Generates a tree using a vector, breadth-fir...
Rust
0
# Copyright (c) Facebook, Inc. and its affiliates. # # 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
ring(tx)?; let empty_str = alloc_c_string("")?; let handle = ErrorHandle::new()?; let mut fee_handle: *mut c_void = ptr::null_mut(); let error_code = unsafe { CfdInitializeEstimateFee( handle.as_handle(), &mut fee_handle, self.network.is_elements(), ) }; let r...
Rust
0
f"Could not export {number_export_samples} samples. Exhausted dataloader " f"and exported {exported_samples} samples", level="warning", ) LOGGER.info( f"Completed the export of {number_export_samples} " f"input/output samples to {save_dir}" ) def _export_tor...
Python
1
llowed_types]), ), data_check_name=self.name, message_code=DataCheckMessageCode.TARGET_UNSUPPORTED_TYPE, details={"unsupported_type": y.ww.logical_type.type_string}, ).to_dict(), ) return messages ...
Python
1
= Resolver::new(ResolverConfig::default(), ResolverOpts::default())?; let response = resolver.txt_lookup("epicversion.epic.tech.")?; let response_next = response.iter().next().ok_or(Error::new( ErrorKind::Other, "Invalid response when checking the node version!", ))?; let version_next = response_next.iter().ne...
Rust
0
::MAX])?; assert!((result - 4.0).abs() < 1e-12); // d_xyx let dddexpr_dxyx = ddexpr_dxy.partial(0)?; assert_eq!(format!("{}", dddexpr_dxyx), "2.0"); let result = dddexpr_dxyx.eval(&[f64::MAX, f64::MAX])?; assert!((result - 2.0).abs() < 1e-12); Ok(()) } f...
Rust
0
all_wall(&mut layer); let center_pt: Point = Point::new(WIDTH / 2, HEIGHT / 2); // Start by building a platform with a mining hole around it for y in center_pt.y - 10..=center_pt.y + 10 { for x in center_pt.x - 10..=center_pt.x + 10 { let pt = Point::new(x, y); let idx =...
Rust
0
file_type_list, go, quiet, hidden, ignored, ignored_file_types, no_regex, path, pattern, replacement, selected_file_types, subvert, word_regex, } = opt; if file_type_list { on_type_list(); return Ok(...
Rust
0
fo: ItemInfo::new("Sling", 2, vec![Rule::Propulsive]), is_two_hands: false, is_ranged: true, range: 100, damage: CombatProperties { nb_dice: 1, dice_faces: 6, damage_type: DamageType::Bludgeoning, }, } } <filename>examples/comma_separated.r...
Rust
0
when the message does not have a channel set :param bool append: if set to `True` messages are appended to the file, else the file is truncated """ super().__init__(file, mode="a" if append else "w") self.channel = channel self...
Python
1
pace().map(|word| f32::from_str(word)); let x = words.next().ok_or(ParseError::NotEnoughWords)??; let y = words.next().ok_or(ParseError::NotEnoughWords)??; let z = words.next().ok_or(ParseError::NotEnoughWords)??; if words.next().is_some() { return Err(ParseError::TooManyWo...
Rust
0
from odoo import fields, models, api class Hostel(models.Model): _name = 'hostel.hostel' _description = "Information about hostel" _order = "id desc, name" _rec_name = 'hostel_code' name = fields.Char(string="hostel Name", required=True) hostel_code = fields.Char(string="Code", required=True)...
Python
1
he use core::ops::RangeInclusive; use std::collections::HashMap; use itertools::iproduct; use crate::{ cache::{ error::CacheResult, index::{self, CacheIndex}, }, definitions::{ indextype::{ConfigType, IndexType}, mapsquares::{GroupMapSquare, MapFileType, MapSquare, MapSquar...
Rust
0
get_definition( other_defs: &HashMap<String, WidgetDefinition>, globals: &HashSet<VarName>, def: &WidgetDefinition, ) -> Result<(), ValidationError> { let mut variables_in_scope = globals.clone(); for arg in def.expected_args.iter() { variables_in_scope.insert(VarName(arg.name.to_string()));...
Rust
0
assert!(to_utf16(s) == u); assert!(from_utf16(u) == s); assert!(from_utf16(to_utf16(s)) == s); assert!(to_utf16(from_utf16(u)) == u); } } #[test] fn test_char_at() { let s = ~"ศไทย中华Việt Nam"; let v = ~['ศ','ไ','ท','ย','中','华','V','i',...
Rust
0
_EXTRACTION_SIGMA_LIMIT_FAIL, -24 => OFFSET_CAL_NO_SAMPLE_FAIL, -25 => OFFSET_CAL_NO_SPADS_ENABLED_FAIL, -26 => ZONE_CAL_NO_SAMPLE_FAIL, -27 => TUNING_PARM_KEY_MISMATCH, // Other -41 => NOT_IMPLEMENTED, -60 => PLATFORM_SPECIFIC_START, ...
Rust
0
sync::Arc; use ::log::*; use enumset::*; #[allow(unused_imports)] use mutex_trait::Mutex; use embedded_svc::eth::*; use embedded_svc::ipv4; use embedded_svc::mutex::Mutex as ESVCMutex; use esp_idf_sys::*; #[cfg(any( all(esp32, esp_idf_eth_use_esp32_emac), any( esp_idf_eth_spi_ethernet_dm9051, ...
Rust
0
} device_descriptor .config_values .insert(cfg_idx, config_descriptor.bConfigurationValue); device_descriptor .config_descriptors .insert(config_descriptor.bConfigurationValue, config_descriptor); } else { warn!...
Rust
0
heap::Heap, fail::{RtErr, RtResult}, rt_util::bin_reader::BinaryReader, term::{ boxed::{self, bignum::sign::Sign, endianness::Endianness}, term_builder::TupleBuilder, value::Term, }, }; #[repr(u8)] enum CteTag { LiteralInt = 0b000, Integer = 0b001, Atom = 0b010, XReg = 0b011, YReg = 0b100...
Rust
0
Compute A query (in G1) if !at.is_zero() { **a = g1_wnaf.scalar(at.into_repr()); } // Compute B query (in G1/G2) if !bt.is_zero() { let bt_repr = bt.into_repr(); **b_g1 = g1_wnaf.scalar(bt_repr)...
Rust
0
macro_rules! cfg_alloc {( $($item:item)* ) => ( $( #[cfg(feature = "alloc")] #[cfg_attr(feature = "nightly", doc(cfg(any(feature = "alloc", feature = "std"))), )] $item )* )} <reponame>rustkas/error-index<gh_stars>0 /* This error occurs when the compiler was unabl...
Rust
0
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmcv import ops from mmcv.runner import BaseModule from mmdet3d.models.builder import ROI_EXTRACTORS @ROI_EXTRACTORS.register_module() class Single3DRoIAwareExtractor(BaseModule): """Point-wise roi-aware Extractor. Extract Point-wise roi feat...
Python
1
import mysql.connector def view_data(): cnx = mysql.connector.connect(user='root', database='dbtokoonline') cursor = cnx.cursor() def view_pelanggan(): query = "SELECT * FROM Pelanggan" cursor.execute(query) result = cursor.fetchall() print("Data Pelanggan:") for ro...
Python
1
内部属性」と呼ばれます. 「内部」という言葉はこの属性がそれ自体ではマクロの呼び // 出しに対応せず、他のマクロ呼び出しの中で利用されることを示しています。 // // // 参考資料 // // - 関連する構文木: // https://docs.rs/syn/1.0/syn/struct.Attribute.html // https://docs.rs/syn/1.0/syn/enum.Meta.html // // - ランタイムな値に対してフォーマット文字列を適用するマクロ: // https://doc.rust-lang.org/std/macro.format_args.html ...
Rust
0
he end x = x.abs() # Get upper triu of symmetric connectivity matrix triu = torch.triu_indices(n_chans, n_chans, 1) x = x[:, triu[0], triu[1], :] return x @staticmethod def _apply_plv(x, n_chans, batch=None): # Compute PLV connectivity # x -> (batch, el...
Python
1
def main(): time = input("What time is it? ") time_float = convert(time) if 7 <= time_float <= 8: print("breakfast time") if 12 <= time_float <= 13: print("lunch time") if 18 <= time_float <=19: print("dinner time") def convert(time): hours, minutes= time.split(":") ...
Python
1
nds: Commands, mut velocity_query: Query<&mut Velocity, (With<Player>, With<Strafes>)>, mut state: ResMut<State<AppState>>, mut reader: EventReader<StandardBoxEvent>, ) { for event in reader.iter() { if let StandardBoxEvent::Enter(box_) = event { commands.entity(*box_).insert(Active)...
Rust
0
""" Crie um programa que leia o nome de uma cidade e diga se ela começa ou não com o nome "Santo". """ cidade = str(input('Em que cidade você nasceu? ')).split() print(cidade[0].lower() == "santo")
Python
1
st)] // mod tests { // use crate::api::element::Record; // use crate::api::window::{TimeWindow, WindowWrap}; // use crate::storage::keyed_state::mem_storage::{drop_window, merge, windows}; // // #[test] // pub fn parse_test() { // let time_window = TimeWindow::new(2, 5); // let windo...
Rust
0
operty_name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ListClsLogTopicsRequest(AbstractModel): """ListClsLogTopics请求参数结构体 """ def __init__(self): r""" :param _Channel: 接入渠道,cdn或者ecdn,默认值为cdn :type C...
Python
1
def hanshu(M, N, K, equipment): #定义一个函数hanshu min_weight = -1 # 初始最低总重量为-1,表示无法满足要求 for i in range(1, 2**K): sum_a = 0 # 当前组合的氧气总值 sum_b = 0 # 当前组合的燃料总值 sum_c = 0 # 当前组合的装备总重...
Python
1
max_height { max_height = metrics.height; } if metrics.width > max_width { max_width = metrics.width; } }); return (max_height as i32, max_width as i32); } pub fn get(&self, ch: char) -> &FontBitmap { return self.chara...
Rust
0
# By submitting this assignment, I agree to the following: # “Aggies do not lie, cheat, or steal, or tolerate those who do” # “I have not given or received any unauthorized aid on this assignment” # # Names: Gabriel Deem # Daniel Wu # Ricky Alviso # Andrew Wu # Section: 564 # Assignment: Lab 3.15 # Date: 12/9/2023 from...
Python
1
environ["werkzeug.profiler"] = { "elapsed": elapsed * 1000.0, "time": time.time(), } filename = self._filename_format(environ) else: filename = self._filename_format.format( method=environ[...
Python
1
_OFF: &str = concat!(escape!(), "c"); pub const BLINK_ON: &str = concat!(escape!(), "B"); pub const BLINK_OFF: &str = concat!(escape!(), "b"); pub const BACKLIGHT_ON: &str = concat!(escape!(), "+"); pub const BACKLIGHT_OFF: &str = concat!(escape!(), "-"); pub const BACKLIGHT_FLASH: &str = concat!(escape!(), "*"); pub c...
Rust
0
WINDOWS: # see docstring assert pid not in psutil.pids() except (psutil.Error, AssertionError): x -= 1 if x == 0: raise else: return for pid in range(1, 3000): ...
Python
1
None # => void ] updateEdge = Callable[ # 示例数据:updateEdge('edge-1', (edge) => ({ label: 'A new label' })); [ str, # id: string, Union[EdgeType, Callable[[EdgeType], EdgeType]], # edgeUpdate: Partial<EdgeType> | ((edge: EdgeType) => Partial<EdgeType>),\ Option...
Python
1
el = trace.FireTraceElement( component='Example', action='Fake action', ) self.assertEqual(str(el), 'Fake action') def testFireTraceElementAsStringWithTarget(self): el = trace.FireTraceElement( component='Example', action='Created toy', target='Beaker', ) ...
Python
1
.fetchone()[0] + 1 self.cursor.execute("INSERT INTO path(idPath, strPath) VALUES (?, ?)", (path_id, strPath)) return path_id # artwork def get_artwork(self, KodiId, ContentType): Artwork = {} self.cursor.execute("SELECT * FROM art WHERE media_id = ? and media_type = ?", (KodiId,...
Python
1
source: &Collection<Child<'a, G, u64>, D>) -> Variable<'a, G, D> { let (feedback, cycle) = source.inner.scope().loop_variable(u64::max_value(), 1); let cycle = Collection::new(cycle); let mut result = Variable { feedback: Some(feedback), current: cycle.clone(), cycle: cycle }; result.add...
Rust
0
, }; Ok(Response::new(resp)) } } enum BlockGroupType { BlockFees, BlockSize, } async fn get_block_group( mut handler: LocalNodeCommsInterface, request: Request<tari_rpc::BlockGroupRequest>, block_group_type: BlockGroupType, ) -> Result<Response<tari_rpc::BlockGroupResponse>, St...
Rust
0
"""Use odespy to solve general oscillation ODEs.""" import odespy from matplotlib.pyplot import \ plot, savefig, legend, xlabel, figure, title, hold, axis, show def compare(odespy_methods, f, s, F, m, U_0, V_0, T, dt, start_of_plot=0, umin=None, umax=None, exact_solution=None): from nump...
Python
1
Box_::into_raw(f), ) } } fn connect_property_stock_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_stock_size_trampoline<P, F: Fn(&P) + 'static>( this: *mut gtk_sys::GtkCellRendererPixbuf, _param_spec: gl...
Rust
0
o ;K*f@s4ddlmZGdddejZGdddejZdS))formsc@sDeZdZejddejddiddZejddejddiddZ dS) StaffLoginFormEmailTclass form-controlattrs)labelrequiredwidgetPasswordN) __name__ __module__ __qualname__r...
Python
1
from locations.categories import Extras, apply_yes_no from locations.items import Feature from locations.storefinders.woosmap import WoosmapSpider class PoundlandSpider(WoosmapSpider): name = "poundland" item_attributes = {"brand": "Poundland", "brand_wikidata": "Q1434528"} key = "woos-4108db5c-39f8-360b-...
Python
1
from ._npyio_impl import DataSource, NpzFile, __doc__ # noqa: F401
Python
1
import asyncio from asgiref.sync import sync_to_async from datetime import datetime from users.models import UserProfile, UserPhoto import re from django.conf import settings import os from .gpt import generate_one from moviepy.editor import ImageClip, concatenate_videoclips, CompositeVideoClip from moviepy.video.fx i...
Python
1
t_lkey(), mrkey: obj_key} join_model_cls.insert(params).run() def remove(self, *objs): old_keys = set() for obj in objs: if not isinstance(obj, model_cls): raise TypeError('%s instance expected, got %r' % ...
Python
1
class Solution(object): def containsCycle(self, grid): """ :type grid: List[List[str]] :rtype: bool """ dx = [1, -1, 0, 0] dy = [0, 0, 1, -1] ufs = UnionFindSet(grid) m, n = len(grid), len(grid[0]) for i in range(m): for j in range(...
Python
1
# Copyright (c) 2012 Tuan Tran # ======================================================================= # Distributed under the MIT License. # (See accompanying file LICENSE or copy at # http://opensource.org/licenses/MIT) # ======================================================================= """"This module is...
Python
1
board_width, board_height, &mut pattern_board, &searched_patterns)?; render_board(&board_a, board_width, board_height, &pattern_board, &mut canvas)?; } pattern_board.write().unwrap().clear(); pattern_board.write().unwrap().resize_with((board_width * board_height) as usize, Default:...
Rust
0
ata.east_asian_width(c)] return width def date_time_str(t: float) -> Tuple[str, str]: """Convert seconds since the Epoch to formatted local date and time strings.""" source_date_epoch = os.environ.get('SOURCE_DATE_EPOCH') if source_date_epoch is not None: t = time.gmtime(min(t, int(source_date...
Python
1
from abc import ABCMeta, abstractmethod from typing import TYPE_CHECKING if TYPE_CHECKING: from .system import System from .base_world import BaseWorld class Event(metaclass=ABCMeta): """Event is a class which has a process method. The process method is executed when the event is trigered. """ ...
Python
1
# https://adventofcode.com/2023/day/23 # https://github.com/Favo02/advent-of-code import sys from collections import defaultdict, deque sys.setrecursionlimit(10**5) fin = open(sys.argv[1]) if len(sys.argv) > 1 else sys.stdin def matrix_dfs(matrix, cur, cur_dist, seen=set(), dist=defaultdict(int)): if cur in seen: ...
Python
1
pub unsafe trait Feature { const FLAG: u32; type Structure: Sized; type Result; fn get_result(hr: i32, structure: &Self::Structure) -> Self::Result; } use crate::arch::aarch64::ir as lir; use crate::common::analyze_resource::frame_object::StackFrame; use crate::common::three_address_code as tac; pub ...
Rust
0
xis values. /// * Two POV hat values. /// * 24 buttons. /// /// This is similar to the amount of data collected by the /// [DIJOYSTATE](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ee416627(v=vs.85)) /// struct, which is MSDN's suggested default. /// /// With our version here the number of element...
Rust
0
from openai import OpenAI import lib background = """ ## What would you like ChatGPT to know about you to provide better responses? 我:你是 LLM ,擅長預測下一個詞彙 (System 1),但是不擅長進行深入思考 (System 2) 但是你可以呼叫其他專家來回答《深入思考》的問題 因此請你在自己不擅長回答的問題上,改用呼叫 Python 函數的方式回應。 如果一個 Python 函數在你的記憶中已經出現過,或者在下列函數列表中,那麼直接呼叫就可以了 * eval(exp) -- 將 P...
Python
1
x_a = 10 x_a = -10 print("Пункт a: x =", x_a) x_b = 17.5 x_b = -2 * x_b print("Пункт b: x =", x_b) x_c = 60 x_c = x_c - 1 x_c = 0 print("Пункт c: x =", x_c) k = 5 x_d = -50 x_d = -25 x_d = x_d + k print("Пункт d: x =", x_d)
Python
1
!("-L{filepath} -l{name}"), }, } } } else { eprintln!("Could not find an artifact named \"{name}\"!"); eprintln!("Possible artifacts:"); // FIXME: Dependency artifacts are also listed here, but it would be improper for // a user to be able to dire...
Rust
0
""" Routers package for FastAPI MCP server. Contains specialized routers for different model types and functionalities. """ from . import codegen_router, debugger_router __all__ = ["codegen_router", "debugger_router"]
Python
1
possible_values = CopyMode::possible_values())] pub mode: CopyMode, #[clap( help = "comma separated list of commands that should enter copy mode when key is pressed" )] pub commands: String, } pub fn send_key_or_copy_mode(options: SendKeyOrCopyMode) -> nmk::Result<()> { let SendKeyOrCopyMo...
Rust
0
# 임시로 기본 후속 질문 사용 follow_up_questions = [ "구체적인 예시를 들어 설명해주세요.", "그 상황에서 본인의 역할은 무엇이었나요?", "결과적으로 어떤 성과를 얻었나요?" ] return { "success": True, "follow_up_questions": follow_up_questions, "total_count": len(...
Python
1
errupt status after masking & forcing for irq1"] pub irq1_ints: IRQ1_INTS, } #[doc = "PIO control register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`]...
Rust
0
fn sub_bytes(state: &mut [u32; 4]) { for i in 0..4 { state[i] = sub_word(state[i]); } } fn shift_rows(state: &mut [u32; 4]) { state[1] = state[1] << 08 | state[1] >> 24; state[2] = state[2] << 16 | state[2] >> 16; state[3] = state[3] << 24 | state[3] >> 08; } fn mix_columns(state: &mut [u...
Rust
0
{ let parent = div(); let text_node = text("ab"); parent.append_child(&text_node); selection().select_all_children(&parent); assert!(selection().contains_whole(&text_node)); } } <gh_stars>1000+ // SPDX-License-Identifier: MIT // Copyright (C) 2018-present iced project and co...
Rust
0
latten) if input_padding_mask is not None: value = value.masked_fill(input_padding_mask[..., None], float(0)) value = value.view(N, Len_in, self.n_heads, self.d_model // self.n_heads) # 计算采样偏移量和注意力权重 sampling_offsets = self.sampling_offsets(query).view( N, Len_q,...
Python
1
RecoverableSignature::from_compact(&s, &[ 0x66, 0x73, 0xff, 0xad, 0x21, 0x47, 0x74, 0x1f, 0x04, 0x77, 0x2b, 0x6f, 0x92, 0x1f, 0x0b, 0xa6, 0xaf, 0x0c, 0x1e, 0x77, 0xfc, 0x43, 0x9e, 0x65, 0xc3, 0x6d, 0xed, 0xf4, 0x09, 0x2e, 0x88, 0x98, 0x4c, 0x1a, 0x97, 0x16, 0...
Rust
0
let dpdv = if self.common.curve_type == CurveType::Ribbon { Vector3::from(n_hit).cross(&dpdu).normalize() * hit_width } else { // Compute curve dpdv for flat and cylinder curves. let dpdu_plane = ray_to_object.inverse().transform_vector(&dpdu); ...
Rust
0
pcLocalAddressFormat = 2i32; #[doc = "*Required features: `\"Win32_System_Rpc\"`*"] pub type RpcProxyPerfCounters = i32; #[doc = "*Required features: `\"Win32_System_Rpc\"`*"] pub const RpcCurrentUniqueUser: RpcProxyPerfCounters = 1i32; #[doc = "*Required features: `\"Win32_System_Rpc\"`*"] pub const RpcBackEndConnecti...
Rust
0