text
string
label_name
string
labels
int64
n new_opt_ensure(value: Option<Ensure>) -> Self { Self::OptEnsure(value.map(Box::new)) } pub(crate) fn new_opt_else(value: Option<Else>) -> Self { Self::OptElse(value.map(Box::new)) } pub(crate) fn new_exc_var(value: ExcVar) -> Self { Self::ExcVar(Box::new(value)) } pub(c...
Rust
0
", err), Ok(_) => panic!("Expected failure"), } } #[test] fn test_result_finish() { let conn = or_panic!(Connection::connect("postgres://postgres@localhost", &NoSsl)); or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id BIGINT PRIMARY KEY)", [])); let stmt = or_panic!(conn.prepare("SELECT * ...
Rust
0
# archive-pdf-tools # Copyright (C) 2020-2021, Internet Archive # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
Python
1
sync::Arc, }; mod generator; mod group; mod multiexp; mod prover; // mod singlecore; mod multicore; mod source; mod verifier; mod wnaf; pub use self::{generator::*, prover::*, source::*, verifier::*}; #[cfg(test)] mod test; #[derive(Debug, Clone)] pub struct Proof<E: PairingEngine> { pub a: E::G1Affine, p...
Rust
0
(1); //! let data: Option<&[u8]> = row.get(2); //! //! println!("found person: {} {} {:?}", id, name, data); //! } //! # Ok(()) //! # } //! ``` //! //! # Implementation //! //! This crate is a lightweight wrapper over tokio-postgres. The `postgres::Client` is simply a wrapper around a //! `tokio_postgres::Clien...
Rust
0
b fn is_dcorsel_7(&self) -> bool { *self == DCORSELR::DCORSEL_7 } } #[doc = "Possible values of the field `DCOFTRIM`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum DCOFTRIMR { #[doc = "DCO frequency trim: 0"] DCOFTRIM_0, #[doc = "DCO frequency trim: 1"] DCOFTRIM_1, #[doc = "DCO freq...
Rust
0
tom attributes for the output array, if high-level. Like #ak.argmax, but treating NaN ("not a number") values as missing. Equivalent to ak.argmax(ak.nan_to_none(array)) with all other arguments unchanged. See also #ak.argmax. """ # Dispatch yield (array,) # Impl...
Python
1
egressor( feature_columns=all_feature_columns, hidden_units=[32, 10], warm_start_from='models/autompg-dnnregressor/', model_dir='models/autompg-dnnregressor/') def eval_input_fn(df_test, batch_size=8): df = df_test.copy() test_x, test_y = df, df.pop('MPG') dataset = tf.data.Dataset.from_...
Python
1
"bubble_marble_02": "My_asset/S/BubbleMarble_02.usd", "bubble_marble_03": "My_asset/S/BubbleMarble_03.usd", "caster_bearing": "My_asset/S/caster_bearing.usd", "cheerio_geom": "My_asset/S/Cheerio_geom.usd", "d20_01": "My_asset/S/D20_01.usd", ...
Python
1
from django.http import Http404, HttpResponse, HttpResponseForbidden from django.utils.deprecation import MiddlewareMixin from wagtail.models import Page from wagtail.views import serve class BlockDodgyUserAgentMiddleware(MiddlewareMixin): # Used to test that we're correctly handling responses returned from midd...
Python
1
as f: sql = f.read() # with transaction(conn): conn.executescript(sql) @pytest.fixture(params=itertools.product(PAGE_SIZES, JOURNAL_MODES)) def get_db(request) -> Tuple[str, sqlite3.Connection]: # if dbname in os.listdir(): # os.system(f"rm -rf {dbname}*") conn = sqlite3.connect(dbna...
Python
1
from pydantic import BaseModel from typing import Optional class LoraConfig(BaseModel): r: int = 32 target_modules: str = "all-linear" use_rslora: bool = True modules_to_save: list = ["lm_head"] class DiffusionForcingModelConfig(BaseModel): num_hidden_layers: int = 2 num_diffusion_iteration...
Python
1
(self) -> &'a mut W { self.variant(ISO0RXPTR0_A::ISO0RXPTR0_0) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); self.w } } #[doc ...
Rust
0
🞛', '瀞', '🕮', '省', '𝈶', 'ꄢ', '𛱃', '⮍', '𐴴', 'ﮂ', '𐞡', '㍴', '🨯', '؞', '𑶤', 'Ϋ', '↜', '𖬝', 'Ⰰ', '𝗻', '\u{827}', '🤻', 'ꑵ', '𑃛', 'ⴙ', '🌎', '𒉤', '𝚸', '⓳', '🮦', '𑈮', '༤', 'ڢ', '𘭑', '🥼', '㈋', 'ꌽ', '𐐡', 'ꌿ', '\u{1ab1}', '𞟶', '𞋩', 'ɂ', 'ܢ', 'ᆥ', '𐔷', '𑫟', '\u{1e136}', '𖦧', 'ᖥ', '⠄', ...
Rust
0
# Copyright 2022 Red Hat, Inc. # 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...
Python
1
MOpcode::OpAdd => self.handle_binop(ret_node, ops, c_ast::Expr::Add, ast), MOpcode::OpAnd => self.handle_binop(ret_node, ops, c_ast::Expr::And, ast), MOpcode::OpDiv => self.handle_binop(ret_node, ops, c_ast::Expr::Div, ast), MOpcode::OpEq => self.handle_binop(ret_node, ops...
Rust
0
annel in updated_channels.items(): volume = channel['volume'] if not channel['mute'] else 0 muted = channel['mute'] if i < len(volumes): # Make sure we're not exceeding array bounds # Only update if the volume has changed if volume != volumes[i] or muted != (volumes[i] =...
Python
1
either the [`Map`](super::Map) is dropped, there are no sensitive reads /// running on that [`Map`](super::Map) or both [`Map`](super::Map)s share the /// same incinerator. pub struct Removed<K, V> { nnptr: NonNull<(K, V)>, origin: Weak<Incinerator<Garbage<K, V>>>, } impl<K, V> Removed<K, V> { pub(super) ...
Rust
0
{AgentSchema, MessageSchema}, }, simulation::package::creator::PackageCreators, }; pub struct Config { pub agent_schema: Arc<AgentSchema>, pub message_schema: Arc<MessageSchema>, pub context_schema: Arc<ContextSchema>, } impl Config { pub fn new_sim( exp_config: &super::ExperimentConfi...
Rust
0
� /// assert_eq!(Jaeum::from(choseong), Jaeum::Rieul); /// /// let jongseong = Jongseong::PieupSios; // ㅄ /// assert_eq!(Jaeum::from(jongseong), Jaeum::PieupSios); /// /// let jaeum = Jaeum::SsangSios; // ㅆ /// assert_eq!(Choseong::try_from(jaeum), Ok(Choseong::SsangSios)); /// assert_eq!(Jongseong::try_from(jaeum), Ok...
Rust
0
self.rcs, MatchesAll( ContainsAllIPs([gone_ip, stay_ip]), HasLength(2) ), timeout=timeout_default ), clb_other.wait_for_nodes( self.rcs, MatchesAll( ...
Python
1
) timbre = torch.cat(x.shape[2] * [timbre], 2) timbre = torch.cat(x.shape[3] * [timbre], 3) condition = torch.cat([f0, timbre], 1) x = torch.cat([x, condition], 1) hiddens = [] for resnet1, resnet2, attn, downsample in self.downs: x = resnet1(x, ...
Python
1
# # Copyright (C) 2014-2025 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # OpenQuake is distri...
Python
1
rgb_key] = np.moveaxis(data[rgb_key], -1, -3).astype(np.float32) / 255. # Step2: 处理其他数据 for key in raw_data_dict: if key == rgb_key: # RGB 图像原来就是 Uint 类型 continue obs_dict[key] = data[key].astype(np.float32) # Step3: 产生两个机器手之间的相对位姿,没有就不作用 # generate relative pose betwee...
Python
1
self.setDefaultButton(qt.QMessageBox.StandardButton.Yes) class SettingsDialog(qt.QDialog): def __init__(self, title): super(SettingsDialog, self).__init__() self.setWindowTitle(title) self.setMinimumHeight(200) self.setMinimumWidth(400) layout = qt.QVBoxLa...
Python
1
# Copyright 2021 The Funnel Rocket Maintainers # # 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 o...
Python
1
""" Задача №13. Пользователь вводит число N (1 ≤ N ≤ 10). Далее построчно N чисел от -50 до 50. Нужно вывести наибольшее количество идущих подряд положительных чисел. Input: 6 -> -20 30 -40 50 10 -10 Output: 2 """ from random import randint amount_of_days = int(input("Input amount of days: ")) count = 0 max_count ...
Python
1
ygen); oxygen.retain(|x| { let ch = x.chars().nth(i).unwrap(); if m[i] == 0 { ch == '0' } else { ch == '1' } }); } if co2.len() > 1 { let m = most_common_values(&c...
Rust
0
galera = list() pessoa = dict() soma = media = 0 while True: pessoa.clear() pessoa['nome'] = str(input('Nome: ')) while True: pessoa['sexo'] = str(input('Sexo: [M/F] ')).upper()[0] if pessoa['sexo'] in 'MF': break print('ERRO! Por favor, Digite apenas M ou F.') pessoa...
Python
1
<(usize, String)> = self.connection.hgetall(self.session_key())?; let mut todos: Vec<Todo> = ids_and_payloads .into_iter() .map(|(_, payload)| serde_json::from_str(&payload)) .flat_map(|r| r) .collect(); todos.sort_unstable_by_key(|t| t.id); Ok(...
Rust
0
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html import inspect # -- Path setup ---------------------------------------------------------...
Python
1
)* } $( impl From<$ty> for Any { fn from(lang: $ty) -> Self { Self::$ty(lang) } } )* impl $crate::lang::LangItem<$lang> for Any { fn format( &self, out: &mut $crate::...
Rust
0
import numpy as np import astropy.io.ascii as ascii import matplotlib.pyplot as plt pyout = ascii.read('test.pyout') idlout = ascii.read('test.idlout') fig, axarr = plt.subplots(4, 2, figsize=(10, 10)) fig.suptitle("python") axarr[0,0].plot(pyout['alpha']) axarr[0,0].set_ylabel('alpha') axarr[0,1].plot(pyout['beta']...
Python
1
under=101"): should_fail_under(100.0, 101, 0) @pytest.mark.parametrize( "statements, lines, result", [ ({1, 2, 3, 4, 5, 10, 11, 12, 13, 14}, {1, 2, 5, 10, 11, 13, 14}, "1-2, 5-11, 13-14"), ( [1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 98, 99], [1, 2, 5, 10, 11, 13, 14, ...
Python
1
tus'] = _SMARTRECORDERSTATUS DESCRIPTOR.enum_types_by_name['RecordingState'] = _RECORDINGSTATE _sym_db.RegisterFileDescriptor(DESCRIPTOR) SmartRecorderStatus = _reflection.GeneratedProtocolMessageType('SmartRecorderStatus', (_message.Message,), { 'DESCRIPTOR' : _SMARTRECORDERSTATUS, '__module__' : 'modules.common_...
Python
1
onse.text, "html.parser") # Find all anchor tags with the title attribute containing the ride name ride_name_elements = soup.find_all("a", title=True) for ride in ride_name_elements: ride_name = ride.get_text(strip=True) if ride_name == "Astro Orbitor": parent_tr = ride.find_p...
Python
1
.lock().init(); GAME.lock().run(); } /* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under both the MIT license found in the * LICENSE-MIT file in the root directory of this source tree and the Apache * License, Version 2.0 found in the LICENSE-APACHE file in the root dir...
Rust
0
utput(); //! # std::process::Command::new("sudo ip link set up vcan0").output(); //! let interface = RefCell::new(socketcan::CANSocket::open("vcan0").unwrap()); //! //! let module1 = Module::new(&interface, 1); //! let module2 = Module::new(&interface, 2); //! //! module1.write_command(ROR::new(0, 2...
Rust
0
# Generated by Django 5.1.4 on 2024-12-07 15:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('students', '0016_alter_currentsemester_options_and_more'), ] operations = [ migrations.AddField( model_name='studenthistory', ...
Python
1
import lmdb import numpy as np import cv2 import json LMDB_ENVS = dict() LMDB_HANDLES = dict() LMDB_FILELISTS = dict() def get_lmdb_handle(name): global LMDB_HANDLES, LMDB_FILELISTS item = LMDB_HANDLES.get(name, None) if item is None: env = lmdb.open(name, readonly=True, lock=False, readahead=Fal...
Python
1
from __future__ import annotations from typing import Any, Dict, List, Optional, Protocol class AgentRole(Protocol): """ Contrato mínimo para roles de agentes bajo coordinación. """ name: str async def act(self, context: Dict[str, Any]) -> Dict[str, Any]: ... async def respond(self...
Python
1
_DSCLKCFG_DSOSCSRCR::SYSCTL_DSCLKCFG_DSOSCSRC_MOSC => 3, SYSCTL_DSCLKCFG_DSOSCSRCR::SYSCTL_DSCLKCFG_DSOSCSRC_RTC => 4, SYSCTL_DSCLKCFG_DSOSCSRCR::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline(always)] pub fn _from(value: u8) -> SYSCTL_DSC...
Rust
0
SIG_IGNSIGTERMr)rr.r,r#stdinstdoutrr&_CLEANUP_FUNCSkeysopenstripdecodesplitgetrAaddremove RuntimeError excepthookexc_infoitemsr r!r@) fdfcacheliner/r:r;Z cleanup_funcZ rtype_cacheer r r mains     ...
Python
1
event error due to cloned model (with new tf>=2.11 optimizers) optimizer = self.train_kwargs['optimizer'] self.train_kwargs['optimizer'] = optimizer.__class__.from_config(optimizer.get_config()) train_args = [self.model, self.loss_fn, None] self.train_kwargs.updat...
Python
1
unt // 4 for page_num in range(pages_amount): page = reader.pages[page_num] parsed_text[page_num + 1] = parse_page_to_text(page, page_num=page_num + 1, filepath=filepath, lang=lang) if page_num <= pages_amount_div_4 or page_num >= pages_amount - pages_amount_div...
Python
1
import requests, re, sys, codecs,time from multiprocessing import Pool from time import time as timer global user_agent,helper,directory,ifing,list_targets def logo(): banner=(f'''\033 \t # # ####### # # # ####### # # # # \t # # # # # # # # ## ## # # \t # # # ...
Python
1
def tinh_tong(n): tong = 0 for i in range(1,n + 1): tong += 1 / ((n ** 2) + i) return tong n = int(input("Nhập Giá trị n = ")) print("Tổng cần tìm là: ",tinh_tong(n))
Python
1
1 and len(e) == 2: c = (int(e[0]) << 8) + int(e[1]) if ( (c >= 0xC2A1 and c <= 0xC2BF) or (c >= 0xC780 and c <= 0xC783) or (c >= 0xCAB9 and c <= 0xCBBF) or (c >= 0xCC80 and c <= 0xCDA2) ): ...
Python
1
t info_size = mem::size_of::<ffi::MojoBufferInformation>() as u32; let mut info = ffi::MojoBufferInformation { struct_size: info_size, flags: 0, num_bytes: 0, _align: [], }; let r = MojoResult::from_code(unsafe { ffi::MojoGetBufferInfor...
Rust
0
import unittest from hamcrest import * from src.MAMEToolkit.emulator.StreamGobbler import StreamGobbler from multiprocessing import get_start_method, set_start_method, Process, Queue import queue def run_gobbler(lines, output_queue): pipe = MockPipe(lines) line_queue = queue.Queue() gobbler = None try...
Python
1
import unittest from solution import TreeNode, Solution # Helper function to create a binary tree from a list (level-order) def list_to_binary_tree(lst): if not lst: return None root = TreeNode(lst[0]) queue = [root] i = 1 while i < len(lst): current = queue.pop(0) if lst[i]...
Python
1
.debug_struct("USCI_A0_SPI_MODE").finish() } } #[doc = "USCI_A0 SPI Mode"] pub mod usci_a0_spi_mode; #[doc = "USCI_A1 UART Mode"] pub struct USCI_A1_UART_MODE { _marker: PhantomData<*const ()>, } unsafe impl Send for USCI_A1_UART_MODE {} impl USCI_A1_UART_MODE { #[doc = r"Pointer to the register block"] ...
Rust
0
process| { process .cons( atom_unchecked("zero"), process .cons(process.integer(1).unwrap(), Term::NIL) .unwrap(), ) .unwrap() }, ); } #[test] #[ignore] fn wit...
Rust
0
if m.bias is not None: # m.bias.data.fill_(bias_fill) # # # class ResidualBlockNoBN(nn.Module): # """Residual block without BN. # # It has a style of: # ---Conv-ReLU-Conv-+- # |________________| # # Args: # num_feat (int): Channel number of intermedia...
Python
1
pass def convert_xy_to_extent(xy, scale_vector, gi, pic): '''Cannot use xy_t because it has been shifted partly discarded''' # frame_num = gi['frame_ss'][1] - gi['frame_ss'][0] # ALWAYS extent = np.zeros((len(xy), 4)) # left, right, bottom, top borders extent_t = np.zeros((len(xy), 4)) # lef...
Python
1
import h5py import numpy as np from annoy import AnnoyIndex import sqlite3 filePath = 'asset/per-protein.h5' indexFile = 'protein_embeddings.ann' databaseFile = 'protein_index.db' def isValidEmbedding(embedding): return not np.any(np.isnan(embedding) | np.isinf(embedding)) def buildAnnoyDb(embeddings, num_trees=...
Python
1
Name: LPCWSTR, pReserved: *mut c_void, NewState: SPRULESTATE, pcRulesChanged: *mut ULONG, ) -> HRESULT, fn SetProprietaryRuleIdState( pvEngineGrammar: *mut c_void, dwRuleId: DWORD, NewState: SPRULESTATE, ) -> HRESULT, fn LoadSLM( pvEngineGrammar: *...
Rust
0
w() .base(0) .limit(0xfffff) .granularity(gdt::Granularity::Page) .size(32) .present() .ring(gdt::RingLevel::Ring0) .executable() .read_write() ...
Rust
0
) if args.fuse_conv_bn: model = fuse_conv_bn(model) if not distributed: model = MMDataParallel(model, device_ids=[0]) outputs = single_gpu_test(model, data_loader, args.show, args.show_dir) else: model = MMDistributedDataParallel( model.cuda(), device...
Python
1
yload["data"]["project_code"] == "PROJ_A" @patch.object(ProjectsAPI, "_send_request") def test_get_project_scans_project_not_found(mock_send, projects_api_inst): mock_send.return_value = {"status": "0", "error": "Project code does not exist"} # Should return empty list, not raise scans = projects_api_inst...
Python
1
Self: Sized, { Dependencies::empty() } fn get_state_field_specs( &self, _config: &ExperimentConfig, _globals: &Globals, _field_spec_map_builder: &RootFieldSpecCreator, ) -> Result<Vec<RootFieldSpec>> { Ok(vec![]) } } pub struct StateColumn { ...
Rust
0
_transaction_header()); cdata.append(&mut update_type); cdata.append(&mut ip_info_length.to_be_bytes().to_vec()); cdata.append(&mut ip_identity); ledger.exchange(create_command(cdata, 0)).unwrap(); // Send name length let mut cdata = Vec::new(); cdata.append(&mut name_length.to_be_bytes()....
Rust
0
negated: false, low: Box::new(lit(0)), high: Box::new(lit(10)), }; let expr = expr.or(Expr::Literal(ScalarValue::Boolean(None))); let result = expr.clone().rewrite(&mut rewriter)?; assert_eq!(expr, result); Ok(()) } #[test] fn optimize_e...
Rust
0
// dbg!(s_ps); let n = re_n.captures(body).unwrap().get(1).unwrap().as_str(); // dbg!(n); let re_ps_num = Regex::new(r"(ps\[\d+\])").unwrap(); // let f_ps = re_ps_num. } // as := strings.Split(string(reAS.FindSubmatch(body)[1]), ",") // ps := strings.Split(string(r...
Rust
0
85442, 81479, 107241], ], "24.0": [ [72410, 79137, 76694, 90854, 73023, 82980, 72707, 54842], [85561, 81870, 76953, 48967, 79315, 85442, 81479, 107241], ], } librispeech_dummy = load_dataset("hf-internal-testing/librispeech_asr_dummy", ...
Python
1
scalation_ticket = Table( 'attendee_escalation_ticket', MagModel.metadata, Column('attendee_id', UUID, ForeignKey('attendee.id')), Column('escalation_ticket_id', UUID, ForeignKey('escalation_ticket.id')), UniqueConstraint('attendee_id', 'escalation_ticket_id'), Index('ix_attendee_escalation_tick...
Python
1
urned_value=returned_value, ) finally: self.set_current_task( task=None, ) def pre_work( self, task: objects.Task, killer_object: typing.Optional[killer.process.Killer] = None, ) -> None: try: self.worker_ob...
Python
1
rents=True, exist_ok=True) for i in range(3): (root / f"file_{i}").write_text("NICE") files = list(root.ls()) assert len(files) == 3 valid_names = [f"file_{i}" for i in range(len(files))] for i, blob_stat in enumerate(files): assert blob_stat.name in valid_names assert blob_s...
Python
1
parent: Some(0) }, Edge { src: 0, dst: 2, status: New }, Retreat { u: 2, parent: Some(0) }, Retreat { u: 0, parent: None }, ] ); dfs_test...
Rust
0
test_inputs = triage_inputs + flight_modifications for test in test_inputs[:1]: result = await swarm.generate_str(test) logger.info(f"Result: {result}") await swarm.set_agent(triage_agent) await triage_agent.shutdown() if __name__ == "__main__": import time async def m...
Python
1
sult<Vec<DamlTypePayload<'_>>> { args.iter().map(DamlTypePayload::try_from).collect::<DamlLfConvertResult<Vec<_>>>() } #![allow(dead_code)] #[macro_use] extern crate lazy_static; extern crate num_cpus; extern crate stderr; extern crate mio; extern crate slab; // TcpStream::from_stream tokio-0.1.1也有类似api, 等tokio稳定...
Rust
0
LETTER OO] => Some("OO"), '\u{0222}' | // Ȣ http://en.wikipedia.org/wiki/OU [LATIN CAPITAL LETTER OU] '\u{1D15}' // ᴕ [LATIN LETTER SMALL CAPITAL OU] => Some("OU"), '\u{24AA}' // ⒪ [PARENTHESIZED LATIN SMALL LETTER O] => Some("(o)"), '\u{0153}' | // œ [LATIN ...
Rust
0
\n blackness-80: #1a0033;\ \n blackness-100: black;\ \n}\ \nwhiteness-20 {\ \n blackness-0: #9933ff;\ \n blackness-20: #8033cc;\ \n blackness-40: rebeccapurple;\ \n blackness-60: #4d3366;\ \n blackness-80: #333333;\ \n blackness-10...
Rust
0
'atlas://data/images/defaulttheme/action_bar') ''' Background image of the ActionBars default graphical representation. :attr:`background_image` is a :class:`~kivy.properties.StringProperty` and defaults to 'atlas://data/images/defaulttheme/action_bar'. ''' border = ListProperty([2, 2...
Python
1
object, }); } } } let object_buffer = InstanceBuffer::new(context, &objects)?; let target_buffer = InstanceBuffer::new(context, &targets)?; Ok(Self { object_buffer, target_buffer, background }) } pub fn bui...
Rust
0
def getCount(self, head): count = 0 current = head while current: count += 1 current = current.next return count
Python
1
torch pretrained = False models = [ resnext14_16x4d, resnext14_32x2d, resnext14_32x4d, resnext26_16x4d, resnext26_32x2d, resnext26_32x4d, resnext38_32x4d, resnext50_32x4d, resnext101_32x4d, resnext101_64x4d, ] for model ...
Python
1
ected() -> None: nproc = util.selected_process() if nproc not in PROC_STATE: return trace = commands.STATE.trace if trace is None: return nthrd = util.selected_thread() level = util.selected_frame() with trace.client.batch(): with trace.open_tx("Frame {}.{}.{} selecte...
Python
1
Gr \"\%GR5GSUSj5Gr \"\%GR5GSuSj5Gr\"\%GR5S<SSI\#GR \#GR"\#GR$4GSvSjj5Gr\"\%GR&5...
Python
1
# Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master...
Python
1
_product(cell, max_window_index, x_g1, x_g2, t_g1, t_g2): """ 原地更新内积,不返回值 :param cell: 待更新的内积数组 :param max_window_index: :param x_g1: :param x_g2: :param t_g1: :param t_g2: :return: None """ for i in prange(t_g1.shape[0]): for j in range(max_window_index - 1, 0, -1): ...
Python
1
from pydantic import BaseModel from typing import Dict, List, Optional """ Defines Pydantic models for request/response validation """ class TweetAnalysisRequest(BaseModel): tweet_text: str class FactCheckRequest(BaseModel): tweet_text: str class FactCheckResult(BaseModel): accuracy_score: float verif...
Python
1
ip.id)]['deleted'] == 1 def test_merge_nodes(client, session): node1 = Node(node_type="testtype") node2 = Node(node_type="testtype") session.add(node1) session.add(node2) session.commit() response = client.put('/graph/node/merge', json={'id': [node1.id, node2.id]}) assert response.status_co...
Python
1
from fastapi import Depends, APIRouter, WebSocket, WebSocketDisconnect from fastapi.exceptions import HTTPException from fastapi.responses import JSONResponse from fastapi_limiter.depends import RateLimiter from pydantic import BaseModel from src.utils.auth import verify_api_key, permission_check router = APIRouter() ...
Python
1
import argparse from pathlib import Path import tweetnlp from pklballcheck import collect_attr_stats, verify_loader_was_used TEST = "The happy man has been eating at the diner" def load_model(model_path, test=TEST) -> tuple[bool, str]: model_dir = Path(model_path).parent try: model = tweetnlp.Class...
Python
1
ErrorLocation { file, line: Some(line), column: None, } => println!("{}|{}|", file, line), ErrorLocation { file, line: None, .. } => println!("{}||", file), } } struct ErrorLocation<'a> { file: &'a str, line: Option<u32>, ...
Rust
0
surface_pos, recursion_depth, ); let ap2 = self.shader2.get_appearance_for( intersection_pos, ray_dir, surface_normal, world, surface_pos, recursion_depth, ); ap1 + ap2 } } // Add 2 Boxed Shader i...
Rust
0
, /// `!=` operator. Neq, /// `>` operator. Gt, /// `<` operator. Lt, /// `>=` operator. Gte, /// `<=` operator. Lte, /// `<<` operator. Lsh, /// `>>` operator. Rsh, /// `BANK(Symbol)` BankSym(u32), /// `BANK("section")` BankSect(&'a [u8]), ///...
Rust
0
0xe4 - PWM Write Protection Control Register"] pub wpcr: WPCR, #[doc = "0xe8 - PWM Write Protection Status Register"] pub wpsr: WPSR, _reserved31: [u8; 28usize], #[doc = "0x108 - Transmit Pointer Register"] pub tpr: TPR, #[doc = "0x10c - Transmit Counter Register"] pub tcr: TCR, _res...
Rust
0
ze, t: isize) -> usize { if c <= 0 || t <= 0 { 0 } else { let c = BigUint::from(c as usize); let t = BigUint::from(t as usize); binomial(&c + t, c).to_usize().unwrap() } } fn find_t(c: usize, r: usize) -> usize { let c = c as isize; let r = r as isize; if c == 1...
Rust
0
LOW}Enter target (IP, domain, or network): {Style.RESET_ALL}").strip() if not target: print(f"{Fore.RED}Target is required.{Style.RESET_ALL}") return None return target @staticmethod def confirm_workflow_execution(workflow_name: str, target: str) -> bool: """...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipaySecurityRiskCustomerriskQueryResponse(AlipayResponse): def __init__(self): super(AlipaySecurityRiskCustomerriskQueryResponse, self).__init__() self._risk_result...
Python
1
art += 1; self.msg_type = bytes[start]; start += 1; eprintln!( "start: {}, byte: {:x}, len: {}", start, bytes[start], bytes.len() ); self.msg_length = u32::from_be_bytes(bytes[start..start + 4].try_into().unwrap()) .tr...
Rust
0
ro, "SOLICITANDO_CITA", "modificar_nombre", datos_guardados, config) return "De acuerdo. ¿Cuál es tu nombre?" elif 'todo' in mensaje.lower(): actualizar_estado_conversacion(numero, "SOLICITANDO_CITA", "reiniciar", {}, config) if es_porfirianna: return...
Python
1
R'RtNonetminR Rt TypeErrortAttributeErrortsortedR R t _nsmallestR;RR R ( RR*RHR+theadtsizeR,tin1tin2((sH/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/heapq.pyRs,    ...
Python
1
sh script dependencies are present in $PATH") .arg( Arg::with_name("DEPENDENCIES") .help("Your sh script dependencies") .index(1) .multiple(true) .required(true) ) ...
Rust
0
.peers .iter() .filter(|peer| peer.state.has(piece_idx).unwrap()) .count(); if num_owners < self.peers.len() { let piece = FilePieceData { idx: piece_idx, peer_shift: 0, num_owners: num_owners as PieceNumOwners, ...
Rust
0
els, num_clients) acc1, f1_sc1, auroc1 = get_accuracy(cent_model, breakhis_test_loader) acc2, f1_sc2, auroc2 = get_accuracy(cent_model, bracs_test_loader) wandb.log({"Server Model Accuracy (break-his)": acc1}) wandb.log({"Server Model Accuracy (bracs)": acc2}) print("Communication", i+2, "| Test Acc...
Python
1
# coding: utf-8 ''' newimagedlgPyside.py Annotated PySide adaptation of newimagedlg.py from Chapter 6 of Mark Summerfield's 'Rapid GUI Programming with Python and Qt' (2008) Book's web site: http://www.qtrac.eu/pyqtbook.html This is imported by imagechangerPyside.py Useful attributes of Qt to enumerate: PySide.QtCo...
Python
1
from typing import List, Optional from pydantic import BaseModel, Field, HttpUrl class Criteria(BaseModel): likes: bool = False reposts: bool = False comments: bool = False # Запрос на розыгрыш class RaffleRequest(BaseModel): post_url: HttpUrl raffle_name: Optional[str] = None criteria: Cri...
Python
1