text string | label_name string | labels int64 |
|---|---|---|
from operator import le
import string
words = open("src/words.csv")
letter_count = dict.fromkeys(string.ascii_lowercase, 0)
total = 0
for word in words:
for letter in word.strip("\n"):
total+=1
letter_count[letter] = letter_count[letter]+ 1
print(letter_count)
for letter in letter_count:
print... | Python | 1 |
unify_roots(vec!["Foo".into(), "Foo2".into()]),
&[PathBuf::from("Foo"), PathBuf::from("Foo2"),]
);
}
}
//! Subcommand modules for the `linkr` binary.
pub mod circos;
pub mod clean;
pub mod connect;
pub mod filter;
pub mod merge;
pub mod sort;
use egg::*;
define_language! {
enum... | Rust | 0 |
duty_cycle, Polarity::Normal, true)
.expect("Could not initialize steering");
let delay = 2000;
let delay2 = 1;
let mut val = 1000;
sleep(Duration::from_millis(delay));
for val2 in 0..3000 {
let d = val2;
throttle.set_period(Duration::from_micros(d));
steering.set_... | Rust | 0 |
, Clone, PartialEq)]
pub enum AutogenFunction {
/// Gives the current timestamp
CurrentTimestamp,
}
/// Generates the current timestamp
pub fn current_timestamp() -> AutogenFunction {
AutogenFunction::CurrentTimestamp
}
<gh_stars>1-10
use super::mapping_functions::{IdenticalFunction, PrefixMappin... | Rust | 0 |
2428.95,
8335.3,
1361.92,
335.3,
1229.62,
2510.3,
661.8,
1192.53,
123.3,
1234.6,
688.41,
193.7,
227.73,
833.36,
],
2003: [
3435.95,
1150.81,
2439.68,
1176.65,
1... | Python | 1 |
:9 - 9:8\\]
Real-time clock calibration frequency"]
#[inline(always)]
pub fn rtccalf(&self) -> RTCCALF_R {
RTCCALF_R::new(((self.bits >> 8) & 0x03) as u8)
}
}
impl W {
#[doc = "Bits 0:1 - 1:0\\]
Real-time clock time event"]
#[inline(always)]
pub fn rtctev(&mut self) -> RTCTEV_W {
... | Rust | 0 |
BALL_MAX_LINEAR_VELOCITY: f64 = 15.0;
pub const BALL_DEFAULT_FORCE: f64 = 6.0;
#[derive(Clone, Debug)]
pub struct SpawnBallEvent {
pub position: Vector2d,
pub linear_velocity: Vector2d,
pub owning_paddle_ent: Option<Entity>,
}
#[derive(Debug)]
pub struct BallComponent {
pub last_pos: Point2f,
pub... | Rust | 0 |
uperset metadata database could not be initialized: " # noqa: EM101
"`superset db upgrade` failed"
),
handle,
)
logger.debug("Completed `superset db upgrade`")
@hook("before_invoke")
async def init_hook(
self,
invoker: Pl... | Python | 1 |
1e-7 || (angle_between_lines - PI).abs() < 1e-7 {
return vec![if return_next { next } else { prev }];
};
let bisect_tangent_angle = (std::f64::consts::PI - angle_between_lines) / 2.0;
let smaller_side_length = prev.length().min(next.length()) * max_curve_frac;
// calculate the radius of a circl... | Rust | 0 |
report_file);
//runtime.spawn(report_file.map_err(|_|()));
result(
// write record to CSV file
failures
.write_record(&[&method, &uri, &reason, &relative_path])
... | Rust | 0 |
int("test start")
self.test_ready()
data_loader = self.data_loader
with torch.no_grad():
for i, (x_A, x_B) in enumerate(data_loader):
x_A = x_A.to(self.device)
x_B = x_B.to(self.device)
x_AB, x_BA = \
self.update_G(x... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 21 18:09:14 2017
@author: tkoller
"""
import numpy as np
from .default_config import DefaultConfig
class DefaultConfigExploration(DefaultConfig):
"""
Options class for the exploration setting
"""
# task options
task = "exploration" #don't change this... | Python | 1 |
: 1440 + 38,
width: 1920,
height: 1080 - 38,
}
)
}
<gh_stars>1-10
/// internal cpu operation
pub const IO: u8 = 5; /// Internal cpu operation
pub const MR: u8 = 3; /// Memory read
pub const MRH: u8 = 3; /// Memory read of high byte
pub const MRL: u8 = 3; /// Memory read of low byte
... | Rust | 0 |
trade_count" not in conn_content:
# Adicionar contador no on_trade_update
if "def on_trade_update" in conn_content:
# Adicionar incremento do contador
trade_update_marker = "def on_trade_update(self, obj):"
pos = conn_content.find(trade_update_mar... | Python | 1 |
import airflow
from airflow import DAG
from datetime import timedelta
from airflow.utils.dates import days_ago
from airflow.operators.dagrun_operator import TriggerDagRunOperator
# Define default arguments
ARGS = {
"owner": "SHAIK SAIDHUL",
"start_date": days_ago(1),
"depends_on_past": False,
"email_on... | Python | 1 |
raise NotImplementedError()
def store_discr_outputs(self, batch):
out_size = batch['image'].shape[2:]
discr_real_out, _ = self.discriminator(batch['image'])
discr_fake_out, _ = self.discriminator(batch['predicted_image'])
batch['discr_output_real'] = F.interpolate(discr_rea... | Python | 1 |
Y_MAX = 146;
NR_SCHED_GET_PRIORITY_MIN = 147;
NR_SCHED_RR_GET_INTERVAL = 148;
NR_MLOCK = 149;
NR_MUNLOCK = 150;
NR_MLOCKALL = 151;
NR_MUNLOCKALL = 152;
NR_VHANGUP = 153;
NR_MODIFY_LDT = 154;
NR_PIVOT_ROOT = 155;
NR__SYSCTL = 156;
NR_PRCTL = 157;
NR_ARCH_PRCTL = 158;
NR_ADJTIMEX = 159;
NR_SETRLIMIT = 160;
... | Rust | 0 |
fn referenced_vars(&self) -> impl Iterator<Item = &VarName> {
self.attrs.iter().flat_map(|(_, value)| value.var_refs())
}
}
impl WidgetNode for Generic {
fn get_name(&self) -> &str {
&self.name
}
fn get_text_pos(&self) -> Option<TextPos> {
self.text_pos
}
fn render(
... | Rust | 0 |
}
).unwrap();
(vulkan.0.data().pipeline_barrier)(
vulkan.0.data().command_buffer,
VkPipelineStage::TopOfPipe,
VkPipelineStage::TopOfPipe,
0, 0, null(), 0, null(), 1,
&VkImageMemoryBarrier {
s_type: VkStructureType::ImageMemoryBarrier,
p_next: null(),
src_access_mask: VkAccess::NoFla... | Rust | 0 |
EAR_TIME = pygame.time.get_ticks()
LAST_T_SPIN_STATE = T_SPIN_STATE
if CLEARED_LINES == 4 or T_SPIN_STATE:
BTB_CHAIN += 1
else:
if BTB_CHAIN > 2:
SFX['btb_break'].play()
BTB_CHAIN = 0
else:
COMBO ... | Python | 1 |
"ᢍ",
"mong:ddaaligali": "ᢎ",
"mong:nnaaligali": "ᢏ",
"mong:taaligali": "ᢐ",
"mong:daaligali": "ᢑ",
"mong:paaligali": "ᢒ",
"mong:phaaligali": "ᢓ",
"mong:ssaaligali": "ᢔ",
"mong:zhaaligali": "ᢕ",
"mong:zaaligali": "ᢖ",
"mong:ahaligali": "ᢗ",
... | Python | 1 |
if show_fig:
plt.plot(costs)
plt.show()
def train_wikipedia(we_file='word_embeddings.npy', w2i_file='wikipedia_word2idx.json', RecurrentUnit=GRU):
# there are 32 files
### note: you can pick between Wikipedia data and Brown corpus
### just comment one out, and uncomment... | Python | 1 |
#!/usr/bin/python
import sys
def reimwortpaare(wortliste):
reimwörterbuch = {}
for wort in wortliste:
Endung_sortieren(wort, reimwörterbuch)
ausgabeliste = []
for key in reimwörterbuch:
ausgabeliste = ausgabeliste + (paare_aus_liste(reimwörterbuch[key]))
return ausgabeliste
def En... | Python | 1 |
he field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == REGION79_A::ENABLED
}
}
#[doc = "Write proxy for field `REGION79`"]
pub struct REGION79_W<'a> {
w: &'a mut W,
}
impl<'a> REGION79_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
... | Rust | 0 |
UX_ALTF2_DEFAULT_IN_0 = crate::Reg<u32, _IOMUX_ALTF2_DEFAULT_IN_0>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _IOMUX_ALTF2_DEFAULT_IN_0;
#[doc = "`read()` method returns [iomux_altf2_default_in_0::R](iomux_altf2_default_in_0::R) reader structure"]
impl crate::Readable for IOMUX_ALTF2_DEFAULT_IN_0 {}
#[doc = "`wr... | Rust | 0 |
import os
import csv
import json
from operator import itemgetter
from itertools import groupby
def csv_mapper(fname):
outp = {}
with open(fname, 'rb') as f:
rows = list(csv.reader(f))
for row in rows:
outp[row[0]] = []
for row in rows:
outp[row[0]].append(row[1])
return outp... | Python | 1 |
ITER: Writer = Writer {
column_position: 0,
row_position: 0,
color_code: ColorCode::new(Color::LightGray, Color::Black),
};
macro_rules! println {
($fmt:expr) => (print!(concat!($fmt, "\n")));
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
}
macro_rules! print {
($($arg:t... | Rust | 0 |
::Token = mio::Token(1);
// The EventLoop will set up a mio::Poll and use it to wait for the following:
//
// - messages telling it what to do
//
// - events telling it that something has happened on one of the watched files.
struct EventLoop {
running: bool,
poll: mio::Poll,
event_loop_waker: Arc<mio::W... | Rust | 0 |
ARSE, tp.as_mut_ptr());
tp.assume_init()
};
_timespec_to_u64(tp.tv_sec as u64, tp.tv_nsec as u32)
}
#[cfg(target_os = "macos")]
fn _now() -> u64 {
let nsec = unsafe { clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW_APPROX) };
_nsecs_to_u64(nsec)
}
#[cfg(any(ta... | Rust | 0 |
(&self.y, &mut ret)?;
write_f64(&self.z, &mut ret)?;
write_f32(&self.offset_x, &mut ret)?;
write_f32(&self.offset_y, &mut ret)?;
write_f32(&self.offset_z, &mut ret)?;
write_f32(&self.particle_data, &mut ret)?;
write_i32(&self.count, &mut ret)?;
write_bytearray_to_... | Rust | 0 |
from piel.types.experimental import (
PropagationDelayMeasurementData,
PropagationDelayMeasurement,
)
def extract_propagation_delay_data_from_measurement(
measurement: PropagationDelayMeasurement,
) -> PropagationDelayMeasurementData:
raise NotImplementedError(
"This generic data extraction me... | Python | 1 |
assert isinstance(curr_pos, list)
assert len(curr) == len(curr_pos) == 1
curr, curr_pos = (
curr[0],
curr_pos[0],
)
assert (
curr.shape[1] == memory.shape[1]
), "Batch size must be the same for curr and memory"
... | Python | 1 |
s: &'static mut ())
where
&'static mut (): Clone, //~ ERROR the trait bound
{
<&'static mut () as Clone>::clone(&s);
}
fn main() {}
<filename>src/server/db/mod.rs
pub use client::Client;
pub use config_entry::ConfigEntry;
pub use db_connection::db_connection;
pub use download_entry::DownloadEntry;
mod client;... | Rust | 0 |
ery_results['distances']}")
if "ids" in query_results:
print(f"匹配文档ID: {query_results['ids']}")
return My_ChromaDB_VectorStore._extract_documents(query_results)
def get_related_ddl(self, question: str, **kwargs) -> list:
"""查询相关DDL并返回文档列表,同时打印相似度信息"""
qu... | Python | 1 |
import re
import string
from typing import TYPE_CHECKING, Match
if TYPE_CHECKING:
from ..block_parser import BlockParser
from ..core import BlockState, InlineState
from ..inline_parser import InlineParser
from ..markdown import Markdown
# because mismatch is too slow, add parsers for paragraph and tex... | Python | 1 |
hline
syslinux_conf += "DEFAULT boot\n"
syslinux_conf += "LABEL boot\n"
kernel = "/" + get_bitbake_var("KERNEL_IMAGETYPE")
syslinux_conf += "KERNEL " + kernel + "\n"
syslinux_conf += "APPEND label=boot root=%s %s\n" % \
(creator.... | Python | 1 |
w_polygon(g_polygon).as_item(),
&geo_types::Geometry::MultiPoint(ref g_mpoint) => g_mpoint_to_w_mpoint(g_mpoint).as_item(),
&geo_types::Geometry::MultiLineString(ref g_mline) => g_mline_to_w_mline(g_mline).as_item(),
&geo_types::Geometry::MultiPolygon(ref g_mpolygon) => {
g_mpolyg... | Rust | 0 |
#!/usr/bin/env python2
# SPDX-License-Identifier: GPL-3.0-or-later
# devicetree_convert Tool to convert a DTB to a static C file
from pyfdt.pyfdt import FdtBlobParse
import argparse
parser = argparse.ArgumentParser(description='Cavium DTB to C converter')
parser.add_argument('--indtb', help='Compiled devicetree blob ... | Python | 1 |
"""
Classifies: CHEBI:17297 UDP-sugar
"""
from rdkit import Chem
from rdkit.Chem import rdqueries
def is_UDP_sugar(smiles: str):
"""
Determine if a molecule is a UDP-sugar based on its SMILES string. A UDP-sugar is a pyrimidine nucleotide-sugar with UDP as the nucleotide component attached via an anomeric diph... | Python | 1 |
>");
options.optopt("p", "partition", "partition", "<u8>");
commands.insert("locate_10",
ShellCommand { func:locate_10, options });
//TODO
options = Options::new();
options.optflag("?", "help", "");
options.optopt("", "dest_type", "TODO", "<u8>"); //reqopt?? TODO
options.optflag("", "rsvd", "TODO")... | Rust | 0 |
Zinh,
Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh,
Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh,
Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh,
Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc::Zinh, Sc... | Rust | 0 |
Response::Response(new_res))
}use crate::rule_prelude::*;
use ast::*;
use SyntaxKind::*;
/// Attempt to check if a simple expression is always truthy or always falsey.
///
/// For example, `true`, `false`, and `foo = true`, this does not consider math ops like `0 + 0`.
pub fn simple_bool_coerce(condition: Expr) -> Opt... | Rust | 0 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 GNS3 Technologies Inc.
#
# This program 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 your option) any later version.
... | Python | 1 |
pub struct WStrChars<'a, E: 'static + ByteOrder> {
chunks: ChunksExact<'a, u8>,
_endian: PhantomData<&'static E>,
}
/// Iterator yielding `(index, char)` tuples from a UTF-16 little-endian encoded byte slice.
///
/// The slice must contain valid UTF-16, otherwise this may panic or cause undefined
/// behaviou... | Rust | 0 |
"""
Classifies: CHEBI:24279 glucosinolate
"""
"""
Classifies: CHEBI:24163 glucosinolate
"""
from rdkit import Chem
from rdkit.Chem import AllChem
def is_glucosinolate(smiles: str):
"""
Determines if a molecule is a glucosinolate based on its SMILES string.
A glucosinolate has a thioglucose moiety linked vi... | Python | 1 |
Note: this test actually sends out the request, and is supposed to test a situation
// where we haven't received any response yet. This test can theoretically fail if the
// HTTP response comes back faster than the kernel schedules our thread, but that is highly
// unlikely.
assert_eq!(api.response_headers(id)... | Rust | 0 |
etns" => setup_netns::run(args),
#[cfg(feature="containers")]
"version" => version::run(args),
#[cfg(feature="containers")]
"wrapper" => wrapper::run(args),
#[cfg(feature="containers")]
"build" | "builder" => builder::run(args),
#[cfg(feature="containers")]
... | Rust | 0 |
,
/// Nicaraguan córdoba
NIO,
/// Norwegian krone
NOK,
/// Nepalese rupee
NPR,
/// New Zealand dollar
NZD,
/// Omani rial
OMR,
/// Panamanian balboa
PAB,
/// Peruvian sol
PEN,
/// Papua New Guinean kina
PGK,
/// Philippine peso
PHP,
/// Pakista... | Rust | 0 |
import re
from langchain.schema import Document
from langchain_text_splitters import RecursiveCharacterTextSplitter
from langchain_community.document_loaders import PyPDFLoader
from langchain_openai import ChatOpenAI
import json
class ArabicTextPreprocessing:
def __init__(self, pdf_path):
self.pdf_path = p... | Python | 1 |
"FixedMLPVAE_food10132x32_128x64x32x64x128_bs64")
def _():
base_model_fn = fc_vae_loss_fn([128, 64], [64, 128], 32, tf.nn.relu)
dataset = datasets.get_image_datasets(
"food101_32x32", batch_size=64, shuffle_buffer=5000)
return base.DatasetModelTask(base_model_fn, dataset)
@registry.task_registry.regist... | Python | 1 |
1.) / 2.,
(5. * x.powi(3) - 3. * x) / 2.,
(35. * x.powi(4) - 30. * x.powi(2) + 3.) / 8.,
(63. * x.powi(5) - 70. * x.powi(3) + 15. * x) / 8.,
(231. * x.powi(6) - 315. * x.powi(4) + 105. * x.powi(2) - 5.) / 16.,
(429. * x.powi(7) - 693. * x.powi(5) + 315. * x.po... | Rust | 0 |
)
# Perform merge
result = left_df.merge(right_df, left_on=left_on, right_on=right_on, how=how)
tm.assert_frame_equal(result, expected, check_like=True)
@pytest.mark.parametrize("left_index", ["inner", ["inner", "outer"]])
def test_join_indexes_and_columns_on(df1, df2, left_index, join_type):
# Cons... | Python | 1 |
("Sonos Era", None),
],
indirect=["speaker_model"],
)
async def test_media_source_list(
hass: HomeAssistant,
async_autosetup_sonos,
speaker_model: str,
source_list: list[str] | None,
) -> None:
"""Test the mapping between the speaker model name and source_list."""
state = hass.states.... | Python | 1 |
from pwn import *
io = process(['python3','run'], stdin=PTY)
for _ in range(1, 10):
# Tangkap encrypted char (dalam bentuk bytes), lalu decode ke string
enc_char = io.recvregex(br'- Encrypted Character: (.+)\n', capture=True).group(1).decode()
key = io.recvregex(br'- XOR Key: (.+)\n', capture=True).group(... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@File : LLM.py
@Time : 2024/02/12 13:50:47
@Author : 不要葱姜蒜
@Version : 1.0
@Desc : None
'''
from typing import Dict, List, Optional, Tuple, Union
PROMPT_TEMPLATE = dict(
RAG_PROMPT_TEMPALTE="""使用以上下文来回答用户的问题。如果你不知道答案,就说你不知道。总是使用中文回答。
问题: ... | Python | 1 |
b::bare("cd"),
b::sp(),
b::bare(r"C:\Users\wycat\AppData\Local\Temp\.tmpaj5JKi\cd_test_11")
]])
}
}
#[test]
fn test_flag() {
equal_tokens! {
<nodes>
"--amigos" -> b::token_list(vec![b::flag("arepas")])
}
... | Rust | 0 |
return list(cls._models.keys())
# 工具函数
def count_parameters(model: nn.Module) -> int:
"""计算模型参数数量"""
return sum(p.numel() for p in model.parameters() if p.requires_grad)
def get_model_size(model: nn.Module) -> str:
"""获取模型大小"""
param_count = count_parameters(model)
if param_count < 1... | Python | 1 |
),
)))
}
}
}
}
<filename>bench/benches/throughput_std_noinline.rs
use simdutf8_bench::define_throughput_benchmark;
define_throughput_benchmark!(BenchFn::StdNoInline);
pub mod error;
mod fields;
mod manual_parser;
mod parser;
pub mod utils;
use anyhow::{Context, Result};... | Rust | 0 |
};
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if self.value != 0. {
o... | Rust | 0 |
e).into()
}
}
else {
if n == 0 {
format!("Option<{}>", name).into()
}
else {
format!("Option<{}{}::{}>", "super::".repeat(n), to_snake_case(name), name).into()
}
}
}
fn needs_workaround(var_type: &str) -> bool {
static TYPES: &[&str] = &["... | Rust | 0 |
EDHASH_PARMS() {
assert_eq!(
::std::mem::size_of::<TPMS_KEYEDHASH_PARMS>(),
6usize,
concat!("Size of: ", stringify!(TPMS_KEYEDHASH_PARMS))
);
assert_eq!(
::std::mem::align_of::<TPMS_KEYEDHASH_PARMS>(),
2usize,
concat!("Alignment of ", stringify!(TPMS_KEYEDHASH... | Rust | 0 |
re
B: Backend,
{
let flags = format!("0x{:x} (b{:0>32b})", fragment.flags, fragment.flags);
let region_count = format!("{}", fragment.region_count);
let region_ids = format!("{:?}", fragment.regions);
let size2 = format!("{:?}", fragment.size2);
let data2 = format!("{:?}", fragment.data2);
... | Rust | 0 |
(event)
.unwrap();
Ok(())
}
}
pub trait System {
fn init(
&self,
_lua: LuaContext,
_local: &mut OwnedResources,
_global: Option<&SharedResources>,
) -> Result<()> {
Ok(())
}
fn update(&self, lua: LuaContext, resources: &UnifiedResources) ... | Rust | 0 |
, PartialEq, Eq, Debug, Encode, Decode)]
pub struct TestRuntime;
pub struct BaseCallFilter;
impl Filter<u32> for BaseCallFilter {
fn filter(c: &u32) -> bool {
*c % 2 == 0
}
}
impl frame_system::Config for TestRuntime {
type AccountId = u32;
type Call = u32;
type BaseCallFilter = BaseCallFilter;
}
... | Rust | 0 |
))),
("a\\\\ \\\\:\\\\=b c", Some(ParsedLine::KVPair("a\\\\", "\\\\:\\\\=b c"))),
("\\ b", Some(ParsedLine::KVPair("\\ ", "b"))),
("=", Some(ParsedLine::KVPair("", ""))),
("=x", Some(ParsedLine::KVPair("", "x"))),
("x=", Some(ParsedLine::KVPair("x", ""))),
("\\=x", Some(ParsedLine::... | Rust | 0 |
import re
def calculate_sum_of_multiplications(input_file):
try:
# Read the content of the input file
with open(input_file, 'r') as file:
content = file.read()
# Find all substrings matching the pattern "mul(\d+,\d+)"
matches = re.finditer(r"(do\(\)|don't\(\)|mul\((\d+)... | Python | 1 |
(msa: &[&[u8]], query: &[u8]) -> (DP, Trace) {
// eprintln!("Fallback");
let height = query.len();
let width = msa[0].len();
let mut dp = vec![vec![0.; width + 1]; height + 1];
// (0..=width).for_each(|j| dp[0][j] == 0);
let mut traceback = vec![vec![Ed::Term; width + 1];... | Rust | 0 |
x += 1
} else {
x -= 1
}
if line.start.y < line.end.y {
y += 1
} else {
y -= 1
}
}
} else {
let min_x1 = cmp::min(line.start.x, line.end.x);
... | Rust | 0 |
}
<gh_stars>1-10
use crate::ops::{ControlFlow, Try};
/// An iterator able to yield elements from both ends.
///
/// Something that implements `DoubleEndedIterator` has one extra capability
/// over something that implements [`Iterator`]: the ability to also take
/// `Item`s from the back, as well as the front.
///
//... | Rust | 0 |
directs(
resp, "/accounts/profile/", fetch_redirect_response=False
)
@override_settings(SOCIALACCOUNT_PROVIDERS={"facebook": {"VERIFIED_EMAIL": True}})
def test_login_verified(self):
emailaddress = self._login_verified()
self.assertTrue(emailaddress.verified)
de... | Python | 1 |
s:
hparams (Dict): Hyperparameters
Raises:
ValueError: Unknown optimizer
ValueError: Unknown scheduler
Returns: optimizers and scheduler
"""
hparams_optimizer = hparams.get("optimizer", "sgd")
if hparams_optimizer == "sgd":
optimi... | Python | 1 |
else:
print(f"Reducing {log_file}")
cmd = [
"python",
"do_reducemany.py",
design_name,
str(cfg["N_THREADS"]) if "N_THREADS" in cfg else 40,
... | Python | 1 |
block_id,
peer.short_str(),
e
);
continue;
}
Ok(response) => response,
};
if response.status != BlockRetrievalStatus::SUCCEEDED {
warn!(
"... | Rust | 0 |
# -*- coding: utf-8 -*-
import sys
import os
PWD = os.path.join(os.path.dirname(sys.argv[0]))
sys.path.append(os.path.join(PWD, '../support/'))
sys.path.append(os.path.join(PWD, '../'))
import PyQt5.QtGui
import PyQt5.QtWidgets
import gui.appgui as qutrubgui
#from gui.qutrubgui import *
import libqutrub.verb_db as ... | Python | 1 |
= future_guard.create_release_event(write_release_queue).unwrap().clone();
let future_write_vec = future_guard.and_then(move |mut data| {
if PRINT { println!("* Write init starting \t(iter: {}) ...", task_iter); }
for val in data.iter_mut() {
*val = Int4::splat(write_val);
}
... | Rust | 0 |