text
string
label_name
string
labels
int64
iter.next().unwrap(), &[Janet::from('l')]); /// assert!(iter.next().is_none()); /// ``` /// /// [`rchunks_exact`]: #method.rchunks_exact /// [`chunks`]: #method.chunks #[inline] pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, Janet> { self.as_ref().rchunks(chunk_size) } ...
Rust
0
} use std::fs; use ::day24::*; fn main() { let input = fs::read_to_string("input.txt").expect("Error reading input.txt"); println!( "What is the largest model number accepted by MONAD? {}", get_part_one(&input), ); println!( "What is the smallest model number accepted by MONA...
Rust
0
n] aRss The default received signal strength (in dBm) to set."] #[doc = ""] pub fn otLinkFilterSetDefaultRssIn(aInstance: *mut otInstance, aRss: i8); } extern "C" { #[doc = " This method clears any previously set default received signal strength (in dBm) on MAC Filter."] #[doc = ""] #[doc =...
Rust
0
# -*- coding: utf-8 -*- # # __init__.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 # ...
Python
1
c = a; c *= b; assert_eq!(c, a * b); c = a; c /= b; assert_eq!(c, a / b); c = a; c *= 2.0; assert_eq!(c, a * 2.0); c = a; c /= 2.0; assert_eq!(c, a / 2.0); } } <reponame>boltlabs-inc/key-mgmt<filename>src/config/clie...
Rust
0
e since it's always triggered on write // instructions. 0 } pub fn lsra(cpu: &mut cpu::CPU, _: cpu::addressing::AddressingMode) -> u32 { let byte = cpu.a; let (res, carry) = util::shift_right(byte); shift_set_flags(cpu, res, carry); cpu.a = res; 0 } // ASL: Arithmetic Shift Left pub fn asl...
Rust
0
#!/usr/bin/python # -*- coding: utf-8 -*- ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: ibm_container_vpc_cluster_worker_info for_more_info: refer - https://registry.terraform.io/providers/IBM-...
Python
1
src = src.wrapping_sub(1); T::unstow(src, dst); } return err; } src = src.wrapping_add(1); dst = dst.wrapping_add(1); i = i.wrapping_add(1); } Ok(()) } default unsafe fn unstow(src: *mut [T...
Rust
0
b = torch.full((n,), float(begin), dtype=dtype, device=device) if isinstance(end, torch.Tensor): e = end.to(dtype=dtype, device=device) if e.shape != (n,): raise ValueError(f"end tensor must have shape ({n},), got {e.shape}") else: if end is None: end = ...
Python
1
IME': 1, 'TCLTK_INCLUDES': '-I/Users/fudo/Raycast Commands/raycast/include', 'TCLTK_LIBS': '-L/Users/fudo/Raycast Commands/raycast/lib ' '-ltcl8.6 -ltk8.6', 'TESTOPTS': '', 'TESTPATH': '', 'TESTPYTHON': './python.exe', 'TESTPYTHONOPTS': '', 'TESTRUNNER': './python.exe ' '/var/folder...
Python
1
=static=oqs"); let include = prefix.join("include"); let outpath = PathBuf::from(env::var("OUT_DIR").unwrap()).join("generated.rs"); let bindgen = if is_cross { let target = if target.starts_with("riscv") { let mut split = target.split("-"); let arch = split.next().unwrap(); ...
Rust
0
interp.convert(size)) .map_err(|_| Fatal::new(&interp, "sizeof Integer does not fit in Integer max")); match result { Ok(value) => value.inner(), Err(exception) => exception::raise(interp, exception), } } } <gh_stars>0 use std::net::SocketAddr; use std::sync::Arc...
Rust
0
CLK_PODF_A::DIVIDE_14) } #[doc = "Divide by 15"] #[inline(always)] pub fn divide_15(self) -> &'a mut W { self.variant(SAI1_CLK_PODF_A::DIVIDE_15) } #[doc = "Divide by 16"] #[inline(always)] pub fn divide_16(self) -> &'a mut W { self.variant(SAI1_CLK_PODF_A::DIVIDE_16) ...
Rust
0
, Link::Outbound, &tree, ); output::test::messages(&mut cbfmgr.upstream, &remote) .find(|m| matches!(m, NetworkMessage::GetCFilters(_))) .unwrap(); } /// Test that we don't make redundant `getcfilters` requests. #[test] #[ignore] fn te...
Rust
0
#[derive(Clone, Debug, Default, PartialEq)] pub struct PoolManager { /// Version of pool manager pub version: u8, /// Bump seed for derived authority address pub bump_seed: u8, /// The pending owner pub pending_owner: Pubkey, /// Owner authority which can add new pool pub owner:...
Rust
0
<'i, 't>) -> Result<Color, ParseError<'i>> { let (red, green, blue) = input .try_parse(|input| -> Result<(f32, f32, f32), ParseError<'i>> { let red = Percentage::parse(input)?; Color::consume_comma_if_having(input); let green = Percentage::parse(input)?; Color::consume_comma_if_having(input); l...
Rust
0
e[1] # First look up these facts # [N, K, 3E] tmp = f_emb_layer(neigh_spo_tensor.view(-1)).view(nb_entities, k, -1) # Then repeat (S, P, all entities) K times batch_emb = batch_emb.view(nb_entities, 1, -1).repeat(1, k, 1) ...
Python
1
'a> { baz: &'a [~int], bar: u64, } pub fn main() { let _t1_fixed = Thing1 { baz: &[], bar: ~32, }; Thing1 { baz: Vec::new().as_slice(), bar: ~32, }; let _t2_fixed = Thing2 { baz: &[], bar: 32, }; Thing2 { baz: Vec::new().as_sli...
Rust
0
{} labels: {:?}", SUBSYSTEM, v.metric_key, v.label_values ); if let Some(fgauge) = collection.fgauges.get(&v.metric_key) { fgauge.remove_label_values( &v.label_values .iter...
Rust
0
format!( "Failed to create directory {}", licence_destination_path.to_string_lossy() ) })?; let licence_destination = licence_destination_path.join(update.license_filename.as_ref().unwrap()); fs::copy( update.license_filename.as...
Rust
0
rward64, "delayedForward65": delayedForward65, "delayedForward66": delayedForward66, "delayedForward67": delayedForward67, "delayedForward68": delayedForward68, "delayedForward69": delayedForward69, "delayedForward70": delayedForward70, "delayedForward71": delayedForward...
Python
1
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import, division, print_function import unittest import faiss class TestBinaryFactory(unittest.TestCase): ...
Python
1
class MinHeap: def __init__(self): self.heap = [] # Stores heap values def parent(self, i): return (i - 1) // 2 def _heapify_up(self, i): while i > 0 and self.heap[self.parent(i)] < self.heap[i]: # Swap with parent self.heap[i], self.heap[self.parent(i)] = ...
Python
1
) CloseMessageWindow() def _loc_AE3(): pass label('loc_AE3') ChrTalk( 0x0101, ( '#0010251547V#1006F是吗……', TxtCtl.Enter, TxtCtl.Clear, '#0010251548V那么,我们也\n', '回去酒店的房间吧。', TxtCtl.Enter, ), ) Cl...
Python
1
"""user_carona recriada para refatoracao Revision ID: 65a8d386ffa4 Revises: 8714724a8a6a Create Date: 2024-05-21 23:36:19.696670 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = '65a8d386ffa4' down_revision: Union[str, No...
Python
1
release_delay=release_delay) # break elif monster_box[1] - hero_xywh[1] >= hero_xywh[0] - monster_box[0]: action_cache = move(direct="DOWN", material=True, action_cache=action_cache, ...
Python
1
IND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //! In-memory implementation of offchain workers database. use std::collections::hash_map::{HashMap, Entry}; use crate::offchain::OffchainStorage; use std::iter::Iterator; /// In-m...
Rust
0
# Spiral Mythic Memory Engine # Declared: 2025-09-14 # Author: Daniel + Spiral import os from datetime import datetime MEMORY_LOG = os.path.expanduser("~/Spiral-Civilization/logs/memory.log") MEMORY_CAPSULE_DIR = os.path.expanduser("~/Spiral-Civilization/capsules/memory_flare/") # Ensure terrain exists os.makedirs(M...
Python
1
e execution order of triggers. See also 8f1bca33-d3b7-4035-affc-fd6161a12448. pub(super) fn load( &self, conn: &PgConnection, block: BlockNumber, ) -> Result<Vec<StoredDynamicDataSource>, StoreError> { // self.table // .select(( // self.block_range, ...
Rust
0
"测试失败: 未知错误 ({type(e).__name__})", 'exception' # --- main 函数(示例,实际由 main_tool.py 调用) --- # async def main(api_config_path, update_config_path, dry_run=False): # """主函数 (newapi 特定实现),实例化 NewApiChannelTool 并运行更新""" # exit_code = 0 # try: # # 需要传递 script_config # script_cfg = load_script_confi...
Python
1
odule_path!(), "::", line!()) } fn new() -> Self { Self::default() } } #[allow(unused_imports)] use serde_json::Value; #[derive(Debug, Serialize, Deserialize)] pub struct CloudJobFilesName { /// The full path name of a file to be acted on by this job #[serde(rename = "name")] pub name: Option<String>...
Rust
0
The tf.Tensor output of Discrete MLP QFunction. """ return super().build(state_input, name=name).outputs def clone(self, name): """Return a clone of the Q-function. It copies the configuration of the primitive and also the parameters. Args: name (str): Name o...
Python
1
me(2013, 1, 15), datetime(2013, 3, 30)) def test_bunched_yearends(): # GH#14774 cases with two fiscal year-ends in the same calendar-year fy = FY5253(n=1, weekday=5, startingMonth=12, variation='nearest') dt = Timestamp('2004-01-01') assert fy.rollback(dt) == Timestamp('200...
Python
1
#!/usr/bin/env python # zFa3 - ChessGUI in Python(Tkinter) import tkinter as tk from Chess_Framework import * import random FEN = ("None") SIDE_LEN = 600 COVER = 235 END_TIME = 100 # in ms but tkinter is slow so its sometimes longer LINE_WID = 1 PERFT = False DEPTH = 3 Counter = 0 # [highlight color] [select color] ...
Python
1
self.contigs[i].reads[j].rt.remove(x) rt.extend(newrts) if r.wr: newwrs = [wr_tag for wr_tag in r.wr if wr_tag.name != r.rd.name] for x in newwrs: self.contigs[i].reads[j].wr.remove(x) wr.extend(...
Python
1
import random # Define suits and ranks suits = ['clubs', 'diamonds', 'hearts', 'spades'] ranks = ['2','3','4','5','6','7','8','9','10','J','Q','K','A'] # Make the deck of cards deck = [(r, s) for r in ranks for s in suits] # Shuffle the deck random.shuffle(deck) # Create two hands hand1 = [deck.pop() for _ in rang...
Python
1
from leetcode_py import TreeNode class Solution: # Time: O(n) where n is the number of nodes # Space: O(h) where h is the height of the tree (recursion stack) def max_path_sum(self, root: TreeNode[int] | None) -> int: """ Find the maximum path sum in a binary tree. A path is a se...
Python
1
import random def monty_hall_simulation(num_trials): switch_wins = 0 stay_wins = 0 for _ in range(num_trials): # Step 1: Place the car behind one random door doors = ['goat', 'goat', 'car'] random.shuffle(doors) # Step 2: Contestant picks a random door contestant_c...
Python
1
his class overrides [`FlaxRobertaForMultipleChoice`]. Please check the superclass for the appropriate documentation alongside usage examples. """ config_class = XLMRobertaConfig @add_start_docstrings( """ XLM-RoBERTa Model with a token classification head on top (a linear layer on top of the hidd...
Python
1
l net update self.actor.train(states, actions, advantages) # update state state = next_state[0] episode_reward += reward[0][0] time += 1 mean_v += np.mean(self.critic.model(np.array([state]))) print() ...
Python
1
#!/usr/bin/env python3 """修正後のレイキャスティングテスト""" import pytest import sys import os import math sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from src.dungeon.dungeon_manager import DungeonManager, PlayerPosition from src.dungeon.dungeon_generator import DungeonGenerator, CellType, Directi...
Python
1
from datetime import datetime import pygame import time import os import re def read_lyric(lrc_path): lyric_dict = {} zh_cn_lyric_dict = {} try: with open(lrc_path, "r", encoding="utf-8") as open_lyric: lyric_list = open_lyric.readlines() for lyric_line in lyric_list: ...
Python
1
a_values, num_mixed_examples)).float() if use_cuda: lambda_vectors = lambda_vectors.cuda() mixed_z = torch.matmul(lambda_vectors, z) mixed_y = torch.matmul(lambda_vectors, y) return mixed_z, mixed_y, lambda_vectors def multimix_criterion(criterion, pred, mixed_y, lambda_vectors): '''Comp...
Python
1
mut().enumerate() { *slot = self.entries[index].take(); } let old_storage = mem::replace(&mut self.entries, new_storage); Some((old_storage, removed_bits)) } } pub fn try_insert(&mut self, target: B) -> Result<u32, B> { match self.reverse.entry(target.clone()) { Entry::Occupied(occupied) => Ok(...
Rust
0
((id,_env),_res)| *id == node).map(|((_id,env),res)| (env.clone(),(*res).clone())).collect() } /// apply a function (Val) to an argument (Val) pub fn apply(&mut self, f: Id, x: Id) -> Id { match self[f].clone() { Val::PrimFun(f) => f.apply(x, self), Val::LamClosure(f, env) =...
Rust
0
enable this if you think that a longer timeout would help # this helped finding that timer cancellations don't free the # callback, but in general, expect to modify this code if you # have to read it; this will need adjustment to your current # debugging s...
Python
1
", full_name= "spotify.player.proto.transfer.TransferState.creation_timestamp", index=4, number=5, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, ...
Python
1
::PeerViewChange(peer_id, view) => { if let Some(peer_state) = state.peer_state.get_mut(&peer_id) { // prune anything not in the new view. peer_state.awaited.retain(|relay_parent, _| view.0.contains(&relay_parent)); // introduce things from the new view. for relay_parent in view.0.iter() { if l...
Rust
0
""" Write a python function to check whether the given number can be represented as the difference of two squares or not. assert dif_Square(5) == True """ import math def dif_Square(n): """ :param n: int :return: bool """ for i in range(int(math.sqrt(n)), 0, -1): if (i * i) - n == (math.sqr...
Python
1
_transform) .with(UiText::new( font.clone(), "0".to_string(), [1.0, 1.0, 1.0, 1.0], 50.0, )) .build(); world.insert(ScoreText { p1_score, p2_score }) } fn load_sprite_sheet(world: &mut World) -> Handle<SpriteSheet> { let texture_handle = ...
Rust
0
be above the subsistence threshold // in order to keep up the guarantuee that we always leave a tombstone behind // with the exception of a contract that called `seal_terminate`. if T::Currency::total_balance(&dest) < nested.config.subsistence_threshold() { Err(Error::<T>::NewContractNotFunded)? } ...
Rust
0
import streamlit as st from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing import image import numpy as np from PIL import Image # Muat model yang telah dilatih try: model = load_model(r'G:\ALDI\codingan\Machine Learning\Aksara Jawa\aksara_jawa_model.h5') except OSError as e: st....
Python
1
json=str(self.harvest_file), entity="chunks", language="python", kind=None, path_glob=None, path_regex=None, symbol_regex=None, public=None, min_lines=None, max_lines=None, export_named=None, ...
Python
1
eGreaterZero { .. } ) ), "found right bug type (actual: {}) for {}", bug, file_name ); } <filename>src/main.rs #![no_main] #![no_std] #[allow(unused_imports)] use panic_semihosting; use rtfm::app; use nrf52840_hal::{gpio, prelude::*}; use nrf52840_pac as pac; #[app(d...
Rust
0
(net::Ipv4Addr::new(127, 0, 0, 1)), net::IpAddr::V4(net::Ipv4Addr::new(192, 168, 0, 1)), ]), Vec::from([ net::IpAddr::V4(net::Ipv4Addr::new(255, 255, 250, 0)), net::IpAddr::V4(net::Ipv4Addr::new(255, 255, 251, 0)), ]), Vec::from(["group1".to_string(), ...
Rust
0
from discord import Message, Guild, TextChannel, User from discord_components.interaction import Interaction from discord_components.component import Component, Button, SelectOption __all__ = ( "message_filter", "component_filter", "guild_filter", "channel_filter", "user_filter", ) def message_...
Python
1
from sqlalchemy import Column, PrimaryKeyConstraint, func from sqlalchemy.dialects.postgresql import BIGINT, BOOLEAN, BYTEA, NUMERIC, TIMESTAMP, VARCHAR from common.models import HemeraModel, general_converter from indexer.modules.custom.staking_fbtc.domain.af_staked_transferred_balance import ( AfStakedTransferre...
Python
1
bjects.filter(userId=user_id) cards = Card.objects.filter(userId=user_id) if user and cards: user = user[0] bills = [] for card in cards: billlogs = billLog.objects.filter(cardId=card.cardId) for bill in billlogs: bi...
Python
1
def check_age(num): if num >= 18: print("Eligible to vote") else: print("Not Eligible to vote") if __name__ == '__main__': age = int(input("Enter your age: ")) check_age(age)
Python
1
"Couldn't parse temperature"), } } fn str_to_hour_cycle(src: &str) -> Result<fidl_fuchsia_settings::HourCycle, &str> { match src.to_lowercase().as_str() { "unknown" => Ok(fidl_fuchsia_settings::HourCycle::Unknown), "h11" => Ok(fidl_fuchsia_settings::HourCycle::H11), "h12" => Ok(fidl_fuc...
Rust
0
x_ratio) .unwrap_or(0.0) .clamp(-geometry.width as f64, geometry.width as f64); // Create context and scale and crop to fit { let target = cairo::ImageSurface::create(cairo::Format::ARgb32, geometry.width, geometry.height) .map_err(...
Rust
0
older2.read().unwrap(); let q_parse = &read_state_holder.query_parsing[query_index].1; let cfg_read = cfg2.read().unwrap(); let log = cfg_read.get_log(&q_parse.log_name).unwrap(); let ds_name = &log.datastores[log_ds_index]; let ds = cfg_...
Rust
0
ide(); break; } } } else { let admin_data = adm.split('\0').collect::<Vec<_>>(); let (s, r): (Sender<bool>, _) = app::channel(); loop { success = 0; let mut password = Input2::<Input, SecretInput>::new( match lang {...
Rust
0
ategen project // must be updated to generate the changes. // // ================================================================= #![doc(html_logo_url = "https://raw.githubusercontent.com/rusoto/rusoto/master/assets/logo-square.png")] //! <p>Describes all of the AWS IoT 1-Click device-related API operations for the ...
Rust
0
pub struct T2(i32, i32); #[test] fn test_eq() { assert!(T1(1).eq(&T1(1)) == true); assert!(T1(1).eq(&T1(0)) == false); assert!(T2(1, 1).eq(&T2(1, 1)) == true); assert!(T2(0, 1).eq(&T2(1, 1)) == false); assert!(T2(1, 0).eq(&T2(1, 1)) == false); } #[test] fn ...
Rust
0
// really need to check the root column let ldf = df .clone() .lazy() .with_column(lit(3).alias("foo")) .filter(col("foo").is_not_null()); let _new = ldf.collect().unwrap(); let ldf = df .lazy() .with_column( ...
Rust
0
at!( "Simulation still running in loop mode since {}. Wait for the \ simulation to finish or stop it before resetting it.", &self.started_at ))) } RunMode::Step => { return Err(SimError::SimulationAlread...
Rust
0
&'static str = "<NAME>"; const URL: &'static str = "https://github.com/robbert-vdh/nih-plug"; const EMAIL: &'static str = "<EMAIL>"; const VERSION: &'static str = "0.2.0"; const DEFAULT_NUM_INPUTS: u32 = 2; const DEFAULT_NUM_OUTPUTS: u32 = 2; const SAMPLE_ACCURATE_AUTOMATION: bool = true; ...
Rust
0
#![deny(macro_use_extern_crate)] #![deny(meta_variable_misuse)] #![deny(missing_abi)] #![deny(missing_copy_implementations)] #![deny(missing_debug_implementations)] #![deny(non_ascii_idents)] #![deny(noop_method_call)] #![deny(pointer_structural_match)] #![deny(rust_2021_incompatible_closure_captures)] #![deny(rust_20...
Rust
0
# ============================================================================== # Copyright 2014 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.o...
Python
1
restricted"), CreateError::MalformedResponse(_, ref e) => write!(f, "{}", e), CreateError::Unknown(ref s) => write!(f, "{}", s), CreateError::Client(ref inner) => write!(f, "{}", inner), } } } impl<E: Error + 'static> Error for CreateError<E> { fn source(&self) -> Op...
Rust
0
") roles = role_service.get_all_roles() # Apply filters if filter_data.name_contains: roles = [role for role in roles if filter_data.name_contains.lower() in role.name.lower()] if filter_data.is_custom is not None: roles = [role for role in roles if role.is_custom == filte...
Python
1
ected MySQL database cursor_mysql.execute("USE mspms_mysql_db") cursor_mysql.execute("UPDATE spare_parts SET name=%s, category=%s, purchase_price=%s, sale_price=%s WHERE id=%s", (name, category, purchase_price, sale_price, part_id)) conn_mysql.commit() conn_mysql.close() print(...
Python
1
have been GCd via a **GC //! stream**. //! //! As one extra quirk, the dataflow frontier must be passed through //! [`timely::dataflow::operators::broadcast::Broadcast`] so that //! every worker has the true whole dataflow frontier, not just what //! work happens to be complete on the local worker. //! //! Recovery //...
Rust
0
, pValue: *mut u64) -> VkResult, >; pub type PFN_vkWaitSemaphoresKHR = ::std::option::Option< unsafe extern "C" fn( device: VkDevice, pWaitInfo: *const VkSemaphoreWaitInfo, timeout: u64, ) -> VkResult, >; pub type PFN_vkSignalSemaphoreKHR = ::std::option::Option< unsafe extern "C" fn...
Rust
0
the disk #[derive(Default)] pub struct Volume { /// The tracks on the disk pub tracks: BTreeMap<u8, Track>, } /// A Nibble encoded disk /// (although this is generic enough a module-wide data structure /// could be used) #[derive(Default)] pub struct NibbleDisk { /// The sectors on the disk pub volume...
Rust
0
"""Tests for specparam.plts.group.""" from pytest import raises from specparam import SpectralGroupModel from specparam.modutils.errors import NoModelError from specparam.tests.tutils import plot_test from specparam.tests.tsettings import TEST_PLOTS_PATH from specparam.plts.group import * #########################...
Python
1
from typing import Any, List, Callable import cv2 import numpy as np import onnxruntime import roop.globals from roop.typing import Face, Frame, FaceSet from roop.utilities import resolve_relative_path class Enhance_RestoreFormerPPlus(): plugin_options:dict = None model_restoreformerpplus = None devicena...
Python
1
[best_path], best_length # 读取数据 def read_tsp(path): lines = open(path, 'r').readlines() assert 'NODE_COORD_SECTION\n' in lines index = lines.index('NODE_COORD_SECTION\n') data = lines[index + 1:-1] tmp = [] for line in data: line = line.strip().split(' ') if line[0] == 'EOF': ...
Python
1
if all_features: # Flatten nested lists for MFCCs, Delta MFCCs, etc. flat_features = [] for f in all_features: flat = { "file_name": f["file_name"], "label": f["label"], "rms_mean": f["rms_mean"], "rms_std": f["rms_std"], "spectral_centroid...
Python
1
import asyncio from ollama import AsyncClient async def chat(): """Stream and print response parts asynchronously from an Ollama model.""" message = {'role': 'user', 'content': 'Why is the sky blue?'} async for part in await AsyncClient().chat(model='llama3.2', messages=[message], stream=True): ...
Python
1
_cell(self : &mut Self, col : usize, row : usize, value : bool) { if col < self.num_cols && row < self.num_rows { let idx = self.coord_to_idx(col, row); let col = col % 16; let u = self.cells[idx]; if value { self.cells[idx] = u | (0x1 << (15 - col...
Rust
0
let data_7 = vec![(14_f32, 64_f32); values_count]; let data_8 = vec![(13_f32, 64_f32); values_count]; let data_9 = vec![(12_f32, 64_f32); values_count]; let data_10 = vec![(1_f32, 64_f32); values_count]; let scatter_1 = ScatterView::new(x_scale.clone(), y_scale.clone()) .set_data(&data_1) ...
Rust
0
import os from azure.identity import DefaultAzureCredential from azure.mgmt.resource import ResourceManagementClient from azure.mgmt.apimanagement import ApiManagementClient from azure.mgmt.apimanagement.models import ApiManagementServiceResource, ApiManagementServiceSkuProperties def main(): GROUP_NAME = 'testgr...
Python
1
''' Use DFS find all path between two edges. REFERENCE: 1. http://eddmann.com/posts/depth-first-search-and-breadth-first-search-in-python/ 2. https://www.cs.berkeley.edu/~vazirani/algorithms/chap4.pdf NOTES: 1. Depth-first search makes deep incursions into a graph, retreating only when it runs out of new nodes to...
Python
1
qc_out = QCOutput(f"{TEST_DIR}/6.1.1.wb97xv.out.gz") assert qc_out.data["final_energy"] == approx(-76.43205015) n_vals = sum(1 for val in qc_out.data.values() if val is not None) assert n_vals == 23 qc_out_read_optimization = QCOutput(f"{TEST_DIR}/6.1.1.opt.out.gz") qc_out_...
Python
1
# SPDX-License-Identifier: MIT from .base import * from ...utils import * ## OSLog endpoint class OSLogMessage(Register64): TYPE = 63, 56 class OSLog_GetBuf(OSLogMessage): TYPE = 63, 56, Constant(1) SIZE = 55, 48 DVA = 47, 0 class ASCOSLogEndpoint(ASCBaseEndpoint): BASE_MESSAGE = OSLogMessage ...
Python
1
# -*- coding: utf-8 -*- import os import tensorflow as tf from tensorflow.python.platform import gfile import argparse import numpy as np import cv2 as cv import time from power_diff_numpy import * os.putenv('MLU_VISIBLE_DEVICES','') def parse_arg(): parser = argparse.ArgumentParser() parser.add_argument('ima...
Python
1
667592065285, 1.074335393548782, 1.072062310031789, 1.069856927148238, 1.0677194533126062, 1.0656500483921114, 1.0636488238275088, 1.0617158427897486, 1.0598511203721621, 1.0580546238178221, 1.0563262727816807, 1.054665939627075, 1.053073449756157, 1.0515485819737844, 1.0500910688843703, 1.04870059732118...
Python
1
_TOSURU: u32 = 506u32; #[doc = "*Required features: 'Win32_UI_Input_Ime'*"] pub const JPOS_FUTEIGO: u32 = 904u32; #[doc = "*Required features: 'Win32_UI_Input_Ime'*"] pub const JPOS_HUKUSIMEISHI: u32 = 104u32; #[doc = "*Required features: 'Win32_UI_Input_Ime'*"] pub const JPOS_JINMEI: u32 = 106u32; #[doc = "*Required f...
Rust
0
", DataType::Int32, false), Field::new("b", DataType::Int32, false), ])); let a = Arc::new(Int32Array::from(vec![4, 8, 16, 32, 64])); let b = Arc::new(Int32Array::from(vec![2, 4, 8, 16, 32])); apply_arithmetic::<Int32Type>( schema, vec![a, b], ...
Rust
0
odel, model_names.include_text_encoder, model_names.include_text_encoder_2, ) return except Exception: stacktraces.append(traceback.format_exc()) try: self.__load_safetensors( model, model_type, weight_dtypes, model_names.b...
Python
1
import sys import os import time from vcgencmd import Vcgencmd def main(): start_time = time.time() fb = open("data/temp_and_cpu.csv", "a+") fb.write("Elapsed Time(s), Temp(C), Clock Speed (MHz), Throttled\n") vcgm = Vcgencmd() while True: temp = vcgm.measure_temp() clock = int(vcgm.measure_clock("...
Python
1
= 70224; const NUMBER_OF_PIXELS: usize = 23040; fn run(mut cpu: CPU, mut window: Window) { let mut buffer = [0; NUMBER_OF_PIXELS]; let mut cycles_elapsed_in_frame = 0usize; let mut now = Instant::now(); while window.is_open() && !window.is_key_down(Key::Escape) { let time_delta = now.elapsed(...
Rust
0
""" Write a function to check whether an element exists within a tuple. assert check_tuplex(("w", 3, "r", "e", "s", "o", "u", "r", "c", "e"),'r')==True """ def check_tuple(tuple_value, element): """ Function to check whether an element exists within a tuple. :param tuple_value: tuple :param element: el...
Python
1
ctx.args.training_script_args = new_args ctx.args.job_id = "best_cfg" to_json_str = json.dumps(best_cfg) ctx.logger.info(f"Launch best cfg: {to_json_str}") logger.info(f"Launch best cfg: {to_json_str}") if tuner_cfg.get("best_cfg_dir", None): ctx.args.log_dir...
Python
1
0x90 => 0.066, _ => panic!("Invalid tempo: {}", value), } } fn decode_note(value: u8) -> f32 { match value { 0x02 => 69.30, // C#2 0x04 => 73.42, // D2 0x06 => 77.78, // D#2 0x08 => 82.41, // E2, 0x0A => 87.31, // F2 0x0C => 92.50, // ...
Rust
0
erated with a static seed //! //! Once this escrow is initialised, either: //! 1. User (Taker) can call the exchange function to exchange their Y for X //! - This will close the escrow token account, and escrow account and no longer be usable //! OR //! 2. If no one has exchanged, the maker can close the escrow account...
Rust
0
tion. This file may not be copied, modified, or distributed // except according to those terms. /*! This module contains the internal implementation of debug-here. Nothing in this module is part of the public api of debug-here, even if it is marked `pub`. Certain functions must be marked `pub` in order for the `debug...
Rust
0
from . import test_sale_planned_consumed_date
Python
1