text
string
label_name
string
labels
int64
, k as f32); // //let c = color::mul_s(&color::WHITE, k); // (r, c) // } else { // (Ray3f{origin: *surface_point, dir: math::zero()}, color::BLACK) // } // } fn eval( &self, surface_normal: &Vector3f, in_dir: &Vector3f, out_...
Rust
0
); let factor = dt / t; self.status = TileState::TileMoving(t - dt, x + factor * (dx - x), y + factor * (dy - y), ox, oy); } }, TileState::TileNew(t, size) => { if dt >= t { self.status = TileState::TileS...
Rust
0
ldren::default()); let leaf1_node_key = gen_leaf_keys(0 /* version */, internal_node_key.nibble_path(), index1).0; let internal2_node_key = gen_leaf_keys(1 /* version */, internal_node_key.nibble_path(), 2).0; let internal3_node_key = gen_leaf_keys(2 /* version */, internal_node_key.nibble_path...
Rust
0
actor; pub(crate) use actor::link::RecorderLink; pub(crate) use actor::Recorder; use std::result::{Result}; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, UdpSocket}; use std::thread::{self, JoinHandle}; use std::string::ToString; use std::any::Any; use std::str; use regex::Regex; use multicast; use helper::*;...
Rust
0
i64> = line .split_whitespace() .map(|x| x.parse().unwrap()) .collect(); let words: Vec<i64> = words.iter().map(|x| x-1).collect(); let mut friends = [0;100]; for i in 0..n { friends[words[i as usize] as usize] = i; } for i in 0..n {...
Rust
0
load_url=f"https://github.com/sdpython/{project_var_name}/", description=DESCRIPTION, long_description=read_readme(__file__), cmdclass=default_cmdclass(), keywords=KEYWORDS, classifiers=CLASSIFIERS, packages=packages, package_dir=package_dir, package_data=package_data, setup_requires...
Python
1
not args.save_state: safetensor_save_path = os.path.join(args.output_dir, f"checkpoint-{global_step}.safetensors") save_model(safetensor_save_path, accelerator.unwrap_model(network)) else: accelerator_save_path = os.path.join(args.output_dir, f"checkpoint-{global_step}") ...
Python
1
_win, opt._h_max, opt._h_min, opt._grad_var, opt._dist_to_opt_avg, opt._lr_var, opt._mu_var, apply_op] ) res[5] = opt._lr_var.eval() res[6] = opt._mu_var.eval() g_norm_squared_avg = 0.999 * g_norm_squared_avg \ + 0.001 * np.sum(( (i + 1)*np.ones( [n_dim + 1, ] ) )**2) g_norm_a...
Python
1
RROR helpfulToons=None in assignRewards , tell Red') activeToonList = [] for t in activeToons: toon = simbase.air.doId2do.get(t) if toon != None: activeToonList.append(toon) for toon in activeToonList: for i in range(len(ToontownBattleGlobals.Tracks)): uberIn...
Python
1
} fn set_attribute(&self, reg_base_addr: u64) -> Result<()> { let attribute = kvm_bindings::kvm_device_attr { group: kvm_bindings::KVM_DEV_ARM_VGIC_GRP_ADDR, attr: u64::from(kvm_bindings::KVM_VGIC_ITS_ADDR_TYPE), addr: &reg_base_addr as *const u64 as u64, ...
Rust
0
dev() as u64 == m2.dev() && m1.ino() as u64 == m2.ino() } #[test] fn test_file_meta_basic() { let tmpdir = tempfile::tempdir().unwrap(); let tmpdir_path = tmpdir.as_ref(); let tmpdir = Dir::open(tmpdir_path).unwrap(); tmpdir .create_dir("dir", 0o777, LookupFlags::empty()) .unwrap(); ...
Rust
0
ty: 0.5;"> <div class="company-logo" style="background-color: #DC3545;"> <i class="fas fa-exclamation-triangle"></i> </div> <div class="company-name">Error Loading Tasks</div> <div class="company-description">Please refresh the page to ...
Python
1
from pathlib import Path from pydantic import Field, field_validator from pydantic_settings import BaseSettings class Settings(BaseSettings): # Required environment variables (must be non-empty) DATABASE_URL: str = Field(..., description="Database connection URL") PYTHONPATH: str = Field(..., description...
Python
1
concat!("Alignment of ", stringify!(CallbackMsg_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<CallbackMsg_t>())).m_hSteamUser as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(CallbackMsg_t), "::", stringify!(m_hSteamUser) ) ); assert_eq!( unsafe { &(*(::std::ptr::...
Rust
0
] { fn object_hash(&self) -> Hash { Hash::new(*self) } } #[cfg(test)] mod tests { use exonum_crypto::{Hash, HashStream}; use super::HashTag; #[test] fn empty_list_hash() { let len_bytes = [0; 8]; let tag = 2; let empty_list_hash = HashStream::new() ...
Rust
0
focused_id.unwrap(), tile_grid.graph.get_sorted_children(0)[5] ); } #[test] fn push_twelve_nodes_altering_axis_and_directions_then_swap_focused_around() { let mut tile_grid = TileGrid::new(0, TestRenderer {}); perform_actions(&mut tile_grid, LARGE_LAYOUT); let root = tile_grid.graph.get_root()...
Rust
0
np.percentile(data, 0.001) for i in range(len(data)): if (data[i] <= upper_) and (data[i] >= lower_): newd.append(data[i]) newd = np.array(newd) inp_min = newd.min() inp_max = newd.max() ...
Python
1
from app.core.commands import WriteCommand class CreateTaskCommand(WriteCommand): def __init__(self, data): pass def validate(self) -> bool: return True def execute(self) -> dict: pass
Python
1
named!(pub parse_smb1_negotiate_protocol_response_record_ok<Smb1NegotiateProtocolResponseRecord>, do_parse!( wct: le_u8 >> dialect_idx: le_u16 >> sec_mode: le_u8 >> take!(16) >> caps: le_u32 >> sys_time: le_u64 >> server_tz: le_u16 >> challe...
Rust
0
= var("HOME").expect("Error: Unable to find AppData directory."); let mut heroes_json_path = Path::new(&heroes_json_path_str).to_path_buf(); heroes_json_path.push("Library/Application Support/Optolith/heroes.json"); }; panic!("Error: Unknown platform. Could not determin heroes....
Rust
0
cy: usize, width: usize, height: usize, visited: &HashSet<(usize, usize)>) -> Option<(usize, usize)> { let neighbors = get_unvisit...
Rust
0
import re from collections import Counter def words(text): return re.findall(r'\w+', text.lower()) WORDS = Counter(words(open('/home/jalaj/PycharmProjects/NLPython/NLPython/data/big.txt').read())) def P(word, N=sum(WORDS.values())): "Probability of `word`." return WORDS[word] / N def correction(word): ...
Python
1
0qfu6h5: by7zk2hs5_j=b'', ffmld2j6n8p=None, ae01jehca_e=0j, fzo3lvkly2w: sa93c2_rv16=0): """# throttle_motels_definition -> program_exception_cakes""" raise '' from ngj9we0yxkt import brsg_d4lk8u, f9r6bbv0den, ojfwkyefzf8 as y9pgfnszjze, w47a_ewtl77 as jh6x0g4anow, kp8s0gaoksv, gdexq0uq5q_ return False ...
Python
1
lines.append( line.rstrip() ) f.close() f = open( conanTestPath, 'w' ) for line in lines: f.write( line + "\n" ) def performUpdates(version): # First update version file, so we can regenerate single header and # have it ready for upload to wandbox, when updating readme version....
Python
1
: [u32], pub sound_id: [reference SOUND], } } <filename>src/config/config.rs extern crate directories; use std::fs; use directories::ProjectDirs; use duration_string::DurationString; use serde::Deserialize; use crate::config::args::Args; use crate::error::error::Error; use super::args; use super::yandex...
Rust
0
if e.response["Error"]["Code"] == "UserNotFoundException": raise HTTPException( status_code=404, detail="User does not exist" ) elif e.response["Error"]["Code"] == "UserNotConfirmedException": raise HTTPException( s...
Python
1
RT_VIEW_SEEK_OPERATOR_FLAGS = 4u32; #[doc = "*Required features: `\"Win32_Security_Cryptography_Certificates\"`*"] pub const CVR_SEEK_LT: CERT_VIEW_SEEK_OPERATOR_FLAGS = 2u32; #[doc = "*Required features: `\"Win32_Security_Cryptography_Certificates\"`*"] pub const CVR_SEEK_GE: CERT_VIEW_SEEK_OPERATOR_FLAGS = 8u32; #[do...
Rust
0
= vec![42, 1, 1, 0, 1] .into_iter() .map(point::from_u64) .collect::<Vec<_>>(); let polynomial = from_coefficients(coefficients.into_iter()); let point = point::from_u64(2); let result_in_fr = polynomial.evaluate_at(point); let mut result: u64 = 0; ...
Rust
0
and `.set_aliased` calls. body: &'a $($m)? [T::Mem], /// If the `BitSlice` ended in the interior of its last element, /// this contains the ending index and the last address. tail: Option<(&'a T $(::$a)?, BitTail<T::Mem>)>, } } impl<'a, T> $t <'a, T> where T: BitStore, { /// Attempts ...
Rust
0
, "seventy"), (80, "eighty"), (90, "ninety"), ]; fn encode_less_than_two_digits(n: u64) -> String { let hash: HashMap<u64, &str> = BASIC_NUMBERS.iter().cloned().collect(); match n { 0...20 => hash[&n].to_string(), tens if tens % 10 == 0 => hash[&tens].to_string(), _ => format!(...
Rust
0
] = True cvt_list[all_rel[node]['father']] = False else: cvt_list[node] = False cvt_list[all_rel[node]['father']] = True continue if G.degree(node) == 1: cvt_list[node] = False continue else: ...
Python
1
the second response. */ let key = HandShake::do_the_handshake(&mut sender, &mut receiver, None).await; assert_eq!(receiver.number_of_responses, 2); assert_eq!(key.is_err(), true); } mod steam_options; pub use steam_options::*; mod macros; pub use macros::*; mod preferences; pub use preferences::*; m...
Rust
0
aUsageFeedback](https://developer.android.com/reference/android/provider/ContactsContract.DataUsageFeedback.html) /// /// Required feature: android-provider-ContactsContract_DataUsageFeedback #[deprecated] public final class ContactsContract_DataUsageFeedback ("android/provider/ContactsContract$DataUsageFee...
Rust
0
end(Some(e.to_string())), } }); println!("Mock CSI plugin started"); Ok((rx, plugin)) } fn external_provisioner_start(bin_root: &Path) -> anyhow::Result<Child> { let stdout = std::fs::File::create(Path::new(LOG_DIR).join("csi-provisioner.stdout"))?; let stderr = std::fs::File::create(Path...
Rust
0
et_ylabel("Weight q") ax2.set_xlim(-0.5, p_max-0.5) ax2.set_ylim(-0.5, q_max-0.5) ax2.set_xticks(p_range) ax2.set_yticks(q_range) ax2.grid(True, alpha=0.3) # Beilinson-Lichtenbaum conjecture ax2.text(0.02, 0.98, f"φ-Motivic Cohomology:\nE₂^{{p,q}} = H^p_{{M,φ}}(X, Z(q)) ⇒ K_{{q-p}}(X)\n...
Python
1
r::GetKey); key.try_into().unwrap_or_revert() } fn update_list(name: String) { let list_key = get_list_key(LIST_KEY); let mut list: Vec<String> = storage::read_or_revert(list_key); list.push(name); storage::write(list_key, list); } fn sub(name: String) -> Option<URef> { if runtime::has_key(&na...
Rust
0
> Self { SerializeOptions { date_format: None, time_format: None, datetime_format: None, delimiter: b',', quote: b'"', } } } /// Utility to write to `&mut Vec<u8>` buffer struct StringWrap<'a>(pub &'a mut Vec<u8>); impl<'a> std::fmt::Writ...
Rust
0
: u8 = 255; println!("{}", y); let nums: [i32; 5] = [0,1,2,3,4]; println!("{:?}",nums[1]); let tup = (5, -20, false, "ttt"); println!("{:?}",tup.2); test_fn_one(); test_fn_two(x, "0"); let z = { let x = 3; x + 1 }; println!("{:?}",z); easy_if(20); ...
Rust
0
turn (value >= 59) && (value <= 76); } else { return false; } } fn byr_valid(s: &str) -> bool { return yr_valid(s, 1920, 2002); } fn iyr_valid(s: &str) -> bool { return yr_valid(s, 2010, 2020); } fn eyr_valid(s: &str) -> bool { return yr_valid(s, 2020, 2030); } fn yr_valid(s: &str, min: ...
Rust
0
import numpy as np import os import matplotlib.pyplot as plt timesteps = list(range(1, 10, 1)) def get_stats_timestep(path): f = np.load(path, allow_pickle=True) dist_min = f['dist_min'] dist_averages = f['dist_averages'] / 2428 times = f['times'] avg = np.mean(dist_averages) std = np.std(dis...
Python
1
/// RFC 904. #[derive(Debug, PartialEq, PartialOrd, Ord, Eq, Hash)] pub struct NeighIntervalHello(pub Counter32); access: ReadOnly, status: Obsolete, value = [1, 3, 6, 1, 2, 1, 8, 5, 1, 12]; /// The interval between EGP poll command retransmissions (in /// hundre...
Rust
0
in() { let args: Vec<String> = args().collect(); let program = args.get(0).unwrap(); let mut opts = Options::new(); opts.optflag("h", "help", "print this help message"); opts.optopt("c", "cmd", "run code from command", "CODE"); opts.optopt("i", "input", "use string as input", "TEXT"); opts....
Rust
0
on_hooked(self, source: Trainer, params: ParamsType): super().on_hooked(source, params) from dbrecord import PDict from lumo.exp.watch import is_test_root self.fn = source.exp.mk_rpath('contrib', 'params_key.sqlite') olds = PDict(self.fn) current = source.params.hash() ...
Python
1
R<EVENTS_USBREMOVED_SPEC>); impl core::ops::Deref for R { type Target = crate::R<EVENTS_USBREMOVED_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<EVENTS_USBREMOVED_SPEC>> for R { #[inline(always)] fn from(reader: crate::R<EVENTS_USBREMOVED_SPEC...
Rust
0
ANCE_FACTOR); submit_voter::<T>(caller.clone(), all_candidates, stake)?; whitelist!(caller); }: _(RawOrigin::Signed(caller)) report_defunct_voter_correct { // number of already existing candidates that may or may not be voted by the reported // account. let c in 1 .. MAX_CANDIDATES; // number of candida...
Rust
0
u can apply *Activities* to //! * a collection of properties and *Parts* //! * **[Parts](trait.Part.html)** //! * a collection of properties //! * never directly used in *Activities* //! * **[Activities](trait.CallBuilder.html)** //! * operations to apply to *Resources* //! //! All *structu...
Rust
0
let storage = storage::Storage::new(); // Read RFC by rfcnumber if let Some(n) = matches.value_of("Number") { let rfc_number = n.parse::<u32>().unwrap(); // check if RFC is downloaded if !storage.is_rfc_downloaded(rfc_number).unwrap() { println!("Fetching RFC..."); ...
Rust
0
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------ # Copyright by KNIME AG, Zurich, Switzerland # Website: http://www.knime.com; Email: contact@knime.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General P...
Python
1
response = self.efi.pix_detail_charge(params=params) if not isinstance(response, dict): error_message = f"A API da Efí retornou um erro inesperado ao consultar o estado da cobrança: {str(response)}" logger.error(error_message) return {"suc...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2017 Michael J. Hayford """ Gap container class .. Created on Fri Sep 15 17:06:17 2017 .. codeauthor: Michael J. Hayford """ from opticalglass import opticalmedium as om def gap_medium(g) -> str: """ return a formatted string of the gap's medium. ""...
Python
1
from scriptwriter.ai_gameset import AIGameSet from common.character import CharacterManager from game import Game from game_phases.player_detective.player_RA_phase import PlayerRAPhase import random def main(): # 1️⃣ 產生遊戲設定 gameset = AIGameSet() # 2️⃣ 使用 AIGameSet 的數據建立 Game 物件 game = Game( ...
Python
1
Returns whether or not the visible area is sampled or not. pub fn get_sample_visible_area(&self) -> bool { self.sample_visible_area } /// Return the differential area of microfacets oriented with the surface /// normal `wh`. /// /// * `wh` - A sample normal from the distrubition of nor...
Rust
0
::Context>) -> HmdBuilder { let default_caps = ffi::ovrHmdCap_LowPersistence | ffi::ovrHmdCap_DynamicPrediction; HmdBuilder { caps: default_caps, track_caps: ffi::ovrTrackingCaps::empty(), allow_debug: false, owning_context: owning_context } ...
Rust
0
jni_env = __jni_bindgen::Env::from_ptr(self.0.env); // let (__jni_class, __jni_method) = __jni_env.require_class_method("android/animation/ValueAnimator\0", "clone\0", "()Landroid/animation/Animator;\0"); // __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())...
Rust
0
"""Embed Sheet.""" import os.path from colander import deferred from deform.widget import TextAreaWidget from pyramid.interfaces import IRequest from pyramid.renderers import render from zope.interface import Interface from adhocracy_core.interfaces import API_ROUTE_NAME from adhocracy_core.interfaces import ISheet f...
Python
1
(), user.clone(), mint_msg).unwrap(); let change_url_msg = ExecuteMsg::ChangePixelData { token_id: TEST_TOKEN_ID1, color_map: None, url: Some(TEST_URL.to_string()), }; let res = execute(deps.as_mut(), mock_env(), user2, change_url_msg); assert_eq!(Err(ContractError::Unauthoriz...
Rust
0
)) .as_ref()); _hkdf_expand_label(out, &hmac::SigningKey::new(self.hash, &secret[..self.hash.output_len]), b"exporter", &h_context[..self.hash.output_len]); Ok(()) } } fn _hkdf_expand_lab...
Rust
0
from rest_framework import serializers from kpi.utils.schema_extensions.serializers import inline_serializer_class from .fields import ( OpenRosaFileRequestField, OpenRosaFormHubField, OpenRosaManifestURLField, OpenRosaMetaField, ) OpenRosaFormListResponse = inline_serializer_class( name='OpenRosa...
Python
1
Err(e) => { eprintln!("Destination Error -- {}: {}", sub_command.dest[0], e); return Err(()); } } } } } Ok(ParseResult { sub_command, flags }) } /// Sets up the environment based on given ...
Rust
0
"""Triangle I""" def find_mox(num1 , num2 , num3 ) : """max""" if num1 >= num2 and num1 >= num3 : return [num1 , 1] if num2 >= num1 and num2 >= num3 : return [num2 , 2] return [num3 , 3] def main() : """Triangle I""" wood1 = float(input()) wood2 = float(input()) wood3 = f...
Python
1
from perceptron import Perceptron from utils import load_dataset, plot_data, plot_decision_boundary import numpy as np from itertools import combinations from sklearn.metrics import accuracy_score, confusion_matrix # Load dataset dataset_path = "datasets/dataset.txt" # Define class indices based on dataset structure ...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models class ResCompany(models.Model): _inherit = 'res.company' def _get_countries_allowing_tax_representative(self): rslt = super()._get_countries_allowing_tax_representative() ...
Python
1
("Node {} Received vote request {}", node_id, request); let vote_response = process_vote_request( request, params.protected_node.clone(), params.raft_elections_administrator.clone(), ); let resp_result = { trace!("Node {} Sending response {}", node_id, vote_response); ...
Rust
0
categories=["small", "medium", "large"], ordered=True, ) data_factor, level_map, K = check_categorical(pd_cat_ordered) unique_levels = np.array(list(level_map["code_to_value"].values())) assert np.array_equal(unique_levels, np.array(["small", "medium", "large"])) asse...
Python
1
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.wait import WebDriverWait import os from dotenv import load_dotenv from abii_utils import AbiiUtils def main(): POSSIBLE_VALUES = ["1015", "Mental Math"] lo...
Python
1
ct in time")); }, c = NodeClient::connect(dst.clone()) => match c { Ok(c) => return Ok(c), // TODO: the error needs to be looked at in case it's not "Connection refused" Err(_) => continue, } }; } ...
Rust
0
se::from_thenable` to convert it into a true `Promise`. /// /// If the `input` isn't a Promise-like object then it returns `None`. /// /// # Examples /// /// Convert a Promise-like object to a `Promise`: /// /// ```rust /// // jQuery Promise /// Promise::from_thenable(&js!( retur...
Rust
0
100, 40, 28, 429, 13, 16, 7, 9, 130, 6, 11, 3, 4, 1, 5, 1, 167, 11, 12, 84, 56, 7, 3, 2, 10, 1, 1, 20, 10, 1, 22, 10, 2, 70, 30, 7, 3, 1]]}]} ''' if callback: callback = subscribe_callback_wrapper(callback) if gear_num is not None and price is not None: raise Exception('不能同时指定档位和价格') ...
Python
1
new(x, y)), } } } use crate::utils::{match_def_path, snippet_with_applicability, span_lint_and_sugg}; use if_chain::if_chain; use rustc::declare_lint_pass; use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; use rustc_session::de...
Rust
0
ng", "ŋ"); let str344 = &str343.replace("aŋ", "æŋ"); let str345 = &str344.replace("tiŋ", "ɾɪ̝̃ŋ"); let str346 = &str345.replace("iŋ", "ɪ̝̃ŋ"); let str347 = &str346.replace("oŋ", "ɔ̝̃ŋ"); let str348 = &str347.replace("ent ", "ənt "); let str349 = &str348.replace("ent.", "ənt."); let str350 = &str349...
Rust
0
#concession stand program menu = { "pizza":3.00, "nachos":4.50, "popcorn":6.00, "fries":2.50, "chips":1.00, "pretzels":3.50, "soda": 3.00, "lemonade":4.25} cart = [] total = 0 print("_____MENU_____") for key , value in menu.items(): print(f"{key:10}: ${...
Python
1
TSS_fcn = None T = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).astype(float) obs = np.array([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]).astype(float) settings = type( "Settings", (object,), { "segment_minimum_count": 2, "regularization_percent_lasso": 0.2, ...
Python
1
if self.are_equal((0, 0), (1, 1)) && self.are_equal((1, 1), (2, 2)) { self._set_won(0, 0); return; } // check right diagonal if self.are_equal((2, 0), (1, 1)) && self.are_equal((1, 1), (0, 2)) { self._set_won(2, 0); return; } if ...
Rust
0
es) -> TypeRef { types.get_for_type(&self) } } impl Typed for FPType { fn get_type(&self, types: &Types) -> TypeRef { types.fp(*self) } } impl<A, B> Typed for Either<A, B> where A: Typed, B: Typed, { fn get_type(&self, types: &Types) -> TypeRef { match self { ...
Rust
0
# Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copi...
Python
1
R, std::marker::PhantomData<&'a ()>); impl<'a> VideoReferenceSlotKHRBuilder<'a> { #[inline] pub fn new() -> VideoReferenceSlotKHRBuilder<'a> { VideoReferenceSlotKHRBuilder(Default::default(), std::marker::PhantomData) } #[inline] #[must_use] pub fn slot_index(mut self, slot_index: i8) ->...
Rust
0
/ neg response should have TTL of 59 seconds. let nx_error = lru.negative(name.clone(), 59, now); match nx_error.kind() { &ResolveErrorKind::NoRecordsFound { valid_until, .. } => { let valid_until = valid_until.expect("resolve error should have a deadline"); /...
Rust
0
import streamlit as st from transformer.app import AcademicTextHumanizer, NLP_GLOBAL, download_nltk_resources from nltk.tokenize import word_tokenize def main(): """ The `main` function sets up a Streamlit page for transforming user-provided text into a more formal academic style by expanding contraction...
Python
1
from pathlib import Path from PIL import Image, ImageDraw, ImageFont from nonebot.adapters.onebot.v11 import MessageSegment as ms from src.const.path import ( ASSETS, CACHE, build_path ) from src.utils.generate import get_uuid from src.utils.network import Request async def get_bulletin_img(msg: str, typ...
Python
1
enes2d.add(loader.scene), camera: loader.camera, spot_light: loader.spot_light, // Create simple user interface that will show some useful info. debug_text: TextBuilder::new(WidgetBuilder::new()) .build(&mut engine.user_interface.build_ctx()), ...
Rust
0
import argparse import logging import sys from clan_cli.profiler import profile from clan_app.app import ClanAppOptions, app_run log = logging.getLogger(__name__) @profile def main(argv: list[str] = sys.argv) -> int: parser = argparse.ArgumentParser(description="Clan App") parser.add_argument( "--c...
Python
1
(1, 1, Err(EFAULT)), (1, 2, Err(EFAULT)), (2, 0, Ok(data[2..].as_mut_ptr() as _)), (2, 1, Ok(data[2..].as_mut_ptr() as _)), (2, 2, Ok(data[2..].as_mut_ptr() as _)), (usize::MAX, 0, Err(EFAULT)), (0, usize::MAX, Err(EOVERFLOW)), ...
Rust
0
es; mod type_converter; pub use compute_pass::*; pub use render_context::*; pub use render_graph_runner::*; pub use render_pass::*; pub use render_resource_context::*; pub use renderer::*; use bevy_app::prelude::*; use bevy_ecs::prelude::*; use bevy_render2::{renderer::RenderResources, RenderStage}; use futures_lite:...
Rust
0
INITIALIZATION_FAILED: BUGCHECK_ERROR = 105u32; #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"] pub const LPC_INITIALIZATION_FAILED: BUGCHECK_ERROR = 106u32; #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"] pub const PROCESS1_INITIALIZATION_FAILED: BUGCHECK_ERROR = 107u32; #[doc...
Rust
0
ate_cfg) in conditionals .iter_mut() .filter(|(key, _)| engine.eval_expression::<bool>(key).unwrap_or_default()) { if let Some(mut extra_includes) = conditional_template_cfg.include.take() { let mut includes = template_cfg.include.unwrap_or_default(); includes.append(...
Rust
0
import enum import uuid import decimal import datetime from dataclasses import dataclass, asdict import pytz from tea import serde from tea import timestamp as ts class MyEnum(enum.Enum): foo = "foo" bar = "bar" @dataclass class DC: x: int y: str class Foo: def __init__(self, x, y): ...
Python
1
dispatch::builder::DispatcherBuilder; use res::*; use system::*; #[derive(Default)] struct Res(i32); struct Dummy(i32); impl<'a> System<'a> for Dummy { type SystemData = Write<'a, Res>; fn run(&mut self, mut data: Self::SystemData) { if self.0 == 4 { ...
Rust
0
) # 首尾部填充 img.paste(bkg, (0, 0)) img.paste(bkg, (0, image_height - 120)) idraw = ImageDraw.Draw(img) # 绘制标题栏与结尾栏 export_time = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime()) # 输出图片的时间,文件动态命名 list1 = [f"{self.title} - 节点拓扑分析", "版本:{} 总共耗时: {}s".format(__version__, ...
Python
1
for row in range(2): for column in range(7): print('@', end='') print()
Python
1
up(name='mygroup', description='My group') @my_group.command() async def my_command(interaction: discord.Interaction, arg: str, arg2: int) -> None: """Test slash command Parameters ---------- arg: str Description of arg. This is the second line of the ar...
Python
1
parallel_attn=True, bias=False, max_position_embeddings=2048, rope_theta=10000.0, rope_scaling=None, bos_token_id=11, eos_token_id=11, ffn_hidden_size=None, activation="gelu", **kwargs, ): self.vocab_size = vocab_size # B...
Python
1
import os import json import csv import io from typing import List from retrieve import initialize_chroma, search from embed import generate_embedding from summarize import call_llm_with_prompt from format_template import CARD_FORMAT_PROMPT, CARD_FORMAT_PROMPT_EN, ANKI_PROMPT def standardize_query_with_llm_anki(user_...
Python
1
#!/usr/bin/env python3 # --- Modules --- # import drawBot as dB from pathlib import Path import json from collections import defaultdict from random import shuffle # --- Constants --- # DICT_FOLDER = Path('dictionaries') MARGIN = 100 DRAFT_MODE = False PRECISION = 2 # --- Objects & Methods --- # def lineQualities(th...
Python
1
from evaluate_script.quantitative.removing.create_logs import manipulate_log as remove_enabled from evaluate_script.quantitative.changing.create_logs import manipulate_log as change_enabled from evaluate_script.quantitative.adding.add_enabled import manipulate_log as add_enabled_activities_to_events from evaluate_scrip...
Python
1
`. #[allow(non_snake_case)] pub fn musig<'k,T>(&'k self, t: T) -> MuSig<T,CommitStage<&'k Keypair>> where T: SigningTranscript+Clone { MuSig::new(self,t) } } /// Commitment stage for cosigner's `R` values #[allow(non_snake_case)] pub struct CommitStage<K: Borrow<Keypair>> { keypair: K, ...
Rust
0
_DELAY_3 } } #[doc = "Write proxy for field `XTALOSC_PWRUP_DELAY`"] pub struct XTALOSC_PWRUP_DELAY_W<'a> { w: &'a mut W, } impl<'a> XTALOSC_PWRUP_DELAY_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XTALOSC_PWRUP_DELAY_A) -> &'a mut W { { ...
Rust
0
from sqlmodel import Field, SQLModel from datetime import datetime, timezone from typing import Optional, Literal from uuid import UUID, uuid4 OrderStatus = Literal["initialized", "pending", "processing", "shipped", "delivered", "cancelled"] CartStatus = Literal["initialized", "pending", "paid", "cancelled", "complete...
Python
1
from findbigV import find_bigV if __name__ == "__main__": print(find_bigV("牡丹"))
Python
1
"] DCORSEL_1, #[doc = "DCO frequency range select: 2"] DCORSEL_2, #[doc = "DCO frequency range select: 3"] DCORSEL_3, #[doc = "DCO frequency range select: 4"] DCORSEL_4, #[doc = "DCO frequency range select: 5"] DCORSEL_5, #[doc = "DCO frequency range select: 6"] DCORSEL_6, ...
Rust
0
equal_rows5_float2() { const N: usize = 5; let c = vec![ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ]; let mut weights: WeightMatrix<f32> = WeightMatrix::from_row_vec(N, c.clone()); let matching = solv...
Rust
0