text
string
label_name
string
labels
int64
class Solution: def colorBorder(self, grid: List[List[int]], r0: int, c0: int, color: int) -> List[List[int]]: def dfs(i: int, j: int, originalColor: int) -> None: if not 0 <= i < len(grid) or not 0 <= j < len(grid[0]) or grid[i][j] != originalColor: return grid[i][j] = -originalColor d...
Python
1
y: usize, size: usize, used: usize, avail: usize, goal: bool, } impl FromStr for Node { type Err = (); fn from_str(s: &str) -> Result<Node, ()> { let re: &Regex = regex!("/dev/grid/node-x([0-9]+)-y([0-9]+) +([0-9]+)T +([0-9]+)T +([0-9]+)T"); let captures = re....
Rust
0
class Solution: def uniquePaths(self, grid): """ :type grid: List[List[int]] :rtype: int Given an n×m grid of 0’s (free) and 1’s (blocked), count how many ways to go from top-left (0,0) to bottom-right (n-1,m-1), moving only right or down. """ # If grid is e...
Python
1
from datetime import datetime import logging from sqlalchemy import Table, Column, ForeignKey, or_ from sqlalchemy import DateTime, Integer, Unicode import meta log = logging.getLogger(__name__) twitter_table = Table( 'twitter', meta.data, Column('id', Integer, primary_key=True), Column('create_time', ...
Python
1
fn init_unix(sender: mpsc::Sender<event::Event>) -> (PathBuf, runtime::Runtime) { let in_path = tempfile::tempdir().unwrap().into_path().join("unix_test"); let server = SocketConfig::from(UnixConfig::new(in_path.clone())) .build("default", &GlobalOptions::default(), sender) ...
Rust
0
_907, 120_917, 120_919, 120_929, 120_937, 120_941, 120_943, 120_947, 120_977, 120_997, 121_001, 121_007, 121_013, 121_019, 121_021, 121_039, 121_061, 121_063, 121_067, 121_081, 121_123, 121_139, 121_151, 121_157, 121_169, 121_171, 121_181, 121_189, 121_229, 121_259, 121_267, 121_271, 121_283, 12...
Rust
0
_map(body) ) params = open_api_models.Params( action='UserBatchQuitGroup', version='2021-03-08', protocol='HTTPS', pathname='/', method='POST', auth_type='AK', style='RPC', req_body_type='formData', ...
Python
1
/// ## `diffuse` /// The components of the desired diffuse color pub fn set_diffuse(&self, diffuse: &Color) { unsafe { ffi::cogl_pipeline_set_diffuse(self.to_glib_none().0, diffuse.to_glib_none().0); } } /// Sets the pipeline's emissive color, in the standard OpenGL lighting...
Rust
0
ql", None); HttpResponse::Ok() .content_type("text/html; charset=utf-8") .body(html) } /*! Command-line arguments and command processing */ pub(self) use std::path::{Path, PathBuf}; pub(self) use structopt::StructOpt; pub(self) use crate::{utils, Error, Result, State}; #[cfg(any( feature = ...
Rust
0
WASM gains threads we need to fix this. // unsafe impl Send for ChatSubmitEvt {} impl Handler< ChatSubmitEvt > for ChatForm { fn handle_local( &mut self, msg: ChatSubmitEvt ) -> ReturnNoSend<()> { info!( "Chat submit button clicked" ); Box::pin( async move { // We also trigger this if the user types Ente...
Rust
0
; pub mod util; <gh_stars>0 //! Example migrating a json file that contains an array of user entities //! //! The first migration fills the json file with some example user entities //! of the initial version (they contain only `name` field). //! //! The second migration adds the `surname` field to each user. use std:...
Rust
0
from typing import Optional from fastapi import Depends, Security from fastapi.security import (HTTPAuthorizationCredentials, HTTPBasic, HTTPBasicCredentials, HTTPBearer, SecurityScopes) from .context import ServerContext from .exceptions import AppErrors from .models.user import LoginRe...
Python
1
plt.title(f"Future Stock Price Predictions for {stock}") plt.legend() plt.grid() plt.show() # Create GUI window root = tk.Tk() root.title("Stock Price Prediction using LSTM") # Set window size root.geometry("600x500") # Stock symbol input stock_label = tk.Label(root, text="Enter stock symbol (e.g., GOOG...
Python
1
::Tuple(_) = objt { tuple(ctx, objt, index) } else { bail!("Object {:?} is not Tuple nor Accessible", obj) } } fn call(&self, ctx: ScriptContextRef, args: &[Value]) -> Result<Value, Error> { fn accessible( ctx: ScriptContextRef, obj: &dyn ...
Rust
0
BioSTEAMdoc' # -- Options for LaTeX output ------------------------------------------------ latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the L...
Python
1
def clean_countries_full(data): result = [] rejected = [] seen_cca3 = set() for country in data: try: cca3 = country.get("cca3") if not cca3 or cca3 in seen_cca3: rejected.append({"reason": "missing or duplicate cca3", "raw": country}) con...
Python
1
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>. // From construct_runtime macro #![allow(clippy::from_...
Rust
0
c_layout(&self.temp, tree, layout_size, layout); } let layout: &BumpVec<Layout> = self.layout_cache.as_ref().unwrap().borrow(); // ---------- Render ---------- // TODO - If phase == Idle, re-issue commands from last frame self.canvas .set_size(window_size.width as u...
Rust
0
SpW clock, defaults to divide by ten"] #[inline(always)] pub fn sw_clkdiv10(&mut self) -> SW_CLKDIV10_W { SW_CLKDIV10_W { w: self } } #[doc = "Writes raw bits to the register."] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.0.bits(bits); ...
Rust
0
import numpy as np import pytest from keras_hub.src.models.vgg.vgg_backbone import VGGBackbone from keras_hub.src.tests.test_case import TestCase class VGGBackboneTest(TestCase): def setUp(self): self.init_kwargs = { "stackwise_num_repeats": [2, 3, 3], "stackwise_num_filters": [8,...
Python
1
import asyncio from pathlib import Path import typer from typing_extensions import Annotated from facilito import AsyncFacilito, Quality app = typer.Typer(rich_markup_mode="rich") @app.command() def login(): """ Open a browser window to Login to Codigo Facilito. Usage: facilito login """ ...
Python
1
check if is_check(board, PieceColor::Black) { return false; } //check that the squares required for castling are not threatened if is_check_cords(board, PieceColor::Black, (BOARD_START, BOARD_START + 2)) || is_check_cords(board, PieceColor::Black, (BOARD_START, BOARD_START + 3)) { ...
Rust
0
::Formatter) -> std::fmt::Result { std::fmt::UpperHex::fmt(&self.inner, f) } } impl std::str::FromStr for Uuid { type Err = Error; fn from_str(uuid_str: &str) -> Result<Self, Self::Err> { Self::parse_str(uuid_str) } } ///////////////////////////////////////////////////////////////////...
Rust
0
Based on debian patch: Author: Barry Warsaw <barry@debian.org> Patch-Name: pth-installation-path Subject: Calculate the correct .pth path cov-core wants to install the file init_cov_core.pth so that cov_core_init will be imported and initialized automatically for subprocess coverage, if the environment variable CO...
Python
1
import badger2040 from badger2040 import WIDTH import network TEXT_SIZE = 1 LINE_HEIGHT = 16 # Display Setup display = badger2040.Badger2040() display.led(128) # Connects to the wireless network. Ensure you have entered your details in WIFI_CONFIG.py :). display.connect() net = network.WLAN(network.STA_IF).ifconfig(...
Python
1
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import cv2 class SpecCNN(nn.Module): def __init__(self, scale_ratio, n_select_bands, n_bands): """Load the pretrained ResNet and replace top fc layer.""" super...
Python
1
e279b3aa216b39afee75e53602de319484db89a51e844f38c361634e474f8f1f01c340f3f3594860d671346449c6d08ee38de22d246309bc7e4a252a29c86aa6d94b5b4fa58904c70").unwrap(); let output = decode("7d35cfe4be56bd6e0e09dedcd01735b915bc1891a4d1f6a541abc4bcd0ebe89dcb8e365e5813742e8ec65777b6159422fada747da99394252baf8a046fc1b60ad79755f545f...
Rust
0
/src/dpx_type1c.rs #![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals, unused_assignments, unused_mut)] extern crate libc; use crate::dpx_pdfobj::pdf_obj; use libc::free; extern "C" { /* This is dvipdfmx, an eXt...
Rust
0
ullBackend; use sp_runtime::generic::Era; use std::{error::Error, sync::Arc}; use substrate_simnode::{FullClientFor, SignatureVerificationOverride}; /// A unit struct which implements `NativeExecutionDispatch` feeding in the /// hard-coded runtime. pub struct ExecutorDispatch; impl sc_executor::NativeExecutionDispatc...
Rust
0
, RusRoHcalNeutron = cms.double(0.1), RusRoMuonIronNeutron = cms.double(0.1), RusRoPreShowerNeutron = cms.double(0.1), RusRoCastorNeutron = cms.double(0.1), RusRoWorldNeutron = cms.double(0.1), RusRoProtonEnergyLimit = cms.double(0.0), RusRoEcalP...
Python
1
_journal().entries.into_iter().map(|t| t.1).collect(); let expected: HashSet<u64> = [2094615114573771027u64, 244675582389208413u64].iter().cloned().collect(); assert_eq!(drained_elems, expected); assert_eq!(bloom.k_num, 12); } #[test] fn hash_backward_compatibility_for_from_parts() { let stored_state = vec!...
Rust
0
# Generated by Django 1.11.24 on 2019-10-08 18:33 from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ('course_metadata', '0202_backpopulatecoursetypeconfig'), ] operations = [ migrations.AlterField( model_name='cours...
Python
1
is only used to /// initialize a thread-local clone of the sender handle, so that there /// is no need for locking during request processing. request_sender: Mutex<Sender<QueuedRequest>>, /// Thread-local channel for submitting requests to the worker. tl_request_sender: ThreadLocal<Sender<QueuedReq...
Rust
0
lüid)) kayit_durumu[üye.id]['registered'] = True if kayitci.id not in kayit_sayilari: kayit_sayilari[kayitci.id] = 0 kayit_sayilari[kayitci.id] += 1 embed = discord.Embed( title="✅ Kayıt Yapıldı!", description=( f"Kayıt Bilgileri:\n"...
Python
1
where E: de::Error, { match v { true => Ok(ChildUnitPermissionArg::Granted), false => Ok(ChildUnitPermissionArg::NotGranted), } } } deserializer.deserialize_any(ChildUnitPermissionArgVisitor) } } #[derive(Debug, PartialEq)] pub enum ChildUnaryPer...
Rust
0
_data) ) # Update user role if role_id: await user_crud.update(db, user_id, {"role_id": role_id}) csrf_token, signed_token = csrf_protect.generate_csrf_tokens() headers = { "HX-Location": "/user", "HX-Trigger"...
Python
1
epoch + 1, epoch_num, (i + 1) * bs, train_num, ite_num, \ running_det_loss / ite_num4val, \ running_fus_loss / ite_num4val, \ running_sem_loss / ite_num4val, \ running_loss / ite_num4val)) wri...
Python
1
通常以大写字母开头,使用驼峰命名法。 元组结构体 (tuple struct) 是由元组和结构体混合构成,元组结构体有名称,但是它的域没有。 当元组结构体只有一个域时,称为新类型 (newtype)。 没有任何域的结构体,称为类单元结构体 (unit-like struct)。 结构体中的值默认是不可变的,需要给结构体加上mut使其可变。 */ // structs struct Point { x: i32, y: i32, }; let point: Point = Point { x: 0, y: 0 }; let point...
Rust
0
window_sma_returns_correct_simple_moving_average() { let series = [15f64, 13f64, 2f64, 11f64]; let expected_sma = vec![14f64, 7.5f64, 6.5f64]; assert_eq!(n_window_sma(2, &series), Some(expected_sma)); } #[test] fn price_diff_returns_none_if_series_is_smaller_than_2() { asser...
Rust
0
= "The `uniformMatrix4fv()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocatio...
Rust
0
with code.new_blk("if arg_%d, ok = arg.v.(%s); !ok" % (i, arg_tp_code)): code += "err_arg_seq = %d" % (i + 1) code += "return" code += "_ = arg_%d" % i with code.new_blk("func (this *%s) lar_reflect_methods() []*l...
Python
1
rintln!("Usage: {} GENESIS_FILE", args.get(0).unwrap_or(&String::from("nimiq-genesis"))); exit(1); } fn main() { pretty_env_logger::init(); let args = env::args().collect::<Vec<String>>(); if let Some(file) = args.get(1) { let GenesisInfo { block, hash, accounts } = GenesisBuilder::new().with...
Rust
0
# coding=UTF-8 # ex:ts=4:sw=4:et=on # Copyright (c) 2013, Mathijs Dumon # All rights reserved. # Complete license can be found in the LICENSE file. from math import exp, sqrt, log, pi import numpy as np sqrtpi = sqrt(pi) sqrt2pi = sqrt(2 * pi) sqrt8 = sqrt(8) def mmult(A, B): return np.sum(np.transpose(A, (0, ...
Python
1
, _ => 0, }; } count } fn print_usage(opts: Options) { let brief = format!( "Usage: theseus_cargo --input INPUT_DIR [OTHER_OPTIONS] CARGO_COMMAND [CARGO OPTIONS]\n\n \ *** Note: the --input argument and other options must come before the cargo command. \ ...
Rust
0
# 使用list函数 ll = list('hello list') print(ll) # 列表元素赋值 如 x[3]=5 x = [1,2,3,4,5] # 改变列表第四个元素的值 x[3] = 5 print(x) # 删除元素 del names = ['zhangsan','lisi','wangwu','zhaoliu'] print(names) # 删除第三个元素 del names[2] # 最后列表长度变为3 print(names) # 分片赋值 name = list('python') name[2:] = 'wr' print(name) # 序列不等长分片替换 name_re = list('...
Python
1
-------------------------------------------- // Public Types // ------------------------------------------------------------------------------------------------ /// /// Not all the features expressed in the Graph APIs are required to be implemented by a /// particular type. This trait allows a client to determine whic...
Rust
0
selector(floodRepeat=1), ), ( into_hsgf_level_params( hsgf.PyBruteforceKNNParams( degree=int(_config["k_values"][0] * 0.5) ), "KNN", ), ...
Python
1
{ syn::Error::new( ident.span(), format!("could not open {:?}: {}", current_path, err), ) })?; let mut content = String::new(); file.read_to_string(&mut content).map_err(|err| { syn::Error::new( ident.span(), format!("could not read {:...
Rust
0
: u32 = 20; pub const FORMAT_R8G8_SINT: u32 = 21; pub const FORMAT_R8G8_SRGB: u32 = 22; pub const FORMAT_R8G8B8_UNORM: u32 = 23; pub const FORMAT_R8G8B8_SNORM: u32 = 24; pub const FORMAT_R8G8B8_USCALED: u32 = 25; pub const FORMAT_R8G8B8_SSCALED: u32 = 26; pub const FORMAT_R8G8B8_UINT: u32 = 27; pub const FORMAT_R8G8B8_...
Rust
0
from collections.abc import Callable import numpy as np import torch from torch import FloatTensor, Tensor from torch.nn import functional as F from . import AbstractWatermarkCode, AbstractReweight class Delta_WatermarkCode(AbstractWatermarkCode): def __init__(self, u: FloatTensor): assert torch.all(u >=...
Python
1
from db import init_db from menu import main_menu if __name__ == "__main__": init_db() main_menu()
Python
1
paragraph = input("Enter the paragraph you wish to enter:") print("The length of the paragraph is",len(paragraph))
Python
1
", "type": "Storage", "service_port": 9999, "management_port": 9999, "address": "0.0.0.0", "protocol": "http" } @classmethod async def insert_into_tbl(cls, table_name, payload): pass @classmethod async def ...
Python
1
#!/usr/bin/python from ming import * import sys srcdir=sys.argv[1] mediadir=srcdir+'/../Media' Ming_useSWFVersion(8); m = SWFMovie(); Ming_setScale(1.0); #Unknown block type 69 # SWF_DEFINELOSSLESS # Bitmap 1 (lossless). To extract: # swfextract -p 1 -o character1.png $swf character1 = SWFBitmap(mediadir + '/...
Python
1
called_fun_id) = worklist.pop() { let called_funs = global_env .get_function(called_fun_id) .get_called_functions(); for called_fun_id in called_funs { if non_inv_fun_set.insert(called_fun_id) { // Add to...
Rust
0
array!(&sk, true, "SaverSk"); let ek = obj_to_uint8array!(&ek, false, "SaverEk"); let dk = obj_to_uint8array!(&dk, false, "SaverDk"); setup.push(&snark_pk); setup.push(&sk); // Cannot zeroize sk here as that will make the `setup` array contain an all-0 value for `sk` setup.push(&ek); setup.p...
Rust
0
import requests from pprint import pprint API_key = '6258e383fda86a1c201f5e3e76b0f99d' def get_weather(api_key, city): base_url = "http://api.openweathermap.org/data/2.5/weather" params = { "q": city, "appid": api_key, "units": "metric" } response = requests.get(base_url, par...
Python
1
tiguous().view(-1, D, H, W) crops = F.grid_sample(bottom, grid) crops = F.max_pool2d(crops, 2, 2) else: grid = F.affine_grid(theta, torch.Size((rois.size(0), 1, cfg.POOLING_SIZE, cfg.POOLING_SIZE))) bottom = bottom.view(1, batch_size, D, H, W).contiguous().expand(roi_per_batch, batch_size, D...
Python
1
self.bits & 0x01) != 0) } #[doc = "Bit 1 - Dynamic Clock Gating Supported"] #[inline(always)] pub fn gclk(&self) -> GCLK_R { GCLK_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 2 - Random Selection Policy Supported"] #[inline(always)] pub fn randp(&self) -> RANDP_R { ...
Rust
0
class Solution: def scoreOfString(self, s: str) -> int: ans = 0 for i in range(1, len(s)): ans += abs(ord(s[i-1]) - ord(s[i])) return ans
Python
1
] = i; } for j in 0..(s2.len() + 1) { dist[0][j] = j; } for (i, c1) in s1.chars().enumerate() { for (j, c2) in s2.chars().enumerate() { if c1 == c2 { dist[i + 1][j + 1] = dist[i][j]; } else { let delete = dist[i][j + 1] + 1; ...
Rust
0
(); let mut out = io::BufWriter::new(stdout.lock()); let reader = io::BufReader::new(stdin.lock()); let input = reader.lines().filter_map(Result::ok); let mut boot_code = Vec::<Instruction>::new(); for line in input { let mut line_iter = line.trim().split_whitespace().take(2); let...
Rust
0
ger agent with personality: {personality}") # Initialize game state state_manager.initialize_game_state( active_players=game_engine.active_players, werewolves=game_engine.werewolves, villagers=game_engine.villagers ) # Print game star...
Python
1
START_Y as f32), Vector2::new((STARTX - LINE_WIDTH) as f32, DEAD_BOX_START_Y as f32), LINE_WIDTH as f32, Color::BLACK); let fps: String = d.get_fps().to_string(); let num_infected: String = infected_len.to_string(); let num_normal: String = normal_len.to_string(); let num_recovered: Stri...
Rust
0
tion: Pixel, point: ScreenPoint) -> ScreenPoint { let resolution = ScreenPoint::from(resolution); let result = ((point + ScreenPoint::new(1.0, 1.0)) / 2.0) * resolution - ScreenPoint::new(0.5, 0.5); result } impl Sub<ScreenPoint> for ScreenPoint { type Output = ScreenPoint; fn sub(self, rh...
Rust
0
()); let entry = assert_ready_ok!(poll!(t, queue)).into_inner(); assert_eq!(entry, "bar"); }) } #[test] fn reset_first_expiring_item_to_expire_later() { let mut t = MockTask::new(); clock::mock(|clock| { let mut queue = DelayQueue::new(); let epoch = clock.now(); ...
Rust
0
############################################################################### # # OpenEduCat Inc # Copyright (C) 2009-TODAY OpenEduCat Inc(<https://www.openeducat.org>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License a...
Python
1
""" initialization of unittests and data for unittests """ import time environment = "practice" # calculate expiryDate as an offset from today # now + 5 days days = 5 expiryDate = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(int(time.time() + 86400*days))) def fetchTestData(responses...
Python
1
import os import unittest import platform from test.test_support import TESTFN def can_symlink(): # cache the result in can_symlink.prev_val prev_val = getattr(can_symlink, 'prev_val', None) if prev_val is not None: return prev_val symlink_path = TESTFN + "can_symlink" try: symlink...
Python
1
import numpy as np import scipy.special as sc from numpy.testing import assert_almost_equal, assert_array_equal class TestPdtr: def test(self): val = sc.pdtr(0, 1) assert_almost_equal(val, np.exp(-1)) def test_m_zero(self): val = sc.pdtr([0, 1, 2], 0) assert_array_equal(val, [...
Python
1
from typing import Generator import aiohttp from fastapi import Depends, HTTPException, status from fastapi.security import OAuth2 from pydantic.error_wrappers import ValidationError from app.core.db import SessionLocal from app.core.http_session import SingletonAiohttp from app.core.utils.jwt import decode_token fro...
Python
1
import os import math import torch from mmcv.runner import HOOKS, Hook @HOOKS.register_module() class SaveStatsHook(Hook): def __init__(self, save_stats_interval=-1): self.save_stats_interval = save_stats_interval def save_stats(self, named_params, work_dir, iterate, rank): ...
Python
1
, String, no_partial(many1(digit())) .or(many1(letter())) .skip(range(&"\r\n"[..])) } let input = "1\r\n\ abcd\r\n\ 123\r\n\ abc\r\n\ 1232751\r\n"; let result = run_decoder(input, seq, TestParser::default()...
Rust
0
color=0x3498DB, ) decision_emojis = { "allowed": "✅", "blocked": "❌", "consent_requested": "❓", "allowed_once": "✅", "denied_once": "❌", "allowed_always": "✅", "denied_always": ...
Python
1
#[doc(hidden)] pub struct _ENET_MDIO_SELECT_INPUT; #[doc = "`read()` method returns [enet_mdio_select_input::R](enet_mdio_select_input::R) reader structure"] impl crate::Readable for ENET_MDIO_SELECT_INPUT {} #[doc = "`write(|w| ..)` method takes [enet_mdio_select_input::W](enet_mdio_select_input::W) writer structure"]...
Rust
0
t.write('SConscript', """assert GetLaunchDir() == r'%s'"""%test.workpath('sub3')) test.run(chdir = 'sub3', arguments='-U bar') test.must_not_exist(test.workpath('sub1', 'foo.out')) test.must_exist(test.workpath('sub2', 'bar.out')) test.must_exist(test.workpath('sub2b', 'bar.out')) test.must_not_exist(test.workpath('sub...
Python
1
g: &Config, env: &mut Env<R>, ty_subs: I, ty_sup: &Ty<R>, ) -> Result<Prop<R>> where R: Reason, I: IntoIterator<Item = &'a Ty<R>>, { let mut prop = Prop::valid(); for ty_sub in ty_subs { let next = simp_ty(cfg, env, ty_sub, ty_sup)?; if next.is_unsat() { prop = ne...
Rust
0
:accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<CVirtualControllerConfig_Control>>( "controls", |m: &CVirtualControllerConfig_ActionSet| { &m.controls }, |m: &mut CVirtualControllerConfig_ActionSet| { &mut m.controls }, )); ...
Rust
0
"combinators")] impl<'buf, O, F1: DecodeParser<'buf, O>, F2: DecodeParser<'buf, O>> DecodeParser<'buf, O> for Or<F1, F2> { /// Parse over `Or` structure. fn parse(&self, i: DecodeBufIterator<'buf>) -> DCPResult<'buf, O> { match self.f1.parse(i.clone()) { Err(_e1) => match self.f2.parse(...
Rust
0
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt import unittest import frappe from frappe.tests import IntegrationTestCase from frappe.utils import today from erpnext.accounts.doctype.loyalty_program.test_loyalty_program import create_records from erpnext.accounts.doctype.sales_...
Python
1
from launch_ros.actions import Node import os from launch import LaunchDescription from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource from ament_index_python.packages import get_package_share_directory def generate_launch_description(): ...
Python
1
ac\xc0\xfdW\x9b_\xc7q\xe4,\xe2\ \x22\xc5\xd3\xf1c\x5c\xb4\x8f\xf17\x12\x1f\xf0u\xec\xf8\ ;\x89\xfa \xf1\x8f\x7f\xfc#/\xe2\xf8\xd5\xe6W4\ \xeb\xef\xd8Tp\x04/\xbd\xe8\xee8\xefn_\xf8\xbc\ \xad\xdc\xa1?\x9c,,\xde\xd9\xb2_\x8b\x9d\xf1_\x8a\ \xed\xba\xbb?t\xaa\xe7\xe0\xec3\xef\xd9T>n\xb8\ \xf2fkq\xc59\xcbe\x19\xd5\xd6\x88\x8...
Python
1
446f}, {-0.9890159f,0.14780942f},{-0.99026805f,0.1391731f},{-0.9914449f,0.13052619f}, {-0.99254614f,0.12186934f},{-0.9935719f,0.11320321f},{-0.9945219f,0.104528464f}, {-0.9953962f,0.09584575f},{-0.9961947f,0.087155744f...
Rust
0
map.contains_key(&check_point) && *seating_map.get(&check_point).unwrap() != TileState::Floor { output.push(check_point); break; } } // Diag - down left let mut check_point = *location; loop { if check_point.get_x() < 0 || check_point.get_y...
Rust
0
{ if args.node == args.new_node { return ArgResult::error("node and new_node must be different."); } ArgResult::Ok } pub fn get_command() -> Command { Command { func: replace_nodes, verify_args: Some(verify_args), args: vec![ (ArgType::Node(true), "Name of node to replace"), (ArgType::NewNode, "Nam...
Rust
0
do this so that if we throw exc or JVM // crashes during deletions, even when not on Windows, we don't // leave the index in an "apparently corrupt" state: let mut copys = vec![]; for file in files { copys.push(file); if !file.starts_with(INDEX_FILE_SEGMENTS) { ...
Rust
0
name.as_bytes()[0..len] { *raw_name = *b as c_char; raw_name = raw_name.offset(1); } *raw_name = b'\0' as c_char; 1 } _ => 0, } } #[no_mangle] pub extern "C" fn rb_ot_layout_has_glyph_classes(ttf_parser_data: *const ffi::rb_ttf_p...
Rust
0
wo groups, keeping common let (new_numbers_true, new_numbers_false): (Vec<usize>, Vec<usize>) = current_numbers .iter() .partition(|x| check_bit_for_one(x, i) == is_ones_common); // replace current_numbers if is_most_common { current_numbers = new_numbers_tru...
Rust
0
) } fn do_add() { prepare_environments(); match std::fs::read_dir("pending") { Ok(entries) => { for entry in entries.flatten() { let file_name = entry.file_name().to_string_lossy().to_string(); do_add_file("pending", &file_name); } } ...
Rust
0
""" Plugin for ResolveURL Copyright (C) 2021 gujal 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
FE', instname=inst.name, ) show_opd( wfe_si * 0, aperture, title='ISIM struct. align.', ax=axes[3, 2], annotate_budget='ISIM structural', instname=inst.name, ) show_opd( wfe_si_dynamic, aperture, title='ISIM+SI instability',...
Python
1
elif node["joint"]["type"] == "continuous": node["joint"]["range"] = [0.0, 360.0] elif ( node["joint"]["type"] == "prismatic" or node["joint"]["type"] == "screw" ): node["joint"]["range"] = [0.0, float(data["range"][i][1])] node["joint"]["axis"] = {} ...
Python
1
st] fn it_convert_knownquarts_to_u_s_tablespoons_3() { let result: f64 = volume::quarts::to_u_s_tablespoons(0.44); assert_approx_eq!(33.81875, result, 0.01); } /// Need to convert to parameterized tests #[test] fn it_convert_knownquarts_to_u_s_quarts_1() { let result: f64 = volume::quarts::to_u_s_quarts(0.4...
Rust
0
#Faça um programa que leia um ângulo qualquer e mostre na tela seu seno, cosseno e tangente from math import radians, sin, cos, tan #As funções tan(), sin() e cos() calculam respectivamente o valor da tangente, seno e cosseno de X radianos #Por se calcular em radianos, é necessário a conversão do ângulo em graus para ...
Python
1
) session = _build_session(model_) input_dict = _create_input_dict(subgraph_inp_names, cached_data) cached_data[subgraph_out_names[0]] = session.run( None, input_feed=input_dict )[0] # Final subgraph extraction and session run subgraph_inp...
Python
1
object: &mut aws_smithy_json::serialize::JsonObjectWriter, input: &crate::model::S3Target, ) -> Result<(), aws_smithy_http::operation::SerializationError> { if let Some(var_1177) = &input.path { object.key("Path").string(var_1177); } if let Some(var_1178) = &input.exclusions { let mut ar...
Rust
0
.config.hash.as_bytes(), ); let compiled_file_metadata = CompiledFileMetadata { version_hash }; let meta_key = self .disk_cache .get_cache_filename_with_extension(module_specifier.as_url(), "meta"); self.disk_cache.set( &meta_key, compiled_file_metadata.to_json_string()?.as_byte...
Rust
0
as an interrupt pub fn dispatch(&self) { match self { Self::ClockTick => { clock::on_tick(); } } } } <filename>pac/atsamd11d/src/usb/device/qosctrl.rs #[doc = "Reader of register QOSCTRL"] pub type R = crate::R<u8, super::QOSCTRL>; #[doc = "Writer for register QOSCTRL"] pub type W = crate::W<u8, super:...
Rust
0
) inp = tf.constant( list(inp_array.ravel(order="C")), shape=shape, dtype=dtype) lrn_op = tf.nn.local_response_normalization( inp, name="lrn", depth_radius=lrn_depth_radius, bias=bias, alpha=alpha, beta=beta) err = tf.test.compute_gradient_error(inp, ...
Python
1
l-client")] pub async fn create() -> crate::Result<Self> { crate::CLOUD_CLIENT.hmac_key().create().await } /// The synchronous equivalent of `HmacKey::create`. /// /// ### Features /// This function requires that the feature flag `sync` is enabled in `Cargo.toml`. #[cfg(all(feature ...
Rust
0