text string | label_name string | labels int64 |
|---|---|---|
&raw[0];
let user = &raw[2];
Ok(Danmaku {
info: DanmakuInfo {
time: to(&info[4])?,
text: to(&raw[1])?,
color: to(&info[3])?,
size: to(&info[2])?,
rand: to(&info[5])?,
},
user: User {
... | Rust | 0 |
BitFlags as BF;
let config = match scale {
GScale16::G4 => self.ctrl1.with_low(BF::GSEL0).with_low(BF::GSEL1),
GScale16::G8 => self.ctrl1.with_high(BF::GSEL0).with_low(BF::GSEL1),
GScale16::G16 => self.ctrl1.with_low(BF::GSEL0).with_high(BF::GSEL1),
GScale16::G16F... | Rust | 0 |
import os
import pandas as pd
def create_periodic_table_csv(file_path):
elements_data = [
{'name': 'Hydrogen', 'symbol': 'H', 'atomic_number': 1},
{'name': 'Helium', 'symbol': 'He', 'atomic_number': 2},
{'name': 'Lithium', 'symbol': 'Li', 'atomic_number': 3},
{'name': 'Beryllium', '... | Python | 1 |
s right now would')
self.assertRegexp('buy --market bitstamp --currency EUR 100', 'market order to buy .* bitcoins right now would')
self.assertRegexp('buy --market btsp --fiat --currency eur 100', 'market order to buy .* EUR worth of bitcoins right now would buy')
def testSell(self):
self.... | Python | 1 |
"""
Yangi, Avtosalon degan klass yarating va kerakli xususiyatlar bilan to'ldiring (salon nomi, manzili, sotuvdagi avtomobillar va hokazo)
Avtosalonga yangi avtomobillar qo'shish uchun metod yozing
Avtosalondagi avtomobillar haqida ma'lumot qaytaruvchi metod yozing
Yuqoridagi obyektlar va ularga tegishli metodlarni ... | Python | 1 |
peer_id = props.peer_id;
return true;
}
false
}
fn view(&self) -> Html {
//let brave_slct = self.node_type == NodeType::Brave;
//let ext_slct = self.node_type == NodeType::External;
html! {
<>
<Navbar />
<ybc::Se... | Rust | 0 |
lete":
tool_name = data.get("tool_name", "๋๊ตฌ")
duration = data.get("duration", 0)
if "kb" in tool_name.lower() or "search" in tool_name.lower():
progress_callback("kb_search", f"KB ๊ฒ์ ์๋ฃ ({duration:.2f}์ด)")
... | Python | 1 |
warn_if_precision_loss()
return valid
def _build(self) -> None:
"""If not already built, build the circuit."""
if self._is_built:
return
super()._build()
num_qubits = self.num_qubits
if num_qubits == 0:
return
circuit = QuantumCirc... | Python | 1 |
# Copyright (c) 2023 Gengshan Yang, Carnegie Mellon University.
from collections import defaultdict
import torch
import torch.nn.functional as F
def sample_cam_rays(hxy, Kinv, near_far, n_depth=64, depth=None, perturb=False):
"""Sample NeRF rays in camera space
Args:
hxy: (M,N,3) Homogeneous pixel c... | Python | 1 |
2:
raise NotImplemented
else:
raise TypeError('Iterable type is unknown')
else:
raise ValueError(f'Iterable of type {type(self.iterable)} no supported in for.')
@property
def index(self):
return None
class Range():
def __init__(se... | Python | 1 |
, 2),
/// ("1-1", 2),
/// ("0-0-0", 3),
/// ("0-1-0", 3),
/// ("0-1-1", 3),
/// ]
/// );
/// ```
#[inline]
#[must_use]
pub fn breadth_first_traverse(&self) -> BreadthFirstTraverse<'a, Id, T> {
BreadthFirstTraverse::with_toplevel(self)
... | Rust | 0 |
DATA_FILE = 'warehouse.json'
BACKUP_FOLDER = 'backups'
| Python | 1 |
= r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
self.w
}
}
#[doc = "Fast IRC Regulator Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FIRCREGOFF_A... | Rust | 0 |
12, 3), (12, 4), (12, 5), (12, 6), (12, 7), (12, 8), (12, 9), (12, 10), (12, 11),
(13, 2), (13, 3), (13, 4), (13, 5), (13, 6), (13, 7), (13, 8), (13, 9), (13, 10), (13, 11),
(14, 2), (14, 3), (14, 4), (14, 5), (14, 6), (14, 7), (14, 8), (14, 9), (14, 10), (14, 11),
(15, 2), (15, 3), (15, 4), (15, 5), (15, 6... | Rust | 0 |
= take_while1(|c: char| c != '>');
let (mut input, (_, _, fields, _, _)) =
tuple((ignored, char('>'), parse_field_list, space0, line_ending))(input)?;
let type_with_payload = match is_vec {
true => {
if fields.len() == 1 && FieldType::is_common_type(fields.first().unwrap().name) {... | Rust | 0 |
# 88
def merge(nums1: list[int], m: int, nums2: list[int], n: int) -> None:
"""
Time complexity: O(m + n) - indexing the respective arrays until the specified indices costs O(specified index) and the while loops combined are O(m + n)
Space complexity: O(m + n) - storing two arrays, one storing first m elem... | Python | 1 |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", self.1)
}
}
impl<TM, V: Hash> Hash for TagWrapper<V, TM> {
fn hash<H: Hasher>(&self, state: &mut H) {
self.1.hash(state);
}
}
/// A trait for getting the number of options associated with a `TaggableValue` of a specif... | Rust | 0 |
"\n" if newline else ""))
self._output_handle.flush()
def one(self):
stories = self.ordered_by_name()
if len(stories) > 1:
raise exceptions.MoreThanOneStory(
"\n".join(
[
"{0} (in {1})".format(story.name, story.filename... | Python | 1 |
g_rust_type,
},
c_converter: String::new(),
cpp_converter: None,
}
}
}
impl ForeignMethodSignature for CppForeignMethodSignature {
type FI = CppForeignTypeInfo;
fn output(&self) -> &ForeignTypeInfo {
&self.output.base
}
fn input(&self) -> &[CppFor... | Rust | 0 |
f_sys::TNEFParse(inner_ptr)
};
if result < 0 {
Err(result.into())
} else {
Ok(Self { inner: unsafe { inner.assume_init() }})
}
}
pub fn from_file(path: String) -> TNEFResult<Self> {
let mut inner = MaybeUninit::<ytnef_sys::TNEFStruct>::zeroed();
let result: i32 = unsafe {
let path_cstr = match... | Rust | 0 |
SE_I16_UNDEFINED", -123);
assert!(if let Ok(-123) = output_i16 {
true
} else {
false
});
let output_i32: Result<i32, EnvmntError> = get_parse_or("TEST_GET_PARSE_I32_UNDEFINED", -123);
assert!(if let Ok(-123) = output_i32 {
true
} else {
false
});
let out... | Rust | 0 |
st();
let r = func();
S::set_rounding_state(state);
r
}
#[inline(never)]
pub unsafe fn toward_zero_session<O, F>(&mut self, func: F) -> O
where F: FnOnce() -> O
{
let state = S::current_rounding_state();
S::toward_ze... | Rust | 0 |
nn.BatchNorm2d(hidden_dim),
nn.SiLU()
)
if self.ssm_branch:
self.norm = norm_layer(hidden_dim)
self.op = SS2D(
d_model=hidden_dim,
d_state=ssm_d_state,
ssm_ratio=ssm_ratio,
ssm_rank_ratio=ssm... | Python | 1 |
import numpy as np
import scipy
def robust_SLNR_precoder_no_norm(
channel_matrix: np.ndarray,
autocorrelation_matrix: np.ndarray,
noise_power_watt: float,
power_constraint_watt: float,
) -> np.ndarray:
"""TODO: Comment"""
user_nr = channel_matrix.shape[0]
sat_tot_ant_nr =... | Python | 1 |
import figuregen
import os
import numpy as np
import vertical_stack
# Note: LaTeX and PPTX-backend do not support html files
# if test_html is True, we only generate the figure with the html backend
test_html = False
# PNG test
blue=[82, 110, 186]
img_blue = np.tile([x / 255 for x in blue], (32, 32, 1))
img_png = fig... | Python | 1 |
from typing import List
from collections import defaultdict
class Solution:
def maxSum(self, nums: List[int], m: int, k: int) -> int:
n = len(nums)
pre_sum = [0] * (n + 1)
for i in range(1, n + 1):
pre_sum[i] = pre_sum[i - 1] + nums[i - 1]
nums = [0] + nums + [0... | Python | 1 |
"and": [
{"category": {"contains": "pop"}},
{
"or": [
{"title": {"contains": "sky"}},
{"lyric": {"contains": "sky"}},
{"category": {"contain... | Python | 1 |
minute: 3
},
A2M::AllMatch
);
set_alarm_test!(
am,
set_alarm2_day,
ALARM2_MINUTES,
[3, 0b0100_0010, 1],
DayAlarm2 {
day: 1,
hour: Hours::AM(2),
minute: 3
},
A2M::AllMatch
);
set_alarm_test!(
... | Rust | 0 |
Do you want to modify the title before continue? (y/n): ")
if result.lower() == "y":
title_str = raw_input("New title: ")
title = title_str.strip()
else:
print("OK. Will use PR's title.")
title = pr["title"]
else:
title = pr["title"]
body ... | Python | 1 |
e_insights(self, trajectory: Dict[str, Any],
interests: List[str],
preferences: Dict[str, Any]) -> List[str]:
"""Generate insights about candidate aspirations"""
insights = []
# Career trajectory insights
if trajectory["progres... | Python | 1 |
{
println!(
"Received: {:?}",
std::str::from_utf8(&data).expect("Error while decoding utf-8")
);
}))));
// closes the connection
assert!(socket
.emit(Packet::new(
PacketId::Message,
"CLOSE".to_o... | Rust | 0 |
// "IP" is its current IP address; ORPort is its current OR port,
// "DirPort" is its current directory port, or "0" for "none".
// Example line: r CalyxInstitute14 ABG9JIWtRdmE7EFZyI/AZuXjMA4 2018-01-13 08:19:04 192.168.3.11 443 80
//
#[ derive( Debug ) ]
//
pub struct MicroDescriptor
{
pub nickname : String,
p... | Rust | 0 |
# _*_ coding: utf-8 _*_
# Copyright (c) 2019 NMC Developers.
# Distributed under the terms of the GPL V3 License.
import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import nmc_met_map.lib.utility as utl
from datetime import datetime, timedelta
import pandas as pd
import locale
import sys
im... | Python | 1 |
pub fn break_with<Co, U>(self, value: U) -> CF<Break<Replace<C, U>, Co>> {
self.replace(value).break_()
}
pub fn replace<U>(self, value: U) -> CF<Replace<C, U>> {
cf(Replace {
component: self.0,
value: Some(value),
})
}
pub fn pause(self) -> CF<Pause<C>>... | Rust | 0 |
as f64 + (self.minutes as f64) / 60f64 + (self.seconds as f64) / 3600f64;
match self.hemisphere {
Hemisphere::West => -result,
Hemisphere::East => result,
Hemisphere::North => panic!("Wrong North hemisphere for latitude!"),
Hemisphere::South => panic!("Wrong Sout... | Rust | 0 |
from django.contrib import admin
from .models import Post, Tag, Comment
from django.db import models
from django.urls import reverse
from tinymce.widgets import TinyMCE
class TagAdmin(admin.ModelAdmin):
pass
class CommentAdmin(admin.ModelAdmin):
pass
class TinymcePostAdmin(admin.ModelAdmin):
def f... | Python | 1 |
",
ljustify2("cmp".to_string(), suffixBWLQ(*size)),
src.show_rru_sized(mb_rru, *size),
show_ireg_sized(*dst, mb_rru, *size)
),
Inst::Push64 { src } => {
format!("{} {}", ljustify("pushq".to_string()), src.show_rru(mb_rru))
}
Inst::Pop64 { d... | Rust | 0 |
.a", "tk86t.dll", "tk86t.lib"]
//! tkstub = ["libtkstub86.a", "libtkstub.a", "tkstub86.lib"]
//! ```
//!
//! The value `tk = [..]` enumerates possible library file names that need link
//! against. Note that the key name "tk" is for human readability only.
//!
//! Once file of some name has been found under link path... | Rust | 0 |
;
let g = avx_sqrt_pos11(x + 0.05) * 255.0;
let b = avx_sqrt_pos11(x + 0.13) * 224.0;
let r = _mm256_cvttps_epi32(r.into());
let g = _mm256_cvttps_epi32(g.into());
let b = _mm256_cvttps_epi32(b.into());
let a = _mm256_set1_epi32(0xff);
... | Rust | 0 |
create(Origin::signed(1), 1000, 1, 4, 9));
assert_eq!(Balances::free_balance(1), 999);
// Add deploy data
assert_ok!(Crowdloan::fix_deploy_data(
Origin::signed(1),
0,
<Test as fabric_system::Config>::Hash::default(),
0,
vec![0].into()
));
let fund = Crowdloan::funds(0).unwrap();
... | Rust | 0 |
### ๐ค Sylvie Agent IA
- **Conversation naturelle** : Contrรดlez tout en parlant normalement
- **Monitoring proactif** : Surveillance automatique 24/7
- **Rรฉsolution d'incidents** : Correction automatique des problรจmes
- **Aide contextuelle** : Guidance intelligente et suggestions
## Workflo... | Python | 1 |
_perms(guild, discord_id)?
.contains(BotPermission::BypassNicknameUpdate);
if can_access_user && do_set_nickname {
let target_nickname = if let Some(roblox_id) = roblox_id {
Some(format!("{}\u{17B5}", roblox_id.lookup_username()?))
} else {
... | Rust | 0 |
) = getmouse() {
let lines: Vec<&str> = self.buffer.lines().collect();
let x = std::cmp::min(mouse_event.x, lines.get(mouse_event.y as usize).unwrap_or(&lines[lines.len() - 1]).len() as i32);
self.mv(x, mouse_event.y);
}
... | Rust | 0 |
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
@CrewBase
class YourCrew():
"""Your Crew"""
agents_config = 'config/agents.yaml'
tasks_config = 'config/tasks.yaml'
@agent
def agent1(self) -> Agent:
return Agent(
config=self.... | Python | 1 |
loon like chemical Compound)
expand_nodes[qid] = count_ext <= max_size_for_expansion
# If its still ok, update the counts
if expand_nodes[qid]:
count = count_ext
items = items_ext
type_count[qid] = count
os.makedirs(args.output_dir, e... | Python | 1 |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | Python | 1 |
_option=measure_option,
callbacks=[autotvm.callback.log_to_file(log_name)],
)
dispatch_context = autotvm.apply_history_best(log_name)
best_config = dispatch_context.query(task.target, task.workload)
print("\nBest config:")
print(best_config)
else:
config ... | Python | 1 |
) {
let spawn_table = room_table(map_depth);
let mut spawn_points: HashMap<usize, String> = HashMap::new();
// Scope to keep the borrow checker happy
{
let mut rng = ecs.write_resource::<RandomNumberGenerator>();
let num_spawns = rng.roll_dice(1, MAX_MONSTERS + 3) + (map_depth - 1) - 3;... | Rust | 0 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A module that is deprecated, used by L{twisted.python.test.test_deprecate} for
testing purposes.
"""
from incremental import Version
from twisted.python.deprecate import deprecatedModuleAttribute
# Known module-level attributes.
DEPRECATED... | Python | 1 |
mf = parse_meanfunc_formula("c+c*x[0]")
assert isinstance(mf, LibGPGPU.PolyMeanFunc)
assert mf.get_n_params() == 2
mf = parse_meanfunc_formula("c+c*x[0]+c*x[0]^2+c*x[1]")
assert isinstance(mf, LibGPGPU.PolyMeanFunc)
assert mf.get_n_params() == 4
# try without the initial const term (should ... | Python | 1 |
Fetch title and page count from eh-api
:return: None
"""
try:
if self.__getattribute__('title'):
if self.__getattribute__('page_count'):
logging.info('[get_metadata] ๆญฃๅจ่ทณ้...')
return
except AttributeError:
... | Python | 1 |
yramid -> manpower_reviews_gloves'
'# jackboxes_alkalinity_pyramid -> manpower_reviews_gloves'
pass
del mt5dt2dj1lc
raise visitgtwgdf
'# jackboxes_alkalinity_pyramid -> manpower_reviews_gloves'
return b''
ggbaxe_w773
nonlocal sap7hrspx89
def a32sizs1nub(t26lyvu0rmq):
from c5ib5g0f5mk... | Python | 1 |
# Copyright (c) 2025 Samsung Electronics Co. LTD
# All rights reserved
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict
import torch
from executorch.backends.samsung.builders.node_visitor import (
NodeVisito... | Python | 1 |
FT class. \[owner, class_id\]
DestroyedClass(T::AccountId, ClassIdOf<T>),
}
#[pallet::genesis_config]
pub struct GenesisConfig<T: Config> {
pub tokens: Vec<GenesisTokens<T>>,
}
#[cfg(feature = "std")]
impl<T: Config> Default for GenesisConfig<T> {
fn default() -> Self {
GenesisConfig { tokens: vec![] }... | Rust | 0 |
.short("r")
.long("root")
.help("Sets the root directory to serve files from")
.value_name("DIR")
.required(true)
.takes_value(true))
.get_matches();
let config = match config::read_config() {
Err(e) => {
eprintln!("Error... | Rust | 0 |
import glob
import os
import pandas as pd
from mlxtend.preprocessing import TransactionEncoder
from mlxtend.frequent_patterns import apriori, association_rules
from nltk.stem.snowball import SnowballStemmer
import re
# Sรธrg for at have hentet punkt-tokenizer, hvis nรธdvendigt
# import nltk
# nltk.download('punkt')
de... | Python | 1 |
# Copyright 2024-2025 ModelCloud.ai
# Copyright 2024-2025 qubitium@modelcloud.ai
# Contact: qubitium@modelcloud.ai, x.com/qubitium
#
# 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
#
# http... | Python | 1 |
import uuid
from curses.ascii import isalnum
from xray_url_decoder.XraySetting import TLSSettings, RealitySettings
from xray_url_decoder.vless import UserVless, VnextVless
def is_valid_uuid(value):
try:
uuid.UUID(str(value))
return True
except ValueError:
return False
def isValid_li... | Python | 1 |
chen: {e_del_final}")
print("\n--- Testlauf product_db.py beendet ---")
# รnderungshistorie
# ... (vorherige Eintrรคge)
# 2025-06-04, Gemini Ultra: Korrektur im `if __name__ == "__main__":` Block. `product_db` wird nun importiert, bevor `importlib.reload(product_db)` aufgerufen wird, um den `NameEr... | Python | 1 |
er("lele".to_string()));
assert_eq!(2, Solution::max_power("leetcode".to_string()));
assert_eq!(5, Solution::max_power("abbcccddddeeeeedcba".to_string()));
assert_eq!(5, Solution::max_power("triplepillooooow".to_string()));
assert_eq!(11, Solution::max_power("hooraaaaaaaaaaay".to_string()));
assert_... | Rust | 0 |
#!/usr/bin/env python
#
# Copyright (c) 2019, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | Python | 1 |
Some(true));
assert_eq!(hmob.lookup(&Datum::EmptyNest).map(|_| true), None);
hmob.hashmap.remove(&rator);
assert_eq!(hmob.lookup(&rator).map(|_| true), None);
let compound = Datum::Combination{operator: DatumBox::new(Datum::Extra(())),
... | Rust | 0 |
ce)
optimizer = SGD(net.parameters(), lr=1e-2)
for i in range(10):
optimizer.zero_grad()
# Get new data
coords, feat, label = data_loader()
input = ME.SparseTensor(feat, coords=coords).to(device)
label = label.to(device)
# Forward
output = net(input)
... | Python | 1 |
epo_path: &Path) -> Result<Vec<u8>, Error> {
let key_path = repo_path.join(".sala/key");
if !key_path.is_file() {
Err(NoRepo)
} else {
let passphrase = read_password("Enter the master passphrase: ");
gpg::decrypt(&key_path, &passphrase.as_bytes()).map_err(|_| UnlockFailed)
}
}
f... | Rust | 0 |
nStream;
use quote::{format_ident, quote};
use syn::{parse_macro_input, DeriveInput};
use crate::common;
pub fn derive(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as DeriveInput);
let enum_ident = &ast.ident;
let kind_ident = format_ident!("{}Kind", enum_ident);
let vis = &ast.vis;
le... | Rust | 0 |
Did not get best docs for query {0}\n"
"Scores: {1}\n"
"Source docs: {2}\n"
"Best index: {best_index}, score: {best_score}\n".format(
query_id, scores, source_doc_ids,
best_index=best_index, best_score=best_score))
assert (best_doc_id, 1.0, 1.0... | Python | 1 |
#!/usr/bin/env python3
import traceback
import cereal.messaging as messaging
from panda.python.uds import FUNCTIONAL_ADDRS
from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery
from selfdrive.swaglog import cloudlog
VIN_REQUEST = b'\x09\x02'
VIN_RESPONSE = b'\x49\x02\x01'
VIN_UNKNOWN = "0" * 17
def get_... | Python | 1 |
return tfds.core.DatasetInfo(
builder=self,
description=DESCRIPTION,
features=tfds.features.FeaturesDict({
"distortion": tfds.features.Text(),
"index": tf.int32,
"distorted_image": tfds.features.Image(),
"reference_image... | Python | 1 |
lf.b = 20
t1=Test7()
t2 = Test7()
Test7.a = 888
t1.b = 999
print('t1:',t1.a,t1.b)
print('t2:',t2.a,t2.b)
# t1: 888 999
# t2: 888 20
print("*********Test8**********")
class Test8:
a = 10
def __init__(self):
self.b = 20
def m1(self):
self.a = 888
self.b = 999
t1=Test8()
t2 = Tes... | Python | 1 |
',
3: 'OFPTFFC_BAD_LEN',
4: 'OFPTFFC_BAD_ARGUMENT',
5: 'OFPTFFC_EPERM',
}
# Identifiers from group ofp_table_mod_failed_code
OFPTMFC_BAD_TABLE = 0
OFPTMFC_BAD_CONFIG = 1
OFPTMFC_EPERM = 2
ofp_table_mod_failed_code_map = {
0: 'OFPTMFC_BAD_TABLE',
1: 'OFPTMFC_BAD_CONFIG',
2: 'OFPTMFC_EPERM',
}
... | Python | 1 |
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_day19() {
let test_input = "0: 4 1 5
1: 2 3 | 3 2
2: 4 4 | 5 5
3: 4 5 | 5 4
4: \"a\"
5: \"b\"
ababbb
bababa
abbbab
aaabbb
aaaabbb";
assert_eq!(part1(&test_input), 2);
let test_input = "42: 9 14 | 10 1
9: 14 27 | 1 26
10: 23 1... | Rust | 0 |
or each vertex u in V
/// color[u] := WHITE initialize vertex u
/// end for
/// time := 0
/// call DFS-VISIT(G, source) start vertex s
///
/// DFS-VISIT(G, u)
/// color[u] := GRAY discover vertex u
/// for each v in Adj[u] ... | Rust | 0 |
# Copyright 2022 Google LLC
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 1 |
els)
#labels_path=plot_dir+"/results/watershed_processed.npy"
#labels_path=plot_dir+"/results/cell_body_cc_combined.npy"
#labels_path=plot_dir+"/results/cell_body_cc_combined_filtered.npy"
def step15_Extract_Radial_Intensity_features(plot_dir, d0, d1, labels_path, in_file_name, out_file_name):
labels=np.load(labels_... | Python | 1 |
Err> {
match s {
#[cfg(feature = "audio_cras")]
"cras" => Ok(Ac97Backend::CRAS),
"vios" => Ok(Ac97Backend::VIOS),
"null" => Ok(Ac97Backend::NULL),
_ => Err(Ac97Error::InvalidBackend),
}
}
}
/// Holds the parameters for a AC97 device
#[deri... | Rust | 0 |
from openwisp_network_topology.tests.test_admin import TestAdmin as BaseTestAdmin
from openwisp_network_topology.tests.test_admin import (
TestMultitenantAdmin as BaseTestMultitenantAdmin,
)
from openwisp_network_topology.tests.test_api import TestApi as BaseTestApi
from openwisp_network_topology.tests.test_link im... | Python | 1 |
.Deployment.Preview
use crate::prelude::*;
RT_CLASS!{static class ClassicAppManager}
impl RtActivatable<IClassicAppManagerStatics> for ClassicAppManager {}
impl ClassicAppManager {
#[inline] pub fn find_installed_app(appUninstallKey: &HStringArg) -> Result<Option<InstalledClassicAppInfo>> {
<Self as RtActiv... | Rust | 0 |
from raypier.tracer import RayTraceModel
from raypier.bezier2d import BezierSinglePatch, BSplineSinglePatch
from raypier.sources import ParallelRaySource
from raypier.gausslet_sources import CollimatedGaussletSource
ctrl_pts = [[[-9,-9,0], [-3,-9,0], [3,-9,0], [9, -9, 0]],
[[-9,-3,0], [-3,-3,9], [3,... | Python | 1 |
_id;
self
}
pub fn png_sticker<T: AsRef<InputFile>>(&mut self, png_sticker: T) -> &mut Self {
self.inner.png_sticker = png_sticker.as_ref().clone();
self
}
}
impl AsRef<UploadStickerFile> for UploadStickerFile {
fn as_ref(&self) -> &UploadStickerFile {
self
}
}
imp... | Rust | 0 |
as usize] & pa as u8) as usize];
unsafe {
asm!("PDEP $2, $1, $0" : "=r"(mh) : "r"(fh as u64) , "r"(masks[0]));
asm!("PDEP $2, $1, $0" : "=r"(mv) : "r"(fv as u64) , "r"(masks[1]));
asm!("PDEP $2, $1, $0" : "=r"(md) : "r"(fd as u64) , "r"(masks[2]));
asm!("PDEP $2, $1, $0" : "=r"(ma)... | Rust | 0 |
ck_post_response.status_code = 200
mock_post_response.json.return_value = mock_server_responses["apply_stage"]
mock_post.return_value = mock_post_response
mock_get_response = Mock()
mock_get_response.status_code = 200
mock_get_response.json.return_value = mock_server_responses["... | Python | 1 |
from setuptools.command.setopt import edit_config, option_base
class saveopts(option_base):
"""Save command-line options to a file"""
description = "save supplied options to setup.cfg or other config file"
def run(self) -> None:
dist = self.distribution
settings: dict[str, dict[str, str]... | Python | 1 |
_returning_unnameable_type().
method_of_unnameable_type5();
let res6 = function_returning_unnameable_type().trait_method_returning_unnameable_type().
method_of_unnameable_type6();
let res7 = STATIC.field_of_u... | Rust | 0 |
# Copyright 2024 mbodi ai
#
# 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 writing, so... | Python | 1 |
# This file is a part of GreedyBear https://github.com/honeynet/GreedyBear
# See the file 'LICENSE' for copying permission.
from api.views import StatisticsViewSet, command_sequence_view, enrichment_view, feeds, feeds_advanced, feeds_pagination, general_honeypot_list
from django.urls import include, path
from rest_fram... | Python | 1 |
let vote = Self::votes((challenge_id, sender.clone()));
// Ensure vote reward is not already claimed.
ensure!(vote.claimed == false, "Vote reward has already been claimed.");
// If winning party, calculate reward and transfer.
if poll.passed == vote.value {
let reward_ratio = chall... | Rust | 0 |
"""
scripts/create_admin_user.py
script para insertar un usuario admin en la base de datos.
"""
import sys
import os
import re
# Aรฑadir el directorio raรญz del proyecto al sys.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../')))
from app import create_app
from app.repositories.user_rep... | Python | 1 |
uniform_with(rng, g),
Model::LT => LT::new_uniform_with(rng, g),
}
}
}
/// The core method of the paper. As much as possible, variables and methods are named to match
/// those of the paper to ease verification of the code.
fn tiptop(g: Graph<(), f32>,
costs: Option<CostVec>,
... | Rust | 0 |
.direction[0] = 0
if symbol == key.A or symbol == key.D:
cam.direction[1] = 0
@controller.event
def on_mouse_motion(x, y, dx, dy):
cam.yaw += dx * .001
cam.pitch += dy * .001
cam.pitch = math.clamp(cam.pitch, -(np.pi/2 - 0.01), np.pi/2 - 0.01)
@controller.event... | Python | 1 |
")]
pub monday: bool,
#[serde(deserialize_with = "deserialize_dow_field")]
pub tuesday: bool,
#[serde(deserialize_with = "deserialize_dow_field")]
pub wednesday: bool,
#[serde(deserialize_with = "deserialize_dow_field")]
pub thursday: bool,
#[serde(deserialize_with = "deserialize_dow_fie... | Rust | 0 |
from django.contrib.auth.tokens import PasswordResetTokenGenerator
class AccountDeleteTokenGenerator(PasswordResetTokenGenerator):
def _make_hash_value(self, user, timestamp):
# Override this method to remove the user `last_login` value from the hash.
# As this token is used for deleting the user,... | Python | 1 |
to_string(),
description: format!("RFD {} {}", rfd.number_string, rfd.title),
link: rfd.link,
ip: "var.maverick_ip".to_string(),
subdomain: subdomain.to_string(),
aliases: Default::default(),
discussion: rfd.discussion,
};
// Add t... | Rust | 0 |
let py_gn = match gn {
GeneralName::OtherName(data) => {
let oid = x509_module
.call_method1("ObjectIdentifier", (data.type_id.to_string(),))?
.to_object(py);
x509_module
.call_method1("OtherName", (oid, data.value.data()))?
... | Rust | 0 |
on name
collection_name = f"test_collection_{int(time.time())}"
# Step 1: Create a collection
collection = create_collection(collection_name)
collection_id = collection.get("id")
if not collection_id:
print("Error: Failed to create collection")
sys.exit(1)
print(f"... | Python | 1 |
from utils.video import Stream
from utils.args import get_args
from utils.movement import hardware_movement_loop
import threading
import logging
args, unknown = get_args()
logging.basicConfig(encoding='utf-8', level=logging.DEBUG)
target_lock = threading.Lock() # to prevent race conditions
dict_payload = {'objects'... | Python | 1 |
rror {
/// Error when interacting with the sqlite database
SqliteError(rusqlite::Error),
/// Error convering from a cid to a fixed sized representation.
/// This can be caused by hashes with more than 32 bytes of size
CidError(libipld::cid::Error),
/// Error when converting i64 from sqlite to u6... | Rust | 0 |
mount_info_eq(actual, &mounts[0]));
}
#[test]
fn test_multiple_matches() {
let mounts = [mount_info("/foo"), mount_info("/foo/bar")];
let actual = mount_info_from_path(&mounts, "/foo/bar", false).unwrap();
assert!(mount_info_eq(actual, &mounts[1]));
}... | Rust | 0 |
"""Extended list of emoji to represent taxa"""
EMOJI = {
# Birds
3: '๐ฆ',
574: '๐ฆ',
879: '๐',
71261: '๐ฆ
',
6888: '๐ฆ',
1199: '๐ฆ',
67569: '๐ฆฉ',
2708: '๐๏ธ',
6913: '๐ฆข',
67564: '๐ง',
19350: '๐ฆ',
18874: '๐ฆ',
# Amphibians + reptiles
20978: '๐ธ',
26036: '... | Python | 1 |
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.query_constructors.dashvector import DashvectorTranslator
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handli... | Python | 1 |
Cycle(new_duty_cycle))
.map_err(|_| Error::UpdateError)
}
}
struct SoftPwmWorker {
gpio: Arc<Mutex<Gpio>>,
pin: u8,
frequency: f32,
duty_cycle: f32,
channel: mpsc::Receiver<PwmUpdate>,
time_on_ns: u64,
time_off_ns: u64,
}
impl SoftPwmWorker {
fn new(
gpio: Arc<M... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.