text string | label_name string | labels int64 |
|---|---|---|
Hash<S = RandomState> {
pub slots: usize,
state: S,
}
impl JumpHash {
pub fn new(slots: usize) -> Self {
JumpHash {
slots,
state: Default::default(),
}
}
}
impl<S> JumpHash<S>
where
S: BuildHasher,
{
pub fn with_hasher(slots: usize, state: S) -> Self {
... | Rust | 0 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import annotations
from typing import Union
import onnx_ir as ir
from onnxscript.rewriter import _fusion_utils, pattern
Dim = Union[int, ir.SymbolicDim]
class SDPAImplementation(pattern.RewriteRuleClassBase):
def pattern(... | Python | 1 |
unOperatorOnce(op)
Y = workspace.FetchBlob('Y')
np.testing.assert_array_equal(X, Y)
@given(**hu.gcs)
@settings(deadline=10000)
def test_range(self, gc, dc):
names = [
('stop_',),
('start_', 'stop_'),
('start_', 'stop_', 'step_'),
]... | Python | 1 |
b fn prepend(self, new_child: RenderId, tree: &mut RenderTree) {
self.0.prepend(new_child.0, &mut tree.arena);
}
/// A delegate for [NodeId::remove](indextree::NodeId.remove)
pub fn remove(self, tree: &mut RenderTree) { self.0.remove(&mut tree.arena); }
/// A delegate for [NodeId::parent](indextree::NodeI... | Rust | 0 |
uence_length, total_tokens_embeddings]
`multiple_choice_logits`: the multiple choice logits as a torch.FloatTensor of size [batch_size, num_choices]
Example usage:
```python
# Already been converted into BPE token ids
input_ids = torch.LongTensor([[[31, 51, 99], [15, 5, 0]]]) # (bsz, numbe... | Python | 1 |
# -*- coding: utf-8 -*-
"""
@version: python2.7
@author: luofuli
@time: 2017/7/1
"""
import os
class WSD_path(object):
def __init__(self):
self.DATA_DIR = '../data/'
# Lexical Example task dataset
self.LS_DATASET = ['senseval2_LS', 'senseval3_LS']
# ALL-words task dataset
... | Python | 1 |
ard per chromosome')
args = parser.parse_args()
chroms = {}
density = {}
for bamf in args.input:
hdr = BAMHeader(bamf)
idx = BAMIndex(bamf)
for (tchr, tlen), (size, dens) in zip(hdr.chrs, idx.density()):
d = density.setdefault(tchr,[])
if len(d) < len(den... | Python | 1 |
fn deserialize_at(buffer: &[u8], pos: BitPosition) -> (Self, BitPosition) {
let result = T::deserialize_bits_at(buffer, SIZE, pos);
(
Bits {
size: SIZE,
value: result.0,
},
result.1,
)
}
}
impl<T: BitumSerializeSomeBit... | Rust | 0 |
>0
use std::fmt::Write;
fn is_even(val: usize) -> bool {
val % 2 == 0
}
fn generate_dragon(initial: &Vec<u8>, target_size: usize) -> Vec<u8> {
let mut a = initial.clone();
while a.len() < target_size {
let mut b = a.clone();
b.reverse();
for val in b.iter_mut() {
*val ... | Rust | 0 |
std::marker::PhantomData;
use ::std::net::SocketAddr;
use ::std::net::SocketAddrV4;
use ::std::net::SocketAddrV6;
use ::std::ops::Deref;
use ::std::ops::DerefMut;
use ::std::slice::from_raw_parts;
use ::std::slice::from_raw_parts_mut;
use ::std::fs::DirBuilder;
use ::std::fs::remove_dir;
use ::std::fs::remove_file;
use... | Rust | 0 |
::mem::swap(&mut self.bsp, &mut bsp);
let constraints = filter_inverted_constraints(constraints, &self.vm, bsp);
if !constraints.is_empty() {
// Return inverted constraints to parent VM.
// TODO (dhatch): Would be n... | Rust | 0 |
32c(b"rld!", 0xf92d22b8), 0xfe6cf1dc);
/// assert_eq!(crc32c(b"Hello World!", 0), 0xfe6cf1dc);
/// ```
///
/// See the [module-level documentation](../crc) for more info.
///
pub fn __crc(data: &[u8], crc: __u) -> __u {
cfg_if! {
if #[cfg(__if(__naive))] {
let mut crc = __p(crc ^ __xor);
... | Rust | 0 |
# LeanEval/models/huggingface.py
from __future__ import annotations
import logging
from typing import Iterable, List, Generator, Union, Sequence, Optional, Dict, Any
from pathlib import Path
import concurrent.futures as cf
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, PreTrainedModel, Pre... | Python | 1 |
/// client code.
Ref($ref_),
/// A metavariable. The `usize` gives the index of the metavariable in the
/// local context, and the [`InferTarget`] is the expected type of the expression
/// that should replace this metavariable.
MVar(usize, InferTarget),
/// A proof metavariable, als... | Rust | 0 |
es.iter() {
output_sum = output_sum.overflowing_add(s).0;
}
let coinbase_reward: u64 = 60_000_000_000;
let fees = coinbase_reward.overflowing_sub(output_sum).0;
let mut tx_elements = Vec::new();
// single input spending a single coinbase (deterministic key_id aka height)
{
let key_id = ExtKeychain... | Rust | 0 |
ec @ s7 d d l Td d l Td d l Td d Z d Z d S( i( t *c C s. | d k r t } n t | | f i } | S( N( t Nonet objectt type( t
class_namet
base_classt new_class( ( sN /Users/arjunbhut/Downloads/python-pip-starter-kit-cou... | Python | 1 |
bers.len() as i32 {
//println!("{}", numbers[i as usize]);
// Lookup value
let target = numbers[i as usize];
// Increment previous
//numbers[i as usize] += 1
numbers[i as usize] += if target >= 3 { -1 } else {1};
// Jump
i += target;
steps += 1;
... | Rust | 0 |
write access of a latch when dropped.
pub struct ExclusiveGuard<'a, T: ?Sized> {
latch: &'a HybridLatch<T>,
#[allow(dead_code)]
guard: RwLockWriteGuard<'a, ()>,
data: *mut T,
version: usize
}
unsafe impl<'a, T: ?Sized + Sync> Sync for ExclusiveGuard<'a, T> {}
impl<'a, T> ExclusiveGuard<'a, T> {
... | Rust | 0 |
LOCALE, true, true);
builder
.set_released_on(&parse_release_date(&song.issue_date)?)
.set_artwork_url(&parse_artwork_url(&song.album_img_path))
.add_name(name)
} else {
return Err(ExtractionError::MissingField("songs"));
};
let builder = parse_songs(&s... | Rust | 0 |
ime64_t = ::std::os::raw::c_longlong;
pub type __kernel_clock_t = __kernel_long_t;
pub type __kernel_timer_t = ::std::os::raw::c_int;
pub type __kernel_clockid_t = ::std::os::raw::c_int;
pub type __kernel_caddr_t = *mut ::std::os::raw::c_char;
pub type __kernel_uid16_t = ::std::os::raw::c_ushort;
pub type __kernel_gid1... | Rust | 0 |
warn!("Unable to read package group `{}`: {}", package, e);
}
}
}
expanded
}
#[inline]
fn package_build_inner<P: AsRef<Path>>(
packages: &[String],
instance: &str,
root: P,
) -> Result<(i32, usize)> {
let total = packages.len();
for (index, package) in packages.iter()... | Rust | 0 |
let ops_to_test = vec![2];
// Common pre-execution state
set_for_all!(vm_states[ops_to_test].memory[0] = Some(0x0000_9D00));
set_for_all!(vm_states[ops_to_test].r[1] = Some(stack_mem_address(0)));
set_for_all!(vm_states[ops_to_test].r[2] = Some(0xBEED)); // Add 1 to get second-lowest byte
// ... | Rust | 0 |
is part of the hydralang open souce project
//
// Copyright (c) 2021 KittyBorgX and the englang project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://github.com/KittyBorgX/hydralang/blob/main/LICENSE for license information
// See https://github.com/KittyBorgX/hydralang... | Rust | 0 |
n=int(input('Enter a number :'))
for i in range(2,n):
if n%i==0:
print('is not a prime number')
break
else:
print(n,'is a prime number')
| Python | 1 |
.
With ``dist_sync``, batch-size now means the batch size used on each machine.
So if there are ``n`` machines and we use batch size ``b``,
then ``dist_sync`` behaves like ``local`` with batch size ``n * b``.
``dist_device_sync``: Identical to ``dist_sync`` with the difference similar
to ``device``... | Python | 1 |
f}".format(int(hours),int(minutes),seconds)) #Prints out time of individual registration
total_start_time = time.time() #Start time of running code
#### MUST Declare Variables Below #####
#Declare MRI Image(s) Path:
path2images = 'path\to\images_directory'
#Declare Mask Image(s) Path: if no masks are needed, ... | Python | 1 |
import torch
import torch.nn.functional as F
def train(net, modelName,optimizer, criterion, data, depth):
net.train()
optimizer.zero_grad()
output,loss_CI,_,_,hidden_layer = net(data.x, data.adj, depth=depth)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
loss_CI = torch.tens... | Python | 1 |
use core::fmt::Write;
use hal::gpio::{gpioc::*, *};
use hal::prelude::*;
use hal::serial::*;
use hal::stm32;
use hal::timer::*;
#[rtic::app(device = hal::stm32, peripherals = true)]
mod app {
use super::*;
#[shared]
struct Shared {}
#[local]
struct Local {
led: PC15<Output<OpenDrain>>,
... | Rust | 0 |
> FromPayload for TandemPayload<P1, P2> {
fn from_payload<R: Read>(mut reader: R) -> IPCResult<Self> {
let p1_length = reader.read_u64::<BigEndian>()?;
let mut load1_bytes = vec![0u8; p1_length as usize];
reader.read_exact(&mut load1_bytes)?;
let p2_length = reader.read_u64::<BigEnd... | Rust | 0 |
app/src/render.rs<gh_stars>10-100
use crate::{blink::Blink, depth, game::GameStatus, ui};
use chargrid::render::{
blend_mode, ColModify, Coord, Frame, Rgb24, Style, View, ViewCell, ViewContext,
};
use chargrid::text::{wrap, StringView, StringViewSingleLine};
use direction::CardinalDirection;
use line_2d::{Config as... | Rust | 0 |
"""Provide a dynamical systems framework for astrodynamics and orbital mechanics.
This package provides a comprehensive framework for defining, analyzing, and
integrating dynamical systems with emphasis on applications in astrodynamics,
particularly the Circular Restricted Three-Body Problem (CR3BP).
Examples
-------... | Python | 1 |
# Problem 2
'''
Ticket Types
The Magic Castle, the home of the Academy of Magical Arts at California has organized the great 'WonderWorks Magic Show'. Renowned magicians were invited to mystify and thrill the crowd with their world’s spectacular magic tricks. The Ticket booking for the show started 2 days prior and the... | Python | 1 |
from typing import Generator, Tuple
from unittest.mock import MagicMock, patch
import pytest
@pytest.fixture
def mock_smtp() -> Generator[MagicMock, None, None]:
"""
Fixture to mock the SMTP object used for sending emails.
This fixture patches the `SMTP` class from `smtplib` to prevent actual email send... | Python | 1 |
NOTE: in either spooky or hidden only if measured in the same
// direction must the spins be opposite
// measure with with a message
pub fn spooky (&mut self, friend: &mut Particle) -> Pair<Direction> {
let detector1 = Detector::D12;
let detector2 = Particle::get_detector_direction();
... | Rust | 0 |
log::trace!("Found commit for {}: {:?}", tag_name, &commit);
Ok(commit)
}
pub mod command;
pub mod count;
#![no_std]
#![no_main]
#![feature(asm)]
extern crate discovery_stm32f3 as board;
// LED0 = PE9;
use board::mcu::rcc::*;
use board::mcu::gpio::*;
#[no_mangle]
pub extern "C" fn main() -> ! {
RCC.wit... | Rust | 0 |
import time
my_time = int(input("Enter your time : "))
for i in range(1,my_time):
# print(i)
seconds = i % 60
minutes = int(i/60)%60
hours = int(i /3600)
print(f"{hours:02}:{minutes:02}:{seconds:02}")
time.sleep(0.25)
print("Times up!")
for j in range(my_time, 0 ,-1):
# print(i)
secon... | Python | 1 |
` value this result came from.
index: usize,
/// A score of this result ranked against the query string.
score: f32,
}
impl Eq for SearchResult {}
impl Ord for SearchResult {
fn cmp(&self, other: &Self) -> cmp::Ordering {
self.score.partial_cmp(&other.score).unwrap()
}
}
impl SearchResult... | Rust | 0 |
from typing import List
def removeElement(nums: List[int], val: int) -> List[int]:
"""
Use a prev pointer to hold the position of the index till which 'elements without val'
are present, then increment prev only if the current index is not 'val'. This ensures
that all elements till index 'prev' are '... | Python | 1 |
wrap());
Ok(value)
}
pub fn online_create_wallet(
&self,
node_url: &str,
cookie_file: &str,
required_sig: u8,
xpubs: &Vec<String>,
) -> Result<CreateWalletOutput> {
let required_sig = format!("{}", required_sig);
let mut args = vec![
... | Rust | 0 |
pub fn insert_one(&mut self, value: f64) {
self.insert(value, 1)
}
/// Insert observed value into histogram with count how many such values
/// to add.
///
/// # Example
/// ```
/// use streamhist::StreamingHistogram;
/// let mut hist = StreamingHistogram::new(32);
/// a... | Rust | 0 |
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('grades', '0011_null_edited_time'),
]
operations = [
migr... | Python | 1 |
e = reader.read_u8().await?;
let block_type = first_byte & 0b01111111;
let length = read_u24_async(reader).await? as usize;
Ok(MetadataBlock {
is_last: first_byte & 0b10000000 > 0,
length,
data: match block_type {
0 => MetadataBlockData::Stream... | Rust | 0 |
};
let result = match error_code {
0 => {
let ret = {
let mut list: Vec<String> = vec![];
list.reserve(script_item_num as usize);
let mut index: c_uint = 0;
while index < script_item_num {
let asm_str = {
let mut asm: *mut c_char = ptr... | Rust | 0 |
reset - reset to empty vector
Accessors:
* [INDEX] - access item at INDEX
* [?] - access items at current context
* .length - display number of items"#;
assert_eq!(context_vec.node_step(runner), String::from(output));
}
#[test]
fn node_step_chain_context() {
let mut context_vec = tes... | Rust | 0 |
f) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28);
self.w
}
}
#[doc = "Secure mask for pin P1_29\n\nValue on r... | Rust | 0 |
# scripts/post_install.py
"""
Script to:
1. Create an admin user with a default password.
2. Download the spaCy en_core_web_sm model.
Usage:
python scripts/post_install.py
You can add more post-installation steps to this script as needed.
"""
import subprocess
import sys
import os
from pathlib import Path
# Add ... | Python | 1 |
),
"temperature": np.array(
[
1.3038408,
1.2965926,
1.5638316,
2.2146196,
2.02055,
1.5597022,
1.8442568,
1.9387102,
1.8885067,
1.8819242,
2.0420198,
2.168703,
... | Python | 1 |
crate::VictoryState::TimeoutVictory(White) => 1,
crate::VictoryState::TimeoutVictory(Black) => -1,
crate::VictoryState::NoProgressDraw => 0,
}
}
////////////////////////////////////////////////////////////////////////////////
// (De-)Serialization ///////////////////////////////////////////////////... | Rust | 0 |
().expect("Should have 1 value"), pred);
}
for v in values {
// qty commit flv commit borrow => -v +v
borrow_value(p, v)
}
// n = 1: no rolls
// n = 2: -a +a -b +b: roll 2, roll 1
// n = 3: -a +a -b +b -c +c: roll 4, roll 3, roll 2
// n = 4: -a +a -b +b -c +c -d +d: roll 6, ... | Rust | 0 |
from langchain_core.embeddings import Embeddings
from langchain_ollama import ChatOllama
from loguru import logger
from app.core.config import Settings
from app.ml.qa.qa_chain import get_qa_chain
def generate_response(
settings: Settings,
query: str,
llm: ChatOllama,
embeddings: Embed... | Python | 1 |
depth = &mut self.map_depth[pos..];
let mut src_depth = &self.core.cu_data_best[log2_src_cuw - 2][log2_src_cuh - 2].depth[..];
let w = if x + src_cuw > self.w {
(self.w - x) >> MIN_CU_LOG2
} else {
(src_cuw >> MIN_CU_LOG2)
} as usize;
let h = if y + src_... | Rust | 0 |
default());
let mut engine = ExecutionEngine::new(env.clone());
engine.set_record(spaced_record!["foo", "bar"]);
engine.execute_statement(&Statement::Command(BuiltinCommand::Print, vec![]))?;
assert_eq!(env.get_printed_lines(), vec![String::from("foo bar\n")]);
Ok(())
}
#[test]
fn multi_print() -... | Rust | 0 |
import subprocess
def test_versions_are_up_to_date():
alembic_heads_command = subprocess.run("alembic heads", capture_output=True, shell=True, text=True, check=True)
alembic_heads = alembic_heads_command.stdout.splitlines()
try:
pre_version_line = next(line for line in alembic_heads if "(pre)" in... | Python | 1 |
class Solution:
def wordPattern(self, pattern: str, s: str) -> bool:
words = s.split()
if(len(words) != len(pattern)):
return False
dict1 = {}
dict2 = {}
for i in range(len(words)):
match = pattern[i]
word = words[i]
if match no... | Python | 1 |
from pyrogram import filters
from pyrogram.types import *
from AarohiX import app
from gpytranslate import Translator
#.......
trans = Translator()
#......
@app.on_message(filters.command("tr"))
async def translate(_, message) -> None:
reply_msg = message.reply_to_message
if not reply_msg:
await mes... | Python | 1 |
g0b0_g0b1_g0c1 as vrefbuf;
pub use super::instances::wwdg_g050_g051_g061_g0b0_g0b1_g0c1 as wwdg;
#[cfg(all(feature = "rtic", not(feature = "nosync")))]
#[allow(non_snake_case)]
pub struct Peripherals {
pub ADC: adc::Instance,
pub CRC: crc::Instance,
pub DAC: dac::Instance,
pub DMAMUX: dmamux::Instance,... | Rust | 0 |
# Copyright 2017 The dm_control 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 i... | Python | 1 |
}
#[derive(Debug)]
struct Tweet {
username: String,
content: String,
reply: bool,
retweet: bool,
}
impl Summary for Tweet {
fn summarize(&self) -> String {
format!("{}: {}", self.username, self.content)
}
fn summarize_author(&self) -> String {
format!("@{}", self.username)... | Rust | 0 |
import requests
import json
import os
from dotenv import load_dotenv
load_dotenv()
# Configuración de Azure Cognitive Search
search_service_name = os.environ.get("AI_SEARCH_SERVICE_NAME")
index_name = 'documents'
api_key = os.environ.get("AI_SEARCH_API_KEY")
search_url = f'https://{search_service_name}.search.windows... | Python | 1 |
sctime)s %(module)s %(process)d '
'%(thread)d %(message)s'
),
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
},
'requir... | Python | 1 |
import warnings
warnings.filterwarnings("ignore")
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import TimeSeriesSplit
from sklearn.metrics import mean_absolute_error
from sklearn.feature_selec... | Python | 1 |
/// A shortcut for `F::from_bits`.
pub fn f(x: U) -> F {
F::from_bits(x)
}
// Fused-multiply add operation (x * m + a).
pub fn fma(x: F, m: F, a: F) -> F {
x * m + a
}
pub fn poly(x: F, coeffs: [U; 5]) -> F {
let p = f(coeffs[4]);
let p = fma(x, p, f(coeffs[3]));
let p = fma(x, p, f(coeffs[2]));
... | Rust | 0 |
address: &str = str::from_utf8(ser_addr_bytes).unwrap(); // make sure the bytes are UTF-8
let keys = handle_errors!(zkproofs::force_merchant_close(
&channel_state,
&channel_token,
&cust_close,
&merch_state,
));
// let merch_close: zkproofs::Chan... | Rust | 0 |
_0_GENB_ACTCMPAU_NONE)
}
#[doc = "Invert pwmB"]
#[inline(always)]
pub fn pwm_0_genb_actcmpau_inv(self) -> &'a mut W {
self.variant(PWM_0_GENB_ACTCMPAUW::PWM_0_GENB_ACTCMPAU_INV)
}
#[doc = "Drive pwmB Low"]
#[inline(always)]
pub fn pwm_0_genb_actcmpau_zero(self) -> &'a mut W {
... | Rust | 0 |
e between iteration when looping is needed,
in second. Default: 15
steps:
1. Learn Vxlan Conf object and check advertise_evpn_multisite is available
if has any, otherwise, SKIP the trigger
2. Save the current device configurations throu... | Python | 1 |
from typing import Iterator, Tuple, Union
from ...errors import Errors
from ...symbols import NOUN, PRON, PROPN
from ...tokens import Doc, Span
def noun_chunks(doclike: Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]:
"""Detect base noun phrases from a dependency parse. Works on both Doc and Span."""
lab... | Python | 1 |
en the program encounters is when throw really shines. This will result in an
//! error message:
//!
//! ```text
//! Error: No such file or directory (os error 2)
//! at 16:23 in main (src/main.rs)
//! at 9:19 in main (src/main.rs)
//! ```
//!
//! These stack traces are stored inside throw::Error, and are record... | Rust | 0 |
d for user"
db_table = "recsys_terms_recommended_users"
class VisiteurProductComplementaryRecommended(BaseVisiteurModelRecommended):
model_recommended = ForeignKey(ProductComplementary, on_delete=SET_NULL, null=True)
class Meta:
verbose_name = "Term recommended for visiteur"
db_table ... | Python | 1 |
def test_audioldm2_vocoder_model_in_dim(self):
components = self.get_dummy_components()
audioldm_pipe = AudioLDM2Pipeline(**components)
audioldm_pipe = audioldm_pipe.to(torch_device)
audioldm_pipe.set_progress_bar_config(disable=None)
prompt = ['hey']
output = audioldm_pipe(prompt, num_inference... | Python | 1 |
handCards_A[get_num(card[1])] += 1
#print('Reyn_AI Log 读取手牌部分结束')
#print('Reyn_AI Tip 当前读取到的手牌为')
#print('handCards_S:',handCards_S)
#print('handCards_H:',handCards_H)
#print('handCards_C:',handCards_C)
#print('handCards_D:',handCar... | Python | 1 |
ult;
use crate::runtime::AsyncKernel;
use crate::runtime::Block;
use crate::runtime::BlockMeta;
use crate::runtime::BlockMetaBuilder;
use crate::runtime::MessageIo;
use crate::runtime::MessageIoBuilder;
use crate::runtime::Pmt;
use crate::runtime::StreamIo;
use crate::runtime::StreamIoBuilder;
pub struct MessageSink {... | Rust | 0 |
_EN = """
Generate 5-8 main categories for a concept map. OUTPUT ONLY JSON.
Topic: {user_prompt}
Output format:
{
"topic": "Central topic",
"categories": [
"Category 1",
"Category 2",
"Category 3"
]
}
Rules:
- 5-8 main categories
- Each category should be a broad concept area
- Pure JSON only
"""
... | Python | 1 |
the mapping from emb_id to raw_embedding_result idx.
/// Place each emb result in correct idx and processed the raw emb gradient update
/// TODO: use i32 to represent the index
/// Current solution is due to pytorch index_select function not support int32 index
/// when installed pytorch version below 1... | Rust | 0 |
AOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA","file":"min.js","sourceRoot":"/the/root"}"#.to_string())
}
}
<filename>src/ucm/mappings.rs
//! Lazilly evaluated `static`'s, holding an [`Encoding`] for each encoding
//!
//! Note: These originate from the [`lazy_static!`] macro, so you'll have to use the `&*` trick to
//... | Rust | 0 |
(*cinfo).global_state;
Some(
(*(*cinfo).err)
.error_exit
.expect("non-null function pointer"),
)
.expect("non-null function pointer")(cinfo as crate::jpeglib_h::j_common_ptr);
}
if (*cinfo).output_scanline >= (*cinfo).output_height {
(... | Rust | 0 |
:1])
def test_auto_lora_model_for_causal_lm_noncb_export_compile_generate(
base_model_name, adapter_id_0, adapter_id_1, tmp_path
):
qeff_model = QEffAutoLoraModelForCausalLM.from_pretrained(base_model_name, num_hidden_layers=1)
qeff_model.load_adapter(adapter_id_0, "adapter_0")
qeff_model.load_adapter(... | Python | 1 |
assert!(matches!(
Passphrase::try_from([0xFFu8, 0xFF, 0xFF, 0xFF, 0xFF].as_ref()),
Err(PassphraseError::Encoding)
));
}
#[test]
fn passphrase_bad_size() {
assert!(matches!(Passphrase::try_from("tiny"), Err(PassphraseError::Size(4))));
assert!(matches!(
... | Rust | 0 |
const OFFSET: u8 = 5;
((self.bits >> OFFSET) & MASK as u32) != 0
};
STIMENA5R { bits }
}
#[doc = "Bit 4 - 4:4\\] Bit mask to enable tracing on ITM stimulus port 4."]
#[inline]
pub fn stimena4(&self) -> STIMENA4R {
let bits = {
const MASK: bool = true;
... | Rust | 0 |
fn add_back<T>(x: &mut T, y: &T, mut t: SignedWide, j: usize)
where T: CloneableVecLike<Limb>
{
let n = y.len();
// Store quotient digits
// If we subtracted too much, add back.
// Original Code:
// q[j] = qhat; // Store quotient digit.
// if (t < 0) { // If we ... | Rust | 0 |
_base_ = [
'../_base_/models/upernet_convnextv2.py',
'../_base_/datasets/dfc2025sarseg1024x1024.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_160k.py'
]
crop_size = (1024, 1024)
data_preprocessor = dict(
size=crop_size,
seg_pad_val=0,
)
model = dict(
data_preprocessor=da... | Python | 1 |
eck experiment, band, and directory " + pf.exp_dir )
exit ( 1 )
if ( args.task == "load" ):
pf_load ( pf, args.nopcal )
elif ( args.task == "logs" ):
pf_logs ( pf )
elif ( args.task == "gean" ):
pf_gean ( pf )
elif ( args.task == "gain" ):
pf_gain ( pf, arg... | Python | 1 |
()
self.update_crypto_list()
crypto_window.window.protocol("WM_DELETE_WINDOW", on_close)
def calcular_quantidade(self):
"""Calculate the quantity based on current price and investment value"""
try:
preco_atual = self.atualizar_preco()
if pre... | Python | 1 |
js)})...")
lock = asyncio.Lock()
semaphore = asyncio.Semaphore(cfg.max_workers)
async def process_with_semaphore(row_obj):
async with semaphore:
return await process_row(row_obj, cfg.api, cfg, cfg.dataset, lock)
tasks = [process_with_semaphore(row_obj) for row_obj in tqdm(incomplet... | Python | 1 |
e to (maybe) wrap
min_num_params (int, Optional): minimum number of layer params to wrap
"""
try:
from fairscale.nn import wrap
if min_num_params is not None:
num_params = sum(p.numel() for p in module.parameters())
if num_params >= min_num_params:
... | Python | 1 |
fig(self) -> Dict[str, str]:
"""Get AI service configuration."""
return {
"api_key": self.get("AI_API_KEY"),
"api_url": self.get("AI_API_URL"),
"model_name": self.get("AI_MODEL_NAME"),
"stt_api_key": self.get("STT_API_KEY"),
"stt_api_url": self... | Python | 1 |
IPH, Adc1Periph, HMATRIX_OWNED, HMATRIX_REF_COUNT, 0x4100c000, 0x00, 0x0e);
#[derive(Clone, Copy, PartialEq, Eq)]
#[doc="ADC1 Peripheral"]
pub struct Adc1Periph(pub usize);
impl Adc1Periph {
#[doc="Get the PRAS Register."]
#[inline] pub fn pras_reg(&self) -> ::bobbin_mcu::register::RegisterArray<Pras, ::bobb... | Rust | 0 |
from turtle import Turtle
class Ball (Turtle):
def __init__(self):
super().__init__()
self.shape("circle")
self.penup()
self.color("white")
self.move_x = 10
self.move_y = 10
self.move_speed = 0.1
def move(self):
new_x = self.xcor() + self.move_x... | Python | 1 |
#[deprecated] pub fn onZoom<'env>(&'env self, arg0: bool) -> __jni_bindgen::std::result::Result<(), __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
// class.path == "android/widget/ZoomButtonsController$OnZoomListener", java.flags == PUBLIC | ABSTRACT, .name == "onZoom", .descriptor == "(... | Rust | 0 |
# Task 1:
print("Hello, world! Welcome to Python programming. Let's start our journey with some fun coding!")
# Task 2:
# 1. New Line Escape Sequence
# Learn to use `\n` to add a new line within a single string.
print("Hello\nWorld")
# 2. String Concatenation
# Use the plus symbol `+` to concatenate different string... | Python | 1 |
rays_d, 0)
if self.rgb is not None:
rgb = [self.rgb[i, select_inds[i]] for i in range(self.batch_size)]
rgb = torch.stack(rgb, 0)
else:
rgb = None
ret = {'ray_o': rays_o.cuda(),
'ray_d': rays_d.cuda(),
'intrinsics': self.intrins... | Python | 1 |
b.iter(|| AccessRights::from_bytes(&data));
}
fn make_named_keys() -> BTreeMap<String, Key> {
let mut named_keys = BTreeMap::new();
named_keys.insert(
"ref1".to_string(),
Key::URef(URef::new([0u8; 32], AccessRights::READ)),
);
named_keys.insert(
"ref2".to_string(),
K... | Rust | 0 |
_sys::window()
/// .unwrap()
/// .document()
/// .unwrap()
/// .body()
/// .unwrap();
///
/// let builder = DomBuilder::new(body);
///
/// with_node!(builder, body => {
/// .event(move |_: events::Click| body.set_inner_text("Goodbye"))
/// .text("Hello world")
/// });
/// ```
#[macro_export]... | Rust | 0 |
usize,
concat!(
"Offset of field: ",
stringify!(_STARTUPINFOW),
"::",
stringify!(wShowWindow)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).cbReserved2 as *const _ as usize },
66usize,
concat... | Rust | 0 |
pool = pool.clone();
Box::new(
future::lazy(move || match pool.get() {
Ok(conn) => {
let ts = time::SystemTime::now()
.duration_since(time::UNIX_EPOCH)
.unwrap()
.as_secs();
let mut script = REPLACE_HASH.key(&fullkey);
script.arg(opts.... | Rust | 0 |
str()
.map_err(|_| ProtoError::Parse(Parse::HeaderName))?
.parse::<u64>()
.map_err(|_| ProtoError::Parse(Parse::HeaderName))?;
if len != 0 {
decoder.try_set(TransferCoding::length(len))?;
}
}
... | Rust | 0 |
ss TestBroadcastToNoAxesCase2(TestBroadcastToOpNoAxes):
def init_case(self):
self.inputs = {"x": np.random.random([5, 3]).astype("float32")}
self.out_shape = [4, 5, 3]
class TestBroadcastToNoAxesCase3(TestBroadcastToOpNoAxes):
def init_case(self):
self.inputs = {"x": np.random.random([... | Python | 1 |
= HistoryEventType.RECEIVE and
event.asset.identifier == self.giv_token_id and
event.location_label == user and
amount == event.amount
):
event.event_subtype = HistoryEventSubType.REWARD
event.counterparty = CPT_GIVE... | Python | 1 |
# Copyright 2024 The HuggingFace Team. 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 applicabl... | Python | 1 |
ker run -d postgres"),
("create redis container", "docker run -d redis"),
("launch mysql container", "docker run -d mysql"),
("deploy mongodb container", "docker run -d mongo"),
# Test examples
("run apache container", "docker run -d httpd"),
("start elasticsearch contain... | Python | 1 |
ng"),
}
)
elif self.config.schema == f"seacrowd_{str(TASK_TO_SCHEMA[Tasks.PROMPTING]).lower()}":
features = schemas.ssp_features
else:
raise ValueError(f"Invalid config: {self.config.name}")
return datasets.DatasetInfo(
descripti... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.