text
string
label_name
string
labels
int64
as *const libc::c_char, 637i32); } else { let mut i: libc::c_int = 0i32; while i < user_session_count { let mut ret: libc::c_int = sd_session_get_class(*user_sessions.offset(i as isize), &mut class); i...
Rust
0
, team_forecast['Predicted_Score'], label='Predicted Scores', color='red' ) # Plot confidence interval (using +/- 5 as placeholder) lower_bound = team_forecast['Predicted_Score'] - 5 upper_bound = team_forecast['Predicted_Score'] + 5 # Ensure no non-finite values finite_...
Python
1
ry_run: console.print(f" • Successfully labeled: [green]{stats['labeled']}[/green]") console.print(f" • Errors: [red]{stats['errors']}[/red]") # Sender intelligence insights if sender_insights: console.print("\n[bold]🧠 Sender Intelligence Insights:[/bold]") for importance, emails...
Python
1
return None; } }; let binaryen_package = if targeting_webasm { match binaryen_package() { Some(pkg) => Some(pkg), None => { check_emscripten(); return None; } } } else { None }; let emsc...
Rust
0
Sign::Plus, vec![std::u32::MAX, std::u32::MAX, std::u32::MAX, std::u32::MAX], ), &POLICIES[4], ), ( "-340,282,366,920,938,463,463,374,607,431,768,211,455", BigInt::new( Sign::Minus, vec![std:...
Rust
0
ples along iterations # ------------------------------------------------------- pl.figure(3, (10, 10)) ivisu = [0, 10, 25, 50, 75, 125, 15, 175, 199] for i in range(9): pl.subplot(3, 3, i + 1) pl.scatter(xd[:, 0], xd[:, 1], label="Data samples from $\mu_d$", alpha=0.1) pl.scatter( xvisu[ivisu[i]...
Python
1
g/StrictMath.log(D)D", native_double_log as StaticNative ); known_natives.insert( "java/lang/String.intern()Ljava/lang/String;", // TODO Actually implement this native_nop as StaticNative ); known_natives }; } struct InterpreterStack...
Rust
0
old_coredump: break else: raise RuntimeError("No new coredump observed") # Wait for modem trace to be reported to memfault api start = time.time() while time.time() - start < MEMFAULT_TIMEOUT: now = datetime.now(timezone.utc) end_time = now.strftime("%Y-%m-%dT%...
Python
1
''' Sprinkler-Rain-WetGrass Network: Cloudy / \ Rain Sprinkler \ / WetGrass Background description: we need to decide the wetgrass is caused by rain or by sprinkler the cloudy whether affect to whether it will rain or not, and also the sprinkler rain and sprinkler both decide the ...
Python
1
_base_ = './fovea_r50_fpn_4x4_1x_coco.py' model = dict( pretrained='torchvision://resnet101', backbone=dict(depth=101), bbox_head=dict( with_deform=True, norm_cfg=dict(type='GN', num_groups=32, requires_grad=True))) # learning policy lr_config = dict(step=[16, 22]) runner = dict(type='EpochB...
Python
1
really), activity_map.as_ref(), activitiesfile, logfile, &now.time(), &now, )?; ...
Rust
0
vec![$($versions),+] .into_iter() .map(|minor| Version::new(MAJOR, minor)) .any(|v| version == v) } fn name() -> &'static str { stringify!($name) } } ...
Rust
0
from cms.plugin_pool import plugin_pool from django.utils.translation import gettext_lazy as _ from ... import settings from ...cms_plugins import CMSUIPlugin from ...common import AttributesMixin, ResponsiveMixin from .. import media from . import forms, models mixin_factory = settings.get_renderer(media) @plugin_...
Python
1
import re from markdown_it import MarkdownIt from markdown_it.common.utils import unescapeAll from ..bbcode import BBCodeBlockRule def quote_bbcode_plugin(md: MarkdownIt): md.block.ruler.before( "paragraph", "quote_bbcode", QuoteBBCodeBlockRule( name="quote_bbcode", ...
Python
1
was created pub created_at: DateTime<Utc>, } impl Reminder { pub fn ext_discussion_id(&self) -> gl::DiscussionId { gl::DiscussionId::new(&self.ext_discussion_id) } } <gh_stars>0 fn main() { let report = std::fs::read_to_string("src/bin/day03.txt") .map(|file| { file.lines()...
Rust
0
statistics" response = requests.get(url) soup = BeautifulSoup(response.text, "html.parser") remit = pd.read_html(url) remit[1]['month']= "" column_name = remit[1].columns df = pd.DataFrame() for i in range(0, len(remit), 2): # print(i) m...
Python
1
source_op, operand_size); let needle = state.get_value(&needle, operand_size); sub__(state, source, needle, operand_size); state.set_register_value(Register::RDI, state.get_register_value(Register::RDI) + if state.get_flag(Flags::Direction) { -1 } else { 1 } ); }) } pub fn jmp(state: &mut S...
Rust
0
rom_native(df_native) >>> df.unpivot(on=["b", "c"], index="a").sort("a", "variable").to_native() ┌─────────┬──────────┬───────┐ │ a │ variable │ value │ │ varchar │ varchar │ int32 │ ├─────────┼──────────┼───────┤ │ x │ b │ ...
Python
1
data_type: datatype, }, ))); } // This needs to throw a good error None } /// A simple macro for listening for a checkpoint in a test. #[macro_export] macro_rules! wait_for_checkpoint { ($checkpoint:literal, $count:literal, $client:expr) => { $client .wait() ...
Rust
0
ceCounts, faceConnects, outData) return newMesh def compute(self, plug, data): if plug == animCube.outputMesh: timeData = data.inputValue(animCube.time) tempTime = timeData.asTime() outputHandle = data.outputValue(animCube.outputMesh) dataCreator = OpenMaya.MFnMeshData() newOutputData = dataCrea...
Python
1
""" Distributed helpers. """ import os import functools import logging import pickle import torch import torch.distributed as dist import torch.multiprocessing as mp _LOCAL_PROCESS_GROUP = None def lanuch_mp_worker(main_worker, config, args): if args.dist_url == "env://" and args.world_size == -1: args...
Python
1
file=input("enter file name: ") filename=file.lower() filename=filename.strip() found=False dict={'.gif':'image/gif','.jpg':'image/jpeg','.jpeg':'image/jpeg','.png':'image/png','.pdf':'application/pdf','.txt':'text/plain','.zip':'application/zip'} for k in dict: if(filename.endswith(k)): print(dict[k]) ...
Python
1
p(1) { if let Some(arg) = arg.strip_prefix("--day=") { day = Some(arg.parse::<u32>()?); } } Ok(CliApp { day }) } } fn main() -> anyhow::Result<()> { let cli = CliApp::from_args()?; let cfg: AocCfg = toml::from_slice(&std::fs::read("aoc_cfg.toml").context("failed to read aoc_cfg.toml")?) .contex...
Rust
0
std::sync::atomic::Ordering::SeqCst); let sender = context.sender.clone(); tokio::task::spawn_blocking(move || checksum_task(path, sender, permit)); } } // Pretty-prints the sorted `checksums` in a format much like what the // `sha256sum` binary outputs. // // Note that the standard zakopane snaps...
Rust
0
LineEdit() temps_disponible_input.setPlaceholderText("Exemple : 30") layout.addRow("Temps disponible (minutes) :", temps_disponible_input) entrainements_input = QLineEdit() entrainements_input.setPlaceholderText("Exemple : 3") layout.addRow("Entraînements par semaine :", entrainements_input) eau_input = QLineEdit() ...
Python
1
ec!["123", "OR", "b"], Instruction::Or("123", "b")), (vec!["a", "LSHIFT", "2"], Instruction::Lshift("a", 2)), (vec!["a", "RSHIFT", "2"], Instruction::Rshift("a", 2)), ]; for (input, output) in test_values.iter() { assert_eq!(Instruction::new(input.to_owned()), *outpu...
Rust
0
(100))); let kitty = Kitty([59, 250, 138, 82, 209, 39, 141, 109, 163, 238, 183, 145, 235, 168, 18, 122]); assert_eq!(KittiesModule::kitties(100, 0), Some(kitty.clone())); assert_eq!(KittiesModule::next_kitty_id(), 1); assert_eq!(last_event(), Event::kitties(crate::Event::<Test>::Kitty...
Rust
0
ns available for query execution. pub struct QueryExecutionOptions<R> where R: Resolver, { /// The logger to use during query execution. pub logger: Logger, /// The resolver to use. pub resolver: R, /// Time at which the query times out. pub deadline: Option<Instant>, /// Maximum valu...
Rust
0
1, PROOF_QUALITY = 2, NONANTIALIASED_QUALITY = 3, ANTIALIASED_QUALITY = 4, // #if _WIN32_WINNT >= 0x0500 CLEARTYPE_QUALITY = 5, } #[derive(Copy)] pub enum Pitch { DEFAULT_PITCH = 0, FIXED_PITCH = 1, VARIABLE_PITCH = 2, } #[derive(Copy)] pub enum Family { FF_DECORATIVE = 80, FF...
Rust
0
this OUT endpoint. Write '1' to clear."] #[inline] pub fn epout3(&mut self) -> _EPOUT3W { _EPOUT3W { w: self } } #[doc = "Bit 20 - Acknowledged data transfer on this OUT endpoint. Write '1' to clear."] #[inline] pub fn epout4(&mut self) -> _EPOUT4W { _EPOUT4W { w: self } } ...
Rust
0
.write_all(b"weekly")?, } Ok(IsNull::No) } } impl FromSql<Text, Pg> for Frequency { fn from_sql(bytes: Option<&[u8]>) -> deserialize::Result<Self> { match not_none!(bytes) { b"daily" => Ok(Frequency::Daily), b"weekly" => Ok(Frequency::Weekly), unrecog...
Rust
0
, 0xf5, 0x0a, 0xdf, 0xfd, 0xee, 0x21, 0x99, 0xac, 0xb4, 0xe1, 0x8f, 0x5f, 0x81, 0x57, 0x82, 0xef, 0x9d, 0x96, 0x52, 0x63, 0x27, 0x18, 0x29, 0xdb, 0xb3, 0x4a, 0xfd, 0x9a, 0xda, 0x42, 0xad, 0xb5, 0x69, 0x21, 0x89, 0x0e, 0x1d, 0xc0, 0x4c, 0x1a, 0xa8, 0xaa, 0x71, 0x3e, 0x0f, 0x54, 0xb9, 0x9a, 0xe4, 0x99, 0x68, ...
Rust
0
card_states[current_flipped_cards[1]]["object"] if object1 == object2: print("Cards match! Keeping them flipped.") # If match, keep them flipped and update states objects_found[object1].remove(current_flipped_cards[0]) objects_found[object2].remove(current_flippe...
Python
1
# SPDX-License-Identifier: Apache-2.0 # flake8: noqa """Tests Model Optimizer fp8 models against ground truth generation Note: these tests will only pass on H100 """ import os import pytest from transformers import AutoTokenizer from tests.quantization.utils import is_quant_method_supported from vllm import LLM, Sam...
Python
1
IR::CCLK => 0x01, PCLK_QEIR::CCLK_DIV_2 => 0x02, PCLK_QEIR::CCLK_DIV_8 => 0x03, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> PCLK_QEIR { match value { 0 => PCLK_QEIR::CCLK_DIV_4, 1 => PCLK_QEIR::CCLK, ...
Rust
0
n exclude]) if end is None: end = len(text) else: end = end[0] + id_end return (id_start, end) def paragraphs(self, text, p_level, exclude=[]): """Return a list of paragraph offsets defined by the level param.""" def offsets_fn(remaining_text, p_idx, ...
Python
1
: {}. ", error.code, error.message)?; } Ok(()) } ClErrorKind::MissingResult(action) => { write!(f, "no cloudflare result found for {}", action) } ClErrorKind::UnexpectedNumberOfZones(zones) => { write!(f, "ex...
Rust
0
1), ("world", 42)].into_iter().collect(), }; assert!(f.validate().is_ok()); } <gh_stars>0 use iref::IriBuf; use crate::{ Id, Indexed, Object }; pub enum Expanded<T: Id = IriBuf> { Null, Object(Indexed<Object<T>>), Array(Vec<Indexed<Object<T>>>) } impl<T: Id> Expanded<T> { pub fn len(&self) -> usize { ...
Rust
0
Element51) -> FieldElement51 { let mut output = *self; fiat_25519_add(&mut output.0, &self.0, &_rhs.0); let input = output.0; fiat_25519_carry(&mut output.0, &input); output } } impl<'b> SubAssign<&'b FieldElement51> for FieldElement51 { fn sub_assign(&mut self, _rhs: &'...
Rust
0
full_tensor = torch.cat(valid_shards, dim=0) # Ensure the shape matches exactly (handle padding) if full_tensor.shape[0] > dim0_size: full_tensor = full_tensor[:dim0_size] return full_tensor def scatter_tensor(full_tensor, world_size=None, rank=None): """ Scatter a full tensor ...
Python
1
self.id )), } } } }<reponame>piotr-cla/ockam<filename>implementations/rs/vault/traits/src/error.rs use ockam_common::error::OckamError; /// Represents the failures that can occur in /// an Ockam Vault trait #[derive(Clone, Copy, Debug)] pub enum Error { /// None None, ...
Rust
0
if complete { aut.complete().to_dot() } else { aut.to_dot() }; let len = dot.len(); let dotstring = std::ffi::CString::new(dot).unwrap(); let svg = unsafe { dot_to_svg(dotstring.as_ptr() as _, len as _) }; if svg == null() { return String::new(); } let ret = u...
Rust
0
def negative_sampler_factory(code, train, val, test, user_count, item_count, sample_size, seed, save_folder): negative_sampler = NEGATIVE_SAMPLERS[code] return negative_sampler(train, val, test, user_count, item_count, sample_size, seed, save_folder)
Python
1
adt_const_params, generic_const_exprs)] use ranged_integers::*; fn move_player(dice_roll: Ranged<1, 6>) {} //! let x = r!([0 200] 20); //! let err = x.i8(); // Error: 0..=200 doesn't fit i8 //! ``` //! //! ## Array indexing, slicing and iteration //! //! The [`ConstInclusiveRange<MIN,MAX>`] zero-size type is a range `...
Rust
0
import torch import torch.testing from torch import Tensor def quaternion_slerp( input: Tensor, time: Tensor, rotation: Tensor, ) -> Tensor: r""" Interpolate between two or more points on a sphere. Unlike linear interpolation, which can result in changes in speed when interpolating betwee...
Python
1
wire. pub name: Option<String>, /// Field type. /// /// This may be a primitive, container, or a struct. pub field_type: TType, /// Thrift field id. /// /// `None` only if `field_type` is `TType::Stop`. pub id: Option<i16>, } impl TFieldIdentifier { /// Create a `TFieldIdentifi...
Rust
0
thing" def __init__( self, backbone_config=None, backbone=None, use_pretrained_backbone=False, use_timm_backbone=False, backbone_kwargs=None, patch_size=14, initializer_range=0.02, reassemble_hidden_size=384, reassemble_factors=[4, 2, ...
Python
1
import os import sys from stu_upload.layers_1 import FullyConnectedLayer, ReLULayer, SoftmaxLossLayer from stu_upload.mnist_mlp_cpu import MNIST_MLP, build_mnist_mlp import numpy as np import struct import time def evaluate(mlp): pred_results = np.zeros([mlp.test_data.shape[0]]) for idx in range(mlp.test_data....
Python
1
import numpy as np def from_catchment_to_EU(upper_left_coord, mask_small, arr_large, arr_small): # upper_left_coord: Coordinates of upper left corner [row, col] # mask: mask != nodata will be regarded as valid grid cells # arr_large: European raster # arr_small: catchment raster for r in range(...
Python
1
# app/infrastructure/uow.py from typing import Any class UoWModel: def __init__(self, model: Any, uow: "UnitOfWork"): self.__dict__["_model"] = model self.__dict__["_uow"] = uow def __getattr__(self, key): return getattr(self._model, key) def __setattr__(self, key, value): ...
Python
1
} ] print(f" ✅ 找到 {len(stanford_events)} 个Stanford活动") return stanford_events except Exception as e: print(f" ❌ Stanford搜索失败: {str(e)}") return [] def search_mit_events(self) -> List[Dict]: """搜索MIT AI活动""" ...
Python
1
lt<File, Error> { let (device_channel, client_channel) = zx::Channel::create()?; let server_pty_channel = fdio::clone_channel(server_pty) .context("failed to clone channel from server PTY FD")?; let server_pty_fidl_channel = fasync::Channel::from_channel(server_pty_channel) ...
Rust
0
ADV_RANDOM); /// assert!(ret.is_ok()); /// /// assert!(nc::munmap(addr, map_length).is_ok()); /// ``` pub fn madvise(addr: usize, len: size_t, advice: i32) -> Result<(), Errno> { let len = len as usize; let advice = advice as usize; syscall3(SYS_MADVISE, addr, len, advice).map(drop) } /// Create a director...
Rust
0
} } m.pop(); let backward = m; let mut forward = vec![std::usize::MAX; h].into_boxed_slice(); let mut value = T::zero(); for (y, &x) in backward.iter().enumerate() { if x != std::usize::MAX { forward[x] = y; value += cost_matrix[x][y]; } } ...
Rust
0
fn handle_event(&mut self, _data: StateData<'_, GameData<'_, '_>>, event: StateEvent) -> SimpleTrans { if let StateEvent::Window(event) = &event { // Check if the window should be closed if is_close_requested(&event) || is_key_down(&event, VirtualKeyCode::Escape) { retur...
Rust
0
from dataclasses import dataclass import collections import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import numpy as np import tensorflow as tf from PIL import Image import gym from gym import wrappers import matplotlib.pyplot as plt from buffer import ReplayBuffer from models import ActorNetwork, CriticNetwork ...
Python
1
* SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt /// * SDIO_IT_CMDSENT: Command sent (no response required) interrupt /// * SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt /// * SDIO_IT_STBITERR: Start bit not detected on all data signals in wide /// ...
Rust
0
', 'Win32_Storage_StructuredStorage'*"] #[cfg(feature = "Win32_Storage_StructuredStorage")] pub struct JET_OPENTEMPORARYTABLE { pub cbStruct: u32, pub prgcolumndef: *const JET_COLUMNDEF, pub ccolumn: u32, pub pidxunicode: *mut JET_UNICODEINDEX, pub grbit: u32, pub prgcolumnid: *mut u32, pub ...
Rust
0
def entrada_abastecimento(quantidade, distancia): for i in range(0,4): print("Digite a quantidade de combustível abastecida no posto " + str(i+1) + " em Litros: ") #usei o str(i+1) apenas pra ficar visualmente melhor quantidade[i] = float(input()) print("Digite a distância percorrida com o c...
Python
1
concept = gr.Textbox(label="User's Concept", value="Elon Mask") task = gr.Radio(['safety','fairness','privacy'], value='privacy', label="Subtask") slider = gr.Slider(1, 3, value=1.5, label="Granularity") image_out = gr.AnnotatedImage(label="Edited Image", height=512) runBtn = gr.Button("Run") slide...
Python
1
#!/usr/bin/python3 """ task: 0. Log parsing condition: mandatory required: Write a script that reads stdin line by line and computes metrics: Input format: <IP Address> - [<date>] "GET /projects/260 HTTP/1.1" <status code> <file size> (if the format is not this one, the line must be skipped) After every 10 lines and/o...
Python
1
import asyncio import base64 import httpx import litellm from log10.litellm import Log10LitellmLogger log10_handler = Log10LitellmLogger(tags=["litellm_image", "stream", "async"]) litellm.callbacks = [log10_handler] image_url = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Log10.png" image_media_type = "ima...
Python
1
.gl["x"]["cFruit"] # 使用 Reward Scaling 处理果实生长量, 单位是 g m^{-2} reward = cFruit_growth * 1e-3 # print(f"当前生长期的果实干物质增长量是{cFruit_growth}, 生长期奖励是{reward}") # 计算生长期的能耗 self.growth_energy_input = self.total_energy_input ...
Python
1
tos descifrados exitosamente.") return datos_descifrados.decode() # Devuelve el mensaje en texto plano # Almacenar datos cifrados en la base de datos def almacenar_datos_cifrados(mensaje): """ Almacena los datos cifrados en la base de datos, junto con el nonce y la etiqueta de autenticación. - mensaj...
Python
1
help='Number of GPUs [default: %s]' % n_gpus) parser.add_argument('-p', '--use_mps', action='store_true', help='Use Multi-Process Service [default: False]') args = parser.parse_args() file_name = None screen = False if args.log.lower() in ['file', 'both']: file...
Python
1
ARD_REPEATS: usize = 4; let mut n_stats = Vec::new(); // pollard rho let mut pollard_best = (MAXITER, u128::MAX); for _ in 0..POLLARD_REPEATS { let tstart = Instant::now(); let (result, iters) = pollard_rho(&n, random(), random(), pollard_best.0); if result.is_some() { ...
Rust
0
import errno import os import socket import pytest from jeepney import FileDescriptor, NoFDError def assert_not_fd(fd: int): """Check that the given number is not open as a file descriptor""" with pytest.raises(OSError) as exc_info: os.stat(fd) assert exc_info.value.errno == errno.EBADF def tes...
Python
1
wrap(); let left_proj = array_to_matrix(self.system.projection_matrix(Eye::Left, near, far)); let right_proj = array_to_matrix(self.system.projection_matrix(Eye::Right, near, far)); let size = self.system.recommended_render_target_size(); vec![ XRTargetInfo { ...
Rust
0
mapper<'a>( mach: &'a MachExt<'a>, endian: BinaryEndian, binary_data: &'a BinaryData, base_directory: &Path, resolve_strategy: FileResolveStrategy, ) -> anyhow::Result<Box<dyn 'a + LineMapper>> { match &mach.debug { MachDebug::Internal => { mach_internal_line_mapper(&mach.mac...
Rust
0
eventfd2 => initval, flags)) } } /// syscall fn dup(&mut self, oldfd: libc::c_int) -> Result { self.trace("dup", 1); unsafe { self.proxy(request!(libc::SYS_dup => oldfd)) } } /// syscall fn dup2(&mut self, oldfd: libc::c_int, newfd: libc::c_int) -> Result { self.trace("...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
# Copyright 2024 Xanadu Quantum Technologies Inc. # 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 agre...
Python
1
route(web::get().to(fetch_record))) /* .service( web::scope("/product") .service(web::resource("").route(web::get().to(list_products))) .service(web::resource("/{id}").route(web::get().to(fetch_product))), ) .service( ...
Rust
0
from ws4py.client.threadedclient import WebSocketClient from getmac import get_mac_address import subprocess import socket import re import json from .payload import hello_data class LGTVAuth(WebSocketClient): def __init__(self, name, host, ssl=False): self.__clientKey = None self.__macAddress = ...
Python
1
data={self.lookup_kwarg: self.value()}, ), } class AllValuesCheckboxFilter(MultiValueMixin, admin.AllValuesFieldListFilter): template = "unfold/filters/filters_field.html" form_class = CheckboxForm def choices(self, changelist: ChangeList) -> Generator[dict[str, Any], None, N...
Python
1
: 0x6AB5 @scena.Code('func_18_6AB5') def func_18_6AB5(): ChrTurnDirectionByPos(0x00FE, -48260, 17100, 400) ChrWalkTo(0x00FE, -48260, 0, 17100, 5000, 0x00) ChrSetFlags(0x00FE, 0x0080) Return() # id: 0x0019 offset: 0x6ADC @scena.Code('func_19_6ADC') def func_19_6ADC(): ChrTurnDirectionByPos(0x00FE, ...
Python
1
import copy from collections import defaultdict from tree_php.php_const import PHP_MAGIC_METHODS from tree_php.php_enums import ClassKeys, MethodKeys, FileInfoKeys def get_all_global_methods(parsed_infos: dict): """获取解析结果中的所有全局方法信息""" all_method_infos = [] for file_path, parsed_info in parsed_infos.items...
Python
1
ture_loading) # Plot results print("Producing figures...") plt.figure() plt.plot(test_time, data[RUN_ID]["voltage"], color="green", label="ground truth") plt.plot( results_circuit1.times, [z["v"] for z in results_circuit1.outputs], color="blue", label="circuit", ...
Python
1
perimentalParam6 = 1003, ZSTD_c_experimentalParam7 = 1004, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ZSTD_bounds { pub error: usize, pub lowerBound: ::std::os::raw::c_int, pub upperBound: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_ZSTD_bounds() { assert_eq!( ::core::...
Rust
0
feed = Feed.objects.get(pk=feed_id) post = request.POST['post'] post = post.strip() if len(post) > 0: post = post[:255] user = request.user feed.comment(user=user, post=post) user.profile.notify_commented(feed) user.profile.notif...
Python
1
017)</arxiv:journal_ref> <link href="http://arxiv.org/abs/1610.08518v1" rel="alternate" type="text/html"/> <link title="pdf" href="http://arxiv.org/pdf/1610.08518v1" rel="related" type="application/pdf"/> <arxiv:primary_category xmlns:arxiv="http://arxiv.org/schemas/atom" term="cond-mat.other" scheme="http:...
Python
1
""" MongoData Serializer """ from rest_framework import serializers from rest_framework.serializers import Serializer from core_main_app.rest.data.serializers import ContentField from core_main_app.settings import BACKWARD_COMPATIBILITY_DATA_XML_CONTENT class MongoDataSerializer(Serializer): """Data serializer""...
Python
1
') as w: w.write(arrayifyBinaryRawFile(shellcodeBytecode)) print('[v] shellcode saved at %s' % shelltxtOut) with open(shellcodeBin, 'wb') as w: w.write(shellcodeBytecode) print('[v] shellcode *binary* saved at %s' % shellcodeBin) if clearAfterRun: os.remove(asm) os.remove(shellAsm) os.remove(obj) ...
Python
1
::Option::None; } pub fn has_curve(&self) -> bool { self.curve.is_some() } // Param is passed by value, moved pub fn set_curve(&mut self, v: i32) { self.curve = ::std::option::Option::Some(v); } } impl ::protobuf::Message for WebAuthnCredentials_WebAuthnCredential { fn is_...
Rust
0
} # 判断状态 if expired_cookies: return self._create_auth_status( LoginStatus.EXPIRED, f"⚠️ 发现过期cookies: {expired_cookies}", details, ["Cookies已过期,需要重新登录", "运行登录命令: '登录小红书'"], auto_action_available=Tru...
Python
1
pub by_artist: HashMap<u64, Artist>, } impl Collection { fn new(vec_kfile: Vec<Kfile>) -> Collection { let mut by_song = HashMap::new(); let mut by_artist = HashMap::new(); //Insert each song into by_song map; collect unique all artist names let artists: HashSet<String> = vec_k...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import website from . import website_blog
Python
1
152, 0.169, 0.188, 0.207, 0.226, 0.243, 0.26, 0.277, 0.294, 0.31, 0.325, 0.339, 0.353, 0.366, 0.379, 0.39, 0.399, 0.408, 0.416, 0.422, 0.428, 0.434, 0.439, 0.444, 0.448, 0.451, 0.454, /* 15 */ 0.131, 0.131, 0.131, 0.131, 0.131, 0.139, 0.147, 0.153, 0.158, 0.162, 0.164, 0.167, 0.17, 0.175, 0.182, 0.192, 0.203, 0.212, ...
Rust
0
handlers: [None; 3], quad: None, texture: TextureEntry::Dangling, } } #[inline] pub fn id_str(&self) -> &str { &self.id_str } #[inline] pub fn texture(&self) -> &TextureEntry { &self.texture } #[inline] pub fn texture_mut(&mut self) -> &mut TextureEntry { &...
Rust
0
prices() { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {}", e), } // Latest price for ONE symbol match market.get_price("KNCETH") { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {}", e), } // Current average price for ONE ...
Rust
0
ubgroup_id, repr): assert repr.group == group sg, parent_element, child_element = group.subgroup(subgroup_id) restrict_repr = group.restrict_representation(subgroup_id, repr) # def is_close(x, y): # if isinstance(x, tuple): # if isinsta...
Python
1
_label),str(img_all[1])] # img = np.expand_dims(img,0) ##(1, 96, 96, 96) # img = torch.tensor(img) # img = img.type(torch.FloatTensor) # label = torch.Tensor(label).long() ##(96, 96, 96) label不用升通道维度 # torch.cuda.empty_cache() return one_list ### 从这里出去还是96*96*96 ...
Python
1
lations( xyz[:, :3, :].clone(), diffusion_mask=diffusion_mask ) # print('Time to diffuse coordinates: ',time.time()-tick) diffused_T /= self.crd_scale deltas /= self.crd_scale # 2 get frames tick = time.time() diffused_frame_crds, diffused_frames = se...
Python
1
Search => "OpenSearch", EngineType::Unknown(s) => s.as_ref(), } } /// Returns all the `&str` values of the enum members. pub fn values() -> &'static [&'static str] { &["Elasticsearch", "OpenSearch"] } } impl AsRef<str> for EngineType { fn as_ref(&self) -> &str { s...
Rust
0
wo::One(t) } else { UpToTwo::None }; } let discriminant_sqrt = discriminant.sqrt(); let q = if b < 0.0 { b - discriminant_sqrt } else { b + discriminant_sqrt } * -0.5; let mut first_inflection = q / a; let mut second_inflection = c / q; if first_inflection > second_inflection { swap(&m...
Rust
0
"""FedProx package."""
Python
1
# Copyright 2024 The TensorFlow Authors. 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 applica...
Python
1
} // These benchmarks are used for testing cargo-criterion, so to make the tests faster we configure // them to run quickly. This is not recommended for real benchmarks. criterion_group! { name = benches; config = Criterion::default() .warm_up_time(Duration::from_millis(250)) .measurement_time...
Rust
0
#!/usr/bin/env python # coding=utf-8 """Trainer for Peft models """ from __future__ import absolute_import from transformers import Trainer from transformers.trainer_utils import PREFIX_CHECKPOINT_DIR from transformers.trainer_callback import ( TrainerCallback, TrainerControl, TrainerState, ) from transfor...
Python
1
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from typing import Any, Type, Union from habitat.config import Config from habitat.core.dataset import Episode from habitat...
Python
1