text string | label_name string | labels int64 |
|---|---|---|
from typing import List
from pyems.structure import Structure
from pyems.coordinate import Coordinate2, reorder_counterclockwise2
def module_header(name: str) -> str:
"""
"""
return "(module " + name + " (layer F.Cu) (clearance 0) (attr virtual)\n"
def polygon(poly: List[Coordinate2]) -> str:
"""
... | Python | 1 |
"""Simple pose graph example with two pose variables and three costs:
┌────────┐ ┌────────┐
│ Pose 0 ├───Between───┤ Pose 1 │
└───┬────┘ └────┬───┘
│ │
│ │
Prior Prior
"""
import jax
import jaxlie
import jaxls
# Create v... | Python | 1 |
xccr]\x07\xf7}}\
+\xaa\x96#\x9f\xa1\x5c\xd0\xa8\x96\xb6g\xae]x^\
\xf2\xc3\xcb\x96\xd6\xfe\xe2(\xa2]\xbbQwqZQ\
x\xf6\xd6\xd6\xd5\xbe\xd4\xcbo*\xff\x00{\xe5\xac\xdf\
\x87>2]z\xd7\xed\x16\xb7V\xb7\x96\xb2\xb7\xee\xda\
&\xdd\xb7\xd4\x1fB+\x86\xf8\xd3\xf0\xfb\xc4\xda\xce\xa8\
\xd7\x9am\xe5\xaa\xc7\xff\x00<\xde2\xad\xd7\xaeG... | Python | 1 |
ic garbage collection run.
More detailed information can be found in the official Python
documentation for :ref:`the try statement <python:try>`.
"""
__tracebackhide__ = True
if not expected_exception:
raise ValueError(
f"Expected an exception type or a tuple of exceptio... | Python | 1 |
name).expect("Unable to load map data");
file.read_to_end(&mut data).expect("Unable to read map data");
let tiles = bincode::deserialize(&data).expect("Unable to parse map data");
Map { tiles }
}
#[allow(dead_code)]
pub const fn init_empty() -> Map {
Map {
tiles:... | Rust | 0 |
import type_enforced
from typing import List, Set, Dict, Tuple
@type_enforced.Enforcer
def my_fn(
a: List[int], b: Set[str], c: Dict[str, int], d: Tuple[str, int]
) -> None:
return None
success_1 = True
try:
my_fn(
a=[1, 2, 3], b={"a", "b", "c"}, c={"a": 1, "b": 2, "c": 3}, d=("a", 1)
)
exce... | Python | 1 |
od tests {
use std::net::IpAddr;
use super::IpWhitelist;
#[test]
fn test_empty() {
let wl = IpWhitelist::empty();
assert_eq!(wl.contains("127.0.0.1".parse::<IpAddr>().unwrap()), false);
}
#[test]
fn test_basic() {
let wl = IpWhitelist::new(vec!["127.0.0.0/8", "fd00... | Rust | 0 |
'''
Implemente uma função que dada uma lista de conjuntos de inteiros determine qual
o menor número desses conjuntos cuja união é idêntica à união de todos os
conjuntos recebidos.
input: sets = [{1,2,3},{2,4},{3,4},{4,5}]
output: 2
input: sets = [{1},{2},{3,4},{5,6,7,8},{1,3,5,7},{2,4,6,8},{9}]
ou... | Python | 1 |
import sys
from collections import deque
inp = sys.stdin.readline
n = int(inp().strip())
arr = [list(map(int, inp().strip().split())) for _ in range(n)]
res = 10000
cur = 1
directions = [[1, 0], [-1, 0], [0, 1], [0, -1]]
visit = [[0]*n for _ in range(n)]
for i in range(n):
for j in range(n):
if arr[i][j] !... | Python | 1 |
umbheuqbin2, ag6sarnt_rd as dndp95r1t_3, e1r1mns7gok, r7xqc1xuy2v
'# speech_blackboard_purges -> detail_plastic_gangways'
'# speech_blackboard_purges -> detail_plastic_gangways'
z4k4mn45vq3 //= 0j
u61ajj31d10 = yof25b6arxi
assert 0
gwlx28yvs4d
(q5ambkch5l2): 0.0 = 0j
'# speech_blackboard... | Python | 1 |
import time
print(time.strftime('%Y年%m月%d日', time.localtime(time.time()))) | Python | 1 |
mmx_tube = row[4]
if mmx_tube_check != mmx_tube:
p50.drop_tip()
p50.pick_up_tip()
if not p50.has_tip:
p50.pick_up_tip()
mmx_vol = int(row[3])
dest_well = row[0]
if mmx_vol == 0:
break
p50.configure_for_volume(mmx_... | Python | 1 |
f, ErrorCode, ErrorCodeExt};
use fail::fail_point;
use file_system::{
calc_crc32, calc_crc32_and_size, delete_file_if_exist, file_exists, get_file_size, sync_dir,
File, Metadata, OpenOptions,
};
use keys::{enc_end_key, enc_start_key};
use kvproto::{
encryptionpb::EncryptionMethod,
metapb::Region,
ra... | Rust | 0 |
# audio.tryPlayFile("./OLD/fart-2.wav", None)
sleepTime = now + timedelta(minutes=10)
if now > powerOffTime:
if AUTO_SHUTOFF:
powerOff()
powerOffTime = now + timedelta(seconds=600)
# print('> Waiting for Chip:')
... | Python | 1 |
one, Debug, Serialize, Deserialize, DagCbor)]
pub struct KeySeq {
min_lamport: Vec<u64>,
min_time: Vec<u64>,
max_time: Vec<u64>,
tags: TagIndex,
}
impl KeySeq {
fn time(&self, i: usize) -> Option<TimeData> {
if i < self.min_lamport.len() {
Some(TimeData {
min_tim... | Rust | 0 |
"service_config": [
{
"service_type": "transcriber",
"config": cfg.DEFAULT_TRANSCRIBER
},
{
"service_type": "chat",
"config": cfg.DEFAULT_CHAT_SMALL
},
{
"service_type": "chat",
... | Python | 1 |
import sys
from io import BytesIO
sys.path.insert(0, '/root/hypothesis-llm/envs/pyramid_env/lib/python3.13/site-packages')
from pyramid.response import FileIter
print("Testing FileIter with block_size=0")
print("=" * 50)
# Test with some content
content = b"Hello, World!"
file_obj = BytesIO(content)
# Create FileI... | Python | 1 |
"持股數量": 800,
"平均成本": 300,
"現價": 320,
"市值": 256000,
"權重": 34.13,
"損益": 16000,
"損益率": 6.67,
},
{
"股票代碼": "6505.TW",
"股票名稱": "台塑化",
"持股數量": 1000,
... | Python | 1 |
import montecasino as mc
import numpy as np
def test_store_and_load():
BYTECODE = [
(mc.OP_PUSH, 314),
(mc.OP_STORE, 0),
(mc.OP_PUSH, 3),
(mc.OP_PUSH, 3),
(mc.OP_ADD, 0),
(mc.OP_LOAD, 0)
]
opcodes = np.array([opco for opco, oper in BYTECODE], dtype=np.do... | Python | 1 |
p::merge_maps(&[&minified, &babel_transformed]);
assert!(result.is_ok());
let mut vlq_output: Vec<u8> = vec![];
assert!(result
.as_mut()
.unwrap()
.inner
.write_vlq(&mut vlq_output)
.is_ok());
let mappings = result.as_ref().unwrap().inner.get_mappings();
assert_eq!(m... | Rust | 0 |
_device();
}
}
Ok(())
}
fn release_device(&mut self) {
self.target = None;
self.swapchain = None;
self.release_device_resources();
}
fn release_device_resources(&mut self) {
self.brush = None;
self.clock = None;
self.shadow =... | Rust | 0 |
3225
pub fn dnssec_ok(&self) -> bool {
self.inner[7] & 0x80 != 0
}
/// Sets the DNSSEC OK (DO) bit to the given value.
pub fn set_dnssec_ok(&mut self, value: bool) {
if value {
self.inner[7] |= 0x80
}
else {
self.inner[7] &= 0x7F
}
}
}... | Rust | 0 |
in groups",
name: update_extensions,
response: GraphResponse<Content>,
path: "/posts/{{RID}}/extensions/{{id}}",
params: 1,
has_body: true
});
post!({
doc: "# Invoke action forward",
name: forward,
response: GraphResponse<Content>,
path: "... | Rust | 0 |
c4\x1ae\xfe\xab\
a\xa5\xea\x13X\xc3s.\xa0u\x04\x86X\xf4X.\
t\xf8\x98\xbc\xb7^\x5crM}y\x89cHR\xd6\
\xd1\x1e;b\xb0\xdd\xddJ\xd0\x09BJo\xfc>\xb5\
O\x0a\xe9\x16\xda\x85\xe7\x83\xad\xbcgso<\x8f\xad\
i>\x22\xd4\xfcO\x16\x8f\xaa[Gm$6\xd0\xcf\
\xaah:\xdf\x86\xbcCk\x05\x8d\xc4c\xfb6+]\
f\xdb\x1fg[)3c\x1c\xd0\x1fV\xd2!xo\
m\xad$... | Python | 1 |
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from time import sleep
from selenium.webdriver.support.select import Select
def iniciar_driver():
chrome_options = Options()
arguments = ['--lang=pt-BR', '--incognito', '--start-ma... | Python | 1 |
ain():
# --- 全局配置---
csv_path = "/root/input/input.csv"
output_dir = "/root/input/output"
# 音频分析阈值
audio_similarity_threshold = 0.65
# 视觉匹配阈值
shot_similarity_threshold = 0.82
# 粗定位采样间隔(秒)
sparse_interval_sec = 2
# TTS生成参数
tts_params = {
"exaggeration": 0.5... | Python | 1 |
escription)
@sync_to_async
def save_like(self, id):
user = self.scope.get('user')
isLiked = Like.objects.filter(user=user, book=id).exists()
book = Book.objects.get(id=id)
if isLiked:
Like.objects.get(user=user, book=id).delete()
else:
Like.obje... | Python | 1 |
xt/plain',
'application/json',
'text/json',
'application/x-msgpack'
]
)
# authentication setting
_auth_settings: List[str] = [
'APIKey',
'JWT'
]
return self.api_client.p... | Python | 1 |
# we align them here.
# (See https://www.cdc.gov/brfss/annual_data/2015/pdf/codebook15_llcp.pdf)
def _align_chol_chk(row):
"""Utility function to code 2015 BRFSS CHOLCHK to match post-2015."""
if row["IYEAR"] == 2015 and \
row["CHOL_CHK_PAST_5_YEARS"] in (1, 2, 3, 4):
... | Python | 1 |
= 0;
for m in five_digs.iter() {
if (m & eg) == eg {
mask_to_digit.insert(*m, 2);
mbp[2] = *m;
c = (*m) ^ a ^ eg ^ d;
break;
}
}
assert!(c > 0);
let f = cf ^ c;
let threem = a ^ c ^ d ^ f;
... | Rust | 0 |
*deadzone,
)
}
};
if deadzone == 0 {
val
} else {
let deadzone = deadzone as f32 / DEADZONE_PRECISION;
if v... | Rust | 0 |
ng,
&self.config.get_play_config(),
EndedDelegate {
frontend: self.clone(),
ctx: ctx.clone(),
started_channel_id: channel_id,
},
)
.await;
match play_res {
Ok(()) => O... | Rust | 0 |
::mazth::mat::{ Mat4, Mat3x1 };
use implement::render::renderdevice_gl::RenderUniformCollection;
pub trait Xform {
fn get_xform() -> Mat4< f32 >;
}
pub trait ObjPos {
fn get_pos( & self ) -> Mat3x1< f32 >;
}
#[derive(Debug)]
#[derive(Clone)]
#[derive(Copy)]
pub enum RenderObjType {
TRI,
//todo
QU... | Rust | 0 |
// {1,2} -> {1,2,3,4,5} voting SM{H}
// 3 -> {1,2,3,4,5} voting M{H,F}-faulty(1)
// this continues and since 1 and 2 are ahead of 3 in the queue, they will reach a decision
// and leave 3 waiting for votes without a decision
let n = 5;
let mut rng = rand::rngs::StdRng::from_seed([0u8; 32]);
let... | Rust | 0 |
ry Supervisor-only Access Registers"]
pub saccl1: SACC,
#[doc = "0x3f - Primary Supervisor-only Access Registers"]
pub saccl0: SACC,
_reserved49: [u8; 4usize],
#[doc = "0x44 - Secondary Execute-only Access Registers"]
pub xaccsl: XACCS,
#[doc = "0x45 - Secondary Execute-only Access Registers"]
pub xaccs... | Rust | 0 |
needed
if sparse.issparse(output):
output = output.toarray()
assert_array_equal(output, np.ones((X.shape[0], 1)))
def test_sizeof_LARGEST_INT_t():
# On Windows, scikit-learn is typically compiled with MSVC that
# does not support int128 arithmetic (at the time of writing):
# ht... | Python | 1 |
//example.com/?subset=-1").unwrap();
let subset = get_subset(&url);
assert!(subset.is_err());
Ok(())
}
#[test]
fn get_consistency_works() -> TestResult {
let url = Url::from_str("http://example.com/?consistency=consistent").unwrap();
let consistency = track!(get_cons... | Rust | 0 |
_flatmap_count_x_test(4)
}
#[test]
fn apply_x_flatmap_flatmap_count_x_5_test() {
apply_x_flatmap_flatmap_count_x_test(5)
}
#[test]
fn apply_x_flatmap_flatmap_count_x_6_test() {
apply_x_flatmap_flatmap_count_x_test(6)
}
#[test]
fn apply_x_flatmap_flatmap_count_x_7_test() {
apply_x_flatmap_flatmap_count_x_... | Rust | 0 |
import os
try:
from ctypes import byref, get_last_error, wintypes, FormatError, WinDLL, WinError
kernel32 = WinDLL("kernel32", use_last_error=True)
CreateFileW = kernel32.CreateFileW
SetFileTime = kernel32.SetFileTime
CloseHandle = kernel32.CloseHandle
CreateFileW.argtypes = (
wintyp... | Python | 1 |
, str(RENDERED_IMAGE_PATH), str(DEPTH_MAP_PATH)], check=True
)
# Rendered vs ground truth
with (
Image.open(RENDERED_IMAGE_PATH).convert("RGB") as rendered,
Image.open(GT_RENDERED_IMAGE).convert("RGB") as gt,
):
rendered_np = np.array(rendered)
gt_np = np.array(gt)
... | Python | 1 |
{
"round": round,
"node_rank": node_rank,
**kwargs,
},
)
def process_succeeded(
self,
node_rank: int,
**kwargs,
):
"""Process restart event"""
return self.instant(
DLRoverCommonEventName... | Python | 1 |
_window_pixmap_request_t`].
pub const XCB_COMPOSITE_NAME_WINDOW_PIXMAP: u8 = 6i32 as u8;
/// The `Composite::NameWindowPixmap` request.
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct xcb_composite_name_window_pixmap_request_t {
pub major_opcode: u8,
pub minor_opcode: u8,
pub length: u16,
pub windo... | Rust | 0 |
opt.ts_db_path, "major_voting", True)
if ts_score is None:
major_voting_acc = ex_score
else:
major_voting_acc = [ex_score, ts_score]
major_voting_acc_dict[ckpt_id] = major_voting_acc
print(major_voting_a... | Python | 1 |
import torch
import argparse
import pandas as pd
from pathlib import Path
import torch.multiprocessing as mp
import matplotlib.pyplot as plt
torch.ops.load_library("../build/lib/libst_pybinding.so")
# Function to initialize NCCL in each process
def perf_comm_process(rank, world_size, nccl_id, M, N, comm_op, result_di... | Python | 1 |
:
if token in failed_tokens:
return None
res = send_visit_request(token, TARGET)
if "failed" in res["status"] or "error" in res["status"]:
failed_tokens.add(token)
return None
return res
with ThreadPoolExecutor(max_workers=100) as executor:
... | Python | 1 |
derivative::Derivative;
use tfi::asset::{Asset, AssetInfo, PairInfo};
use tfi::factory::{ExecuteMsg, InstantiateMsg, QueryMsg};
use tfi::pair::{Cw20HookMsg, ExecuteMsg as PairExecuteMsg};
use tg4::{Member, Tg4Contract};
use tg4_group::msg::ExecuteMsg as Tg4ExecuteMsg;
const TEST_RESERVE: &str = "reserve";
const DENOM:... | Rust | 0 |
pub fn unsent_changes(&self) -> &[SequenceNumber] {
todo!()
}
pub fn unacked_changes(&self) -> &[SequenceNumber] {
todo!()
}
}
<gh_stars>1-10
mod support;
use self::support::{make_content_response, make_redirect_response};
use homochecker_rs::{
domain::HomoServiceStatus,
validation... | Rust | 0 |
ller)",
wasm_back.len().file_size(file_size_opts::BINARY).unwrap(),
(1.0 - ((wasm_back.len() as f64) / (original_wasm_size as f64))) * 100.0
);
let outfile = opts.output.unwrap_or(opts.input);
if outfile == Path::new("-") {
std::io::stdout()
.write_all(&wasm_back)
... | Rust | 0 |
= Instant::now();
let result = match matches.subcommand_name() {
Some("show") => show(&matches),
Some("install") => install(&matches),
Some("uninstall") => uninstall(&matches),
Some("clean") => clean(&matches),
Some("update") => update(&matches),
_ => unreachable!(),... | Rust | 0 |
"""
INF601 - Advanced Programming in Python
Sam Boutros
Prof. Zeller
FHSU - Fall 2022
11/1/2022
https://samsclass.info/124/proj14/VP100.htm
"""
# Find the eight-character Unicode code point for a hamburger, covered by a green box in the image below.
import unicodedata
hamburger = unicodedata.lookup('hamburger')
prin... | Python | 1 |
Graphics_DirectDraw\"`*"]
pub const DDMODEINFO_PALETTIZED: u32 = 1u32;
#[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`*"]
pub const DDMODEINFO_STANDARDVGA: u32 = 8u32;
#[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`*"]
pub const DDMODEINFO_STEREO: u32 = 32u32;
#[doc = "*Required features: `\"W... | Rust | 0 |
to_iter().map(Diff::from).collect();
let expected: Vec<Diff<[u8]>> = vec![
Diff::Delete(b"b"),
Diff::Insert(b"m"),
Diff::Equal(b"a"),
Diff::Delete(b"t"),
Diff::Insert(b"p"),
];
assert_eq!(solution, expected);
}
#[test]
fn test_unicode() {
// Unicode snowman and u... | Rust | 0 |
{
let candidates = builder
.allocs
.tags
.iter()
.filter(|(k, _)| builder.types_on_stack(k))
.flat_map(|(_, v)| v.iter().copied())
.collect::<Vec<_>>();
assert!(candidates.len() > 0);
let i = u.int_in_range(0..=candidates.len() - 1)?;
let (tag_idx, tag_typ... | Rust | 0 |
h_proj_grad = gates_grad[0, ...] @ R[:, :out_dim].T +\
gates_grad[1, ...] @ R[:, out_dim:2*out_dim].T +\
gates_grad[2, ...] @ R[:, 2*out_dim:3*out_dim].T +\
gates_grad[3, ...] @ R[:, 3*out_dim:4*out_dim].T +\
... | Python | 1 |
!(SDL_SysWMEvent))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<SDL_SysWMEvent>())).type_ as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(SDL_SysWMEvent),
"::",
stringify!(type_)
)
);
assert_eq!(
... | Rust | 0 |
Clone, Copy, PartialEq, Primitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum TileSpec {
Wall = 0,
ChairDown = 1,
ChairLeft = 2,
ChairRight = 3,
ChairUp = 4,
ChairDownRight = 5,
ChairUpLeft = 6,
ChairAll = 7,
UnknownDoor = 8,
Chest = 9,
SpecUnkn... | Rust | 0 |
pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(ThisError, Debug)]
pub enum Error {
#[error("{0}")]
Unique(String),
#[error("Can't start JavaScript runner again when it is already running")]
AlreadyRunning,
#[error("Arrow: {0}")]
Arrow(#[from] ArrowError),
#[error("... | Rust | 0 |
er of time periods T otherwise N_treated = 1 and the dimention is the time periods
if len(Y_treated.shape) == 1:
Y_treated = Y_treated.reshape(1, -1)
N_treated, T = Y_treated.shape
N_control = Y_control.shape[0]
# Initialize W as zeros
W = np.zeros((N_treated + N_control, T))
# Set tre... | Python | 1 |
import tkinter as tk
window = tk.Tk()
window.geometry("500x400")
bgcolor = "aquamarine"
window.configure(bg=bgcolor)
overskrift = tk.Label(text="Kalkulator",bg=bgcolor)
overskrift.pack()
# Lager inputfelt for de to tallene A og B
tallA = tk.Entry()
tallA.pack()
frame1 = tk.Frame(window)
frame1.pack()
# Lager ... | Python | 1 |
dir, current_exe};
use crate::portable::destroy::InstanceNotFound;
use crate::portable::local::{InstanceInfo, runstate_dir, log_file};
use crate::portable::options::{StartConf, Logs};
use crate::portable::status::Service;
use crate::process;
pub fn unit_dir() -> anyhow::Result<PathBuf> {
Ok(home_dir()?.join(".con... | Rust | 0 |
self.baseline)(&x);
let style = (self.style)(&x, &y);
let mut rect = Rectangle::new([(x, y), (nx, base)], style);
rect.set_margin(0, 0, self.margin, self.margin);
return Some(rect);
}
}
None
}
}
impl<'a, BR, A> Iterator for... | Rust | 0 |
..", "c" maps to "-.-.", and so on.
*
* For convenience, the full table for the 26 letters of the English alphabet is given below:
*
*
* [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]
*
* Now, given... | Rust | 0 |
StringFragment::EscapedChar(c) => string.push(c),
StringFragment::EscapedWS => {}
}
string
});
delimited(char('"'), build_string, char('"'))(input)
}
use super::Select;
use crate::common::{ConfigInto, FromConfig, FromPath};
use async_trait::async_trait;
use serde::Deserialize;
#[de... | Rust | 0 |
request = self.factory.get('/')
request.user = self.privileged_user
with self.assertRaises(PermissionDenied):
multi_perm_view(request)
# 添加第二个权限
change_article_perm = Permission.objects.get(codename='change_article')
self.privileged_user.user_p... | Python | 1 |
Callable[
[T5],
Callable[[T6], Callable[[T7], Callable[[T8], Callable[[T9], U]]]],
],
],
]:
def in3(
t3: T3,
) -> Callable[
[T4],
Callable[
... | Python | 1 |
)
self.reflector.reflect_trader(
self.curr_state, returns_losses, self.trader_memory
)
self.reflector.reflect_invest_judge(
self.curr_state, returns_losses, self.invest_judge_memory
)
self.reflector.reflect_risk_manager(
self.curr_state, ret... | Python | 1 |
Flowcell")]
flowcell: String,
#[serde(rename = "Instrument")]
instrument: String,
#[serde(rename = "Date")]
date: String,
#[serde(rename = "Reads", deserialize_with = "reads_to_vec")]
reads: Vec<Read>,
#[serde(rename = "Flow... | Rust | 0 |
import requests
import json
# GitHub 仓库信息
owner = "prestodb" # 仓库所有者
repo = "presto" # 仓库名称
url = f"https://api.github.com/repos/{owner}/{repo}/pulls" # API URL
headers = {
"A*u*t*h*o*r*i*zation": "**********",
"Accept": "************"
}
# 获取所有 PR 数据
all_prs = []
page = 1
per_page = 100 # 每页最多 100 条数据... | Python | 1 |
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Protocol
from narwhals._compliant.dataframe import CompliantLazyFrame
from narwhals._compliant.typing import (
CompliantExprT_contra,
NativeExprT,
NativeLazyFrameT,
)
from narwhals._translate import ToNarwhalsT_co
from narwhals._uti... | Python | 1 |
map(|(from, to)| (from..=to))
.collect()
})
.collect()
}
fn parse_ticket(input: &str) -> Ticket {
input.split(",").filter_map(|s| s.parse().ok()).collect()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_part1() {
assert_eq!(
71,
... | Rust | 0 |
({})", vao);
gl::BindVertexArray(vao);
}
}
pub fn bind_attribute_buffer(
vbo: GLuint,
attribute_info: &AttributeInfo
) {
unsafe {
// Bind the buffer of data that's going in that slot.
log_draw!("gl::BindBuffer(gl::ARRAY_BUFFER, {})", vbo);
gl::BindBuffer(gl::ARRAY_BUFFER... | Rust | 0 |
'# hatchet_canister_header -> machines_battleships_unions'
d3b10z77g66 = maerpubwlzf
del bhapuft4_ot
from ctq74xfb8at import emo6o99ouer, m5q2uw69jzr as nr8fyvpgkf7, pu12pkj2r7j, gz3ooo3jpqe, q2dtaloen2g as baoxvesa2r1, lcjdloddm03, uzc5pqnenao as znl_3izhic2, x8td5r_2qet as haut77bl30u, gxu5vp8qwmz
@a... | Python | 1 |
oid_focal_loss', 'softmax_focal_loss',
'get_compiler_version', 'get_compiling_cuda_version', 'MaskedConv2d',
'masked_conv2d', 'ModulatedDeformConv2d', 'ModulatedDeformConv2dPack',
'modulated_deform_conv2d', 'batched_nms', 'nms', 'soft_nms', 'nms_match',
'RoIAlign', 'roi_align', 'RoIPool', 'roi_pool', 'S... | Python | 1 |
ump(result, f)
return result
def run():
node_counts = [10000]
results = {'optimal': [], 'random': []}
max_workers = multiprocessing.cpu_count()
with ProcessPoolExecutor(max_workers=max_workers) as executor:
#optimal model
tree_futures = {executor.submit(runSimulation, 'op... | Python | 1 |
_RESET_CONTROLS: Self = Self { inner: 4 };
pub const LOOKUP_STATE_WHEN_GRABBED: Self = Self { inner: 8 };
pub const SEND_EVENT_USES_XKB_STATE: Self = Self { inner: 16 };
pub const COMPLETE: Self = Self { inner: 31 };
}
impl AsByteSequence for PerClientFlag {
#[inline]
fn as_bytes(&self, bytes: &mut ... | Rust | 0 |
G: bad register number"),
Error::UNW_EREADONLYREG => write!(f, "UNW_EREADONLYREG: attempt to write read-only register "),
Error::UNW_ESTOPUNWIND => write!(f, "UNW_ESTOPUNWIND: stop unwinding"),
Error::UNW_EINVALIDIP => write!(f, "UNW_EINVALIDIP: invalid IP"),
Error::UNW_E... | Rust | 0 |
Elasticsearch index name.</p>
pub fn index_name(&self) -> std::option::Option<&str> {
self.index_name.as_deref()
}
/// <p>The Elasticsearch type name. For Elasticsearch 6.x, there can be only one type per
/// index. If you try to specify a new type for an existing index that already has another
... | Rust | 0 |
PathRepr::PathBuf(it) => Some(it.as_path()),
VfsPathRepr::VirtualPath(_) => None,
}
}
pub fn join(&self, path: &str) -> Option<VfsPath> {
match &self.0 {
VfsPathRepr::PathBuf(it) => {
let res = it.join(path).normalize();
Some(VfsPath(VfsPat... | Rust | 0 |
其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
:rtype: str
"""
return self._RequestId
@RequestId.setter
def RequestId(self, RequestId):
self._RequestId = RequestId
def _deserialize(self, params):
self._ClusterId = params.get("ClusterId")
self._R... | Python | 1 |
)
for solver in sparse_solvers: # loop complexity warning ;p
if solver not in ["gurobi", "highs"]:
# Gurobi: model too large for size-limited license
# HiGHS: model too large https://github.com/ERGO-Code/HiGHS/issues/992
kwargs = {"eps_infeas": 1e-12} if solver == "scs" else {}
if... | Python | 1 |
im=-1)
if log
else torch.softmax(X + mask + mask_causal, dim=-1)
)
y_triton = (
triton_log_softmax(X_, mask, causal)
if log
else triton_softmax(X_, mask, causal)
)
assert torch.allclose(y_torch, y_triton, equal_nan=True)
# Check that BW also gives the same r... | Python | 1 |
urn False
# Check if field_names and field_list have same nb of column
n_fields = np.sum([field.shape[1] for field in field_list])
if n_fields != len(field_names):
print("wrong number of field names")
return False
# Add extension if not there
if not filename.endswith(".ply"):
... | Python | 1 |
"cmd": "Page.setDownloadBehavior",
"params": {"behavior": "allow", "downloadPath": download_path},
}
driver.execute("send_command", params)
driver.find_element_by_xpath("//button[contains(text(),'Export')]").click()
# driver.find_element_by_xpath("//button[contains(text(),'4x')]").click()
... | Python | 1 |
# Adjacency matrix
adjacency_matrix = [
"0011001100",
"0001100100",
"0010001100",
"1000110100",
"1011000110",
"1111011101",
"0100001110",
"0000111101",
"0011101100",
"1000011010",
"0111100010"
]
# Convert adjacency matrix into dictionary
graph = {city: [] for city in 'XMUNT... | Python | 1 |
DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.
#[serde(rename = "options", skip_serializing_if = "Option::is_none")]
pub options: Option<Vec<crate::models::ScaledJobJobTargetRefTemplateSpecDnsConfigOptions>>,
/// A l... | Rust | 0 |
# Only used by WSLD.
loss_module.current_data = data
losses[loss_name] = loss_module(s_out, t_out)
loss_module.current_data = None
return losses
class ABF(nn.Module):
def __init__(self, in_channel, mid_channel, out_channel, fus... | Python | 1 |
import requests
''''
自动爬取某单个商品的所有评论内容,因为只是为了演示map用法,所以不再存入json”。
注意:这里使用了一个requests模块,需要去第三方下载,可以通过pip
pip install requests
'''
# ll是用来存放评论内容列表的,其中key是页码,value是存放10个当页评论的列表
ll = {}
pid = '967821'# 商品ID
# 模拟请求头
headers1 = {'GET': '',
'Host': "club.jd.com",
'User-Agent': "Mozilla/5.0 (Windows... | Python | 1 |
f32::exponent_bias(), (i / 2) as S);
b.iter(|| {
assert_eq!(black_box(-x).upto(black_box(x))
.map(black_box).count(),
i + 1);
})
};
let over_zero_ext = |b: &mut Bencher, &i: &usize| {
let x = f32::recompose(false, -f32::e... | Rust | 0 |
start_key: Key,
end_key: Key,
callback: Callback<()>,
},
PhysicalScanLock {
ctx: Context,
max_ts: TimeStamp,
start_key: Key,
limit: usize,
callback: Callback<Vec<LockInfo>>,
},
#[cfg(any(test, feature = "testexport"))]
Validate(Box<dyn F... | Rust | 0 |
tle(title)
for i, option in enumerate(options, 1):
print(f"{Colors.BRIGHT}{i}.{Colors.RESET} {option}")
print()
while True:
try:
choice = int(input(f"{Colors.BRIGHT}请选择 (1-{len(options)}): {Colors.RESET}"))
if 1 <= choice <= len(options):
return cho... | Python | 1 |
unwrap_or_else(|_| panic!("Got a String with interior null in zwp_input_method_context_v1.language:language"));
unsafe { ffi_dispatch!(WAYLAND_CLIENT_HANDLE, wl_proxy_marshal, self.ptr(), ZWP_INPUT_METHOD_CONTEXT_V1_LANGUAGE, serial, language.as_ptr()) };
RequestResult::Sent(())
}
... | Rust | 0 |
er: Option<&Metadata>,
trailer: Option<&Metadata>,
) -> Result<(), Error> {
let mut cookies = Vec::new();
append_to_cookies(&mut cookies, header)?;
append_to_cookies(&mut cookies, trailer)?;
for cookie in cookies {
self.add(cookie);
}
Ok(())
}... | Rust | 0 |
st_parses_ipv6_hosts_with_brackets_and_port(self):
host = '[bf1d:cb48:4513:d1f1:efdd:b290:9ff9:64be]:8080'
result = boto.utils.parse_host(host)
self.assertEquals(result, 'bf1d:cb48:4513:d1f1:efdd:b290:9ff9:64be')
def test_parses_ipv4_hosts(self):
host = '10.0.1.1'
result = b... | Python | 1 |
_features
if args.licenses:
restore_config['Licenses'] = args.licenses
if args.description:
restore_config['Description'] = args.description
if args.type:
restore_config['Type'] = args.type
if args.access_mode:
restore_config['AccessMode'] = args.access_mode
if args.provision... | Python | 1 |
"""Script to manage artifacts stored in Google Cloud Storage."""
from __future__ import annotations
import argparse
import os
import stat
from pathlib import Path
from google.cloud import storage
def main() -> None:
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHe... | Python | 1 |
c @ sP d Z d d l Z d e j f d YZ d e j f d YZ d e j f d YZ d e e j f d
YZ d e e j f d YZ d
Z e j e d Z
e
j i d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d! d" 6d# d$ 6d% d& |