text string | label_name string | labels int64 |
|---|---|---|
n.as_str() {
"raw" => match args.arguments.as_slice() {
[arg] => match &arg.value {
ast::Expression::StringValue(s, _) => Ok(OperatorClass::Raw(s.as_str())),
_ => Err(DatamodelError::new_parser_error(
... | Rust | 0 |
ler:
fhandler.write(custom_rhp_txt)
dict_config = dict(
server=dict(
mlflow_tracking_uri=None, # not setup, not modified yet
credentials=None,
request_header_provider=dict(
type="bad_custom_rhp.BadCustomRequestHeaderProvider"
),
... | Python | 1 |
version https://git-lfs.github.com/spec/v1
oid sha256:a702a0519daf126d9374ca0aa4c9518a359c683f7e19234eec43ac328b94a118
size 953
| Python | 1 |
if let Some(release) = &self.release {
release.as_str()
} else {
"0"
}
}
}
impl TryFrom<MetadataRep> for Metadata {
type Error = Error;
fn try_from(rep: MetadataRep) -> Result<Self> {
Ok(Self {
name: rep.name,
version: rep.versi... | Rust | 0 |
tion_tape,
grabbing: false,
atoms_grabbed: [AtomKey::null(); 6],
}
}
pub fn angles_between_arm(arm_type: ArmType) -> Rot {
use ArmType::*;
match arm_type {
PlainArm => 6,
DoubleArm => 3,
TripleArm => 2,
HexArm => 1,
... | Rust | 0 |
_pick(pr_num, merge_hash, latest_branch)]
if JIRA_IMPORTED:
if JIRA_USERNAME and JIRA_PASSWORD:
continue_maybe("Would you like to update an associated JIRA?")
jira_comment = "Issue resolved by pull request %s\n[%s/%s]" % (pr_num, GITHUB_BASE, pr_num)
resolve_jira_issues(... | Python | 1 |
xt.replace("\\", r"\\").replace("\"", r#"\""#);
format!("\"{}\"", encoded)
}
fn main() {
let strings = get_input_lines("day8.txt");
let mut total_raw = 0;
let mut total_str = 0;
for string in &strings {
let stripped_string = strip_escape_chars(&string);
let raw_length = string.chars().count();
let... | Rust | 0 |
(3;4,0)]);("0+4",[(4;0,6);(5;6,0)]);("",[(6;0,0)])]);
let bdd_2 = bdd!(5;1;[("1+2",[(1;2,3)]);("3+2",[(2;4,5);(3;4,0)]);("0+4",[(4;0,6);(5;6,0)]);("",[(6;0,0)])]);
let mut system = system![bdd, bdd_2]?;
let join_id = system.join_bdds(Id::new(0), Id::new(1))?;
let result = system
.pop_bdd(join_id... | Rust | 0 |
"""Tests for webhook server"""
import pytest
from aiohttp import web
from unittest.mock import Mock
from src.webhooks.server import WebhookServer
from src.webhooks.handlers import WebhookHandler
class MockWebhookHandler(WebhookHandler):
"""Mock handler for testing"""
async def handle(self, request: web.Requ... | Python | 1 |
eSetInformation(sessionhandle: u64, informationclass: TRACE_QUERY_INFO_CLASS, traceinformation: *const ::core::ffi::c_void, informationlength: u32) -> u32;
#[doc = "*Required features: `\"Win32_System_Diagnostics_Etw\"`*"]
pub fn UnregisterTraceGuids(registrationhandle: u64) -> u32;
#[doc = "*Required featu... | Rust | 0 |
Fn = callback::CallbackMut1Fn<f32>;
/// Internal `Camera2d` representation. Please see `Camera2d` for full documentation.
#[derive(Debug)]
struct Camera2dData {
display_object: display::object::Instance,
screen: Screen,
zoom: f32,
z_zoom_1: f32,
... | Rust | 0 |
// println!("triangles: {}, valid: true, keep: false", facet);
compute_silhouette(
triangles[facet].adj[(indirect_id + 1) % 3],
triangles[facet].indirect_adj_id[(indirect_id + 1) % 3],
point,
out_facets_and_idx,
po... | Rust | 0 |
import os
class Config(object):
API_HASH = os.environ.get("API_HASH")
BOT_TOKEN = os.environ.get("BOT_TOKEN")
TELEGRAM_API = os.environ.get("TELEGRAM_API")
OWNER = os.environ.get("OWNER")
OWNER_USERNAME = os.environ.get("OWNER_USERNAME")
PASSWORD = os.environ.get("PASSWORD")
DATABASE_URL =... | Python | 1 |
current_time = time.time()
# Kiểm tra thời gian
if current_time > room.current_round.end_time:
logger.info(f"Round ended in room {room_id}, starting new round")
# Tự động tạo vòng mới thay vì từ chối đoán
self._start_new_round(room)
# Cho phép đoán tr... | Python | 1 |
uint256,bytes32)[]").unwrap(),
ParamType::Array(Box::new(ParamType::Tuple(vec![ParamType::Uint(256), ParamType::FixedBytes(32)])))
)
}
#[test]
fn test_read_inner_tuple_array_param() {
use crate::param_type::Writer;
let abi = "((uint256,bytes32)[],address)";
let read = Reader::read(abi).unwrap();
let p... | Rust | 0 |
***********************
sad6
Y_Y
******************************
screaming
:-@
******************************
sean the sheep
<('--')>
******************************
shark
~~~~~~^~~~~~
******************************
shark attack
~~~~~~\o/~~~~~/\~~~~~
******************************
shocked2
:-O
***************************... | Python | 1 |
looks like it runs for ever, but this is not how tokio works
// at least with tokio 1.6.0 and Rust 1.52 this stops executing
// when the tokio runtime gets dropped.
loop {
int.tick().await;
// breaks the loop
let map = INTERVAL_MANAGER.running_intervals.lock().unwrap();
if ... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @File : lda.py
# @Data : 2020/5/31
# @Author : Luo Kun
# @Contact: luokun485@gmail.com
import numpy as np
from matplotlib import pyplot as plt
from numpy import linalg as LA
class LDA:
"""
Linear Discriminant Analysis(线性判别分析)
"""
def __init__(self... | Python | 1 |
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("SubjectRulesReviewSpec")
}
fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error> where A: serde::de::MapAccess<'de> {
let mut value_groups: Option<Vec... | Rust | 0 |
import numpy as np
# Define the initial grid
grid = np.array([[10, 25, 'x'], ['x', 'x', 45], ['x', 7, 'x']])
# Define the range of possible numbers
numbers = set(range(5, 54))
# Remove the numbers already in the grid from the set of possible numbers
for row in grid:
for num in row:
if num != 'x':
... | Python | 1 |
how::{anyhow, bail, Context, Result};
use bytes::Buf;
use cpio::{write_cpio, NewcBuilder, NewcReader};
use nix::unistd::isatty;
use openat_ext::FileExt;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::convert::TryInto;
use std::fs::{read, write, File, OpenOptions};
use std::io::{self, copy,... | Rust | 0 |
fn main() {
let l = Layout::from_size_align(1, 1).unwrap();
let ptr = Global.allocate(l).unwrap().as_non_null_ptr();
unsafe { System.deallocate(ptr, l); }
}
pub use crate::core::UnivariateMoments;
pub mod discrete;
pub mod continuous;
import_all!(uniform);
import_all!(degenerate);
use self::SeqType::*;
u... | Rust | 0 |
("440504", "广东省汕头市公园区"),
("440505", "广东省汕头市金砂区"),
("440506", "广东省汕头市达濠区"),
("440507", "广东省汕头市龙湖区"),
("440508", "广东省汕头市金园区"),
("440509", "广东省汕头市升平区"),
("440510", "广东省汕头市河浦区"),
("440511", "广东省汕头市郊区"),
("440512", "广东省汕头... | Rust | 0 |
mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
PrefixOperator::Plus => write!(f, "+"),
PrefixOperator::Minus => write!(f, "-"),
PrefixOperator::Not => write!(f, "!"),
}
}
}
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum AssignOperator {
... | Rust | 0 |
s[u] != G.nodes[v]
with pytest.raises(nx.NetworkXError, match="Negative number of nodes"):
nx.complete_multipartite_graph(2, -3, 4)
def test_kneser_graph(self):
# the petersen graph is a special case of the kneser graph when n=5 and k=2
assert is_isomorphic(nx.kneser_graph(5, 2)... | Python | 1 |
import torch
from torch import nn
from d2l import torch as d2l
import os, sys
sys.path.insert(
0, os.path.dirname(os.path.abspath(__file__)) + "/../../")
from tasks.deep_learn.RNN import load_data_time_machine, train, RNNModelScratch
from tasks.deep_learn.ConciseRNN import RNNModel
def get_lstm_params(vocab_siz... | Python | 1 |
egg -> compass_airfield_payments'
@['', ty6qcegbi_t, fix70baxwa_, 0j, 0.0, sklqr66y9fi, b'', j96dwza1ki3, None, p360ew4inoc]
def mgckt55y8pd(urmf80_g5ua=0j):
None
del rr9fe83bxkv
nonlocal gb4yu7mll_k
'# periods_semicolon_egg -> compass_airfield_payments'
import v2l9a3qnc30
'# periods_semicolon_e... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 Efabless Corporation
#
# 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
#
# Un... | Python | 1 |
me = match exec_name_ffi.to_str() {
Some(v) => v.to_string(),
None => return Err("Can't decode unicode in executable name".to_string()),
};
// Generates shell completions for <shell> and prints to stdout
let mut buf: Vec<u8> = vec![];
CmdArgs::clap().gen_completions_to(exec_name, shell,... | Rust | 0 |
let mut outer = BTreeMap::new();
outer.insert(util::ByteString::from_str("dict"), Bencode::Dict(inner));
outer.insert(util::ByteString::from_str("outer"), Bencode::Number(1));
assert_decoded_eq(&[DictStart,
DictKey(bytes("outer")),
Nu... | Rust | 0 |
/// Glue two faces at boundaries.
/// # Examples
/// ```
/// use truck_topology::*;
/// let v = Vertex::news(&[(); 8]);
/// let edge = vec![
/// Edge::new(&v[0], &v[1], ()),
/// Edge::new(&v[1], &v[2], ()),
/// Edge::new(&v[2], &v[0], ()),
/// Edge::new(&v[3], &v[4]... | Rust | 0 |
#
# Solved Problems in Geostatistics
#
# ------------------------------------------------
# Script for lesson 4.2
# "Bootstrap & Spatial Bootstrap"
# ------------------------------------------------
import sys
sys.path.append(r'../shared')
from statistics import *
from numpy import *
from geo import *
from grid_3d im... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from itertools import combinations
def rewrap(data:np.array)-> np.array:
"""Wraps the data between -pi and pi.
Args:
data (np.array): the data need to be wrapped
Returns:
np.array: Wrapped data. Values are between -pi and ... | Python | 1 |
thod="wsum",
params=bm25_bert_params[0],
)
bm25_bert_run.name = 'BM25 + BERT'
bm25_bert_user_run = fuse(
runs=[bm25_ranx_run, bert_ranx_run, user_ranx_run],
norm="min-max",
method="wsum",
params=bm25_user_bert_params[0],
)
bm25_ber... | Python | 1 |
moized_b(db: &dyn Database) {
db.memoized_a()
}
fn volatile_a(db: &dyn Database) {
db.salsa_runtime().report_untracked_read();
db.volatile_b()
}
fn volatile_b(db: &dyn Database) {
db.salsa_runtime().report_untracked_read();
db.volatile_a()
}
fn cycle_leaf(_db: &dyn Database) {}
fn cycle_a(db: &d... | Rust | 0 |
::new();
/// // Enqueue a kernel on `queue_1`, creating an event representing the kernel
/// // command in our list:
/// kernel.cmd().queue(&queue_1).enew(&mut event_list).enq()?;
/// // Read from a buffer using `queue_2`, ensuring the read does not begin until
/// // after the kernel command has co... | Rust | 0 |
ir.open_dir_readable(&job_id)?;
dirs.push(dir);
}
Ok(dirs)
}
// Get all entries in a capabilities directory. If there is a "svc" directory, traverse it and
// collect all protocol names as well.
async fn get_capabilities(capability_dir: Directory) -> Result<Vec<String>> {
let mut entries = capabili... | Rust | 0 |
> bool {
*self == TEST_AOUT_A::AOUT_DCDC_ACTIVATED
}
#[doc = "Checks if the value of the field is `AOUT_VDDRF_READY`"]
#[inline(always)]
pub fn is_aout_vddrf_ready(&self) -> bool {
*self == TEST_AOUT_A::AOUT_VDDRF_READY
}
#[doc = "Checks if the value of the field is `AOUT_VDDC_RE... | Rust | 0 |
vmLv {
pub name: Box<str>,
pub path: Box<Path>,
pub uuid: Box<str>,
}
#[derive(Debug, Clone)]
pub struct LvmPv {
pub path: Box<Path>,
pub uuid: Box<str>,
}
#[derive(Debug, Clone)]
pub struct Luks {
pub physical_volume: Box<str>,
}
/* automatically generated by rust-bindgen 0.59.1 */
pub type ... | Rust | 0 |
=score,
recommendation_type=recommendation_type,
similarity_to_request=similarity,
market_trend=self._get_market_trend(build),
meta_rank=self._get_meta_rank(build)
)
scored_builds.append(recommendation)
... | Python | 1 |
detached_t(output_tp)
arg_tp = dr.diff_array_t(arg_tp)
return output_tp, arg_tp
# 1D
Float, UInt32 = make_ad_types(Float, UInt32)
assert Float.__module__ != UInt32.__module__
casted = Float(UInt32([0, 1, 2, 3]))
assert type(casted) == Float
assert dr.all(casted == [0., 1... | Python | 1 |
from microbit import *
import random
from nezha import *
from ai import *
def stop(nz):
nz.set_motors(1, 0)
nz.set_motors(4, 0)
def straight(nz, speed):
nz.set_motors(1, speed)
nz.set_motors(4, speed)
def right(nz, speed):
nz.set_motors(1, 10)
nz.set_motors(4, speed * 2)
... | Python | 1 |
1, time0, time1, ray.time))
/ radius)
.normalize();
let (front_face, normal) = Intersection::get_face_normal(ray, outward_normal);
return Some(Intersection {
point,
normal,
t,
... | Rust | 0 |
ON);
}
#[test]
fn physical_to_physical_position() {
let src = PhysicalPosition::new(128, 256);
let dest = src.to_physical(2 * DEFAULT_DPI);
assert!(src.x == dest.x);
assert!(src.y == dest.y);
let src = PhysicalPosition::new(128.0, 256.0);
let dest = src.to_p... | Rust | 0 |
import Model.MyString.mystring as mystring
from Model.abstractions.ifile import IModelFile
from Model.abstractions.itext import IModelText
class ModelFile(IModelFile):
def __init__(self,
text: IModelText,
name: str | None):
super().__init__(text, name)
def open_fi... | Python | 1 |
4551_1,
std::option::Option::None,
"NS_4551-1",
[
"iso-ir-60",
"ISO646-NO",
"no",
"csISO60DanishNorwegian",
"csISO60Norwegian1",
],
[
"ISO-IR-60",
"CSISO60DANISHNORWEGIAN",
"CSISO60NORWEGIAN1",
"NS_4551-1",
"ISO646-NO",
"NO",
],
NF_Z_62_010,
std::option::Option::None,
"NF_Z_62-010",
["is... | Rust | 0 |
from flask import Blueprint, render_template, redirect, url_for, flash, request
from app.controller.consultas_controller import getAllConsultas, getDicValores, getPK, getCampos, postConsulta, deleteConsulta, getConsultaById, updateConsulta
alcance_consultas = Blueprint("consultas", __name__)
@alcance_consultas.route... | Python | 1 |
self.cpu
)
}
if trace.flag_break() != self.cpu.flag_break {
panic!(
"Failed verification trace on step {}: B {}, CPU: {:?}",
step,
trace.flag_break(),
self.cpu
... | Rust | 0 |
import dash
import dash_bootstrap_components as dbc
import pandas as pd
from dash import html, callback, Input, Output
import globals
import ui.components.allocation.allocation_by_client as abc
import ui.components.allocation.allocation_by_product_or_service as abpos
import ui.components.allocation.allocation_by_case ... | Python | 1 |
use crate::color::{Color, TriColor};
pub(crate) mod command;
use self::command::Command;
#[cfg(feature = "graphics")]
mod graphics;
#[cfg(feature = "graphics")]
pub use self::graphics::Display2in9bc;
/// EPD2in9bc driver
pub struct EPD2in9bc<SPI, CS, BUSY, DC, RST> {
interface: DisplayInterface<SPI, CS, BUSY, ... | Rust | 0 |
.collect::<Vec<_>>();
serialise::<Vec<serde::TaskWrapper>, Vec<serde::TaskWrapper>>(tasks)
}
#[wasm_bindgen]
pub async fn schedule() -> Result<JsValue> {
let schedule = eva::schedule(configuration()?, "importance").await?;
serialise::<eva::Schedule<eva::Task>, serde::ScheduleWrapper>(schedule)
}
... | Rust | 0 |
if exp_enable:
_check_exp_box(box_exp)
def check_utilize_harvest(self) -> bool:
"""
在寮结界界面检查是否有收获
:return: 如果没有返回False, 如果有就收菜返回True
"""
self.screenshot()
appear = self.appear(self.I_UTILIZE_EXP)
if not appear:
logger.info('No util... | Python | 1 |
else:
error = e.__str__()
logger.error(error)
yield ({"event": "error"})
finally:
client.delete(f"has_generated:{chat_id}")
if error:
history.append(SystemMessage(content=error))
elif full_answer:
... | Python | 1 |
const fn default_version() -> u16 {
relay_common::PROTOCOL_VERSION
}
fn is_false(value: &bool) -> bool {
!*value
}
fn make_false() -> bool {
false
}
/// Request information for sentry ingest data, such as events, envelopes or metrics.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RequestMeta... | Rust | 0 |
",
"weloganite",
"wolfenite",
"xenotime",
"yttrium aluminium garnet",
"zektzerite",
"zeolite",
"zincite",
"zinnwaldite",
"zircon",
"zoisite"
]
}
"#;
/// Contains various moods
pub const DATA_MOOD: &str = r#"
{
"data" :
[
"abandoned",
"absent minded"... | Rust | 0 |
priority: i32,
unmanaged: bool,
}
impl<System: raw::KernelInterruptLine> InterruptHandlerDefiner<System> {
const fn new() -> Self {
Self {
_phantom: Init::INIT,
line: None,
start: None,
priority: 0,
unmanaged: false,
}
}
/... | Rust | 0 |
: &mut H) {
match *self {
Object::Integer(ref i) => i.hash(state),
Object::Boolean(ref b) => b.hash(state),
Object::String(ref s) => s.hash(state),
_ => "".hash(state),
}
}
}
<gh_stars>0
use bracket_lib::prelude::*;
use specs::prelude::*;
use crate::... | Rust | 0 |
# Eve W-Space
# Copyright 2014 Andrew Austin and contributors
#
# 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 requi... | Python | 1 |
ser has installed the extension by cloning directly in the extension folder.
# We can't handle that when using typescript because we need the `target` directory to be the one that gnome knows about.
# So we ask the user to move the install instead.
printc(RED, f"You have installed ma... | Python | 1 |
es, containing the group
generated by all values
EXAMPLES::
sage: G = AbelianGroupWithValues([-1,0,1], [2,1,3])
sage: G.values_group()
Integer Ring
sage: Z4 = AbelianGroupWithValues([I], [4]) # needs sage.symbolic
... | Python | 1 |
def download_original_config(config_url, tmpdir):
original_config_file = BytesIO(requests.get(config_url).content)
path = f'{tmpdir}/config.yaml'
with open(path, 'wb') as f:
f.write(original_config_file.read())
return path
| Python | 1 |
import asyncio
import salt.transport
async def test_publsh_server(
io_loop, minion_opts, master_opts, transport, process_manager
):
minion_opts["transport"] = master_opts["transport"] = transport
pub_server = salt.transport.publish_server(master_opts)
pub_server.pre_fork(process_manager)
await a... | Python | 1 |
import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
from typing import Union, Optional
class Critic(nn.Module):
def __init__(self, backbone: nn.Module, device: str = "cpu", positive: bool = False, max_value = 0.0) -> None:
super().__init__()
self.device = to... | Python | 1 |
from mpi4py import MPI
import gmsh
from dolfinx.io import XDMFFile, gmshio
R = 1.0 # Outer radius of the ring
L = 0.75 # Inner radius of the ring
def gmsh_ring(model: gmsh.model, name: str) -> gmsh.model:
"""Create a Gmsh model of a ring-type geometry using 2D triangular cells."""
model.add(name)
model... | Python | 1 |
_type: SLOPE_INCLINE_W,
surface_type: 0,
slope_height: 8,
no_cursor: false,
no_walk: false,
};
let middle = Tile {
height: 8,
depth: 0,
slope_type: SLOPE_FLAT_0,
surface_type: 0,
slope_height: 0,
... | Rust | 0 |
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("intfloat/e5-mistral-7b-instruct")
# In case you want to reduce the maximum sequence length:
model.max_seq_length = 4096
queries = [
"how much protein should a female eat",
"summit define",
]
documents = [
"As a general guid... | Python | 1 |
"]
pub invalidate: ::std::option::Option<unsafe extern "C" fn(drawable: *mut __DRIdrawable)>,
#[doc = " This function reduces the number of flushes in the driver by combining"]
#[doc = " several operations into one call."]
#[doc = ""]
#[doc = " It can:"]
#[doc = " - throttle"]
#[doc = " - fl... | Rust | 0 |
from_depth_image(
depth=depth_image_o3d,
intrinsic=self.intrinsic,
depth_scale=1000.0,
depth_trunc=5)
# Apply transformation to fix camera orientation (rotate 180 degrees around Y-axis)
transformation_matrix... | Python | 1 |
, T, Error = E, SendFuture = BoxFuture<'a, Result<(), E>>>>;
pub fn boxed<T, E, Snk>(sink: Snk) -> BoxItemSink<T, E>
where
T: 'static,
Snk: for<'a> ItemSink<'a, T, Error = E> + 'static,
{
let boxing_sink = BoxingSink(sink);
let boxed: BoxItemSink<T, E> = Box::new(boxing_sink);
boxed
}
pub type Mps... | Rust | 0 |
ATURE_SIZE: usize = NUM_FEATURES * 361;
/// Utility function for determining the data format of the array returned by
/// `get_features`.
pub trait Order {
fn index(c: usize, i: usize) -> usize;
}
/// Implementation of `Order` for the data format `NCHW`.
pub struct CHW;
impl Order for CHW {
fn index(c: usize... | Rust | 0 |
import pandas as pd
def get_team_matches(csv_file_path, team_name):
try:
df = pd.read_csv(csv_file_path)
df = df.dropna(subset=['HomeTeam', 'AwayTeam', 'FTR'])
df['HomeTeam'] = df['HomeTeam'].str.strip()
df['AwayTeam'] = df['AwayTeam'].str.strip()
... | Python | 1 |
}
if arr[1].len() >= 2 {
let mut iter = arr[1].iter();
let x = *iter.next().unwrap();
let y = *iter.next().unwrap();
v2 = x + y;
}
println!("2: {} {}", v1, v2);
sub = min(v1, v2);
}
... | Rust | 0 |
IO2)
} else {
k_sinf(C1_PIO2 - x64)
}
} else if ix < UF_9_PI_4 {
/* |x| ~<= 9*pi/4 */
if ix > UF_7_PI_4 {
/* |x| ~> 7*pi/4 */
k_cosf(if sign { x64 + C4_PIO2 } else { x64 - C4_PIO2 })
} else if sign {
k_sinf(-x64 - C3_PIO2)
... | Rust | 0 |
(coords1[1], coords2[1], coords3[1], coords4[1]);
let y_min = util::min_4(coords1[1], coords2[1], coords3[1], coords4[1]);
let w_out = (x_max - x_min) as u32;
let h_out = (y_max - y_min) as u32;
let mut output = Image::blank(ImageInfo::new(w_out, h_out,
... | Rust | 0 |
imal, Deps, DepsMut, Env, from_binary, MessageInfo, Response, StdError, StdResult, Storage, to_binary, Uint128};
use cosmwasm_std::entry_point;
use cw20_base::allowances::{
execute_burn_from as cw20_execute_burn_from, execute_decrease_allowance as cw20_execute_decrease_allowance,
execute_increase_allowance as c... | Rust | 0 |
# modules/external_apis/web_search.py
import logging
import requests
import time
import hashlib
from typing import List, Dict
from pathlib import Path
from datetime import datetime, timedelta
class WebSearchClient:
def __init__(self, api_key: str, endpoint: str = "https://google.serper.dev/search", results_limit:... | Python | 1 |
println!("{}", task.url);
let resp = match task.method {
Method::Get =>
client.get(task.url)
.send(),
Method::Post =>
client.post(task.url)
.header(reqwest::header::CONTENT_TYPE, task.content_type)
... | Rust | 0 |
<u8> {
let mut with_header = vec![0u8; 0x150];
with_header[0x147] = 0x01;
with_header[0x148] = 0x00;
with_header[0x149] = 0x00;
for (i, byte) in rom.iter().enumerate() {
with_header[i] = *byte;
}
with_header
}
fn run_steps_without_wait_cycles(... | Rust | 0 |
[...,2]
return T
def twist2axangle(T):
'''
converts an n x 4 x 4 twist (se3) matrix to an n x 6 axis-angle
'''
return T[...,[0,1,2,2,0,1],[3,3,3,1,2,0]]
def axangle2adtwist(x):
'''
@Input:
x = n x 6 = n elements of position and axis-angle
@Output:
A = n x 6 x 6 = n elements of ad(se(3))
'''... | Python | 1 |
14 && &val[0..14] == "@[PRELOAD_DB]:" {
let db_name = String::from(&val[14..]);
let tmp_db_manager = database_manager.clone();
tokio::spawn(async move {
crate::database::DB_STATE
.lock()
... | Rust | 0 |
t_usage(self):
usage = {}
with closing(self.db.cursor()) as cursor:
cursor.execute(
f"""
SELECT name FROM {_schema_table_name(self.sqlite_version)} WHERE type = 'table' AND name NOT LIKE 'sqlite_%'
"""
)
for row in curso... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Amazon/Avatax Bridge",
'summary': "Bridge module between Amazon Connector and Avatax",
'category': 'Sales/Sales',
'version': '1.0',
'depends': ['sale_amazon', 'account_avatax'],
'installable': True,
'auto_... | Python | 1 |
pt)
logger.warning(f"請求失敗,等待 {delay} 秒後重試: {e}")
await asyncio.sleep(delay)
last_exception = e
else:
last_exception = e
# 所有重試都失敗
raise LLMConnectorError(f"請求失敗,已重試 {self.max_retries} 次: {last_except... | Python | 1 |
"""Using a dictionary to represent an instructor's grade book."""
grade_book = {
'Susan': [92, 85, 100],
'Eduardo': [83, 95, 79],
'Azizi': [91, 89, 82],
'Pantipa': [97, 91, 92]
}
all_grades_total = 0
all_grades_count = 0
for name, grades in grade_book.items():
total = sum(grades)
print(f'Avera... | Python | 1 |
' > building shuffle index with split [0, {}) and [{}, {}) '
'...'.format(num_samples, num_samples, total_size), flush=True)
dtype_ = np.uint32
if total_size >= (np.iinfo(np.uint32).max - 1):
dtype_ = np.int64
shuffle_idx_first = np.arange(start=0, stop=num_samples,
... | Python | 1 |
rite(time_msg)
print()
if args.eval:
# evaluate classifiers trained on synthetic data
synth_dir_list = []
for i in range(n_seeds):
synth_dir = os.path.join(exp_dir, f'synthesis/{seed + i}')
if os.path.exists(synth_dir):
synth_dir_l... | Python | 1 |
'technical_data': technical_data
}
def main():
"""Test the technical indicators"""
# Setup logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
print("📊 Technical Ind... | Python | 1 |
import math
def convert_K_to_RGB(colour_temperature):
"""
Converts from K to RGB, algorithm courtesy of
http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
Python translation from https://gist.github.com/petrklus/b1f427accdf7438606a6
"""
if colour_temperature < 2500:
... | Python | 1 |
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
#with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-... | Python | 1 |
[0])
self.dialog_nodes = DialogListNodes(element=self._get_children_elements(child_type="nodes")[0])
@dataclass
class DialogTree:
_tree_ref: ET.ElementTree
content: DialogContent
@classmethod
def create(cls, file_path: str) -> "DialogTree":
tree = ET.parse(file_path)
root = tre... | Python | 1 |
arg("proposal_index"))
.arg(get_integer_arg("instruction_index"))
.arg(get_arg("base64_instruction"))
)
.subcommand(
SubCommand::with_name("instruction-remove")
.about("Remove the instruction from the proposa... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. 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 |
RelativeTime.minutes(1)
assert a.getDescription() == "1 min 1 sec"
assert a.getDescription("infinite") == "1 min 1 sec"
a += juce.RelativeTime.hours(1)
assert a.getDescription() == "1 hr 1 min"
assert a.getDescription("infinite") == "1 hr 1 min"
a += juce.RelativeTime.days(1)
assert a.getD... | Python | 1 |
from langgraph.checkpoint.memory import MemorySaver
from langgraph.constants import START, END
from langgraph.graph import StateGraph
from backend.graphs.assistant_state import State
class BaseTestGraph:
@staticmethod
def dummy_leave_skill_node(_:State):
return {}
def build(self, entry: str, as... | Python | 1 |
.length,
input.len()
)
.as_str(),
)));
}
if output.len() != (self.length / 2 + 1) {
return Err(Box::new(FftError::new(
format!(
"Wrong length of output, expected {}, got {}",
... | Rust | 0 |
NFLICT DO NOTHING;
INSERT INTO wechat_mall_district (id, pid, name, create_uid, create_date, write_uid, write_date) VALUES (152523, 152500, '苏尼特左旗', 1, NOW() AT TIME ZONE 'UTC', 1, NOW() AT TIME ZONE 'UTC') ON CONFLICT DO NOTHING;
INSERT INTO wechat_mall_district (id, pid, name, create_uid, create_date, write_u... | Python | 1 |
ric = trimesh.triangles.points_to_barycentric(verts[closest_verts], closest) # (n, 3)
# device = points.device
# closest_verts = torch.tensor(closest_verts).to(device)
# barycentric = torch.tensor(barycentric).to(device)
# values = torch.sum(values[closest_verts] * # (n, 3, 3)
# ... | Python | 1 |
def __init__(self, config):
super().__init__(config)
self.model = OPTModel(config)
self.lm_head = nn.Linear(config.word_embed_proj_dim, config.vocab_size,
bias=False)
self.post_init()
| Python | 1 |
from itertools import product
import numpy as np
import pytest
import komm
import komm.abc
params = []
# PAM
order = [2, 4, 8]
base_amplitude = [0.5, 1.0, 2.0]
for args in product(order, base_amplitude):
params.append(komm.PAMConstellation(*args))
# QAM
orders = [4, 16, (2, 4), (8, 2)]
base_amplitudes = [0.5, ... | Python | 1 |
0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"
// "System.Private.CoreLib, Version=[ip], Culture=neutral, PublicKeyToken=7cec85d7bea7798e"
// NOTE: @userpath has false-positives in dotnet
// "Request starting HTTP/1.1 POST http://localhost:62919/Home/PostIndex application/json; charset=UTF-8 65"
//... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.