text
string
label_name
string
labels
int64
print_layout(); verbose!("m_protect flag: {:?}", flags); match locked_inner.layout.modify_access(addr.into(), len, flags, grow_up, grow_down) { Some(_) => { // locked_inner.layout.print_layout(); 0 }, None => { locked_inner.recv_signal(crate::process::...
Rust
0
import os import logging as log from cosalib.cmdlib import runcmd from cosalib.qemuvariants import QemuVariantImage class KubeVirtImage(QemuVariantImage): """ KubeVirtImage uses QemuVariantImage to create a normal qcow2 image. This image is then wrapped into an ociarchive as final build artifact which ...
Python
1
op_x(op) }, (0xF, _, 0x1, 0xE) => Opcode::ADDIVx{ x: op_x(op) }, (0xF, _, 0x2, 0x9) => Opcode::LDFVx{ x: op_x(op) }, (0xF, _, 0x3, 0x3) => Opcode::LDBVx{ x: op_x(op) }, (0xF, _, 0x5, 0x5) => Opcode::LDIVx{ x: op_x(op) }, (0xF, _, 0x6, 0x5) => Opcode::LDVxI{ x: op_x(op) ...
Rust
0
# Copyright 2011 Raphaël Valyi, Renato Lima, Guewen Baconnier, Sodexis # Copyright 2017 Akretion (http://www.akretion.com) # Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com> # Copyright 2020 Hibou Corp. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import _, api, fields, mod...
Python
1
et client = TcpStream::connect(addr).await.unwrap(); let mut client_config = ClientConfig::new(); client_config .dangerous() .set_certificate_verifier(Arc::new(TestVerifier {})); let connector = TlsConnector::from(Arc::new(client_config)); let domain = DNSNameRe...
Rust
0
# Copyright 2020 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
errideMiddleware<InnerService> where InnerService: Service<Request<Body>>, { type Response = InnerService::Response; type Error = InnerService::Error; type Future = InnerService::Future; fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { self.inner_service.pol...
Rust
0
ers_fixed[3][1])]]) rect = cv2.minAreaRect(cnt) longSide_inf = minAreaRect2longSideFormat(rect) angle = longSide_inf[-1] all_info.append(angle) new_boxes.append(",".join([str(x) for x in all_info])) labelout = str(classes...
Python
1
box: gtk::Box, } enum AppMsg { Increment, Decrement, ShowComp2, ShowComp1, } struct AppModel { counter: u8, } impl Model for AppModel { type Msg = AppMsg; type Widgets = AppWidgets; type Components = AppComponents; } impl Widgets<AppModel, ()> for AppWidgets { type Root = gtk::Ap...
Rust
0
emoji = get_next_emoji() subprocess.run(f'ffmpeg -i "{filename}" -ss 00:00:02 -vframes 1 "{filename}.jpg"', shell=True) await prog.delete (True) reply = await m.reply_text(f"**Uploading ...** - `{name}`") try: if thumb == "no": thumbnail = f"{filename}.jpg" ...
Python
1
]) -> [Card; Hand::HAND_SIZE] { for card in all_cards { if !main_cards.contains(card) { main_cards.push(*card); } } main_cards[..Hand::HAND_SIZE].try_into().unwrap() } fn find_high_card(cards: &Cards) -> Hand { Hand { hand_type: HighCard, cards: cards[..Hand:...
Rust
0
import time from qsprpred.extra.utils.parallel import DaskJITGenerator from qsprpred.utils.parallel import batched_generator from qsprpred.utils.testing.base import QSPRTestCase class TestDaskGenerator(QSPRTestCase): @staticmethod def func(x): time.sleep(1) return x ** 2 @staticmethod ...
Python
1
operty_action_group(&self) -> Option<gio::ActionGroup>; fn get_property_pad(&self) -> Option<gdk::Device>; fn connect_property_action_group_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_property_pad_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; } impl<O: Is...
Rust
0
else: final_cross_section_centers = None final_cross_section_centers = comm.bcast(final_cross_section_centers, root=0) # Assign cross-section center based on the rank cross_section_center_choosen = assign_section(rank, ranks_per_section, final_cross_section_centers) # Calculate radial, theta...
Python
1
s_library = metadata_pkg.is_library(); let rows = conn.query( "INSERT INTO releases ( crate_id, version, release_time, dependencies, target_name, yanked, build_status, rustdoc_status, test_status, license, repository_url, homepage_url, description, descriptio...
Rust
0
""" Engine classes for :func:`~pandas.eval` """ from __future__ import annotations import abc from typing import TYPE_CHECKING from pandas.errors import NumExprClobberingError from pandas.core.computation.align import ( align_terms, reconstruct_object, ) from pandas.core.computation.ops import ( MATHOPS,...
Python
1
== 1).all() assert mask.all() assert crop_transformation.is_close(expected_transformation, 0.001, 0.001) def test_apply_division_to_image() -> None: rng = np.random.default_rng(42) division = np.arange(5 * 5).reshape(5, 5) + 1 division = np.repeat(division, 4, axis=0) division = np.repeat(div...
Python
1
**self._DEFAULT_MAIN_KWARGS, # pyright: ignore[reportArgumentType] ) # Calculate expected number of subprocess calls num_experiments = len(experiments.split(",")) expected_calls = num_experiments * 2 if sweep else num_experiments # Assert subprocess.run was called the...
Python
1
} fn add(&mut self, branch: Branch) { self.branches.push(branch); } } impl fmt::Display for Detail { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if let Some(score) = self.score { write!(f, "CVSSv3={:1.1} ", score)?; } let b: Vec<&str> = self....
Rust
0
.await, ); } Ok(()) } #[cfg(test)] mod tests { use super::*; #[tokio::test] async fn load_url() { let url = "https://www.youtube.com/watch?v=rvkxtVkvawc"; input::ytdl(&url).await.unwrap(); } } <reponame>cjordan/rust-fitsio use fitsio::FitsFile; #[test] fn te...
Rust
0
_filters, list): for custom_filter in custom_filters: env.filters[custom_filter.__name__] = custom_filter if context is not None: this_template = env.get_template(template_name) return this_template.render(**context) else: def wrap(f): def wrapped_f(*args...
Python
1
from collections import Counter with open('input') as f: lines = [x.strip() for x in f.readlines()] def update(d): new_d = {} for (x, y), t in d.items(): adjacent = [d[(x + dx, y + dy)] for dx in (-1, 0, 1) for dy in (-1, 0, 1) if (dx != 0 or dy != 0) and (x + dx, y + dy) in d...
Python
1
_initialized() { return false; } }; true } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { while !is.eof()? { let (field_number, wire_type) = is.read_tag_unpack()?; match field_number...
Rust
0
], }, #[cfg(feature = "bg")] crate::Annotation { lang: "bg", tts: Some("Широко усмихнато лице с усмихнати очи"), keywords: &[ "Широко усмихнато лице с усмихнати очи", "лице", "отворен", "усмивка...
Rust
0
on_x) vision_x = rearrange(vision_x, "(b T) d -> b T d", b=B, T=n * S) embedding_weight = torch.cat([self.weight, self.figure_token_weight], dim=0) embedding_weight = embedding_weight.unsqueeze(0).repeat(B, 1, 1) embedding_weight = torch.cat([embedding_weight, vision_x],...
Python
1
t_eq!(si.index.len(), 2); prop_assert_eq!(si.index[0].key, si.index[1].key); prop_assert_eq!(si.index[0].offset, si.index[1].offset); prop_assert_eq!(si.index[0].offset, 0); } } proptest! { #![proptest_config(Config::with_cases(1000))] #[test] ...
Rust
0
, pub data_in: Vec<u8>, } #[derive(Serialize, Deserialize, PartialEq, Debug)] pub struct DeviceDocmdresp { pub error: DeviceErrorcode, pub data_out: Vec<u8>, } #[derive(Serialize, Deserialize, PartialEq, Debug)] pub enum DeviceAsyncRequest { V1(DeviceAsyncRequestV1), } #[derive(Serialize, Deserialize...
Rust
0
} } } #[cfg(test)] mod test { use crate::multi_thread::algo_1116::ZeroEvenOdd; use std::sync::Arc; use std::thread; #[test] fn test_zero_even_odd() { let zero_even_odd_base = Arc::new(ZeroEvenOdd::new(4)); let zero_even_odd = Arc::clone(&zero_even_odd_base); let han...
Rust
0
tUser, _new: CurrentUser) { info!("[user_update]"); } async fn unknown(&self, _ctx: Context, name: String, _raw: serde_json::Value) { info!("[unknown]: {}", name); } } async fn is_join_event(ctx: &Context, old: &Option<VoiceState>, new_state: &VoiceState) -> bool { // If there is no ne...
Rust
0
dlsdnv_k = dlsdnvk_fn(scWl0=scWl_opt[k,:],nv0=Tl_opt[k,:],Wl0_next=scWl_opt[k+1,:],nv0_next=Tl_opt[k+1,:],Wl0_prev=scWl_opt[k-1,:],nv0_prev=Tl_opt[k-1,:])['dlsdnvk_f'].full() dlsdw += dlsdWl_k@scWl_grad[k] + dlsdnv_k@nv_grad[k] else: dlsdWl_N = dlsdWlN_fn(scWl0=s...
Python
1
e_path2, image_path1]: # [database, query] view_idx_splits = view_path.split('/') color_image = imread_cv2(view_path) intrinsics = self.params_dict[view_path]['intrinsics'].astype(np.float32) pose = self.params_dict[view_path]['pose_c2w'].astype(np.float32) ...
Python
1
} pub fn get_cell(&mut self, address: usize) -> u32 { if self.current_replay >= self.replays.len() { panic!("get_cell(0x{:x}) faled, current replay: {}, total replays: {}", address, self.current_replay+1, self.replays.len()); } let replay: &mut ReplayRecord = &mut self.replays[self.curren...
Rust
0
stm32f398"))] tim1_ext1!(); #[cfg(any( feature = "stm32f302xb", feature = "stm32f302xc", feature = "stm32f302xd", feature = "stm32f302xe", feature = "stm32f303xb", feature = "stm32f303xc", feature = "stm32f303xd", feature = "stm32f303xe", feature = "stm32f358", feature = "stm32f...
Rust
0
import random import uuid import pytest from remnawave.models import ( CreateUserHwidDeviceRequestDto, DeleteUserHwidDeviceRequestDto, CreateUserHwidDeviceResponseDto, DeleteUserHwidDeviceResponseDto, GetUserHwidDevicesResponseDto, ) from tests.conftest import REMNAWAVE_USER_UUID new_hwid = str(u...
Python
1
is not `account`. /// Returns with `MissingRole` error if `account` doesn't have `role`. #[ink(message)] fn renounce_role(&mut self, role: RoleType, account: AccountId) -> Result<(), AccessControlError> { if Self::env().caller() != account { return Err(AccessControlError::InvalidCaller)...
Rust
0
_stats, 4), parse_number!(dist_stats, 5), parse_number!(dist_stats, 6), parse_number!(dist_stats, 7), parse_number!(dist_stats, 8), parse_number!(dist_stats, 9), parse_number!(dist_stats, 10), *timestamp, ) } pub fn sec...
Rust
0
from django.contrib import admin from .models import CourseModel #注册Course模型,这样在admin后台管理页面就可以看到Course模型,并对其进行增删改查操作 @admin.register(CourseModel) # 使用装饰器注册Course模型 class CourseAdmin(admin.ModelAdmin): list_display = ['name', 'introduction', 'teacher', 'price'] # 显示的字段 search_fields = list_display # 搜索的字段 ...
Python
1
query_type = 0 else: query_type = int(rtype + 1) try: await CallbackQuery.answer(_["playcb_2"]) except: pass title, duration_min, thumbnail, vidid = await YouTube.slider(query, query_type) buttons = slider_markup(_, vidid, user_id, query, qu...
Python
1
import pygame from sys import exit from matrix import Matrix from pathfinder import Pathfinder pygame.init() height , width = 1280,736 screen = pygame.display.set_mode((height,width)) clock = pygame.time....
Python
1
elete_func: &F) where F: Fn(&Uuid) -> (), { (*on_delete_func)(this_id); self.remove_parent(this_id); self.nodes.remove(this_id); } //Nodeを削除する(再帰的にchildNodeも削除する) pub fn delete_node_recursive_call<F>(&mut self, this_id: &Uuid, on_delete_func: &F) where F: ...
Rust
0
Vec<(Term, TXID)> { let mut ret = vec![]; for (txid, learned) in self.committed.iter() { ret.push((learned.term, *txid)); } ret } } <reponame>voidxnull/fawkes-crypto pub mod ethereum; pub mod near; pub mod prover; pub mod verifier; use std::{cell::RefCell, mem::transmut...
Rust
0
ht, 0x14F => ViziaCode::End, 0x150 => ViziaCode::ArrowDown, 0x151 => ViziaCode::PageDown, 0x152 => ViziaCode::Insert, 0x153 => ViziaCode::Delete, 0x15B => ViziaCode::MetaLeft, 0x15C => ViziaCode::MetaRight, 0x15D => ViziaCode::ContextMenu, 0x15E =>...
Rust
0
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
Python
1
eport's name, date, and the exchange it was released on. Returns: [ { "trading_symbol": "NG", "short_name": "Natural Gas (NG)" } ] """ return self.api.get(COMMITMENT_OF_TRADERS_REPORT_ENDPOINT) def cik_list(self): """P...
Python
1
) }; if let TranslationLevel::Level3 = level { table3.entries[index3].fetch_or(PageEntry::ACCESSED, Ordering::AcqRel); invalidate_tlb(addr, root.asid); return; } } } } <gh_stars>0 #![unstable( feature = "geobacter", reason = "WI...
Rust
0
st: &HttpRequest ) -> Box<dyn Future<Item=HttpResponse, Error=Error>> { let header: &HeaderMap<HeaderValue> = request.headers(); let response: Value; let user_email: &str = header[EMAIL].to_str().unwrap(); if check_email_format(user_email) { let users_collection: Collection = connect_database_co...
Rust
0
# Copyright 2021 Alexis Lopez Zubieta # # 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, publi...
Python
1
oso.register_class(person_class).unwrap(); oso.load_str(policy).unwrap(); oso.query("has_grandchild_called(new Person(), \"cora\")") .unwrap() }, |query| assert!(query.next_result().is_some()), criterion::Ba...
Rust
0
psc::Sender<ManagerCommand<T>>, receiver: mpsc::Receiver<ManagerCommand<T>>, clock: C, ) { let rows1 = Arc::new(rows); let rows2 = rows1.clone(); let inner1 = inner.clone(); let clock1 = clock.clone(); thread::spawn(move || { let scheduler = request_scheduler::RefreshScheduler::new( ...
Rust
0
rows_filtered = dbm.fetch_data("SELECT * FROM example_table WHERE name = ?;", ("sample_item",)) if rows_filtered: print("Fetched filtered data:") for row in rows_filtered: print(row) else: print("Failed to connect to the databas...
Python
1
import open3d as o3d import sys import os import glob import numpy as np def statistical_filter(pcd, nb_neighbors=20, std_ratio=2.0): """ 统计滤波:移除离群点 :param pcd: 输入点云 :param nb_neighbors: 每个点考虑的邻居数量 :param std_ratio: 标准差比例,用于判断异常值 :return: 滤波后的点云 """ cl, ind = pcd.remove_statistical_ou...
Python
1
h to fail on 64-bit. nbits = np.dtype(np.intp).itemsize * 8 thesize = int((2**nbits)**(1.0/5.0)+1) def dp(): n = 3 a = np.ones((n,)*5) i = np.random.randint(0, n, size=thesize) a[np.ix_(i, i, i, i, i)] = 0 def dp2(): n = 3 ...
Python
1
import os import json import glob import argparse import torch from tqdm import tqdm class T2IModel(): def __init__(self, model_name, ckpt_path, height=None, width=None, guidance_scale=None, num_inference_steps=None, max_sequence_length=None): self.model_name = model_name self.ckpt_path = ckpt_pa...
Python
1
= err.source(); while let Some(err) = source { exceptions.push(exception_from_error(err)); source = err.source(); } exceptions.reverse(); Event { exception: exceptions.into(), level: Level::Error, ..Default::default() } } fn exception_from_error<E: Error + ...
Rust
0
Ok((None, None)))); assert!(matches!(parse_spec(".", '.'), Ok((None, None)))); assert!(format!("{}", parse_spec("::", ':').err().unwrap()).starts_with("invalid group: ")); assert!(format!("{}", parse_spec("..", ':').err().unwrap()).starts_with("invalid group: ")); } } <filename>rust/rust-cr...
Rust
0
#!/usr/bin/env python3 """ Debug script for model mapping issue """ import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) try: from src.services.model_handlers.model_configs import ModelConfigurations, Provider print("=== Model Configuration Debug ===") # Tes...
Python
1
for service_name, config_key in services: service_config = config.get(config_key, {}) if service_config.get("enable"): server_config = service_config.get("server", {}) protocol = "https" if server_config.get("ssl", False) else "http" ...
Python
1
:SS')", "2012-03-04 00:00:00" ); let ts = Timestamp::new(2012, 3, 4, 5, 6, 7, 0); test_to_sql!( &conn, &ts, "TO_CHAR(:1, 'YYYY-MM-DD HH24:MI:SS')", "2012-03-04 05:06:07" ); test_to_sql!( &conn, &ts, "TO_CHAR(:1, 'YYYY-MM-DD HH24:MI:SS...
Rust
0
ilename. timestamp = datetime.now().strftime('%Y-%m-%d-%H-%M-%S') filename = f'coa-data-{timestamp}.xlsx' # Save a temporary workbook. try: parser = CoADoc(init_all=False) with tempfile.NamedTemporaryFile(suffix='.xlsx', delete=False) as temp: parser.save(data, temp.name) ...
Python
1
ring())); // assert_eq!(data_url.get_media_type(), "text/plain"); // Ok(()) // } } use crate::acpi::ACPISDTHeader; #[derive(Debug)] #[repr(C)] pub struct FADT { header: ACPISDTHeader, firmware_ctrl: u32, dsdt: u32, reserved: u8, preferred_power_management_profile: u8, sci_...
Rust
0
1; } impl<T: PunchCardLine> PunchCardLine for RangeToInclusive<T> { const HEAD: Option<bool> = Some(true); type Tail = T; const LENGTH: usize = Self::Tail::LENGTH + 1; } <filename>src/okta/models/user_activation_token.rs #[allow(unused_imports)] use serde_json::Value; #[allow(unused_imports)] use std::borrow::Borro...
Rust
0
t, y) -> int: """Partially annotated method.""" return x * y def calculate_all(self): """Method that calls others.""" a = self.add(5, 3) b = self.subtract(10, 4) c = self.multiply(2, 6) return a + b + c def use_calculator(): """Function using the calcula...
Python
1
from rest_framework import serializers from posts.models import Comment, Group, Post, Follow, User class CommentSerializer(serializers.ModelSerializer): author = serializers.SlugRelatedField( read_only=True, slug_field='username' ) class Meta: model = Comment fields = '__all__' ...
Python
1
e: u32, } impl<S> Lz4Decoder<S> { pub(crate) fn new(stream: S) -> Self { Self { inner: stream, chunks: BufList::default(), meta: None, buffer: Vec::new(), } } fn read_meta(&mut self) -> Result<Lz4Meta> { assert!(self.chunks.remaining(...
Rust
0
} fn __delitem__(&mut self, idx: usize) -> PyResult<()> { match self.graph.remove_node(NodeIndex::new(idx as usize)) { Some(_) => Ok(()), None => Err(PyIndexError::new_err("No node found for index")), } } // Functions to enable Python Garbage Collection // Func...
Rust
0
NBits>) -> Self { BitArraySet { bit_array: bit_array } } pub fn from_bytes(bytes: &[u8]) -> Self { BitArraySet { bit_array: BitArray::from_bytes(bytes) } } /// Consumes this set to return the underlying bit array. /// /// # Examples /// /// ``` /// extern crate typ...
Rust
0
TestConnection; use aws_smithy_http::body::SdkBody; use pretty_assertions::assert_eq; use std::fs; use std::path::Path; // Create a mock CloudWatch client, returning the data from the specified // data_file. fn mock_client( data_file: Option<&str>, ) -> Client { let cred...
Rust
0
size_of::<[libc::c_int; 1]>().try_into().unwrap()) as usize }; assert!(BUF_SIZE >= buf_size, "{} < {}", BUF_SIZE, buf_size); let mut buf: [libc::c_char; BUF_SIZE] = unsafe { mem::zeroed() }; msg.msg_control = buf.as_mut_ptr() as *mut libc::c_void; msg.msg_controllen = mem::size_of_val(&buf).try_into().unwrap...
Rust
0
import sqlite3 koneksi = sqlite3.connect('database_hewan.db') koneksi.execute(""" INSERT INTO HEWAN ('nama_hewan', 'jenis', 'asal', 'jml_skrng', 'thn_ditemukan') VALUES('Orangutan', 'Mamalia', 'Sumatera', '14000', '2021') """) koneksi.execute(""" INSERT ...
Python
1
(1000, "M"), (900, "CM"), (500, "D"), (400, "CD"), (100, "C"), (90, "XC"), (50, "L"), (40, "XL"), (10, "X"), (9, "IX"), (5, "V"), (4, "IV"), (1, "I"), ...
Rust
0
; use std::iter::FromIterator; use crate::lasir::connections::*; use crate::utils::math::log2_ceil; use crate::utils::math::be_arr_as_be_u32; use crate::utils::math::u32_as_be_arr; use crate::utils::math::generate_right_bitmask; use crate::utils::math::increment_at_bit_index; #[derive(Debug)] pub struct SubnetCandidat...
Rust
0
f = Sonyflake::new().unwrap(); //! let next_id = sf.next_id().unwrap(); //! println!("{}", next_id); //! ``` //! //! ## Concurrent use //! //! Sonyflake is threadsafe. `clone` it before moving to another thread: //! ``` //! use sonyflake::Sonyflake; //! use std::thread; //! //! let sf = Sonyflake::new().unwrap(); //! /...
Rust
0
| "Insert" | "Meta" | "NumLock" | "PageDown" | "PageUp" | "Pause" | "ScrollLock" | "Shift" | "Tab" ) } fn handle_key_press(key: &str, modifiers: &egui::Modifiers, s: &mu...
Rust
0
Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> WatchlistCreateResponse: """ Add To Watchlist Args: extra_headers: Send extra headers extr...
Python
1
_runner::run_test(case); } #[test] fn test_correct_tx_when_change_owner() { let mut case = get_correct_case(); if let CustomCell::ETHLightClientLockCustomCell(script) = &mut case.script_cells.outputs[0] { script.args[0] = 0; } case_runner::run_test(case); } #[test] fn test_correct_tx_when_chan...
Rust
0
dp_odd[i] # Iterate over the elements of the array for i in range(1, n + 1): # If the i-th element is even if arr[i - 1] % 2 == 0: # arr[i] alone dp_even[i] = 1 # arr[i] alone is an odd number so we don't have any subsequences with odd sum dp_odd[i] = 0 # If we add arr[i] to a subsequence with e...
Python
1
= include!(concat!(env!("CARGO_MANIFEST_DIR"), "/data/unicode_to_qr_kanji.json")); /// Returns a list of zero or more segments to represent the specified Unicode text string. pub(crate) fn make_segments_optimally( code_points: &[char], ecc: QrCodeEcc, min_version: Version, max_version: Version, ) ...
Rust
0
ve_pdb="target.pdb", algo="TMalign", execpath='',writePDB=True,offset=0): '''Superpose "model_pdb" to "native_pdb" ''' if not execpath and algo!="matrix": # default path to executables if algo.lower().startswith("pymol") or algo=="super": execpath="pymol" else: execpa...
Python
1
tores = {sub.id: sub for sub in self.load_all_data(SubmissionStore)} self.reload_or_update_if_needed() failed_cnt = 0 except Exception as e: self.log( 'error', 'base.init_game', f'exception during ini...
Python
1
ter::SENSORTIME } else { 0 }; let end = if selector.time { Register::SENSORTIME + 3 } else if selector.accel { Register::ACC + 6 } else if selector.gyro { Register::GYR + 6 } else if selector.magnet { Register::MAG + 8 } else { 0 }; (...
Rust
0
, 2); assert_eq!(image.pixels, pixels); } #[test] fn test_flip_x() { let mut pixels = [ Pixel::rgb(100, 0, 0), Pixel::rgb(0, 0, 0), Pixel::rgb(100, 0, 0), Pixel::rgb(0, 0, 0), ]; let mut image = Image::from_raw(&mut pixels[0],...
Rust
0
"""Example that illustrates use of the rulecurve scheme.""" from pathlib import Path from rtctools.util import run_simulation_problem from rtctools_simulation.reservoir.model import ModelConfig, ReservoirModel CONFIG = ModelConfig(base_dir=Path(__file__).parent) class SingleReservoir(ReservoirModel): """Exampl...
Python
1
let::pallet] pub struct Pallet<T>(_); #[pallet::hooks] impl<T: Config> Hooks<T::BlockNumber> for Pallet<T> {} #[pallet::call] impl<T: Config> Pallet<T> { /// Create NFT class, tokens belong to the class. /// /// - `metadata`: external metadata /// - `properties`: class property, include `Transferable` `B...
Rust
0
7, 13, 59, 31, 19], 939), Some(&59)); assert_eq!(wait_time(939, 59), 5); } #[test] fn part_1() { assert_eq!(include_str!("inputs/day_13").part_1(), 296); } #[test] fn example_2() { assert_eq!( chinese_remainder_inv(&[0, 1, 4, 6, 7], &[7, 13, 59, 31, 19]), ...
Rust
0
. //! //! # Examples //! //! ```rust //! # extern crate actix; //! use actix::actors::signal; //! use actix::prelude::*; //! //! struct Signals; //! //! impl Actor for Signals { //! type Context = Context<Self>; //! } //! //! // Shutdown system on and of `SIGINT`, `SIGTERM`, `SIGQUIT` signals //! impl Handler<signa...
Rust
0
st_web_rtc_sys::gst_webrtc_sctp_transport_state_get_type()) } } } #[cfg(any(feature = "v1_16", feature = "dox"))] impl<'a> FromValueOptional<'a> for WebRTCSCTPTransportState { unsafe fn from_value_optional(value: &Value) -> Option<Self> { Some(FromValue::from_value(value)) } } #[cfg(any(feature = ...
Rust
0
::{ collections::HashMap, fs::File, io::{stdout, BufWriter, Write}, path::Path, sync::{Arc, Mutex}, }; pub struct ExternalSolver { output: Arc<Mutex<dyn Write + Send>>, } impl ExternalSolver { pub fn new<P>(path: P) -> Result<Self, SolverError> where P: AsRef<Path>, { ...
Rust
0
no_crc: true, no_header: true, size: data_size as u16, payload: data, }; let tx_packet = wrapper::TxPacket::new(Uuid::new_v4(), tx_packet); match queue .lock() .unwrap() .enqueue(timersync::get_concentrator_count(), tx_packet) { Ok(_) => ...
Rust
0
part = coriolis_v.columns_mut(rb.assembly_id, ndofs); let mut coriolis_w_part = coriolis_w.columns_mut(rb.assembly_id, ndofs); // JDot coriolis_v_part += rb_joint_j_v_dot; coriolis_w_part += rb_joint_j_w_dot; // JDot/u * qdot ...
Rust
0
ba", "Alba", "Alba", "Alba"], ["羅馬尼亜", "Romania", "Romania", "Romania", "Romania", "Romania", "Romania"], "20c210c205030000", ] weathercities099["Drobeta-Turnu Severin"] = [ [ "ドロベタ=トゥルヌ・セヴェリン", "Drobeta-Turnu Severin", "Drobeta-Turnu Severin", "Drobeta-Turnu Severin", ...
Python
1
"] line = "{:<15}".format(label_name) + sep + col1 line += sep + "{:>15.3f}".format(ap_avg) + sep line += sep + "{:>15.3f}".format(ap_50o) + sep line += sep + "{:>15.3f}".format(ap_25o) + sep print(line) all_ap_avg = avgs["all_ap"] all_ap_50o = avgs["all_ap_50%"] all...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from pathlib import Path from psychopy.experiment.components import BaseComponent, Param, _translate class UnknownPluginComponent(BaseComponent): """This is used by Builder to represent a component that was not known by the current installed version of PsychoPy (...
Python
1
h_last["market"] == market][ "ema12ltema26" ].values[0] except Exception as err: print(err) # don't flood exchange, sleep 1 second time.sleep(2) # current position ROW += 1 # clear screen ...
Python
1
used_mut)] let mut scope_1431 = writer.prefix("TransitGatewayRouteTableId"); if let Some(var_1432) = &input.transit_gateway_route_table_id { scope_1431.string(var_1432); } #[allow(unused_mut)] let mut scope_1433 = writer.prefix("PrefixListId"); if let Some(var_1434) = &input.prefix_list_...
Rust
0
e_rm8.negate_condition_code(), Code::Seta_rm8); /// assert_eq!(Code::Seta_rm8.negate_condition_code(), Code::Setbe_rm8); /// ``` #[must_use] #[allow(clippy::missing_inline_in_public_items)] pub fn negate_condition_code(self) -> Self { let mut t; // SAFETY: All valid input (all Code values) have been tested su...
Rust
0
sim=sim, prior_mask = same_proto_mask if self.use_memory_net else None) positive_num+=positive_num_ negative_num+=negative_num_ elif y_con_config["y_con_type"]=="multi_criterion_con_loss": y_con_loss = multi_criterion_con...
Python
1
""" Emonoda -- A set of tools to organize and manage your torrents Copyright (C) 2015 Devaev Maxim <mdevaev@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either vers...
Python
1
or /// `get_client_data`. pub fn set_client_data<T: ClientDataDefinition>( &mut self, area: &ClientDataArea<T>, data: &T, ) -> Result<()> { unsafe { map_err(sys::SimConnect_SetClientData( self.handle, area.client_id, ...
Rust
0
ilinear_filter(mut x: f64) -> f64 { x = x.abs(); if x < 1.0 { 1.0 - x } else { 0.0 } } #[inline] fn hamming_filter(mut x: f64) -> f64 { x = x.abs(); if x == 0.0 { 1.0 } else if x >= 1.0 { 0.0 } else { x *= PI; (0.54 + 0.46 * x.cos()) * x.s...
Rust
0
edDeref for std::sync::RwLockReadGuard<'a, T> {} #[cfg(feature = "std")] unsafe impl<'a, T: ?Sized> TrustedDeref for std::sync::RwLockWriteGuard<'a, T> {} #[cfg(feature = "alloc")] unsafe impl TrustedDeref for String {} // TODO: These are correct, right? Explain why. #[cfg(feature = "std")] unsafe impl TrustedDeref ...
Rust
0