text
string
label_name
string
labels
int64
from yogi import tokens c = 1 for n in tokens(int): if n%2==0: print(c) break else: c = c + 1
Python
1
r_id: try: history = vk.messages.getHistory(peer_id=peer_id, count=10, offset=0) if isinstance(history, dict): items = history.get('items') or history.get('messages') or [] if items: ...
Python
1
"""this function will serve as an introduction to opencv, a framework designed for computer vision technologies. THis can capture video and images, draw overlays and process frames. in the concept of pose estimation, which we will discuss soon, this is good for capturing webcam, manipulating frames, render skeletal o...
Python
1
#!/usr/bin/env python3 """ Log stats - New version """ from pymongo import MongoClient if __name__ == '__main__': """ provide some stats about nginx logs """ client = MongoClient('mongodb://localhost:27017/') db = client.logs collection = db.nginx total_logs = collection.count_documents({}...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models class AccountMove(models.Model): _inherit = 'account.move' @api.onchange('purchase_vendor_bill_id', 'purchase_id') def _onchange_purchase_auto_complete(self): purchase_...
Python
1
arget> server = self._server_socket(keyfile=SERVER_KEY, certfile=SERVER_CERT, ssl_version=ssl.PROTOCOL_TLSv1_1) self._assert_connection_success(server, ca_certs=SERVER_CERT, ssl_version=ssl.PROTOCOL_TLSv1_1) </target> if not hasattr(ssl, 'PROTOCOL_TLSv1_1') or not hasattr(ssl, 'PROTOCOL...
Python
1
status::PullRequestStatus, summary::SummaryTextGenerator, LogicError, Result as LogicResult, }; async fn arrange( conf: &Config, db_adapter: &dyn IDatabaseAdapter, ) -> (RepositoryModel, PullRequestModel) { // Create a repository and a pull request let repo = RepositoryModel::builder(conf, "me"...
Rust
0
annel(); tokio::task::spawn(rx.forward(user_ws_tx).map(|result| { if let Err(e) = result { eprintln!("websocket send error: {}", e); } })); // Save the sender in our list of connected users. info!("users.insert: {}", my_ws_uid); unwrap!(users.lock()).insert(my_ws_uid, tx)...
Rust
0
The default rdd if no more in rdds """ if default and not isinstance(default, RDD): default = self._sc.parallelize(default) if not rdds and default: rdds = [rdds] if rdds and not isinstance(rdds[0], RDD): rdds = [self._sc.parallelize(input) for inpu...
Python
1
from typing import AsyncGenerator, Generator, Iterable, List, Union import polars as pl from mage_ai.data.models.generator import DataGenerator from mage_ai.data.models.pyarrow.record_batch import RecordBatch, TaggedRecordBatch from mage_ai.data_preparation.models.variables.constants import VariableType from mage_ai....
Python
1
from ..report import Report from ..table import Table from advisornotes.models import AdvisorVisit from coredata.models import Unit from datetime import datetime, timedelta class FASAdvisorVisitsWeeklyReport(Report): title = "FAS Advisor Visit Weekly Report" description = "A report of all advisor visits for th...
Python
1
if let Some(local) = place.as_local() { trans.remove(local); } }); } fn apply_yield_resume_effect( &self, trans: &mut Self::Domain, _resume_block: mir::BasicBlock, resume_place: mir::Place<'tcx>, ) { if let Some(local) =...
Rust
0
hapes.append(create_obstacle_shape(self.cr_obstacle, obstacle_state.position, obstacle_state.orientation)) else: # We could not get the states for all time steps and thus return False return False # We could ge...
Python
1
ll_arithmetic_operators, ser.iloc[0], exc=None) else: # ... but not the rest. super().test_arith_series_with_scalar(data, all_arithmetic_operators) def test_divmod_series_array(self): # GH 23287 # skipping because it is not implemented pass class TestCastin...
Python
1
).unwrap_or_default(),)* ps,), _ => return Err(Error::arity(args.len())), }; let $range = range.start + count!($($p)*)..range.end; let Bind(api, _) = self; api($($r,)* $(replace!($t, $thread),)? $($e,)? $($p,)* $($rest)?).into_result() } } } } ...
Rust
0
here { center, radius: 0.2, material: Box::new(Lambertian { albedo: Vec3::new(rand() * rand(), rand() * rand(), rand() * rand()), }), })) } else if material_cho...
Rust
0
, path: &str) -> Box<ProgressReporter> { let progress_bar = self.multi_progress.add(indicatif::ProgressBar::new(100)); Box::new(ProgressBarReporter::new(progress_bar, path)) } fn join(&self) { self.multi_progress.join().ok(); } } fn colored_score(quality: &CheckResultQuality) -> AN...
Rust
0
iteratortest").expect(""); let db = DB::open_default(path.path().to_str().unwrap()).unwrap(); for i in 1..8000 { db.put(format!("{:04}", i).as_bytes(), format!("{:04}", i).as_bytes()) .expect(""); } db.flush(true).expect(""); asser...
Rust
0
Signal the thread to stop. """ logging.debug("QueueWorker received stop signal.") self.stop_event.set() def spawn_periodic_worker(worker_fn, interval, *args, **kwargs): """ Factory function to spawn a periodic worker thread. Args: worker_fn (callable): Function to ex...
Python
1
} #[doc = "Bits 8:12 - Active Channel ID"] #[inline(always)] pub fn id(&self) -> ID_R { ID_R::new(((self.bits >> 8) & 0x1f) as u8) } #[doc = "Bit 15 - Active Channel Busy"] #[inline(always)] pub fn abusy(&self) -> ABUSY_R { ABUSY_R::new(((self.bits >> 15) & 0x01) != 0) ...
Rust
0
in([str(i) for i in input_args])}": { "fast_bitblas_top20_tune_time": fast_tune_time, "fast_bitblas_top1_latency": cpresults[0].latency, "fast_bitblas_top20_latency": best.latency, "default_bitblas_tune_time": default_tune_time, "default_bitblas_latency": t * ...
Python
1
t(vec![value])) } } /// DEPRECATED: See `NewSubfileType` #[derive(Debug, Eq, PartialEq)] pub enum SubfileType { FullResolutionImage, ReducedResolutionImage, SinglePageImage, } impl Field for SubfileType { fn tag() -> Tag { Tag::SubfileType } fn decode_from_value(value: &TIFFValue)...
Rust
0
) val_loss /= (batch_idx+1) y, y_pred = np.array(y), np.array(y_pred) stats_dict = eval_stat(y_pred, y, haze_thresh) stats_dict.update({'val_loss': round(val_loss, 4)}) return stats_dict def train(config=None): with wandb.init(config=config): config = wandb.config train_...
Python
1
# This file is part of Indico. # Copyright (C) 2002 - 2025 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import pytz def test_serialize_room_api(dummy_room): from indico.modules.rb.schemas import RoomLegac...
Python
1
SHA256_BITS as f64).ceil() as usize; format!( "#define N ({}) #define K ({}) #define LOG2_K ({}) #define DEGREE_EXPANDER ({}) #define DEGREE_BUTTERFLY ({}) #define LOG2_DEGREE_BUTTERFLY ({}) #define NUM_EXPANDER_LAYERS ({}) #define NUM_BUTTERF...
Rust
0
import pytest from starlette.testclient import TestClient from sqlalchemy.orm import Session import app.main from wps_shared.db.models.hfi_calc import PlanningWeatherStation, FireCentre, FuelType, PlanningArea import app.routers.hfi_calc def mock_get_fire_weather_stations(_: Session): fire_centre = FireCentre(id=...
Python
1
# database_operations.py import psycopg2 # Создаем соединение с базой данных conn = psycopg2.connect( host="localhost", database="postgres", user="postgres", password="210506kz" ) cur = conn.cursor() def insert_user(username): cur.execute("INSERT INTO public.user (username) VALUES (%s) ON CONFLIC...
Python
1
<i32>, costs: Vec<i32>) -> i32 { // dp[day]: 第day天所花费的最小票价 // dp[day] = min(dp[day-1]+costs[0], dp[day-7]+costs[1], dp[day-30]+costs[2]) let mut travel = [false; 366]; let mut dp = [0; 366]; let (first, last) = (*days.first().unwrap(), *days.last().unwrap()); for day in d...
Rust
0
__ = ['id', 'node_id', 'status', 'subscriber_email', 'update_time'] def __init__(self, node_dict: typing.Dict): self.id = 0 self.node_id = 0 self.status = self.STATUS_WAITING self.subscriber_email = '' for k in self.__slots__: if k not in node_dict: ...
Python
1
:CheckCaseInsensitiveStr(&query)) } else { Ok(PathCheck::CheckStr(&query)) } } } } else { Ok(PathCheck::Allow) } } } #[cfg(test)] mod tests { use super::*; use std::path::Path; #[tes...
Rust
0
unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int; #[cfg(target_os = "macos")] #[link_name = "stat64"] unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int; } } #[nolink] #[abi = "cdecl"] pub mod stdio { ...
Rust
0
NL80211_BSS_SELECT_ATTR_MAX: nl80211_bss_select_attr = 3; pub type nl80211_bss_select_attr = ::std::os::raw::c_uint; pub const NL80211_NAN_FUNC_PUBLISH: nl80211_nan_function_type = 0; pub const NL80211_NAN_FUNC_SUBSCRIBE: nl80211_nan_function_type = 1; pub const NL80211_NAN_FUNC_FOLLOW_UP: nl80211_nan_function_type = ...
Rust
0
ew) .push(Target { p: *p, d: dist }); } let mut cnt = 0; let ans2 = 'outer: loop { let mut keys_to_be_deleted: Vec<Angle> = Vec::new(); for (&k, ts) in targets.iter_mut() { if let Some(t) = ts.pop() { cnt += 1; if cnt == 200 { ...
Rust
0
) -> bool { self.bounds.is_empty() } /// Clears all bound requirements pub fn clear_bounds(&mut self) -> &mut Self { self.bounds.clear(); self } /// Pushes a single bound requirement pub fn push_bound<T>(&mut self, bound: T) -> &mut Self where T: Into<Type> ...
Rust
0
LaUR5nO[R"X6S S 9nURS5Ul URS5Ul X`lUbURU5 SUlg) NTcopyr7rrr Argument has a size  which does not match ...
Python
1
d_argument( "--scenario", type=str, help="Specify the character's scenario (otherwise LLM will generate it)", # nopep8 ) parser.add_argument( "--greeting-message", type=str, help="Specify the character's greeting message (otherwise LLM will generate it)", # nope...
Python
1
// Draw player let player = &self.char_pos; self.board[player.y as usize][player.x as usize] = PLAYER; } fn draw_board(&self) { console::erase(); console::jump(); let mut stdout = io::stdout(); for y in 0..ROWS { stdout.write(&self.board[y]).unwrap(); stdout.write(&NEWLINE).unwrap(); } std...
Rust
0
string1 = "I am a list" print(string1.split(",")) print(string1.rjust(15,"X")) part1 = "I am" part2 = " a string" print(part1 + part2) print("This string is " + str(len(part1+part2)) + " characters long") String10 = "I am a list" print("String10 is {} characters long!".format(len(String10))) prin...
Python
1
ic_json ="coco/annotations/ZSP/panoptic_val2017_all.json" semantic_root = "coco/panoptic_semseg_val2017" prefix_instances = prefix[: -len("_panoptic")] instances_meta = MetadataCatalog.get(prefix_instances) image_root, instances_json = instances_meta.image_root, instances_meta.json_file register_c...
Python
1
Display { type Err = crate::Error; fn from_str(s: &str) -> Result<Self, Self::Err> { // Convert first 10 digits let mut digit_key = [0; NUMBER_DIGITS_TOTAL]; let mut line = s.splitn(11, ' '); line.by_ref().take(10).for_each(|digit| match digit.len() { 2 => digit_key[1...
Rust
0
# -*- coding: utf-8 -*- """ @file: __init__.py @desc: @author: Jaden Wu @time: 2020/9/22 10:12 """
Python
1
lic::SymExpr`]. macro_rules! expression_builder { ($method_name:ident ( $($param_name:ident : $param_type:ty ),+ ) => $message:ident) => { #[allow(clippy::missing_safety_doc)] #[no_mangle] fn $method_name(&mut self, $( $param_name : $param_type, )+ ) -> Option<RSymExpr> { self.wr...
Rust
0
, max) } } /// Generate out good tick interval defaults for `f64`. pub fn compute_ticks(ideal_num_steps: u32, good_ticks: &[u32], range: [f64; 2]) -> TickInfo<f64> { let (step, good_normalized_step) = find_good_step(good_ticks, ideal_num_steps, range); let (start_step, step_num) = get_range_info(step, rang...
Rust
0
si_m import to0y___5uuy nonlocal on263_hklng '# difficulties_punches_electrolyte -> trick_relief_swing' raise cteca_47zs_ del al9j69pc8mv '# difficulties_punches_electrolyte -> trick_relief_swing' jbxgm7euqmk = xs08x8uab11 = n828jctet7d = b'' global cbqduvi69fb hgp1qiv5vny wu415ux4k_...
Python
1
-> StoreResult<()> { self.0.put(key, value) } } <filename>src/core/src/bin/sim.rs<gh_stars>10-100 // Copyright (c) 2019 Libgirl // // Released under Apache 2.0 license as described in the file LICENSE.txt. use wheatnnleek::Parameters; use wheatnnleek::connections::static_connection; use wheatnnleek::conn...
Rust
0
chema.mock_table_metadata", ) ) assert data == {"test": "data"} def test_query_builder_metadata(mocker: MockerFixture): mocker.patch( "src.sdk.python.rtdip_sdk.queries.time_series.time_series_query_builder.metadata.get", return_value={"test": "data"}, ) data = ( Ti...
Python
1
a d:} @spdZgdZeZdZdZdZddlZddlZ ddl Z zddl m Z e dd ZWneyhd d ZYn0d Zd ZdZdZdZdZdZdZdZdZe jdkrdZdZdZn dZdZdZeedZGdddeZ Gddde Z!Gdd d e Z"Gd!d"d"e"Z#Gd#d$d$e e$Z%Gd%d&d&e"Z&G...
Python
1
from neuralqa.retriever import ElasticSearchRetriever import logging logger = logging.getLogger(__name__) class RetrieverPool(): def __init__(self, retrievers): self.retriever_pool = {} for retriever in retrievers["options"]: if (retriever["value"] in self.retriever_pool): ...
Python
1
sync_seen def _initialize(self, path, start, length): self._stream = self.getStream(path) if length == 0: self._end = self._stream.getPos() + self._stream.length() else: self._end = self._stream.getPos() + length # Parse Header version_block = self....
Python
1
#!/usr/bin/python # This is a simple example showing how you can send a key press event # to XBMC using the XBMCClient class import sys sys.path.append("../../lib/python") import time from xbmcclient import XBMCClient def main(): host = "localhost" port = 9777 # Create an XBMCClient object and con...
Python
1
let in_ = m.input("in_", 16); let load = m.input("load", 1); let address = m.input("address", 12); let dmux8way = DMux8Way::new("dmux8way", m); dmux8way.in_.drive(load); dmux8way.sel.drive(address.bits(address.bit_width() - 1, address.bit_width() - 3)); let ra...
Rust
0
表 start_date: 開始日期 end_date: 結束日期 Returns: 包含策略比較數據的字典 """ return self.data_service.compare_strategies_performance( strategy_names, start_date, end_date ) # ==================== 圖表生成方法 ==================== def generate_cumulative...
Python
1
parts.get(1).ok_or("Invalid bag rule text.")?; if rest == &"no other bags." { Ok(BagNode { id, children: Vec::new() }) } else { let mut children = Vec::new(); for child in rest.split(", ") { let (n, child_id) = trim_bag_id(child).split_at(1); children.push((n.par...
Rust
0
inalizer(cleanup) return models @pytest.fixture() async def test_models_async(async_engine: AsyncEngine, request: pytest.FixtureRequest) -> dict[str, type[Any]]: """Get appropriate test models for the given async engine. This fixture creates isolated models with proper metadata management and table c...
Python
1
RomanNumeral { symbol: "M", value: 1000, }, RomanNumeral { symbol: "CM", value: 900, }, RomanNumeral { symbol: "D", value: 500, }, RomanNumeral { symbol: "CD", value: 400, }, RomanNumeral { symbol: "C", value...
Rust
0
r.percentile(), modisPixelKernel) # --> We would like to compute a percentile here, but this would require a different reducer input for each pixel! # Get whichever DEM is loaded in the domain dem = domain.get_dem().image water_present = water_fraction.gt(0.0)#.mask(water_high) if spe...
Python
1
pMapper(geom, var) self.renderAndCompare(mapper, img_file, pos) def testTimeWithTimeSets(self): reader = self.setupReader("blow2_ascii.case") reader.UpdateInformation() outInfo = reader.GetOutputInformation(0) numSteps = outInfo.Length(vtkStreamingDemandDrivenPipeline.TIME_STEPS()) self.asse...
Python
1
_total_%"].append(dados_cpu[2]) dados["uso_ram_total_%"].append(uso_ram_porcentagem) dados["swap_rate_mbs"].append(swap_rate[2]) dados["tempo_cpu_ociosa"].append(dados_cpu[0]) dados["cpu_io_wait"].append(dados_cpu[3]) dados["uso_disco_total_%"].append(uso_disco_porcentagem) dados["disco_iops_tot...
Python
1
vec![ artifact_name, "/", &format!("{}", artifact_version), "/", filename, ] .into_iter() .collect() } } // This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/vhdirk/gir-file...
Rust
0
<G>, } impl<G, W, P> SkipWhile<G, W, P> { /// Create a new `SkipWhile` walker. pub fn new(walker: W, predicate: P) -> Self where G: GraphRef, W: Walker<G>, P: FnMut(G, &W::Item) -> bool, { SkipWhile { walker, maybe_predicate: Some(predicate), ...
Rust
0
/// Holds implementation of the socks4 protocol but /// without ident being passed when establishing /// connection pub mod no_ident; pub use general::Socks4General; pub use no_ident::Socks4NoIdent; /// Represents a Socks4 protocol command #[repr(u8)] pub enum Command { TcpConnectionEstablishment = 1, TcpPo...
Rust
0
import sys from awsglue.transforms import * from awsglue.utils import getResolvedOptions from pyspark.context import SparkContext from awsglue.context import GlueContext from awsglue.job import Job from awsglue import DynamicFrame args = getResolvedOptions(sys.argv, ['JOB_NAME']) sc = SparkContext() glueContext = Glue...
Python
1
import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt matplotlib.rcParams['font.family'] = 'Arial' # 'Helvetica', 'Times New Roman' matplotlib.rcParams.update({'font.size': 20}) matplotlib.rcParams.update({'font.weight': "bold"}) matplotlib.rcParams.update({'axes.labelweight': "bold...
Python
1
NSLATION_RESULT, ..Default::default() }; let mut e = Emulator::<TestCallbacks>::new().unwrap(); let mut callbacks_context = CallbacksContext { emulator: &mut e, context: &mut callbacks, }; let gva: WHV_GUEST_VIRTUAL_ADDRESS = 0; let ...
Rust
0
// This plugin handles player related stuff like movement /// Player logic is only active during the State `GameState::Playing` impl Plugin for PlayerPlugin { fn build(&self, app: &mut App) { app.add_system_set(SystemSet::on_enter(GameState::Playing).with_system(spawn_player)); } } fn spawn_player(mut ...
Rust
0
'Alice'}} """ if "fields" not in record: record = {"fields": cast(Fields, record)} return { "id": str(record.get("id") or fake_id()), "createdTime": str(record.get("createdTime") or _now()), "fields": record["fields"], } def _extract_args( args: Sequence[Any], k...
Python
1
import json from django.core.management import CommandError from django.core.management.base import BaseCommand from corehq.util.couchdb_management import couch_config class Command(BaseCommand): help = "Check status or cancel replication" def add_arguments(self, parser): parser.add_argument('repli...
Python
1
_and_base_mut2() { let mut foo = make_foo(); let bar1 = &mut foo.bar1.int1; let _foo2 = &mut *foo; //~ ERROR cannot borrow *bar1; } fn borrow_imm_and_base_mut() { let mut foo = make_foo(); let bar1 = &foo.bar1.int1; let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow *bar1; } fn borrow_...
Rust
0
), // protocol_interest_factor Rate::saturating_from_rational(5, 1000), // max_borrow_rate Rate::saturating_from_rational(9, 10), //collateral_factor None, // borrow_cap PROTOCOL_INTEREST_TRANSFER_THRESHOLD, // protocol_interest_threshold ) .build() .execute_w...
Rust
0
import json def inspect_event(event, context): print("🎯 Full GCS Event Payload:") print(json.dumps(event, indent=2)) print(f"📁 File uploaded: {event.get('name')}") print(f"🪣 Bucket: {event.get('bucket')}") print(f"📦 Size: {event.get('size')} bytes") print(f"📄 Content type: {event.get('con...
Python
1
# Ignore system files .DS_Store Thumbs.db # Ignore user-specific files .vscode/ .streamlit/ # Ignore Python virtual environments myenv/ .env # Ignore temporary files *.log *.bak # Ignore directories like AppData or Documents AppData/ Documents/ Downloads/ Favorites/ Pictures/ Music/ Videos/
Python
1
tions::HashMap; #[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct Program { pub symbol: HashMap<TokenId, TokenType>, pub operation: Vec<Op>, pub storage: HashMap<TokenId, StorageType>, pub input: HashMap<String, TokenId>, pub output: HashMap<String, TokenId>, } #[derive(Debug, Pa...
Rust
0
"*Required features: `\"Win32_Graphics_DirectDraw\"`, `\"Win32_Foundation\"`, `\"Win32_Graphics_Gdi\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct DDHAL_FLIPVPORTDATA { pub lpDD: *mut DDRAWI_DIRECTDRAW_LCL, pub lpVideoPort: *mut DDRAWI_DDVIDEOPORT_LCL, pub lpSurf...
Rust
0
ssid: Ssid::from_bytes_unchecked(bss.ies[ssid_range].to_vec()), bssid: Bssid(bss.bssid), bss_type: bss.bss_type, beacon_period: bss.beacon_period, capability_info: bss.capability_info, channel: bss.channel.into(), rssi_dbm: bss.rssi_dbm, ...
Rust
0
::WebServices; use log::error; use rocket::{ catch, catchers, config::{Config as RocketConfig, Environment, Limits, Value}, routes, }; use rocket_contrib::json::JsonValue; use simplelog::{Config as LogConfig, LevelFilter, WriteLogger}; #[macro_use] mod utils; mod args; mod config; mod db; mod models; mod ...
Rust
0
name, state, old_position: position, animation_time: 0.0, levels: connections, to_reveal_next: Vec::new(), } } fn restore_state(&mut self) { assert!(self.to_reveal_next.is_empty()); let local_storage = util::get_sto...
Rust
0
B YeB@sddlmZdS))adminN)Zdjango.contribrrruD:\Projects\DJANGO PROJECTS\DEC-23\Exam Seating Auto-Generated System\EXAMSEATINGAUTOGENERATEDSYSTEM\student\admin.py<module>s
Python
1
import random from collections import defaultdict from util.patch.aslr import aslr COUNT = 3 def patch(pt): funcs = aslr(pt, count=COUNT) relocs = [] for func, choices in funcs.items(): entries = [] for addr, size in choices: jmp = pt.asm(pt.arch.jmp(addr), addr=func.addr) ...
Python
1
dKey::L}, lib_foundry_common::KeyboardKey::M => {lib_tremor_common::input::KeyboardKey::M}, lib_foundry_common::KeyboardKey::N => {lib_tremor_common::input::KeyboardKey::N}, lib_foundry_common::KeyboardKey::O => {lib_tremor_common::input::KeyboardKey::O}, lib_foundry_common::KeyboardKey:...
Rust
0
0 //! Module for tokenizing JMESPath expressions. //! //! The lexer returns a VecDeque of tuples where each tuple contains the //! character position in the original string from which the lexeme originates //! followed by the token itself. The VecDeque is then consumed by the parser. //! A VecDeque is utilized in order...
Rust
0
eScan { table_name: "test".to_string(), filters: vec![], projected_schema: Arc::new(DFSchema::try_from( (*test_provider.schema()).clone(), )?), projection: None, source: Arc::new(test_provider), limit: None, }; ...
Rust
0
if result.is_err() { println!("Err: {:?}\n", result.err().unwrap()); return; } println!("Legacy file data has been exported to: {}\n", path.canonicalize().unwrap().to_string_lossy()); }, 0x02 => { // SNES (.r16m) let path = tasd.source_file.with_extension("export.r16m"); ...
Rust
0
nop */ let instruction_bytes = backing!([ 0x34, 0x84, 0x00, 0x00, 0x1c, 0x80, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x24, 0x05, 0x00, 0x01, 0x03, 0xe0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 ]); let driver = init_driver_function( instruction_bytes, vec![("$a0", const_(0xffffff...
Rust
0
) }, None => format!( "Unable to create capability type {}", capability_type ), } }) .map_err(runtime_error)?; let id = env.iden...
Rust
0
.as_ref() .unwrap_or(&HashMap::new()) .try_into() .map_err(|e| format!("invalid headers:{:?}", e))?; debug!("http headers:{:?}", headers); let response = match Method::from_bytes( self.method .as_ref() .unwrap_or(&String::f...
Rust
0
} }); ($fmt:expr, $($arg:tt)*) => { $crate::private::new_adhoc(format!($fmt, $($arg)*)) }; } <filename>compiler/rustc_parse/src/parser/stmt.rs use super::attr::DEFAULT_INNER_ATTR_FORBIDDEN; use super::diagnostics::{AttemptLocalParseRecovery, Error}; use super::expr::LhsExpr; use super::pat::{...
Rust
0
rks r create_textzCanvas.create_textB rrc(|jd||S)z+Create window with coordinates x1,y1,x2,y2.rrrrks r create_windowzCanvas.create_windowF rrcX|jj...
Python
1
<Expression, ParseError> { debug!(">>> parse_primary {}", self.current_token.kind); let e = match self.current_token.kind { TokenKind::IDENT => match self.next_token.kind { TokenKind::LPAREN => self.parse_function_invocation()?, _ => Expression::Identifier(self.current_token.value.clone())...
Rust
0
(mreturn), stmt => Err(ParserError::Convert(format!("{:?}", stmt), "Return".into()).into()), } } } <filename>implementations/rust/ockam/ockam_command/src/enroll/enrollment_token_generate.rs use anyhow::{anyhow, Context}; use clap::Args; use ockam::identity::IdentityTrait; use crate::IdentityOpt...
Rust
0
e unique identifier to use for model fetching. Defaults to `None`, but can reference any surrogate or candidate key for the table. Returns: The value of attribute on ``item`` named as :attr:`id_attribute <AbstractAsyncRepository.id_attribute>`. """ return getattr(ite...
Python
1
import os import openai from openai import OpenAI from Preprocessing.feature_extraction import load_eeg_data from Preprocessing.csv_to_json_4o import csv_to_json_without_label from sklearn.metrics import roc_auc_score, f1_score, accuracy_score def use_model(msg, model_id): completion = client.chat.completions.cre...
Python
1
, objective: &mut dyn Objective) -> Result<Tree, String> { let target = d_train.get_target(); objective.initialize(&config, &target); objective.update(&target); let mut dataset = Dataset::new(&config, &d_train); dataset.update(&config, objective.gradients(), objective.bounds()); let mut co...
Rust
0
from z3 import BitVecVal, BV2Int, If, LShR, UDiv, ULT, UGT, URem, ZeroExt, Extract def ADD(x, y): return x + y def MUL(x, y): return x * y def SUB(x, y): return x - y def DIV(x, y): return If(y == 0, 0, UDiv(x, y)) def SDIV(x, y): return If(y == 0, 0, x / y) def MOD(x, y): return If(y == 0, 0, URem(x, y)) ...
Python
1
import re from typing import Annotated from pydantic import AfterValidator, BeforeValidator from pydantic_settings import NoDecode from geh_common.application.converters.str_to_list import str_to_list def _validate_energy_supplier_ids(v: list[str]) -> list[str]: """Validate the list of energy supplier IDs.""" ...
Python
1
\u{010330}'..='\u{01034F}' => Some(GOTHIC), '\u{010350}'..='\u{01037F}' => Some(OLD_PERMIC), '\u{010380}'..='\u{01039F}' => Some(UGARITIC), '\u{0103A0}'..='\u{0103DF}' => Some(OLD_PERSIAN), '\u{010400}'..='\u{01044F}' => Some(DESERET), '\u{010450}'..='\u{01047F}' => Some(SHAVIAN)...
Rust
0
import sys import comtypes.test def main(): sys.exit(comtypes.test.run(sys.argv[1:])) if __name__ == "__main__": main()
Python
1
({}, {}) # {}", integer, base, binary, binary, base, binary_integer ); Ok(()) }, ); } <reponame>zanders3/rustboot #![no_std] #![allow(improper_ctypes)] #![feature(lang_items)] #![feature(...
Rust
0
'html.parser') # ค้นหา message widgets messages = soup.find_all('div', class_='tgme_widget_message') for msg_div in messages: msg_info = { 'extracted_at': datetime.now().isoformat(), 'is_real': True ...
Python
1
from __future__ import absolute_import from __future__ import print_function from TensorMol import * from TensorMol.MBE.NN_MBE import * from TensorMol.MBE.MBE_Opt import * from ..TFDescriptors.RawSymFunc import * from TensorMol.ForceModifiers.Neighbors import * from TensorMol import * import os os.environ["CUDA_VISIBLE...
Python
1
distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use common_exception::ErrorCode; use common_exception::Result; use common_meta_types::WarehouseInfo; us...
Rust
0