text
string
label_name
string
labels
int64
import tkinter as tk from tkinter import ttk # window window = tk.Tk() window.title('Pack parenting') window.geometry('400x600') # Top frame top_frame = ttk.Frame(window) label1 = ttk.Label(top_frame, text = 'First label', background = 'red') label2 = ttk.Label(top_frame, text = 'Label 2', background = 'blue') # mi...
Python
1
R U5m[ UU4SjTRR555n[ U4SjU55n[ U4SjU55n[RS:a[U5S:XdS 5e[T5n/n[...
Python
1
minus(&TineTree::from(Empty)), [Open(0, 3)]); assert_eq_i!(a.minus(&TineTree::from(Point(13))), [Open(0, 3)]); assert_eq_i!(a.minus(&TineTree::from(Open(10, 13))), [Open(0, 3)]); assert_eq_i!(a.minus(&TineTree::from(LeftOpen(10, 13))), [Open(0, 3)]); assert_eq_i!(a.minus(&TineT...
Rust
0
as f64; let circle_width = (extents.width() / pango::SCALE) as f64; let circle_height = (extents.height() / pango::SCALE) as f64; // this rectangle & clip is a workaround. // without that, i get a connecting line between this // circle and some items (for instance project titles or // links for...
Rust
0
at_ceiling && body.speed.y > 0. { body.speed.y = 0.; } if was_on_ground != body.on_ground { println!( "ground: {:?} -> {:?} ({:?}", was_on_ground, body.on_ground, delta ); } } } fn apply_movements(mut query: Query<(&mut Tr...
Rust
0
import argparse import pandas as pd from tqdm import tqdm from pygaggle.rerank.base import Query, Text from pygaggle.rerank.transformer import MonoT5, SentenceTransformersReranker def load_corpus(path): print('Loading corpus...') corpus = {} with open(path, 'r', encoding='utf-8') as f_in: for line...
Python
1
#!/usr/bin/python3 """Defines a function that prints a square with the character #. Attributes: print_square: function that prints a square with the character #. """ def print_square(size): """Prints a square with the character #. Args: size (int): Size of the square (1 side). Raises: ...
Python
1
mut b = seed3 as u32 * x + seed4 as u32 * y + seed12 as u32 * z + (rnum >> 10); let mut c = seed5 as u32 * x + seed6 as u32 * y + seed9 as u32 * z + (rnum >> 6); let mut d = seed7 as u32 * x + seed8 as u32 * y + seed10 as u32 * z + (rnum >> 2); a &= 0x3F; b &= 0x3F; c &= 0x3F; d &= 0x3F; ...
Rust
0
on<bool>, /// Whether or not we're catching exceptions from the main function /// invocation. Currently only used for imports. catch: bool, } /// Helper struct used in incoming/outgoing to generate JS. pub struct JsBuilder { typescript: Vec<TypescriptArg>, prelude: String, finally: String, ...
Rust
0
onfig_pl; mod mode_change; mod read_measurement; mod read_status; <reponame>jknight/Rust-Programming-Cookbook use std::env; use std::env::var; use std::path::PathBuf; const HEADER_FILE_NAME: &'static str = "../tinyexpr/tinyexpr.h"; fn main() { let project_dir = var("CARGO_MANIFEST_DIR").unwrap(); println!("...
Rust
0
del.get_learned_conditioning(prompts) if args.mode == "base": cond = {"c_crossattn": [text_emb], "fps": fps} else: raise NotImplementedError ## inference batch_samples = batch_ddim_sampling( model, cond, noise_shape, ...
Python
1
n("No solution available."); //! var num_vertices = railplot_solution_edge_num_vertices(ptr, edge); //! for (uint i = 0; i < num_vertices; i++) //! { //! yield return new Point( //! railplot_solution_edge_vertex_x(ptr, edge, i), //! railplo...
Rust
0
WX859] 开始发送文件: {file_path} 到 {receiver}") try: # 使用异步方法发送文件 send_result = loop.run_until_complete(self.send_file_message(receiver, file_path)) if send_result and send_result.get("success", False): logger.info(f...
Python
1
mem::transmute(((self._bitfield_1 & (8192usize as u32)) >> 13u32) as u32) } } #[inline] pub fn set_pcm_enabled_flag(&mut self, val: u32) { self._bitfield_1 &= !(8192usize as u32); self._bitfield_1 |= ((val as u32 as u32) << 13u32) & ...
Rust
0
import os from pathlib import Path from common import VOLUME_CONFIG, app, axolotl_image, HOURS, MINUTES from huggingface_hub import HfApi @app.function( image=axolotl_image, volumes=VOLUME_CONFIG, timeout=2*HOURS, ) def upload_model_to_hf(axolotl_run_path: str, hf_repo_id: str): """ Upload traine...
Python
1
import logging from kfai.transformers.utils import logger_config def test_setup_logging_adds_handlers_only_once(mocker): """ Tests that setup_logging correctly adds handlers to a clean root logger and does NOT add them again if they already exist. """ # 1. Arrange: Mock external dependencies and ...
Python
1
from haystack import Document, Pipeline from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever from haystack.document_stores.in_memory import InMemoryDocumentStore from haystack_integrations.components.embedders.fastembed import FastembedDocumentEmbedder, FastembedTextEmbedder document_store ...
Python
1
word] = emoji; localStorage.setItem("customEmojis", JSON.stringify(customWords)); // save document.getElementById("customMsg").innerText = `"${word}" added as ${emoji}`; document.getElementById("newWord").value = ""; document.getElementById("newEmoji").value = ""; updateCustomList(); }...
Python
1
]) def test_update_plot_heterogenous_plotter(self): ax = plt.figure().subplots() ax.scatter(['a', 'b'], ['e', 'g']) ax.plot(['a', 'b', 'd'], ['f', 'a', 'b']) ax.bar(['b', 'c', 'd'], ['g', 'e', 'd']) axis_test(ax.xaxis, ['a', 'b', 'd', 'c']) axis_test(ax.yaxis, ['e', ...
Python
1
tion Tokens: {self.completion_tokens}\n" f"Total Cost (USD): ${self.total_cost:9.6f}" ) def __call__(self, response) -> None: """Collect token usage""" usage = response.usage if not hasattr(usage, "total_tokens"): return None model_name = standardize...
Python
1
gitude and latitude of Viby Bibliotek. # viby_bibliotek_longitude = viby_bibliotek_location[0]['longitude'] # viby_bibliotek_latitude = viby_bibliotek_location[0]['latitude'] # # # Retrieve all parking data from the parking database. # all_parking_data = get_data([], 'parking') # # # Calculate the distance from Viby Bi...
Python
1
json: T_JSON_DICT) -> StorageBucketDeleted: return cls( bucket_id=str(json['bucketId']) ) @event_class('Storage.attributionReportingSourceRegistered') @dataclass class AttributionReportingSourceRegistered: ''' **EXPERIMENTAL** ''' registration: AttributionReportingSource...
Python
1
)?; } // Test fixed-base scalar multiplication with a base field element { super::chip::mul_fixed::base_field_elem::tests::test_mul_fixed_base_field( chip, layouter.namespace(|| "fixed-base scalar mul with base...
Rust
0
static str) -> i64 { Symbolic::symbolic(name) } #[deprecated(note = "call u8::symbolic instead")] pub fn crucible_u8(name: &'static str) -> u8 { Symbolic::symbolic(name) } #[deprecated(note = "call u16::symbolic instead")] pub fn crucible_u16(name: &'static str) -> u16 { Symbolic::symbolic(name) } #[deprecated(note = "...
Rust
0
##################################################### def get_word_phones(word): """Convert word to phonemes using CMU dictionary""" if not hasattr(get_word_phones, 'lookup'): import nltk try: get_word_phones.lookup = nltk.corpus.cmudict.dict() except LookupError: ...
Python
1
ems, "skills": {name: skill.__dict__ for name, skill in character.skills.skills.items()} } # Gets the data of Character from a dictionary. @classmethod def deserialize_character(cls, data, character): if not data: return None person.name = data.get("name", "...
Python
1
hipErrorECCNotCorrectable = 214, hipErrorUnsupportedLimit = 215, hipErrorContextAlreadyInUse = 216, hipErrorPeerAccessUnsupported = 217, #[doc = "< In CUDA DRV, it is CUDA_ERROR_INVALID_PTX"] hipErrorInvalidKernelFile = 218, hipErrorInvalidGraphicsContext = 219, hipErrorInvalidSource = 30...
Rust
0
keys) # (B, T, 1, num_neigh) scale = tf.math.sqrt(tf.cast(c, tf.float32)) safe_scale = tf.where(tf.equal(scale, 0.0), 1.0, scale) # Avoid division by zero attn_scores = attn_scores / safe_scale # Sigmoid gate centered around 0 attn_weights = tf.nn.sigmoid(a...
Python
1
= "*Required features: 'Win32_Networking_WinHttp'*"] pub const ERROR_WINHTTP_RESERVED_189: u32 = 12189u32; #[doc = "*Required features: 'Win32_Networking_WinHttp'*"] pub const ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW: u32 = 12184u32; #[doc = "*Required features: 'Win32_Networking_WinHttp'*"] pub const ERROR_WINHTTP_SCRIP...
Rust
0
ation_should_not_jump_when_zero_unset() { let mut cpu = generate_test_cpu_with_instructions(vec![0xf0, 0x08]); cpu.ps.zero = false; let state = cpu.run(2).unwrap(); assert_eq!(0x6002, state.pc.read()); } #[test] fn bmi_relative_operation_should_jump_when_zero_set() { let mut cpu = generate_test_cp...
Rust
0
if offset + header_fields_bytes as usize > buf.len() { return Err(Error::NotEnoughBytes); } let mut fields = Vec::new(); let mut bytes_used_counter = 0; while bytes_used_counter < header_fields_bytes as usize { match unmarshal_header_field(header, buf, offset + bytes_used_counter) { ...
Rust
0
_weight * seen_count, None => 0, }; Ok(WeightSearch::Subtree(root.weight + sub_weight, root)) } else if subtree_weights.len() == 2 { let mut unique_prog = None; let mut unique_subtree_weight = None; let mut other_weight = None; for w in &subtree_weights ...
Rust
0
', system=None, stop_word='</s>' ) register_template( template_name='mistral', system_format='<s>', user_format='[INST]{content}[/INST]', assistant_format='{content}</s>', system='', stop_word='</s>' ) register_template( template_name='mixtral', system_format='<s>', user_fo...
Python
1
cription = 'Tool not found in tool descriptions' if tool_name in self.tool_descriptions: tool_description = self.tool_descriptions[tool_name] else: print(self.tool_descriptions) print('Key', tool_name, 'not found in tool descriptions') self.add_to_queue( ...
Python
1
" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. extern crate time; extern crate log; use log::{Log, LogLevel, LogMetadata, LogRecord}; pub struct SimpleLogger; impl log::L...
Rust
0
# Copyright 2024 The Orbit Authors. 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 applicable l...
Python
1
""" Throttling classes for the API app. """ from rest_framework.throttling import AnonRateThrottle, UserRateThrottle class StandardAnonRateThrottle(AnonRateThrottle): """ Throttle for anonymous users. """ rate = "100/hour" class StandardUserRateThrottle(UserRateThrottle): """ Throttle ...
Python
1
rcentage) def turn_off(self, **kwargs: Any) -> None: """Turn off the fan (to away).""" self.set_percentage(0) def set_percentage(self, percentage: int) -> None: """Set fan speed percentage.""" _LOGGER.debug("Changing fan speed percentage to %s", percentage) if percenta...
Python
1
f }; tokio::spawn(send_fut); let recv = recv_fut.await; assert_eq!(recv.len(), 100); } #[tokio::test(multi_thread)] async fn send_receive_slow_sender_multi_thread() { let (tx, rx) = unbounded(Duration::from_secs(10)); let send_fut = async move { ...
Rust
0
port, register) } fn write_register_ap(&mut self, port: PORT, register: REGISTER) -> Result<(), Self::Error> { (*self).write_register_ap(port, register) } } /// Determine if an AP exists with the given AP number. pub fn access_port_is_valid<AP>(debug_port: &mut AP, access_port: GenericAP) -> bool ...
Rust
0
tact(TestFactory): file_name = "penalty_frictional_contact_test_2D/hyper_simple_stick_patch_test" class TwoDSimplestPatchMatchingTestContact(TestFactory): file_name = "mpc_contact_tests/2D_contact_simplest_patch_matching_test" class TwoDSimplestWithFrictionPatchMatchingTestContact(TestFactory): file_name ...
Python
1
for i in range(4): for j in range(4): if j+i<=3: print(i,j) print('paint')
Python
1
2, x, validY); blurredPixel += pixel.rgb * gKernel[i++]; } uchar4 out; out.rgb = convert_uchar3(clamp(blurredPixel, 0.f, 255.f)); out.a = 0xff; return out; } use reign::prelude::*; #[derive(Debug, Model)] pub struct Article { #[model(no_write)] pub id: i32, pub title: String, ...
Rust
0
tok_start_idx = idx s = c idx = idx + 1 while (idx < len(data) and (data[idx] != '\"')): s = s + data[idx] if (data[idx] == '\\'): idx = idx + 1 idx = idx + 1 s = s + data[...
Python
1
fn parse_array_type(source: &str) -> Option<&str> { if !source.starts_with("Array") { return None; } let inner_type = &source[6..source.len() - 1]; Some(inner_type) } fn parse_decimal(source: &str) -> Option<(u8, u8, NoBits)> { if source.len() < 12 { return None; } if !s...
Rust
0
/// ********************************************************************* /// Now we define our Actor's. /// An Actor is anything in the game world. /// We're not *quite* making a real entity-component system but it's /// pretty close. For a more complicated game you would want a /// real ECS, but for this it's enou...
Rust
0
from easydict import EasyDict import torch import torch.nn as nn from ding.model.common import FCEncoder, ReparameterizationHead bipedalwalker_ppo_config = dict( exp_name='bipedalwalker_ppopg', env=dict( env_id='BipedalWalker-v3', collector_env_num=8, evaluator_env_num=5, # (boo...
Python
1
: &str = "flight.execute.cost"; use crate::graphics::{AttributeType, OpenGL}; use log::trace; /// A trait to describe vertices that will be consumed by a shader. /// /// # Example /// ``` /// // This is an example for how to implement VertexDescriptor for a simple type. /// use storm::cgmath::*; /// use storm::graphic...
Rust
0
nwrap(); let local_roots_range = local_roots.clone()[(begin - 1) as usize..].to_vec(); let config = ChangesTrieConfiguration::new(4, 2); let request = RemoteChangesRequest::<Header> { changes_trie_configs: vec![sp_core::ChangesTrieConfigurationRange { zero: (0, Default::default()), end: None, config: Som...
Rust
0
import asyncio import dbopenapi from app_keys import appkey, appsecretkey # app_keys.py 파일에 appkey, appsecretkey 변수를 정의하고 사용하세요 ''' 로그인 토큰발급은 1분에 1건으로 제한됨 https://openapi.db-fi.com/apiservice?group_id=cc55b867-e049-421b-a798-be016370ff44&api_id=9e3097ab-7d39-4433-8002-00649604f0de 2024.05.14 ''' async def main(): ...
Python
1
estored. This can happen when there's an # indirect connection from the attached object to the root. continue restore_lib.CheckpointPosition( checkpoint=checkpoint, proto_id=proto_id).restore(ref.ref) load_status = util.CheckpointLoadStatus( checkpoint, grap...
Python
1
onst WAVEFORM: Waveform = Waveform::Sawtooth; let mut play_idx = 0; let mut frame_count = 0; loop { let (channel, note, start_frame, volume) = notes[play_idx]; if frame_count == start_frame { println!("{:?} {:?} @ {}", channel, note, start_frame); synth.play(channel, ...
Rust
0
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional from typing_extensions import Literal from .._models import BaseModel __all__ = ["ContainerListResponse", "ExpiresAfter"] class ExpiresAfter(BaseModel): anchor: Optional[Literal["last_active_at"]] ...
Python
1
frame: Frame::from_ptr(handle), } } /// Creates a copy of the given frame. /// /// The plane data is copy-on-write, so this isn't very expensive by itself. /// /// Judging by the underlying implementation, it seems that any valid `core` can be used. #[inline] pub fn co...
Rust
0
"multiline": True }), "speed":("FLOAT",{ "default": 1.0 }), "seed":("INT",{ "default": 42 }), "text_frontend":("BOOLEAN",{ "default": True }), ...
Python
1
], allowing it to be finalized and dropped by the manager according to /// the close method returned by [`close_method`]. /// The bar should not be used after this is called. /// /// [`Bar`]: IsBar /// [`close_method`]: IsBar::close_method fn done(&mut self); /// Checks if the [`Bar`] is do...
Rust
0
p(); // // let key = entry_hash(&[1]); // assert!(storage.delete(&key).is_ok()); //} // //fn test_try_delete_non_existing_key(kv_store_factory: &TestContextKvStoreFactoryInstance) { // let storage = kv_store_factory // .create("test_try_delete_non_existing_key") // .unwrap(); // // let key = e...
Rust
0
- E+/W- tz = -5.0#5.5# place = panchanga.Place('PlacePerLatLong',lat, lon, tz)#('Chennai,IN',lat, lon, tz) #""" start_date = panchanga.Date(2024,1,1) end_date = panchanga.Date(2025,4,31) tithi_index = _amavasya_tithi vdates = tithi_dates(place, start_date, end_date, tithi_index) #vdates ...
Python
1
def main(model_path, output_path): unet_state_dict = load_file(model_path) config = {} converted_state_dict = convert_state_dict(unet_state_dict) unet = Kandinsky3UNet(config) unet.load_state_dict(converted_state_dict) unet.save_pretrained(output_path) print(f'Converted model saved to {outpu...
Python
1
) if images is not None: image_features = self.image_processor(images, **images_kwargs) num_tiles = image_features.pop("num_tiles") data.update(image_features) # Create cross attention mask if images is not None and text is not None: ...
Python
1
; impl<'de> ::serde::de::Visitor<'de> for Visitor { type Value = DataflowEdge; fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { write!(f, "a struct of type DataflowEdge") } fn visit_map<A: ::serd...
Rust
0
# 차종 선택 model_select = WebDriverWait(self.driver, 10).until( EC.element_to_be_clickable((By.ID, 'modelList')) ) model_select = Select(model_select) model_select.select_by_visible_text(model) ...
Python
1
e from the subjectDN will be used)."] #[doc = " If `server_name` is `NULL` then no such matching is performed."] #[doc = ""] #[doc = " \\param ctx validation context."] #[doc = " \\param server_name server name to match (or `NULL`)."] pub start_chain: ::core::option::Option< unsa...
Rust
0
match self.app.tick(PollStrategy::Once) { Ok(mut messages) => { if !messages.is_empty() { self.redraw = true; } let found = messages.iter().position(|m| wait_for.contains(m)); // Return if fo...
Rust
0
#[must_use] pub fn donate_output(&self) -> Option<i64> { self.donate_output } /// Get the record create one's bank account input. #[must_use] pub fn bank_account_input(&self) -> Option<i64> { self.bank_account_input } /// Get the record create one's bank account output...
Rust
0
# Descrição # Neste desafio, implemente uma solução para completar a função conta_vogais que conta o número de vogais # em uma string fornecida como entrada. Vogais são caracteres específicos sem acentuação, incluindo tanto # letras minúsculas quanto maiúsculas (aeiouAEIOU). # # Para resolver este desafio, siga os...
Python
1
: test_params.eth_lock_contract_address, eth_bridge_lock_hash: test_params.eth_bridge_lock_code_hash, light_client_typescript_hash: test_params.light_client_typescript_hash, token_amount: test_params.token_amount, fee: test_params.fee, }; let input_sudt_amount = test_params.inpu...
Rust
0
} fn call(&mut self, mut req: http::Request<B>) -> Self::Future { debug!("client request: method={} uri={} version={:?} headers={:?}", req.method(), req.uri(), req.version(), req.headers()); match *self { ClientService::Http1(ref h1) => { let upgrade = re...
Rust
0
<div class="flex space-x-2"> <button class="w-8 h-8 bg-gray-300 hover:bg-gray-400 rounded-full flex items-center justify-center text-white text-sm font-bold" onclick="callPythonFunction('minimizeWindow')">−</button> <button class="w-8 h-8 bg-warning hover:bg-yellow-500 rounde...
Python
1
hora de inicio de ausencia debe estar entre {self.HORA_MIN_PERMITIDA.strftime('%H:%M')} " f"y {self.HORA_MAX_PERMITIDA.strftime('%H:%M')}." ) if self.hora_fin_ausencia and not (self.HORA_MIN_PERMITIDA <= self.hora_fin_ausencia <= self.HORA_MAX_PERMITIDA): raise models.Val...
Python
1
#3)write a program to find given number is positive ,nigetive or zero. num1=int(input(f"Enter the number : ")) def face_val(param): digit4 = (param // 1000) % 10 digit3 = (param // 100) % 10 digit2 = (param // 10) % 10 digit1 = param % 10 return "{} {} {} {}".format(digit4, digit3, digit2...
Python
1
ANGE: SqlState = SqlState(Cow::Borrowed("22008")); /// 22012 pub const DIVISION_BY_ZERO: SqlState = SqlState(Cow::Borrowed("22012")); /// 22005 pub const ERROR_IN_ASSIGNMENT: SqlState = SqlState(Cow::Borrowed("22005")); /// 2200B pub const ESCAPE_CHARACTER_CONFLICT: SqlState = SqlState(Cow::B...
Rust
0
import math, random from panda3d.core import Vec3 def Cloud(radius = 1): x = 2 * random.random() - 1 y = 2 * random.random() - 1 z = 2 * random.random() - 1 unitVec = Vec3(x, y, z) unitVec.normalize() return unitVec * radius def BaseballSeams(step, numSeams, B, F = 1): time = step / floa...
Python
1
}.json') def ensure_parent_dir(path: str) -> None: """Create parent directory for a file path, if needed.""" parent = os.path.dirname(os.path.abspath(path)) if parent: os.makedirs(parent, exist_ok=True) def ensure_dir(dir_path: str) -> None: """Create directory if needed.""" os.makedirs(...
Python
1
e[y].chars().nth(x).unwrap() } fn count(&mut self, needle: char) -> usize { self.image .iter() .map(|row| row.matches(&needle.to_string()).count()) .sum() } } #[derive(Clone, Debug)] struct Tile { id: u32, edges: Vec<u32>, image: Image, } impl Tile ...
Rust
0
import hashlib import os import shutil import requests import zstandard as zstd def download_and_unpack_csv(url, output_csv_path): # Download the compressed file response = requests.get(url, stream=True) compressed_file_path = output_csv_path + '.zst' with open(compressed_file_path, 'wb') as compres...
Python
1
xefiw\x1dn\xadm\xf3\xc1\xcde\x16\x977X\xdf\ \xa9!\x04\x8c\x97K\x89\x80-\xd9'H-\xf7\xf9\x0b\ \xcb\x90\xaeJp`|\xa7\xf0u\xd4\xb5qK\xd1i\ v\xa8\xaem\xb3y{\x83\xc6N\x1d4X9\x1b\xcb\ \xb6CM\xc1\x9e\xb6\x0b\xfa\x9c\xe8J\xf79\x7f\xfc\xbc\ \xc9}=\xc5LW\xb4\x7f\x02\x0a\x85\x02\xa7O\x9f\xe1\ \xfa\xf5\xeb\x5c\xbdz\x95w\xdey\x17\xa5...
Python
1
# Copyright 2023 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
REALTIME); #[cfg(any( target_os = "fuchsia", all( not(any(target_env = "uclibc", target_env = "newlib")), any(target_os = "linux", target_os = "android", target_os = "emscripten") ) ))] pub const CLOCK_REALTIME_ALARM: ClockId = ClockId(libc::CLOCK_REALTIME_ALA...
Rust
0
String(String), Float(f32), Push, Colon, Plus, Multiply, EqualEqual, Minus, Modulo, Divide, Comma, Indent, Dedent, GreaterThan, GreaterEqual, LessEqual, LessThan, Assign, Bang, OpeningParen, ClosingParen, OpeningBracket, Closing...
Rust
0
_nonzero outputs a single non-zero word if the input is non-zero and zero otherwise. /// Preconditions: /// 0 ≤ eval arg1 < m /// Postconditions: /// out1 = 0 ↔ eval (from_montgomery arg1) mod m = 0 /// /// Input Bounds: /// arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffff...
Rust
0
to move windows. pub modifiers_move_lock: bool, /// Whether pressing the modifiers are required to click windows. pub modifiers_click_lock: bool, /// Whether windows should close with the `ESC` key. pub close_with_esc: bool, } /// Retrieves the UI settings from ArcDPS. pub fn ui_settings() -> UI...
Rust
0
from transformers.models.llama.modeling_llama import LlamaForCausalLM, LlamaModel from colossalai.inference.modeling.models.glide_llama import ( GlideLlamaDecoderLayer, glide_llama_causal_lm_forward, glide_llama_model_forward, ) from colossalai.inference.utils import init_to_get_rotary from colossalai.shar...
Python
1
varint32_size(len) + len; } for value in &self.before_requirement { let len = value.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; for value in &self.after_requirement { let len = value.compute_size(); ...
Rust
0
#!/usr/bin/env python3 """ Download Mistral Model Script This script downloads the Mistral 7B model for local inference. """ import os import sys import argparse import requests from pathlib import Path # Model URLs MODEL_URLS = { "mistral-7b-instruct-v0.2.Q3_K_S.gguf": "https://huggingface.co/TheBloke/Mistral-7...
Python
1
Interface>, { #[derive(Debug)] #[allow(dead_code)] struct TypeAndStorageLayout { type_: &'static str, type_size: usize, type_alignment: usize, storage_: &'static str, storage_size: usize, storage_alignment: usize, } let lay = TypeAndStorageLayout { ...
Rust
0
>, #[doc = "0xcc - AVS Counter Divisor Register"] pub avs_cnt_div: crate::Reg<avs_cnt_div::AVS_CNT_DIV_SPEC>, } #[doc = "tmr_irq_en register accessor: an alias for `Reg<TMR_IRQ_EN_SPEC>`"] pub type TMR_IRQ_EN = crate::Reg<tmr_irq_en::TMR_IRQ_EN_SPEC>; #[doc = "Timer IRQ Enable Register"] pub mod tmr_irq_en; #[d...
Rust
0
import pytest import torch from scipy.constants import physical_constants import cheetah @pytest.mark.parametrize("species_name", ["proton", "electron", "deuteron"]) def test_particle_mass(species_name): """ Test that the particle mass is correct for different species by comparing it to the value given i...
Python
1
repo_name (str): The full name of the repository. issue_number (int): The number of the issue. title (str, optional): The new title for the issue. body (str, optional): The new body content for the issue. Returns: A JSON-formatted string confirming t...
Python
1
coins = [22, 4, 12, 26, 4, 9, 4, 28, 28, 8, 28, 19, 15, 20, 9, 161, 11, 28, 17, 10, 25, 15, 7, 28, 21, 24, 10, 13, 22, 4, 10, 14] tax_values = {15: 2, 17: 10, 10: 3, 12: 10, 21: 12, 4: 2, 22: 1, 11: 6, 26: 9, 14: 7, 24: 12, 161: 16, 20: 15, 9: 8, 8: 1, 13: 10, 28: 6, 7: 6, 25: 6, 19: 15} def calculate_tax(coins_subse...
Python
1
.map_err(|_| { ConnectorError::FailedParsingCoreResponse("Send Post Request Failed.".to_string()) })?; Ok(text[1..(text.len() - 1)].to_string()) } } /// Reads the local `oracle-config.yaml` file fn get_config_yaml_string() -> Result<String> { std::fs::read_to_str...
Rust
0
import pygame import socket import threading WIDTH, HEIGHT = 600, 400 WHITE = (255, 255, 255) GRAY = (220, 220, 220) BLACK = (0, 0, 0) pygame.init() screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Pilih Batu Gunting Kertas") font = pygame.font.Font(None, 36) # Load images batu = pygame....
Python
1
# (C) 2025 A.Voß, a.voss@fh-aachen.de, info@codebasedlearning.dev """ This snippet is about sqlite3 - a database connector. Teaching focus - connect to sqlite database - read from database - closing context manager Preparations - .env file with credentials (if you use ones), not part of the project; - the ...
Python
1
vert_coord(&coord); self.source.write_value_at(txn_id, coord, value) } } impl<T: DenseAccess> ReadValueAt for BlockListExpand<T> { fn read_value_at<'a>(&'a self, txn: &'a Txn, coord: Coord) -> Read<'a> { let source_coord = self.rebase.invert_coord(&coord); let read = self .s...
Rust
0
"""ShotGrid RV commands module. TODO: This module is a stub and needs more testing and development. """ import uuid from PySide2 import QtCore from .. import common from .. import database tag = f'{common.product}{uuid.uuid4().hex}' PushAndClear = common.idx(reset=True, start=0) PushAndClearFullScreen = common.id...
Python
1
/// `n` must be between 1 and 8, inclusive. fn read_be_uint_n(&mut self, nbytes: uint) -> IoResult<u64> { assert!(nbytes > 0 && nbytes <= 8); let mut val = 0u64; let mut i = nbytes; while i > 0 { i -= 1; val += (try!(self.read_u8()) as u64) << i * 8; ...
Rust
0
t Engine) -> Failure { ld_int::<UnsignedIntegerBigEndianEncoding>(engine, "LDUXQ", 256, STACK | QUIET | STAY) } // (slice length - x slice) pub fn execute_ldix(engine: &mut Engine) -> Failure { ld_int::<SignedIntegerBigEndianEncoding>(engine, "LDIX", 257, STACK | STAY) } // (slice length - x slice) 256 pub fn...
Rust
0
bank_account.acc_number, bank_account.clearing_number, company.phone, dict(self._fields['tax_liability']._description_selection(self.env)).get(self.tax_liability), month_to_tax_liability.get(0), month_to_tax_liability.get(1), month_to_tax_l...
Python
1
a = butter(N, Wn, 'lowpass', analog=False) # Check filtfilt condition if N * 3 > signal_len: diff = N * 3 - signal_len ecgy = list(reversed(ecgy)) + list(ecgy) + list(ecgy[-1] * np.ones(diff)) # Filtering with filtfilt ECG_Clean = filtfilt(b, a, ecgy) ECG_Clean = ECG_Cl...
Python
1
# -*- coding: utf-8 -*- # Copyright (c) 2021 Brian Scholer (@briantist) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import (absolute_import, division, print_function) __metaclass__ = type ...
Python
1