text
string
label_name
string
labels
int64
or( name='ProtoconfMutationService', full_name='v1.ProtoconfMutationService', file=DESCRIPTOR, index=0, serialized_options=None, serialized_start=219, serialized_end=316, methods=[ _descriptor.MethodDescriptor( name='MutateConfig', full_name='v1.ProtoconfMutationService.MutateConfig', inde...
Python
1
eekableDataSourceInner<R, A>>, ); impl<R: Read + Debug + Send + Sync + 'static, A: Digest> Debug for UnseekableDataSource<R, A> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("UnseekableDataSource").field(&self.0).finish() } } struct UnseekableDataSourceInner<R: Read + Debu...
Rust
0
# Copyright 2015 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 agreed to in writing, s...
Python
1
e: # network or HTTP errors _ = e # Reserved for logging br.on_failure(time.time()) if attempt >= self.retries: raise # simple exponential backoff: 0.5, 1.0, 2.0 ... del...
Python
1
sprite.x == -256 { 0 } else { sprite.x }; let y = sprite.y as u16; // "Only those sprites with -size < X < 256 are considered in Range." (`size` is `w` here) // We don't check `X < 256`, since that cannot occur (X is a signed 9-bit integer) // A sprite moved past the right edge of the s...
Rust
0
a<&'a Complex32>, } impl<'a> FftPlan<'a> { pub fn create( x: &'a [Complex32], y: &'a mut [Complex32], direction: FftType, ) -> Result<Self, &'static str> { assert!(x.len() == y.len(), "x/y buffers must have the same size"); if direction == FftType::FORWARD || direction =...
Rust
0
Script::TaiTham, 0x1A57 => Script::TaiTham, 0x1A58..=0x1A5E => Script::TaiTham, 0x1A60 => Script::TaiTham, 0x1A61 => Script::TaiTham, 0x1A62 => Script::TaiTham, 0x1A63..=0x1A64 => Script::TaiTham, 0x1A65..=0x1A6C => Script::TaiTham, 0x1A6D..=0x1A72 => Scr...
Rust
0
in nn_grad but not here. let (mut cost, _) = scope.install(nn_ops::SparseSoftmaxCrossEntropyWithLogits::new( precise_logits, labels, name, )?)?; cost = array_ops::reshape(scope, cost, labels_shape, "")?; let labels_static_shape = labels_static_shape.definition_i64().unwrap(); ...
Rust
0
lse, **dataloader_kwargs: Any ) -> DataLoader: r"""Return a dataloader for the given split. Parameters ---------- key: KeyType, shuffle: bool, default False dataloader_kwargs: Any, Returns ------- DataLoader """ # Construct th...
Python
1
// Calculate bounds let mut min = Offset { x: 9999, y: 9999 }; let mut max = Offset { x: -9999, y: -9999 }; if dungeon.rooms.len() > 0 { for (offset, _) in dungeon.rooms.iter() { min.x = cmp::min(offset.x, min.x); min.y = cmp::min(offset.y, m...
Rust
0
(self): """Public utility method to fetch frame local variables for the stored frame. Frame arguments are not fetched. If there are no frame local variables, return an empty list.""" lvars = [] try: block = self.frame.block() except RuntimeError: ...
Python
1
#!/usr/bin/env python3 import argparse import json import logging import pprint import shlex import thepower def terraform_workspace_id(text): """Extracts Terraform Workspace ID and write it to JSON. Example input: @kyanny , :wave: You've requested GHES 3.10.3 single-node resources in australiaeast on azur...
Python
1
'\u{0F57}', // TIBETAN LETTER BHA '\u{0F5C}', // TIBETAN LETTER DZHA '\u{0F69}', // TIBETAN LETTER KSSA '\u{0F76}', // TIBETAN VOWEL SIGN VOCALIC R '\u{0F78}', // TIBETAN VOWEL SIGN VOCALIC L '\u{0F93}', // TIBETAN SUBJOINED LETTER GHA '\u{0F9D}', // TIBET...
Rust
0
# from globals import debug, contro_signal, mode # if not debug: # from globals import controller from globals import debug import globals import time def control(): # global contro_signal # global debug # global mode init_height = 90 # the initial flight height height = init_height # flight ...
Python
1
import pandas as pd Pesquisa_Populacao_Geral = pd.read_excel('Pesquisa_Populacao_Geral.xlsx') conhecimento_lojas = Pesquisa_Populacao_Geral[Pesquisa_Populacao_Geral['Conhece a conessionária?']== 'Sim'].groupby('Cidade').size().sort_values(ascending=False) print(conhecimento_lojas)
Python
1
import re import json from urlparse import urlparse import urllib import pdb from scrapy.selector import Selector try: from scrapy.spiders import Spider except: from scrapy.spiders import BaseSpider as Spider from scrapy.utils.response import get_base_url from scrapy.spiders import CrawlSpider, Rule from scra...
Python
1
impl frame_system::offchain::AppCrypto<MultiSigner, MultiSignature> for TestAuthId { type RuntimeAppPublic = Public; type GenericSignature = sp_core::sr25519::Signature; type GenericPublic = sp_core::sr25519::Public; } // implementation for mock runtime in test impl frame_system::offchain::AppCrypto<...
Rust
0
( p: *mut DlogProof<GAffine>, ) -> *const OpeningProof<GAffine> { let x = (unsafe { &(*p).proof }).clone(); return Box::into_raw(Box::new(x)); } #[no_mangle] pub extern "C" fn zexe_tweedle_fq_proof_evals_nocopy( p: *mut DlogProof<GAffine>, ) -> *const [DlogProofEvaluations<Fq>; 3] { let x = (unsafe...
Rust
0
.to_string().into(); let iface = configuration_iface.to_string().into(); let content = emit_incoming_account_message.first().unwrap(); let (datatype, body) = (content.0.clone(), content.1.clone()); let dict = Dict::new(vec![(&*datatype, &*body)]); ...
Rust
0
PrivateKey; } impl PartialEq for PublicKey { fn eq(&self, other: &PublicKey) -> bool { self.to_bytes() == other.to_bytes() } } impl Eq for PublicKey {} impl std::hash::Hash for PublicKey { fn hash<H: std::hash::Hasher>(&self, state: &mut H) { let encoded_pubkey = self.to_bytes(); ...
Rust
0
ntial values until we get over 256 running_list_lengths.append(len(last_list)) running_values.append(current_value) if sum(running_list_lengths) >= self.new_base: # We made it! Now add the running value and start again result.appen...
Python
1
, Balance, BlockNumber, Hash, Header, Index, Signature, }; // A few exports that help ease life for downstream crates. #[cfg(any(feature = "std", test))] pub use frame_system::Call as SystemCall; #[cfg(any(feature = "std", test))] pub use pallet_balances::Call as BalancesCall; #[cfg(any(feature = "std", test))] pub us...
Rust
0
ures: 'Win32_Graphics_Direct3D9'*"] pub const D3DDECLTYPE_SHORT4: D3DDECLTYPE = 7i32; #[doc = "*Required features: 'Win32_Graphics_Direct3D9'*"] pub const D3DDECLTYPE_UBYTE4N: D3DDECLTYPE = 8i32; #[doc = "*Required features: 'Win32_Graphics_Direct3D9'*"] pub const D3DDECLTYPE_SHORT2N: D3DDECLTYPE = 9i32; #[doc = "*Requ...
Rust
0
poll_fd() } } pub fn poll_for_read(pfd: &mut [pollfd]) { if let Err(e) = poll(pfd, None) { log::error!("poll failed for {}", e); } } <filename>src/readable/mod.rs //! Bindings and conversions for //! [readable streams](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream). use futures::i...
Rust
0
te_adapter) self._active_adapters: LoRALRUCache = LoRALRUCache( self.lora_slots, self._deactivate_adapter) def list_adapters(self) -> Dict[int, LoRAModel]: """List all registered LoRAModels.""" return dict(self._registered_adapters.cache) def add_adapter(self, lora: LoRAMod...
Python
1
#[inline] pub fn reserved4(&self) -> RESERVED4R { let bits = { const MASK: u8 = 255; const OFFSET: u8 = 4; ((self.bits >> OFFSET) & MASK as u32) as u8 }; RESERVED4R { bits } } #[doc = "Bit 3 - ampcomp_req"] #[inline] pub fn ampcomp_req...
Rust
0
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import logging import time import pytest # type: ignore import requests from tests.utils.tracked_container import TrackedContainer LOGGER = logging.getLogger(__name__) @pytest.mark.parametrize( "env,expected_c...
Python
1
video, is_training=is_training, output_stride=self.feature_grid_stride, out_num_frames=num_frames, final_endpoint='tsm_resnet_unit_2', ) feature_grid = latent / jnp.sqrt( jnp.maximum( ...
Python
1
from __future__ import annotations import operator from collections.abc import Sequence from typing import Optional from langchain_core.callbacks import Callbacks from langchain_core.documents import BaseDocumentCompressor, Document from pydantic import ConfigDict from langchain.retrievers.document_compressors.cross...
Python
1
aZ\ \xf6\x0b0\xccv\x8eA\xe2{\x02\x06\x887\xd1~\x0a\ Q\xf1\x07\x80t2\x11\xf7\xc3{\xbf\xfbe~}\xf3\ y\xaa\xb2B\x81O\xd8\xceB\x04\xe0iU\xf7kM\ \xb5\xb3==h+\x17*\xebZ\xd2\x08\xc7\x8b\xb8\xb8\ ;`\x00\xc2P\xc4<\x13\xb2\xe2\x0f\x00\xfbl\x07\x18\ \x88\x86\x9a\xf2M\x8d5\xb1\xb3Dq\x19\x14\x9bm\xe7\ \xa1\xc2$\x90-\x0a\x5cU\x9a\xda...
Python
1
ansi_code) = self.underline { match ansi_code { AnsiCode::On => { write!(f, "\u{1b}[4m")?; } AnsiCode::Reset => { write!(f, "\u{1b}[24m")?; } _ => {} } } if let...
Rust
0
i - 1])) return ''.join(b) def get_subset_from_bitstring(super_set, bitstring): """ Gets the subset defined by the bitstring. Examples ======== >>> get_subset_from_bitstring(['a', 'b', 'c', 'd'], '0011') ['c', 'd'] >>> get_subset_from_bitstring(['c', 'a', 'c', 'c'], '1100') ['c',...
Python
1
''' Date: 2024-12-12 12:58:32 LastEditTime: 2024-12-12 13:01:42 FilePath: /MineStudio/minestudio/models/groot_one/__init__.py ''' from minestudio.models.groot_one.body import GrootPolicy, load_groot_policy
Python
1
) * 64)?; let bs = self.as_bitmap_mut().0; if buf.len() < bs.len() { return Err(Error::InternalError( "Not sufficient length of buffer for buf_shift".into(), )); } buf_shift_bits(bs, bits, orig_len, buf); self.set_len(orig_len - bits) }...
Rust
0
insert(sender_id, &farmer); self.data_mut().seeds.insert(seed_id, &farm_seed); farm_seed.get_ref().seed_type.clone() } } <gh_stars>0 use rand::thread_rng; use rand::Rng; //use std::fmt; /* Random Value this function will generate a random int between 0 and 255 for the RGB values args: - max (...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time : 2023/12/14 11:40 @Author : alexanderwu @File : write_prd_an.py """ from typing import List, Union from metagpt.actions.action_node import ActionNode LANGUAGE = ActionNode( key="Language", # 项目的语言 expected_type=str, # 期望的类型为字符串 instruction=...
Python
1
タン入力 if let Some(Button::Keyboard(key)) = e.release_args() { match key { Key::J => cpu_sys.pad1.release_button(PadButton::A), Key::K => cpu_sys.pad1.release_button(PadButton::B), Key::U => cpu_sys.pad1.release_button(PadButton::Select), ...
Rust
0
e tar; extern crate toml; mod app; mod cache; mod config; mod error; mod installation; mod package; mod repository; mod utils; use std::path::Path; fn main() { // Get the configs. let config = Path::new("~/.config/wiz"); let config = config::Config:: read_from(config) .map(|x| x.fill_with...
Rust
0
import configargparse, cv2 from functools import partial from dataio import get_mgrid import modules import torch import torch.nn as nn import torch.nn.functional as F from PIL import Image from collections import OrderedDict import os p = configargparse.ArgumentParser() p.add_argument('--save_path', required=True, t...
Python
1
import pandas as pd import time import ijson import content_feature_vec as cf import csv def get_content_vector(tweets_text): content_vector = { "characters":cf.count_characters(tweets_text), "hashtags":cf.count_hashtags(tweets_text), "words":cf.count_words(tweets_text), "hashtags_t...
Python
1
gt_coords /= simcc_split_ratio return keypoint_pck_accuracy(pred_coords, gt_coords, mask, thr, normalize) def refine_simcc_dark(keypoints: np.ndarray, simcc: np.ndarray, blur_kernel_size: int) -> np.ndarray: """SimCC version. Refine keypoint predictions using distribution aware coordinate decoding f...
Python
1
e = GLenum; /// StencilFaceDirection /// * [`GL_BACK`] /// * [`GL_FRONT`] /// * [`GL_FRONT_AND_BACK`] pub type StencilFaceDirection = GLenum; /// StencilFunction /// * [`GL_ALWAYS`] /// * [`GL_EQUAL`] /// * [`GL_GEQUAL`] /// * [`GL_GREATER`] /// * [`GL_LEQUAL`] /// * [`GL_LESS`] /// * [`GL_NEVER`] /// * [`GL_NOTEQUAL...
Rust
0
min.to_string()); let max = max(&reward_points); era_data.insert("max_reward_points".to_string(), max.to_string()); let avg = mean(&reward_points); era_data.insert("avg_reward_points".to_string(), avg.to_string()); let median = median(&mut reward_points); era_data.insert...
Rust
0
job_description: JobDescription::Figurehead, }, whence: Locale::new(0, 4), whither: Locale::new(0, 5), }; assert_eq!(false, ws.apply(service_patch) .tree .orange_east_service_eligibility());...
Rust
0
_BONDING : i32 = 11; /// public static final [BOND_NONE](https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#BOND_NONE) pub const BOND_NONE : i32 = 10; /// **get** public static final [CREATOR](https://developer.android.com/reference/android/bluetooth/BluetoothDevice...
Rust
0
_runtime::MultiSignature; use frame_support::inherent::Vec; use frame_support::sp_runtime::traits::Verify; use sp_core::crypto::AccountId32; use frame_support::sp_runtime::app_crypto::TryFrom; #[pallet::config] pub trait Config: frame_system::Config { type Event: From<Event<Self>> + IsT...
Rust
0
<filename>src/app/dialog.rs /* * Copyright (c) 2016-2018 Boucher, Antoni <<EMAIL>> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation th...
Rust
0
(format!( "target/{}/deps/artifact/{}-*/bin/{}-*{}", target_name, dep_name, bin_name, std::env::consts::EXE_SUFFIX )) .filter_map(Result::ok) .filter(|f| f.extension().map_or(true, |ext| ext != "o" && ext...
Rust
0
) == zero { v = v >> one; } if u > v { mem::swap(&mut u, &mut v); } v = v - u; } u << shift } #[test] fn test_euclid_zero() { assert_eq!(0, euclid_gcd(0, 0)); } #[test] fn test_euclid_same() { assert_eq!(10, euclid_gcd(10, 10)); } #[test] fn ...
Rust
0
to_wrapped(underlying_asset: CurrencyId, underlying_amount: Balance) -> BalanceResult { let exchange_rate = Self::get_exchange_rate(underlying_asset)?; let wrapped_amount = Rate::from_inner(underlying_amount) .checked_div(&exchange_rate) .map(|x| x.into_inner()) .ok_or(Error::<T>::ConversionError)?; Ok...
Rust
0
ings/src/bindings.rs #![allow(broken_intra_doc_links)] #![allow(clippy::all)] // GrVkBackendContext contains u128 fields on macOS #![allow(improper_ctypes)] include!(concat!(env!("OUT_DIR"), "/bindings.rs")); use cosmwasm_std::{Addr, Uint128}; use terra_multi_test::{App, ContractWrapper, Executor}; use white_whale::c...
Rust
0
import random user_points = 0 computer_points = 0 options = ["rock","paper","scissors"] while True: user_choices = input("Choose between:Rock,Paper,Scissors or Q to quit the game :) ").lower() if user_choices == "q": break if user_choices not in options: continue comp_choice...
Python
1
. don't load pic_data twice) let pic_data = std::fs::read(filename).unwrap(); match header_match(&pic_data[0..4]) { cga::CGA_HEADER => return cga::load_spritesheet(filename), ega::EGA_HEADER => return ega::load_spritesheet(filename), _ => panic!("no matching header"), // TODO return resu...
Rust
0
; } // infix operators } else if let Some((l_bp, r_bp)) = infix_binding_power(op) { if l_bp < min_bp { break; } lexer.builder.start_node_at(checkpoint, EXPR).finish_node(); lexer.next(); lexer.builder.token(OP, op);...
Rust
0
from minet.web import Response from minet.crawl import CrawlJob, SpiderResult, Spider, CrawlTarget, Crawler from minet.scrape import WonderfulSoup START_URL = "https://echojs.com/latest" def scrape(soup: WonderfulSoup) -> SpiderResult: next_links = soup.scrape("#newslist article > h2 > a[href]", "href") titl...
Python
1
0, f64::NEG_INFINITY), Ok(f64::NEG_INFINITY)); assert_eq!(mul(-1.0, f64::INFINITY), Ok(f64::NEG_INFINITY)); assert!(mul(0.0, f64::INFINITY).unwrap().is_nan()); assert_eq!(mul(f64::NEG_INFINITY, f64::INFINITY), Ok(f64::NEG_INFINITY)); } #[test] fn test_div() { let div = jit_function! { div(a:f64, b:f64)...
Rust
0
n new( validator_info: ValidatorInfo, config: ValidatorConfig, validator: Validator, ) -> Self { Self { info: validator_info, config, validator: Some(validator), } } } pub trait Cluster { fn get_node_pubkeys(&self) -> Vec<Pubkey>; ...
Rust
0
r(to_py_err::<PyIndexError, _>( "Out of bound: Index cannot be negative", )); } let index = index as usize; if view.len() <= offset + index { Err(to_py_err::<PyIndexError, _>(format!...
Rust
0
ymbols: PyReadonlyArray1<'_, i32>, model: &CustomModel, model_parameters: PyReadonlyArray2<'_, f64>, py: Python<'py>, ) -> PyResult<()> { let dims = model_parameters.dims(); let num_symbols = dims[0]; let num_parameters = dims[1]; if symbols.len() != num_symbo...
Rust
0
vel2 - vel1; gjk::directional_distance(m1, g1, m2, g2, &dvel, &mut VoronoiSimplex::new()) } // edition:2018 // There is an order to respect for keywords before a function: // `<visibility>, const, async, unsafe, extern, "<ABI>"` // // This test ensures the compiler is helpful about them being misplaced. // Visibi...
Rust
0
from domain.Car import Car from domain.Comanda import Comanda from domain.Locatie import Locatie from repository.car_file_repository import CarFileRepository from repository.car_repository import CarRepository from repository.comanda_repository import OrderRepository from repository.locatie_repository import LocatieRep...
Python
1
# coding: utf-8 """ Intrinio API Welcome to the Intrinio API! Through our Financial Data Marketplace, we offer a wide selection of financial data feed APIs sourced by our own proprietary processes as well as from many data vendors. For a complete API request / response reference please view the [Intrinio API ...
Python
1
write_driver( do_write, data, col, b"\r\n\x00" as *const u8 as *const libc::c_char, 2i32 as size_t, ); if r != MAILIMF_NO_ERROR as libc::c_int { return r; } return MAILIMF_NO_ERROR as libc::c_int; } /* * libEtPan! -- a mail stuff library * * Copyright (...
Rust
0
# 情况2和3: 物料B是新增的(无论物料A是否完全移除) change_type = "[新物料引入]" # 存储变更信息,包含该变更涉及的位号、物料和变更类型 changes_by_type[change_type].append((refs, pn_a, pn_b, mpn_a_info, mpn_b_info, alt_info)) # 按变更类型显示 first_type = Tr...
Python
1
let scattered = Ray::new(rec.p, p.generate(), this_ray.tm); let pdf = p.value(scattered.dir); return emitted + get_color(&scattered, background, world, lights.clone(), depth - 1) .change(srec.atten_col) * rec.mat_ptr.scattering_pdf(this...
Rust
0
self } } #[doc = "\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify...
Rust
0
e) fn new( mut memory: Memory<'probe>, state: &'probe mut State, sequence: Arc<dyn ArmDebugSequence>, ) -> Result<Self, Error> { if !state.initialized() { // determine current state let dhcsr = Dhcsr(memory.read_word_32(Dhcsr::ADDRESS)?); log::deb...
Rust
0
#!/usr/bin/env python3 import sys from ctypes import CDLL, Structure, c_byte, c_char_p, c_void_p, \ pointer, string_at def py_str_at(addr): return string_at(addr).decode('UTF-8') def main(argv): fcs = CDLL("libfreecell-solver.so") libc = CDLL("libc.so.6") user = fcs.freecell_solver_user_alloc()...
Python
1
::new(SilentEmitter)); ParseSess::with_span_handler(handler, sm) } #[inline] pub fn source_map(&self) -> &SourceMap { &self.source_map } pub fn clone_source_map(&self) -> Lrc<SourceMap> { self.source_map.clone() } pub fn buffer_lint( &self, lint: &'...
Rust
0
nhead = 8 pos_dropout = 0.1 trans_dropout = 0.1 n_warmup_steps = 500 num_epochs = 10 batch_size = 64 device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') print(device,flush=True) parser = argparse.ArgumentParser(description="Main script for running the model") ...
Python
1
inate.lon} to {item.title()}') # TODO: handle exceptions using self.user_add_claim try: item.addClaim(newclaim) except CoordinateGlobeUnknownError as e: pywikibot.info(f'Skipping unsupported globe: {e.args}') return False return True def main(*args...
Python
1
from DotDashtoText import DotDashtoText, Cha class OnOfftoDotDash(): dotDashtoText = DotDashtoText() wpm = 14 outputDotDashSequence = [] def __init__(self, wpm) -> None: self.wpm = wpm def recieveState(self, state, time): if state: if time < self.wpmToms() * 2.5: # TOD...
Python
1
ptr) }; check!(name); IrminString::wrap(name) } } /* Copyright 2016 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
Rust
0
# pylint: disable=missing-function-docstring, missing-module-docstring from mpi4py import MPI comm = MPI.COMM_WORLD rank = comm.Get_rank() size_ = comm.Get_size() nx = 4 ny = 3 * 2 x = [0., 0., 0., 0.] y = [[0., 0.], [0., 0.], [0., 0.]] if rank == 0: x[:] = 1.0 y[:,:] = 1.0 source = 0 dest = 1 # ... tag1...
Python
1
e); write_batch.put_bytes::<cf::Coding>( (coding_blob.slot(), coding_blob.index()), &coding_blob.data[..BLOB_HEADER_SIZE + coding_blob.size()], )?; } } } punctuate_info_obj_packet( ...
Rust
0
from utils.llm_utils import llm_generate from utils.analysis import analyze_customer_issue from database.support_db import create_support_ticket def customer_service_agent(user_query, user_context): # Analyze sentiment and issue type issue_analysis = analyze_customer_issue(user_query) # Check if escal...
Python
1
header_dt(headers, "eta"), expires: get_header_dt(headers, "expires"), retries: get_header_u32(headers, "retries"), timelimit: headers .inner() .get("timelimit") .and_then(|v| match v { AM...
Rust
0
, ref b @ builtins::bytes::PyBytes => ast::Constant::Bytes(b.as_bytes().to_owned()), ref t @ builtins::tuple::PyTuple => { ast::Constant::Tuple( t.as_slice() .iter() .map(|elt| Self::ast_from_object(vm, elt.clone...
Rust
0
# 初始化PipeLine pl=PipeLine(rgb888p_size=rgb888p_size,display_mode=display_mode) pl.create() display_size=pl.get_display_size() # 初始化自定义旋转目标检测实例 obb_det=ObbDetectionApp(kmodel_path,labels=labels,model_input_size=[320,320],max_boxes_num=max_boxes_num,confidence_threshold=confidence_threshold,nms_thres...
Python
1
} } impl KexPublic for X25519Public { type KexEphemeralPrivate = X25519EphemeralPrivate; } impl AsRef<[u8]> for X25519Public { /// Public keys can be referenced as bytes. /// /// ``` /// use mc_crypto_keys::*; /// use std::convert::TryFrom; /// /// let key = [0x55u8; 32]; /// let p...
Rust
0
_rx) = channel(); let (send_tx, send_rx) = channel(); let path = format!("/tmp/idscp_socket{}", connnection_id); create_socket(&path, send_tx, receive_rx).unwrap(); loop { if let Ok(event) = connection.recv_incoming_msg_with_timeout(ASYNC_TIMOUT) { match event { Idsc...
Rust
0
import operator import functools Numeros = [15, 83, 29, 374, 7, 58, 923, 32] # Ordenar la lista Numeros_ordenados = sorted(Numeros) # Encontrar el segundo menor y el segundo mayor segundo_menor = Numeros_ordenados[1] segundo_mayor = Numeros_ordenados[-2] # Calcular el mínimo, máximo y la suma de todos los números Re...
Python
1
#!/usr/bin/env python3 """Convolution with Padding""" import numpy as np def convolve_grayscale_padding(images, kernel, padding): """ Function to perform convolution with custom padding """ if images.ndim == 4: m, h, w, _ = images.shape # Convert RGB to grayscale images = (0.2989 * ...
Python
1
c000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const xts_aes::RegisterBlock { Self::PTR } } impl Deref for XTS_AES { type Target = xts_aes::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { uns...
Rust
0
# (deep breath) calculate attention and out projection # attn_output, attn_output_weights = _scaled_dot_product_attention(q, k, v, attn_mask, dropout_p, p_list=p_list) # 点积注意力 attn_output = attn_output.transpose(0, 1).contiguous().view(tgt_len * bsz, embed_dim) attn_output = attn_output.to(torch.float1...
Python
1
style_id = style_id.into_inner(); worker.queue(worker::Task::new(worker::TaskType::Style(style_id))); Ok(Json(json!(style::delete(&*conn.get()?, uid, style_id)?))) } fn style_get( conn: web::Data<DbReplica>, auth: auth::Auth, auth_rules: web::Data<auth::AuthContainer>, style_id: web::Path<i6...
Rust
0
from __future__ import print_function import sys, os import pickle import gzip from floor_plans.visualize import View from floor_plans.floorplan import FloorPlan # path = '/home/simonlab/Dropbox/floor_plans/out/school_January_15_2017_17-24/winner_school_population2.p' # path = '/home/simonlab/Dropbox/floor_plans/out/...
Python
1
, 'sk': 'ugaritčina', 'sl': 'ugaritski jezik', 'sr': 'угаритски', 'sr-Cyrl': 'угаритски', 'sr-Latn': 'ugaritski', 'sv': 'ugaritiska', 'ta': 'உகாரிடிக்', 'te': 'ఉగారిటిక్', 'th': 'ยูการิต', 'to': 'lea fakaʻūkaliti', 'tr': 'Ugarit dili', 'ug': 'ئۇگارىتىكچە', 'uk': 'угаритська', 'vi': 'Tiếng Ugaritic', 'yrl': 'ugarítiku',...
Python
1
xt('Duration'), lazy_gettext('Seconds')), widget=NumberInput(step='any')) duration_end = DecimalField( "{} ({})".format(lazy_gettext('Duration to End'), lazy_gettext('Seconds')), widget=NumberInput(step='any')) setpoint_start = DecimalField( lazy_gettext('Start Setpoint'), ...
Python
1
gy Report message."] #[doc = " @param[in] aContext A pointer to application-specific context."] #[doc = ""] #[doc = " @retval OT_ERROR_NONE Successfully enqueued the Energy Scan Query message."] #[doc = " @retval OT_ERROR_NO_BUFS Insufficient buffers to generate an Energy Sc...
Rust
0
N,Q=map(int,input().split()) list = list(map(int,input().split()[:N])) prefix=[] prefix.append(list[0]) for i in range (1,N): prefix.append(list[i]+prefix[i-1]) sum=0 for i in range(0,Q): x,y=map(int,input().split()) if(x==1): sum=prefix[y-1] else: sum=(prefix[y-1]-prefix[x-2]) p...
Python
1
import cv def cv2array(im): depth2dtype = { cv.IPL_DEPTH_8U: 'uint8', cv.IPL_DEPTH_8S: 'int8', cv.IPL_DEPTH_16U: 'uint16', cv.IPL_DEPTH_16S: 'int16', cv.IPL_DEPTH_32S: 'int32', cv.IPL_DEPTH_32F: 'float32', cv.IPL_DEPTH_64F: 'float64', } arrdtype=im.depth...
Python
1
l::task; use crate::app::lib::param; pub async fn main(req: Request<Body>) -> Result<Response<Body>, hyper::Error> { let params = param::post_param(req).await?; let is_1 = params.contains_key("user_id"); if is_1 { let user_id = params.get("user_id").unwrap(); let data = task::select_user_i...
Rust
0
from sympy.core.symbol import symbols from sympy.core.function import Function from sympy.matrices.dense import Matrix from sympy.matrices.dense import zeros from sympy.simplify.simplify import simplify from sympy.codegen.matrix_nodes import MatrixSolve from sympy.utilities.lambdify import lambdify from sympy.printing....
Python
1
))) ] , Exp::Begin( vec![ mk_set(mk_reg("r9"), mk_num_lit(0)) , mk_set(mk_reg("r8"), mk_num_lit(1))] , Box::new(mk_call("X1")))); } <gh_stars>1-10 use super::hittable::*; use super::material::*; use crate::math::*; pub struct Sphere { center: Point3, ...
Rust
0
NomadGasConfig = NomadGasConfig { core: CoreGasConfig { home: HomeGasLimits { update: HomeUpdateGasLimit { per_message: 10_000, base: 100_000, }, improper_update: HomeUpdateGasLimit { per_message: 10_000, ba...
Rust
0
r::AnsiValue(33), // DodgerBlue1 no_uid: Color::AnsiValue(33), // DodgerBlue1 }, pipe: Color::AnsiValue(44), // DarkTurquoise symlink: Symlink { default: Color::AnsiValue(44), // DarkTurquoise broken: ...
Rust
0
from module.auth.role import register_role_api_route, register_role_ui_route from module.auth.user import register_user_api_route, register_user_ui_route from fastapi import FastAPI from fastapi.templating import Jinja2Templates from core import AuthService, MenuService from transport import AppMessageBus, AppRPC from ...
Python
1
instance(self._view, physx.RigidBodyView): pos_w, quat_w = self._view.get_transforms()[env_ids].split([3, 4], dim=-1) quat_w = math_utils.convert_quat(quat_w, to="wxyz") else: raise RuntimeError(f"Unsupported view type: {type(self._view)}") # return the pose r...
Python
1
#!/usr/bin/env python3 """ Git分支管理工具 帮助管理TradingAgents-CN项目的分支 """ import subprocess import sys from typing import List, Dict import argparse # 导入日志模块 from tradingagents.utils.logging_manager import get_logger logger = get_logger('scripts') class BranchManager: def __init__(self): self.current_branch = ...
Python
1