text string | label_name string | labels int64 |
|---|---|---|
in pattern"),
},
// TODO: Confirm that rustc introduces this pattern only for primitive derefs
box PatKind::Deref { subpattern } => self.extract_pattern(subpattern, binder),
_ => self.unsupported_pattern(pattern.span, "Unsupported kind of pattern"),
}
}
fn extract_subpatterns(
&m... | Rust | 0 |
self.topology_props = props.clone();
self.topology_decoded = Some(TopologyID {
socket: (self.x2apic_id & self.topology_props.socket.mask) >> self.topology_props.socket.shift,
core: (self.x2apic_id & self.topology_props.core.mask) >> self.topology_props.core.shift,
thread:... | Rust | 0 |
hat
const MSG_TRUNC = 0x20; // Return the real length of the packet or datagram
const MSG_DONTWAIT = 0x40; // Nonblocking io
const MSG_WAITALL = 0x0100; // Wait for a full request
const MSG_ERRQUEUE = 0x2000; // Fetch message from error... | Rust | 0 |
-> SEXP;
pub fn CLOENV(x: SEXP) -> SEXP;
pub fn RDEBUG(x: SEXP) -> ::libc::c_int;
pub fn RSTEP(x: SEXP) -> ::libc::c_int;
pub fn RTRACE(x: SEXP) -> ::libc::c_int;
pub fn SET_RDEBUG(x: SEXP, v: ::libc::c_int) -> ();
pub fn SET_RSTEP(x: SEXP, v: ::libc::c_int) -> ();
pub fn SET_RTRACE(x: SEXP... | Rust | 0 |
t_ok!(result);
assert_eq!(&stdout.get_ref()[0..2], b"8\n");
}
#[test]
fn milestone_5_main() {
let bytecode = vec![
Alloca(Type::Int32),
PushInt32(0),
Store(Type::Int32, 0),
PushInt32(3),
Alloca(Type::Int32),
Store(Type:... | Rust | 0 |
PnL по сделкам
pnl_trades = [t for t in self.trades if 'pnl' in t]
if pnl_trades:
pnls = [t['pnl'] for t in pnl_trades]
winning_trades = [p for p in pnls if p > 0]
losing_trades = [p for p in pnls if p < 0]
... | Python | 1 |
* * `needle` - The string to search for
*
* # Return value
*
* `Some` containing the byte index of the first matching substring
* or `None` if there is no match
*/
fn find_str(&self, needle: &str) -> Option<uint> {
if needle.is_empty() {
Some(0)
} else... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
dsk_metrics.py
Different functions to plot DeepSurvK metrics.
"""
import matplotlib as mpl
from matplotlib import pyplot as plt
import seaborn as sns
__all__ = ['plot_loss']
#%%
# A few tweeks to make plots pretty.
sns.set(style="whitegrid")
sns.set(font_scale=1.25)
sns.set_style('ticks'... | Python | 1 |
let aligned = hdr.version == CONST_ALIGNED_FILE_VERSION;
let pos = stream_len - i.len();
// Align input
if aligned && hdr.num_states > 0 && pos % CONST_ARCH_ALIGNMENT > 0 {
i = take(CONST_ARCH_ALIGNMENT - (pos % CONST_ARCH_ALIGNMENT))(i)?.0;
}
let (mut i, const_s... | Rust | 0 |
test]
fn test_d07_p1_proper() {
let input = generate_input(&read_to_string("./input/2015/day7.txt").unwrap());
let result = solve_part_1(&input);
assert_eq!(956, result);
}
#[test]
fn test_d07_p2_proper() {
let input = generate_input(&read_to_string("./input/2015/day7.tx... | Rust | 0 |
{
match self.remove_inner(k, guard) {
Ok(n) => return n,
Err(_) => backoff.spin(),
}
}
}
#[inline]
fn compute_if_present_inner<F>(
&self,
k: &T,
remapping_function: &mut F,
_guard: &Guard,
) -> Result<Optio... | Rust | 0 |
2
);
assert_eq!(
validator_1_unbond_list_before[1].amount(),
&U512::from(UNDELEGATE_AMOUNT_3)
);
let validator_2_unbond_list = unbond_purses_before
.get(&*VALIDATOR_2)
.cloned()
.expect("should have unbond");
assert_eq!(validator_2_unbond_list.len(), 1); // ... | Rust | 0 |
clippy::decimal_literal_representation,
//TODO clippy::doc_markdown,
clippy::empty_enum,
clippy::option_expect_used,
clippy::expl_impl_clone_on_copy,
clippy::explicit_into_iter_loop,
clippy::explicit_iter_loop,
clippy::fallible_impl_from,
clippy::filter_map,
clippy::filter_map_next... | Rust | 0 |
__version__ = "0.1.0"
__author__ = "Your Name"
__email__ = "your.email@example.com"
| Python | 1 |
'HD'
else: q = 'SD'
#host = re.findall('">(.+?)\.',data[0], re.DOTALL )[0]
valid, host = source_utils.is_host_valid(url, hostDict)
lang, info = 'es', 'LAT'
sources.append(
{'source': host, 'quality': q, 'language': lang, 'url': url, 'info'... | Python | 1 |
type)
test_kvstore('local_allreduce_cpu', stype)
test_kvstore('local_allreduce_device', stype)
## compression for local kvstore happens only when reduce is on device
test_compress_kvstore('local_allreduce_device', '1bit', -.5)
test_compress_kvstore('local_allreduce_device', '1bit', 0)
t... | Python | 1 |
class Solution:
def numSubmatrixSumTarget(self, matrix: List[List[int]], target: int) -> int:
m = len(matrix)
n = len(matrix[0])
ans = 0
# Transfer each row of matrix to prefix sum
for row in matrix:
for i in range(1, n):
row[i] += row[i - 1]
for baseCol in range(n):
for ... | Python | 1 |
from romer_minirobot.robot import MiniRobot
from romer_minirobot.modules import robot, Bool
from pynput import keyboard
import time
# Multicast group details
MULTICAST_GROUP = '224.0.0.252'
MULTICAST_TOPIC_PORT = 5007
class KeyboardControl():
def __init__(self, robot, x_linear_speed, z_angular_speed):
se... | Python | 1 |
# first party
from delphi.epidata.common.integration_test_base_class import DelphiTestBase
class DengueNowcastTest(DelphiTestBase):
"""Basic integration tests for dengue_nowcast endpint."""
def localSetUp(self):
create_dengue_nowcasts = """
CREATE TABLE IF NOT EXISTS `dengue_nowcasts` (
... | Python | 1 |
64> {
let mut new_arr:Vec<i64> = Vec::new();
for _ in 0..arr.len() {
let lower = search_lower(arr);
new_arr.push(arr[lower]);
arr.remove(lower);
}
return new_arr;
}
fn main() {
let mut list: Vec<i64> = vec![24, 50, 54, 6, 9, 20, 1, 3, 80, 4];
println!("Position: {:?}", s... | Rust | 0 |
_bindgen_ty_8::SDL_LOG_CATEGORY_RENDER;
pub const SDL_LOG_CATEGORY_INPUT: _bindgen_ty_8 =
_bindgen_ty_8::SDL_LOG_CATEGORY_INPUT;
pub const SDL_LOG_CATEGORY_TEST: _bindgen_ty_8 =
_bindgen_ty_8::SDL_LOG_CATEGORY_TEST;
pub const SDL_LOG_CATEGORY_RESERVED1: _bindgen_ty_8 =
_bindgen_ty_8::SDL_LOG_CATEGORY_RE... | Rust | 0 |
in_time_range = np.logical_and(time_values >= startdate,\
time_values <= enddate).nonzero()[0]
curr_ds = curr_ds.isel(time=in_time_range)
if (('SNAPSHOT' in shortname) and (snapshot_interval == 'monthly')):
... | Python | 1 |
std::str::FromStr;
#[macro_use]
extern crate lazy_static;
#[derive(Debug, Clone, Deserialize, Recap)]
#[recap(regex = r"(?x)
\s*
((
byr:(?P<byr>\S+) |
iyr:(?P<iyr>\S+) |
eyr:(?P<eyr>\S+) |
hgt:(?P<hgt>\S+) |
hcl:(?P<hcl>\S+) |
ec... | Rust | 0 |
in bytes.
pub unsafe fn read_config_space<T: Copy>(&self, offset: usize) -> T {
match self.resources {
VirtioResources::Mmio { ref registers } => registers.read(0x100 + offset)
}
}
}
bitflags! {
/// Indicates a reason for the device to have raised an interrupt. These values are... | Rust | 0 |
n(final_step.column_filters[1]['value max']['filters']) == 0
assert mito.dfs[1].equals(
pd.DataFrame({
'date': ['1-1-2000'],
'value max': [1]
})
)
def test_replay_edits_allows_filter_editing():
df = pd.DataFrame(data={'date': ['1-1-2000', '1-2-2000', '1-3-2000'], '... | Python | 1 |
return alert_result.success and script_result.success
except Exception as e:
print(f"❌ AI analysis test failed: {e}")
return False
def main():
"""Run all tests"""
print("🧪 Backend Discard Service - Test Suite")
print("=" * 50)
# Test queue operations
qu... | Python | 1 |
import random
def get_user_inputs():
print("Welcome to the Personalized Story Generator!")
name = input("Enter your name: ")
favorite_color = input("Enter your favorite color: ")
favorite_animal = input("Enter your favorite animal: ")
dream_job = input("Enter your dream job: ")
city = input("En... | Python | 1 |
from typing import Dict, Any
from sqlalchemy import update, delete, insert
from sqlalchemy.future import select
from sqlalchemy.orm import Session
from models.data.sqlalchemy_async_models import Attendance_Member
from datetime import datetime
class AttendanceRepository:
def __init__(self, sess:Session):
... | Python | 1 |
_base_ = './retinanet_r50_fpn_1x_coco.py'
# learning policy
lr_config = dict(step=[16, 22])
runner = dict(type='EpochBasedRunner', max_epochs=24)
| Python | 1 |
space into one space.
r? rw r )
r~ rS r r rU r r r r r )r r s r; r zAddrlistClass.getphraselist s hhTZZ(zz$((#txx/A
DHH%,T]]_-DHH%, ''(9:DHH%8 T\\$//:; hhTZZ( r< |