text
string
label_name
string
labels
int64
})); ctx.fill_color(state.borrow().1[0]); //ctx.fill_color([0u8, 0xFF, 0x00, 0x80]); ctx.pause(); }use std::sync::Arc; use winit::{event, event_loop, window}; const A_POSITION: usize = 0; const A_TEX_COORD: usize = 1; const I_OFFSET: (usize, usize) = (0, 0); // set 0, binding 0 const T_TEXTURE: (us...
Rust
0
SSKr"SS\RR5r\R"SS54rS1r\"5rg)Nc\rSrSrSrSrSrg)DynamicShapeSlicingc Slices with dynamic shape arguments should be captured into t...
Python
1
wrap(); let mut data_be = Vec::new(); let mut data_le = Vec::new(); { let mut writer_be = AsyncBitWriter::new(&mut data_be); let mut writer_le = AsyncBitWriter::new(&mut data_le); for _ in 0u64..20 { for bits in 0..max_bits { writer_be.write_huffman(&writ...
Rust
0
""" 報表查詢與視覺化 API 測試 - 修正版本 使用正確的認證 mock 方式 """ import pytest from datetime import datetime, timedelta from fastapi.testclient import TestClient from unittest.mock import patch, MagicMock from src.api.main import app class BaseAPITest: """API 測試基類,處理認證和通用設置""" @classmethod def setup_class(cls): ...
Python
1
do_loop, frequency ) } pub fn write_dmc_load_counter_reg(&mut self, value: u8) { self.dmc_counter = value & 0b0111_1111; } pub fn write_dmc_sample_address_reg(&mut self, value: u8) { // TODO: Implement register let sample_address = value; ...
Rust
0
#!/usr/bin/env python3 import base64 import random from test_framework.test_framework import TestFramework from utility.submission import ENTRY_SIZE, submit_data from utility.submission import create_submission from utility.utils import ( assert_equal, wait_until, ) class SubmissionTest(TestFramework): d...
Python
1
nucl_b = nst.nucleotides[*id_b]; if nucl_b.on_jump { continue; } // Create h-bound between nucl_a and nucl_b system.push(Box::new(Spring { a: nucl_a.id, b: nucl_b.id, l: len.ab(), k: K_SPRING...
Rust
0
from odoo import models, _ class StockRule(models.Model): _inherit = 'stock.rule' def _get_lead_days(self, product, **values): """For subcontracting, we need to consider both vendor lead time and manufacturing lead time, and DTPMO (Days To Prepare MO). Subcontracting delay = ...
Python
1
import pandas as pd #pip install pandas (il faut install biblio) fichier = pd.read_csv("employes.csv") print("Les cinq premières lignes du fichier CSV :") print(fichier.head())#head : pour afficher les premières lignes par defaut (5) moyenne_age = fichier["age"].mean() # calcule la moyenne de la colonne age. print(f...
Python
1
e WtfException("Cannot locate manifest file for package [%s]"%pkg) except rospkg.InvalidManifest as e: raise WtfException("Package [%s] has an invalid manifest: %s"%(pkg, e)) def _load_stack(ctx, stack): """ Utility for initializing WtfContext state @raise WtfException: if context state cannot ...
Python
1
import os import sys import unittest from amazon_dash.audio import WavAudio from ._compat import patch from amazon_dash.exceptions import AudioError if sys.version_info < (3,2): FileNotFoundError = OSError class TestWavAudio(unittest.TestCase): file = 'hack.wav' @patch('amazon_dash.audio.get_pyaudio_mo...
Python
1
y.context().tombstone_block() >= cur_block); let hashes_after_purge = HashSet::from_iter(cache.keys().cloned()); let purged_hashes = hashes_before_purge .difference(&hashes_after_purge) .cloned() .collect::<HashSet<_>>(); log::debug!( self.logger,...
Rust
0
offset = 0; while remaining > 0 { let n = stream.write(&data[offset..])?; remaining -= n; offset += n; } Ok(()) } pub fn send_message(stream: &mut UnixStream, message: &str) -> io::Result<()> { let len = message.len(); let bytes = len...
Rust
0
mit) @pytest.mark.precommit def test_transpose_precommit(self, params, ie_device, precision, ir_version, temp_dir): self._test(*self.create_net(**params, ir_version=ir_version), ie_device, precision, ir_version, temp_dir=temp_dir) @pytest.mark.parametrize("para...
Python
1
.ok() .and_then(|x| x.get("mod")) .and_then(|x| x.as_str()) .map_or(false, |x| x == self.name) }); if let Some(Ok(sheet)) = sheet { let sizes: Vec<u64> = sheet["sizes"] .as_array() .unwrap() ...
Rust
0
ingsRead, term: &'a TermEntry) -> impl Iterator <Item=TermPost<'a>> + 'a { let start = term.offset as usize; let end = start + term.doc_freq as usize; (start..end).map(move |i| TermPost { doc_id: posts[2 * i] ...
Rust
0
else: warnings.warn( "Installing missing dependencies:\n" f"pip install {' '.join((repr(str(dep)) for dep in missing_deps))}", UserWarning, ) if pip is None: raise RuntimeError(f"Couldn't find pip amongst {', '.join(pi...
Python
1
x: *mut fmx__fmxcpt, ) -> fmx_int32; } extern "C" { pub fn FM_DateTime_GetMinute( _self: *const ::std::os::raw::c_void, _x: *mut fmx__fmxcpt, ) -> fmx_int16; } extern "C" { pub fn FM_DateTime_GetSec( _self: *const ::std::os::raw::c_void, _x: *mut fmx__fmxcpt, ) -> fmx...
Rust
0
amqp:sasl-init:list", }; if !is_match { Err(AmqpParseError::InvalidDescriptor(descriptor)) } else { decode_sasl_init_inner(input) } } } impl Encode for SaslInit { fn encoded_size(&self) -> usize { encoded_size_sasl_init_inner(self) } fn enc...
Rust
0
тветствует ожидаемому") else: print ("URL соответствует ожидаемому") #guide_learn_more_other_weather def get_click_guide_learn_more_other_weather_page(self): self.guide_learn_more_other_weather() def get_click_guide_learn_more_other_weather(self): assert MainPageLocators.gu...
Python
1
#!/usr/bin/env python # # Copyright 2016 Cisco Systems, Inc. # # 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 applicab...
Python
1
import os import re import networkx as nx import pytest from test_migrators import run_test_migration from conda_forge_tick.migrators import StdlibMigrator, Version TEST_YAML_PATH = os.path.join(os.path.dirname(__file__), "test_yaml") TOTAL_GRAPH = nx.DiGraph() TOTAL_GRAPH.graph["outputs_lut"] = {} STDLIB = Stdlib...
Python
1
l_run, &tool_run.cmd_line ); let cmd_line = self.replace_placeholders( &tool_run, &cmd_line ); println!("Calling\n{}\tfor {:#?}", cmd_line, tool_run.input ); // let output = Command::new("/bin/sh").args(&["-c", "echo", ""]).output(); // let output = Command::new("/bin/sh").args(&["-c", "date", ""]).output(); if...
Rust
0
INFO_CHAIN_SYSTEM_PROMPT = """🍳 **Welcome to your Culinary Assistant!** I am here to assist you with all things cooking, recipes, and culinary advice. My goal is to provide clear, relevant, and engaging responses to help you cook delicious meals. 🔍 **To give you the best recommendations, I need a few details:** ...
Python
1
|yuv ..."); } else { if args[1] == "yuv" { let yuv = Yuv::new(&args).unwrap_or_else(|err| { println!("Problem parsing arguments: {}", err); Yuv::helper(); process::exit(1); }); if let Err(err) = yuv.run() { ...
Rust
0
ied_weight / 2 { //Threshold: More than 50% of the tokens that participated in the vote // (after excluding “Abstain” votes) need to have voted in favor of the proposal (“Yes”). a_poll.status = PollStatus::Passed; passed = true; } else { rejected_reaso...
Rust
0
lf { surface: surface, gl: gl, renderer: Rc::new(RefCell::new(Renderer3D::new())) } } pub fn prepare_frame(&self) { self.renderer.borrow_mut().prepare_frame(&self.gl); } pub fn finish_frame(&self) { self.renderer.borrow_mut().finish_frame();...
Rust
0
| number | CRC status: 1 = OK, -1 = fail, 0 = no CRC modu | string | Modulation identifier "LORA" or "FSK" datr | string | LoRa datarate identifier (eg. SF12BW500) datr | number | FSK datarate (unsigned, in bits per second) codr | string | LoRa ECC coding rate identifier size | number | RF packet pay...
Rust
0
import json from apis import ( get_company_register, search_company_name_by_register, search_company_and_registered_capital_by_industry, search_company_name_by_info ) def _get_full_name(company_name: str) -> str: """根据公司名称、公司简称或英文名称,获取该公司的全称。""" company_info_json = search_company_name_by_info(...
Python
1
# Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Exercícios extras # G. verbing # Dada uma string, caso seu comprimento seja pelo menos 3, # adiciona 'ing' n...
Python
1
t_receiver) = oneshot::channel(); let (wait_signal, wait_receiver) = oneshot::channel(); let security_attributes = self.security_attributes; remote.remote().spawn(move |handle| { let mut endpoint = Endpoint::new(endpoint_addr); endpoint.set_security_attributes(security_attributes); if cfg!(unix) { ...
Rust
0
from opencompass.openicl.icl_prompt_template import PromptTemplate from opencompass.openicl.icl_retriever import ZeroRetriever from opencompass.openicl.icl_inferencer import GenInferencer from opencompass.datasets import LongBenchF1Evaluator, LongBenchhotpotqaDataset LongBench_hotpotqa_reader_cfg = dict( input_col...
Python
1
yield (b'--frame\r\n' b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n') time.sleep(frame_time) cap.release() return Response(generate(), mimetype='multipart/x-mixed-replace; boundary=frame') # 获取视频第一帧 @app.route('/video_first_frame') def video_first_frame(): glo...
Python
1
}) .unwrap_or_else(|| None) } } #[test] fn get_module() { let context = XsdContext::new( r#" <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:example="http://example.com" > </xs:schema> "#, ) .unwrap(); let mut mapping = BTreeMap::new(); mapping.insert(...
Rust
0
ingServiceDomainAssociationList: if self._linkshortening_messaging_service_domain_association is None: self._linkshortening_messaging_service_domain_association = ( LinkshorteningMessagingServiceDomainAssociationList(self) ) return self._linkshortening_messaging_s...
Python
1
ning(self, "Uyarı", "Lütfen satış numarası, müşteri ID ve satılan ürünleri girin.") def destek_talebi_olustur(self): musteri_id = self.musteri_input.text().strip() detaylar = self.destek_talebi_input.toPlainText().strip() if musteri_id and detaylar: self.cursor.execute("INSERT ...
Python
1
all(getter.as_bytes()) { Ok(_) => {}, Err(_) => {} } let file_read = File::open("tmp.rss").unwrap(); let reader = BufReader::new(file_read); match Channel::read_from(reader) { Ok(value) => { File::open("tmp.rss").unwrap().set_len(0).unwrap_or({}); return Ok(value); } Err(err) =...
Rust
0
(self, x, subject_ids): # x = self.conv1_fmri[f'{subject_ids[0].item()}'](x) x = self.proj_fmri(x) x = x.reshape(x.size(0), -1, 1024) x = self.encoder(x) eeg_embedding = self.enc_eeg(x) out = self.proj_eeg(eeg_embedding) return out ...
Python
1
criterion_group!(benches, multiple_payments_http, multiple_payments_btp); criterion_main!(benches); <gh_stars>100-1000 use jack_sys as j; /// Type used to represent sample frame counts. pub type Frames = j::jack_nframes_t; /// Type used to represent the value of free running monotonic clock with units /// of microsec...
Rust
0
in(random.choice(['0', '1']) for _ in range(50)) } # params = { # } # response = requests.get(url, headers=self.headers, cookies=cookies, params=params) # html = etree.HTML(response.text) # content = ''.join(html.xpath('//div[@class="article-content"]/div[2]//text()')) ...
Python
1
from fastapi import FastAPI, UploadFile, File, Request import shutil from fastapi.templating import Jinja2Templates from os import getenv from meeting_notes_ai.media_handler import MediaHandler templates = Jinja2Templates(directory="templates") app = FastAPI( root_path=getenv("ROOT_PATH", "http://127.0.0.1:8000")...
Python
1
f(info)), OutputData::Pending { .. } => None, } } else { None } } /// Add a listener to this output /// /// The provided closure will be called whenever a property of the output changes, /// including when it is removed by the compositor (in this case it'll be marked as /// obsolete...
Rust
0
res; } else if res.1 { break; } } (false, false) } else { if chars.len() < inner.len() || !Solution::chars_equal(&inner, &chars[..inner.len()]) { (false, false) } else { ...
Rust
0
def print_sorted_matrix(matrix): for row in matrix: for elem in row: print(elem, end=" ") print() matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] print_sorted_matrix(matrix)
Python
1
); } #[test] fn deserialize_inputs_invalid_inputs_json() { // no `address` field let invalid_json = json_c_pointer!([ { "add": "pay:sov:d0kitWxupHvZ4i0NHJhoj79RcUeyt3YlwAc8Hbcy87iRLSZC", "seqNo": 4 } ]); error_deseriali...
Rust
0
ms.view_position, view_position[0], view_position[1], view_position[2]); gl.Uniform3f(self.uniforms.light_position, light[0], light[1], light[2]); gl.Uniform3f(self.uniforms.light_direction, light[3], light[4], light[5]); gl.Uniform3f(self.uniforms.light_ambient, light[6], light[7], ...
Rust
0
>libjose/examples/basic_jws.rs // Copyright 2020-2021 <NAME> // SPDX-License-Identifier: Apache-2.0 //! cargo run --example basic_jws use libjose::jwk::Jwk; use libjose::jws::Encoder; use libjose::jws::JwsAlgorithm; use libjose::jws::JwsHeader; use libjose::jwt::JwtClaims; fn main() { let header: JwsHeader = JwsHe...
Rust
0
ion (table or view) which PostgREST Auth will use for generating JWTs. If the relation is a view, it is recommend that it be auto-updateable. Must be user defined. The default is postgrest.users' --refresh-...
Rust
0
(255, 0, 0, 0.5), #00f);\n \n \ boo: invert(#123456);\n}\n", "div{color:#ff0;background:#7b2d06;flah:#111;\ grah:rgba(255,0,238,.5);blah:rgba(1,2,3,.6);floo:aqua;\ bloo:rgba(0,255,255,.7);groo:aqua;hoo:123;moo:45;poo:6;\ goo:rgba(64,0,191,.75);boo:#edcba9} ", )...
Rust
0
# Copyright (c) 2018 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 app...
Python
1
0; _df_valid_2 <= 0; end else begin if(vx && rx && (_df_ready_0 || !_df_valid_0)) begin _df_data_0 <= x + 1; end if(_df_valid_0 && _df_ready_0) begin _df_valid_0 <= 0; end if(rx && (_df_ready_0 || !_df_valid_0)) begin _df_valid_0 <= vx; end ...
Python
1
) combined_output = process_neurons(probabilities_taken, probabilities_lost, params[total_quantum_params:]) test_predictions.append(combined_output) test_accuracy = accuracy_test(test_predictions, Y_test) test_accuracy_history.append(test_accuracy) #...
Python
1
self.indexer, batch=True, method="PSO", search_limit=0.1, ) assert det2.navigation_shape == (3, 3) assert abs(det.pc_average - det2.pc_average).max() < tol def test_optimize_pc_raises(self): with pytest.raises(Valu...
Python
1
def monotonic(l: list): """Return True is list elements are monotonically increasing or decreasing. >>> monotonic([1, 2, 4, 20]) True >>> monotonic([1, 20, 4, 10]) False >>> monotonic([4, 1, 0, -10]) True """ if len(l) < 2: return True first = l[0] second = l[1] f...
Python
1
mp(unit, _) if *unit == TimeUnit::Millisecond => { make_string!(array::TimestampMillisecondArray, column, row) } DataType::Timestamp(unit, _) if *unit == TimeUnit::Microsecond => { make_string!(array::TimestampMicrosecondArray, column, row) } DataType::Timestamp(u...
Rust
0
from torchvision import transforms import collections import torch import numpy as np def apply_transform(split, image, points, transform_name='basic', exp_dict=None): if transform_name == 'rgb_normalize': mean = [0.485, 0.456, 0.406] std = [0.229, 0.224, ...
Python
1
import os from django import VERSION as DJANGO_VERSION from django.template import Context from django.template.defaultfilters import slugify from django.template.loader import get_template from generate_scaffold.generators.base import BaseGenerator from generate_scaffold.utils.directories import get_templates_in_dir...
Python
1
impl From<SimulationError> for errors::Error { fn from(_error: SimulationError) -> Self { errors::Error(ErrorKind::Msg("trap".to_string()), State::default()) } } fn run_bin( buffer: &[u8], trace: bool, option_trace_start: Option<u64>, itm_file: Option<Box<dyn io::Write + 'static>>, ) ->...
Rust
0
'a mut W, } impl<'a> _CQFLAGSW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CQFLAGSW) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = "CQ Stop Flag. When set, CQ processing will complete. value."] #[inline] pub fn stop(self) ...
Rust
0
File::create(output_print).unwrap(); match file.write(bpstring.as_bytes()) { Ok(_) => {} Err(e) => { eprintln!("error writing blueprint file: {}", e) } } } Err(e) => eprintln!("error processing file ...
Rust
0
(); let mut chain_4 = chain_3.clone(); // Try to extend chain last even link of level 2 with odd link of level 6 assert!(chain_4.extend_with_even(cred_link_6).is_err()); chain_4.extend_with_even(cred_link_4).unwrap(); } } <reponame>notshridhar/vault /// Path to the directory where...
Rust
0
); root.set_window_border(window.window_id, window.border, window.border_color); root.map_window(window.window_id); // TODO: check tags } else { root.unmap_window(window.window_id); } } root.flush(); } pub fn manage(&mut se...
Rust
0
CodecContext, frame_bytes: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn av_get_audio_frame_duration2( par: *mut AVCodecParameters, frame_bytes: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AVBitSt...
Rust
0
from openai import OpenAI import os client = OpenAI( api_key=os.environ.get("OPENAI_API_KEY"), ) # ChatGPTにリクエストを送信する関数 def make_tweet(): # ChatGPTへの命令文を設定 request = "あなたはPythonを学習し始めた女子大学生です。\ Twitterに投稿するツイートを140文字以内で作成してください。\ ツイートを作成する際は、入力した例文を参考に、新たな文章を作成してください。\ ...
Python
1
will consume the remainder of the reader. fn check_for_extra_bytes<R: io::Read>(reader: &mut R) -> Result<(), ReadDataError> { let num_extra_bytes = reader.read_to_end(&mut Vec::new())?; if num_extra_bytes == 0 { Ok(()) } else { Err(ReadDataError::ExtraBytes(num_extra_bytes)) } } /// R...
Rust
0
#!/usr/bin/env python # coding: utf-8 import re def parse_hunk_meta(hunk_meta): # @@ -3,7 +3,6 @@ a = hunk_meta.split()[1].split(',') # -3 7 if len(a) > 1: old_addr = (int(a[0][1:]), int(a[1])) else: # @@ -1 +1,2 @@ old_addr = (int(a[0][1:]), 0) b = hunk_meta.split()[2]...
Python
1
enum VmDiskType { None, Unmanaged, } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RetrieveBootDiagnosticsDataResult { #[serde(rename = "consoleScreenshotBlobUri", default, skip_serializing_if = "Option::is_none")] pub console_screenshot_blob_uri: Option<String>, ...
Rust
0
onvert::TryFrom; use serde::{Deserialize, Serialize}; use super::proto::quilkin::extensions::filters::capture_bytes::v1alpha1::{ capture_bytes::Strategy as ProtoStrategy, CaptureBytes as ProtoConfig, }; use crate::filters::{metadata::CAPTURED_BYTES, ConvertProtoConfigError}; use crate::map_proto_enum; use super:...
Rust
0
pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12); self.w } } #[doc = "Reader of field `TRIM13_E`"] pub type TRIM13_E_R = crate::R<u8, u8>; #[doc = "Write proxy for field `TRIM13_E`"] pub struct TRIM13_E_W<'a> { ...
Rust
0
raise Exception() v2ray_versions = versions last_get_version_time = now return jsonify( Msg( True, msg=gettext("Get %(v2_core)s version successfully.", v2_core=v2_core), obj=versions, ) ) except Exception ...
Python
1
m::Sha256Ripemd160, [i / 2; 20].into())?; let address_metadata = proto::AddressMetadata { timestamp: 1000 + i as i64, ttl: 10, entries: vec![], }; let entry_proto = cashweb_payload::proto::SignedPayload { pubkey: vec![2;...
Rust
0
#!/usr/bin/python # -*- coding: utf-8 -*- # ##### BEGIN LICENSE BLOCK ##### # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License ...
Python
1
!(rewline: "\"hi\\ryo\"" => Ok(vec![ b'h', b'i', b'\r', b'y', b'o' ])); test_eval!(tab: "\"hi\\tyo\"" => Ok(vec![ b'h', b'i', b'\t', b'y', b'o' ])); <filename>poem-openapi/src/error.rs use poem::{http::StatusCode, Error}; /// This type represents errors that occur when parsing the HTTP request. #[derive(De...
Rust
0
s: &'a str) -> Self { /// Foo {part: Foo::split_first(s)} /// } /// //满足 生命周期参数省略规则 /// fn get_part(&self) -> &str { /// self.part /// } /// } /// fn main() { /// let words = String::from("Sometimes think, the greatest sorrow than older"); /// println!("{:?}",Foo::new(words.as_str()))...
Rust
0
sions for your Notion integration.", ), ( Blocks, Pages, "https://api.notion.com/v1/blocks/123/children", 403, b'{"object": "error", "status": 403, "code": "restricted_resource"}', False, "This is likely due to insuffici...
Python
1
import uvicorn import signal import sys import atexit # Global shutdown flag server_shutting_down = False def signal_handler(signum, frame): global server_shutting_down print("\nShutting down server gracefully...") server_shutting_down = True # Cleanup ML libraries try: import torch ...
Python
1
# Copyright 2021 Alibaba Group Holding Limited. All Rights Reserved. import os.path as osp import numpy as np from .base_video_dataset import BaseVideoDataset from ..registry import DATASETS def _load_ssv2(anno_dir, mode='train', video_format="webm"): cls_file = osp.join(anno_dir, "something-something-v2-label...
Python
1
ew.0, cx); <B as NtMatch>::nt_match(&old.1, &new.1, cx); } } impl<A: NtMatch, B: NtMatch, C: NtMatch> NtMatch for (A, B, C) { fn nt_match(old: &Self, new: &Self, cx: &mut Ctxt) { <A as NtMatch>::nt_match(&old.0, &new.0, cx); <B as NtMatch>::nt_match(&old.1, &new.1, cx); <C as Nt...
Rust
0
mvs, compound_buffer, ); } else { assert!(u_xdec == 1 && u_ydec == 1); // TODO: these are absolutely only valid for 4:2:0 if bsize == BlockSize::BLOCK_4X4 { let mv0 = cw.bc.blocks[tile_bo.with_offset(-1, -1)].mv; let rf0 = cw.bc.blocks[tile_b...
Rust
0
0xAF => { self.res_r8(5, R8::A); } 0xB0 => { self.res_r8(6, R8::B); } 0xB1 => { self.res_r8(6, R8::C); } 0xB2 => { self.res_r8(6, R8::D); } 0xB3 => { self.res_r8(6, R8::E); } 0xB4 => { self.res_r8(6, R8::H); } 0xB5 => { self.res_r8(6...
Rust
0
# MIT License # Copyright (c) 2025 ChaseDDevelopment # See LICENSE file for full license information. import numpy as np from models.dataclasses import MorpheusBoundingBox from utils.general import match_images_to_label_files LABEL_AS_DICTIONARY = { "name": "car", "box": {"xmin": 100, "ymin": 200, "xmax": 300...
Python
1
rt((x,y)); } } points = new_points; } points.len() } <filename>robin/tests/test_helpers/mod.rs use std::{error, fmt, fs::{self, File}, io, io::{prelude::*, BufWriter, Write}}; use robin::prelude::*; use robin::redis_queue::*; pub fn setup() ...
Rust
0
ion": "If you call this tool, you must pass arguments in the JSON format {key: value}, where the key is the parameter name."\n }\n]\n如果你已经获得足够信息,请直接给出答案. 避免不必要的工具调用! 同时注意你可以使用的工具,不要随意捏造!', 'name': 'plugin'}, # {'role': 'user', 'content': '帮我搜索 InternLM2 Technical Report'}, # {'role': 'assistant', 'content': ...
Python
1
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties import numpy import os font_set = FontProperties(fname=r"c:\\windows\\fonts\\simsun.ttc", size=15) #重要全局变量 PATH_SUFFIX = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) PATH_SU...
Python
1
n.set_options(ssl::SslOptions::NO_TLSV1_2); conn.clear_options(ssl::SslOptions::NO_TLSV1_3); tracing::debug!( roots = ?self .base .roots .iter() .filter_map(|c| super::fingerprint(&*c)) .collect::<Vec<_>>(), ...
Rust
0
}, } } Ok(None) } pub(crate) fn push(&mut self, callback: impl HookCallback<T, E> + 'static) { self.callbacks.push(Box::new(callback)); } } /// Collection of all the hooks that can be configured for a [`Pool`]. /// /// [`Pool`]: super::Pool pub struct Ho...
Rust
0
basic", 1, 1) records = data_flow_ops.RecordInput( file_pattern=os.path.join(self.get_temp_dir(), "basic.*"), parallelism=1, buffer_size=100, batch_size=1, name="record_input") yield_op = records.get_yield_op() for _ in range(50): ...
Python
1
print("The following enclosed file is corrupted: {!r}".format(badfile)) print "Done testing" elif args[0] == '-e': if len(args) != 3: print USAGE sys.exit(1) zf = ZipFile(args[1], 'r') out = args[2] for path in zf.namelist(): ...
Python
1
f.commands_rx = Some(commands_rx); } } } pub fn start_window(&mut self, id: &WindowId, height: f64) -> Result<WindowUpdateStream, ()> { let window = self.windows.get_mut(id).ok_or(())?; window.set_height(height); Ok(window.updates()) } pub fn dispatch_action...
Rust
0
} } /// Returns the raw pointer of the KDB object. /// Should be used with caution. In particular, /// the pointer should only be modified with /// `elektra_sys::kdb*` functions, but `kdbClose` /// should not be called. pub fn as_ptr(&mut self) -> *mut elektra_sys::KDB { sel...
Rust
0
hEvent: SPXEVENTHANDLE, ) -> *const ::std::os::raw::c_char; } pub const GrammarList_RecognitionFactorScope_PartialPhrase: GrammarList_RecognitionFactorScope = 1; pub type GrammarList_RecognitionFactorScope = ::std::os::raw::c_uint; extern "C" { pub fn grammar_handle_is_valid(hgrammar: SPXGRAMMARHANDLE) ...
Rust
0
alse otherwise. auto_open: bool (default True) If True, open the saved file in a web browser after saving. This argument only applies if `full_html` is True. div_id: str (default None) If provided, this is the value of the id attribute of the div tag. If None, the id attribute is...
Python
1
.get(4)); } #[test] pub fn construct_and_parse_large_bitarray() { let x = MemoryBackedStore::new(); let contents = (0..).map(|n| n % 3 == 0).take(123456); let builder = BitArrayFileBuilder::new(x.open_write()); let _written = builder.push_all(stream::iter_ok(contents)) ...
Rust
0
########################################################################## # # Copyright (c) 2016, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
Python
1
"\n2. {nome_med2}") print(f" Categoria: {categoria_med2.title()}") print(f" Preço Original: R$ {preco_med2:.2f}") print(f" Preço com Desconto: R$ {preco_final_med2:.2f}") print(f" Estoque: {estoque_med2} unidades ({status_med2})") print(f" Valor Total: R$ {valor_estoque_med2:.2f}") print(f"\n3. {nome_med3}")...
Python
1
* m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) if m.bias is not None: m.bias.data.zero_() elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_() elif isinstance(m, nn.Linear): m.weight.data.normal_(0, fc...
Python
1
ember: *mut CRYPTCATMEMBER) -> *mut CRYPTCATMEMBER; #[doc = "*Required features: `\"Win32_Security_Cryptography_Catalog\"`, `\"Win32_Foundation\"`, `\"Win32_Security_Cryptography_Sip\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security_Cryptography_Sip"))] pub fn CryptCATFreeSortedMemberI...
Rust
0
top: top, width: width, height: height, cell_width: cell_width, cell_height: cell_height, foreground_color_index: foreground_color_index, background_color_index: background_color_index }) } } /// Contains metadata for application e...
Rust
0
ator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) sse = await iter_next(iterator) assert sse.event == "ping" assert sse.json() == {"foo": "my long\n\ncontent"} await assert_empty_iter(iterator) @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True,...
Python
1
time val_interval = Interval(start=train_interval.end[2], end=epoch.end[2]) return train_interval, val_interval, test_interval def split_more_than_five_epochs(epoch): assert len(epoch) > 5 train_interval, val_interval, test_interval = epoch.split( [0.6, 0.1, 0.3], shuffle=False ) ret...
Python
1