text
string
label_name
string
labels
int64
== 4: count_4 += 1 # elif i == 5: # count_5 += 1 # elif i == 6: # count_6 += 1 # else: # count_7 += 1 print(count_0) print(count_1) print(count_2) print(count_3) # print(count_4) # print(count_5) # print(count_6) # print(count_7) # 将标签写入txt文件 print(len(y_km)) # t = open('H:\\...
Python
1
representation of a single permit from a semaphore. pub struct SharedPermit { inner: Arc<Semaphore>, } impl Drop for SharedPermit { fn drop(&mut self) { self.inner.add_permits(1); } } <reponame>vkochnev/ral<filename>generator/src/device.rs use std::fmt::{Display, Formatter, Result}; use svd_parse...
Rust
0
# 2022.10.14 18:07 import re from hoshino import Service, priv from . import db,until sv_help = ''' [帮助绘图]查看帮助 '''.strip() sv = Service( name = '绘图', #功能名 use_priv = priv.NORMAL, #使用权限 manage_priv = priv.ADMIN, #管理权限 visible = True, #是否可见 enable_on_default = True, #是否默认启用 bundle = '娱乐', #属于哪...
Python
1
# Notebooks-contrib test import os import sys def bsql_start(): """ set up users to use SQL in the RAPIDS AI ecosystem > try to import BlazingContext from BlazingSQL > offer to install BlazingSQL if module not found BlazingSQL prereqs: > Conda: https://docs.blazingdb.com/docs/i...
Python
1
= prev_active continue removed_this_arm = 0 ebones = arm_obj.data.edit_bones # Build a set of bone names to keep: any bone that is directly used # and all of its ancestors (parents) must be preserved. keep_names = set(used_bones) ...
Python
1
/// ### Why is this bad? /// Concise code helps focusing on behavior instead of boilerplate. /// /// ### Example /// ```rust /// let foo: Option<i32> = None; /// match foo { /// Some(v) => v, /// None => 1, /// }; /// ``` /// /// Use instead: /// ```rust /...
Rust
0
{ pub async fn expand(self, db: &Database) -> Result<ExpandedParticipation, Error> { Ok(ExpandedParticipation { opportunity: Opportunity::load_by_uid(db, &self.opportunity) .await? .exterior, when: self.when, }) } } #[derive(Debug, serde:...
Rust
0
""" Created by HenryMa on 2020/8/27 """ __author__ = 'HenryMa' from builtins import print, int import cv2 import numpy as np from matplotlib import pyplot as plt # shape: 600 * 600 img = cv2.imread('../pic/Fig0438(a)(bld_600by600).tif', 0) # 返回的是复数 dtype.complex128 fft = np.fft.fft2(img) print("fft is: ", fft) # 平...
Python
1
} } return false; } } #[cfg(test)] mod tests { use super::Authenticator; #[test] fn test(){ let auth = Authenticator::new("abc"); assert!(auth.authenticate("bac")); assert!(!auth.authenticate("abc")); assert!(!auth.authenticate...
Rust
0
figured as an I2C Slave, and the address sent by the master is equal to the address of the slave, then this bit will be of high level."] #[inline(always)] pub fn slave_addressed(&self) -> SLAVE_ADDRESSED_R { SLAVE_ADDRESSED_R::new(((self.bits >> 5) & 0x01) != 0) } #[doc = "Bit 6 - This field cha...
Rust
0
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Sep 18 15:41:27 2018 @author: user """ import string import sys import math import os count = 0 path_orig = sys.argv[1] path_sum = sys.argv[2] path_w = sys.argv[3] length = float(sys.argv[4]) for f in os.listdir(path_orig): url_orig = os.path.join(pa...
Python
1
] as is now the case with all Tokio //! types since 1.0. //! //! We also use [Fuse] to represent optional values, just like [Option]. But //! [Fuse] provides implementations and functions which allow us to safely //! perform operations over the value when it's pinned. Exactly what's needed to //! drive a [Stream] (see ...
Rust
0
# -*- coding: utf-8 -*- """ Created on Tue Jul 01 12:20:20 2014 @author: wea """ import matplotlib import matplotlib.pyplot as plt import numpy as np from scipy import signal import math from c2cb import c2cb pname = "SavedData\\" fname = "openBCI_raw_2014-05-31_20-57-51_Robot05.txt" t_plot_sec = [0.0, 135.0] fs_Hz...
Python
1
#[allow(missing_docs)] pub fn into_any<T>(self) -> T { match self {} } } fn main() -> Result<(), Error> { log::set_logger(&LOGGER)?; log::set_max_level(MAX_LOG_LEVEL); info!("Starting"); let mut exec = fasync::Executor::new().context("error creating event loop")?; let (phys, phy_events) ...
Rust
0
a; #[derive(Serialize, Deserialize, Debug)] enum GemBSData { Config(HashMap<Section, HashMap<String, DataValue>>), SampleData(HashMap<String, HashMap<Metadata, DataValue>>), Contigs(Vec<Contig>), ContigPools(HashMap<Rc<String>, ContigPool>), } struct GemBSFiles { config_dir: PathBuf, config_file: PathBuf, gem_...
Rust
0
ype: :class:`ResourceDescriptor` :returns: A resource descriptor. """ return cls( name=info['name'], type_=info['type'], display_name=info.get('displayName', ''), description=info.get('description', ''), labels=tuple(LabelDescriptor._fr...
Python
1
foo in another scope should add a definition scope.declare(Identifier::from("foo"), type_id); assert_eq!(scope.lookup(&Identifier::from("foo")).len(), 2); // Declaring the same name in the same scope should overwrite the // definition scope.declare(Identifier::from("foo"), type...
Rust
0
uture>(future: F) -> (KillHandle, Killable<F>) { let (send, recv) = channel(); let fut = Killable { inner: Some(future), kill: recv, }; (KillHandle { inner: AtomicTake::new(send) }, fut) } #[derive(Debug)] pub struct KillSpawn { recv: Receiver<()>, } impl KillSpawn { pub fn new(...
Rust
0
x_pool = (torch.mean(x**p, dim=-1) + 1e-12)**(1/p) else: x_pool = self.avgpool(x) x_pool = x_pool.view(x_pool.size(0), x_pool.size(1)) feat = self.bottleneck(x_pool) #Divide feature map into p parts (p=num_parts)################## part_pool_list = [] ...
Python
1
 R%SrSSKrSSKrSSKJrJrJrJr SSKrSSKJ r J r SSK J r JrJr SSKJr SSKJr \\ \\4r\R.r\R0rS q/q\\\/S4\\4\S '\R<"5r\R@...
Python
1
converts( "tests/files/interlaced_grayscale_alpha_8_should_be_grayscale_alpha_8.png", ColorType::GrayscaleAlpha, BitDepth::Eight, ColorType::GrayscaleAlpha, BitDepth::Eight, ); } #[test] fn interlaced_grayscale_alpha_16_should_be_grayscale_16() { test_it_converts( ...
Rust
0
import numpy as np #this function computes the proportion of media accurately classified in the top prop% def prop_media1(t, y_view_val, y_view_pred): n_media = int(t*len(y_view_val)) a_view = list(np.argsort(-y_view_val)[:n_media]) b_view = list(np.argsort(-y_view_pred)[:n_media]) count_view = 0 for i in rang...
Python
1
0; while if self.tx_dirty >= self.tx_clean { (self.tx_dirty - self.tx_clean) } else { DMA_DESC_TX - (self.tx_clean - self.tx_dirty) //(self.tx_dirty - self.tx_clean) & (DMA_DESC_TX - 1) } > 0 { debug!( "tx_complete, tx_dirt...
Rust
0
from collections import OrderedDict from .. import Provider as AutomotiveProvider class Provider(AutomotiveProvider): license_formats = OrderedDict( [ ("???###", 0.6), ("???##?", 0.3), ("T####", 0.03), ("??####", 0.01), ("R#####", 0.03), ...
Python
1
(entities) @staticmethod def sentences_to_instances(sentences: List[Dict]) -> List[Instance]: instances: List[Instance] = [] for sentence in sentences: dataset_split: str = sentence["split_type"] if dataset_split is None: continue split = KPIE...
Python
1
#[test] #[should_panic] fn dyn_s_with_invalid_range() { dyn_s!(2..10;0); } #[test] #[should_panic] fn dyn_s_with_invalid_ranges() { dyn_s!(2..10;0, 1..); } #[test] fn s_with_new_axis() { const INFO: SliceInfo<[ArrayIndex; 1], DimDiff<1>> = s!(NewAxis); ...
Rust
0
me: Document<'a>, types: impl IntoIterator<Item = &'a Arc<Type>>, ) -> Document<'a> { let generic_usages = collect_generic_usages(HashMap::new(), types); let generic_names: Vec<Document<'_>> = generic_usages .iter() .map(|(id, _use_count)| id_to_type_var(*id)) .collect(); docvec...
Rust
0
return "no offensive content" def is_offensive_bert(text): """ Use fine-tuned BERT model to classify text into: 'no offensive content', 'sexism', 'racism', or 'homophobia'. """ # Translate to English if needed translation = translate_to_english(text) if translation is None: retu...
Python
1
from .cartan_type import CartanType def DynkinDiagram(t): """Display the Dynkin diagram of a given Lie algebra Works by generating the CartanType for the input, t, and then returning the Dynkin diagram method from the individual classes. Examples ======== >>> from sympy.liealgebras.dynkin_d...
Python
1
oin(self.output) def visit_apispecification(self, node): self.output.append('<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:apigee="http://api.apigee.com/wadl/2010/07/" xmlns="http://wadl.dev.java.net/2009/02" xsi:schemaLocation="http:/...
Python
1
reversed_args.pop().expect("part number"); let input_file = reversed_args.pop().expect("input file"); let content = fs::read_to_string(input_file).unwrap(); let input_data: Vec<usize> = content .trim_end() .split(',') .map(|x| x.parse().unwrap()) .collect(); match part ...
Rust
0
* D) * min(dx, dy) def heuristic(self, node): # Euclidean Distance D = 1 dx = abs(node[0] - self.goal.position[0]) dy = abs(node[1] - self.goal.position[1]) return D * math.sqrt(dx * dx + dy * dy) def visualize_grid(self, cost): fig, ax = plt.subplots(...
Python
1
let entry_id = *fv.bbs.first().unwrap(); self.current_entry = entry_id; let mut blocks = fv.bbs .iter() .map(|bbid| { let block = self.build_block(&mut fcb, *bbid); (*bbid, block) }) .collect::<LinkedHashMap<MuID, B...
Rust
0
: ObjId, /// The top left point of the trim area in pixels. trim_top_left: (i16, i16), /// The size of the trim area in pixels. trim_size: (u16, u16), /// The top left point to be rendered in pixels. draw_point: (i16, i16), }, /// `#BANNER [filename]`. Defines the...
Rust
0
for name in filters: link += f"{name}={filters[name]}&" link = link[:-1] if start_from: filters["continue"] = start_from locale = locale or self._profile_parse_locale if isinstance(self.client, AsyncClient): response = await self.client.post(li...
Python
1
rait when working with generic /// Coproducts or Folders of unknown type. If the type of everything is known, /// then `co.fold(folder)` should "just work" even without the trait. /// /// [`Coproduct::fold`]: enum.Coproduct.html#method.fold pub trait CoproductFoldable<Folder, Output> { /// Use functions to fold a c...
Rust
0
r""" Gurobi Solver for CVRP """ # Copyright (c) 2024 Thinklab@SJTU # ML4CO-Kit is licensed under Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # http://license.coscl.org.cn/MulanPSL2 # THIS SOFTWARE IS PROVIDED ON AN "AS...
Python
1
rowed<Clock> = from_glib_borrow(ptr); imp.internal_time(wrap.unsafe_cast_ref()).into_glib() } unsafe extern "C" fn clock_wait<T: ClockImpl>( ptr: *mut ffi::GstClock, id: *mut ffi::GstClockEntry, jitter: *mut ffi::GstClockTimeDiff, ) -> ffi::GstClockReturn { let instance = &*(ptr as *mut T::Instanc...
Rust
0
mout: TMO) -> ER; pub fn rcv_pdq(pdqid: ID, p_data: *mut isize, p_datapri: *mut PRI) -> ER; pub fn prcv_pdq(pdqid: ID, p_data: *mut isize, p_datapri: *mut PRI) -> ER; pub fn trcv_pdq(pdqid: ID, p_data: *mut isize, p_datapri: *mut PRI, tmout: TMO) -> ER; pub fn ini_pdq(pdqid: ID) -> ER; pub fn r...
Rust
0
_or_proc).cons($car, inner).unwrap() }} } pub mod tokens; pub mod lex; pub mod trees; pub mod parse; pub mod either { pub enum Either<L, R> { Left(L), Right(R), } } pub mod grammar { include!(concat!(env!("OUT_DIR"), "/parser/grammar.rs")); } #[doc = r"Register block"] #[repr(C)] pub s...
Rust
0
"""Utility methods for test.""" import logging from contextlib import contextmanager from copy import deepcopy from unittest.mock import MagicMock, Mock class DeepCopyMagicMock(MagicMock): """Derive a new MagicMock doing a deepcopy of args to calls. MagicMocks store a reference to a mutable object - so on mu...
Python
1
e) # Push the file success = AndroidFilesystem.push_file_to_package(conn, test_path) self.assertTrue(success) # Validate it pushed OK data = conn.adb_runas('ls', test_file) self.assertEqual(data.strip(), test_file) # Copy the file with tempfile.Temporar...
Python
1
on kernel.") return "flex-fmha" raise NotImplementedError( "NATTEN could not find a suitable backend for this FMHA use case. " "Run with NATTEN_LOG_LEVEL=DEBUG to find out why." ) def get_compatible_backends( query: Tensor, key: Tensor, value: Tensor, torch_compile: bool ) -> List...
Python
1
> s, Source { msl_10: s, .. } if s != EMPTY && revision >= 10 => s, _ => return Err(SelectError(backend)), } } #[cfg(feature = "vulkan")] Backend::Vulkan => { match *self { Source { vulkan: s,...
Rust
0
from random import random from subprocess import Popen task = [ " -task mt1n -dataset en-fr", " -task mt1n -dataset en-zh", " -task mtn1 -dataset fr-en", " -task mtn1 -dataset zh-en" ] cuda_range = [0,3,1,2] i = 0 bag = [] base = "PYTHONPATH=./ python src/recom_search/scripts/run_pipeline.py -nexa...
Python
1
let client_id = matches.value_of("CLIENT_ID") .map(|x| x.to_owned()) .unwrap_or_else(generate_client_id); let channel_filters: Vec<(TopicFilter, QualityOfService)> = matches.values_of("SUBSCRIBE") .unwrap() .map(|c| (To...
Rust
0
) } #[no_mangle] pub extern "C" fn free_bytes() -> usize { memory_manager::free_bytes(&SINGLETON) } #[no_mangle] pub extern "C" fn total_bytes() -> usize { memory_manager::total_bytes(&SINGLETON) } #[no_mangle] pub extern "C" fn is_live_object(object: ObjectReference) -> bool{ object.is_live() } #[no_ma...
Rust
0
theta_help = "Explore intermediate angles for deeper understanding" else: theta_step = 1 theta_help = "Fine-tune angles for advanced analysis" theta = st.slider( "**Polar Angle θ** (degrees)", min_value=0, max_v...
Python
1
elif isinstance(prompt_msg,dict): desearlize_prompt_msgs.append(Msg(**prompt_msg)) # parse name int for msg in desearlize_prompt_msgs: if isinstance(msg.name, int): msg.name = str(msg.name) p...
Python
1
args(&["submodule", "update", "--init"]) .status(); } cc::Build::new() .include("resources/libfvad/src") .include("resources/libfvad/src/vad") .include("resources/libfvad/src/signal_processing") .file("resources/libfvad/src/signal_processing/division_operations.c") ...
Rust
0
s.add(ProgressBar::new(file_count)); let error_progress = multi_progress.add(ProgressBar::new(file_count)); main_progress.set_style( ProgressStyle::default_bar().template("{wide_bar:.green} {pos}/{len} ({per_sec})"), ); in_place_progress .set_style(ProgressStyle::default_bar().template(...
Rust
0
ed with -m") # Execute a module sys.argv[:] = [ns.module, *ns.args] runners.run_module(ns.module, profile=ns.profile) elif ns.cmd is not None: # Execute a cmd sys.argv[:] = ["-c", *ns.args] runners.run_source( ns.cmd, profile=ns.profile, line_profile=ns.li...
Python
1
vcpu has been saved /// and can therefore be used by other pcpus. #[no_mangle] pub unsafe extern "C" fn api_regs_state_saved(current: *const VCpu) { let mut current = ManuallyDrop::new(VCpuExecutionLocked::from_raw(current)); if (*current).vm().id != HF_PRIMARY_VM_ID { ManuallyDrop::drop(&mut current);...
Rust
0
ass__,), ) self._data_store = {} self._check_type = _check_type self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__cla...
Python
1
import datetime import elo import ncaaf_test import reader matches = reader.read_matches("ncaaf_matches.txt") hfa = 65 elo_ratings, arr, dates, total_results, dif \ = elo.calculate_elo_ratings(matches, initial_elo=1000, home_field_advantage=hfa, k=76, season_reset=False, end_date=d...
Python
1
self.to_string()) } } }; } /// Helper macro to implement deserialization from both numeric values or their /// base16 (hex) / base10 representations as string. Implements `FromStr` and /// `Deserialize`. macro_rules! impl_hex_de { ($type:ident, $num:ident) => { impl ::std::str::From...
Rust
0
z0-9|]+)"', resp.text).group(1) resp = session.post(url, {'username': 'abc', 'password': '1234', 'password_again': '1234', '_xsrf': xsrf}) self.assertTrue(u'账户创建成功!' in resp.text) # user exists resp = session.get(url) xsrf = re.search(r'"_...
Python
1
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing_extensions import Literal from ...._models import BaseModel from .image_file import ImageFile __all__ = ["ImageFileContentBlock"] class ImageFileContentBlock(BaseModel): image_file: ImageFile type: Literal["i...
Python
1
cr } else { assert!(r >= 0); //let cr = Some(self.tree.samples(r).unwrap()); let cr = Some(unsafe { *(*self.tree.as_ptr()).samples.offset(r.0 as isize) }.into()); //self.next_sample_index = s...
Rust
0
# -*- coding: utf-8 -*- from opinel.utils.globals import manage_dictionary from AWSScout2.configs.regions import RegionalServiceConfig, RegionConfig, api_clients from AWSScout2.configs.vpc import VPCConfig ######################################## # EMRRegionConfig ######################################## class EM...
Python
1
se std::collections::VecDeque; /// A [`Token`] and its associated `&str` slice; buffered from the lexer for parsing/matching. pub(crate) type BufferedToken<'input> = (Spanned<Token<'input>, ByteOffset>, &'input str); /// A minimal pratt-style parser base over [`Token`]s pub(crate) struct TokenParser<'input, 'tracker>...
Rust
0
let mut scope_3031 = writer.prefix("NetworkInsightsPathId"); if let Some(var_3032) = &input.network_insights_path_id { scope_3031.string(var_3032); } #[allow(unused_mut)] let mut scope_3033 = writer.prefix("AnalysisStartTime"); if let Some(var_3034) = &input.analysis_start_time { sco...
Rust
0
from backdoors.backdoor import * import time class Netcat(Backdoor): prompt = Fore.RED + "(nc) " + Fore.BLUE + ">> " + Fore.RESET def __init__(self, core): cmd.Cmd.__init__(self) self.intro = GOOD + "Using netcat backdoor..." self.core = core self.options = { ...
Python
1
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from fastapi.staticfiles import StaticFiles from pydantic import BaseModel import sqlite3 import os import uvicorn app = FastAPI() app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_header...
Python
1
.gen::<usize>() % n; map.insert(i, i); } // measure b.iter(|| { let k = rng.gen::<usize>() % n; map.insert(k, k); map.remove(&k); }); black_box(map); } ) } macro_rules! map_insert_se...
Rust
0
xible_version(_version: u16) -> bool {\n false \n}"); } else if api_call.min_supported_version == api_call.min_flexible_versions.unwrap() { def.push_str("fn is_flexible_version(_version: u16) -> bool {\n true \n}"); } else { def.push_str(&format!( "fn is_flexible_version(version: u16...
Rust
0
rgeCumulatedCurrentWeek(self): self.assertEqual(self.device.getElectricalEnergySystemTransferDischargeCumulatedCurrentWeek(), 3198) def test_getElectricalEnergySystemTransferDischargeCumulatedCurrentMonth(self): self.assertEqual(self.device.getElectricalEnergySystemTransferDischargeCumulatedCurrent...
Python
1
import skimage.io # bug. need to import this before tensorflow import skimage.transform # bug. need to import this before tensorflow from resnet_train import train import tensorflow as tf import time import os import sys import re import numpy as np from synset import * from image_processing import image_preprocessi...
Python
1
from setuptools import setup package_name = 'image_subscriber' setup( name=package_name, version='0.0.0', packages=[package_name], data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), ], ...
Python
1
79, 206], OperandSize::Qword, ) } #[test] fn vrsqrt14sd_4() { run_test( &Instruction { mnemonic: Mnemonic::VRSQRT14SD, operand1: Some(Direct(XMM15)), operand2: Some(Direct(XMM25)), operand3: Some(IndirectScaledIndexedDisplaced( RD...
Rust
0
query_bevs = torch.zeros(B, C, H, W).to(bevs.device) pos_bevs = torch.zeros(B, C, H, W).to(bevs.device) gt_xyr = torch.zeros(B, 3).to(bevs.device) for ndx, mask in enumerate(positives_mask): qpose = poses[ndx] qbev = bevs[ndx] query_bevs[ndx] = q...
Python
1
ng {SERVICE_NAME.upper()} service directly via __main__...") # Manually run lifespan startup steps logger.info("Running startup sequence...") model_load_info = {"status": "initializing"} load_configuration() if llm_config: downloaded_path = None try: downloaded_path = dow...
Python
1
oc = "0x80 - "] pub sar_touch_out5: crate::Reg<sar_touch_out5::SAR_TOUCH_OUT5_SPEC>, #[doc = "0x84 - "] pub sar_touch_ctrl2: crate::Reg<sar_touch_ctrl2::SAR_TOUCH_CTRL2_SPEC>, _reserved34: [u8; 0x04], #[doc = "0x8c - "] pub sar_touch_enable: crate::Reg<sar_touch_enable::SAR_TOUCH_ENABLE_SPEC>, ...
Rust
0
handle_trade(&self, data: &[u8]) { let book: BookTicker<f64> = match from_json::<BookTicker<String>>(data) { Err(e) => { ::slog::warn!( self.logger, "Failed to decode the payload: {}. Ignoring", e ); let data = String::from_utf8(Vec::from(data)) ...
Rust
0
"""smcsystem URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
Python
1
class Round(): difficulties = [ # name, key, attempts ("easy", "1", 10), ("medium", "2", 5), ("hard", "3", 3), ] def __init__(self, player, database) -> None: self.is_running: bool = False self.started: str = "" self.stoped: str = "" self.round: ...
Python
1
tIdentity wwpExtBridgeTrapMIBNotifications = _WwpExtBridgeTrapMIBNotifications_ObjectIdentity( (1, 3, 6, 1, 4, 1, 6141, 2, 41, 2, 0) ) _WwpExtBridgeTrapMIBConformance_ObjectIdentity = ObjectIdentity wwpExtBridgeTrapMIBConformance = _WwpExtBridgeTrapMIBConformance_ObjectIdentity( (1, 3, 6, 1, 4, 1, 6141, 2, 41, ...
Python
1
r { return Some((expr1, expr2)); } None } /// Active pattern match for `NOT(expr)` fragments. fn case_and(expr: &BoxScalarExpr) -> Option<(&BoxScalarExpr, &BoxScalarExpr)> { use BoxScalarExpr::*; if let CallBinary { func: mz_expr::BinaryFunc::And, expr1, expr2, ...
Rust
0
TITLE_LEN: int = 64 DESCR_LEN: int = 150
Python
1
10.1046 7 9 7M11 11V15C11 16.1046 11.8954 17 13 17C14.1046 17 15 16.1046 15 15V14M11 11H9M11 11H15M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", }, }, Shape::CurrencyDollar => rsx! { path { ...
Rust
0
pub fn count_received(&self) -> u64 { self.remote.nonce().into_u64() } /// receive message from the remote peer /// /// The output can have 16 bytes less than the input. This is because /// the MAC is appended in the input message so we can verify the /// message has not been temper...
Rust
0
); h1 == h2 } #[test] fn test() { assert!(test_compare_impls(b"")); assert!(test_compare_impls(b"x")); assert!(test_compare_impls(b"sg")); assert!(test_compare_impls(b"crc")); assert!(test_compare_impls(b"test")); } } // mod test /* * Copyright (c) 2018 <NAME> * * Permission is hereby granted, free of charg...
Rust
0
', required=True, help='Function address in the original binary, to be compared') parser.add_argument('--func_addr_patched', required=True, help='Function address in the patched binary, to be compared') parser.add_argument('--version', type=str, required=False, default='angr', help='Select the tools to use: [id...
Python
1
""" Unit tests for Bounds.handle_bounds method. """ import pytest class TestBoundsHandleBounds: """ Unit tests for Bounds.handle_bounds method. """ def test_project(self, example_bounds, point_multidimensional): handled_point = example_bounds.handle_bounds(point_multidimensional, "project") ...
Python
1
*mut BOOL, fontFileType: *mut DWRITE_FONT_FILE_TYPE, fontFaceType: *mut DWRITE_FONT_FACE_TYPE, numberOfFaces: *mut UINT32, ) -> HRESULT, }} ENUM!{enum DWRITE_PIXEL_GEOMETRY { DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_PIXEL_GEOMETRY_RGB, DWRITE_PIXEL_GEOMETRY_BGR, }} ENUM!{enum DWRITE_R...
Rust
0
d_text[:100]}...") ordered_topics, split_texts = knowledge_graph.getKnowledgeGraph(topics, combined_text) print(ordered_topics) user_id, session, vector_embeddings = vector_store.getVectorStore(ordered_topics, split_texts) memory, question_chain, hint_chain, evaluation_c...
Python
1
""" # Tiled image grid Split an image into a grid of smaller images displayed using a single image visual. --- tags: - image - texture - panzoom dependencies: - imageio in_gallery: true make_screenshot: true --- """ import imageio.v3 as iio import numpy as np import datoviz as dvz def load_image(): fi...
Python
1
import requests from requests_kerberos import HTTPKerberosAuth, OPTIONAL import tableauserverclient as TSC # Tableau server information server_url = 'https://your-tableau-server.com' site_name = '' # Leave empty for the default site csv_export_url = 'https://your-tableau-server.com/views/your_view_name.csv' # URL to...
Python
1
from django.urls import path from . import views app_name = 'subscription' urlpatterns = [ path('', views.subscriptions_list, name='subscriptions_list'), path('<int:pk>/', views.subscription_detail, name='subscription_detail'), path('checkout/', views.checkout, name='checkout'), ]
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.construct import init from .list_chat import ListChat class SearchChatResponseBody(object): _types = { "items": List[ListChat], "page_token": str, "has_more":...
Python
1
from typing import Any, Generator from Py4GWCoreLib import Map from Py4GWCoreLib.GlobalCache import GLOBAL_CACHE from Py4GWCoreLib.Pathing import AutoPathing class PathHelper: @staticmethod def __chain_paths(waypoints: list[tuple[float, float]], z: float) -> Generator[Any, None, list[tuple[float, float]...
Python
1
mut self) { self.index = (self.index + 1) % self.titles.len(); } pub fn previous(&mut self) { if self.index > 0 { self.index -= 1; } else { self.index = self.titles.len() - 1; } } } #[derive(PartialEq, Debug, Clone, Copy)] pub enum Mode { Console...
Rust
0
eption as e: print("Error sending message:", e) @staticmethod def remove_inst(text): """ Remove the '[INST]' and '[/INST]' tags from the given text. Args: text (str): The input text containing '[INST]' and '[/INST]' tags. Returns: str: The t...
Python
1
tInfoRequest::SERVICE { // Send a node information response let response = GetInfoResponse { protocol_version: Version { major: 1, minor: 0 }, hardware_version: Version { major: 0, minor: 0 }, software_version: Version { major: 0, minor: 1 }, ...
Rust
0
import time for i in range(1, 4): print(i) time.sleep(0.25)
Python
1
rounds[1:] middle_rounds_count = len(rounds) - 1 - len(recent_rounds) if middle_rounds_count > 0: compressed_middle = f"[Rounds 2-{middle_rounds_count+1} compressed: Multiple tools executed successfully, information gathered and accumulated]" else: compressed_mi...
Python
1
ph Engine // // 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, publish, distribute, sublicense, a...
Rust
0
ping_add((*xself).min_block_size_); } } } if is_final != 0 { *histograms_size = (*split).num_types; (*split).num_blocks = (*xself).num_blocks_; } } const BROTLI_MAX_STATIC_CONTEXTS: usize = 13; fn ContextBlockSplitterFinishBlock<Alloc: alloc::Allocator<u8> + alloc::Allocator<u32> + alloc::Alloc...
Rust
0
edec1878eccf12eb9f26a5fe5ec0e279423156e657a::/ip4/127.0.0.1/tcp/8000"; SeedPeer::from_str(sample).unwrap_err(); } #[test] fn it_errors_invalid_address() { let sample = "06e98e9c5eb52bd504836edec1878eccf12eb9f26a5fe5ec0e279423156e657a::/ip4/invalid/tcp/8000"; ...
Rust
0
0x0002) ClearScenaFlags(ScenaFlag(0x0000, 2, 0x2)) OP_A6(0x0002) ClearScenaFlags(ScenaFlag(0x0000, 2, 0x2)) Return() # id: 0x000C offset: 0x26DC @scena.Code('func_0C_26DC') def func_0C_26DC(): CameraMove(-7500, 0, 1700, 0) ChrSetPos(0x0101, -7950, 0, -500, 0) ChrSetPos(0x0102, -9310, 0, -3...
Python
1