text string | label_name string | labels int64 |
|---|---|---|
let mut cfg = CONFIG.load(deps.storage)?;
let lp_token = addr_validate_to_lower(deps.api, lp_token.as_str())?;
let mut pool_info = POOL_INFO.load(deps.storage, &lp_token)?;
mass_update_pools(deps.branch(), env)?;
cfg.total_alloc_point = cfg
.total_alloc_point
.checked_sub(pool_i... | Rust | 0 |
# Copyright 2018 Toolchain Labs, Inc. All rights reserved.
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import socket
import subprocess
from toolchain.base.memo import memoized
from toolchain.base.toolchain_error import ToolchainAssertion
@memoized
def get_remote_username() -> str:
... | Python | 1 |
features: `\"Win32_UI_ColorSystem\"`*"]
pub struct JabColorF {
pub J: f32,
pub a: f32,
pub b: f32,
}
impl ::core::marker::Copy for JabColorF {}
impl ::core::clone::Clone for JabColorF {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[doc = "*Required features: `\"Win32_UI_ColorSystem\"`, `... | Rust | 0 |
"num_retrieved_tiles": len(instance.retrieved_tiles),
"num_result_tiles": len(instance.result_tiles),
"num_result_cells": result_tile_set.compute_num_cells(),
"num_ground_truth_cells": gt_tile_set.compute_num_cells()
}
result.update(confusion.as_dict())
... | Python | 1 |
) -> bool> {
self.get_team(Team::Player)
}
pub fn monsters<'a>
(&'a self)
-> std::iter::Filter<std::slice::Iter<'a, Character>, fn(&&Character) -> bool> {
self.get_team(Team::Monster)
}
pub fn get_team<'a>
(&'a self,
team: Team)
-> std::iter::... | Rust | 0 |
xda\xa9G\x989\xbe\xd2E[]Qn\x8b\
|\xbf\xbd\xfe\x1a\xb1\xf6\x05\xd5e\x89e]\xdb[w\
\xcd\xebX:\xa6\x8d5\xac\xac\xd6\xf2\xbc_\xc4\xb5&\
\x83\xaf\x5cZ\xc4\xbfjm\xcc\xad\xf7\x97\xf9\xd6\x1c\xbf\
\xccTj\xedf7\xe2_\xc2\xf8\xb5MwK\xf15\
\x84\xb2\xe9\xbe \xd1\x1b\xf7w\x116\xcf>,`\xa3\
c\xa8>\xf5\xd6\xe8:\xf3x\xf2/\xde\xf9K\xa9[\
... | Python | 1 |
S.build(visualizer)
drawn_img = drawn_img.detach().cpu().numpy()
# drawn_img = drawn_img[:, :, ::-1]
drawn_img[0, :, :] = drawn_img[0, :, :] * 255
drawn_img[1, :, :] = drawn_img[1, :, :] * 255
drawn_img[2, :, :] = drawn_img[2, :, :] * 255
drawn_img = drawn_img.astype(np.... | Python | 1 |
"%F %RZ",
"%F %R%:z",
"%F %T%.fZ",
"%F %T%.f%:z",
"%FT%R",
"%FT%RZ",
"%FT%R%:z",
"%FT%T%.f",
"%FT%T%.fZ",
"%FT%T%.f%:z",
];
for format in sqlite_datetime_formats {
if let... | Rust | 0 |
AsyncRead for Rd {
fn poll_read(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
_buf: &mut [u8],
) -> Poll<io::Result<usize>> {
unimplemented!();
}
}
// Can't create BytesMut w/ zero capacity, so fill it up
let mut buf = BytesMut::with_c... | Rust | 0 |
import os
import unittest
from pyats.topology import loader
from genie.libs.sdk.apis.iosxe.spanning_tree.configure import unconfigure_spanning_tree_bridge_assurance
class TestUnconfigureSpanningTreeBridgeAssurance(unittest.TestCase):
@classmethod
def setUpClass(self):
testbed = f"""
devices:
... | Python | 1 |
rn_idx": [1, 2, 3],
"freeze_at": -1,
"freeze_norm": False,
"use_lab": True,
},
"dfine_hgnetv2_l": {
"name": "B4",
"return_idx": [1, 2, 3],
"freeze_at": 0,
"freeze_norm": True,
"freeze_stem_only": True,
... | Python | 1 |
def forward(self, x):
x = self.features(x)
x = self.conv(x)
x = self.avgpool(x)
x = x.view(x.size(0), -1)
x = self.classifier(x)
return x
| Python | 1 |
Some(scad!(NamedColor(c.to_string())))
} else {
None
}
}
fn assemble(&self) -> ScadObject {
if let Some(mut c) = self.object_color() {
c.add_child(self.assemble_both());
c
} else {
self.assemble_both()
}
}
}
im... | Rust | 0 |
(i & bits(10, 11)) >> 10 {
0b00 => ARMv4InstructionType::STRH{transfer_params, data_reg: rd, offset},
0b01 => ARMv4InstructionType::LDRSB{transfer_params, data_reg: rd, offset},
0b10 => ARMv4InstructionType::LDRH{transfer_params, data_reg: rd, offset},
0b11 => ARMv4Instr... | Rust | 0 |
age,
&original_region,
&plot_region,
bin_size,
0,
)?;
let plot_id = format!(
"graph_{event_id}_{cycle_id}_{edge}",
event_id = event_id,
cycle_id = cycle.id,
edge = i
... | Rust | 0 |
rule(
rrule,
ymd_hms(1997, 9, 2, 9, 0, 0),
&[
ymd_hms(1997, 9, 2, 9, 0, 0),
ymd_hms(1997, 9, 2, 14, 0, 0),
ymd_hms(1997, 9, 2, 19, 0, 0),
ymd_hms(1997, 9, 4, 1, 0, 0),
ymd_hms(1997, 9, 4, 6, 0, 0),
],
);
}
#[test]
fn hourly... | Rust | 0 |
(node.1 - system.y()) as i32,
),
)
.unwrap();
}
}
}
_ => {}
}
}
self.character.draw(syst... | Rust | 0 |
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... | Python | 1 |
d(Accuracy::TenBit).midpoint(), 0);
}
#[test]
fn voltage_range_from_raw_into_raw() {
for raw in 0..1024 {
assert_eq!(
VoltageRange::from_raw(raw, Accuracy::TenBit).into_raw(),
raw
);
assert_eq!(
VoltageRange::from_... | Rust | 0 |
xtend[i] + torch.tensor([1., 0., 0.])
else:
# 隐藏参考可视化
for i in range(28):
viewer.user_scn.geoms[i].pos = [10, 10, 10]
viewer.sync()
# --- 安全检查 ---
if ((d.qpos[7:] - joint_limit_lo) < -0.02).any() or ((d.qpos[7:] - join... | Python | 1 |
bookmarks
self._launcher_instance._perform_search(trigger)
return False
GLib.timeout_add(50, reset_and_refresh)
except ImportError:
# Fallback: direct call if GLib not available
self._launcher_i... | Python | 1 |
l(mean, std, size=num_samples)
wgn_input_v = np.random.normal(mean, std, size=num_samples)
wgn_input_w = np.random.normal(mean, std, size=num_samples)
tout1, u_disturb, x1 = signal.lsim(H_u, wgn_input_u, t_p)
tout2, v_disturb, x2 = signal.lsim(H_v, wgn_input_v, t_p)
tout3, w_dis... | Python | 1 |
"""
Diffing utilities for DeepCoder CLI.
"""
import difflib
from typing import List, Tuple
def create_diff(old_content: str, new_content: str, file_path: str) -> str:
"""
Create a unified diff between old and new content.
Args:
old_content: The original content
new_content: The new co... | Python | 1 |
# SPDX-License-Identifier: GPL-2.0-or-later
"""
A class that writes persistence data to disk when device state is updated.
Due to the architecture of the daemon, it's not as simple to know when
something has changed, so for now, an interval will periodically check for
changes in memory and write them to disk. This al... | Python | 1 |
GleamThinUpBox,
/// Gleam Thin Down Box
GleamThinDownBox,
/// Gleam Round Up Box
GleamRoundUpBox,
/// Gleam Round Down Box
GleamRoundDownBox,
/// Free BoxType
FreeBoxType,
}
impl FrameType {
/// Gets the Frame type by index
pub fn by_index(idx: usize) -> FrameType {
let ... | Rust | 0 |
,
)],
vec!["example.json", "schema.json"],
);
let package = package.unwrap();
let template = helpers::template(
&Fixture::contents("kcp/files/no-params.txt"),
&Value::Object(Map::new()),
);
let rendered = package.compile(None, None);
assert_eq!(rendered.unwrap(), Value::String(templ... | Rust | 0 |
from pathlib import Path
from typing import Tuple, List, Dict, Any
import random
from bisect import bisect_right
import torch
from torch import Tensor
import numpy as np
from tqdm import tqdm
from .base import CfdDataset, CfdAutoDataset
from .utils import load_json, normalize_bc, normalize_physics_props
def load_ca... | Python | 1 |
path and os.path.exists(comparison_path):
comparison_df = pd.read_csv(comparison_path)
print("\n=== MODEL COMPARISON ===")
print(comparison_df.to_string(index=False))
# Print summary for each company
print("\n=== COMPANY RESULTS ===")
for result in re... | Python | 1 |
def solve(grid):
h = len(grid)
w = len(grid[0])
freq = {}
for i in range(h):
for j in range(w):
v = grid[i][j]
if v != 0:
freq[v] = freq.get(v, 0) + 1
if not freq:
return grid
target = max(freq, key=lambda k: freq[k])
visited = [[False]... | Python | 1 |
xf4\xd6S\x8f\xe2\xad)X\x15\xef\x95u\x81\
\x8f\xde\xbe51\xa7\xc7$\xa5\xd7\x03jA\xbc}+\
\xd9\x8dHM\x7f\xed\x98\xb3\x02+\xa4\x88\x8f\xd4\xd2-\
F|l\x84h@\x8a\x9cWJ\xa9\x9cOg\xc4\xc6\
\x17\x94\xd6H\x13w\x16\x10\xf6\xedFo\x83\xf5\x9c)\
m'\x84\x84\x86\xcep\xd6\x88\xdc/J^\x22.E\
\x5c\xeb\xf4qA\x9dM\xe7{-\x88s\x1c\xbb\xf1\x10\
... | Python | 1 |
tinue,
_ => return true,
}
}
}
/// Wake up one thread that's blocked on futex_wait on this futex.
///
/// Returns true if this actually woke up such a thread,
/// or false if no thread was waiting on this futex.
#[cfg(any(target_os = "linux", target_os = "android"))]
pub fn futex_wake(futex: &A... | Rust | 0 |
ibuted_msg_bounce");
let sock_addrs = [next_test_addr(), next_test_addr()];
scope(|s| {
s.spawn(|_| {
/*
native | sync p|-->
| g|<--
*/
let mut c = file_logged_connector(0, test_log_path);
let [p, g] = [
... | Rust | 0 |
new(TableArrayAttribute::new(
"modification",
vec![
Box::new(ScalarAttribute::new("type", SIZEOF_BYTE)),
Box::new(ArrayAttribute::new("cosignatory_publicKey", SIZEOF_BYTE)),
],
)),
];
schema_definition.append(&mut modify_multisig_accou... | Rust | 0 |
UVICORN_CONFIG = {
"backlog": 2048,
"timeout_keep_alive": 65,
"limit_concurrency": 500,
"limit_max_requests": 0,
} | Python | 1 |
Right::Read),
};
const FUNCTIONS_HEX: phf::Map<&'static str, (PrimitiveMethod, Right)> = phf_map! {
"encode" => (PrimitiveObject::hex_encode as PrimitiveMethod, Right::Read),
"decode" => (PrimitiveObject::hex_decode as PrimitiveMethod, Right::Read),
};
const FUNCTIONS_EVENT: phf::Map<&'static str, (Pr... | Rust | 0 |
nager: &mut EntityManager, entity_id: usize) {
manager.remove_entity(entity_id);
}
}
impl System for RenderSystem {
fn update(&mut self, manager: &mut EntityManager, accessor: &mut EntityIdAccessor) {
let (canvas_width, canvas_height) = RenderSystem::get_canvas_size(manager);
// @TODO: Is getting context ever... | Rust | 0 |
"""
Copyright (c) 2018-2024 Intel 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
Unless required by applicable law or agreed to in wri... | Python | 1 |
"""Device defaults for a Growatt Inverter."""
from .base import (
GrowattDeviceRegisters,
custom_function,
FIRMWARE_REGISTER,
DEVICE_TYPE_CODE_REGISTER,
NUMBER_OF_TRACKERS_AND_PHASES_REGISTER,
ATTR_INVERTER_MODEL,
ATTR_MODBUS_VERSION,
ATTR_SOC_PERCENTAGE,
ATTR_DISCHARGE_POWER,
A... | Python | 1 |
CLOSED_RECEIVER_ERROR),
Ok(v) => match v {
TdType::Ok(v) => Ok(v),
TdType::Error(v) => Err(RTDError::TDLibError(v)),
_ => {
log::error!("invalid response received: {:?}", v);
Err(INVALID_RESPONSE_ERROR)
}... | Rust | 0 |
cimal_places=2) = decimal.Decimal("100.00")
assert isinstance(User.fake(), User)
def test_int32() -> None:
"""
Test Int32 type
"""
class User(AvroBaseModel):
name: str
age: int
test_score_1: types.Int32 = 100
test_score_2: types.Int32 = types.Int32(12)
assert... | Python | 1 |
}
use std::io::{Write, Read, Seek, SeekFrom};
use std::fs::{File, OpenOptions};
fn read_file(path: &str, seek_start: u64) -> Result<String, String> {
File::open(path).map_err(|err| err.to_string())
.and_then(|mut file| {
let mut contents = String::new();
file.seek(SeekFrom::Start(s... | Rust | 0 |
#[doc = "Filter Division Set 2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum FLTDIV2_A {
#[doc = "0: BUSCLK/32"]
_000 = 0,
#[doc = "1: BUSCLK/64"]
_001 = 1,
#[doc = "2: BUSCLK/128"]
_010 = 2,
#[doc = "3: BUSCLK/256"]
_011 = 3,
#[doc = "4: BUSCLK... | Rust | 0 |
15, 20))
/// # .style(style);
/// let moved = line.translate(Coord::new(10, 10));
///
/// assert_eq!(moved.start, Coord::new(15, 20));
/// assert_eq!(moved.end, Coord::new(25, 30));
/// ```
fn translate(&self, by: Coord) -> Self {
Self {
start: self.start + by,
... | Rust | 0 |
1...kM])
```
where the join is over all `[j1...jN]` such that `segment_ids[j1...jN] = i`.
Strings are joined in row-major order.
For example:
>>> inputs = ['this', 'a', 'test', 'is']
>>> segment_ids = [0, 1, 1, 0]
>>> num_segments = 2
>>> separator = ' '
>>> tf.strings.unsorted_segment_join(inputs... | Python | 1 |
from contextlib import contextmanager
from io import BytesIO
import logging
import os
import time
from typing import Union
from PIL import Image
Image.MAX_IMAGE_PIXELS = None
logger = logging.getLogger(__name__)
@contextmanager
def no_proxy():
d_original = {}
for variable in ["http_proxy", "https_proxy", "H... | Python | 1 |
,
port: usize,
pin: usize
}
impl PinInput {
pub fn pull_up(&mut self) -> Result<()> {
let spi = match self.spi.lock() {
Ok(guard) => guard,
Err(poisoned) => poisoned.into_inner(),
};
let mask = 1 << self.pin;
let iodir = MCP23X17Register::GPPU(self.p... | Rust | 0 |
valuations',
Item=item
)
st.success("✅ Evaluation results saved to DynamoDB.")
debug_logs['dynamodb_success'] = "Evaluation results saved to DynamoDB"
except Exception as e:
debug_logs['dynamodb_error'] = f"Failed to save to... | Python | 1 |
from typing import Any
from flask import g
def get_ego_network(ids: set[int]) -> list[dict[str, Any]]:
g.cursor.execute(
"""
SELECT id, domain_id, property_code, range_id
FROM model.link
WHERE domain_id IN %(ids)s or range_id IN %(ids)s;
""",
{'ids': tuple(ids)})
... | Python | 1 |
from django.http import HttpResponseRedirect
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from .config import *
import requests
from .serializer import *
import random
from django.views.decorators.csrf import csrf_exempt
class InitiateAuthView(... | Python | 1 |
eed.vector(ndofs_fine);
/// multiplicity.set_value(1.0);
///
/// // Restrictions
/// let strides : [i32; 3] = [1, q as i32, q as i32];
/// let rq = ceed.strided_elem_restriction(ne, q, 1, q * ne, strides);
///
/// let mut indx : Vec<i32> = vec![0; 2 * ne];
/// for i in 0..ne {
/// ... | Rust | 0 |
ncode_metric_datum("", &[0.0, 2.5, 5.0], false, &metric);
assert_eq!(
header,
"# HELP requests requests\n# TYPE requests histogram\n".to_owned()
);
assert_eq!(frame, "requests_bucket{le=\"0\"} 0\nrequests_bucket{le=\"2.5\"} 6\nrequests_bucket{le=\"5\"} 8\nrequests_bucket... | Rust | 0 |
.add(&Q.z); y3.norm();//15
x3.mul(&y3); //16
y3.copy(&t0); y3.add(&t2); //y3.norm();//17
y3.rsub(&x3); y3.norm(); //18
z3.copy(&t2);
if rom::CURVE_B_I==0 {
z3.mul(&b); //18
} else {
z3.imul(rom::CURVE_B_I);
}
x3.copy(&y3); x3.sub(&z3); x3.norm(); //20
z3.copy(... | Rust | 0 |
weights_array = prj.get("weight", format="array")
self.assertTrue((weights_array > 0.).all())
def test_create_with_homogeneous_common_properties(self):
with self.assertRaises(ValueError):
# create synapse type with heterogeneous common parameters
fromlist = sim.FromListCon... | Python | 1 |
get_info(self):
"""Override to provide camera-specific info"""
basic_info = super().get_info()
flash_info = "with flash" if self.has_flash else "without flash"
return f"{basic_info}, {self.megapixels} megapixels, {flash_info}"
# Demo code to test the Smartphone class
if __name__ == "__... | Python | 1 |
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Python Software
# Foundation; All Rights Reserved
"""A HTTPSConnection/Handler with additional proxy and cert validation features.
In particular, monkey patches in Python r74203 to provide support for CONNECT
proxies and adds SSL cert validation if the ssl modu... | Python | 1 |
57B1
@scena.Code('func_13_57B1')
def func_13_57B1():
Sleep(500)
def _loc_57B6(): pass
label('loc_57B6')
If(
(
(Expr.PushLong, 0x1),
Expr.Return,
),
'loc_5802',
)
ChrWalkTo(0x00FE, 13560, -4000, 11950, 1500, 0x00)
ChrSetDirection(0x00FE, 270... | Python | 1 |
tart.timestamp() < istop.timestamp():
if prevdate != event.start.strftime("%Y-%m-%d"): # Make a header for each day
prevdate = event.start.strftime("%Y-%m-%d")
myfile.write("\nWorklog, " + prevdate + "\n===================\n")
dura... | Python | 1 |
considered in the differenctiation, meaning that the stress would be considered as
# a velocity independent constant in the LHS.
print(f"Computing {dim}D{nnodes}N LHS Gauss point contribution\n")
SubstituteMatrixValue(rhs, stress, C*grad_sym_v)
lhs = Compute_LHS(rhs, testfunc, dofs, do_simplifications)... | Python | 1 |
ed);
assert!(buffer.is_empty());
let mut buffer = vec![127, 127, 127, 127, 127, 128, 1, 240, 35, 128];
let res = Message::decode(&mut buffer, false, 0, None);
assert_eq!(res.unwrap(), expected);
assert!(buffer.is_empty());
let mut buffer = vec![127, 127, 127, 127, 128, ... | Rust | 0 |
::from_bytes(b1, b2);
assert!(i.is_ok());
let i_data = i.unwrap();
assert_eq!(i_data.i_type, I::LDSprite);
assert!(i_data.addr.is_none());
assert!(i_data.byte.is_none());
assert!(i_data.nibble.is_none());
assert_eq!(i_data.vx, Some(0x2));
assert!(i_data.vy.is_none());
}
#[test]
fn te... | Rust | 0 |
import os
import wx.stc
from modules import dict4ini
from modules import Globals
_fmtime = None
_ini = None
_ini_filename = os.path.join(Globals.workpath, 'acp/jquery/jquery.tag')
# Lookups to determine what the current line-ending is.
_eols = { wx.stc.STC_EOL_CR : '\r',
wx.stc.STC_EOL_CRLF : '\r\n',
... | Python | 1 |
rovided as the last argument, i.e. there is no associated
// value.
FlagWithoutValue,
}
/// Iterator to scan through all symbols in the size graph.
pub struct SymbolIter<'g> {
graph: &'g SizeGraph,
current: usize,
}
impl<'g> Iterator for SymbolIter<'g> {
type Item = Symbol<'g>;
fn next(&mut s... | Rust | 0 |
timesteps], dtype=torch.long, device=sample.device)
elif torch.is_tensor(timesteps) and len(timesteps.shape) == 0:
timesteps = timesteps[None].to(sample.device)
# broadcast to batch dimension in a way that's compatible with ONNX/Core ML
timesteps = timesteps.expand(sample.shape[0])
... | Python | 1 |
_MAX_ENUM:
VkSparseImageFormatFlagBits = 2147483647;
pub type VkSparseImageFormatFlagBits = ::std::os::raw::c_uint;
pub type VkSparseImageFormatFlags = VkFlags;
pub const VkFenceCreateFlagBits_VK_FENCE_CREATE_SIGNALED_BIT: VkFenceCreateFlagBits = 1;
pub const VkFenceCreateFlagBits_VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM... | Rust | 0 |
import warnings
import pandas as pd
import time
from autox.autox_server.util import log
from tqdm import tqdm
warnings.filterwarnings('ignore')
def f_rolling_count(x):
x.iloc[:] = range(1, len(x) + 1)
return x
# 同一时间内,cat类型的值出现的次数
def fe_time_rolling_count(G_df_dict, G_data_info, G_hist, is_train, remain_time... | Python | 1 |
ics.assert_field_eq(&metric, "test_str", &"hello");
metrics.assert_field_eq(&metric, "test_i32", &1024);
let metric = metrics.assert_metric_exists(&"message 2 value format value");
metrics.assert_field_eq(&metric, "test_str", &"hi");
metrics.assert_field_eq(&metric, "test_i32", &512);
}
/*
* SPDX-Lic... | Rust | 0 |
_queues: Vec<i32>,
/// Number of RX descriptors to use.
pub rxd: i32,
/// Number of TX descriptors to use.
pub txd: i32,
pub loopback: bool,
pub tso: bool,
pub csum: bool,
}
impl Default for PortConfiguration {
fn default() -> PortConfiguration {
PortConfiguration {
... | Rust | 0 |
"p(f(f(a)),h(f(f(a)),f(a)),f(f(a)))");
}
#[test]
fn exercise2_3_1() {
// same as above, but using `interpret` to drive the machine,
// instead of a hardcoded sequence of instructions
let mut machine = Machine::new(7);
{
let mut machine = machine.dump();
interpret::query(&mut machi... | Rust | 0 |
/// i.e. currently not servicing an exception
ThreadMode,
/// Non-maskable interrupt.
Nmi,
/// All class of fault.
HardFault,
/// Memory management.
MemoryManagementFault,
/// Pre-fetch fault, memory access fault.
BusFault,
/// Undefined instruction or illegal state.
Usag... | Rust | 0 |
# Smartphone Class with Inheritance
class Smartphone:
def __init__(self, brand, model, price):
self.brand = brand
self.model = model
self.price = price
def details(self):
return f"{self.brand} {self.model} costs ${self.price}"
class GamingSmartphone(Smartphone):
def __ini... | Python | 1 |
svc_perror!(Asp::ext_tsk());
toppers_assert!(false);
}
}
#[no_mangle]
extern "C" fn cpuexc_handler(p_excinf: &c_void) {
toppers_syssvc_syslog!(
LOG_NOTICE,
"CPU exception handler (p_excinf = 0x%08x).",
p_excinf as *const c_void as u32
);
if Asp::sns_ctx() != tr... | Rust | 0 |
"""
URL configuration for climate_tracker project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, na... | Python | 1 |
# Copyright 2025 © BeeAI a Series of LF Projects, LLC
# SPDX-License-Identifier: Apache-2.0
import json
from io import StringIO
from typing import Any
import pytest
from beeai_server.utils.utils import extract_string_value_stream
def async_json_reader(obj: dict[str, Any] | str):
stringio = StringIO(json.dumps(... | Python | 1 |
s, p).as_str()]).collect();
}
}
unreachable!()
}
fn input_compatible_with(&self, p: &Vec<u8>) -> bool {
for digits in self.input.iter() {
let lights = Entry::transform(digits, p);
if !Entry::digit_map().contains_key(lights.as_str()) {
... | Rust | 0 |
if (
schema["properties"]["metadata"]["properties"].get("auth_type") is not None
and SupportedAuthProviders is not None
):
schema["properties"]["metadata"]["properties"]["auth_type"]["enum"] = auth_type_enum
... | Python | 1 |
started = False
else:
logging.debug(f"Job '{filename}' started via OctoPrint API")
started = True
if not started:
if fmgr.upload_queue_enabled():
job_queue: JobQueue = self.server.lookup_component(
... | Python | 1 |
is: Dict) -> Dict[str, Any]:
"""Analyze text using JAIS (Arabic-native model)"""
client = self.get_jais_client()
# Use Arabic prompt for JAIS as it's native Arabic model
prompt = f"""
حلل هذا النص العربي من ناحية المشاعر والمواضيع والسياق الثقافي:
النص: {text}
أجب بصيغة JSON:
... | Python | 1 |
delta_r_2i = calc_deltaR(self.particles, self.exclusive_jets_3[:, 1:2])
delta_r_3i = calc_deltaR(self.particles, self.exclusive_jets_3[:, 2:3])
self.pt_i = self.particles.pt
min_delta_r = ak.min(
ak.concatenate(
[
delta_r_1i[..., np.newaxis] ** s... | Python | 1 |
rror_exception::SWAddressNotSignExtended {}),
Box::new(super::arithmetic::shifts::SRA {}),
Box::new(super::arithmetic::shifts::SRL {}),
Box::new(super::arithmetic::shifts::SLL {}),
Box::new(super::arithmetic::shifts::ShiftsIntoR0 {}),
Box::new(super::cart_memory::LW {}),
... | Rust | 0 |
()
non_composite_2.fit()
# composite_2 is an unfitted version of composite
# composite is an unfitted version of non_composite_2
assert non_composite == non_composite
assert composite == composite
assert non_composite == non_composite_2
assert non_composite != non_composite_3
assert non... | Python | 1 |
from .studentam_raspisanieekza__zachjotov_2uncategorised import (
StudentamRaspisanieEkzamenovIZachjotov2UncategorisedMilDomainParser,
)
__all__ = ["StudentamRaspisanieEkzamenovIZachjotov2UncategorisedMilDomainParser"]
| Python | 1 |
,
// TODO Should be enum
_mod: i16,
interval: i16,
leaky: i16,
},
#[udmf(215)]
TeleportLine {
thisid: i16,
destid: i16,
// TODO Should be bool
flip: i16,
},
#[udmf(216)]
SectorSetGravity { tag: i16, ipart: i16, fpart: i16 },
... | Rust | 0 |
om_response(command="Confirm", response=response)
return True if data is not None else False
@staticmethod
def _request(url: str, json_data: dict, config_version: str):
# print("json_data = ", json_data)
args = {"config_version": config_version}
cert_path = MLOpsConfigs.get_cert... | Python | 1 |
_depth > args.min_depth_eval, gt_depth < args.max_depth_eval)
if args.garg_crop or args.eigen_crop:
gt_height, gt_width = gt_depth.shape
eval_mask = np.zeros(valid_mask.shape)
if args.garg_crop:
eval_mask[int(0.40810811 * gt_height):int(0.99189189 * gt_heigh... | Python | 1 |
ithub repo add so.
raw_alpha = self.deconv1(x12d)
pred_mattes = F.sigmoid(raw_alpha)
if self.stage <= 1:
return pred_mattes, 0
# Stage2 refine conv1
refine0 = torch.cat((x[:, :3, :, :], pred_mattes), 1)
refine1 = F.relu(self.refine_conv1(refine0))
r... | Python | 1 |
ively walk directories to find Python files, applying exclusion patterns.
# Get all Python files from directories that match our criteria:
# - Pass formatter's exclude/extend-exclude/force-exclude patterns
# - Match Python file extensions (.py, .pyi, .ipynb)
# - Aren't symlinks pointing outside the root... | Python | 1 |
*const c_void {
let id = T::register_type(name);
cpp!(unsafe [id as "int"] -> *const c_void as "const void*" {
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
return QMetaType(id).iface();
#else
Q_UNUSED(id);
return nullptr;
#endif
})
}
/// QGadget are automatically QMetaType... | Rust | 0 |
"""
自适应检索 核心函数
"""
import os
import re
import fitz
import numpy as np
from openai import OpenAI
from dotenv import load_dotenv
load_dotenv()
client = OpenAI(
base_url=os.getenv("LLM_BASE_URL"),
api_key=os.getenv("LLM_API_KEY")
)
llm_model = os.getenv("LLM_MODEL_ID")
embedding_model = os.getenv("EMBEDDING_MODE... | Python | 1 |
PXi<Output<MODE>> {
fn is_high(&self) -> bool {
!self.is_low()
}
fn is_low(&self) -> bool {
// NOTE(unsafe) atomic read with no side effects
unsafe { (*$GPIOX::ptr()).pdir.read().bits() &... | Rust | 0 |
);
}
"-d" => {
// Read stream from stdin.
let mut vec = Vec::new();
io::stdin()
.read_to_end(&mut vec)
.expect("Failed to read stdin");
// Decompress the input.
let decompressed = lz4::decompress(&vec).expect("C... | Rust | 0 |
")
indexedmodel.histogram()
outputfilename = "/tmp/data.colibri.indexedpatternmodel"
print("Writing to file")
indexedmodel.write(outputfilename)
print("Loading indexed corpus")
indexedmodel = colibricore.IndexedPatternModel("/tmp/data.colibri.indexedpatternmodel")
print("iterating over all patterns and values")
for ... | Python | 1 |
expr) => {
let it = vec![0_u8; $times];
for (_, _) in it.iter().enumerate() {
$fn();
}
}
}
fn console() {
println!("repeated");
}
fn main() {
repeat!(console; 10);
}
/*
Copyright ⓒ 2015 grabbag contributors.
Licensed under the MIT license (see LICENSE or <http://openso... | Rust | 0 |
import matplotlib.pyplot as plt
import numpy as np
from scipy import ndimage
from scipy import interpolate
def plot_trajectory(env_map, trajectories):
plt.style.use('grayscale')
plt.ion()
styles = ['solid', 'dashed', 'dashdot', 'dotted']
env_map = ndimage.binary_dilation(env_map, [[False, True, False], [True... | Python | 1 |
images = images.permute(0, 2, 3, 1).numpy()
# masks = masks.permute(0, 2, 3, 1).numpy()
for i, (image, mask) in enumerate(zip(images, masks)):
print(i, image.shape, mask.shape)
# print(np.unique(mask))
ax = plt.subplot(args.batch_size, 2, 2 * i + 1)
# ax.set_title('image')
... | Python | 1 |
import argparse
import os
import cv2
import numpy as np
import torch
from torch.utils.data import DataLoader
from torchvision import transforms as T
from tqdm import tqdm
from utils.metrics import evaluation
from utils import prepare_dataset
from utils.dataset import LandmarkDataset, save_img
from models.D2GPLand impo... | Python | 1 |
;
pub const __LDBL_DIG__: ::std::os::raw::c_uchar = 18;
pub const __LDBL_HAS_INFINITY__: ::std::os::raw::c_uchar = 1;
pub const __LDBL_HAS_QUIET_NAN__: ::std::os::raw::c_uchar = 1;
pub const __LDBL_MANT_DIG__: ::std::os::raw::c_uchar = 64;
pub const __LDBL_MAX_10_EXP__: ::std::os::raw::c_ushort = 4932;
pub const __LDBL... | Rust | 0 |
= body.rotation_period {
meta_comp.set_metadata("body_rotation_period", &rotation_period.to_string());
}
if let Some(rotation_axis) = body.rotation_axis {
meta_comp.set_metadata(
"body_rotation_period",
&format!(
"[{}, {}, {}]"... | Rust | 0 |
: Write>(&self, mut writer: W) -> IoResult<()> {
self.key.write(&mut writer)?;
self.val.write(&mut writer)?;
Ok(())
}
}
impl<F: PrimeField> Default for ExampleTx<F> {
fn default() -> Self {
ExampleTx::<F> {
key: 0,
val: F::default(),
}
}
}
//... | Rust | 0 |
n config is terminal, return the final dependence trees object
dep_tree = config.tree
return dep_tree
def load_model(name = 'zh'):
''' data_path e.g.: ./deepnlp/parser/data/zh
ckpt_path e.g.: ./deepnlp/parser/ckpt/zh
ckpt_file e.g.: ./deepnlp/parser/ckpt/zh/parser.ckpt.data-00000-of... | Python | 1 |
HashMap;
let mut proxy_headers = HashMap::new();
proxy_headers.insert("X-Forwarded-Proto", "https");
let security = Security::new()
.ssl_redirect()
.ssl_proxy_headers(proxy_headers);
let client = create_client(security);
let req = client
.get("/")
.header(Header::ne... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.