text string | label_name string | labels int64 |
|---|---|---|
import datetime
import tempfile
from copy import copy
from socket import gethostname
import absl.flags as flags
import ml_collections
import wandb
def _recursive_flatten_dict(d: dict):
keys, values = [], []
for key, value in d.items():
if isinstance(value, dict):
sub_keys, sub_values = _r... | Python | 1 |
Z0;
#[allow(non_camel_case_types)]
type _0PartialDivP4 = <<A as PartialDiv<B>>::Output as Same<_0>>::Output;
assert_eq!(<_0PartialDivP4 as Integer>::to_i64(), <_0 as Integer>::to_i64());
}
#[test]
#[allow(non_snake_case)]
fn test__0_Pow_P4() {
type A = Z0;
type B = PInt<UInt<UInt<UInt<UTerm, B1>,... | Rust | 0 |
b3 as wbgmeyqdaxd, mi14zxm18ui, pz6ilj4e6vr as v3l0ejdoc8s, u570iv64zuq, qbe2ycqynju as lkiz6rpzn4o
wbx6rp4po9f
def q9btfccok7_(ns2ymkwy4by: fw4y7az9wh9=None, eiuuovdsz0o=0.0, nhjgt7qkv46: lvkn3io7sim=b'', qpgahprzx8t=0, rguxr63g8jw: qdxrbc2br0_=0j, tzy2k415z3m=False, nzh6ufxeq78: dk6kk46iroy=0j, ph1x7d2_jhv: c316d... | Python | 1 |
);
Ok(())
}
}
<reponame>mjmorais/treerite
fn main() {
add_search_path();
add_llvm_path();
build_lib();
}
#[cfg(feature = "static")]
fn build_lib() {
let dst = cmake::Config::new("treelite")
.define("BUILD_STATIC_LIBS", "ON")
.build();
println!("cargo:rustc-link-search... | Rust | 0 |
import re
import bleach
from bleach.callbacks import nofollow, target_blank
def remove_line_breaks(target_string: str) -> str:
return target_string.replace('\r', '')
def strip_line_breaks(target_string: str) -> str:
return target_string.replace('\n', '').replace('\r', '')
def clean_up_string(target_strin... | Python | 1 |
(Type),
Const(Const),
}
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
pub struct Lifetime {
pub debruijn_index: Base62Number,
}
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
pub struct Binder {
pub count: Base62Number,
}
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
pub enum Type {
BasicType(BasicType),... | Rust | 0 |
import turtle
import random
#Turtle List
turtle_list=[]
#Screen
drawing_board=turtle.Screen()
drawing_board.bgcolor("green")
drawing_board.title("Turtle Game ")
FONT=('Arial',30,'normal')
score=0
game_over=False
score_turtle=turtle.Turtle()
countdown_Turtle=turtle.Turtle()
def Setup_Score_Turtle():
#score Turtle
... | Python | 1 |
en.NAME for u in tokens[i - 2 : i])
and [u.string for u in tokens[i - 2 : i]] == ["from", "__future__"]
):
futureimpline = True
if t.type == token.NEWLINE and futureimpline:
futureimpline = False
if fullname == "mercurial.pycompat":... | Python | 1 |
= a_listing.highest_bid;
let mut creator_token_manager = bank_read(&deps.storage).may_load(creator_key)?.unwrap_or_default();
creator_token_manager.token_balance = creator_token_manager.token_balance + price;
bank(&mut deps.storage).save(creator_key, &creator_token_manager)?;
let mut bidder_token_man... | Rust | 0 |
if inner.access.contains(memory::READ) {
let memory_range = vk::MappedMemoryRange {
sType: vk::STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
pNext: ptr::null(),
memory: inner.buffer.resource().memory,
offset: 0,
... | Rust | 0 |
}
pub fn cur_pots(&self) -> impl Iterator<Item = &PotStatus> {
self.pots.iter()
}
pub fn ind_offset(&self) -> i32 {
self.first_ind
}
pub fn pots_str(&self) -> String {
let mut res = String::new();
for status in &self.pots {
res.push(match status {
... | Rust | 0 |
)
self.assertIs(
avatar_xso.Pointer.height.default,
None
)
def test_as_payload_class(self):
with contextlib.ExitStack() as stack:
at_Pointer = stack.enter_context(
unittest.mock.patch.object(
avatar_xso.Pointe... | Python | 1 |
z: p_obj.z,
})
.normalize();
if self.reverse_orientation {
it.n *= -1.0 as Float;
}
// reproject _p_obj_ to sphere surface and compute _p_obj_error_
p_obj *= self.radius / pnt3_distancef(&p_obj, &Point3f::default());
let p_obj_error: V... | Rust | 0 |
qttUtf8String");
protocol_name.serialize(buf);
let protocol_version = MqttOneBytesInt::new(5);
protocol_version.serialize(buf);
self.flags.serialize(buf);
self.keep_alive.serialize(buf);
self.props.serialize(buf);
self.clientid.serialize(buf);
if let... | Rust | 0 |
# Copyright 2025 DeepMind Technologies Limited
#
# 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 agre... | Python | 1 |
lename of rendered html
"""
if 'html' not in filename:
filename = os.path.join(filename, ".html")
html_plate = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GitHub Actions Dashboard</title>
<sc... | Python | 1 |
: f64,
//! }
//! ```
//!
//! Every symbol except the start symbol we need to annotate with `#[derive(LemonTreeNode)]`, and the start symbol with `#[derive(LemonTree)]`.
//! Parser rules that return this symbol we put into `#[lem()]` annotation attributes.
//! All `#[derive(LemonTreeNode)]`, `#[derive(LemonTree)]` and `... | Rust | 0 |
FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, O... | Rust | 0 |
ach episode
self.episodeTdErr = deque()
# record some sample of weights, once after episode
self.episodeWeights = deque()
# record some sample of weights, once each step, for observing the vary of weights
self.weights = deque()
if self.compatibilityMode:
# bu... | Python | 1 |
");
//! break;
//! }
//! # #[cfg(not(windows))]
//! SIGQUIT => {
//! eprintln!("Terminating on the QUIT signal");
//! break;
//! }
//! _ => unreachable!(),
//! }
//! }
//!
//! Ok(())
//! }
//! ```
/... | Rust | 0 |
trol_binding: Gst.ControlBinding
//}
fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_active_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTrackElement,
_param_spec: glib_sys::gpointer,
... | Rust | 0 |
import pandas as pd
import matplotlib.pyplot as plt
# ==============================
# Leitura e preparação dos dados
# ==============================
df = pd.read_csv("data/vendas.csv", parse_dates=["data"])
df.dropna(subset=["produto", "quantidade", "preco_unitario"], inplace=True)
if "valor_total" not in df.column... | Python | 1 |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import CustomUser
@admin.register(CustomUser)
class CustomUserAdmin(UserAdmin):
fieldsets = UserAdmin.fieldsets + (
('Дополнительные поля', {'fields': ('telegram_id',)}),
)
add_fieldsets = UserAdmin.add_... | Python | 1 |
15:00:52",
"Size": 10032728,
"ContactedHost": ["136.243.154.86", "52.84.125.27"],
"DnsRequest": ["cloud.nitehe-nutete.com", "isrg.trustid.ocsp.identrust.com", "offers.filezilla-project.org"],
"PositiveDetections": 1,
"Name": "FileZilla_3.47.2.1_win64_sponsored... | Python | 1 |
if mcu_y > 0 {
rb[i] =
results[i][(mcu_y - 1) * frame.image_size.width as usize + mcu_x];
if mcu_x > 0 {
rc[i] = results[i]
[(mcu_y - 1) * frame.imag... | Rust | 0 |
refer to the ["choose a combinator" guide](https://github.com/Geal/nom/blob/master/doc/choosing_a_combinator.md) for an exhaustive list of parsers.
//! See also the rest of the documentation [here](https://github.com/Geal/nom/blob/master/doc).
//! .
//!
//! ## Making new parsers with function combinators
//!
//! nom i... | Rust | 0 |
et name = standard_op_name(&self, &self.name, graph, &[self.input_id.clone()], &[self.output_id.clone()]);
{
let input_shape = self.input_id.shape();
if self.axes.len() == 0 {
for i in 0..input_shape.ndim() {
if matches!(input_shape.dimensions()[i], NodeDim::Known(_)) {
self.axes.push(i as isize... | Rust | 0 |
ut
} => process_approve_kicker_coin(program_id, accounts),
ShihonInstruction::DenyKickerCoin {} => process_deny_kicker_coin(program_id, accounts),
ShihonInstruction::Candidate { coordinator, amount }, {} => process_candidate(program_id, accounts),
ShihonInstruction::MixContent {
time_shift_a,... | Rust | 0 |
ok!(test_benchmark_lock_price());
});
}
#[test]
fn test_unlock_price() {
new_test_ext().execute_with(|| {
assert_ok!(test_benchmark_unlock_price());
});
}
}
<reponame>urschrei/polyline-ffi
vec![
[52.48803, 13.37053],
[52.48941, 13.37067],
[52.49048, 13.37073],
[52.49072, 13.37078],
[52... | Rust | 0 |
ow.className="toggle-arrow"; arrow.innerHTML="▶";
header.appendChild(titleW); header.appendChild(arrow);
block.appendChild(header);
const wrapper = document.createElement("div"); wrapper.className="subcat-list"; wrapper.style.paddingLeft="12px";
const row = document.createElement("div"); row.cla... | Python | 1 |
u8 = 0;
let mut regs_write_count: u8 = 0;
let rc_ptr: *mut u8 = &mut regs_read_count;
let wc_ptr: *mut u8 = &mut regs_write_count;
let res = unsafe {
cs_regs_access(self.csh,
&insn.0 as *const cs_insn,
rr_ptr,
... | Rust | 0 |
}
#[derive(Debug)]
#[allow(non_camel_case_types)]
struct MyStructField2_Meth1(usize);
impl IntrusiveBase for MyStructField2_Meth1 {
type Container = MyStruct;
type Field = i32;
fn offset() -> usize {
containerof_field_offset!(MyStruct:field2)
}
unsafe fn new(ia: IntrusiveAlias) -> Self {
... | Rust | 0 |
"""
Using This Code Example
=========================
The code examples provided are provided by Daniel and Audrey Feldroy of
Feldroy to help you reference Django Crash Course. Code samples follow
PEP-0008, with exceptions made for the purposes of improving book
formatting. Example code is provided "as is".
Permission... | Python | 1 |
import tkinter as tk
from tkinter import messagebox
import math
def calculate_percentage(expression):
"""Calculate percentage in the expression."""
operators = ['+', '-', '*', '/']
for operator in operators:
if operator in expression:
# Split the expression based on the operator
... | Python | 1 |
kRef);
fn WebmVideoTrackGetWidth(track: WebmVideoTrackRef) -> c_longlong;
fn WebmVideoTrackGetHeight(track: WebmVideoTrackRef) -> c_longlong;
fn WebmVideoTrackGetFrameRate(track: WebmVideoTrackRef) -> c_double;
fn WebmAudioTrackDestroy(track: WebmAudioTrackRef);
fn WebmAudioTrackGetSamplingRate(tra... | Rust | 0 |
import torch
import os
import pickle
import yaml
import numpy as np
import matplotlib.pyplot as plt
def pload(*f_names):
"""Pickle load"""
f_name = os.path.join(*f_names)
with open(f_name, "rb") as f:
pickle_dict = pickle.load(f)
return pickle_dict
def pdump(pickle_dict, *f_names):
"""Pic... | Python | 1 |
------- 登陆类型开关 ------------
# 是否禁用 普通 登录
self.disable_login_mode_normal = False
# 是否禁用 QQ空间 登录
self.disable_login_mode_qzone = False
# 是否禁用 爱玩 登录
self.disable_login_mode_iwan = False
# 是否禁用 安全管家 登录
self.disable_login_mode_guanjia = False
# 是否禁用 心悦 ... | Python | 1 |
WriteStorage<'a, NextFrame<BodyPose3<f32>>>,
WriteStorage<'a, RotationControl>,
Read<'a, WindowFocus>,
Read<'a, HideCursor>,
ReadStorage<'a, FlyControlTag>,
);
fn run(
&mut self,
(
events,
mut transforms,
mut body_poses,
... | Rust | 0 |
t_visit::noop_flat_map_impl_item(i, self);
}
mut_visit::noop_flat_map_impl_item(i, self)
}
fn flat_map_field_def(&mut self, mut sf: FieldDef) -> SmallVec<[FieldDef; 1]> {
if !self.st.marked(sf.id, self.label) {
return mut_visit::noop_flat_map_field_d... | Rust | 0 |
from flask import Blueprint, render_template, request
views = Blueprint(__name__, "views")
| Python | 1 |
)
for _, r0 in tail.iterrows():
last_ts_by[r0["symbol"]] = int(r0["ts"])
last_bp_by[r0["symbol"]] = float(r0["bp"])
last_ap_by[r0["symbol"]] = float(r0["ap"])
last_bsz_by[r0["symbol"]] = float(r0["bsz"])
last_asz_by[r0["symbol"]... | Python | 1 |
using=True` we should see an Error
with self.assertRaises(ValueError):
pipe.fuse_lora(components=self.pipeline_class._lora_loadable_modules, safe_fusing=True)
# without we should not see an error, but every image will be black
pipe.fuse_lora(components=self.pipeline_... | Python | 1 |
es_net = tf.pad(res_net, paddings, 'REFLECT')
res_net = layers.conv2d(res_net, num_filters * 4,
activation_fn=None)
net += res_net
end_points['resnet_block_%d' % block_id] = net
###########
# Decoder #
###########
with tf.variable... | Python | 1 |
a + Result<T,E> + 'a>) { //~ ERROR expected trait, found
//~^ ERROR only a single explicit lifetime bound is permitted
panic!()
}
struct Traitor;
trait Trait {}
fn g() -> Traitor + 'static { //~ ERROR expected trait, found struct `Traitor`
A
}
fn main() {}
<filename>examples/displacement_mapping.rs
extern crate... | Rust | 0 |
# Ejercicio 2: Operaciones de conjuntos con listas
# Este programa trabaja con 2 listas de palabras y que a continuacion
# 1. Lista de palabras que aparecen en las listas.
# 2. Lista de palabras que aparecen en la primera lista, pero no en la segunda.
# 3. Lista de palabras que aparecen en la segunda lista, pero no en ... | Python | 1 |
_end_step = tuning_cfg.get('profile_end_step', 1)
tuning.run_after_tuning = tuning_cfg.get('run_after_tuning', True)
tuning.debug = tuning_cfg.get('debug', True)
engine_cfg = config['Engine']
engine_cfg['strategy'] = strategy
def process_auto_ckpt_dir(config):
configs = config["Engine"]["save_loa... | Python | 1 |