text
string
label_name
string
labels
int64
lm_with_tools print(list(chain.stream({"input": f'"{query}"에 대한 뉴스 기사들을 {display}개 찾고, 찾은 기사들을 토대로 다음 의견에 반박해: "{opinion}"'}))[-1]) # tools = [search_articles, read_article_link] # # llm_with_tools = model.bind_tools(tools) # agent = ( # { # "input": lambda x: x["input"], # ...
Python
1
Provider): """An interface for sending bytes to a single peer.""" @abstractmethod async def send(self, item: bytes) -> None: """ Send the given bytes to the peer. :param item: the bytes to send """ class ByteStream(ByteReceiveStream, ByteSendStream): """A bidirectiona...
Python
1
ssert response["content"] == "success" assert response["status"] == 200 async def test_rest_command_get_response_json( hass: HomeAssistant, setup_component: ComponentSetup, aioclient_mock: AiohttpClientMocker, ) -> None: """Get rest_command response, json.""" await setup_component() aiocl...
Python
1
}/Cargo.toml", manifest_dir), format!("--out-dir={}/bin", manifest_dir), // `--out-dir` is unstable and requires `-Zunstable-options`. "-Zunstable-options".to_string(), ...if !features.is_empty() { vec![format!("--features={}", features...
Rust
0
te_condition_if: The evaluate_condition_if of this Condition. :type: str """ self._evaluate_condition_if = evaluate_condition_if @property def urn_ietf_params_scim_schemas_oracle_idcs_extension_ociconsolesignonpolicyconsent_policy(self): """ Gets the urn_ietf_params_scim...
Python
1
-I$(CLOVIS_ROOT)/ASP/components/cnt/include \\ -I$(CLOVIS_ROOT)/ASP/components/utils/include \\ -I$(CLOVIS_ROOT)/ASP/components/osal/include \\ -I$(CLOVIS_ROOT)/ASP/components/timer/include \\ -I$(CLOVIS_ROOT)/ASP/components/om/include \\ ...
Python
1
(*(*t).mon).tagset[(*(*t).mon).seltags as usize] { t = (*t).snext } (*(*c).mon).sel = t }; } unsafe extern "C" fn seturgent(mut c: *mut Client, mut urg: libc::c_int) { let mut wmh: *mut XWMHints = 0 as *mut XWMHints; (*c).isurgent = urg; wmh = XGetWMHints(dpy, (*c).win...
Rust
0
_ID_COUNT_INPUT { Input: D3D11_AUTHENTICATED_QUERY_INPUT, DeviceHandle: HANDLE, CryptoSessionHandle: HANDLE, }} STRUCT!{struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_OUTPUT { Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, DeviceHandle: HANDLE, CryptoSessionHandle: HANDLE, OutputIDCount: UINT, ...
Rust
0
# mono - Downmix Exaile's audio to one channel # Copyright (C) 2013 Johannes Sasongko <sasongko@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 version 2 of the License, or ...
Python
1
ForkChoiceTest::new() .apply_blocks(2) .apply_invalid_block_directly_to_fork_choice( |block, _| { block.slot = block.slot + 1; }, |err| assert_invalid_block!(err, InvalidBlock::FutureSlot { .. }), ); } /// Specification v0.12.1 /// /// assert ...
Rust
0
import numpy as np import torch import sklearn.metrics def calculate_metric_with_sklearn(predictions: np.ndarray, labels: np.ndarray): """ Manually calculate the accuracy, f1, matthews_correlation, precision, recall with sklearn. """ valid_mask = labels != -100 # Exclude padding tokens valid_pr...
Python
1
def pack(high,low): """pack high,low 32bit unsigned int to one unsigned 64bit long long Note:the print value of result number may appear signed, if the sign bit is used. """ h=high<<32 return (h|low) def secondsFromString(i): """convert from a string in the format output from timeStamptoDate...
Python
1
n = 1 d = 1 nn = [] dd = [] f = [] for i in range(0, 51): f.append(n/d**3) print('{}/{}³'.format(n, d)) d += 2 posi = [] negat = [] for j in range(len(f)): if j % 2 == 0: posi.append(f[j]) else: negat.append(f[j]) for f in range(len(negat)): negat[f] = -negat[f] negativ = sum(neg...
Python
1
b), 0x01000032 => <ark_bw6_761::BW6_761 as CurveBasicOperations>::pairings(input).map(b2b), id => return Err(Error::InvalidFunctionId), }?) } /// Integrate add pub fn add(func_id: u32, input: &[u8]) -> Result<Vec<u8>> { Ok(match func_id { 0x00 => call(0x01000000, input)?, 0x10 =...
Rust
0
from __future__ import annotations import pytest from polars_upgrade._data import Settings from polars_upgrade._main import fix_plugins @pytest.mark.parametrize( ("s", "version"), ( pytest.param( "df.group_by_dynamic(truncate=1)\n", (0, 20, 0), ), pytest.param...
Python
1
fn new(bits: bool) -> Self { EP0_DMA_TX_EN_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for EP0_DMA_TX_EN_R { type Target = crate::FieldReader<bool, bool>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `ep0_dma_tx_en` writer - "] pub st...
Rust
0
"""Find the nearest intersection to a given position""" min_distance = float("inf") nearest_intersection = None for intersection in self.intersections: distance = self._distance_to_point(position, intersection) if distance < min_distance: min_distance = ...
Python
1
input.into()) //! } //! fn parse_type(self, input: & 'a str) -> SmtRes<String> { //! Ok(input.into()) //! } //! } //! //! let model = parser.get_model_const( false, & Parser ).expect("model"); //! assert_eq!( model, vec![ ("a".into(), "Int".into(), "(- 17)".into()) ] ) //! # } //! ``` //! //! //! ##...
Rust
0
font_size=24, showarrow=False, font_color="#000000" )] ) st.plotly_chart(fig, use_container_width=True) # Results display st.markdown(f""" <div style="border: 2px solid #000000; padding: 20px; border-radius: 10px; margin: ...
Python
1
"https://u2.dmhy.org/userdetails.php?id={}", self.uid )) .await?; let username = Document::from(context.as_str()) .find(Name("a")) .find(|x| match x.attr("class") { Some(x) => x.split_at(x.len() - 5).1 == "_Name", ...
Rust
0
h the MIT license found in the * LICENSE-MIT file in the root directory of this source tree and the Apache * License, Version 2.0 found in the LICENSE-APACHE file in the root directory * of this source tree. */ use std::pin::Pin; use futures::future::Future; use futures::ready; use futures::task::{Context, Poll};...
Rust
0
_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; mod account; mod agent; mod asset; #[macro_use] mod macros; mod mission_control; mod rate; // Copyright 2019 Authors of Red Sift // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-...
Rust
0
if __name__ == '__main__': device = 'cpu' out_channel = 11 batch_size = 3 img_size = [3, 32, 32] # image size in cifar. params = ModelParams( conv_filter=gen_image_batch([7, 7, 3], out_channel), bn_scale=ops.rand( shape=(1, out_channel), dtype=kaleido.float32, device=...
Python
1
izing_if = "Option::is_none")] pub scheme: Option<String>, /// A hint to the client to identify how the bearer token is formatted. /// Bearer tokens are usually generated by an authorization server, so this /// information is primarily for documentation purposes. #[serde(skip_serializing_if = "Opti...
Rust
0
routine def network_state_machine(ctx): yield ctx.q.put((START,)) while True: item = yield ctx.q.get() print item yield functions[item[0]](ctx, *item[1:]) ctx.q.task_done() def launch_app(ctx): application = tornado.web.Application([ (r"/", MakeIncomingPeerHandler(c...
Python
1
""" 用class的形式处理y=kx+b的问题是一种很好的解决方式 但是如果需要计算2万条一次函数的话,需要不断更新k,b的值,来创建2万个内存对象空间 更重要的是,自定义的类默认都集成了大量的魔法方法从object中,累赘, 类的方式占用大量内存 """ class Line(object): def __init__(self, k, b): self.k = k self.b = b def __call__(self, x): print(self.k * x + self.b) """ 闭包closure,就是一个...
Python
1
g_comments() || tok.has_leading_comments()) } /// Whether the node contains trailing comments. fn has_trailing_comments(&self) -> bool { self.to_node() .last_token() .map_or(false, |tok| tok.has_trailing_comments()) } /// Whether the node contains leading comments. ...
Rust
0
.try_into() .map_err(|_| PinWeaverError::LengthInvalid)?, cred_metadata: params.cred_metadata.ok_or(PinWeaverError::TypeInvalid)?, h_aux: params.h_aux.ok_or(PinWeaverError::TypeInvalid)?.into_iter().flatten().collect(), }; Ok(PinweaverRequest::new(PinweaverMe...
Rust
0
t): joint_model = self.robot_model.joint(i) joint_state = self.joint_states(time_step).joint_state(i) mimic_f = 1.0 / mimic_div[joint_model.name] if isinstance(joint_model, tt.ScalarJointModelBase): if joint_model.limits: tr.goal(tr.rel...
Python
1
write!(buf, r#","module":"{}""#, module)?; } if let Some(file) = record.file() { write!(buf, r#","file":"{}""#, file)?; } if let Some(line) = record.line() { write!(buf, r#","line":"{}""#, line)?; } } writeln!(buf, "}}") } // // Problem...
Rust
0
::enc(&none).unwrap(); let r = kserd.decode::<Option<u8>>(); assert_eq!(r, Ok(None)); let some = Some(8); let kserd = Kserd::enc(&some).unwrap(); let r = kserd.decode::<Option<u8>>(); assert_eq!(r, Ok(Some(8))); } #[test] fn unit_struct() { let u = UnitStruct; let kserd = Kserd::enc(&u...
Rust
0
Relation::Conflicts)), (false, false) => (), } } } } for edge_to_add in edges_to_add { assert!(graph.find_edge(edge_to_add.0, edge_to_add.1).is_none()); graph.add_edge(edge_to_add.0, edge_to_add.1, edge_to_add.2); } loop { let mut node_indices_to_remove = std::collections::BTreeSet::new(); ...
Rust
0
}, /// Mouse wheel moved. MouseScroll { /// Amount of steps the wheel rotated. /// /// Positive when scrolled "down"/"backwards". /// /// Negative when scrolled "up"/"forwards"/"away". delta: i32, }, /// A keyboard or mouse button pressed (might repea...
Rust
0
""" =================== Label image regions =================== This example shows how to segment an image with image labelling. The following steps are applied: 1. Thresholding with automatic Otsu method 2. Close small holes with binary closing 3. Remove artifacts touching image border 4. Measure image regions to fi...
Python
1
# ========= Copyright 2023-2024 @ CAMEL-AI.org. 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 requ...
Python
1
(), SingleType::Int8Array(_) => unreachable!(), SingleType::Int16Array(_) => unreachable!(), SingleType::Int32Array(_) => unreachable!(), SingleType::Uint8Array(_) => unreachable!(), SingleType::Uint16Array(_) => unreachable!(), SingleType::Uint32A...
Rust
0
answer_offset = answer["answer_start"] while paragraph_text[answer_offset] in [ " ", "\t", "\r", "\n", "。", ",", ":", ":", ".", "," ]: answer_offset += 1 start_position = char_to_w...
Python
1
ca\xbcg\xdc],\x9f\x1d$\xdb\xc9\ \xfb\x7f\x93}\x89l\xd5]\xd2\x02\x19\xf7\x05\xd9\xa6U\ \xb2_h\xcf\x0aI\x93\xc5\xf2\xfei\xb2>\xbfJ:\ q\xff\x1c\xd9'\xb4\x8f\xf5\xefs\xd9\xb7\xe8\x97'\xc8\ \xf7\x9f\x1d\xc4\x01\xc2\xd1G\x90\xb1G\xcb\xbe\xa9(\xdb\ \xc3X\x86\xaf\xc3K&\xca\xcf\x8a\xe7P\xcel\xe1\x8c\ \xe3\x8a\xb2\x1f\x86\x09G\x...
Python
1
from pydantic import BaseModel class LoginSchema(BaseModel): CPF: str Senha: str
Python
1
eturn that with a larger diff. if successor_idx < sequence.len() { let p_diff = sequence[result.rank] - sequence[predecessor_idx]; let s_diff = sequence[successor_idx] - sequence[result.rank]; if p_diff <= s_diff { Some(predecessor_idx) } else { Some(successor...
Rust
0
path.split('/')[-2],each_video_path.split('/')[-1].split('.')[0]) # print(save_dir) if not os.path.exists(save_dir): os.makedirs(save_dir) self.videoReader.video2frame_update(frame_save_path=save_dir) else: conti...
Python
1
<gh_stars>1-10 use std::fmt::Display; use std::process; /// `println!`, but for stderr instead of stdout. macro_rules! errprintln { ( $($args:tt)* ) => {{ use std::io::Write; let stderr = ::std::io::stderr(); let mut stderr = stderr.lock(); writeln!(stderr, $($args)*).unwrap(); ...
Rust
0
lds class""" self._subfields.extend(subfields) return self def alias(self, alias: str) -> "PostFields": self._alias = alias return self class UserFields(GraphQLField): id: "UserGraphQLField" = UserGraphQLField("id") name: "UserGraphQLField" = UserGraphQLField("name") a...
Python
1
import operator_benchmark as op_bench import torch import torch.nn as nn """ Microbenchmarks for the softmax operators. """ # Configs for softmax ops softmax_configs_short = op_bench.config_list( attr_names=[ 'N', 'C', 'H', 'W' ], attrs=[ [1, 3, 256, 256], [4, 3, 256, 256], ...
Python
1
jectAssets { /// Creates a new builder-style object to manufacture [`BatchDisassociateProjectAssetsInput`](crate::input::BatchDisassociateProjectAssetsInput) pub fn builder() -> crate::input::batch_disassociate_project_assets_input::Builder { crate::input::batch_disassociate_project_assets_input::Builde...
Rust
0
}', '\u{fdd2}', '\u{fdd3}', '\u{fdd4}', '\u{fdd5}', '\u{fdd6}', '\u{fdd7}', '\u{fdd8}', '\u{fdd9}', '\u{fdda}', '\u{fddb}', '\u{fddc}', '\u{fddd}', '\u{fdde}', '\u{fddf}', '\u{fde0}', '\u{fde1}', '\u{fde2}', '\u{fde3}', '\u{fde4}', '\u{fde5...
Rust
0
lf.app.opt.scale_x, self.app.opt.scale_y, self.app.opt.auto_scale, self.app.opt.preview_scale, self.app.opt.spread_stacks, self.app.opt.preserve_aspect_ratio) = d.scale_values if not self.app.opt.auto_scale: ...
Python
1
import math N = 149055622578427140579327241295750028254053935026508697671159426064086003433803278662589824024479925649884665883051742716746578443524545439588475681903724467235496277522744427891842364907682723131874100771242346998547249070397701936808224954705322189050834597309980036229261525905977102131279521410560295...
Python
1
lista_tarefas = [] def adicionar_tarefa(lista_tarefas, descricao, status, prioridade): if lista_tarefas: novo_id = max(tarefa["id"] for tarefa in lista_tarefas) + 1 else: novo_id = 1 nova_tarefa = { "id": novo_id, "descricao": descricao, "status": status, "pr...
Python
1
: __kernel_pid_t, pub shm_lpid: __kernel_pid_t, pub shm_nattch: __kernel_ulong_t, pub unused4: __kernel_ulong_t, pub unused5: __kernel_ulong_t, } #[repr(C)] #[derive(Copy, Clone, Default)] pub struct shminfo64 { pub shmmax: __kernel_ulong_t, pub shmmin: __kernel_ulong_t, pub shmmni: __kerne...
Rust
0
on, PyObject}; use edgeql_parser::position::InflatedPos; py_class!(pub class SourcePoint |py| { data _position: InflatedPos; @classmethod def from_offsets(cls, data: PyBytes, offsets: PyObject) -> PyResult<PyList> { let mut list: Vec<usize> = offsets.extract(py)?; let data: &[u8] =...
Rust
0
/// /// For queues with default values, removing an element will add a new /// default value into the queue. /// /// # Returns /// - `Ok(T)`: The oldest element in the queue /// - `Error` /// /// # Errors /// Returns an error if an attempt is made to remove an element from /// an...
Rust
0
help_message[i]); i += 1; } } assert_eq!(i, long_help_message.len()); } #[test] fn test_basic_usage() -> anyhow::Result<()> { env::set_var("ACICK_CONTEST", "arc100"); let test_dir = tempdir()?; assert_matches!(get_opt_common(&test_dir, &["help"]) => Err(_)); // check that...
Rust
0
as a Web service /// request to the HTTP address specified using the protocol specified /// in [RFC6546]. /// ``` pub fn read_iodef(url: &[u8]) -> ProtoResult<Url> { let url = str::from_utf8(url)?; let url = Url::parse(url)?; Ok(url) } /// Issuer key and value pairs. /// /// See [RFC 6844, DNS...
Rust
0
block specification more propertly. pub fn handle_disk_access(&mut self) { let avail_address = self.disk.get_avail_address(); let base_desc_address = self.disk.get_desc_address() as u64; let base_used_address = self.disk.get_used_address(); let _flag = self.load_halfword_raw(avail_address); let offset = sel...
Rust
0
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from boat import BoatSimulator from scenarios import ScenarioGenerator from csv_logging import open_csv_file, close_and_save_csv_file from render import Render log_dir, csv_file, csv_writer, simulation_time = open_csv_file() s...
Python
1
# 2293 동전 1 # 동전의 종류 수 (n)와 목표 금액 (k)를 입력받음 n, k = map(int, input().strip().split()) arr = [] # 각 동전의 가치를 입력받음 for _ in range(n): arr.append(int(input())) # 0부터 k까지의 금액을 만들 수 있는 방법의 수를 저장할 리스트 초기화 dp = [0 for _ in range(k + 1)] dp[0] = 1 # 금액 0을 만드는 방법은 동전을 사용하지 않는 한 가지 방법 # 각 동전 종류를 처리 for coin in arr: # c...
Python
1
uncompressed_msg); } #[test] fn test_rsa_encryption() { use rand::SeedableRng; let (skey, _headers) = SignedSecretKey::from_armor_single( fs::File::open("./tests/opengpg-interop/testcases/messages/gnupg-v1-001-decrypt.asc") .unwrap(), ) .unwrap()...
Rust
0
# import heapq # q = [] # heapq.heappush(q, 1) # array = set() # array.add(1) # n = int(input()) # while len(array) < n: # num = heapq.heappop(q) # array.add(num) # heapq.heappush(q, 2 * num) # heapq.heappush(q, 3 * num) # heapq.heappush(q, 5 * num) # array = sorted(array) # print(array[-1...
Python
1
#!/usr/bin/env python3 """ Setup script for AI-Powered Multi-Tool Application """ import os import sys import subprocess import shutil from pathlib import Path def check_python_version(): """Check if Python version is compatible""" if sys.version_info < (3, 8): print("❌ Python 3.8 or higher is require...
Python
1
from vector import * import graphics as gr import time as t class animator: def __init__(self, positions : list[list[vector]], masses : list[float], dt : float) -> None: self.positions = positions self.masses = masses self.dt = dt def animate(self, duration : float): windowWid...
Python
1
import os, socket import logging, server, spoof def check(): logger = logging.getLogger('SweetSecurityLogger') #Check Logstash Health if os.path.isfile('/usr/share/logstash/bin/logstash'): logstashHealth=os.popen('service logstash status').read() for line in logstashHealth.splitlines(): if line.lstrip().star...
Python
1
''' Author: Mr.Car Date: 2025-03-21 14:29:41 ''' import pytest from weather_server.server import CityNameConverter def test_pinyin_conversion(): """测试拼音转换功能""" converter = CityNameConverter() # 测试基本映射 assert converter.to_english("苏州") == "suzhou" assert converter.to_english("北京") == "beijing" ...
Python
1
(0.0, 0.0, 0.0).into(), up: cgmath::Vector3::unit_y(), aspect: width as f32 / height as f32, fovy: 45.0, znear: 0.1, zfar: 100.0, } } pub fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> { let view = cgmath::Matrix4::look...
Rust
0
class BinarySearch: def search(self, arr, target): left, right = 0, len(arr) - 1 while left <= right: mid = (left + right) // 2 if arr[mid] == target: return mid elif arr[mid] < target: left = mid + 1 else: ...
Python
1
from rasa_sdk import Tracker, Action from rasa_sdk.executor import CollectingDispatcher import ruamel.yaml import pathlib from typing import Dict, Text, Any, List from rasa_sdk.events import EventType here = pathlib.Path(__file__).parent.absolute() handoff_config = ( ruamel.yaml.safe_load(open(f"{here}/handoff_co...
Python
1
/ # use std::default::Default; /// # use recommender1_beta1::{Recommender, oauth2, hyper, hyper_rustls}; /// /// # let secret: oauth2::ApplicationSecret = Default::default(); /// # let auth = oauth2::InstalledFlowAuthenticator::builder( /// # secret, /// # oauth2::InstalledFlowReturnMethod::HTTPRedirec...
Rust
0
bled or self._onlyonce: # 加载模块 self._site_schema = SubmoduleHelper.import_submodules('app.plugins.modules._autogenrss', filter_func=lambda _, obj: hasattr(obj, 'match')) self.debug(f"加载特殊站点:{self._site_schema}") ...
Python
1
winapi::um::fileapi, pub fn FindFirstFileA( lpFileName: LPCSTR, lpFindFileData: LPWIN32_FIND_DATAA, ) -> HANDLE;INVALID_HANDLE_VALUE} make_func! {winapi::um::fileapi, pub fn FindFirstFileW( lpFileName: LPCWSTR, lpFindFileData: LPWIN32_FIND_DATAW, ) -> HANDLE;INVALID_HANDLE_VALUE} make_func! {winapi::u...
Rust
0
meticUnderflow)?; Ok::<_, Error<T>>(()) })?; }; ($storage:ty, $currency:expr, $account:expr, $amount:expr) => { <$storage>::mutate($currency, $account, |value| { *value = value.checked_sub($amount).ok_or(Error::<T>::ArithmeticUnderflow)?; Ok::<_, Error<T>>(())...
Rust
0
spatchAsync(0x0101, 0x0002, lambda_3B57) @scena.Lambda('lambda_3B6F') def lambda_3B6F(): OP_6C(45000, 10500) ExitThread() DispatchAsync(0x0101, 0x0003, lambda_3B6F) OP_70(0x0005, 0) OP_73(0x0005) OP_23(0x00EB) WaitForThreadExit(0x0101, 0x0001) Sleep(200) Fade(500...
Python
1
metadata = { 'apiLevel': '2.5', 'protocolName': 'qPCR 96 well -> 384 well transfer', 'author': 'Opentrons <protocols@opentrons.com>', 'source': 'Custom Protocol Request' } def run(ctx): column_count = get_values( # noqa: F821 'column_count') column_count =...
Python
1
el) => fmt_label("j", label), Inst::Call(label) => fmt_label("call", label), Inst::Ret => " ret".into(), Inst::Lw(rd, offset, rs) => fmt_reg2_offset("lw", *rd, *rs, *offset), Inst::Sw(rd, offset, rs) => fmt_reg2_offset("sw", *rd, *rs, *offset), Inst::Add(rd, rs1, rs2) => fmt_reg3("add", *...
Rust
0
(script_tag)? { Some(s) => match s.find_langsys_or_default(opt_lang_tag)? { Some(v) => v, None => return Ok(()), }, None => return Ok(()), }; let syriac_glyphs: &mut Vec<SyriacGlyph> = &mut raw_glyphs.iter().map(SyriacGlyph::from).collect(); // 1. Co...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class SocialPost(models.Model): _inherit = "social.post" # Technical field that holds the relationship between a track and this 'reminder' post event_track_id = fields.Many2...
Python
1
MaxHardwareCounterType, }} pub type PHARDWARE_COUNTER_TYPE = *mut HARDWARE_COUNTER_TYPE; ENUM!{enum PROCESS_MITIGATION_POLICY { ProcessDEPPolicy, ProcessASLRPolicy, ProcessDynamicCodePolicy, ProcessStrictHandleCheckPolicy, ProcessSystemCallDisablePolicy, ProcessMitigationOptionsMask, Proc...
Rust
0
from setuptools import setup __author__ = "Chetan Jain <chetan@omkar.cloud>" install_requires = [ ] extras_require = {} def get_description(): try: with open("README.md", encoding="utf-8") as readme_file: long_description = readme_file.read() return long_description except: ...
Python
1
Invert this pixel fn invert(&mut self); /// Blend the color of a given pixel into ourself, taking into account alpha channels fn blend(&mut self, other: &Self); } /// Private module for supertraits of sealed traits. mod seals { pub trait EncodableLayout {} impl EncodableLayout for [u8] {} im...
Rust
0
with self.assertRaisesOpError("Input matrix is not invertible."): self._verifySolve(singular_matrix, singular_matrix, batch_dims=[2, 3]) def testEmpty(self): self._verifySolve(np.empty([0, 2, 2]), np.empty([0, 2, 2]), lower=True) self._verifySolve(np.empty([2, 0, 0]), np.empty([2, 0, 0]), lower=True...
Python
1
.is_infinite()); assert!(neg_infinity.is_sign_negative()); let nan: f64 = f32::NAN.into(); assert!(nan.is_nan()); } /// Conversions where the full width of $source can be represented as $target macro_rules! test_impl_try_from_always_ok { ($fn_name:ident, $source:ty, $target: ty) => { #[test] ...
Rust
0
the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); self.w } }...
Rust
0
of field `CERDYIFG`"] pub type CERDYIFG_R = crate::R<bool, CERDYIFG_A>; impl CERDYIFG_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CERDYIFG_A { match self.bits { false => CERDYIFG_A::CERDYIFG_0, true => CERDYIFG_A::CERDYIFG_1, ...
Rust
0
print(f"\nSaved model to: {path}") # Save training history history_path = path.replace('.h5', '_history.npz') np.savez( history_path, episode_rewards=self.training_history['episode_rewards'], robot1_rewards=self.training...
Python
1
''' Created on Dec 14, 2011 @author: pablocelayes ''' #!/usr/bin/python # -*- coding: utf-8 -*- """\ This module generates RSA-keys which are vulnerable to the Wiener continued fraction attack (see RSAfracCont.pdf) The RSA keys are obtained as follows: 1. Choose two prime numbers p and q 2. Compute n=pq 3. Compute...
Python
1
# test arithmetic opcodes @micropython.asm_rv32 def f1(): li(a0, 0x100) li(a1, 1) add(a0, a0, a1) addi(a0, a0, 1) addi(a0, a0, -2) sub(a0, a0, a1) c_add(a0, a1) c_addi(a0, -1) c_sub(a0, a1) print(hex(f1())) @micropython.asm_rv32 def f2(): li(a0, 0x10FF) li(a1, 1) an...
Python
1
: *mut BSTR, ) -> HRESULT, fn set_DynamicBase( appBase: BSTR, ) -> HRESULT, fn get_LicenseFile( pRetVal: *mut BSTR, ) -> HRESULT, fn set_LicenseFile( appBase: BSTR, ) -> HRESULT, fn get_PrivateBinPath( pRetVal: *mut BSTR, ) -> HRESULT, fn s...
Rust
0
::c_int, ) -> oboe_DataCallbackResult; } extern "C" { #[doc = " Construct an `AudioStream` using the given `AudioStreamBuilder`"] #[doc = ""] #[doc = " @param builder containing all the stream's attributes"] #[link_name = "\u{1}_ZN4oboe11AudioStreamC2ERKNS_18AudioStreamBuilderE"] pub fn oboe_Aud...
Rust
0
"""Exercise 03 Testing the Dictionary""" __author__: str = "730431256" import pytest from exercises.ex03.dictionary import invert, favorite_color, count, bin_len # Edge case: Duplicate values should raise a key error def test_invert_edge_case_duplicate_values() -> None: with pytest.raises(KeyError): inv...
Python
1
e1f}', '\u{e20}', '\u{e21}', '\u{e22}', '\u{e23}', '\u{e24}', '\u{e25}', '\u{e26}', '\u{e27}', '\u{e28}', '\u{e29}', '\u{e2a}', '\u{e2b}', '\u{e2c}', '\u{e2d}', '\u{e2e}', '\u{e2f}', '\u{e30}', '\u{e31}', '\u{e32}', '\u{e33}', '\u{e34}', '\u{e35}', '\u{e36}', '\u{e37}', '\u{e38}', '\u{e39}', '\u{e3a}', ...
Rust
0
el(n_jobs=n_jobs)( delayed(_get_env)(var_name) for i in range(2)) assert results == ["1", "1"] finally: if original_var_value is None: del os.environ[var_name] else: os.environ[var_name] = original_var_value @with_multiprocessing @parametrize('n_job...
Python
1
# coding: utf-8 """ CNB OPENAPI No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 1.0 Contact: cnb@tencent.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class m...
Python
1
""" Author: CERISARA Nathan (https://github.com/nath54) File Description: ... """ import sys import sdl2 import sdl2.ext def run(): # Initialize SDL2 if sdl2.SDL_Init(sdl2.SDL_INIT_VIDEO) != 0: print(f"SDL_Init Error: {sdl2.SDL_GetError().decode()}") return -1 # Create a window wind...
Python
1
IOT, #[clap()] IRL, #[clap()] IRN, #[clap()] IRQ, #[clap()] ISL, #[clap()] ISR, #[clap()] ITA, #[clap()] JAM, #[clap()] JEY, #[clap()] JOR, #[clap()] JPN, #[clap()] KAZ, #[clap()] KEN, #[clap()] KGZ, #[clap(...
Rust
0
you picked from some sort of online color picker //! or in Photoshop or Aseprite, then what you have is almost certainly an [`EncodedSrgb<u8>`] //! color. If you have a color that you loaded //! from a similar format but has floating point values instead of `u8` ints, then you //! almost certainly instead have a [`Enc...
Rust
0
# Copyright (c) 2024 Alibaba Inc (authors: Xiang Lyu, Zhihao Du) # # 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 appl...
Python
1
len as u32, ) }) { unsafe { libc::close(fd); } return Err(err); } let stream = unsafe { std::os::unix::net::UnixStream::from_raw_fd(fd) }; Ok(BluetoothStream { inner: stream, proto, }) ...
Rust
0
import os from dotenv import load_dotenv load_dotenv() bot_token = os.getenv("TELEGRAM_BOT_TOKEN") openweather_api_key = os.getenv("OPENWEATHER_API_KEY") nutrition_api_id = os.getenv("NUTRITION_API_ID") nutrition_api_key = os.getenv("NUTRITION_API_KEY") if not bot_token: raise ValueError("Переменная окружения BO...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time : 2024/7/19 17:13 @Author : thezehui@gmail.com @File : provider_entity.py """ import os.path from typing import Any import yaml from pydantic import BaseModel, Field from internal.lib.helper import dynamic_import from .tool_entity import ToolEntity clas...
Python
1
_base_ = ['./segformer_mit-b0_8xb2-160k_geo20k-512x512.py'] checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/segformer/mit_b4_20220624-d588d980.pth' # noqa # model settings model = dict( backbone=dict( init_cfg=dict(type='Pretrained', checkpoint=checkpoint), embed_dims=64...
Python
1
(always)] fn round(r: usize, m: &[Word; 16], v: &mut [Word; 16]) { // Select the message schedule based on the round. let s = SIGMA[r]; // Mix the columns. g(v, 0, 4, 8, 12, m[s[0] as usize], m[s[1] as usize]); g(v, 1, 5, 9, 13, m[s[2] as usize], m[s[3] as usize]); g(v, 2, 6, 10, 14, m[s[4] as ...
Rust
0