text
string
label_name
string
labels
int64
_match( hash_algo: HashingAlgorithm, pcr_data: &PcrData, attestation: Attest, ) -> Result<bool> { let pcr_data = Vec::<TPML_DIGEST>::try_from(pcr_data.clone())?; let quote_info = match attestation.attested() { AttestInfo::Quote { info } => info, _ => { return Err(KeylimeE...
Rust
0
| MIPS | `$0` or `$zero` | This is a constant zero register which can't be modified. | | MIPS | `$1` or `$at` | Reserved for assembler. | | MIPS | `$26`/`$k0`, `$27`/`$k1` | OS-reserved registers. | | MIPS | `$28`/`$gp` | Global pointer cannot be used as inputs or outputs. | | MIPS | `$ra` | Return address cannot be us...
Rust
0
# flake8: noqa: F401 # Contexts and bounds by name from carl.envs.brax.carl_ant import CONTEXT_BOUNDS as CARLAnt_bounds from carl.envs.brax.carl_ant import DEFAULT_CONTEXT as CARLAnt_defaults from carl.envs.brax.carl_ant import CARLAnt from carl.envs.brax.carl_fetch import CONTEXT_BOUNDS as CARLFetch_bounds from carl.e...
Python
1
Self { c, d, d1, d2 } } pub fn open<Q1: Point, Q2: Point>( &self, b: Commitment<Q1>, c: Commitment<Q2>, nonce: Scalar, ) -> bool { let q1 = Q1::hash(NOTHING_UP_MY_SLEEVE_Q1); let q2 = Q2::hash(NOTHING_UP_MY_SLEEVE_Q2); let d1 = Q1::generator()...
Rust
0
is_some() && body.node_id.unwrap().id != nid { error!( "Join Cluster Request body node_id {} does not match path {}, which is used", body.node_id.unwrap().id, nid ); } info!("received register node request for node {:?}:{:?}", nid, body); let connect_cmd = ConnectNo...
Rust
0
from generate_ppt import Generate_ppt #coding:utf-8 # 加载已有的PPT模板 ppt_path = "source/ppt_model/1.百廿红-李一.pptx" generate_ppt = Generate_ppt(ppt_path) generate_ppt.add_cover("这是标题", "这是作者", "2021年5月") menu_items = ["目录1", "目录2", "目录3", "目录4"] generate_ppt.add_menu("source/img/image22.jpg", 3, menu_items) generate_ppt.add_m...
Python
1
from django.shortcuts import render, redirect, get_object_or_404 from . import models from .form import EmployeeForms from .models import Employee def employeeForm(request, id=0): if request.method == 'GET': if id == 0: # Criação de um novo registro form = EmployeeForms() else: # Edi...
Python
1
details.push(indent(&format!("{}: {}", key, s))); } else { details.push(indent(&format!("{}: {}", key, stringified))); } } else { extras.push(format!("{}={}", key, stringified)); } } let formatted_details = if details.len() > 0 { format...
Rust
0
# 错误次数+1 self.err += 1 # 用f字符串格式化错误类型和错误信息,提供更多的调试信息 print( f'{time.strftime("%Y-%m-%d_%H-%M-%S")} login:页面加载或元素操作失败,错误类型:{type(e).__name__}, 详细错误信息:{str(e).split("Stacktrace:")[0]}' ) ...
Python
1
import numpy as np import matplotlib.pyplot as plt # Array from .csv arra=np.genfromtxt('https://raw.githubusercontent.com/marcoreps/multiinstrumentalist/master/csv/20210920-105659_3458A_INL.csv',delimiter=',',skip_header=1) # Columns to lists F5700A = [row[0] for row in arra] HP3458A = [row[1] for row in arra] PPMde...
Python
1
info!(root_log, "Failed to unmount {:?}: {}", target, e); } } else { let output = Command::new("fusermount").arg("-u").arg(&target).output()?; if !output.status.success() { info!( ...
Rust
0
screen_width, screen_height, 1, crate::types::vec4(0.0, 0.0, 0.0, 0.0))?); copy_program = Some(program::Program::from_source(&gl, include_str!("shaders/copy.vert"), include_str!("shaders/copy.frag"))?); ...
Rust
0
s = vec![CustomBlockConfig::new(drive_id.clone(), true, None, true)]; insert_block_devices(&mut vmm, &mut cmdline, event_manager, block_configs); // Add net device. let network_interface = NetworkInterfaceConfig { iface_id: String::from("netif"), host_dev_name: String::f...
Rust
0
import numpy as np from omegaconf import DictConfig import torch import torch.nn.functional as F from ....abstract.explainer import Explainer from ...utils.utils import build_counterfactual_graph_gc from torch_geometric.utils import k_hop_subgraph from torch_geometric.data import Data class EgoExplainer(Explainer): ...
Python
1
import os from dataclasses import dataclass from typing import Dict, List, Optional from dotenv import load_dotenv from loguru import logger # 加载.env文件 load_dotenv() @dataclass class MonitorConfig: # 驱动模式:webhook/telegram driver_type: str @dataclass class TelegramConfig: """Telegram配置""" api_id:...
Python
1
rams, options=options, ), ) async def reject_async( self, account: str, params: "AccountService.RejectParams", options: RequestOptions = {}, ) -> Account: """ With [Connect](https://stripe.com/connect), you can reject accounts ...
Python
1
/// use tokio::io::AsyncWriteExt; /// /// # #[tokio::main(flavor = "current_thread")] /// # async fn test () { /// let mut decoded = "hello world"; /// let mut encoded: Vec<u8> = vec![]; /// /// { /// let mut encoder = Encoder::with_chunks_size(&mut encoded, 5); /// encoder.write_all(decoded.as_bytes()).await;...
Rust
0
Collect for DisplayProperty<'gc> { fn needs_trace() -> bool { false } } /// The map from key/index to function pointers for special display object properties. #[derive(Collect)] #[collect(no_drop)] pub struct DisplayPropertyMap<'gc>(PropertyMap<DisplayProperty<'gc>>); impl<'gc> DisplayPropertyMap<'gc...
Rust
0
_levels = AccessLevels { map: access_levels.map.iter() .map(|(&k, &v)| (tcx.hir.local_def_id(k), v)) .collect() }; let send_trait = if crate_name == Some("core".to_string()) { clean::path_to_...
Rust
0
fn call(&mut self, req: Request<Body>) -> Self::Future { let mut detox = self.clone(); let resp = async move { let resp = detox.process(req).await; tracing::trace!("response {:?}", resp); let out = match resp { Err(ref error) => make_error_response(er...
Rust
0
from pydantic import BaseModel, Field from fastapi import Header, Depends, APIRouter, HTTPException from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials from sqlalchemy.orm import Session from database import get_db import requests from models import LUsers from datetime import datetime, timedelta from...
Python
1
import requests, json, sys, zipfile, io, os import pandas as pd def set_identity(name): identity = {"name": name} with open("identity.json", "w") as f: json.dump(identity, f, ident = 4) def load_identity(): try: with open("identity.json", "r") as f: identity = json.load(f) ...
Python
1
// // The precondition also ensures that we are the only one accessing // `self` at the moment so replacing is fine. unsafe { let _ = mem::replace(&mut *ptr, Some(value)); } // SAFETY: With the call to `mem::replace` it is guarant...
Rust
0
type Err = ParseFixedError; /// Parses a string slice containing decimal digits to return a fixed-point number. /// /// Rounding is to the nearest, with ties rounded to even. #[inline] fn from_str(s: &str) -> Result<Self, Self::Err> { F::wrapping_from_str(s).map(Wrapping) } } macro_rul...
Rust
0
CHANGE_SUCCESSFUL, RDW_INTERNALPAINT, }, }, System::{ Com::{ CoCreateInstance, CoInitializeEx, CoUninitialize, CLSCTX_ALL, COINIT_APARTMENTTHREADED, }, Ole::{OleInitialize, RegisterDragDrop}, }, UI::{ Input::{ KeyboardAndMouse::{ ...
Rust
0
}, Ok(_) => println!("unknown request id"), Err(_) => println!("error assigning request id"), }}, _ => { // subscriptions println!("no id field found in response. must be subscription"); println!...
Rust
0
_key_public = PKey::from_rsa(Rsa::from_public_components( root_key_rsa.n().to_owned()?, root_key_rsa.e().to_owned()?, )?)?; let root_key = PKey::from_rsa(root_key_rsa.clone())?; let new_subject = get_cert_subject()?; let random_numbers = get_random_big_number()?; let not_before = Utc...
Rust
0
# -*- coding: utf-8 -*- import ccxt.pro from asyncio import gather, run async def symbol_loop(exchange, method, symbol): print('Starting', exchange.id, method, symbol) while True: try: response = await getattr(exchange, method)(symbol) now = exchange.milliseconds() ...
Python
1
antizationPreset.PERFORMANCE, inplace_statistics=False) statistics_aggregator = PT2StatisticsAggregator(dataset) wrapped_model: GraphModelWrapper = wrap_model(model, input_data, True) statistic_points = min_max_algo.get_statistic_points(wrapped_model.model, wrapped_model.get_graph()) statistics_aggrega...
Python
1
R'(R R RR-R)(R"tlabelt field_classR&R'tlayoutRR=((s;/Users/dylan/Projects/django-bootstrap3/bootstrap3/forms.pytrender_field_and_labels cCsdjd|d|S(u' Render a Bootstrap for...
Python
1
# -*- coding: utf-8 -*- """新聞分類和熱度分析器 此模組提供新聞自動分類和熱度分析功能,支援政策類、行業類、 個股類、宏觀經濟類等多種新聞分類,並提供熱度評分算法。 主要功能: - 新聞自動分類 - 熱度評分算法 - 關鍵詞提取 - 主題挖掘 - 趨勢分析 支援的分類: - 政策類 (Policy) - 行業類 (Industry) - 個股類 (Stock) - 宏觀經濟類 (Macro) - 市場情緒類 (Market) Example: >>> from src.nlp.news_classifier import NewsClassifier >>> classifier =...
Python
1
from tkinter import * # window my_window = Tk() my_window.title("ماشین پخت مستر پخت") my_window.geometry("400x300") # calculator_screen result = StringVar() Label(my_window, text="به نام خدا ", font=("Arial", 20)).place(x=148, y=20) Label(my_window, text="ماشین پخت مستر پخت ", font=("Arial", 14)).place(x=248, y=60) La...
Python
1
handle_intr_misc(&mut self, intr: u32) -> bool { if (intr & ISR_FATAL > 0) { println!("intr-fatal: {:X}", intr); self.flag |= FLAG_TASK_RESET; self.task(); return true; } if (intr & ISR_ALERT > 0) { println!("interrupt alert: {:X}", intr); } ...
Rust
0
(&storage_path).map_err(|err| ProtocolError::StorageError { action: format!("create dir {}", storage_path), err, })?; // Calculate hash of temp file let hash = calc_file_hash(&source_path, hash_chunk_size)?; let file_size = metadata.len() as u64; let index = (file_size / transfer_c...
Rust
0
<'de> for PrimaryTable2<I, V> where V: Deserialize<'de> + Default + Clone, { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'de>, { struct Visitor<I, V>(PhantomData<fn() -> PrimaryTable2<I, V>>); impl<'de, I, V> serde::de::Visitor<'de> for Vis...
Rust
0
if *WINDOWS && (Self::has_windows_drive(&path) || scheme.eq("file")) { path = path.replace("\\", "/"); } let min_len = Self::start_position_without_windows_drive(&path) + 1; if (path.len() > min_len) && path.ends_with(SEPARATOR) { path = path.get(0..path.len() -...
Rust
0
ty::TxBefore), _ => None, } } // The built-in inequality operators apply to Long, Double, and Instant. pub fn supported_types(&self) -> ValueTypeSet { use self::Inequality::*; match self { &LeCausethan | &LeCausethanOrEquals | &Greater...
Rust
0
import pandas as pd import numpy as np import os from cmaq2hemco.mp2022 import open_gdemis, open_ptemis from cmaq2hemco.utils import pt2hemco, gd2hemco, gd2matrix, gd2hemco_fast from cmaq2hemco.mechrc.cb6r5_ae7_aq import writeconfig debug = True dates = pd.date_range('2022-01-01', '2022-12-31', freq='d') # Define grid...
Python
1
Key>::from_str(policy)); let minisc = jserr!(Descriptor::new_wsh(jserr!(policy.compile()))); Ok(minisc.to_string().into()) } #[wasm_bindgen] pub fn address(desc: &str, idx: u32, network: &str) -> Result<JsValue, JsValue>{ let network = jserr!(network.parse::<bitcoin::Network>()); if idx >= 0x80000000 {...
Rust
0
# This indicates real edges self.san_graphs[idx] = g.cpu() return g def get_graph(self, idx): if idx in self.dgl_graphs: return self.dgl_graphs[idx] else: graph_info = self.graphs[idx] g = dgl.graph((graph_info['edge_index'][0], graph_inf...
Python
1
Args: token_ids_0 (:obj:`List[int]`): List of IDs. token_ids_1 (:obj:`List[int]`, `optional`): Optional second list of IDs for sequence pairs. Returns: :obj:`List[int]`: List of `token type IDs <../glossary.html#token-type-ids>`_ according to...
Python
1
from ctypes import cdll, c_void_p, c_char_p from ctypes import util def get_platform_ios(): objc = cdll.LoadLibrary(util.find_library(b'objc')) objc.objc_getClass.restype = c_void_p objc.objc_getClass.argtypes = [c_char_p] objc.objc_msgSend.restype = c_void_p objc.objc_msgSend.argtypes = [c_void_...
Python
1
let (ty, color_info) = match color_info_type { ColorInfoType::Palette(palette) => (0, ColorInfo { palette }), ColorInfoType::Rgb(rgb) => (1, ColorInfo { rgb }), ColorInfoType::Text => (2, ColorInfo::default()), }; Self { addr, pitch, ...
Rust
0
# Copyright 2017-2023 Posit Software, PBC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
1
ppo_agent.buffer.is_terminals.append(done) time_step += 1 current_ep_reward += reward if render and i_episode % 50 == 0: env.render() # Update PPO agent if time_step % update_timestep == 0: ppo_agent.upd...
Python
1
#!/usr/bin/env python3 """ Main entry point for Construction Cost Estimation Chatbot """ import asyncio from .construction_bot import ConstructionCostBot from .gradio_interface import launch_gradio async def run_cli(): """Run the command line interface""" bot = ConstructionCostBot() await bot.initialize() ...
Python
1
# Copyright (C) 2011-2012 One Laptop Per Child # Copyright (C) 2010 Tomeu Vizoso # Copyright (C) 2011 Walter Bender # Copyright (C) 2011 Raul Gutierrez Segales # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softw...
Python
1
#!/usr/bin/env python3 """ Validation script to check if the Titanic ML Agent setup is correct """ import os import sys def check_files(): """Check if all required files exist""" required_files = [ 'titanic_agent.py', 'train_agent.py', 'requirements.txt', 'README.md', '...
Python
1
YuvItur = 3u8 + 30u8, /// YUV NTSC color format, 3 channels YuvNtsc = 3u8 + 35u8, } impl Default for ColorChannels { fn default() -> ColorChannels { Srgba } } pub use ColorChannels::*; impl ColorChannels { /// Convert a pixel to this format from another. pub fn from(self, from: C...
Rust
0
; if !destination.ends_with("/") { destination.push('/') } let mut cmd = process::Command::new("rsync"); cmd.arg("-rltz") .arg("--delete"); if self.has_contimeout { cmd.arg("--contimeout=10"); } cmd.arg(source.to_string()) ...
Rust
0
import base64 import os import requests engine_id = "stable-diffusion-v1-5" api_host = os.getenv('API_HOST', 'https://api.stability.ai') api_key = os.getenv("STABILITY_API_KEY") if api_key is None: raise Exception("Missing Stability API key.") response = requests.post( f"{api_host}/v1/generation/{engine_id}/...
Python
1
Str; use std::str::FromStr; /// A paid subscription ot the channel #[non_exhaustive] #[derive(Clone, Debug, PartialEq, Hash, FromStr)] #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] pub enum SubPlan { /// A `Prime` subscription Prime, /// A Tier-1 subscription (currently ...
Rust
0
.FileBasedCache', # 'LOCATION': 'django_cache', # }, 'default': { 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', # 本地内存缓存 'TIMEOUT': 60 * 60 * 1, # 过期时间 秒, 一个钟过期 'LOCATION': 'unique-snowflake', } } # logging的配置 https://docs.djangoproject.com/en/2.2/topics/logg...
Python
1
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: streamlit/proto/PageProfile.proto # Protobuf Python Version: 5.26.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool fro...
Python
1
_eq!(buffer.push(data.clone()), PushResult::Ok(false)); assert!(!buffer.is_empty()); assert_eq!(buffer.num_items(), 1); assert_eq!(buffer.push(data.clone()), PushResult::Ok(true)); assert!(!buffer.is_empty()); assert_eq!(buffer.num_items(), 2); assert_eq!(buffer.push(da...
Rust
0
import os import sys class Core(object): _commands_path = { "nmap" : "/usr/bin/nmap", "tshark" : "/usr/bin/tshark", "tcpdump" : "/usr/sbin/tcpdump", "arpspoof" : "/usr/sbin/arpspoof", "phantomjs" : "/usr/local/bin/phantomjs" } _nmap_optimize = "-min-hostgroup 64 -min-parallelism 64 -host-timeout=300m -max-rtt-time...
Python
1
rt_eq!(wallet, imported); let desc = wallet.to_descriptors().unwrap(); assert_eq!(desc[0], descriptor); } use std::default; use crate::prelude::*; use once_cell::sync::Lazy; static ACCEPT_ENCODING_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r#"(?P<kind>\w+)(?:;q=(?P<quality>.+))?"#).unwrap()); #[derive(...
Rust
0
th = path.as_ref(); let n_workers = num_cpus::get(); let pool = Pool::new(n_workers); // Loop until generator says we are done loop { // Number of threads to spawn let mut num_jobs: i64 = 0; let (tx, rx) = channel(); let mut data = Vec::new(); // run each c...
Rust
0
// don't bother bouncing absorbed rays towards lights // (they would be absorbed in the opposite direction). return Srgb::new(0.0, 0.0, 0.0); } } } None => { let t: f32 = clamp(0.5 * (ray.direction.unit_vector().y() as f32 ...
Rust
0
Self { value: GroupG1::new_bigs(&x, &y) } } } impl From<[u8; FIELD_ORDER_ELEMENT_SIZE]> for G1 { fn from(data: [u8; FIELD_ORDER_ELEMENT_SIZE]) -> Self { Self::from(&data) } } impl From<&[u8; FIELD_ORDER_ELEMENT_SIZE]> for G1 { fn from(data: &[u8; FIELD_ORDER_ELEMENT_SIZE]) -> Self { ...
Rust
0
wl_array { pub size: size_t, pub alloc: size_t, pub data: *mut libc::c_void, } pub type C2RustUnnamed = libc::c_uint; pub const WL_EVENT_ERROR: C2RustUnnamed = 8; pub const WL_EVENT_HANGUP: C2RustUnnamed = 4; pub const WL_EVENT_WRITABLE: C2RustUnnamed = 2; pub const WL_EVENT_READABLE: C2RustUnnamed = 1; pu...
Rust
0
imit = "1024"] use ensogl_core::prelude::*; use enso_text::unit::Bytes; use ensogl_core::application::Application; use ensogl_core::display::object::ObjectOps; use ensogl_core::system::web; use ensogl_hardcoded_theme as theme; use ensogl_list_view as list_view; use ensogl_text_msdf_sys::run_once_initialized; use logg...
Rust
0
src/packet/mod.rs pub mod reader; pub mod builder; pub mod codec; pub mod chunk; <reponame>lerouxrgd/rsgen-kafka<gh_stars>0 use std::ops::{Deref, DerefMut}; use crate::codec::ser::{ser_option_bytes, ser_raw_string}; use crate::codec::Compression; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] ...
Rust
0
impl GetPrimitive for HashMap<String, String> { fn get_bool(&self, key: &str) -> Result<bool> { match self .get(key) .map(|x| x.as_str()) .ok_or(format!("{} is not defined", key))? { "1" | "true" | "True" => Ok(true), "0" | "false" | "Fal...
Rust
0
import turtle aj = turtle.Pen() y = 0 aj.speed(100) turtle.bgcolor("black") # aj.shape("turtle") def head(): aj.color("green") aj.fd(160) x = aj.xcor() aj.seth(90) aj.begin_fill() # aj.color("green") aj.circle(x / 2, 180) aj.end_fill() aj.penup() aj.goto(33, 37) aj.pendown()...
Python
1
false, 2.99, ), MenuItem::new( "Soup of the day", "Soup of the day, with a side of potato salad", false, 3.29, ), MenuItem::new( "Hotdog", "A h...
Rust
0
sert($x);)* set }}; } /// Implements steps 2 and 3 of **Algorithm 3.36** in *Compilers: Principles, /// Techniques, and Tool*, Second Edition. fn tree_to_dfa(tree: &SyntaxTree) -> Result<DFA, ParseError> { let base = match calculate_functions(tree)? { Some(b) => b, None => { ...
Rust
0
// Unknown4 = 4, None, // Unknown5 = 5, None, // Unknown6 = 6, None, // Unknown7 = 7, Some(&[(Key::Backspace, Mods(0))]), ...
Rust
0
d(f'/root/cjy/proG/pre_trained/task_heads/{dataset}.pth') dis = Discriminator(hid_dim=cfg['hid_dim']) pretrained_dis = torch.load(f'/root/cjy/proG/pre_trained/dis/{dataset}.pth') dis.load_state_dict(pretrained_dis) hid_dim = cfg['hid_dim'] W_down = nn.Parameter(torch.randn(2 * hid_dim, hid_dim)...
Python
1
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import math import torch.nn.functi...
Python
1
""" ui/sales_analytics.py Very basic analytics: totals & top products for date range (inclusive). """ from PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QDateEdit, QLabel, QPushButton, QTableWidget, QTableWidgetItem from PyQt5.QtCore import QDate class AnalyticsWindow(QWidget): def __init__(self, db):...
Python
1
} pub struct GrpcMsgHistogramVec: Histogram { "type" => GrpcTypeKind, } pub struct GrpcMsgFailCounterVec: IntCounter { "type" => GrpcTypeKind, } } lazy_static! { pub static ref SEND_SNAP_HISTOGRAM: Histogram = register_histogram!( "tikv_server_send_snapshot_duration_seco...
Rust
0
|| MODEL_EVALUATOR.evaluate_invocable(invocable_name, &ctx)); } #[bench] fn _0007(b: &mut Bencher) { let ctx = context(INPUT_DATA); let invocable_name = "dtDuration1"; assert_decision(&MODEL_EVALUATOR, invocable_name, &ctx, r#"P13DT2H14S"#); b.iter(|| MODEL_EVALUATOR.evaluate_invocable(invocable_name, &ctx)); ...
Rust
0
State; pub struct State { pub jig_id: JigId, pub loader: AsyncLoader, pub share_state: Rc<ShareJigState>, pub jig_edit_state: Rc<JigEditState>, } impl State { pub fn new(jig_id: JigId, jig_edit_state: Rc<JigEditState>) -> Self { Self { jig_id: jig_id.clone(), loader...
Rust
0
"""轨迹恢复:用最后检测框匹配严重遮挡的轨迹""" N, M = len(trackers), len(detections) if N == 0 or M == 0: return [] cost_matrix = np.ones((N, M), dtype=np.float32) * 2.0 for i, trk in enumerate(trackers): last_det = trk.get_last_detection() for j,...
Python
1
from dl_connector_bundle_chs3.chs3_yadocs.formula.definitions.conditional_blocks import DEFINITIONS_COND_BLOCKS from dl_connector_bundle_chs3.chs3_yadocs.formula.definitions.functions_aggregation import DEFINITIONS_AGG from dl_connector_bundle_chs3.chs3_yadocs.formula.definitions.functions_array import DEFINITIONS_ARRA...
Python
1
RenderingContext::STATIC_DRAW, ); // Set up the color for the faces. // In this case, solid colors for each face is used. let color_buffer = context .create_buffer() .ok_or("failed to create color_buffer")?; context.bind_buffer(WebGlRenderingContext::ARRAY_BUFFER, Some(&color_buffer...
Rust
0
h Display Name", scope=Scope.settings) class TestIndexedXBlock(XBlock): """ Class to test when an Xblock provides a dictionary """ def index_dictionary(self): return { "test_field": "ABC123", "text_block": "Here is some text that was inde...
Python
1
import os MyPC = os.path.basename(__file__) != "Main.py" if MyPC: from icecream import ic ic.disable() else: def ic(*args): return None ic.enable() if MyPC else None def main(): h, w, d = map(int, input().split()) tmp_grid_list = [list(input()) for _ in range(h)] grid_list = [["#"]*(w+2) for _ in ran...
Python
1
#!/usr/bin/env python import difflib, httplib, itertools, optparse, random, re, urllib, urllib2, urlparse NAME, VERSION, AUTHOR, LICENSE = "Damn Small SQLi Scanner (DSSS) < 100 LoC (Lines of Code)", "0.2y", "Miroslav Stampar (@stamparm)", "Public domain (FREE)" PREFIXES, SUFFIXES = (" ", ") ", "' ", "') "), ("", "-- ...
Python
1
'''Exercício Python 58: Melhore o jogo do DESAFIO 28 onde o computador vai “pensar” em um número entre 0 e 10. Só que agora o jogador vai tentar adivinhar até acertar, mostrando no final quantos palpites foram necessários para vencer.''' #outro jeito (aula) from random import randint computador = randint(0,10) prin...
Python
1
# Problem: C - z-sort - https://codeforces.com/gym/603156/problem/C t=int(input()) arr= list(map(int,input().split())) for i in range(1, len(arr)): if i % 2 == 1: if arr[i] < arr[i - 1]: arr[i], arr[i - 1] = arr[i - 1], arr[i] else: if arr[i] > arr[i - 1]: arr[i], arr[i - 1] = a...
Python
1
top_padding { pos.y = top_padding; } else if pos.y > GAME_SIZE_Y as f32 - bottom_padding { pos.y = GAME_SIZE_Y as f32 - bottom_padding; } } fn update_state_spawning( state_shared: &mut EnemyStateShared, dt: f32, state_data: &mut EnemyStateSpawnin...
Rust
0
# coding: utf-8 """ Slurm REST API API to access and control Slurm The version of the OpenAPI document: Slurm-24.11.5&openapi/slurmdbd&openapi/slurmctld Contact: sales@schedmd.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E50...
Python
1
from zlapi.models import Message import os import importlib from config import PREFIX RESET = '\033[0m' BOLD = '\033[1m' GREEN = '\033[92m' RED = '\033[91m' class CommandHandler: def __init__(self, client): self.client = client self.mitaizl = self.load_mitaizl() self.auto_mitaizl = self.lo...
Python
1
( cf: &T::Crowdfunding, ) -> Vec<Investment<T>> { InvestmentMapV2::<T>::drain_prefix(*cf.id()) .map(|(_, x)| x) .collect() } fn has_investments( cf: &T::Crowdfunding, ) -> bool { InvestmentMapV2::<T>::iter_prefix(*cf.id()) .tak...
Rust
0
match part { Part::Part1 => part1(&school), Part::Part2 => part2(&school) } } fn solve(school:&School, nb_generation:u32) -> u128 { let mut school = *school; for _i in 0..nb_generation { school.perform_one_tick(); } school.population_size() } fn solve_fast(school:&School, ...
Rust
0
cpu.b(); let r = add_with_carry_and_set_flags(cpu, a, b); cpu.set_a(r); } /// Add `C` to `A` with carry fn adc_a_c(cpu: &mut self::Cpu) { let a = cpu.a(); let c = cpu.c(); let r = add_with_carry_and_set_flags(cpu, a, c); cpu.set_a(r); } /// Add `D` to `A` with carry fn adc_a_d(cpu: &mut s...
Rust
0
= self._get_voc_results_file_template().format(cls) rec, prec, ap = voc_eval( filename, annopath, imagesetfile, cls, cachedir, ovthresh=0.5, use_07_metric=use_07_metric) aps += [ap] print('AP for {} = {:.4f}'.fo...
Python
1
obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License...
Rust
0
ReactionsPlusOne => "reactions-+1", SearchIssuesPullRequestsSort::ReactionsMinusOne => "reactions--1", SearchIssuesPullRequestsSort::ReactionsHeart => "reactions-heart", SearchIssuesPullRequestsSort::ReactionsSmile => "reactions-smile", SearchIssuesPullRequestsSort::React...
Rust
0
If we don't know the receiver, don't emit the warning. if let Some(span) = help_sp { cx.struct_span_lint(lint, msg_sp, msg) .note(note) .span_help(span, help) .emit() } } // #[doc(hidden)] // pub fn _() { todo!() } // #[doc(hidden)] // pub fn chain() { todo!() } // #...
Rust
0
port, registry).map(drop) ); metrics } else { MetricsService::new() }; // Periodically updated metrics and telemetry updates. spawn_handle.spawn("telemetry-periodic-send", metrics_service.run( client.clone(), transaction_pool.clone(), network_status_sinks.clone() ) ); // RPC let gen_handler...
Rust
0
ion which can replace the // cache with None is `with_cache`, which would have panicked if // `f` attempted to re-enter it. let by_size = cache.as_mut().unwrap().entry(input).or_default(); by_size.insert(size_in_bytes, output); output ...
Rust
0
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed ...
Python
1
ssage is not expected on the collator side of the protocol", ); } } Ok(()) } /// Our view has changed. async fn handle_peer_view_change<Context>( ctx: &mut Context, state: &mut State, peer_id: PeerId, view: View, ) -> Result<()> where Context: SubsystemContext<Message = CollatorProtocolMessage> { let cur...
Rust
0
}; let (recv_res_msg, _) = block_on(try_join(f_res_msg, f_recv)).unwrap(); assert_eq!(recv_res_msg, res_msg); } } <filename>vendor/atsame70q21b/src/i2sc0/i2sc_mr.rs #[doc = "Register `I2SC_MR` reader"] pub struct R(crate::R<I2SC_MR_SPEC>); impl core::ops::Deref for R { type Target = crate::R<I2...
Rust
0
utputs['multi'] = self.final_layer_multi(x) return outputs def init_weights(self, pretrained='', fixed=False, print_load_info=False): logger.info('=> init weights from normal distribution') for m in self.modules(): if isinstance(m, nn.Conv2d): nn.init.normal_(m.w...
Python
1
/01/02 02:00:00 UTC; hardware type 22:22:22:22:22:22; uid Client2; hostname \"TESTHOSTNAME\"; client-hostname \"HN\"; } lease 192.168.0.3 { starts 1 1986/01/02 00:00:00 UTC; ends 1 1986/12/02 02:00:00 UTC; hardware type 22:22:22:22:22:22; uid Clie...
Rust
0
# Copyright 2024 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
Python
1