text string | label_name string | labels int64 |
|---|---|---|
മ\u{d41}ഖം",
],
},
#[cfg(feature = "mn")]
crate::Annotation {
lang: "mn",
tts: Some("инээсэн царай"),
keywords: &["инээсэн царай", "инээх", "царай"],
},
#[cfg(feature = "mr")]
crate::Annotation {
lang: "mr",
... | Rust | 0 |
as e:
print(f"Error processing job {url}: {e}")
print(f"\nScraping complete! Processed {len(job_links)} jobs")
print(f"Results saved to: {self.csv_filename}")
except Exception as e:
print(f"Error durin... | Python | 1 |
};
let mut default = quote! { None };
for var in &gen.variants {
if var.metadata.default {
let init = var.builder_new(&gen.ident);
default = quote! { Some(#init) };
}
}
quote! {
#[automatically_derived]
#[allow(non_camel_case_types)]
#[... | Rust | 0 |
ET = 114u16,
ROOT = 115u16,
#[token(">")]
R_ANGLE = 116u16,
#[token(">=")]
R_ANGLE_EQ = 117u16,
#[token("]")]
R_BRACK = 118u16,
#[token("}")]
R_CURLY = 119u16,
#[token(")")]
R_PAREN = 120u16,
#[token(";")]
SEMICOLON = 121u16,
#[token("<<")]
SHL = 122u16,
#... | Rust | 0 |
lf.raw_description = description
for k, v in description.items():
if v == 'numpy':
self.description.update({
k: 'byte',
f'__{k}_type': 'int',
f'__{k}_shape': 'int'
})
elif v == 'str':
... | Python | 1 |
1001, 31, -2, 31, 1007, 31, 0, 33, 1002, 33, 7, 33, 1,
33, 31, 31, 1, 32, 31, 31, 4, 31, 99, 0, 0, 0,
];
let phases = [1, 0, 4, 3, 2];
assert_eq!(amplifiers(&memory, &phases), 65210);
}
#[test]
fn d7_ex4() {
let memory = vec![
3, 26, 1001, 26, -4, 26... | Rust | 0 |
;
fn prepare_font_atlas<T: TextureMap>(
gl: &Context,
fonts: &mut imgui::FontAtlas,
texture_map: &mut T,
) -> Result<GlTexture, InitError> {
#![allow(clippy::cast_possible_wrap)]
let atlas_texture = fonts.build_rgba32_texture();
let gl_texture = unsafe { gl.create_texture() }.map_err(InitErro... | Rust | 0 |
format!("{:?}", x)
}
// tile numbering follows alphabet order (not necessarily unicode order).
// rack: array of numbers. 0 for blank, 1 for A.
// board: 2D array of numbers. 0 for empty, 1 for A, -1 for blank-as-A.
// count: maximum number of moves returned.
// (note: equal moves are not stably sorted;
// different ... | Rust | 0 |
carving.setCarveLayerHeight( layerHeight )
importRadius = 0.5 * repository.importCoarseness.value * abs(edgeWidth)
carving.setCarveImportRadius(max(importRadius, 0.001 * layerHeight))
carving.setCarveIsCorrectMesh( repository.correctMesh.value )
loopLayers = carving.getCarveBoundaryLayers()
if len( loopLay... | Python | 1 |
panic!("received an unexpected response type!"),
}
}
async fn get_self_address(ws_stream: &mut WebSocketStream<MaybeTlsStream<TcpStream>>) -> String {
let self_address_request = json!({ "type": "selfAddress" }).to_string();
let response = send_message_and_get_json_response(ws_stream, self_address_request).... | Rust | 0 |
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from sphinx.testing.util import SphinxTestApp
@pytest.mark.sphinx(
'html',
testroot='ext-extlinks-hardcoded-urls',
confoverrides={'extlinks_detect_hardcoded_links': False},
)
def test_extlinks_detect... | Python | 1 |
1,0xa7,0x96,0x7c,0xab,],
ct: [0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,]
},
Aes256Test {
key: [0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,],... | Rust | 0 |
_add_guess(_thread_local._guesses_data, _thread_local._checked_paths,
game_path, f"Proton Non-Steam Game/{path_with_variant}/{game_name_variant} (AppID: {appid})",
False, state.game_abbreviations_lower, state.current_steam_app_id,
... | Python | 1 |
=> {
let mut res = vec![0xB3];
let mut encoded = CoinValue::encode_list(coin_values);
res.append(&mut encoded);
res
}
&PollEvent::SmartEmptied { dispensed: ref coin_values } => {
let mut res = vec![0xB4];
... | Rust | 0 |
;
for idx in order {
if let Some(target_idx) = targets[idx] {
let defending = &groups[target_idx];
let attacking = &groups[idx];
let damage = attacking.damage_to(defending);
let killed = defending.units.min(damage / defending.hit_points);
if killed... | Rust | 0 |
let mut board = Board::new();
let mut player = Player::TIK;
let mut board_states = HashMap::<Board, BoardState>::new();
loop {
let board_state = board_states.entry(board.clone()).or_insert(BoardState {
put_states: (0..9).fold(vec![], |mut states, i| {
if !board.tik[i... | Rust | 0 |
import os
from pgse.environment.args import get_parser
from pgse import TrainingPipeline, InferencePipeline
from pgse.log import logger
def train():
parser = get_parser()
args = parser.parse_args()
pipeline = TrainingPipeline(
args.data_dir,
args.label_file,
args.pre_kfold_info_f... | Python | 1 |
import copy
import itertools
from tqdm import tqdm
from utils.open_and_read import open_and_read
path="sample.txt"
data = open_and_read(path)
for idx, line in enumerate(data):
data[idx] = list(line.strip())
directions = [(0,-1),(1,0),(0,1),(-1,0)]
list_of_positions ={}
score = 0
group = 0
def get_spot(point):... | Python | 1 |
{}: {}", fname, err));
return contents.lines().enumerate().map(
|(lineno, line)| {
line.parse().unwrap_or_else(|err| panic!("Parse error at '{}' in {} on line {}: {}", line, fname, lineno+1, err))
}
).collect();
}
fn main() {
let matches = App::new("Advent of code 2020, Day 09... | Rust | 0 |
dir_path = f"../Instances/Benchmark/Hurink/{set_name}/J{job_num}_M{machine_num}/"
instances_files = os.listdir(dir_path)
instances_files.sort()
solutions = []
for method in methods:
# print(method.__name__)
all_times = []
... | Python | 1 |
TinySet;
use crate::docset::{DocSet, TERMINATED};
use crate::query::score_combiner::{DoNothingCombiner, ScoreCombiner};
use crate::query::Scorer;
use crate::DocId;
use crate::Score;
const HORIZON_NUM_TINYBITSETS: usize = 64;
const HORIZON: u32 = 64u32 * HORIZON_NUM_TINYBITSETS as u32;
// `drain_filter` is not stable ... | Rust | 0 |
t up the BlueMaestro BLE sensors."""
coordinator = entry.runtime_data
processor = PassiveBluetoothDataProcessor(sensor_update_to_bluetooth_data_update)
entry.async_on_unload(
processor.async_add_entities_listener(
BlueMaestroBluetoothSensorEntity, async_add_entities
)
)
e... | Python | 1 |
orch.float32)
# # refresh_point_map = point_map.clone()
# refresh_confidence_map = confidence_map.clone()
# # 创建图像的索引
# row_idx, col_idx = torch.meshgrid(torch.arange(H), torch.arange(W))
# row_idx = row_idx.flatten()
# col_idx = col_idx.flatten()
# kernel_size... | Python | 1 |
import os
import sys
import pytransform
#-----------------------------------------------------------
#
# Part 1: check internet time by ntp server
#
#-----------------------------------------------------------
def check_expired_date_by_ntp():
from ntplib import NTPClient
from time import mktime, strptime
... | Python | 1 |
# File: tests/workflows/conditions/test_regex_condition.py
import pytest
import re
from swarmauri_workflow_statedriven.conditions.regex_condition import RegexCondition
@pytest.mark.unit
def test_init_compiles_pattern():
"""
File: workflows/conditions/regex_condition.py
Class: RegexCondition
Method: _... | Python | 1 |
queue_family_index(vk::QUEUE_FAMILY_IGNORED),
]),
);
// Depth Image
context.device.cmd_pipeline_barrier2_khr(
frame_data.command_buffer,
&vk::DependencyInfoBuilder::new().image_memory_barriers(&[
vk::ImageMemoryBarrier2Builder::new()
... | Rust | 0 |
#=======================================================================
# Crossbar_test.py
#=======================================================================
from pymtl import *
from pclib.test import TestVectorSimulator
from Crossbar import Crossbar
#----------------------------------------------------... | Python | 1 |
copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
//! Global cache state.
use std::collections::{VecDeque, HashSet, HashMap};
use std::sync::Arc;
use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard};
use linked_hash_map::{LinkedHashMap, Entry};
use ha... | Rust | 0 |
# Copyright (C) 2012 Yahoo! Inc. 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.org/licenses/LICENSE-2.0
#
# Unless required... | Python | 1 |
T>) {
for (e, coll, _) in q_bp.query.iter() {
commands
.entity(e)
.insert(GameCleanup)
// editor integration
.insert(Editable)
.insert(crate::scene_exporter::SaveSceneMarker)
.insert(T::KINDENUM)
.insert(ColliderEditorVisCol... | Rust | 0 |
#Rock Paper Scissors
import random
op=['rock','paper','scissors']
while True:
while True:
user= input('Choose(rock, paper, scissors):')
if user not in op:
print('invalid')
continue
bot=random.choice(op)
print('Computer choice:',bot)
if user==bot:
... | Python | 1 |
"geometry": {
/// "type": "Point",
/// "coordinates": [102.0, 0.5]
/// },
/// "properties": null,
/// });
///
/// assert!(json_value.is_object());
///
/// let geojson: GeoJson = json_value.try_into().unwrap();
///
/// assert_eq!(
/// geojson,... | Rust | 0 |
rr_faces
face_ts += timestamps
face_boxes += curr_boxes
gray_prev = gray_curr
else:
gray_prev = cv2.cvtColor(curr_frame, cv2.COLOR_BGR2GRAY)
if last_timestamp != -1:
key_frame_ts.append(last_timestamp)
video... | Python | 1 |
"joule per megagram", "joules per megagram";
@joule_per_gigagram: prefix!(micro); "J/Gg", "joule per gigagram", "joules per gigagram";
@joule_per_teragram: prefix!(nano); "J/Tg", "joule per teragram", "joules per teragram";
@joule_per_petagram: prefix!(pico); "J/Pg", "joule per petagram", "joul... | Rust | 0 |
_children.append(node.get_json_dict())
for child in node.getChildren():
dfs_search(child)
# print_tree
dfs_search(root)
with open(save_file_path, 'w+') as f:
f.write(tree_str)
save_file_path = './output/%s/tree_output/%s_%s.json' % (self.args.ou... | Python | 1 |
!= 0 {
cart.direction *= TURN_LEFT;
} else if cart.direction.re != 0 {
cart.direction *= TURN_RIGHT
} else {
bail!("unable to follow path at {:?}", (cart_row, cart_column));
}
... | Rust | 0 |
final_B = np.block([
[-np.sin(psi)*delta_i0],
[-np.cos(psi) * np.cos(theta) * delta_i0],
[-1j*np.sin(psi) * n_I * np.cos(theta) * delta_i0],
[1j*n_I*np.cos(psi) * delta_i0]
]
)
final_X = np.linalg.inv(final_A) @ final_B
R_s = final_X[:ff, :].flatten(... | Python | 1 |
y) -> ToolCallingAgent | RequirementAgent:
if instance is not None:
new_instance = await instance.clone()
new_instance.memory = memory
return new_instance
return ToolCallingAgent(
llm=llm, # type: ignore
tools=tool... | Python | 1 |
re::fmt::Result {
f.debug_struct("POWER_NS").finish()
}
}
#[doc = "Power control"]
pub mod power_ns;
#[doc = "Reset control"]
pub struct RESET_NS {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for RESET_NS {}
impl RESET_NS {
#[doc = r"Pointer to the register block"]
pub const PTR: *const ... | Rust | 0 |
== False:
raise Exception('源数据不在word定义范围[0x00000000 - 0xFFFFFFFF],不能进行变换计算')
return _line_conv_LN(_no_line_conv(srcdata))
def _generate_ext_keys(initkey):
'''
通过密钥扩展算法生成加密算法的轮密钥
'''
if len(initkey) % 2 != 0:
raise Exception('加密密钥长度[%s]错误' % len(initkey))
... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Feeling of Contrast Index
=========================
:spd_to_fci(): Calculate Feeling of Contrast Index (FCI).
Created on Fri Oct 2 16:37:13 2020
@author: ksmet1977 at gmail.com
"""
import numpy as np
from luxpy import cat, cam, spd_to_xyz, _RFL, _CIE_D65, xyz_to_lab
from luxpy.utils... | Python | 1 |
all_ft.append(np.load(ft_path + ".npy"))
for ft_name in self.audio_ft:
ft_path = os.path.join(ft_root, ft_name, vname)
all_ft.append(np.load(ft_path + ".npy"))
min_len = min([len(ft) for ft in all_ft])
# TODO: use other sampling method (e.g. uniform sampling)
... | Python | 1 |
nst IMAGE_REL_ARM_BLX24: u32 = 8u32;
#[doc = "*Required features: 'Win32_System_SystemServices'*"]
pub const IMAGE_REL_ARM_BRANCH11: u32 = 4u32;
#[doc = "*Required features: 'Win32_System_SystemServices'*"]
pub const IMAGE_REL_ARM_BRANCH20T: u32 = 18u32;
#[doc = "*Required features: 'Win32_System_SystemServices'*"]
pub... | Rust | 0 |
let vendor_css_file = concat_vendor_css(vec!["tachyons"]);
let app_js_file = concat_app_js(vec![]);
AssetFiles {
css: CSSFiles {
app: app_css_file,
fonts: fonts_css_file,
vendor: vendor_css_file,
},
js: JSFiles { a... | Rust | 0 |
d1\xd2\xd2\x82\xdd\xbb\
w#>\xd0\x1f\x8aD\x22\x95\xe1p\xa4P\xd34\x95\
\x10\x92\x9d4\xf1\x8c\xaeXO\xb4)\x99Jp\xca\x00\
!\xbe?\x00\x22\x84@$\x12!\xf3\xe6\xcd\xc3\xd8\xb1\
c\xf1\xe4\x93O\x8a\xb5k\xd7J\x8f>\xfa(?q\
\xe2\xd2\xa5K\xe5o:]I\x92\x88\xaa\xaa\xb4\xa7'\
\x0a]\xd7\x0b\xe6\x9d;\xef\xfa\xda\xda\xba\xc5\xa5e\x15\
\xb3\... | Python | 1 |
nore_case, O_IGNORECASE);
option_getter!(is_show_match, O_SHOWMATCH);
option_setter!(set_show_match, O_SHOWMATCH);
option_getter!(is_non_cyclic, O_NONCYCLIC);
option_setter!(set_non_cyclic, O_NONCYCLIC);
option_getter!(is_mouse_menu, O_MOUSE_MENU);
option_setter!(set_mouse_menu, O_MOUSE_MENU)... | Rust | 0 |
"""Find marc record URL from oclc number.
Usage: python oclc_to_marc.py oclc_1 oclc_2
"""
import sys
import urllib
import requests
root = "https://openlibrary.org"
def wget(path):
return requests.get(root + path).json()
def find_marc_url(d):
if d.get('source_records'):
return d['source_records']... | Python | 1 |
# app.py
import streamlit as st
from streamlit import session_state
import time
import base64
import os
os.environ["TOKENIZERS_PARALLELISM"] = "false"
from vectors import EmbeddingsManager # Import the EmbeddingsManager class
from chatbot import ChatbotManager # Import the ChatbotManager class
import nltk
nltk.do... | Python | 1 |
a> {
pub label: String,
pub usage: AttachmentUsage,
pub attachment_type: AttachmentType<'a>,
}
impl<'a> Attachment<'a> {
fn new(label: String, usage: AttachmentUsage, attachment_type: AttachmentType) -> Attachment {
Attachment {
label,
usage,
attachment_type,... | Rust | 0 |
ant être traversée par les rayons du
/// Soleil.
pub fn irradiance(air_mass: f64) -> f64 {
// `powf` est une contraction de "power" et "float", car on élève
// un nombre à une puissance réelle, et "float" signifie "nombre
// à virgule flottante" en anglais.
1.353 * 0.7f64.powf(air_mass.powf(0.678)) * 10... | Rust | 0 |
cessed_time': datetime.now().isoformat(),
'roll_no': roll,
'name': name,
'images_used': len(embs),
'embedding': mean_emb
}
logging.info("%s -> %d images processed", folder_name, len(embs))
else:
logging.warning("... | Python | 1 |
xffffffff]
/// Output Bounds:
/// out1: [0x0 ~> 0xffffffff]
/// out2: [0x0 ~> 0xffffffff]
#[inline]
pub fn fiat_secp256k1_mulx_u32(out1: &mut u32, out2: &mut u32, arg1: u32, arg2: u32) -> () {
let x1: u64 = ((arg1 as u64) * (arg2 as u64));
let x2: u32 = ((x1 & (0xffffffff as u64)) as u32);
let x3: u32 = ((x1 ... | Rust | 0 |
Self {
let index: usize = index.into().value() as usize;
let value: ::bobbin_bits::U1 = value.into();
let value: u32 = value.into();
let shift: usize = 0 + index;
self.0 &= !(0x1 << shift);
self.0 |= value << shift;
self
}
}
impl From<u32> for Otyper {
#... | Rust | 0 |
\\brief A rectangle, with the origin at the upper left."]
#[doc = ""]
#[doc = " \\sa SDL_RectEmpty"]
#[doc = " \\sa SDL_RectEquals"]
#[doc = " \\sa SDL_HasIntersection"]
#[doc = " \\sa SDL_IntersectRect"]
#[doc = " \\sa SDL_UnionRect"]
#[doc = " \\sa SDL_EnclosePoints"]
#[repr(C)]
#[derive(Debug, Default, Copy, C... | Rust | 0 |
ckend! Wayland status: {:?} X11 status: {:?}",
wayland_err,
x11_err,
);
panic!(err_string);
}
pub fn new_wayland() -> Result<EventLoop<T>, ConnectError> {
wayland::EventLoop::new()
.map(EventLoop::Wayland)
}
pub fn new_x11() -> Result<EventLo... | Rust | 0 |
# coding=utf-8
'''
作者:Jairus Chan
程序:多项式曲线拟合算法
'''
import matplotlib.pyplot as plt
import math
import numpy
import random
fig = plt.figure()
ax = fig.add_subplot(111)
#阶数为9阶
order=9
#生成曲线上的各个点
x = numpy.arange(-1,1,0.02)
y = [((a*a-1)*(a*a-1)*(a*a-1)+0.5)*numpy.sin(a*2) for a in x]
#ax.plot(x,y,color='r',linestyle... | Python | 1 |
ArcGenerator(vocabs, embed_dim, ff_embed_dim, num_heads, dropout)
self.concept_generator = ConceptGenerator(vocabs, embed_dim, ff_embed_dim, conc_size, dropout)
self.relation_generator = RelationGenerator(vocabs, embed_dim, rel_size, dropout)
self.dropout = dropout
self.vocabs = vocabs
... | Python | 1 |
pub enum Struct_rd_kafka_s { }
pub type rd_kafka_t = Struct_rd_kafka_s;
pub enum Struct_rd_kafka_topic_s { }
pub type rd_kafka_topic_t = Struct_rd_kafka_topic_s;
pub enum Struct_rd_kafka_conf_s { }
pub type rd_kafka_conf_t = Struct_rd_kafka_conf_s;
pub enum Struct_rd_kafka_topic_conf_s { }
pub type rd_kafka_topic_conf... | Rust | 0 |
self) -> &'static str {
match self {
LogEntry::Chunk => "chunk_executor",
LogEntry::Block => "block_executor",
LogEntry::Cache => "speculation_cache",
}
}
}
pub const EVENT: &str = "event";
// Copyright 2017 <NAME>
//
// Licensed under the Apache License, Version... | Rust | 0 |
from_static(b"Goodbye, and thanks for all the fish!")
);
}
}
use crate::custom_types::zig_zag_vec::ZigZagVec;
use super::header::Header;
#[derive(Debug, Default, Clone)]
pub struct Record {
pub attributes: i8,
pub timestamp: i64,
pub offset: i64,
pub key: ZigZagVec<u8>,
pub value: ZigZ... | Rust | 0 |
from arm.logicnode.arm_nodes import *
class DrawRectNode(ArmLogicTreeNode):
"""Draws a rectangle.
@input Draw: Activate to draw the rectangle on this frame. The input must
be (indirectly) called from an `On Render2D` node.
@input Color: The color of the rectangle.
@input Filled: Whether the r... | Python | 1 |
#!/usr/bin/env python
import rospy
import tf2_ros
from geometry_msgs.msg import Transform, TransformStamped
from nav_msgs.msg import Odometry
from std_msgs.msg import Header
class TFMap2Odom:
def __init__(self) -> None:
self.odom_frame_id = rospy.get_param("~odom_frame_id", "odom")
self.tf_pub =... | Python | 1 |
seed=seed,
optimize_memory_usage=optimize_memory_usage,
# Remove all tricks from TD3 to obtain DDPG:
# we still need to specify target_policy_noise > 0 to avoid errors
policy_delay=1,
target_noise_clip=0.0,
target_policy_noise=0.1,
_in... | Python | 1 |
fn calculate_crc(&mut self, data: &[u8]) -> Result<[u8; 2], Error<E>> {
// stop any ongoing command
self.command(Command::Idle).map_err(Error::Spi)?;
// clear the CRC_IRQ interrupt flag
self.write(Register::DivIrq, 1 << 2).map_err(Error::Spi)?;
// flush FIFO buffer
sel... | Rust | 0 |
ait
}
}
impl<T: Clone> Clone for CatalogServiceClient<T> {
fn clone(&self) -> Self {
Self {
inner: self.inner.clone(),
}
}
}
impl<T> std::fmt::Debug for CatalogServiceClient<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std... | Rust | 0 |
_30_ctrl_0: crate::Reg<ldo_30_ctrl_0::LDO_30_CTRL_0_SPEC>,
#[doc = "0x204 - LDO_30 control register 1"]
pub ldo_30_ctrl_1: crate::Reg<ldo_30_ctrl_1::LDO_30_CTRL_1_SPEC>,
_reserved32: [u8; 0x08],
#[doc = "0x210 - LDO_50 control register 0"]
pub ldo_50_ctrl_0: crate::Reg<ldo_50_ctrl_0::LDO_50_CTRL_0_S... | Rust | 0 |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import List
from typing_extensions import Literal, TypedDict
from .response_includable import ResponseIncludable
__all__ = ["InputItemListParams"]
class InputItemListParams(TypedDic... | Python | 1 |
BCSTART_Disabled: ::cty::c_uint = 0;
pub const RADIO_SHORTS_ADDRESS_BCSTART_Enabled: ::cty::c_uint = 1;
pub const RADIO_SHORTS_END_START_Pos: ::cty::c_uint = 5;
pub const RADIO_SHORTS_END_START_Msk: ::cty::c_uint = 32;
pub const RADIO_SHORTS_END_START_Disabled: ::cty::c_uint = 0;
pub const RADIO_SHORTS_END_START_Enable... | Rust | 0 |
let pos = pos + 1;
return Ok((cur_node, pos));
} else if let Ok((child_node, new_pos)) = p_generic_selection(toks, pos) {
cur_node.type_exp = child_node.type_exp.clone();
cur_node.child.push(child_node);
return Ok((cur_node, new_pos));
} else {
return Err(format... | Rust | 0 |
layer: Chain::new(layer, self.layer),
}
}
/// Create a `LayeredMakeService` from the composed layers and transport `MakeService`.
pub fn build_make_service<M, Target, Request>(self, mk: M) -> LayeredMakeService<M, L, Request>
where
M: MakeService<Target, Request>,
{
... | Rust | 0 |
let a: C = a;
drop(a);
drop(a);
}
}
match R(&L(&mk_c())) {
L(L(&a)) | L(R(&a)) | R(L(&a)) | R(R(&a)) => {
let a: C = a;
drop(a);
drop(a);
}
}
match Ok(mk_c()) {
Ok(ref a @ b) | Err(b @ ref a) => {
... | Rust | 0 |
sync-api")]
#[cfg_attr(feature = "doc", doc(cfg(feature = "sync-api")))]
pub mod sync_api;
mod tasks;
#[cfg(test)]
mod tests;
pub mod types;
mod utils;
#[cfg(feature = "async-api")]
#[cfg_attr(feature = "doc", doc(cfg(feature = "async-api")))]
pub use async_trait::async_trait;
pub use self::address::Address;
<reponam... | Rust | 0 |
from scipy.stats import kruskal
import scikit_posthocs as sp
import pandas as pd
def main():
# Normalized MSE values for each model
resnet_scores = [
0.99796612,
0.13624485,
0.74595548,
0.05540673,
-0.77483817,
-0.07071808,
-0.07071808,
1.6425548... | Python | 1 |
> <p>The broker node info.</p>
/// </code></pre>
#[serde(rename = "BrokerNodeInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_node_info: Option<BrokerNodeInfo>,
/// <pre><code> <p>The instance type.</p>
/// </code></pre>
#[serde(renam... | Rust | 0 |
print("Hello Anaconda") | Python | 1 |
10"))
font.setPointSize(11)
self.label.setFont(font)
self.label.setObjectName(_fromUtf8("label"))
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setEnabled(True)
self.statusbar.setObjectName(_fromUtf8("... | Python | 1 |
from slurm_launcher.sbatch_launcher import launch_tasks
def run():
gpu_option = 2
for data_level in [
("dropout",), # for continuous model
# ("dropout", "dropout_poisson500", "dropout_poisson1"), # for discrete model (use n_env 20)
]:
for graphs in [
("er", "sf",... | Python | 1 |
]
except KeyError:
conn = get_connection(module)
out = conn.get(cmd)
cfg = to_text(out, errors="surrogate_then_replace").strip()
_DEVICE_CONFIGS[cmd] = cfg
return cfg
def load_config(module, config):
try:
conn = get_connection(module)
conn.edit_config(co... | Python | 1 |
# main.py
from lyrics_generator import lyrics_composition
from audio_client import generate_and_get_audio
if __name__ == "__main__":
# 1. 사용자로부터 키워드를 입력받음
keyword = input("가사 키워드 입력 : ") # 키워드만 입력 받음
style = input("노래 스타일 입력 : ")
title = input("제목 입력 : ")
# 2. 동요 가사 생성
lyrics = lyrics_composi... | Python | 1 |
) => {
v.visit_expr(&call.callee);
for arg in &call.args {
v.visit_expr(arg);
}
}
Expr::TypeParam(ref expr) => {
v.visit_expr(&expr.callee);
for arg in &expr.args {
v.visit_type(arg);
}
}
... | Rust | 0 |
# Copyright Sierra
from typing import Any, Dict
from tau_bench.envs.tool import Tool
class Calculate(Tool):
@staticmethod
def invoke(data: Dict[str, Any], expression: str) -> str:
if not all(char in "0123456789+-*/(). " for char in expression):
return "Error: invalid characters in express... | Python | 1 |
100,
101,
},
12,
},
};
let expected = r##"
0
1
10
11
100
101
12
"##;
self::test_tree_manual_walk(tree.root_nodes(), expected);
}
#[test]
fn manual_traverse() {
let mut tree = Tree::<&'static str>::default();
let x = tr... | Rust | 0 |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import ssl
import socketpool
import wifi
import adafruit_minimqtt.adafruit_minimqtt as MQTT
# Add a secrets.py to your filesystem that has a dictionary called secrets with "ssid" and
# "password" keys with your W... | Python | 1 |
"-c " + \
"-e robots=off " + \
"-X robots.txt " + \
"-nH " + \
"-np " + \
"--cut-dirs=8 " + \
"--retr-symlinks " + \
"--retry-connrefused " ... | Python | 1 |
self
.y_coord()
.expect("coordinates are always defined for edwards curves");
Some(PointCoords { x: xrecover(&y), y })
}
fn serialize_compressed(&self) -> Self::CompressedPoint {
self.ge.to_bytes()
}
fn serialize_uncompressed(&self) -> Self::UncompressedPoint {... | Rust | 0 |
recycle5(100000+26*36**4+36**4, "b0000")
recycle5(100000+2*26*36**4-1, "zzzzz")
#
for width in [4,5]:
for value in [-(10**(width-1)), 10**width+2*26*36**(width-1)]:
try: hy36enc(width=width, value=value)
except (ValueError, RuntimeError) as e:
assert str(e) == "value out of range."
e... | Python | 1 |
},
PhendranaDriftsSouthQuarantineCave => {
pak_name: "Metroid3.pak",
name: "Phendrana Drifts South\0(Quarantine Cave)",// "Transport to Magmoor Caverns South",
mlvl: 0xa8be6291,
mrea: 0xdd0b0739,
mrea_idx: 29,
scly_id: 0x1d005a,
room_id: 0x31D08ACB,
... | Rust | 0 |
):
def __init__(
self,
num_features,
eps=1e-5,
momentum=0.1,
affine=True,
track_running_stats=True,
step_mode='s'
):
"""
* :ref:`API in English <BatchNorm3d-en>`
.. _BatchNorm3d-cn:
:param step_... | Python | 1 |
{
walk_speed: rng.gen(),
fly_speed: rng.gen(),
may_fly: rng.gen_bool(0.5),
flying: rng.gen_bool(0.5),
invulnerable: rng.gen_bool(0.5),
may_build: rng.gen_bool(0.5),
instabuild: rng.gen_bool(0.5),
}
}
}
#[derive(Archive, Ser... | Rust | 0 |
]
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
# Example configuration for intersphinx: refer ... | Python | 1 |
from cifar10_simple_flask_app import app
if __name__ == "__main__":
app.run(debug=True)
| Python | 1 |
class Solution:
def canPlaceFlowers(self, flowerbed: List[int], n: int) -> bool:
for i, flower in enumerate(flowerbed):
if flower == 0 and (i == 0 or flowerbed[i - 1] == 0) and (i == len(flowerbed) - 1 or flowerbed[i + 1] == 0):
flowerbed[i] = 1
n -= 1
if n <= 0:
return True
... | Python | 1 |
from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime
from typing import Any
from paddle_billing.Undefined import Undefined
from paddle_billing.Notifications.Entities.Shared import (
SavedPaymentMethodOrigin,
SavedPaymentMethodType,
)
from paddle_billing.Notificatio... | Python | 1 |
ent: GLuint, indirects: *const *mut void, sizes: *const GLsizei, states: *const GLuint, fbos: *const GLuint, count: GLuint);
/// glListParameterfSGIX
/// * `list` group: List
/// * `pname` group: ListParameterName
/// * `param` group: CheckedFloat32
pub type glListParameterfSGIX_t = unsafe extern "system" fn(list: GLu... | Rust | 0 |
method.expect_or_log
//! [`Option::unwrap_none_or_log()`]: https://docs.rs/tracing-unwrap/*/tracing_unwrap/trait.OptionExt.html#tymethod.unwrap_none_or_log
//! [`Option::expect_none_or_log(msg)`]: https://docs.rs/tracing-unwrap/*/tracing_unwrap/trait.OptionExt.html#tymethod.expect_none_or_log
use std::fmt;
//
// Exte... | Rust | 0 |
# sentiment_analyzer.py
class SentimentAnalyzer:
word_weights = {
"good": 1, "great": 2, "awesome": 3, "fantastic": 4, "amazing": 3, "love": 2, "like": 1, "liked": 2, "happy": 2, "wonderful": 3,
"excellent": 3, "positive": 2, "joy": 2, "pleasure": 2, "delight": 2, "satisfying": 2, "best": 3, "beaut... | Python | 1 |
# Copyright 2024-2205 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
from abc import ABC, abstractmethod
from datetime import datetime
from typing import Any, ClassVar
from pydantic import BaseModel
class SecretModel(BaseModel, ABC):
pre... | Python | 1 |
# Copyright 2024-2025 ModelCloud.ai
# Copyright 2024-2025 qubitium@modelcloud.ai
# Contact: qubitium@modelcloud.ai, x.com/qubitium
#
# 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... | Python | 1 |
o takes a series of functions whose contexts all have `into` implemented,
/// and then links them together to run in series. The result of this macro is a single `MiddlewareChain`.
///
#[macro_export]
macro_rules! middleware {
[ @tailtype $ctx:ty => $head:expr ] => { $ctx };
[ @tailtype $ctx:ty => $head:expr, $($ta... | Rust | 0 |
import datetime
from typing import Optional
import beanie
import pydantic
import pymongo
class ChatQA(beanie.Document):
created_date: datetime.datetime = pydantic.Field(default_factory=datetime.datetime.now)
prompt: str
question: str
answer: Optional[str] = None
email: str
podcast_id: str
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.