text
string
label_name
string
labels
int64
//visit::walk_stmt(&mut v, stmt, ()); // println!("stmt {:?}",stmt); // let mut v = ImplVisitor{ name_path: Vec::new() }; // visit::walk_stmt(&mut v, stmt, ()); // println!("v {}",v.name_path); // pub struct Match { // pub matchstr: ~str, // pub filepath: Path, // pub point: uint, // ...
Rust
0
, -2.0; 0.5, 1.0]; assert_eq!(MatrixNorm::norm(&Lp::Integer(1), &m), 4.5); } #[test] fn test_lp_vector_float() { let v = vector![1.0, 2.0, -2.0]; assert_eq!(VectorNorm::norm(&Lp::Float(1.0), &v), 5.0); } #[test] fn test_lp_matrix_float() { ...
Rust
0
info = { "name": "as", "date_order": "YMD", "january": [ "জানু", "জানুৱাৰী" ], "february": [ "ফেব্ৰু", "ফেব্ৰুৱাৰী" ], "march": [ "মাৰ্চ" ], "april": [ "এপ্ৰিল" ], "may": [ "মে" ], "june": [ "জুন" ], ...
Python
1
out.write("\n\n=== Hallen und Outdoor") for beitraege in ['Halle Normaltarif', 'Halle ermäßigt', 'Halle Förderm.']: out.write(fmt("\n\n==== %s", beitraege)) cols = ",".join([">1" for _ in range(0, anzahl_outdoor_max+1)]) out.write("\n[cols=\">1,"+cols+"\"]\n[%autowidth]\n|===") out....
Python
1
[GP] stddev={3}, lr={0}, decay={1}, step={2}, update={4}".format( util.toYellow("{0:.0e}".format(opt.lrGP)), util.toYellow("{0}".format(opt.lrGPdecay)), util.toYellow("{0}".format(opt.lrGPstep)), util.toYellow("{0:.0e}".format(opt.stdGP)), util.toYellow("{0}".format(opt.updateGP)))) print("[D] stddev=...
Python
1
R](rmon_r_p65to127::R) reader structure"] impl crate::Readable for RMON_R_P65TO127 {} #[doc = "Rx 65- to 127-Byte Packets Statistic Register"] pub mod rmon_r_p65to127; #[doc = "Rx 128- to 255-Byte Packets Statistic Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust...
Rust
0
at different log levels, all of these appear with timestamps //! in both the console and the log file: //! //! ```no_run //! # #[macro_use] extern crate origen_metal; //! # fn main() { //! let x = 10; //! //! log_error!("The value of x is {}", x); //! log_info!("The value of x is {}", x); //! log_success!("The value o...
Rust
0
to_string(), vars, }; Ok((input, pcre)) } /// Parse an end quote. Probably not the best name for thie parser but it parses up to and /// including a quote that is only prefixed by optional whitespace. fn parse_end_quote(input: &str) -> IResult<&str, &str, RuleParseError<&str>> { preceded(multispace...
Rust
0
} mdenv.atoms[*uu].set_xyz(maxpos.0,maxpos.1,maxpos.2); mdenv.atoms[*uu].unplaced = false; all_placed_points.push(*uu); assigned = uii as i64; println!("***{} {} {} {} {}",negcheck_debug,mul...
Rust
0
from typing import Optional import jwt from fastapi import Depends, Header, HTTPException, Request from app.core.ctx import CTX_USER_ID from app.models import User from app.models.admin import ApiToken from app.utils import settings from datetime import datetime class AuthControl: @classmethod async def is_...
Python
1
/flo-task<gh_stars>0 mod spawn_scope; pub use spawn_scope::{SpawnScope, SpawnScopeHandle}; #[macro_use] extern crate criterion; extern crate space_efficient_quantile; use criterion::{BenchmarkId, Criterion}; use space_efficient_quantile::*; pub fn quantile_generator_benchmark(c: &mut Criterion) { let mut group = ...
Rust
0
#!/usr/bin/python3 #-*- coding:utf-8 -*- #Date:16-10-2017 #Author:jhinno #Version=.3 import sys sys.path.append("..") from tools.tools import * import unittest import main class TestDesktopStart(unittest.TestCase): """测试 appform 申请桌面 case:""" def setUp(self): print("开始测试appform申请桌面【desktopStart ap...
Python
1
#!/usr/bin/env python # -*- coding: UTF-8 -*- # This Coding is Code in python 2 now it will be renewed soon import sys import mechanize import http.cookiejar as cookielib import random # pip install mechanize # pip install requests email = str(input("Enter the Facebook Username (or) Email (or) Phone Number: ")) pass...
Python
1
ptimize=exp_path) assert_raises( RuntimeError, np.einsum_path, *path_test, optimize=exp_path) def test_spaces(self): #gh-10794 arr = np.array([[1]]) for sp in itertools.product(['', ' '], repeat=4): # no error for any spacing np.einsum('{}...a{}->...
Python
1
::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fwpwrite7](fwpwrite7) module"] pub type FWPWRITE...
Rust
0
from pathlib import Path import pandas as pd import itertools import logging import sys PROJECT_ROOT_DIR: Path = Path(__file__).parent.parent.parent if str(PROJECT_ROOT_DIR.absolute()) not in sys.path: sys.path.append(str(PROJECT_ROOT_DIR.absolute())) from runF16.f16Classes import Guide, ControlLaw, PlaneMode...
Python
1
# Authors: Sylvain MARIE <sylvain.marie@se.com> # + All contributors to <https://github.com/smarie/python-pyfields> # # License: 3-clause BSD, <https://github.com/smarie/python-pyfields/blob/master/LICENSE> import sys import pytest from pytest_cases.common_pytest import list_all_fixtures_in, is_fixture, g...
Python
1
from sqlalchemy import and_, delete from sqlalchemy.dialects.sqlite import insert from .sqlalchemy import SQLAlchemyRoleProvider, roles_table __all__ = ("SQLiteRoleProvider",) class SQLiteRoleProvider(SQLAlchemyRoleProvider): """SQLite-based role provider. Required packages :code:`sqlalchemy[asyncio]`, :co...
Python
1
82799346313767754307809363333018982642090 10848802521674670883215120185883543223812876952786 71329612474782464538636993009049310363619763878039 62184073572399794223406235393808339651327408011116 66627891981488087797941876876144230030984490851411 60661826293682836764744779239180335110989069790714 85786944089552990653640...
Rust
0
del": ckpt.model} return ckpt, file def attempt_load_weights(weights, device=None, inplace=True, fuse=False): """Loads an ensemble of models weights=[a,b,c] or a single model weights=[a] or weights=a.""" ensemble = Ensemble() for w in weights if isinstance(weights, list) else [weights]: ckpt, ...
Python
1
fn main() { let input = include_str!("../../input/15.txt"); println!("Part 1: {}", part_1(input)); println!("Part 2: {}", part_2(input)); } fn shortest_path(map: Vec<Vec<i64>>) -> i64 { let success = (map.len() - 1, map[0].len() - 1); let mut costs = vec![vec![i64::MAX; map[0].len()]; map.len()];...
Rust
0
crete_a, mmt_sec_rank_m, mmt_sec_rank_a, mmt_time_rank_m, mmt_report_overnight, mmt_report_jump, mmt_report_period, mmt_highest_days_a, # vol_std_1m, # vol_std_3m, # vol_std_6m, # vol_down_std_1m, # vol_down_std_3m, # vol_down_std_6m, # vol_up_std_1m, # vol_up_std_3m, # vol_up_std_6m, # vol_highlow_avg_1m, # vol_highlo...
Python
1
( orientation="h", yanchor="bottom", y=1.02, xanchor="center", x=0.5 ), margin=dict(l=20, r=20, t=40, b=20), ) # Add a custom note about sentiment analysis st.markdown(""" <di...
Python
1
. let http_proxy = env::var("https_proxy") .unwrap_or(env::var("http_proxy") .unwrap_or("socks5://127.0.0.1:9050".to_string())); let proxy = reqwest::Proxy::http(http_proxy) .expect("Can't connect to HTTP proxy"); let client = reqwest::blocking::Client::builder() ....
Rust
0
{\tau}+\frac{h}{\tau} \\ &\frac{d h}{d t}=-\frac{h}{\tau}+\delta\left(t_{0}-t\right) \end{aligned} .. [1] Sterratt, David, Bruce Graham, Andrew Gillies, and David Willshaw. "The Synapse." Principles of Computational Modelling in Neuroscience. Cambridge: Cambridge UP, 2011. 172-95. Print...
Python
1
# Problem Statement # Sophia has a fruit store. She has written a function num_in_stock which takes a string fruit as a parameter and returns how many of that fruit are in her inventory. Write code in main() which will: # Prompt the user to enter a fruit ("Enter a fruit: ") # Call num_in_stock(fruit) to get the numbe...
Python
1
sizeLargestBlob destroyFG = count[1:] <= th destroyFG = np.concatenate(([False], destroyFG)) maskSeq[i][destroyFG[sp1]] = 0 if maskSeq.shape[0] == 1: return maskSeq[0] return maskSeq def my_accumarray(indices, vals, size, func='plus', fill_value=0): """ Implementing py...
Python
1
await super().init(context) # 初始化存储对象 self._ensure_story_storages() # 启动自动生成任务 asyncio.create_task(self._start_auto_generate()) online_info = self.online_story_storage.get_storage_info() logger.info( f"海龟汤插件已加载,配置: 生成LLM提供商={self.generate_llm_provider_i...
Python
1
from admin_interface.admin import ThemeAdmin from admin_interface.models import Theme from django.contrib import admin from django.contrib.admin import AdminSite, ModelAdmin from django.utils.html import format_html from django.utils import timezone from django.db import transaction from admin_panel.telebot.forms impo...
Python
1
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl, # KU Leuven. All rights reserved. # Copyright (C) 2011-2014 Greg Horn # # CasADi is free software; you can r...
Python
1
NAL_SERVER_ERROR)); // let svc_two = svc_one.clone(); // let app = svc_one.or(svc_two); // let addr = run_in_background(app).await; // } pub trait Summary { fn summarize_author(&self) -> String; fn summarize(&self) -> String { format!("(Read more from {}...)", self.summarize_author()) ...
Rust
0
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: protos/perfetto/trace/ftrace/irq.proto # Protobuf Python Version: 5.27.3 '''Generated protocol buffer code.''' from google.protobuf import descriptor as _descriptor from google.protobuf import d...
Python
1
Buf>, } impl CppBuildPaths { /// Constructs an empty configuration object. pub fn new() -> Self { Self::default() } /// Adds `path` to a lib directory. /// It's supplied to the linker via `-L` option or environment variables. pub fn add_lib_path<P: Into<PathBuf>>(&mut self, path: P) { ...
Rust
0
se.status}. " f"Error: {error_response}") return await response.json() async def get_current_server_time( throttler: Optional[AsyncThrottler] = None, domain: str = CONSTANTS.DEFAULT_DOMAIN, ) -> float: throttler = throttler or create_throttler() api_f...
Python
1
} } } AUTH_USER_MODEL = 'accounts.CustomUser' # Password validation # https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'dj...
Python
1
x.powi(2); *sum_y_sq.get_or_insert_with(Value::zero) += y.powi(2); *dot_prod.get_or_insert_with(Value::zero) += (*x) * (*y); n += 1; } let n = Value::from(n).ok_or_else(|| ErrorKind::ConvertType)?; let dot_prod = dot_prod.ok_or_else(|| ErrorKind::NoMatchingRatings)?; let sum_x =...
Rust
0
)*b = p*b + b res = op(res, b.clone()); p -= E::one(); } } res } /// ///Raises a [monoid](MulMonoid) element to a integral power using inversion and repeated squaring /// ///# Panics ///If both the base and power are `0` /// #[inline] pub fn repeated_squaring_inv<E:IntegerSubset...
Rust
0
_data["issue"], user_data["solution"],override)) # Commit the changes and close the connection conn.commit() conn.close() return "Data Received" @app.get("/ticket") def ticket(details): # Connect to the SQLite database conn = sqlite3.connect('chatbot.db') cursor = conn.cursor() #...
Python
1
self.arg_stack.push(pair.1.clone()); self.frame.pc += 1; } else { return Err(runtime_panic("top of the stack is not a pair".to_string())); } }, Inst::Return => return self.return_value() } O...
Rust
0
/// ``` #[cfg(feature = "permission-calculator")] #[cfg_attr(docsrs, doc(cfg(feature = "permission-calculator")))] pub const fn permissions(&self) -> InMemoryCachePermissions<'_> { InMemoryCachePermissions::new(self) } /// Update the cache with an event from the gateway. pub fn update...
Rust
0
from datetime import datetime from selenium import webdriver from selenium.webdriver.support.select import Select from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC import time from subprocess import Pope...
Python
1
ensionPosFormat1 { substFormat: subst_format, extensionLookupType: extension_lookup_type, extension: Offset32::new(off, subtable), }) } } #[derive(Debug, PartialEq, Clone)] pub enum GPOSSubtable { /// Contains a single positioning rule. GPOS1_1(SinglePosFormat1),...
Rust
0
text.len(), 1); assert_eq!(c.ciphertext["test_curve_key"].body, "encrypted_body"); assert_eq!(c.ciphertext["test_curve_key"].message_type, 1u16.into()); } _ => panic!("Wrong content type, expected a OlmV1 content"), } } #[test] fn deserializat...
Rust
0
ffset = 0x1D4B42 if metadata.bias is not None: # NOTE: a large bias tensor leads to overflow during pointer arithmetic assert metadata.bias.numel() < 2**31 bias_strides = ( metadata.bias.stride(0), metadata.bias.stride(1), metadata.bias.stride(2), ...
Python
1
from django.contrib.auth.mixins import LoginRequiredMixin from django.views import View from django.shortcuts import render, redirect, get_object_or_404 from django.urls import reverse_lazy from django.views.generic.edit import CreateView, UpdateView, DeleteView from cats.models import Breed, Cat class CatList(LoginR...
Python
1
m_offer(issuer2_did, xyz_claim_def_seq_no); let res = AnoncredsUtils::prover_store_claim_offer(prover_wallet_handle, &issuer2_claim_offer_json); assert!(res.is_ok()); //10. Prover get Claim Offers let filter_json = "{}"; let res = AnoncredsUtils::prover_get_claim_offers(prover_wallet_handle, &fil...
Rust
0
node, )?; time::wait_for_epoch(2, leader_1.explorer()); let rewards_after = leader_1 .explorer() .status() .unwrap() .data .unwrap() .status .latest_block .treasury .unwrap() .rewards .parse::<u64>() .unwrap();...
Rust
0
weighted sum of multiple losses. - ``log_vars`` contains all the variables to be sent to the \ logger. - ``num_samples`` indicates the batch size (when the model is \ DDP, it means the batch size on each GPU), which is used for \ ...
Python
1
impl FaviconDatabaseError { #[doc(alias = "webkit_favicon_database_error_quark")] pub fn quark() -> glib::Quark { assert_initialized_main_thread!(); unsafe { from_glib(ffi::webkit_favicon_database_error_quark()) } } } impl fmt::Display for FaviconDatabaseError { fn fmt(&self, f: &mut fmt::Formatter) ->...
Rust
0
write_postfix_replacement() { let mut edit = new(3, 2, "helloworld!"); assert!(edit.try_overwrite(14, 2, "x∆∅")); assert_eq!(edit, new(3, 13, "helloworld!x∆∅")); } #[test] fn overwrite_wrapping_replacement() { let mut edit = new(3, 2, "helloworld!"); assert!(edit.try...
Rust
0
unwrap_or(&SampleFlags::default()).to_bytes(stream)?; } if (flags & 0x0800) > 0 { self.sample_composition_time_offset.unwrap_or(0).to_bytes(stream)?; } Ok(()) } } // --------------------------------------------------------------------- // TWAMP Accept-Session // ---------...
Rust
0
{}", text); } } if matches.is_present("add") { let url = matches.value_of("add").unwrap(); let client = Client::new_with_token( &settings.url, &settings.access_token, &settings.refresh_token, ); let mut json = HashMap::new(); js...
Rust
0
new_object(FLOAT, "(F)V", &[jvalue]) // } // _ => return Err(anyhow!("Unsupported WASM type: {}", val.ty())), // }; // obj.with_context(|| format!("failed to convert {:?} to java", val)) // } pub(crate) unsafe fn return_or_load_or_from_arg<'a, 'w>( env: &JNIEnv<'a>, ty: WasmTy, ret...
Rust
0
"Douglas" => 54.15, -4.48, 35.; "Dublin" => 53.35, -6.25, 85.; "Dushanbe" => 38.55, 68.8, 803.; "<NAME>" => 27.15, -13.2, 64.; "Fort-de-France" => 14.6, -61.03, 9.; "Freetown" => 8.5, -13.28, 26.; "Funafuti" => -8.52, 179.22, 2.; "Gaborone" => -24.75, 25.95, 1...
Rust
0
"created_at": created_at, "type": "refresh", "access": valid_access, }, ttl=REFRESH_TTL * 24 * 3600, ) self.assertFalse(validate_token(token=refresh_with_invalid_user)) def test_validate_token_jwt_function_with_valid_token(self): use...
Python
1
('Delta: ', args.delta, '. Delta Delta: ', args.delta_delta, '. Cmvn: ', args.apply_cmvn) # Select data sets for idx, s in enumerate(SETS): print('\t', idx, ':', s) tr_set = input('Please enter the index of splits you wish to use preprocess. (seperate with space): ') tr_set = [SETS[int(t)] for ...
Python
1
import argparse from mlagents_envs.environment import UnityEnvironment from mlagents_envs.envs.unity_gym_env import UnityToGymWrapper def test_run_environment(env_name): """ Run the gym test using the specified environment :param env_name: Name of the Unity environment binary to launch """ u_env ...
Python
1
ITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. use std::io; use std::path::Path; #[macro_use] pub mod process; /// Indicator of whether the output should be verbose. #[derive(Clone, Copy, Debug, PartialEq)] pub enum Verbosity { Brief(usize), Verbose, } /// Returns [`Verbosity`](Verbosity....
Rust
0
{} impl<T, U> EnumMustNotImplDrop for Enum<T, U> {} impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> { unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {} } // We don't need to check for `#[repr(packed)]`, // since it does not apply to enums. }; fn main() {} <re...
Rust
0
32 = 0; pub const CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT: u32 = 1; pub const CL_PROGRAM_BINARY_TYPE_LIBRARY: u32 = 2; pub const CL_PROGRAM_BINARY_TYPE_EXECUTABLE: u32 = 4; pub const CL_BUILD_SUCCESS: u32 = 0; pub const CL_BUILD_NONE: i32 = -1; pub const CL_BUILD_ERROR: i32 = -2; pub const CL_BUILD_IN_PROGRESS: i32 = -3...
Rust
0
o gy@sddlmZddlZddlmZmZddlmZdddd d d d d Z dddZ GdddejZ e e j e e ee j ddS)) annotationsN)Image ImageFile)i32le)AL)rr)RGBALA)RGBzYCC;P)r zYCCA;P)r r )r r ))i)i)ii)...
Python
1
one: super().__init__(num_groups=num_groups, num_channels=num_channels, eps=eps, affine=affine, device=device, dtype=dtype) @torch.no_grad() def forward(self, x: Tensor) -> Tensor: x = x.detach() # get height height = torch.tensor(x.shape[-2], dtype=torc...
Python
1
($n: expr,) => {}; } arbitrary_array!{ 32, T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T } impl<A: Arbitrary> Arbitrary for Vec<A> { fn arbitrary<U: Unstructured + ?Sized>(u: &mut U) -> Result<Self, U::Error> { let size = u.container_size()?; (0..size).map(|_| Arbitrary::arb...
Rust
0
Z = [] pointsRGB = [] for id, data in enumerate(points3D): pointsXYZ.append(points3D[data][1]) pointsRGB.append(points3D[data][2]) pointsXYZ = np.asarray(pointsXYZ) pointsRGB = np.asarray(pointsRGB) file_name = sys.argv[3] np.save(file_name, pointsXYZ) # pcd = o3d.geometry.PointCloud() # ...
Python
1
rrelation_strength = mega_analysis["intelligence_effect_analysis"]["interpretation"] # Best and worst models rankings = mega_analysis["cross_model_stats"]["model_rankings"] best_model = rankings[0][0] if rankings else "N/A" worst_model = rankings[-1][0] if rankings else "N/A" ...
Python
1
from(recording_path)); } // listeners parsing for listener in matches.values_of(ARG_LISTENERS).unwrap_or_default() { let mut internal_url; let mut external_url; if let Some(pos) = listener.find(',') { let url_str = &listener[0..pos]; ...
Rust
0
s a sequence of items from `source` that has been removed /// and does not appear in `result`. Delete(usize), /// Represents a sequence of items from `result` that have been added /// at the current position in `source`. Insert(usize), } /// Computes the difference between two lists containing lines of text. ///...
Rust
0
same as the input but it isn't technically lossless. /// The range is exponential, so increasing the CRF value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the bitrate. /// Choose the highest CRF value that still provides an acceptable quality. If the output looks good, t...
Rust
0
import datetime import math from enum import Enum from typing import Any, Generic, TypeVar from fastapi.encoders import jsonable_encoder from pydantic import BaseModel from sqlalchemy.inspection import inspect from sqlalchemy.orm import Session from sqlalchemy.orm.properties import ColumnProperty from app import sche...
Python
1
reply_text = chat_reply.get("message") self.database.insert_chat(session_id, query, reply_text) return Reply(ReplyType.TEXT, reply_text) else: logger.error(f"[luolinai] 回复类型不正确: {type(chat_reply)}") return...
Python
1
class Item: def __init__(self, nome, tipo, intensidade): self.nome = nome self.tipo = tipo self.intensidade = intensidade def cria_item(tipo_item): if tipo_item == "vida1": item_aleatorio = Item("poção de vida", "Vida", 20) elif tipo_item == "vida2": ...
Python
1
from openai import OpenAI import requests client = OpenAI(api_key="OPENAI_API_KEY_SECRET") tools = [{ "type": "function", "function": { "name": "get_weather", "description": "Get current temperature for a given location.", "parameters": { "type": "object", "prop...
Python
1
-> SignatureRaw { use crate::key::make_signature; match pool_private_key { EitherEd25519SecretKey::Extended(sk) => { SignatureRaw(make_signature(sk, &self).as_ref().to_vec()) } EitherEd25519SecretKey::Normal(sk) => { SignatureRaw(make_...
Rust
0
import numpy as np from scipy.signal import find_peaks import matplotlib.pyplot as plt def detect_satellite_signal(signal, threshold=0.5, peak_distance=100): """ Detect satellite signals in a given signal. Args: - signal (array-like): The input signal. - threshold (float): Threshold for peak detec...
Python
1
get_boolean_setting(RESOLVE_SYMLINK_TARGET_SETTING, context_settings, defaults).unwrap(); LinkAction { fs, path, target, relink, force, create_parent_dirs, ignore_missing_target, relative, resolve_symlink_target, } } /// Path of the new symlink pub fn ...
Rust
0
# results in an exception. with mock.patch("psutil._psposix.os.kill", side_effect=OSError(errno.EBADF, "")) as m: self.assertRaises(OSError, psutil._psposix.pid_exists, os.getpid()) assert m.called def test_os_waitpid_let_raise(self): # os.wai...
Python
1
_point_data = True timer.StartTimer() clean1.Update() timer.StopTimer() time = timer.GetElapsedTime() print("Time to clean grid (non-zero tolerance): {0}".format(time)) print("\tRemaining points: {0}".format(clean1.output.number_of_points)) print("\tRemaining cells: {0}".format(clean1.output.number_of_cells)) assert(...
Python
1
"""Basic checks for HomeKit cameras.""" import base64 from collections.abc import Callable from aiohomekit.model import Accessory from aiohomekit.model.services import ServicesTypes from aiohomekit.testing import FAKE_CAMERA_IMAGE from homeassistant.components import camera from homeassistant.core import HomeAssista...
Python
1
:PipelineStageFlags::TRANSFER, vk::PipelineStageFlags::FRAGMENT_SHADER, vk::DependencyFlags::empty(), &[], &[], &barriers, ) }; } } impl Drop for Image { fn drop(&mut self) { unsafe { if !sel...
Rust
0
ize; #[derive(Debug, PartialEq)] pub enum TemplateSpec<'spec> { Local(PathBuf), Remote(&'spec str), } impl Display for TemplateSpec<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { match self { TemplateSpec::Local(path) => write!(f, "{}", path.display()), &...
Rust
0
try: import torch_gcu # 导入 torch_gcu from torch_gcu import transfer_to_gcu # transfer_to_gcu except Exception as e: print(e) from transformers import AutoModelForCausalLM, AutoTokenizer model_name = "Qwen/Qwen2.5-7B-Instruct" device = "gcu" # the device to load the model onto model = AutoModelForCausalL...
Python
1
from llama_index.core.base.embeddings.base import BaseEmbedding from llama_index.embeddings.langchain import LangchainEmbedding def test_langchain_embedding_class(): names_of_base_classes = [b.__name__ for b in LangchainEmbedding.__mro__] assert BaseEmbedding.__name__ in names_of_base_classes
Python
1
left_camera_rectification_transform=rect_l, right_camera_rectification_transform=rect_r, rot=rot, trans=trans, essential_matrix=essential_matrix, ...
Python
1
import subprocess import shlex import time import signal import atexit import os env_llm = os.environ.copy() env_llm["CUDA_VISIBLE_DEVICES"] = "2" env_emb = os.environ.copy() env_emb["CUDA_VISIBLE_DEVICES"] = "3" cmds = { "llm": shlex.split( "vllm serve /mnt/driver_g/gsq/hf_cache/Qwen/Qwen3-8B/ " ...
Python
1
0x2f5a680f84c9e810, "5xe6h3w4t7n1", -47.452252337, -17.734446758}, {0x85fff499b8020641, "hrzz96es0834", -45.073469345, 22.208198475}, {0x88e6740f75bb692f, "j3m783vprenk", -82.342641136, 63.650995808}, {0x8ee676457490cc25, "jvm7djcnk362", -59.820850195, 86.22226184}, {0xb83bf1b4a9e12b5d, ...
Rust
0
s_{}_description_label", key)), pack_file_view.get_mut_widget()); let edit = QSpinBox::new_1a(pack_file_view.get_mut_widget()); edit.set_value(*setting); layout.add_widget_5a(&label, row, 0, 1, 1); layout.add_widget_5a(&edit, row, 1, 1, 1); settings_number.i...
Rust
0
import os data_root = "/proj/mtklmadm/data/speech/EXPRESSO/expresso" transcripts_fpath = "/proj/mtklmadm/data/speech/EXPRESSO/expresso/read_transcriptions.txt" # split_fid_fpath = "/proj/mtklmadm/data/speech/EXPRESSO/expresso/splits/test.txt" split_fid_fpath = "/proj/mtklmadm/dev/mtk53678/rtslm_storage/code/rtslm/Cosy...
Python
1
}; RxneR { bits } } } impl W { #[doc = r" Reset value of the register"] #[inline(always)] pub fn reset_value() -> W { W { bits: 2 } } #[doc = r" Writes raw bits to the register"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self...
Rust
0
_preds = get_trait_predicates_for_trait_id(cx, generics, cx.tcx.lang_items().fn_mut_trait()); let ord_preds = get_trait_predicates_for_trait_id(cx, generics, get_trait_def_id(cx, &paths::ORD)); let partial_ord_preds = get_trait_predicates_for_trait_id(cx, generics, cx.tcx.lang_items().partia...
Rust
0
ffinity, containers=[container], image_pull_secrets=image_pull_secrets, node_selector=node_selector, scheduler_name=scheduler_name, restart_policy='Never', service_account_name=service_account_name, tolerations=tolerations, ...
Python
1
then `BitSel`, proves that values of this type are always correct to apply to underlying memory. [`BitIdx`]: crate::index::BitIdx [`BitOrder`]: crate::order::BitOrder [`BitOrder::select`]: crate::order::BitOrder::select [`BitPos`]: crate::index::BitPos [`BitPos::select`]: crate::index::BitPos::select **/ // #[rustc_l...
Rust
0
reate_inputs(mask_embedder: BertEmbedder, average_embedder: BertEmbedder): input_str, char_start, char_end = _create_input_string(5, 5, 2) inputs = mask_embedder.create_inputs([input_str], [(char_start, char_end)]) assert mask_embedder.tokenizer.convert_ids_to_tokens(inputs["input_ids"][0]) == [ "[C...
Python
1
"""Crypto Router.""" from openbb_core.app.model.command_context import CommandContext from openbb_core.app.model.example import APIEx from openbb_core.app.model.obbject import OBBject from openbb_core.app.provider_interface import ( ExtraParams, ProviderChoices, StandardParams, ) from openbb_core.app.query...
Python
1
############# def build_list_urls_2(page=1): return ['http://www.digitalcybersoft.com/ProxyList/fresh-proxy-list.shtml'] def parse_page_2(html=''): matches=re.findall(r''' ((?:[\d]{1,3}\.){3}[\d]{1,3})\:([\d]+) #ip:port \s+(Anonymous|Elite Proxy)[+\s]+ #type (.+)\r?\n ...
Python
1
], ) -> Result<(), Error> { match path { [head] => { let key = head.into(); let blob = make_blob(bytes)?; match Reflect::set(&root, &key, &blob) { Ok(true) => Ok(()), _ => Err(Error::new("Cannot set object property")), } ...
Rust
0
alCategory = 12i32; #[doc = "*Required features: `\"Win32_Globalization\"`*"] pub const U_INPC_TOP_AND_RIGHT: UIndicPositionalCategory = 13i32; #[doc = "*Required features: `\"Win32_Globalization\"`*"] pub const U_INPC_VISUAL_ORDER_LEFT: UIndicPositionalCategory = 14i32; #[doc = "*Required features: `\"Win32_Globalizat...
Rust
0
# src/train/grpo/torch/grpo_generation.py import logging import torch # inference imports from inference.torch.custom_generate_torch import top_p_generate_torch_with_kvcache # training imports from train.grpo.torch.grpo_utils import gather_logprobs # logger logger = logging.getLogger(__name__) def generate_single_r...
Python
1
4, vec![]); //let entry = vec![entry_splice]; let id = sub_lines_buffer.pop().unwrap(); let mut seq = sub_lines_buffer.pop().unwrap(); let plus = sub_lines_buffer.pop().unwrap(); let mut qual = sub_lines_buffer.pop().unwrap(); let last_base_tmp = min(seq.len(), last_base); seq =...
Rust
0
".join(memeber_set)) class DeleteServiceResponse(AbstractModel): """DeleteService返回参数结构体 """ def __init__(self): r""" :param _RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self._RequestId = None @property def Requ...
Python
1
import os import numpy as np import SharedArray as SA import torch from torch.utils.data import Dataset from util.voxelize import voxelize from util.data_util import sa_create, collate_fn from util.data_util import data_prepare_scannet as data_prepare import glob class Scannetv2(Dataset): def __init__(self, spli...
Python
1