text
string
label_name
string
labels
int64
("X1", "X0"), ("X2", "X0"), ("X3", "X0"), ("X4", "X0")])) data = np.random.normal(0, 1, (10000, 4)) data = pd.DataFrame( { "X0": (data[:, 0] + data[:, 1] + data[:, 2] + data[:, 3]).reshape(-1), "X1": data[:, 0].reshape(-1), "X2": data[:, 1].reshape(-1), "...
Python
1
import numpy as np from ocelot.cpbd.elements.optic_element import OpticElement from ocelot.cpbd.elements.bend_atom import BendAtom from ocelot.cpbd.transformations.transfer_map import TransferMap class Bend(OpticElement): """ bending magnet l - length of magnet in [m], angle - angle of bend in [rad],...
Python
1
"""Dilated ResNet and DenseNet""" from .resnet import *
Python
1
ref().map(|i| i.handle).unwrap(); break; } } item } } fn next_item(tree: HWND, action: NextAction, handle: HTREEITEM) -> Option<TreeItem> { use winapi::shared::minwindef::{LPARAM, WPARAM}; use winapi::um::commctrl::TVM_GETNEXTITEM; let handle = wh::...
Rust
0
(to_vec(&value).unwrap(), String::from("i2e").into_bytes()); } #[test] fn test_serialize_u64() { let value: u64 = 2; assert_eq!(to_vec(&value).unwrap(), String::from("i2e").into_bytes()); } #[test] fn test_serialize_u64_greater_than_i64_max() { let value: u64 = (i64::ma...
Rust
0
2048, scheme: AsymSchemeUnion::RSASSA(HashingAlgorithm::Sha256), pub_exponent: 0, }, 16, ) .unwrap(); let (key2, auth2) = ctx .create_key( KeyParams::RsaSign { size: 2048, scheme: AsymSchemeUn...
Rust
0
""" Exercise 152 The following DataFrame is given: | df = pd.DataFrame(np.random.rand(10, 4), columns=list('ABCD')) Extract rows of this DataFrame for which the C column is greater than 0.3 and the D column is less than 0.7. Print result to the console. """ import numpy as np import pandas as pd np.random.seed...
Python
1
bseed', 'https://mywebseed.example.org/foo', '--nowebseed']) t = torf.Torrent.read(exp_torrent_filepath) assert t.webseeds == [] cap = capsys.readouterr() assert 'Webseed\t' not in cap.out @pytest.mark.parametrize( argnames='merges, exp_result', argvalues=( ( [ ...
Python
1
batches .into_par_iter() .map(|p| { p.packets .iter() .map(|p| verify_shred_cpu(p, slot_leaders).unwrap_or(0)) .collect() }) .collect() }) }); inc_n...
Rust
0
level is too ') print('high or signal is not present. Please check your setup and try again.') exit() if isnan(test): # NRP-xxP sensors return a "nan-float" as long as there is no valid signal available print('Cannot measure. Either timing information is wrong, signal level ...
Python
1
dding_dim=embedding_dim, embedding_name=embedding_name, embedding_initializer=embedding_initializer, embedding_regularizer=embedding_regularizer ) embedded_dict[slot_name] = group[slot_name] if len(embedd...
Python
1
_mut_slice() } } impl<T: Serialize> Serialize for Vec<T> { fn serialize<S>(&self, serializer: S) -> StdResult<S::Ok, S::Error> where S: Serializer, { self.vec.serialize(serializer) } } impl<'de, T: Deserialize<'de>> Deserialize<'de> for Vec<T> { fn deserialize<D>(deserializer: ...
Rust
0
return message def convert_date(input_date): # Map month abbreviations to their numeric representation month_mapping = { 'JAN': '01', 'FEB': '02', 'MAR': '03', 'APR': '04', 'MAY': '05', 'JUN': '06', 'JUL': '07', 'AUG': '08', 'SEP': '09', 'OCT': '10', 'NOV': '11', 'DEC': '12' } # Ext...
Python
1
F: Fn(&mut T, &R::ShaderResourceView), G: Fn(&mut T, &R::UnorderedAccessView), H: Fn(&mut T, &R::RenderTargetView), I: Fn(&mut T, &R::DepthStencilView), J: Fn(&mut T, &R::Sampler), K: Fn(&mut T, &R::Fence), >(&mut self, &mut T, A, B, C, D, E, F, G, H, I, J, K); } imp...
Rust
0
ument("-u", "--usernames", type=str, help="The usernames that are to be read", action="store", dest="username_file") parser.add_argument("-f", "--filename", type=str, help="Filename for output the confirmed usernames", action="store", dest="filename") parser.add_argument("-i", "--ip", type=str, help="The IP add...
Python
1
= "std"), no_std)] // A module for proof of existence pub use pallet::*; #[cfg(test)] mod mock; #[cfg(test)] mod tests; //定义功能模块 #[frame_support::pallet] pub mod pallet { use frame_support::{ dispatch::DispatchResultWithPostInfo, pallet_prelude::* }; use frame_system::pallet_prelude::*; ...
Rust
0
import paddle import paddle.nn as nn class PointNet_Basic_Seg(nn.Layer): def __init__(self, num_classes=50, max_points=1024): super(PointNet_Basic_Seg, self).__init__() self.max_points = max_points self.pointnet_bacic = PointNet_Basic(max_points) self.seg_net = nn.Sequential( ...
Python
1
from flask import Blueprint, request, jsonify from app.models import Genero from app import db genero_bp = Blueprint('genero', __name__) @genero_bp.route('/generos', methods=['GET']) def get_generos(): generos = Genero.query.all() return jsonify([genero.serialize() for genero in generos]) @genero_bp.route('/...
Python
1
'#0030300977V#020F现在已经\n', '没时间闲逛了啊。', TxtCtl.Enter, TxtCtl.Clear, '#0030300978V在街上买完东西以后\n', '就去国际空港吧。', TxtCtl.Enter, ), ) CloseMessageWindow() def _loc_5C54(): pass label('loc_5C54') ChrMoveToRelative(...
Python
1
scheduler.step() # 调用模型训练 model.train() # 依次获取所有图像,参与模型训练或测试 for data in dataloaders[phase]: # 获取输入 inputs, labels = data # 判断是否使用gpu if use_gpu: ...
Python
1
# -*- coding: utf-8 -*- '''Test getContiguousLaneSegment method that return the contour of another piece of road lane that continues the given one at its beginning (if length<0) or at its end (if length>0''' from __future__ import division from __future__ import print_function __author__= "Luis C. Pérez Tato ...
Python
1
""" Regularized Best Subset Selection ================================= """ # %% # # .. image:: ../../Tutorial/figure/regularized_cover.png # # %% # In some cases, especially under low signal-to-noise ratio (SNR) setting or predictors are highly correlated, # the vallina type of :math:`\ell_0` constrained model ma...
Python
1
crate) mod date; pub(crate) mod raw; pub(crate) mod number; pub(crate) mod varchar; pub(crate) mod timestamp; pub(crate) mod interval; pub(crate) mod rowid; pub use date::Date; pub use raw::Raw; pub use number::Number; pub use varchar::Varchar; pub use rowid::RowID; pub use timestamp::DateTime; pub use interval::Inter...
Rust
0
offset_y.serialize_into(bytes); self.width.serialize_into(bytes); self.height.serialize_into(bytes); self.screen.serialize_into(bytes); self.following.serialize_into(bytes); } } #[derive(Debug, Clone, PartialEq, Eq)] pub enum DeviceStateData { Resolution(DeviceStateDataResolution...
Rust
0
node.index()), child_span)] } }) .collect(); } fn sorted_children(&self, node: NodeIndex) -> impl Iterator<Item = NodeIndex> { let mut children = self .dag .children(node) .iter(&self.dag) .map(|(_, node)| node) ...
Rust
0
import tensorflow as tf import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import re import os import sys import time import json from glob import glob from PIL import Image import pickle import I2S_Model import I2S_evalData from datetime import datetime os.environ["CUDA_VISIBLE_DEVICES"]="0" gp...
Python
1
slots = [ [], [], [], [], [], [], [], [] ] # 8 calibration slots cfg = [] # the config slot size = os.path.getsize( infile.name ) file_size_orig = max_slot_orig * slot_len + sector_len file_size_noSD = max_slot_noSD * slot_len + sector_len if size == file_size_orig: # orig 5 slot format index = 0 # start with s...
Python
1
Time::from_zx(zxt1); let t2 = Time::from_zx(zxt2); assert_eq!(t1.into_zx(), zxt1); assert_eq!(Time::from_zx(zx::Time::INFINITE), Time::INFINITE); assert_eq!(Time::from_zx(zx::Time::INFINITE_PAST), Time::INFINITE_PAST); assert_eq!(zxt1 - zxt2, t1 - t2); assert_eq!(zxt1 +...
Rust
0
#!/usr/bin/env python3 import pandas as pd import json data = pd.read_pickle('data.pkl') # iteratve over rows and convert to json data_json = [] query_to_index = {} for index, row in data.iterrows(): ''' category: Category of search query, used to seed diverse generations search_query: The user query to ...
Python
1
# Attribute TIMEX2 TIMEX3 #--------------------------------- # ID None tid ('t' + ID) # value val value # mod mod mod # type set type # (only if type=set) # freq None freq # quant None quant # comm...
Python
1
vote: {expected:?} != {received:?}")] UnexpectedVote { #[serde(serialize_with = "serialize_root")] #[serde(deserialize_with = "deserialize_root")] expected: Root, #[serde(serialize_with = "serialize_root")] #[serde(deserialize_with = "deserialize_root")] received: Ro...
Rust
0
v_x", shader::VertexOutDef(shader::Type::Float, shader::VertexOutQualifier::Smooth), ); const V_INSTANCE_START: (&str, shader::VertexOutDef) = ( "v_instance_start", shader::VertexOutDef(shader::Type::Float, shader::VertexOutQualifier::Flat), ); const V_INSTANCE_END: (&str, shader::VertexOutDef) = ( "v...
Rust
0
word=input("Write a word, if u put END, the program will finish ") list=[] cont=0 while word!="END": list.append(word) word=input("Write a word, if u put END, the program will finish ") word=input("What word do you want search? ") if word in list: print(f"The word {word} is found") else: print...
Python
1
from sqlalchemy import String, func from sqlalchemy.orm import Mapped, mapped_column from app.libs.helper import generate_string from .base import Base from .engine import db from .types import StringUUID class Site(Base): __tablename__ = "sites" __table_args__ = ( db.PrimaryKeyConstraint("id", name=...
Python
1
ure_extract_tester, equal_resolution=False, torchify=True) for image in image_inputs: self.assertIsInstance(image, torch.Tensor) # Test not batched input (GLPNFeatureExtractor doesn't support batching) encoded_images = feature_extractor(image_inputs[0], return_tensors="pt").pixel_va...
Python
1
TMRB3CLKR::CTMRB1 => 26, TMRB3CLKR::CTMRB5 => 27, TMRB3CLKR::CTMRB6 => 28, TMRB3CLKR::BUCKBLE => 29, TMRB3CLKR::BUCKB => 30, TMRB3CLKR::BUCKA => 31, TMRB3CLKR::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidde...
Rust
0
# grade calculator name=str(input("Please Enter Student Name: \n")) score=int(input("Print Enter Student Score: \n")) if(score>=101): print("Please enter score b/w 1 to 100") exit() grade=str(input("assign GRADE in captial letter b/w A to E ")) if(grade=="A"): print("Student Name:",name) print("Student...
Python
1
bal variable groupcache, a dictionary containing info about each part of the fortran module. At the end of analyzeline, information is filtered into the correct dict keys, but parameter values and dimensions are not yet interpreted. rrN)rrrrar.rzBanalyzeline: no group yet. ...
Python
1
currentTurboAmount maxTurboAmount turboLastActivatedAt turboAmountLastRechargeDate currentRefillEnergyAmount maxRefillEnergyAmount refillEnergyLastAc...
Python
1
s1 = input().strip().lower() s2 = input().strip().lower() for ch1, ch2 in zip(s1, s2): if ch1 != ch2: if ch1 < ch2: print('-1') elif ch1 > ch2: print('1') break else: print(0)
Python
1
3, 24, 25, 28, 31, //! 32, 33, 34, 35, 38, 39, 42, 45, 46, 47, 48, 49, (52) //! //! (0), 1, 2, 3, 4, 7, 8, 9, 10, 11, 14, 17, 18, 19, 20, 23, 24, 25, 28, 31, //! 32, 33, 34, 35, 38, 39, 42, 45, 46, 47, 49, (52) //! //! (0), 1, 2, 3, 4, 7, 8, 9, 10, 11, 14, 17, 18, 19, 20, 23, 24, 25, 28, 31, //! 32, 33, 34, 35, 38, 39,...
Rust
0
P_BTF_{}", static_item.ident.to_string()); let map_btf_ident = syn::Ident::new(&map_btf_name, static_item.ident.span()); let value_align_name = format!("MAP_VALUE_ALIGN_{}", static_item.ident.to_string()); let value_align_ident = syn::Ident::new(&value_align_name, static_item.ident.span()); let btf_type...
Rust
0
)) => { let dir = args.value_of("dir").unwrap(); let autoplay = args.is_present("autoplay"); serve(dir, autoplay).await?; } _ => unreachable!(), } Ok(()) } struct ProcessCleaner { inner: Child } impl Drop for ProcessCleaner { fn drop(&mut self) { ...
Rust
0
np.testing.assert_allclose(expect_out, np.array(res), rtol=1e-05) # case 2: with program_guard(Program(), Program()): x = paddle.static.data(name="x", shape=[-1, 3], dtype="float32") z = paddle.roll(x, shifts=1, axis=0) exe = base.Executor(paddle.CustomPlace("npu", 0...
Python
1
""" Routes and resources for the /container-terminal-page page """ from typing import Tuple from flask import Blueprint, Response import csle_common.constants.constants as constants import csle_rest_api.constants.constants as api_constants def get_container_terminal_page_bp(static_folder: str) -> Blueprint: """ ...
Python
1
== 'Darwin': set_start_method('forkserver') # Global variables Global = Manager().Namespace() Global.buff_num = 1 Global.read_num = 1 Global.write_num = 1 Global.frame_delay = 0 Global.is_exit = False read_frame_list = Manager().dict() write_frame_list = Manager().dict() ...
Python
1
sitions: &Vec<u16>) -> crate::Result<u32> { let average_float = positions.iter().map(|n| *n as u32).sum::<u32>() as f32 / positions.len() as f32; let average_floor = average_float.floor() as u32; let average_ceil = average_float.ceil() as u32; let (fuel_floor, fuel_ceil) = positions.iter().fold(...
Rust
0
_depth: usize, /// Filename for mod metadata file. pub mod_meta_filename: String, /// Filename for mod data definition script file. pub mod_data_filename: String, /// Regular expression used for validating mod names. pub mod_name_re: Regex, /// Name of the table field to use when extract...
Rust
0
float128', """ 128-bit floating-point number. Character code: 'g'. C long float compatible. """) add_newdoc('numpy.core.numerictypes', 'int8', """8-bit integer. Character code ``b``. C char compatible.""") add_newdoc('numpy.core.numerictypes', 'int16', """16-bit integer. Character code ``h``....
Python
1
where T: DeserializeOwned + std::fmt::Debug, { let resp: Result<T, CommonError> = Runtime::new().unwrap().block_on(async { let data: T = do_request::<T>(url).await?; Ok(data) }); resp? } // Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory o...
Rust
0
nternalContext<Dpy> { fn bind_async<'future, 'a, 'b>( &'a self, dpy: &'b GlDisplay<Dpy>, read: Option<Drawable>, draw: Option<Drawable>, ) -> GenericFuture<'future, breadx::Result<()>> where 'a: 'future, 'b: 'future; fn unbind_async<'future>(&'future self...
Rust
0
import heapq import sys input = sys.stdin.readline INF = int(1e9) n, m, c = map(int, input().split()) graph = [[] for _ in range(n + 1)] distance = [INF] * (n + 1) for _ in range(m): a, b, j = map(int, input().split()) graph[a].append((b, j)) def dijkstra(start): q = [] heapq.heappush(q, (0, start...
Python
1
onal-only string literal to allow static tools like editors and documentation generators to use it. This complements docstrings. The string value passed is available in the attribute ``documentation``. Example:: >>> from typing_extensions import Annotated, Doc ...
Python
1
): no_answer_probabilities = dict((p["id"], p["no_answer_probability"]) for p in predictions) dataset = [{"paragraphs": [{"qas": references}]}] predictions = dict((p["id"], p["prediction_text"]) for p in predictions) qid_to_has_ans = make_qid_to_has_ans(dataset) # maps qid to True/Fals...
Python
1
}) .sum::<Counter>(); (counter.point_count as f64) / (counter.voxel_count as f64) } struct Counter { point_count: usize, voxel_count: usize, } impl Sum for Counter { fn sum<I: Iterator<Item = Self>>(iter: I) -> Self { iter.fold( Counter { point_count: 0, ...
Rust
0
error) => { error!("get room error: {}", error); return; } }; let participant_connection = match ParticipantConnection::new(room).await { Ok(participant_connection) => participant_connection, Err(e) => { ...
Rust
0
uture use", ); cat.insert("Chrome OS", m); let mut m = HashMap::new(); m.insert( convert_str_to_array("5DFBF5F4-2848-4BAC-AA5E-0D9A20B745A6").unwrap(), "/usr partition (coreos-usr)", ); m.insert( convert_str_to_array("3884DD41-8582-440...
Rust
0
type = match l_prim.size().cmp(&r_prim.size()) { Ordering::Less => false, Ordering::Greater => true, Ordering::Equal => !l_prim.signed() && !r.ty.is_pointer(), }; if use_l_type { let r = TCExpr { kind: TCExprKind::Conv { from: r_prim, ...
Rust
0
Alignment::Center, "(AUTO)", Gradient::new(RGB(0xc0,0xc0,0xc0), RGB(0x40,0x40,0x40))); } }); } screen.set_clip_rect(&screen.get_rect()); self.restore_panel(); ...
Rust
0
let Some(path) = config.user_dict_bin_path { let user_dict_bin_data = read_file(path)?; let user_dict = UserDictionary::load(&user_dict_bin_data)?; ( Some(user_dict.dict), Some(user_dict.words_idx_data), Some(us...
Rust
0
from setuptools import find_packages, setup import os from glob import glob package_name = 'my_r2_tf2' setup( name=package_name, version='0.0.0', packages=find_packages(exclude=['test']), data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ...
Python
1
""" Простой запуск синтезирования материала без командной строки Просто запустите: python synthesize/run.py """ import os import sys from pathlib import Path # Добавляем пути для импорта модулей проекта sys.path.append(str(Path(__file__).parent.parent)) from main import ( load_prompts_config, recognize_lectu...
Python
1
ument(level = "debug", skip(app_state, server_handle))] async fn wait_for_ready( app_state: &AppState, server_handle: &DockerComposeServerHandle, ) -> Result<()> { let probe_result = tokio::time::timeout(std::time::Duration::from_secs(60 * 5), async { let mut ready = false; let mut probe = N...
Rust
0
PDF pages. PDF also"] #[doc = " has a type of annotation called \"link\" (FPDFTEXT doesn't deal with"] #[doc = " that kind of link). FPDFTEXT weblink feature is useful for"] #[doc = " automatically detecting links in the page contents. For example,"] #[doc = " things ...
Rust
0
""" Sends a couple of orders to 'orders' for OMS/EMS/ledger end-to-end test. """ import os, asyncio, time, ujson as json from aiokafka import AIOKafkaProducer BROKER=os.getenv("KAFKA_BROKER","localhost:9092") TOPIC=os.getenv("ORD_TOPIC","orders") async def main(): p=AIOKafkaProducer(bootstrap_servers=BROKER, acks...
Python
1
("VadRoot") // MM_AVL_TABLE *PhysicalVadRoot / MM_AVL_TABLE VadRoot / RTL_AVL_TREE VadRoot .ok_or_else(|| { Error(ErrorOrigin::OsLayer, ErrorKind::Offset) .log_warn("_EPROCESS::VadRoot not found") })? .offset as _; let balanced_node_left =...
Rust
0
class Solution: def zigzagLevelOrder(self, root: Optional[TreeNode]) -> List[List[int]]: if not root: return [] ans = [] q = collections.deque([root]) isLeftToRight = True while q: size = len(q) currLevel = [0] * size for i in range(size): node = q.popleft() ...
Python
1
from libis import cabeçalho def aquivoExiste(nome): '''arquivoExiste verifica se o arquivo onde vai ser salvo os dados, existe''' try: a = open(nome, 'rt') a.close() except FileNotFoundError: return False else: return True def criarArquivo(nome): '''criarArquivo cr...
Python
1
""" AI-powered subdomain prediction module """ import json import requests from typing import List from ..core.config import Config class AIPredictor: """AI-powered subdomain prediction using Gemini""" def __init__(self, config: Config): self.config = config self.gemini_url = "https://g...
Python
1
from unittest import IsolatedAsyncioTestCase from dex_adaptors.uniswap_v3 import UniswapV3 class TestUniswapV3(IsolatedAsyncioTestCase): async def asyncSetUp(self): self.exchange = UniswapV3() async def asyncTearDown(self): pass async def test_get_pool_data(self): ezETH_WETH_poo...
Python
1
"GL_KHR_debug"))] #[cfg_attr(docs_rs, doc(cfg(any(feature = "GL_KHR_debug"))))] pub fn glDebugMessageControlKHR_is_loaded() -> bool { !glDebugMessageControlKHR_p.load(RELAX).is_null() } /// [glDebugMessageInsertKHR](http://docs.gl/es3/glDebugMessageInsertKHR)(source, type_, id, severity, length, buf) //...
Rust
0
#Sets the scene to load either the Non GLSL scene or the GLSL scene import bge def main(): cont = bge.logic.getCurrentController() own = cont.owner yes = cont.actuators["yes"] no = cont.actuators["no"] #Check to see if data is already loaded try: if bge.logic.globalDict['game_resolution']: print ('conf...
Python
1
EQ_FILTER_PEAKING, DspMultibandEqFilterType::Bandpass => ffi::FMOD_DSP_MULTIBAND_EQ_FILTER_BANDPASS, DspMultibandEqFilterType::Notch => ffi::FMOD_DSP_MULTIBAND_EQ_FILTER_NOTCH, DspMultibandEqFilterType::AllPass => ffi::FMOD_DSP_MULTIBAND_EQ_FILTER_ALLPASS, } } } impl Dsp...
Rust
0
the `relatedTarget` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/relatedTarget)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `MouseEvent`*"] pub fn related_target...
Rust
0
http_response( 402, vec![("Powered-By", "proxy-wasm")], Some(b"Access forbidden.\n"), ); Action::Pause } } } } #[flow( calculate_strategy = "Direct", control_strategy = "Reject", threshold = ...
Rust
0
/// supported on Linux. /// /// The ACL *must* contain entries for the permssion modes of the file. Use /// the [`AclEntry::allow_other`] and [`AclEntry::allow_mask`] functions to /// specify the mode's other and mask permissions. Use "" as the name for the /// file owner and group owner. /// /// If an ACL contains a n...
Rust
0
""" pygments.lexers.zig ~~~~~~~~~~~~~~~~~~~ Lexers for Zig. :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, words from pygments.token import Comment, Operator, Keyword, Name, String, \ Number...
Python
1
lf.enhancer.gem_plan_list.clear() min_star = self.enhancer.min_gem_level.value() max_star = self.enhancer.max_gem_level.value() if min_star >= max_star: return # 获取当前宝石方案设置 gem_settings = self.enhancer.settings.get("宝石方案", {}) plan_settings = gem_settings.g...
Python
1
"""Codec for serializing and deserializing a hash field with a width of 160 bits (20 bytes). `See Hash Fields <https://xrpl.org/serialization.html#hash-fields>`_ """ from __future__ import annotations from typing import Type from typing_extensions import Self from xrpl.core.binarycodec.types.hash import Hash clas...
Python
1
n the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/ucx/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file. // Copyright ...
Rust
0
nt) = next_element { // Fetch the element definition let wrapper = core.elements.get(&current_element); let wrapper = match wrapper { Some(wrapper) => wrapper, None => { break; } }; // S...
Rust
0
8], vec![5, 7, 8], vec![6, 7, 8], ]; assert_eq!(generate_timestamp_patterns(&vec![4, 5, 6, 7, 8]), expected); } } use std::path::Path; use std::env; pub fn get_builtin(cmd: &String) -> Option<fn(crate::ast::SExp) -> String> { match cmd.as_ref() { "cd" => Some(bu...
Rust
0
# Ultralytics YOLO 🚀, AGPL-3.0 license """ Ultralytics modules. Visualize with: from ultralytics.nn.modules import * import torch import os x = torch.ones(1, 128, 40, 40) m = Conv(128, 128) f = f'{m._get_name()}.onnx' torch.onnx.export(m, x, f) os.system(f'onnxsim {f} {f} && open {f}') """ from .block import (C1, C...
Python
1
: *mut JNIEnv, throwable: jobject, index: jint, ) -> jobject { todo!() } pub extern "C" fn JVM_InitializeCompiler(env: *mut JNIEnv, compCls: jclass) { todo!() } pub extern "C" fn JVM_IsSilentCompiler(env: *mut JNIEnv, compCls: jclass) -> jboolean { todo!() } pub extern "C" fn JVM_CompileClass(env: *...
Rust
0
Isaac64Rng>; /// A seedable random number generator that can be serialized for consistent random number /// generation. For more info on Rust RNGs, refer to https://rust-random.github.io/book/guide-rngs.html /// For an example implementation of serializable RNG, refer to /// https://github.com/rsaarelm/calx/blob/4...
Rust
0
font-size: 12px; min-height: 24px; } QPushButton:hover { background-color: #40a9ff; } """) add_btn.clicked.connect(self.add_attachment) remove_btn = QPushButton('- 删除') remove_btn.setFixedWidth(60) # 减小按钮宽...
Python
1
crate libc; mod bluetooth; pub use bluetooth::*; // //////////////////////////////////// // Linux implementation of functions #[cfg(target_os = "linux")] mod linux; #[cfg(target_os = "windows")] #[allow(unused_variables)] // TODO: remove warnings mod windows; mod platform { #[cfg(target_os = "linux")] pub...
Rust
0
state_lock); db.flush()?; Ok(ban_user::Response::new().into()) } /// # `POST /_matrix/client/r0/rooms/{roomId}/unban` /// /// Tries to send an unban event into the room. #[cfg_attr( feature = "conduit_bin", post("/_matrix/client/r0/rooms/<_>/unban", data = "<body>") )] #[tracing::instrument(skip(db, ...
Rust
0
n_pattern: TransactionPattern, } /// CLI options for linear search max throughput. #[derive(Debug, StructOpt)] #[structopt( name = "max_throughput", author = "Libra", about = "Linear Search Maximum Throughput." )] pub struct SearchOpt { // Options for creating Benchmarker. #[structopt(flatten)] ...
Rust
0
S IN THE // SOFTWARE. use winapi::ctypes::c_long; use winapi::shared::winerror::HRESULT; use winapi::shared::wtypes::{BSTR,VARIANT_BOOL}; use winapi::um::oaidl::{IDispatch, IDispatchVtbl, VARIANT, SAFEARRAY}; use crate::system::_Exception; use crate::system::reflection::_MethodBase; use crate::system::runtime::remo...
Rust
0
import cv2 def apply_canny(img, low_threshold, high_threshold): return cv2.Canny(img, low_threshold, high_threshold)
Python
1
pe(): self.linear_in = L.Linear(idim, n_units) self.lnorm_in = L.LayerNormalization(n_units) self.pos_enc = PositionalEncoding(n_units, dropout, 5000) self.n_layers = n_layers self.dropout = dropout for i in range(n_layers): setattr...
Python
1
Vec<Option<ColName>>>, insert: &proc::Insert, ) -> Result<(Vec<Option<ColName>>, ColUsageNode), ErrorT> { let projection = compute_insert_schema(insert); let mut exprs = Vec::new(); for row in &insert.values { for expr in row { exprs.push(expr.clone()); } } Ok(( pr...
Rust
0
video: &[], audio: &[], }; const CHROMECAST: Device = Device { container: &[ContainerFormat::MKV], video: &[VideoFormat::H264, VideoFormat::VP8], audio: &[ AudioFormat::Vorbis, AudioFormat::AAC, AudioFormat::FLAC, AudioFormat::MP3, AudioFormat::Opus, ], }; const CHROMECAST_ULTRA: Device = Device { con...
Rust
0
Generate object to pass to C++ """ spec = _C.RaySegmentsSpec() spec.vals = self.vals.contiguous() if self.packed_info is not None: spec.chunk_starts = self.packed_info[:, 0].contiguous() if self.packed_info is not None: spec.chunk_cnts = self.pack...
Python
1
import random import requests_mock from mediawords.db import connect_to_db from mediawords.test.db.create import create_test_topic from topics_fetch_twitter_urls.fetch_twitter_urls import fetch_twitter_urls_update_state from .mock_lookups import mock_statuses_lookup, mock_users_lookup def test_fetch_twitter_urls_u...
Python
1
"""replace local auth with cognito Revision ID: 6f8a4e1b9d43 Revises: 5f7a3e1b8d42 Create Date: 2025-01-20 12:00:00.000000+00:00 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = '6f8a4e1b9d43' down_revision: Union[str, No...
Python
1
# Copyright (C) 2016-Today: Odoo Community Association (OCA) # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class GithubTeamPartner(models.Model): _name = "github.team.partner" _description...
Python
1
# Принцип работы сортировки вставками: # 1. Считаем первый элемент списка отсортированным. # 2. Затем берем следующий элемент и вставляем его на правильное место в уже отсортированной части списка. # 3. Повторяем этот процесс для каждого элемента, пока весь список не будет отсортирован. def insertion_sort(arr): n =...
Python
1
00421142578), ), (1629, ("TER", "LPLA", 38.761799, -27.090799)), (1630, ("QLR", "LPMR", 39.828335, -8.8875)), (1631, ("UNKNOWN", "LPMT", 38.703899, -9.03592)), (1632, ("UNKNOWN", "LPOV", 40.915901, -8.64592)), (1633, ("PDL", "LPPD", 37.7411994934, -25.6979007721)), (1634, ("PIX", "LPPI", 38....
Rust
0