text
string
label_name
string
labels
int64
ce_4n90tv6v as sqgq3e1hhdx, shu2mduyvsl as gfnq_x9gnfb, wvd13zrpx1c, s8fa480i8f4, cvsf2cn_gtc as gpo4ts029i3, pqz55qvp3mv, opot03h32k3 as hufg95_6e6d u926l4q0h8f import n5fe359kasd, hyrf7l78hyw as vk30ib95ljq, gntcj6kkokb as vr9bjlhn__c del c195jonysyv 0.0[0] //= z78xtnf3qwg (s9ay5gpqa_r): nqdadsjcw...
Python
1
parent_directories(path.as_ref())?; let mut header = TarHeader::new_gnu(); header.set_mtime(self.time); header.set_path(path)?; header.set_mode(chmod); header.set_size(out_data.len() as u64); header.set_cksum(); self.tar.append(&header, out_data)?; Ok(())...
Rust
0
, solve_part2_captcha("1221")); } #[test] fn part2_example3() { assert_eq!(4, solve_part2_captcha("123425")); } #[test] fn part2_example4() { assert_eq!(12, solve_part2_captcha("123123")); } #[test] fn part2_example5() { assert_eq!(4, solve_part2_captcha("1...
Rust
0
pub fn as_eb_read(&self, start: i32, size: i32, buff: &mut [u8]) -> Result<()> { let res = unsafe { Cli_AsEBRead( self.handle, start as c_int, size as c_int, buff as *mut [u8] as *mut c_void, ) }; if res == ...
Rust
0
Resource) -> Self { Self { tracked_resource, properties: None, system_data: None, } } } #[doc = "The LiveEvent action input parameter definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LiveEventActionInput { #[doc = "T...
Rust
0
let mut is_disease_inverted = false; let mut is_item_consumed = false; let mut is_jacket_off = false; let mut frame_time; let mut now; let mut console_update_counter = 0.; let person = init_zara_instance(); register_side_effects(&person, &mut state); ...
Rust
0
update_outputs: tmp = graph.get_tensor_by_name(incr_update_outputs[tmp_key].name) tensor_info_incr_update_outputs[tmp_key] = \ tf.saved_model.utils.build_tensor_info(tmp) incr_update_signature = ( tf.saved_model.signature_def_utils.build_signature_def( inputs=tensor_info_in...
Python
1
from django.shortcuts import render from .forms import UserRegisterForm # Псевдо-список существующих пользователей existing_users = ["user1", "user2", "user3"] def sign_up_by_django(request): info = {} if request.method == "POST": form = UserRegisterForm(request.POST) if form.is_valid(): ...
Python
1
import json from dvclive import Live from dvclive.plots.custom import CustomPlot def test_log_custom_plot(tmp_dir): live = Live() out = tmp_dir / live.plots_dir / CustomPlot.subfolder datapoints = [{"x": 1, "y": 2}, {"x": 3, "y": 4}] live.log_plot( "custom_linear", datapoints, ...
Python
1
visit_pat_tuple(_binding_0); } Pat::TupleStruct(_binding_0) => { v.visit_pat_tuple_struct(_binding_0); } Pat::Type(_binding_0) => { v.visit_pat_type(_binding_0); } Pat::Verbatim(_binding_0) => { skip!(_binding_0); } Pat:...
Rust
0
es += [meter.summary() for meter in self.meters] print(" ".join(entries)) def _get_batch_fmtstr(self, num_batches): num_digits = len(str(num_batches // 1)) fmt = "{:" + str(num_digits) + "d}" return "[" + fmt + "/" + fmt.format(num_batches) + "]" def dict_to_cuda(input_dict): ...
Python
1
str data for Cesu8Str"); assert_eq!(std.bytes.len(), 7, "string length was not as expected"); } // not enough space { // buffer shouldn't even be used - leave it at length 0 let mut buf = [0; 0]; // needs to be Java variant to prevent borrowing from `text` let res =...
Rust
0
from django.db.migrations.operations.base import Operation from .signals import composite_type_created __all__ = ["BaseOperation"] def sql_field_definition(field_name, field, schema_editor): quoted_name = schema_editor.quote_name(field_name) db_type = field.db_type(schema_editor.connection) return f"{qu...
Python
1
import torch import triton from sglang.srt.layers.moe.ep_moe.kernels import post_reorder_triton_kernel batch_sizes = [64, 128, 256, 512, 640, 768, 1024, 2048, 4096] configs = [(bs,) for bs in batch_sizes] @triton.testing.perf_report( triton.testing.Benchmark( x_names=["batch_size"], x_vals=[list...
Python
1
xp_needed; skill.next_level_percentage = (skill.next_level_progress * 100.0) / next_level_xp_needed; } } fn calculate_skill_next_level_xp_neeeded(skill: &mut Skill, world_skill: &WorldSkill) -> f64 { (100.0 + (4.0 * skill.level * skill.level)) as f64 * world_skill.xp_req_modifier } fn gain_stat_xp(gam...
Rust
0
ot self.label_manager.has_regions: # if we train with regions all segmentation heads predict some kind of foreground. In conventional # (softmax training) there needs tobe one output for the background. We are not interested in the # background Dice # [1:] in order to rem...
Python
1
# There are 5280 feet in a mile. Write a Python statement that calculates # and prints the number of feet in 13 miles. miles = 13 print(miles * 5280)
Python
1
map.insert('\\', r#"\textbackslash"#); map.insert('^', r#"\textasciicircum"#); map.insert('_', r#"\_"#); map.insert('~', r#"\~"#); map.insert('$', r#"\$"#); map.insert('{', r#"\{"#); map.insert('}', r#"\}"#); map.insert('#', r#"\#"#); map.insert('&', r#"\&"#); map.insert('%', r#"\%"#...
Rust
0
self) -> RequestId { RequestId::new(self.inner_command.get_request_id()) } pub fn get_error(&self) -> ServerError { self.inner_command.get_error().into() } pub fn get_message(&self) -> &str { self.inner_command.get_message() } } <reponame>deuszx/ibc-rs<gh_stars>1-10 use eyr...
Rust
0
from keras_hub.src.api_export import keras_hub_export from keras_hub.src.metrics.rouge_base import RougeBase @keras_hub_export("keras_hub.metrics.RougeN") class RougeN(RougeBase): """ROUGE-N metric. This class implements the ROUGE-N variant of the ROUGE metric. The ROUGE-N metric is traditionally used fo...
Python
1
} cntr_acct.adjust_balance(trigger.call_value).unwrap(); } if trigger.call_token_value > 0 { if owner_acct .adjust_token_balance(trigger.call_token_id, -trigger.call_token_value) .is_err() { return Err("insu...
Rust
0
/// Private /// Foo => { &0u32 }, /// /// Public /// pub Bar => { &1u32 }, /// /// Unsafe and generic /// {unsafe} pub Qux { num: &'a u32 } => { num } /// } as pub UnsafeEnum ['a] impl Into<&'a u32> /// } /// ``` /// /// expands to: /// ``` /// #[derive(Debug)] /// enum UnsafeEnumInner<'a> { /// Foo, /// B...
Rust
0
random activation functions for each node node_fn = jr.categorical(key, jnp.ones(len(act_fns)) / len(act_fns), shape=(total_nodes,)) # output nodes should not have activation functions node_fn = node_fn.at[-n_outputs:].set(0) node_fn = node_fn.at[:n_inputs].set(0) # Minimal rand...
Python
1
a=int(input()) if(a%4==0 and a%100!=0): print("YES") elif (a%400==0): print("YES") else: print("NO")
Python
1
ARE_H1), bishops: (SQUARE_C1 | SQUARE_F1), knights: (SQUARE_B1 | SQUARE_G1), pawns: RANK_2 }; pub const BLACK_START: Pieces = Pieces { all: (RANK_7 | RANK_8), king: SQUARE_E8, queens: SQUARE_D8, rooks: (SQUARE_A8 | SQUARE_H8), bishops: (SQUARE_C8 | SQUARE_F8), knights: (SQUARE_B8 | ...
Rust
0
mages) ) tags += ["force converged" if is_force_conv else "forces not converged"] tags += [f"elapsed time {t_f - t_i} seconds"] return NebResult( images=images, image_indices=list(range(len(images))), initial_images=initial_images, energie...
Python
1
version, VersionTriplet(18, 27, 1)); assert!(version > VersionTriplet(17, 27, 1)); assert!(version > VersionTriplet(18, 26, 1)); assert!(version > VersionTriplet(18, 27, 0)); } } <filename>examples/simple/src/not_covered.rs use mutagen::mutate; #[cfg_attr(test, mutate)] pub fn simple_assert...
Rust
0
dynamic_decoder"]( features, is_training=False) save_topview( idx, static_tv, os.path.join( args.out_dir, "static", "{}.png".format(output_name))) ...
Python
1
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """File for Message object and associated functions. The Message object's key function is to prevent users from editing ...
Python
1
_BITS: u32 = 8; pub const SPI_SSPIMSC_TXIM_MSB: u32 = 3; pub const SPI_SSPIMSC_TXIM_LSB: u32 = 3; pub const SPI_SSPIMSC_TXIM_ACCESS: &'static [u8; 3usize] = b"RW\0"; pub const SPI_SSPIMSC_RXIM_RESET: u32 = 0; pub const SPI_SSPIMSC_RXIM_BITS: u32 = 4; pub const SPI_SSPIMSC_RXIM_MSB: u32 = 2; pub const SPI_SSPIMSC_RXIM_L...
Rust
0
result = calculate_factorial(num) print(f"{num}! = {result}") # 测试练习4:斐波那契数列 print("\n练习4:斐波那契数列测试") fib_sequences = [0, 1, 8, 10] for n in fib_sequences: result = fibonacci_sequence(n) print(f"前{n}项斐波那契数列: {result}") # 测试练习5:数字统计 print("\n练习5:数字统计测试") ...
Python
1
import os import sys import unittest import dragon from dragon.native.process import Popen from dragon.data.ddict.ddict import DDict from dragon.native.machine import System, Node from dragon.infrastructure.policy import Policy from dragon.infrastructure.facts import DRAGON_LIB_DIR import multiprocessing as mp ENV = d...
Python
1
rc/bin/kvs.rs<gh_stars>0 fn main() -> kvs::Result<()> { kvs::run()?; Ok(()) } <reponame>thibault-martinez/iota.rs pub use crate::{ iota_client, iota_constants, iota_conversion, iota_crypto, iota_model, iota_pow, iota_signing, iota_utils, iota_validation, }; /// This trait provides conversion methods for...
Rust
0
{ use gtk::prelude::*; let text = entry.get_text(); let stored = app.stored(); let map = stored.history(); let text = text.unwrap_or_else(|| String::new()); let history = app.history(); let count = history.search(&text, &map.model); map.summary.set_text(&format!("{} {}", count,...
Rust
0
nodes = spawn_nodes(N, Topology::Mesh).await; for node in &nodes { assert_eq!(node.peers().await.unwrap().len(), N - 1); } } #[tokio::test(max_threads = 1)] async fn check_topology_star() { let nodes = spawn_nodes(N, Topology::Star).await; for (i, node) in node...
Rust
0
TDH_HANDLE, eventrecord: *const EVENT_RECORD, propertyname: ::windows_sys::core::PCWSTR, buffersize: *mut u32, buffer: *mut u8) -> u32; #[doc = "*Required features: `\"Win32_System_Diagnostics_Etw\"`*"] pub fn TdhLoadManifest(manifest: ::windows_sys::core::PCWSTR) -> u32; #[doc = "*Required features: `\"Wi...
Rust
0
from dataset import CrossDocked2020_SBDD, collate_mols from torch.utils.data import DataLoader from rdkit import Chem dataset = CrossDocked2020_SBDD() atomic_num_to_type = {} atomic_element_to_type = {} for i in range(len(dataset)-1, -1, -1): if i%1000 == 0: print(i) print(atomic_num_to_type) ...
Python
1
(i, _) in extra_fds.iter().enumerate() { let mut e = fds.reborrow().get(i as u32); let r = &extra_fds[i]; e.set_tid(r.tid); e.set_fd(r.fd); } map.set_skip_monitoring_mapped_fd(skip_monitoring_mapped_fd); let mut src = m...
Rust
0
a = 16 b = 17 if (a + b) == 3: print((a + b)) else: print((a - b)) if (a + b) == 3: z = (a + b) + 10 else: z = ((a - b) - 10) x = z print(x)
Python
1
from nonebot import on_command from nonebot.params import CommandArg from nonebot.adapters.onebot.v11 import ( Message, GroupMessageEvent ) from src.config import Config from src.const.jx3.server import Server from src.const.prompts import PROMPT from .api import get_sandbox_image sandbox_matcher = on_comman...
Python
1
) GST_STATE_CHANGE_PLAYING_TO_PAUSED", "35"), ("(gint) GST_STATE_CHANGE_PLAYING_TO_PLAYING", "36"), ("(gint) GST_STATE_CHANGE_READY_TO_NULL", "17"), ("(gint) GST_STATE_CHANGE_READY_TO_PAUSED", "19"), ("(gint) GST_STATE_CHANGE_READY_TO_READY", "18"), ("(gint) GST_STATE_CHANGE_SUCCESS", "1"), ("(g...
Rust
0
it.n = it.n.face_foward(&ns); } else if self.reverse_orientation ^ self.transform_swapshandedness { it.n *= -1.0; } // Compute error bounds for sampled point on triangle let pabs_sum = (*p0 * b[0]).abs() + (*p1 * b[1]).abs() + (*p2 * (1.0 - b[0] - b[1])).abs(); it.p_...
Rust
0
from app.core.date_utils import parse_relative_dates from app.core.chat_history import get_session_history, chat_history_to_string from app.core.recent_docs_cache import get_top_recent_docs from app.core.retriever_factory import create_ensemble_retriever from app.models.prompt_template import chatbot_rag_prompt from ap...
Python
1
LSN_GAUGE.with_label_values(&[&ztli_str]), write_wal_bytes: WRITE_WAL_BYTES.with_label_values(&[&ztli_str]), write_wal_seconds: WRITE_WAL_SECONDS.with_label_values(&[&ztli_str]), } } fn new_noname() -> SafeKeeperMetrics { SafeKeeperMetrics { flush_lsn: FLUSH_...
Rust
0
env __jni_bindgen::Env) -> __jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::java::lang::Character_UnicodeScript>> { unsafe { let (class, field) = env.require_class_static_field("java/lang/Character$UnicodeScript\0", "MEETEI_MAYEK\0", "Ljava/lang/Character$UnicodeScript;\0...
Rust
0
W), Reg::new("XC430-W240", V2, "DriveMode", 10, Byte, RW), Reg::new("XC430-W240", V2, "OperatingMode", 11, Byte, RW), Reg::new("XC430-W240", V2, "Secondary", 12, Byte, RW), Reg::new("XC430-W240", V2, "ProtocolType", 13, Byte, RW), Reg::new("XC430-W240", V2, "HomingOffset", 20, Word, RW), Reg::ne...
Rust
0
rate::Reg<scl_low_period::SCL_LOW_PERIOD_SPEC>, #[doc = "0x04 - I2C_CTR_REG"] pub ctr: crate::Reg<ctr::CTR_SPEC>, #[doc = "0x08 - I2C_SR_REG"] pub sr: crate::Reg<sr::SR_SPEC>, #[doc = "0x0c - I2C_TO_REG"] pub to: crate::Reg<to::TO_SPEC>, #[doc = "0x10 - I2C_SLAVE_ADDR_REG"] pub slave_add...
Rust
0
poll(&mut self) -> Poll<Self::Item, Self::Error> { loop { match mem::replace(&mut self.inner, FutureInner::Poisoned) { FutureInner::Sending { mut substream, mut message, } => { match substream.write_buf(&mut...
Rust
0
XW5 UR5nU"Xc5TU'g)N.storage.data/ has_storage get_storage_typed_storager\get_storage_from_recordrYrVrWrZ add_storage) dtypesizekeylocationrestore_locationrwstoragetensorloaded_storagesrRros r: load_tensor...
Python
1
from datetime import datetime, timedelta from math import floor from test.fastapp.auth_test_client import AuthTestClient from test.fastapp.user_manager import MOCK_USER, MockUser from typing import Any import pytest from gen_epix.fastapp.services.auth.util import get_name_from_claims class CommonAuthTestClient(Auth...
Python
1
32, 10, 64], "axes": [0, 2], "starts": [16, 0], "ends": [32, 64], "strides": [2, 4], "decrease_axis": [] }, { "shape": [8, 16, 32, 64, 128], "axes": [0, 1, 2, 3, 4], "s...
Python
1
import uuid from datetime import datetime from typing import Union from ouroboros.vlc_db.spark_session import SparkSession from ouroboros.vlc_db.utils import epoch_ns_from_datetime class SessionTable: def __init__(self): self._session_store = {} def add_session(self, robot_id: int, sensor_id: int = ...
Python
1
# # Copyright 2013, Martin Owens <doctormo@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3.0 of the License, or (at your option) any later version. # # Thi...
Python
1
Adobe/OperatingConfigs"); assert!( std::path::Path::new(app_support_path).is_dir(), "Application Support path is not present" ); } } //! Default Compute@Edge template program. use fastlazy::RequestLazy; use fastly::http::{HeaderValue}; use fastly::{Body, Error, Request, Requ...
Rust
0
cx: &CodegenCx<'gcc, 'tcx>) -> bool { self.unqualified() == cx.context.new_type::<f64>() } fn is_vector(&self) -> bool { let mut typ = self.clone(); loop { if typ.dyncast_vector().is_some() { return true; } let old_type = typ; ...
Rust
0
xd1\xe4\xb9\xfep\ \x83\x93\x8a\x1b/\xcc\xb9\xda8fC\xc2\xa9\xb0\x7f\xcd\ \xa3\x1a\x99\x9f\xf68?b>d\xfe\xe6\xc9\xbb\xa4\x94\ x\xe0U-\xfa\xdd\x05\x87/\xf6\xbc\xf95#\xde\xf8\ \xe8\x98\x8f\xbf=\x90\x5c\x85\x1f\x1a\xaa\x89\xf0\xf4\x8fz\ \xbe\xfd\x83\x15\xbd,H,y\xcbkF|\xe7\xc5\x85\ YF\xca\x98\xa5\x0a\x0dGg+~\xeb\xfd\xdb|\xfa\...
Python
1
, case: MergeCase) -> Self { self.merge_case = case; self } /// Load all data from all previously appended parsers, merge data according to appended order and return [`Config`]. /// /// # Errors /// /// If any errors will occur during parsing/merging then error will be returned....
Rust
0
t this trait. pub unsafe trait Ctxt {} unsafe impl Ctxt for App {} unsafe impl Ctxt for Cloud {} use crate::sk::*; use napi::*; #[js_function(1)] fn register(ctx: CallContext) -> Result<JsUndefined> { let this = ctx.this_unchecked::<JsObject>(); let font_collection = ctx.env.unwrap::<FontCollection>(&this)?; le...
Rust
0
} let mid : usize = l / 2; let mut first_half_tail : &mut ListNode = head.as_mut().unwrap(); let mut i : usize = 0; while i < mid - 1 { first_half_tail = first_half_tail.next.as_mut().unwrap(); i+=1; } let mut mid_node : Box<ListNode> = f...
Rust
0
ub struct RTC_CLKFMT_SPEC; impl crate::RegisterSpec for RTC_CLKFMT_SPEC { type Ux = u32; } #[doc = "`read()` method returns [rtc_clkfmt::R](R) reader structure"] impl crate::Readable for RTC_CLKFMT_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [rtc_clkfmt::W](W) writer structure"] impl crate::...
Rust
0
; use serde::de; use serde::ser::{Serialize, Serializer}; use serde::de::{Deserialize, Deserializer, Visitor, Unexpected}; /// The Telegram `Integer`, currently i64. pub type Integer = i64; /// The Telegram `Float`, currently f32. pub type Float = f32; #[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Ha...
Rust
0
import os import openai from dotenv import load_dotenv import time import logging class DeepseekClient: """Deepseek API客户端""" def __init__(self): load_dotenv() # 加载.env文件 def summarize(self, text, detail_level=2, max_retries=3): """使用deepseek-chat模型总结文本 Args:...
Python
1
let sum2 = a[i] + a[j]; map.insert(sum2, (i, j)); } } for i in 0..n { for j in (i + 1)..n { let partial = target - a[i] - a[j]; if let Some(&(ind1, ind2)) = map.get(&partial) { // i, j, ind1 and ind2 must be all distinct ...
Rust
0
ikey", true) { Some(pass_code) => { if pass_code.is_empty() { return None } factor_data.insert("passCode", pass_code); }, None => return None, } } while now.elapsed().as_millis() <= 30000 { l...
Rust
0
from collections import deque # Define the city map city_map = [ ['x', 12, 'x', 'x', 'x', 5, 9, 14, 6, 'x', 3, 14, 'x'], ['x', 'x', 3, 'x', 11, 'x', 13, 'x', 'x', 'x', 'x', 9, 8], ['x', 18, 'x', 'x', 'x', 13, 4, 5, 'x', 'x', 'x', 13, 'x'], [10, 4, 'x', 'x', 'x', 'x', 'x', 18, 'x', 15, 'x', 'x', 'x'], ...
Python
1
in 0..characters.len() { let (res, _, max) = test_case(0, &characters, &rules[&0], &rules, i); if res && max + 1 == characters.len() { acc += 1; break; } } } acc } fn test_case( pos: usize, characters: &Vec<char>, rule: &...
Rust
0
_hostname(i.name.as_bytes()) { Ok(i) => Some(i), Err(_) => { warn!("Ignoring invalid identity: {}", i.name); None } } } fn pb_to_sock_addr(pb: TcpAddress) -> Option<SocketAddr> { use api::net::ip_address::Ip; use std::net::{Ipv4Addr, Ipv6Addr}; /* cur...
Rust
0
Inst::MovzxRmR { ext_mode: ExtMode::LQ, dst, ref src } => { let mut rex = false; InstLayout { opc: OpcodeLayout::MovReg(layout_rm(&mut rex, dst, src)), rex } } PInst::MovsxRmR { ext_mode: ExtMode::LQ, dst, ref src } => InstLayout { opc: OpcodeLayout::MovSX(layout_rm(&mut true, dst, s...
Rust
0
lf.player_sprite.change_x > MAX_SPEED: self.player_sprite.change_x = MAX_SPEED elif self.player_sprite.change_x < -MAX_SPEED: self.player_sprite.change_x = -MAX_SPEED if self.player_sprite.change_y > MAX_SPEED: self.player_sprite.change_y = MAX_SPEED elif self...
Python
1
# -*- coding: utf-8 -*- """ BaseMap X:/Characters/Roles/Actor/Chopper01/St/Textures/TGA/T_Chopper01_St_body_Base.tga SssMap X:/Characters/Roles/Actor/Chopper01/St/Textures/TGA/T_Chopper01_St_body_Sss.tga IlmMap X:/Characters/Roles/Actor/Chopper01/St/Textures/TGA/T_Chopper01_St_body_Ilm.tga DetailMap X:/Characters/line/...
Python
1
s(self) -> None: assert (1, int(5e8)) == Time(seconds=1, nanoseconds=5e8).seconds_nanoseconds() assert (1, int(5e8)) == Time(seconds=0, nanoseconds=15e8).seconds_nanoseconds() assert (0, 0) == Time().seconds_nanoseconds() def test_infinite_duration(self) -> None: duration = Infinite...
Python
1
ors) = self.get_impl(coverage, base_id) { if !f(base_id, mark_id, anchors) { return false; } } true }) == Some(true) }) } /// Invokes the specified closure with the glyph, mark class and anchor o...
Rust
0
_mode: x.parse_mode.clone() } }).collect(); Some(MediaFile::MultipleFiles(entities)) } } pub fn into_files(self) -> Option<Vec<File>> { if self.0.len() == 0 { None } else { Some(self.0.into_iter().map(|x| x.file).collect()...
Rust
0
# coding=utf-8 import sys import pika # %2F是被转义的/, 这里使用了默认的虚拟主机、 默认的guest这个账号和密码 parameters = pika.URLParameters('amqp://guest:guest@localhost:5672/%2F') connection = pika.BlockingConnection(parameters) # connection就是所谓的消息代理 channel = connection.channel() # 获得信道 # 声明交换机,指定交换类型为直接交换。 最后2个参数表示想要持久化的交换机 channel.excha...
Python
1
s" backlog = 30 only-v6 = true [[listen]] port = 5678 host = "127.0.0.1" signature = "local" [ui] msg = "Hello world" "#; async fn hello( spirit: &Arc<Spirit<Empty, Config>>, cfg: &Arc<HttpServer<Signature>>, _req: Request<Body>, ) -> Result<Response<Body>, Infallible> { // Get some global configurat...
Rust
0
s', 'to': 'Lau', 'tr': 'Laos', 'tt': 'Лаос', 'twq': 'Laawos', 'tzm': 'Laws', 'ug': 'لائوس', 'uk': 'Лаос', 'ur': 'لاؤس', 'uz': 'Laos', 'uz-Cyrl': 'Лаос', 'uz-Latn': 'Laos', 'vai': 'ꕞꕴꔻ', 'vai-Latn': 'Lawosi', 'vai-Vaii': 'ꕞꕴꔻ', 'vec': 'Laos', 'vi': 'Lào', 'vun': 'Laosi', 'wae': 'Laos', 'wo': 'Lawos', 'xh': 'ELaos', 'xnr...
Python
1
1920 kp_y = keypoints[k][0][kp + 1] * 1080 kp_c = keypoints[k][0][kp + 2] if kp_c > confidence_threshold: marker_style = 'o' if style == '-' else 'v' # 'v' (triangle) for predictions ...
Python
1
est/storage"; let _ = std::fs::remove_dir_all(dirname); let fs = Arc::new(LocalFs::new(dirname).unwrap()); let sstable_options = SstableOptions::default(); let sstable_storage = SstableStorage::new(fs.clone(), sstable_options); let sstable_storage: Arc<dyn Storage> = Arc::new(ss...
Rust
0
#!/usr/bin/python """distutils script for libwebp python module.""" from distutils.core import setup from distutils.extension import Extension import os import shutil import tempfile tmpdir = tempfile.mkdtemp() package = "com.google.webp" package_path = os.path.join(tmpdir, *package.split(".")) os.makedirs(package_p...
Python
1
CoreExerciseName::RollUp => 61, CoreExerciseName::Rolling => 62, CoreExerciseName::Rowing1 => 63, CoreExerciseName::Rowing2 => 64, CoreExerciseName::Scissors => 65, CoreExerciseName::SingleLegCircles => 66, CoreExerciseName::SingleLegSt...
Rust
0
USER_ID_QUERY = '{"user_uri": "http://www.pixiv.net/member.php?id=511763"}' USER_ARTS = [ { 'author': '北原亜希', 'thumbnail_uri': 'http://i1.pixiv.net/img-inf/img/2013/12/27/12/57/17/40544332_s.jpg', 'title': '2013冬コミ新刊です~。', 'uri': 'http://www.pixiv.net/member_illust.php?mode=medium&il...
Python
1
i2c1.cr2.modify(|_, w| { w.sadd1(SLAVE_ADDRESS).rd_wrn(false).nbytes(1).start(true) }); // Wait until we are allowed to send data (START has been ACK) while !i2c1.isr.read().txis() {} i2c1.txdr.write(|w| w.txdata(START_REGISTER_ADDRESS)); // Wait until the tra...
Rust
0
for (i, j, k, l) in (0..N4).tuple_combinations() { black_box(i + j + k + l); } }) }); } criterion_group!( benches, tuple_comb_for1, tuple_comb_for2, tuple_comb_for3, tuple_comb_for4, tuple_comb_c1, tuple_comb_c2, tuple_comb_c3, tu...
Rust
0
ContentEntity> { self.contents .insert(cref, content) .map(|content| content.to_entity(cref).clean()) } // TODO: What exactly happening here? pub fn get_key(&self, key_ref: &str) -> Option<ContentEntity> { self.contents .get(key_ref) .and_then...
Rust
0
from .api.main import APIService from .feature import FeatureService from .monitoring import MonitoringService from .producer import ProducerService ServiceKind = FeatureService | ProducerService | APIService | MonitoringService __all__ = ["FeatureService", "ProducerService", "APIService", "MonitoringService"]
Python
1
pub struct AnimatedProperty { pub group_index: usize, pub property_index: usize, pub target: AnimatedPropertyTarget, pub is_collapsed: bool, } pub enum AnimatedPropertyTarget { Joined(AnimatedPropertyField), Separate(Vec<AnimatedPropertyField>), } pub struct AnimatedPropertyField { pub l...
Rust
0
ately dominating node and corresponding `EdgeIndex`. /// * Returns `None` if `node` doesn't exist or doesn't have incoming edges. pub fn secondary_parent(&self, node: NodeIndex) -> Option<(NodeIndex, EdgeIndex)> { for edge in self.graph.edges_directed(node, Direction::Incoming) { if !edge.we...
Rust
0
_tail() assert result == 12.2 assert ( str(linked_list) == "100 -> Node(77345112) -> dlrow olleH -> 7 -> 5555 -> 0 -> " "-192.55555 -> Hello, world! -> 77.9 -> Node(10) -> None -> None" ) # Delete a node in specific location in linked list result = linked_list.delete_nth(10) ass...
Python
1
vec![30].try_into().unwrap(), ))); }); } #[test] fn sub_on_finalize_should_work() { ExtBuilder::default().build().execute_with(|| { System::set_block_number(1); let update: GraduallyUpdate<StorageKeyBytes<Runtime>, StorageValueBytes<Runtime>> = GraduallyUpdate { key: vec![1].try_into().unwrap(), target...
Rust
0
plied"] #[doc = " to rte_eth_dev_configure()."] #[doc = " @param nb_tx_desc"] #[doc = " The number of transmit descriptors to allocate for the transmit ring."] #[doc = " @param socket_id"] #[doc = " The *socket_id* argument is the socket identifier in case of NUMA."] #[doc = " Its value ...
Rust
0
oSet { inner: Option<PyObject>, } common_impl!(PicoSet); // --------------------------------------------------------------------------- #[cfg_attr(feature = "extension-module", pymodule(nanoset))] pub fn init(py: Python, m: &PyModule) -> PyResult<()> { m.add_class::<NanoSet>()?; m.add_class::<PicoSet>()?...
Rust
0
import re class CryptoAdvisor: def __init__(self): self.name = "EcoCryptoGuide" self.crypto_db = { "Bitcoin": { "price_trend": "rising", "market_cap": "high", "energy_use": "high", "sustainability_score": 3/10 }...
Python
1
== "clearpose": colors = get_clearpose_colors() assert len(seg_visual.shape) == 3 seg_visual = np.argmax(seg_visual, axis=0) seg_visual = seg_visual.astype(np.uint8) color_img_preds = color_img_to_gray(np.copy(img)) for ii, color in zip(range(2), colors): col...
Python
1
ome background. Both ARM and Intel are releasing documentation /// that they plan to include instruction set extensions for SHA1 and SHA256 /// sometime in the near future. Second, LLVM won't lower these intrinsics yet, /// so these functions were written emulate these instructions. Finally, /// the block function impl...
Rust
0
let inputs = inputs(to_usize, from_path(path)?); println!("Day 8 Part 1 => {:?}", inputs.iter().sum::<usize>()); Ok(()) } fn part2(path: &str) -> Result<()> { let inputs = inputs(to_usize2, from_path(path)?); println!("Day 8 Part 2 => {:?}", inputs.iter().sum::<usize>()); Ok(()) } #[derive(D...
Rust
0
test_labels = get_latents_and_labels(ae.eval_sess, ae.eval_ops, ds.test) print('Shape of test_labels = {}'.format(np.shape(test_labels))) print('Shape of test_latents = {}'.format(np.shape(test_latents)...
Python
1
import cv2 import sys, getopt import numpy as np cap = cv2.VideoCapture(-1) if(not cap.isOpened()): print("Cannot open camera") else: cap.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, 320) cap.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 240) spotFilter = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5, 5)) maskMorph = cv...
Python
1
# question 26 # Write a python program that checks the string starts with a given prefix and ends eith agiven suffix. s=input("Enter a string: ") pre=input("Given prefix-") if s[0:len(pre)]==pre: print("Yes it starts with given prefix") else: print("No it doesn't start with given prefix") suf=input("Given su...
Python
1
ource::BCP1979, page: 727 }, local_name: String::from(""), latin_name: String::from("<NAME>"), verses: vec![ PsalmVerse { number: 1, a: String::from("Sing to the LORD a new son...
Rust
0
= Cameras( fx=fx, fy=fy, cx=cx, cy=cy, height=height, width=width, camera_to_worlds=camera_to_worlds[:, :3, :4], camera_type=CameraType.PERSPECTIVE, ) # TODO supports downsample # cameras.rescale_out...
Python
1