text
string
label_name
string
labels
int64
from].concat()).arg(msg.stamp).query_async(&mut rc).await?; redis::cmd("acl") .arg("setuser") .arg(["client:", &msg.from].concat()) .arg("on") .arg("sanitize-payload") .arg([">", &msg.data].concat()) .arg("nocommands") .arg(["+p...
Rust
0
:modint::{ModValue, ModTrait, ModInt}; /// /// #[derive(Debug, Copy, Clone)] /// struct Mod13 {} /// impl ModTrait for Mod13 { /// const MOD: ModValue = 13; /// } /// type ModInt13 = ModInt<Mod13>; /// /// assert_eq!(ModInt13::new(5), ModInt13::new(2) - ModInt13::new(10)); /// ``` pub trait ModTrait: Debug + Copy +...
Rust
0
_metrics(group_name) logger.info("Disabled metrics collection for group %s.", group_name) print( "You must terminate all instances in the group before you can delete the group." ) print("Set minimum size to 0.") as_wrapper.update_group(group_name, MinSize=0) group = as_wrapper.descr...
Python
1
def main(): print('Hello from main!') if __name__ == '__main__': main()
Python
1
std::ptr::null(), dli_fbase: std::ptr::null_mut(), dli_saddr: std::ptr::null_mut(), }; unsafe { libc::dladdr(init_stored_proc as *const c_void, &mut module_info) }; // extract name from library metadata let module_abs_path = unsafe { CStr::from_ptr(module_info.dli_fname) } .to_s...
Rust
0
/* Clear the stack... */ // TODO: only pop what we put there let size = self.state.get_top(); self.state.pop(size); Ok(()) } fn add_rum_libs(&mut self) { self.state.new_table(); self.state.set_global("rum"); } fn lua_func_wrapper(state: &mut lua::State...
Rust
0
herSet().set_closing_type(user_info['level'])) * XiuConfig().closing_exp_upper_limit)) # 获取下个境界需要的修为 * 1.5为闭关上限 if int(get_exp + user_info['exp']) > max_exp_next: get_exp = 1 msg = f"检测到修为将要到达上限!" sect_stone = int(userstask[user_id]['任务内容']['sect']) s...
Python
1
import tkinter as tk from gui import SignalAnalyzer if __name__ == "__main__": root = tk.Tk() app = SignalAnalyzer(root) root.mainloop()
Python
1
epr_compare hook. This sets up this custom comparison for the test. """ ihook = item.ihook def callbinrepr(op, left: object, right: object) -> str | None: """Call the pytest_assertrepr_compare hook and prepare the result. This uses the first result from the hook and then ensures the ...
Python
1
#!/usr/bin/python3 """ This module contains the function is_same_class """ def is_same_class(obj, a_class): """return true if obj is the exact class a_class, otherwise false""" return (type(obj) == a_class)
Python
1
) gr2poly.Update() dgraph = Mesh(gr2poly.GetOutput(0)) # dgraph.clean() # WRONG!!! dont uncomment dgraph.flat().color(self._c).lw(2) dgraph.name = "DirectedGraph" diagsz = self.diagonal_size() / 1.42 if not diagsz: return None dgraph.scale(1...
Python
1
_num(num: u16) -> Self { match num { 1 => Self::A, 2 => Self::NS, 5 => Self::CNAME, 15 => Self::MX, 28 => Self::AAAA, _ => Self::UNKNOWN(num), } } } #[derive(Debug, Clone, PartialEq)] pub struct Query { pub qname: String, ...
Rust
0
from .addressTypes import ValueList, ValueSingle, ValueRange # generated from asar output # A1 start: A1FA80 objectivesAddr = { # --- objectives checker functions: A1FA80 --- 'objectivesList': ValueSingle(0xA1FA80), 'objectiveEventsArray': ValueRange(0xA1FB1A, length=2*5), 'objective[kraid_is_dead]': Va...
Python
1
ve to remove them early in order to save rent. #[pallet::constant] type DepositPerContract: Get<BalanceOf<Self>>; /// The balance a contract needs to deposit per storage byte to stay alive indefinitely. /// /// Let's suppose the deposit is 1,000 BU (balance units)/byte and the rent is 1 BU/byte/day, /// th...
Rust
0
LINE_THICKNESS}; use ezgui::{Drawable, GeomBatch, GfxCtx, Prerender}; use geom::{Angle, Circle, Distance, Line, Polygon, Pt2D}; use map_model::{BusStop, BusStopID, Map}; const RADIUS: Distance = Distance::const_meters(1.0); pub struct DrawBusStop { pub id: BusStopID, center: Pt2D, zorder: isize, draw...
Rust
0
t)); } // FILENAME if path.len() == 2 { // NO FILENAME IN URL return Ok(root_link(fragment)); } let last = *path.last().unwrap(); let (modules, filename) = if last.contains('.') { (&path[2..path.len() - 1], last) } else { (&path[2..], "index.html") };...
Rust
0
from datetime import date import os CURRENT_DATE = str(date.today()) base_dir = os.path.dirname(os.path.abspath(__file__)) logs_dir = os.path.join(base_dir, "logs") os.makedirs(logs_dir, exist_ok=True) # Default queries for harvest default_queries = { "wos": "OG=(Ecole Polytechnique Federale de Lausanne)", "...
Python
1
""" Main client for the Cloud189 SDK """ import time import httpx import uuid import math import hashlib import base64 import json import random import logging from urllib.parse import urlparse, parse_qs from .constants import * from .store import MemoryStore from .utils import get_signature, rsa_encode, aes_encrypt, ...
Python
1
vector_store=vector_store) vector_index = load_index_from_storage(storage_context=storage_context) return vector_index, all_nodes sub_index,sub_nodes = create_subnodes_index(base_nodes) sub_retriever = sub_index.as_retriever(similarity_top_k=2) sub_nodes_dict = {n.no...
Python
1
import torch from torch_scatter import segment_csr def purity_sampling(xt, x1, x1_probs, unmask_prob, mask_index, batch_size, batch_num_nodes, node_batch_idx, hc_thresh, device): masked_nodes = xt == mask_index # mask of which nodes are currently unmasked purities = x1_probs.max(-1)[0] # the highest probabili...
Python
1
""" A model for the disasters data with a changepoint changepoint ~ U(0, 110) early_mean ~ Exp(1.) late_mean ~ Exp(1.) disasters[t] ~ Po(early_mean if t <= switchpoint, late_mean otherwise) """ from pymc import * from numpy import array, empty from numpy.random import randint __all__ = [ 'disasters_array', ...
Python
1
"ORD_OBJT_CBLC_DVSN_CD": ord_objt_cblc_dvsn_cd } if loan_dt: params["LOAN_DT"] = loan_dt if rsvn_ord_end_dt: params["RSVN_ORD_END_DT"] = rsvn_ord_end_dt if ldng_dt: params["LDNG_DT"] = ldng_dt res = ka._url_fetch(API_URL, tr_id, "", params, postFlag=True) ...
Python
1
for mov in moves { match *mov { Move::Spin(ref x) => { let len = dancers.len(); dancers.rotate_left(len - *x as usize); } Move::Exchange(ref x, ref y) => { let first = dancers[*x as usize]; let second = dancers...
Rust
0
); // check the right things are in the table now // Inserting again replaces the existing entries for i in 0..num { map.insert(i, num-1-i); } assert_eq!(map.values().fold(0, |x, y| x+y), num*(num-1)/2); // TODO: Test Entry API, Iterators, ... } fn main() { if cfg!(target_os = "macos...
Rust
0
}, } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Getters)] #[serde(deny_unknown_fields, rename_all = "kebab-case")] #[get = "pub"] pub struct VariableValues { #[serde(rename = "_note")] _note: String, choices: HashMap<String, String>, default: Option<String>, values: HashMap<String, V...
Rust
0
counter_1.clone(); let signal_value_sum_1 = Rc::new(Cell::new(0)); let signal_value_sum_2 = signal_value_sum_1.clone(); let update_signal_value = move |precedent_signal_value| { let current_value = signal_value_sum_1.get(); signal_value_sum_1.set(current_value + precedent_signal_value); };...
Rust
0
import os import yaml import numpy as np from box import Box import geomstats.lie_group as lie_group from geomstats.special_euclidean_group import SpecialEuclideanGroup import liegroups SE3_GROUP = SpecialEuclideanGroup(3, epsilon=np.finfo(np.float32).eps) metric = SE3_GROUP.left_canonical_metric def load_config(con...
Python
1
indTracker)): if mindTracker[i]['nodeID'] == nodeID: mindTracker[i]['turns'] = 1 mindTracker[i]['secret_code'] = '' mindTracker[i]['cmd'] = 'new' else: # increment turn count and keep playing turn_count += 1 ...
Python
1
let comparator = CsvComparator { old_sizes, new_sizes, old_gas_usage, new_gas_usage, }; // when let res = comparator.get_diffs().expect("getting diffs failed"); // then let mut iter = res.iter(); assert_eq!( i...
Rust
0
ationProperties(ref v) => encoded_size_application_properties_inner(v), Section::Data(ref v) => encoded_size_data_inner(v), Section::AmqpSequence(ref v) => encoded_size_amqp_sequence_inner(v), Section::AmqpValue(ref v) => encoded_size_amqp_value_inner(v), Section::Footer(...
Rust
0
from DenseMatrix import DenseMatrix from SparseMatrix import SparseMatrixCOO as Sp import numpy as np import scipy.linalg as sp import matplotlib.pyplot as plt # Class for recommending movies to users """ Chose a threshold of 0.3, so most people generally like the movies to simulate a real world scenario """ #Based o...
Python
1
t empty we start to iterate. while !bucket.is_empty() { eccentricity += Distance::ONE; // We compute the next bucket of nodes, i.e. the next step of the frontier. bucket = bucket .into_par_iter() .flat_map_iter(|node_id| { ...
Rust
0
import sys import logging import os # 把当前文件所在文件夹的父文件夹路径加入到PYTHONPATH sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from DAGscheduling.model.Task import Task from DAGscheduling.model.Processor import Processor from DAGscheduling.model.Workflow import Workflow from DAGscheduling.util.HEFT i...
Python
1
""" Print summary of all pytest results (saved to JSON files). Without arguments -- ANSI-colored terminal, with "md" argument -- Markdown, with "msg" argument -- GitHub notice/warning message (only for skip/warn). """ import sys from glob import glob import json from re import findall # output type if len(sys.argv) > ...
Python
1
언어 설정 실패 시 기본 영어 메시지 사용 title = "OMG! Hii guys ✧(≧◡≦) ♡" description = "Thank you for inviting me to hang with yall (*≧▽≦)\n\nType /help to view my slash commands ♡" # 환영 메시지 embed 생성 embed = discord.Embed( title=title, descrip...
Python
1
ing(), balance: output.wallet.balance().to_string(), }), })), Err(_) => Err(Status::internal("error")), } } fn delete(&self, request: Request<DeleteRequest>) -> Result<Response<DeleteResponse>, Status> { let input = DeleteWalletInputDa...
Rust
0
0(i32); fn main() { let f: Foo; f = Foo(1); } "#, expect![[r#" Foo Struct FileId(0) 0..16 7..10 FileId(0) 54..57 "#]], ); } #[test] fn test_struct_literal_for_union() { check( r#" union Foo $0{ x: u32 } fn ma...
Rust
0
# ============================================================ # CLASE 46: PROYECTO INTEGRADOR # ============================================================ # 🎯 Objetivo: # Crear un pequeño sistema de gestión de tareas (ToDo list) # que integre todo lo aprendido: # # - Funciones y clases # - Manejo de archivos (guard...
Python
1
from __future__ import annotations from abqpy.decorators import abaqus_class_doc, abaqus_method_doc from ..Part.Part import Part from ..UtilityAndView.abaqusConstants import DEFAULT_MODEL, SymbolicConstant from .Leaf import Leaf @abaqus_class_doc class LeafFromPartElementLabels(Leaf): """The LeafFromPartElement...
Python
1
RowSlice::Big { non_null_ids: read_ints_le(&mut data, non_null_cnt)?, null_ids: read_ints_le(&mut data, null_cnt)?, offsets: read_ints_le(&mut data, non_null_cnt)?, values: data, } } else { RowSlice::Small { ...
Rust
0
let messages = gst::BusStream::new(&bus).for_each(|msg| { use gst::MessageView; let quit = match msg.view() { MessageView::Eos(..) => true, MessageView::Error(err) => { println!( "Error from {:?}: {} ({:?})", msg.get_src()....
Rust
0
my_list = [1,2,3, 'apple', 'lemon'] my_list.append(6) print(my_list) # instet my_list.insert(1, 20) print() #remove my_list.remove(2) print(my_list) print() #pop poped_element = my_list.pop() print()
Python
1
impl<'a, T: Scalar, P, Criterion> ConjugateGradient<'a, T, (), P, Criterion> { pub fn with_operator<A>(self, operator: A) -> ConjugateGradient<'a, T, A, P, Criterion> { ConjugateGradient { workspace: self.workspace, operator, preconditioner: self.preconditioner, ...
Rust
0
"chrome": "google-chrome", # "firefox": "firefox", # "terminal": "gnome-terminal", # "files": "nautilus", # "spotify": "spotify", # "telegram": "telegram-desktop", # "intellij": "idea" # } # command = apps.get(app_name.lower()) # return execute_command(comm...
Python
1
ts below and related plumbing will be removed once support for WASM // system contracts will be dropped. #[doc(hidden)] GasLimit = 40, /// Too many frames on the runtime stack. /// ``` /// # use casper_types::system::auction::Error; /// assert_eq!(41, Error::RuntimeStackOverflow as u8); ...
Rust
0
", stringify!(zmq_poller_event_t), "::", stringify!(fd) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<zmq_poller_event_t>())).user_data as *const _ as usize }, 16usize, concat!( "Offset of fiel...
Rust
0
TF...") train_hits_vector = 0 for idx, row in train_questions.iterrows(): true_doc_id = row['Answer ID'] if true_doc_id in train_similarity_results_vector[idx]: train_hits_vector += 1 train_recall_at_3_vector = train_hits_vector / len(train_questions) print( f'Recall...
Python
1
, &["subnets"], body, None)?; debug!("Created subnet {:?}", root.subnet); Ok(root.subnet) } /// Delete a floating IP. pub fn delete_floating_ip<S: AsRef<str>>(session: &Session, id: S) -> Result<()> { debug!("Deleting floating IP {}", id.as_ref()); let _ = session.delete(NETWORK, &["floatingips", id.as...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time : 2023/5/11 17:46 @Author : alexanderwu @File : test_run_code.py @Modifiled By: mashenquan, 2023-12-6. According to RFC 135 """ import pytest from metagpt.actions.run_code import RunCode from metagpt.schema import RunCodeContext @pytest.mark.asyncio asyn...
Python
1
mx&ss=fuchsia%2Ffuchsia" ] "/appmgr" -> "/appmgr/bar.cmx" "/sys" [ label = "sys" href = "https://cs.opensource.google/search?q=f%3Asys.cml%7Csys.cml&ss=fuchsia%2Ffuchsia" ] "/" -> "/sys" "/sys/baz" [ label = "baz" style = "filled" fontcolor = "#ffffff" href = "https://cs.opensource.google/search?q=f%...
Rust
0
), (1, 2, 2, 0), (1, 3, 2, 0), (2, -1, 2, 0), (2, 3, 2, 0), (3, 0, 2, 0), (3, 3, 2, 0), (4, 0, 2, 0), (4, 1, 2, 0), (4, 2, 2, 0), (2, 1, -2, 2), ...
Rust
0
RR<((s _abcoll.pyR=scCs@|\}}y|j|}Wntk r1tSX||kSdS(N(RiRTR((RtitemR]R>tv((s _abcoll.pyR.s   ccs*x#|jD]}||j|fVq WdS(N...
Python
1
.duration trace.latency_dict=latency_dict # 返回字典供后续使用 if __name__ == "__main__": os.makedirs(args.saveDir, exist_ok=True) traces = data_collect(f'{args.dataDir}/{args.dataSet}') dists = [ "normal", "expon", "gamma", "weibull_min", ...
Python
1
&mut f64) -> i32 { const C2: f64 = 1.0 / 5.0; const C3: f64 = 3.0 / 10.0; const C4: f64 = 3.0 / 5.0; const C5: f64 = 1.0; const C6: f64 = 7.0 / 8.0; const B5O1: f64 = 37.0 / 378.0; const B5O2: f64 = 0.0; const B5O3: f64 = 250.0 / 621.0; const B5O4...
Rust
0
tionPhase.SESSION: return SessionMessageHandler() case IntegrationPhase.ATTACH: return AttachMessageHandler() case IntegrationPhase.AMBIENT_DISCOVERY: return AmbientDiscoveryMessageHandler() case IntegrationPhase.SF_DISCOVERY: ...
Python
1
xF407_9851), (r"textures\raven01.dds", 0x071D_655D, 0x1122_9EF0), (r"textures\flameeye.dds", 0x071D_715D, 0xF024_E526), (r"meshes\i\act_werewolf_statue.nif", 0x0729_000B, 0x73A9_3910), (r"meshes\o\contain_bm_wolfbane_01.nif", 0x0729_147F, 0x2460_DED9), (r"meshes\o\contain_bm_stalhrim_01.nif", 0...
Rust
0
// 255 #[derive(Debug)] pub enum LogicalLiteral { True, False, Unknown } fn logical_literal(s: &str) -> IResult<LogicalLiteral> { alt((map(kw("false"), |_| LogicalLiteral::False), map(kw("true"), |_| LogicalLiteral::True), map(kw("unknown"), |_| LogicalLiteral::Unknown)))(s) } // 256 log...
Rust
0
value=[min + steps, min + steps * 3], marks=None, ), ] ), ] ) app = Dash(__name__) app.layout = html.Div(LAYOUT) dash_dcc.start_server(app) dash_dcc.wait_for_element(".rc-slider") dash_dcc....
Python
1
_view.selection() { if let Some(item) = &*sel { siv.pop_layer(); submit_cb_copy(siv, item); } } }) .with_name(format!("search_{}", title)) .fixed_width(SEARCH_VIEW_WIDTH); Dialog::around(LinearLayout::vertic...
Rust
0
ned: checkpoint = torch.load('../pvt_v2_b3.pth', map_location='cpu') if 'model' in checkpoint: checkpoint_model = checkpoint['model'] else: checkpoint_model = checkpoint state_dict = self.encoder.state_dict() for k in ['head.wei...
Python
1
from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch_ros.actions import Node from launch.substitutions import LaunchConfiguration def generate_launch_description(): use_sim_time = LaunchConfiguration('use_sim_time', default='false') resolution = LaunchConfiguratio...
Python
1
("pre_unmount", &self.pre_unmount) .field("unmount_with_operation", &self.unmount_with_operation) .field( "unmount_with_operation_finish", &self.unmount_with_operation_finish, ) .field("eject_with_operation", &self.eject_with_operation) ...
Rust
0
dden_dim)) # [CLS], qpos, a_seq # 新增触觉输入 def forward(self, image, depth_image, robot_state, actions=None, action_is_pad=None, tactile_input=None): """ qpos: batch, qpos_dim image: batch, num_cam, channel, height, width env_state: None 没有值 ...
Python
1
import numpy as np import matplotlib.pyplot as plt # Generate impulse response h[n] h = np.zeros(99) for i in range(99): h[i] = 0.31752 * np.sin(0.314159 * (i - 49.00001)) / (i - 49.00001) h[i] *= (0.54 - 0.46 * np.cos(0.0641114 * i)) # Plot impulse response h[n] plt.figure(figsize=(10, 5)) plt.plot(h) plt.xl...
Python
1
venue", "Stream", "Stream", "Street", "Street", "Streets", "Summit", "Summit", "Terrace", "Throughway", "Trace", "Track", "Trafficway", "Trail", "Trail", "Tunnel", "Tunnel", "Turnpike", "Turnpike", "Underpass", "Union", "Unions", "V...
Rust
0
<filename>src/day12.rs use lazy_static::lazy_static; use regex::Regex; use crate::common::read_lines; fn parse_line() -> Vec<(char, usize)> { lazy_static! { static ref RE: Regex = Regex::new(r"^(?P<dir>[NSEWLRF])(?P<val>[0-9]+)$").unwrap(); } read_lines("./inputs/day12") .iter() .m...
Rust
0
Some(filename) = framedef_filename { framedef_set(&filename, false, &framedef_status); } let fun = framedef_set.clone(); framedef.on_change(move |filename| { fun(filename, false, &framedef_status); }); if let Some(filename) = hd2_framedef_filename { framedef_set(&filename, t...
Rust
0
Error { #[inline] pub fn parse_error(input: String) -> Error { Error::ParseError(input) } pub fn get_parse_error(&self) -> Option<String> { match self { Error::ParseError(s) => Some(s.to_string()), } } pub fn is_parse_error(&self) -> bool { match sel...
Rust
0
e shored across adapters const SHARED_CROSS_ADAPTER = 0x20; /// the heap can't store render target or depth stencil textures const DENY_RT_DS_TEXTURES = 0x40; /// the heap can't contain textures without `ALLOW_RENDER_TARGET` or `ALLOW_DEPTH_STENCIL` flags c...
Rust
0
curred, terminating connection."); break; } } buffer.clear(); if !*running_clone.lock().unwrap() { break; } thread::sleep(time::Duration::from_millis(10)); } ...
Rust
0
1 ydg_egrkbzt = gvwpjzoflg_ = d6vi5ktd6j4 = jyl3i6u9uh0 = idt_gxifuub = uum3mrkd_1i = ms_i9byu1vf = False None nonlocal yre8xpjxq4w '# knobs_fellows_pipe -> indication_competitions_side' from t04tk8zqz46 import zlynq2ahuwx, cr7be1np102 as t0kcz7vcui_, ch73n_8d93y, n4pjvo86lay as x2bk2j3b_0h, scqom42...
Python
1
import sys def state(argv): states = { "Oregon" : "OR", "Alabama" : "AL", "New Jersey": "NJ", "Colorado" : "CO" } capital_cities = { "OR": "Salem", "AL": "Montgomery", "NJ": "Trenton", "CO": "Denver" } argv = argv.lower().title() for key, value in capital_cities....
Python
1
t', delimiter="\t") # Group by the relevant columns and remove the columns that do not make sense data_2 = data.groupby(["Type","Electrolyte"], as_index=False).agg(['mean', 'std']) data_2 = data_2.drop(["Chip", "Disp", "Std IDSmed [A]", "Std IGSmed [A]", "Std IDSant_pos [A]", "Std IDSdep_pos [A]", "Std del...
Python
1
"part_of_speech_detail_3": "*", "inflectional_type": "*", "inflectional_form": "*", "stem": ["*"], "yomi": ["テストイチ"], "pronunciation": ["テストイチ"], "accent_type": [1], "accent_associative_rule": "*", }, "c89596ad-caa8-...
Python
1
:convert::TryFrom; #[derive(Debug, Clone)] pub struct BasisSet { pub name: String, pub description: String, pub basis_functions: HashMap<Element, Vec<BasisFunction>>, } impl From<InputData> for BasisSet { fn from(data: InputData) -> Self { // The HashMap is initialized. let mut bfs: Ha...
Rust
0
) py_data.append(numpy.array(ys)) # py_coupling0.append(numpy.array(cs)) py_data = numpy.array(py_data) # py_coupling0 = numpy.array(py_coupling0) # build CUDA kernels cfpre = cu_expr('sin(xj - xi)', ('xi', 'xj'), {}) cfpost = cu_expr('rcp_n * gx', ('gx',...
Python
1
""" Analyze multi-provider comparison data and generate comprehensive statistics. """ import pandas as pd import numpy as np def analyze_provider_comparison(): """Analyze the multi-provider comparison data.""" # Load the data df = pd.read_csv('results/multi_provider_comparison/all_providers_compariso...
Python
1
box2_xyxy[:, :4]).to(box1.device) max_iou, max_index = iou.max(0) max_index = max_index.data.cuda() coo_response_mask[i + max_index] = 1 # IOU最大的bbox no_coo_response_mask[i + 1 - max_index] = 1 # 舍去的bbox # confidence score = predicted box 与 the ground truth...
Python
1
ack border, we can just use the normal inference if not self.config.get("avoid_boundary", False): return self.eval_infer(x) # otherwise, we need to crop the image to avoid the black border # For now, this may be a bit slow due to converting to numpy and back # We ass...
Python
1
from pyramid.view import view_config from pyramid.httpexceptions import HTTPOk from assembl.models import IdeaMessageColumn from ..traversal import InstanceContext, CollectionContext from . import ( FORM_HEADER, JSON_HEADER, instance_put_json, instance_put_form, collection_add_json, collection_add_with_params,...
Python
1
dows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"; #[derive(Debug)] pub enum RestApiFailureCode { FromHttp(u16), FromApi { code: i32, message: String }, } macro_rules! error_conv_impl { ($name:ident, $($variant:ident => $error:ty),*, $(,)?) => { #[...
Rust
0
C allows multi-byte writes. The Bus Pirate expects xxxx+1 // data bytes. Up to 16 data bytes can be sent at once. Note that 0000 // indicates 1 byte because there’s no reason to send 0. // // BP replies 0×01 to the bulk I2C command. After each data byte the // Bus Pirate returns the ACK (0x00) or NACK (0x01) bit from t...
Rust
0
e_align(this: &VttCue) -> LineAlignSetting; #[cfg(feature = "LineAlignSetting")] # [ wasm_bindgen ( structural , method , setter , js_class = "VTTCue" , js_name = lineAlign ) ] #[doc = "Setter for the `lineAlign` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozi...
Rust
0
-increment")] mod auto_increment; #[cfg(feature = "auto-increment")] pub use auto_increment::AutoIncrement; #[cfg(not(feature = "auto-increment"))] pub trait AutoIncrement {} use { crate::{ data::{Row, Schema}, result::Result, Value, }, async_trait::async_trait, serde::Serialize, std::fmt::Debug, thiserror...
Rust
0
return np.random.normal(0.0, 5.0, in_shape).astype(in_dtype) if (target == "Metal" and len(axis_int32_data) == 4): for i in range(4): for j in range(4): if i != j: assume(in_shape[axis_int32_data.index(i)] * ...
Python
1
able-fields) of the index (enable all attributes). /// /// # Example /// /// ``` /// # use meilisearch_sdk::{client::*, indexes::*, document::*, settings::Settings}; /// # futures::executor::block_on(async move { /// let client = Client::new("http://localhost:7700", "masterKey"); /// let...
Rust
0
#!/usr/bin/python #---------------------------------------------------------------------------- # Download OSM data covering the area of a slippy-map tile # # Features: # * Cached (all downloads stored in cache/z/x/y/data.osm) #---------------------------------------------------------------------------- # Copyright 2...
Python
1
h s { "major" => Ok(BumpLevel::Major), "minor" => Ok(BumpLevel::Minor), "patch" => Ok(BumpLevel::Patch), "release" => Ok(BumpLevel::Release), "rc" => Ok(BumpLevel::Rc), "beta" => Ok(BumpLevel::Beta), "alpha" => Ok(BumpLevel::Alpha), ...
Rust
0
& 0x07) << 4); self.w } } #[doc = "This test mode is intended for lab use only, replace FS differential receiver with DP single ended receiver\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum RXDBYPASS_A { #[doc = "0: Normal operation."] _0, #[doc = "1: Use the output of...
Rust
0
"""The command for archiving a smart list tag.""" from jupiter.core.domain.concept.smart_lists.smart_list_item import SmartListItem from jupiter.core.domain.concept.smart_lists.smart_list_tag import SmartListTag from jupiter.core.domain.core.archival_reason import ArchivalReason from jupiter.core.domain.features impor...
Python
1
import requests import execjs jscode = open("jCryption111.js", "r", encoding="utf-8").read() exec_js = execjs.compile(jscode) kv = exec_js.call('getkey_value') jCryptionKey=kv['jCryptionKey'] jCryptionValue=kv['jCryptionValue'] url = "https://www.bijiaqi.com/?action=user.login&_v=10.11194" payload = f"jCryptionID=3...
Python
1
t=True, num_workers=self.num_workers, persistent_workers=self.persistent_workers, ) def val_dataloader(self): return DataLoader( self.test_dataset, batch_size=self.hparams.batch_size, # type: ignore num_workers=self.num_workers, ...
Python
1
"v1_2", feature = "dox"))] pub fn connect_property_ttl_notify<F: Fn(&DeviceVxlan) + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_ttl_trampoline<F: Fn(&DeviceVxlan) + 'static>( this: *mut nm_sys::NMDeviceVxlan, _param_spec: glib_sys::g...
Rust
0
篇', '翩'], '密': ['蜜', '觅'], '间': ['简', '煎'], '谍': ['牒', '迭'], '疫': ['抑', '役'], '虚': ['须', '需'], '传': ['转', '砖'], '响': ['晌', '象'], } # 生成模糊匹配模式 fuzzy_patterns = ...
Python
1
from rest_framework import serializers from asset.models import AssetModel class AssetsOnlyNameAndCodeSerializer(serializers.ModelSerializer): # logo = serializers.SerializerMethodField() # # def get_logo(self, i): # return i.logo if 'placeholder' in i.logo else 'None' class Meta: mod...
Python
1
from ._exposition import MetricsResource __all__ = ['MetricsResource']
Python
1
def test_peer_relation_default_values(): expected_id = _next_relation_id(update=False) endpoint = 'peers' interface = 'shared' relation = PeerRelation(endpoint, interface) assert relation.id == expected_id assert relation.endpoint == endpoint assert relation.interface == interface assert...
Python
1
se { None } } fn get_write(s: &str) -> Option<Math> { if s.starts_with("TWrite") { let v = s.split_whitespace().nth(1).unwrap(); Some(Math::TWrite(v.to_owned())) } else { None } } fn get_udf(s: &str) -> Option<Math> { Some(Math::Str(s.to_owned())) } pub fn parse_ho...
Rust
0
, cost, updates=p_updates) _train_p_cost = theano.function([x], [cost, gx]) _predict_z = theano.function([x], z) _gen = theano.function([z], gx) print('%.2f seconds to compile theano functions' % (time() - t)) def rec_test(test_data, n_epochs=0, batch_size=128, output_dir=None): print('computing reconstruction l...
Python
1
om(consumption_function(val, &right_location)); sum }); while left_consumption != right_consumption { let mid_location = left_location + ((right_location - left_location) / 2); if left_consumption <= right_consumption { right_location = mid_location; right_consu...
Rust
0