text
string
label_name
string
labels
int64
import seaborn as sns def get_colour_key(): religion = ("alt.atheism", "talk.religion.misc", "soc.religion.christian") politics = ("talk.politics.misc", "talk.politics.mideast", "talk.politics.guns") sport = ("rec.sport.baseball", ...
Python
1
= tt_get_unsigned_pair(handle); (*table).xAvgCharWidth = tt_get_signed_pair(handle); (*table).usWeightClass = tt_get_unsigned_pair(handle); (*table).usWidthClass = tt_get_unsigned_pair(handle); (*table).fsType = tt_get_signed_pair(handle); (*table).ySubscriptXSize = tt_get_signed...
Rust
0
elf, type_obj: &Object, rte: &RTE) -> bool { if let Object::Interface(p) = type_obj { ptr_eq_plain(p, &rte.interface_types.borrow()[interface_index::REGEX]) } else { false } } fn get(self: Rc<Self>, key: &Object, env: &mut Env) -> FnResult { let t = &env....
Rust
0
class ConfigEmail : def __init__(self): self.config = {} # 存储配置的字典 self.load_config() # 加载配置 def load_config(self): # 加载配置 self.config = { "emails": [ # ("vaocnfl0@outlook.com", "ugh574844"), # ("kvpucde8@outlook.com", "czf543817"), # ("xxzygbwf2@outlook.com", "wl...
Python
1
cing_instance_buffer(resources.dynamic_constants, &instances); let tlas = api.resources.rt_acceleration(tlas_ref); let cb = api.cb; api.device().rebuild_ray_tracing_top_acceleration( cb.raw, instance_buffer_address, instances.len(), ...
Rust
0
"""Update merged users in abstract email logs Revision ID: 5bb555dd91eb Revises: 8e08236a529f Create Date: 2024-02-06 12:23:43.406547 """ from alembic import op # revision identifiers, used by Alembic. revision = '5bb555dd91eb' down_revision = '8e08236a529f' branch_labels = None depends_on = None def upgrade(): ...
Python
1
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import uuid from gratipay.models.team import Team as _Team class Team(object): """A :py:class:`~gratipay.models.package.Package` can have a :py:class:`~gratipay.models.team.Team` associated with it. ...
Python
1
} } //! # Gates //! Gates are used to embedded extension requirements in the type system. use std::{marker::PhantomData, ptr::NonNull}; use erupt::vk; use crate::prelude::Variant; use super::version::Version; /// Extension name for using [`vk::DeviceLoader::get_physical_device_properties2`]. pub const PROPERTIE...
Rust
0
.541746 * 100 * X2 * 9.27400968 * 0.1 + Y1 * 2.541746 * 100 * Y2 * 9.27400968 * 0.1 + Z1 * 2.541746 * 100 * Z2 * 9.27400968 * 0.1 ) print("state %d" % (i + 1)) print("f %f" % f_value) print("R %f"% r_velocity_s) print("absmiu %f ...
Python
1
[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum BinaryOps { $( $(#[$binopmeta])* $binop, )* } impl AsRef<str> for BinaryOps { fn as_ref(&self) -> &str { match self { $( ...
Rust
0
import pytest import customtkinter as ctk from beautiful_calc import * from testing.conftest import * @pytest.mark.usefixtures('app') def test_widget_visibility(app): assert app.children['!ctkbutton'].cget('text') == 'Калькулятор' assert app.children['!ctkbutton2'].cget('text') == 'Рандомайзер' assert app...
Python
1
''' ***** VERSIÓN 2 DEL EJERCICIO - UTILIZACIÓN DE LISTAS Y MÉTODOS ESPECIALES ***** 2.- Crear un programa en el que pida una oración por teclado, la cual puede tener letras tanto en mayúsculas como minúsculas. Contar la cantidad de vocales. Crear un segundo string con toda la oración en minúsculas para que sea más fác...
Python
1
} } pub fn body_fun(lex: &mut lexer::Elements, ignore: bool) -> Con<bool> { let key = if matches!(lex.curr(ignore)?.key(), KEYWORD::Symbol(_)) { lex.peek(0, ignore)?.key() } else { lex.curr(ignore)?.key() }; match key { KEYWORD::Keyword(BUILDIN::Seg) => Ok(true), KEYWORD::Keyword(BUILDIN::Var) =...
Rust
0
let mut end_of_name: usize = 0; for i in answer_start..data.len() { if data[i] & 0xc0 == 0xc0 { // i is the pointer, i + 1 is the length end_of_name = i + 2; break; } if data[i] == 0 { end_of_name = i + 1...
Rust
0
['unique_suggestions'])}") print(f"\n💡 ПРЕДЛОЖЕНИЯ:") for suggestion in analysis['unique_suggestions'][:5]: print(f" • {suggestion}") elif action == 'plan': analysis = improver.analyze_project_with_ai() ...
Python
1
G_PROXY_HOST"), push_config.get("TG_PROXY_PORT") ) proxies = {"http": proxyStr, "https": proxyStr} response = requests.post( url=url, headers=headers, params=payload, proxies=proxies ).json() if response["ok"]: print("tg 推送成功!") else: print("tg 推送失败!") def aibo...
Python
1
eshes\i\act_sotha_fabsteam.nif", 0x7523_040B, 0x8857_25F0), (r"meshes\i\act_sotha_pre_door.nif", 0x7523_040B, 0x9190_3A78), (r"meshes\i\act_sotha_oilcrane.nif", 0x7523_040B, 0xD162_2C07), (r"meshes\i\act_dwe_weather00.nif", 0x753B_130B, 0x820D_0A03), (r"meshes\i\act_dwe_powerbox00.nif", 0x753B_130B,...
Rust
0
with open("day06/input6.txt") as f: lines = [x.strip() for x in f.readlines()] def detect_loop(grid): curr_x = start_x curr_y = start_y directions = [(-1, 0), (0, 1), (1, 0), (0, -1)] curr_dir = 0 seen_poses = set() while 0 <= curr_x < len(lines) and 0 <= curr_y < len(lines[0]): if (curr_x, c...
Python
1
elf; } impl<U, B> Identifier for UInt<U, B> { type Ident = Ident<Self::Table, Self::Natural>; type Table = Local; type Natural = Self; } /// Trait to access name and type description for a label. pub trait LabelName { /// Returns the label name. fn name() -> &'static str; /// Returns a string s...
Rust
0
me_controls = tk.Frame(root) frame_controls.pack(pady=10) # Nút chức năng tk.Button(frame_controls, text="Tạo dữ liệu mới" ,bg= '#99FFFF' ,command=create_new_data).pack(side=tk.LEFT, padx=5) tk.Button(frame_controls, text="Cập nhật dữ liệu",bg= '#FFCC99', command=update_data).pack(side=tk.LEFT, padx=5) tk.Button(frame...
Python
1
, ToSvgString}; use geo_types::Geometry; use geo_wkt_writer::ToWkt; use wasm_bindgen::prelude::*; use wasm_bindgen::JsValue; use wkt::Wkt; /// Convert an SVG element into a WKT representation. /// This function can read a <path>, <polygon>. <polyline>, /// <rect>, and <line>, all other SVG elements will return /// and...
Rust
0
fn version_new_handles_two_components() { let u = Version::from("1.0"); let v = Version::from("1-0"); let w = Version::from("1_0"); assert_eq!(&u.parts, &[Part::Num(1), Part::Num(0)]); assert_eq!(&v.parts, &u.parts); assert_eq!(&w.parts, &u.parts); } #[test]...
Rust
0
o g@sBz ddlmZWdSey ddlmZedefiZYdSw))ABC)ABCMetarN)abcr ImportErrorrobjectrrbC:\Users\devid\Desktop\Daily-Practice\Attendance App\venv\lib\site-packages\openpyxl\compat\abc.py<module>s   
Python
1
div></div>')) assert stats == {} def test_fb_roster_string_representation(self): expected = """Toby Alderweireld (f7d50789) Davinson Sánchez (da7b447d) Serge Aurier (5c2b4f07) Dele Alli (cea4ee8f) Lucas Moura (2b622f01) Son Heung-min (92e7e919) Harry Winks (2f7acede) Paulo Gazzaniga (63d17038) Har...
Python
1
import functools from collections import OrderedDict #averages all of the given state dicts class mime(): def __init__(self, config): self.algorithm = "Mime" self.lr = 1.0 self.momentum = 0.9 def aggregate(self,server_model_state_dict, optimizer_state, state_dicts, gradients_x): ...
Python
1
errno.ECONNREFUSED: print( 'Connection refused during wait. ' 'This will be retried with a subsequent wait.' ) return 0 elif e.errno in (errno.EAGAIN, errno.EACCES): print( 'Status currently being modified and cannot be read right now. ' ...
Python
1
""" 静态url:一般html结尾的都是静态的url,每个网页有真实的物理路径,存在服务器中 优点:对seo有加分影响,因为打开速度快 缺点:太多的静态网页,占用硬盘空间 动态url:类似php,asp,py等结尾的,或者带有?id=5类似的url,动态生成的url,每个url只是逻辑地址,并不是真正存在服务器中的 优点:修改网页方便,因为是逻辑地址,所以占用硬盘空间少 缺点:因为需要运算,所以打开速度稍慢 伪静态url:xxx/coure/95.html看起来是一个静态的url,但是并不存在真实的物理地址在服务器中 优点和...
Python
1
): pattern_mriqc = r"sub-(?P<subid>[^_]+)(_ses-(?P<ses>[^_]+))?(_run-(?P<run>[^_]+))?_T1w.html" if subjectslist: for key, value in subjectslist.items(): imgid = value.get("imgid") pattern = f"sub-{imgid}_T1w.html" file = os.path.join(mriqc_dir,...
Python
1
import sys input = sys.stdin.readline from collections import deque n = int(input()) # 노드 개수 graph = [[] for _ in range(n+1)] # 인접 리스트 # 데이터 저장 - (노드, 가중치) 함께 저장 for _ in range(n): data = list(map(int, input().split())) index = 0 s = data[index] index += 1 while True: e = data[index] ...
Python
1
inputs: vec![0], expected_success: true, expected_output: vec![0], }, Run{ code: "3,3,1105,-1,9,1101,0,0,12,4,12,99,1".to_owned(), inputs: vec![100], expected_success: true, expected_outpu...
Rust
0
::*; use utils::vk_ptr::*; use utils::vk_traits::*; use vulkan::vk::*; use vulkan::vk::{VkStructureType,RawVkStructureType}; /// Wrapper for [VkDescriptorSetVariableDescriptorCountLayoutSupport](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorSetVariableDescriptorCountLayoutSupport.ht...
Rust
0
) { continue; } // Check that value in direction is smaller if self.pidx[(i as i8 + dir) as usize] > n { continue; } if let Some(lm) = largest_movable { if n > self.pidx[lm] { largest_movable ...
Rust
0
) > 0: flag = 1 print( "The (%d,%d,%d) is not reached" % (x, y, z) ) ...
Python
1
32, pub lod_zoom_factor: f32, pub mysterious_data_1: Option<u32>, pub mysterious_data_2: Option<u32>, } /// Implementation of "RigidModel" impl RigidModel { /// This function reads the data from a Vec<u8> and decode it into a RigidModel. This CAN FAIL, /// so we return Result<RigidModel, Error>. ...
Rust
0
ION = "execute" CATEGORY = "ControlNet Preprocessors" def execute(self, image): _, H, W, _ = image.shape return (W, H) NODE_CLASS_MAPPINGS = { "PixelPerfectResolution": PixelPerfectResolution, "ImageGenResolutionFromImage": ImageGenResolutionFromImage, "ImageGenResolutionFromL...
Python
1
# ---------------------------------------------------------------------------------------------------------------------- def main(): app = QApplication(sys.argv) dlg = WrapperQDialog(InterfaceSelectUi()) dlg.exec() # -------------------------------------------------------------------------------------...
Python
1
, :] ), dim=1) if self.prompt_config.FILTER: x = self._filter_ops(i, x) x = self.blocks[i](x) if self.prompt_config.FILTER: x = self._filter_ops(-1, x) norm_func = self.norm if self.prompt_config.VIT_POOL_TYPE == ...
Python
1
from copy import deepcopy from django.db import models from django.utils.translation import gettext_lazy as _ from django_filters import filterset from .. import compat from .filters import BooleanFilter, IsoDateTimeFilter FILTER_FOR_DBFIELD_DEFAULTS = deepcopy(filterset.FILTER_FOR_DBFIELD_DEFAULTS) FILTER_FOR_DBFI...
Python
1
"""Load a garden dataset and create a grapher dataset.""" import owid.catalog.processing as pr from owid.datautils.dataframes import map_series from etl.helpers import PathFinder # Get paths and naming conventions for current step. paths = PathFinder(__file__) # Item codes that should add up to "Meat, Total", as we...
Python
1
for sel in r.selectors.iter() { for test in sel.tests.iter() { let (tag_name, value_matters) = match test { Test::Unary { ref tag_name, ref test_type, } => { ...
Rust
0
n() + 1))) .map(|s| s.to_string_lossy())) { Ok(()) => 0, Err(err) => err, } } #[no_mangle] pub unsafe extern "stdcall" fn DeleteFilesW(PackedFile: *mut WCHAR, DeleteList: *mut WCHAR) -> c_int { match modify_archive(OsString::from_wide(slice::from_raw_parts(PackedFil...
Rust
0
fmt::Debug, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("ArchivedBox").field(&self.0).finish() } } impl<T: ArchivePointee + ?Sized> ArchivedBox<T> { /// Gets the value of this archived box as a pinned mutable reference. pub fn get_pin(self: Pin<&mut Self>) -> Pin...
Rust
0
on to # present a user-friendly message. All other errors are surfaced as-is. except apitools_exceptions.HttpBadRequestError as error: e2e_integrity.ProcessHttpBadRequestError(error) if self._PerformIntegrityVerification(args): self._VerifyResponseIntegrityFields(req, resp) try: log....
Python
1
import sys from awsglue.transforms import * from awsglue.utils import getResolvedOptions from pyspark.context import SparkContext from awsglue.context import GlueContext from awsglue.job import Job from awsglue import DynamicFrame def sparkSqlQuery(glueContext, query, mapping, transformation_ctx) -> DynamicFrame: ...
Python
1
("16", "Gunma / 群馬"), ("17", "Yamanashi / 山梨"), ("18", "Shizuoka / 静岡"), ("19", "Gifu / 岐阜"), ("20", "Aichi / 愛知"), ("21", "Triple / 三重"), ("22", "Kyoto / 京都"), ("23", "Shiga / 滋賀"), ("24", "Nara / 奈良"), ("25", "Osaka / 大阪"), ("26", "Wakayama / 和歌山"), ("27", ...
Rust
0
_SET_MSECS: raw::c_uint = 3; pub const G_SLICE_CONFIG_COLOR_INCREMENT: raw::c_uint = 4; pub const G_SLICE_CONFIG_CHUNK_SIZES: raw::c_uint = 5; pub const G_SLICE_CONFIG_CONTENTION_COUNTER: raw::c_uint = 6; pub type GSliceConfig = Enum_Unnamed80; pub type Enum_Unnamed81 = raw::c_uint; pub const G_SPAWN_ERROR_FORK: raw::c...
Rust
0
> { if self.log_to_file { let file = OpenOptions::new() .create(true) .append(true) .open(&self.file_path.as_ref().unwrap()); let mut file = match file { Ok(f) =>...
Rust
0
#!/usr/bin/env python3 ''' Description:takes a float n as argument and returns the floor of the float Parameter: n: float ''' def floor(n: float) -> int: ''' Return largest int value less than or equal to n. ''' return int(n) if n >= 0 else int(n) - 1
Python
1
# 3 method of writing variable name # 1. Underscore b/w words(work as a space) -> year_to_check # 2. Camel Case (first ch of 1st word is small and first ch of later words is capital) -> yearToCheck # 2. Pascal Case (first ch of all words is capital) -> YearToCheck # Part 1: Conditional Statements (20 Questions) # # ...
Python
1
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("Config") } } /// Private key, DER-encoded ASN.1 in either PKCS#8 or PKCS#1 format. #[derive(Clone)] pub struct PrivateKey(rustls::PrivateKey); impl PrivateKey { /// Assert the given bytes are DER-encoded ASN.1 in either PKCS#8 or...
Rust
0
except VersionedText.DoesNotExist: new_version_number = 1 updated_content = text.content for word in known_words: unknown_word = UnknownWord.objects.filter(word=word, text=text).first() if unknown_word and unknown_word.is_typo and unknown_word.correct_form: updated_content =...
Python
1
from Modules.messages import Messages from Modules.Api import FireBaseApi import requests messages = Messages() class Exames: def __init__(self): response = FireBaseApi.fetchApi() self._exames = response def searchExames(self, exameInput): messages.applicationDivisor() messa...
Python
1
""" GTSAM Copyright 2010-2019, Georgia Tech Research Corporation, Atlanta, Georgia 30332-0415 All Rights Reserved See LICENSE for the license information Stereo VO unit tests. Author: Frank Dellaert & Duy Nguyen Ta (Python) """ import unittest import numpy as np import gtsam from gtsam import symbol from gtsam.util...
Python
1
from typing import Optional, List from telethon.tl.custom import Message from kantek import Database from kantek import Client from kantex.md import * from kantek import k, Command @k.command('ungban', delete=True) async def ungban(client: Client, db: Database, msg: Message, args: List) -> Optional[KanTeXDocument]:...
Python
1
dot -h` for help."), }, }; let (_, gfa_graph) = gfa.into_digraph()?; gfa_graph.dot(gfa)?; Ok(()) } <reponame>grafeia/ReX use std::cmp::{min, max}; use super::builders; use super::convert::AsLayoutNode; use super::{Alignment, Layout, LayoutNode, LayoutSettings, LayoutVariant, Style, ColorCha...
Rust
0
It is both a basis and a lowest common denominator of many other encodings * including UTF-8, which Rust internally assumes. */ #[deriving(Clone)] pub struct ASCIIEncoding; impl Encoding for ASCIIEncoding { fn name(&self) -> &'static str { "ascii" } fn encoder(&self) -> ~Encoder { ASCIIEncoder::new() } ...
Rust
0
|| isdigit(c) } /// Checks if a given character is a space character (i.e., ' ', \t, \n, \r). #[inline] pub fn isspace(c: u8) -> bool { match c { b' ' | b'\t' | b'\n' | b'\r' => true, _ => false } } pub unsafe fn strtof<'a>(s: &'a [u8]) -> Result<(f32, Option<&'a [u8]>), ParseNumErr> { let (val, r...
Rust
0
: default_vec.clone().into(), effective: default_vec.clone().into(), inheritable: default_vec.clone().into(), permitted: default_vec.clone().into(), ambient: default_vec.into(), } } } <reponame>remilauzier/rendy //! //! The mighty triangle example. //! This ex...
Rust
0
nite", "--no-playlist", "--ignore-config", "--no-warnings", uri.as_str(), "-o", "-", ]; let youtube_dl_output = TokioCommand::new("youtube-dl") .args(&ytdl_args) .stdin(Stdio::null()) .output() .await?; let json = std::str::fr...
Rust
0
s to the MIB builder mibBuilder.exportSymbols( "IPFIX-SELECTOR-MIB", **{"ipfixSelectorMIB": ipfixSelectorMIB, "ipfixSelectorObjects": ipfixSelectorObjects, "ipfixSelectorFunctions": ipfixSelectorFunctions, "ipfixFuncSelectAll": ipfixFuncSelectAll, "ipfixFuncSelectAllAvail": ipfixFun...
Python
1
# Copyright 2019 typed_python Authors # # 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 applicable law or a...
Python
1
import adsk.core import adsk.fusion import traceback class ExtrudeCreator: def __init__(self, profile, distance, operation_type): self.profile = profile self.distance = distance self.operation_type = operation_type app = adsk.core.Application.get() self.design = app.activeP...
Python
1
IZE) } } /// Support deserialization from x86_64 bytes impl<'bytes> TryFrom<&'bytes [u8]> for Attributes { type Error = EncodingError; fn try_from(src: &[u8]) -> Result<Self, EncodingError> { if src.len() < ATTRIBUTES_SIZE { return Err(EncodingError::InvalidInputLength); } ...
Rust
0
# This file was auto-generated by Fern from our API Definition. from ..core.unchecked_base_model import UncheckedBaseModel from ..core.pydantic_utilities import IS_PYDANTIC_V2 import typing import pydantic class ChatStreamEventType(UncheckedBaseModel): """ The streamed event types """ if IS_PYDANTIC...
Python
1
from datetime import datetime from app import db class ArxivTrack(db.Model): __table_args__ = {"schema": "tracking"} __tablename__ = "arxiv_record" id = db.Column(db.BigInteger, primary_key=True) arxiv_id = db.Column(db.Text) created_at = db.Column(db.DateTime) first_tracked_at = db.Column(db....
Python
1
crate features to be activated: `AudioParam`, `GainNode`*"] pub fn gain(this: &GainNode) -> AudioParam; #[cfg(feature = "BaseAudioContext")] #[wasm_bindgen(catch, constructor, js_class = "GainNode")] #[doc = "The `new GainNode(..)` constructor, creating a new instance of `GainNode`."] #[doc = ""] ...
Rust
0
t.tab_pane).disabled = False except NoMatches: return def disable_tab(self, tab_id: str) -> None: """Disables the tab with the given ID. Args: tab_id: The ID of the [`TabPane`][textual.widgets.TabPane] to disable. Raises: Tabs.TabError: If there...
Python
1
event" field_type={TextFieldType::Time} /> <MatTextField outlined=true label="Outlined" icon_trailing="delete" /> </div> }}); let without_label = with_raw_code!(without_label { html! { <div class="demo-group-spaced"> <MatTextField helper="Helper Text" /> ...
Rust
0
im_model query, _ = self.sequence_layer(embed) query = query.permute(0, 2, 1).contiguous() key = out_enc.view(n, c_enc, h * w) if self.encode_value: value = key else: value = feat.view(n, c_feat, h * w) mask = None if valid_ratios is not ...
Python
1
crate::rustfmt; use proc_macro2::TokenStream; use std::{fs::File, io::Write, path::Path}; /// Type-safe contract bindings generated by a `Builder`. This type can be /// either written to file or into a token stream for use in a procedural macro. pub struct ContractBindings { /// The TokenStream representing the c...
Rust
0
= WSP / (c-nl WSP) /// ``` fn c_wsp<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, &'a str, E> { alt((recognize(WSP), recognize(tuple((c_nl, recognize(WSP))))))(input) } // ------------------------------------------------------------------------------------------------- fn bin_u32<'a, E: ParseEr...
Rust
0
image) => image, Err(dif_error) => match dif_error { DifCodeError::InternalCapacityReached(num_bits_successful) => { message_bytes.truncate(num_bits_successful / 8); encode_into_image(&message_bytes, &original_image, &allowed_changes_map).expect("encoding/saving faile...
Rust
0
, cl, color) self.update_canvas() self.in_tick = False if self.is_active: QTimer.singleShot(SPEED_BLOCKS, self.tick) def load_file(self): global addfind filePath, _ = QFileDialog.getOpenFileName(self, "Open File", "", "All Files (*);;BF Files (*.bf);;Text F...
Python
1
: Sized + private::Sealed + Div<Output = Self> + Neg<Output = Self> + Mul<Output = Self> + Add<Output = Self> + PartialEq + PartialOrd + Default + Clone + Copy + Debug + Display { const INFINITY: Self; const NEG_INFINITY: Self; const NAN: Self; const N...
Rust
0
> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } #[doc = "Field `DMA_APBPERI_I2S0_PMS_CONSTRAIN_SRAM_WORLD_0_PMS_2` reader - dma_apbperi_...
Rust
0
use edb::{Engines, CausetEngine, MuBlock, WriteBatch, WriteBatchExt, WriteOptions}; use edb::{Causet_DEFAULT, Causet_DAGGER, Causet_VIOLETABFT, Causet_WRITE}; use futures::compat::Future01CompatExt; use futures::FutureExt; use ekvproto::import_sst_timeshare::SstMeta; use ekvproto::meta_timeshare::{self, Brane, BraneEpo...
Rust
0
de: &NodeProto) -> TractResult<Box<Op>> { let axis = node.get_attr_opt("axis")?.unwrap_or(1); Ok(Box::new(tractops::array::Flatten::new(axis))) } pub fn gather(node: &NodeProto) -> TractResult<Box<Op>> { let axis = node.get_attr_opt("axis")?.unwrap_or(0); Ok(Box::new(tractops::array::Gather::new(axis))...
Rust
0
noise_source_c(gr.GR_GAUSSIAN, 1.0/10) # Generate a complex sinusoid #source = gr.file_source(gr.sizeof_gr_complex, 'foobar2.dat', repeat=True) src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, -500e3, 1) src2 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 500e3, 1) src3 = gr.sig_source_c (input_rate, gr....
Python
1
p, tt); } unsafe fn get1(d: usize, p: *const Self) -> Trint1 { let tt = Self::get_tbit(d, p); let (r, _) = mods1(tt.0 as i32); r } unsafe fn put3(d: usize, p: *mut Self, t: Trint3) { let q0 = t.0 as i32; let (r0, q1) = mods1(q0); Self::put1(d + 0, p, r0)...
Rust
0
import collections import logging import random from typing import Any, Callable, Dict, Generic, Optional, Sequence, Tuple import instancelib as il from allib.activelearning.poolbased import PoolBasedAL from allib.environment.base import AbstractEnvironment from allib.typehints.typevars import DT, IT, KT, LT, RT, VT f...
Python
1
y[-1][0,-1].shape}') print(f'max error: {[np.max(np.abs(x[i]-x_recon[i])) for i in range(len(x))]}') print(f"------------test Object Combine:---------------------") trans_object_combine =trans_Object_Combine() x = (np.random.randn(2, 26, 101),np.random.randn(2, 26, 1),convert_last_Ndim_to_object(np.ran...
Python
1
iform(false).map(|v| v * &scale + &lower) } else { Ok(v.clone()) }) } // utility trait to impute with a constant, regardless of the representation of null pub trait ImputableDomain: Domain { type Imputed; fn impute_constant<'a>(default: &'a Self::Carrier, constant: &'a Self::Imputed) -> &'a Self::Imput...
Rust
0
; let public_key = engine .load_public_key(&key_handle) .map_err(|_| edgelet_http::error::server_error("failed to load edge ca public key"))?; Ok((private_key, public_key)) } fn edge_ca_extensions( ) -> Result<openssl::stack::Stack<openssl::x509::X509Extension>, openssl::error::ErrorStack> { ...
Rust
0
def circular_shift(x, shift): """Circular shift the digits of the integer x, shift the digits right by shift and return the result as a string. If shift > number of digits, return digits reversed. >>> circular_shift(12, 1) "21" >>> circular_shift(12, 2) "12" """ digits = str(x) s...
Python
1
} }); let sim = Sim::new(&model).with_config(default_config().with_max_schedules(3)); let result = sim.check(); assert_eq!(3, total_runs.borrow().get("a")); assert_eq!(3, total_runs.borrow().get("b")); assert_eq!(6, total_runs.borrow().get("c")); assert_eq!(Pass, result); } #[tes...
Rust
0
def event_handler(obj, event): if event == lv.EVENT.VALUE_CHANGED: print("State: %s" % ("On" if obj.get_state() else "Off")) # Create styles for the switch bg_style = lv.style_t() indic_style = lv.style_t() knob_on_style = lv.style_t() knob_off_style = lv.style_t() lv.style_copy(bg_style, lv.style_pretty)...
Python
1
import socket import argparse host = '10.252.132.146' def echo_client(port): """A Simple echo client""" # Create a TCP/IP socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # connect the socket to the server server_address = (host, port) print("connecting to %s port %s" % server_...
Python
1
catenate([center[..., [0]] + x1, center[..., [1]] + y1], axis=-1) p2 = np.concatenate([center[..., [0]] + x2, center[..., [1]] + y2], axis=-1) p3 = np.concatenate([center[..., [0]] - x1, center[..., [1]] - y1], axis=-1) p4 = np.concatenate([center[..., [0]] - x2, center[..., [1]] - y2], axis=-1)...
Python
1
"""The command for creating a metric entry.""" from jupiter.core.domain.concept.metrics.metric import Metric from jupiter.core.domain.concept.metrics.metric_entry import MetricEntry from jupiter.core.domain.core.adate import ADate from jupiter.core.domain.features import WorkspaceFeature from jupiter.core.domain.stora...
Python
1
""" Know more, visit my Python tutorial page: https://morvanzhou.github.io/tutorials/ My Youtube Channel: https://www.youtube.com/user/MorvanZhou Dependencies: tensorflow: 1.1.0 matplotlib numpy """ import tensorflow as tf import matplotlib.pyplot as plt import numpy as np tf.set_random_seed(1) np.random.seed(1) LR ...
Python
1
# Copyright (C) 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import pytest import sys from conftest import logger, SAMPLES_PY_DIR, SAMPLES_CPP_DIR, SAMPLES_C_DIR, MODELS from test_utils import run_sample class TestChatSample: @pytest.mark.llm @pytest.mark.samples @pytest.ma...
Python
1
(); pub(crate) macro Set_initial_values_of_key_variables($globals:expr) { crate::section_0074::Set_initial_values_of_key_variables_0074!($globals); crate::section_0215::Set_initial_values_of_key_variables_0215!($globals); crate::section_0254::Set_initial_values_of_key_variables_0254!($globals); crate:...
Rust
0
) ) }, issue_1684_2, " const cache = {} async function getThing(key) { const it = cache[key] || (await fetchThing(key)) return it } function fetchThing(key) { return Promise.resolve(key.toUpperCase()).then(val => (cache[key] = val)) } ", " var rege...
Rust
0
. let filter_plan = FilterPlan::create_from(predicates.iter().cloned()).unwrap_or_else(|err| { panic!("Temporal predicate error: {:?}", err); }); let (ok_collection, err_collection) = self.collection(input).unwrap(); let (oks, err...
Rust
0
= {corrected_p:.5f} {significance}") print(f" Mean {group_labels[i]}: {mean_i:.2f}%, Mean {group_labels[j]}: {mean_j:.2f}%") if not found_significant: print(" No significant pairwise comparisons found.") print("\nSignificance levels:") print(" * p < 0.05") print("...
Python
1
to Celsius.") .required(true) .takes_value(true)) .arg(Arg::with_name("mt") .short("m") .long("mt") .value_name("MEASUREMENT TEMPERATURE") .help("Measurement temperature with unit (C, F, K, etc.). Defaults ...
Rust
0
; let data = &mut self.data; data.for_each_mut(|item, index| { let mut d = Ctx::new(ctx.to_owned(), item.to_owned()); cb(&mut d, index); if !ctx.same(&d.ctx) { *ctx = d.ctx; } if !item.same(&d.data) { *item = d.d...
Rust
0
(rich_structure), Err(Null) => set_null(), Err(err) => set_error(err), } } #[no_mangle] pub unsafe fn pefileExports(pefile: *mut PeFile) { match (*pefile).as_ref().exports() { Ok(exports) => set_json(exports), Err(Null) => set_null(), Err(err) => set_error(err), } } #[no_mangle] pub unsafe fn pefileImports...
Rust
0
"""Simple struct operations to pack and unpack numbers to strings.""" # The copyright in this software is being made available under the BSD License, # included below. This software may be subject to other third party and contributor # rights, including patent rights, and no such rights are granted under this license....
Python
1
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
Python
1