text string | label_name string | labels int64 |
|---|---|---|
{}
/// Write-only values (empty)
pub mod W {}
/// Read-write values (empty)
pub mod RW {}
}
/// PRIORITY
pub mod PRIORITY {
/// Offset (23 bits)
pub const offset: u32 = 23;
/// Mask (5 bits: 0b11111 << 23)
pub const mask: u32 = 0b11111 << off... | Rust | 0 |
t': f'{SLUG_FORMAT_REGEX}|{SUBDIRECTORY_SLUG_FORMAT_REGEX}',
'error_msg': 'Course edit was unsuccessful. The course URL slug "[{url_slug}]" is an invalid format. Please ensure that the slug is in the format `learn/<primary_subject>/<organization_name>-<course_title>`',
},
'bootcamp-2u': {
... | Python | 1 |
}| j t| jk r| j| j | jd v r\| j| j dvrL|| j| j | j d7 _ q| j| j dkr| j| qqqt|S )z&Skip white space and extract comments.z
rA () rz rU r r{ rW r
getcommentEMPTYSTRINGjoin)r wslistr> r> r? gotonext s zAddrlistClass.go... | Python | 1 |
#[inline(always)]
pub fn reserved9(&mut self) -> RESERVED9_W {
RESERVED9_W { w: self }
}
#[doc = "Bit 8 - 8:8\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn fsm_act(&mut self) -> FSM_ACT_W {
FSM_ACT_W { w: self }
}
#[doc = "Bit 7 - 7:7\\]
... | Rust | 0 |
#!/usr/local/bin/python
#
# interactive JT65.
# runs in a Linux or Mac terminal window.
# user can respond to CQs, but not send CQ.
# optional automatic band switching when not in QSO.
#
# I use jt65i.py with a K3S via USB, automatically switching
# among bands:
# ./jt65i.py -card 2 0 -out 1 -cat k3 /dev/cu.usbserial-... | Python | 1 |
prog[c as usize] = 1;
} else {
prog[c as usize] = 0;
}
ip += 4;
}
8 => {
let a = prog[(ip + 1) as usize];
let b = prog[(ip + 2) as usize];
let c = prog[(ip + 3) a... | Rust | 0 |
// TODO: Support note names once someone requests it
kInvalidArgument
}
unsafe fn get_program_pitch_name(
&self,
_id: i32,
_index: i32,
_pitch: i16,
_name: *mut u16,
) -> tresult {
kInvalidArgument
}
unsafe fn get_selected_unit(&self) -> i32 ... | Rust | 0 |
l.head.parameters():
param.requires_grad = True
print('Linear probing activated')
# Move model to GPU
if cfg['TRAINING']['USE_GPU']:
model_parameters = filter(lambda p: p.requires_grad, model.parameters())
params = sum([np.prod(p.size()) for p in ... | Python | 1 |
"""Реализуйте контекстный менеджер safe_write с помощью декоратора @contextmanager, который принимает один аргумент:
filename — имя файла
Контекстный менеджер должен позволять записывать информацию в файл с именем filename. Причем если во время записи в файл было возбуждено какое-либо исключение, контекстный менеджер ... | Python | 1 |
file(save=True, type='mayaAscii', force=True)
# Ensure the values are correct
self.assertEqual(result[0], 'success=1')
def test_init_ceres_line_search_lbfgs_der_maya_dag(self):
self.do_solve(
'ceres_line_search_lbfgs_der',
mmapi.SOLVER_TYPE_CERES_LINE_SEARCH_LBFGS_D... | Python | 1 |
#[inline]
fn needs_trace() -> bool {
K::needs_trace() || V::needs_trace()
}
#[inline]
fn trace(&self, cc: CollectionContext) {
for (k, v) in self {
k.trace(cc);
v.trace(cc);
}
}
}
unsafe impl<T> Collect for BTreeSet<T>
where
T: Eq + Ord + Co... | Rust | 0 |
,
);
} else {
d.draw_text(
&"Wait".to_string(),
self.units[self.selected_unit].x + 65,
self.units[self.selected_unit].y + 10,
20,
Color::BLACK,
);
}... | Rust | 0 |
import io
from tenacity import retry, stop_after_attempt
from pathlib import Path
from typing import List, Optional
from lazyllm.thirdparty import fsspec
from lazyllm.thirdparty import pypdf
from .readerBase import LazyLLMReaderBase, get_default_fs, is_default_fs
from ..doc_node import DocNode
RETRY_TIMES = 3
class... | Python | 1 |
property(get_blue, set_blue, None, doc)
def __iter__(self):
"""Iterator support. Values are returned in [R,G,B] order
>>> for i in c:
... print i
123
124
125
>>> list(c)
[123, 124, 125]
"""
r = False
g = F... | Python | 1 |
data: i64,
link: Option<Node>
}
fn main() {
let mut c = Node{data: 30, link: None};
println!("{}", c.data);
}
<reponame>fangerm/gelixrs
use indexmap::map::IndexMap;
use lazy_static::lazy_static;
use std::{
fmt,
sync::Mutex,
time::{Duration, Instant},
};
lazy_static! {
pub static ref BENCH:... | Rust | 0 |
;
pub fn derive_enum<'a>(
variants: Vec<ast::Variant<'a>>,
_attr_container: &attr::Container,
) -> quote::Tokens {
let tokens = variants.into_iter().enumerate()
.map(|(variant_idx, variant)| {
let variant_name = variant.attrs.name().serialize_name();
match variant.style {
... | Rust | 0 |
Array,
};
use jni::JNIEnv;
/// Helper struct for Java's Primitives
pub struct Primitive();
impl Primitive {
/// Create a new int[]
pub fn new_int_array(env: &JNIEnv<'_>, ints: &[i32]) -> Result<jintArray> {
let arr = env.new_int_array(ints.len() as i32)?;
env.set_int_array_region(arr, 0, ints)... | Rust | 0 |
tatus());
}
let mut temp = ::tempfile_fast::persistable_tempfile_in(path.parent().unwrap())
.chain_err(|| "creating download temporary file")?;
// TODO: length checks?
io::copy(&mut resp, temp.as_mut())
.chain_err(|| "writing downloaded sources to temporary file... | Rust | 0 |
vent(data)
else:
logger.error("unknown event: %s", data)
except Empty:
pass
if event:
event.session_id = self.session.id
return event
def remove_handlers(self) -> None:
"""
Remove session event handlers for events being wat... | Python | 1 |
except (OSError, BackupError) as exc:
LOG.debug("Failed to backup Postgres. %s", str(exc), exc_info=True)
raise BackupError(str(exc))
@classmethod
def configspec(cls):
"""Provide a specification for the configuration dictionary this
plugin accepts.
"""
... | Python | 1 |
miss_l += 1
if DEBUG:
file_name = coco.loadImgs(ids=[img_id])[0]['file_name']
img = cv2.imread('{}/{}2017/{}'.format(IMG_PATH, split, file_name))
if RESIZE:
img = cv2.resize(img, (w, h))
for t, gt in enumerate(g):
if anns[t]['iscrowd'] > 0:
continue
x... | Python | 1 |
xca\xc5w\xa5\
k\x97:\x1e\xbf\xa0B..\xfcK\xaa\xcdk\xe3\xcd\
#P\x93U\xf10\xd6\xae\xa6Mb\xea\xdbR\xb9\xf1\
\x01\xb0\xbd\x9e\xf4f!nl`\x9b\xa9\xbb\xd1|%\
\x17\xc3\xcb\xb8V\xda?\x10i\x90\xcb\xe7\xf8\x9e;\xeb\
-^[(.\xef#\xf0\xda\xe9~\x19\xf0\xae\x9d-\
\xdc\x1a\xc6\x8d\xaf\xe8\xda\x9b\x98g\xd4|;\xa8Is\
}\xad\xf9V\x12<\xf0\xc4\... | Python | 1 |
from typing import List, Optional
import tsfel
from .extractor import BaseTSExtractor
class TSFEL(BaseTSExtractor):
def __init__(
self,
domains: Optional[List[str]] = None,
verbose: bool = False,
):
# Generate default domain value
"""Initializes the TSFEL feature extr... | Python | 1 |
# sample from DATA_SOURCE every SUBSAMPLE_RATE episode and store under /mnt/data/expert_trajs/DATA_SIZE
# take all val episodes
import os
import shutil
import sys
from tqdm import tqdm
DATA_SIZE = sys.argv[1] if len(sys.argv) >= 4 else 'small'
SUBSAMPLE_RATE = eval(sys.argv[2]) if len(sys.argv) >= 4 else 100
DATA_SOU... | Python | 1 |
# Sebastian Raschka 2014-2017
# mlxtend Machine Learning Library Extensions
#
# A function for searching files in local directories.
# Author: Sebastian Raschka <sebastianraschka.com>
#
# License: BSD 3 clause
import os
def find_files(substring, path, recursive=False,
check_ext=None, ignore_invisible=... | Python | 1 |
self[3] = self[3] + rhs[3];
}
}
impl<T: Copy + Clone + Sub<Output = T>> Sub for Mat4x4<T> {
type Output = Mat4x4<T>;
fn sub(self, rhs: Self) -> Mat4x4<T> {
Mat4x4 {
m: [
self[0] - rhs[0],
self[1] - rhs[1],
self[2] - rhs[2],
... | Rust | 0 |
let reader = BufReader::new(file);
let input: Vec<_> = reader
.lines()
.filter_map(Result::ok)
.map(|line| process_line(&line))
.collect();
Ok(input)
}
fn main() -> std::io::Result<()> {
let filepath = Path::new("./input/input.txt");
let input = read_input(filepath)?... | Rust | 0 |
checker.verify_unconditional_abort();
checker.verify_jmp_pad();
checker.verify_node_type(RawNodeType::Additional, additional_node_bytes);
checker.verify_jmp_if_equal(
UNCOND_ABORT_BYTES,
EncodedValue { value_type: RawValueType::NumberValue, value: 10 },
Encod... | Rust | 0 |
import geopandas
import numpy
from ... import examples
from .. import gabriel
path = examples.get_path("columbus.shp")
df = geopandas.read_file(path)
geoms = df.geometry.centroid
coords = numpy.column_stack((geoms.x, geoms.y))
def test_delaunay():
a = gabriel.Delaunay(coords)
b = gabriel.Delaunay.from_dataf... | Python | 1 |
y(clippy::panic)]
#![deny(clippy::perf)]
#![deny(clippy::nursery)]
#![deny(clippy::needless_update)]
#![deny(clippy::match_like_matches_macro)]
#![deny(clippy::from_over_into)]
#![deny(clippy::useless_conversion)]
#![allow(clippy::module_name_repetitions)]
#![allow(clippy::missing_errors_doc)]
#![allow(clippy::upper_ca... | Rust | 0 |
INFO; PROCESSOR_IDLESTATE_POLICY_COUNT],
}}
pub type PPROCESSOR_IDLESTATE_POLICY = *mut PROCESSOR_IDLESTATE_POLICY;
pub const PO_THROTTLE_NONE: DWORD = 0;
pub const PO_THROTTLE_CONSTANT: DWORD = 1;
pub const PO_THROTTLE_DEGRADE: DWORD = 2;
pub const PO_THROTTLE_ADAPTIVE: DWORD = 3;
pub const PO_THROTTLE_MAXIMUM: DWORD ... | Rust | 0 |
constant 10
pop static 0
label LOOP
call Sys.incr 0
pop temp 0
goto LOOP
return
function Sys.incr 0
push static 0
push constant 1
add
pop ... | Rust | 0 |
const NISysCfgStatus_NISysCfg_TopLevelHiddenComponentError: NISysCfgStatus = -2147220285;
pub const NISysCfgStatus_NISysCfg_InvalidAddon: NISysCfgStatus = -2147220284;
pub const NISysCfgStatus_NISysCfg_NoRTImagesFolder: NISysCfgStatus = -2147220283;
pub const NISysCfgStatus_NISysCfg_NoRTImagesRegistry: NISysCfgStatus =... | Rust | 0 |
if key == 'key':
return self._key
elif key == 'fields':
return WrappedDictionary(self._fields)
return None
# }}}
# {{{ getitem(key) - Get item from issue
def __getitem__(self, key):
return self.__getattr__(key)
# }}}
# {{{ str... | Python | 1 |
no cover # 这个分支是一个保险分支,通常无法执行,所以只进行记录
_logger.error(
f"{e} when close ws connection. client: {client_to_server_task}, server:{server_to_client_task}"
)
raise
finally:
# 无论如何,确保关闭两个websocket
# 状态码参考: https://developer.mozilla.org/zh-CN/docs/Web/API/CloseEvent
... | Python | 1 |
arse("{1}", &[Variant::Int(42)], &NoNamedArguments));
}
#[test]
fn missing_named_arg() {
assert_eq!(Err(0), parse("{arglebargle}", &NoPositionalArguments, &NoNamedArguments));
}
#[test]
fn missing_positional_width() {
assert_eq!(
Err(0),
parse("{:1$}", &[Variant::Int(42)], &NoNamedArguments)
... | Rust | 0 |
import asyncio
import aio_pika
import aiormq
RECEIVED_URLS = []
async def on_url(message):
global RECEIVED_URLS
decoded_body = message.body.decode('utf-8')
print(f"Received URL: {decoded_body}")
RECEIVED_URLS.append(decoded_body)
await asyncio.sleep(0.1) # Simulate some processing time
async def... | Python | 1 |
d=10**9+7
q={1:1,2:1,3:2,4:3,5:5}
def p(n):
if n not in q:q[n]=(p(n//2)**2+p(n//2+1)**2)%d if n%2==1 else(p(n+1)-p(n-1))%d
return q[n]
print(p(int(input()))) | Python | 1 |
import torch
from PIL import Image
from torchvision.transforms import transforms
from torchvision.models import resnet18
import matplotlib.pyplot as plt
import os
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0... | Python | 1 |
lose(out.get(), hostOut.astype(dtype), atol=atol)
out = module.matvec(A, w, axis=0)
hostOut = np.empty(out.shape, dtype=np.float32)
for i in range(hostA.shape[0]):
np.dot(hostA[i].T.astype(np.float32), hostW[i].astype(np.float32), out=hostOut[i])
assert np.allclose(out.get(), hostOut.astype(dtype), atol=atol)
... | Python | 1 |
import re
from ..symbols import NORM, ORTH
from .char_classes import ALPHA_LOWER
# URL validation regex courtesy of: https://mathiasbynens.be/demo/url-regex
# and https://gist.github.com/dperini/729294 (Diego Perini, MIT License)
# A few mods to this regex to account for use cases represented in test_urls
URL_PATTERN... | Python | 1 |
)
image.save('code.jpg', 'jpeg')
fig=plt.figure(dpi=150,figsize=(10,6))#分辨率,画布大小
im1=Image.open(imagepath)
im1=np.array(im1)#获得numpy对象,RGB
#print(type(im1))
#print(im1.shape)
xticks = [220, 620, 1020, 1420, 1820, 2220, 2620, 3020, 3420, 3820, 4220, 4620, 5020, 5420, 5820, 6220, 6620, 7020, 7420, 7820, 8220]
xticklabes ... | Python | 1 |
, data_8_bytes: int) -> dict:
"""Get data 8 bytes CAN message for sending.
Returns:
dict: message.
"""
return self._get_message(name="f_BootloaderData8Bytes", Data=data_8_bytes)
def get_message_crc_8_bytes(self, crc_8_bytes: int) -> dict:
"""Get CRC 8 bytes CAN ... | Python | 1 |
to `cons`".to_string());
None
} else {
let value = &args[0];
let rest = &args[1];
match value {
Value::List(value) => match rest {
Value::List(l) => {
let mut l = l.clone();
let mut v = value.clone();
... | Rust | 0 |
plit('/').collect();
if ipv4_string_vector.len() != 2 {
return Err(format_err!("Invalid IP format. Please use CIDR notation"));
}
let prefix = match ipv4_string_vector[1].parse() {
Ok(n) => n,
Err(_err) => return Err(format_err!("Cannot parse IP prefix")),
... | Rust | 0 |
ithm which is by far the most advanced
//! feature in all lyon crates.
//!
//! The FillTessellator takes a [FillEvents](struct.FillEvents.html) object and
//! [FillOptions](struct.FillOptions.html) as input. The former is an intermediate representaion
//! of the path, containing all edges sorted from top to bottom. Fil... | Rust | 0 |
{
let _ = rt.block_on(http_handle)?;
}
std::mem::drop(metrics_runtime);
if let Some((stop_signal_handler, join_handle)) = scrape_handle {
stop_signal_handler.send(())?;
join_handle.join().expect("join() failed.");
}
Ok(())
}
fn make_poll_loop(
log: slog::Logger,
ic... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
# mypy: disable-error-code="type-arg"
from cmk.gui... | Python | 1 |
\n"),
Some((Version::HTTP_09, StatusCode::OK,))
);
assert_eq!(
parse_status_line(b"HTTP/1.0 500 Internal Server Error\r\n"),
Some((Version::HTTP_10, StatusCode::INTERNAL_SERVER_ERROR,))
);
assert_eq!(
parse_status_line(b"HTTP/1.1 404 not fo... | Rust | 0 |
t).into(),
ResolvAddr::resolve_or_exit,
);
let daemon_p2p_addr: SocketAddr = config.daemon_p2p_addr.map_or(
(DEFAULT_SERVER_ADDRESS, default_daemon_p2p_port).into(),
ResolvAddr::resolve_or_exit,
);
let electrum_rpc_addr: SocketAddr = config.electrum_rp... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .app_recommend_rule import AppRecommendRule
class ListAppRecommendRuleResponseBody(object):
_types = {
"rules": List[AppRecommendRule],
"pa... | Python | 1 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from amazon.opentelemetry.distro._aws_metric_attribute_generator import _AwsMetricAttributeGenerator
from amazon.opentelemetry.distro.aws_metric_attributes_span_exporter import AwsMetricAttributesSpanExporter
from... | Python | 1 |
n::Flag(0))
]
);
let cli = Cli::tokenize(args(vec!["orbit", "--help", "-v"]));
assert_eq!(cli.tokens, vec![
Some(Token::Flag(0)),
Some(Token::Switch(1, 'v'))
],
);
let cli = Cli::tokenize(args(vec!["orbit", "new", "rary.gates"]))... | Rust | 0 |
l!(<'a, T>(a: $matrix_type<T>, b: &'a T) -> $matrix_type<T> {
let mut a = a;
for value in a.values_mut() {
*value = b.inlined_clone() * value.inlined_clone();
}
a
});
impl_mul!(<T>(a: $matrix_type<T>, b: T) -> $matrix_type<T> {
... | Rust | 0 |
use Factory::*;
match self {
Candle => Source::new(RGB::from_u8(255, 127, 0), 6, 256),
Torch => Source::new(RGB::from_u8(255, 127, 0), 10, 384),
Moss => Source::new(RGB::from_u8(83, 223, 83), 6, 8),
Deadlights => Source::new(RGB::from_u8(192, 192, 218), 5, 19... | Rust | 0 |
t/ - macOS source files")
if os.path.exists('icon.icns'):
print("✓ icon.icns - macOS icon")
else:
print("! icon.icns - Create manually with:")
print(" iconutil -c icns icon.iconset -o icon.icns")
print(" or use https://iconverticons.com/online/")
... | Python | 1 |
_geo_box_meta_invalid_coord.json").is_err());
}
#[test]
fn test_meta_box_missing_coord() {
assert!(load_meta("pangaea_geo_box_meta_missing_coord.json").is_err());
}
#[test]
fn test_meta_lat_lon() {
let md = load_meta("pangaea_geo_lat_lon_meta.json").unwrap();
match &md.... | Rust | 0 |
sNotMatch;
}
Matches
}
/// https://www.w3.org/TR/CSP/#match-ports
fn port_part_match(port_a: &str, port_b: &str, scheme_b: &str) -> MatchResult {
if port_a.is_empty() {
if port_b == default_port_str(scheme_b) {
return Matches;
} else {
return DoesNotMatch;
}
... | Rust | 0 |
ount {
match self {
InputRing::Signable(ring) => &ring.input_secret.amount,
InputRing::Presigned(ring) => &ring.pseudo_output_secret.amount,
}
}
}
/// The secrets corresponding to an output that we are trying to authorize
/// creation of
#[derive(Clone, Debug, Zeroize)]
#[ze... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from sympy import symbols, exp
# Define symbolic variables
x, a = symbols('x a')
# Define the expression and integrate
expression = x * exp(a * x)
integral_result = (1 / a**2) * (a * x - 1) * exp(a * x)
# Define the x v... | Python | 1 |
from odoo import models, fields, api
import datetime
class Singer(models.Model):
#_name = "infomusic.singer"
_inherit = "infomusic.singer"
country_of_birth = fields.Many2one(comodel_name="res.country", string="pais de nacimiento")
photo = fields.Image("foto del cantante", max_width=150, max_height=150)
... | Python | 1 |
l!(YabsErrorKind::Command(cmd.to_owned(), command.status.code().unwrap_or(1)));
}
print!("{}", String::from_utf8(command.stdout)?);
Ok(())
}
pub fn spawn_cmd(cmd: &str) -> Result<Child, YabsError> {
Ok(Command::new("sh").arg("-c").arg(&cmd).spawn()?)
}
pub trait PrependEach<T> {
fn prepend_each(&s... | Rust | 0 |
* z,
m[2][0] * x + m[2][1] * y + m[2][2] * z,
)
}
}
impl<'a, T> Mul<Point3<T>> for &'a Transform<T>
where
T: FloatValueType,
{
type Output = Point3<T>;
fn mul(self, other: Point3<T>) -> Point3<T> {
let m = &self.m.m;
let x = other.x;
let y = other.y;
... | Rust | 0 |
from pathlib import Path
import pytest
import requests
import caption_contest_data as ccd
root = Path(__file__).absolute().parent.parent.parent
exps = root / "contests" / "info"
@pytest.mark.parametrize("path", [str(x) for x in exps.glob("*") if x.is_dir()])
def test_dir(path):
p = Path(path)
files = [x.na... | Python | 1 |
{
pub(crate) fn new(value: PgValue<'de>) -> crate::Result<Self> {
let mut data = value.try_get()?;
let element_oid = match data {
PgData::Binary(ref mut buf) => {
// number of dimensions of the array
let ndim = buf.get_i32::<BE>()?;
if n... | Rust | 0 |
from __future__ import annotations
def validate_node_input(
received_type: str, input_type: str, strict: bool = False
) -> bool:
"""
received_type and input_type are both strings of the form "T1,T2,...".
If strict is True, the input_type must contain the received_type.
For example, if received_... | Python | 1 |
{
Ok(_) => Report::new("O", "Discord"),
Err(e) => Report::new("X", "Discord").update_reason(&e),
};
Table::new(vec![desktop_message, slack_message, discord_message])
.with(Style::modern())
.to_string()
}
// Copyright 2021 Parallel Finance Developer.
// This file is part of Para... | Rust | 0 |
import tkinter as tk
from tkinter import messagebox
class FinanceTracker:
def __init__(self, root):
self.root = root
self.root.title("Personal Finance Tracker")
# Initialize variables
self.balance = 0
# Create UI elements
self.income_label = tk.Labe... | Python | 1 |
from typing import List
import pydantic
import requests
class Token(pydantic.BaseModel):
address: str
symbol: str
name: str
class TxnVolume(pydantic.BaseModel):
buys: int
sells: int
class TxnVolumeByPeriod(pydantic.BaseModel):
m5: TxnVolume
h1: TxnVolume
h6: TxnVolume
h24: Txn... | Python | 1 |
Import("env")
# Add semihosting feature
env.Append(
LINKFLAGS=["--specs=rdimon.specs"],
LIBS=["rdimon"]
) | Python | 1 |
ME_FLUENT_COLORS_LIGHT: &str =
include_str!("../../../assets/themes/fluent/theme_fluent_colors_light.ron");
/// The font resources of the Fluent theme.
pub const THEME_FLUENT_FONTS: &str =
include_str!("../../../assets/themes/fluent/theme_fluent_fonts.ron");
/// Segeo Icon Font map.
pub const MDL2_ASSETS_ICON... | Rust | 0 |
comes),
"outcome_tags": market.outcome_tags.to_vec(),
"categories": market.categories.to_vec(),
"end_time": U64(market.end_time),
"creator_fee_percentage": U128(market.creator_fee_percentage),
"resolution_fee_percentage": U128(market.resolution_fee_percentage),
"affiliate_fee_percentage": U128(m... | Rust | 0 |
ategorical_features()
task_example.task_mask[5] = 1
# assert task_example.task_mask == [0, 0, 0, 0, 0, 1]
task_example.example_id = base_example.example_id + f"-5-{slot_id}-0"
task_example.example_id_num = base_example.examp... | Python | 1 |
_R::new(((self.bits >> 20) & 0x03) as u8)
}
#[doc = "Bits 24:25 - External Interrupt 6 Pin Select"]
#[inline(always)]
pub fn extipinsel6(&self) -> EXTIPINSEL6_R {
EXTIPINSEL6_R::new(((self.bits >> 24) & 0x03) as u8)
}
#[doc = "Bits 28:29 - External Interrupt 7 Pin Select"]
#[inline(a... | Rust | 0 |
///
/// # Panics
///
/// Panics if `point` is outside the display.
pub fn get_pixel(&self, point: Point) -> C {
self.point_to_index(point)
.and_then(|index| self.pixels.get(index).copied())
.expect("can't get point outside of display")
}
fn point_to_index(&s... | Rust | 0 |
from game.mapa import Mapa
from game.jugador import Jugador
from game.variacionesEnemigos import Esqueleto, Bruja, Golem
from game.objetos.variacionesHabilidad import AtaqueBasico, Congelacion
from game.objetos.variacionesBuff import BuffFuerza, BuffRegeneracion
from estructuras.lista import Lista
from estructuras.cola... | Python | 1 |
efault=True,
help='Include MACD analysis (default: True)'
)
parser.add_argument(
'--include-hypotheses',
action='store_true',
default=True,
help='Include hypothesis testing (default: True)'
)
parser.add_argument(
'--no-macd',
action='stor... | Python | 1 |
alse):
if reverse:
x, sldj = self.coup(x, sldj, reverse)
x, sldj = self.conv(x, sldj, reverse)
x, sldj = self.norm(x, sldj, reverse)
else:
x, sldj = self.norm(x, sldj, reverse)
x, sldj = self.conv(x, sldj, reverse)
x, sldj = self.co... | Python | 1 |
mapped.
/// - Setting registers incorrectly can cause interrupts to behave unexpected.
unsafe fn set_lvt_register(offset: usize, register: LVTRegister) {
set_register(offset, register.0);
}
/// Issues an interrupt to the current CPU.
pub fn issue_self_interrupt(vector: u8) {
issue_interrupt(InterruptDestinati... | Rust | 0 |
t.configurations {
let mut array_1930 = object.key("Configurations").start_array();
for item_1931 in var_1929 {
{
let mut object_1932 = array_1930.value().start_object();
crate::json_ser::serialize_structure_crate_model_aws_s3_bucket_notification_configuration... | Rust | 0 |
ey: K, value: V) -> Self {
Self { key, value }
}
}
impl<K: PartialEq, V> PartialEq for Leaf<K, V> {
fn eq(&self, other: &Self) -> bool {
self.key == other.key
}
}
impl<K: Eq, V> Eq for Leaf<K, V> {
}
impl<K: PartialOrd, V> PartialOrd for Leaf<K, V> {
fn partial_cmp(&self, other: &Self... | Rust | 0 |
messenger(&messenger_ci, None)
.expect("Debug Utils Callback")
}
}
};
DebugUtils {
device: gpu.device.clone(),
enable_messenger_callback,
ext,
debug_messenger,
}
}
fn set_object_name(&se... | Rust | 0 |
1_07, signal: Sck, daisy: DAISY_LPSPI4_SCK_GPIO_B1_07);
spi!(module: U4, alt: 3, pad: GPIO_B0_03, signal: Sck, daisy: DAISY_LPSPI4_SCK_GPIO_B0_03);
spi!(module: U4, alt: 1, pad: GPIO_B1_06, signal: Sdo, daisy: DAISY_LPSPI4_SDO_GPIO_B1_06);
spi!(module: U4, alt: 3, pad: GPIO_B0_02, signal: Sdo, daisy: DAISY_LPSPI4_S... | Rust | 0 |
= null;
@(_ => el = _)
class A {}
expect(el).toEqual(Object.defineProperty({
kind: "class",
elements: []
}, Symbol.toStringTag, { value: "Descriptor" }));
@(_ => el = _)
class B {
foo = 2;
static bar() {}
get baz() {}
set baz(x) {}
}
expect(el.elements).toHaveLength(3);
"#
);
// duplicated_keys_create_... | Rust | 0 |
},
frame::Frame,
};
/// Shell frame.
pub struct ShellFrame {
frame: Frame,
cmd_buffer: String,
active: bool,
blink_time: Instant,
cursor_shown: bool,
}
impl ShellFrame {
/// Create new frame.
pub fn new(rect: Rect) -> Self {
Self {
frame: Frame::new(rect, "SHELL"),
... | Rust | 0 |
message.to_string()));
String::from("")
}
}
}
)
}
#[macro_export]
macro_rules! expect_string_literal {
($next:ident, $parser_context:ident, $message:expr) => (
{
let token = $next.token;
match token {
Token... | Rust | 0 |
xce, 0x00,
0x5f, 0xf1, 0x83, 0xd7, 0xbb, 0x14, 0x95, 0x20, 0x72, 0x36, 0x64,
0x70, 0x37, 0x00, 0x2b, 0x00, 0x03, 0x02, 0x03, 0x04, 0x00, 0x0d,
0x00, 0x20, 0x00, 0x1e, 0x04, 0x03, 0x05, 0x03, 0x06, 0x03, 0x02,
0x03, 0x08, 0x04, 0x08, 0x05, 0x08, 0x06, 0x04, 0x01, 0x05, 0x0... | Rust | 0 |
import turtle as t
import random
tim = t.Turtle()
########### Challenge 4 - Random Walk ########
colours = ["CornflowerBlue", "DarkOrchid", "IndianRed", "DeepSkyBlue", "LightSeaGreen", "wheat", "SlateGray", "SeaGreen"]
directions = [0, 90, 180, 270]
tim.pensize(15)
tim.speed("fastest")
for _ in range(200):
tim.c... | Python | 1 |
.nth(0)
.unwrap_or(format!("0x{:X}", self.edid.header.serial))
}
}
impl fmt::Display for ConnectedOutput {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "output {} vendor {} product {} serial {}", self.name, self.vendor(), self.product(), self.serial())
}
}
pub trait Backend {
fn list_outp... | Rust | 0 |
ge Base에서 문서 검색
context_docs = search_knowledge_base(prompt)
# 검색 결과 디버깅 정보 표시
if context_docs:
if language_code == "English":
st.caption(f"🔍 Found {len(context_docs)} documents from Knowledge Base")
else:
st.caption(f"🔍 Knowledg... | Python | 1 |
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""All public utility methods for exporting Estimator to SavedModel.
This file includes functions and constants from core (model_utils) and export.py
"""
from __future__ import print_func... | Python | 1 |
asm.jit(
self.jit_info.stacksize(),
JitDescriptor::DoraFct(self.fct.id),
self.ast.throws,
);
jit_fct
}
}
impl<'a, 'ast> visit::Visitor<'ast> for AstCodeGen<'a, 'ast> {
fn visit_stmt(&mut self, s: &'ast Stmt) {
match *s {
StmtExpr(ref stmt... | Rust | 0 |
from .pyheck import *
__doc__ = pyheck.__doc__
| Python | 1 |
from typing import Any, Dict, Optional
from .errors import HAMError
from .vector_clock import VectorClock, validate_type, validate_vector_clock
class State:
@staticmethod
def is_state(node: Dict[str, Any], key: str) -> bool:
validate_type(node, dict)
validate_type(key, str)
return (node... | Python | 1 |
# Python program for implementation of heap Sort
# To heapify subtree rooted at index i.
# n is size of heap
def heapify(arr, n, i):
largest = i # Initialize largest as root
l = 2 * i + 1 # left = 2*i + 1
r = 2 * i + 2 # right = 2*i + 2
# See if left child of root exists and is
# greater than r... | Python | 1 |
.generate(**unconditional_inputs, max_new_tokens=256)
```"""
last_hidden_state = torch.zeros(
(num_samples, 1, self.config.text_encoder.hidden_size), device=self.device, dtype=self.dtype
)
attention_mask = torch.zeros((num_samples, 1), device=self.device, dtype=torch.long)
... | Python | 1 |
# =========== Encoding Files =========== #
# When you run the unencoded example you will notice that the output displays strange characters.
# This can be fixed by specifying the encoding scheme, UTF-8 or UTF-8-SIG, as an additional arugment to the open() function.
# utf-8-sig is a variation of the utf-8 encoding tha... | Python | 1 |
de.skip_nt, progress_bar=False)
for i in range(0, pde.nt):
grid.run(pde.sample_rate, progress_bar=False)
d_field_.append(grid.E[outer_area:-outer_area, outer_area:-outer_area, outer_area:-outer_area, :].copy())
h_field_.append(grid.H[outer_area:-outer_area, outer_area:-outer_... | Python | 1 |
atures: `\"Win32_Media_Multimedia\"`*"]
pub const MM_OPTI_P16_MIDIOUT: u32 = 18u32;
#[doc = "*Required features: `\"Win32_Media_Multimedia\"`*"]
pub const MM_OPTI_P16_MIXER: u32 = 21u32;
#[doc = "*Required features: `\"Win32_Media_Multimedia\"`*"]
pub const MM_OPTI_P16_WAVEIN: u32 = 19u32;
#[doc = "*Required features: ... | Rust | 0 |
_value())
* (1.0 - self.availability.num_value()));
let impact = if scope_changed {
7.52 * (iss - 0.029) - 3.25 * (iss - 0.02).powf(15.0)
} else {
6.42 * iss
};
Score::from(impact)
}
fn expoitability_score(&self) -> Score {
Score::... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.