text string | label_name string | labels int64 |
|---|---|---|
# решение задачи
# вариант: повыпендрежнее 2
import math
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
# рассчитываем значение функции
def calc(x):
return str(math.log(abs(12 * math.sin(int(x)))))
# вывод проверочного кода в консоль
def print_answer(remote: webdriver.... | Python | 1 |
impl RObject for AuthorizationStateClosed {
#[doc(hidden)] fn td_name(&self) -> &'static str { "authorizationStateClosed" }
#[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
}
impl TDAuthorizationState for Authoriz... | Rust | 0 |
Deque::from(vec![
Column(VecDeque::from(vec![' '; square_len]));
square_len
]),
};
// println!(
// "tile_count * chars_per_tile = {} * {} = {} square_len",
// tile_count, chars_per_tile, square_len
// );
for t_row in 0..tile_count {
for t_col in 0.... | Rust | 0 |
io.write_triangle_mesh(file_pred_aligned, mesh_est)
mesh_sample_point = 1000000
voxel_down_sample_res = 0.02
verts_pred = utils_eval.sample_points_from_mesh(file_pred_aligned, mesh_sample_point=mesh_sample_point, voxel_down_sample_res=voxel_down_sample_res)
verts_trgt = utils_eval.sample_points_from_mes... | Python | 1 |
import re
__product__ = "aeSecure (WAF)"
def detect(content, **kwargs):
content = str(content)
headers = kwargs.get("headers", {})
detection_schema = (
re.compile(r"aesecure.denied.png", re.I),
)
header_check = (
headers.get("aeSecure-code", ""),
headers.get("AeSecure-Co... | Python | 1 |
# %%
"""
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Image/pansharpen.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" hr... | Python | 1 |
array = list(input())
stack = result = 0
flag = False
for i in array:
if i == "(":
stack += 1
flag = True
elif i == ")":
if flag:
stack -= 1
result += stack
flag = False
elif not flag:
stack -= 1
result += 1
result +... | Python | 1 |
import pytest
import uuid
from .links_repository import LinksRepository
from src.models.settings.db_connection_handler import db_connection_handler
db_connection_handler.connect()
link_id = str(uuid.uuid4())
trip_id = str(uuid.uuid4())
@pytest.mark.skip(reason="interacao com o banco")
def test_registry_link():
c... | Python | 1 |
channel: &channel,
operation: PackageChannelOperation::Demote,
trigger: helpers::trigger_from_request_model(&req),
requester_id: session.get_id() as i64,
requester_name: &session.get_name(),
origin: &origin... | Rust | 0 |
# SPDX-License-Identifier: MIT
"""
Commonly used hooks for on_setattr.
"""
from . import _config
from .exceptions import FrozenAttributeError
def pipe(*setters):
"""
Run all *setters* and return the return value of the last one.
.. versionadded:: 20.1.0
"""
def wrapped_pipe(instance, attrib, n... | Python | 1 |
s.canvas);
this.dom.addEventListener("keydown", function(e) {
console.log("pressed",e);
})
}
this.setPreprocessor(`x ->\n IO.println "Preprocessor set after receiving ${data}`)
let first = data.shift();
... | Rust | 0 |
.0[2];
self.0[3] += rhs.0[3];
self.0[4] += rhs.0[4];
self.0[5] += rhs.0[5];
self.0[6] += rhs.0[6];
}
}
impl DivAssign for SIUnit {
#[allow(clippy::suspicious_op_assign_impl)]
fn div_assign(&mut self, rhs: Self) {
self.0[0] -= rhs.0[0];
self.0[1] -= rhs.0[1];
... | Rust | 0 |
: *tag,
inst: inst.clone().executed(),
},
res,
));
} else {
*cycles += 1;
}
}
deleted_idx.map(|i| self.executing_insts.remove(i));
}
pub fn take_complete(&mut self) -> Option... | Rust | 0 |
match self {
ApiError::Authentication(msg) => write!(f, "Not Authenticated: {}", msg),
ApiError::MalformedApiFile(e) => {
write!(f, "Invalid API specification: {}", e.to_string())
}
ApiError::ResponseError(msg) => write!(f, "{}", msg),
... | Rust | 0 |
# skills/models.py - Simple Version
from django.db import models
class Skill(models.Model):
skill_id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=100, unique=True)
category = models.CharField(max_length=50, blank=True, null=True)
description = models.TextField(blank=True, ... | Python | 1 |
import pygame
import random
import numpy as np
# Constantes
GRID_SIZE = 2
GRID_COLS = 400
GRID_ROWS = 300
WIDTH = GRID_COLS * GRID_SIZE
HEIGHT = GRID_ROWS * GRID_SIZE
FPS = 60
# Cores
WATER_COLOR = (0, 119, 190)
BG_COLOR = (20, 20, 20)
# Tipos
EMPTY = 0
WATER = 1
# Grid de partículas
grid = [[EMPTY for _ in range(G... | Python | 1 |
od_, ioov155t1y7, j1p0ktfv9e_: ivmiwxc11_e):
assert None
pass
gw3djamzyu7
import b60rvhuuvkn as uaf_lvv9xh3, nh1y3iod5r2 as ejfngtyngij, fo_gxdr6lnp, czwqh31a2jn as wsqdvezxo6o, nuk1fg3o3u7, mslqgllwf0s, pbdrbx09ynd as xhv40f09x1b
from hz2y1b3tltd import r0m__yezzor, pr9jeq2n786 as pqjkurm03jf, odks... | Python | 1 |
# This module contains the model of Net ecosystem exchange (NEE)
# load libraries
import torch
# net ecosystem productivity (NEP)
def compute_nep(gpp_t: torch.Tensor, ter_t: torch.Tensor):
"""
This function computes net ecosystem productivity (NEP) as a difference between gross primary productivity (GPP) and... | Python | 1 |
"""
Contouring
~~~~~~~~~~
Generate iso-lines or -surfaces for the scalars of a surface or volume.
3D meshes can have 2D iso-surfaces of a scalar field extracted and 2D surface
meshes can have 1D iso-lines of a scalar field extracted.
"""
import pyvista as pv
from pyvista import examples
# %%
# Iso-Lines
# +++++++++... | Python | 1 |
s
/// already done, the latest state is immediately returned. If the timeout
/// specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
/// timeout is used. If the server does not support this method, it returns
/// google.rpc.Code.UNIMPLEMENTED.
/// Note that this method is on a bes... | Rust | 0 |
# Code to evaluate forward pass time in Pytorch
# Sept 2017
# Eduardo Romera
#######################
import os
import numpy as np
import torch
import time
from PIL import Image
from argparse import ArgumentParser
from torch.autograd import Variable
from erfnet_nobn import ERFNet
from transform import Relabel, ToLab... | Python | 1 |
Ok(())
}
async fn search(st: &SearchTarget) -> Result<Vec<String>> {
let mut result: Vec<String> = Vec::new();
let mut responses = ssdp_client::search(st.into(), TIMEOUT, 2).await?;
eprintln!("Searching for {}", st);
while let Some(response) = responses.next().await {
let response = respo... | Rust | 0 |
mean;
let err: f64 = feature.iter()
.zip(target_column.iter())
.map(|(&x, &y)| intercept + slope * x - y)
.map(|r| r * r)
.sum();
if err < best_err {
best_err = err;
best_slope = slope;
... | Rust | 0 |
: HINTERNET, lpdwNumberOfBytesAvailable: LPDWORD,
) -> BOOL;
pub fn WinHttpQueryHeaders(
hRequest: HINTERNET, dwInfoLevel: DWORD, pwszName: LPCWSTR, lpBuffer: LPVOID,
lpdwBufferLength: LPDWORD, lpdwIndex: LPDWORD,
) -> BOOL;
pub fn WinHttpQueryOption(
hInternet: HINTERNET, dwOpti... | Rust | 0 |
import os
import argparse
import subprocess
# Basis-Pfade
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
DATASETS_DIR = os.path.join(BASE_DIR, "datasets")
MODELS_DIR = os.path.join(BASE_DIR, "models")
MODEL_PATH = os.path.join(MODELS_DIR, "card_model.h5")
# Funktionen für die einzelnen Schritte
def start_live_... | Python | 1 |
rch.Tensor):
parameters = [parameters]
parameters = [p for p in parameters if p.grad is not None]
norm_type = float(norm_type)
if len(parameters) == 0:
return torch.tensor(0.)
device = parameters[0].grad.device
if norm_type == torch.inf:
total_norm = max(p.grad.detach().abs()... | Python | 1 |
clone(),
rca: rca.clone(),
growth: growth.clone(),
debug: debug.clone(),
exclude_default_members: exclude_default_members.clone(),
filters: filters.clone(),
rate: rate.clone(),
sparse: sparse.clone(),
});
} else {
//... | Rust | 0 |
"""
Classifies: CHEBI:17984 acyl-CoA
"""
"""
Classifies: CHEBI:15347 acyl-CoA
"""
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import rdMolDescriptors
def is_acyl_CoA(smiles: str):
"""
Determines if a molecule is an acyl-CoA based on its SMILES string.
An acyl-CoA is a thioester th... | Python | 1 |
chars, erroring if it's not as expected
macro_rules! expect_ident {
($ident_name: literal => $( $chars: literal ),*) => {{
// Consume each char in turn, erroring if any of them aren't expected
$(
match iter.next() {
Some((_, $chars)... | Rust | 0 |
import time
import vcr
import yaml
import os
from mendeley import Mendeley
from mendeley.session import MendeleySession
from test.yamlfileserializer import YamlFileSerializer
class DummyStateGenerator(object):
@staticmethod
def generate_state():
return 'state1234'
def load_config_from_file(filenam... | Python | 1 |
}
}
#[derive(Default)]
pub struct ProxyUpdate {
pub signal_queue: bool,
pub remove_proxy: ProxyRemoval,
pub polling: Option<(u64, RawFd, EventSet)>,
pub new_proxy: Option<(u32, RawFd)>,
pub push_accept: Option<(u64, u64)>,
pub push_credit_req: Option<MuxerRx>,
}
impl fmt::Display for ProxyErro... | Rust | 0 |
SIMPLE = {
# "stopping_strings": [
"stop": [
"\nUSER:",
"\nASSISTANT:",
"\nFUNCTION RETURN:",
"\nUSER",
"\nASSISTANT",
"\nFUNCTION RETURN",
"\nFUNCTION",
"\nFUNC",
"<|im_start|>",
"<|im_end|>",
"<|im_sep|>",
# '\n' +... | Python | 1 |
for _ in 0 .. letter_frequencies.len() {
letter_count.push(0f32);
}
let mut nonletter_count = 0f32;
for octet in &output {
match *octet {
0x41u8 ... 0x5Au8 | 0x61u8 ... 0x7Au8 => { letter_count[((octet | 0x20u8) - 0x61u8) as usize] += 1f32; },
... | Rust | 0 |
import re
import json
import logging
import os
from datetime import datetime, date, timedelta
from typing import Union, Optional, Dict, Any
import pytz
import jdatetime
from .config import PROGRESS_COLORS
from .database import db
import urllib.parse
from .config import LOYALTY_REWARDS
logger = logging.getLogger(__nam... | Python | 1 |
elf) -> bool {
self.compl() == 1
}
/// gets a non-complemented version of self
pub fn regular(&self) -> BddPtr {
let mut new = self.clone();
new.set_compl(0);
new
}
pub fn neg(&self) -> BddPtr {
let mut r = self.clone();
if self.is_compl() {
... | Rust | 0 |
y() > 1.))
self.assertTrue(np.any(out.detach().numpy() < .0))
def test_upscaler_batch_eight_without_sigmoid(self) -> None:
m: upscalers.ResidualUpscaler = upscalers.ResidualUpscaler(
c_in=384, c_out=1, add_final_sigmoid_layer=False
)
t: torch.Tensor = torch.randn((8, 384... | Python | 1 |
ame, flags))
func_code = """
static PyObject* {cfuncname}{signature}
{{
{code}
}}
""".format(cfuncname=cfuncname, signature=signature, code=code)
codes.append(func_code)
body = "\n".join(codes) + """
static PyMethodDef methods[] = {
%(methods)s
{ ... | Python | 1 |
}
(I64(a), U64(b)) if b < i64::MAX as u64 => {
a.checked_sub(b as i64).map(val)
.unwrap_or_else(|| val((a as f64) - (b as f64)))
}
(I64(a), U64(b)) => val((a as f64) - (b as f64)),
}
}
pub fn mul<'x>(a: Number, b: Number) -> VarRef<'x> {
use self::NumberInner::... | Rust | 0 |
__all__ = ('ScheduleWeeksDay',)
from ...bases import Preinstance as P, PreinstancedBase
class ScheduleWeeksDay(PreinstancedBase, value_type = int):
"""
Represents a day of a week.
Attributes
----------
name : `str`
The name of the schedule week's day.
value : `int`
T... | Python | 1 |
bed, i = {}, 0
start = timer()
bed_1 = sys.argv[1]
with open(bed_1) as fp:
for line in fp:
t = line[:-1].split("\t")
if not t[0] in bed: # check for chrom
bed[t[0]] = []
bed[t[0]].append(node(int(t[1]),int(t[2]))) # add new node to the same ch... | Python | 1 |
ats".to_owned() + path;
let request = match Request::new_with_str(&url) {
Ok(v) => v,
Err(e) => return Promise::reject(&e),
};
fetch(&request)
}
fn render_error(status: StatusCode) -> Promise {
match generate_error_response(status, None) {
Ok(v) => Promise::resolve(&v),
... | Rust | 0 |
el restored_params
start_step = int(jax.device_get(train_state.step))
if FLAGS.save_model_freq > 0:
save_checkpoint(train_state)
sharded_rng = next_rng()
step_counter = trange(start_step, FLAGS.total_steps, ncols=0)
for step, (batch, dataset_metrics) in zip(step_c... | Python | 1 |
scoped_answers.insert(identifier.to_owned(), AnswerInfo::with_value(string).build());
}
}
}
}
// Render any variables used in the definition of the AnswerInfo using the current
// context befo... | Rust | 0 |
fn buffer_length(&self) -> usize {
INPUT_LENGTH
}
}
<reponame>romankoblov/ocl
#![allow(unused_imports, unused_variables, dead_code)]
use std::sync::Arc;
use std::rc::{Rc, Weak};
use std::cell::RefCell;
use std::thread::{self, JoinHandle, Thread};
use futures::{executor, SinkExt, StreamExt, Future, Never, ... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType
class SubscribeCalendarRequest(BaseRequest):
def __init__(self) -> None:
super().__init__... | Python | 1 |
"""Devuelve la versión de la API."""
metadata = {
other_metadata: os.environ.get(other_metadata, None)
for other_metadata in TrainerWrapper.worker_metadata
}
metadata["__VERSION__"] = app_version
metadata["debug"] = DEBUG_MODE
metadata["debug"] = metadata["debug"] if DEBUG_MODE... | Python | 1 |
d = {'key1': 'aaa', 'key2': 'aaa', 'key3': 'bbb'}
value = d['key1']
print(value)
# aaa
keys = [k for k, v in d.items() if v == 'aaa']
print(keys)
# ['key1', 'key2']
keys = [k for k, v in d.items() if v == 'bbb']
print(keys)
# ['key3']
keys = [k for k, v in d.items() if v == 'xxx']
print(keys)
# []
key = [k for k, ... | Python | 1 |
import json
import logging
import sys
from pathlib import Path
from dotenv import load_dotenv
from podcast_generator import GPT4oAPI
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[logging.StreamHandler(sys.stdout)]
)
log... | Python | 1 |
{
x: &'t InferCtxt<'a, 'tcx>,
}
pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d> {
typer: &'t InferCtxt<'a, 'tcx>,
mc: MemCategorizationContext<'t, 'a, 'tcx>,
delegate: &'d mut (Delegate<'tcx>+'d),
}
impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
pub fn new(delegate: &'d mut Delegate<'t... | Rust | 0 |
#[doc = "DSP_BOOT_RAMMAP register accessor: an alias for `Reg<DSP_BOOT_RAMMAP_SPEC>`"]
pub type DSP_BOOT_RAMMAP = crate::Reg<dsp_boot_rammap::DSP_BOOT_RAMMAP_SPEC>;
#[doc = "DSP Boot SRAM Remap Control Register"]
pub mod dsp_boot_rammap;
#[doc = "VER register accessor: an alias for `Reg<VER_SPEC>`"]
pub type VER = crat... | Rust | 0 |
gIpListResponse;
}
impl HasPagination for FloatingIpListResponse {
fn next_page(&self) -> Option<Url> {
self.links.next()
}
}
impl HasValue for FloatingIpListResponse {
type Value = Vec<FloatingIp>;
fn value(self) -> Vec<FloatingIp> {
self.floating_ips
}
}
macro_rules! foobar <fold text='{...}'>{
($self... | Rust | 0 |
job_args=SPARK_JOB_ARGS.get("etl_dwm2dws_dws_orders_detailed_info_wide_ipd"),
script_path=SPARK_JOB_SCRIPTS_PATH.get("etl_batch_process")
),
cmd_timeout=600,
)
refresh_dws = TriggerDagRunOperator(
task_id="trigger_dws_refresh",
trigger_dag_id="backfill_r... | Python | 1 |
:ident : $lhs:path, $rhs_i:ident : &$rhs:path| -> $out:path $body:block) => {
$crate::_parse_binary_op_gen!($op, <$($T $(: $C)?),+>, $lhs, &$rhs, $out, lhs, rhs, {
|$lhs_i: $lhs, $rhs_i: &$rhs| -> $out { $body }(lhs, rhs)
});
};
($op:tt <$($T:ident $(: $C:ident)?),*> |$lhs_i:ident : ... | Rust | 0 |
story_len=history_len,
temperature=temperature,
top_p=top_p,
history=history)
history.append((input, resp['result']))
print(resp['result'])
return resp['result']
if __name__ == "__main__":
reinit_model(large_language_model='ChatGLM-6B-int8',
embedding_model='tex... | Python | 1 |
import datetime
from imap_tools import EmailAddress
DATA = dict(
subject='Re: Test reply email',
from_='xxxxxxxx@xxx.org',
to=('mikel@xxxx.net',),
cc=(),
bcc=(),
reply_to=(),
date=datetime.datetime(2007, 11, 18, 19, 56, 7, tzinfo=datetime.timezone(datetime.timedelta(seconds=39600))),
da... | Python | 1 |
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.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... | Python | 1 |
m8.option)
|| self.keyjazz.contains_key(&self.rm8.keyjazz)
|| self.keyjazz.contains_key(&self.rm8.octave_minus)
|| self.keyjazz.contains_key(&self.rm8.octave_plus)
|| self.keyjazz.contains_key(&self.rm8.velocity_minus)
|| self.keyjazz.contains_key(&self.rm8.velocity_plus);
}
}
<reponame>bradparks/divans... | Rust | 0 |
def set_image_to_text_mode(self):
"""Manually set the generation mode to image-conditioned text generation."""
self.mode = 'img2text'
| Python | 1 |
_dst)
except KeyError:
self.fsm_graph.add_edge(_src, _dst)
edge = self.fsm_graph.get_edge(_src, _dst)
edge.attr.update(edge_attr)
self.set_node_style(src, 'previous')
def _get_subgraph(graph, name):
""" Searches for subgraphs in a graph.
Args:
... | Python | 1 |
bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
impl R {
#[doc = r" Value of the register as raw bits"]
#[inline]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bit 0 - Channel 0 Single Reques... | Rust | 0 |
build_udp_probe_packet(probe_setting, packet);
});
},
ProbeType::TcpSynAckProbe => {
tx.build_and_send(1, TCP_PACKET_SIZE, &mut |packet: &mut [u8]| {
build_tcp_probe_packet(probe_setting, packet, probe_type);
... | Rust | 0 |
level only
let _ = handle.catch_unwind().await;
assert_eq!(super::get_context().lock().unwrap().task_active, 1);
});
}
#[test]
fn test_ticks_increment_on_wait() {
super::run(async {
super::await_tick!(1);
super::assert_tick!(1);
});
... | Rust | 0 |
let m = FairMutex::new(());
drop(m.lock());
drop(m.lock());
}
#[test]
fn lots_and_lots() {
const J: u32 = 1000;
const K: u32 = 3;
let m = Arc::new(FairMutex::new(0));
fn inc(m: &FairMutex<u32>) {
for _ in 0..J {
*m.lock() += 1... | Rust | 0 |
# SecuML
# Copyright (C) 2016-2019 ANSSI
#
# SecuML 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 Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# SecuML is distributed in the h... | Python | 1 |
too to avoid validation issues
result = self.solver.advanced_solver.solve_advanced_problem(problem)
print(f"Result: {result}")
self.display_result(result)
except Exception as e:
error_msg = f"Error: {str(e)}\n\n{traceback.format_exc()}"
print(e... | Python | 1 |
g_list.remove('milk')
# print(shopping_list)
# ans2Mid Level (Student Grades): You are given a list of tuples where each tuple contains a
# student's name and their score on a test:
# students = [('Alice', 85), ('Bob', 90), ('Charlie', 78),('David', 92)].
# Write a program that converts this list into a dictionary ... | Python | 1 |
"""Constants."""
RANDOM_SEED = 419
BUFFER_SIZE = 300
RUN_FROM = 'local'
NUM_EPOCHS = 29
IMAGE_SIZE = 128
MASK = 'spiral_mask'
MIN_VOTE = (
3 # min votes that the most voted pixel of a mask must have to be a spiral arm (barred) galaxy
)
THRESHOLD = 3 # min votes that a pixel must have to be clasified as a spiral... | Python | 1 |
origin"
def test_urdf_all_joints_have_required_elements(cad_doc: CAD) -> None:
"""Each joint in URDF should have parent, child, origin, and type-specific elements."""
from lxml import etree as ET
graph = KinematicGraph.from_cad(cad_doc)
client = DummyClient()
robot = Robot.from_graph(
k... | Python | 1 |
del):
"""DescribeOverviewDDoSEventList请求参数结构体
"""
def __init__(self):
r"""
:param _StartTime: 起始时间
:type StartTime: str
:param _EndTime: 结束时间
:type EndTime: str
:param _AttackStatus: 可选按攻击状态过滤,start:攻击中;end:攻击结束
:type AttackStatus: str
:param... | Python | 1 |
relative, rootfs);
if !destination_resolved.starts_with(&rootfs) {
panic!(
"Device at {:?} cannot be mounted into rootfs!",
&destination_relative
);
}
if !destination_resolved
.parent()
.expect(
format!(
"Could create device at destination {:?} which has no parent dir!",
destination_resolve... | Rust | 0 |
ge对象
# # # # # # # # # # # # # # """
# # # # # # # # # # # # # # def convert2QImage(img):
# # # # # # # # # # # # # # height, width, channel = img.shape # 获取图像的高度、宽度和通道数
# # # # # # # # # # # # # # # 创建一个QImage对象,用于显示图像
# # # # # # # # # # # # # # # 注意:这里的步长应该根据图像的通道数进行调整
# # # # # # # # # # # # # # re... | Python | 1 |
'''
16진수 문자로 이루어진 1차 배열이 주어질 때, 왼쪽부터 순차적으로 암호비트패턴을 찾아 차례대로 출력하시오. 암호는 연속되어있다.
입력
0DEC
0269FAC9A0
2진수: 0000110111101100
answer: 7, 101, 116, 3
'''
def hex_to_binary(hex_string):
# 16진수를 2진수로 변환하기 위한 매핑 테이블
hex_to_bin_map = {
'0': '0000', '1': '0001', '2': '0010', '3': '0011',
'4': '0100', '5... | Python | 1 |
seconds_start = kwargs.get("seconds_start", 0)
seconds_total = kwargs.get("seconds_total", int(noise.shape[-1] / 21.53))
seconds_start_embed = self.seconds_start_embedder([seconds_start])[0].to(device)
seconds_total_embed = self.seconds_total_embedder([seconds_total])[0].to(device)
g... | Python | 1 |
from_camera(Camera::new(
0.05, // Velocity
0.4, // Sensitivity
glm::vec3(-0.5, 3., -5.), // Position
0., // Head x-axis position
90., // Head y-axis position
));
for x in 0..16 {
... | Rust | 0 |
if bytes.len() < 3 || bytes[0] != 0x01 {
return 0;
}
size.bytes.len() + 622
}
PhotoSize::Progressive(size) => size.sizes.iter().sum::<i32>() as usize,
PhotoSize::Path(size) => size.bytes.len(),
}
}
/// Dow... | Rust | 0 |
False, hwyljif3lsq=None, gmittp60rlh: b9ogqsywg6j=0.0):
"""# speech_blackboard_purges -> detail_plastic_gangways"""
assert 0j
global fjmzgrvik7w
import e26kb75zt5v as oduao1meg4c, jk25_h8ssde
utkld7ad3p3.tmbxgxmard_: None = b''
cu2t_jyaz8f /= ujk4mbsume7
from fddmttkwxvw import dgtvkz8fevw a... | Python | 1 |
?;
let len_type = length.pretty_name();
let length = length
.try_into::<usize>()
.map_err(|_| Error::NoImplicitConversion {
from: len_type,
to: "Integer",
})?;
Ok(Some((
array::Ele... | Rust | 0 |
cape key. \n 2x2 is currently used with all notations and will be changed to use either RUF or LUF moves \n Currently this Software is written in Python with the Tkinter Module and is still in development! \n Have Fun Timing and Solving! \n Thank You! press the 'OK' Button when you're ready to time Solves!", font = ("T... | Python | 1 |
df", "txt", "markdown").
"""
return cls(
MessageFileContent(
file_id=file_id,
file_data=file_data,
format=format,
filename=filename,
)
)
@classmethod
def from_text(cls, text: str) -> Self:
""... | Python | 1 |
def setUp(self):
self.diffusers_dir = tempfile.mkdtemp()
os.makedirs(os.path.join(self.diffusers_dir, 'schedulers/'))
check_copies.DIFFUSERS_PATH = self.diffusers_dir
shutil.copy(os.path.join(git_repo_path,
'src/diffusers/schedulers/scheduling_ddpm.py'), os.path.join(self.
diffusers_dir,... | Python | 1 |
ing `Texture`s
/// - `F`: `Format` used for loading `FontAsset`
/// - `W`: Type used for Widget IDs
///
/// ### Example:
///
/// ```rust,ignore
/// let ui_handle = world.exec(|loader: UiLoader<TextureFormat, FontFormat>| {
/// loader.load("renderable.ron", ())
/// });
/// ```
#[derive(SystemData)]
#[allow(missing_d... | Rust | 0 |
# Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa >
# Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki.
"""
TheTeamAlexa is a project of Telegram bots with variety of purposes.
Copyright (c) 2021 ~ Present Team Alexa <https://github.com/TheTeamAlexa>
This progra... | Python | 1 |
Leds -------------------------------------------------------------------------------------
if with_led_chaser:
self.submodules.leds = LedChaser(
pads = platform.request_all("user_led"),
sys_clk_freq = sys_clk_freq)
# Build -----------------------------------... | Python | 1 |
gin/device-based/regular/login/?refsrc=deprecated&lwv=100&refid=8',data=log_data,headers=header_freefb).text
log_cookies=session.cookies.get_dict().keys()
if 'c_user' in log_cookies:
coki=";".join([key+"="+value for key,value in session.cookies.get_dict().items()])
... | Python | 1 |
type StorePeriod = StoragePeriod;
type UnsignedPriority = UnsignedPriority;
}
impl<LocalCall> frame_system::offchain::SendTransactionTypes<LocalCall> for Test where
Call: From<LocalCall>,
{
type OverarchingCall = Call;
type Extrinsic = Extrinsic;
}
pub fn new_test_ext() -> sp_io::TestExternalities {
let t = f... | Rust | 0 |
let count = map_ii.entry(word).or_insert(0); // map_ii に走査されてきた単語についての記録が無ければ0を単語として追加して次のループ
// 値があればスルーして残りの処理を(可変参照を返す)
*count += 1; // count が可変参照を保持しているので参照外しをして
}
println!("{:?}", map); //< {"world": 2, "hello": 1, "wonderful": 1}
// or_insert関数は元々 キーに対する値への可変参照(&mut V)を返す
// ここでその可変参照を coun... | Rust | 0 |
T>(a: &T, b: &T) -> Ordering
where
T: PartialOrd + IsFloat + NativeType,
{
if T::is_float() {
match (a.is_nan(), b.is_nan()) {
// safety: we checked nans
(false, false) => unsafe { a.partial_cmp(b).unwrap_unchecked() },
(true, true) => Ordering::Equal,
(tr... | Rust | 0 |
from panda3d.core import *
from toontown.toonbase import ToontownGlobals
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
import random
from direct.gui.DirectGui import *
from panda3d.core import *
from toontown.toonbase import TTLocalizer
from . import HouseGlobals
fr... | Python | 1 |
# Copyright 2009-2011 Ram Rachum.
# This program is distributed under the LGPL2.1 license.
'''
Defines the `WorkspaceMenu` class.
See its documentation for more info.
'''
import wx
from garlicsim_wx.general_misc.cute_menu import CuteMenu
class WorkspaceMenu(CuteMenu):
'''Menu for manipulating the workspace.'''... | Python | 1 |
om_slice(&(8 as usize).to_le_bytes());
let eight_scalar = curve25519_dalek::scalar::Scalar::from_bits(eight_scalar_bytes);
let r_candidate_point = curve25519_dalek::edwards::EdwardsPoint::vartime_double_scalar_mul_basepoint(&k, &(mixed_pub_point.neg().mul_by_cofactor()), &(s * eight_scalar));
p... | Rust | 0 |
pixel_dif1 = images[1:,:,:] - images[:-1,:,:]
pixel_dif2 = images[:,1:,:] - images[:,:-1,:]
# Sum for all axis. (None is an alias for all axis.)
sum_axis = None
elif ndims == 4:
# The input is a batch of images with shape [batch, height, width, channels... | Python | 1 |
ED_FEATURES);
}
self.features = Some(feats);
}
"separate-nightlies" => self.separate_nightlies = parse_empty(k, v)?,
"multitarget" => self.multitarget = parse_empty(k, v)?,
"rustdoc-map" => self.rustdoc_map = parse_empty(k, v)?,
... | Rust | 0 |
#[test]
fn test_no_ignore() {
let te = TestEnv::new();
te.assert_output(
&["--no-ignore", "foo"],
"a.foo
ignored.foo
one/b.foo
one/two/c.foo
one/two/C.Foo2
one/two/three/d.foo
one/two/three/directory_foo");
te.assert_output(
&["--hid... | Rust | 0 |
// Face abc.
if let Some(res) = check_face(
0, &self.a, &self.b, &self.c, &ap, &bp, &cp, &ab, &ac, &ad, dabc, dbca,
dacb,
/*ap_ab, bp_ab, cp_ab,
ap_ac, bp_ac, cp_ac*/
) {
return res;
}
// Face abd.
if let Some... | Rust | 0 |
# coding:utf-8
# pylint: disable=doc-string-missing
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# 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.o... | Python | 1 |
import plsca840uz_ as jheykc5__7i, y9qeh15nmsi as cq5wmb3t1z0, qb95nvvhksl, ds7d4z49s8h, geaddt9dcmp as comvcd11xiz, zh1oinpq8lf as abt8rmbhci2
'# difficulties_punches_electrolyte -> trick_relief_swing'
nonlocal ggd2iti5bcp
del tb0jxxs7x56
kry1zntpc_e['']: zsbx7zqbarr = 0
0j
'# difficulties_pun... | Python | 1 |
束
# 获取线程名字:getName()
# 3、线程同步
# 4、互斥锁
# 四十四、协程
# 1、又称微线程,纤程。Coroutime。是Python中另外一种实现多任务的方式,只不过比线程更小,占用更小执行单元(需要的资源)
# ,自带cpu上下文。这样只要在合适的时机,我们可以把一个协程切换到另一个协程。只要这个过程中保持或恢复cpu上下文那么程序还是可以运行的
# 2、简单实现
import time
def task1():
while True:
yield 'hahaha'
time.sleep(1)
def task2():
while Tr... | Python | 1 |
: SC_POS,
y: SC_POS,
rx: SC_DIM,
ry: SC_DIM,
stops: *const SC_COLOR_STOP,
nstops: UINT,
) -> GRAPHIN_RESULT,
// setup parameters of gradient radial fills.
pub gFillGradientRadial: extern "system" fn(
hgfx: HGFX,
x: SC_POS,
y: SC_POS,
r... | Rust | 0 |
xpr(e, &projection))
.collect::<FuseQueryResult<Vec<_>>>()?;
if let ExpressionPlan::Column(name) = expr {
if let Some(expr) = projection.get(name) {
return Ok(expr.clone());
}
}
Ok(Optimizer::rebuild_from_exprs(&expr, &expressions))
}
impl IOptimizer for FilterPushDownO... | Rust | 0 |
return
with open(output_path, "w", encoding="utf-8") as fout:
write_pruned_guide(fout)
def prune_sections(
lines: Iterator[str], blacklist_keywords: Sequence[str]
) -> Generator[str, None, None]:
exclude_level: int | None = None
used_keywords = []
for line in lines:
if (line_ls :=... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.