text string | label_name string | labels int64 |
|---|---|---|
+ '_' + prettyLabel + '.root'
fullCompareCmd += ' --compRoot=%s' % compRootName
if options.strictPairing:
fullCompareCmd += ' --strictPairing'
if options.verbose:
print("comparing branch %s %s" % (name, obj.label()))
if options.verbose... | Python | 1 |
PE,
stderr=subprocess.DEVNULL,
)
(stdo, _) = pc.communicate()
if pc.returncode == 0:
archpath = stdo.decode().strip()
return "lib/" + archpath
except Exception:
pass
if os.path... | Python | 1 |
tests!(I832, U832, i832);
generate_modinv_tests!(I1024, U1024, i1024);
generate_modinv_tests!(I1216, U1216, i1216);
generate_modinv_tests!(ignore I2048, U2048, i2048);
generate_modinv_tests!(ignore I3072, U3072, i3072);
generate_modinv_tests!(ignore I4096, U4096, i4096);
generate_modinv_tests!(i... | Rust | 0 |
_below(threshold) {
let low_note = notification::low(curr);
log::info!("Sending low power notification after unplug");
if let Err(e) = low_note.show() {
log::error!("failed to send unplugged notification: {}", e)
}
}
}
fn notify_full(curr: &Snapshot) {
let full_note... | Rust | 0 |
pub struct NodeMapping(pub Vec<NodeMapping>);
impl NodeMapping {
#[must_use]
pub fn empty() -> NodeMapping {
NodeMapping(Vec::with_capacity(0))
}
#[must_use]
pub fn singleton(mapping: NodeMapping) -> NodeMapping {
NodeMapping(vec![mapping])
}
}
// Information that is constant... | Rust | 0 |
e @endlink for
/// more information on the layout and winding order of a face.
type Face: ffi::aiFace;
}
impl Face {
/// The indices defining this face.
pub fn indices(&self) -> &[VertexIdx] {
unsafe { prim::slice(self.raw.mIndices, self.raw.mNumIndices) }
}
}
// ++++++++++++++++++++ Verte... | Rust | 0 |
onConf>())).reportMode as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(rlTxGainPhaseMismatchMonConf),
"::",
stringify!(reportMode)
)
);
assert_eq!(
unsafe {
&(*(::core::pt... | Rust | 0 |
# File for GraphQL queries
TEMPLATE_QUERY = """
query searchCatalog($where: ResourceWhereInputWithPropertiesFilter, $take: Int, $skip: Int) {
catalog(where: $where, take: $take, skip: $skip) {
totalCount
data {
id
name
description
resourceType
... | Python | 1 |
/// etc.
fn do_logic(&mut self);
}
/// A struct that manages a stack of scenes.
pub struct SceneManager {
/// Scene stack
scenes: Vec<RcCell<dyn Scene>>
}
impl SceneManager {
/// Create new scene manager instance
pub fn new() -> SceneManager {
SceneManager {
scenes: Vec::n... | Rust | 0 |
self, index_tup: (u32, u32)) -> &Self::Output {
let index = self.calc_index(index_tup.0, index_tup.1);
unsafe { self.as_vec_ref().get_unchecked(index) }
}
}
impl<T: Copy + Sized+fmt::Display > IndexMut<(u32, u32)> for TiledBuffer2D<T> {
fn index_mut(&mut self, index_tup: (u32, u32)) -> &mut Sel... | Rust | 0 |
ctx);
}
}
/// UI Demonstration functions to substitute for unimplemented UI events
mod demo {
use super::{api, state};
/// Step the UI demonstration animation by 1 tick
pub fn tick(fb: &mut state::FrameBuf, ctx: &mut state::Context) {
let fr = ctx.demo_frame;
ctx.demo_frame = (fr + 1)... | Rust | 0 |
import requests
import discord
import platform
import random
import copy
import matplotlib.pyplot as plt
import concurrent.futures
import asyncio
import aiohttp
import pandas as pd
import mplfinance as mpf
import prediction_vote as p
import subprocess
import os
import math
import secrets
import matplotlib.dates as mdat... | Python | 1 |
'''SEGMENTOR_CFG for CGNet'''
from .default_segmentor import SegmentorConfig
'''CGNET_SEGMENTOR_CFG'''
CGNET_SEGMENTOR_CFG = SegmentorConfig(
type='FCN',
num_classes=-1,
benchmark=True,
align_corners=False,
work_dir='ckpts',
eval_interval_epochs=10,
save_interval_epochs=1,
logger_handl... | Python | 1 |
tagged with (@username) or (#issue)";
const HINT: &str = "Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)";
impl LintRule for BanUntaggedTodo {
fn new() -> Box<Self> {
Box::new(BanUntaggedTodo)
}
fn code(&self) -> &'static str {
CODE
}
fn lint_pr... | Rust | 0 |
rams
@staticmethod
def from_alipay_dict(d):
if not d:
return None
o = IndustryChargeInfo()
if 'charge_fee' in d:
o.charge_fee = d['charge_fee']
if 'charge_type' in d:
o.charge_type = d['charge_type']
if 'is_rating_on_switch' in d:
... | Python | 1 |
import itertools
from collections import defaultdict
with open('day08.txt') as fl:
antennas = defaultdict(list)
w, h = 0, 0
for (y, line) in enumerate(fl):
h = max(h, y)
line = line.strip()
for (x, c) in enumerate(line):
w = max(w, x)
if c != '.':
... | Python | 1 |
limiter) = ts.parse() {
delimiters.push(delimiter);
items.push(ts.parse()?);
}
Ok(Self { items, delimiters })
}
}
impl<T: Format, D: Format> Format for NonEmptyItems<T, D> {
fn format(&self, fmt: &mut Formatter) {
fmt.subregion(Indent::CurrentColumn, Newline::Nev... | Rust | 0 |
);
assert_ulps_eq!(v, o);
}
}
#[test]
fn tween_in_out() {
let mut tweener = ExpoInOut::new(0.0..=100.0, 10.0);
for time in 0..=10 {
let time = time as f32;
let our_value = tweener.run(time);
let easer = Expo::ease_in_out(time, 0.0, ... | Rust | 0 |
ts = np.round(points_2d).astype(np.int32)
# image_points = (points_2d + 0.5).astype(np.int32)
uv_ProjEmb = np.zeros((height, width, 2)).astype(np.float32)
depth = np.zeros((height, width, 1)).astype(np.float32)
for i, (x, y) in enumerate(image_points):
if x >= width or y >= height or x < 0 or y ... | Python | 1 |
ir::ExprTup;
pub type Expr = ir::Expr;
pub type ExprCoord = asm::ExprCoord;
pub type Sig = ir::Sig;
#[derive(Serialize, Deserialize, PartialEq, Clone, Debug, Eq, Hash)]
pub enum OpBasc {
Id,
Gnd,
Vcc,
Ext,
Cat,
}
#[derive(Serialize, Deserialize, PartialEq, Clone, Debug, Eq, Hash)]
pub enum OpMach... | Rust | 0 |
from stream_framework.tests.feeds.base import TestBaseFeed
from stream_framework.feeds.memory import Feed
class InMemoryBaseFeed(TestBaseFeed):
feed_cls = Feed
| Python | 1 |
();
for i in 0..n {
for j in 0..n {
if i == j { continue }
// Can safely unwrap here, since the particles share dimensionality
let distance = particles[i].distance_to(&particles[j]).unwrap();
... | Rust | 0 |
, 0.66, 0.76, 0.79, 0.74, 0.63, 0.48, 0.38, 0.37,
],
},
SurfaceMonthlyRadiation {
zone: C2c,
orientation: NE,
beta: 90.0,
gamma: -135.0,
dir: vec![
2.07, 3.65, 13.91, 21.13, 36.74, 52.69, 56.5, 40.35, 21.58, 8.29, 2.... | Rust | 0 |
#!/usr/bin/python3
'''shbang'''
class BaseGeometry:
'''creat geo class'''
pass
| Python | 1 |
def sum_of_three_number(a, b, c=15):
return a + b + c
result = sum_of_three_number(10, 20, 30)
# result = sum_of_three_number(10, 20)
# result = sum_of_three_number(10)
# result = sum_of_three_number()
# result = sum_of_three_number(a=78, c=67)
print(result) | Python | 1 |
#!/usr/bin/python3
"""
Module contains Definition of Class State
"""
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.orm import relationship
Base = declarative_base()
class State(Base):
"""
In... | Python | 1 |
trait Config: frame_system::Config {
/// The overarching event type.
type Event: From<Event> + Into<<Self as frame_system::Config>::Event>;
}
// This pallet's storage items.
decl_storage! {
trait Store for Module<T: Config> as SecurityModule {
/// Integer/Enum defining the current state of the BTC... | Rust | 0 |
a");
assert_eq!(ir.fields.len(), 2);
let algorithm_field = &ir.fields[0];
assert_eq!(algorithm_field.ident, "algorithm");
assert_eq!(algorithm_field.attrs.asn1_type, None);
assert_eq!(algorithm_field.attrs.context_specific, None);
assert_eq!(algorithm_field.attrs.tag_mod... | Rust | 0 |
print(" แแแฅแญแตแ_แแแตแ แญ")
def แแแตแ แญ():
แแแต="qwertyuiopasdfghjklzxcvbnm"
แขแแแต=input("แแแฅแญแถแ แซแตแแก: ")
แแแ=4
แจแฐแแจแจแ_แแแฅแญแต=""
for แแฐแ in แขแแแต:
if แแฐแ in แแแต:
แฆแณ=แแแต.find(แแฐแ)
#print(แฆแณ)
แ แฒแต_แฆแณ=(แฆแณ+แแแ) % len(แแ... | Python | 1 |
0, 0.0, -0.5, -0.5, 0.0, 1.0, 0.0, 0.5, 0.5, 0.0, 0.0, 1.0,
];
device.new_buffer_with_data(
vertex_data.as_ptr() as *const _,
(vertex_data.len() * mem::size_of::<f32>()) as u64,
MTLResourceOptions::CPUCacheModeDefaultCache | MTLResourceOptions::StorageModeManaged,
... | Rust | 0 |
e),
max_length=input_len + seq_len,
do_sample=True,
top_k=top_k,
top_p=1.0
)
texts = tokenizer.batch_decode(output_sequences, skip_special_tokens=True)
for text in texts:
# perplexity of GPT2-XL and G... | Python | 1 |
= "std"))]
use alloc::collections::BTreeMap;
#[cfg(not(feature = "std"))]
type Map<K, V> = BTreeMap<K, V>;
#[derive(Clone)]
pub struct AllocChangeBuff {
data: Vec<u8>,
entry: FatEntryValue,
}
impl ChangeSetEntry for AllocChangeBuff {
fn data(&self) -> &[u8] {
... | Rust | 0 |
set_summary_writer before doing any '
'logging from tensorboard_logging')
_check_verbosity(level)
proto_level = _LEVEL_PROTO_MAP[level]
if proto_level >= _LEVEL_PROTO_MAP[_verbosity]:
log_message = event_pb2.LogMessage(level=proto_level,
message=m... | Python | 1 |
from shinestacker.config.constants import constants
from shinestacker.algorithms.stack_framework import StackJob, CombinedActions
from shinestacker.algorithms.align import AlignFrames
from shinestacker.algorithms.balance import BalanceFrames
def test_hls_gamma():
try:
job = StackJob("job", "examples", inp... | Python | 1 |
def abc ():
return ["hello", "world",
"!"]
print( "Incorrect formatting"
)
| Python | 1 |
into();
let rhs = rhs.into();
Ok(ComparisonOperation::new(
lhs.type_()
.to_primitive()
.ok_or_else(|| BuildError::PrimitiveExpected(lhs.type_().clone()))?,
operator,
lhs.expression().clone(),
rhs.expression().clone(),
))
}
pub fn pointer_address(
... | Rust | 0 |
,
}
)
lower_bounds_array.append(rs.range.start)
upper_bounds_array.append(rs.range.end)
in_bounds_lookup_array.append(res_idx)
res_df = pd.DataFrame(result_array)
# Note: if multiple true values, items higher on the list will be taken pref... | Python | 1 |
//~ ERROR type has conflicting packed and align representation hints
#[repr(align(8))]
#[repr(packed)]
struct H(i32); //~ ERROR type has conflicting packed and align representation hints
#[repr(packed, packed(2))]
struct I(i32); //~ ERROR type has conflicting packed representation hints
#[repr(packed(2))]
#[repr(pac... | Rust | 0 |
s function
let al = cpu.get_r8(R::AL);
println!("DOS - TERMINATE WITH RETURN CODE {:02X}", al);
cpu.fatal_error = true; // XXX just to stop debugger.run() function
}
0x4D => {
// DOS 2+ - GET RETURN CODE (ERRORLEVEL)
... | Rust | 0 |
})
.collect::<Vec<_>>();
Some(Notification::AirportList(data))
}
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_EXCEPTION => {
let event = unsafe { *(data_buf as *const bindings::SIMCONNECT_RECV_EXCEPTION) };
Some(Notificatio... | Rust | 0 |
RAMPOWERDOWN_R::new((self.bits & 0x0f) as u8)
}
}
impl W {
#[doc = "Bits 0:3 - RAM0 Blockset Power-down"]
#[inline(always)]
pub fn rampowerdown(&mut self) -> RAMPOWERDOWN_W {
RAMPOWERDOWN_W { w: self }
}
}
use std::collections::HashMap;
use std::result::Result;
fn add_to_loop(map: &mut H... | Rust | 0 |
#!/usr/bin/env python
""" Font metrics for the Adobe core 14 fonts.
Font metrics are used to compute the boundary of each character
written with a proportional font.
The following data were extracted from the AFM files:
http://www.ctan.org/tex-archive/fonts/adobe/afm/
"""
### BEGIN Verbatim copy of the license... | Python | 1 |
# Continuous: delta_theta error (elevation)
"w_phi": 0.3, # Continuous: phi error (roll angle)
"w_theta": 0.3, # Continuous: theta error (pitch angle)
# Depracated for now, added complexity of very tight goal constraints removed - Erik 30.06.22
... | Python | 1 |
e),
}
})
}
#[no_mangle]
pub extern "C" fn polar_next_query_message(query_ptr: *mut Query) -> *const c_char {
ffi_try!({
let query = unsafe { ffi_ref!(query_ptr) };
if let Some(msg) = query.next_message() {
let msg_json = serde_json::to_string(&msg).unwrap();
CStr... | Rust | 0 |
2)
y_test_tensor = torch.tensor(y_test_np, dtype=torch.float32)
# ใขใใซๆง็ฏใปๅญฆ็ฟ
model = StockRegressor(input_size=X_train_tensor.shape[1])
print("--- ใขใใซๅญฆ็ฟ้ๅง ---")
train_model(model, X_train_tensor, y_train_tensor) # ่จ็ทดใใผใฟใงใขใใซใๅญฆ็ฟ
print("--- ใขใใซๅญฆ็ฟๅฎไบ ---")
# ใในใๅ
ฅๅ (ๅฝๆฅใฎopenใจๅๆฅใฎhigh, low, volume)
... | Python | 1 |
#!/usr/bin/env python
import os
import ConfigParser
import pyami.fileutil
configfilename = 'redux.cfg'
confdirs = pyami.fileutil.get_config_dirs()
config_locations = [os.path.join(confdir, configfilename) for confdir in confdirs]
pyami.fileutil.check_exist_one_file(config_locations)
configparser = ConfigParser.SafeC... | Python | 1 |
"),
content: String::from(
"The Pittsburgh Penguins once again are the best \
hockey team in the NHL.",
),
};
println!("New article available! {}", article.summarize());
println!("Author: {}", article.summarize_author());
let tweet2 = Tweet2 {
username:... | Rust | 0 |
self.items.push_back(x);
}
/// Returns the median element of the window.
/// Returns the greater element when the window size is even.
fn median(&self) -> Option<T> {
let size = self.sorted.len();
if size == 0 {
None
} else {
Some(self.sorted[siz... | Rust | 0 |
_W),
EventCode::EV_KEY(EV_KEY::KEY_E),
EventCode::EV_KEY(EV_KEY::KEY_R),
EventCode::EV_KEY(EV_KEY::KEY_T),
EventCode::EV_KEY(EV_KEY::KEY_Y),
EventCode::EV_KEY(EV_KEY::KEY_U),
EventCode::EV_KEY(EV_KEY::KEY_I),
EventCode::EV_KEY(EV_KEY::KEY_O),
EventCode::EV... | Rust | 0 |
PTCHA service to function correctly.
# The project ID should be obtained from the Google Cloud Console when creating a reCAPTCHA
RECAPTCHA_PROJECT_ID = None
############################## Miscellaneous ###############################
# To limit the number of courses displayed on learner dashboard
DASHBOARD_COURSE... | Python | 1 |
has all the calls available in your runtime.
type Call: Parameter + GetDispatchInfo + Dispatchable<Origin=Self::Origin>;
// The maximum amount of calls an account can make
#[pallet::constant]
type MaxCalls: Get<u32>; // Having MaxCalls as a configuration trait instead of a StorageItem saves one storage read p... | Rust | 0 |
import json
def sort_dict(d):
return {k: v for k, v in sorted(d.items(), key=lambda item: item[1]['profit'], reverse=True)}
router_count = 0
router_stats = {}
from_stats = {}
with open('data/cycle_include_router_with_tx_from1.json') as f:
for line in f:
info = json.loads(line)
_from = info['tx... | Python | 1 |
Save_dir}/{id0}-{id1}.npz',trans=best_trans_ransac, recalltime=recall_time)
R_pre_log(dataset,Save_dir)
class yohoo:
def __init__(self, cfg):
self.cfg = cfg
self.rind_extractor = extractor_dr_index(cfg)
self.localT_extractor = extractor_localtrans(cfg)
self.ransacer = yohoo... | Python | 1 |
Combinatorial),
olmc(PinMode::Combinatorial),
olmc(PinMode::Combinatorial),
olmc_feedback_no_output(),
olmc(PinMode::Combinatorial),
olmc(PinMode::Combinatorial),
olmc(PinMode::Combinatorial),
olmc(PinMode::Combinatorial),
];
... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from vtkmodules.vtkCommonCore import (
vtkFloatArray,
vtkLookupTable,
)
from vtkmodules.vtkCommonDataModel import vtkTable
from vtkmodules.vtkChartsCore import (
vtkChart,
vtkChartXY,
vtkPlotPoints,
)
from vtkmodules.vtkViewsContext2D import v... | Python | 1 |
"""Build the train/test split for the mouse protein dataset.
"""
import os
import pdb
import pandas as pd
import numpy as np
np.random.seed(42)
input_folder = "/home/ec2-user/data/mouse_protein/processed"
df_hpp = pd.read_csv(os.path.join(input_folder, "human_protein_phenotype.csv"))
df_mgi = pd.read_csv(os.path.joi... | Python | 1 |
;
let bucket = captures
.get(1)
.map(|x| x.as_str().to_owned())
.ok_or(FindError::S3Parse)?;
let prefix = captures.get(3).map(|x| x.as_str().to_owned());
Ok(S3Path { bucket, prefix })
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum FindSize {
Equal(... | Rust | 0 |
socket: TcpStream,
addr: SocketAddr,
// packet handling
handler_state: PacketHandlerState,
out_buffer: BytesMut,
in_buffer: BytesMut,
server_tx: Sender<Box<McTask>>,
output_sync: (UnboundedSender<BytesMut>, UnboundedReceiver<BytesMut>),
connection_sync: (
UnboundedSender<Box... | Rust | 0 |
class Solution:
def arraysum(self,num):
return self.sum(num,0)
def sum(self, num,left) :
if left>=len(num):
return 0
return num[left]+self.sum(num,left+1)
if __name__=="__main__":
solution=Solution()
num=[1,3,5]
result=solution.arraysum(num)
... | Python | 1 |
Path(_) => quote! {
copy_of_self.#field_ident.serialize(writer, version_map, app_version)?;
},
syn::Type::Reference(_) => quote! {
copy_of_self.#field_ident.serialize(writer, version_map, app_version)?;
},
_ => panic!("Unsupported field typ... | Rust | 0 |
org/val2017/000000039769.jpg"
lowres_url = "https://4.img-dpreview.com/files/p/TS560x560~forums/56876524/03975b28741443319e9a94615e35667e"
cats_image = Image.open(requests.get(url, stream=True).raw)
lowres_img = Image.open(requests.get(lowres_url, stream=True).raw)
inputs_batched = self... | Python | 1 |
_with_nodes(
commands: &mut Commands,
player: PlayerId,
pos: Position,
vel: Velocity,
nodes: i32,
materials: &Materials,
) -> Entity {
let head = spawn_snake_head(commands, player, pos, vel, materials);
for i in 1..=nodes {
spawn_snake_segment(commands, i, player, pos, materials)... | Rust | 0 |
ๅ ๅ
ถไปๅๅ ๆช่ฝๆต่พพๆๅก็ซฏ๏ผๅ่ฏฅๆฌก่ฏทๆฑไธไผ่ทๅพ RequestId๏ผใๅฎไฝ้ฎ้ขๆถ้่ฆๆไพ่ฏฅๆฌก่ฏทๆฑ็ RequestIdใ
:type RequestId: str
"""
self._Group = None
self._RequestId = None
@property
def Group(self):
return self._Group
@Group.setter
def Group(self, Group):
self._Group = Group
@property
def ... | Python | 1 |
์์ด ์ค๊ทธ๋ผ๋๋ ์ฆ์์ ์๋ค์๋ณ(์ํฉ๋ณ)์ผ๋ก ์ธํ ๊ฒ์ผ๋ก ์ถ์ ๋ฉ๋๋ค.
์ด ๋ณ์ ํนํ ๊ฐ์ ์๋ฌผ์ ์ฐ์ํด์ ์ฌ๋ฐฐํ๋ ์ด์ด์ง๊ธฐ์์ ์์ฃผ ๋ฐ์ํฉ๋๋ค.
๋ํ, ์ฆ์์ด ๋์์ง ๋ ์ฃผ๋ก ๋ฐ์ํ๋ค๊ณ ํ์
จ๋๋ฐ, ์ด๋ ๊ณ ์จ์ด ๋ณ์ ๋ฐ์์ ์ด์งํ ์ ์์์ ์์ฌํฉ๋๋ค.
๐ฟ๋ฐฉ์ ๋ฒ:
1. **๋๋ ค์ง๊ธฐ ์ค์**: ์ญ์ํ๊ณผ๊ฐ ์๋ ๋ค๋ฅธ ์๋ฌผ๋ก ๋๋ ค์ง๊ธฐ๋ฅผ ํ์ฌ ํ ์์ ๋ณ์๊ท ๋๋๋ฅผ ๋ฎ์ถ๋ ๊ฒ์ด ์ค์ํฉ๋๋ค.
2. **ํ ์ pH ์กฐ์ **: ํ ์์ ์ฐ๋๋ฅผ pH 6.5~7.0 ์ ๋๋ก ์ ์งํฉ๋๋ค.
3. **ํ ์ ๊ด๋ฆฌ**: ํ ์ ์ค ๋ฏธ์ธ๋๋ฌผ์ ์ํด ๋ฟ๋ฆฌ... | Python | 1 |
st]
fn part1_finds_most_minus_least_common_elt_count_for_10_steps() {
let sample = vec_of_str(include_str!("../test_inputs/day14.txt"));
let count = part1(&sample);
assert_eq!(1588, count);
}
#[test]
fn part2_finds_most_minus_least_common_elt_count_for_40_steps() {
let sample = vec_of_str(inclu... | Rust | 0 |
.write(&mut w).unwrap();
assert!(<NetworkGraph>::read(&mut io::Cursor::new(&w.0)).unwrap() == *network);
}
#[test]
fn calling_sync_routing_table() {
let (secp_ctx, net_graph_msg_handler) = create_net_graph_msg_handler();
let node_privkey_1 = &SecretKey::from_slice(&[42; 32]).unwrap();
let node_id_1 = Public... | Rust | 0 |
Keycap Number Sign"),
("*โฃ", "*โฃ Keycap Asterisk"),
("0โฃ๏ธ", "0โฃ๏ธ Keycap Digit Zero"),
("1โฃ๏ธ", "1โฃ๏ธ Keycap Digit One"),
("2โฃ๏ธ", "2โฃ๏ธ Keycap Digit Two"),
("3โฃ๏ธ", "3โฃ๏ธ Keycap Digit Three"),
("4โฃ๏ธ", "4โฃ๏ธ ... | Python | 1 |
t map = $map_type::new();
let value = 0usize;
let start_num: u64 = "100000000000000000000000000000000000"[..$min_len].parse().unwrap();
let keys = (0..$map_len).map(|i| {
let key_len = rng.gen_range(0, $max_len - $min_len);
$key_prefix.to_string() +... | Rust | 0 |
eq!(
AuthErrorCode::InvalidRequest,
serde_json::from_str(r#""invalid_request""#).unwrap()
);
assert_eq!(
AuthErrorCode::InvalidClient,
serde_json::from_str(r#""invalid_client""#).unwrap()
);
assert_eq!(
AuthErrorCode::InvalidGra... | Rust | 0 |
item = self.coordinateWidget.horizontalHeaderItem(0)
item.setText(_translate("WaypointWindow", "Lat"))
item = self.coordinateWidget.horizontalHeaderItem(1)
item.setText(_translate("WaypointWindow", "Long"))
item = self.coordinateWidget.horizontalHeaderItem(2)
item.setText(_transl... | Python | 1 |
variant(self, variant: PRAM0_ACCESS_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "PRAM0 access disabled"]
#[inline(always)]
pub fn pram0_access_disable(self) -> &'a mut W {
self.variant(PRAM0_ACCESS_A::PRAM0_ACCESS_DISABLE)
}
#[doc = "PRAM0 access ... | Rust | 0 |
&mut self,
ctx: &mut Context,
runtime: &mut RuntimeInfo,
update: &ActiveLeavesUpdate,
) -> super::Result<()>
where
Context: SubsystemContext,
{
let activated = update.activated.iter().map(|ActivatedLeaf { hash: h, .. }| h);
let activated_sessions =
get_activated_sessions(ctx, runtime, activated).awai... | Rust | 0 |
mut ip: unw_word_t = 0;
let _ret = unw_getcontext(uc.as_mut_ptr());
let _ret = unw_init_local(c.as_mut_ptr(), uc.as_mut_ptr());
let mut backtrace = String::new();
loop {
unw_get_reg(
c.as_mut_ptr(),
UNW_TDEP_IP as :... | Rust | 0 |
RST_CATEGORY_GLYPH_LIMIT: u32 = 0xA0;
const SECOND_CATEGORY_GLYPH_LIMIT: u32 = 0x100;
const THIRD_CATEGORY_GLYPH_LIMIT: u32 = 0x4016;
const FOURTH_CATEGORY_GLYPH_LIMIT: u32 = 0x38E2E;
const UTF_1_MODULO: u32 = 0xBE;
const THIRD_CATEGORY_GLYPH_TERM: u32 = 0xA1;
const FOURTH_CATEGOR... | Rust | 0 |
me.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
return # Inizia il gioco
# Funzione principale del gioco
def game():
running = True
... | Python | 1 |
from typing import Annotated, Optional
from uuid import UUID
from fastapi import APIRouter, Body, Depends, Path, Query
from app.schemas.common.object_created import ObjectCreatedSchema
from app.schemas.create_flat_coin_schema import CreateFlatCoinSchema
from app.schemas.flat_coin_schema import FlatCoinSchema
from app... | Python | 1 |
ta)
p_32.append(p.data)
m_32.append(state['exp_avg'])
else:
raise RuntimeError('FusedLion only support fp16, bf16 and fp32.')
if len(g_16) > 0:
state['step'] += 1
multi_tensor_applier(self.multi_tens... | Python | 1 |
k (markdown triple-backtick, possibly with 'json')
match = re.search(r"```json\s*(\{.*?\})\s*```", output, flags=re.DOTALL)
if not match:
raise ValueError("Could not find recipe JSON in output.")
recipe_json_str = match.group(1)
# Parse JSON
recipe_dict = json.loads(recipe_json_str)
retu... | Python | 1 |
interpreter::sql::node::otherwise_node::OtherwiseNode;
use crate::interpreter::sql::node::string_node::StringNode;
use crate::core::convert::StmtConvert;
use crate::core::db::DriverType;
use crate::interpreter::expr::runtime::ExprRuntime;
#[derive(Clone, Debug)]
pub struct ChooseNode {
pub when_nodes: Option<Vec<N... | Rust | 0 |
': 0.0, '\x13\xcb': 0.0, '\x13\xca': 0.0, '\x13\xc9': 0.0, '\x13\xc8': 0.0, '\x13\xcf': 0.0, '\x13\xce': 0.0, '\x13\xcd': 0.0, '\x13\xcc': 0.0, '\x13\xc3': 0.0, '\x13\xc2': 0.0, '\x13\xc1': 0.0, '\x13\xc0': 0.0, '\x13\xc7': 0.0, '\x13\xc6': 0.0, '\x13\xc5': 0.0, '\x13\xc4': 0.0, '\x13\xbb': 0.0, '\x13\xba': 0.0, '\x13\... | Python | 1 |
, PERCENT_2),
"lighter3" => make_color_lighter(reference, PERCENT_3),
"lighter4" => make_color_lighter(reference, PERCENT_4),
"lighter5" => make_color_lighter(reference, PERCENT_5),
"random" => random_color(),
_ =>
{
// If not then check if it's an RGB value
... | Rust | 0 |
Self::LIST_NAME).unwrap(),
split_to_flac_row: builder.get_object("flac_split-row").unwrap(),
flac_warning_lbl: builder.get_object("flac_warning-lbl").unwrap(),
split_to_wave_row: builder.get_object("wave_split-row").unwrap(),
wave_warning_lbl: builder.get_object("wave_war... | Rust | 0 |
import torch
import torch.nn as nn
import torch.nn.functional as F
try:
from .modules import VideoExtractor, FaceRecognizer, Decoder
except ModuleNotFoundError:
from modules import VideoExtractor, FaceRecognizer, Decoder
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class Lip2Speech(nn.Mo... | Python | 1 |
_subsampled(order, q, eps_fn), eps_fn(order))
for order in orders
])
eps, _, order = tfp.get_privacy_spent(orders, rdp * steps, target_delta=delta)
return eps, order
def skellam_local_stddev(epsilon,
scale,
l2_clip,
num_client... | Python | 1 |
-> Intersection<'a, T> {
Intersection::new(self.a, self.b)
}
/// Prepare the two slices for the _difference_ set operation.
pub fn difference(self) -> Difference<'a, T> {
Difference::new(self.a, self.b)
}
/// Prepare the two slices for the _difference_ set operation.
pub fn sy... | Rust | 0 |
-> u16 {
self.st_shndx.get(endian)
}
#[inline]
fn st_value(&self, endian: Self::Endian) -> Self::Word {
self.st_value.get(endian)
}
#[inline]
fn st_size(&self, endian: Self::Endian) -> Self::Word {
self.st_size.get(endian)
}
}
struct Solution {}
fn search(nums: Ve... | Rust | 0 |
import networkx as nx
import matplotlib.pyplot as plt
from io import BytesIO
import base64
def generate_knowledge_graph_images(kg_result):
"""
Generate images of knowledge graphs from the given result.
Args:
- kg_result (list): List of dictionaries containing the knowledge graph data.
Returns:
... | Python | 1 |
// hhas_symbol_refs_rust::IncludePath::into_doc_root_relative
print_include(ctx, w, inc.clone())?;
}
w.write_all(b"\n}\n")?;
}
Ok(())
}
fn print_symbol_ref_regions<'arena>(
ctx: &Context<'_>,
w: &mut dyn Write,
symbol_refs: &HhasSymbolRefs<'arena>,
) -> Result<()> ... | Rust | 0 |
clone();
let a = Closure::new(move |x| {
hit.set(true);
x + 3
});
assert_eq!(call2(&a), 5);
}
assert!(hit.get());
}
"#)
.file("test.ts", r#"
... | Rust | 0 |
# test_parser.py
from pathlib import Path
from utils import add_package_from_parent_to_context
add_package_from_parent_to_context("fangless_compiler")
from parser import FanglessParser
from lexer import FanglessLexer
from exceptions import ParserError, IndentationMismatchError, LexerError
import sys
from common impor... | Python | 1 |
unwrap();
let params = rpc_params!(*INVALID_CONTRACT_ADDR);
let error = client(addr)
.request::<ContractCode>("starknet_getCode", params)
.await
.unwrap_err();
assert_eq!(ErrorCode::ContractNotFound, error);
}
#[tokio::... | Rust | 0 |
pool_transactions<'a>(
&'a self,
) -> Result<Box<dyn Iterator<Item = Result<Transaction, BitcoinError>> + Send +'a>, BitcoinError>;
async fn wait_for_transaction_metadata(
&self,
txid: Txid,
num_confirmations: u32,
) -> ... | Rust | 0 |
l_module
),
skip_lineno=skip_lineno
)
node.parent.replace(
"from Qt import {key}".format(key=second_level_module)
)
binding_aliases["bindings"].add(binding)
binding_aliases["root_... | Python | 1 |
{1, 0, 0.75}})
// An edges that crosses three cube edges (four faces):
testClipToPaddedFace(t, Point{r3.Vector{1, 0.9, 0.95}}, Point{r3.Vector{-1, 0.95, 0.9}})
testClipToPaddedFace(t, Point{r3.Vector{-1, 0.95, 0.9}}, Point{r3.Vector{1, 0.9, 0.95}})
// Comprehensively test edges that are difficult to ha... | Rust | 0 |
&& mir_structural_match_violation
// FIXME(#73448): Find a way to bring const qualification into parity with
// `search_for_structural_match_violation` and then remove this condition.
&& self.search_for_structural_match_violation(cv.ty).is_some()
{
self... | Rust | 0 |
from . import report_statement_common
from . import activity_statement
from . import detailed_activity_statement
from . import outstanding_statement
from . import activity_statement_xlsx
from . import detailed_activity_statement_xlsx
from . import outstanting_statement_xlsx
| Python | 1 |
from django.urls import path
from .views import CategoriesView
urlpatterns = [
path("categories/", CategoriesView.as_view(), name="categories"),
]
| Python | 1 |
inplace<R>(rng: &mut R, length: u32, amount: u32) -> IndexVec
where R: Rng + ?Sized,
{
debug_assert!(amount <= length);
let mut indices: Vec<u32> = Vec::with_capacity(length as usize);
indices.extend(0..length);
for i in 0..amount {
let j: u32 = rng.gen_range(i, length);
indices.swap... | Rust | 0 |
ldBuilder) {
let cfg = world.config.geo_feature;
for tile in world.tiles.values_mut() {
// Lake
if tile.runoff() >= cfg.lake_runoff_threshold {
tile.add_feature(GeoFeature::Lake);
}
// River exit
// We have to copy this into a ... | Rust | 0 |
ecode::Lt
| Bytecode::Gt
| Bytecode::Le
| Bytecode::Ge
| Bytecode::MutBorrowGlobal(_)
| Bytecode::MutBorrowGlobalGeneric(_)
| Bytecode::ImmBorrowGlobal(_)
| Bytecode::ImmBorrowGlobalGeneric(_)
| Bytecode::Exists(_)
| Bytecode::ExistsGeneric(_)
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.