file_name large_stringlengths 4 69 | prefix large_stringlengths 0 26.7k | suffix large_stringlengths 0 24.8k | middle large_stringlengths 0 2.12k | fim_type large_stringclasses 4
values |
|---|---|---|---|---|
film.rs | use crate::core::geometry::point::{Point2i, Point2f};
use crate::core::spectrum::{Spectrum, xyz_to_rgb};
use crate::core::pbrt::{Float, Options, clamp, INFINITY};
use crate::core::filter::{Filters, Filter};
use crate::core::geometry::bounds::{Bounds2i, Bounds2f};
use crate::core::parallel::AtomicFloat;
use std::sync::R... |
}
pub struct Film {
pub full_resolution : Point2i,
pub diagonal : Float,
pub filter : Filters,
pub filename : PathBuf,
pub cropped_pixel_bounds: Bounds2i,
pixels : RwLock<Vec<Pixel>>,
filter_table : [Float; FILTER_TABLE_WID... | {
Self {
xyz: [0.0; 3],
filter_weight_sum: 0.0,
splat_xyz: [AtomicFloat::default(), AtomicFloat::default(), AtomicFloat::default()],
_pad: 0.0
}
} | identifier_body |
auth.rs |
Rejected(Response<Body>),
LoggedIn(Response<Body>),
}
type AuthFuture<T> = Pin<Box<dyn Future<Output = Result<AuthResult<T>>> + Send>>;
pub trait Authenticator: Send + Sync {
type Credentials;
fn authenticate(&self, req: RequestWrapper) -> AuthFuture<Self::Credentials>;
}
#[derive(Clone, Debug)]
stru... | () {
let token = Token::new(24, b"my big secret");
assert!(token.is_valid(b"my big secret"));
let orig_token = token.clone();
let serialized_token: String = token.into();
assert!(serialized_token.len() >= 72);
let new_token: Token = serialized_token.parse().unwrap();
... | test_token | identifier_name |
auth.rs |
Rejected(Response<Body>),
LoggedIn(Response<Body>),
}
type AuthFuture<T> = Pin<Box<dyn Future<Output = Result<AuthResult<T>>> + Send>>;
pub trait Authenticator: Send + Sync {
type Credentials;
fn authenticate(&self, req: RequestWrapper) -> AuthFuture<Self::Credentials>;
}
#[derive(Clone, Debug)]
stru... | ); // unwrap is safe as we control
}
Ok(AuthResult::Rejected(resp))
}
fn cookie_params(req: &RequestWrapper) -> &'static str {
if req.is_https() && get_config().is_cors_enabled(&req.request) {
"SameSite=None; Secure"
} else {
"SameSite=Lax"
}
}
impl Authenticator for Share... | cookie_params(req)
))
.unwrap(), | random_line_split |
cli.rs | // Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
//! Functionality related to the command line interface of the Move prover.
use anyhow::anyhow;
use clap::{App, Arg};
use docgen::docgen::DocgenOptions;
use log::LevelFilter;
use serde::{Deserialize, Serialize... | (&self, boogie_file: &str) -> Vec<String> {
let mut result = vec![self.backend.boogie_exe.clone()];
let mut add = |sl: &[&str]| result.extend(sl.iter().map(|s| (*s).to_string()));
add(DEFAULT_BOOGIE_FLAGS);
if self.backend.use_cvc4 {
add(&[
"-proverOpt:SOLVER=... | get_boogie_command | identifier_name |
cli.rs | // Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
//! Functionality related to the command line interface of the Move prover.
use anyhow::anyhow;
use clap::{App, Arg};
use docgen::docgen::DocgenOptions;
use log::LevelFilter;
use serde::{Deserialize, Serialize... | /// Whether to minimize execution traces in errors.
pub minimize_execution_trace: bool,
/// Whether to omit debug information in generated model.
pub omit_model_debug: bool,
/// Whether output for e.g. diagnosis shall be stable/redacted so it can be used in test
/// output.
pub stable_test_o... | pub generate_only: bool,
/// Whether to generate stubs for native functions.
pub native_stubs: bool, | random_line_split |
cli.rs | // Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
//! Functionality related to the command line interface of the Move prover.
use anyhow::anyhow;
use clap::{App, Arg};
use docgen::docgen::DocgenOptions;
use log::LevelFilter;
use serde::{Deserialize, Serialize... |
}
/// Sets up logging based on provided options. This should be called as early as possible
/// and before any use of info!, warn! etc.
pub fn setup_logging(&self) {
CombinedLogger::init(vec![TermLogger::new(
self.verbosity_level,
ConfigBuilder::new()
.se... | {
Ok(options)
} | conditional_block |
main.rs | #![feature(entry_insert, destructuring_assignment)]
use anyhow::{anyhow, bail, ensure};
use clap::{App, Arg};
use derive_more::From;
use digits_iterator::*;
use itertools::Itertools;
use std::{collections::HashMap, convert::TryFrom, fmt, fs, iter, sync::Mutex};
use tokio::pin;
use tokio_stream::{Stream, StreamExt};
f... | program_str
.split(",")
.map(|num_str| {
num_str
.trim()
.parse()
.map_err(|_| anyhow!("Could not parse number in program as isize: '{}'", num_str))
})
.try_collect()
}
| identifier_body | |
main.rs | #![feature(entry_insert, destructuring_assignment)]
use anyhow::{anyhow, bail, ensure};
use clap::{App, Arg};
use derive_more::From;
use digits_iterator::*;
use itertools::Itertools;
use std::{collections::HashMap, convert::TryFrom, fmt, fs, iter, sync::Mutex};
use tokio::pin;
use tokio_stream::{Stream, StreamExt};
f... | pcode: usize) -> Result<Vec<ParameterModes>, anyhow::Error> {
opcode
.digits()
.rev()
.skip(2)
.map(ParameterModes::try_from)
.try_collect()
}
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
enum ParameterModes {
Position,
Immediate,
Relative,
}
impl TryFrom<u8> for Par... | t_parameter_modes(o | identifier_name |
main.rs | #![feature(entry_insert, destructuring_assignment)]
use anyhow::{anyhow, bail, ensure};
use clap::{App, Arg};
use derive_more::From;
use digits_iterator::*;
use itertools::Itertools;
use std::{collections::HashMap, convert::TryFrom, fmt, fs, iter, sync::Mutex};
use tokio::pin;
use tokio_stream::{Stream, StreamExt};
f... | Up,
Down,
Left,
Right,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, From)]
struct Point {
x: isize,
y: isize,
}
impl fmt::Debug for Point {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("").field(&self.x).field(&self.y).finish()
}
}
impl Point {
fn o... | }
#[derive(Clone, Copy, PartialEq, Eq)]
enum Direction { | random_line_split |
env.rs | use config::{self, Alias, ClickConfig, Config};
use error::KubeError;
use kobj::{KObj, ObjType};
use kube::{
ConfigMapList, DeploymentList, JobList, Kluster, NodeList, PodList, ReplicaSetList, SecretList,
ServiceList, StatefulSetList,
};
use ansi_term::Colour::{Blue, Green, Red, Yellow};
use rustyline::config ... | {
Single(KObj),
Range(Vec<KObj>),
None,
}
/// Keep track of our repl environment
pub struct Env {
pub config: Config,
pub click_config: ClickConfig,
click_config_path: PathBuf,
pub quit: bool,
pub need_new_editor: bool,
pub kluster: Option<Kluster>,
pub namespace: Option<String... | ObjectSelection | identifier_name |
env.rs | use config::{self, Alias, ClickConfig, Config};
use error::KubeError;
use kobj::{KObj, ObjType};
use kube::{
ConfigMapList, DeploymentList, JobList, Kluster, NodeList, PodList, ReplicaSetList, SecretList,
ServiceList, StatefulSetList,
};
use ansi_term::Colour::{Blue, Green, Red, Yellow};
use rustyline::config ... | }
/// Add a new task for the env to keep track of
pub fn add_port_forward(&mut self, pf: PortForward) {
self.port_forwards.push(pf);
}
pub fn get_port_forwards(&self) -> std::slice::Iter<PortForward> {
self.port_forwards.iter()
}
pub fn get_port_forward(&mut self, i: usize... | } | random_line_split |
env.rs | use config::{self, Alias, ClickConfig, Config};
use error::KubeError;
use kobj::{KObj, ObjType};
use kube::{
ConfigMapList, DeploymentList, JobList, Kluster, NodeList, PodList, ReplicaSetList, SecretList,
ServiceList, StatefulSetList,
};
use ansi_term::Colour::{Blue, Green, Red, Yellow};
use rustyline::config ... |
pub fn get_port_forward(&mut self, i: usize) -> Option<&mut PortForward> {
self.port_forwards.get_mut(i)
}
pub fn stop_port_forward(&mut self, i: usize) -> Result<(), std::io::Error> {
if i < self.port_forwards.len() {
let mut pf = self.port_forwards.remove(i);
pf.... | {
self.port_forwards.iter()
} | identifier_body |
lib.rs | fn baseref_and_options(
refname: &str,
) -> josh::JoshResult<(String, String, Vec<String>)> {
let mut split = refname.splitn(2, '%');
let push_to = split.next().ok_or(josh::josh_error("no next"))?.to_owned();
let options = if let Some(options) = split.next() {
options.split(',').map(|x| x.to_st... | {
pub hash: String,
}
pub type CredentialStore = std::collections::HashMap<HashedPassword, Password>;
impl std::fmt::Debug for HashedPassword {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("HashedPassword")
.field("value", &self.hash)
.fini... | HashedPassword | identifier_name |
lib.rs | fn baseref_and_options(
refname: &str,
) -> josh::JoshResult<(String, String, Vec<String>)> {
let mut split = refname.splitn(2, '%');
let push_to = split.next().ok_or(josh::josh_error("no next"))?.to_owned();
let options = if let Some(options) = split.next() {
options.split(',').map(|x| x.to_st... | &repo_update.base_ns, &baseref
);
let backward_commit =
transaction.repo().find_commit(backward_new_oid)?;
if let Ok(Ok(base_commit)) = transaction
.repo()
.revparse_single(&rev)
.map(|x| x.peel_to_commit())... | let rev = format!(
"refs/josh/upstream/{}/{}", | random_line_split |
lib.rs | fn baseref_and_options(
refname: &str,
) -> josh::JoshResult<(String, String, Vec<String>)> {
let mut split = refname.splitn(2, '%');
let push_to = split.next().ok_or(josh::josh_error("no next"))?.to_owned();
let options = if let Some(options) = split.next() {
options.split(',').map(|x| x.to_st... | ;
let cmd = format!("git push {} '{}'", &nurl, &spec);
let mut fakehead = repo.reference(&rn, oid, true, "push_head_url")?;
let (stdout, stderr, status) =
shell.command_env(&cmd, &[], &[("GIT_PASSWORD", &password.value)]);
fakehead.delete()?;
tracing::debug!("{}", &stderr);
tracing::debu... | {
url.to_owned()
} | conditional_block |
lib.rs | fn baseref_and_options(
refname: &str,
) -> josh::JoshResult<(String, String, Vec<String>)> {
let mut split = refname.splitn(2, '%');
let push_to = split.next().ok_or(josh::josh_error("no next"))?.to_owned();
let options = if let Some(options) = split.next() {
options.split(',').map(|x| x.to_st... |
}
pub struct TmpGitNamespace {
name: String,
repo_path: std::path::PathBuf,
_span: tracing::Span,
}
impl TmpGitNamespace {
pub fn new(
repo_path: &std::path::Path,
span: tracing::Span,
) -> TmpGitNamespace {
let n = format!("request_{}", uuid::Uuid::new_v4());
let ... | {
f.debug_struct("HashedPassword")
.field("value", &self.hash)
.finish()
} | identifier_body |
build.rs | extern crate avr_mcu;
use std::path::Path;
fn main() {
let crate_root = Path::new(env!("CARGO_MANIFEST_DIR"));
let mcus = if cfg!(feature = "all_mcus") {
avr_mcu::microcontrollers().to_owned()
} else {
// By default, when compiling for AVR we should hard error if
// microcontrolle... |
result.insert(r.name.clone(), r);
}
}
}
result
}
/// Gets the integer type of a specified width.
fn integer_type(byte_count: u32) -> &'static str {
match byte_count {
1 => "u8",
2 => "u16",
4 => "u... | register.clone()
};
| conditional_block |
build.rs | extern crate avr_mcu;
use std::path::Path;
fn main() {
let crate_root = Path::new(env!("CARGO_MANIFEST_DIR"));
let mcus = if cfg!(feature = "all_mcus") {
avr_mcu::microcontrollers().to_owned()
} else {
// By default, when compiling for AVR we should hard error if
// microcontrolle... |
}
Ok(())
}
fn ordered_registers(mcu: &Mcu) -> Vec<Register> {
let mut unique_registers = self::unique_registers(mcu);
insert_high_low_variants(&mut unique_registers);
let mut registers: Vec<Register> = unique_registers.into_iter().map(|a| a.1).collect();
regis... | random_line_split | |
build.rs | extern crate avr_mcu;
use std::path::Path;
fn main() {
let crate_root = Path::new(env!("CARGO_MANIFEST_DIR"));
let mcus = if cfg!(feature = "all_mcus") {
avr_mcu::microcontrollers().to_owned()
} else {
// By default, when compiling for AVR we should hard error if
// microcontrolle... | fn insert_high_low_variants(registers: &mut HashMap<String, Register>) {
let wide_registers: Vec<_> = registers.values()
.filter(|r| r.size == 2)
.cloned()
.collect();
for r in wide_... | let mut unique_registers = self::unique_registers(mcu);
insert_high_low_variants(&mut unique_registers);
let mut registers: Vec<Register> = unique_registers.into_iter().map(|a| a.1).collect();
registers.sort_by_key(|r| r.offset);
registers
}
| identifier_body |
build.rs | extern crate avr_mcu;
use std::path::Path;
fn main() {
let crate_root = Path::new(env!("CARGO_MANIFEST_DIR"));
let mcus = if cfg!(feature = "all_mcus") {
avr_mcu::microcontrollers().to_owned()
} else {
// By default, when compiling for AVR we should hard error if
// microcontrolle... | (mcu: &Mcu, path: &Path) -> Result<(), io::Error> {
let mut file = File::create(path)?;
self::mcu_module_doc(mcu, &mut file)?;
writeln!(file)?;
self::mcu_module_code(mcu, &mut file)?;
Ok(())
}
/// Gets the module name for a mcu.
fn mcu_module_name(mcu: &Mcu) -> Str... | generate_mcu_module | identifier_name |
eth_pubsub.rs | // Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at yo... | logs(filter, ex).into_future()
})
.collect::<Vec<_>>()
);
let limit = filter.limit;
let executor = self.executor.clone();
let subscriber = subscriber.clone();
self.executor.spawn(logs
.map(move |logs| {
let logs = logs.into_iter().flat_map(|log| log).collect();
for log in limi... | .map(|&(hash, ref ex)| {
let mut filter = filter.clone();
filter.from_block = BlockId::Hash(hash);
filter.to_block = filter.from_block; | random_line_split |
eth_pubsub.rs | // Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at yo... |
Err(())
})
)
}
}
impl<C> EthPubSubClient<C>
where
C:'static + Send + Sync {
/// Creates new `EthPubSubClient`.
pub fn new(client: Arc<C>, executor: Executor, pool_receiver: mpsc::UnboundedReceiver<Arc<Vec<H256>>>) -> Self {
let heads_subscribers = Arc::new(RwLock::new(Subscribers::default()));
let... | {
if let Some(handler) = weak_handler.upgrade() {
handler.notify_syncing(status);
return Ok(())
}
} | conditional_block |
eth_pubsub.rs | // Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at yo... | (&self, id: BlockId) -> Option<encoded::Header> {
self.client.block_header(id)
}
fn logs(&self, filter: EthFilter) -> BoxFuture<Vec<Log>> {
Box::new(LightFetch::logs(self, filter)) as BoxFuture<_>
}
}
impl<C: LightClient> LightChainNotify for ChainNotificationHandler<C> {
fn new_headers(&self, enacted: &[H256... | block_header | identifier_name |
eth_pubsub.rs | // Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at yo... | Self::notify(&executor, &subscriber, pubsub::Result::Log(Box::new(log)))
}
})
.map_err(|e| warn!("Unable to fetch latest logs: {:?}", e))
);
}
}
/// Notify all subscribers about new transaction hashes.
fn notify_new_transactions(&self, hashes: &[H256]) {
for subscriber in self.transaction... | {
for &(ref subscriber, ref filter) in self.logs_subscribers.read().values() {
let logs = futures::future::join_all(enacted
.iter()
.map(|&(hash, ref ex)| {
let mut filter = filter.clone();
filter.from_block = BlockId::Hash(hash);
filter.to_block = filter.from_block;
logs(filter, ex).in... | identifier_body |
time_client.rs | C2SLookupError(StoreError),
TcpError(io::Error),
TlsHandshakeError(io::Error),
TlsSessionError(io::Error),
NtskeProblem(ntske::NtskeProblem),
NtskeNoCookies,
CredentialSaveError(StoreError),
CoreTickError(io::Error),
CoreDepartureError(io::Error),
UdpSocketError(io::Error),
}
im... | unique_id: core::UniqueId,
}
///Deserialize a time response as far as the envelope, but don't try to decrypt it
pub fn deserialize_response_envelope<Response: Buf>(
response: Response,
) -> Result<Result<ResponseEnvelopeData, CryptoNakData>, ResponseError> {
let packet = wire::Packet::decode(response).map_e... | toNakData {
| identifier_name |
time_client.rs | ),
C2SLookupError(StoreError),
TcpError(io::Error),
TlsHandshakeError(io::Error),
TlsSessionError(io::Error),
NtskeProblem(ntske::NtskeProblem),
NtskeNoCookies,
CredentialSaveError(StoreError),
CoreTickError(io::Error),
CoreDepartureError(io::Error),
UdpSocketError(io::Error),
}
... | &envelope.nonce,
Payload {
aad: &envelope.ad,
msg: &envelope.ciphertext,
},
)
.map_err(|_| ResponseError::DecryptionFailure(peer_name.clone()))?;
let (cookies, response)... | let plaintext = aead_s2c
.decrypt( | random_line_split |
time_client.rs | CookieLookupError(e) => write!(f, "Looking up cookie from store: {}", e),
C2SLookupError(e) => write!(f, "Looking up C2S key from store: {}", e),
TcpError(e) => write!(f, "Establishing TCP connection for NTS-KE: {}", e),
TlsHandshakeError(e) => write!(f, "During TLS handshake: {}... | let mut recv_buf = [0; 65535];
loop {
let (recv_size, peer_addr) = socket.recv_from(&mut recv_buf).await?;
if let Err(e) = handle_time_response(&recv_buf[0..recv_size], core_state, secret_store) {
log!(
e.level(),
"Handling time response from {}: {}",
... | identifier_body | |
fst_builder.rs | inited: false,
}
}
// this should be call after new FstBuilder
pub fn init(&mut self) {
if self.do_share_suffix {
let reader = self.fst.bytes_store.get_reverse_reader();
let dedup_hash = NodeHash::new(&mut self.fst, reader);
self.dedup_hash =... | {
let no_output = outputs.empty();
let fst = FST::new(input_type, outputs, bytes_page_bits as usize);
FstBuilder {
dedup_hash: None,
fst,
no_output,
min_suffix_count1,
min_suffix_count2,
do_share_non_singleton_nodes,
... | identifier_body | |
fst_builder.rs | for i in 0..10 {
let node = UnCompiledNode::new(self, i);
self.frontier.push(node);
}
self.inited = true;
}
pub fn term_count(&self) -> i64 {
self.frontier[0].input_count
}
fn compile_node(&mut self, node_index: usize, tail_length: u32) -> Result<Compil... | (&self) -> &mut FST<F> {
unsafe { &mut (*self.fst) }
}
fn nodes_equal(&mut self, node: &UnCompiledNode<F>, address: CompiledAddress) -> Result<bool> {
let reader = &mut self.input as *mut StoreBytesReader;
let mut scratch_arc = unsafe { self.fst().read_first_real_arc(address, &mut *read... | fst | identifier_name |
fst_builder.rs | for i in 0..10 {
let node = UnCompiledNode::new(self, i);
self.frontier.push(node);
}
self.inited = true;
}
pub fn term_count(&self) -> i64 {
self.frontier[0].input_count
}
fn compile_node(&mut self, node_index: usize, tail_length: u32) -> Result<Compil... |
}
if scratch_arc.is_last() {
return Ok(idx == node.num_arcs - 1);
}
unsafe {
self.fst()
| {
return Ok(false);
} | conditional_block |
fst_builder.rs | for i in 0..10 {
let node = UnCompiledNode::new(self, i);
self.frontier.push(node);
}
self.inited = true;
}
pub fn term_count(&self) -> i64 {
self.frontier[0].input_count
}
fn compile_node(&mut self, node_index: usize, tail_length: u32) -> Result<Compi... |
// create a tmp for mem replace
let tmp_fst = FST::new(self.fst.input_type, self.fst.outputs().clone(), 1);
let fst = mem::replace(&mut self.fst, tmp_fst);
Ok(Some(fst))
}
fn compile_all_targets(&mut self, node_idx: usize, tail_length: usize) -> Result<()> {
for i in 0.... | self.compile_node(0, tail_len)?
};
self.fst.finish(node)?; | random_line_split |
furnace.rs | use super::{
items::item_to_str,
structure::{Structure, StructureDynIter, StructureId},
DropItem, FactorishState, FrameProcResult, Inventory, InventoryTrait, ItemType, Position,
Recipe, TempEnt, COAL_POWER,
};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize}; | use web_sys::CanvasRenderingContext2d;
const FUEL_CAPACITY: usize = 10;
/// A list of fixed recipes, because dynamic get_recipes() can only return a Vec.
static RECIPES: Lazy<[Recipe; 2]> = Lazy::new(|| {
[
Recipe::new(
hash_map!(ItemType::IronOre => 1usize),
hash_map!(ItemType::Ir... | use wasm_bindgen::prelude::*; | random_line_split |
furnace.rs | use super::{
items::item_to_str,
structure::{Structure, StructureDynIter, StructureId},
DropItem, FactorishState, FrameProcResult, Inventory, InventoryTrait, ItemType, Position,
Recipe, TempEnt, COAL_POWER,
};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use wasm_bindgen::prelude::*;
... | )
}
fn destroy_inventory(&mut self) -> Inventory {
let mut ret = std::mem::take(&mut self.input_inventory);
ret.merge(std::mem::take(&mut self.output_inventory));
// Return the ingredients if it was in the middle of processing a recipe.
if let Some(mut recipe) = self.recipe.take... | {
&mut self.output_inventory
} | conditional_block |
furnace.rs | use super::{
items::item_to_str,
structure::{Structure, StructureDynIter, StructureId},
DropItem, FactorishState, FrameProcResult, Inventory, InventoryTrait, ItemType, Position,
Recipe, TempEnt, COAL_POWER,
};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use wasm_bindgen::prelude::*;
... |
fn inventory(&self, is_input: bool) -> Option<&Inventory> {
Some(if is_input {
&self.input_inventory
} else {
&self.output_inventory
})
}
fn inventory_mut(&mut self, is_input: bool) -> Option<&mut Inventory> {
Some(if is_input {
&mut sel... | {
if self.output_inventory.remove_item(item_type) {
Ok(())
} else {
Err(())
}
} | identifier_body |
furnace.rs | use super::{
items::item_to_str,
structure::{Structure, StructureDynIter, StructureId},
DropItem, FactorishState, FrameProcResult, Inventory, InventoryTrait, ItemType, Position,
Recipe, TempEnt, COAL_POWER,
};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use wasm_bindgen::prelude::*;
... | (&mut self, is_input: bool) -> Option<&mut Inventory> {
Some(if is_input {
&mut self.input_inventory
} else {
&mut self.output_inventory
})
}
fn destroy_inventory(&mut self) -> Inventory {
let mut ret = std::mem::take(&mut self.input_inventory);
r... | inventory_mut | identifier_name |
day18.rs | // day 18
use std::collections::HashMap;
struct MazeNode {
obstacle: bool,
key_index: i64,
door_index: i64,
}
struct Key {
x: usize,
y: usize,
symbol: char,
}
struct Door {
_x: usize,
_y: usize,
symbol: char,
key_index: usize,
}
struct Maze {
grid: Vec<Vec<MazeNode>>,
keys: Vec<Key>,
doors: Vec<Door>,
... | }
}
vec2.push(line);
}
}
let result_a = read_maze(vec, &mut maze);
println!("Result A: {}", result_a);
if has_part_b {
let result_b = read_maze(vec2, &mut maze2);
println!("Result B: {}", result_b);
}
} | {
for y in 0..vec.len() {
let mut line = String::from("");
let bytes = vec[y].as_bytes();
for x in 0..vec[y].len() {
if (x == ox - 1 && y == oy - 1) ||
(x == ox + 1 && y == oy - 1) ||
(x == ox - 1 && y == oy + 1) ||
(x == ox + 1 && y == oy + 1) {
line.push('@');
} else if (x == o... | conditional_block |
day18.rs | // day 18
use std::collections::HashMap;
struct MazeNode {
obstacle: bool,
key_index: i64,
door_index: i64,
}
struct Key {
x: usize,
y: usize,
symbol: char,
}
struct Door {
_x: usize,
_y: usize,
symbol: char,
key_index: usize,
}
struct Maze {
grid: Vec<Vec<MazeNode>>,
keys: Vec<Key>,
doors: Vec<Door>,
... | for key in frontier.keys() {
let node = frontier.get(key).unwrap();
let exploredindex1 = exploredindex(maze, (*node).x, (*node).y);
if explored.contains_key(&exploredindex1) {
let last_dist = explored.get(&exploredindex1).unwrap().dist;
if (*node).dist < last_dist {
let node2 = explored.get_mut(... | {
let mut explored:HashMap<usize, DNode> = HashMap::new();
let mut frontier:HashMap<usize,DNode> = HashMap::new();
let mut frontier_next:HashMap<usize,DNode> = HashMap::new();
frontier_next.insert(exploredindex(maze, start_x, start_y), DNode{x:start_x, y:start_y, dist:0, parent_x:start_x, parent_y:start_y});
... | identifier_body |
day18.rs | // day 18
use std::collections::HashMap;
struct MazeNode {
obstacle: bool,
key_index: i64,
door_index: i64,
}
struct Key {
x: usize,
y: usize,
symbol: char,
}
struct Door {
_x: usize,
_y: usize,
symbol: char,
key_index: usize,
}
struct Maze {
grid: Vec<Vec<MazeNode>>,
keys: Vec<Key>,
doors: Vec<Door>,
... | } else if i == 3 {
xd = 0; yd = -1;
}
let x1 = (*node).x as i64 + xd;
let y1 = (*node).y as i64 + yd;
if x1 < 0 || x1 >= (*maze).width as i64 || y1 < 0 || y1 >= (*maze).height as i64 {
continue;
}
else {
if (*maze).grid[y1 as usize][x1 as usize].obstacle {
continu... | } else if i == 1 {
xd = 1; yd = 0;
} else if i == 2 {
xd = 0; yd = 1; | random_line_split |
day18.rs | // day 18
use std::collections::HashMap;
struct MazeNode {
obstacle: bool,
key_index: i64,
door_index: i64,
}
struct Key {
x: usize,
y: usize,
symbol: char,
}
struct Door {
_x: usize,
_y: usize,
symbol: char,
key_index: usize,
}
struct Maze {
grid: Vec<Vec<MazeNode>>,
keys: Vec<Key>,
doors: Vec<Door>,
... | {
x: usize,
y: usize,
dist: usize,
parent_x:usize,
parent_y:usize
}
#[derive(Clone)]
struct DNodeB {
at:Vec<usize>,
keys:Vec<usize>,
dist:usize
}
fn intersect_count (vec_a:&Vec<usize>, vec_b:&Vec<usize>)->usize {
let mut count = 0;
for i in 0..vec_a.len() {
for j in 0..vec_b.len() {
if vec_b[j] == vec... | DNode | identifier_name |
main.rs | ability guarantees from other requests from the same process.
// Sanitizes the path.
let req = req.into_inner();
let rx = {
if let Some(perms) = self.process_tokens.lock().unwrap().get_mut(&req.process_token) {
perms.touch()
} else {
return... | /// If the tag corresponds to sensor state (say maybe it starts with #
/// which is reserved for state tags), forward the request as a state
/// change instead.
async fn push(
&self, req: Request<PushData>,
) -> Result<Response<()>, Status> {
debug!("push");
// Validate the p... | /// forward to the controller.
/// | random_line_split |
main.rs | guarantees from other requests from the same process.
// Sanitizes the path.
let req = req.into_inner();
let rx = {
if let Some(perms) = self.process_tokens.lock().unwrap().get_mut(&req.process_token) {
perms.touch()
} else {
return Err(St... | (
&self, req: Request<PushData>,
) -> Result<Response<()>, Status> {
debug!("push");
// Validate the process is valid and has permissions to write the file.
// No serializability guarantees from other requests from the same process.
// Sanitizes the path.
let req = re... | push | identifier_name |
main.rs | guarantees from other requests from the same process.
// Sanitizes the path.
let req = req.into_inner();
let rx = {
if let Some(perms) = self.process_tokens.lock().unwrap().get_mut(&req.process_token) {
perms.touch()
} else {
return Err(St... | return Ok(Response::new(()));
}
if state_tags::is_state_tag(&req.tag) {
Some(state_tags::parse_state_tag(&req.tag))
} else {
None
}
} else {
unreachable!()
};
if let Some((sensor, key)) =... | {
debug!("push");
// Validate the process is valid and has permissions to write the file.
// No serializability guarantees from other requests from the same process.
// Sanitizes the path.
let req = req.into_inner();
let rx = {
if let Some(perms) = self.proces... | identifier_body |
main.rs | guarantees from other requests from the same process.
// Sanitizes the path.
let req = req.into_inner();
let rx = {
if let Some(perms) = self.process_tokens.lock().unwrap().get_mut(&req.process_token) {
perms.touch()
} else {
return Err(St... |
}
}
impl Host {
/// Generate a new host with a random ID.
pub fn new(
base_path: PathBuf,
controller: &str,
cold_cache_enabled: bool,
warm_cache_enabled: bool,
pubsub_enabled: bool,
mock_network: bool,
) -> Self {
use rand::Rng;
let id: u... | {
// Forward the file access to the controller and return the result
debug!("push: {} forwarding push tag={}", req.process_token, req.tag);
self.api.forward_push(req).await
} | conditional_block |
parser.rs | // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//! Parsing of Verilog vmem files into the [`Vmem`] representation.
//!
//! See the [srec_vmem] documentation for a description of the file format.
//!
//! To summarise:... | () {
// Check we can pick out the correct token from a string:
let expected = [
("", Token::Eof, 0),
("@ff", Token::Addr(0xff), 3),
("ff", Token::Value(0xff), 2),
("// X", Token::Comment, 4),
("/* X */", Token::Comment, 7),
(" ", T... | token | identifier_name |
parser.rs | // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//! Parsing of Verilog vmem files into the [`Vmem`] representation.
//!
//! See the [srec_vmem] documentation for a description of the file format.
//!
//! To summarise:... | /// Catch-all for any characters that don't belong in vmem files.
#[error("unknown character '{0}'")]
UnknownChar(char),
}
/// Representation of the possible tokens found in vmem files.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
enum Token {
/// End of file.
Eof,
/// Address directive, e.g. `@... | AddrMissingValue,
| random_line_split |
parser.rs | // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//! Parsing of Verilog vmem files into the [`Vmem`] representation.
//!
//! See the [srec_vmem] documentation for a description of the file format.
//!
//! To summarise:... |
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn parse() {
let input = r#"
AB
// comment
CD EF
@42
12 /* comment */ 34
"#;
let expected = Vmem {
sections: vec![
Section {
... | {
// Check for whitespace at the beginning of the input.
let len = match s.find(|c: char| !c.is_whitespace()) {
Some(0) => return Ok(None),
Some(len) => len,
None => s.len(),
};
let token = Token::Whitespace;
let span = Span { len, token };
... | identifier_body |
main.rs | use oorandom;
#[test]
fn research_on_directionary() {
// 词性分类函数, 找出.dic的标识符以及每个标识符 10 个id
use std::fs;
use std::collections::HashMap;
let mut hash : HashMap<&str, Vec<&str>> = HashMap::new();
let raw_bytes = fs::read_to_string("resources/ansj_seg-master/default.dic").expect("failed to open directio... | [element ="Who"][word = "是从"][element = "Location"][word="来的."]
), 1.8)
.add_node(sentance!(
[element="AskWho"][word="在"][element ="Time"][element="TranstiveVerb"]
[element="Adjective"][word="的"][element="GenericNoun"][icon='?']
), 0.4)
.add_node(sentance!(
... | !(
| identifier_name |
main.rs | use oorandom;
#[test]
fn research_on_directionary() {
// 词性分类函数, 找出.dic的标识符以及每个标识符 10 个id
use std::fs;
use std::collections::HashMap;
let mut hash : HashMap<&str, Vec<&str>> = HashMap::new();
let raw_bytes = fs::read_to_string("resources/ansj_seg-master/default.dic").expect("failed to open directio... | continue;
}
let hash_get = hash.get_mut(tag);
match hash_get {
None => {
let vec = vec!(last_word);
hash.insert(tag, vec);
}
Some(vec) => {
if vec.len() >= 10 {continue;}
vec.push(last... | i = i + 1;
// 奇数列为word, 偶数列为tag
if i % 2 != 0 {
last_word = tag; | random_line_split |
main.rs | use oorandom;
#[test]
fn research_on_directionary() {
// 词性分类函数, 找出.dic的标识符以及每个标识符 10 个id
use std::fs;
use std::collections::HashMap;
let mut hash : HashMap<&str, Vec<&str>> = HashMap::new();
let raw_bytes = fs::read_to_string("resources/ansj_seg-master/default.dic").expect("failed to open directio... | #[derive(Debug)]
struct RandomResolver {
rng : oorandom::Rand64,
}
impl RandomResolver {
pub fn from_se
ed(seed : u128) -> Self {
let rng = oorandom::Rand64::new(seed);
RandomResolver{rng : rng}
}
fn resolve_pos(&mut self, vec : &Vec<f64>) -> usize {
let float_result = self.rng.... | &new_word, matcher_result);
match matcher_result {
Some(element_vec) => {
for element in element_vec{
let library_result = self.library.get_mut(element.as_str());
match library_result {
Some(ele_vec) => {
... | identifier_body |
virtio_constants.rs | #![allow(dead_code)]
#![allow(clippy::all)]
// Copied from the ixy C driver
// Amended with updates from the newer Virtio spec v1.1
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or wi... | pub const VIRTIO_NET_F_STATUS: usize = 16; /* virtio_net_config.status available */
pub const VIRTIO_NET_F_CTRL_VQ: usize = 17; /* Control channel available */
pub const VIRTIO_NET_F_CTRL_RX: usize = 18; /* Control channel RX mode support */
pub const VIRTIO_NET_F_CTRL_VLAN: usize = 1... | random_line_split | |
virtio_constants.rs | #![allow(dead_code)]
#![allow(clippy::all)]
// Copied from the ixy C driver
// Amended with updates from the newer Virtio spec v1.1
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or wi... | (command_data: T) -> VirtioNetCtrl<T> {
VirtioNetCtrl {
class: T::CLASS,
command: T::COMMAND,
command_data,
ack: 0,
}
}
}
/// A specific command to be sent through the control queue (wrapped in a [`VirtioNetCtrl`])
pub trait VirtioNetCtrlCommand {
... | from | identifier_name |
main.rs | 6],
}
#[derive(Clone, Copy, Debug)]
#[repr(C, align(16))]
struct PerInstanceConst {
translate: nalgebra::Vector3<f32>,
dir: u32,
}
#[derive(Clone, Copy, Debug)]
#[repr(C, align(16))]
struct PerInstance {
color: nalgebra::Vector3<f32>,
pad: u32,
}
#[derive(Debug)]
struct Camera {
view: nalgebra::... |
Ok(MeshRenderPipeline {
align,
buffer,
sets,
})
}
}
fn model_transform() -> nalgebra::Matrix4<f32> {
let rot = nalgebra::UnitQuaternion::identity();
nalgebra::Similarity3::from_parts(Vector3::new(0.5, 0.5, 0.0).into(), rot, 0.5).into()
}
fn model_trans... | {
// println!(
// "upload const: {}",
// std::mem::size_of::<PerInstanceConst>() * scene.per_instance_const.len()
// );
unsafe {
factory
.upload_visible_buffer(&mut buffer, 0, &scene.per_instance_const[..])
... | conditional_block |
main.rs | >; 6],
}
#[derive(Clone, Copy, Debug)]
#[repr(C, align(16))]
struct PerInstanceConst {
translate: nalgebra::Vector3<f32>,
dir: u32,
}
#[derive(Clone, Copy, Debug)]
#[repr(C, align(16))]
struct PerInstance {
color: nalgebra::Vector3<f32>,
pad: u32,
}
#[derive(Debug)]
struct Camera {
view: nalgebra... | let mut planes = crystal::PlanesSep::new();
planes.create_planes(&bm);
let planes_copy : Vec<crystal::Plane> = planes.planes_iter().cloned().collect();
let mut scene = Scene {
camera: Camera {
proj: nalgebra::Perspective3::new(aspect as f32, 3.1415 / 4.0, 1.0... | random_line_split | |
main.rs | 6],
}
#[derive(Clone, Copy, Debug)]
#[repr(C, align(16))]
struct PerInstanceConst {
translate: nalgebra::Vector3<f32>,
dir: u32,
}
#[derive(Clone, Copy, Debug)]
#[repr(C, align(16))]
struct PerInstance {
color: nalgebra::Vector3<f32>,
pad: u32,
}
#[derive(Debug)]
struct Camera {
view: nalgebra::... |
const fn buffer_const_size(align: u64) -> u64 {
align_to(PER_INSTANCE_CONST_SIZE * NUM_INSTANCES, align)
}
const fn buffer_frame_size(align: u64) -> u64 {
align_to(UNIFORM_SIZE + PER_INSTANCE_SIZE * NUM_INSTANCES, align)
}
const fn buffer_size(align: u64, frames: u64) -> u64 {
buffer_const_size(align) + bu... | {
((s - 1) / align + 1) * align
} | identifier_body |
main.rs | 6],
}
#[derive(Clone, Copy, Debug)]
#[repr(C, align(16))]
struct PerInstanceConst {
translate: nalgebra::Vector3<f32>,
dir: u32,
}
#[derive(Clone, Copy, Debug)]
#[repr(C, align(16))]
struct PerInstance {
color: nalgebra::Vector3<f32>,
pad: u32,
}
#[derive(Debug)]
struct Camera {
view: nalgebra::... | (index: usize, align: u64) -> u64 {
buffer_const_size(align) + buffer_frame_size(align) * index as u64
}
const fn per_instance_offset(index: usize, align: u64) -> u64 {
uniform_offset(index, align) + UNIFORM_SIZE
}
#[derive(Debug, Default)]
struct MeshRenderPipelineDesc;
#[derive(Debug)]
struct MeshRenderPipe... | uniform_offset | identifier_name |
catalog.rs | use crate::block::BlockType;
use crate::error::*;
use crate::mutator::append::Append;
use crate::params::{SourceId, CATALOG_METADATA, TIMESTAMP_COLUMN};
use crate::scanner::{Scan, ScanResult};
use crate::storage::manager::PartitionGroupManager;
use crate::ty::{BlockStorage, ColumnId, ColumnIndexStorageMap};
use hyena_c... | bail!("Cannot find catalog metadata {:?}", meta);
}
let (mut catalog, group_metas): (Catalog, Vec<SourceId>) =
deserialize!(file meta).with_context(|_| "Failed to read catalog metadata")?;
catalog.groups = Catalog::prepare_partition_groups(&root, group_metas)
... | let meta = meta.as_ref();
if !meta.exists() { | random_line_split |
catalog.rs | use crate::block::BlockType;
use crate::error::*;
use crate::mutator::append::Append;
use crate::params::{SourceId, CATALOG_METADATA, TIMESTAMP_COLUMN};
use crate::scanner::{Scan, ScanResult};
use crate::storage::manager::PartitionGroupManager;
use crate::ty::{BlockStorage, ColumnId, ColumnIndexStorageMap};
use hyena_c... |
fn prepare_partition_groups<P, I>(root: P, ids: I) -> Result<PartitionGroupMap<'cat>>
where
P: AsRef<Path>,
I: IntoIterator<Item = SourceId>,
{
ids.into_iter()
.map(|source_id| {
let path = PartitionGroupManager::new(&root, source_id).with_context(|_| {
... | {
let _ = self.ensure_group(source_id)?;
Ok(())
} | identifier_body |
catalog.rs | use crate::block::BlockType;
use crate::error::*;
use crate::mutator::append::Append;
use crate::params::{SourceId, CATALOG_METADATA, TIMESTAMP_COLUMN};
use crate::scanner::{Scan, ScanResult};
use crate::storage::manager::PartitionGroupManager;
use crate::ty::{BlockStorage, ColumnId, ColumnIndexStorageMap};
use hyena_c... | (&mut self) -> Result<()> {
let ts_column = Column::new(BlockStorage::Memmap(BlockType::U64Dense), "timestamp");
let source_column = Column::new(BlockStorage::Memory(BlockType::I32Dense), "source_id");
let mut map = HashMap::new();
map.insert(TIMESTAMP_COLUMN, ts_column);
map.ins... | ensure_default_columns | identifier_name |
catalog.rs | use crate::block::BlockType;
use crate::error::*;
use crate::mutator::append::Append;
use crate::params::{SourceId, CATALOG_METADATA, TIMESTAMP_COLUMN};
use crate::scanner::{Scan, ScanResult};
use crate::storage::manager::PartitionGroupManager;
use crate::ty::{BlockStorage, ColumnId, ColumnIndexStorageMap};
use hyena_c... |
}
self.ensure_columns(column_map)
}
/// Extend internal index map without any sanitization checks.
///
/// This function uses `std::iter::Extend` internally,
/// so it allows redefinition of a index type.
/// Also, the index' support for a given column is not checked.
/// ... | {
bail!("Column Name already exists '{}'", column.name);
} | conditional_block |
credentials.rs | //! # Credentials for accessing the Firebase REST API
//! This module contains the [`crate::credentials::Credentials`] type, used by [`crate::sessions`] to create and maintain
//! authentication tokens for accessing the Firebase REST API.
use chrono::Duration;
use serde::{Deserialize, Serialize};
use serde_json;
use s... | () {
let jwk_list = JWKSet::new(include_str!("../tests/service-account-test.jwks")).unwrap();
let c: Credentials = Credentials::new(include_str!("../tests/service-account-test.json"))
.expect("Failed to deserialize credentials")
.with_jwkset(&jwk_list)
.expect("JWK public keys verification ... | deserialize_credentials | identifier_name |
credentials.rs | //! # Credentials for accessing the Firebase REST API
//! This module contains the [`crate::credentials::Credentials`] type, used by [`crate::sessions`] to create and maintain
//! authentication tokens for accessing the Firebase REST API.
use chrono::Duration;
use serde::{Deserialize, Serialize};
use serde_json;
use s... | /// # Ok::<(), firestore_db_and_auth::errors::FirebaseError>(())
/// ```
pub fn add_jwks_public_keys(&mut self, jwkset: &JWKSet) {
for entry in jwkset.keys.iter() {
if!entry.headers.key_id.is_some() {
continue;
}
let key_id = entry.headers.key_id.... | /// c.add_jwks_public_keys(&JWKSet::new(include_str!("../tests/service-account-test.jwks"))?);
/// c.compute_secret()?;
/// c.verify()?; | random_line_split |
credentials.rs | //! # Credentials for accessing the Firebase REST API
//! This module contains the [`crate::credentials::Credentials`] type, used by [`crate::sessions`] to create and maintain
//! authentication tokens for accessing the Firebase REST API.
use chrono::Duration;
use serde::{Deserialize, Serialize};
use serde_json;
use s... | {
let jwk_list = JWKSet::new(include_str!("../tests/service-account-test.jwks")).unwrap();
let c: Credentials = Credentials::new(include_str!("../tests/service-account-test.json"))
.expect("Failed to deserialize credentials")
.with_jwkset(&jwk_list)
.expect("JWK public keys verification ... | identifier_body | |
credentials.rs | //! # Credentials for accessing the Firebase REST API
//! This module contains the [`crate::credentials::Credentials`] type, used by [`crate::sessions`] to create and maintain
//! authentication tokens for accessing the Firebase REST API.
use chrono::Duration;
use serde::{Deserialize, Serialize};
use serde_json;
use s... |
let key_id = entry.headers.key_id.as_ref().unwrap().to_owned();
self.keys
.pub_key
.insert(key_id, Arc::new(entry.ne.jws_public_key_secret()));
}
}
/// If you haven't called [`Credentials::add_jwks_public_keys`] to manually add public keys,
//... | {
continue;
} | conditional_block |
main.rs | 1 2 3 4
4 3 2 1
= 1 2 2 1
unpack hi, min
1 2 2 1
1 1 2 2
= 1 1 2 1
*/
let x = self.0;
let y = _mm256_extractf128_ps(x, 1);
let m1 = _mm_min_ps(_mm256_castps256_ps128(x), y);
... |
}
}
} else {
color += reflectance * bg.emit_color;
break;
}
}
(color, orig_bounces - bounces)
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
// flush denormals to zero
unsafe { _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON) };
... | {
let a = randf_range(rng_state, 0.0, 2.0 * PI);
let z = randf_range(rng_state, -1.0, 1.0);
let r = (1.0 - z * z).sqrt();
V3(r * a.cos(), r * a.sin(), z)
} | conditional_block |
main.rs | 1 2 3 4
4 3 2 1
= 1 2 2 1
unpack hi, min
1 2 2 1
1 1 2 2
= 1 1 2 1
*/
let x = self.0;
let y = _mm256_extractf128_ps(x, 1);
let m1 = _mm_min_ps(_mm256_castps256_ps128(x), y);
... |
}
impl Div for WideF32 {
type Output = Self;
fn div(self, other: Self) -> Self {
Self(unsafe { _mm256_div_ps(self.0, other.0) })
}
}
impl Sub for WideF32 {
type Output = Self;
fn sub(self, other: Self) -> Self {
Self(unsafe { _mm256_sub_ps(self.0, other.0) })
}
}
impl Mul f... | {
Self(unsafe { _mm256_or_ps(self.0, other.0) })
} | identifier_body |
main.rs | 1 2 3 4
4 3 2 1
= 1 2 2 1
unpack hi, min
1 2 2 1
1 1 2 2
= 1 1 2 1
*/
let x = self.0;
let y = _mm256_extractf128_ps(x, 1);
let m1 = _mm_min_ps(_mm256_castps256_ps128(x), y);
... | {
xs: Vec<f32>,
ys: Vec<f32>,
zs: Vec<f32>,
rsqrds: Vec<f32>,
mats: Vec<Material>,
}
impl Spheres {
fn new(spheres: Vec<Sphere>) -> Self {
let len = (spheres.len() + SIMD_WIDTH - 1) / SIMD_WIDTH * SIMD_WIDTH;
let mut me = Self {
xs: Vec::with_capacity(len),
... | Spheres | identifier_name |
main.rs | unsafe { _mm256_movemask_ps(self.0) }
}
fn hmin(&self) -> f32 {
unsafe {
/*
This can be done entirely in avx with permute2f128, but that is allegedly very
slow on AMD prior to Zen2 (and is anecdotally slower on my Intels as well)
initial m256
... | self.mask() != 0
}
fn mask(&self) -> i32 { | random_line_split | |
mod.rs | /*
* Copyright 2018 The Starlark in Rust Authors.
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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
*
* https://www.apache.org/lic... |
}
| {
self.get_aref().get_type_value()
} | identifier_body |
mod.rs | /*
* Copyright 2018 The Starlark in Rust Authors.
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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
*
* https://www.apache.org/lic... | (self, name: &str, heap: &'v Heap) {
if let Some(mut mv) = self.get_ref_mut_already() {
mv.export_as(heap, name)
}
}
/// Return the attribute with the given name. Returns a pair of a boolean and the value.
///
/// The type is [`AttrType::Method`] if the attribute was defined... | export_as | identifier_name |
mod.rs | /*
* Copyright 2018 The Starlark in Rust Authors.
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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
*
* https://www.apache.org/lic... |
}
fn compare(self, other: Value<'v>) -> anyhow::Result<Ordering> {
let _guard = stack_guard::stack_guard()?;
self.get_aref().compare(other)
}
fn downcast_ref<T: AnyLifetime<'v>>(self) -> Option<ARef<'v, T>> {
let any = ARef::map(self.get_aref(), |e| e.as_dyn_any());
if... | {
let _guard = stack_guard::stack_guard()?;
self.get_aref().equals(other)
} | conditional_block |
mod.rs | /*
* Copyright 2018 The Starlark in Rust Authors.
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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
*
* https://www.apache.org/lic... | }
}
impl Debug for FrozenValue {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
debug_value("FrozenValue", Value::new_frozen(*self), f)
}
}
impl<'v> PartialEq for Value<'v> {
fn eq(&self, other: &Value<'v>) -> bool {
self.equals(*other).ok() == Some(true)
}
}
impl PartialE... | debug_value("Value", *self, f) | random_line_split |
backend.rs | `.
use crate::memory::Memory;
use cranelift_codegen::binemit::{Addend, CodeOffset, NullTrapSink, Reloc, RelocSink};
use cranelift_codegen::isa::TargetIsa;
use cranelift_codegen::{self, ir, settings};
use cranelift_module::{
Backend, DataContext, DataDescription, Init, Linkage, ModuleNamespace, ModuleResult,
};
use... | (&self, func: &Self::CompiledFunction) -> Self::FinalizedFunction {
func.code
}
fn finalize_data(
&mut self,
data: &Self::CompiledData,
namespace: &ModuleNamespace<Self>,
) -> Self::FinalizedData {
use std::ptr::write_unaligned;
for &RelocRecord {
... | get_finalized_function | identifier_name |
backend.rs | Backend`.
use crate::memory::Memory;
use cranelift_codegen::binemit::{Addend, CodeOffset, NullTrapSink, Reloc, RelocSink};
use cranelift_codegen::isa::TargetIsa;
use cranelift_codegen::{self, ir, settings};
use cranelift_module::{
Backend, DataContext, DataDescription, Init, Linkage, ModuleNamespace, ModuleResult,... | | Reloc::X86GOTPCRel4
| Reloc::X86CallPLTRel4 => panic!("unexpected text relocation in data"),
_ => unimplemented!(),
}
}
(data.storage, data.size)
}
fn get_finalized_data(&self, data: &Self::CompiledData) -> Self::FinalizedData {
... | | Reloc::X86CallPCRel4 | random_line_split |
backend.rs | `.
use crate::memory::Memory;
use cranelift_codegen::binemit::{Addend, CodeOffset, NullTrapSink, Reloc, RelocSink};
use cranelift_codegen::isa::TargetIsa;
use cranelift_codegen::{self, ir, settings};
use cranelift_module::{
Backend, DataContext, DataDescription, Init, Linkage, ModuleNamespace, ModuleResult,
};
use... |
fn declare_function(&mut self, _name: &str, _linkage: Linkage) {
// Nothing to do.
}
fn declare_data(
&mut self,
_name: &str,
_linkage: Linkage,
_writable: bool,
_align: Option<u8>,
) {
// Nothing to do.
}
fn define_function(
&m... | {
&*self.isa
} | identifier_body |
token.rs | /**
* An advanced fungible token implementation.
*
*/
use near_sdk::serde_json::{self, json};
use near_sdk::borsh::{ self, BorshDeserialize, BorshSerialize};
use near_sdk::{ env, near_bindgen, ext_contract, AccountId, Balance, Promise, StorageUsage};
use near_sdk::collections::LookupMap;
use near_sdk::json_types::U... |
//// How many rollbacks we have had
pub fn get_rollback_count(&self) -> u64 {
self.ledger.rollbacks
}
/// Returns balance of the `owner_id` account.
pub fn get_name(&self) -> &str {
return &self.metadata.name;
}
/// Send owner's tokens to another person or a smart contrac... | {
self.ledger.get_locked_balance(&owner_id).into()
} | identifier_body |
token.rs | /**
* An advanced fungible token implementation.
*
*/
use near_sdk::serde_json::{self, json};
use near_sdk::borsh::{ self, BorshDeserialize, BorshSerialize};
use near_sdk::{ env, near_bindgen, ext_contract, AccountId, Balance, Promise, StorageUsage};
use near_sdk::collections::LookupMap;
use near_sdk::json_types::U... |
// Construct the promise that calls back the
// token contract to finalise the transaction
let promise1 = env::promise_then(
promise0,
env::current_account_id(),
b"handle_token_received",
json!({
"ol... | {
// The send() was destined to a compatible receiver smart contract.
// Build another promise that notifies the smart contract
// that is has received new tokens.
env::log(b"Constructing smart contract notifier promise");
let promise0 = env::promise_create... | conditional_block |
token.rs | /**
* An advanced fungible token implementation.
*
*/
use near_sdk::serde_json::{self, json};
use near_sdk::borsh::{ self, BorshDeserialize, BorshSerialize};
use near_sdk::{ env, near_bindgen, ext_contract, AccountId, Balance, Promise, StorageUsage};
use near_sdk::collections::LookupMap;
use near_sdk::json_types::U... | account_balance: 1_000_000_000_000_000_000_000_000_000u128,
account_locked_balance: 0,
storage_usage: 10u64.pow(6),
attached_deposit: 0,
prepaid_gas: 10u64.pow(18),
random_seed: vec![0, 1, 2],
is_view: false,
output_data_rec... | block_index: 0,
block_timestamp: 0, | random_line_split |
token.rs | /**
* An advanced fungible token implementation.
*
*/
use near_sdk::serde_json::{self, json};
use near_sdk::borsh::{ self, BorshDeserialize, BorshSerialize};
use near_sdk::{ env, near_bindgen, ext_contract, AccountId, Balance, Promise, StorageUsage};
use near_sdk::collections::LookupMap;
use near_sdk::json_types::U... | () -> AccountId {
"bob.near".to_string()
}
fn carol() -> AccountId {
"carol.near".to_string()
}
fn get_context(predecessor_account_id: AccountId) -> VMContext {
VMContext {
current_account_id: alice(),
signer_account_id: bob(),
signer_account... | bob | identifier_name |
processor.rs | mut c_char;
fn system_info_os_version(info: *const SystemInfo) -> *mut c_char;
fn system_info_cpu_family(info: *const SystemInfo) -> *mut c_char;
fn system_info_cpu_info(info: *const SystemInfo) -> *mut c_char;
fn system_info_cpu_count(info: *const SystemInfo) -> u32;
fn process_minidump(
b... | else {
Err(ProcessMinidumpError(result))
}
}
/// The index of the thread that requested a dump be written in the threads vector.
///
/// If a dump was produced as a result of a crash, this will point to the thread that crashed.
/// If the dump was produced as by user code witho... | {
Ok(ProcessState {
internal,
_ty: PhantomData,
})
} | conditional_block |
processor.rs | mut c_char;
fn system_info_os_version(info: *const SystemInfo) -> *mut c_char;
fn system_info_cpu_family(info: *const SystemInfo) -> *mut c_char;
fn system_info_cpu_info(info: *const SystemInfo) -> *mut c_char;
fn system_info_cpu_count(info: *const SystemInfo) -> u32;
fn process_minidump(
b... | <'a> {
internal: *mut IProcessState,
_ty: PhantomData<ByteView<'a>>,
}
impl<'a> ProcessState<'a> {
/// Processes a minidump supplied via raw binary data.
///
/// Returns a `ProcessState` that contains information about the crashed
/// process. The parameter `frame_infos` expects a map of Breakp... | ProcessState | identifier_name |
processor.rs | *mut c_char;
fn system_info_os_version(info: *const SystemInfo) -> *mut c_char;
fn system_info_cpu_family(info: *const SystemInfo) -> *mut c_char;
fn system_info_cpu_info(info: *const SystemInfo) -> *mut c_char;
fn system_info_cpu_count(info: *const SystemInfo) -> u32;
fn process_minidump(
... | NoMinidumpHeader,
/// The minidump file has no thread list.
NoThreadList,
/// There was an error getting one thread's data from the dump.
InvalidThreadIndex,
/// There was an error getting a thread id from the thread's data.
InvalidThreadId,
/// There was more than one requesting thr... |
/// The minidump file had no header. | random_line_split |
builders.rs | //! Builder types used for patches and other complex data structures.
//!
//! These types do not usually need to be imported, but the methods available
//! on them are very relevant to where they are used.
use serde_json::Value;
use chrono::offset::FixedOffset;
use chrono::DateTime;
use model::*;
use Object;
macro_... | (self, bitrate: u64) -> Self {
set!(self, "bitrate", bitrate)
}
/// Edit the voice channel's user limit. Zero (`0`) means unlimited.
pub fn user_limit(self, user_limit: u64) -> Self {
set!(self, "user_limit", user_limit)
}
}
impl EditMember {
/// Edit the member's nickname. Supply the empty string to remove ... | bitrate | identifier_name |
builders.rs | //! Builder types used for patches and other complex data structures.
//!
//! These types do not usually need to be imported, but the methods available
//! on them are very relevant to where they are used.
use serde_json::Value;
use chrono::offset::FixedOffset;
use chrono::DateTime;
use model::*;
use Object;
macro_... | #[inline(always)]
pub fn __build<F: FnOnce($name) -> $name>(f: F) -> $inner where $inner: Default {
Self::__apply(f, Default::default())
}
#[doc(hidden)]
pub fn __apply<F: FnOnce($name) -> $name>(f: F, inp: $inner) -> $inner {
f($name(inp)).0
}
/// Merge this builder's contents w... |
impl $name {
#[doc(hidden)] | random_line_split |
builders.rs | //! Builder types used for patches and other complex data structures.
//!
//! These types do not usually need to be imported, but the methods available
//! on them are very relevant to where they are used.
use serde_json::Value;
use chrono::offset::FixedOffset;
use chrono::DateTime;
use model::*;
use Object;
macro_... |
/// Transfer ownership of the server to a new owner.
pub fn owner(self, owner: UserId) -> Self {
set!(self, "owner_id", owner.0)
}
/// Edit the verification level of the server.
pub fn verification_level(self, verification_level: VerificationLevel) -> Self {
set!(self, "verification_level", verification_lev... | {
set!(self, "afk_timeout", timeout)
} | identifier_body |
verify_cert.rs | // Copyright 2015 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL... | (
input: Option<&mut untrusted::Reader>,
used_as_ca: UsedAsCa,
sub_ca_count: usize,
) -> Result<(), Error> {
let (is_ca, path_len_constraint) = match input {
Some(input) => {
let is_ca = der::optional_boolean(input)?;
// https://bugzilla.mozilla.org/show_bug.cgi?id=98502... | check_basic_constraints | identifier_name |
verify_cert.rs | // Copyright 2015 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL... |
// https://tools.ietf.org/html/rfc5280#section-4.1.2.5
fn check_validity(input: &mut untrusted::Reader, time: time::Time) -> Result<(), Error> {
let not_before = der::time_choice(input)?;
let not_after = der::time_choice(input)?;
if not_before > not_after {
return Err(Error::InvalidCertValidity);... | {
// TODO: check_distrust(trust_anchor_subject, trust_anchor_spki)?;
// TODO: Check signature algorithm like mozilla::pkix.
// TODO: Check SPKI like mozilla::pkix.
// TODO: check for active distrust like mozilla::pkix.
// See the comment in `remember_extension` for why we don't check the
// Key... | identifier_body |
verify_cert.rs | // Copyright 2015 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL... | // * We follow the convention established by Microsoft's implementation and
// mozilla::pkix of treating the EKU extension in a CA certificate as a
// restriction on the allowable EKUs for certificates issued by that CA. RFC
// 5280 doesn't prescribe any meaning to the EKU extension when a certificate
// is bei... | // Notable Differences from RFC 5280:
// | random_line_split |
cc.rs | t)]
pub(crate) name: String,
value: UnsafeCell<ManuallyDrop<T>>,
}
/// The real layout if `T` is tracked by the collector. The main APIs still use
/// the `CcBox` type. This type is only used for allocation and deallocation.
///
/// This is a private type.
#[repr(C)]
pub struct RawCcBoxWithGcHeader<T:?Sized, ... | ;
// safety: ccbox_ptr cannot be null from the above code.
let non_null = unsafe { NonNull::new_unchecked(ccbox_ptr) };
let result = Self(non_null);
if is_tracked {
debug::log(|| (result.debug_name(), "new (CcBoxWithGcHeader)"));
} else {
debug::log(|| (re... | {
Box::into_raw(Box::new(cc_box))
} | conditional_block |
cc.rs | T` is unwind-safe, so does `CcBox<T>`.
impl<T: UnwindSafe +?Sized> UnwindSafe for RawCcBox<T, ObjectSpace> {}
// `NonNull` does not implement `UnwindSafe`. But `Cc` and `Weak` only use it
// as a "const" pointer. If `T` is unwind-safe, so does `Cc<T>`.
impl<T: UnwindSafe +?Sized, O: AbstractObjectSpace> UnwindSafe for... | cast_ref | identifier_name | |
cc.rs | st)]
pub(crate) name: String,
value: UnsafeCell<ManuallyDrop<T>>,
}
/// The real layout if `T` is tracked by the collector. The main APIs still use
/// the `CcBox` type. This type is only used for allocation and deallocation.
///
/// This is a private type.
#[repr(C)]
pub struct RawCcBoxWithGcHeader<T:?Sized,... |
}
impl<T: Trace, O: AbstractObjectSpace> RawCc<T, O> {
/// Constructs a new [`Cc<T>`](type.Cc.html) in the given
/// [`ObjectSpace`](struct.ObjectSpace.html).
///
/// To collect cycles, call `ObjectSpace::collect_cycles()`.
pub(crate) fn new_in_space(value: T, space: &O) -> Self {
let is_t... | {
collect::THREAD_OBJECT_SPACE.with(|space| Self::new_in_space(value, space))
} | identifier_body |
cc.rs | est)]
pub(crate) name: String,
value: UnsafeCell<ManuallyDrop<T>>,
}
/// The real layout if `T` is tracked by the collector. The main APIs still use
/// the `CcBox` type. This type is only used for allocation and deallocation.
///
/// This is a private type.
#[repr(C)]
pub struct RawCcBoxWithGcHeader<T:?Sized... | /// Force drop the value T.
fn gc_drop_t(&self);
/// Returns the reference count. This is useful for verification.
fn gc_ref_count(&self) -> usize;
}
/// A dummy implementation without drop side-effects.
pub(crate) struct CcDummy;
impl CcDummy {
pub(crate) fn ccdyn_vptr() -> *mut () {
let... | random_line_split | |
main.rs | // Copyright (c) Microsoft. All rights reserved.
//! This binary is the process entrypoint for aziot-certd, -identityd and -keyd.
//! Rather than be three separate binaries, all three services are symlinks to
//! this one aziotd binary. The aziotd binary looks at its command-line args to figure out
//! which service i... | hyper::Request<hyper::Body>,
Response = hyper::Response<hyper::Body>,
Error = std::convert::Infallible,
> + Clone
+ Send
+'static,
<TServer as hyper::service::Service<hyper::Request<hyper::Body>>>::Future: Send,
{
log::info!("Starting service...");
... | Output = Result<(http_common::Connector, TServer), Box<dyn std::error::Error>>,
>,
TServer: hyper::service::Service< | random_line_split |
main.rs | // Copyright (c) Microsoft. All rights reserved.
//! This binary is the process entrypoint for aziot-certd, -identityd and -keyd.
//! Rather than be three separate binaries, all three services are symlinks to
//! this one aziotd binary. The aziotd binary looks at its command-line args to figure out
//! which service i... |
}
Ok(())
}
#[derive(Clone, Copy, Debug, PartialEq)]
enum ProcessName {
Certd,
Identityd,
Keyd,
Tpmd,
}
/// If the symlink is being used to invoke this binary, the process name can be determined
/// from the first arg, ie `argv[0]` in C terms.
///
/// An alternative is supported where the bin... | {
run(
aziot_tpmd::main,
"AZIOT_TPMD_CONFIG",
"/etc/aziot/tpmd/config.toml",
"AZIOT_TPMD_CONFIG_DIR",
"/etc/aziot/tpmd/config.d",
)
.await?
} | conditional_block |
main.rs | // Copyright (c) Microsoft. All rights reserved.
//! This binary is the process entrypoint for aziot-certd, -identityd and -keyd.
//! Rather than be three separate binaries, all three services are symlinks to
//! this one aziotd binary. The aziotd binary looks at its command-line args to figure out
//! which service i... | () {
let base = r#"
foo_key = "A"
foo_parent_key = { foo_sub_key = "B" }
[bar_table]
bar_table_key = "C"
bar_table_parent_key = { bar_table_sub_key = "D" }
[[baz_table_array]]
baz_table_array_key = "E"
baz_table_array_parent_key = { baz_table_sub_key = "F" }
"#;
let mut base: toml::Value = toml::from_... | merge_toml | identifier_name |
main.rs | // Copyright (c) Microsoft. All rights reserved.
//! This binary is the process entrypoint for aziot-certd, -identityd and -keyd.
//! Rather than be three separate binaries, all three services are symlinks to
//! this one aziotd binary. The aziotd binary looks at its command-line args to figure out
//! which service i... | "/etc/aziot/identityd/config.toml",
"AZIOT_IDENTITYD_CONFIG_DIR",
"/etc/aziot/identityd/config.d",
)
.await?
}
ProcessName::Keyd => {
run(
aziot_keyd::main,
"AZIOT_KEYD_CONFIG",
... | {
let mut args = std::env::args_os();
let process_name = process_name_from_args(&mut args)?;
match process_name {
ProcessName::Certd => {
run(
aziot_certd::main,
"AZIOT_CERTD_CONFIG",
"/etc/aziot/certd/config.toml",
"AZIOT_... | identifier_body |
mod.rs | mod strata;
mod assigners;
mod samplers;
pub mod serial_storage;
use std::cmp::max;
use std::ops::Range;
use std::sync::Arc;
use std::sync::RwLock;
use std::thread::spawn;
use std::thread::sleep;
use std::time::Duration;
use evmap;
use rand;
use commons::bins::Bins;
use commons::channel;
use commons::channel::Receiver... | updated_examples_send.send(t.clone());
}
}
println!("Loading speed: {}", (batch * 10) as f32 / pm_load.get_duration());
});
let mut pm_sample = PerformanceMonitor::new();
pm_sample.start();
let mut average = 0.0;
for _ ... | for i in 1..11 {
let t = get_example(vec![i as TFeature], i as f32); | random_line_split |
mod.rs | mod strata;
mod assigners;
mod samplers;
pub mod serial_storage;
use std::cmp::max;
use std::ops::Range;
use std::sync::Arc;
use std::sync::RwLock;
use std::thread::spawn;
use std::thread::sleep;
use std::time::Duration;
use evmap;
use rand;
use commons::bins::Bins;
use commons::channel;
use commons::channel::Receiver... | () {
let _ = env_logger::try_init();
let filename = "unittest-stratified3.bin";
let batch = 100000;
let num_read = 1000000;
let (sampled_examples_send, sampled_examples_recv) = channel::bounded(1000, "sampled-examples");
let (_, models_recv) = channel::bounded(10, "update... | test_mean | identifier_name |
mod.rs | mod strata;
mod assigners;
mod samplers;
pub mod serial_storage;
use std::cmp::max;
use std::ops::Range;
use std::sync::Arc;
use std::sync::RwLock;
use std::thread::spawn;
use std::thread::sleep;
use std::time::Duration;
use evmap;
use rand;
use commons::bins::Bins;
use commons::channel;
use commons::channel::Receiver... | weights_table_w.update(index, Box::new(F64 { val: cur + weight }));
{
counts_table_w.refresh();
weights_table_w.refresh();
}
}
});
}
// Monitor the distribution of stra... | {
let strata = Strata::new(num_examples, feature_size, num_examples_per_block,
disk_buffer_filename);
let strata = Arc::new(RwLock::new(strata));
let (counts_table_r, mut counts_table_w) = evmap::new();
let (weights_table_r, mut weights_table_w) = evmap:... | identifier_body |
mod.rs | mod strata;
mod assigners;
mod samplers;
pub mod serial_storage;
use std::cmp::max;
use std::ops::Range;
use std::sync::Arc;
use std::sync::RwLock;
use std::thread::spawn;
use std::thread::sleep;
use std::time::Duration;
use evmap;
use rand;
use commons::bins::Bins;
use commons::channel;
use commons::channel::Receiver... | else {
0
}
}).collect();
let mapped_data = LabeledData::new(features, data.label);
updated_examples_s.send((mapped_data, (0.0, 0)));
});
index += batch... | {
bins[idx - range.start].get_split_index(*val)
} | conditional_block |
main.rs | #![allow(clippy::float_cmp)]
#![allow(clippy::inline_always)]
#![allow(clippy::many_single_char_names)]
#![allow(clippy::needless_lifetimes)]
#![allow(clippy::needless_return)]
#![allow(clippy::or_fun_call)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::redundant_field_names)]
#![allow(clippy::enum_variant_nam... |
if!args.is_present("serialized_output") {
println!("Rendering scene with {} threads...", thread_count);
}
let (mut image, rstats) = r.render(
max_samples_per_bucket,
crop,
thread_count,
... | {
println!("\tBuilt scene in {:.3}s", t.tick());
} | conditional_block |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.