text string | label_name string | labels int64 |
|---|---|---|
Duration::from_millis(500),
AnimationFunction::EaseOutCubic,
));
}
let v = self
.beat_animation
.as_ref()
.unwrap()
.value(data.engine_state.time);
... | Rust | 0 |
fn last_support_fork() {
let mut value = 0;
let mut value2 = 0;
{
let o = observable::from_iter(1..100).last();
let o1 = o.fork().last();
let o2 = o.fork().last();
o1.subscribe(|v| value = v);
o2.subscribe(|v| value2 = v);
}
assert_eq!(value, 99);
assert_eq!(value2... | Rust | 0 |
qual( attribute.Get( 0 ), 24.0 )
self.assertEqual( attribute.Get( 24 ), 24.0 )
renderAttribute = uPrim.GetAttribute( "primvars:testAttribute" )
self.assertEqual( renderAttribute.Get( 0 ), 24.0 )
self.assertEqual( renderAttribute.Get( 24 ), 24.0 )
# constant prim var
attribute = uPrim.GetAttribute( "primva... | Python | 1 |
_void, _1: *mut c_void) -> (),
pub fn XtCallbackNone (_3: Widget, _2: *mut c_void, _1: *mut c_void) -> (),
pub fn XtCallbackNonexclusive (_3: Widget, _2: *mut c_void, _1: *mut c_void) -> (),
pub fn XtCallbackPopdown (_3: Widget, _2: *mut c_void, _1: *mut c_void) -> (),
pub fn XtCallbackReleaseCacheRef (_3: Widg... | Rust | 0 |
== "name":
num_tokens += tokens_per_name
elif isinstance(message, str):
num_tokens += len(encoding.encode(message))
else:
NotImplementedError(
f"""num_tokens_from_messages() is not implemented message type {type(message... | Python | 1 |
pub struct FeeConfig {
pub fee: Uint128,
pub operation: String,
pub denom: String,
}
#[derive(Default, Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
pub struct Member {
pub amount: Uint128,
pub claimed: Uint128,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debu... | Rust | 0 |
req: HttpRequest,
auth: BasicAuth,
body: Json<RequestOauth2Introspect>,
) -> HttpResult<HttpResponse> {
server_request!(&server, &req, async {
let body = server_validate!(&server, body);
let request = server
.oauth2_introspect_parse_request(Some(&body.token), auth.secret().... | Rust | 0 |
to_write: &mut [u8] = &mut magnitude_bytes[first_occupied_byte..];
if value < 0 {
bytes_to_write[0] |= 0b1000_0000;
}
sink.write_all(bytes_to_write)?;
Ok(bytes_to_write.len())
}
/// Encodes a negative zero as an `Int` and writes it to the privided `sink`.
/// Re... | Rust | 0 |
T but for OUTPUT
/// pub type OUTPUT = (f32,);
///
/// // similar to INPUT and OUTPUT but tells the uniform
/// pub type UNIFORM = ();
/// }
/// ```
/// ### Example input
/// ```
/// # use gears::{module};
/// module! {
/// // Module kind:
/// kind = "vert",
/// // Module source path:
/// path = "../gea... | Rust | 0 |
, T7, T8, T9, T10;
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
impl_value_list_for_tuple!(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11;
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
impl_value_list_for_tuple!(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12;
... | Rust | 0 |
let e: u32 = 1;
let r: u32 = transmute(vcvts_n_u32_f32::<2>(transmute(a)));
assert_eq!(r, e);
}
#[simd_test(enable = "neon")]
unsafe fn test_vcvtd_n_u64_f64() {
let a: f64 = 0.25;
let e: u64 = 1;
let r: u64 = transmute(vcvtd_n_u64_f64::<2>(transmute(a)));
... | Rust | 0 |
ranch_out.chunk(3, dim=1)
outs.append(curr_out)
gates.append(curr_gate)
for group_id in range(1, self.num_groups - 1):
curr_x = torch.cat([xs[group_id], curr_fork], dim=1)
branch_out = self.interact[str(group_id)](curr_x)
curr_out, curr_fork, curr_gate = bran... | Python | 1 |
nder;
type RenderContext = RenderContext;
fn upload_model(ctx: &mut RenderContext, models: Vec<tobj::Model>) {
asset_load::upload_model(ctx, models);
}
/// Creates a `RenderContext` with the specified
/// window title and dimensions
fn create_context(title: &str, dimensions: (u32, u32)... | Rust | 0 |
e_int(env: *mut ErlNifEnv, i: c_int) -> ERL_NIF_TERM;
fn enif_make_ulong(env: *mut ErlNifEnv, i: c_ulong) -> ERL_NIF_TERM;
fn enif_make_double(env: *mut ErlNifEnv, d: c_double) -> ERL_NIF_TERM;
fn enif_make_atom(env: *mut ErlNifEnv, name: *const c_char) -> ERL_NIF_TERM;
fn enif_make_existing_atom(env: *mut ErlNifEn... | Rust | 0 |
// "+-----------+------+-------------------------------+",
// ];
batches
}
// RecordBatches with knowledge of influx metadata
pub async fn create_batches_with_influxtype() -> Vec<Arc<RecordBatch>> {
// Use the available TestChunk to create chunks and then convert them t... | Rust | 0 |
saludo ='bienvenido'
resp = type(saludo)
print(resp)
saludo ="Alumno"
print(type(saludo))
valor = -5
print(type(valor))
valor = 12.5
print(type(valor)) | Python | 1 |
import numpy as np
from scipy.stats import ttest_ind
class NanotechTesting:
def __init__(self, experiment_design):
self.experiment_design = experiment_design
def conduct_experiment(self, nanoparticle_design):
# Conduct experiment using nanoparticle design
import experiment_setup
... | Python | 1 |
Ok(Term::Num(2.)),
);
assert_eq!(
eval_string("hasField \"foo\" ( { foo = 2; bar = 3; }-$(\"foo\"))"),
Ok(Term::Bool(false))
);
assert_eq!(
eval_string("hasField \"foo\" ( { bar = 3; }$[\"foo\" = 1])"),
Ok(Term::Bool(true))
... | Rust | 0 |
# 配置文件
# 请将你的API密钥填入下方或创建config_local.py文件
GEMINI_API_KEY = ""
# DeepSeek API配置
DEEPSEEK_API_KEY = "" # 请填入您的DeepSeek API密钥
DEEPSEEK_BASE_URL = "https://api.deepseek.com" # DeepSeek API基础URL
# 模型选择配置
DEFAULT_MODEL_PROVIDER = "deepseek" # 可选: "gemini", "deepseek"
DEEPSEEK_MODEL = "deepseek-chat" # DeepSeek模型名称
#... | Python | 1 |
"""
Test enth_sorp_whittaker module
"""
import numpy as np
import pytest
import pygaps.characterisation.enth_sorp_whittaker as we
import pygaps.modelling as pgm
import pygaps.parsing as pgp
from .conftest import DATA_WHITTAKER
loading = np.linspace(0.1, 20, 100)
@pytest.mark.characterisation
class TestWhittakerEn... | Python | 1 |
impl One for Bool {
fn one() -> Self {
Bool(1)
}
}
impl From<cl_bool> for Bool {
#[inline(always)]
fn from(val: cl_bool) -> Bool {
match val {
0 => Bool(0),
1 => Bool(1),
v => _panic_invalid!(v),
}
}
}
impl From<Bool> for cl_bool {
... | Rust | 0 |
_key(fulfills, COMMITMENT_FULFILLEDBY_LINK_TYPE, COMMITMENT_FULFILLEDBY_LINK_TAG);
},
_ => (),
};
// :TODO: observation DNA handles this. Should queries be possible in planning DNA, too?
// match ¶ms.fulfilled_by {
// Some(fulfilled_by) => {
// entries_result = query_... | Rust | 0 |
into_iter().filter_map(|x| x).collect(),
host_memory_types: host_memory_types.into_iter().filter_map(|x| x).collect(),
}
}
pub fn exact_host_visible_index(
&self,
mask: u32,
required: br::MemoryPropertyFlags,
) -> Option<&MemoryType> {
self.host... | Rust | 0 |
#[derive(Debug, Copy)]
pub struct u64x4(u64, u64, u64, u64);
#[repr(simd)]
#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
#[derive(Debug, Copy)]
pub struct i64x4(i64, i64, i64, i64);
#[repr(simd)]
#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
#[derive(Debug, Copy)]
pub struct ... | Rust | 0 |
Carrier) -> Self;
/// Get the carrier.
fn get(&self) -> GasCarrier;
/// Map a function `f` of one argument over the underlying data.
fn map<F: Fn(GasCarrier) -> GasCarrier>(self, f: F) -> Self {
Self::new(f(self.get()))
}
/// Map a function `f` of two arguments over the underlying car... | Rust | 0 |
# Copyright (c) 2025 Arne Deutsch, itemis AG, MIT License
"""Token generation helpers for the evaluation harness."""
from __future__ import annotations
import re
from hippo_eval.metrics.scoring import (
em_norm,
em_raw,
enforce_short_answer,
enforce_udlr,
f1,
)
from .encode import encode_prompt
... | Python | 1 |
word);
Ok(Self {
smtp_server: config.smtp_server,
sender,
contacts: contacts.into(),
credentials,
})
}
}
use std::mem;
fn main() {
let val = 14;
let ptr = (&val as *const i32).wrapping_offset(1);
let _x: &i32 = unsafe { mem::transmute(ptr... | Rust | 0 |
id String @id
name String
age Int
}
"#;
let response = api
.infer(dm2)
.migration_id(Some("mig02"))
.assume_applied_migrations(Some(vec![AppliedMigration {
datamodel_steps: steps,
migration_id: mig_1_id.to_owned(),
... | Rust | 0 |
=> Error::new(ErrorKind::Credential, e),
crate::errors::Error::HttpPrepare(e) => e.into(),
crate::errors::Error::Other(e) => Error::new(ErrorKind::Other, e),
crate::errors::Error::AuthorizationPolicy(msg) => Error::with_message(
ErrorKind::Credential,
... | Rust | 0 |
orm = 1.0 # population covariance to match Wang et. al. 2004
# compute (weighted) means
ux = filter_func(im1, **filter_args)
uy = filter_func(im2, **filter_args)
# compute (weighted) variances and covariances
uxx = filter_func(im1 * im1, **filter_args)
uyy = filter_func(im2 * im2, **filter_ar... | Python | 1 |
the kernel's text pages")
.and_then(|offset| kernel_text_pages.as_slice(offset, ap_startup_size_in_bytes))?;
let dest_slice: &mut [u8] = ap_startup_mapped_pages.as_slice_mut(0, ap_startup_size_in_bytes)?;
dest_slice.copy_from_slice(source_slice);
}
// Now, the AP startup code is at t... | Rust | 0 |
riant1(__tok0),
_ => unreachable!(),
},
_ => unreachable!(),
}
}
pub struct AtomParser {
_priv: (),
}
impl AtomParser {
pub fn new() -> AtomParser {
AtomParser {
_priv: (),
}
}
#[all... | Rust | 0 |
};
assert_eq!(actual, expected);
}
}
use anyhow::Context;
use chrono::{DateTime, FixedOffset, Utc};
use futures::stream::{FuturesUnordered, StreamExt};
use futures::{future::BoxFuture, FutureExt};
use hyper::header::HeaderValue;
use once_cell::sync::OnceCell;
use reqwest::header::{AUTHORIZATION, USER_AGENT};
use r... | Rust | 0 |
import torch
def zero_module(module):
for p in module.parameters():
p.detach().zero_()
return module
| Python | 1 |
in datos.items():
valor_str = str(value)
# Verificar caracteres especiales
if any(char in valor_str for char in ['&', '<', '>', '"', "'"]):
problemas.append(f"Caracteres XML especiales en {key}: {value}")
# Verificar caracteres de control
import re
if re.se... | Python | 1 |
s *const c_char
}
}
pub fn from_string_slice(_rp: *mut Page, s: &str) -> String {
String::create(_rp, s.as_ptr() as *const u8, s.len())
}
pub fn append_character(&self, _rp: *mut Page, c: char) -> String {
unsafe {
let s = String::create(_rp, self.data, self.get_len... | Rust | 0 |
from typing import List
from crud.manager import (
create_task_manager,
delete_task_manager,
get_task_manager,
list_task_managers,
restore_task_manager,
update_task_manager,
)
from db.session import get_pg_db
from fastapi import APIRouter, Depends
from schemas.manager import TaskManagerCreate, ... | Python | 1 |
# -*-coding:utf-8-*-
# Implement regular expression matching with support for '.' and '*'.
# '.' Matches any single character.
# '*' Matches zero or more of the preceding element.
# The matching should cover the entire input string (not partial).
# The function prototype should be:
# bool isMatch(const char *s, con... | Python | 1 |
import pytest
import numpy as np
from athene.retrieval.sentences.deep_models.ESIM import ESIM as ESIMretrieval
from athene.rte.deep_models.ESIM_for_ensemble_glove_only_no_attention import ESIM as ESIMrte
from athene.rte.utils.text_processing import load_whole_glove
from common.util.log_helper import LogHelper
LogHelp... | Python | 1 |
iles[idx]);
draw_batch.set(
pt - offset,
ColorPair::new(colorpair.fg, colorpair.bg),
glyph,
);
}
}
}
draw_batch.submit(0).expect("Batch error");
}
// Mark this test as BPF-only due to curre... | Rust | 0 |
ords)
jitter_min = -jitter_max
jitter_hw = (
torch.empty(2, **dd).uniform_(jitter_min, jitter_max).exp()
)
coords *= jitter_hw[None, :]
# Rescale coords by multiplying the range [-1, 1] by a log-uniform value in [1/rescale, rescale]
if sel... | Python | 1 |
ame']}"
return get_direct_image_url(search_term)
def fetch_wikipedia_image_url(row):
search_term = f"{row['full_name']} {row['name']}"
return get_wikipedia_image_url(search_term)
if __name__ == "__main__":
# Example usage
search_term = "bennecourt claude monet"
image_url = get_wikipedia_image_... | Python | 1 |
import gym
import torch
import numpy as np
from dqn_agent import DQNAgent
from collections import deque
import matplotlib.pyplot as plt
env = gym.make("CartPole-v1")
state_size = env.observation_space.shape[0]
action_size = env.action_space.n
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
agent... | Python | 1 |
nd_options + chunk1_option + ' --sleep ' + str(sleep_time) + ' &'
command_list.append(command)
lat = lat + inps.lat_step
sleep_time = sleep_time +inps.wait_time
chunk1_option = ''
commands_file = inps.work_dir + '/minsar_commands.txt'
f = open(commands_file, "w")
prin... | Python | 1 |
cfg(feature = "randr")]
(Some(randr::X11_EXTENSION_NAME), 15) => Some("GetOutputProperty"),
#[cfg(feature = "randr")]
(Some(randr::X11_EXTENSION_NAME), 16) => Some("CreateMode"),
#[cfg(feature = "randr")]
(Some(randr::X11_EXTENSION_NAME), 17) => Some("DestroyMode"),
#[cfg... | Rust | 0 |
ripe_customer_id"], unique=False)
batch_op.create_foreign_key("fk_users_tier_ids", "tiers", ["tier_id"], ["id"])
def downgrade() -> None:
with op.batch_alter_table("users", schema=None) as batch_op:
batch_op.drop_constraint("fk_users_tier_ids", type_="foreignkey")
batch_op.drop_index("idx_... | Python | 1 |
from extensions import db
class DeliveryAssignment(db.Model):
id = db.Column(db.Integer, primary_key=True)
purchase_id = db.Column(db.Integer, db.ForeignKey('purchase.id'))
provider_id = db.Column(db.Integer, db.ForeignKey('delivery_provider.id'))
| Python | 1 |
pping-bag" => Some(outline::Shape::ShoppingBag),
"shopping-cart" => Some(outline::Shape::ShoppingCart),
"sort-ascending" => Some(outline::Shape::SortAscending),
"sort-descending" => Some(outline::Shape::SortDescending),
"sparkles" => Some(outline::Shape::Sparkles),
"speakerphone"... | Rust | 0 |
ll;
I64(5) Null
);
test!(Ok(expected), sql);
let sql = "
SELECT Item.*
FROM Player p
LEFT JOIN Item
ON p.id = player_id
";
let expected = select_with_null!(
id | quantity | player_id;
I64(101) I64(1) I64(1);
I64(102) I64(4) I64(2);
I64(103) I64(9)... | Rust | 0 |
audio))
if max_amp > 1.0:
mixed_audio = mixed_audio / max_amp * 0.95 # Leave a little headroom
# Create a new processor with the mixed audio
mixed_processor = AudioProcessor(audio_data=mixed_audio, sample_rate=processor.sample_rate)
mixed_processor.save("output_mixed_processed.wav")
cr... | Python | 1 |
reate("foo/sherlock", SHERLOCK);
dir.create("foo/watson", SHERLOCK);
let expected = "\
foo/watson:For the Doctor Watsons of this world, as opposed to the Sherlock
foo/watson:be, to a very large extent, the result of luck. <NAME>
";
assert_eq!(expected, cmd.arg("Sherlock").stdout());
});
// See: https://gi... | Rust | 0 |
uring quantization.
:param advanced_parameters: Advanced quantization parameters for
fine-tuning the quantization algorithm.
:return: NNCFConfig for the quantization algorithm.
"""
compression_config = _get_default_quantization_config(preset, subset_size)
if ignored_scope is not None:
... | Python | 1 |
self.0 ^= self.0 << 13;
self.0 ^= self.0 >> 17;
self.0 ^= self.0 << 5;
self.0
}
}
<filename>rs/tests/src/driver/test_env_api.rs
//! # The Test Environment API
//!
//! The goal of this module is to provide the user with an extensible,
//! consistent and ergonomic API to access the Test E... | Rust | 0 |
delete::*;
pub use delete_metadata_all_versions::*;
pub use delete_versions::*;
pub use destroy_versions::*;
pub use get::*;
pub use undelete_versions::*;
pub use update_set::*;
// TODO: Add List, Read Metadata, Update Metadata
<reponame>Guiguiprim/cargo-guppy<gh_stars>10-100
// Copyright (c) The cargo-guppy Contribu... | Rust | 0 |
rmatter};
#[derive(Debug)]
pub(crate) struct CanonicalStrand<C: Context> {
pub(super) canonical_ex_clause: C::CanonicalExClause,
/// Index into `ex_clause.subgoals`.
pub(crate) selected_subgoal: Option<SelectedSubgoal<C>>,
}
pub(crate) struct Strand<'table, C: Context + 'table, I: Context + 'table> {
... | Rust | 0 |
class Solution
public int[] nextGreaterElements(int[] nums) {
int n = nums.length;
int[] res = new int[n];
Stack<Integer> st = new Stack<>();
for (int i = (2 * n) - 1; i >= 0; i--) {
int idx = i % n;
while (!st.isEmpty() && nums[idx] >= ... | Python | 1 |
n_current * self.adaptation_decay + self.spike_increase * s_float
self.synaptic_efficiency = (
self.synaptic_efficiency * (1 - self.depression_rate * s_float) +
self.recovery_rate * (1 - self.synaptic_efficiency)
)
if self.use_adaptive_threshold:
if i... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2023 Google 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 requir... | Python | 1 |
sifraitech/kzg<filename>mcl-kzg/kzg/src/zero_poly.rs<gh_stars>10-100
use crate::data_types::fr::Fr;
use crate::fk20_fft::FFTSettings;
use crate::kzg10::Polynomial;
use crate::utilities::{is_power_of_2, next_pow_of_2};
use std::cmp::min;
/// Copy all of the coefficients of polynomial @p p to @p out, padding to length ... | Rust | 0 |
.map_err(|e| FluvioError::from(e).into());
partition_consumer
})
}
pub async fn connect(addr: String) -> Result<Fluvio, wasm_bindgen::JsValue> {
Self::setup_debugging(false);
let config = FluvioConfig::new(addr.clone());
let inner = Rc::new(
Nati... | Rust | 0 |
.add(enode!(Num(2)));
let three = egraph.add(enode!(Add, one, two));
let three_recexpr = r!(Add, r!(Num(1)), r!(Num(2)));
assert_eq!(three, egraph.add_expr(&three_recexpr));
```
[`enode!`]: macro.enode.html
[`RecExpr`]: struct.RecExpr.html
**/
#[macro_export]
macro_rules! recexpr {
($e:expr) => {
$crate::... | Rust | 0 |
pb_name::<ServicesRequest>(
"ServicesRequest",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static ServicesRequest {
static instance: ::protobuf::rt::LazyV2<ServicesRequest> = ::protobuf::rt::LazyV2::INIT;
... | Rust | 0 |
import pandas as pd
# Get the end of season stats for each team (no duplicates)
def get_end_of_season_standings():
# Load the training data
df = pd.read_csv('./backend/data/Training_Schedule_RF1.csv')
standings_df = {}
current_team = df.iloc[0]["Team"]
# Go throught all games in training schedul... | Python | 1 |
F: SerializableFst<W> + MutableFst<W> + Display,
W: SerializableSemiring + WeaklyDivisibleSemiring + WeightQuantize,
{
// Remove epsilon
let mut fst_rmepsilon = test_data.raw.clone();
rm_epsilon(&mut fst_rmepsilon)?;
std::dbg!(fst_rmepsilon.properties());
std::dbg!(test_data.rmepsilon.result_s... | Rust | 0 |
ommendations")
print(f" Items removed: {len(removed_items)}, Items added: {len(new_items)}")
for i, (item_id, score) in enumerate(new_recommendations):
title = itemid_to_title.get(item_id, 'Unknown')
genres = itemid_to_genres.get(ite... | Python | 1 |
# gateways/gateway_factory.py - 网关工厂类
import logging
from typing import Dict, Any, Optional, Type
from tonypy.core.base_gateway import BaseGateway
from tonypy.core.event_engine import EventEngine
from tonypy.gateways.binance_gateway import BinanceGateway
from tonypy.gateways.huobi_gateway import HuobiGateway
class ... | Python | 1 |
from .base import Dependency, GitClone, MesonBuilder
from kiwixbuild._global import option, get_target_step, neutralEnv
class Libzim(Dependency):
name = "libzim"
force_build = True
class Source(GitClone):
git_remote = "https://github.com/openzim/libzim.git"
git_dir = "libzim"
class B... | Python | 1 |
Rsp",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _session_revoke_serialize(
self,
session_id,
_request_auth,
_content_type,
_headers,
... | Python | 1 |
# Problem: Pascal's Triangle II - LeetCode - https://leetcode.com/problems/pascals-triangle-ii/
class Solution:
def getRow(self, rowIndex: int) -> List[int]:
hash={0:1,1:1}
temp={0:1,1:1}
if rowIndex==0:
return [1]
if rowIndex==1:
return [1,1]
for ... | Python | 1 |
detect_block_start(line_stripped, line_num)
if block_type: # 成功检测到块
current_block = {
'id': block_id,
'type': block_type,
'start_line': line_num,
'end_line': None,
'block_index': total_block... | Python | 1 |
ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]'))
def PyJs_LONG_1067_(var=var):
return var.get('RegExp').create(Js('[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾ... | Python | 1 |
# Copyright 2018 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo.tests import common
class TestBaseCharacterization(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.area_model = cls.env["res.area"]
... | Python | 1 |
def insert_data(ws, data, freight_number, container_type, num_containers, template_file=None):
"""
Insert extracted data into the Excel worksheet for 'possiano' PDF type.
Mirrors maritime logic but uses different defaults where needed.
"""
if 'feri_number' in data:
ws.range('E6').value = f"F... | Python | 1 |
s_mut().prev = Some(tail);
task.as_mut().next = None;
tail.as_mut().next = Some(*task);
}
}
self.tail = Some(*task);
}
}
/// Pop the first task of the queue
pub fn pop_front(&mut self) -> Option<Shared<Task>> {
unsafe {
match self.head {
None => None,
Some(mut task) => {
sel... | Rust | 0 |
__all__ = ['agents', 'core', 'envs']
| Python | 1 |
type(int)), tuple(tag.corners[idx, :].astype(int)), (0, 255, 0))
cv2.putText(color_img, str(tag.tag_id),
org=(tag.corners[0, 0].astype(int)+10,tag.corners[0, 1].astype(int)+10),
fontFace=cv2.FONT_HERSHEY_SIMPLEX,
fontScale=0.8,
col... | Python | 1 |
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmdeploy.core import FUNCTION_REWRITER
from mmdeploy.utils import is_dynamic_shape
@FUNCTION_REWRITER.register_rewriter('mmdet.models.detectors.maskformer.'
'MaskFormer.forward')
def maskformer__forward(self,
... | Python | 1 |
stomData {
#[serde(
rename = "_difficultyBeatmapSets",
default,
skip_serializing_if = "Vec::is_empty"
)]
pub contributors: Vec<Contributor>,
#[serde(
rename = "_difficultyBeatmapSets",
skip_serializing_if = "Option::is_none"
)]
pub custom_environment: Opt... | Rust | 0 |
mple on role train data
if len(predicate_arguments) > 0 and not isTest:
for tmp_et in random.sample(set(schema_et_list) - et_set, 4):
for role_type in et_rt_dict[tmp_et]:
source_text = tmp_et + " </s> " + role_type + " </s> " + token_separator.join(tokens)
... | Python | 1 |
import requests
import zipfile
import os
from urllib.parse import urlparse
import sys
sys.path.append('..')
relative_target_folder = r".\data\external"
def get_GloVe_embeds():
zip_url = "https://nlp.stanford.edu/data/glove.6B.zip"
download_and_extract_zip(zip_url, relative_target_folder)
def get_FastText_e... | Python | 1 |
\\n"]
#[doc = "encoded in 2 bytes (16 bit unsigned number) \\n"]
#[doc = "1 LSB = 10 MHz \\n"]
#[doc = "For 77GHz devices(76GHz to 81GHz) \\n"]
#[doc = "Valid range: 7600 to 8100"]
#[doc = "Default value : 7600 (If API is not issued)"]
#[doc = "For 60GHz devices(57GHz to 64GHz) \\n"]
#[doc ... | Rust | 0 |
instance_id)
}
fn safe_args(&self) -> &'static [&'static str] {
self.error.safe_args()
}
}
impl<T> Serialize for WithInstanceId<T>
where
T: Serialize,
{
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
self.error.serialize(s)
}
}
i... | Rust | 0 |
et buyer = T::Lookup::lookup(offer_owner)?;
Offers::<T, I>::try_mutate_exists(
buyer.clone(),
offer_id,
|maybe_offer| -> DispatchResult {
let offer = maybe_offer.as_mut().ok_or(Error::<T, I>::OfferNotFound)?;
if let Some(ref deadline) = offer.deadline {
ensure!(
<frame_system::Pa... | Rust | 0 |
}
// check for no more cells
if arr[0][0] != '_' && arr[0][1] != '_' && arr[0][2] != '_' &&
arr[1][0] != '_' && arr[1][1] != '_' && arr[1][2] != '_' &&
arr[2][0] != '_' && arr[2][1] != '_' && arr[2][2] != '_' {
out = 'T';
}
out
}
// main game function
fn play_game() ... | Rust | 0 |
PixelColor,
{
fn with_style(mut self, style: Style<C>) -> Self {
self.style = style;
self
}
fn with_stroke(mut self, color: Option<C>) -> Self {
self.style.stroke_color = color;
self
}
fn with_stroke_width(self, _width: u8) -> Self {
// Noop
self... | Rust | 0 |
import frappe
def execute():
frappe.reload_doc("stock", "doctype", "quality_inspection_parameter")
params = set()
# get all parameters from QI readings table
for (p,) in frappe.db.get_all(
"Quality Inspection Reading", fields=["specification"], as_list=True
):
params.add(p.strip())
# get all parameters fr... | Python | 1 |
};
let mut rng = thread_rng();
let dist = Uniform::new(-10.0, 10.0);
loop {
let a: f64 = dist.sample(&mut rng);
let b: f64 = dist.sample(&mut rng);
let c: f64 = dist.sample(&mut rng);
let d: f64 = dist.sample(&mut r... | Rust | 0 |
Shows', 2145.041021505376), ('Comedy', 1585.263705882353)]
================================== Ai Message ==================================
The music genres with the longest average track durations are:
1. **Sci Fi & Fantasy**: ~2911.78 seconds (48.53 minutes)
2. **Science Fiction**: ~2625.55 seconds (43.76 minutes)... | Python | 1 |
cxsmiles('CCCC[C@H](N(C)[*])C([*])=O |$;;;;;;;_R1;;_R2;$|')
print(relabel_rgroup2index(smi))
# Get CXSMILES from SMILES
smi = get_cxsmiles_from_smi('[*:_R1]N1CCC[C@H]1C([*:_R2])=O')
print(smi)
print(combine_monomer_unused_rgroup('CCCC[C@H](N(C)[*:1])C([*:2])=O', '[*:1][H]'))
replace_unused_r_gr... | Python | 1 |
import google.generativeai as genai
import os
genai.configure(api_key=os.environ["GEMINI_API_KEY"])
model = genai.GenerativeModel('gemini-pro')
def generate_quiz_prompt(station_name, language="EN"):
"""
Generates a prompt for the Groq API to create 5 multiple choice questions.
"""
return [
f""... | Python | 1 |
wrapper::exception::raise_exception(env.as_c_arg(), atom.as_c_arg());
Term::new(env, exception)
}
Error::RaiseTerm(ref term_unencoded) => {
let term = term_unencoded.encode(env);
let exception =
wrapper::exception... | Rust | 0 |
ent."""
@Event.PreDeleteCommand.subscribe
def hook(command: DeleteCommand) -> None:
command.largs.labels = ["einstein"]
assert Event.PreDeleteCommand.validate()
await DeleteCommand("knuthwebsite").execute()
assert "einstein" not in Database().keys()
assert... | Python | 1 |
"kk")]
crate::Annotation {
lang: "kk",
tts: Some("ет кесімі"),
keywords: &["ет кесімі"],
},
#[cfg(feature = "km")]
crate::Annotation {
lang: "km",
tts: Some("សាច\u{17cb}ម\u{17bd}យដ\u{17bb}\u{17c6}"),
keywords: &[
... | Rust | 0 |
",
"type": "record",
"fields": [ {"name": "hacker", "type": "boolean", "default": false} ]}"#,
Value::Record(vec![("hacker".into(), Value::Boolean(false))])),
// Doc examples
(r#"{"type": "record", "name": "TestDoc", "doc": "Doc string",
"fields": ... | Rust | 0 |
_elastic;
mod model_liquid_retention;
mod model_pedroso_williams;
mod model_porous;
mod model_real_density;
mod model_seepage;
mod model_stress_strain;
mod model_van_genuchten;
mod parameters;
mod sim_config;
mod sim_state;
mod sim_state_initializer;
mod simulation;
pub use crate::boundary_conditions::*;
pub use crate:... | Rust | 0 |
ate from the
// workers instead of synchronously acquiring an update, and that way we
// could ensure that even on the Rust side of things it's not UB.
let mem = wasm_bindgen::memory().unchecked_into::<WebAssembly::Memory>();
let mem = Uint8ClampedArray::new(&mem.buffer()).slice(base as u32, (base + len... | Rust | 0 |
from openai import OpenAI
import os
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role":"user", "content":"Hello Nanthini!"}]
)
print(response.choices[0].message.content)
| Python | 1 |
le_kernel_sizes = upsample_kernel_sizes
self.resblock_kernel_sizes = resblock_kernel_sizes
self.resblock_dilation_sizes = resblock_dilation_sizes
self.leaky_relu_slope = leaky_relu_slope
# specific to Code Hifi-Gan
self.unit_hifi_gan_vocab_size = unit_hifi_gan_vocab_size
... | Python | 1 |
;
use hyper::client::Client;
use tokio_core::reactor::Core;
pub struct HttpClient {
header: String,
}
impl HttpClient {
pub fn post() {
let json = r#"{"library":"hyper"}"#;
let uri = "http://httpbin.org/post".parse::<Uri>().unwrap();
let mut req: Request<Body> = Request::new(Method::... | Rust | 0 |
oWeightNorm),
nn.LogSoftmax(dim=1)
)
def __init__(self, nChan, nTime, nClass, idx, idx_local_graph,
nBands=9, m=48, doWeightNorm=True, strideFactor=4, n_chunks=10):
super().__init__()
self.nBands = nBands
self.channels = nChan
self.m = m
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.