text
string
label_name
string
labels
int64
a| a.abs()); ctx.append_output(ret); } Ok(()) } fn grad(&self, ctx: &mut crate::op::GradientContext<T>) { ctx.append_input_grad(Some(ctx.output_grad() * sign(ctx.input(0)))); } } impl<T: Float> op::Op<T> for NegOp { fn compute(&self, ctx: &mut crate::op::ComputeCont...
Rust
0
from unittest.mock import ANY, AsyncMock, call, patch import pytest from yarf.rf_libraries.libraries.mir.VideoInput import VideoInput @pytest.fixture def mock_screencopy(autouse=True): with patch("yarf.lib.wayland.screencopy.Screencopy") as m: m.return_value.grab_screenshot = AsyncMock() m.retur...
Python
1
175971], [0.709898, 0.868751, 0.169257], [0.720391, 0.870350, 0.162603], [0.730889, 0.871916, 0.156029], [0.741388, 0.873449, 0.149561], [0.751884, 0.874951, 0.143228], [0.762373, 0.876424, 0.137064], [0.772852, 0.877868, 0.131109], [0.783315, 0.879285, 0.125405], [0.793760, 0.880678...
Rust
0
sort_ascending=sort_ascending, ) response = {"Backups": [b.to_dict() for b in backups], "NextToken": next_token} return json.dumps(response, cls=DateTimeEncoder) def put_resource_policy(self) -> str: params = json.loads(self.body) resource_arn = params.get("R...
Python
1
"""SciPy solver Class.""" from typing import Callable, Union import numpy as np from numpy.typing import ArrayLike from scipy.optimize import minimize, Bounds from ._base_solvers import NonLinearOptimizer class OptimizerSciPy(NonLinearOptimizer): """ SciPy solver configuration class. Attributes --...
Python
1
la configuration OpenAPI de base openapi_schema = get_openapi( title=app.title, version="1.0.0", description=app.description, routes=app.routes, ) # S'assurer que le composant 'schemas' existe if "components" not in openapi_schema: openapi_schema["components...
Python
1
eq!(sent, Ok(1)); let out = peer_conn.process(None, now()); hconn.process(out.dgram(), now()); sent = peer_conn.stream_send(control_stream, &[0x5]); assert_eq!(sent, Ok(1)); let out = peer_conn.process(None, now()); hconn.process(out.dgram(), now()); sent = peer...
Rust
0
/// If the PE is not halted when `C_HALT` is cleared to zero, it is UNPREDICTABLE whether this bit is set to `1`. If /// `DHCSR.C_DEBUGEN == 0` this bit reads as an UNKNOWN value. /// /// This bit clears to zero when read. /// /// **Note** /// /// If the request to clear C_HALT is made simul...
Rust
0
oot.destroy() frontscreen() backbutton = Button(adminroot, text="Back", font=("Microsoft Sans Serif", 9), activebackground="#B7CADB", width=8, bg="#035397", fg="white", bd=4, command=back).place(x=5, y=40) adminroot.mainloop() def bookingdetails(adminroot): if usrnme.get(...
Python
1
.as_ref().unwrap(); let web_asset_path = PathBuf::from(&config_.build.dist_dir); if !web_asset_path.exists() { return Err(anyhow::anyhow!( "Unable to find your web assets, did you forget to build your web app? Your distDir is set to \"{:?}\".", web_asset_path )); } if let S...
Rust
0
ring, pub description: String, pub title: String, pub click_action: String, pub click_url: String, #[serde(default)] pub last_updated: Option<serde_json::Value>, } #[derive(Debug, Clone, Deserialize, Serialize)] pub struct BadgeSet { pub versions: HashMap<String, Badge>, } #[derive(Debug, ...
Rust
0
x = True y= False # and print(x and y) # False """#uso posible: if (aprobo(matematicas) and aprobo(fisica)): print("Aprobo las dos materias")""" # or print(x or y) # True """ 1 and 1 -> 1 0 and 1 -> 0 1 and 0 -> 0 0 and 0 -> 0 1 or 0 -> 1 0 or 1 -> 1 0 or 0 -> 0 1 or 1 -> 1""" print(y) #negar y p...
Python
1
dr_target = self.conn.addr(url)?; let user = if let Some(u) = proxy.username() { u.to_string() } else { "".to_string() }; let mut stream = Socks4Stream::connect(&addr_proxy[..], &addr_target[..], &user[..]) .map_err(error::request)?; self.conn.block_send_with_stream(url, &mut stream) } fn call_wi...
Rust
0
#for getting the linkedin jobs using playwright library in python from playwright.sync_api import sync_playwright #Output -> get company name, job title, no of jobs from linkedin # -> user input location, job title, no of jobs e.g Noida Software developer 10 # Process -> browser -> linkeding job search-> location &...
Python
1
https://docs.rs/vtc/badge.svg" alt="Documentation"></a> </p> # Overview ``vtc-rs`` is inspired by years of scripting workflow solutions in a Hollywood cutting room. It aims to capture all the ways in which timecode is used throughout the industry so users can spend more time on their workflow logic, and less time han...
Rust
0
scn_mlm_mask = seq_mlm_mask.clone() aux["xt_traj"] = torch.stack(xt_traj, dim=1) aux["aatype_t_traj"] = torch.stack(aatype_t_traj, dim=1) aux["aatype_pred_traj"] = torch.stack(aatype_pred_traj, dim=1) aux["seq_probs"] = seq_probs_t aux["psce"] = psce_t aux["psce_t_tra...
Python
1
ecutionProvider) を利用できる ## iGPU でも利用できるが、大半のケースで CPU 推論よりも大幅に遅くなる elif use_gpu is True and "DmlExecutionProvider" in self.available_onnx_providers: # fmt: skip self.onnx_providers = [] ## TODO: より適した Direct3D 上のデバイス ID を指定できるようにする self.onnx_providers.append(("DmlExec...
Python
1
ably a valid email, it will most likely pass. However, it could still very well be that the actual emailaddress has simply not be claimed by anyone (so then this function fails to devalidate). """ if not re.match(VALID_ADDRESS_REGEXP, email_address): emsg = 'Emailaddress "{}" is not valid accord...
Python
1
INNER join. if self.effective_connector == AND or ( self.effective_connector == OR and votes == self.num_children ): to_demote.add(table) # Finally, what happens in cases where we have: # (rel_a__col=1|rel_b__col=2) & rel_a__col__gte=0 ...
Python
1
{ map.add( Select, [Vector(n, s_ty), Vector(n, s_ty), Vector(n, Bool)], Vector(n, s_ty), ); } } for s_ty in [I32, U32] { for ty in scalar_and_vectors_of(s_ty) { map.add(Clamp, [ty.clone(), ty.clone(), ty.clone()...
Rust
0
forks had been implemented. Genesis, /// [`BIP 34`](https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki): /// The rule that requires blocks to contain their height (number) in the coinbase input, /// and the introduction of version 2 blocks has been implemented since core **v0.7.0**. /// ...
Rust
0
: Copy { let tn = QNameRef::from(tag_name); if let QNameRef::Name(name) = tn { if name.is_empty() { panic!("supplied tag name is empty"); } } let mut node = Node::new(NodeData { storage_key: None, node_type: NodeType::E...
Rust
0
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode': # define a function to traverse the...
Python
1
let n: UdWords; let d: UdWords; let mut q: UdWords; let mut r: UdWords; let mut sr: i32; unsafe { n = transmute(a); d = transmute(b); } /* special cases, X is unknown, K != 0 */ if n.high == 0 { if d.high == 0 { /* 0 X * --- ...
Rust
0
opy { /// Construct a matrix from a set of column vectors. #[rustfmt::skip] #[inline] pub fn from_columns(c0: &Vector4<S>, c1: &Vector4<S>) -> Self { Self::new( c0[0], c0[1], c0[2], c0[3], c1[0], c1[1], c1[2], c1[3], ) } /// Construct a matrix from a set ...
Rust
0
e: policy = [p for p in (api('get', 'data-protect/policies', v=2))['policies'] if p['name'].lower() == policyname.lower()] if policy is None or len(policy) == 0: print('Policy %s not found' % policyname) exit(1) else: policy = policy[0] # get storageDomai...
Python
1
from yacs.config import CfgNode as CN cn = CN(new_allowed=True) cn.DATASET = CN(new_allowed=True) cn.DATASET.NAME = 'COCO' cn.DATASET.TFRECORDS = '/media/user/data/coco/TF2-SimpleHumanPose/tfrecords' cn.DATASET.ANNOT = '/media/user/data/coco/annotations/person_keypoints_val2017.json' cn.DATASET.TRAIN_SAMPLES = 149813...
Python
1
""" Negative Lens Experiment: Visualize how a negative lens affects light rays. This experiment places a negative lens at a fixed distance of 4dm from the camera and renders the scene with a target image at 50dm (5m) distance. The simulation demonstrates how a negative lens causes light rays to diverge. Output files...
Python
1
(t(symbol::EQ), r"="), (t(symbol::DOT), r"\."), (t(symbol::COMMA), r","), (t(symbol::L_BRACK), r"\["), (t(symbol::R_BRACK), r"\]"), (t(symbol::L_CURLY), r"\{"), (t(symbol::R_CURLY), r"\}"), (t(symbol::WHITESPACE), r"\s+"), ...
Rust
0
0)] ResolveError(ResolveError), #[display(fmt = "RuntimeError: {}", _0)] RuntimeError(RuntimeError), #[display(fmt = "ContractError: {}", _0)] ContractError(ContractError), } #[derive(Debug, Clone, Display)] pub enum PreCompileError { #[display(fmt = "ValidationError: {}", msg)] ValidationError { msg: String },...
Rust
0
ory_axis.has_major_gridlines, caxis_has_minor_gridlines=False, caxis_major_tick_mark='outside', caxis_minor_tick_mark='none', caxis_tick_labels_font_name="Calibri", caxis_tick_labels_font_size=10, caxis_tick_labels_font_bold=False, caxis_tick_labels_font_italic=F...
Python
1
# Copyright (c) 2022-2023, NVIDIA CORPORATION. # 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 agreed...
Python
1
RItitem((sn/private/var/folders/vy/31wknkcs30l6xb2fzgwnrkh80000gn/T/pip-build-H4rTmN/pip/pip/_vendor/packaging/markers.pys <genexpr>s(sandsor( RBRLR?R RMtappendt_evaluate_markersR"R_RR[tany( tmarkersR]tgroupsRPRR...
Python
1
// Calculate a_1i, a_2i and update hash dleq.g1 = self.g.clone(); dleq.h1 = x; dleq.g2 = publickey.clone(); dleq.h2 = encrypted_share.unwrap().clone(); dleq.r = Some(response.unwrap().clone()); dleq.c = Some(distribute_sharesbox.chall...
Rust
0
': label_data, }, fetch_list=[one_hot_label], return_numpy=False, ) def test_api_with_depthTensor(self): main = paddle.static.Program() startup = paddle.static.Program() with paddle.static.program_guard(main, startup): ...
Python
1
"proof": { "jws": "eyJhbGciOiJFZERTQSIsImNyaXQiOlsiYjY0Il0sImI2NCI6ZmFsc2V9..34uD8jKn2N_yE8pY4ErzVD8pJruZq7qJaCxx8y0SReY2liZJatfeQUv1nqmZH19a-svOyfHt_VbmKvh6A5vwBw", "type": "Ed25519Signature2018", "created": days_ago, "proofPurp...
Python
1
1 } else { 0 } } else { 0 } } }) .sum(); let fz = dag.size(); let fm = std::cmp::max(pair.0.size(), pair.1.size()); let cs2 = fz as f64 / fm as f64; (cs1, cs2) } for ((x, y), dag) in cache_int...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2025 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...
Python
1
cdaf3b13e0de7dc349264caad0cadada548af5bdd9cb8be749cf574f9d30545adf8f7ec06dec83b702d051e39b3ccdefc7b3ad918f2978c8f8d01886006ce0dffc6f905a4c24015ef463428f90007f67c41cf94346721c3f4234b54291a6228e05c2e851e6f9b0eb5d036afd13ea64e8075e2b4dc0477d027c32551de887abee4a8440318e011ceb0487d818623cf0699b2ba75b73246dff66c", "38a2939...
Rust
0
import numpy as np import matplotlib.pyplot as plt import allantools # Set the parameters for synthetic data num_points = 173 # Number of data points T = 3600 # Total time in seconds (1 hour) time = np.linspace(0, T, num_points) # Time axis # Generate synthetic white noise (random Gaussian fluctuations) white_nois...
Python
1
from __future__ import annotations import typing as t from contextvars import ContextVar from werkzeug.local import LocalProxy if t.TYPE_CHECKING: # pragma: no cover from .app import Flask from .ctx import _AppCtxGlobals from .ctx import AppContext from .ctx import RequestContext from .sessions ...
Python
1
row_mut().location.move_to(new.x, new.y); area.update_entity_position(member, old.x, old.y, mgr); // TODO add subpos animation so move is smooth } } fn find_bump_position( area: &AreaState, entity: &EntityState, party: &[usize], cur: Point, ) -> Option<Point> { let to_ignore = v...
Rust
0
check_moment!(c, [2013, 2, 12]), "martes de esta semana", "el martes de esta semana"); example!(v, check_moment!(c, [2013, 2, 13]), "miércoles de esta semana", "el miércoles de esta semana"); // TODO: support "durante la semana" example!(v, check_moment!(c, [2013, 2, 11], Grain::Week), "esta semana"); ...
Rust
0
Parser { /// Implementation for [`ValueParser::bool`] pub fn new() -> Self { Self {} } fn possible_values() -> impl Iterator<Item = crate::PossibleValue<'static>> { ["true", "false"] .iter() .copied() .map(crate::PossibleValue::new) } } impl Type...
Rust
0
E_QUARTER_FIELD](https://developer.android.com/reference/android/icu/text/DateFormat.html#STANDALONE_QUARTER_FIELD) pub const STANDALONE_QUARTER_FIELD : i32 = 28; /// public static final [TIMEZONE_FIELD](https://developer.android.com/reference/android/icu/text/DateFormat.html#TIMEZONE_FIELD) pu...
Rust
0
file.read_to_end(&mut file_content).expect("fixture file"); Unreal4Crash::parse(&file_content) } #[test] fn test_load_unreal_crash() { get_unreal_crash().expect("crash file loaded"); } #[test] fn test_get_minidump_slice() { let ue4_crash = get_unreal_crash().expect("test crash file loads"); let minid...
Rust
0
g(), Self::UnmatchedLoop => "unmatched loop".to_string(), } ) } } impl<'a> From<VerboseError<&'a str>> for Error { fn from(mut e: VerboseError<&'a str>) -> Self { let mut result = Self::Unknown(String::new()); e.errors.reverse(); for (input, err_kind)...
Rust
0
} pub fn mk_var<'tcx>(cx: &ctxt<'tcx>, v: TyVid) -> Ty<'tcx> { mk_infer(cx, TyVar(v)) } pub fn mk_int_var<'tcx>(cx: &ctxt<'tcx>, v: IntVid) -> Ty<'tcx> { mk_infer(cx, IntVar(v)) } pub fn mk_float_var<'tcx>(cx: &ctxt<'tcx>, v: FloatVid) -> Ty<'tcx> { mk_infer(cx, FloatVar(v)) } pub fn mk_infer<'tcx>(cx: ...
Rust
0
nfidence threshold iou_thres=0.6, # NMS IoU threshold task='val', # train, val, test, speed or study device='', # cuda device, i.e. 0 or 0,1,2,3 or cpu workers=8, # max dataloader workers (per RANK in DDP mode) single_cls=False, # treat as single-class dataset augmen...
Python
1
ORATION", "0") .define("CONFIG_MAX_TILE", "0") .define("CONFIG_EXT_INTRA_MOD", "0") .define("CONFIG_FRAME_SIZE", "0") .define("CONFIG_SIMPLIFY_TX_MODE", "0") .define("CONFIG_OBU", "0") .define("CONFIG_FILTER_INTRA", "0") .define("CONFIG_ANALYZER", "0") .bu...
Rust
0
assert_eq!(date_right, date); } #[test] fn test_day3() { let naive = NaiveDate::from_ymd(2023,11,15) .and_hms(9,13,29); let date_right = DateTime::<Utc>::from_utc(naive, Utc); let str_date = "Wed, 15-Nov-23 09:13:29 GMT"; let result = rfc_850::pars...
Rust
0
crate::RuntimeDebug)] pub enum Infallible {} /// The length of the junction identifier. Note that this is also referred to as the /// `CHAIN_CODE_LENGTH` in the context of Schnorrkel. #[cfg(feature = "full_crypto")] pub const JUNCTION_ID_LEN: usize = 32; /// Similar to `From`, except that the onus is on the part of t...
Rust
0
#!/usr/bin/env python3 # # Copyright (C) 2016 Amlogic, Inc. All rights reserved. # # # This source code is subject to the terms and conditions defined in the # file 'LICENSE' which is part of this source code package. # # # dgpk: device global protect key def main(): import os import random import uuid from Crypto...
Python
1
fdZddlmZmZddlZeZddZGddej ZGddejZGd d ejZ Gd d ejZ d Z y)z Python 'mbcs' Codec for Windows Cloned by Mark Hammond (mhammond@skippin...
Python
1
# uncompyle6 version 2.11.5 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.18 (default, Apr 20 2020, 20:30:41) # [GCC 9.3.0] # Embedded file name: Exploits\Com_Joomanager.py import requests import re from Exploits import printModule from Tools import getSMTP Headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubu...
Python
1
.header(search_include(&include_paths, "libavutil/frame.h")) .header(search_include(&include_paths, "libavutil/hash.h")) .header(search_include(&include_paths, "libavutil/hmac.h")) .header(search_include(&include_paths, "libavutil/imgutils.h")) .header(search_include(&include_pat...
Rust
0
"--category", type=str, default="PERSON", # PERSON popularities are more reliable than others categories. help="Either `ALL` or one of the answer type categories from your NER model.", ) # Corpus substitution-specific arguments corpus_sub_parser = subparsers.add_parser("corpus-subst...
Python
1
h IP: {pod_ip}") # Store mapping in Redis pod_address = f"{pod_ip}:2222" redis_client.hset(REDIS_MAP_HASH_NAME, attacker_ip, pod_address) logger.info(f"Stored mapping in Redis: {attacker_ip} -> {pod_address}") ...
Python
1
1, XED_IFORM_VPMAXUB_YMMqq_YMMqq_MEMqq = 4542, XED_IFORM_VPMAXUB_YMMqq_YMMqq_YMMqq = 4543, XED_IFORM_VPMAXUB_YMMu8_MASKmskw_YMMu8_MEMu8_AVX512 = 4544, XED_IFORM_VPMAXUB_YMMu8_MASKmskw_YMMu8_YMMu8_AVX512 = 4545, XED_IFORM_VPMAXUB_ZMMu8_MASKmskw_ZMMu8_MEMu8_AVX512 = 4546, XED_IFORM_VPMAXUB_ZMMu8_M...
Rust
0
otomize => 2, Skill::quint => 2, Skill::quinttog => 2, Skill::wisdom => 2, _ => 0, }; let mut shardgolem = ThingData::default(); shardgolem.flag.0 |= Flag::golem; shardgolem.status.insert(Stat::atk, stat2 / 2); shardgolem.status.insert(Stat::maxhp, stat2 / 2); shardgolem.stat...
Rust
0
from typing import Any from web3 import Web3 from ...network import Network from ...wallet_providers import EvmWalletProvider from ..action_decorator import create_action from ..action_provider import ActionProvider from .constants import WETH_ABI, WETH_ADDRESS from .schemas import WrapEthSchema SUPPORTED_CHAINS = [...
Python
1
from pathlib import Path base_path = Path(__file__).parent data = base_path.joinpath('input.in').read_text().strip().split('\n') # print(data) count = 0 answer = 0 for pair in data: if pair[0] == "A" and pair[2] == "X": count += 3 elif pair[0] == "B" and pair[2] == "Y": count += 5 elif pa...
Python
1
# Copyright (C) 2024-present Naver Corporation. All rights reserved. # Licensed under CC BY-NC-SA 4.0 (non-commercial use only). # # -------------------------------------------------------- # head factory # -------------------------------------------------------- from .dpt_gs_head import create_gs_dpt_head from .linear...
Python
1
NewYork, Newfoundland, Novosibirsk, Ontario, Oslo, Other, Paris, Perth, PetropavlovskKamchatskiy, Phoenix, Prague, Quebec, Reykjavik, Riyahd, Rome, Samara, Samoa, SantaFe, Santiago, Saskatchewan, Seattle, Stockholm, Sydney, ...
Rust
0
#[doc = "Bit 3"] #[inline(always)] pub fn softcon(&self) -> SOFTCON_R { SOFTCON_R::new(((self.bits >> 3) & 0x01) != 0) } #[doc = "Bit 2"] #[inline(always)] pub fn to_digital_pad(&self) -> TO_DIGITAL_PAD_R { TO_DIGITAL_PAD_R::new(((self.bits >> 2) & 0x01) != 0) } #[doc...
Rust
0
let res = histogram.scale(0, value); assert_eq!(0.2 * (10. - 0.3) + 0.3, res); } #[test] fn test_histogram_inf() { let data = vec![vec![0.3, -1.0], vec![7., 0.9], vec![10., 1.0]]; let it = data .iter() .flat_map(|v| v.iter().enumerate().map(|(idx, f)...
Rust
0
#1.IMPORT LIBRARIES import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.datasets import load_digits from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LogisticRegression from sklearn.n...
Python
1
Assimp's log output. const VALIDATION_WARNING = 0x4, /// This flag is currently only set by the aiProcess_JoinIdenticalVertices step. /// It indicates that the vertices of the output meshes aren't in the internal /// verbose format anymore. In the verbose format all vertices are unique...
Rust
0
BuildRequestError(http::Error), #[error("Failed to execute request: {0}")] ExecuteRequestError(azure_core::HttpError), #[error("Failed to serialize request body: {0}")] SerializeError(serde_json::Error), #[error("Failed to deserialize response: {0}, body: {1:?...
Rust
0
from django.http import HttpResponse import re import os def index(request): result = "Test Page (at least vulnerable to xss - don't use on live)<br/>\n" try: result += "<br/>GET input0:<br/><br/>" result += "input0="+request.GET['input0']+"<br/>" result += "len(input0)="+str(len(request.GET['input0']))+"<br/>...
Python
1
, ethical_framework=self.ethical_framework, decision="ALLOW", confidence=0.9, reasoning="Content promotes cultural understanding and respect", supporting_evidence=[f"Detected {respectful_score} culturally respectful keywords"], ...
Python
1
Embeddings de CSV gerados: {len(csv_embeddings)} vetores") for i, text in enumerate(csv_texts): print(f" 📄 Linha {i+1}: {text}") # 8. Verificar conexão com Supabase (se disponível) print("\n🔌 Testando conexão com Supabase...") try: # Gerar em...
Python
1
t ctor = ctor.clone(); let name = name.clone(); let self_obj = Rc::new(RefCell::new( Class { name: name.clone(), members: process_fn_mem(mems, rc.clone(), &name.clone()), dtor: None, friends: friends.clone(), par...
Rust
0
run(|mut all_storages| { entity_creator::create_base(Axial::new(10, 5), &mut all_storages); let nest_time = 20; entity_creator::create_nest(Axial::new(-5, -7), nest_time, &mut all_storages); entity_creator::create_nest(Axial::new(12, -15), nest_time, &mut all_storages);...
Rust
0
import socket import selectors import time selector = selectors.DefaultSelector() def send_response(conn, addr, response): """Send the response when the socket is ready for writing.""" try: conn.sendall(response.encode()) except Exception as e: print(f"Error sending response to {addr}: {e...
Python
1
_obj['url'], params=params, cookies=cookie, headers=new_http_header, timeout=5, proxies=proxies) except requests.exceptions: raise ConnectError('多次网络请求均未能获得数据:{}'.format(info_obj['url'])) # 尝试理解并验证响应数据 if http_result.status_code == 200: try: json...
Python
1
from typing import List from fastapi import APIRouter, Depends from sqlalchemy.ext.asyncio import AsyncSession from app.core.db import get_async_session from app.core.user import current_superuser, current_user from app.crud.charity_project import charity_project_crud from app.crud.donation import donation_crud from ...
Python
1
et mut loc_configs = TextureConfig::dump_all(config)?.into_values().collect::<Vec<_>>(); loc_configs.sort_unstable_by_key(|loc| loc.id); let mut file = File::create(path!(config.output / "textures.json"))?; let data = serde_json::to_string_pretty(&loc_configs).unwrap(); file.write_all(data.as_bytes())?...
Rust
0
basic_dir_path = '/unitree/robot/basic' # Absolute path might be needed depending on the system setup tmp_dir_path = '/unitree/tmp' model_id_to_name = { 1: "AIR", 2: "PRO", 4: "EDU" } # Reverse the dictionary to map from names to IDs model_name_to_id = {name: id for id, name in model_id_to_name.items()}...
Python
1
#[cfg(any(feature = "rustls", feature = "native-tls"))] pub fn new(config: &aws_types::config::Config) -> Self { Self::from_conf(config.into()) } #[cfg(any(feature = "rustls", feature = "native-tls"))] pub fn from_conf(conf: crate::Config) -> Self { let client = aws_hyper::Client::...
Rust
0
f dZddlZGddejZGddejZGddejZGd d eej ZGd d eej Zd Zeje dZ e j...
Python
1
utxos = crate::test_util::setup_utxos_2_2_2(out_chain_ids, out_amounts, Some(in_indices)); let output1 = out_utxos[0].commitment.into_repr().to_bytes_le(); let output2 = out_utxos[1].commitment.into_repr().to_bytes_le(); let ext_data = ExtData { recipient: RECIPIENT.to_string(), re...
Rust
0
; } } <gh_stars>0 // Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0. use cop_datatype::EvalType; use super::*; /// A scalar value container, a.k.a. datum, for all concrete eval types. /// /// In many cases, for example, at the framework level, the concrete eval type is unknown at compile /// time...
Rust
0
ef search_content(data: SearchContentRequest = Body(...)): """ Search for text content within files in a specified directory. """ base_path = normalize_path(data.path) results = [] search_query_lower = data.search_query.lower() if not base_path.is_dir(): raise HTTPException(status_c...
Python
1
from src.common.domain import DomainException class InvalidReservationIdException(DomainException): def __init__(self, user_id: str): super().__init__(f"Invalid Reservation ID: {user_id}")
Python
1
ec2_to_vec3`](fn.vec2_to_vec3.html) /// * [`vec2_to_vec4`](fn.vec2_to_vec4.html) pub fn vec4_to_vec2<N: Scalar + Copy>(v: &TVec4<N>) -> TVec2<N> { TVec2::new(v.x, v.y) } /// Creates a 2D vector from a slice. /// /// # See also: /// /// * [`make_vec1`](fn.make_vec1.html) /// * [`make_vec3`](fn.make_vec3.html) /// *...
Rust
0
); } } <filename>src/lib.rs #![feature(unboxed_closures)] #![feature(phase)] #![feature(macro_rules)] extern crate regex; pub mod types; pub mod parser; pub mod eval; pub mod init; fn debug(s: &str) { // print!("{}", s); } fn debugln(s: &str) { // println!("{}", s); } mod physical_device_type; pub use self::phy...
Rust
0
self.close_session(); return Ok(Async::Ready(None)); } self.notify = Some(task::current()); Ok(Async::NotReady) } } pub(crate) struct SessionMeta<U> { config: Config, id: SessionId, protocol_configs: Arc<HashMap<String, Box<dyn ProtocolMeta<U> + Send + Sync...
Rust
0
uote, '“' => LeftDoubleQuote, '”' => RightDoubleQuote, '`' => GraveAccent, '^' => CircumflexAccent, '\\' => ReverseSolidus, '~' => Tilde, ch => Unescaped(ch), } } } impl EscapeToken { fn escape_sequence(&self) -> &'stat...
Rust
0
import torch from typeguard import typechecked from espnet2.s2st.losses.abs_loss import AbsS2STLoss from espnet2.utils.types import str2bool from espnet.nets.pytorch_backend.e2e_tts_tacotron2 import Tacotron2Loss class S2STTacotron2Loss(AbsS2STLoss): """Tacotron-based loss for S2ST.""" @typechecked def ...
Python
1
from collections import deque def create_graph(tubes): graph = {} for i, tube in enumerate(tubes): content = {} for ball in tube: if ball in content: content[ball] += 1 else: content[ball] = 1 graph[i] = content return graph ...
Python
1
insert( "X-B3-ParentSpanId", HeaderValue::from_static("0102030405060708"), ); expected_headers.insert("X-B3-Sampled", HeaderValue::from_static("1")); assert_eq!(headers, expected_headers); assert_eq!(get_trace_context(&headers), Some(context)); } } <filename>...
Rust
0
ch_input_mask = np.array([ inst[1] for inst in insts ]).astype("float32").reshape([-1, max_seq_length, 1]) batch_mask_position = np.array([ idx * max_seq_length + inst[2] for (idx, inst) in enumerate(insts) ]).astype("int64").reshape([-1, 1]) batch_mask_label = np.array( [inst[3...
Python
1
ername: &str, password: &<PASSWORD>, credential_store: std::sync::Arc<std::sync::RwLock<CredentialStore>>, ) -> josh::JoshResult<bool> { let specs: Vec<_> = refs_prefixes .iter() .map(|r| { format!( "'+{}:refs/josh/upstream/{}/{}'", &r, ...
Rust
0
# -*- coding: utf8 -*- # Copyright 1999-2017 Tencent Ltd. # # 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 l...
Python
1
) { self.stored.push_back(next); } } self.stored.front() } /// Returns the next item after the last one peeked. It doesn't interfer with `peek` output. fn peek_next(&mut self) -> Option<&(TokenKind, &'a str)> { self.peek_pos += 1; if self.peek_pos ...
Rust
0
, 480], 'monitor_twopeople': [640, 480], 'monitor_twowoman': [640, 480], 'test_001_BatMan_video_06': [1280, 720], 'test_002_BF5_FireGUN_video_05': [1280, 720], 'test_003_BianLian_video_02': [1280, 720], 'test_004_BianLian_video_04': [1280, 720], 'test_005_Cartoon-Fox-video-03_done': [1280, 720], 'test_006_Cartoon-Fox-v...
Python
1
: usize, a: f32, b: f32) { if n >= self.band_count() { panic!("Accessing bands this CH does not have"); } if n == 0 { panic!("Band 0 cannot be accessed through this interface"); } self.coeffs[(n * 2) - 1] = a; self.coeffs[n * 2] = b; } pu...
Rust
0
pull-down resistor at pad."] #[inline] pub fn epd(&mut self) -> _EPDW { _EPDW { w: self } } #[doc = "Bit 4 - Disable pull-up resistor at pad. By default, the pull-up resistor is enabled at reset."] #[inline] pub fn epun(&mut self) -> _EPUNW { _EPUNW { w: self } } #[doc =...
Rust
0
IpAddr::from([127, 0, 0, 1]), )) }); mock::Spawn::new(make::MakeGateway::new( resolve, service_fn(move |_: _| { let out = outbound.clone(); async move { Ok::<_, Never>(out) } ...
Rust
0