text string | label_name string | labels int64 |
|---|---|---|
quired features: `\"Win32_Storage_FileServerResourceManager\"`*"]
pub const FSRM_S_CLASSIFICATION_SCAN_FAILURES: ::windows_sys::core::HRESULT = 283398i32;
#[doc = "*Required features: `\"Win32_Storage_FileServerResourceManager\"`*"]
pub const FSRM_S_PARTIAL_BATCH: ::windows_sys::core::HRESULT = 283396i32;
#[doc = "*Req... | Rust | 0 |
betac @ e Zd Zdd ZdS ) _Sentinelc C dS )Nz
<sentinel> selfru ru sC:\Users\devid\Desktop\Daily-Practice\Attendance App\venv\lib\site-packages\setuptools\_vendor\typing_extensions.py__repr__ z_Sentinel.__repr__N__name__
__module____qualname__r... | Python | 1 |
import ast
import re
import math
from PIL import Image
import ray
import os
from io import BytesIO
import base64
import datetime
import traceback
import torch
from qwen_vl_utils import process_vision_info
from desktop_env.desktop_env import DesktopEnv
uitars_system_prompt = """You are a GUI agent. You are given a ... | Python | 1 |
#The icecreamed one
print("Note=from prespective of PY8th\n\n\n\n\n\n\n\n\n\n\n")
import time
import random
import turtle
def waiting_dots(amount_of_dots = 3,waiting_time = 1):
for i in range(amount_of_dots):
print(".")
time.sleep(waiting_time)
def Processing(Processing="Processing",amount_of_dots =... | Python | 1 |
#[test]
fn check_sum_filtered_ints() {
let a: Vec<i32> = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let par_sum_evens: i32 = a.par_iter().filter(|&x| (x & 1) == 0).sum();
let seq_sum_evens = a.iter().filter(|&x| (x & 1) == 0).sum();
assert_eq!(par_sum_evens, seq_sum_evens);
}
#[test]
fn check_sum_filtermap_i... | Rust | 0 |
_address"]
return None
def is_same_network(self, cidr1, cidr2):
# CIDR表記のIPアドレスが同じネットワークに属するか判断
net1 = ipaddress.ip_network(cidr1, strict=False)
net2 = ipaddress.ip_network(cidr2, strict=False)
return net1.overlaps(net2)
def get_neighbor_router_id(self, link, current_ro... | Python | 1 |
OSITE_HASH_TO_G1},
hashers::{composite::COMPOSITE_HASHER, DirectHasher, Hasher},
test_helpers::{keygen_batch, sign_batch, sum},
PrivateKey, PublicKeyCache, SIG_DOMAIN,
};
use algebra::{
bls12_377::{Bls12_377, G1Projective, G2Projective, Parameters},
curves::bls12::Bls12P... | Rust | 0 |
adt_def, variant, substs) = match agg_kind {
&AggregateKind::Adt(adt_def, variant, substs) => (adt_def, variant, substs),
_ => span_bug!(src_info.span, "expected struct, not {:?}", rhs),
};
let n = bb.statements.len();
bb.statements.reserve(n + operand... | Rust | 0 |
nent => 0,
Timeout::ExpiresAfter(d) => d,
}
}
}
#[derive(Debug, PartialEq)]
pub struct Mask<T> {
pub value: T,
pub mask: Option<T>,
}
/// Capabilities supported by the datapath.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Capabilities {
pub flow_stats: bool,
pub tab... | Rust | 0 |
"""
Poor Man's Configurator. Probably a terrible idea. Example usage:
$ python train.py config/override_file.py --batch_size=32
this will first run config/override_file.py, then override batch_size to 32
The code in this file will be run as follows from e.g. train.py:
>>> exec(open('configurator.py').read())
So it's ... | Python | 1 |
Andorra";
pub const ISO_FULL_AGO: &str = "Angola";
pub const ISO_FULL_AIA: &str = "Anguilla";
pub const ISO_FULL_ATA: &str = "Antarctica";
pub const ISO_FULL_ATG: &str = "Antigua and Barbuda";
pub const ISO_FULL_ARG: &str = "Argentina";
pub const ISO_FULL_ARM: &str = "Armenia";
pub const ISO_FULL_ABW: &str = "Aruba";
p... | Rust | 0 |
,
optional_param: None,
}
}
}
/// Converts the ObjectParam value to the Query Parameters representation (style=form, explode=false)
/// specified in https://swagger.io/docs/specification/serialization/
/// Should be implemented in a serde serializer
impl std::string::ToString for ObjectParam {
... | Rust | 0 |
ity_bit(0b00000000), 0);
assert_eq!(compute_parity_bit(0b00000001), 1);
assert_eq!(compute_parity_bit(0b00000011), 0);
assert_eq!(compute_parity_bit(0b00000010), 1);
assert_eq!(compute_parity_bit(0b00000110), 0);
assert_eq!(compute_parity_bit(0b00001110), 1);
assert_eq!(compute_parity_bit(0b0001... | Rust | 0 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_squared_error
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, LSTM, Dropout
def mean_absolute_percentage_error(y_true, y_pred)... | Python | 1 |
import torch
import torch.nn as nn
from torch import Tensor
class DeployC2f(nn.Module):
def __init__(self, *args, **kwargs):
super().__init__()
def forward(self, x: Tensor) -> Tensor:
x_main = self.main_conv(x)
x_main = [x_main, x_main[:, self.mid_channels:, ...]]
x_main.exte... | Python | 1 |
ard() {
let hub = MessageHub::<TestMessage, TestAddress>::create();
let (messenger_1, _) =
hub.lock().await.create_messenger(MessengerType::Addressable(TestAddress::Foo(1)));
let (_, mut receiver_2) = hub.lock().await.create_messenger(MessengerType::Broker);
let (_, mut receiver_3) =
hu... | Rust | 0 |
restack", "--on-disk"])?;
let stdout = remove_rebase_lines(stdout);
insta::assert_snapshot!(stdout, @r###"
branchless: running command: <git-executable> diff --quiet
Calling Git for on-disk rebase...
branchless: running command: <git-executable> rebase --continue
Finished... | Rust | 0 |
def solve(grid):
# find separator rows and cols
rows, cols = len(grid), len(grid[0])
sep_rows = {r for r in range(rows) if len(set(grid[r]))==1 and grid[r][0]!=0}
sep_cols = {c for c in range(cols) if len({grid[r][c] for r in range(rows)})==1 and grid[0][c]!=0}
# find block row spans
brs = []
... | Python | 1 |
# https://leetcode.com/problems/add-binary/description/
class Solution(object):
def addBinary(self, a, b):
ans = bin(int(a, 2) + int(b, 2))[2:]
return ans
| Python | 1 |
tput
out = join(args.runner, "out.xml")
if os.path.exists(out):
os.remove(out)
traci.start([sumoBinary, "-n", network], port=args.port)
steps = int(end * (1 / args.step_length))
# Load scenario with desired traffic scaling
traci.load(["-c", scenario])
try:
for step in ran... | Python | 1 |
R
component.error_message = str(e)
component.end_time = datetime.now(timezone.utc)
logger.error(f"❌ 组件异常: {component.name} - {e}")
return False
async def _initialize_component(self, component: StartupComponent) -> bool:
"""初始化具体组件"""
try:
... | Python | 1 |
#type,
content: self.content,
confidence: self.confidence,
speaker: self.speaker,
}
}
}
}
impl MedicalItem {
/// Creates a new builder-style object to manufacture [`MedicalItem`](crate::model::MedicalItem)
pub fn builder() -> crate::model::... | Rust | 0 |
ll points (1:0),(2,0),(3,0),etc.
P = [0 for _ in range(n + 1)]
P[0] = 1
pts.append(self(P))
return pts
# fix the pickles from moving projective_space.py
register_unpickle_override('sage.schemes.generic.projective_space',
'ProjectiveSpace_field',
... | Python | 1 |
# Generated by Django 5.1.3 on 2024-11-27 13:11
import django.db.models.deletion
import profiles.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("profiles", "0008_remove_profilecard_profile_profile_cards"),
]
operations = [
migrat... | Python | 1 |
import math
from typing import List
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from matplotlib.ticker import FuncFormatter
def human_format(num):
num = float('{:.3g}'.format(num))
magnitude = 0
while abs(num) >= 1000:
magnitude += 1
num /= 1000.0
return '{}{}... | Python | 1 |
ack_bottom == 1:
mycount+=1
track_bottom=0
track_top=0
# Display the push-up count and leg state
frame2= cv2.resize(frame, (640, 480)) # Change size as needed
cv2.putText(frame2, f"Push-ups: {pushup_count}", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 0, 0)... | Python | 1 |
1 != A::V2; }");
err(
"enum A { V1 } fun f() -> A { return A; }",
pos(1, 37),
SemError::EnumUsedAsIdentifier,
);
err(
"enum A { V1 } fun f() { A = 1; }",
pos(1, 27),
SemError::InvalidLhsAssignment,
);
err(
"enum A { V1, V2 } fun f() -> A { r... | Rust | 0 |
.context.i32_type().const_zero().into(),
contract.context.i32_type().const_int(hashlen, false).into(),
],
"",
);
}
// bytes32 needs to reverse bytes
let temp = contract.builder.build_alloca(
contract.llvm_type(&resolver... | Rust | 0 |
&self.value
}
}
/// # Memory Device — Memory Technology
#[derive(Serialize, Debug, PartialEq, Eq)]
pub enum MemoryDeviceTechnology {
/// Other
Other,
/// Unknown
Unknown,
/// DRAM
Dram,
/// NVDIMM-N
NvdimmN,
/// NVDIMM-F
NvdimmF,
/// NVDIMM-P
NvdimmP,
///... | Rust | 0 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import os
import re
from lib.core.common import singleTimeWarnMessage
from lib.core.convert import decodeHex
from lib.core.convert import getOrds
from lib.core.enums import DBMS... | Python | 1 |
, %mm0");
test_display(&[0x4f, 0x0f, 0xd1, 0x00], "psrlw (%r8), %mm0");
test_display(&[0x0f, 0xe5, 0x3d, 0xaa, 0xbb, 0xcc, 0x77], "pmulhw 0x77ccbbaa(%rip), %mm7");
}
#[test]
fn test_instructions_c() {
// just modrm
test_display(&[0x33, 0x08], "ecx ^= [rax]");
test_display(&[0x33, 0x20], "esp ^= [r... | Rust | 0 |
import datetime as dt
hozir = dt.datetime.now()
print(hozir)
# sanani ajratib olish
print(hozir.date())
# vaqtni ajratib olish
print(hozir.time())
# soatni ajratib olish
print(hozir.hour)
# minutni ajratib olish
print(hozir.minute)
# sekundni ajratib olish
print(hozir.second)
bugun = dt.date.today()
print(f"Bugu... | Python | 1 |
;
table_boilerplate!(tables::name::name, name);
table_boilerplate!(tables::os2::os2, os2);
table_boilerplate!(tables::post::post, post);
table_boilerplate!(tables::prep::prep, prep);
table_boilerplate!(tables::MATH::MATH, MATH);
impl Serialize for LoadedTable {
fn to_bytes(&self, data: &mut Vec<u8>) -> Result<(), ... | Rust | 0 |
= nan_integer:
raise ValueError(
"if ``domain_super_areas`` is True, I expect not Nones super areas."
)
if super_area not in domain_super_areas:
continue
school = world.schools.get_fro... | Python | 1 |
x, vec![title]).parse_query("diary")?;
/// # let top_docs = docs_sorted_by_rating(&index.searcher()?, &query, rating)?;
/// # assert_eq!(top_docs,
/// # vec![(97u64, DocAddress::new(0u32, 1)),
/// # (80u64, DocAddress::new(0u32, 3))]);
/// # Ok(())
/// # }
//... | Rust | 0 |
#!/usr/bin/env python3
# topo/insdn_topo.py
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.node import OVSSwitch, RemoteController, Host # Add these if not present
from mininet.link import TCLink # Add this if using bw/delay
from mininet.log import info, setLogLevel
from time import sleep # <... | Python | 1 |
# Copyright 2024 The JAX Authors.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Python | 1 |
chunk ┌ frame
//! ┌ sample ↓ ↓
//! │ ┌─────────┐ ┌─┐
//! ┌──↓──────┼─────────┼─────┼─┼───────────────────┐
//! channel →│• • • • •│• • • • •│• • •│•│• • • • • • • • • •│
//! └─────────┼─────────┼─────┼─┼───────────────────┘
//! • • • • •│• • ... | Rust | 0 |
9\x8c\xcf\xd0\xf7\xde4\x18\x5c\
1\xb9\xd7\xd6\xc8W\x83\xbe}\xf8JX\xacq\xe8\xa9\
\xccK~o\xfd\xa7\x8e\xdeyk\xdft\x14e_\xcb\
\x13\x9eq9n\xed\x91\x17sD\xa2/\xe1\xc4\x9c\x1c\
Y[\xdf\x90\xcclc\x88\x12\x89>\x1e\x8c\x19)\xeb\
>\x95Y\x99\xec\x15\xeb9\x08U\xa95%\xcc|5\
\xadA\x1e\x11\xbb=\xb2\xff9\x90N\xe5\xe7\x5cO-\
\x90,\xa8\x9... | Python | 1 |
from .dependencymatcher import DependencyMatcher
from .levenshtein import levenshtein
from .matcher import Matcher
from .phrasematcher import PhraseMatcher
__all__ = ["DependencyMatcher", "Matcher", "PhraseMatcher", "levenshtein"]
| Python | 1 |
ame, index_columns)
except Exception as e:
exit('Error: %s' % (e))
def create_index(conn, table_name, index_name, index_columns, unique=False):
index_def = 'CREATE %s INDEX %s on %s(%s)' % (
'UNIQUE' if unique else '', index_name,
table_name, ','.join(index_columns))
... | Python | 1 |
is ``None``.
h: The direction(s) for the directional (Gâteaux) derivative. If this is
``None``, one random direction is chosen. Default is ``None``.
rng: A numpy random state for calculating a random direction.
Returns:
The convergence order from the Tayl... | Python | 1 |
from llava.conversation import conv_templates
import string
import json
import os
import ast
def process_ast(string):
return ast.literal_eval(string)
def last_problem(doc):
return process_ast(doc["problems"])[-1]
def remove_punctuation(input_string):
return input_string.translate(str.maketrans('', '', st... | Python | 1 |
(value as i64),
})
}
}
impl TryFrom<DataValue> for Address {
type Error = MemoryError;
fn try_from(value: DataValue) -> Result<Self, Self::Error> {
let addr = match value {
DataValue::U32(v) => v as u64,
DataValue::I32(v) => v as u32 as u64,
DataValue::U... | Rust | 0 |
uant, "temp_storage only work for blockwise (i.e lat. method) quantization"
load_shiftaddllm_weight(model, args.load_temp_storage, model_name=str(args.model).split("/")[-1],
wbits=args.wbits, groupsize=args.groupsize)
dataloader, testloader = get_loaders(
args.datase... | Python | 1 |
_LIST: [&str; 41] = [
"URU'R'", // 1
"yU'L'UL", // 2
"yL'U'L", // 3
"RUR'", // 4
"U'RUR'U2RU'R'", // 5
"yUL'U'LU2'L'UL", // 6
"U'RU2R'U2RU'R'", // 7
"yUL'U2LU2'L'UL", // 8
"yUL'U'LU'L'U'L", ... | Rust | 0 |
"""
WLOG, G = 1.0 gravitational constant
HELP
(key up, down, right, left): camara movement P
"""
HELP_TEXT = "(key up, down, right, left): camara movement (mouse click on a matter): lock center on a matter, click again to unlock (resizing window also unlocks) (mouse wheel)... | Python | 1 |
n claim_rewards() {
let mut deps = mock_dependencies(&[Coin {
denom: "uusd".to_string(),
amount: Uint128::new(100u128),
}]);
let init_msg = default_init();
let info = mock_info("addr0000", &[]);
instantiate(deps.as_mut(), mock_env(), info, init_msg).unwrap();
let msg = Execute... | Rust | 0 |
import pytest
from django.test import Client
from pollaris.app.models import SearchLog
def post_to_search_log(payload):
return Client().post("/api/v1/search/log", payload, content_type="application/json")
@pytest.mark.django_db
def test_search_log_request_search_string():
payload = {
"address_enter... | Python | 1 |
pass
n0yp2htjz6i = l3htfkx0jwv = k5d1rhupin3 = rrcpn3r1d2_ = wm48gjlpqfz = xg5jg98fvsy = n5xxljmf00c
import s5hbijjds3_ as eefdjz2nwj_, zf7udf6gvez, ga5cqrc3m7q, vzwnk3ncmqb as dxw4p8upycv, xayhrtdfir2 as cpqjmrm2ce2
0j
raise o7dy7hm5des
'# hospitals_repairs_hoses -> difficulties_rain_pitches'
... | Python | 1 |
}
#[inline]
pub fn signal(&self) -> Option<Signal> {
Signal::from_i32(self.si_signo())
}
}
impl fmt::Debug for SigInfo {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut ds = f.debug_struct("SigInfo");
ds.field("si_signo", &self.si_signo());
ds.field("si_e... | Rust | 0 |
// TODO: Restore Balance and Total Supply
// legacy.balance
// TODO: Change legacy names
// NOTE: this is only needed from Libra -> Diem renames
if let Some(bal) = &legacy.balance {
let new = BalanceResource::new(bal.coin());
write_set_mut.push((
AccessPath::new(account,... | Rust | 0 |
import gym
from simple_dqn_torch import DeepQNetwork, Agent
from utils import plotLearning
import numpy as np
from gym import wrappers
if __name__ == '__main__':
env = gym.make('LunarLander-v2')
brain = Agent(gamma=0.99, epsilon=1.0, batch_size=64, n_actions=4,
input_dims=[8], alpha=0.003)
... | Python | 1 |
v in a.iter_mut() {
*v = v.mul_round(chirp, 16);
chirp = ((start as u32 * chirp as u32 + 32768) >> 16) as u32;
}
} else {
deadline = false;
break;
}
}
if deadline {
for (v, l) in... | Rust | 0 |
ns
///
/// An exclusive `&mut BitSlice` over the `elem` element.
///
/// Note that the original `elem` reference will be inaccessible for the
/// duration of the returned slice handle’s lifetime.
///
/// # Examples
///
/// ```rust
/// use bitvec::prelude::*;
///
/// let mut elem = 0u16;
/// let bits = BitS... | Rust | 0 |
]
for _ in boxes
]
return box_coords, point_coords
@app.cell(column=2, hide_code=True)
def _(mo):
mo.md(r"""## Segment-Anything results""")
return
@app.cell
def _(box_coords, image, masks, point_coords):
import matplotlib.pylab as plt
plt.imshow(image)
if len(point_coords +... | Python | 1 |
.session != session {
return Err("Field Constraint - (session, Expected the same session)".into())
}
if !self.keys.constains(profiles) {
return Err("Field Constraint - (keys, Expected the same profile list)".into())
}
let sig_data = Self::data(&self.session, &se... | Rust | 0 |
rt cache._remove_counter == 2
del cache[5]
assert len(cache) == 2
assert set(cache.cache) == {2, 4}
assert cache._remove_counter == 3
cache.pop(10)
assert len(cache) == 2
assert set(cache.cache) == {2, 4}
assert cache._remove_counter == 3
cache[6] = 6
assert len(cache) == 3
... | Python | 1 |
::is_none")]
pub stack_level: Option<i64>,
}
use plantuml_backend::PlantUMLBackend;
#[cfg(any(feature = "plantuml-ssl-server", feature = "plantuml-server"))]
use plantuml_server_backend::PlantUMLServer;
use plantuml_shell_backend::PlantUMLShell;
use plantumlconfig::PlantUMLConfig;
#[cfg(any(feature = "plantuml-ssl-... | Rust | 0 |
import pathlib
import re
FORBIDDEN = [
r"\brequests\.",
r"\burllib\.request\.",
r"\baiohttp\.ClientSession\(",
]
def test_no_blocking_http_in_endpoints():
root = pathlib.Path(__file__).resolve().parents[1]
routers = root / "innerloop" / "api" / "routers"
bad = []
for py in routers.rglob("... | Python | 1 |
"""Define a client to interact with a RainMachine unit."""
| Python | 1 |
one
assert env.line_comment_prefix is None
env = Environment(line_statement_prefix="#", line_comment_prefix="##")
assert env.line_statement_prefix == "#"
assert env.line_comment_prefix == "##"
rv = env.render_str("# for x in range(3)\n{{ x }}\n# endfor")
assert rv == "0\n1\n2\n"
def test_cus... | Python | 1 |
neg_prompt_ids,
)
if self.safety_checker is not None:
safety_params = params["safety_checker"]
images_uint8_casted = (images * 255).round().astype("uint8")
num_devices, batch_size = images.shape[:2]
images_uint8_casted = np.asarray(images_uint8_cas... | Python | 1 |
, Clone, Default)]
pub struct VkIndirectCommandsLayoutTokenNVX {
pub tokenType: VkIndirectCommandsTokenTypeNVX,
pub bindingUnit: u32,
pub dynamicCount: u32,
pub divisor: u32,
}
/// See [`VkIndirectCommandsLayoutCreateInfoNVX`](https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.htm... | Rust | 0 |
_ => steps.push(Step::RunLocalFns(vec![system])),
},
SimpleStep::FlushCommands => match steps.last() {
Some(Step::FlushCommands) | None => (),
_ => steps.push(Step::FlushCommands),
},
}
}
steps
}
fn run_systems_seq<S>(
... | Rust | 0 |
# ! [model_pass:ov_model_pass_py]
'''
``ModelPass`` can be used as a base class for transformation classes that take entire ``Model`` and proceed with it.
To create transformation, you need to:
1. Define a class with ``ModelPass`` as a parent.
2. Redefine the run_on_model method that will receive ``Model`` as an argum... | Python | 1 |
join("videos", f"""kan-{state["env_name"]}-episode*.mp4"""))
clips = [VideoFileClip(file) for file in video_files]
final_clip = concatenate_videoclips(clips)
final_clip.write_videofile(video_path, codec="libx264", fps=24)
symbolic_formula = f"### The symbolic formula of the policy is:"
... | Python | 1 |
# let's build the same app again but let's change few `Draggable` properties
import flet as ft
def main(page: ft.Page):
page.title = "Simple Drag N Drop App"
def drag_accept(e):
# get draggable (source) control by its ID
src = page.get_control(e.src_id)
# update the text inside dragg... | Python | 1 |
gs.lr * coef_lr},
# the learning rate for new added parameters are lr
{'params': [p for n, p in decay_noclip_param_tp], 'weight_decay': weight_decay},
{'params': [p for n, p in no_decay_noclip_param_tp], 'weight_decay': 0.0}
]
elif args.optim == 'AdamW':
optimize... | Python | 1 |
.write(true)
.open(&path)
.await;
if result.is_err() {
return Err(anyhow::Error::msg(format!(
"Failed to open the block file {:?}.",
path
)));
}
file = result.unwrap();
//read max span size from f... | Rust | 0 |
n password ... (tmp solution)
return user
else:
return {"id": -1}
@app.post("/login")
async def login_user(user : User):
cur.execute('SELECT salt FROM users WHERE username = ?', (user.username,))
result = cur.fetchone()
if result is None:
return { "id": -1}
salt = resu... | Python | 1 |
)]
pub struct NRF_QDEC_Type {
pub TASKS_START: u32,
pub TASKS_STOP: u32,
pub TASKS_READCLRACC: u32,
pub RESERVED0: [u32; 61usize],
pub EVENTS_SAMPLERDY: u32,
pub EVENTS_REPORTRDY: u32,
pub EVENTS_ACCOF: u32,
pub RESERVED1: [u32; 61usize],
pub SHORTS: u32,
pub RESERVED2: [u32; 64u... | Rust | 0 |
self,
"Reset Changes",
f"This will clear the record of {len(self.session_commands)} operation(s) from this session.\n\n"
"The changes will remain applied, but you won't be able to undo them using 'Cancel All Changes'.\n\n"
"Are you sure?",... | Python | 1 |
kip_snap_zero and snapnr == 0:
continue
if skip_last_snap and f == hdf5files[-1]:
continue
newsnap = RTSnapData()
newsnap.snapnr = snapnr
F = h5py.File(f, "r")
newsnap.boxsize = F["Header"].attrs["BoxSize"]
newsnap.ncells = F["Cells"]
Gas... | Python | 1 |
round_digits = 5
total_joints = 10000
inspector_a_defects = 740
inspector_b_defects = 742
defects_judge_at_least_one = 1077
# (a)
print(f"Inspected by neither {round(1 - defects_judge_at_least_one/total_joints, round_digits)}")
# (b)
only_inspector_b = defects_judge_at_least_one - inspector_a_defects
print(f"Judge b... | Python | 1 |
imated": (animated,) } }
class SaveAnimatedPNG:
def __init__(self):
self.output_dir = ldm_patched.utils.path_utils.get_output_directory()
self.type = "output"
self.prefix_append = ""
@classmethod
def INPUT_TYPES(s):
return {"required":
{"images": ("IMAGE... | Python | 1 |
&'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "No event."]
#[inline(always)]
pub fn no_event(self) -> &'a mut W {
self.variant(SRC_A::NO_EVENT)
}
#[doc = "AUX_EVCTL:EVSTAT3.AUX_SMPH_AUTOTAKE_DONE"]
#[inline(always)]
pub fn aux_smph_autotake_done(self) -> &'a... | Rust | 0 |
.with_id(open_menu_id));
menu.add_item(MenuItemAttributes::new("Quit").with_id(quit_menu_id));
let _system_tray = SystemTrayBuilder::new(icon, Some(menu))
.build(&event_loop)
.unwrap();
}
#[cfg(any(target_os = "macos", target_os = "windows"))]
let _system_tray = SystemTrayBuilder::new(icon, N... | Rust | 0 |
range for each team
for t in range(num_teams):
model.addCons(quicksum(neighborhood_vars[t, n] * 1.2 for n in range(num_neighborhoods)) <= work_ranges[t], f"WorkRange_{t}")
# Priority neighborhood coverage
for n in range(num_neighborhoods):
if priority_neighborhoods[n] =... | Python | 1 |
new index in the tree.
pub fn move_focus(&mut self, idx: usize) {
if !self.leaf_range.contains(&idx) {
while !self.path.last().unwrap().1.contains(&idx) {
self.path.pop();
}
let new_idx = idx - self.path.last().unwrap().1.start;
let (leaf_rang... | Rust | 0 |
InstanceRequest. # noqa: E501
:return: The stopped_mode of this StopInstanceRequest. # noqa: E501
:rtype: str
"""
return self._stopped_mode
@stopped_mode.setter
def stopped_mode(self, stopped_mode):
"""Sets the stopped_mode of this StopInstanceRequest.
:par... | Python | 1 |
yh_algorithm_YH_ALGO_YUBICO_OTP_AES192 => Algorithm::YubicoOtpAes192,
yh_algorithm_YH_ALGO_YUBICO_OTP_AES256 => Algorithm::YubicoOtpAes256,
yh_algorithm_YH_ALGO_YUBICO_AES_AUTH => Algorithm::YubicoAesAuth,
yh_algorithm_YH_ALGO_EC_ED25519 => Algorithm::EcEd25519,
... | Rust | 0 |
nst EQ = 0b00000010;
}
}
impl Display for Extensions {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let eqxor = Extensions::EQ | Extensions::XOR;
if *self == eqxor {
write!(f, "satex")
} else {
match *self {
Extensions::N... | Rust | 0 |
various inputs
class MockModel:
class _meta:
class pk:
attname = "id"
class MockHistoricalModel(models.Model):
class Meta:
app_label = 'test'
abstract = True
instance_type = MockModel
history_date = models.Dat... | Python | 1 |
()?;
assert_eq!(strings.get(0).unwrap(), "hello");
assert_eq!(strings.get(1).unwrap(), "world");
assert_eq!(return_class_array()?.len(), 2);
Ok(())
}
pub fn run_end_to_end_test() -> Result<(), wasm_bindgen::JsValue> {
assert!(run_test(&cloner, &generic_cloner, &generic_cloner, &generic_cloner, vec!... | Rust | 0 |
print("─"*50)
print(result.answer)
print("\n" + "="*70)
# Pause between demos
if i < len(demo_questions):
print("\nPress Enter to continue to the next demo...")
input()
print("\n🎉 Thinking demonstration completed!")
... | Python | 1 |
l^k$G&b1^A"));
encoding_eq!(ClientMessage::AuthenticationSaslResponse(
SaslResponse {
data: bconcat!(b"c=biws,"
b"r=%NR65>7bQ2S3jzl^k$G&b1^A"
b"YsykYKRbp/Gli53UEElsGb4I,"
b"p=UNQQkuQ0m5RRy24Ovzj/"
... | Rust | 0 |
"""Package version"""
__version__ = "0.3.24"
| Python | 1 |
class Solution:
def numDecodings(self, s: str) -> int:
dp = {len(s) :1}
def dfs(i):
if i in dp:
return dp[i]
if s[i] == "0":
return 0
res = dfs(i+1)
if (i + 1 < len(s) and (s[i] == '1' or s[i] == '2' and s[i +1] in '01... | Python | 1 |
('𣍦', "kuàng"),
('𣍧', "fěi"),
('𣍯', "yùn"),
('𣍰', "qiǎn"),
('𣍴', "quán"),
('𣍸', "pò"),
('𣍺', "pěi"),
('𣎄', "gèng"),
('𣎅', "yì,huān"),
('𣎆', "luò"),
('𣎑', "kuān"),
('𣎓', "xuǎn"),
('𣎔', "niàn"),
('𣎚', "hú"),
('𣎛', "jú,xuè"),
('𣎩', "yè"),
(... | Rust | 0 |
rch = "mips64")))]
fn is_getrandom_available() -> bool {
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
use std::sync::{Once, ONCE_INIT};
static CHECKER: Once = ONCE_INIT;
static AVAILABLE: AtomicBool = ATOMIC_BOOL_INIT;
CHECKER.call_once(|| {
... | Rust | 0 |
== STATE_COMPLETE {
let r = mem::replace(&mut contents.result, Ok(Async::NotReady));
return r;
} else {
log!(FutureInstallWaitingTask { state: state });
contents.waiting_task = Some(task::park());
Ok(Async::NotReady)
}
}
fn cancel(&se... | Rust | 0 |
import urllib.request
import html
from bs4 import BeautifulSoup
if __name__ == '__main__':
shorthand_map = []
url = "https://typst.app/docs/reference/symbols/"
with urllib.request.urlopen(url) as response:
html_text = response.read().decode('utf-8')
soup = BeautifulSoup(html_text, 'html.par... | Python | 1 |
{options::*, types::FieldTable, Connection, ConnectionProperties, Result};
/// use futures_lite::stream::StreamExt;
/// use std::future::Future;
///
/// let addr = std::env::var("AMQP_ADDR").unwrap_or_else(|_| "amqp://127.0.0.1:5672/%2f".into());
///
/// let res: Result<()> = async_global_executor::block_on(async {
///... | Rust | 0 |
this
"locked json "
{
"send": {
"msg": "eyJsb2NrZWQiOnsibW9udGgiOjF9fQ==",
"amount": "1500000000",
"contract": "terra13dycyqjf8kv0xqqlh2wm5lq98w3lzkptgrt9mj"
}
}
*/
pub fn locked(deps: DepsMut, env... | Rust | 0 |
fx, y, l_epoch_count, l_epoch, idx, len_batch,inter_start_time=fx.client_fx,fx.labels,fx.iter,fx.slocal_ep,fx.idx,fx.len_batch,fx.inter_start_time
if inter_start_time:
inter_end_time = time.time()
print('intermedia data is ',inter_end_time-inter_start_time)
server_start_train=time.time()
d... | Python | 1 |
,facecolor='gold'\
,linestyle='--'\
,linewidth=2"
);
}
#[test]
fn options_text_works() {
let mut icon = SlopeIcon::new();
icon.set_text_color("red").set_fontsize(12.0);
let (opt_x, opt_y) = icon.options_text();
assert_eq!(
opt_x,... | Rust | 0 |
if sizeOfSerialParts > 0 and self.getSizeItemsPerPage(url) > 0:
a = math.ceil(float(sizeOfSerialParts) / float(self.getSizeItemsPerPage(url)))
for i in range(int(a)):
num = i + 1
title = 'Lista ' + str(num)
destUrl = url + sort_asc + '&pa... | Python | 1 |
_LOGGING_SUBSYSTEM_INITIALIZED.load(Ordering::SeqCst) == true {
warn!("cannot run this thes with an initialized logging subsystem, \
run separately using 'cargo test fallback_config'");
}
else {
logging::init_logging(".");
error!("running in {:?}", cur... | Rust | 0 |
nothing unless polled"]
pub struct SpawnFuture<'a, F: Future>(State<'a, F>);
impl<'a, F: Future> SpawnFuture<'a, F> {
pub fn new(handle: Handle<'a>, future: F) -> Self {
SpawnFuture(State::Starting { handle: handle, future: future })
}
}
impl<'a, F> fmt::Debug for SpawnFuture<'a, F>
where F: Futur... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.