text
string
label_name
string
labels
int64
_collaterals, 999); }); } #[test] fn should_not_lock_more_than_account_balance() { new_test_ext().execute_with(|| { Pdot::init(Origin::signed(2)); Pdot::mint(Origin::signed(2), 4, 9999); assert_eq!(Pdot::balance_of(4), 9999); Cdp::open(Origin::signed(4)); Cdp::lock(Origin::signed(4), 0, 999);...
Rust
0
import statsmodels.regression.linear_model as lm_ import statsmodels.discrete.discrete_model as dm_ import statsmodels.discrete.conditional_models as dcm_ import statsmodels.regression.mixed_linear_model as mlm_ import statsmodels.genmod.generalized_linear_model as glm_ import statsmodels.robust.robust_linear_model as ...
Python
1
"""add count column to order product association table Revision ID: 08646b64afa8 Revises: 94baa87b9131 Create Date: 2025-08-13 12:30:00.906969 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = "08646b64afa8" down_revision...
Python
1
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = "d. F Y" TIME_FORMAT = "H:i" DATETIME_FORMAT = "j. F Y. H:i" YEAR_MONTH_FORMAT = "F Y" MONTH_DAY_FOR...
Python
1
回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self._RequestId = None @property def RequestId(self): return self._RequestId @RequestId.setter def RequestId(self, RequestId): self._RequestId = RequestId def _deseri...
Python
1
tware/libc/manual/html_node/TZ-Variable.html). //! //! # Usage //! //! ## Time zone //! //! ```rust //! # fn main() -> Result<(), tz::TzError> { //! use tz::TimeZone; //! //! // 2000-01-01T00:00:00Z //! let unix_time = 946684800; //! //! // Get UTC time zone //! let time_zone_utc = TimeZone::utc(); ...
Rust
0
virtio_gpu_set_scanout_blob), ResourceFlush(virtio_gpu_resource_flush), TransferToHost2d(virtio_gpu_transfer_to_host_2d), ResourceAttachBacking(virtio_gpu_resource_attach_backing), ResourceDetachBacking(virtio_gpu_resource_detach_backing), GetCapsetInfo(virtio_gpu_get_capset_info), GetCapset(vir...
Rust
0
# Method Overriding: If the same method is defined in both base and derived classes, then the method of the derived class overrides the method of the base class. # Video Game class Character: def __init__(self, x, y, num_lives): self.x = x self.y = y self.num_lives = num_lives def...
Python
1
"text_1": ("STRING", {"default": ""}), "compare_1": ("STRING", {"default": ""}), "text_2": ("STRING", {"default": ""}), "compare_2": ("STRING", {"default": ""}), "text_3": ("STRING", {"default": ""}), "compare_3": ("STRING", {"default...
Python
1
(linear: nn.Linear): hook_fn = WandaHookFn(linear) return hook_fn hooks = {} handles: List[torch.utils.hooks.RemovableHandle] = [] for name, linear in linear_layers.items(): hook_fn = get_hook_fn(linear) hooks[name] = h...
Python
1
_ 9y'7lI|Xyyt}usCZK rk5Jyܗ>u3y(T4;@k<m<ZϳξMHO&˼mlNzFŵXF&+‰2a專?#64șgܟ\QigW툀1ʧ51>35:~ICzoO;aZs'[Ec2Z@^V`ς'_W_~Wm˜-41s_yjssD}Pk \)g\܅a-m q;|/o>ꠌnL-.[? "k3ZzJh;Ts} Q_s d0NޙS'lq{Jp`O D}~ei^wP/(h{fh,7Ak6 HLQ0`0Leϼz= d[Ѳ.paߴkցK'ж4(Jgh9Nzw6ZǏ3&J>Wg>conƢp>Y1g.Cr-ߔڢڛyi3.5M/VL...
Python
1
_mul(u12![0]), U12::min_value()); assert_eq!(u12![2].wrapping_mul(u12![255]), u12![510]); assert_eq!(u12![255].wrapping_mul(u12![2]), u12![510]); assert_eq!(u12![2].wrapping_mul(u12![2048]), U12::min_value()); assert_eq!(u12![2].wrapping_mul(u12![4095]), u12![0xFFE]); } #[test] fn test_overflowing_mul() { as...
Rust
0
.expect("unable to parse"); match topo { TopoJson::Topology(t) => { let geojson = to_geojson(&t, &String::from(case.1)) .expect("Unable to convert TopoJSON to GeoJSON"); let geojson_string = GeoJson::FeatureCollection(geojson).to_string(); ...
Rust
0
let m1 = Matrix4::rotation_from_euler(&e1); let m2 = Matrix4::rotation_from_euler(&e2); let m3 = Matrix4::rotation_from_euler(&e3); let m = m1.multiply(&m2).multiply(&m3); let q_from_m = Quaternion::from_rotation_matrix(&m); let quaternions: Vec<Quaternion> = ...
Rust
0
lect(); for route in &routes { handle.route().del(route.clone()).execute().await.unwrap(); } routes.reverse(); for route in routes { IPRoute { action: Action::Add, msg: route.clone(), } .execute(&mut handl...
Rust
0
import json import os with open("data/pushup/train.json", "r") as fp: train1 = json.load(fp) for l in train1: l["is_pushing_up"] = True with open("data/lsp_lspet_7points/train.json", "r") as fp: train2 = json.load(fp) for l in train2: l["is_pushing_up"] = False with open("data/pushup/v...
Python
1
rJBarrier._release&$ $,,  13c^# TRRU4Sj5IShvN TR[R[R 4;a[ R"S5egNI7f)Nc...
Python
1
tar aproximação de Euler plt.plot(tempos, valores_euler, 'r--', linewidth=2, label='Aproximação de Euler') # Marcar pontos importantes plt.plot(0, N0, 'go', markersize=8, label=f'Condição inicial: N(0) = {N0}') plt.plot(t_meia_vida, N0/2, 'mo', markersize=8, label=f'Meia-vida: t = {t_meia_vida:.3f}...
Python
1
max { max = input; } if state == State::Halted { break; } } Ok(max) } fn process_data_a(data: &str) -> i128 { let ints: Vec<i128> = data .split(',') .map(|i| i.parse::<i128>().unwrap()) .collect(); let phases = 0..5; let mut...
Rust
0
find the number of brackets node.nbBrackets.value = 0 return d = json.loads(jsonMetadata) # Find Fnumber fnumber = findMetadata(d, ["FNumber"], "") if fnumber == "": aperture = findMetadata(d, ["Exif:ApertureValue", "Apertu...
Python
1
== cellAttName: cname = vtkStringToken('field_conn') vname = vtkStringToken('field_vals') ar.BindArrayToTexture(cname, conn, True) # Reshape to a 1-D array with 1 component per tuple. ar.BindArrayToTexture(vname, vals, True) # Always reshape since #comps can be > 4. ar.PrepareCo...
Python
1
get_positions(); // Transform triangle vertices to ray coordinate space // Translate vertices based on ray origin let mut p0t = p0 - Vector3f::from(r.o); let mut p1t = p1 - Vector3f::from(r.o); let mut p2t = p2 - Vector3f::from(r.o); // permute components of triangle ve...
Rust
0
rt_ { #[doc = "< Tangent of the angle between the viewing vector and top edge of the FOV."] pub UpTan: f32, #[doc = "< Tangent of the angle between the viewing vector and bottom edge of the FOV."] pub DownTan: f32, #[doc = "< Tangent of the angle between the viewing vector and left edge of the FOV."...
Rust
0
rom.read_to_end(&mut buffer).expect("Failed to read rom file"); println!("Read rom into memory!"); Ok(()) } fn main() -> () { let args: Vec<String> = env::args().collect(); if args.len() < 2 { println!("Need a rom file to read!"); return () } let rom_name = &args[1]; p...
Rust
0
t_target(target_temp + 273) def set_hvac_mode(self, hvac_mode: str): """Set new hvac mode.""" _LOGGER.debug("Set %s heat mode %s", self.name, hvac_mode) if hvac_mode == HVACMode.OFF: self._device.turn_off() elif not self._device.is_on: self._device.turn_on() ...
Python
1
/shape와 일치하는 항목만 filtering filtered_dict = {} for k, v in dino_state_dict.items(): if k in model_dict and model_dict[k].shape == v.shape: filtered_dict[k] = v # (C) 모델 dict에 DINO 파라미터를 덮어씌움 model_dict.update(filtered_dict) # (D) strict=True로 최종 로딩 (filtered_dict 외 키는 그대로) m...
Python
1
(|d| Dependency(d)); let dependency_descriptors = if self.force { dependency_descriptors.collect() } else { dependency_descriptors .filter_map(|d| match d.already_saved() { Ok(true) => None, Ok(false) => Some(Ok(d)), ...
Rust
0
india=["mumbai", "banglore", "delhi"] pakistan=["lahore", "karachi", "Islamabad"] bangladesh=["dhaka", "khulna", "rangpur"] #Question: i Write a program that asks user to enter a city name and it should tell which country the city belongs to #cName=input("Ente...
Python
1
","kk":"Тонга (Ньяса)","mt":"Tonga (Nyasa)","lv":"Tonga (Nyasa)","tr":"Tonga (Nyasa)","zu":"Tonga (Nyasa)","az":"Tonqa (Nyasa)"},"x":{"t":"living","scope":"individual"}},"toh":{"3":"toh","e":"Gitonga","x":{"t":"living","scope":"individual"}},"toi":{"3":"toi","e":"Tonga (Zambia)","x":{"t":"living","scope":"individual"}}...
Python
1
controller=controller, homophily_ratio=0.7, world_size=world_size ) end = time() print(f"\033[91mCurrent mode is {mode}, Current pop size: {pop_size}\033[0m") print(f"\033[91mTotal cost: {end - start}\033[0m") torch.cuda.empty_cache() if __name__ == "__main__": from gapa.u...
Python
1
import time from option import opt import scipy.io as scio from torch_ema import ExponentialMovingAverage from utils import * from architecture import * from architecture.DeSCI import * from architecture.GAP_TV import * from architecture.TwIST import * """ 1.配置测试环境 """ os.environ["CUDA_DEVICE_ORDER"] = 'PCI_BUS_I...
Python
1
g_wang_by_position(self, jiazi_number: int) -> List[str]: """ 根据六十甲子序号计算空亡. """ # 六旬的空亡地支 kong_wang_table = [ ["戌", "亥"], # 甲子旬 ["申", "酉"], # 甲戌旬 ["午", "未"], # 甲申旬 ["辰", "巳"], # 甲午旬 ["寅", "卯"], # 甲辰旬 ["子...
Python
1
aset_with_empty_parameter", **params) assert (res['code'] == RetCode.DATA_ERROR and res['message'] == 'Please input at least one parameter that you want to update!') # ---------------------------------mix the different methods-------------------------- def test_create_and_delete_dataset_to...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC. All Rights Reserved. # # 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 requir...
Python
1
import heapq class MedianFinder: def __init__(self): self.maxHeap = [] self.minHeap = [] def addNum(self, num: int) -> None: if self.minHeap and num < self.minHeap[0]: heapq.heappush(self.maxHeap,-num) else: heapq.heappush(self.minHeap,num) ...
Python
1
ndgen_test_layout_in6_addr__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<in6_addr__bindgen_ty_1>(), 16usize, concat!("Size of: ", stringify!(in6_addr__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::<in6_addr__bindgen_ty_1>(), 4usize, concat!("Alignm...
Rust
0
Err(()), false => match unsafe { books.get_unchecked(2).trim().parse::<u16>() } { Ok(x) => match book_system.find_book( unsafe { books.get_unchecked(0) }, unsafe { books.get_unchecked(1) }, x, ) { Some(i) => Ok(i), ...
Rust
0
[doc = "Bit 11 - This bit is 1 if power is supplied to SRAM domain PD_SRAM0_3"] #[inline(always)] pub fn pd_grp0_sram3(&mut self) -> PD_GRP0_SRAM3_W { PD_GRP0_SRAM3_W { w: self } } #[doc = "Bit 10 - This bit is 1 if power is supplied to SRAM domain PD_SRAM0_2"] #[inline(always)] pub fn p...
Rust
0
# Longest Consecutive Sequence # https://practice.geeksforgeeks.org/problems/longest-consecutive-subsequence2449/1# # https://leetcode.com/problems/longest-consecutive-sequence/ # Time Complexity: O(n), Space Complexity: O(n) - Striver Approach but slower nums = [100,4,200,1,3,2] def longestConsecutive1(nums): u...
Python
1
the given [`SurfaceInteraction`] to this [`Light`]. fn sample_li(&self, si: &SurfaceInteraction) -> LightSample; } // // genetic - genetic programming experiments // Copyright (c) 2019 <NAME> <<EMAIL>> // // This project is licensed under the terms of the MIT license // (see the LICENSE file for details). // // //...
Rust
0
(&self) -> &Circuit { &self.circ } pub fn modulus(&self, x:Ref) -> u8 { self.circ.moduli[x] } fn get_next_input_id(&mut self) -> Id { let id = self.next_input_id; self.next_input_id += 1; id } fn get_next_ciphertext_id(&mut self) -> Id { let id ...
Rust
0
std::net::TcpListener; use std::net::TcpStream; use std::sync::Arc; use std::sync::mpsc; use std::sync::mpsc::Receiver; use std::sync::mpsc::Sender; use std::sync::Mutex; use std::thread; use std::time::Instant; use crate::app::Color; use crate::network::Network; use crate::raft::membership::Address; use crate::raft::...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import account_invoice_report from . import account_hash_integrity_templates
Python
1
# q_v0 = 14 # g kg^-1 if z <= z_tr: theta = theta_0 + (theta_tr - theta_0) * (z / z_tr) ** (5./4) else: theta = theta_tr * math.exp((gravity / (WK_C_p * T_tr)) * (z - z_tr)) return theta # --- # Functions taken from or based on functions from atm_utilities.f90 # --- # Constancts from ica...
Python
1
c COMPLETIONS_HELP: &str = r#" DISCUSSION: Enable tab completion for Bash, Fish, Zsh, or PowerShell The script is output on `stdout`, allowing one to re-direct the output to the file of their choosing. Where you place the file will depend on which shell, and which operating system you are using. You...
Rust
0
y_ssize_t, arg4: *mut PyObject) -> int; pub type objobjargproc = unsafe extern "C" fn (arg1: *mut PyObject, arg2: *mut PyObject, arg3: *mut PyObject) -> int; cfg_if! { if #[cfg(not(Py_LIMITED_API))] { #[derive(Copy)] #[repr(C)] pub struct Py_buffer { pub buf: *mut void, ...
Rust
0
i32 { debug!("emscripten::invoke_iii"); if let Some(dyn_call_iii) = &get_emscripten_data(ctx).dyn_call_iii { dyn_call_iii.call(index, a1, a2).unwrap() } else { panic!("dyn_call_iii is set to None"); } } pub fn invoke_iiii(ctx: &mut Ctx, index: i32, a1: i32, a2: i32, a3: i32) -> i32 { ...
Rust
0
ng else 0.0, is_causal=True, ) else: attn_mtx = torch.matmul(q, k.transpose(2, 3)) / math.sqrt(self.head_dim) attn_mtx = attn_mtx + mask[:, :, :seq_len, :seq_len] attn_mtx = F.softmax(attn_mtx.float(), dim=-1).type_as(k) attn_mtx = self...
Python
1
h self.items_var.get(key) { Some(v) => Some(v.clone()), None => { if let Some(ref p) = self.parent { Some(p.borrow().get(key)) } else { None } } }, ...
Rust
0
# This Python file uses the following encoding: utf-8 # @author runhey # github https://github.com/runhey from enum import Enum from module.atom.image import RuleImage from tasks.KekkaiUtilize.assets import KekkaiUtilizeAssets as KUA class CardClass(str, Enum): UNKNOWN = 'unknown' # 未知 TAIKO6 = 'taiko_6' ...
Python
1
import numpy as np import pickle from os.path import join as pjoin POS_enumerator = { 'VERB': 0, 'NOUN': 1, 'DET': 2, 'ADP': 3, 'NUM': 4, 'AUX': 5, 'PRON': 6, 'ADJ': 7, 'ADV': 8, 'Loc_VIP': 9, 'Body_VIP': 10, 'Obj_VIP': 11, 'Act_VIP': 12, 'Desc_VIP': 13, 'OTH...
Python
1
from langchain_core.embeddings import Embeddings __all__ = ["Embeddings"]
Python
1
(auth::CL_UUID, val.id.clone()); self.vars.set(auth::AUTH_TOKEN, val.access_token.clone()); elements.profile = val; return Some(Box::new(super::ServerList::new(None))); }, Err(err) => { ...
Rust
0
gen::prelude::*; #[wasm_bindgen] pub fn multiply(first: u8, second: u8) -> i32 { i32::from(first) * i32::from(second) } <gh_stars>1-10 //! Router Component. use std::rc::Rc; use crate::prelude::*; use yew::prelude::*; /// Props for [`Router`]. #[derive(Properties, PartialEq, Clone)] pub struct RouterProps { ...
Rust
0
#!/usr/bin/env python3 import re def strip(s): return re.sub(r'\s+\n', '\n', re.sub(r'\n\s+', '\n', s)) common_css = open('src/ui/common.css').read() common_tis = open('src/ui/common.tis', encoding='UTF8').read() index = open('src/ui/index.html').read() \ .replace('@import url(index.css);', open('src/ui/index....
Python
1
from __future__ import absolute_import, division, print_function from cctbx.eltbx import neutron from libtbx.test_utils import approx_equal, Exception_expected def exercise_00(): t = neutron.neutron_news_1992_table("eu") assert t.label() == "Eu" l = t.bound_coh_scatt_length() assert approx_equal(l.real, 7.22) ...
Python
1
""" Copyright (c) Facebook, Inc. and its affiliates. """ import unittest import os from droidlet.shared_data_structs import MockOpt from droidlet.dialog.dialogue_manager import DialogueManager GROUND_TRUTH_DATA_DIR = os.path.join( os.path.dirname(__file__), "../../../droidlet/artifacts/datasets/ground_truth/" ) ...
Python
1
# # For licensing see accompanying LICENSE.md file. # Copyright (C) 2025 Argmax, Inc. All Rights Reserved. # from coremltools.converters.mil.frontend.torch.ops import _get_inputs from coremltools.converters.mil.frontend.torch.torch_op_registry import ( _TORCH_OPS_REGISTRY, register_torch_op ) from coremltools.conv...
Python
1
ck = [3, 8, 36, 3] return ResNetV1(BottleneckV1b, num_block, cfg=cfg, norm_layer=norm_layer) @BACKBONE_REGISTRY.register() def resnet50c(cfg=None, norm_layer=nn.BatchNorm2d): num_block = [3, 4, 6, 3] return ResNetV1(BottleneckV1b, num_block, cfg=cfg, norm_layer=norm_layer, deep_stem=True) @BACKBONE_REGI...
Python
1
.to_biguint().unwrap(), u128::MAX); check(BigUint::new(vec![]), 0); check(BigUint::new(vec![1]), 1); check(BigUint::new(vec![N1]), (1 << 32) - 1); check(BigUint::new(vec![0, 1]), 1 << 32); check(BigUint::new(vec![N1, N1, N1, N1]), u128::MAX); assert_eq!(BigUint::new(vec![0, 0, 0, 0, 1]).to_u12...
Rust
0
num_samples, replacement) @BatchSampler.register("basic") class BasicBatchSampler(data.BatchSampler, BatchSampler): """ A registrable version of pytorch's [BatchSampler](https://pytorch.org/docs/stable/data.html#torch.utils.data.BatchSampler). Wraps another sampler to yield a mini-batch of indices. ...
Python
1
", delay=0.02) if target_enemy and not target_enemy.is_defeated(): enemy_action_msg = target_enemy.enemy_turn(gm.player) slow_print(enemy_action_msg, delay=0.02, color=Fore.LIGHTRED_EX) if gm.player.is_defeate...
Python
1
e::experimental::scene::{Handle, Lens, Node}; use std::future::Future; use std::pin::Pin; use std::{ ops::{Add, Mul, Sub}, task::{Context, Poll}, }; pub struct LinearTweenFuture<T> where T: Copy + Add<Output = T> + Sub<Output = T> + Mul<f32, Output = T>, { fr...
Rust
0
ion, "max_duration": max_duration, "total_iteration_count": iter_count, "failed_iteration_count": failed_iter_count, "pass_sla": success, "statistics": {}, "start_time": start, }] ...
Python
1
k) ])) def pcap_dump(self, packet, ts_sec=None, ts_usec=None, orig_len=None): ''' Appends a new packet to the libpcap file. Optionally specify ts_sec and tv_usec for timestamp information, otherwise the current time is used. Specify orig_len if your snaplen is smaller ...
Python
1
( ( GeneratedSubgraphs::new(vec![subgraph]), Arc::new( ( || { bail!("{}", e); Ok(()) ...
Rust
0
nfidence:.4f}{marker}\n" self.confidence_text.setPlainText(conf_text) def on_class_changed(self): """处理类别改变事件""" if self.current_region_index >= 0: # 只有在用户手动更改时才允许修改(防止自动设置被覆盖) if hasattr(self, '_updating_class_selection'): return ...
Python
1
TcpConnectionPool<A>> + Sized, { let mut nodes: Vec<TcpConnectionPool<A>> = Vec::with_capacity(node_configs.0.len()); for node_config in &node_configs.0 { let node_connection_pool = new_tcp_pool(node_config.clone())?; nodes.push(node_connection_pool); } load_balancing.init(nodes); Ok(Session { ...
Rust
0
cita_vm::Transaction { from: vm.account1, to: Some(addr), value: U256::from(10), nonce: U256::from(2), gas_limit: 1_000_000, gas_price: U256::from(1), input: vec![], itype: cita_vm::InterpreterType::RISCV, }; let r = vm.executor.exec(cita_vm::Cont...
Rust
0
import subprocess from .logger import get_logger logger = get_logger(__name__) class Shell: @staticmethod def run( cmd, on_stdout=lambda e: print("" + e), on_stderr=lambda e: print("" + e), ): logger.info(f"run shell command: {cmd}") with subprocess.Popen( ...
Python
1
tring containing a character class that can occur at the beginning or end of a URL. macro_rules! valid_domain_start_end_chars { () => { concat!("[^", punctuation_chars!(), ctrl_chars!(), invalid_characters!(), unicode_spaces!(), "]") }; } ///Regex substring containing a character class that can occur in the middle ...
Rust
0
tb_writer.add_scalar('avg_rewards', avg_rewards, epoch) tb_writer.add_scalar('entropy', entropy, epoch) tb_writer.add_scalar('s_log_alpha', log_alpha[0].item(), epoch) tb_writer.add_scalar('r_log_alpha', log_alpha[1].item(), epoch) # tb_writer.add_scalar('p_log_alpha', log_alpha[2...
Python
1
utes', 0)}") console.print(f" • TRIZ principles applied: {evolution.get('triz_principles_applied', 0)}") console.print(f" • Contradictions resolved: {evolution.get('resolutions_proposed', 0)}") except ImportError as e: console.print(f"❌ [red]Demo dependencies missing: {e...
Python
1
get_active_rich_vault_from_id(&vault_id)?; Ok(vault.to_be_issued_tokens()) } /// Get the current collateralization of a vault pub fn get_collateralization_from_vault( vault_id: T::AccountId, only_issued: bool, ) -> Result<UnsignedFixedPoint<T>, DispatchError> { let vault...
Rust
0
import sys from functools import cache with open(sys.argv[1], 'r') as f: stones = list(map(int, f.read().strip().split(" "))) # for i in range(75): # new_stones = [] # for stone in stones: # if stone == 0: # new_stones.append(1) # print elif len(str(stone)) % 2 == 0: # ...
Python
1
import re import subprocess def parse_result(nmapfile): result = {} with open(nmapfile, 'r') as file: lines = '\n'.join(file.readlines()) hosts = lines.split('</host>') for host in hosts[:-1]: ip = re.search('<address addr="([^"]+)"', host).group(1) result[ip] = {} result[ip]['ports'] = {} result[i...
Python
1
.to_owned(),needs_redraw:true, }; if tmp.prog_head == 0 && tmp.prog_num != 0 { tmp.msg = "Program headers offset = 0, but there are program headers".to_owned(); return tmp; } if tmp.sect_head == 0 && tmp.sect_num != 0 { tmp.msg = "Section headers offset = 0, but there are program headers".to_owned()...
Rust
0
### # #%L # Scenery-backed 3D visualization package for ImageJ. # %% # Copyright (C) 2016 - 2024 sciview developers. # %% # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain ...
Python
1
ister accessor: an alias for `Reg<HSTPIPINRQ_SPEC>`"] pub type HSTPIPINRQ = crate::Reg<hstpipinrq::HSTPIPINRQ_SPEC>; #[doc = "Host Pipe IN Request Register"] pub mod hstpipinrq; #[doc = "HSTPIPERR register accessor: an alias for `Reg<HSTPIPERR_SPEC>`"] pub type HSTPIPERR = crate::Reg<hstpiperr::HSTPIPERR_SPEC>; #[doc =...
Rust
0
session.post(f'{url}/json', data=data, files=files) try: res = req.json() logger.trace(res) except json.decoder.JSONDecodeError: res = {} if not req.ok: logger.trace(req.content) logger.warning( f"上传图片失败: HTTP {req.status_code}, reason: {req.reason} " ...
Python
1
"""Multidict implementation. HTTP Headers and URL query string require specific data structure: multidict. It behaves mostly like a dict but it can have several values for the same key. """ from typing import TYPE_CHECKING from ._abc import MultiMapping, MutableMultiMapping from ._compat import USE_EXTENSIONS __all...
Python
1
# tifffile/__main__.py """Tifffile package command line script.""" import sys from .tifffile import main sys.exit(main())
Python
1
"""Extra array functions built on top of the array API standard.""" from ._delegation import isclose, pad from ._lib._at import at from ._lib._funcs import ( apply_where, atleast_nd, broadcast_shapes, cov, create_diagonal, expand_dims, kron, nunique, setdiff1d, sinc, ) from ._li...
Python
1
""" return self._Charset @Charset.setter def Charset(self, Charset): self._Charset = Charset @property def CreatedAt(self): r"""创建时间 :rtype: str """ return self._CreatedAt @CreatedAt.setter def CreatedAt(self, CreatedAt): self._Cre...
Python
1
lf.iter_idx = 0 return self def __next__(self): if self.iter_idx < self.__len__(): next_segmentation = self.__getitem__(self.iter_idx) self.iter_idx += 1 return next_segmentation raise StopIteration() next = __next__ # Python 2 compatibility de...
Python
1
15: 0.2997460533286469, 3: 0.26597983827252, 48: 0.2479611722429104, 60: 0.2381913660976317, 63: 0.20104329046098846, 73: 0.18810984088035806, 12: 0.17373078876272166, ...
Python
1
self.max.max(rhs.max); } #[inline] pub fn transform(&self, m: &Affine3) -> Self { let min = Vec3A::from(m.w_axis); let max = min; let mut min_out = min; let mut max_out = max; let x_axis = Vec3A::from(m.x_axis); let x_mask = x_axis.cmpgt(Vec3A::ZERO); ...
Rust
0
# Copyright 2020 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
&str = r#"#version 100 varying lowp vec2 uv; uniform sampler2D Texture; uniform lowp vec4 test_color; void main() { gl_FragColor = test_color * texture2D(Texture, uv); }"#; #[macroquad::main("Shaders")] async fn main() { let mat = load_material( VERTEX, FRAGMENT, MaterialParams { ...
Rust
0
main() { human_panic::setup_panic!(); let cli_opts = CliOpts::from_args(); let log_level = slog::Level::from_usize(3 + cli_opts.verbose).unwrap_or(slog::Level::Warning); let logger = init_log(log_level); debug!(logger, "parsed args"; "cmd" => ?&cli_opts); let r = match &cli_opts.cmd { ...
Rust
0
{ Some(&number) => number, _ => panic!("No step for crossing: {}", coords), }) .sum(); if manhattan_distance < min_manhattan_distance { min_manhattan_distance = manhattan_distance; } if steps_su...
Rust
0
extent, Extent { minx: -1017529.7205322683, miny: 7005300.768279828, maxx: -978393.9620502591, maxy: 7044436.526761841, } ); let extent = grid.tile_extent(486, 691, 10); assert_eq!( extent, Extent { minx: -1...
Rust
0
import tempfile from pathlib import Path # from forbiditerative import planners as fi from kstar_planner import planners as kp # Used in (action) reachability def is_unsolvable_new_goal(domain, problem, new_goal): goal = extract_goal(problem) new_problem = problem.replace(goal, f"(:goal {new_goal} )") r...
Python
1
let log_dir = tmp_dir.join("log"); use crate::bootstrap::open_engine; let db = open_engine(db_dir).unwrap(); let db = Arc::new(db); let state_engine = StateEngine::new(db.clone()).unwrap(); let address_resolver = Arc::new(crate::node::resolver::AddressResolver::new(vec![])); ...
Rust
0
use rand::{thread_rng, Rng}; use cgmath::{Vector3, Rad}; use core::game_state::{State}; use core::unit::{Unit, UnitId}; use core::sector::{SectorId}; use core::position::{MapPos, ExactPos}; use core::event::{FireMode, AttackInfo, ReactionFireMode}; use core::player::{PlayerId}; use core::object::{ObjectId}; use types:...
Rust
0
"""Provide utility functions for dynamical systems analysis. This submodule provides specialized utility functions for analyzing dynamical systems, with particular focus on the Circular Restricted Three-Body Problem (CR3BP) and general stability analysis. Examples -------- Energy analysis: >>> from hiten.algorithms....
Python
1
T = 44; pub const VT_JUST_U64: flatbuffers::VOffsetT = 46; pub const VT_MAYBE_U64: flatbuffers::VOffsetT = 48; pub const VT_DEFAULT_U64: flatbuffers::VOffsetT = 50; pub const VT_JUST_F32: flatbuffers::VOffsetT = 52; pub const VT_MAYBE_F32: flatbuffers::VOffsetT = 54; pub const VT_DEFAULT_F32: fl...
Rust
0
# Preprocessing Example # Karen Mazidi # September 2018 from nltk import word_tokenize from nltk.stem.porter import PorterStemmer from nltk.stem import WordNetLemmatizer from nltk.corpus import stopwords import re def preprocess(raw_text): """ Preprocess raw tex. Arguments: a raw text string ...
Python
1
ParseLabelValue { #[snafu(source)] err: ErrorKind, }, #[snafu(display("expected value in range [0, {}], found: {}", u32::MAX, value))] ValueOutOfRange { value: f64 }, #[snafu(display("multiple metric kinds given for metric name `{}`", name))] MultipleMetricKinds { name: String ...
Rust
0
1.atan2(self.0) * 180.0 / PI } pub fn angle_with_0_down(&self) -> f64 { (self.angle() + 180.0) % 360.0 } pub fn spiral(&self) -> Self { Vector( self.0.cos() * self.magnitude(), self.1.sin() * self.magnitude(), ) } } impl Default for Point { fn default() -> Self { Point { x: 0,...
Rust
0