text string | label_name string | labels int64 |
|---|---|---|
TOKEN]["NNP"]);
assert_eq!(0.25, constrained_model.hidden_probs[0]["VBZ"]["NNP"]);
assert_eq!(0.0, constrained_model.hidden_probs[0]["NNP"]["RB"]);
assert_eq!(0.0, constrained_model.hidden_probs[0]["NNP"]["VBZ"]);
assert_eq!(0.0, constrained_model.hidden_probs[0]["RB"]["VBZ"]);
a... | Rust | 0 |
CVec_u8ZZNoneZPtr,
/// Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
pub result_ok: bool,
}
#[no_mangle]
/// Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
pub extern "C" fn CResult_CVec_CVec_u8ZZNoneZ_ok(o: crate::c_types::derived::CVec_CVec_u8ZZ) -> CResult_CVec_CVec_u8ZZNone... | Rust | 0 |
"""
File: doctorserver.py
Server for providing non-directive psychotherapy.
Uses client handlers to handle clients' requests.
"""
from socket import *
from doctorclienthandler import DoctorClientHandler
HOST = "localhost"
PORT = 6000
ADDRESS = (HOST, PORT)
server = socket(AF_INET, SOCK_STREAM)
server.bind(ADDRESS)
s... | Python | 1 |
wspace.uwaterloo.ca/bitstream/handle/10012/8621/Henry_Ryan.pdf
//! See also the attack on Peng and Bao’s batch proof protocol in
//! "Batch Proofs of Partial Knowledge" by <NAME> and <NAME>
//! https://www.cypherpunks.ca/~iang/pubs/batchzkp-acns.pdf
//!
//! We might reasonably ask if the VRF signer's public key should
... | Rust | 0 |
for r in 0..R {
self.data[c][r] += other.data[c][r];
}
}
}
}
impl<S, const R: usize, const C: usize, const RC: usize> ops::SubAssign<Matrix<S, R, C, RC>> for Matrix<S, R, C, RC>
where
S: Scalar
{
#[inline]
fn sub_assign(&mut self, other: Matrix<S, R, C, RC>... | Rust | 0 |
import numpy as np
import pickle as pkl
from scapy.all import *
import argparse
from manipulator import Manipulator
parse = argparse.ArgumentParser()
parse.add_argument('-m',
'--mal_pcap',
type=str,
required=True,
help="input malicious traffic... | Python | 1 |
ception e) {{
try {{
base64 = Class.forName("sun.misc.BASE64Decoder");
decoder = base64.newInstance();
bytes = (byte[]) decoder.getClass()
.getMethod("decodeBuffer", String.class)
.invoke(decoder, payload);
}... | Python | 1 |
Ext<<Self as InstantContext>::Instant>,
{
/// Returns a route for a socket.
///
/// If `device` is specified, the available routes are limited to those that
/// egress over the device.
fn lookup_route(
&self,
device: Option<Self::DeviceId>,
src_ip: Option<SpecifiedAddr<I::Add... | Rust | 0 |
IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pub type rdpAutoDetect = rdp_autodetect;
#[repr(C)]#[derive(Copy, Clone)]
pub struct rdp_autodetect {
pub context: *mu... | Rust | 0 |
:
await chan.aclose()
with pytest.raises(trio.ClosedResourceError):
await chan.receive()
async def test_as_safe_channel_close_during_iteration() -> None:
@as_safe_channel
async def agen() -> AsyncGenerator[None]:
await chan.aclose()
while True:
yield
... | Python | 1 |
) => Some(value.clone()),
None => panic!("downcast failed"),
},
None => None,
}
}
/// Get an existing value and setup a stream for updates at the same time.
pub fn stream<T>(&self) -> (Stream<T>, Option<T>)
where
T: Any + Send + Sync + 'static + C... | Rust | 0 |
if part.thought:
model_reasoning = part.text
else:
completion = part.text
final_answer = completion.lower().split("### answer:")[1].replace(".","").strip() if "### answer:" in completion.lower() else completion.strip()
el... | Python | 1 |
, "r", encoding="utf-8"
) as f:
for line in f:
text = line.strip().casefold()
words = text.split(" ")
file_id = words[0]
words = words[1:]
record = {}
... | Python | 1 |
period of this ChargeInfoForDescribeDBInstancePriceDetailInput. # noqa: E501
:type: int
"""
self._period = period
@property
def period_unit(self):
"""Gets the period_unit of this ChargeInfoForDescribeDBInstancePriceDetailInput. # noqa: E501
:return: The period_unit... | Python | 1 |
bytes(),
0xCDCDCDFF_u32.to_be_bytes(),
// bright
0x000000FF_u32.to_be_bytes(),
0x0000FFFF_u32.to_be_bytes(),
0xFF0000FF_u32.to_be_bytes(),
0xFF00FFFF_u32.to_be_bytes(),
0x00FF00FF_u32.to_be_bytes(),
0x00FFFFFF_u32.to_be_bytes(),
0xFFFF00FF_u32.to_b... | Rust | 0 |
ndimR = R.ndim
if ndimR == 1:
aR, sR0, sR1 = _checkRewardsListLike(R, aP, sP0)
elif ndimR == 2:
sR0, aR = R.shape
sR1 = sR0
elif ndimR == 3:
aR, sR0, sR1 = R.shape
else:
raise _error.InvalidError(_MDPERR["R_shape"])
except A... | Python | 1 |
print(f" 📝 Detailed logs:")
for log in step['logs']:
print(f" - {log}")
if step.get('output_data'):
output_data = step['output... | Python | 1 |
le1 = [...]
// cdb-check:struct tuple$<tuple$<type_names::Struct1,type_names::mod1::mod2::Struct3>,enum$<type_names::mod1::Enum2>,char> tuple2 = [...]
// BOX
// cdb-command:dv /t box*
// cdb-check:struct tuple$<alloc::boxed::Box<f32,alloc::alloc::Global>,i32> box1 = [...]
// cdb-check:struct tuple$<alloc::boxed::Box<e... | Rust | 0 |
::Serialize::serialize(&($(&self.$env,)*), serializer)
}
}
impl<'de, $($t),*> $crate::internal::serde::Deserialize<'de> for $name<$($t),*>
where
$($bound_ty: $bound_trait,)*
$($env_type: $crate::internal::serde::Deserialize<'de>,)*
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Erro... | Rust | 0 |
= vec![];
for path in &paths {
let last_cave_visited = &path[path.len() - 1];
if *last_cave_visited == end_cave {
new_paths.push(path.clone());
continue;
}
let connected_caves = cave_graph.get(last_cave_visited).unwrap();
... | Rust | 0 |
中")
query_result = se.query(channel).filter(channel.channel_id == channel_id).first()
if query_result is not None:
t = query_result.type
type_info = se.query(channel_type).filter(channel_type.row_ == t).first()
if type_info is n... | Python | 1 |
data=data[None,:,:]
data=data[:,:,self.Nei_in_SO3]
data=torch.reshape(data,[data.shape[0],data.shape[1],60,13])
return data
def PartII_SO3_Conv(self,data):#data:bn,f,gn
data=self.data_process(data)
data=self.Conv_init(data)[:,:,:,0]
for layer in self.PartII_SO3_Conv... | Python | 1 |
ib"
else:
return filename.split(".")[0] + ".a"
except Exception as e: # noqa
pass
return filename
def parse_setuppy_commands():
"""Check the commands and respond appropriately.
Return a boolean value for whether or not to run the build or not (a... | Python | 1 |
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from ._cf_ops_gen import *
| Python | 1 |
if let Some(flex) = self.flex {
match message {
BasicMessage::Add => {
self.counter += 1;
let new_row =
context.create_widget(Label::new(format!("New Item {}", self.counter)));
let padded = context.cre... | Rust | 0 |
ent::Right) => (pad, 0, 0),
}
};
let fill = fmt.fill();
for _ in 0..pad_left {
fmt.write_char(fill)?;
}
fmt.write_str(sign)?;
fmt.write_str(prefix)?;
for _ in 0..pad_zeros {
fmt.write_char('0')?;
}
fmt.write_str... | Rust | 0 |
Mutex, PoisonError,
},
time::{Duration, Instant},
};
use crypto::hash::{BlockHash, ContextHash, OperationHash};
use failure::Fail;
use once_cell::sync::Lazy;
use rusqlite::{named_params, Batch, Connection, Error as SQLError, Transaction};
use serde::Serialize;
pub const FILENAME_DB: &str = "context_s... | Rust | 0 |
)
if level_index == levels_count - 1:
display_text(screen, "You Won!", width, height, 1000)
print("GameSate set here 1")
gameState = "Won"
scores[username] = Score
updateScores(scores)
... | Python | 1 |
nse.content}
]
return new_state
def billing_node(state: CustomerServiceState) -> Dict[str, Any]:
"""账单问题处理节点
WHY - 设计思路:
1. 需要处理账单和付款相关问题
2. 需要结合知识库提供准确的账单信息
HOW - 实现方式:
1. 提取用户查询
2. 从知识库检索相关账单文档
3. 生成专业的账单问题回答
WHAT - 功能作用:
处理账单相关问题,提供清晰的账单解释和指导
... | Python | 1 |
scope_5379.boolean(*var_5380);
}
writer.finish();
Ok(aws_smithy_http::body::SdkBody::from(out))
}
pub fn serialize_operation_crate_operation_modify_vpn_connection(
input: &crate::input::ModifyVpnConnectionInput,
) -> Result<aws_smithy_http::body::SdkBody, aws_smithy_http::operation::Serializat... | Rust | 0 |
types' quantization capability.
"""
assert (
datatype in self.get_quant_datatypes()
), f"The target data type should be one of {self.get_quant_datatypes()}"
return self.cur_config[datatype]
def get_quant_datatypes(self):
"""Got low-precision data types for quant... | Python | 1 |
name="out_proj",
)
self.config = config
def call(self, features, training=False):
x = features[:, 0, :] # take <s> token (equiv. to [CLS])
x = self.dropout(x, training=training)
x = self.dense(x)
x = self.dropout(x, training=training)
x = self.out_p... | Python | 1 |
def setCurrentNation(self, nationID):
hasAction = self.__techTreeEventsListener.hasActiveAction
oldHint = self.__activeHints.pop(EventActionHint.getHintID(), None)
if oldHint is not None:
oldHint.markHint()
if not self.__limitedUIController.isRuleCompleted(LuiRules.TECH_TR... | Python | 1 |
#
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2025 Carsten Igel.
#
# This file is part of simplepycons
# (see https://github.com/carstencodes/simplepycons).
#
# This file is published using the MIT license.
# Refer to LICENSE for more information
#
""""""
# pylint: disable=C0302
# Justification: Code is generated
... | Python | 1 |
column_not_searchable(session):
"""Test if result's are filtered from global search field."""
columns = [
ColumnDT(User.id, mData="ID"),
ColumnDT(User.name, mData="Username", global_search=False),
]
query = session.query().select_from(User)
params = create_dt_params(columns, search... | Python | 1 |
bit BE), Code ... */
/* Next Subtbl for LOOKUP_CONTINUE */
pub(crate) type CID = u16;
/*
* PDF viewer applications use following tables (CIDFontType 2)
*
* head, hhea, loca, maxp, glyf, hmtx, fpgm, cvt_, prep
*
* - from PDF Ref. v.1.3, 2nd ed.
*
* The fpgm, cvt_, and ... | Rust | 0 |
#[cfg(feature = "std")]
#[doc(no_inline)]
pub use std::{dbg, eprint, eprintln, print, println};
<reponame>cypherlink/TDN
use chamomile_types::message::DeliveryType as P2pDeliveryType;
use chamomile_types::Peer as ChamomilePeer;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
/// Type: PeerId
pub use chamomile_types::ty... | Rust | 0 |
println!(
"i_next: {:?}, r_next1: {:?}, r_next2: {:?}",
i_next, r_next1, r_next2
);
}
println!("i_sum: {:?}", i_sum);
println!("r_sum1: {:?}", r_sum1);
println!("r_sum2: {:?}", r_sum2);
assert!(r_sum1 > i_sum)
}
//! Field tests
use quickcheck::{Arbitrary, Gen};
u... | Rust | 0 |
# -*- coding: utf-8 -*-
# pylint: disable=all
# flake8: noqa
# type: ignore
# mypy: ignore-errors
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
🔍 Network Reconnaissance Tool (Thai Version)
เครื่องมือสแกนเครือข่าย - ภาษาไทย
"""
import os
import subprocess
import sys
def print_banner():
print("""
🔍 เครื่องมื... | Python | 1 |
) => tokens.append_all(quote! {
__cx.fragment_from_iter(#exp)
}),
}
}
}
<gh_stars>10-100
mod oklab;
fn main() {
oklab::example();
}
<reponame>jhodges10/gdl<filename>crate/src/diagrams.rs<gh_stars>0
/// Create diagrams, flowcharts, graphs, etc.,
use wasm_bindgen::prelude::*... | Rust | 0 |
movup.6
popw.mem
pushw.mem
pushw.local.5
exec.rev_4_elements
exec.xor_4_elements # compute state[24..28] #
movup.5
popw.mem
pushw.mem
pushw.local.6
exec.rev_4_elements
drop
drop
pushw.local.4
exec.rev_4_elements
drop
drop
exec.xor_4_ele... | Rust | 0 |
>
}
}
}
<filename>src/coroutine.rs
// re-export coroutine interface
pub use crate::cancel::trigger_cancel_panic;
pub use crate::coroutine_impl::{current, park, park_timeout, spawn, Builder};
pub use crate::join::JoinHandle;
pub use crate::park::ParkError;
pub use crate::scoped::scope;
pub use crate::sleep::... | Rust | 0 |
_raw_parts(self as *const CellMeta as *const u8, Self::size())
};
dst.copy_from_slice(src);
}
}
impl<'b> flatbuffers::Push for &'b CellMeta {
type Output = CellMeta;
#[inline]
fn push(&self, dst: &mut [u8], _rest: &[u8]) {
let src = unsafe {
::std::slice::from_raw_pa... | Rust | 0 |
.0, 0.0), Point::new(2.0, 0.0)];
/// let polyline = Polyline::new(points);
///
/// writer.write_shapes(&vec![polyline])?;
/// # Ok(())
/// # }
/// ```
pub fn write_shapes<S: EsriShape>(&mut self, shapes: &[S]) -> Result<(), Error> {
let mut file_length = header::HEADER_SIZE as usize;... | Rust | 0 |
from sqlalchemy import (
Column,
Integer,
ForeignKey,
DateTime,
Text,
String,
UniqueConstraint, TIMESTAMP, Date, Boolean, LargeBinary,
)
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import func
Base = declarative_base()
... | Python | 1 |
ions.append(_("Enable HTTPS for your website"))
if not technical_metrics.has_robots_txt:
suggestions.append(_("Add a robots.txt file"))
if not technical_metrics.has_sitemap:
suggestions.append(_("Add an XML sitemap"))
if not technical_metrics.is_mobile_friendly:
... | Python | 1 |
32>> = read::read_digits("input.txt".to_owned());
let mut map : Map = Map::new(digits);
map.find_low_points();
// Part 1
let count_1 : u32 = map.find_sum_risk_levels();
println!("🌋 The risk level is '{}' (Part 1)", count_1);
// Part 2
let count_2 : u32 = map.find_basins_value();
... | Rust | 0 |
ghInto, lobpcg, lobpcg::LobpcgResult, Lapack, Scalar, TruncatedOrder, UPLO,
};
use ndarray_rand::{rand_distr::Uniform, RandomExt};
use num_traits::NumCast;
use linfa::{traits::Transformer, Float};
use linfa_kernel::Kernel;
use super::hyperparameters::{DiffusionMapHyperParams, DiffusionMapHyperParamsBuilder};
pub st... | Rust | 0 |
init_extra)]
#[macro_use]
extern crate memoffset;
#[macro_use]
extern crate log;
mod block_alloc;
mod device_info;
mod material;
mod material_repo;
mod raytracer;
mod render_resources;
pub mod renderer;
mod shared_buffer;
pub mod swapchain;
mod utils;
use dust_core::CameraProjection;
use dust_core::SunLight;
use gla... | Rust | 0 |
, # '?'
64: 253, # '@'
65: 182, # 'A'
66: 106, # 'B'
67: 107, # 'C'
68: 100, # 'D'
69: 183, # 'E'
70: 184, # 'F'
71: 185, # 'G'
72: 101, # 'H'
73: 94, # 'I'
74: 186, # 'J'
75: 187, # 'K'
76: 108, # 'L'
77: 109, # 'M'
78: 110, # 'N'
79: 111,... | Python | 1 |
gment[i], self.base_knots,
self.M)
f_min = _interpolate(np.array([self.base_knots[i, 0]])[:, np.newaxis], self.Augment[i], self.base_knots,
self.M)[0]
f_max = \
... | Python | 1 |
_VERSION { MajorVersion: 1, MinorVersion: 0 };
pub const HTTP_VERSION_1_1: HTTP_VERSION = HTTP_VERSION { MajorVersion: 1, MinorVersion: 1 };
#[inline] #[allow(dead_code)]
pub fn HTTP_SET_VERSION(mut version: HTTP_VERSION, major: ::USHORT, minor: ::USHORT) {
version.MajorVersion = major;
version.MinorVersion = ... | Rust | 0 |
= open('./oj_json/cf_rating.json', 'r+', encoding='utf-8')
all_rating = json.load(f)
local_rating = all_rating["all_rating"]
for uname in local_rating:
print(uname)
rating_info = await self.query_user_rating(uname, final_contest)
if not rating_info:
... | Python | 1 |
Token::Config(block) => &block.lparen.trivia,
Token::ConfigPair { key, .. } => &key.trivia,
Token::Data { size, .. } => &size.trivia,
Token::Definition { tag, .. } => &tag.trivia,
Token::Eof(empty) => &empty.trivia,
Token::Error(invalid) => &invali... | Rust | 0 |
.conversation.load_dataset",
return_value=fake_dataset_dict
):
result = adapter.from_hub_to_dataset_dict("username/dataset")
assert isinstance(result, DatasetDict)
assert set(cast(list[str], result.keys())) == {"train", "validation", "test"}
for _split_name, split_data in c... | Python | 1 |
import flet as ft
from utils.utils import create_app_bar
from utils.utils import msg_erro
class SignUpView:
def __init__(self, page: ft.Page, on_signup, on_back):
self.page = page
self.on_signup = on_signup
self.on_back = on_back
self.setup_page()
self.signup_page_ui()
... | Python | 1 |
Example
///
/// ```no_run
/// use std::error::Error;
/// use apollo_client::open::{OpenApiClient, requests::OpenAppRequest};
///
/// #[tokio::main]
/// async fn main() -> Result<(), Box<dyn Error>> {
/// let client: OpenApiClient = todo!();
///
/// let _responses = clien... | Rust | 0 |
#!/usr/bin/env python
#
# Copyright 2013 Bastian Bloessl <bloessl@ccs-labs.org>
#
# This program 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 3 of the License, or
# (at your option) any later... | Python | 1 |
frames)
Returns:
Resampler features of shape (batch_size, num_queries, d_visual)
"""
assert x_f.ndim == 4
batch_size, max_length, _, dim = x_f.shape
assert dim == self.dim
# Mask the position embeddings for the padded frames
time_pos_emb = (
... | Python | 1 |
{
'name': 'DMS: Project Budget',
'version': '1.0.4',
'category': 'Document Management',
'depends': ['dms', 'project_budget'],
'description': """
""",
'author': '',
'support': '',
'installable': True,
'auto_install': True,
'data': [
'data/dms_data.xml',
'views/... | Python | 1 |
sm_bindgen::to_value(&request.signature.to_unblinded(&request.blindingFactor))
.unwrap(),
)
}
#[wasm_bindgen(js_name = createProof)]
pub fn bbs_create_proof(request: JsValue) -> Result<JsValue, JsValue> {
let request: CreateProofRequest = request.try_into()?;
if request
.revealed
... | Rust | 0 |
from __future__ import division, absolute_import, print_function
import pytest
from numpy.testing import assert_, suppress_warnings
import numpy.distutils.fcompiler
customizable_flags = [
('f77', 'F77FLAGS'),
('f90', 'F90FLAGS'),
('free', 'FREEFLAGS'),
('arch', 'FARCH'),
('debug', 'FDEBUG'),
... | Python | 1 |
uthorization
<Authorization<T>>::remove(&from, (currency_id, &to));
Self::deposit_event(RawEvent::UnAuthorization(from, to, currency_id));
}
/// `origin` refuse anyone to manipulate its vault
fn unauthorize_all(origin) {
let from = ensure_signed(origin).map_err(|_| Error::AccountUnSigned)?;
// upda... | Rust | 0 |
///
/// Enumeration from nl80211/nl80211.h:3194
#[neli_enum(serialized_type = "u16")]
pub enum Nl80211MeshPowerMode {
MeshPowerUnknown = 0,
MeshPowerActive = 1,
MeshPowerLightSleep = 2,
MeshPowerDeepSleep = 3,
MeshPowerAfterLast = 4,
MeshPowerMax = 3,
}
impl NlAttrType for Nl80211MeshPowerMode... | Rust | 0 |
,
self.c2,
self.c3,
];
println!("Player tick: {:?}", player.get_tick());
for n in 0..3 {
let mut r1 = board_array[n];
let mut r2 = board_array[n + 3];
let mut r3 = board_array[n + 6];
if r1 == r2 && r2 == r3 && !(r3 == ... | Rust | 0 |
// wschar = ( %x20 / ; Space
// %x09 ) ; Horizontal tab
#[inline]
fn is_wschar(c: char) -> bool {
matches!(c, ' ' | '\t')
}
// ws = *wschar
parse!(ws() -> &'a str, {
take_while(is_wschar)
});
// non-eol = %x09 / %x20-10FFFF
#[inline]
fn is_non_eol(c: char) -> bool {
... | Rust | 0 |
return syns
lgn.add_edges(source=lgn.nodes(), target=net.nodes(pop_name='Scnn1a'),
iterator='all_to_one',
connection_rule=select_source_cells,
connection_params={'nsources_min': 10, 'nsources_max': 25},
syn_weight=4e-03,
weight_function='wmax',
... | Python | 1 |
if s < 0.7 or s > 1.3:
print(f"Skipping[{i+1-len(results_quad)}/{i+1}]: {img_path} s={s}")
skip = True
break
if abs(pose[0]) > 90 or abs(pose[1]) > 80 or abs(pose[2]) > 50:
print(f"Skipping[{i+1-len(results_quad)}/{i+1}]: {img_path} pose={pos... | Python | 1 |
format (e.g., "20202021")
end_season (str, optional): End of season range in YYYYYYYY format.
Defaults to start_season if not provided.
stats_type (str): Type of statistics to retrieve:
'summary', 'advanced', 'bios', 'daysrest', 'penaltyShots',
's... | Python | 1 |
.]+) \\((.+)?\\) at ([a-zA-Z]+) ([a-zA-Z]+) ([0-9]+) ([0-9]+):([0-9]+):([0-9]+) ([0-9]+)", RegexMode::Captures)
],
vec![
ColumnDefinition::with_regex("line", 1, "ip", ValueType::String),
ColumnDefinition::with_regex("line", 2, "hostname", ValueType::String),
ColumnDef... | Rust | 0 |
to(),
0xAFu64.into(),
175.0f32.into(),
175.0f64.into(),
0xAFu8.into(),
0xAFu16.into(),
0xAFu32.into(),
0xAFu64.into(),
175.0f32.into(),
175.0f64.into(),
0xAFu8.... | Rust | 0 |
n't assert for a particular version in rust
// TODO: Either add this check in verification or remove this test because otherwise there's
// no point of it
fn fuzz_input(input: &mut BlockVerdict) -> (String, LiteVerdict) {
let mut rng = rand::thread_rng();
let version = &... | Rust | 0 |
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
import json
from dataclasses import dataclass
from importlib import metadata
@dataclass
class CIRequirements:
"""
A dataclass to store the CI requirements.
It used to make airbyte-ci client define the CI runners it will run on.
"""
dagger_... | Python | 1 |
mut self, new_marks: u32) {
self.marks = new_marks;
}
fn calculate_per(a: f32, b: f32, c: f32) -> f32 {
let score = a + b + c;
let per = (score / 300.0) * 100.0;
per
}
}
fn main() {
let mut std1 = Student {
name: String::from("ali"),
marks: 5,
su... | Rust | 0 |
! {small=> ($f,$t,$f)=$f }
$the_macro! {small=> ($t,$t,$f)=$f }
$the_macro! {small=> ($f,$f,$t)=$f }
$the_macro! {small=> ($t,$f,$t)=$f }
$the_macro! {small=> ($f,$t,$t)=$f }
$the_macro! {small=> ($t,$t,$t)=Carry }
$the_macro! {small=> ($f,$f,$f,$f)=$f }
$the_macr... | Rust | 0 |
"""
A turtlebot reaches for 4 randomly places targets.
This script contains examples of:
- Non-linear mobile paths to reach a target with collision avoidance
"""
from os.path import dirname, join, abspath
from pyrep import PyRep
from pyrep.robots.mobiles.turtlebot import TurtleBot
from pyrep.objects.shape import Sh... | Python | 1 |
ile;
use std::io;
use crypto_hash;
use crypto_hash::{Algorithm, Hasher};
use hex;
use error::{Error, Result};
byond_fn! { hash_string(algorithm, string) {
string_hash(algorithm, string).ok()
} }
byond_fn! { hash_file(algorithm, string) {
file_hash(algorithm, string).ok()
} }
fn get_algorithm(string: &str) ... | Rust | 0 |
# Generated by Django 4.2.20 on 2025-05-20 15:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Categoria',
fields=[
... | Python | 1 |
import re
from pathlib import Path
import jieba.posseg as psg
from pypinyin import Style, lazy_pinyin
from style_bert_vits2.nlp.chinese.tone_sandhi import ToneSandhi
from style_bert_vits2.nlp.symbols import PUNCTUATIONS
with open(Path(__file__).parent / "opencpop-strict.txt", "r", encoding="utf-8") as f:
__PINY... | Python | 1 |
# 90 or 90 aove a, 80 and 90 b, 70and 80 c grade 60 and 70 d grade else fail
def num(n):
if n>=90:
print("A grade ")
elif n>=80 or n< 90:
print("B grade")
elif n>= 70 and n <60:
print("c grade")
elif n>=60 and n <50:
print("d grade")
else :
print ("fail")
num... | Python | 1 |
job_id: "job1".to_string(),
activity_type: "delivery".to_string(),
location: Some(vec![5., 0.].to_loc()),
time: Some(Interval {
start: "1970-01-01T00:00:06Z".to_string(),
... | Rust | 0 |
, Box<dyn std::error::Error>> {
let mut write = false;
while !write {
let client = self
.client_table
.get(&self.last_leader)
.map(|c| c.clone())
.unwrap();
match client {
Some(mut client) => {
let request = tonic::Request::new(ClientWriteRpcRequest... | Rust | 0 |
zPath: LPCSTR,
) -> HRESULT;
pub fn SHSetFolderPathW(
csidl: c_int,
hToken: HANDLE,
dwFlags: DWORD,
pszPath: LPCWSTR,
) -> HRESULT;
pub fn SHGetFolderPathAndSubDirA(
hwnd: HWND,
csidl: c_int,
hToken: HANDLE,
dwFlags: DWORD,
pszSubDi... | Rust | 0 |
stream::Stream;
use nix;
use os_pipe::IntoStdio;
use os_pipe;
use serde_json;
use std;
use std::io::{Write};
use std::os::unix::fs::FileExt;
use std::os::unix::io::FromRawFd;
use crate::error::ResultExt;
fn start_cmd(cmd: &'static str) -> std::process::Command {
let mut cmd = std::process::Command::new(cmd);
cmd.st... | Rust | 0 |
ce = bridge.get_dai_balance(our_address).await?;
info!("Our DAI balance is {}", dai_balance);
if dai_balance > minimum_stranded_dai_transfer {
info!("rescuing dais, failure to wait for event");
detailed_state_change(DetailedBridgeState::DaiToXdai {
amount: dai_balance.clone(),
... | Rust | 0 |
CAPTIONSIZINGTEMPLATE 30, 0
WINDOW_SMALLCAPTIONSIZINGTEMPLATE 31, 0
WINDOW_FRAMELEFTSIZINGTEMPLATE 32, 0
WINDOW_SMALLFRAMELEFTSIZINGTEMPLATE 33, 0
WINDOW_FRAMERIGHTSIZINGTEMPLATE 34, 0
WINDOW_SMALLFRAMERIGHTSIZINGTEMPLATE 35, 0
WINDOW_FRAMEBOTTOMSIZINGTEMPLATE 36, 0
WINDOW_SMALLFRAMEBOTTOMSI... | Rust | 0 |
to this SpellingPolicy
:param midi_num: a MIDI pitch value
"""
name, octave, alteration = self.resolve_name_octave_and_alteration(midi_num)
return pymusicxml.Pitch(name.upper(), octave, alteration)
def _to_dict(self) -> dict:
# check to see this SpellingPolicy is identical ... | Python | 1 |
rate on primes2
offset = next_index - current_index
# move primes2 forward that many times
for _ in range(offset):
output = next(primes2)
# we have a winner
yield output
# this is where we are, so we can compute the next hop
current_index = next_index
... | Python | 1 |
# ssalign_more_foldseek(basenames, 5000, 50, "method_measure", "rmsd")
# ssalign_more_foldseek(basenames, 100000, 1000, "method_measure", "rmsd")
# ssalign_more_foldseek(basenames, 800000, 8000, "method_measure", "rmsd")
gtalign_ssalign_foldseek_faiss_mode1(basenames,50000,500,"avgtmscore")
gtalign_s... | Python | 1 |
else:
dx = 0
dy = 0
self.Dot(x0 + x + dx, self.h - (y0 + y) + dy, self.Black)
class WeatherDrawer:
"""天气绘图器"""
# 绘图常量
XSTART = 32
XSTEP = 44
XFLAT = 10
YSTEP = 50
DEFAULT_DEGREE_PER_PIXEL = 0.5
FLOWER_RIGH... | Python | 1 |
import numpy as np
import pandas as pd
import plotly.express as px
import streamlit as st
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
import re
st.set_page_config(layout='wide', page_title='CosmetriX')
# Veri setlerini yükle ve birleştir
@st.cache... | Python | 1 |
) -> Self {
Ticks(ticks)
}
}
impl Add for Ticks {
type Output = Self;
#[inline]
fn add(self, rhs: Self) -> Ticks {
Ticks(self.ticks() + rhs.ticks())
}
}
impl Sub for Ticks {
type Output = Self;
#[inline]
fn sub(self, rhs: Self) -> Ticks {
Ticks(self.ticks() - rh... | Rust | 0 |
入日志"""
try:
with self.lock:
timestamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
log_message = f"[{timestamp}] [{level.upper()}] {message}\n"
with open(self.log_file, 'a', encoding='utf-8') as f:
f.writ... | Python | 1 |
).or_default().insert(other.0, pos);
}
}
}
for scanner in scanners.iter_mut().enumerate().skip(1) {
let mut progress = FxHashSet::default();
*scanner.1 = rotate_to_zero(&distances, scanner.1.clone(), scanner.0, &mut progress).unwrap();
}
scanners.into_iter().flat_map(... | Rust | 0 |
"""
Module contains simple trainer classes.
"""
from podium.datasets import Iterator
from podium.experimental.models.trainer import AbstractTrainer
class SimpleTrainer(AbstractTrainer):
"""
Simple trainer class.
Attributes
----------
MAX_EPOCH_KEY : str
keyword argument key for maximal nu... | Python | 1 |
}
}
#[tonic::async_trait]
impl Metaboss for MyMetaboss {
async fn decode(
&self,
request: Request<DecodeRequest>,
) -> Result<Response<DecodeResponse>, Status> {
println!("Received request from: {:?}", request);
let client = RpcClient::new(URL.to_string());
let account ... | Rust | 0 |
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from conftest import setup_edge, USER_EMAIL, USER_PASSWORD # Импортируйте переменные
import time
def test_example(setup_edge):
driver = setup_edge
... | Python | 1 |
import logging
from dotenv import load_dotenv
from src.mteam import MTeamClient
from src.mteam.subtitle import SubtitleSearch, SubtitleLanguage
# 配置日志
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
# 加载环境变量
load_dotenv()
def debug_subtitle_list():
"""调试字幕列表功能"""
# 使用自定义配置创建客户端
... | Python | 1 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
c = pycurl.Curl()
c.setopt(c.URL, 'https://httpbin.org/post')
c.setopt(c.HTTPPOST, [
('fileupload', (
c.FORM_BUFFER, 'readme.txt',
c.FORM_BUFFERPTR, 'This is a fancy readme file',
)),
])
c.perform()
c.close()
| Python | 1 |
edding_config, GPT_config):
super().__init__(**GPT_config)
# patching the config by removing the default parameters for Conv1d
if feat_embedding_config.target.split('.')[-1] in ['LSTM', 'GRU']:
for p in ['in_channels', 'out_channels', 'padding', 'kernel_size']:
if p ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.