text string | label_name string | labels int64 |
|---|---|---|
#!/usr/bin/env python3
"""
创建一个简单的 ICO 图标文件
"""
import struct
def create_simple_ico():
# 创建一个简单的 16x16 像素的 ICO 文件
# ICO 文件头
ico_header = struct.pack('<HHH', 0, 1, 1) # 保留字段, 类型(1=ICO), 图像数量
# 图像目录条目
width = 16
height = 16
colors = 0 # 0 表示 256 色或更多
reserved = 0
planes = 1
... | Python | 1 |
from langchain_community.tools.gmail.base import GmailBaseTool
__all__ = ["GmailBaseTool"]
| Python | 1 |
ub emergency: Option<VaultPresignedTransaction<EmergencyTransaction>>,
pub unvault_emergency: Option<VaultPresignedTransaction<UnvaultEmergencyTransaction>>,
}
/// Contains the transactions that have been broadcasted for a specific vault
#[derive(Debug)]
pub struct VaultOnchainTransactions {
pub outpoint: OutP... | Rust | 0 |
ires_hi::R) reader structure"]
impl crate::Readable for CRC32INIRES_HI {}
#[doc = "`write(|w| ..)` method takes [crc32inires_hi::W](crc32inires_hi::W) writer structure"]
impl crate::Writable for CRC32INIRES_HI {}
#[doc = "CRC32 Initialization and Result, upper 16 bits"]
pub mod crc32inires_hi;
#[doc = "CRC32 Result Rev... | Rust | 0 |
r) => {
let is_long = searcher.memory == usize::MAX;
// write out `true` and `false`, like `next_match`
if is_long {
searcher.next_back::<MatchOnly>(self.haystack.as_bytes(),
self.needle.as_bytes(),
... | Rust | 0 |
, pe1) = self.lower_expr(e1, ExpectExpr::Any);
let ty = e1.ty();
let (e2, pe2) = self.lower_expr(e2, ExpectExpr::HasTy(ty));
return ret![
hir::ExprKind::Eq(ty, op == types::Binop::Ne, Box::new(e1), Box::new(e2)),
pe1.and_then(|pe1| Ok(intern!(self, ExprKind::Binop(o... | Rust | 0 |
# Copyright (c) 2025 Intel Corporation
# 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 writ... | Python | 1 |
if echo_path:
for _, file_path, song_id_ in fs.yield_music_files():
if song_id_ == song_id:
print(file_path)
elif echo_database:
prepare_db()
song = Song.get(Song.id == song_id)
import pprint
pprint.pprint(song.__data__)
else:
prin... | Python | 1 |
ngfuse_public_key = standard_callback_dynamic_params.get("langfuse_public_key")
dynamic_langfuse_secret_key = standard_callback_dynamic_params.get("langfuse_secret_key")
if dynamic_langfuse_public_key and dynamic_langfuse_secret_key:
auth_header = LangfuseOtelLogger._get_langfuse_authorizati... | Python | 1 |
memory[out as usize], out);
pointer += 2;
}
4 => {
let a = get_val(mode_1, pointer + 1, memory.to_vec());
println!("4@{} output> {}", pointer, a);
pointer += 2;
}
5 => {
let a = get_val(mode_... | Rust | 0 |
, right_value: r, instruction: i};
let span = Span { left, right };
validator.met_match(&match_, span);
Box::new(Instruction::Match(match_))
}
}
#[allow(unused_variables)]
fn __action12<
'err,
'input,
'v,
>(
input: &'input str,
errors: &'err mut Vec<ErrorRecovery<usize,... | Rust | 0 |
value,
self.tracer.config.record_samples_for_structs,
)
}
}
pub struct StructVariantSerializer<'a> {
tracer: &'a mut Tracer,
samples: &'a mut Samples,
name: &'static str,
variant_index: u32,
variant_name: &'static str,
fields: Vec<Named<Format>>,
values:... | Rust | 0 |
labels: &[S]) -> Vec<Vec<EncodingProb<D::Encoding>>>
where
S: AsRef<[EncodingProb<usize>]>,
{
labels
.iter()
.map(|encoding_probs| {
encoding_probs
.as_ref()
.iter()
.map(|encoding_prob| {
... | Rust | 0 |
id=user_id, active=active)
if associations:
serialiser = AllocationAssociationSchema()
return serialiser.dump(associations, many=True)
current_app.logger.error("Could not find any applications associated with user %(user_id)s", dict(user_id=user_id))
abort(404)
@assessment_user_bp.get("/u... | Python | 1 |
= torch.cat(param2_flat_list)
sim = F.cosine_similarity(param1_combined, param2_combined, dim=0)
return sim.item()
else:
return 0.0
def log_model_similarities(self):
sim_m1_m2 = self.calculate_model_similarity(self.model1, self.model2)
sim_m1_gwm = self.... | Python | 1 |
[Vertex]) -> Result<VertexBuffer> {
VertexBuffer::with_usage(ctx, vertices, BufferUsage::Dynamic)
}
/// Creates a new vertex buffer, with the specified usage hint.
///
/// The GPU may optionally use the usage hint to optimize data storage and access.
///
/// # Errors
///
/// * [... | Rust | 0 |
star(old_address),
pass_usize(old_size),
pass_usize(new_size),
c_uint(flags.bits()),
void_star(new_address),
))
}
/// # Safety
///
/// `mlock` operates on raw pointers and may round out to the nearest page
/// boundaries.
#[inline]
pub(crate) unsafe fn mlock(addr: *mut c::c_void, le... | Rust | 0 |
sk])
index_median_dist_cent = np.median(rna_distance_cent) / expected_distance
features = (index_mean_dist_cent, index_median_dist_cent)
# compute proportion of mRNAs next to the centrosomes (<2000nm)
radius = int(2000 / voxel_size_yx)
if radius < 1:
warnings.warn(UserWarning, "'voxel_size... | Python | 1 |
f`
const SINE_RULE: Rule<'a> = RightRule {
first: First {
lhs: E::T(TerminalSymbol::Original(Str("sin"))),
rhs: E::V(Factor),
},
second: Second(E::T(TerminalSymbol::Metasymbol(Failure))),
};
/// Cosine = "cos" Factor / f
const COSINE_RULE: Rule<'a> = Righ... | Rust | 0 |
# Generated by Django 5.1.6 on 2025-03-10 08:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('aap_api', '0006_rename_total_records_zipupload_records_imported_and_more'),
]
operations = [
migrations.AlterField(
model_name='... | Python | 1 |
) -> Entity {
match config {
CameraConfig::Unreal(config) => create_unreal_camera_entity(commands, config, eye, target),
CameraConfig::Orbit(config) => create_orbit_camera_entity(commands, config, eye, target),
}
}
pub struct CameraPlugin;
impl Plugin for CameraPlugin {
fn build(&self, app... | Rust | 0 |
import qutip as qt
def spin_spin_correlation(psi, qubits):
# Compute spin-spin correlation between first qubit and its double
#for get a better idea please check perturbation_function
op = qt.tensor([qt.sigmaz()] + [qt.qeye(2)] * (qubits - 1) + [qt.sigmaz()] + [qt.qeye(2)] * (qubits - 1))
return qt.ex... | Python | 1 |
import os
import xbmcaddon
from xbmcvfs import translatePath
from resources.lib.utils import kill
# siehe Zeile 51
addonInfo = xbmcaddon.Addon().getAddonInfo
addonId = addonInfo('id')
addonVersion = addonInfo('version')
def starter2():
root_path = translatePath(os.path.join('special://home/addons/', '%s'))
a... | Python | 1 |
import json
import os.path
import fire
from paddleocr import PaddleOCR
import re
from tqdm import tqdm
from easyrag.utils.mllm_utils import glm4v_generate
def contains_chinese(s):
return bool(re.search(r'[\u4e00-\u9fff]+', s))
ocr = PaddleOCR(use_angle_cls=True, lang="ch") # need to run only once to downloa... | Python | 1 |
try:
# 構建請求
url = f"{self.n8n_url}/rest/workflows/{workflow_id}"
headers = {"X-N8N-API-KEY": self.api_key}
# 發送請求
response = requests.put(url, headers=headers, json=workflow)
# 檢查響應
if response.status_code == 200:
... | Python | 1 |
//#[cfg(feature = "tangle")]
pub mod client;
<gh_stars>1-10
pub mod bound;
pub mod data;
pub mod gltf;
pub mod imgui;
pub mod model;
pub mod renderer;
pub mod resources;
pub mod scene;
pub mod texture;
pub mod window;
mod data_uri;
mod layer;
pub use layer::{CallOrder, EventResult, Layer};
mod main_loop;
pub use mai... | Rust | 0 |
());
let missing_score = (0..missing_rolls).into_iter().fold(0u16, |total, idx| {
total
+ u16::from(
first_score_loop
[usize::from(idx % u16::try_from(first_score_loop.len()).unwrap())],
)
});
first... | Rust | 0 |
{
format!("{}/", router.prefix())
} else {
String::new()
};
for el in &self.elements {
match *el {
PatternElement::Str(ref s) => path.push_str(s),
PatternElement::Var(_) => {
if let Some(val) = iter.next() {... | Rust | 0 |
isinstance(model, Model) else Model.load(model)
#construct Classifier class
clf = classifier.Classifier(filename = filename, model = lr_classifier, transpose = transpose_input, gene_file = gene_file, cell_file = cell_file)
#predict
predictions = clf.celltype(mode = mode, p_thres = p_thres)
if not ma... | Python | 1 |
"""
Example sentences to test spaCy and its language models.
>>> from spacy.lang.sl.examples import sentences
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"Apple načrtuje nakup britanskega startupa za 1 bilijon dolarjev",
"France Prešeren je umrl 8. februarja 1849 v Kranju",
"Staro ljubljansko letali... | Python | 1 |
, |sum, next| sum + *next)
add eax, dword, ptr, [r8]
intrinsics::offset(self, count) (libcore\ptr.rs:622)
add r8, 4
if self.ptr == self.end { (libcore\slice\mod.rs:1178)
cmp rcx, r8
jne .LBB14_14
.LBB14_15:
}
pop rbp
ret
"#
} else {
unimplemented!()
};
... | Rust | 0 |
push_page_msg(tag: BufferTag, base_img: &[u8], buf: &mut Vec<u8>) {
assert!(base_img.len() == 8192);
let len = 4 + 1 + 4 * 4 + base_img.len();
buf.put_u8(b'P');
buf.put_u32(len as u32);
tag.ser_into(buf)
.expect("serialize BufferTag should always succeed");
buf.put(base_img);
}
fn bui... | Rust | 0 |
_base_ = 'mobilenet-v3-large_8xb32_in1k.py'
_deprecation_ = dict(
expected='mobilenet-v3-large_8xb32_in1k.py',
reference='https://github.com/open-mmlab/mmclassification/pull/508',
)
| Python | 1 |
"""
Chickmaster 코어 패키지
비즈니스 도메인 모델과 포트 인터페이스를 포함합니다.
"""
| Python | 1 |
eader {
pub fn new(frame: Frame,
frame_address: FrameAddress,
protocol_header: ProtocolHeader)
-> Header {
Header {
frame,
frame_address,
protocol_header,
}
}
}
#[derive(Debug)]
pub struct Frame {
// First 2 by... | Rust | 0 |
else { set(signals, z, !signals[x]); }
}
}
}
}
fn part1(input: &str) -> u16 {
let mut signals = BTreeMap::new();
simulate(&parse_circuit(input), &mut signals);
signals["a"]
}
fn part2(input: &str) -> u16 {
let circuit = parse_circuit(input);
let mut signals = BT... | Rust | 0 |
async fn begin_tx(&self) -> Result<Transaction<'static, Postgres>>;
}
// MakAir Telemetry
//
// Copyright: 2020, <NAME>
// License: Public Domain License
use crate::structures::*;
pub fn compute_duration(messages: Vec<TelemetryMessage>) -> u32 {
let mut duration: u32 = 0;
for message in &messages {
... | Rust | 0 |
from typing import Tuple
from pyspark.sql import DataFrame
from ydata_profiling.config import Settings
from ydata_profiling.model.summary_algorithms import describe_counts
@describe_counts.register
def describe_counts_spark(
config: Settings, series: DataFrame, summary: dict
) -> Tuple[Settings, DataFrame, dict... | Python | 1 |
#! /usr/bin/env python3
"Replace tabs with spaces in argument files. Print names of changed files."
import os
import sys
import getopt
import tokenize
def main():
tabsize = 8
try:
opts, args = getopt.getopt(sys.argv[1:], "t:")
if not args:
raise getopt.error("At least one file ar... | Python | 1 |
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
#
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
#
# This software may be modified and distributed under the terms of
# the 3-Clause BSD License. See the LICENSE file in the package base
# directory for details.
impor... | Python | 1 |
# Copyright 2025 Google LLC
#
# 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 |
self.vao.draw_elements(shader, font);
Ok(())
}
}
use self::JoypadKey::*;
use crate::irq::{Interrupt, IrqHandler};
use crate::memory::Memory;
pub const JOYPAD_ADDRESS: u16 = 0xFF00;
pub const JOYPAD_KEYS: [&'static str; 8] =
["Up", "Down", "Left", "Right", "Select", "Start", "A", "B"];
pub const JOYPAD_... | Rust | 0 |
}
pub const L_tmpnam: ::c_uint = 14;
pub const TMP_MAX: ::c_uint = 0x7fff;
extern {
pub fn strcasecmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int;
pub fn strncasecmp(s1: *const ::c_char, s2: *const ::c_char,
n: ::size_t) -> ::c_int;
}
mod example {
use bitflags::bitflags;
... | Rust | 0 |
boxes is not None:
x0, y0, x1, y1 = boxes[i]
# if drawing boxes, put text on the box corner.
text_pos = (x0, y0)
horiz_align = "left"
elif masks is not None:
x0, y0, x1, y1 = masks[i].bbox()
... | Python | 1 |
i),
&mut output.index_axis_mut(Axis(0), i),
&mut aggs,
);
}
}
Ok(output)
}
fn eval_1d<'i, A, T>(&self, input: &ArrayView1<T>) -> TractResult<Array1<f32>>
where
A: AggregateFn,
T: AsPrimitive<f32>,
{
... | Rust | 0 |
from llm_api.qwen.tools import *
from llm_api.qwen.qwen_model import *
device = "cuda"
def build_planning_prompt(TOOLS, query):
tool_descs = []
tool_names = []
for info in TOOLS:
tool_descs.append(
TOOL_DESC.format(
name_for_model=info['name_for_model'],
n... | Python | 1 |
from .overlay import OverlayManager
class VoiceAssistantApp(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Voice Assistant")
self.setGeometry(100, 100, 800, 600)
# Initialize overlay manager
self.overlay_manager = OverlayManager()
... | Python | 1 |
_data = tx.user_data::<HybridParsing_Get_User_Data>().unwrap();
assert_eq!(1, user_data.callback_RESPONSE_HEADERS_invoked);
// Response complete
t.connp.state_response_complete_ex(1).unwrap();
let tx = t.connp.tx(tx_id).unwrap();
let user_data = tx.user_data::<HybridParsing_Get_User_Data>().unwrap(... | Rust | 0 |
#[derive(Debug, ShapeAccessors, SmartDefault)]
pub struct Cube {
#[default(_code = "shape::new_shape_id()")]
pub id: u32,
#[default(Weak::<Self>::new())]
pub parent: Weak<dyn Shape>,
#[default(Matrix::identity(4))]
pub transform: Matrix,
#[default(Material::default())]
pub material: Mate... | Rust | 0 |
import pandas as pd
def extrage_date_bilant(df):
cpa20 = f"{df.iloc[76, 1]:.2f}"
cpa21 = f"{df.iloc[76, 2]:.2f}"
cpa22 = f"{df.iloc[76, 3]:.2f}"
data = {
"Capitalul propriu al actionarilor 2020": cpa20,
"Capitalul propriu al actionarilor 2021": cpa21,
"Capitalul propriu al... | Python | 1 |
= self.map_.get(mapname)?;
// if it's just one map without any keys, return map.
// this can only happen for LUA maps.
if maps.len() == 1 && maps[0].key.is_none() && maps[0].keys.len() == 0 {
return Some((&maps[0], key));
}
// find first map with a matching key.
... | Rust | 0 |
}
impl TryFrom<&[u8]> for Ulid {
type Error = DecodingError;
/// Returns a ULID for the given slice of bytes or `DecodingError::InvalidLength`
/// if the slice does not contain exactly 16 bytes.
///
/// # Examples
///
/// ```
/// use rusty_ulid::Ulid;
/// use std::convert::TryFrom... | Rust | 0 |
from bs4 import BeautifulSoup
# Read the HTML file
with open("index.html", "r") as file:
html_content = file.read()
# Parse the HTML content
soup = BeautifulSoup(html_content, "html.parser")
# Find the input field by its name attribute
input_field = soup.find("input", {"name": "inp_name"})
# Update the value of... | Python | 1 |
"""
Classifies: CHEBI:62499 methyl-branched fatty acid
"""
from rdkit import Chem
def is_methyl_branched_fatty_acid(smiles: str):
"""
Determines if a molecule is a methyl-branched fatty acid based on its SMILES string.
A methyl-branched fatty acid must have a carboxylic acid group and only methyl branches.... | Python | 1 |
'''Default Argument'''
def sayHello(nama = "Otong"):
print(f"Hello, {nama}")
sayHello("Ucup") | Python | 1 |
# ----------------------------------------------------------------------------
# Title: Scientific Visualisation - Python & Matplotlib
# Author: Nicolas P. Rougier
# License: BSD
# ----------------------------------------------------------------------------
import numpy as np
import matplotlib.pyplot as plt
# Setup... | Python | 1 |
flateEnd as mz_deflateEnd;
pub use self::z::inflateEnd as mz_inflateEnd;
pub use self::z::deflateReset as mz_deflateReset;
pub use self::z::deflate as mz_deflate;
pub use self::z::inflate as mz_inflate;
pub use self::z::z_stream as mz_stream;
pub use self::z::Z_BLOCK as MZ_BLOCK;
pub use se... | Rust | 0 |
i32;
pub fn dx_Live2D_Model_GetMotionFadeInTimeValue(
Live2DModelHandle: i32,
groupName: *const i8,
index: i32,
) -> f32;
pub fn dx_Live2D_Model_GetMotionFadeInTimeValueWithStrLen(
Live2DModelHandle: i32,
groupName: *const i8,
groupNameLength: usize,
... | Rust | 0 |
import warnings
import torch
from torch import nn
from torchvision.ops import RoIPool
warnings.filterwarnings("ignore")
class VGG16RoIHead(nn.Module):
def __init__(self, n_class, roi_size, spatial_scale, classifier):
super(VGG16RoIHead, self).__init__()
self.classifier = classifier
#-----... | Python | 1 |
rait_value)?)),
"user" => Some(TdType::User(serde_json::from_value(rtd_trait_value)?)),
"userFullInfo" => Some(TdType::UserFullInfo(serde_json::from_value(
rtd_trait_value,
)?)),
"userPrivacySettingRules" => Some(TdType::UserPrivacySettingRules(serde_json::from_value(
... | Rust | 0 |
{
Ok(args) => Ok(args),
Err(err) => Err(err),
}
}
// UNIT TESTS /////////////////////////////////////////////////////////////////////////////
#[cfg(test)]
mod tests {
use super::*;
use crate::{
commands::alias::error::ErrorKind,
test::{alias::*, os::TestValidOsDirs},
}... | Rust | 0 |
finite differences
for i in 0..3 {
let mut p = a;
p[i] += EPS;
assert_ulps_eq!((cell.angle(&p, &b, &c) - angle) / EPS, d1[i], epsilon = 1e-6);
}
for i in 0..3 {
let mut p = b;
p[i] += EPS;
assert_ulps_eq!((cell.angle(&a, &... | Rust | 0 |
from itertools import repeat
def insertion_sort(A, p, r):
for j in range(p + 1, r + 1):
key = A[j]
i = j - 1
while i >= p and A[i] > key:
A[i + 1] = A[i]
i = i - 1
A[i + 1] = key
def merge(A, p, q, r):
n1 = q - p + 1
n2 = r - q
L = list(repeat(N... | Python | 1 |
Generation")
clarification = repair.generate_clarification(
"unclear_item",
{"item": "Crunchy Taco"}
)
print(f"Clarification: {clarification}\n")
# Test confusion detection
print(f"{Fore.CYAN}Test 3: Confusion Detection")
confused_text = "Wait, I don't understand"
is_co... | Python | 1 |
"message": "Session title updated successfully",
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Gmail Integration",
"updated_at": "2024-01-15T11:30:00Z"
}
}
class RegenerateTitleResponse(BaseModel):
"""Response mode... | Python | 1 |
"""
PointNet++ Model for point clouds classification
"""
import os
import sys
BASE_DIR = os.path.dirname(__file__)
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tensorflow as tf
import numpy as np
import tf_util
from pointnet_util import pointnet_sa_module
# NUM_CLASSES = 40... | Python | 1 |
o()
spinner_proto.text = clean_text(text)
message._enqueue("spinner", spinner_proto)
_add_script_run_ctx(_threading.Timer(DELAY_SECS, set_message)).start()
# Yield control back to the context.
yield
finally:
if display_message... | Python | 1 |
ptions"] == [
"preferred",
"Home Assistant",
pipeline_1.name,
pipeline_2.name,
]
# Change select to new pipeline
await hass.services.async_call(
"select",
"select_option",
{
"entity_id": "select.assist_pipeline_test_prefix_pipeline",
... | Python | 1 |
/linux/man-pages/man2/close.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/close.2.html#//apple_ref/doc/man/2/close
///
/// # Safety
///
/// This function takes a `RawFd`, which must be valid before the call, and is
/// not valid after the call.
#[... | Rust | 0 |
client = GraphServiceClient(
credential,
scopes=["https://graph.microsoft.com/.default"],
)
# Step 1: Sync applications
app_batch_size = 10 # Batch size for applications
apps_batch = []
total_app_count = 0
# Stream and load applications
async for app in get_entra_appl... | Python | 1 |
:Result<Op<Open>> {
use io_uring::{opcode, types};
// Here the path will be copied, so its safe.
let path = driver::util::cstr(path.as_ref())?;
let flags = libc::O_CLOEXEC | options.access_mode()? | options.creation_mode()?;
Op::submit_with(Open { path }, |open| {
o... | Rust | 0 |
ix_engine::prelude::*;
/// let from = rgb!(255, 0, 0);
/// let to = rgb!(0, 100, 255);
/// let lerped = from.lerp(to, 0.5);
/// assert_eq!(lerped.channels(), [128, 50, 128, 255]);
///
/// let from = rgb!(255, 0, 0);
/// let to = hsb!(120.0, 80.0, 100.0, 0.5);
/// let lerped = from.lerp(t... | Rust | 0 |
name": "kevin" },
{ "name": "bob", "age": 20 }
]"#[..];
let mut builder = IndexDocuments::new(&mut wtxn, &index, 0);
builder.update_format(UpdateFormat::Json);
builder.execute(content, |_, _| ()).unwrap();
wtxn.commit().unwrap();
let rtxn = index.read_txn().u... | Rust | 0 |
, 0, 3, 5, 1], // base cell 106
bc7![0, -1, 3, 0, 5, 2, 0], // base cell 107 (pentagon)
bc7![0, 5, 0, 0, 5, 5, 0], // base cell 108
bc7![0, 0, 1, 0, 4, 5, 1], // base cell 109
bc7![0, 3, 3, 3, 0, 0, 0], // base cell 110
bc7![0, 0, 0, 3, 0, 5, 0], // base cell 111
bc7![0, 0, 0, 3, 0, 5, 0], ... | Rust | 0 |
"""draw_centered_circle
"""
import turtle
def draw_centered_regular_polygon(t, centre=(0, 0), radius=10, sides=4, penw=1, penc="black", fillc=None):
t.pu()
t.goto(centre)
t.seth(0)
t.fd(radius)
t.seth(90)
t.pensize(penw)
t.pencolor(penc)
t.pd()
if fillc is not None:
t.fillc... | Python | 1 |
pedra" or jogadaHumano == "tesoura" and jogadaComputador == "papel":
print("Humano:", jogadaHumano)
print("Computador:", jogadaComputador)
print("Humano venceu!")
humano += 1
else:
print("Humano:", jogadaHumano)
print("Computador:", jogadaC... | Python | 1 |
('snoopy', true),
('marmaduke', true),
('pluto', true),
('dingo', true),
('itzi', true),
('mugi', true)
;
"#,
r#"
ALTER TABLE "Dog" DROP COLUMN is_good_dog;
ALTER TABLE "Dog" AD... | Rust | 0 |
"""
Test that with no fields selected for a stream automatic fields are still replicated
"""
import os
from tap_tester import runner, connections
from base import FacebookBaseTest
class FacebookAutomaticFields(FacebookBaseTest):
"""Test that with no fields selected for a stream automatic fields are still replic... | Python | 1 |
Var,
}
impl RelQueryVar {
#[cfg(any(feature = "cosmos", feature = "gremlin", feature = "neo4j"))]
pub(crate) fn new(
label: String,
suffix: String,
src: NodeQueryVar,
dst: NodeQueryVar,
) -> RelQueryVar {
RelQueryVar {
label,
suffix: suffix.cl... | Rust | 0 |
import numpy as np
from artemis.general.ezprofile import EZProfiler
from artemis.general.pareto_efficiency import is_pareto_efficient_ixs, is_pareto_efficient_dumb, \
is_pareto_efficient
__author__ = 'peter'
def test_is_pareto_efficient(plot=False):
for n_costs in (2, 10):
rng = np.random.RandomSta... | Python | 1 |
# LeetCode Problem: 2441-Largest-Positive-Integer-That-Exists-With-Its-Negative
# Problem Link: https://leetcode.com/problems/largest-positive-integer-that-exists-with-its-negative/description/
class Solution:
def findMaxK(self, nums: List[int]) -> int:
d=set(nums)
maxi=-1
for i in nums:
... | Python | 1 |
file(path) {
panic!("rm: {}", err);
}
}
pub fn slurp<P: AsRef<path::Path>>(path: P) -> String {
let mut file = fs::File::open(path).unwrap_or_else(|err| panic!("slurp {}", err));
let mut s = String::new();
if let Err(err) = file.read_to_string(&mut s) {
panic!("slurp: {}", err)
}
s
}
pub fn rea... | Rust | 0 |
Err(err) => panic!(format!("{}", err))
//! }
//! }
//! });
//! }
//!
//! Err(err) if err.kind() == io::ErrorKind::WouldBlock => { }
//!
//! Err(err) => panic!(format!("{}", err))
//! }
//!
//! match client.read_command() ... | Rust | 0 |
= ::std::option::Option::None;
self.specport = ::std::option::Option::None;
self.steamid = ::std::option::Option::None;
self.name.clear();
self.appid = ::std::option::Option::None;
self.gamedir.clear();
self.version.clear();
self.product.clear();
self.reg... | Rust | 0 |
println!("Decoded string: {}", &decoded_str);
assert!(decoded_str.len() > 0);
}
#[test]
#[cfg(target_os = "linux")]
fn test_disk_space() {
let storage = "/home";
let space = get_available_space(storage);
println!("Space in {} is {}", storage, space);
assert!(spac... | Rust | 0 |
ON(
src_y: *const u8,
src_u: *const u8,
src_v: *const u8,
dst_argb: *mut u8,
yuvconstants: *const YuvConstants,
width: ::std::os::raw::c_int,
);
}
extern "C" {
pub fn I422ToARGBRow_NEON(
src_y: *const u8,
src_u: *const u8,
src_v: *const u8,... | Rust | 0 |
}
}
// FIXME this should definitely be type state
pub fn enable_outputcompare(&mut self, channel: i32) {
match channel {
0 => self.register.cc0_ctrl.modify(|_, w| w.mode().variant(registers::$timerN::cc0_ctrl::MODEW::OUTPUTCOMPARE)),
1 => self.register.cc1_ctrl.modif... | Rust | 0 |
hidden)]
pub struct _APB_SARADC_CTRL2;
#[doc = "`read()` method returns [apb_saradc_ctrl2::R](apb_saradc_ctrl2::R) reader structure"]
impl crate::Readable for APB_SARADC_CTRL2 {}
#[doc = "`write(|w| ..)` method takes [apb_saradc_ctrl2::W](apb_saradc_ctrl2::W) writer structure"]
impl crate::Writable for APB_SARADC_CTRL2... | Rust | 0 |
om "sass-spec/spec/libsass/precision/default.hrx"
#[test]
fn default() {
assert_eq!(
rsass(
"test {\r\
\n foo: 0.4999 round(0.4999);\r\
\n bar: 0.49999 round(0.49999);\r\
\n baz: 0.499999 round(0.499999);\r\
\n baz: 0.49999999999 round(0.499999... | Rust | 0 |
t = "L")]
max_depth: Option<usize>,
/// Don't descend into directories with more than `n` entries
#[structopt(long = "filelimit")]
file_limit: Option<usize>,
// globs
/// Glob / literal filenames to match (accepts multiple e.g. -P <first> -P <second>)
#[structopt(short = "P")]
keep_patt... | Rust | 0 |
_HW_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for ROSDAC_Q_HW_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `rosdac_q_hw` writer - "]
pub struct ROSDAC_Q_HW_W<'a> {
w: &'a mut W,
}
impl<'a> R... | Rust | 0 |
while True:
numero_1 = input ('Digite primeiro número: ')
numero_2 = input ('Digite segundo número: ')
operador = input ('Digite o operador (+-/ ou *): ')
numeros_validos = None
num_1_float = 0
num_2_float = 0
try:
num_1_float = float (numero_1)
num_2_float = float (numero_2... | Python | 1 |
SCROLLBAR_INV_FGCOLOR,
SCROLLBAR_INV_BGCOLOR,
SCROLLBAR_DEADAREA_COLOR,
SELBAR_FGCOLOR,
SELBAR_BGCOLOR,
INACT_SELBAR_FGCOLOR,
INACT_SELBAR_BGCOLOR,
ITEMBG2,
ITEMFG2,
NUM_COLORS,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum WACURSOR {
VOLUME = 0,
POSITIO... | Rust | 0 |
= io::Error;
fn encode(&mut self, item: Self::Item, into: &mut BytesMut) -> Result<(), Self::Error> {
serde_json::to_writer(into.writer(), &item)?;
into.reserve(1);
into.put_u8(b'\n');
Ok(())
}
}
pub struct Codec<D, E> {
decoder: D,
encoder: E,
}
impl<D, E> Codec<D,... | Rust | 0 |
ctor space of dimension 2 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
sage: subspace.coordinate_vector(subspace.gen(0)) # defined in subspace.py
(1, 0)
"""
raise NotImplementedError("No coordinate vector is implemented yet for {}!".format(s... | Python | 1 |
from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry
import FWCore.ParameterSet.Config as cms
# Common functions and classes for ID definition are imported here:
from RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_tools \
import ( EleHLTSelection_V1,
confi... | Python | 1 |
id`
///
/// `386+`
///
/// `16/32/64-bit`
Cmp_EAX_imm32 = 117,
/// `CMP RAX, imm32`
///
/// `o64 3D id`
///
/// `X64`
///
/// `64-bit`
Cmp_RAX_imm32 = 118,
/// `AAS`
///
/// `3F`
///
/// `8086+`
///
/// `16/32-bit`
Aas = 119,
/// `INC r16`
///
/// `o16 40+rw`
///
/// `8086+`
///
/// `16/32-... | Rust | 0 |
{
fn drop(&mut self) {
// Detach everything, close remaining attachpoints
// SAFETY: these fds must be wholly owned by `ProgramVersion`.
for fd in self.fds.iter() {
unsafe {
libc::close(*fd as c_int);
}
}
// We are intentionally enume... | Rust | 0 |
tion. The default value is 0.0.
contractRatio1: float = 0
# A Float specifying the lower bounds on the allowable scaling of the mesh in the 2
# direction. The default value is 0.0.
contractRatio2: float = 0
# A Float specifying the lower bounds on the allowable scaling of the mesh in the 3
# d... | Python | 1 |
# -*- coding: utf-8 -*-
############################################################
# Utilities for reading/writing/parsing NeuroML 2 files
############################################################
from c302.ConnectomeReader import analyse_connections
def getSegmentIds(cell):
seg_ids = []
for segm... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.