text string | label_name string | labels int64 |
|---|---|---|
}
TwinEvent::Both => {
self.report(ctx.clone(), TrustFeedback::Good);
self.report(ctx.clone(), TrustFeedback::Bad("twin bad".to_owned()));
}
}
self.response(
ctx,
RPC_RESP_TRUST_TWIN_EVENT,
Ok(TrustTwin... | Rust | 0 |
] = 7;
data[4 * (32 * 40 + 35) + 3] = 8;
let result = rgba_bounding_box(&data, 40, 70);
assert_eq!(result.coords.x_offset, 35);
assert_eq!(result.coords.y_offset, 32);
assert_eq!(result.coords.width, 1);
assert_eq!(result.coords.height, 1);
assert_eq!(result.data, &[5, 6, 7, 8]);
data[4... | Rust | 0 |
import sys, itertools
from sets import Set
NUM_QUEENS = 8
MAX = NUM_QUEENS * NUM_QUEENS
# Each position (i.e. square) on the chess board is assigned a number
# (0..63). non_intersecting_table maps each position A to a set
# containing all the positions that are *not* attacked by the position
# A.
intersecting_table... | Python | 1 |
he font slightly, to support certain
/// glyphs (especially on the Linux console). If this is set, no such
/// modifications will be made. Note that font changes will not affect anything
/// but the virtual console/terminal in which Notcurses is running.
pub const NCOPTION_NO_FONT_CHANGES: u64 = crate::bindings::ffi::N... | Rust | 0 |
fault());
}
#[test]
fn memory_edit_keys_versioned() {
edit_keys::<Versioned, _>("versioned", MemoryFileManager::default());
}
#[test]
fn memory_edit_keys_unversioned() {
edit_keys::<Unversioned, _>("unversioned", MemoryFileManager::default());
}
#[test]
fn any_edit... | Rust | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" Signs a URL using a URL signing secret """
import hashlib
import hmac
import base64
import urlparse
def sign_url(input_url=None, secret=None):
""" Sign a request URL with a URL signing secret.
Usage:
from urlsigner import sign_url
signed_url = sign_u... | Python | 1 |
|| self.get_path_segment_data_with_id(seg, id))
})
}
pub fn get_path_segment_data(&self, path_seg: &ast::PathSegment) -> Option<Ref> {
self.get_path_segment_data_with_id(path_seg, path_seg.id)
}
fn get_path_segment_data_with_id(
&self,
path_seg: &ast::PathSegment,
... | Rust | 0 |
ng: [::std::os::raw::c_char; 512usize],
}
#[test]
fn bindgen_test_layout_ovrErrorInfo_() {
assert_eq!(
::std::mem::size_of::<ovrErrorInfo_>(),
516usize,
concat!("Size of: ", stringify!(ovrErrorInfo_))
);
assert_eq!(
::std::mem::align_of::<ovrErrorInfo_>(),
4usize,
... | Rust | 0 |
lose to avoid glitching in player
if abs(x_diff_to_player) < (self.attack_range / 2):
x_movement = 0
if x_diff_to_player < 0:
self.model.setH(90)
self.ShootDirection = 1
elif x_diff_to_player > 0:
self.model.setH(-90)
self.ShootDir... | Python | 1 |
a = int(input())
b = int(input())
c = int(input())
if a==60 and b==60 and c ==60:
print('Equilateral')
elif a+b+c == 180 and (a==b or b==c or a==c):
print('Isosceles')
elif a+b+c == 180 and a!=b and b!=c and a!=c:
print("Scalene")
elif a+b+c != 180:
print('Error') | Python | 1 |
&V) -> ScalarResult<[T; 4]> {
let mut result = Vec::with_capacity(self.col_len());
for v in self.rows() {
let res = v.dot_product(factor)?;
result.push(res);
}
Ok(result.into_fixed_length())
}
}
impl<S: ToSlice<T>, V: Vector<T>, T: RealNumber, N: NumberSpac... | Rust | 0 |
4
/// "CST" / "CDT" / ; Central: - 6/ - 5
/// "MST" / "MDT" / ; Mountain: - 7/ - 6
/// "PST" / "PDT" / ; Pacific: - 8/ - 7
/// ;
/// %d65-73 / ; Military zones - "A"
/// %d75-90 / ; through "I" and "... | Rust | 0 |
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
charSet = set()
l = 0
res = 0
for r in range(len(s)):
while s[r] in charSet:
charSet.remove(s[l])
l+=1
charSet.add(s[r])
res = max(res, r-l+1)
... | Python | 1 |
from django.urls import path
from rest_framework.routers import SimpleRouter
from rest_framework_simplejwt.views import (
TokenObtainPairView,
TokenRefreshView,
TokenVerifyView,
)
from .viewsets import AuthenticationCreateUser
app_name = "tokens"
routers = SimpleRouter()
routers.register('api/v1', Aut... | Python | 1 |
ution(self.exec_id)
def logs(self, delay=5):
"""Execution log generator.
:param delay: time in seconds between each server poll
Yields line by line.
"""
finishing = False
offset = 0
while True:
logs = self._session.get_execution_logs(
exec_id=self.exec_id,
offset=... | Python | 1 |
ctx.set_active(false);
if ctx.is_hot() {
ctx.submit_command(TREE_ACTIVATE_NODE.to(self.widget.id()));
}
ctx.request_paint();
}
}
_ => (),
}
self.widget.event(ctx, event,... | Rust | 0 |
GeneratedVisitor)",
Indent(2)
)?;
write_deserialize_end(0, writer)?;
Ok(())
}
fn write_visitor<W: Write>(
writer: &mut W,
indent: usize,
rust_type: &str,
variants: &[(String, String)],
) -> Result<()> {
// Protobuf supports deserialization of enumerations both from string and i... | Rust | 0 |
/// A view into a vacant entry in a `HashMap`.
/// It is part of the [`Entry`] enum.
#[stable(feature = "rust1", since = "1.0.0")]
pub struct VacantEntry<'a, K: 'a, V: 'a> {
base: base::RustcVacantEntry<'a, K, V>,
}
#[stable(feature = "debug_hash_map", since = "1.12.0")]
impl<K: Debug, V> Debug for VacantEntry<'_,... | Rust | 0 |
egorized_files:
categorized_files.append(categorized_file_path)
else:
categorized_file_path = os.path.join(output_dir, "旁白.txt")
new_paragraph = f"{block}{custom_symbol}"
if use_custom_logic:
# C... | Python | 1 |
one bit at a time */
pub fn randomnum(q: &BIG,rng: &mut RAND) -> BIG {
let mut d=DBIG::new();
let mut j=0;
let mut r:u8=0;
let t=BIG::new_copy(q);
for _ in 0..2*t.nbits() {
if j==0 {
r=rng.getbyte();
} else {r>>=1}
let b= ... | Rust | 0 |
eps_max = np.amin(f[min_ind] / g[min_ind])
# find a lower bound on the step
max_ind = np.logical_and(g > 0,
f < -np.sqrt(np.finfo(np.float64).eps))
eps_min = np.amax(f[max_ind] / g[max_ind])
# randomly sample eps
ep... | Python | 1 |
le) as err:
print('error opening %s: %s' % (cache_ent, err), file=stderr)
exit(1)
safe_mkdirs(path.dirname(args.o))
if exclude:
try:
shutil.copyfile(cache_ent, args.o)
except (shutil.Error, IOError) as err:
print('error copying to %s: %s' % (args.o, err), file=stderr)
exit(1)
try:
check_... | Python | 1 |
executor, image, scrollable, slider, time, Align, Application, Button, Column, Command,
Container, Element, HorizontalAlignment, Length, Radio, Row, Scrollable, Settings, Slider,
Subscription, Text, VerticalAlignment,
};
use rand::SeedableRng;
use std::{collections::VecDeque, time::Duration};
const MAX_GRAPH_... | Rust | 0 |
tx_templar_boot.dds", 0x4651_470B, 0x9EBF_5A29),
(r"icons\n\tx_t_bug_musk_01.dds", 0x465E_2531, 0x4BC7_3B87),
(r"icons\n\tx_trama_root_01.dds", 0x465E_261C, 0xEE97_79CC),
(r"textures\tx_menubook_quests_active_over.dds", 0x4664_690D, 0x3F47_2528),
(r"textures\tx_menubook_quests_all_pressed.dds", 0x46... | Rust | 0 |
# ©️ LISA-KOREA | @LISA_FAN_LK | NT_BOT_CHANNEL | LISA-KOREA/YouTube-Video-Download-Bot
# [⚠️ Do not change this repo link ⚠️] :- https://github.com/LISA-KOREA/YouTube-Video-Download-Bot
from pyrogram import Client, filters
import yt_dlp
# Define a command handler to generate thumbnail
@Client.on_message(filters.com... | Python | 1 |
R: io::Read,
{
let mut total_read = 0;
while !buf.is_empty() {
match this.read(buf) {
Ok(0) => break,
Ok(n) => {
total_read += n;
let tmp = buf;
buf = &mut tmp[n..];
}
Err(ref e) if e.kind() == io::ErrorK... | Rust | 0 |
import numpy as np
def exploration_phase(Npop, Max_it, lb, ub, nD, fobj):
pos = np.random.uniform(lb, ub, (Npop, nD))
fit = np.array([fobj(ind) for ind in pos])
xposbest = pos[np.argmin(fit)]
fvalbest = np.min(fit)
Curve = []
for T in range(Max_it):
newpos = pos.copy()
for i in... | Python | 1 |
)
print("✅ Tools enhanced with streaming support")
print("✅ SSE manager operations functional")
print("✅ Ready for real-time streaming responses")
return True
except Exception as e:
print(f"\n❌ SSE test failed: {e}")
import traceback
tracebac... | Python | 1 |
ing `a` with `b`, or
/// `None` if the edge does not exist in the graph.
pub fn edge_weight_mut(&mut self, a: N, b: N) -> Option<&mut E> {
self.edges.get_mut(&edge_key(a, b))
}
/// Return an iterator over all edges of the graph with their weight in arbitrary order.
///
/// Iterator elem... | Rust | 0 |
save_img_path = os.path.join(img_dir, '{:s}_{:d}.png'.format(\
img_name, current_step))
util.save_img(out_img, save_img_path)
# calculate PSNR
if len(gt_img.shape) == 2:
gt_img = np.expand_dims(gt_img, axis=2)... | Python | 1 |
true
);
} else {
buf_writer.write_borrow_object_property(
id_oplan.class_id, id_oplan.predicate_id,
oval.as_str(), false);
}
if !oiter.advance() {
break;
}
}
}... | Rust | 0 |
p_id': episode_id},
headers=headers)
premium_only = play_info.get('code') == -10403
play_info = traverse_obj(play_info, ('result', 'video_info', {dict})) or {}
formats = self.extract_formats(play_info)
if not formats and (premium_only or '成为大会员抢先看' in webpage or '开通大会员观看' in... | Python | 1 |
from django import forms
from .models import SensorType
class AddSensordeviceForm(forms.Form):
# more fields, see https://docs.djangoproject.com/en/1.10/ref/forms/fields/
# get user information
name_pate = forms.CharField(label='Your name', initial="")
email_pate = forms.EmailField(label='Your email... | Python | 1 |
from unittest import TestCase, main
class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> int:
return self.solve_dp(text1, text2)
"""
Runtime: 441 ms (Beats 85.60%)
Time Complexity: O(m * n)
- text1, text2의 길이를 각각 m, n이라 하면 이중 for문 조회에 O(m * n)
- i. dp ... | Python | 1 |
luate(pop, x_add2)
Sol = pop[pop[:,0].argsort()]
minVal = min(Sol[:,0])
###############################################
#Check convergence
if minVal >= lastMin:
noImprove += 1
# elif abs(lastMin-minVal)/lastMin > tol:
# noImprove += 1
... | Python | 1 |
ick: "birch".to_string(),
ident: None,
host: None,
is_server: true,
};
socket.write_message(&RawMessage::new_with_source(
birch.clone(),
"001",
&[&self.nick, "welcome to birch"],
))?;
for msg in self.init_buffer.it... | Rust | 0 |
# coding=utf-8
import json
import os
import random
import re
import time
import webbrowser
from datetime import datetime
from pathlib import Path
from typing import Dict, List, Tuple, Optional, Union
import pytz
import requests
import yaml
VERSION = "2.0.2"
# === 配置管理 ===
def load_config():
"""加载配置文件"""
c... | Python | 1 |
class Carro:
def __init__(self, marca, color):
self.marca = marca
self.color = color
self.frenar = True
def movimiento(self):
self.frenar = False
print(f"el carro color {self.color} está en movimiento")
def freno(self):
self.frenar = True
print(f"el ... | Python | 1 |
), k8s_openapi::RequestError> {
let __url = format!("/apis/build.openshift.io/v1/namespaces/{namespace}/buildconfigs?",
namespace = k8s_openapi::percent_encoding::percent_encode(namespace.as_bytes(), k8s_openapi::percent_encoding2::PATH_SEGMENT_ENCODE_SET),
);
let mut __query_pairs =... | Rust | 0 |
# pip install modelscope
from modelscope import snapshot_download
model_dir = snapshot_download(
model_id = 'llm-research/meta-llama-3.1-8b-instruct',
cache_dir = '/root/autodl-tmp/models',
)
print(model_dir) | Python | 1 |
'\\').replace('59', ';').replace('39', '\'').replace('44', ',').replace('46', '.').replace('47', '/').replace('123', '{').replace('125', '}').replace('124', '|').replace('58', ':').replace('34', '"').replace('60', '<').replace('62', '>').replace('63', '?').replace('32', ' ').replace(',', '').replace('65', 'A').replace... | Python | 1 |
\
0\x02\xa9\x0e\xeeQlD^>\x5c3\x9e?{\x0a\
u\xf1\xfb\xeaE\xdc\xf5\xcd\x03\xde\xdf\xde\xb9yD\xb0\
\xae\x82\x9f\xbe\xfc\xc4\xff\x7f\xdb\xa8\x9b]\xc5\x9b\xcb\x1b\
K\xec6o\x05P\xc17\xe7\xefq\xbb}\x00;\xdb\
W\xc9\x80\xe8\x97\xaf\x9e\xf9zL\x80(&\x9aqz\
z\x88\x93\x93\x13L\xa6t\x04\xd2\x19\xc2kL\xba\xcb\
\xf5\x8d\xc4=o\xb6x}y\x9... | Python | 1 |
in treebank.tagged_words(item):
orig.append(word)
stemmed.append(stemmer.stem(word))
# Convert the results to a string, and word-wrap them.
results = " ".join(stemmed)
results = re.sub(r"(.{,70})\s", r"\1\n", results + " ").rstrip()
# Convert the original to a string, and word... | Python | 1 |
ry <n_jobs>`
for more details.
**kwds : optional keyword parameters
Any further parameters are passed directly to the kernel function.
Returns
-------
K : ndarray of shape (n_samples_X, n_samples_X) or (n_samples_X, n_samples_Y)
A kernel matrix K such that K_{i, j} is the kerne... | Python | 1 |
reads: AtomicU64,
bytes_read: AtomicU64,
writes: AtomicU64,
bytes_written: AtomicU64,
writes_nodes: AtomicU64,
bytes_written_nodes: AtomicU64,
removed_nodes: AtomicU64,
bytes_removed_nodes: AtomicU64,
reads_cache: AtomicU64,
bytes_read_cache: AtomicU64,
}
impl StateUsageStats {
/// New empty usage stats.
pu... | Rust | 0 |
import fs_driver
#
# Show mixed LTR, RTL and Chinese label
#
ltr_label = lv.label(lv.scr_act())
ltr_label.set_text("In modern terminology, a microcontroller is similar to a system on a chip (SoC).")
# ltr_label.set_style_text_font(ltr_label, &lv_font_montserrat_16, 0);
fs_drv = lv.fs_drv_t()
fs_driver.fs_register(fs_... | Python | 1 |
Result<(), std::fmt::Error> {
// self.write_trace(&mut std::fmt::stdout(), evaluation_state, error)
// }
}
fn print_code_location(
out: &mut impl std::fmt::Write,
start: &CodeLocation,
end: &CodeLocation,
) -> Result<(), std::fmt::Error> {
if start.line == end.line {
if start.column == end.column {
write!... | Rust | 0 |
from django.db import migrations
def add_trello_friendly_names(apps, schema_editor):
ToolFriendlyName = apps.get_model("api", "ToolFriendlyName")
entries = {
"trello-create-card": "Trello - Create Card",
"trello-get-cards-on-board": "Trello - Get Cards On Board",
"trello-get-cards-in-... | Python | 1 |
import tensorflow as tf
from tensorflow.contrib import slim
from avb.ops import *
def encoder(x, config, is_training=True):
df_dim = config['df_dim']
z_dim = config['z_dim']
output_size = config['output_size']
# Center x at 0
x = 2*x - 1
n_down = max(min(int(math.log(output_size, 2)) - 2, 4),... | Python | 1 |
description="A datetime parameter",
)
with self.assertRaises(ValueError):
kp.DateTimeParameter(
label="Wrong datetime",
default_value=12345,
description="A datetime parameter",
)
def test_date_format(self):
... | Python | 1 |
"XMLHttpRequest"
.from_case(Case::Pascal)
.to_case(Case::Snake)
);
}
#[test]
fn leading_tailing_delimeters() {
assert_eq!(
"leading_underscore",
"_leading_underscore"
.from_case(Case::Snake)
... | Rust | 0 |
#[inline(always)]
pub fn arbitration_lost_int_ena(&mut self) -> ARBITRATION_LOST_INT_ENA_W {
ARBITRATION_LOST_INT_ENA_W { w: self }
}
#[doc = "Bit 6 - reg_mst_txfifo_udf_int_ena"]
#[inline(always)]
pub fn mst_txfifo_udf_int_ena(&mut self) -> MST_TXFIFO_UDF_INT_ENA_W {
MST_TXFIFO_UDF_... | Rust | 0 |
t;
}
<reponame>elertan/shaku<gh_stars>10-100
#![allow(dead_code)]
// This test ensures that injected components still work without using `dyn`
#![allow(bare_trait_objects)]
use shaku::{Component, Interface};
use std::sync::Arc;
#[derive(Component)]
#[shaku(interface = Foo)]
struct TestComponent {
var1: String,
... | Rust | 0 |
t_status(1);
}
#[cfg(any(feature = "google-cloud-recaptchaenterprise-v1"))]
pub mod v1;
#[cfg(any(feature = "google-cloud-recaptchaenterprise-v1beta1"))]
pub mod v1beta1;
<filename>vss/src/devices/mod.rs
mod image_device;
mod remote_device;
mod video_device;
mod window_device;
pub use self::image_device::*;
pub use se... | Rust | 0 |
&[ValueType::I32; 14], Some(ValueType::I32)),
("ontio_contract_migrate", &[ValueType::I32; 14], Some(ValueType::I32)),
("ontio_contract_destroy", &[], None),
("ontio_storage_read", &[ValueType::I32; 5], Some(ValueType::I32)),
("ontio_storage_write", &[ValueType::I32; 4], None),
("ontio_storage_dele... | Rust | 0 |
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
self
}
fn descriptor(&self) -> &'static ::protob... | Rust | 0 |
ang-4.0-O1.json')
lab2_tmplate('lab2_O0XO2', 'experiment/lab2_clang-4.0-O0VSclang-4.0-O2.json')
lab2_tmplate('lab2_O0XO3', 'experiment/lab2_clang-4.0-O0VSclang-4.0-O3.json')
lab2_tmplate('lab2_O1XO2', 'experiment/lab2_clang-4.0-O1VSclang-4.0-O2.json')
lab2_tmplate('lab2_O1XO3', 'experiment/lab2_clang-4.... | Python | 1 |
(&self.syntax) }
pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T ! [.]) }
pub fn l_paren_token(&self) -> SyntaxResult<SyntaxToken> {
support::required_token(&self.syntax, T!['('])
}
pub fn qualifier(&self) -> SyntaxResult<TsEntityName> { support::required_node(&self.syntax) }
pub ... | Rust | 0 |
Control,
Debug
}
<filename>src/devices/tools/banjo/src/backends/cpp.rs
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
crate::ast::{self, BanjoAst, Ident},
crate::backends::c::{array_bo... | Rust | 0 |
ref agora::media::IAudioFrameObserver::onPlaybackAudioFrame "onPlaybackAudioFrame" callback.
*
* @param enabled
* - true: Enables the external audio sink.
* - false: (Default) Disables the external audio sink.
* @param sampleRate Sets the sample rate (Hz) of the external audio sink, which can b... | Rust | 0 |
from django import template
from devices.models import Device
from blog.models import Post
from django.utils import timezone
from website.models import Contact, HomePage, Hyperlink
register = template.Library()
@register.inclusion_tag("website/index-devices.html")
def display_devices():
devices = Device.objects... | Python | 1 |
XOSC / HPOSC 1: CLK_DCDC is always 48 MHz clock from RCOSC"]
#[inline(always)]
pub fn clk_dcdc_src_sel(&self) -> CLK_DCDC_SRC_SEL_R {
CLK_DCDC_SRC_SEL_R::new(((self.bits >> 24) & 0x01) != 0)
}
#[doc = "Bits 15:23 - 23:15\\]
Software should not rely on the value of a reserved. Writing any other ... | Rust | 0 |
Left(1, 0,3,0,0,0,0,0,0),
Left(2, 0,0,3,0,0,0,0,0),
Left(3, 0,0,0,3,0,0,0,0),
Left(4, 0,0,0,0,3,0,0,0),
Left(5, 0,0,0,0,0,3,0,0),
Left(6, 0,0,0,0,0,0,3,0),
];
// init clear
lp.clear()?;
loop {
// iter through all rows and draw
for r in 0..8 {
let bounce = &rows[r];
draw_row(r as u8, ... | Rust | 0 |
clone();
let res = exec.block_on( async
{
increment( 4, ex2, tx );
rx.next().await.expect( "Some" )
});
assert_eq!( 5u8, res );
}
// pass a &TokioCt to a function that takes exec: `&impl Spawn`
//
#[ test ]
//
fn spawn_ref()
{
let (tx, mut rx) = mpsc::channel( 1 );
let exec = TokioCtBuilder::new... | Rust | 0 |
from typing import List
class Solution:
def minDominoRotations(self, tops: List[int], bottoms: List[int]) -> int:
uniqueTop=set(tops)
uniqueBottom=set(bottoms)
minSwaps=float("inf")
#loop over to make all the elements equal to uniquetop Element
for match in uniqueTop:
... | Python | 1 |
on the thread's message queue.
///
/// The message can be for any window from this thread, or it can be a
/// non-window message as well.
///
/// * MSDN: [`GetMessageW`](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmessagew)
#[cfg_attr(feature = "track_caller", track_caller)]
pub fn get_thr... | Rust | 0 |
import os
import argparse
import subprocess
# CVE-1999-1391: Vulnerability in NeXT 1.0a and 1.0 with publicly accessible printers
# This vulnerability allows local users to gain privileges via a combination of the npd program and weak directory permissions.
# Exploiting the weak permissions, local users can leverage t... | Python | 1 |
n = 0
cat_found = False
while True:
s = input("Введите строку или 'СТОП' для завершения: ")
if s.lower() == 'стоп':
break
n += 1
if 'кот' in s.lower():
cat_found = True
break
if cat_found:
print(f"Кот был упомянут в строке номер {n}.")
else:
print(-1)
| Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import pos_config
from . import pos_order
from . import pos_payment
from . import pos_restaurant
| Python | 1 |
assert_eq!(cpu.get8(A), 128u8);
// HC only
assert!(!cpu.reg.is_set(Zero));
assert!(!cpu.reg.is_set(Carry));
assert!(cpu.reg.is_set(HalfCarry));
assert!(!cpu.reg.is_set(Sub));
}
#[test]
fn add_16_bit() {
let mut cpu = CPU::new();
// simple add, no flags set
cpu.set16(BC, 256u16);
cp... | Rust | 0 |
{
Box::new(VStack {
id: Uuid::new_v4(),
children,
position: Position::new(0.0, 0.0),
dimension: Dimension::new(100.0, 100.0),
spacing: 10.0,
cross_axis_alignment: CrossAxisAlignment::Center,
})
}
pub fn cross_axis_alignmen... | Rust | 0 |
'referer': 'https://www.thonk.co.uk/my-account/add-payment-method/',
'sec-ch-ua': '"Not-A.Brand";v="99", "Chromium";v="124"',
'sec-ch-ua-mobile': '?1',
'sec-ch-ua-platform': '"Android"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-... | Python | 1 |
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct BatchEndpoint {
#[serde(flatten)]
pub endpoint_properties_base: EndpointPropertiesBase,
#[doc = "Batch endpoint default values"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub defaults: Option<BatchEndpointDefault... | Rust | 0 |
"""执行本接口操作的员工信息。
注: `在调用此接口时,请确保指定的员工已获得所需的接口调用权限,并具备接口传入的相应资源的数据权限。`
:rtype: :class:`tencentcloud.ess.v20201111.models.UserInfo`
"""
return self._Operator
@Operator.setter
def Operator(self, Operator):
self._Operator = Operator
@property
def FlowId(self):
"""... | Python | 1 |
cwd("ignores_units");
assert_eq!(
runner.ok("a {b: random(1px)}\n"),
"a {\
\n b: 1;\
\n}\n"
);
}
#[test]
fn named() {
let runner = runner().with_cwd("named");
assert_eq!(
runner.ok("$value: random($limit: 10);\
\na {b: $value > 0 and $value <= 10}\... | Rust | 0 |
}
}
#[derive(Clone)]
pub struct #vertical_name {
#(#vertical_fields,)*
_row_view: #name,
_order_by: Vec<yukino::query_builder::OrderByItem>
}
impl yukino::view::VerticalView<#entity_name> for #v... | Rust | 0 |
"""
Test Service Helpers
"""
import pytest
from common_layer.xml.txc.helpers.service import extract_flexible_pattern_stop_refs
from common_layer.xml.txc.models import (
TXCFixedStopUsage,
TXCFlexibleJourneyPattern,
TXCFlexibleStopUsage,
)
@pytest.mark.parametrize(
"flexible_jp,expected_refs",
[
... | Python | 1 |
of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Answer requests for availability chunks.
use std::sync::Arc;
use futures::channel::oneshot;
use elexeum_node_network_protocol::{
request_response::{incoming, v1, IncomingRequest, IncomingRequestReceiver},
U... | Rust | 0 |
oper_ctypes)]
extern "unadjusted" {
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v2f64.p0f64")]
fn vld1q_f64_x4_(a: *const f64) -> float64x2x4_t;
}
vld1q_f64_x4_(a)
}
/// Load multiple 2-element structures to two registers
#[inline]
#[target_feature(enable = "neo... | Rust | 0 |
ts associated with a drawing.
Returns:
Numpy data array with substituted values.
"""
def substitute(val: types.Coordinate):
if val == types.AbstractCoordinate.LEFT:
return self.parent.time_range[0]
if val == types.AbstractCoordinate.RIGHT:
... | Python | 1 |
um<I>> {
let mut v = (*self.db.trait_datum(trait_id)).clone();
v.binders = Binders::new(
v.binders.binders.clone(),
TraitDatumBound {
where_clauses: Vec::new(),
},
);
Arc::new(v)
}
fn adt_datum(&self, adt_id: chalk_ir::AdtId<I>... | Rust | 0 |
Ok(())
}
fn pin(self: Box<Self>, session: &mut Session) -> Fallible<()> {
match session.project_mut()? {
Some(project) => {
project.pin_npm(None)?;
let bundled_version = match project.platform() {
Some(platform) => {
... | Rust | 0 |
_hero(self):
try:
name = input("Please enter your name: ")
self.__hero = Event.Hero(name)
print(f"\nThere is not much time, {self.__hero.get_name()}. There are {self.__days_until_world_end} days before the Black Dragon completes his ritual and destroys the world.")
... | Python | 1 |
}
//type DefaultCDF16 = FrequentistCDF16;
//type DefaultCDF16 = BlendCDF16;
type DefaultCDF16 = CombinationCDF16;
fn determine_cost(cdf: &DefaultCDF16,
nibble: u8) -> f64 {
let pdf = cdf.pdf(nibble);
assert!(pdf != 0);
let prob = (pdf as f64) / (cdf.max() as f64);
return -prob.log... | Rust | 0 |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2023, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | Python | 1 |
::single(
PotentialOrigin::EngineGenerator(self.number),
self.output_potential,
)
} else {
Potential::none()
}
}
}
provide_potential!(EngineGenerator, (110.0..=120.0));
provide_frequency!(EngineGenerator, (390.0..=410.0));
provide_load!(EngineG... | Rust | 0 |
from pydantic import BaseModel, Field
from typing import List, Optional
class Ingredient(BaseModel):
name: str = Field(
...,
title="Название ингридиента",
min_length=1,
max_length=50
)
class Config:
orm_mode = True
class Recipe(BaseModel):
name: str = Field(
... | Python | 1 |
ckpt,
task,
dir_p + res_pth,
test_set_take_num=500,
mnt=256,
base_model_name=base_model_name1,
)
... | Python | 1 |
"""
"""
def get_generating_args(self):
return {
"temperature": self.temperature,
"top_p": self.top_p,
"top_k": self.top_k,
"num_beams": self.num_beams,
"max_length": self.max_length,
"max_new_tokens": self.max_new_tokens,
... | Python | 1 |
builtins() -> HashMap<LocalIntern<String>, Variable> {
macro_rules! builtins {
($($name:expr => $value:expr,)*) => {{
let mut variables = HashMap::default();
$({
let name = LocalIntern::from($name);
variables.insert(
name,
... | Rust | 0 |
}
}
let (update_secret, common_ancestor) = self.apply_handshake(handshake, sender_tree_idx, my_path_secret)?;
let direct_path_pub_keys = handshake.path.node_msgs.iter().map(|m| &m.public_key);
self.tree.set_public_keys(sender_tree_idx, common_ancestor, direct_path_pub_keys.... | Rust | 0 |
# -*- coding: utf-8 -*-
import codecs
import sys
from itertools import izip
from collections import defaultdict as dd
if len(sys.argv)!=6:
print("USAGE: <child source data file> <child target data file> <count threshold> <output model file> <parent source data file>")
sys.exit()
source_file = codecs.open(sys.argv[1]... | Python | 1 |
, 0.0, 10.0);
let (reso_x, reso_y) = (100, 100);
let conf1 = StewartPotentialGrid::new(2.5,
2.0,
SmoothType::Exponential,
&bbox,
reso_x,
... | Rust | 0 |
&'static IoEnv
/// }
///
/// impl IoPlugin for Example {
/// type Error = Error;
///
/// const NAME: &'static str = "example";
///
/// fn open(env: &'static IoEnv) -> Result<Self, Self::Error> {
/// writeln!(env.stdout(), "example sudo plugin initialized");
///
/// Ok(Example { env })
/// ... | Rust | 0 |
libc::IP_MULTICAST_LOOP,
multicast_loop_v4 as c_int,
)
}
}
pub fn multicast_ttl_v4(&self) -> io::Result<u32> {
unsafe {
let raw: c_int = self.getsockopt(libc::IPPROTO_IP, libc::IP_MULTICAST_TTL)?;
Ok(raw as u32)
}
}
... | Rust | 0 |
mand,
QueryPriority,
PeerPriority,
};
use mydht::dhtif::{
Result as MResult,
};
use mydht::service::{
SpawnSend,
};
use mydht::dhtimpl::{
SimpleRules,
};
use mydht::peer::{
Peer,
PeerMgmtMeths,
};
use mydht::api::{
DHTIn,
};
use std::time::Duration;
use mydht_bincode::Bincode;
use std::borrow::Borrow;
u... | Rust | 0 |
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
class Scrapy01Pipeline:
def process_item... | Python | 1 |
OVERSAMPLE_HUM: u8 = 2;
//Forced mode: perform one measurement, store result and return to sleep mode
const MODE: u8 = 1;
const CONTROL: u8 = OVERSAMPLE_TEMP << 5 | OVERSAMPLE_PRES << 2 | MODE;
//Register locations
const REG_DATA: u8 = 0xF7;
const REG_CONTROL: u8 = 0xF4;... | Rust | 0 |
# with open(".test_data/sample_responses/plans_list.json", "w") as f:
# json.dump(plans_list, f, indent=4)
else:
with open(Path(".test_data/sample_responses/plans_list.json")) as f:
plans_list = json.load(f)
plans_df = _make_plans_df(plans_list=pla... | Python | 1 |
import uuid
from pcapi.connectors.big_query.queries.artist import ArtistAliasModel
from pcapi.connectors.big_query.queries.artist import ArtistModel
from pcapi.connectors.big_query.queries.artist import ArtistProductLinkModel
raw_artists_data = [
{
"artist_id": uuid.uuid4().hex,
"artist_name": "B... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.