text
string
label_name
string
labels
int64
онструктивные дискуссии разрешены\n" "_❗️ Решайте разногласия в личных сообщениях_\n\n" "🔞 *5. Запрещён NSFW-контент*\n" "• Контент 18+, порнография, эротика\n" "• Жестокость, шок-контент, расчленёнка\n" "• Обсуждение наркотиков, терроризма, катастроф\n\n" ...
Python
1
import streamlit as st import pandas as pd st.set_page_config(page_title="My Portfolio", page_icon=":star:", layout="wide") main_image = "logo.png" with st.sidebar: st.title("Streamfolio") st.image("logo.png") selection = st.radio("Navigate to:", ["Home", "Projects", "Skills & Experience", "Contact"], la...
Python
1
""" TencentBlueKing is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaSCommunity Edition) available. Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the...
Python
1
ta.is_empty() || data.len() != constants::SCHNORRSIG_PUBLIC_KEY_SIZE { return Err(Error::InvalidPublicKey); } unsafe { let mut pk = ffi::XOnlyPublicKey::new(); if ffi::secp256k1_xonly_pubkey_parse( ffi::secp256k1_context_no_precomp, &m...
Rust
0
import cv2 import mediapipe as mp mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles my_drawing_specs = mp_drawing.DrawingSpec(color=(0, 255, 0), thickness=1) cap = cv2.VideoCapture(1) mp_face_mesh = mp.solutions.face_mesh with mp_face_mesh.FaceMesh( max_num_faces=1, ...
Python
1
"""Quand on charge l’application users, utilise la classe UsersConfig (dans apps.py) comme configuration, et pas la configuration par défaut. """ default_app_config = 'apps.users.apps.UsersConfig'
Python
1
f, Client, Result}; use futures::{Stream, TryStreamExt}; use reqwest::Method; use std::fmt::Debug; use std::pin::Pin; use tracing::Instrument; use url::Url; fn hmac_keys_url(base_url: Url, project_id: &str) -> Result<Url> { Ok(base_url .join("projects/")? .join(project_id)? .join("hmacKeys/...
Rust
0
) = &input.dry_run { scope_1712.boolean(*var_1713); } #[allow(unused_mut)] let mut scope_1714 = writer.prefix("ForceDelete"); if let Some(var_1715) = &input.force_delete { scope_1714.boolean(*var_1715); } #[allow(unused_mut)] let mut scope_1716 = writer.prefix("InstanceEventW...
Rust
0
self, stmt_span: Span, stmt_time: i32, keyword: &Sp<ast::CondKeyword>, a: &Sp<ast::Expr>, binop: &Sp<ast::BinopKind>, b: &Sp<ast::Expr>, goto: &ast::StmtGoto, ) -> Result<(), ErrorReported>{ match (classify_expr(a, self.ctx)?, classify_expr(b, self.ct...
Rust
0
rgs.rust: import sbpg.targets.rust as rs parsed = [yaml.parse_spec(spec) for spec in file_index.values()] rs.render_all(output_dir, parsed, release) elif args.test_c: test_c.render_check_suites(output_dir, all_specs) test_c.render_check_main(output_dir, all_specs) eli...
Python
1
ightly different from the TF version which uses truncated_normal for initialization # cf https://github.com/pytorch/pytorch/pull/5617 module.weight.data.normal_(mean=0.0, std=self.config.initializer_range) if module.bias is not None: module.bias.data.zero_() e...
Python
1
from typing import List from sqlalchemy import String, Text, SmallInteger, ForeignKey, UUID from sqlalchemy.orm import relationship, mapped_column, Mapped from app import settings from app.models.base import ( BaseORM, table_name_tenant, table_name_tenant_default_model, table_name_pivot_tenant_to_user...
Python
1
""" varlik ismi tanima: metin (cumle) -> metin icerisinde bulunan varlik isimlerini tanimla """ # import libraries import pandas as pd import spacy # spacy modeli ile varlik ismi tanimla nlp = spacy.load("en_core_web_sm") # spacy kutuphanesi ingilizce dil modeli content = "Alice works at Amazon and lives in London....
Python
1
use crate::common::PixelSize; use crate::style::Color; mod mat4; mod shader; mod texture; mod vert_array; pub(crate) use mat4::Mat4; pub(crate) use shader::{ActiveShaderProgram, ShaderProgram}; pub(crate) use texture::{GlTexture, /*TexFormat, TexRGB,*/ TexRed, TexUnit}; pub(crate) use vert_array::{ElemArr, Element}; ...
Rust
0
t_level indent_level += indent_amount def pop_indent(indent_amount=4): global indent_level indent_level -= indent_amount def cgen(code, **kwds): indent = genindent(indent_level) lines = code.split('\n') lines = [indent + x for x in lines] return '\n'.join(lines) % kwds + '\n' def mcgen(co...
Python
1
aisesRegexp(errors_impl.InvalidArgumentError, "warp should be at least a matrix"): sess.run(outputs) # The batch size of the data and warp tensors must be the same. with self.cached_session() as sess: data_shape = (batch_size, data_height, data_width, data_chann...
Python
1
elif value in self.types: token = Name.Class # elif value in self.procedures: token = Name.Function # elif value in self.variables: token = Name.Variable # elif va...
Python
1
profile"); return; }; let closure_def_id = closure_instance.def_id(); let typeck_results = tcx.typeck(closure_def_id.expect_local()); if typeck_results.closure_size_eval.contains_key(&closure_def_id) { let param_env = ty::ParamEnv::reveal_all(); let ClosureSizeProfileData { b...
Rust
0
K]); let a_rsne = make_rsne(Some(cipher::CCMP_128), vec![cipher::CCMP_128], vec![akm::EAP, akm::PSK]); let result = is_valid_rsne_subset(&s_rsne, &a_rsne); assert!(result.is_err()); assert!(format!("{:?}", result.unwrap_err()).contains("negotiated protection is invalid")); ...
Rust
0
#Lesson about while using index def main(): number_sum = 0 index = 1 while index <= 1000: number_sum += index index += 1 print("The sum is:", number_sum) main ()
Python
1
# Copyright 2021 - TODAY, Marcel Savegnago <marcel.savegnago@escodoo.com.br> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, fields, models class StockPicking(models.Model): _inherit = "stock.picking" tms_vehicle_ids = fields.One2many("fleet.vehicle", "stock_picking_id"...
Python
1
(np.int32) np_golden = np_A.copy() mod(np_A) np.testing.assert_allclose(np_A, np_golden, rtol=1e-4, atol=1e-4) def test_meta_for(): N = 8 def top(A: int32[N]): with allo.meta_for(0, N) as i: A[i] = A[i] + 1 with allo.meta_for(N) as i: A[i] = A[i] - 1 ...
Python
1
tegrationTest(unittest.TestCase): @slow def test_inference_image_segmentation_ade(self): # only resize + normalize feature_extractor = SegformerFeatureExtractor( image_scale=(512, 512), keep_ratio=False, align=False, do_random_crop=False ) model = SegformerForSemantic...
Python
1
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # # phylogeny.py # compara # # Created by Haibao Tang on 05/21/20 # Copyright © 2020 Haibao Tang. All rights reserved. # import csv import os.path as op import sys from ..apps.base import ActionDispatcher, OptionParser, logger, mkdir from ..formats.fasta import Fasta, SeqI...
Python
1
lse None, run_name=wandb_run_name if use_wandb else None, ), data_collator=transformers.DataCollatorForSeq2Seq( tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True ), ) model.config.use_cache = False old_state_dict = model.state_dict model....
Python
1
# 3) 推送文档 if docs: with status("[index] 推送文档到 Meili …", spinner="dots"): idx.add_documents(docs) idx.update_searchable_attributes(["title","title_zh","text","context_zh","key_points","key_points_zh","tags"]) idx.update_filterable_attributes(["projects"...
Python
1
# The socket API is an application-level network protocol, # via file transfer protocol (FTP) and hyper transfer protocol import sys import socket # The import of time is useful in order to define how much time has passed import time #this function takes note of what time it is currently, this is useful later startTi...
Python
1
: self.nodes[2].createwallet("wallet{}".format(i)) wrpc = self.nodes[2].get_wallet_rpc("wallet{}".format(i)) for key in signer['privkeys']: wrpc.importprivkey(key) signed_tx = wrpc.walletprocesspsbt(signer['psbt'])['psbt'] assert_equal(signed_t...
Python
1
import uuid from typing import TypedDict from sqlalchemy import sql import acoustid.tables as schema from .db import FingerprintDB class TrackInfo(TypedDict): gid: uuid.UUID disabled: bool async def list_tracks_by_mbid( db: FingerprintDB, mbid: uuid.UUID, include_disabled: bool = False ) -> list[Trac...
Python
1
error(StyleParseErrorKind::UnexpectedToken(token.clone()))), }; let url = BrowserUrl::parse(&value).map_err(|_err| input.new_custom_error(StyleParseErrorKind::UnspecifiedError))?; Ok(CssUrl { original: std::format!( "{}(\"{}\"{})", name, value, if modifiers.len() > 0 { std::format!( ...
Rust
0
from queue import PriorityQueue # Define the city map city_map = [ ['x', 'x', 'x', 3, 'x', 'x', 16, 'x', 2, 16, 3], [8, 'x', 8, 5, 'x', 'x', 10, 'x', 19, 4, 'x'], ['x', 'x', 18, 1, 16, 'x', 9, 15, 'x', 'x', 11], ['x', 'x', 17, 16, 4, 19, 2, 'x', 1, 11, 'x'], [9, 'x', 5, 16, 18, 'x', 'x', 7, 'x', 1...
Python
1
burnthrough_range = countermeasures.burn_through_range_escort(**kwargs) # Clear the axes for the updated plot self.axes1.clear() # Display the results self.axes1.plot(jammer_erp_vector, burnthrough_range, '') # Set the plot title and labels self.axes1.set_title('...
Python
1
expr), Switch(Box<Node>, Box<Node>, Vec<Node>), // Switch(cond, body, case_conds), Case(Box<Node>, Box<Node>), // Case(val, body), ArrIni(Vec<(Node, Node)>), // ArrIni(arrini), NULL, // NULL, } #[deri...
Rust
0
import pygame import pygame.gfxdraw from physics import PhysicsObject from ui_system import UI # Width of the simulator window WIDTH = 1280 # Height of the simulator window HEIGHT = 720 # Pygame initalization and setup of the screen pygame.init() screen = pygame.display.set_mode((WIDTH, HEIGHT)) clock = pygame.time....
Python
1
p>This is the <i>Lambda API Reference</i>. The Lambda Developer Guide provides additional //! information. For the service overview, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/welcome.html">What is //! Lambda</a>, and for information about how the service works, see <a href="https://docs.aws.amazon.com/l...
Rust
0
:validator::{validator_cmd_parse, ValidatorCommand}; use crate::wallet::{wallet_cmd_parse, WalletCommand}; use crate::wasm::{wasm_cmd_parse, WasmCommand}; use terra_rust_api::core_types::Coin; use terra_rust_api::{GasOptions, Terra}; use terra_rust_wallet::Wallet; /// VERSION number of package /// pub const VERSION: O...
Rust
0
// select source parser based on arguments let parser_type = config.value_of("PARSER").unwrap_or("XCOV"); let parser = parsers::Parser::new(parser_type, input); // run codacy::report( &parser.unwrap(), config.value_of("PREFIX").unwrap_or(""), config.value_of("OUTPUT...
Rust
0
, .. }) => panic!("Core::parse_field should not be called on unit"), Data::Struct(Fields { ref mut fields, .. }) => { fields.push(f); Ok(()) } Data::Enum(_) => panic!("Core::parse_field should never be called for an enum"), } } ...
Rust
0
# Zilog motion detector UART control # See http://www.zilog.com/docs/ps0305.pdf import serial ACK = 0x06 NACK = 0x15 def check_response(ser: serial.Serial): rsp = ser.read(1) if rsp[0] == NACK: raise ValueError("Received NACK") elif rsp[0] != ACK: raise SystemError(f"Unexpected response: ...
Python
1
3, left: None, right: None, }))), }))), }))), true), (Some(Rc::new(RefCell::new(TreeNode{ val: 1, left: Some(Rc::new(RefCell::new(TreeNode{ val: 2, ...
Rust
0
_connections(&self, filenames: Vec<&str>) -> Result<(bool, Vec<String>), dbus::Error> { self.method_call( "org.freedesktop.NetworkManager.Settings", "LoadConnections", (filenames,), ) } fn reload_connections(&self) -> Result<bool, dbus::Error> { self....
Rust
0
], identified_contracts: &BTreeMap<H160, (String, Abi)>, ) { let report_for_all = self.report_for.is_empty() || self.report_for.iter().any(|s| s == "*"); traces.iter().for_each(|trace| { self.analyze_trace(trace, identified_contracts, report_for_all); }); } fn an...
Rust
0
recipient recipients = [r.strip() for r in request.POST.getlist("recipients") if r.strip()] sender_account_id = request.POST.get("sender_email") # Basic validation / helpful errors if not user_accounts.exists(): context["error"] = "You have no email accounts configured." ...
Python
1
in there, // so optimistically pretend that we have that extra pixel! let rows = ((height as usize + 1) / dims.cell_height) as u16; let cols = ((width as usize + 1) / dims.cell_width) as u16; let tabs = self.get_tabs(); for tab in tabs.iter() { ...
Rust
0
Keysym(XKB_KEY_Execute); pub const Insert: Keysym = Keysym(XKB_KEY_Insert); pub const Undo: Keysym = Keysym(XKB_KEY_Undo); pub const Redo: Keysym = Keysym(XKB_KEY_Redo); pub const Menu: Keysym = Keysym(XKB_KEY_Menu); pub const Find: Keysym = Keysym(XKB_KEY_Find); pub const Cancel: Keysym = Keysym(XKB_KEY_Cancel); pub c...
Rust
0
pty() || !metadatas.contains_key("ring_id") || !metadatas.contains_key("username") { warn!("Remove task {} with id {} because no parameters were specified", module.name, task.id); let _ = Database::rm_task(&task.id); return; } let device = Database::get_device(&metad...
Rust
0
#!/usr/bin/env python import re import argparse pattern = r'^([\w\.]+) +(0x[0-9a-fA-F]+) +(0x[0-9a-fA-F]+)' def parse_map_file(map_file_path): components = [] mmap = False flash_start = 0 with open(map_file_path, 'r') as map_file: current_component = None for line in map_file: ...
Python
1
}, } } } #[async_trait] impl CommandTrait for IssueCommand { fn setting(&self) -> &CommandSetting { &self.setting } } enum IssueLabelUpdateType { Add, Remove, } async fn create_issues_info_to_update( repo_component: &(dyn IssueComponentTrait + Send + Sync), query: &str, ...
Rust
0
  S**S !a Sl 6:H FOOCO$D EB!b!!Jz!$$J  BGGRg  (v~&&-43Qn QD*F[D[&$WV^T%JKD 6'((.`!3F6!p %8"w""J %+$6$6!!*+X!YD$DL,, b"EK...
Python
1
>, { type Item = (Client, Connection<Socket, T::Stream>); type Error = Error; fn poll(&mut self) -> Poll<(Client, Connection<Socket, T::Stream>), Error> { let (client, connection) = try_ready!(self.0.poll()); Ok(Async::Ready((Client(client), Connection(connection)))) } } /// The futur...
Rust
0
/// Internal use: after building and correcting contexts, finally builds a /// phonetic variation of pronunciation. fn make_variation(&self, ctxs: &[Context]) -> Variation { let mut variation = Variation::default(); let mut syl_breaks = self.syl_breaks.iter().copied(); let mut curr_...
Rust
0
G2::G2Raw(g2) => { let mut tmp = [0u8; 96]; let cpt = g2.pt.into_compressed(); let me_ref = cpt.as_ref(); tmp.copy_from_slice(&me_ref[0..96]); tmp } G2::G2Cmpr(cmpr) => { let mut bytes = [...
Rust
0
from src.classes.agents.core.agent import Agent, AgentConfig, AgentResponse class ExampleAgent(Agent): """Minimal example agent - always responds with the same message.""" AGENT_CONFIG = AgentConfig( type="example", description="Simple text agent for demonstration purposes", log_name=...
Python
1
"Bit 2 - WDT Reset Flag The WDT reset flag is set by the 'Reset Signal' from the Watchdog Timer or Window Watchdog Timer to indicate the previous reset source. Note 1: Write 1 to clear this bit to 0. Note 2: Watchdog Timer register RSTF(WDT_CTL\\[2\\]) bit is set if the system has been reset by WDT time-out reset. Win...
Rust
0
while True: vehicle = input("Enter the name of a vehicle: ") if vehicle.lower() == "bus": print("finally the wait is over") break else: print("waiting")
Python
1
FileMovedEvent): """Handle file move/rename.""" if not event.is_directory: logger.info(f"File moved: {event.src_path} -> {event.dest_path}") asyncio.create_task(self._process_event(FileEventType.MOVED, event.src_path, event.dest_path)) class GenpodFileWatcher: def __init__(s...
Python
1
from fastapi import APIRouter, HTTPException, BackgroundTasks, Depends from ..models.schemas import ScrapeRequest, CrawlRequest from core.crawler import ScrapesterCrawler from typing import Dict, List import asyncio router = APIRouter() crawler = None async def get_crawler(): global crawler if crawler is Non...
Python
1
dify--write-api).\n\nFor information about available fields see [batmonp0](batmonp0) module"] pub type BATMONP0 = crate::Reg<u32, _BATMONP0>; #[allow(missing_docs)] #[doc(hidden)] pub struct _BATMONP0; #[doc = "`read()` method returns [batmonp0::R](batmonp0::R) reader structure"] impl crate::Readable for BATMONP0 {} #[...
Rust
0
ing_type=None, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ ], options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=298, serialized_end=305, ) _CAPABILITY.fields_by_name['value'].message_type = mysqlx__datatypes__pb2._ANY _CAPA...
Python
1
emini AI and display response.""" prompt = self.chat_entry.get() if not prompt: return self.chat_log.config(state=tk.NORMAL) self.chat_log.insert(tk.END, f"You: {prompt}\n") self.chat_entry.delete(0, tk.END) try: genai.configure( ap...
Python
1
# 确保车次中所有运单的状态一致, 并处于"已配载"或"货场配载"状态 try: waybills_status = to_obj_waybills.order_by("status").values("status").distinct() assert len(waybills_status) == 1 waybills_status = waybills_status[0]["status"] if is_logged_user_is_goods_yard(self.request): ...
Python
1
# ===-- vec3.py -----------------------------------------------------------===## # # The KLEE Symbolic Virtual Machine # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # # ===------------------------------------------------------...
Python
1
# default arguments of the function def disp(var1,var2=20): print(var1,"\t",var2) def fun(): disp(10) disp(100,200) fun()
Python
1
hing { super_number, inner_thing: inner_thing.clone(), }; <SuperThingsBySuperNumbers<T>>::insert(super_number, super_thing); Self::deposit_event(RawEvent::NewSuperThingByExistingInner(super_number, inner_thing.number, inner_thing.hash, inner_thing.bala...
Rust
0
dex, f, indent=2, sort_keys=True) print("Model weights saved in {}".format(output_dir)) return str(torch_dtype).replace("torch.", "") def save_config(input_dir: str, output_dir: str, torch_dtype: str): with open(os.path.join(input_dir, CONFIG_NAME), "r", encoding="utf-8") as f: qwen_config_di...
Python
1
o_ignore.contains(&comment.lo()) { continue; } } if comment.start_line_fast(program) < node_start_line { return Some(comment); } } None } pub fn has_surrounding_comments(node: &Node, program: &Program) -> bool { !node.leading_comments_fast(program).is_empty() || !node.trailing_c...
Rust
0
### print("Check inputs", flush=True) assert re.match("[a-z][a-z0-9_]*", par["name"]), "Name should match the regular expression '[a-z][a-z0-9_]*'. Example: 'my_component'." assert len(par['name']) <= 50, "Method name should be at most 50 characters." pretty_name = re.sub("_", " ", par['name']).title() ####...
Python
1
[0]), u32x4(K32[7], K32[6], K32[5], K32[4]), u32x4(K32[11], K32[10], K32[9], K32[8]), u32x4(K32[15], K32[14], K32[13], K32[12]), u32x4(K32[19], K32[18], K32[17], K32[16]), u32x4(K32[23], K32[22], K32[21], K32[20]), u32x4(K32[27], K32[26], K32[25], K32[24]), u32x4(K32[31], K32[30], K32[29], K...
Rust
0
_annual_report_mock_users_required_signers_gold_standard(project_id); // Create new acc with owner role let new_owner_id = create_user_with_owner_role(); let is_owner = EvercityAccounts::account_is_cc_project_owner(&new_owner_id); let owner_sign_result = CarbonCredits::sign_last...
Rust
0
<'a, [T]>>; /// Error that can happen when creating a vertex buffer. #[derive(Copy, Clone, Debug)] pub enum CreationError { /// The vertex format is not supported by the backend. /// /// Anything 64bits-related may not be supported. FormatNotSupported, /// Error while creating the vertex buffer. ...
Rust
0
ounds=(0, 0.02), margin=0.5, sigmoid='long_tail', ) ready_to_lift = reward_utils.hamacher_product(above_floor, in_place) # now actually put the lid on the box pos_error = target_pos - lid error_scale = np.array([1., 1., 3.]) # Emphasize Z error a...
Python
1
from typing import List, Set, Tuple from ray.autoscaler._private import constants class NodeTracker: """Map nodes to their corresponding logs. We need to be a little careful here. At an given point in time, node_id <-> ip can be interchangeably used, but the node_id -> ip relation is not bijective _...
Python
1
fn next( &mut self ) -> Option< Self::Item > { map_iter_next( &self.iter ) } } impl IntoIterator for $map_name { type Item = (String, $item_name); type IntoIter = $iter_name; #[inline] fn into_iter( self ) -> Self::IntoIter {...
Rust
0
#!/usr/bin/env python # Python script that converts SQL dump data to an org table. # Inverse of org2dbdump.py # # usage: sqlite3 <db> .dump | dbdump2org.py > <org-file> # # Copyright (c) 2007-2018 Carnegie Mellon University. All Rights Reserved. # See COPYRIGHT file for details. import sys import re import csv # Tra...
Python
1
.random(buf) .map_err(|_| Error::CryptoError(String::from("Can't generated random Bytes"))) } } <filename>crobat/src/lib.rs pub mod crobat { include!("../proto/pb/proto.rs"); } extern crate pretty_env_logger; #[macro_use] extern crate log; use crobat::crobat_client::CrobatClient; use crobat::Que...
Rust
0
# app/routes.py import openai from openai import OpenAI from dotenv import load_dotenv import os import subprocess from flask import Blueprint, render_template, request, send_file from flask import current_app, jsonify from markupsafe import Markup from .utils import process_zip_file from .generate_file import code_er...
Python
1
s(&self) -> Result<()> { loop { match self.rx.try_recv() { Ok(Action::Add(k, v)) => { self.hashmap.borrow_mut().insert(k, v); } Ok(Action::Remove(k)) => { self.hashmap.borrow_mut().remove(&k); } ...
Rust
0
if styles_offset == 0 { styles_offset = chunk_size; } let mut char_buffer_size = styles_offset - strings_offset; if char_buffer_size % 4 != 0 { return Err(AxmlError::InvalidStringBlockSize); } let mut char_buffer = vec![0; char_buffer_size as ...
Rust
0
############################################################################# # Test create_explain_matrix ############################################################################### @pytest.mark.parametrize( "w_cat, w_cont, embed_continuous", [ (True, True, False), (True, True, True), ...
Python
1
from fastapi import APIRouter, HTTPException from repository.repositories import NoteRepo from models.notes import Note, Response routerr = APIRouter() @routerr.get("/notes") async def all_notes(): _notelist = await NoteRepo.retrieve() if _notelist: return Response(code=200, status="Ok", message="S...
Python
1
(r.bits() | (0b11 << Self::OFFSET)) }); $PXi(PhantomData) } /// Configures the PIN to operate as Input Pin according to Mode. pub fn into_input<Mode: PullMode>(self) -> $PXi<Input<Mode>> { let mut moder: MODER<$GPIOX> = MODER(PhantomData); ...
Rust
0
let header = DiffHeader(); let header_str1 = format!("{}", header); for word in &["archive", "timestamp", "value_a", "value_b"] { assert!(header_str1.contains(word), "should contains {}", word); } let header_str2 = format!("{:#}", header); for word in &["archiv...
Rust
0
expected_output = { 'GigabitEthernet0/0/2': { 'description': 'None', 'signal_type': 'NA', 'mode': 'Synchronous (Ql-enabled)', 'esmc_tx': 'ENABLED', 'esmc_rx': 'ENABLED', 'ql_receive': 'QL-DNU', 'ql_receive_configured': '-', 'ql_receive_overrided': '-',...
Python
1
binerBiasNV = GLenum; /// /// * [`GL_ALPHA`] /// * [`GL_BLUE`] /// * [`GL_RGB`] pub type CombinerComponentUsageNV = GLenum; /// /// * [`GL_EXPAND_NEGATE_NV`] /// * [`GL_EXPAND_NORMAL_NV`] /// * [`GL_HALF_BIAS_NEGATE_NV`] /// * [`GL_HALF_BIAS_NORMAL_NV`] /// * [`GL_SIGNED_IDENTITY_NV`] /// * [`GL_SIGNED_NEGATE_NV`] //...
Rust
0
pub struct Model; #[derive(Clone)] struct Widgets { header_bar: HeaderBar, window: Window, } struct Win { _model: Model, widgets: Widgets, } impl Update for Win { type Model = Model; type ModelParam = (); type Msg = Msg; fn model(_: &Relm<Self>, _: ()) -> Model { Model {} ...
Rust
0
}; } } impl<'a> Mockable<'a> { fn generate_foreign_contract_mock(&self, interface_ident: &Ident) -> TokenStream2 { let interface = self.interface; let span = interface.span; let (trivial_mocks, overriding_fns): (Vec<_>, Vec<_>) = interface.foreign_fns.iter().partition_map(|...
Rust
0
_inputs: Option<Vec<String>>, now: &F, ) -> (Console, Rc<RefCell<WriteStorage>>) where F: Fn() -> SystemTime, { let mock_writer = MockWriter::new(); let mock_reader = MockReader::new(reader_inputs.unwrap_or(vec![])); let storage = Rc::clone(&mock_writer.storage); ...
Rust
0
#MenuTitle: Gemstones # -*- coding: utf-8 -*- __doc__=""" Gemstones """ from NaNGFAngularizzle import ConvertPathsToSkeleton, setGlyphCoords from NaNGFGraphikshared import AddAllPathsToLayer, ClearPaths, ConvertPathlistDirection, retractHandles from NaNGlyphsEnvironment import GSNode, GSLINE from NaNFilter import NaNF...
Python
1
lpfn_connectex let ret = setsockopt(sock, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, ptr::null(), 0); if ret == SOCKET_ERROR { let err = WSAGetLastError(); return Err(io::Error::from_raw_os_error(err)); } } Ok(()) } impl AsyncWrite for TcpStream { fn poll_write(...
Rust
0
{ normalized.replace_range(range, " "); } normalized.into() } fn escape_and_insert_regex_sections(mut s: &str) -> anyhow::Result<String> { let mut result = String::new(); loop { s = if let Some(regex_section_begin) = s.find("@{") { // Escape the none-regex part ...
Rust
0
dof.enable_angular_motor(); } else if dof.offset() > 0.0 { dof.disable_angular_motor(); } } }); testbed.add_callback(move |world, _, _| { /* * Activate the pin-slot joint linear motor if it is to low. */ // Might be N...
Rust
0
struct SHADOW_RESULT_CORE__SIGNAL_TOTAL_EVENTS_SD1_0(u8); impl Debug; u8; pub get, set: 0; } bitfield! { #[derive(Clone, Copy, Eq, Hash, PartialEq)] pub struct SHADOW_RESULT_CORE__TOTAL_PERIODS_ELAPSED_SD1(u32); impl Debug; u32; pub get, set: 31, 0; } bitfield! { #[derive(Clone, C...
Rust
0
Digit], rules2[&BinDigitVariable::BinDigit] ); assert_eq!( rules[&BinDigitVariable::One], rules2[&BinDigitVariable::One] ); } } <gh_stars>0 fn product_fib(p: u64) -> (u64, u64, bool) { let mut x: u64 = 0; let mut y: u64 = 1; while x * y < p { ...
Rust
0
fo: LPWSAPROTOCOL_INFOA, lpszAddressString: LPSTR, lpdwAddressStringLength: LPDWORD, ) -> INT; pub fn WSAAddressToStringW( lpsaAddress: LPSOCKADDR, dwAddressLength: DWORD, lpProtocolInfo: LPWSAPROTOCOL_INFOW, lpszAddressString: LPWSTR, lpdwAddressStringLen...
Rust
0
def caught_speeding(speed, is_birthday): if is_birthday: speed -= 5 if speed <= 60: return 0 elif speed >= 81: return 2 elif 80 >= speed >= 61: return 1
Python
1
vec_uninit( (m * m) as usize) }), FlagSVD::No => None, }; let n = l.len(); let mut vt = match jvt { FlagSVD::All => Some(unsafe { vec_uninit( (n * n) as usize) }), FlagSVD::No => None, }; ...
Rust
0
#!/usr/bin/python3 """Module pour générer le triangle de Pascal""" def pascal_triangle(n): """Génère le triangle de Pascal jusqu'à la n-ième ligne""" if n <= 0: return [] triangle = [[1]] for i in range(1, n): row = [1] for j in range(1, i): row.append(triangle...
Python
1
encoding_format="jpeg", ), "low_cam_image": tfds.features.Image( shape=(256, 256, 3), dtype=np.uint8, encoding_format="jpeg", ...
Python
1
ID = u64; pub(crate) type VersionID = u64; /// Avoid making mistakes between branch name and version name. #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct BranchName<'a>(pub &'a [u8]); #[derive(Clone, Debug, Eq, PartialEq, Default)] pub struct BranchNameOwned(pub Vec<u8>); /// Avoid making mistakes between bra...
Rust
0
0; h0 -= carry0 << 26; Fe([h0 as i32, h1 as i32, h2 as i32, h3 as i32, h4 as i32, h5 as i32, h6 as i32, h7 as i32, h8 as i32, h9 as i32]) } pub fn is_nonzero(&self) -> bool { CtEqual::ct_ne(&self.to_bytes(), &[0; 32]).into() } pub fn is_negative(&self) -> bool { (s...
Rust
0