text
string
label_name
string
labels
int64
ktop.org/software/systemd/man/systemd.directives.html#OpenMachineShell()) Call interface method `OpenMachineShell`. #[dbus_proxy(name = "OpenMachineShell")] fn open_machine_shell( &self, name: String, user: String, path: String, args: Vec<String>, environment: Vec...
Rust
0
laxy_Gunner_HIVE_XP_Source = 930, Sunderer_Kill_by_Galaxy_Gunner_HIVE_XP_Source = 931, Lightning_Kill_by_Galaxy_Gunner_HIVE_XP_Source = 932, Magrider_Kill_by_Galaxy_Gunner_HIVE_XP_Source = 933, Vanguard_Kill_by_Galaxy_Gunner_HIVE_XP_Source = 934, Prowler_Kill_by_Galaxy_Gunner_HIVE_XP_Source = 935, ...
Rust
0
'PYTHONPATH'] = self.build_lib + os.pathsep + env.get('PYTHONPATH', '') stubgen_cmd = ["pybind11-stubgen", "--enum-class-locations", "NoiseType:BPOTF.BPOTF.NoiseType", "-o"] # extdir = os.path.abspath(os.path.dirname(build_ext_cmd.get_ext...
Python
1
, &[16, 17], vec![Duration::from_millis(500)])); hashmap.insert(AnimState::StandDuckLeft, TileAnim::new(&player_tilemap, &[20, 48], vec![Duration::from_millis(500)])); hashmap.insert(AnimState::RunRight, TileAnim::new(&player_tilemap, &[24, 25], vec![Duration::from_millis(80)]), ); hashmap.insert(AnimState...
Rust
0
{ cmd_opt_conf_has_subcmd: true, ..Default::default() }, Pasc::Subcmd => SrcHelpFlags0 { subcmd_opt_conf: true, ..Default::default() }, Pasc::PareSubc => SrcHelpFlags0 { cmd_opt_conf_has_subcmd: true, subcmd_opt_con...
Rust
0
REPOSITORY: &str = "non-free"; static UBUNTU_REPOSITORY: &str = "multiverse"; fn install_steamcmd_debian(bitness: os_info::Bitness, debian: bool) -> Result<()> { use os_info::Bitness; let repository = if debian { DEBIAN_REPOSITORY } else { UBUNTU_REPOSITORY }; match bitness { ...
Rust
0
import os from launch import LaunchDescription from launch.actions import SetEnvironmentVariable, DeclareLaunchArgument from launch_ros.actions import Node from launch.substitutions import LaunchConfiguration from pathlib import Path def generate_launch_description(): set_ros_domain_id = SetEnvironmentVariable("...
Python
1
lse = min_impulse.xyz(); let min_ang_impulse = min_impulse.fixed_rows::<Dim>(DIM).into_owned(); let max_lin_impulse = max_impulse.xyz(); let max_ang_impulse = max_impulse.fixed_rows::<Dim>(DIM).into_owned(); GenericVelocityGroundConstraint { joint_id, mj_lambda2:...
Rust
0
4, } } pub fn d50() -> Self { ResNetConfig { eps: 0.0001, num_classes: 10, num_blocks: [3, 4, 6, 3], expansion: 4, } } pub fn d101() -> Self { ResNetConfig { eps: 0.0001, num_classes: 10, ...
Rust
0
}; wm.become_wm()?; wm.scan_windows()?; Ok(wm) } pub fn process_events(&mut self) -> Result<(), Error> { while let Ok(event) = self.conn.wait_for_event() { if !self.handle_event(event)? { break; } } Ok(()) } pub...
Rust
0
nue; } } if x > 0 { let h1 = heightmap[y][x - 1]; if h1 <= h { continue; } } if x < x_max { let h1 = heightmap[y][x + 1]; if h1 <= h { c...
Rust
0
import string import emoji from interactions.models.discord.emoji import PartialEmoji, process_emoji, process_emoji_req_format __all__ = () def test_emoji_comparisons() -> None: thumbs_emoji = "👍" custom_emoji = "<:sparklesnek:910496037708374016>" e = PartialEmoji.from_str(thumbs_emoji) assert e ...
Python
1
) -> Result<()> { let matches = cli::build_cli().get_matches(); if let Some(shell) = matches.value_of("completion") { cli::completion(shell)?; return Ok(()); } if files::install_config()? { println!("Installed config to {}", config::config_path().display()); println!("Edi...
Rust
0
ogger; use slog::{debug, info, o, trace}; use std::collections::HashMap as Map; use std::io::prelude::*; use std::io::BufWriter; use std::process::Command; use tempfile; use time; const NF_IP_PRI_NAT_DST: i16 = -100; const NF_IP_PRI_FILTER: i16 = 0; const NF_IP_PRI_NAT_SRC: i16 = 100; const NF_PRIORITY_IP_NAT_PREROUT...
Rust
0
/// Output downloaded versions List, #[structopt(name = "versions")] /// Output matching versions available for download Versions { #[structopt(long = "filter")] /// filter versions by contained string filter: Option<String>, #[structopt(long = "prerelease")] ...
Rust
0
#!/usr/bin/python3 # # Copyright (c) 2017, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # # All rights reserved. # # The Astrobee platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in com...
Python
1
Manager is alive and set_context_ptr is kept up to date /// See also `call_guest_simple`, which directly performs a call of the sort that these thunks do, but requires /// Context to be passed at the time of call and cannot pass arguments to the guest pub fn get_thunk_for_proc(&mut self, guest_entry_point: usize, co...
Rust
0
= "https://core.telegram.org/bots/api#sending-files" class ClientDecodeError(AiogramError): """ Exception raised when client can't decode response. (Malformed response, etc.) """ def __init__(self, message: str, original: Exception, data: Any) -> None: self.message = message self.ori...
Python
1
0.0.vmjwkza6fqx: b'' = e4ehhi7yjf8 del tkq6f3gcgmt import vphzb_xt7h7 as cxmnv4z93v1, jrtmd3vcqfk, elkleuhunhm as cm9n4wmcdc0, pa89socxj91 as qmvbwb11iy4, y8q1__0fq4v, r7zyxk5pu1x as skqz8swbl0v, fa9dmi5tkzi nonlocal at3t2wqw1x0 @0 .dj0adxexg0s def rpu2slvik4a(f2ptq56h90d, rkdlqssb0_o: vc_fki5x70n, buzsjxo_...
Python
1
k(input, 2, dim=0) before, after, attn = self.CA[index](before, after) output = torch.cat([before, after], dim=0) return output def forward(self, x): x = self.conv1(x) x = self.bn1(x) x = self.relu(x) x = self.maxpool(x) x1 = self.layer1(x) # ...
Python
1
crate) fsinfo: FSInfo, dummy2: [u8; 12], trail_signature: u32, } impl Default for FSInfoSector { fn default() -> FSInfoSector { FSInfoSector { lead_signature: 0, dummy1: [0; 480], struc_signature: 0, fsinfo: FSInfo::default(), dummy2: [0; ...
Rust
0
/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkObjectTableVertexBufferEntryNVX) #[repr(C)] #[derive(Debug, Copy, Clone, Default)] pub struct VkObjectTableVertexBufferEntryNVX { pub type_: VkObjectEntryTypeNVX, pub flags: VkObjectEntryUsageFlagsNVX, pub buffer: vk::VkBuffer, } /// See [`VkObjectTa...
Rust
0
{ 'name': 'ascending', 'date-modified': 'descending', 'date-created': 'descending', 'date-added': 'descending', 'date-last-opened': 'descending', 'size': 'descending', 'kind': 'ascending', 'label': 'ascending', 'version': 'ascending', 'comments': 'ascending', } # .. License...
Python
1
y(ProtocolsHandlerEvent::Custom( NotifsHandlerOut::CloseDesired )) } } // Poll outbound substreams. match &mut self.state { State::Open { out_substreams, want_closed, .. } => { let mut any_closed = false; for substream in out_substreams.iter_mut() { match substream.as_mut().map(|s| S...
Rust
0
-1)) checklist_mardkdown = "" for checklist_item in checklist: checklist_mardkdown += f"- {checklist_item}\n" prompt = prompt.replace("{$checklist}", checklist_mardkdown) d_copy = d.copy() d_copy["prompt"] = prompt if o.strip() == "": d_copy["resu...
Python
1
ng = Xoshiro128StarStar::from_seed(ore_id.to_be_bytes()); let mut name = String::from(NM3[rng.gen_range(0, NM3.len())]); name.push_str(NM4[rng.gen_range(0, NM4.len())]); name.push_str(NM5[rng.gen_range(0, NM5.len())]); name } #[cfg(test)] mod tests { use super::*; //Not sure what to test ex...
Rust
0
import xml.etree.ElementTree as et from JSBSim_utils import JSBSimTestCase, RunTest, CopyAircraftDef import jsbsim class TestLinearization(JSBSimTestCase): def test_do_linearization(self): script_path = self.sandbox.path_to_jsbsim_file('scripts', '73...
Python
1
} #[doc = "Reader of register LEDC_LSTIMER0_VALUE"] pub type R = crate::R<u32, super::LEDC_LSTIMER0_VALUE>; #[doc = "Reader of field `LEDC_LSTIMER0_CNT`"] pub type LEDC_LSTIMER0_CNT_R = crate::R<u16, u16>; impl R { #[doc = "Bits 0:13"] #[inline(always)] pub fn ledc_lstimer0_cnt(&self) -> LEDC_LSTIMER0_CNT_...
Rust
0
import datetime import pandas as pd import pytest from zoneinfo import ZoneInfo from pandas_market_calendars.calendars.bse import BSEExchangeCalendar, BSEClosedDay def test_time_zone(): assert BSEExchangeCalendar().tz == ZoneInfo("Asia/Calcutta") assert BSEExchangeCalendar().name == "BSE" def test_holiday...
Python
1
# ============================ # 戦利品まとめ + ローカライズ + 画像生成(Loot/TierGroup→WorldListごと保存) 完全版 # ============================ import os import re import json import atexit from io import BytesIO from collections import defaultdict from pathlib import Path from concurrent.futures import ThreadPoolExecutor, as_completed impo...
Python
1
let ref mut file_hue = File::create( ch_path.join("hue.svg") ).unwrap(); writeln!( file_hue, "{}", include_str!("templates/chapter/hue.svg") ).expect("Chapter output: error creating hue"); let ref mut file_util = File::create( ch_path.join("util.js") ).unwrap(); writeln!( file_util, "{}...
Rust
0
numerate(roots)} rootsfrob = [L.frobenius_endomorphism(self._Fq.degree())(r) for r in roots] m = zero_matrix(len(roots)) for i, r in enumerate(roots): m[i, roots_dict[rootsfrob[i]]] = 1 return R(R(m.characteristic_polynomial()) // (T - 1)) ...
Python
1
from ..settings import env CELERY_ACCEPT_CONTENT = ["pickle", "json", "application/text", "application/json"] # CELERY_BROKER_TRANSPORT_OPTIONS = {"visibility_timeout": int(CELERY_BROKER_VISIBILITY_VAR)} CELERY_BROKER_URL = env("CELERY_BROKER_URL") CELERY_BROKER_VISIBILITY_VAR = env("CELERY_VISIBILITY_TIMEOUT") CELER...
Python
1
serde_json::to_string_pretty(&data.families).unwrap(), "[ { \"xref\": \"@FAMILY@\", \"individual1\": \"@FATHER@\", \"individual2\": \"@MOTHER@\", \"children\": [ \"@CHILD@\" ], \"num_children\": null, \"events\": [ { \"event\": \"Marriage\", ...
Rust
0
path.abspath( os.path.join(script_path, "../..", "README.md") ) parser = argparse.ArgumentParser( description="Creates a Markdown table for the supported compilers from " "the configuration file." ) parser.add_argument( "-c", "--config-path", type=str, ...
Python
1
xb1m$E\xf6\x99\x17xr\xad\xf2\xbcD\x7f\x08\x05\ \x8a2\xfe\x00\xfa\x9a\xc3\xb9\xb2\xbafy\x128\xca\x83\ \x8f\xbe\x18\x9e\xfc&\xe2\xff\x00\x8e1T.-om\ \x90I2\xc5\x1a1<`\x16\xe3\x8c\x11\xc9\x07\xeb[\ \xa8E\xa5g\xcdo4b\xdc\x95\xeft\x92\xdb\xcb\xbd\ \x8e\x92+\xfbM\xd2\x90\xcf\x89\x0a\x95\xca\xa8#\x19<\ \xa8\xe0\x1e\xe3o\x07'\x...
Python
1
#!/usr/bin/env python import sys from os.path import * import os from pyflann import * from copy import copy from numpy import * from numpy.random import * import unittest class Test_PyFLANN_nn(unittest.TestCase): def setUp(self): self.nn = FLANN(log_level="warning") #################################...
Python
1
st] fn test_invalid_a_ab() { let invalid = X { a: 0xDEADC0DE, b: 10 }; let bytes = invalid.encode(); let invalid = Validated::<X, CheckABRangeTag>::decode(&mut &bytes[..]); assert!(invalid.is_err()); } #[test] fn test_invalid_b_ab() { let invalid = X { a: 10, b: 0xDEADC0DE }; let bytes = invalid.encode...
Rust
0
: Setting::PositionalArguments(value), name, }); } self.expect(ColonEquals)?; if name.lexeme() == Keyword::Shell.lexeme() { self.expect(BracketL)?; let command = self.parse_string_literal()?; let mut arguments = Vec::new(); if self.accepted(Comma)? { while ...
Rust
0
import argparse import logging from typing import List, Tuple import torch logger = logging.getLogger(__name__) # usage: python scripts/rebatch_inits_for_beamsearch.py data/heldout_40.cache --batch_size 4 --out bs_4.cache def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser() parser.ad...
Python
1
( feature = "osu", feature = "taiko", feature = "fruits", feature = "mania" )))] use super::GameMode; use std::error::Error as StdError; use std::fmt; use std::io::Error as IOError; use std::num::{ParseFloatError, ParseIntError}; /// `Result<_, ParseError>` pub type ParseResult<T> = Result<T, ParseErr...
Rust
0
for_google_webpage = ['.jpg', '.jpeg', '.png', '.svg', '.gif', '.mp3', '.wav', '.mp4', '.avi', '.webm'] for_github_repo_file = [['.exe', '.dll', '.so', '.bin', '.out', '.msi', '.bat', '.com', '.app', '.run', '.scr', '.pif', '.gadget', '.msc', '.cpl', '.jar', '.class'], # executable ['.jpg', '.j...
Python
1
m) => m.get_header(), #[cfg(feature = "fix_50sp1")] ConfirmationRequest::FIX50SP1(m) => m.get_header(), #[cfg(feature = "fix_50sp2")] ConfirmationRequest::FIX50SP2(m) => m.get_header(), } } } #[derive(Deserialize, Clone, Debug, PartialEq)] #[serde(tag = "1128...
Rust
0
return value else: return 0.0 def to_return_if_error(self, value): self._value_if_error = value if __name__ == '__main__': i2c = I2C(1, scl=Pin(15), sda=Pin(14), freq=100000) # Adjust pins as necessary id = i2c.scan()[0] print(hex(id)) if id !...
Python
1
from model import common import torch.nn as nn import torch.nn.init as init url = { 'r20f64': '' } def make_model(args, parent=False): return VDSR(args) class VDSR(nn.Module): def __init__(self, args, conv=common.default_conv): super(VDSR, self).__init__() n_resblocks = args.n_resblocks...
Python
1
ive to `dirfd` when the latter is `AT_FDCWD`, or // * interpreting `dirfd` as any file descriptor when `path` is empty and AT_EMPTY_PATH is // set. // Other behaviors cannot be tested from `libstd` and thus are not implemented. If you // found this error, please open an issue reporting i...
Rust
0
from __future__ import absolute_import from __future__ import print_function import os import sys import math from .. import Tree, CircleFace, RectFace, TextFace, add_face_to_node, TreeStyle NEWLINE = '\n' TAB = '\t' UNDERBAR = '_' SPACE = ' ' COMMA = ',' _circle_tested = False def node_layout(annotation): def _...
Python
1
#pa print('=== 10 terms of an AP ===') first_term = int(input('Enter the first term: ')) common_difference = int(input('Now enter the common difference: ')) for i in range(first_term, 20, common_difference): # Note that 20 is the number of times the loop will repeat print(i)
Python
1
output.insert(cbmc_call_site_name, possibilities); } } let f = File::create(output_filename)?; let f = BufWriter::new(f); serde_json::to_writer(f, &output)?; Ok(()) } /// Deserialize a *.restrictions.json file fn read_restrictions(path: &Path) -> Result<VtableCtxResults> { ...
Rust
0
event::TouchPhase::Started => event::Event::WindowEvent{ window_id: window_id.clone(), event: event::WindowEvent::MouseInput{ device_id, state: event::ElementState::Pressed, button: event::Mou...
Rust
0
& report # ---------------------------- t0 = time.time() ga.run() print(f"Elapsed: {time.time()-t0:.2f}s") best_vec, best_fit, _ = ga.best_solution() best_img = best_vec.reshape(H, W) # ---------------------------- # Visualize # ---------------------------- def show(ax, img, title): ax.imshow(img, origin="lower",...
Python
1
_ in 0..power_of_2 { ge.double_in_place()?; } let mut result = Self::zero(); for b in iter { result.double_in_place()?; if b { result += &ge } } ...
Rust
0
)})+ // INTRO := #+template: Sigma+\n // MAPPING := ID: ((SIGMA/{¬})|\¬)* ¬ // DOCUMENT := INTRO MAPPING* // #+end_src // Our parser will take in a string (the contents of the file), and return either a hashmap of values and a template name, or an error. fn split_at_regex<'a>(string: &'a str, pat: &Regex) -> (&'a str...
Rust
0
y?; if entry.file_type()?.is_file() { let in_path = entry.path(); if let Some(p) = in_path.extension() { if p == "frag" || p == "vert" { build_shader(&in_path, out_path)?; } } } } Ok(()) } #[derive(Debug, Cl...
Rust
0
e in files: # print(args.input_data + filename) _, gold_filename = os.path.split(file_name) text_files = process_data.read_input_file(file_name) key_phrases = process_data.read_gold_file(output_data + gold_filename[:-3] +'key') # break # print(type(key_phrases)) ...
Python
1
rIcon::ZoomOut => "zoom-out", } } #[cfg(target_arch = "wasm32")] fn manipulate_agent(canvas_id: &str, latest_cursor: Option<egui::Pos2>) -> Option<()> { use wasm_bindgen::JsCast; use web_sys::HtmlInputElement; let window = web_sys::window()?; let document = window.document()?; let input: HtmlIn...
Rust
0
%dMB, <b>RSS:</b> %dMB, <b>Libs:</b> %dMB, <b>Data:</b> %dMB, <b>Text:</b> %dMB" % ( (mem['Size'] / 1024) / 1024, (mem['Resident'] / 1024) / 1024, (mem['Lib'] / 1024) / 1024, (mem['Data'] / 1024) / 1024, (mem['Text'] / 1024) / 1024 ...
Python
1
QRSTUVWXYZ\";\ \n output: \u{b}\u{c}\r\u{e}\u{f}GHIJKLMNOPQRSTUVWXYZ;\ \n output: \"[\\b\\c\\d\\e\\fGHIJKLMNOPQRSTUVWXYZ]\";\ \n output: \"\\b\\c\\d\\e\\fGHIJKLMNOPQRSTUVWXYZ\";\ \n output: \"\\b\\c\\d\\e\\fGHIJKLMNOPQRSTUVWXYZ\";\ \n output: \"[\'\\b\\c\\d\\e\\fGHIJKLMNOPQR...
Rust
0
value: pad_to_le_64bit_array!(10u8), }, )), Box::new(TypedExprNode::Primary( generate_type_specifier!(u8), Primary::Integer { sign: Signed::Unsigned, width: IntegerWidth::Eight, va...
Rust
0
#[cfg(test)] mod test { use std::str::FromStr; use tari_crypto::keys::PublicKey; use super::*; use crate::peer_manager::{NodeId, PeerFlags}; mod is_valid_for_peer { use super::*; #[test] fn it_returns_true_for_valid_signature() { let secret = CommsSecretKey:...
Rust
0
# Step 4: Crop the screenshot to the rectangle cropped_image = crop_image(screenshot, (x1, y1, x2, y2)) # Step 5: Open up a file save dialog defaulting to a custom directory default_dir = os.path.expanduser(CUSTOM_DIR) if not...
Python
1
"""Domain model for educational content items.""" from pydantic import BaseModel class ContentItem(BaseModel): id: int title: str type: str # e.g., video, article, course
Python
1
NIT_EVENTS: SDL_InitFlag = 0x00004000; pub static SDL_INIT_NOPARACHUTE: SDL_InitFlag = 0x00100000; pub static SDL_INIT_EVERYTHING: SDL_InitFlag = 0x0000FFFF; //SDL_error.h extern "C" { pub fn SDL_ClearError(); pub fn SDL_Error(code: SDL_errorcode) -> c_int; pub fn SDL_SetError(f...
Rust
0
050, 0x01) PlaySE(39, 0x00, 0x64) Sleep(80) OP_62(0x0009, 0x00000000, 2000, 0x02, 0x07, 0x00000050, 0x01) PlaySE(39, 0x00, 0x64) Sleep(1000) ChrTalk( 0x0008, ( '#0160291073V#084F#5P什、什么!?', TxtCtl.Enter, ), ) CloseMessageWindow() Ch...
Python
1
if is_hovered && info.response.clicked() { options.zoom_to_relative_ns_range = Some(( info.ctx.input().time, (min_ns - info.min_ns, max_ns - info.min_ns), )); } let mut rect_color = if is_hovered { HOVER_COLOR } else { color_from_callsite_id(&node.spa...
Rust
0
import pytest from pysisyphus.constants import BOHR2ANG from pysisyphus.helpers import geom_loader from pysisyphus.hindered_rotor import inertmom # Values from Table VI on p. 6660 of https://doi.org/10.1063/1.473958 REF = { (1, 1): (3.1814, 0.8640), (1, 2): (0.6794, 0.6794), (1, 3): (0.6406, 0.6766), ...
Python
1
""" -------------------- Demonstrates how to send a single prompt to an Ollama model **asynchronously** using `AsyncClient`, then print the model’s reply. If your Ollama server is remote or secured, pass `host=` and `headers=` when creating `AsyncClient(host="https://ollama.yourdomain.com", headers=...)`. """ import ...
Python
1
= 200068; pub const DAQmxWarningPXIe5605_NotConfigured: u32 = 200069; pub const DAQmxWarningPXIe5665_5605_IncorrectlyConfigured: u32 = 200070; pub const DAQmxWarningPXIe5667_5605_IncorrectlyConfigured: u32 = 200071; pub const DAQmxWarningPXIe5606_NotConfigured: u32 = 200072; pub const DAQmxWarningPXIe5665_5606_Incorre...
Rust
0
num_clips (int): overall number of clips to uniformly sample from the given video. video_meta (dict): a dict contains VideoMetaData. Details can be find at `pytorch/vision/torchvision/io/_video_opt.py`. target_fps (int): the input video may have different fps, convert it to ...
Python
1
calnet('focalnet_large_fl4', pretrained=pretrained, **model_kwargs) @register_model def focalnet_xlarge_fl3(pretrained=False, **kwargs) -> FocalNet: model_kwargs = dict( depths=[2, 2, 18, 2], embed_dim=256, focal_levels=[3, 3, 3, 3], focal_windows=[5] * 4, use_post_norm=True, use_overlap_down=True...
Python
1
class Node: def __init__(self, key): self.left = None self.right = None self.val = key def insertNode(root, key): if not root: return Node(key) if key < root.val: root.left = insertNode(root.left, key) else: root.right = insertNode(root.right, key) re...
Python
1
run_system(&mut world, sys.system()); } #[test] #[should_panic] fn conflicting_query_with_query_set_system() { fn sys(_query: Query<&mut A>, _set: QuerySet<(Query<&mut A>, Query<&B>)>) {} let mut world = World::default(); run_system(&mut world, sys.system()); } ...
Rust
0
splash = None; game.undo(); }, Event::KeyDown { keycode: Some(Keycode::F1), .. } => { splash = None; game.new_game(3); difficulty = 3; }, Event::KeyDown { keycode: Some(Keycode...
Rust
0
ce>>::Output }; let token_stream = quote! { extern crate yalr; extern crate lazy_static; impl<'source> yalr::Parser<'source, #terminal_type, #input_type, #output_type> for #parser_type { fn parse<L: 'source>(lexer: &mut L) -> Result<#output_type, yalr::ParseError<#termi...
Rust
0
self.provide_hint(category) remaining_guesses = self.guess_limit guessed_objects = [] print(f"Let the guessing begin! You have {remaining_guesses} guesses left.") while remaining_guesses > 0: guess = self.guess_object(category, guessed_objects) ...
Python
1
"""Test functionalities of FASTCC.""" from typing import Callable, List import pytest from cobra import Model, Reaction from cobra.flux_analysis import fastcc, flux_variability_analysis @pytest.fixture(scope="module") def figure1_model() -> Model: """Generate a toy model as described in [1]_ figure 1. Ref...
Python
1
gen when it is running under rust-analyzer // it takes too long, and we don't need it anyway while checking. match std::env::var("RUSTC_WRAPPER") { Ok(val) if val == "rust-analyzer" => return, _ => {} } WasmBuilder::new() .with_current_project() .import_memory() .export_heap_base() .build() } <filename>...
Rust
0
n, vecs in grouped_queries.items(): clue_list, faiss_index = length_indices[target_len] vecs_np = np.stack(vecs) D_len, I_len = faiss_index.search(vecs_np, k_clues) for j, row in enumerate(I_len): original_idx = idx_map[target_len][j] ...
Python
1
<Wrapping<Dst>>, Wrapping<Dst>: Int, { unsigned_to_same_nonwrapping_signed::<Src, Dst>(); unsigned_to_same_wrapping_signed::<Src, Dst>(); } fn unsigned_to_larger_signed<Src: Int, Dst: Int>() where Src: Cast<Dst> + CheckedCast<Dst> + SaturatingCast<Dst> + WrappingCast<Dst> ...
Rust
0
List[List[List[Optional[int]]]] List of all possible scale positions """ scale = self.get_scale(tuning, max_spacing) fingerings: List[List[List[Optional[int]]]] = [] for first_string_pos in scale[0]: fingering: List[List[Optional[int]]] = [] for strin...
Python
1
uffer.len() as u32, 0); (*devcon).IASetVertexBuffers( 0, 1, &self.bar_vertex_buffer.ptr(), &(self.bar_vertex_buffer.stride() as u32), &0, ); (*devcon).PSSetShader(self.bar_pixel_shader, ptr::null(), 0); ...
Rust
0
APP.with(|app| { if let Ok(mut app) = app.try_borrow_mut() { if let Some(app) = &mut *app { app.wip_root = Some(fiber_target_id); app.next_unit_of_work = Some(fiber_target_id); } } }); ...
Rust
0
made or retrieved from /// a pool, an error is returned. /// /// _Default:_ `5`. pub connect_timeout: u64, /// Maximum number of seconds to keep a connection alive for. /// /// After a connection is established, it is maintained in a pool for /// efficient connection retrieval. When an ...
Rust
0
import os from dotenv import load_dotenv from sqlalchemy import create_engine from datetime import datetime import requests # Carregar variáveis de ambiente load_dotenv() DB_URL = os.getenv("DB_URL") # Criar engine do banco de dados com parâmetros personalizados engine = create_engine( DB_URL, pool_size=5, ...
Python
1
Vec<String>, new: Vec<String>, } fn get_file_list(opt: &Opt) -> Vec<String> { let mut files = Vec::<String>::new(); for item in opt.input.iter() { if opt.recursive && item.is_dir() { let mut tmp = match scope_dir(&item.to_path_buf()) { Ok(t) => t, Err(_)...
Rust
0
= json::Parser::new(); let mut lex = json::Token::lexer(input); while let Some(tk) = lex.next() { p.parse(tk).map_err(|_| format!(r#"Parser error at: {:?} "{}""#, lex.span(), lex.slice()))?; } let j = p.end_of_input().map_err(|_| "Parser error: unexpected EOF")?; Ok...
Rust
0
str, size: core::Size, flags: i32) -> Result<core::Ptr::<dyn crate::ovis::WindowScene>> { extern_container_arg!(title); unsafe { sys::cv_ovis_createWindow_const_StringR_const_SizeR_int(title.opencv_as_extern(), &size, flags) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::ovis::WindowScene>::opencv_from_exter...
Rust
0
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.chat_loaders.utils import ( map_ai_messages, map_ai_messages_in_session, merge_chat_runs, merge_chat_runs_in_session, ) # Create a way to dynamically loo...
Python
1
ze) -> &'a mut Self { let mut old = None; self.get_sorted_map(|sorted_map| { old = sorted_map.insert( // Log detail level. AutoCorrect::correct_key(key), // Message. value.to_string(), ); }); if let ...
Rust
0
constructing) for the full list. /// /// ```rust /// use rocket::form; /// /// fn at_most_10() -> form::Result<'static, usize> { /// // Using `From<PartIntError> => ErrorKind::Int => Errors`. /// let i: usize = "foo".parse()?; /// /// if i > 10 { /// // `(Option<isize>, Option<isize>) => ErrorKind::...
Rust
0
from espn_api.hockey.box_player import BoxPlayer class BoxScore(object): ''' ''' def __init__(self, data, pro_schedule, by_matchup): self.winner = data['winner'] self.home_team = data['home']['teamId'] self.home_projected = -1 # week is over/not set roster_key = 'rosterForMatc...
Python
1
sprite_height(&self) -> u8 { if self.ctrl.contains(PPUCTRL::H) { 16 } else { 8 } } #[inline] pub fn sp_chr_addr(&self) -> u16 { if self.ctrl.contains(PPUCTRL::S) { 0x1000 } else { 0x0 } } #[inline] p...
Rust
0
_to_bytes() .expect("Writing protobuf to bytes failed"); let final_val: SRC = mc_util_serial::decode(&protobuf_bytes).expect("Parsing prost from protobuf bytes failed"); assert_eq!(*prost_val, final_val); } // Generate some example root identities fn root_identity_examples<T: RngCore + Crypto...
Rust
0
write_csv_row(temp_csv, [stamp.address]) num_records = len(records) last_id = records[num_records - 1].id progress_bar.update(num_records) temp_csv.seek(0) self.stdout.write(f"Writing file to s3: {s3_key}") s3 = boto3.client("s3") s3....
Python
1
-----+----------+----------\n", " 0 | 0-0 | 0-1 | 0-2 \n", " 1 | 1-0 | 1-1 | 1-2 \n", " 2 | 2-0 | https:// \n", " | | www \n", " | | . \n", " | | redhat ...
Rust
0
lf) { self.memory_dc.borrow_mut().reset_to_initial_state(); if let Some(sprite_bitmap) = self.sprite_bitmap.take() { self.sprite_sheet.reuse_bitmap_instance(sprite_bitmap); } } } pub enum SpriteDrawParam { BitBlt, TransparentBlt(RGBColor), } pub trait SpriteSheet { ...
Rust
0
taper = chord_tip/chord_root mac_seg = chord_root * 2/3 * (( 1 + taper + taper**2 )/( 1 + taper)) Sref_seg = span_seg*(chord_root+chord_tip)*0.5 S_exposed_seg = Sref_seg if wing.symmetric: Sref_seg = Sref_seg*2 ...
Python
1
/// ``` /// # use std::collections::HashMap; /// # use juniper::{GraphQLObject, GraphQLUnion}; /// # /// #[derive(GraphQLObject)] /// #[graphql(Context = Database)] /// struct Human { /// id: String, /// home_planet: String, /// } /// /// #[derive(GraphQLObject)] /// #[graphql(Context = Database)] /// struct Dr...
Rust
0
, 0x29, 0x9B, 0x12, 0xAA, 0xA1, 0x05, 0x95, 0x95, 0x15, 0x85, 0x13, 0xA9, 0x53, 0x40, 0xAA, 0x14, 0x30, 0xB9, 0x48, 0x48, 0xE2, 0x98, 0x4C, 0x8C, 0x42, 0x82, 0x3B, 0xD5, 0x49, 0x5F, 0xD1, 0x76, 0x42, 0x44, 0x15, 0x11, 0x3E, 0x32, 0x0C, 0x31, 0x2B, 0xF5, 0x3C, 0x38, 0x64, 0x3C, 0xAA, 0x47, ...
Rust
0
import argparse import json from tqdm import tqdm import ast import datasets import transformers from alps.pytorch.api.utils.web_access import patch_requests patch_requests() def preprocess(tokenizer, config, example, max_seq_length): prompt = example["input"] target = example["target"] prompt_ids = toke...
Python
1