text
string
label_name
string
labels
int64
e module on slot 1. Replace \ on temperature module on slot 3 and remove plate seal when complete.') # transfer triplicates for set in triplicate_sets: p300.pick_up_tip() p300.mix(mix_reps, 50, set[0].bottom(3)) p300.transfer(50, set[0].bottom(3), [well.bottom(3) f...
Python
1
ser.add_argument( '-n', '--lines', nargs='?', type=lambda x: int(x, 0), const=0, help="Show this many lines of history. 0 uses the terminal height. " "Defaults to 5.") parser.add_argument( '-z', '--cat', action='store_true', help="Pipe dire...
Python
1
st uint16_t, green: *const uint16_t, blue: *const uint16_t) -> c_int; pub fn SDL_GetWindowGammaRamp(window: *const SDL_Window, red: *const uint16_t, green: *const uint16_t, blue: *const uint16_t) -> c_int; pub fn SDL_DestroyWindow(window: *const SDL_Window); pub fn SDL_IsScreenSaverEnabled() -> SDL_bool; ...
Rust
0
0, -1)] { let mut row = square_cords.0 as i8 + m.0; let mut col = square_cords.1 as i8 + m.1; let mut square = board.board[row as usize][col as usize]; while is_empty(square) { row += m.0; col += m.1; square = board.board[row as usize][col as usize]; ...
Rust
0
<T>::OrgCreate(org))); }); Ok(Some(0).into()) } #[pallet::weight(10_000)] pub fn transfer_ownership( origin: OriginFor<T>, transfer_to: T::AccountId, key_source: InputKeySource<T::AccountId>, ) -> Dispat...
Rust
0
import torch import torch.nn as nn from torch import optim from model import LightGCN from config import config from dataloader import Loader from time import time import numpy as np from utils import BPRLoss, BPRTrain, NegLogLikelihoodLoss, Test, dimSearchTrain if __name__ == '__main__': # configuration devi...
Python
1
yourself, use [`profiler_ui`] instead. /// /// Returns `false` if the user closed the profile window. pub fn profiler_window(ctx: &egui::CtxRef) -> bool { puffin::profile_function!(); let mut open = true; egui::Window::new("Profiler") .default_size([1024.0, 600.0]) .open(&mut open) ...
Rust
0
on', 'off']: raise ValueError(f"Invalid value '{state}'. Expected 0, 1, 'on', or 'off'.") if state == 'on': state = 1 if state == 'off': state = 0 send_command( connection, command="usb_on+%s+" % state, verbose=True, is_silent=True ) def power_off(connection): """ Turn off the Instrument co...
Python
1
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import sys from os import path from typing import Any, Dict from sphinx.cmd.quickstart import QuickstartRenderer from sphinx.ext.apidoc import get_parser, main, recurse_tree, write_file from sphinx.locale import __ from sphinx.util import ensuredir def wr...
Python
1
import random from bidict import bidict def screen_to_game_coord(coord_mapping, pos): x, y = pos game_x = [coord_mapping[screen_pos] for screen_pos in coord_mapping if x in screen_pos][0] game_y = [coord_mapping[screen_pos] for screen_pos in coord_mapping if y in screen_pos][0] return game_x, game_y ...
Python
1
# # # 可视化 # # plt.figure(figsize=(6, 6)) # # plt.imshow(rgba_image) # # plt.axis('off') # 关闭坐标轴 # # plt.grid(True) # # plt.savefig(f'./img/299_gt.png') # for i in range(cav_num): # o...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.model import BaseRequest from lark_oapi.core.enum import HttpMethod, AccessTokenType class DeleteMailgroupRequest(BaseRequest): def __init__(self) -> None: super().__init__()...
Python
1
e, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS I...
Rust
0
bool { (*self) == (*other) } } impl ErlEq for Term { fn erl_eq(&self, other: &Term) -> bool { match (self, other) { (Term::BoundLambda { .. }, _) => unreachable!(), (_, Term::BoundLambda { .. }) => unreachable!(), (Term::ValueList(_), _) => unimplemented!(),...
Rust
0
'𞱴', '𑣂', '㎤', '㏧', 'ṝ', 'Ễ', '\u{1da22}', '𛰤', 'Პ', '𐾿', '🆍', 'ӟ', '𐜱', '\u{11d31}', '𓀀', '梨', '✐', '𐧖', '𘫊', 'Ჾ', '⩭', '𝠏', 'ಪ', '🚇', 'ഈ', '𐤘', '𘥇', '𝌎', '␂', 'ѯ', '𐎱', 'ꁪ', 'ᜟ', ';', '💾', '𓋎', 'ﱥ', '𒇄', 'ऻ', '🪧', 'घ', '𓀑', '𛰄', '𜽙', '𒓱', '𐼇', 'Я', '𝢸', 'ᖋ', '⦸', '𑋁', '�...
Rust
0
())); assert_eq!(circuit.x(i+1), Ok(())); } assert!(circuit.is_stabilizer_circuit()); assert_eq!(circuit.measure(55, 0), Ok(())); assert!(circuit.is_stabilizer_circuit()); assert_eq!(circuit.add_gate(CY::new(), &[99, 0]), Ok(())); assert!(circuit.is_stabiliz...
Rust
0
of the UUID structure. /// /// This determines the interpretation of the structure of the UUID. /// Currently only the RFC4122 variant is generated by this module. /// Callers should only trust the value returned by this method if they /// trust the UUID itself. /// /// # Examples /// ...
Rust
0
erers.get(&cid).cloned().unwrap_or_default(); if referers < 1 && pins < 1 { self.blocks.remove(&cid); let refs = self.refs.remove(&cid).unwrap(); for cid in &refs { self.add_referer(cid, -1); self.remove(cid); } } } } /...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'SMS gateway', 'version': '3.0', 'category': 'Hidden/Tools', 'summary': 'SMS Text Messaging', 'description': """ This module gives a framework for SMS text messaging ------------------------...
Python
1
# Atividade 08: # Média de Notas: # Desenvolva um programa que solicite as notas dos alunos até # que o usuário digite -1. Calcule e exiba a média das notas # inseridas. c = 0 n = 0 m = 0 while n >= 0: n = float(input('Insira a nota: ')) if n >= 0: c += 1 n += n else: print('A média das notas é ')
Python
1
se ndarray::{Array, arr1}; /// /// let array = Array::range(0., 5., 1.); /// assert!(array == arr1(&[0., 1., 2., 3., 4.])) /// ``` pub fn range(start: A, end: A, step: A) -> Self where A: Float, { Self::from_vec(to_vec(linspace::range(start, end, step))) } } /// ## Construct...
Rust
0
her(blake2_128_concat) T::KittyIndex => Option<T::KittyIndex>; // 记录某只猫的父母,因为猫可能没有父母,所以用 Option pub KittyParents get(fn kitty_parents):map hasher(blake2_128_concat) T::KittyIndex => Option<(T::KittyIndex, T::KittyIndex)>; // 记录某只猫的孩子们,第一个值是主猫,第二个是孩子,值也是孩子 pub KittyChildren get(fn kitty_children):double_map hash...
Rust
0
dil_path(dil_dir) #DIL.KANDIL = kandil_path('/var/dsource/scripts/kandil' if options.data: DIL.DATA = Path(options.data).normpath DIL.KANDIL = DIL.DATA/"kandil" DIL.KANDIL = kandil_path(DIL.KANDIL) # The version of Tango we're dealing with. VERSION = "" # Root of the Tango source code (either svn or zi...
Python
1
turns the antireverse of the motor impl_operator!(<S: BaseFloat> Not for Motor4<S> { fn not(q) -> Motor4<S> { Motor4::new( -q.rotor.v.x, -q.rotor.v.y, - q.rotor.v.z, -q.rotor.s, -q.screw.v.x, -q.screw.v.y, -q.screw.v.z, q.screw.s ) } }); /// Returns the negation of the ...
Rust
0
Found::Single(_) => Found::More, Found::More => Found::More, } }); a }); for (index, count) in options.iter().enumerate() { let value = (index + 1) as u8; if let Found::Single(cell) = ...
Rust
0
nion<f32> { (-lhs).into() } } } #[cfg(not(feature = "simd"))] impl_operator!(<S: BaseFloat> Mul<S> for Quaternion<S> { fn mul(lhs, rhs) -> Quaternion<S> { Quaternion::from_sv(lhs.s * rhs, lhs.v * rhs) } }); #[cfg(feature = "simd")] impl_operator_default!(<S: BaseFloat> Mul<S> f...
Rust
0
losses+=loss.item() total_loss.append(losses/len(train_loader)) if epoch%50==0: print("Epoch:", str(epoch+1), "\tLoss:", total_loss[-1]) return model def test_results(model, test_loader): model.eval() y_pred = [] y_obs = [] for idx, (x,y) in enumerate(test_loade...
Python
1
pository.get_group(StudentAndCourse, student_id, course_id) group.student_joins_course() self.repository.save(group) def leave_course(self, student_id: StudentID, course_id: CourseID) -> None: group = self.repository.get_group(StudentAndCourse, student_id, course_id) group.student_l...
Python
1
ep is a percentage value where 0.0 is 0% and 1.0 is 100%. 0% would /// return the `self` vector, 100% would return the `other` vector, and a /// value in the middle would return a vector in the middle. pub fn lerp(&self, other: Vector2, step: f64) -> Vector2 { return *self + (other - *self) * step; } } use serde_...
Rust
0
gc()) pub enum GC { /// Stops the garbage collector Stop = raw::LUA_GCSTOP, /// Restarts the garbage collector Restart = raw::LUA_GCRESTART, /// Performs a full garbage-collection cycle Collect = raw::LUA_GCCOLLECT, /// Returns the current amount of memory (in...
Rust
0
EGRESS_MAP_CKSUMV4: u32 = 8; pub const BPF_LD: u32 = 0; pub const BPF_LDX: u32 = 1; pub const BPF_ST: u32 = 2; pub const BPF_STX: u32 = 3; pub const BPF_ALU: u32 = 4; pub const BPF_JMP: u32 = 5; pub const BPF_RET: u32 = 6; pub const BPF_MISC: u32 = 7; pub const BPF_W: u32 = 0; pub const BPF_H: u32 = 8; pub const BPF_B:...
Rust
0
n), }) unique_speakers.add(cur_speaker) return self._relabel_speakers(segments, unique_speakers) def _relabel_speakers( self, segments: list[dict], unique_speakers: set[int], ) -> list[dict]: """ Make speaker labels contiguous (e.g., 0,1,2 instea...
Python
1
gtklogger.setWidgetName(button, label) gtklogger.connect(button, 'clicked', self.buttonCB, label) self.buttons[0].set_active(1) def buttonCB(self, button, which): if button.get_active(): for button, label in zip(self.buttons, self.labels): if label...
Python
1
/// # /// # async fn new() -> Result<Self, Self::Error> { /// # Ok(Self) /// # } /// # } /// # /// # #[tokio::main(flavor = "current_thread")] /// # async fn main() { /// MyWorld::cucumber() /// .fail_on_skipped() /// .run_and_exit("tests/features/read...
Rust
0
} } } #[test] fn test_simple() { let mut g: SimpleDigraph<(), ()> = SimpleDigraph::new(); let n1 = g.add_node(); let n2 = g.add_node(); let n3 = g.add_node(); let c1 = TriadicCensus::from(&g); assert_eq!(&[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], c1.as_slic...
Rust
0
_100, #[doc = "96 us"] _101, #[doc = "128 us"] _110, #[doc = "256 us"] _111, } impl CS_FWW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self { CS_FWW::_000 => 0, CS_FWW::_001 => 1, CS_FWW::_010...
Rust
0
: threshold as i64, } } /// Reseed the internal PRNG. fn reseed(&mut self) -> Result<(), Error> { R::from_rng(&mut self.reseeder).map(|result| { self.bytes_until_reseed = self.threshold; self.inner = result }) } #[inline(never)] fn reseed_and_gen...
Rust
0
com/en-us/windows/win32/controls/lvm-getemptytext) /// message parameters. /// /// Return type: `WinResult<()>`. #[cfg_attr(docsrs, doc(cfg(feature = "comctl")))] pub struct GetEmptyText<'a> { pub text: &'a mut WString, } unsafe impl<'a> MsgSend for GetEmptyText<'a> { type RetType = WinResult<()>; fn c...
Rust
0
::CustomButton; use crate::components::atoms::text_input::TextInput; use crate::User; use yew::prelude::*; #[derive(Default, Clone)] pub struct Data { pub username: String, pub favorite_language: String, } #[derive(Properties, PartialEq)] pub struct Props { pub onsubmit: Callback<Data>, } #[function_comp...
Rust
0
letedObject>, } impl PwDatabase { pub fn new() -> PwDatabase { PwDatabase { context: Box::new(Context::new()), data_cipher_uuid: PwUUID::zero(), compression_algorithm: PwCompressionAlgorithm::None, kdf_parameters: KdfParameters::new(PwUUID::zero()), ...
Rust
0
# # Copyright (C) 2023, Inria # GRAPHDECO research group, https://team.inria.fr/graphdeco # All rights reserved. # # This software is free for non-commercial, research and evaluation use # under the terms of the LICENSE.md file. # # For inquiries contact george.drettakis@inria.fr # from setuptools import setup from ...
Python
1
sD||||!jj}d|kr6|tS|SdS(Nt/(RXRNR(RRRtinet_str(RRR(s-/home/benjamin/tmp/Week8-UniDB/pg8000/core.pytinet_ins    ieitusert databaseii(RNR t_commands_with_countt ...
Python
1
""" poisson_reconstruct.py Fast Poisson Reconstruction in Python Copyright (c) 2014 Jack Doerner 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 ...
Python
1
act_person = "person to contact about rejecting" response = api_client.patch( f"/concepts/activities/activities/{activity_request.uid}/activity-request-rejections", json={ "contact_person": contact_person, "reason_for_rejecting": reason_for_rejecting, }, ) ass...
Python
1
#!/usr/bin/env python3 import feedparser import re def get_latest_stable_kernel_version_and_date(): # URL of the kernel.org RSS feed rss_url = "https://www.kernel.org/feeds/kdist.xml" # Parse the RSS feed feed = feedparser.parse(rss_url) # Iterate through the feed entries for entry in feed....
Python
1
dok = gradcheck( func, ( value.double(), shapes, level_start_index, sampling_locations.double(), attention_weights.double(), im2col_step, ), ) print(f"* {gradok} check_gradient_numerical(D={channels})") if __name_...
Python
1
calls]) return "tools" return END acting = ToolNode(tools) workflow = StateGraph(MessagesState) workflow.add_node("reasoning", reasoning) workflow.add_node("tools", acting) workflow.set_entry_point("reasoning") workflow.add_conditional_edges( "reasoning", check_for_tool_calls, ) workflow.add_...
Python
1
) -> js::BreakStatement { todo!() } } impl ToParseNode<js::ContinueStatement> for swc::ContinueStmt { fn to_parse_node(self) -> js::ContinueStatement { todo!() } } impl ToParseNode<js::IfStatement> for swc::IfStmt { fn to_parse_node(self) -> js::IfStatement { todo!() } } imp...
Rust
0
from .common import Manager class CmdManager(Manager): '''命令管理类 用于在已创建项目的节点中执行shell命令。 Attributes: user(str): 用户名 project(str): 项目名 ''' def __init__(self, user_name, project_name, backend_ip=None, backend_port=None): super().__init__(backend_ip, backend_por...
Python
1
None); for item_49 in var_48 { #[allow(unused_mut)] let mut entry_51 = list_50.entry(); entry_51.number( #[allow(clippy::useless_conversion)] smithy_types::Number::Float((*item_49).into()), ); } list_50.finish(); ...
Rust
0
import numpy from .ode_solver import * ''' continuous linear dynamical system dx = Ax + Bu y = Cx for solving runge kutta (RK4) is used A matrix, shape (n_states, n_states) B matrix, shape (n_states, n_inputs) C matrix, shape (n_outputs, n_states) x, system state, shape (n_states, 1) u, controll input, shape (n_i...
Python
1
or="hand2", font=("Helvetica", 14, "underline")) signup_link.grid(row=6, column=1, columnspan=2, pady=padding) signup_link.bind("<Button-1>", lambda e: show_signup()) # Create the signup frame signup_frame = tk.Frame(window, padx=global_margin) signup_frame.config(bg="#30365e") # Set signup frame background signup_l...
Python
1
let device_type = device.dwType; let name = raw_handle_to_name(device_handle); let hid_handle = match raw_name_to_hid(name.clone()) { Ok(handle) => handle, Err(_) => continue, }; let serial = get_serial_number(hid_handle); ...
Rust
0
Checking the minimum number of mutual neihborhood if n >= kddbscan.n { if n != 0 { inner_neighbors.push(point); } } let mut points: Vec<&PointWrapper<T>> = kddbscan.points.iter().map(|point| point).collect(); ...
Rust
0
type LPWSPSTRINGTOADDRESS = ::core::option::Option<unsafe extern "system" fn(addressstring: ::windows_sys::core::PCWSTR, addressfamily: i32, lpprotocolinfo: *const WSAPROTOCOL_INFOW, lpaddress: *mut SOCKADDR, lpaddresslength: *mut i32, lperrno: *mut i32) -> i32>; #[doc = "*Required features: `\"Win32_Networking_WinSock...
Rust
0
nota1=int(input("insira uma nota")) nota2=int(input("insira segunda nota")) nota3=int(input("insira terceira nota")) soma=nota1+nota2+nota3 media=soma/3 if media>=7: print("aluno está aprovado") elif media<7 and media>5: print("aluno está em recuperação") else: print("aluno reprovado")
Python
1
class AsyncCompletedEventHandler(MulticastDelegate,ICloneable,ISerializable): """ Represents the method that will handle the MethodNameCompleted event of an asynchronous operation. AsyncCompletedEventHandler(object: object,method: IntPtr) """ def BeginInvoke(self,sender,e,callback,object): """ BeginInvoke(se...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class CalendarEvent(models.Model): _inherit = 'calendar.event' @api.model def default_get(self, fields): if self.env.context.get('default_opportunity_id'): ...
Python
1
import re import sys import random random.seed(0) import numpy as np np.random.seed(0) import tensorflow as tf import tf_keras import onnx_graphsurgeon as gs from onnx2tf.utils.common_functions import ( get_constant_or_variable, print_node_info, inverted_operation_enable_disable, make_tf_node_info, ) fr...
Python
1
m disknum number of disc when multidisc support is used."] #[doc = " \\param gamever version of game"] #[doc = " \\param streaming flag to control audio streaming"] #[doc = " \\param streambufsize size of buffer used for audio streaming"] #[doc = " \\param pad[22] padding"] pub type dvddiskid = _dvddiskid; #[doc = " \\...
Rust
0
imm8 0x4516_0038,// EVEX_Vinserti32x4_ymm_k1z_ymm_xmmm128_imm8 0x4616_0038,// EVEX_Vinserti32x4_zmm_k1z_zmm_xmmm128_imm8 0x4556_0038,// EVEX_Vinserti64x2_ymm_k1z_ymm_xmmm128_imm8 0x4656_0038,// EVEX_Vinserti64x2_zmm_k1z_zmm_xmmm128_imm8 0x4516_0039,// VEX_Vextracti128_xmmm128_ymm_imm8 0x4516_0039,// EVEX_Vextract...
Rust
0
import sys import pytest # import robodm def test_import(): # each test runs on cwd to its temp dir import robodm def test_dataset_create(): import robodm dataset = robodm.Dataset( name="test_robodm", path="/tmp/test_robodm", ) def test_episode_create(): import robodm ...
Python
1
for i in 0..l { print!("{}{:?}: {:?}{}, ", color::Fg(color::LightWhite), i, self._surge_point_types[i], style::Reset); } print!("\n"); println!("---------------------------------------------------------------------------------"); println!("{} start state idxs: {:?}{}", co...
Rust
0
from PIL import Image import numpy as np import os def encrypt_image(input_image_path, output_image_path): # Open the image img = Image.open(input_image_path) img_array = np.array(img) # Perform pixel manipulation: shift pixel values encrypted_array = (img_array + 50) % 256 # Shift pixel values ...
Python
1
R"U[R5R X/S[R"X505UlUR$)NrVrer1rrD scalar_tensorr )rirrVs rM as_tensorSymNodeVariable.as_tensor[    #.44E''...
Python
1
%) - Avg: {avg_cpu:.2f}") logging.info(f"Memory Usage (%) - Avg: {avg_memory:.2f}") logging.info(f"Message Output (msg/sec) - Avg: {avg_output:.2f}") # Calculate per-core CPU usage averages if len(cpu_per_core_usage) > 0: per_core_avg = [np.mean(core) for core in cpu_per_core_usage] log...
Python
1
from .server import Server from .sobject import SObject, SObjectSerialized from topicsync.topic import Topic, IntTopic, SetTopic, DictTopic, StringTopic, ListTopic, GenericTopic, FloatTopic, EventTopic, BoolTopic from objectsync.topic import ObjListTopic, ObjSetTopic, ObjDictTopic, ObjTopic, WrappedTopic __all__ = ['S...
Python
1
# coding: utf-8 """ codebeamer swagger API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 3.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # no...
Python
1
ze": 4576, "url": "https://some.url.example.com", }, }, { "id": "Q2hhbXAtMTg3Mzc0Mw==", "label": "Quel est le numéro de la pièce que tu viens de saisir ?", "stringValue": "F9GFAL123", }, {...
Python
1
::new(CP437_F14, 8, 14, 256)), "IBM EGA43 895" => Ok(Font::new(CP437_F08, 8, 8, 256)), "IBM VGA 991" => Ok(Font::new(CP437_F16, 8, 16, 256)), "IBM VGA50 991" => Ok(Font::new(CP437_F08, 8, 8, 256)), "IBM VGA25G 991" => Ok(Font::new(CP437_F19, 8, 19, 256)), "IBM...
Rust
0
Keyword::Import => "import", Keyword::As => "as", Keyword::From => "from", Keyword::Export => "export", Keyword::Fun => "fun", Keyword::Return => "return", Keyword::If => "if", Keyword::Else => "else", Keyword::While => "while", Keyword::Break => "break", Keyw...
Rust
0
from db_manager import DBManager import logging import time from datetime import datetime from sqlalchemy import text def setup_example_authors(): """Add example authors to the database""" db = DBManager() example_authors = [ { "name": "Ciprian Dobre", "source": "dblp",...
Python
1
sampled_points (torch.Tensor): Sampled points from triangles (N x 3). vertices (torch.Tensor): The vertex positions (V x 3). faces (torch.Tensor): The indices of the vertices that make up each triangle (F x 3). nearest_triangles (torch.Tensor): Indices of the k-nearest triangle...
Python
1
import os import h5py import hydra import copy import numpy as np from PIL import Image import utils.io as io from grit_paths import GritPaths @hydra.main(config_path='configs',config_name='default') def main(cfg): if cfg.subsets_to_distort is not None: subsets_to_distort = cfg.subsets_to_distort else...
Python
1
import functools from app import logger class Marker: def __init__(self, ra, dec, frame): self.ra = ra self.dec = dec self.frame = frame self.x, self.y = frame.get_xy(ra, dec) def within_box(self): return 0 <= self.x <= 1 and 0 <= self.y <= 1 def draw(self, svg, op...
Python
1
s.append(center) else: right_eye_glints.append(center) cv2.circle(results['combined_glints_img'], center, int(radius), (0, 255, 0), 2) # Green real_glints.append(center) # Add to real glints list elif contour_area > 80...
Python
1
* Fixed layer allocation */ opj_tcd_rateallocate_fixed(p_tcd); /*(/ 8)*/ } /* (%8) */ return 1 as libc::c_int; } #[no_mangle] pub unsafe extern "C" fn opj_tcd_copy_tile_data( mut p_tcd: *mut opj_tcd_t, mut p_src: *mut OPJ_BYTE, mut p_src_length: OPJ_SIZE_T, ) -> OPJ_BOOL { let mut i: OPJ_UINT32 = 0; l...
Rust
0
""" Progress Models This module exports progress-related models. """ from app.models.health_fitness.progress.progress_tracking import ( Progress, ProgressGoal, HealthFitnessProgressNote ) __all__ = [ 'Progress', 'ProgressGoal', 'HealthFitnessProgressNote' ]
Python
1
!(arm); diff!(exp_level); diff!(exp); diff!(hungry_level); res } pub fn merge(&mut self, new_stat: PlayerStatus) -> PlayerStatus { let res = self.diff(&new_stat); *self = new_stat; res } pub fn have_enough_hp(&self) -> bool { let threshold ...
Rust
0
indow() def _loc_41E7(): pass label('loc_41E7') Jump('loc_489F') def _loc_41EA(): pass label('loc_41EA') If( ( (Expr.TestScenaFlags, ScenaFlag(0x0085, 5, 0x42D)), Expr.Return, ), 'loc_433F', ) If( ( (Expr.TestScen...
Python
1
import feedparser from yarl import URL from cloudbot import hook from cloudbot.util import formatting, web class FeedAlias: def __init__(self, url, limit=3): self.url = url self.limit = limit ALIASES: dict[str, FeedAlias] = { "xkcd": FeedAlias("http://xkcd.com/rss.xml"), "ars": FeedAlia...
Python
1
(10, 10) } pub fn is_bit_on(val: u16, position_to_check: u8) -> bool { (val >> position_to_check) & 1 == 1 } pub fn flip_bit(val: u16, position_to_flip: u8) -> u16 { val ^ (1 << position_to_flip) } fn possible_values_for_cell(board: Board, coordinates: CellCoordinates) ...
Rust
0
} free((*g).gd as *mut libc::c_void); } free((*g).used_slot as *mut libc::c_void); free(g as *mut libc::c_void); }; } #[inline] unsafe extern "C" fn glyf_cmp(mut v1: *const libc::c_void, mut v2: *const libc::c_void) -> i32 { let mut cmp: i32 = 0i32; let mut sv1: *const tt...
Rust
0
timestamp_f: ::prost::alloc::vec::Vec<super::q::Timestamp>, #[prost(message, repeated, tag = "8")] pub month_f: ::prost::alloc::vec::Vec<super::q::Month>, #[prost(message, repeated, tag = "9")] pub date_f: ::prost::alloc::vec::Vec<super::q::Date>, #[prost(message, repeated, tag = "10")] pub dat...
Rust
0
# Импортируем библиотеки from datetime import datetime, date, timedelta import spacetrack.operators as op from spacetrack import SpaceTrackClient from pyorbital.orbital import Orbital import numpy as np import matplotlib.pyplot as plt USERNAME = '*************************' PASSWORD = '*************************' # Сре...
Python
1
orm PackActionData(ConvertPackActionData), /// From packed to json action data form UnpackActionData(ConvertUnpackActionData), } /// From plain signed json to packed form #[derive(StructOpt, Debug)] pub struct ConvertPackTransaction { /// The plain signed json pub transaction: String, /// Pack ...
Rust
0
f| f) // } // } // Test that attempt to move `&mut` pointer while pointee is borrowed // yields an error. // // Example from src/middle/borrowck/doc.rs use std::util::swap; fn foo(t0: &mut int) { let p: &int = &*t0; // Freezes `*t0` let t1 = t0; //~ ERROR cannot move out of `t0` *t1 = 22; } fn...
Rust
0
from enum import Enum from typing import List from .prompt_builder import Prompt, Role, prompt_builder class SystemPrompts(Enum): itinerary = """You are a seasoned local guide of a trip's location, and you are asked to create an itinerary of events, given an arrival time and departure time, hotel location, and t...
Python
1
fn tpm_no_getek_function_fail() { let hsm_tpm = fake_no_if_tpm_hsm(); let result = hsm_tpm.get_ek().unwrap(); println!("You should never see this print {:?}", result); } #[test] #[should_panic(expected = "HSM API Not Implemented")] fn tpm_no_getsrk_function_fail() { ...
Rust
0
# 記錄恢復事件 self._log_disaster_event("recovery_successful", { "recovery_time": recovery_time.total_seconds(), "rto_compliance": self.recovery_stats["last_recovery_time"] <= self.rto, }) def _handle_recovery_failure(self) -> None: """處理恢復失敗""" logger.c...
Python
1
"] pub struct PWM_0_FLTSTAT0_FAULT3R { bits: bool, } impl PWM_0_FLTSTAT0_FAULT3R { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) ...
Rust
0
labelAlignment ) # The following is a workaround for a Qt bug. If addWidth()'s # <alignment> argument is not supplied, the widget spans the full # column width of the grid cell containing it. If <alignment> # is supplied, this desired behavior is lost and there is no ...
Python
1
# cloning2 (pyStage, converted from Scratch 3) from pystage.en import Sprite, Stage stage = Stage() stage.add_backdrop('backdrop1') stage.create_variable('my variable', 0) dinosaur1 = stage.add_a_sprite(None) dinosaur1.set_name("Dinosaur1") dinosaur1.set_x(49) dinosaur1.set_y(-5) dinosaur1.go_to_back_layer() dinosaur...
Python
1
from uuid import UUID from fastapi import BackgroundTasks, Depends from src.api.submenu.crud_repo import SubMenuCRUDRepo from src.caching.cache_repo import CacheRepo from src.model_definitions.models import SubMenu from src.schemas.submenu_schemas import SubMenuInput class SubMenuServiceRepo: """Service репозит...
Python
1
import hashlib, json, pathlib def sha256(p: pathlib.Path) -> str: return "sha256:" + hashlib.sha256(p.read_bytes()).hexdigest() def test_schema_locked(): root = pathlib.Path(__file__).resolve().parents[1] lock = json.loads((root/"schemas/schema_lock.json").read_text()) path = root/"schemas/company_sch...
Python
1
StateKey::Active)?; } _ => { return Err(E::custom(format!("Unable to parse AnimStateKey from {}", key_id))); } } } keys.sort(); Ok(AnimState { keys }) } } fn add_if_not_already_present<E: de::Err...
Rust
0
red.size(0) # 1. assign -1 by default assigned_gt_inds = bbox_pred.new_full((num_bboxes, ), -1, dtype=torch.long) assigned_labels = bbox_pred.new_full((num_bboxes, ), ...
Python
1
t(" ❌ Component path inconsistency detected") return False return True except Exception as e: print(f" ❌ Integration test failed: {e}") return False def test_requirements_availability(): """Test that all new requirements are available""" print("\n🔍 T...
Python
1
EADY_STOPPED) .to_str() .unwrap() }); #[doc(alias = "NM_DBUS_VPN_BAD_ARGUMENTS")] pub static DBUS_VPN_BAD_ARGUMENTS: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe { CStr::from_ptr(ffi::NM_DBUS_VPN_BAD_ARGUMENTS) .to_str() .unwr...
Rust
0
import logging import math _log = logging.getLogger(__name__) import cairocffi as cairo import geotiler def draw_track(track, bounds): """ Draws the given tracks with the given bounds onto a cairo surface. """ _log.info("Drawing track") mm = geotiler.Map(extent=bounds, zoom=14) width, height = mm....
Python
1