text
string
label_name
string
labels
int64
/// 2 _2 = 1, /// 3 _3 = 2, /// 4 _4 = 3 ], /// Block clock automatically during frequency change AUTOBLOCK OFFSET(11) NUMBITS(1) [ /// Disabled. Autoblocking disabled DisabledAutoblockingDisabled = 0, /// Enabled. Autoblocking enabled...
Rust
0
(["a", "b", "c"]); linearizable! { Implementation => let store = Shared::new($store), Read(usize)(i in 0..LEN) -> Option<Box<[u8]>> { let (cid, _) = &blocks[i]; task::block_on(store.read(cid)).unwrap() }, ...
Rust
0
nt assert origins1 == origins2 def test_cors_config_methods_immutability(self): """Test that allow_methods in config is a new list""" config = get_cors_config() # Modify the returned list config["allow_methods"].append("CUSTOM_METHOD") # Get a n...
Python
1
""" Evernote OAuth1 backend (with sandbox mode support), docs at: https://python-social-auth.readthedocs.io/en/latest/backends/evernote.html """ from requests import HTTPError from ..exceptions import AuthCanceled from .oauth import BaseOAuth1 class EvernoteOAuth(BaseOAuth1): """ Evernote OAuth authenti...
Python
1
= node.right.take(); let val = node.val; match key.cmp(&val) { Equal => match (left, right) { (None, None) => None, (Some(left), None) => Some(left), (None, Some(right)) => Some(right), (left, right)...
Rust
0
'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bit...
Rust
0
*last_result = bit_base; return old; } else { *flags &= !FLAG_ZERO; *last_result = int_log2(bit_base); return *last_result; }; } #[no_mangle] pub unsafe fn bsr32(old: i32, bit_base: i32) -> i32 { *flags_changed = FLAGS_ALL & !FLAG_ZERO & !FLAG_CARRY; *flags &=...
Rust
0
/master/COPYRIGHT. No part of mlnx-ofed, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file. // Copyright © 2016 The developers of mlnx-ofed. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.gith...
Rust
0
g the ``standardized_adv_r`` to ``True``. The same trick is applied to the advantages of the cost. Returns: The data stored and calculated in the buffer. """ data_pre = {k: [v] for k, v in self.buffers[0].get().items()} for buffer in self.buffers[1:]: ...
Python
1
import utils.commons.single_thread_env # NOQA import glob import subprocess from textgrid import TextGrid import os from utils.commons.hparams import hparams, set_hparams def train_mfa_align(mfa_outputs="mfa_outputs", mfa_inputs="mfa_inputs", model_name=None, pretrain_model_na...
Python
1
Set::Mnop => string.push('N'), Set::Qrst => string.push('R'), Set::Uvwx => string.push('V'), Set::YzAccents => string.push('Z'), Set::Accents => {}, // modifier } }, Button::Execute => { update = true; match set { Set::None => string.push(' '), ...
Rust
0
#[inline] pub fn is_m45db(&self) -> bool { *self == PGARIGHTR::M45DB } #[doc = "Checks if the value of the field is `M60DB`"] #[inline] pub fn is_m60db(&self) -> bool { *self == PGARIGHTR::M60DB } } #[doc = "Possible values of the field `PGALEFT`"] #[derive(Clone, Copy, Debu...
Rust
0
model.w = vec![0.0; w_size]; f_in.read_f32_into::<NativeEndian>(&mut model.w)?; Ok(model) } pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error> { let mut f_out = File::create(path)?; f_out.write_all(&self.n.to_ne_bytes())?; f_out.write_all(&self.m.to_ne_byt...
Rust
0
""" How to reference supporting evidence for some object in the database. See: "Metadata in owmeta" for discussion on semantics of what giving evidence for an object means. """ from __future__ import absolute_import from __future__ import print_function import owmeta_core as P from owmeta_core.data import Data from ...
Python
1
import seaborn as sns import matplotlib.pyplot as plt tips=sns.load_dataset('tips') print(tips.head()) #............................................lmplot........................................ fig,ax=plt.subplots(3,2,figsize=(10,10)) sns.lmplot(x='total_bill',y='tip',data=tips,ax=ax[0,0]) ax[0,0].set_title("Simpl...
Python
1
ing_rect<T>(line: Line<T>) -> Rect<T> where T: CoordinateType, { let a = line.start; let b = line.end; let (xmin, xmax) = if a.x <= b.x { (a.x, b.x) } else { (b.x, a.x) }; let (ymin, ymax) = if a.y <= b.y { (a.y, b.y) } else { (b.y, a.y) }; Rect::new( Coordinate { x: xmin, y: ymin }, ...
Rust
0
setae 0x05, 0x73, 0x65, 0x74, 0x6E, 0x62,// setnb 0x05, 0x73, 0x65, 0x74, 0x6E, 0x63,// setnc 0x04, 0x73, 0x65, 0x74, 0x65,// sete 0x04, 0x73, 0x65, 0x74, 0x7A,// setz 0x05, 0x73, 0x65, 0x74, 0x6E, 0x65,// setne 0x05, 0x73, 0x65, 0x74, 0x6E, 0x7A,// setnz 0x05, 0x73, 0x65, 0x74, 0x62, 0x65,// setbe 0x05, 0x73, ...
Rust
0
lis 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. // // Sulis is distributed in the hope that it will be useful, // but WITHO...
Rust
0
"""스케줄러와 타이머 예제. 이 모듈에는 길드 예약 이벤트를 생성하는 함수와 `discord.ext.tasks.loop`을 이용한 주기적인 공지 루프가 포함되어 있습니다. 실제 봇에서는 토큰과 채널 ID를 환경 변수로 관리하고, 필요한 길드 권한이 부여되어야 합니다. """ import datetime import discord from discord.ext import tasks, commands async def schedule_study_event(bot: discord.Bot, guild_id: int, stage_channel_id: int) -> ...
Python
1
from fastapi import APIRouter, Depends, Query from pydantic import BaseModel, Field from sqlalchemy.orm import Session from sqlalchemy import func from app.db.session import get_db from app.db.models import Feedback as FeedbackORM class FeedbackRequest(BaseModel): claim_id: str = Field(..., description="Identifi...
Python
1
import logging from rest_framework import serializers from apps.reviews.models import Review from apps.reviews.exceptions import InvalidReviewData from apps.products.models import Product from apps.users.serializers import UserSerializer logger = logging.getLogger(__name__) class ReviewSerializer(serializers.ModelSe...
Python
1
import typing from .._detail._PolicyCouplerBase import PolicyCouplerBase from ._CalcMrcaUncertaintyAbsUpperBoundWorstCase import ( CalcMrcaUncertaintyAbsUpperBoundWorstCase, ) class CalcMrcaUncertaintyRelUpperBoundWorstCase: def __init__( self: "CalcMrcaUncertaintyRelUpperBoundWorstCase", pol...
Python
1
CResult_RevokeAndACKDecodeErrorZPtr, /// Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state. pub result_ok: bool, } #[no_mangle] /// Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state. pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_ok(o: crate::lightning::ln::msgs::RevokeAn...
Rust
0
#[test] fn test_dep_type() { let default = DepType::default(); assert!(default == DepType::Code); let default_value: u8 = default.into(); assert_eq!(default_value, 0); let max_value = 1u8; for v in 0..32 { let b: packed::Byte = v.into(); let res = DepType::try_from(b); i...
Rust
0
# ‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹ # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2023 Ricardo Pardini <ricardo@pardini.net> # This file is a part of the Armbian Build Framework https://github.com/armbian/build/ # ‹‹‹‹‹‹‹‹‹‹‹‹‹...
Python
1
h_time, data_time, losses, top1, top5], prefix="Epoch: [{}/{}]\t" "LR: {}\t".format(epoch, args.epochs, curr_lr)) # switch to train mode model.train() end = time.time() for i, (images, target) in enumerate(train_loader): # measure data loading time data_time.upda...
Python
1
"""Tests for the timer module.""" import time from collections.abc import Callable from typing import Any from unittest.mock import patch import pytest from pastas.timer import ExceededMaxSolveTime, SolveTimer class TestSolveTimer: """Test class for SolveTimer.""" def test_init(self) -> None: """T...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC. All Rights Reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
Python
1
0.0.1:3000").unwrap() .handle(|_| Hello).unwrap(); println!("Listening on http://127.0.0.1:3000"); } <gh_stars>0 use std::usize; use super::keyboard::{Key, KeyStates}; use super::mouse::{MouseKeys, MouseState, ScrollDelta, ViewportPosition}; use crate::message_prelude::*; use bitflags::bitflags; #[doc(inl...
Rust
0
instruction::group::Group; use crate::value::instruction::hash::Hash; use crate::value::instruction::identifier::Identifier; use crate::value::instruction::IKind; use crate::value::primitive::bool::Bool; use crate::value::primitive::float::Float; use crate::value::primitive::int::Int; use crate::value::primitive::str::...
Rust
0
commended headers by OpenRouter referer = os.getenv("OPENROUTER_REFERER") if referer: headers["HTTP-Referer"] = referer site = os.getenv("OPENROUTER_SITE_NAME") if site: headers["X-Title"] = site resp = requests.post(url, json=payload, headers=headers, tim...
Python
1
serde(default)] internal: bool, #[serde(flatten)] common: MusicCommon, }, RunLengths { #[serde(rename = "run_lengths")] lengths: Vec<u8>, #[serde(default)] internal: bool, #[serde(flatten)] common: MusicCommon, }, Pattern { ...
Rust
0
_up.weight.data, ) print( "First Unet Layer's Down Weight is now : ", _down.weight.data, ) break ...
Python
1
if jwt_files: for line in jwt_files: print(f" {line}") else: print(" No JWT files found") else: print(" Unable to list files") else: print(f"\n{container_name}: NOT RUNNING") d...
Python
1
STEST: {fastest.name} - {fastest.time_ms:.3f}ms\n") f.write(f"💥 MAX SPEEDUP: {fastest.speedup:.1f}x faster than baseline\n") def get_system_info() -> dict: """Сбор информации о системе""" return { "Platform": platform.platform(), "Python Version": platform.python_version(), ...
Python
1
from __future__ import absolute_import, division, print_function import time import iotbx.pdb from cctbx import maptbx from libtbx.test_utils import approx_equal import sys def exercise1(): """ Exercise to see how much values on generated map are different on different platforms """ pdb_str=""" CRYST1 10.0...
Python
1
rate material from given parameter set. /// /// * `tp` - Texture parameter set. fn from(tp: &TextureParams) -> Self { let kd = tp.get_spectrum_texture_or_else("Kd", Spectrum::new(0.5), |v| { Arc::new(ConstantTexture::new(v)) }); let ks = tp.get_spectrum_texture_or_else("...
Rust
0
# Copyright 2020 Uber Technologies, Inc. All Rights Reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
1
me__ == "BlenderbotForCausalLM": model.config.encoder_no_repeat_ngram_size = 0 # TODO: Change the tiny model creation script: don't create models with problematic tokenizers # Avoid `IndexError` in embedding layers CONFIG_WITHOUT_VOCAB_SIZE = ["CanineConfig"] if tokenizer is not None: c...
Python
1
insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/relayer.Relayer/SubscribePackets', relayer__pb2.SubscribePacketsRequest.SerializeToString, ...
Python
1
# -*- coding: utf-8 -*- # Copyright 2023 Google LLC # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
1
# Copyright (C) 2024 Charles O. Goddard # # This software is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This software is d...
Python
1
pub fn success(msg: Vec<u8>) -> InvocationResponse { InvocationResponse { msg, error: None } } pub fn error(err: &str) -> InvocationResponse { InvocationResponse { msg: Vec::new(), error: Some(err.to_string()), } } } /// This function is called by the u...
Rust
0
cmds { match cmd { Cmd::Mask(mask) => { curmask = mask.clone(); }, Cmd::Write(addr, mut val) => { for i in 0..36 { match curmask[i] { Some(false) => val &= u64::MAX - (1 << i), ...
Rust
0
for l in visible_log { draw_batch.fill_region( Rect::with_exact(layout.x1, y, layout.x2, y), ColorPair::new(l.1, l.2), to_cp437(' '), ); draw_batch.print_color( Point::new(layout.x1, y as i32), &l.0, ColorPair::new(l.1,...
Rust
0
When paired with the [`ctx`](#ctx) attribute, `ctx_default` provides default values for the context Example: ```rust # use deku::prelude::*; #[derive(DekuRead, DekuWrite)] #[deku(ctx = "a: u8", ctx_default = "1")] // Defaults `a` to 1 struct Subtype { #[deku(map = "|b: u8| -> Result<_, DekuError> { Ok(b + a) }")]...
Rust
0
cryption_key_id']) @queueadmin_cli.queue_group.command(name=queueadmin_cli.update_queue.name, help=queueadmin_cli.update_queue.help) @cli_util.option('--custom-key', help="""Id of the custom master encryption key which will be used to encrypt messages content. String of length 0 means the custom key should be removed f...
Python
1
# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com) { "name": "Stock Picking Show Linked", "summary": """ This addon allows to easily access related pickings (in the case of chained routes) through a button in the parent picking view. """, "version": "17.0.1.0.0", "autho...
Python
1
of the window view area.". Also, $`d`$ is the /// thickness of the cavity. fn nusselt(ra: Float, gamma: Float, a_gi: Float) -> Float { const THIRTY_RAD: Float = 30. * crate::PI / 180.; const EPSILON_RAD: Float = 0.5 * crate::PI / 180.; if gamma >= 0.0 && gamma < 2. * THIRTY_RAD - EPSILON_RAD { // ...
Rust
0
__all__ = () from ...field_parsers import bool_parser_factory, default_entity_parser_factory, nullable_string_parser_factory from ...field_putters import ( bool_optional_putter_factory, entity_putter_factory, nullable_string_optional_putter_factory ) from ...field_validators import ( bool_validator_factory, en...
Python
1
import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm from estimators import SampleAverageEstimator, WeightedEstimator from testbed import K_armed_testbed np.random.seed(250) def plot_performance(estimator_names, rewards, action_optimality): for i, estimator_name in enumerate(estimator_names):...
Python
1
import os from machine import Pin, SoftSPI from sdcard import SDCard # Initialize SPI and SD card spisd = SoftSPI(-1, miso=Pin(13), mosi=Pin(12), sck=Pin(14)) sd = SDCard(spisd, Pin(27)) print('Root dir before mounting: {}'.format(os.listdir())) vfs = os.VfsFat(sd) try: os.mount(vfs, '/sd') except OSError as e:...
Python
1
smart_test!(nonstring, d, { // let mut d = d; // d.set_var("TEST", 5, false); // let val = d.get_var("TEST")?.ok_or(DataSmartError::UnwrapNoneError)?; // assert_eq!(val, "5"); // }) ported_datasmart_test!(rename, d, { d.rename_var("foo", "newfoo")?; assert_eq!( ...
Rust
0
}, }; value_history.push(next_point.value); } panic!("too many iterations") } fn max_norm(v: &[f64]) -> f64 { let mut acc = 0f64; for x in v { acc = acc.max(x.abs()); } acc } #[cfg(test)] mod tests { use crate::util::Never; use itertools::Itertools; type N...
Rust
0
nectionManager::<MysqlConnection>::new(database_url); let pool = Pool::builder() .build(manager) .expect("Failed to create pool."); Ok(pool) } #[inline] pub fn create_game_entry( db_pool: &Pool<ConnectionManager<MysqlConnection>>, guild: u64, todays_date: &NaiveDate, )...
Rust
0
{}", arg.major, arg.minor, arg.flags, arg.max_readahead ), Operation::OpenDir { arg } => write!(f, "OPENDIR flags={:#x}", arg.flags), Operation::ReadDir { arg } => write!( f, "READDIR fh={}, offset={}, size={}", arg.fh, ...
Rust
0
io; use std::io::prelude::*; use std::fs::File; pub enum GitService { GitHub, GitLab, } #[derive(Deserialize)] pub struct Config { pub github: Option<String>, pub gitlab: Option<String> } #[derive(Debug, Fail)] pub enum ConfigError { #[fail(display = "failed to read API config: {}", why)] IO ...
Rust
0
nt('agent1') success = self.communication.unregister_agent('agent1') assert success == True assert 'agent1' not in self.communication.registered_agents def test_subscribe_unsubscribe(self): """測試訂閱和取消訂閱""" self.communication.register_agent('agent1') ...
Python
1
import inspect import scrapy try: from pep_parse.spiders.pep import PepSpider except ModuleNotFoundError: raise AssertionError('Не найден файл `pep.py`') except ImportError as exc: raise AssertionError( f'Не найден класс `{exc.args[0].split()[3]}` в файле {exc.name}', ) def test_pep_spider()...
Python
1
box_height = bbox.height().to_f64().unwrap(); let box_aspect_ratio = box_width / box_height; let term_aspect_ratio = width / height; // Clamp dimensions to aspect ratio of the geometry bbox let (cols_f, rows_f) = match ( term_aspect_ratio > 1.0, box_aspect_rati...
Rust
0
fixed), |a, b| Ok(a.value() + b.value()) ); b.rule_2("about <duration>", b.reg(r#"(?:about|around|approximately|roughly)"#)?, duration_check!(), |_, duration| Ok(duration.value().clone().precision(Precision::Approximate)) ); b.rule_2("<duration> appr...
Rust
0
import astroid from .base_model_checker import BaseModelChecker from .issue import Issue class DJ06(Issue): code = 'DJ06' description = 'Do not use exclude with ModelForm, use fields instead' class DJ07(Issue): code = 'DJ07' description = "Do not use __all__ with ModelForm, use fields instead" cl...
Python
1
from typing import List class Solution: def isArraySpecial(self, nums: List[int], queries: List[List[int]]) -> List[bool]: n = len(nums) # Step 1: Create mismatch array mismatch = [0] * n for i in range(1, n): mismatch[i] = 1 if nums[i] % 2 == nums[i - 1] % 2 else 0 ...
Python
1
.as_nanos(); // Should return 100000000ns as a u64 sw.lap(); // Get all the lap times { let mut lap = 1; while let Some(lap_time) = sw.lap_time(lap) { let _t = lap_time.as_secs_f64(); lap += 1; }...
Rust
0
m(0x120), expected_acc_mid, "Acc[16..32]")?; soft_assert_eq(SPMEM::read_vector16_from_dmem(0x130), expected_acc_low, "Acc[0..16]")?; soft_assert_eq(SPMEM::read_vector16_from_dmem(0x140), expected_result, "Result when doing VMACU V6, V6, V1")?; soft_assert_eq(SPMEM::read_vector16_from_dmem(0x150), expected_r...
Rust
0
User = Depends(get_current_superuser) ) -> Any: """ Get all attendance records (admin only). """ if not current_user.is_superuser: raise HTTPException( status_code=status.HTTP_403_FORBIDDEN, detail="Only superusers can access this data" ) records = [] cu...
Python
1
sh(parse_quote! { #of_ty: #where_bounds }); } generics } } impl std::iter::FromIterator<OpField> for OpFields { fn from_iter<I: IntoIterator<Item = OpField>>(iter: I) -> OpFields { OpFields(iter.into_iter().collect()) } } impl std::ops::Deref for OpFields { type Target = Vec<O...
Rust
0
if elem.attrib['class'] == 'java.lang.Integer': atts['value'] = int(elem.text) attributes.append(atts) # clear the element when we're done, to keep memory usage low if elem.tag in ['node', 'link'] and xml_event == 'end': elem.cle...
Python
1
fn get_scale(&self) -> &[f32] { self.scale.as_slice() } } /// A 2D counterpart for the [`Transform`]. /// /// A [`Transform2D`] contains Position and Scale [`Vec2`]s and a float for rotation. #[derive(Debug, Clone, Copy)] pub struct Transform2D { /// Position of the [`Transform2D`]. pub position: ...
Rust
0
*self { ErrorKind::Bug(_) => ErrorLevel::Panic, ErrorKind::MissingStartConf => ErrorLevel::Panic, ErrorKind::ExpectedError => ErrorLevel::Yield, ErrorKind::ChannelFinishedDest => ErrorLevel::Yield, ErrorKind::Service(ref servkind) => servkind.level(), /* ErrorKind::Msg(_) => Er...
Rust
0
pe[0]): weights[c,z,:,:] = w merr[c,z,:,:] = me serr[c,z,:,:] = se weights = weights.reshape( original_shape ) merr = merr.reshape( original_shape ) serr = serr.reshape( original_shape ) return weights, merr, serr def malis_weight(pars, props, lbls): """ comp...
Python
1
# Generated by Django 4.1.3 on 2022-11-22 13:01 import datetime from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='ImgModel', fields=[ ('id', ...
Python
1
""" TODO Some parts of this module are still not well documented. """ from jedi.inference import compiled from jedi.inference.compiled import mixed from jedi.inference.compiled.access import create_access_path from jedi.inference.context import ModuleContext def _create(inference_state, obj): return compiled.cre...
Python
1
import random from gnn_model.test_sample_sobel import * random_sample_dataset="sample_dataset/gaussion/random_sample4.txt" random_num=10000 add8_lib = ["add8u_1","add8u_0E2","add8u_0NH","add8u_0NQ","add8u_0NS","add8u_0PA","add8u_0TP","add8u_2J3","add8u_2LL","add8u_3RE","add8u_05G","add8u_6FT","add8u_6K6","add8u_6QU","a...
Python
1
import re import time import stripe from pyrogram import Client, filters, enums from SHUKLAMUSIC import app async def retrieve_account_details(sk): stripe.api_key = sk try: account = stripe.Account.retrieve() account_details = { "name": account.get("business_profile", {}).get("name"...
Python
1
}), ass_item: Some(|seq, i, value, vm| { let zelf = Self::sequence_downcast(seq); if let Some(value) = value { Self::setitem_by_index(zelf.to_owned(), i, value, vm) } else { Err(vm.new_type_error("mmap object...
Rust
0
::new(); let mut x = circle.x - circle.r; let mut was_outside = true; let mut i = 0; loop { if x > circle.x + circle.r { break; } let y = base_y + (circle.r - 0.7 * euclidian_dist((circle.x, circle.y + 0.3 * circle.r), (x, b...
Rust
0
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024) # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
Python
1
ppend(stock) # Step 6: Save to file watchlist_data = { 'timestamp': datetime.now().isoformat(), 'total_stocks': len(final_watchlist), 'screening_criteria': { 'price_min': self.config.TICKER_PRICE_MIN, ...
Python
1
import sys def factorial(n): if n == 0: return 1 return n * factorial(n - 1) n, k = map(int, sys.stdin.readline().split()) print(factorial(n) // (factorial(k) * factorial(n - k)))
Python
1
, audios in audio_groups.items(): audio_sf = sf.SoundFile(str(audios[0])) recordings.append( Recording( id=session_name, sources=[ AudioSource( type="file", ...
Python
1
( &func1, HashMap::from([("delimiter".to_string(), vec!["/".to_string()])]), false, ), ( &func2, HashMap::from([( "x-amz-server-side-encryption".to_string(), vec!["...
Rust
0
(jax.vmap, in_axes=(None, 0)) def lagrangian_potential_vmap(params, x): return self.apply( {"params": params}, x, method=self.lagrangian_potential ) self.lagrangian_potential_vmap_jit = jax.jit(lagrangian_potential_vmap) ...
Python
1
, PitchGroup::En => 4, PitchGroup::Bn => 5, PitchGroup::Fs => 6, PitchGroup::Cs => 7, PitchGroup::Gs => 8, PitchGroup::Ds => 9, PitchGroup::As => 10, PitchGroup::Fn => 11, } } /// DO NOT USE - Internal only ...
Rust
0
s (with BMI)' var bmi = null; var fixedNum = itemJson.item.significantDigits + 1; var weight = findFirstItemValueByName(formJson, 'VS_weight_VSTESTCD-VSORRES'); // update Study Event and Form Name as needed to look up previously-collected data var heightForm = findFormData(HEIGHT_FORM_STUDY_EVENT, HEIGHT_FORM_NAME); va...
Python
1
ESPACE: &str = "stocks"; lazy_static! { pub static ref LATEST_PRICE: GaugeVec = register_gauge_vec!( Opts::new("latest_price", "Latest stock price").namespace(METRICS_NAMESPACE), VARIABLE_LABELS ) .expect("can not create LATEST_PRICE metric. this should never fail"); pub static ref LATE...
Rust
0
Ok(()) } #[pallet::weight(0)] pub fn add_attribute( origin: OriginFor<T>, identity: T::AccountId, name: Vec<u8>, value: Vec<u8>, valid_for: Option<T::BlockNumber>, ) -> DispatchResult { let owner = ensure_signed(origin)?; ensure!(name.len() <= 65, Error::<T>::AttributeCreationFailed); ...
Rust
0
from fastapi import FastAPI from app.services.memory_service import update_memory, get_memory from app.serpapi_service import search_influencers from app.services.gmail_service import send_emails from app.services.ollama_service import parse_user_prompt from fastapi.staticfiles import StaticFiles from app.ui_router imp...
Python
1
hres_abs * step with open(save_path, 'w') as f: for im_idx, im in enumerate(image_list): line = im.replace('.jpg', '') for index, value in enumerate(pred_label_id[im_idx]): if value > thres_rel[im_idx]: line += " {}".format(...
Python
1
c\xdc\xf7\ \x92t \x14 \x9e\xd0\xeeA{\x11\x19\xb85I\xd1\ R\xab\xfd\x1c \xe0\x0bU\xcb<'\xe9\xceC\x032\ ~\xaae\x9f\xc3\x8c\x0b\x92\x16/\xf5\xda\xc6\x81U\x8e\ e\xbe\xbb\x15\xddF\x02\xc8\xa6w\xb5n\x04pl+\ \x9a\x90\x9a\xb3\xd9\x01\xfe\xa3\xc1\x1d\x87\x8f\x14z\x7f\xdd\ \x8a.#\x03d\xcf+\xec\xee\x8eN^\x05P\x7f+\ \x1a\x91\x9a\xb...
Python
1
k = input() o = input() merged = [] max_len = max(len(k), len(o)) for i in range(max_len): if i < len(k): merged.append(k[i]) if i < len(o): merged.append(o[i]) output = ''.join(merged) print(output)
Python
1
{ if self.components() != 1 { return Err(EosError::IncompatibleComponents(self.components(), 1)); } let coefficients = self .parameters .diffusion .as_ref() .expect("Missing diffusion coefficients."); let m = (x * &self.paramete...
Rust
0
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmyolo.models.task_modules.coders import YOLOXBBoxCoder class TestYOLOv5Coder(TestCase): def test_decoder(self): coder = YOLOXBBoxCoder() priors = torch.Tensor([[10., 10.], [8., 8.], [15., 8.], [2.,...
Python
1
// debug!("interrupts are disabled, ignoring"); return; } // debug!("Handling interrupts: pending: {:?} / enabled: {:?}", interrupt_flag, interrupt_enable); let should_handle = |f: InterruptFlag| -> bool { interrupt_flag.contains(f) && interrupt_enable.contain...
Rust
0
sert_eq!(v, &[1]); /// ``` // No Copy bounds here because the original StaticVec gives up all access to the values in // question. #[inline] pub fn drain<R: RangeBounds<usize>>(&mut self, range: R) -> Self { // Borrowed this part from normal Vec's implementation. let old_length = self.length; let ...
Rust
0
PARAM_REGISTER_TYPE = 15i32; #[doc = "*Required features: 'Win32_Graphics_Direct3D9'*"] pub const D3DSPR_TEMPFLOAT16: D3DSHADER_PARAM_REGISTER_TYPE = 16i32; #[doc = "*Required features: 'Win32_Graphics_Direct3D9'*"] pub const D3DSPR_MISCTYPE: D3DSHADER_PARAM_REGISTER_TYPE = 17i32; #[doc = "*Required features: 'Win32_Gr...
Rust
0
set.remove(&col); } } let mut mult: i64 = 1; for (field_name, col) in &placed { if field_name.starts_with("departure") { mult *= my_ticket[*col] as i64; } } println!("{}", mult); } <filename>src/proxy/config.rs #[derive(Clone, Debug)] pub struct Config...
Rust
0
def nonewlines(s: str) -> str: return s.replace("\n", " ").replace("\r", " ")
Python
1
ing.DEBUG ): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) except: response_payload = None http_response = { "payload": response_payload, "headers": d...
Python
1
e_count())) model = torch.nn.DataParallel(model) model.eval() dataset = read_dataset(args, args.test_path) src = torch.LongTensor([sample[0] for sample in dataset]) seg = torch.LongTensor([sample[1] for sample in dataset]) mask_pos = [sample[2] for sample in dataset] label = [sample[3...
Python
1