text string | label_name string | labels int64 |
|---|---|---|
oad_config, self.xdg_profile
)
}
}
impl fmt::Display for CommandLineArguments {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Debug::fmt(self, f)
}
}<filename>src/lib.rs<gh_stars>1-10
#[macro_use] extern crate lazy_static;
use std::collections::HashMap;
lazy_static! {
st... | Rust | 0 |
import json
import os
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
colors = ["#c82423", "#FF7F50", "#3DB070", "#2878b5"]
data = [
[25.7, 33.7, 24.8, 15.8],
[19.8, 21.8, 51.5, 6.9],
[33.7, 46.5, 14.9, 5.0],
]
titles = [
"w/o Reflection", "w/o Debugging", "Both... | Python | 1 |
}
}
fn ms2dur(ms: u32) -> Duration {
Duration::new((ms as u64) / 1000, (ms as u32) % 1000 * 1_000_000)
}
fn dur2ms(dur: Duration) -> u32 {
(dur.as_secs() as u32 * 1000) + (dur.subsec_nanos() / 1_000_000)
}
pub fn int2bool(n: c_int) -> bool {
if n == 0 {false} else {true}
}
pub fn int2usize(n: c_int... | Rust | 0 |
nder = SpriteRender {
sprite_sheet: resources.text_box.clone(),
sprite_number: 0,
};
let ui_transform = UiTransform::new(
"Text Box".to_string(),
Anchor::BottomMiddle,
Anchor::BottomMiddle,
0.,
20.,
2.,
800.,
100.,
);
enti... | Rust | 0 |
{
let crashes_dir = value_t!(args, "crashes_dir", String)?;
let inputs_dir = value_t!(args, "inputs_dir", String)?;
let target_exe = value_t!(args, "target_exe", PathBuf)?;
let target_options = args.values_of_lossy("target_options").unwrap_or_default();
let mut target_env = HashMap::new();
for o... | Rust | 0 |
ADDON = "fake_addon"
import os
import sys
try:
import pytest
except Exception as e:
print(e)
sys.exit(1)
try:
sys.path.append(os.environ["LOCAL_PYTHONPATH"])
from addon_helper import zip_addon, change_addon_dir, install_addon, cleanup
except Exception as e:
print(e)
sys.exit(1)
class Se... | Python | 1 |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: MotorControl
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class SetCurrentKi(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encod... | Python | 1 |
import time
import random
import traceback
from multiprocessing import Process, current_process
from shared_state_ctypes import SharedState
TEST_SHM_NAME = "stress_test_shm"
def writer_process(id):
ss = SharedState(name=TEST_SHM_NAME)
try:
for _ in range(100):
op = random.choice(["model", ... | Python | 1 |
node.put()
# Mini 24x24
q3 = db.GqlQuery("SELECT * FROM Avatar WHERE name = :1", 'node_' + str(node.num) + '_mini')
if (q3.count() == 1):
avatar_mini = q3[0]
avatar_mini.content = db.Blob(avatar_24)
... | Python | 1 |
mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"data",
|m: &MonitorResponse| { &m.data },
|m: &mut MonitorResponse| { &mut m.data },
));
... | Rust | 0 |
model.ot",
);
}
impl Gpt2ConfigResources {
/// Shared under Modified MIT license by the OpenAI team at https://github.com/openai/gpt-2/blob/master/LICENSE. Modified with conversion to C-array format.
pub const GPT2: (&'static str, &'static str) =
("gpt2/config", "https://cdn.huggingface.co/gpt2-con... | Rust | 0 |
1008806316530991104, 1152921504606846976,
1441151880758558720, 1729382256910270464, 2017612633061982208, 2305843009213693952, 2882303761517117440,
3458764513820540928, 4035225266123964416, 4611686018427387904, 5764607523034234880, 6917529027641081856,
8070450532247928832, 9223372036854775808, 11529215046068... | Python | 1 |
CoreLog> {
fetch_global_buffered_logs()
}
}
impl CoreSDK {
pub(crate) fn new<SG: ServerGatewayApis + Send + Sync + 'static>(
server_gateway: SG,
init_options: CoreInitOptions,
) -> Self {
let sg = GatewayRef::new(Arc::new(server_gateway), init_options.gateway_opts.clone());
... | Rust | 0 |
.add(s)
try: s = iter_a.next()
except: cont_loop = False
elif s < b[j]:
try: s = iter_a.next()
except: cont_loop = False
elif s > b[j]:
... | Python | 1 |
i32, y as i32), &mut positions)
.with(Renderable::new(181, RGB::from_u8(191, 151, 96), RGB::from_f32(0.0, 0.0, 0.0), ObjectShader::Foreground, ObjectShader::Background), &mut renderables)
.build();
},
... | Rust | 0 |
get_version', get_version),
url(r'inbox/notifications', include((notifications.urls, notifications))),
url(r'public_notice', publish_notice),
url(r"get_notices", get_public_notice),
url(r"notice_detail", notice_detail),
url(r'get_notifications_count',get_notifications_count),
url(r"get_content",... | Python | 1 |
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>>
============= RESTART: /Users/Kaitlyn/Downloads/musicrecplus.py =============
Enter your name (put a $ symbol after your name if you wish your preferences... | Python | 1 |
size,
empty_entries: AtomicUsize,
total_size: usize,
pub attachment: A,
shadow: PhantomData<(K, V, ALLOC)>,
}
pub struct ChunkPtr<K, V, A: Attachment<K, V>, ALLOC: GlobalAlloc + Default> {
ptr: *mut Chunk<K, V, A, ALLOC>,
}
pub struct Table<K, V, A: Attachment<K, V>, ALLOC: GlobalAlloc + Default, ... | Rust | 0 |
`, `bool`, `vec4`, `{}`, `[]` or `opt`".into())
})
}
pub(crate) fn not_equal(a: &Variable, b: &Variable) -> Result<Variable, String> {
equal(a, b).map(|v| if let Variable::Bool(a, sec) = v {Variable::Bool(!a, sec)} else {
panic!("Expected equal to return `bool`")
})
}
pub(crate) fn add(a: &Variabl... | Rust | 0 |
) -> $ty {
self.cli.$field.or(self.json.$field).unwrap_or($default)
}
)*)
}
#[derive(Clone, Debug)]
struct CliAndJsonConfig {
json: Config,
cli: Config,
}
impl wasm_smith::Config for CliAndJsonConfig {
fields! {
(min_types, usize, 0),
(max_types, usize, 100),
... | Rust | 0 |
, 0x6, N), (0xa, 0xd, N)])]
#[case(0x3, &[(0x3, 0x6, N), (0xa, 0xd, N)], &[(0x0, 0x6, N), (0xa, 0xd, N)])]
#[case(0x4, &[(0x3, 0x6, N), (0xa, 0xd, N)], &[(0x3, 0xd, N)])]
#[case(0x5, &[(0x3, 0x6, N), (0xa, 0xd, N)], &[(0x3, 0x6, N), (0xa, 0xd, N)])]
fn find_free_front(
#[case] length: usize,
... | Rust | 0 |
asury"))
}
}
}
impl core::fmt::Display for MessagePayload {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{:?}", self.payload)
}
}
//! Functionality for parsing options configured via `#[funcmap]` helper
//! attributes
//!
//! Note that this is implemented us... | Rust | 0 |
rest.is_empty() {
break;
}
match rest.split_first() {
Some((byte, rest)) => {
let enc = &[b'%', to_hex_digit(byte >> 4), to_hex_digit(byte & 15)];
push_str(unsafe { str::from_utf8_unchecked(enc) })?;
data = rest;
}
... | Rust | 0 |
///
/// [`Arena`]: ../../arena/index.html
#[derive(PartialEq, Eq, Hash)]
pub struct TestName(());
impl_arena_type!(S<TestName>, StringArena<TestName>);
impl S<TestName> {
/// Gets the actual test case name of the reference from the arena.
pub fn as_ref(&self) -> &str {
Self::arena().get(self)
}
}
... | Rust | 0 |
K_INPUT.as_ptr(),
) == 1
{
1
} else {
0
}
}
}
#[allow(clippy::missing_panics_doc)]
#[no_mangle]
#[export_name = "privateSub"]
pub extern "C" fn private_sub() -> i32 {
unsafe {
assert_eq!(
secp256k1_ec_seckey_negate(secp256k1_context_no... | Rust | 0 |
ubcommand::ExportState(cmd)) => {
let runner = cli.create_runner(cmd)?;
let chain_spec = &runner.config().chain_spec;
set_default_ss58_version(chain_spec);
Ok(runner.async_run(|mut config| {
let (client, _, _, task_manager) = service::new_chain_ops(&mut config, None)?;
Ok((cmd.run(client, config.c... | Rust | 0 |
char), // '+'
SubsequentSibling(char), // '~'
}
#[derive(Debug, PartialEq, Serialize)]
pub enum ComplexSelectorChildren {
Combinator,
SimpleSelector,
}
/// https://www.w3.org/TR/selectors-4/#complex
#[derive(Debug, Default, PartialEq, Serialize)]
pub struct ComplexSelectorNode {
/// Location information... | Rust | 0 |
from woningwaardering.vera.bvg.generated import Referentiedata
from woningwaardering.vera.referentiedatasoort import Referentiedatasoort
class BetalingsregelingstatusReferentiedata(Referentiedata):
pass
class Betalingsregelingstatus(Referentiedatasoort):
aangevraagd = BetalingsregelingstatusReferentiedata(
... | Python | 1 |
ure_application.columns[4:].to_list())
Straw_columns = pd.Series([x for x in Straw_burning.columns[1:].to_list()])
CH4_intestine_columns = pd.Series(CH4_intestine.columns[3:].to_list())
CH4_Fecal_management_columns = pd.Series(CH4_Fecal_management.columns[2:].to_list())
# Manure application data
... | Python | 1 |
import Foundation
import CoreFoundation
from PyObjCTools.TestSupport import TestCase, min_os_level
class TestNSISO8601DateFormatter(TestCase):
def test_enum_types(self):
self.assertIsEnumType(Foundation.NSISO8601DateFormatOptions)
@min_os_level("10.12")
def testConstants(self):
self.asser... | Python | 1 |
Info. 1 for mainnet, 0 for for the rest...
if global::is_mainnet() {
w.write(1, 1)?;
} else {
w.write(1, 0)?;
}
if write_amount {
Self::write_u64(slate.amount, true, w)?;
}
if write_fee {
Self::write_u64(slate.fee, true, w)?;
}
Self::write_u64(slate.height, false, w)?;
Self::write_u64(s... | Rust | 0 |
from dataclasses import dataclass
from day_6.guard import Guard
from day_6.position import Position
@dataclass
class ActivePiece():
position: Position
piece: Guard
| Python | 1 |
if 0 == out[num] {
vout = 0;
}
num = num.saturating_add(1);
}
*v = vout;
}
if *v != 0 {
trace!("VERIFIED PACKET!!!!!");
}
}
}
}
// return true for success, i.e... | Rust | 0 |
(outpoint: &[u8]) -> Result<TxIn, BSVErrors> {
TxIn::from_outpoint_bytes_impl(outpoint)
}
pub fn get_finalised_script(&self) -> Result<Script, BSVErrors> {
self.get_finalised_script_impl()
}
}
<filename>src/layout/font/system.rs
//! Support for detecting OS specific font paths and selecting... | Rust | 0 |
|| f == &"y" || f == &"e")
.collect::<Vec<&str>>();
let distances_fields = fields
.iter()
.copied()
.filter(|f| f == &"apo" || f == &"peri")
.collect::<Vec<&str>>();
// Integrate with initial values first
self.integrate(model, n, h, f... | Rust | 0 |
}
} else {
let mut tmp_ptr = Math(get_avail());
tmp_ptr.set_subtype_i32(MathType::Eq(BE::End, mode));
*LLIST_link(tmp_ptr.ptr()) = LR_ptr.tex_int();
LR_ptr = Some(tmp_ptr.ptr());
... | Rust | 0 |
-m4")]
#[interrupt]
#[allow(non_snake_case)]
fn USB_TRCPT0() {
poll_usb();
}
#[cfg(feature = "feather-m4")]
#[interrupt]
#[allow(non_snake_case)]
fn USB_TRCPT1() {
poll_usb();
}
<filename>tests/common.rs
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub struct A(pub u32);
#[derive(Clone,... | Rust | 0 |
pub fn enact_proposal(
origin: OriginFor<T>,
proposal: ProposalId,
metaverse_id: MetaverseId,
referendum_id: ReferendumId,
proposal_hash: T::Hash,
) -> DispatchResultWithPostInfo {
ensure_root(origin)?;
Self::do_enact_proposal(proposal, metaverse_id, referendum_id, proposal_hash);
Ok(().in... | Rust | 0 |
/// OF BUILDERS WITH NON-CryptoRng RNGs
fn new_internal(params: P, target_height: BlockHeight, rng: R) -> Builder<'a, P, R> {
Builder {
params: params.clone(),
rng,
target_height,
expiry_height: target_height + DEFAULT_TX_EXPIRY_DELTA,
fee: DE... | Rust | 0 |
ugment(img):
if hflip: # horizontal
cv2.flip(img, 1, img)
if vflip: # vertical
cv2.flip(img, 0, img)
if rot90:
img = img.transpose(1, 0, 2)
return img
def _augment_flow(flow):
if hflip: # horizontal
cv2.flip(flow, 1, flow)
... | Python | 1 |
"decoder_input_ids"] = shift_tokens_right(
model_inputs.labels, self.tokenizer.pad_token_id, self.model.config.decoder_start_token_id
)
model_inputs["return_dict"] = True
model_inputs["use_cache"] = False
with torch.no_grad():
outputs = self.model(**model_inputs)
... | Python | 1 |
pub pio_esr: PIO_ESR,
#[doc = "0xc4 - Level Select Register"]
pub pio_lsr: PIO_LSR,
#[doc = "0xc8 - Edge/Level Status Register"]
pub pio_elsr: PIO_ELSR,
_reserved40: [u8; 4usize],
#[doc = "0xd0 - Falling Edge/Low-Level Select Register"]
pub pio_fellsr: PIO_FELLSR,
#[doc = "0xd4 - Risin... | Rust | 0 |
::MouseState,
) {
let mouse_util = window.subsystem().sdl().mouse();
let (win_w, win_h) = window.size();
let (draw_w, draw_h) = window.drawable_size();
io.display_size = [win_w as f32, win_h as f32];
io.display_framebuffer_scale = [(draw_w as f32) / (win_w as f32), (draw_h ... | Rust | 0 |
/ assert!(player < 16, "Tried to poll input for invalid player number");
let state: InputState =
unsafe
{
InputState
{
button: [
ButtonState {pressed: retro_input_state_cb.unwrap()(player, RETRO_DEVICE_JOYPAD, 0, PadB as u32) != 0, down... | Rust | 0 |
), lr=learning_rate)
# ----------------------------
# Training
# ----------------------------
train_losses_history = []
start_time = time.time()
for epoch in tqdm(range(epochs)):
def closure():
total_loss, train_loss_dict = losses(model, points, b1, b2, b3, b4, points_test)
optimizer.zero_grad()
... | Python | 1 |
. ")
metric_name = "_".join(
[
part
for part in [
metric.get("namespace", "buildbuddy"),
metric.get("subsystem"),
metric.get("name"),
]
if part is not None
]
... | Python | 1 |
replay_data();
self.clear_map_data();
self.clear_observed_player_id();
self.clear_options();
self.clear_disable_fog();
self.clear_realtime();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for RequestStartReplay {
fn fmt(&self, f: &mut ::std::fmt::Format... | Rust | 0 |
tc = int(input().strip())
rtc = []
while tc > 0:
inp = ' '
shap = []
count = 0
while inp != '':
inp = input()
if inp == '':
break
else:
shap.append(list(inp))
count += 1
shapType = ''
shapStyle = shap[-1][-1]
siz = 0
if shap[0][... | Python | 1 |
cond_normal = df_merge_score[['values', 'min_bin', 'max_bin']].isna().any(axis=1)
df_score = df_merge_score[~cond_normal].copy()
cond_eq = (df_score['values'] == df_score.min_bin) & (df_score['values'] == df_score.max_bin)
cond_mid = (df_score['values'] > df_score.min_bin) & (df_score['... | Python | 1 |
)
cutoff_perc = 0.01
cutoff = total_size / 100 * cutoff_perc
byfile = {}
for e in entries:
lib = e["lib"]
tsize = e["total"]
if tsize < cutoff:
continue
k = f"{lib:25}: {tsize} ({tsize / total_size * 100:.2f}%)"
byfile[k] = []
print(k)
... | Python | 1 |
#!/usr/bin/env python3
import torch
import torch.cuda.profiler as profiler
from apex import pyprof
#The following creates an object "foo" of type ScriptModule
#The new object has a function called "forward"
@torch.jit.script
def foo(x, y):
return torch.sigmoid(x) + y
#Initialize pyprof after the JIT step
pyprof.nv... | Python | 1 |
"""Plot driver standings in a heatmap
======================================
Plot the points for each driven in each race of a given season in a heatmap, as
https://public.tableau.com/app/profile/mateusz.karmalski/viz/F1ResultsTracker2022
"""
import pandas as pd
import plotly.express as px
from plotly.io import show
... | Python | 1 |
yah kare düğme"],
},
#[cfg(feature = "ug")]
crate::Annotation {
lang: "ug",
tts: Some("قارا چاسا كۇنۇپكا"),
keywords: &["قارا چاسا كۇنۇپكا", "كىۋادرات", "كۇنۇپكا", "گېئومېتىرىيە"],
},
#[cfg(feature = "uk")]
crate::Annotation {
... | Rust | 0 |
}
/// Delete private overlay peers
pub fn delete_private_peers(
&self,
local_key: &Arc<KeyId>,
peers: &[Arc<KeyId>],
) -> Result<bool> {
let mut ret = false;
for peer in peers {
ret = self.adnl.delete_peer(local_key, peer)? || ret
}
Ok(ret... | Rust | 0 |
_handle"
type: DT_STRING
is_ref: true
}
attr {
name: "container"
type: "string"
default_value {
s: ""
}
}
attr {
name: "shared_name"
type: "string"
default_value {
s: ""
}
}
attr {
name: "project_id"
type: "string"
}
attr {
name: "dataset_i... | Python | 1 |
events have the record_created_date field with the real created date
for hit in result["hits"]["hits"]:
event = hit["_source"]
app.logger.error(f"Event: {pformat(event)}")
# The events should have a record_created_date field
assert (
"record_created_date" in event
... | Python | 1 |
io::Result<()> {
let srv_addr = [tcp.ip_addr.as_str(), tcp.port.to_string().as_str()].join(":");
let listener = TcpListener::bind(srv_addr).await?;
loop {
let (io, _) = listener.accept().await?;
tokio::spawn(BaseSrvConn {
io,
read_buf: BytesMut::with_capacity(4096),
... | Rust | 0 |
"""
PathchGAN implementation on Pytorch
Following paper's implementation, using 70 x 70 patchgan
"""
import torch.nn as nn
class PatchGAN(nn.Module):
def __init__(self, dim=64, norm='batch', sigmoid=True):
super(PatchGAN, self).__init__()
if norm == 'batch':
self.norm = nn.BatchNorm2... | Python | 1 |
####.##.#..##";
let asteroids = parse_asteroids(input);
let base = (11, 13);
let first_vaporized = vaporize(&base, &asteroids, 1);
assert_eq!(first_vaporized, (11, 12));
let second_vaporized = vaporize(&base, &asteroids, 2);
assert_eq!(second_vaporized, (12, 1));
... | Rust | 0 |
"""create plan items table
Revision ID: 54fa68773b31
Revises: 0e98bb5af4d2
Create Date: 2025-04-10 11:14:30.587947
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '54fa68773b31'
down_revision: Union[str, None] = '0e98bb5... | Python | 1 |
s]=ROOT.TH2D("curvFromPhiB_"+str(s),"",1024,-512,511,4*400,-8*400,8*400)
histos['phiBFromCurv'][s]=ROOT.TH2D("phiBFromCurv_"+str(s),"",256,-512,511,256,-511,512)
histos['phiProp'][s]=ROOT.TH2D("phiProp_"+str(s),"",binsk,-maxk,maxk,50,-200,200)
histos['phiPropChiV'][s]=ROOT.TH2D("phiPropChiV_"+str(s),"",bins... | Python | 1 |
import random
from utils.simulation.wildlife_tracker import WildLifeTracker
#imports WildLifeTracker which controls all trackers
class TerrestrialAnimalTracker(WildLifeTracker):
def __init__(
self,
device_name,
source_ip,
source_port,
heart_rate_range=(20, 90),
body... | Python | 1 |
&mut buf,
object_readers,
&task_opts,
&ProgressReporter::dummy(),
)
.map(move |bytes| (bytes, buf));
// Update done count.
let done = done_task_count.fetch_add(1, std::sync::atomic:... | Rust | 0 |
cation and multiplexing on all connections
let transport = dns_transport
.clone()
.or_transport(WsConfig::new(dns_transport))
.upgrade(upgrade::Version::V1)
.authenticate(noise)
.multiplex(YamuxConfig::default())
.boxed();
// multi... | Rust | 0 |
yPress {
pub key: Key,
pub modifier: u8,
}
impl KeyPress {
pub const NONE: u8 = 0b000;
pub const SHIFT: u8 = 0b001;
pub const CTRL: u8 = 0b010;
pub const ALT: u8 = 0b100;
pub fn new(key: Key, modifier: u8) -> Self {
Self { key, modifier }
}
}
/// Key types.
#[derive(PartialEq)]... | Rust | 0 |
Ok(())
}
SyscallOp::CNodeDelete => {
let cspace = tcb.cspace()?;
let cptr = tcb.get_mr(0);
let cap_slot = cspace.lookup_slot(cptr)?;
if cap_slot.get().cap_type() == ObjType::NullObj {
return Err(SysError::CapabilityTypeError);
... | Rust | 0 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: streamlit/proto/Block.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _de... | Python | 1 |
, 0.2, 0.3);
println!("abc (f32)");
println!(" 0.1 + 0.2: {:x}", (abc.0 + abc.1).to_bits());
println!(" 0.3: {:x}", (abc.2).to_bits());
println!();
println!("xyz (f64)");
println!(" 0.1 + 0.2: {:x}", (xyz.0 + xyz.1).to_bits());
println!(" 0.3: {:x}", (xyz.2).to_bits());... | Rust | 0 |
().map_err(failure::system("Unable to determine working directory."))?;
loop {
let candidate_path = candidate_dir.join(TOASTFILE_DEFAULT_NAME);
if let Ok(metadata) = fs::metadata(&candidate_path) {
if metadata.file_type().is_file() {
... | Rust | 0 |
Source {
pub fn set_price(currency_id: CurrencyId, price: Option<Price>) {
match currency_id {
SERP => SERP_PRICE.with(|v| *v.borrow_mut() = price),
DNAR => DNAR_PRICE.with(|v| *v.borrow_mut() = price),
LP_SETUSD_DNAR => LP_SETUSD_DNAR_PRICE.with(|v| *v.borrow_mut() = price),
LP_DNAR_SERP => LP_DNAR_SERP... | Rust | 0 |
w: self } }
}
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::AudioChannelPosition;
use std::mem;
use glib::translate::{from_glib, IntoGlib};
impl AudioChannelPosition {
pub fn to_mask(self) -> u64 {
let pos = self.into_glib();
if pos < 0 {
... | Rust | 0 |
_next_method(
mut iterator: *mut libc::c_void,
) -> libc::c_int {
println!("Mdata iterator next...");
let mut context: *mut librdf_mdatas_iterator_context =
iterator as *mut librdf_mdatas_iterator_context;
let len = (*context).mdatas_ptrs.len();
if (*context).current >= len {
retur... | Rust | 0 |
in(ipdl_dir, 'ipdlsrcs.mk')) as ipdls:
mk.dump(ipdls, removal_guard=False)
def _handle_webidl_build(self, bindings_dir, unified_source_mapping,
webidls, expected_build_output_files,
global_define_files):
include_dir = mozpath.join(self.e... | Python | 1 |
These times are valid DateTimes
(i32::MIN as i64) - 1,
(i32::MIN as i64),
(i32::MIN as i64) + 1,
-1,
0,
1,
LockTime::MIN_TIMESTAMP - 1,
LockTime::MIN_TIMESTAMP,
LockTime::MIN_TIMESTAMP + 1,
];
/// Invalid unix epoch timestamps for blocks, in seconds
static BLOCK_HEADER_INVALID_TIMES... | Rust | 0 |
alue.
pub fn number<T>(t: T) -> Value
where
f64: From<T>,
{
Value::Number(From::from(t))
}
/// Makes an anonymous `Object` value.
pub fn object<I, K>(entries: I) -> Value
where
I: Iterator<Item = (K, Value)>,
String: From<K>,
{
Value::Object {
class_name: None,
entries: entries
... | Rust | 0 |
111083081497,
]
);
pub static ref SMITS_WHITE: VSPD = VSPD::from_values(SpdShape::new(380.0, 720.0, 10.9375),
&[
1.0618958571272863e+00,
1.0615019980348779e+00,
1.0614335379927147e+00,
1.0622711654692485e+00,
1.0622036218416742e+00,
... | Rust | 0 |
ize, dwflags: u32, langid: u16) -> super::super::Foundation::BOOL;
#[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
pub fn EnumResourceTypesExW(hmodule: super::super::Foundation::HINSTANCE, lpenumfunc: ENUMRESTYPEPROCW, lparam: isi... | Rust | 0 |
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from neo4j_graphrag.embeddings.base import Embedder
import abc
if TYPE_CHECKING:
import openai
class BaseOpenAIEmbeddings(Embedder, abc.ABC):
client: openai.OpenAI
def __init__(self, model: str = "text-embedding-3-large", dimensions... | Python | 1 |
where
S: AsRef<str>,
E: Expression,
E::Atom: FromIterator<char>,
E::Group: FromIterator<E>,
{
// TODO: should we interface with `FromStr` for atoms or `FromIterator<char>`?
from_chars_as_group::<_, E>(s.as_ref().chars())
}
/// [`Expression`] Parser from ... | Rust | 0 |
"""JSON-compatible module with sane defaults."""
from json import * # noqa: F401, F403
from json import loads as original_loads
def _safe_int(s):
if len(s) > 100:
raise ValueError('Integer is too large')
return int(s)
def loads(*args, **kwargs):
if 'parse_int' not in kwargs: # pragma: no cove... | Python | 1 |
1.0e-14), 1.000000000000005772156649015427511664653698987042926067639529);
assert_almost_eq!(super::gamma(1.0), 1.0, 1e-15);
assert_almost_eq!(super::gamma(1.0 + 1.0e-14), 0.99999999999999422784335098477029953441189552403615306268023, 1e-15);
assert_almost_eq!(super::gamma(1.5), 0.8862269254527... | Rust | 0 |
.map(|(i, &j)| cost_matrix[i][j])
.sum::<T>(),
epsilon = T::epsilon()
);
}
fn compare_with_brute<T: Value + Debug>(cost_matrix: &[Vec<T>], result: &HungarianResult<T>) {
let h = cost_matrix.len();
let w = cost_matrix[0].len();
let mut ... | Rust | 0 |
("[0-9]+").unwrap();
re.find(arg).ok_or(ArgError::Parse("not a number"))?;
let n: u64 = r
.find(arg)
.ok_or(ArgError::Parse("not a number"))?
.as_str()
.parse()?;
Ok(n)
}
use crate::bitmap::index::BuildIndex;
use crate::bitmap::index::RankIndex;
use crate::bitmap::rank::Ra... | Rust | 0 |
/itertools/).
//!
//! * **Combine iterators in sorted order** (advanced)
//!
//! For advanced usage (eg matrix reduction), we also provide a
//! customized merge process in the [hit_merge](utilities::iterators::hit_merge) module.
//!
//! * **Add**
//!
//! We can add the vectors represented by `iter_a... | Rust | 0 |
ormat=None, **kwargs):
super(Maxima2D, self).__init__(**kwargs)
# Update to K.normalize_data_format after keras 2.2.0
if parse_version(keras.__version__) > parse_version("2.2.0"):
self.data_format = K.normalize_data_format(data_format)
else:
self.data_format = con... | Python | 1 |
from setuptools import find_packages, setup
VERSION = "4.0.0"
LONG_DESCRIPTION = """
.. image:: http://pinaxproject.com/pinax-design/patches/pinax-likes.svg
:target: https://pypi.python.org/pypi/pinax-likes/
===========
Pinax Likes
===========
.. image:: https://img.shields.io/pypi/v/pinax-likes.svg
:target:... | Python | 1 |
n.h5")
objFromrefFilename = os.path.join(ycb_data_folder, target_object, "rgbd", "poses",
"{0}_{1}_pose.h5".format(referenceCamera, viewpoint_angle))
calibration = h5.File(calibrationFilename, "r")
try:
depthK = calibration[f"{viewpoint_camera}_depth_K"][:] # u... | Python | 1 |
texto = input("Ingrese un parrafo de un poema: ")
print(f"\nTexto ingresado:\n{texto}")
letras_favoritas = input("Ingrese 3 letras favoritas separadas por comas: ")
# Pasamos a letras minúsculas para evitar problemas de coincidencia
texto_minuscula = texto.lower()
letras_favoritas = [letra.strip().lower() for letra in... | Python | 1 |
use hal::format::Format::*;
// TODO: list may be incomplete or partially wrong..
let format = match format {
R5g6b5Unorm => DXGI_FORMAT_B5G6R5_UNORM,
R5g5b5a1Unorm => DXGI_FORMAT_B5G5R5A1_UNORM,
R8Unorm => DXGI_FORMAT_R8_UNORM,
R8Inorm => DXGI_FORMAT_R8_SNORM,
R8Uint... | Rust | 0 |
std::fmt::Debug;
#[derive(BartDisplay, Debug, Default)]
#[template = "templates/nt_grammar_graph.dot"]
struct NtDotElements<'a> {
title: &'a str,
start_symbol: &'a str,
productions: StrVec,
terminals: StrVec,
non_terminal_types: StrVec,
non_terminal_instances: StrVec,
non_terminal_to_produc... | Rust | 0 |
asynchronous self-update task.
#[async_trait]
pub trait StandaloneMetrics: Metrics {
/// Update metric values.
async fn update(&self);
/// Metrics update interval.
fn update_interval(&self) -> Duration;
/// Spawn the self update task that will keep update metric value at given intervals.
fn spawn(self) {
asy... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time, math, argparse
from dronekit import connect, VehicleMode, Command, LocationGlobalRelative
from pymavlink import mavutil
def upload_mission(vehicle):
cmds = vehicle.commands
cmds.clear()
# 1) Sabit HOME konumu (senin file’daki 584.089966m yüksekl... | Python | 1 |
\x05\x0b\x05\x0c\x05\x0d\x05\x0e\x05\x0f\x05\
\x10\x05\x11\x05\x12\x05\x13\x05\x14\x05\x15\x05\x16\x05\x17\x05\
\x18\x05\x19\x05\x1a\x05\x1b\x05\x1c\x05\x1d\x05\x1e\x05\x1f\x05\
\x05!\x05\x22\x05#\x05$\x05%\x05&\x05'\x05\
(\x05)\x05*\x05+\x05,\x05-\x05.\x05/\x05\
0\x051\x052\x053\x054\x055\x056\x057\x05\
8\x059\x05:\x... | Python | 1 |
UnionTypeField;
fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.write_str("type field")
}
fn visit_str<E>(self, value: &str) -> Result<UnionTypeField, E>
where
E: Error,
{
match value {
... | Rust | 0 |
ngTimes = []
self._firingNodes = []
def results(self) -> Dict[str, Any]:
'''Add the final phases of all oscillators to the results.
:returns: the experimental results'''
rc = super().results()
# final phases of all oscillators
g = self.network()
t = self.c... | Python | 1 |
flat_map(|m| m.range()).collect(),
Err(_) => vec![],
}
}
fn display_view(&self, value: View) -> String {
match value {
View::Sorted => String::from("sorted"),
View::Favorites => String::from("favorites"),
View::All => String::from("all"),
... | Rust | 0 |
macro_rules! trace {
($s:literal, $($arg:tt)+) => (
log::trace!(concat!(":{} ", $s), line!(), $($arg)+);
)
}
/** A received http body
This type represents a body that will be read from the underlying
transport, which it may either borrow from a [`Conn`](crate::Conn) or
own.
```rust
# trillium_testin... | Rust | 0 |
# operasi boolean
#operasi not (input)
print("--- Operasi Not (input) ---")
a = bool (input("Masukkan nilai true or false : "))
b = bool (input("Masukkan nilai true or false : "))
hasil = not a
hasil1 = not b
print("Hasil dari Not ", a, "adalah", hasil)
print("hasil dari Not ", b, "adalah", hasil1)
#operasi and
pri... | Python | 1 |
.as_bytes())?
}
serde_json::Value::Object(ref o) => {
if o.is_empty() {
f.write_all(b"{}")?
} else {
_display_map(f, o, t, indent)?
};
}
};
Ok(())
}
fn _display_array(
f: &mut Write,
a: &[serde_json::Value],
... | Rust | 0 |
{"en": "garter straps", "ja": "ガーターストラップ"}, {"en": "suspenders", "ja": "サスペンダー"},
{"en": "belt", "ja": "ベルト"}, {"en": "zipper", "ja": "ジッパー"},
{"en": "buttons", "ja": "ボタン"}
]
},
{
"id": "clothes_state_action",
"name": "服装の状態/アクション",
"... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.