text string | label_name string | labels int64 |
|---|---|---|
UL, UB, DR, FR, DL, DB, UF, DF, BL, BR],
edges_orientation: [0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0],
},
Down => Self {
corners_permutation: [URF, UFL, ULB, UBR, DLF, DBL, DRB, DFR],
corners_orientation: [0; 8],
edges_permutation: [UR,... | Rust | 0 |
socket.reset();
self.unapply_config(s);
}
}
//if old_link_up || self.link_up {
// self.poll_configurator(timestamp)
//}
if let Some(poll_at) = s.iface.poll_at(timestamp, &mut s.sockets) {
let t = Timer::at(instant_from_s... | Rust | 0 |
from thinc.api import noop
from spacy_biaffine_parser.with_minibatch_by_padded_size import \
with_minibatch_by_padded_size
from .util import memoize
def test_batching():
model = with_minibatch_by_padded_size(memoize(), size=18)
X = ["peach", "banana", "apple", "pineapple"]
_, backprop = model(X, Tru... | Python | 1 |
T![<<] => self.at_composite2(n, T![<], T![<]),
T![<=] => self.at_composite2(n, T![<], T![=]),
T![==] => self.at_composite2(n, T![=], T![=]),
T![=>] => self.at_composite2(n, T![=], T![>]),
T![>=] => self.at_composite2(n, T![>], T![=]),
T![>>] => sel... | Rust | 0 |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_$",
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_$-",
"0123456789\\",
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"/^~",
"=+-!",
"A-",
"-A... | Python | 1 |
"arm 2"))
}
}
#[test]
fn custom_handler() {
let parse = |iter: Box<Iterator<Item = Token>>| {
parse_rules! {
term: Token;
i: Vec<String> => |iter| {
let mut params = Vec::new();
// while let Some(Ident(name)) = iter.peek().map(|peek| peek.clone(... | Rust | 0 |
y").and_return(builder)
related.should_receive("get_key_name").and_return("id")
related.should_receive("get_table").and_return("roles")
related.should_receive("new_pivot").replace_with(lambda *args: Pivot(*args))
builder.get_query().should_receive("join").at_least().once().with_args(
... | Python | 1 |
E_IMAGE_UNITS: u32 = 0x8872;
pub const MAX_TEXTURE_LOD_BIAS: u32 = 0x84FD;
pub const MAX_TEXTURE_MAX_ANISOTROPY: u32 = 0x84FF;
pub const MAX_TEXTURE_MAX_ANISOTROPY_EXT: u32 = 0x84FF;
pub const MAX_TEXTURE_SIZE: u32 = 0x0D33;
pub const MAX_TRANSFORM_FEEDBACK_BUFFERS: u32 = 0x8E70;
pub const MAX_TRANSFORM_FEEDBACK_... | Rust | 0 |
pport for future-incompatible warning reporting.
use crate::core::{Dependency, PackageId, Workspace};
use crate::sources::SourceConfigMap;
use crate::util::{iter_join, CargoResult, Config};
use anyhow::{bail, format_err, Context};
use serde::{Deserialize, Serialize};
use std::collections::{BTreeSet, HashMap, HashSet};... | Rust | 0 |
nvert_yaxis()
plt.savefig(fn, bbox_inches="tight", dpi=300)
# data loading
def load_raw_indiv(
indivs,
bs=10,
weights=RAW_WEIGHTS,
dev="cuda:0",
sid_slice=slice(0, None, 100),
h1=2048,
h2=None,
):
(tl, vl, ttl), nf = get_genetics_imaging_data(
rsids=None,
sid_sli... | Python | 1 |
_maps * input_softmax1.unsqueeze(-1), dim=dim - 1, keepdim=keepdim
) # (B, H, W, 1, 2)
orint_map = L2Norm(orint_map, dim=-1)
return score_map, scale_map, orint_map
else:
return score_map, scale_map
def im_rescale(im, output_size):
h, w = im.shape[:2]
if isinstance(output_s... | Python | 1 |
too_short_salt, &mut out);
assert_eq!(ret, Err(Error::SaltTooShort));
// 4Go of RAM seems big, but as long as we ask for a zero-initialized vector
// optimizations kicks in an nothing is really allocated
let too_long_salt = vec![0u8; argon2::MAX_SALT_LEN + 1];
let ret = ctx.hash_password_into(b"pas... | Rust | 0 |
import faiss, numpy as np, json
from sentence_transformers import SentenceTransformer
from pathlib import Path
INDEX_PATH = "data/faiss.index"
IDMAP_PATH = "data/id_map.json"
EMB_DIR = Path("data/embeddings")
MODEL_NAME = "all-MiniLM-L6-v2"
model = SentenceTransformer(MODEL_NAME)
index = faiss.read_index(INDEX_PATH)
i... | Python | 1 |
import numpy as np
import os
modes = ['train', 'test']
n_split = 1
num_frames = 16
overlap = [1, 1, 0.5]
dss = [1, 2, 4]
root = './data/gtea/'
frame_dir = './data/gtea/frames/'
for mode in modes:
txt_path = 'splits/' + mode + '.split' + str(n_split) + '.bundle'
train_split = []
with open(os.path.join(root,... | Python | 1 |
start_message = \
"""
Hello there! General Kenobi
"""
request_committed = \
"""
Ваш запрос обрабатывается, пожалуйста подождите! :P
"""
| Python | 1 |
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
# Define the image dimensions and patch size
def avg_stitch(
images_array: np.ndarray, # [66*66, 54, 54, 3]
image_count=64,
patch_per_image=3,
stride=1) -> np.ndarray:
output_size = image_count
patch_size... | Python | 1 |
UpdateStats(obj: usize);
fn GameEvent_Tutorial_TA_AddLocalPlayer(obj: usize, Player: usize);
fn GameEvent_Tutorial_TA_HandlePlayerResetTraining(obj: usize, GameEvent: usize);
fn GameEvent_Tutorial_TA_OnInit(obj: usize);
fn GameEvent_Tutorial_TA_EventTutorialTipChanged(obj: usize, GameEvent: usize, NewTi... | Rust | 0 |
nterval_end[cluster_idx]
update_indices = array_ops.expand_dims(
math_ops.range(start, end), -1)
vectors_in_cluster = eigenvectors[start:end, :]
# We use the builtin QR factorization to orthonormalize the
# vectors in the cluster.
q, _ = qr(tra... | Python | 1 |
"""
Approach to Solve the Problem
We need to determine the minimum number of jumps required to reach the last index from the first index. Each element in the array represents the maximum jump length that can be taken from that position.
Optimal Approach: Greedy Algorithm (O(n) Time)
We use a greedy approach with three... | Python | 1 |
usize & 0xf0) >> 4;
let imm = bytes[2] as u16 + (bytes[3] as u16) * 256;
let opcode = match opcode_num {
0 => Opcode::Undecoded,
1 => Opcode::Illegal,
2 => Opcode::NOP,
3 => Opcode::Move,
4 => Opcode::And,
5 => Opcode::Or,
6 => Opcode::Xor,
7 => O... | Rust | 0 |
gsize = (100,100))
ax = plt.axes(projection='3d')
ax.plot_surface(x_pairs,y_pairs,z, rstride=1, cstride=1, color='tab:cyan', alpha=0.4, antialiased=False)
ax.scatter(x_1,x_2,t, c = 'tab:olive')
ax.set_ylabel('')
ax.set_title('t', fontsize=20)
plt.xlabel('x_1', fontsize=18... | Python | 1 |
.expect(&I18n::text("tags_not_found"))
);
}
}
} else {
panic!(I18n::text("field_not_found"));
}
Rule::store_rule(&mut storage, rule);
} else if params.len() > 0 && params[0] == "-i"... | Rust | 0 |
UserStubbedError> {
let mut request_uri = format!("{}/user/marketplace_purchases/stubbed", super::GITHUB_BASE_API_URL);
if let Some(params) = query_params {
request_uri.push_str("?");
request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
}
let req... | Rust | 0 |
TCP channel.
pub type Writer = SplitSink<Framed<TcpStream, LengthDelimitedCodec>, Bytes>;
#[async_trait]
pub trait MessageHandler: Clone + Send + Sync + 'static {
/// Defines how to handle an incoming message. A typical usage is to define a `MessageHandler` with a
/// number of `Sender<T>` channels. Then imple... | Rust | 0 |
{
let changed;
if let Some(user_power) = event.content.users.get(&self.user_id) {
changed = self.power_level != Some(*user_power);
self.power_level = Some(*user_power);
} else {
changed = self.power_level != Some(event.content.users_default);
self... | Rust | 0 |
# Copyright 2025 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Python | 1 |
Ok(())
}
}
#[test]
fn deserialize_from_json() {
fn round_trip<T: Into<MyTransactions>>(t: T) {
let t = t.into();
let initial = serde_json::to_value(&t).unwrap();
println!("{:?}", initial);
let parsed: MyTransactions = serde_json::... | Rust | 0 |
from plotly.graph_objs import Histogram2dContour
| Python | 1 |
thiset = {"apple", "cherry", "banana"}
#check if item is present using 'in'
print("banana" in thiset)
#check if item is not present
print("cherry" not in thiset)
#add items - use add()
thiset = {"apple", "banana", "cherry"}
thiset.add("orange")
print(thiset)
#add sets - use update()
tropical = {"pineapple", "mango"... | Python | 1 |
40/apple/129/person-doing-cartwheel_1f938.png".to_string()),
_ => Some("https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/129/flexed-biceps_1f4aa.png".to_string()),
},
color: Some(rand::thread_rng().choose(&COLORS).unwrap().to_str... | Rust | 0 |
_type = 2;
#[doc = " Memory space that can be configured to store Flow Director filters"]
#[doc = " in the board memory."]
pub type rte_fdir_pballoc_type = u32;
#[doc = "< Never report FDIR hash."]
pub const rte_fdir_status_mode_RTE_FDIR_NO_REPORT_STATUS: rte_fdir_status_mode = 0;
#[doc = "< Only report FDIR hash for... | Rust | 0 |
from __future__ import annotations
from ipaddress import IPv4Address, IPv6Address
import pydantic
import pytest
import sqlalchemy
import edgy
from edgy.core.db import fields
from edgy.testclient import DatabaseTestClient
from tests.settings import DATABASE_URL
pytestmark = pytest.mark.anyio
database = DatabaseTest... | Python | 1 |
# Generated by Django 3.2.13 on 2022-08-17 03:25
from django.db import migrations, models
import django.db.models.deletion
def update_pc_server_mem_and_cpu(apps, schema_editor):
Host = apps.get_model("compute", "Host")
hosts = Host.objects.all()
changed = 0
for host in hosts:
if host.pcserver:... | Python | 1 |
file(whole_page_url_list)
def read_one_page_url_to_get_item_id():
url = "http://list.jd.com/list.html?cat=12218,12219,12227&page=3"
# ip_port = '58.22.106.230:8888'
# http_handler = urllib2.ProxyHandler({'http':'http://%s'%ip_port})
# opener = urllib2.build_opener(http_handler)
# urllib2.install_ope... | Python | 1 |
/ The addresses asssociated with the interface.
#[serde(default)]
addr_info: Vec<AddressInfo>,
}
impl InterfaceInfo {
/// Look up the interface with the specified name.
fn find(ifname: &str) -> Result<Option<InterfaceInfo>> {
// TODO: Should we use our `command_runner` for this so that we can m... | Rust | 0 |
#
# Copyright (C) 2016 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
from oeqa.utils.buildproject import BuildProject
class TargetBuildProject(BuildProject):
def __init__(self, target, uri, foldername=None, dl_dir=None):
self.target = target
self.targetdir = "~/buildtest/"
BuildPro... | Python | 1 |
;
}
self.swap(begin, end);
}
self[low + 1] = self[end];
self[end] = pivot;
if end >= rank {
high = end - 1;
}
if end <= rank {
low = begin;
}
}
}
}
impl<D: A... | Rust | 0 |
ecoder_init_state(self, context_encoding, config=None):
# compute initial decoder's state via average pooling
# (packed_graph_size, encoding_size)
packed_tree_node_encoding = context_encoding['packed_tree_node_encoding']
tree_num = context_encoding['tree_num']
total_node_num = ... | Python | 1 |
for a given query
/// source.
pub trait ValidWhereClause<QS> {}
impl<QS> ValidWhereClause<QS> for NoWhereClause {}
impl<QS, Expr> ValidWhereClause<QS> for WhereClause<Expr> where Expr: AppearsOnTable<QS> {}
#[allow(missing_debug_implementations)] // We can't...
pub enum BoxedWhereClause<'a, DB> {
Where(Box<Quer... | Rust | 0 |
m = key
for n in parse_path(path):
m = m.ChildKey(n)
self.assertEqual(m.ExtendedKey(), "xprvA2nrNbFZABcdryreWet9Ea4LvTJcGsqrMzxHx98MMrotbir7yrKCEXw7nadnHM8Dq38EGfSh6dqA9QWTyefMLEcBYJUuekgW4BYPJcr9E7j")
self.assertEqual(m.ExtendedKey(private=False, encoded=True), "xpub6FnCn6nSz... | Python | 1 |
uitProjectReviewFactory(
timestamp=self.two_weeks_ago, reviewer_user=user
)
review2.timestamp = self.two_weeks_ago
review2.save()
AgileCardFactory(recruit_project=review2.recruit_project)
# add a topic review, now we should have 3 reviews
review3 = TopicRevie... | Python | 1 |
always)]
pub fn is_uctxcptifg_1(&self) -> bool {
*self == UCTXCPTIFG_A::UCTXCPTIFG_1
}
}
#[doc = "Write proxy for field `UCTXCPTIFG`"]
pub struct UCTXCPTIFG_W<'a> {
w: &'a mut W,
}
impl<'a> UCTXCPTIFG_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self... | Rust | 0 |
ch).collect())
.collect()
}
#[allow(dead_code)]
fn map_to_string(map: &Vec<Vec<char>>) -> String {
let mut ret = String::new();
for row in map.iter() {
for ch in row.iter() {
ret.push(*ch);
}
ret.push('\n');
}
ret
}
fn adjacent(map: &Vec<Vec<char>>, x: usiz... | Rust | 0 |
self.draw_corners(img_pred, corner, colors[label], projection)
except:
pass
try:
# draw GT
corners = gt_bboxes['gt_bboxes_3d'].corners.numpy()
labels = gt_bboxes['gt_labels... | Python | 1 |
from ops.data import OpsClass, OpsField, DszObject, DszCommandObject, cmd_definitions
import dsz
if ('dll_u' not in cmd_definitions):
dszdllload = OpsClass('dllload', {'loadaddress': OpsField('loadaddress', dsz.TYPE_INT)}, DszObject)
dszdllunload = OpsClass('dllunload', {'unloaded': OpsField('unloaded', dsz.TY... | Python | 1 |
]), &hash_2x1(&LEAVES8[6], &LEAVES8[7])),
],
vec![LEAVES8[3]],
];
assert_eq!(expected_values, proof.values);
assert_eq!(expected_nodes, proof.nodes);
assert_eq!(3, proof.depth);
// 2 indexes on opposite sides
let proof = tree.prove_batch(&[1, 6]);
let expected_values = vec![LEAVES8[1], LEAVES8[6]];... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Financial Statements Analysis using OpenBB API
This script retrieves and compares total assets data for Target Corp (TGT)
from different financial data providers via OpenBB.
"""
import pandas as pd
from openbb import obb
# Login to OpenBB with your API token
API_TOK... | Python | 1 |
)
);
}
#[test]
fn bindgen_test_layout_cudaExternalSemaphoreWaitParams() {
assert_eq!(
::std::mem::size_of::<cudaExternalSemaphoreWaitParams>(),
40usize,
concat!("Size of: ", stringify!(cudaExternalSemaphoreWaitParams))
);
assert_eq!(
::std::mem::align_of::<cudaEx... | Rust | 0 |
_ulong & 0xFFF) << 12) |
(r as c_ulong & 0xFFF)
}
pub const fn ERR_GET_LIB(l: c_uint) -> c_int {
((l >> 24) & 0x0FF) as c_int
}
pub const fn ERR_GET_FUNC(l: c_uint) -> c_int {
((l >> 12) & 0xFFF) as c_int
}
pub const fn ERR_GET_REASON(l: c_uint) -> c_int {
(l &... | Rust | 0 |
correctly
for name, param in model.named_parameters():
if param.requires_grad:
# Check that parameter is not on meta device
assert not param.is_meta, f"Parameter {name} should not be on meta device"
# Check that parameter is on the correct device
assert param... | Python | 1 |
ith 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 writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express o... | Rust | 0 |
meta.create_gate(leak_once(format!("tv.{}.vaddr", temp_var_name)), |meta| {
let s_vaddr = meta.query_advice(vaddr_sel, Rotation::cur());
let value = meta.query_advice(self.value, Rotation::cur());
let t_var_a = meta.query_advice(temp_var, Rotation::cur());
let ta... | Rust | 0 |
#!/usr/bin/python
#Copyright (C) 2019 Jon Pry
#
#This file is part of Pill.
#
#Pill 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 2 of the License, or
#(at your option) any later version.
#
#Pi... | Python | 1 |
import li_std_wstring_inherit
import sys
x = "hello"
s = li_std_wstring_inherit.wstring("he")
s = s + "llo"
if s != x:
raise RuntimeError("bad string mapping {} {}".format(s, x))
if s[1:4] != x[1:4]:
raise RuntimeError("bad string mapping")
a = li_std_wstring_inherit.A(s)
b = li_std_wstring_inherit.wstring... | Python | 1 |
min_x);
for i in 1..(backwards_points.len()) {
let (ox, oy) = backwards_points[i - 1];
let (wx, wy) = backwards_points[i];
draw_line(ox, oy, wx, wy, 0.01, BLUE)
}
}
let drawstep = (max_x - min_x) / 1000.0;
for i in 0..1000 ... | Rust | 0 |
import streamlit as st
import glob
from natsort import natsorted
from streamlit_extras.switch_page_button import switch_page
import qrcode
import cv2
def main():
st.markdown("""
<div style='text-align: left;'>
<a href="/" target="_self">
<button style='background-col... | Python | 1 |
, 6, cpu);
}
fn reset_6_HL(cpu: &mut Cpu) {
op_set_HL(reset, 6, cpu);
}
fn reset_7_A(cpu: &mut Cpu) {
op_set_A(reset, 7, cpu);
}
fn reset_7_B(cpu: &mut Cpu) {
op_set_B(reset, 7, cpu);
}
fn reset_7_C(cpu: &mut Cpu) {
op_set_C(reset, 7, cpu);
}
fn reset_7_D(cpu: &mut Cpu) {
op_set_D(reset, 7, cpu);
}... | Rust | 0 |
r#"fn main() {
let Person(name: name, age: age) = 1
Nil
}
"#
);
assert_format!(
r#"fn main() {
let Person(age: age, name: name) = 1
Nil
}
"#
);
assert_format!(
r#"fn main() {
let Person(
age: really_long_variable_name,
name: really_long_variable_name,
) = 1... | Rust | 0 |
alue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum COSC_READY_A {
#[doc = "0: interrupt is not generated due to on board oscillator ready"]
COSC_READY_0 = 0,
#[doc = "1: interrupt generated due to on board oscillator ready"]
COSC_READY_1 = 1,
}
impl From<COSC_READY_A> for bool {
#[... | Rust | 0 |
2のクロックを有効にする
let tim2 = &dp.TIM2; // (13)TIM2の取得
tim2.psc.modify(|_, w| unsafe { w.bits(84 - 1) }); // (14)プリスケーラの設定
tim2.arr.modify(|_, w| unsafe { w.bits(1000000 - 1) }); // (15)ロードするカウント値
tim2.dier.modify(|_, w| w.uie().enabled()); // (16)更新割り込み有効
tim2.cr1.modify(|_, w| w.cen().enabled()); ... | Rust | 0 |
ial_decay,
),
action_potential_treshold: merge_scalar(
self.action_potential_treshold,
other.action_potential_treshold,
),
receptors_excitation: merge_scalar(
self.receptors_excitation,
other.receptors_excita... | Rust | 0 |
{
if let PianobarMessage::Info { message } = receiver.recv().await? {
if message.starts_with("We're playing this track because") {
return Ok(message);
}
}
}
};
Ok(timeout(Duration::from_millis(1... | Rust | 0 |
crate::{
check_errors,
command_buffer::CommandBufferLevel,
device::{physical::QueueFamily, Device, DeviceOwned},
Error, OomError, Version, VulkanObject,
};
use smallvec::SmallVec;
use std::{
error, fmt,
hash::{Hash, Hasher},
marker::PhantomData,
mem::MaybeUninit,
ptr,
sync::Arc,... | Rust | 0 |
'volume_diff_30', 'alpha003', 'alpha078', 'alpha085',
# 'turnover_hist_diff_1', 'alpha007', 'alpha016', 'alpha023',
# 'alpha013', 'alpha072', 'alpha049', 'alpha098', 'alpha094',
# 'alpha010', 'alpha006', 'close_diff_1', 'volume_hist... | Python | 1 |
nce(&mut seq)
.returning(move || val_b >> i & 1 != 0);
}
d.mock().expect_finish_reading().times(1).in_sequence(&mut seq);
let (a, b) = block_on(async {
let mut r = d.start_reading();
let a = r.read_bits(len_a).await;
let b = r.read_bits(len_b)... | Rust | 0 |
import unittest
import pytest
from lc_91_next_greater_element_1st import next_greater_element_brute
class TestGreaterElement(unittest.TestCase):
def test_basic_case(self):
self.assertEqual(next_greater_element_brute([2, 1, 2, 4, 3]), [4, 2, 4, -1, -1])
def test_strictly_decreasing(self):
... | Python | 1 |
#User function Template for python3
class Solution:
def findTriplets(self, arr):
# Your code here
n = len(arr)
cnt =0
res = []
for i in range(n-2):
for j in range(i+1, n-1):
for k in range(j+1, n):
if arr[i] + arr[j] +arr[k] == ... | Python | 1 |
DTSTART=20190415T031500")
.unwrap();
assert_eq!(
vec![
"2019-04-15T22:00:30+00:00",
"2019-04-22T22:00:30+00:00",
"2019-04-29T22:00:30+00:00",
],
rrule_result.get_all_iter_dates_iso8601("", "")
)
}
... | Rust | 0 |
_solution_strategy = (
routing_enums_pb2.FirstSolutionStrategy.AUTOMATIC)
# Solve the problem.
assignment = routing.SolveWithParameters(search_parameters)
if assignment is None:
print("No solution found")
result = "No solution found"
else:
p = printer.ConsolePrinter(data... | Python | 1 |
imeout(FONT_DOWNLOAD_TIMEOUT_MS).await?;
Err(timeout_msg.into())
}
}
/// Generates a `<span>` for a specific font family and weight with `opacity:0`,
/// since not all of the fonts may be shown and when e.g. the settings panel is
/// closed, and this will defer font loading.
fn font_test_html((family, weig... | Rust | 0 |
to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING... | Rust | 0 |
# Copyright 2025 the LlamaFactory team.
#
# 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 i... | Python | 1 |
Kind::IMUL {
operand_size,
src,
dst,
} => match operand_size {
ir::OperandSize::QWORD => format!("imulq {}, {}", src.to_atandt(), dst.to_atandt()),
},
ir::InstKind::IDIV {
operand_size,
va... | Rust | 0 |
= mixer::Mixer::new();
input::init_inputs_watches(&mut mixer, &mut sample_buffer, &buffer_position);
});
let host = cpal::default_host();
let device = host
.default_output_device()
.expect("Default output device not found");
let config = device.default_output_config().unwrap().... | Rust | 0 |
deny(
missing_docs,
nonstandard_style,
unused_parens,
unused_qualifications,
rust_2018_idioms,
rust_2018_compatibility,
future_incompatible,
missing_copy_implementations
)]
//! A tool for building and visualizing polytopes. Still in alpha development.
use bevy::prelude::*;
use bevy::re... | Rust | 0 |
import setuptools
from dig.version import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setup_requires = ['pytest-runner']
tests_require = ['pytest', 'pytest-cov', 'mock']
setuptools.setup(
name="dive_into_graphs",
version=__version__,
author="DIVE Lab@TAMU",
author... | Python | 1 |
let mut file = open_regular_file(fs, KERNEL_FILE, FileMode::Read);
let mut buf = [0u8; FILE_INFO_BUFFER_LEN];
let info = file
.get_info::<FileInfo>(&mut buf)
.expect_success("Failed to get file info");
let pool = bt
.allocate_pool(MemoryType::LOADER_DATA, info.file_size() as usize)
... | Rust | 0 |
", "0")?;
cvars.register("cl_crossy", "0")?;
cvars.register_archive("cl_forwardspeed", "400")?;
cvars.register("cl_movespeedkey", "2.0")?;
cvars.register_archive("_cl_name", "player")?;
cvars.register("cl_nolerp", "0")?;
cvars.register("cl_pitchspeed", "150")?;
cvars.register("cl_rollangle",... | Rust | 0 |
== SVE_PT_REGS_SVE ? \
// SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) \
// : SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags))
/// pointer authentication masks (NT_ARM_PAC_MASK)
#[repr(C)]
#[derive(Debug)]
pub struct user_pac_mask_t {
pub data_mask: u64,
pub insn_mask: u64,
}
/// pointer authen... | Rust | 0 |
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
<reponame>bestgopher/leetcode
fn main() {}
struct Solution;
impl Solution {
pub fn is_vali... | Rust | 0 |
fiat_p521_u1 = ((x360 >> 31) as fiat_p521_u1);
let x362: u32 = (x360 & 0x7fffffff);
let x363: u32 = ((x361 as u32) + x314);
out1[0] = x359;
out1[1] = x362;
out1[2] = x363;
out1[3] = x317;
out1[4] = x320;
out1[5] = x323;
out1[6] = x326;
out1[7] = x329;
out1[8] = x332;
out1[9] = x335;
out1[10] =... | Rust | 0 |
image = imageio.v2.imread(filename)
tensor = torch.Tensor(image).view(-1, 28, 28)
tensor = tensor.to(self.device)
output = F.softmax(self.forward(tensor), dim=1)
poss, predicted = torch.max(output.data, 1)
print(f"Predicted label: {predicted.item()}, Possibility: {poss.item(... | Python | 1 |
_ => outlet_types.push(*ty.clone()),
}
}
// - `()` for no outlets.
// - `#outlet` for single outlet.
// - `(#(#outlet),*)` for multiple outlets.
let return_outlets: syn::Expr = match outlets.len() {
0 => {
syn::parse_quote... | Rust | 0 |
o de matrícula que deseja alterar: ')
AlterarMatricula(matr)
#Exclusão baseado na matrícula
elif menuOpç == '3':
os.system('cls')
matr = InputMatrVerificada('\nDigite a matrícula que deseja excluir o registro: ')
ExcluiMatricula(matr)
#Relatorio Geral
elif menuOpç =='4'... | Python | 1 |
fn render_latency(&self, r: &mut Renderer, x: usize, y: usize, latency: &game::LatencyRecorder) {
let style = RBStyle { style: RB_NORMAL, fg: Color::Cyan, bg: Color::Black };
r.print(x, y+13, style, &format!("{:3}ms", latency.average()));
}
pub fn render_pov(&self, r: &mut Renderer, x: usize, ... | Rust | 0 |
type Result = Result<Result<i64, TtlError>, Error>;
}
impl Command for Ttl {
type Output = Result<i64, TtlError>;
fn into_request(self) -> RespValue {
resp_array!["TTL", self.key]
}
fn from_response(res: RespValue) -> Result<Self::Output, RespError> {
match res {
RespValue... | Rust | 0 |
&mut StringWriter) -> (usize, Option<CodecError>) {
let (st, processed, err) = iso2022jp::raw_feed(self.st, input, output, &());
self.st = st;
(processed, err)
}
fn raw_finish(&mut self, output: &mut StringWriter) -> Option<CodecError> {
let (st, err) = iso2022jp::raw_finish(se... | Rust | 0 |
pub const ERROR_WSMAN_INVALID_PARAMETER: u32 = 2150858810u32;
#[doc = "*Required features: `\"Win32_System_RemoteManagement\"`*"]
pub const ERROR_WSMAN_INVALID_PARAMETER_NAME: u32 = 2150858837u32;
#[doc = "*Required features: `\"Win32_System_RemoteManagement\"`*"]
pub const ERROR_WSMAN_INVALID_PROPOSED_ID: u32 = 215085... | Rust | 0 |
7458139914191132783,
3117159955370418896,
])),
),
QuadExtField::<ark_ff::Fp2ParamsWrapper<ark_bn254::Fq2Parameters>>::new(
ark_ff::Fp256::<ark_bn254::FqParameters>::new(BigInteger256::new([
3733904784425318460,
78986518056394... | Rust | 0 |
// (A)
cmd_result.code(0);
}
#[test]
// Given (1) the dock file defines an empty environment called `<env>`
// When `run --debug <env> echo hello` is run
// Then (A) the command is successful
// AND (B) the command STDERR is empty
// AND (C) the command STDOUT includes debugging output
fn debug_flag() ... | Rust | 0 |
les = user_rules
self.community_rules = community_rules
self.steam_db = steam_db
self.mutex = mutex
self.mods_metadata = mods_metadata
def run(self) -> None:
paths = (
self.mod_path if isinstance(self.mod_path, list) else [self.mod_pa... | Python | 1 |
ro_rules! run_rfc6979_test {
($hash: ty, $ntype: ident, $val: ident, $params: ident, $public: ident, $private: ident,
k $k: expr,
r $r: expr,
s $s: expr) => ({
let h1 = <$hash>::hash(&$val);
let rbytes = $r;
let sbytes = $s;
let r = $ntype::from_bytes(&rbytes);
... | Rust | 0 |
self.signals['hs300_signal'] = 0
self.signals['zz500_signal'] = 0
# 生成交易信号 (RSI > 70 超买,RSI < 30 超卖)
self.signals.loc[self.hs300['RSI'] < 30, 'hs300_signal'] = 1
self.signals.loc[self.hs300['RSI'] > 70, 'hs300_signal'] = -1
self.signals.loc[self.zz500['RSI'] < 30, 'zz500... | Python | 1 |
_stars>100-1000
//! Query API implementation.
use crate::WebGL2;
use luminance::backend::query::{Query as QueryBackend, QueryError};
unsafe impl QueryBackend for WebGL2 {
fn backend_author(&self) -> Result<String, QueryError> {
self
.state
.borrow_mut()
.get_vendor_name()
.ok_or_else(|| ... | Rust | 0 |
import chainlit as cl
import agent
@cl.on_chat_start
def start():
cl.user_session.set("agent", agent)
@cl.on_message
async def main(message: cl.Message):
agent = cl.user_session.get("agent") # type
content = message.content
req["messages"][0]["content"][0]["text"] = content
res = await agent.gl... | Python | 1 |
# Copyright 2022 The Deluca Authors.
#
# 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 w... | Python | 1 |
src: *const ::std::os::raw::c_uchar,
size: size_t,
);
}
#[doc = " CFB context."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cry_cfb_ctx {
#[doc = " Cipher context."]
pub ciph_ctx: *mut ::core::ffi::c_void,
#[doc = " Cipher interface."]
pub ciph_itf: *const cry_ciph_itf,
#[... | Rust | 0 |
for i, char in enumerate(text):
# 1. 找到第一个":",记录起始位置
if start_idx == -1 and char == ":":
start_idx = i
continue
# 2. 已找到":",开始判断括号状态
if start_idx != -1:
# 遇到"("或"[",括号计数+1(进入括号内)
if char in ("(", "["):
bracket_count += 1
... | Python | 1 |
"""
@brief test log(time=20s)
"""
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
import ensae_teaching_cs
class TestNotebookRunner2a_5_Dask(unittest.TestCase):
def setUp(self):
from pyquickhelper.pycode import add_missing_development_version... | Python | 1 |
"""
Classifies: CHEBI:137419 secondary ammonium ion
"""
"""
Classifies: CHEBI:36836 secondary ammonium ion
An organic cation obtained by protonation of any secondary amino compound; major species at pH 7.3.
"""
from rdkit import Chem
from rdkit.Chem import AllChem
def is_secondary_ammonium_ion(smiles: str):
"""
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.