text string | label_name string | labels int64 |
|---|---|---|
# coding: utf-8
"""
KlimAPI - Calculation & Compensation API
This API offers you the possibility to calculate and offset emissions, create checkout links, get statistics and much more.
API Version: v2
Contact: tech@klimapi.com
Do not edit the class manually.
""" # noqa: E501
import unittest
... | Python | 1 |
from sqlalchemy import create_engine
from sqlalchemy.orm import declarative_base, sessionmaker
engine = create_engine("postgresql://postgres:2244@localhost/pizza-delivery",
echo=True
)
"""
The create_engine function creates a new instance of the Engine class. The first ar... | Python | 1 |
BufferPool::upload(queue.device().clone());
let mut fps_counter = FpsCounter::<20>::new();
loop {
let frame = match self.capture() {
Ok(frame) => frame,
Err(CameraCaptureError::Timeout) => continue,
Err(err) => return Err(err.into()),
};
fps_counter.tick();
debug::set_flag(... | Rust | 0 |
x & 0b10000000 != 0 { // sign bit set
cpu.R[rr_reg_d(iword0)] |= 0xFFFFFF00;
}
},
};
} else {
cpu.seg_fault(iword0, addr);
}
},
0b01000101 => { // RMX HSF, half sign extend
let addr = cpu.gen_addr_rmx(rm_seg_s(iword1), rr_reg_r(iwo... | Rust | 0 |
out_file.write("- Manufacturer: {}\n".format(each_data['input_manufacturer']))
if 'measurements_name' in each_data and each_data['measurements_name']:
out_file.write("- Measurements: {}\n".format(each_data['measurements_name']))
if 'interfaces' in each_data and ... | Python | 1 |
uniforms[DL_UNI_SCROLL+1];
let mut x2 = x1 + w;
let mut y2 = y1 + h;
let min_x = self.uniforms[DL_UNI_CLIP+0];
let min_y = self.uniforms[DL_UNI_CLIP+1];
let max_x = self.uniforms[DL_UNI_CLIP+2];
let max_y = self.uniforms[DL_UNI_CLIP+3];
x1 = min_x.max(x1).min(max... | Rust | 0 |
urnal_db.get(b'1') == b'test-b'
assert memory_db.exists(b'1') is False
journal_db.persist()
assert len(journal_db.journal.journal_data) == 1
assert memory_db.get(b'1') == b'test-b'
def test_journal_restarts_after_write(journal_db, memory_db):
journal_db.set(b'1', b'test-a')
journal_db.persis... | Python | 1 |
desc = desc.next_descriptor();
}
let len = if !iovecs.is_empty() {
let result = unsafe {
libc::readv(
tap.as_raw_fd() as libc::c_int,
iovecs.as_ptr() as *const libc::iovec,
iovecs.len() a... | Rust | 0 |
s_jobinfo["exit_status"] = os.EX_SOFTWARE
cosmos_jobinfo["successful"] = False
else:
cosmos_jobinfo["successful"] = True
return cosmos_jobinfo
def create_empty_drmaa_jobinfo(exit_status):
return dict(
exit_status=int(exit_status),
successful=(int(exit_status) == 0),
... | Python | 1 |
> {
Automaton1D(&'a mut Automaton1D),
Automaton2D(&'a mut Automaton2D),
Automaton3D(&'a mut Automaton3D),
Automaton4D(&'a mut Automaton4D),
Automaton5D(&'a mut Automaton5D),
Automaton6D(&'a mut Automaton6D),
}
/// Cellular automaton simulation, including a grid of cells (stored using an
/// `Nd... | Rust | 0 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
def stratified_random(
bounds, # [N, 2]
bins, # [N]
):
assert(len(bounds) == len(bin... | Python | 1 |
# SPDX-FileCopyrightText: 2020 Bryan Siepert, written for Adafruit Industries
# SPDX-License-Identifier: MIT
from time import sleep
import board
import busio
from adafruit_as7341 import AS7341
i2c = busio.I2C(board.SCL, board.SDA)
sensor = AS7341(i2c)
def bar_graph(read_value):
scaled = int(read_value / 1000)
... | Python | 1 |
import pytest
from marsh.exceptions import ScriptError
from marsh import Script
from marsh.bash import BashScript
def test_bash_script_subclass():
assert issubclass(BashScript, Script)
@pytest.fixture
def setup_bash_script():
bash_script = BashScript()
return bash_script
def test_bash_script_instanti... | Python | 1 |
of Vanity Registry.
// 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, softwa... | Rust | 0 |
alue::Real
));
/// Reasons for converting to a f64 from a parse triple (left, _, right) to fail.
pub enum RealParseError {
/// When left is not parse-able as `str`.
IntegerPartUnparseable,
/// When right is not parse-able as `str`.
FractionalPartUnparseable,
/// When the combination is not a... | Rust | 0 |
save_path = saver.save(sess, checkpoints_dir + "/model.ckpt", global_step=step)
logging.info("Model saved in file: %s" % save_path)
step += 1
except KeyboardInterrupt:
logging.info('Interrupted')
coord.request_stop()
except Exception as e:
coord.request_stop(e)
... | Python | 1 |
ageTarget::active_target();
let wrong_target = wrong_package_target();
// This installed package is older but matching the active package target
let matching_ident_s = "dream-theater/systematic-chaos/1.1.1/20180704142702";
let matching_pkg_install = testing_package_install(matching_iden... | Rust | 0 |
import enum
import sqlalchemy as sa
import sqlalchemy.ext.hybrid as sa_hybrid
import sqlalchemy.orm as sa_orm
from sqlalchemy.sql.elements import ColumnElement
class ValidationStatus(enum.Enum):
NEW = "NEW"
PENDING = "PENDING"
VALIDATED = "VALIDATED"
REJECTED = "REJECTED"
DELETED = "DELETED"
... | Python | 1 |
# Contains code from https://github.com/pandas-dev/pandas/blob/main/pandas/io/common.py
"""Common IO api utilities"""
from __future__ import annotations
from collections import defaultdict
from typing import DefaultDict, Hashable, Sequence
def dedup_names(
names: Sequence[Hashable],
is_potential_multiindex: ... | Python | 1 |
#[cfg(not(test))]
let tree = Tree::new(
usable,
TreeBox::Bootstrap(
unsafe {
BOOTSTRAP_HEAP.allocate().expect("Ran out of bootstrap heap memory!")
}
)... | Rust | 0 |
Instance,
entry: &ash::vk::StaticFn,
) -> Result<Self, Vec<&'static str>> {
Self::load(|name| unsafe {
::std::mem::transmute(entry.get_instance_proc_addr(instance, name.as_ptr()))
})
}
/* #[cfg(target_os = "macos")]
fn create_surface(
&self,
instance:... | Rust | 0 |
import re
def formatar_resposta(resposta, sql_usado):
"""
Formata a resposta do agente, incluindo o SQL usado se disponível.
"""
if sql_usado:
return f"{resposta}\n\nSQL usado:\n```sql\n{sql_usado}\n```"
return resposta
def extrair_sql_da_resposta(resposta):
"""
Extrai o SQL de uma... | Python | 1 |
v: Path to the Pre-Experiment Questionnaire CSV file.
- output_folder: Directory to save output JSON files.
- num_experiments: Total number of experiments (participants).
- num_sessions: Total number of sessions.
- thresholds: List of thresholds for pose data.
"""
pre_experiment_csv = os.path.jo... | Python | 1 |
RingFinanceError::InvalidStableAccountOwner,
constraint = initializer_stable_token.mint.eq(&stable_mint.key()) @ OneRingFinanceError::InvalidStableMint,
constraint = initializer_stable_token.amount >= args.amount @ OneRingFinanceError::InsufficientStableBalance,
)]
pub initializer_stable_token: ... | Rust | 0 |
// This shouldn't be possible unless there's a bug in the planner
panic!("document scorer: stack size too big ({})", stack.len());
}
Ok(stack.pop().expect("document scorer: stack underflow"))
}
fn search_segment<C: Collector, S: Segment, R: StatisticsReader>(collector: &mut C, plan: &SearchPlan, ... | Rust | 0 |
lm.namespaces.mdt-fs-MDT0000_UUID.lock_timeouts=0
ldlm.namespaces.mdt-fs2-MDT0000_UUID.lock_timeouts=0
ldlm.namespaces.mdt-fs-MDT0000_UUID.lock_unused_count=0
ldlm.namespaces.mdt-fs2-MDT0000_UUID.lock_unused_count=0
ldlm.namespaces.mdt-fs-MDT0000_UUID.lru_max_age=3900000
ldlm.namespaces.mdt-fs2-MDT0000_UUID.lru_max_age... | Rust | 0 |
or port 1 pins PIO1_27"]
pub pio1_27: crate::Reg<pio1_27::PIO1_27_SPEC>,
#[doc = "0xf0 - Digital I/O control for port 1 pins PIO1_28"]
pub pio1_28: crate::Reg<pio1_28::PIO1_28_SPEC>,
#[doc = "0xf4 - Digital I/O control for port 1 pins PIO1_29"]
pub pio1_29: crate::Reg<pio1_29::PIO1_29_SPEC>,
#[d... | Rust | 0 |
tring {
let mut parents = HashSet::new();
let mut children = HashSet::new();
lines.iter().for_each(|line| {
let parts: Vec<&str> = line.split_ascii_whitespace().collect();
// ktlj (57)
parents.insert(parts[0]);
for part in parts.into_iter().skip(3) {
// fwft (72) ... | Rust | 0 |
pub info_log_max_size: ReadableSize,
#[config(skip)]
pub info_log_roll_time: ReadableDuration,
#[config(skip)]
pub info_log_keep_log_file_num: u64,
#[config(skip)]
pub info_log_dir: String,
#[config(skip)]
pub info_log_level: LogLevel,
#[config(skip)]
pub max_sub_compactions: u... | Rust | 0 |
}
#[test]
fn small_int() {
let pg_type: PgType = (&SqlType::small_int()).into();
assert_eq!(pg_type, PgType::SmallInt);
}
#[test]
fn integer() {
let pg_type: PgType = (&SqlType::integer()).into();
assert_eq!(pg_type, PgType::Integer);
}
#[test]
fn big_int() {
let pg_type: PgType = (&SqlType::big... | Rust | 0 |
evEvent::Added { device_id, path } => udev_handler.device_added(device_id, path),
UdevEvent::Changed { device_id } => udev_handler.device_changed(device_id),
UdevEvent::Removed { device_id } => udev_handler.device_removed(device_id),
})
.map_err(|e| -> IoError { e.into() })
... | Rust | 0 |
from collections import OrderedDict
from typing import Dict, Optional
from faker.typing import SexLiteral
from .. import ElementsType
from .. import Provider as PersonProvider
def translit(text: str) -> str:
translit_dict: Dict[str, str] = {
"а": "a",
"б": "b",
"в": "v",
"г": "h"... | Python | 1 |
ual(rust_tokenizer.decode([1552, 310, 247, 1071], skip_special_tokens=True), "This is a test")
# bytefallback showcase
self.assertEqual(rust_tokenizer.encode("生活的真谛是"), [20025, 46549, 5225, 48561, 33656, 238, 12105]) # fmt: skip
self.assertEqual(
rust_tokenizer.decode([20025, 46549... | Python | 1 |
use crate::{
components::{Bloc, BlocKind, PieceKind, BLOC_SIZE, BOARD_HEIGHT, BOARD_WIDTH},
resources::{TetrisResource, TetrisState},
systems::piece_system::initialize_bloc,
};
#[system]
pub fn piece_rotation(
cmd: &mut CommandBuffer,
#[resource] inputs: &Inputs,
#[resource] timers: &mut Timer... | Rust | 0 |
Feature::NUCLEO_L4R5ZI => board!(Nucleo144, Stm32L4xx, "2M", "640K"),
Feature::NUCLEO_L4R5ZI_P => board!(Nucleo144, Stm32L4xx, "2M", "640K"),
}
}
}
/// Possible board form factors for STM32 Nucleo
#[derive(Debug)]
enum Form {
Nucleo32,
Nucleo64,
Nucleo144,
}
impl fmt::... | Rust | 0 |
localhost:8088 \
--key /tmp/alice.priv \
--node acme-node-000::tcps://splinterd-node-acme:8044 \
--node bubba-node-000::tcps://splinterd-node-bubba:8044 \
--service sc00::acme-node-000 \
--service sc01::bubba-node-000 \
--service-type *::scabbard \
--manage... | Rust | 0 |
o_rgb_image(out['seg_map'][0])
# 2D coordinates
py_coord = np.float32(self.cfg.py_coord)
px_coord['out_nms'] = out['nms']
px_coord['out_nms_reg'] = out['nms_reg']
px_coord['out_mwcs_reg'] = out['mwcs_reg']
px_coord['out_mwcs_reg_gt'] = out['mwcs_reg']
px_coord['o... | Python | 1 |
from tmdbv3api.tmdb import TMDb
class Provider(TMDb):
_urls = {
"regions": "/watch/providers/regions", # TODO:
"movie": "/watch/providers/movie", # TODO:
"tv": "/watch/providers/tv", # TODO:
}
def available_regions(self):
"""
Returns a list of all of the countri... | Python | 1 |
VARCHAR2(10)
/// JOB VARCHAR2(9)
/// MGR NUMBER(4)
/// HIREDATE DATE
/// SAL NUMBER(7,2)
/// COMM NUMBER(7,2)
... | Rust | 0 |
def test_consistency_model_pipeline_multistep_class_cond(self):
device = 'cpu'
components = self.get_dummy_components(class_cond=True)
pipe = ConsistencyModelPipeline(**components)
pipe = pipe.to(device)
pipe.set_progress_bar_config(disable=None)
inputs = self.get_dummy_inputs(device)
inputs... | Python | 1 |
ize = (OSCILLATOR_FREQ / 1000) * ms;
// wait for max amount of time multiples times
if ticks_to_wait >= u16::max_value() as usize {
for _ in (0..=ticks_to_wait).step_by(u16::max_value() as usize) {
self.start_countdown(u16::max_value());
self.wait_countdown_i... | Rust | 0 |
import asyncio, os
from workflow.core.api.engines import LLMEngine, LLMAnthropic
from workflow.core.data_structures import MessageDict, ModelConfig
async def test_llm_engines():
# LM Studio setup
lm_studio_engine = LLMEngine()
lm_studio_config = ModelConfig(
api_key="lm_studio", # LM Studio doesn'... | Python | 1 |
emote host")
parser.add_argument("--ftp_port", type=int, help="FTP remote port")
parser.add_argument(
"--ftp_username",
type=str,
default='',
help="FTP username. Not used if anonymous access.")
parser.add_argument(
"--ftp_password",
type=str,
default='... | Python | 1 |
from FindPosts import createPostDict
from YoutubeUpload import main as youtube_upload
import os
from InstaUpload import instaUpload as cl
import time
def uploadInstaPosts(listDisct):
reelsDict = listDisct
for post in reelsDict:
file_path = post['path']
caption = post['description'] + ' '.join([... | Python | 1 |
r.log_and_raise(exception=ValueError, msg='invalid criteria format')
if violated:
info = '{}:{}'.format(rule['name'], rule['criteria'])
RuleOp.add_categories_and_details(info, rule['categories'], details, categories)
return 1 if violated else 0
# the key d... | Python | 1 |
humidity)?;
}
if let Some(condition) = part.condition {
let name_field = format!("forecast_{}_condition_code", i);
s.serialize_field(string_to_static_str(name_field), &condition)?;
if let Some(daytime) = pa... | Rust | 0 |
/// Return if the node is possibly a string.
fn may_be_str(ty: Value<Type>) -> bool {
match ty {
Known(BoolType) | Known(NullType) | Known(NumberType) | Known(UndefinedType) => false,
Known(ObjectType) | Known(StringType) | Unknown => true,
// TODO: Check if this is correct
Known(Sym... | Rust | 0 |
vService<S> for PublicService<A>
where
S: AsyncWrite + AsyncRead + Unpin + Send + ZeroCopyWrite + 'static,
A: Authorization<Stream = S> + Sync + Send,
<A as Authorization>::Context: Send + Sync,
{
type Context = AuthGlobalContext<A>;
type Request = AdminPublicRequest;
async fn respond(
... | Rust | 0 |
es<FontAssets>,
) {
// local mode
let info_string = if local_handles.handles.len() > 1 {
if round_data.cur_round == 0 {
"Janitor: ARROWS\n Clean the cake splats!\nFortress WASD + SPACE\n Make a MESS!"
.to_owned()
} else {
"ROUND SWITCH!\nJanitor: WASD\n Cl... | Rust | 0 |
# [Job Adv] (5th job) 5th Job : Arcane stone of Tynerium
sm.setSpeakerID(1540944)
sm.sendNext("Maple World is a world of order and rules whereas Tynerium is a world of chaos and uncertainty. FOr a long time we've been acting as the shadows of this world.")
sm.sendNext("Truth be told, I don't want to help Maple Wor... | Python | 1 |
from django.contrib import admin
from django.urls import path, include
from .views import home
urlpatterns = [
path('admin/', admin.site.urls),
path('', home),
path('', include('library.urls')),
path('', include('student.urls')),
]
| Python | 1 |
=>node::Token::Access(a),
Token::True =>node::Token::Bool(true),
Token::False =>node::Token::Bool(false),
Token::While =>node::Token::While,
Token::Null =>node::Token::Null,
Token::Extern =>node::Token::Ext... | Rust | 0 |
_ctrl_b::APPCPU_CTRL_B_SPEC>;
#[doc = ""]
pub mod appcpu_ctrl_b;
#[doc = "APPCPU_CTRL_C register accessor: an alias for `Reg<APPCPU_CTRL_C_SPEC>`"]
pub type APPCPU_CTRL_C = crate::Reg<appcpu_ctrl_c::APPCPU_CTRL_C_SPEC>;
#[doc = ""]
pub mod appcpu_ctrl_c;
#[doc = "APPCPU_CTRL_D register accessor: an alias for `Reg<APPCP... | Rust | 0 |
u presencia con alabanza, *"),
b: String::from("vitoreándole con cánticos;")
},
PsalmVerse {
number: 3,
a: String::from("Porque el Señor es Dios grande, *"),
b: String::from("y Rey grande sobre todos los dioses.")
},
PsalmVerse {
number: 4,
a: String::from("En su ... | Rust | 0 |
", "Ctrl+C"))
self.actionYap_t_r.setText(_translate("MainWindow", "Yapıştır"))
self.actionYap_t_r.setToolTip(_translate("MainWindow", "Yapıştır"))
self.actionYap_t_r.setShortcut(_translate("MainWindow", "Ctrl+V"))
self.actionKal_n.setText(_translate("MainWindow", "Kalın"))
self.a... | Python | 1 |
`. Alternately, there is an `impl<'a> From<Name<'a>> for &'a str`
/// which isn't rendered by Rustdoc, that can be accessed using `str::from(name)` or `name.into()`.
pub fn as_str(&self) -> &'a str {
self.source
}
}
impl<'a> PartialEq<str> for Name<'a> {
#[inline]
fn eq(&self, other: &str)... | Rust | 0 |
# A is the style representation of the original image (at layer l).
A = _gram_matrix(a, N, M)
# G is the style representation of the generated image (at layer l).
G = _gram_matrix(x, N, M)
result = (1 / (4 * N**2 * M**2)) * tf.reduce_sum(tf.pow(G - A, 2))
return result
# La... | Python | 1 |
child(
RawHtmlEl::new("div").attr("class", "columns").child(tools())
)
}
fn tools() -> impl Element {
RawHtmlEl::new("div").attr("class", "column").child(line()).child(rectangle()).child(line()).child(rectangle())
}
fn line() -> impl Element {
RawHtmlEl::new("div").attr("class", "column fa-solid f... | Rust | 0 |
ion,
randomness,
rng,
)?;
num_nodes_per_cluster_induced_network.push(subnetwork_clustering.next_cluster_id());
clustering.merge_subnetwork_clustering(&item.subnetwork, &subnetwork_clustering);
}
}
... | Rust | 0 |
(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 15 - HBI Enable"]
#[inline(always)]
pub fn en(&self) -> EN_R {
EN_R::new(((self.bits >> 15) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - Address Generation Unit 0 Software Reset"]
#[inline(always)]
pub fn rst0(&mut self) -> RST0_W {
... | Rust | 0 |
#[allow(unused_mut)]
let mut scope_1421 = writer.prefix("TagSpecification");
if let Some(var_1422) = &input.tag_specifications {
let mut list_1424 = scope_1421.start_list(true, Some("item"));
for item_1423 in var_1422 {
#[allow(unused_mut)]
let mut entry_1425 = list_142... | Rust | 0 |
};
pins!(I2C1, AF4, SCL: [PA9, PB6], SDA: [PA10, PB7]);
// Both technically not present on STM32L432XX and STM32l442XX (pins missing from ref. manual)
pins!(I2C1, AF4, SCL: [PB8], SDA: [PB9]);
pins!(I2C2, AF4, SCL: [PB10, PB13], SDA: [PB11, PB14]);
pins!(I2C3, AF4, SCL: [PA7], SDA: [PB4]);
/... | Rust | 0 |
.status()
.expect("Could not start sgx edger8r");
assert!(stat.success(), "edger8r failed");
}
println!(
"cargo:rerun-if-changed={}",
edl_path.into_os_string().into_string().unwrap()
);
build_generated_code(&output_dir, &edl... | Rust | 0 |
ive",
"From simple to intelligent",
"From reactive to proactive"
]
}
# Display results
print(f"\n📊 AgenticAI Transformation Results")
print(f"=" * 45)
print(f"✅ Successfully created {results['demo_summary']['agents_created']} autonomous agents")
print(f"✅ Ea... | Python | 1 |
for action in self.actions:
self.iface.removePluginMenu(
self.tr(u'&AppEEARS_QGIS'),
action
)
self.iface.removeToolBarIcon(action)
def run(self):
"""Run method that performs all the real work"""
# Create the dialog with elemen... | Python | 1 |
).is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateVpcAttachmentError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_vpc_attachment_response(
response: &http::Response... | Rust | 0 |
u8, {
let l4_len: u64 = unsafe { ::std::mem::transmute(l4_len) };
l4_len as u64
});
__bindgen_bitfield_unit.set(24usize, 16u8, {
let tso_segsz: u64 = unsafe { ::std::mem::transmute(tso_segsz) };
tso_segsz as u64
});
__bindgen_bitfield_unit.... | Rust | 0 |
n=int(input("Enter any number: "))
i=1
sum=0
while(i<=n):
sum+=i
i+=1
print(sum) | Python | 1 |
#[test]
#[ignore] // missing error
fn greater_than_or_equal() {
let runner = runner().with_cwd("greater_than_or_equal");
assert_eq!(
runner.err("@import \'plain\'"),
"Error: Operators aren\'t allowed in plain CSS.\
\n ,\
\n2 | x: y >= z;\
\n | ^^\
\... | Rust | 0 |
ee `Field.numericalize`.
"""
assert self.use_vocab is False
if self.include_lengths and not isinstance(arr, tuple):
raise ValueError("Field has include_lengths set to True, but "
"input data is not a tuple of "
"(data batch, ... | Python | 1 |
InputFile",
"Update",
"User",
"UserChatBoosts",
"UserProfilePhotos",
"UserShared",
"UsersShared",
"Venue",
"Video",
"VideoChatEnded",
"VideoChatParticipantsInvited",
"VideoChatScheduled",
"VideoChatStarted",
"VideoNote",
"Voice",
"WebAppData",
"WebAppInfo"... | Python | 1 |
# practical by Rishabh
"""4. For any number n, write a program to list all the solutions of the equation x1 + x2 +
x3 + ...+ xn = C, where C is a constant (C<=10) and x1, x2,x3,...,xn are non-negative
integers, using brute force strategy."""
def find_solutions(C, n):
def generate_solutions(current_sum, current_so... | Python | 1 |
if id_field.length().is_some() {
continue;
}
errors.push_error(
self.native_instance_error(&native_type_instance)
.new_incompatible_native_type_with_id(" If you are using the `ext... | Rust | 0 |
for feature in matches.values_of("features").unwrap_or_default() {
process.arg("--feature").arg(feature);
}
let mut child = process.spawn()?;
copy(&mut child.stdout.take().unwrap(), &mut writer)
.context("Unable to copy child stdout into output")?;
let exit_code = child.wait().context... | Rust | 0 |
cheater: false,
kind: PartyKind::Normal,
},
receiver_approves: true,
mediator: Party {
name: "marry".to_string(),
cheater: false,
kind: PartyKind::Mediator,
},
... | Rust | 0 |
to swap out parts of the address space used by the control
/// group.
///
/// Note that a value of zero does not imply that the process will not be swapped out.
pub fn set_swappiness(&self, swp: u64) -> Result<()> {
self.open_path("memory.swappiness", true)
.and_then(|mut file| {
... | Rust | 0 |
= "RDS Cluster db-cluster-1 does not have minor version upgrade enabled."
)
assert result[0].resource_id == "db-cluster-1"
assert result[0].region == AWS_REGION_US_EAST_1
assert (
result[0].resource_arn
== f"arn:aws:rds:{AWS_REGION_US_EAST_... | Python | 1 |
pckwd_kr_kr_kr
MemorySize::Unknown,// VEX_Kunpckdq_kr_kr_kr
MemorySize::Unknown,// VEX_Kunpckbw_kr_kr_kr
MemorySize::Unknown,// Movmskps_r32_xmm
MemorySize::Unknown,// Movmskps_r64_xmm
MemorySize::Unknown,// VEX_Vmovmskps_r32_xmm
MemorySize::Unknown,// VEX_Vmovmskps_r64_xmm
MemorySize::Unknown,// VEX_Vmovmskps_r... | Rust | 0 |
<HttpConnector>>;
#[derive(Serialize, Deserialize)]
struct CatFact {
text: String,
}
#[derive(Serialize, Deserialize)]
struct TODO {
title: String,
}
fn get_cats_url() -> String {
#[cfg(not(test))]
let url = format!("{}/facts/random", CATS_URL);
#[cfg(test)]
let url = format!("{}/facts/random... | Rust | 0 |
epi, *sp, l1]);
let iter = self.proc.saved_regs().iter();
let prol = Box::new(Prologue { epi, sp, iter, ok_epi, tctx });
let h3 = self.ok_code0((LCtx::Prologue(prol), lctx), Some(code));
thm!(self.thm, (okProc[self.gctx, *self.start, self.args, self.ret]) =>
okProcI(self.args, code, self.gctx, sel... | Rust | 0 |
stake_config.staked_token.code_hash,
stake_config.staked_token.address,
)?);
store_claim_reward(
&mut deps.storage,
&sender_canon,
Uint128(claim),
symbol.clone(),
None,
&env.block,
)?;
}
store_unbon... | Rust | 0 |
tring, protocol::TypedData>) {}
}
#[cfg(test)]
mod tests {
use super::*;
use std::borrow::Cow;
#[test]
fn it_has_the_method() {
const METHOD: &'static str = "GET";
let mut data = protocol::TypedData::new();
let mut http = protocol::RpcHttp::new();
http.set_method(METHO... | Rust | 0 |
.payload_mut()).unwrap();
})
}
/// Receives an ARP packet from an interface.
///
/// This may result in a response to ARP requests, updating the ARP cache, etc.
pub fn recv_packet(interface: &mut Interface, eth_frame: &EthernetFrame<&[u8]>) -> Result<()> {
let arp_repr = Arp::deserialize(eth_frame.payload())?;... | Rust | 0 |
from .. import IconBase
class IconCarFront(IconBase):
class_name = "lucide lucide-car-front"
svg_data = {
"attrs": {
"width": "24",
"height": "24",
"view_box": "0 0 24 24",
"fill": "none",
"stroke": "currentColor",
"stroke_width": "2",
"stroke_lineca... | Python | 1 |
enshot handler
{
let mut be = BACKEND.lock();
if be.request_screenshot.is_some() {
let document = web_sys::window().unwrap().document().unwrap();
let canvas_dom = document.query_selector("canvas").unwrap().unwrap();
let canvas = canvas_dom.dyn_into::<web_sys::Html... | Rust | 0 |
import json
employees = [{"name":"Alice","salary":50000},{"name":"Bob","salary":60000}]
with open("employees.json","w") as f:
json.dump(employees, f)
| Python | 1 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
#-----------type-1------------
x=5
y="john"
print(x)
print(y)
#-----------type-2------------
x=4
x="sally"
print(x)
#------------Casting-----------
x=str(3)
y=int(3)
z=float(3)
print(x +" "+str(y)+" "+str(z))
#---------different type of a variable with type() function
x=5
y="jhon"
print(type(x))
print(type(y))
... | Python | 1 |
OPEN_INTERPRETER = {
"_TYPE": "agent",
"chat.model": "gpt-4o",
"chat.sys_msg": """
You are Open Interpreter, a world-class programmer that can complete any goal by executing code.
First, write a plan. **Always recap the plan between each code block** (you have extreme short-term memory loss, so you need to... | Python | 1 |
e_finger[0] <= 485: # Red
colorIndex = 2
elif 505 <= fore_finger[0] <= 600: # Yellow
colorIndex = 3
else:
# Append the points only if pinch gesture is detected
if colorIndex == 0:
bpoints[blue_index... | Python | 1 |
paddr, write);
Ok(paddr)
}
/// Hook to execute before a fence.i instruction. `mask` provides bit mask of harts for remote invalidation.
fn before_fence_i(&self, _ctx: &mut Context, _mask: u64) {}
// Hook to execute before a sfence.vma instruction. `mask` provides bit mask of harts for remote ... | Rust | 0 |
outline_set[ix].draw(canvas,(position.0+shift,position.1-1));
outline_set[ix].draw(canvas,(position.0+1+shift,position.1-1));
main_set[ix].draw(canvas,(position.0+shift,position.1));
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
enum EndGame {
Victory (color::Color),
Stalemate
}
struct Animatio... | Rust | 0 |
from configs.general_configs import get_general_configs
def get_default_configs():
config = get_general_configs()
# original
config.devices = [4, 5, 6, 7]
config.name = 'default'
config.dataset = 'hamer'
# data
data = config.data
data.normalize = True
data.rot_rep = 'axis' # rot6... | Python | 1 |
n channel() -> u8 { 16 }
}
#[cfg(feature = "embedded-hal")]
// #[cfg_attr(docsrs, doc(cfg(feature = "embedded-hal")))]
impl Channel<pac::$ADC> for AdcChannel::C17 {
type ID = u8;
fn channel() -> u8 { 17 }
}
#[cfg(feature = "embedded-hal")]
... | Rust | 0 |
output_list = torch.cat(output_list)
label_list = torch.cat(label_list)
score = torch.softmax(output_list, dim=1)
conf, pred = torch.max(score, dim=1)
label_list = label_list.detach().numpy().astype(int)
conf = conf.detach().... | Python | 1 |
9950,
nid=1)],
reset_interval_ms=1500,
weight_sz_permil=20,
weight_nr_accesses_permil=200,
weight_age_permil=1000),
watermarks=_damon_sysfs.DamosWatermarks(
metric = 'free_mem_rate... | Python | 1 |
&Self) {
unsafe { ffi::roaring_bitmap_or_inplace(self.bitmap, other.bitmap) }
}
/// Computes the union between many bitmaps quickly, as opposed to having
/// to call or() repeatedly. Returns the result as a new bitmap.
///
/// # Examples
///
/// ```
/// use croaring::Bitmap;
... | Rust | 0 |
is reached.
task: AtomicTask,
/// Tracks the entry state. This value contains the following information:
///
/// * The deadline at which the entry must be "fired".
/// * A flag indicating if the entry has already been fired.
/// * Whether or not the entry transitioned to the error state.
//... | Rust | 0 |
match new_item {
None => {
self.is_closed = true;
cx.waker().wake_by_ref();
return Poll::Ready(Some(messages));
}
Some(mut additional_messages) => {
... | Rust | 0 |
r, avatar_style: str, avatar_content: Optional[bytes] = None
) -> None:
assert user
if avatar_style == "gravatar":
user.avatar_style = user.AVATAR_GRAVATAR
elif avatar_style == "manual":
user.avatar_style = user.AVATAR_MANUAL
avatar_path = "avatars/" + user.name.lower() + ".png"
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.