text string | label_name string | labels int64 |
|---|---|---|
impl Logic for OpalKellyFastBlinky {
#[hdl_gen]
fn update(&mut self) {
self.clock_div.clock_p.next = self.clock_p.val();
self.clock_div.clock_n.next = self.clock_n.val();
self.clk_100mhz.next = self.clock_div.sys_clock.val();
self.pulser.clock.next = self.clk_100mhz.val();
... | Rust | 0 |
from pyobjus import autoclass
# First we load NSString into pyobjus
NSString = autoclass('NSString')
# Then we can call some class methods of NSString
text = NSString.stringWithUTF8String_('some string')
# Now we can call instance methods
print text.UTF8String()
# If you want to improve performance of you app, cons... | Python | 1 |
import csv
import glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from tqdm import tqdm
from PIL import Image
from sklearn.utils import shuffle
from multiprocessing import Pool
from openslide import OpenSlide
def get_tissue_mask(slide_path):
'''
slide_path: path for each slide
... | Python | 1 |
fn vpmovb2m_5() {
run_test(
&Instruction {
mnemonic: Mnemonic::VPMOVB2M,
operand1: Some(Direct(K6)),
operand2: Some(Direct(ZMM6)),
operand3: None,
operand4: None,
lock: false,
rounding_mode: None,
merge_mode: No... | Rust | 0 |
#!/usr/bin/env python3
import json
import subprocess
import time
import sys
import os
def test_alert_tools():
"""Test if the alert tools are properly registered"""
# Build the binary
print("Building the project...")
result = subprocess.run(["go", "build", "-o", "last9-mcp-alerts", "."],
... | Python | 1 |
t = int(input())
for _ in range(t):
s = input().strip()
zeros = s.count('0')
ones = s.count('1')
if zeros == 0 or ones == 0:
print(0)
else:
if zeros == ones:
print(zeros - 1)
else:
print(min(zeros, ones)) | Python | 1 |
given as a `/.../` literal in Ruby source code.
///
/// See [`SyntaxError`].
Syntax(SyntaxError),
}
impl From<ArgumentError> for Error {
#[inline]
fn from(err: ArgumentError) -> Self {
Self::Argument(err)
}
}
impl From<RegexpError> for Error {
#[inline]
fn from(err: RegexpErro... | Rust | 0 |
+ self.pos.y,
self.pos.y,
-1.0,
1.0,
);
self.need_update = false;
}
}
/// Set the view zoom.
pub fn set_zoom(&mut self, zoom: f32) {
self.zoom = zoom;
self.need_update = true;
}
/// Multiply the curren... | Rust | 0 |
enum = GLenum(0x8951);
pub const GL_CON_17_ATI: GLenum = GLenum(0x8952);
pub const GL_CON_18_ATI: GLenum = GLenum(0x8953);
pub const GL_CON_19_ATI: GLenum = GLenum(0x8954);
pub const GL_CON_1_ATI: GLenum = GLenum(0x8942);
pub const GL_CON_20_ATI: GLenum = GLenum(0x8955);
pub const GL_CON_21_ATI: GLenum = GLenum(0... | Rust | 0 |
_MODE_A> for u8 {
#[inline(always)]
fn from(variant: DISABLE_SMART_MASTER_STRICT_MODE_A) -> Self {
match variant {
DISABLE_SMART_MASTER_STRICT_MODE_A::TIER_MODE => 1,
DISABLE_SMART_MASTER_STRICT_MODE_A::STRICT_MODE => 2,
}
}
}
#[doc = "Reader of field `DISABLE_SMART_M... | Rust | 0 |
format!("teams/{}", self.team_id)
}
}
/// Team List
///
/// List teams in which you are a member.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list)
///
/// # Example:
///
/// TeamList takes no required parameters and... | Rust | 0 |
port_list = [self.start_port]
else:
port_list = [port for port in range(self.start_port,
self.end_port)]
dict_list = []
for _ in range(len(port_list)):
dict_list.append(dict_values)
with ThreadPoolExecut... | Python | 1 |
speech_lengths: torch.Tensor,
beam_size: int,
decoding_chunk_size: int = -1,
num_decoding_left_chunks: int = -1,
ctc_weight: float = 0,
simulate_streaming: bool = False,
reverse_weight: float = 0) -> Dict[str, List[Decod... | Python | 1 |
ert!(stdout.contains("Content-type: text/html; charset=UTF-8"));
assert!(stdout.contains("\r\n\r\n"));
assert!(stdout.contains("hello"));
assert_eq!(output.get_stderr(), None);
}
use std::env;
use std::process::Command;
pub fn main() {
let root = env::var("CARGO_MANIFEST_DIR").unwrap();
let make ... | Rust | 0 |
:count_digits1478;
use crate::parser::determine;
#[test]
fn test_create_bingo_boards() -> Result<(), String> {
//tag::testdata[]
let vec1 = vec![
"be cfbegad cbdgef fgaecd cgeb fdcge agebfd fecdb fabcd edb | fdgacbe cefdb cefbgd gcbe",
"edbfga begcd cbg gc gcadebf ... | Rust | 0 |
_hash256(&v, dk_len, Some(cust)).to_vec();
self.v.push(TestCase {
fn_name: "tuple256".to_string(),
block_len: None,
data: data.to_vec(),
key: None,
nist_fn: None,
personalization: Some(cust.to_vec()),
exp,
})
}
... | Rust | 0 |
ore rights than others. For example, for listing resources, a *read-only* scope will be
/// sufficient, a read-write scope will do as well.
pub fn add_scope<T, S>(mut self, scope: T) -> BillingAccountLocationRecommenderRecommendationGetCall<'a>
where T: In... | Rust | 0 |
"""Test Lidarr integration."""
from homeassistant.components.lidarr.const import DEFAULT_NAME, DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from .conftest import ComponentSetup
async def test_setu... | Python | 1 |
"]
_Reserved(u8),
}
impl SYSCTL_RSCLKCFG_PLLSRCR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
match *self {
SYSCTL_RSCLKCFG_PLLSRCR::SYSCTL_RSCLKCFG_PLLSRC_PIOSC => 0,
SYSCTL_RSCLKCFG_PLLSRCR::SYSCTL_RSCLKCFG_PLLSRC_MOSC => 3,
... | Rust | 0 |
),
AcaciaSapling(SaplingGrowthStage),
DarkOakSapling(SaplingGrowthStage),
Bedrock,
Water(FluidLevel),
Lava(FluidLevel),
Sand,
RedSand,
Gravel,
GoldOre,
DeepslateGoldOre,
IronOre,
DeepslateIronOre,
CoalOre,
DeepslateCoalOre,
NetherGoldOre,
OakLog(Axis),
... | Rust | 0 |
from unittest import TestCase as StdlibTestCase
from unittest.mock import Mock
from synapse.logging.context import ContextResourceUsage, LoggingContext
from synapse.metrics.background_process_metrics import _BackgroundProcess
class TestBackgroundProcessMetrics(StdlibTestCase):
def test_update_metrics_with_negati... | Python | 1 |
from utils.plot_real17j_scaled import plot_real17j_1f_scaled
import torch
import pickle
sampled_poses = pickle.load(open("res/samples3d.pkl", "rb"))
with torch.no_grad():
plot_real17j_1f_scaled(sampled_poses[0].reshape(1, 51).cpu().numpy(), sampled_poses[0].reshape(51).cpu().numpy())
poses = sampled_poses.cpu().... | Python | 1 |
"""
RF-DETR ComfyUI Nodes
Standalone package for object detection and instance segmentation in ComfyUI workflows.
Detection Nodes (bounding boxes only):
- RFDETRLoader: Load detection models (nano/small/medium/base/large)
- RFDETRDetector: Run object detection on images/video batches
Segmentation Nodes (instance mask... | Python | 1 |
"""Functions for modifying UI colors."""
from src.utils.logging_utils import setup_logger
# from src import ndf
# from src.utils.ndf_utils import is_obj_type
logger = setup_logger(__name__)
def edit_colors(source_path) -> None:
"""Edit Colors.ndf.
Args:
source_path: NDF file containing color def... | Python | 1 |
x;
pub type drm_ctx_res_t = drm_ctx_res;
pub type drm_draw_t = drm_draw;
pub type drm_update_draw_t = drm_update_draw;
pub type drm_auth_t = drm_auth;
pub type drm_irq_busid_t = drm_irq_busid;
pub type drm_vblank_seq_type_t = drm_vblank_seq_type;
pub type drm_agp_buffer_t = drm_agp_buffer;
pub type drm_agp_binding_t = ... | Rust | 0 |
pos,
Stmt::Block(s) => s.pos(),
Stmt::If(s) => s.if_pos,
Stmt::Case(s) => s.case,
Stmt::Switch(s) => s.switch,
Stmt::TypeSwitch(s) => s.switch,
Stmt::Comm(s) => s.case,
Stmt::Select(s) => s.select,
Stmt::For(s) => s.for_pos,... | Rust | 0 |
import argparse
import os
from pathlib import Path
from synthesizer.hparams import hparams
from synthesizer.synthesize import run_synthesis
from utils.argutils import print_args
if __name__ == "__main__":
class MyFormatter(argparse.ArgumentDefaultsHelpFormatter, argparse.RawDescriptionHelpFormatter):
pa... | Python | 1 |
from LaplaceUnigramLanguageModel import LaplaceUnigramLanguageModel
from LaplaceBigramLanguageModel import *
from collections import Counter
import math
class StupidBackoffLanguageModel:
def __init__(self, corpus):
"""Initialize your data structures in the constructor."""
# TODO your code here
unigramM... | Python | 1 |
hash, transaction output index)
/// which were included in this commitment transaction in output order.
/// The transaction index is always populated.
///
/// (C-not exported) as we cannot currently convert Vec references to/from C, though we should
/// expose a less effecient version which creates a Vec of refer... | Rust | 0 |
# pylint: disable-all
# flake8: noqa
from datetime import date, datetime
from typing import Any
from unittest import TestCase
import copy
import numpy as np
import pandas as pd
from fugue.bag import Bag, LocalBag
from fugue.exceptions import FugueDataFrameOperationError, FugueDatasetEmptyError
from pytest import raise... | Python | 1 |
ๅ็ด ๏ผx ไน wz/W๏ผy ไน hz/H
flow[:, 0] *= (w_z / float(W))
flow[:, 1] *= (h_z / float(H))
# 2.2) latent ๅ็ด ไฝ็งป โ grid_sample ้่ฆ็ๅฝไธๅๅๆ ไฝ็งป๏ผalign_corners=True๏ผ
# ฮx_norm = 2*dx/(w_z-1), ฮy_norm = 2*dy/(h_z-1)
# w_z/h_z ๅฏ่ฝไธบ1๏ผๅไธชไฟๆค
wx = max(w_z - 1, 1)
hy = max(h... | Python | 1 |
resolver_fn: impl FnMut(&PackageQuery<'g>, PackageLink<'g>) -> bool,
) -> PackageSet<'g> {
self.resolve_with(ResolverFn(resolver_fn))
}
}
use pyo3::prelude::*;
use datafusion::scalar::ScalarValue as _Scalar;
use crate::to_rust::to_rust_scalar;
/// An expression that can be used on a DataFrame
... | Rust | 0 |
};
let mut def_collector = DefCollector::new(&mut self.definitions);
def_collector.visit_macro_invoc = Some(visit_macro_invoc);
def_collector.with_parent(def_index, |def_collector| {
if const_integer {
if let Expansion::Expr(ref expr) = *expansion {
... | Rust | 0 |
0x85, 0x0f, 0xdb, 0x4d, 0xfa, 0x46, 0x6b, 0x1d}
DEFINE_GUID!{Window_Pattern_GUID,
0x27901735, 0xc760, 0x4994, 0xad, 0x11, 0x59, 0x19, 0xe6, 0x06, 0xb1, 0x10}
DEFINE_GUID!{SelectionItem_Pattern_GUID,
0x9bc64eeb, 0x87c7, 0x4b28, 0x94, 0xbb, 0x4d, 0x9f, 0xa4, 0x37, 0xb6, 0xef}
DEFINE_GUID!{Dock_Pattern_GUID,
... | Rust | 0 |
#!/usr/bin/python3
"""
Write a script that reads stdin line by line and computes metrics:
Input format: <IP Address> - [<date>] "GET /projects/260 HTTP/1.1"
<status code> <file size> (if the formt is not this one,the line mst be skiped)
After every 10 lines and/or a keyboard interruption (CTRL + C), print these
statist... | Python | 1 |
(program_id, accounts, order)?;
}
MangoInstruction::ForceCancelOrders {
limit
} => {
msg!("Mango: ForceCancelOrders");
Self::force_cancel_orders(program_id, accounts, limit)?;
}
MangoInstruction::PartialLiquidate... | Rust | 0 |
module.exit_json(changed=True, msg="Dry Run!")
try:
ovh_billing_status = client.post('/cloud/project/{0}/instance/{1}/activeMonthlyBilling'.format(project_id, instance_id))
module.exit_json(changed=True, ovh_billing_status=ovh_billing_status['monthlyBilling'])
except APIError as apiError:
... | Python | 1 |
from . import image, uncond | Python | 1 |
import sys
inp = sys.stdin.readline
# n๊ฐ์ ๋ผ๋ฉด ๊ณต์ฅ
# ๊ฐ ๊ณต์ฅ์ 1๋ฒ ~ n๋ฒ
# i๋ฒ ๊ณต์ฅ์์ ์ ํํ ai๊ฐ ๋ผ๋ฉด ๊ตฌ๋งค ํ์
# ์๋ ์ธ๊ฐ์ง ๋ฐฉ๋ฒ์ผ๋ก ๋ผ๋ฉด ๊ตฌ๋งค
# 1. i๋ฒ ๊ณต์ฅ์์ ๋ผ๋ฉด ํ๋ ๊ตฌ๋งค(3์)
# 2. i, i+1 ๊ณต์ฅ์์ ๋ผ๋ฉด ํ๋์ฉ ๊ตฌ๋งค(5์)
# 3. i, i+1, i+2 ๊ณต์ฅ์์ ๋ผ๋ฉด ํ๋์ฉ ๊ตฌ๋งค(7์)
# ์ต์ ๋น์ฉ์ผ๋ก ๋ผ๋ฉด ๊ตฌ๋งค -> ํ์ํ ๊ธ์ก์?
# ๊ณ์ 3๊ฐ๋ฅผ ๋ณด๋ฉด์ 1๋ณด๋ค ํฌ๋ฉด ๊ทธ๋ ๊ฒ ๊ตฌ๋งคํ๊ณ ์๋๋ฉด ๋ค๋ฅด๊ฒ ํ๋ฉด ์๋๋?
# 3๊ฐ ์ฒ๋ฆฌ๊ฐ ๊ฐ๋ฅํ๋ฐ ์ค๊ฐ์ด 0์ธ ๊ฒฝ์ฐ๋?
# 2 3 2 2
# 0... | Python | 1 |
from airflow import DAG
from operators.common_pipeline import CommonDag
def _transfer(**kwargs):
import pandas as pd
from sqlalchemy import create_engine
from utils.extract_stage import NewTaipeiAPIClient
from utils.load_stage import (
save_dataframe_to_postgresql,
update_lasttime_in_d... | Python | 1 |
import os
from openai import OpenAI
import json
from dotenv import load_dotenv
# ลadowanie zmiennych ลrodowiskowych z pliku .env
load_dotenv()
# Inicjalizacja klienta OpenAI
client = OpenAI(api_key=os.getenv('OPENAI_API_KEY'))
def transcribe_audio(file_path):
with open(file_path, "rb") as audio_file:
tra... | Python | 1 |
(i, BerTag::Enumerated)
}
/// Read a UTF-8 string value. The encoding is checked.
#[inline]
pub fn parse_ber_utf8string(i: &[u8]) -> BerResult {
parse_ber_with_tag(i, BerTag::Utf8String)
}
/// Read a relative object identifier value
#[inline]
pub fn parse_ber_relative_oid(i: &[u8]) -> BerResult {
parse_ber_wi... | Rust | 0 |
),
)
CloseMessageWindow()
ChrTalk(
0x00FE,
(
'ไธค็ป้ฝ่ฆๅ ๆฒนๅ๏ฝ๏ผ',
TxtCtl.Enter,
),
)
CloseMessageWindow()
TalkEnd(0x00FE)
Return()
# id: 0x000C offset: 0x24A
@scena.Code('func_0C_24A')
def func_0C_24A():
TalkBegin(0x00FE)
ChrTalk(
... | Python | 1 |
Green, new_stop_loss = current_price - trailing_stop_pips
new_stop_loss = order[13] - trailing_stop_pips
# Test to see if new_stop_loss > current_stop_loss
if new_stop_loss > order[11]:
print("Update Stop Loss")
# Create updated values for order
order_number =... | Python | 1 |
("Cidr1")
self._Cidr2 = params.get("Cidr2")
self._DeviceId1 = params.get("DeviceId1")
self._DeviceId2 = params.get("DeviceId2")
self._Description = params.get("Description")
memeber_set = set(params.keys())
for name, value in vars(self).items():
property_name ... | Python | 1 |
return;
}
_ => match self.control_chan.try_recv() {
Ok(signal) => {
self.handle_control_signal(signal);
}
Err(TryRecvError::Empty) => {}
Err(TryRecvError::Disconnected) => panic!... | Rust | 0 |
ressing modes
EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI,
}
impl fmt::Display for AMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let s = match self {
AMode::BXSI => "bx+si",
AMode::BXDI => "bx+di",
AMode::BPSI => "bp+si",
AMode::BPDI => "bp+di... | Rust | 0 |
"NUOpC.CL",
"NUOpD.CL",
"NZHpA.CL",
"NZHpC.CL",
"CRRS",
"FIEU",
"SDOpC.CL",
"DOOR",
"SSLT",
"AAMC",
"FCY.CL",
"NZHpB.CL",
"SPDC",
"CCUrw",
"OCIR",
"CCUr",
"INFrw",
"LDOSw",
"QUMU",
"SAICw",
"KYNpG",
"SPCB",
"BCSr",
"BNFT",
"FPRX",
"VLRS",
"DVHI",
"PPSI",
"XLRN"... | Rust | 0 |
import os
import sys
import pickle
import argparse
from sklearn.manifold import TSNE
from tsne_hack import extract_sequence
from visualize import savegif
def main(args):
data_path = './data/%s.pkl' % args.dataset
with open(data_path, 'rb') as f:
X, labels = pickle.load(f)
tsne = TSNE(n_iter=arg... | Python | 1 |
.map(|component| event_param_type_signature(&component))
.collect::<Vec<_>>()
.join(",")
)
}
/// Returns the signature of an event parameter type (e.g. `uint256`).
fn event_param_type_signature(kind: &ParamType) -> String {
use ParamType::*;
match kind {
Address => "address... | Rust | 0 |
.
*/
fn main() {
//
let mut s1 = String::from("hello");
let len = calculate_length(&s1);
println!("The length of '{}' is {}.", s1, len);
//
change(&mut s1);
//
let reference_to_nothing = no_dangle();
}
fn calculate_length(s: &String) -> usize {
s.len()
}
fn change (s: &mut Str... | Rust | 0 |
rint(" ๆฅ็ TROUBLESHOOTING.md ๆไปถ")
def main():
"""ไธปๅฝๆฐ"""
print("๐ฏ HTML2PPT ๅฟซ้ๅผๅง")
print("=" * 50)
# ๆฃๆต็ฏๅข
env_info = detect_environment()
print_environment_info(env_info)
# ๆจ่ๅฎ่ฃ
ๆนๅผ
method, message = recommend_installation(env_info)
if method == "error":
print(... | Python | 1 |
:Less
}
}
unsafe impl Kind for Max {
fn ordering() -> Ordering {
Ordering::Greater
}
}
}
<filename>src/lib.rs
/*!
This crate provides left-padding for strings (including both `&str` and `String`).
Import with `extern crate left_pad;`.
Usage example:
```
use left_pad::{leftpad, leftpad_with};
a... | Rust | 0 |
#!/usr/bin/env python
# coding: utf-8
from django.core.management.base import BaseCommand, CommandError
from kobo.apps.kobo_auth.shortcuts import User
from kobo.apps.openrosa.apps.logger.models import XForm
from kobo.apps.openrosa.libs.utils.logger_tools import mongo_sync_status
class Command(BaseCommand):
args ... | Python | 1 |
},
Node::UnaryNode { ref layer, .. } => {
assert_eq!( inputs.len(), 1 );
predict_unary_layer( ctx, layer.clone(), &inputs[0] )?
},
Node::BinaryNode { ref layer, .. } => {
assert_eq!( inputs.len(), 2 );
predict_bin... | Rust | 0 |
manager.mountpoint = ''
assert self.volume_manager.sync_data() is None
mock_mounted.assert_not_called()
def test_create_verity_layer(self):
with raises(NotImplementedError):
self.volume_manager.create_verity_layer()
def test_create_verification_metadata(self):
with ... | Python | 1 |
t_day = True
prod, masks, channels = get_products_netcdf4(day_id, hhmmss[time_bin], products, path,
target_vars, crop, preprocess, ct_1hot)
sequence.append(prod)
seq_info['day_in_year'].append(day_id)
seq_info['time_b... | Python | 1 |
import jax
import jax.numpy as jnp
from jax.experimental.sparse import BCOO
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import spsolve as spsolve_scipy
def spsolve_cpu(A, b):
"""
A wrapper around scipy sparse linear solver that acts as a JAX pure callback.
For BCOO matrices, we convert to... | Python | 1 |
from flask import Blueprint
flare_blueprint = Blueprint('flare_bp', __name__)
| Python | 1 |
println!("ressp={:?}", res);
}
}
}
#[tokio::test]
async fn test_call_fn() -> Result<(), Box<dyn Error>> {
let client = init_client().await?;
let response = client.call_fn("test", &(("aa", "aa"), 1)).await?;
println!("response2: {:?}", response);
let s: (Vec<String>, Vec<u64>) = ... | Rust | 0 |
import pytest
from src.pages.models import Page
from src.pages.enums import PageType
pytestmark = pytest.mark.django_db
def test_retrieve_public_page__existent__ok(api_client):
# arrange
page = Page.objects.create(
title='Test title',
description='Test desc',
slug=PageType.SIGNIN
... | Python | 1 |
())
}
}
#[doc = "`0`"]
#[inline(always)]
pub fn rssi_ctrl_bypass_agc_default(self) -> &'a mut W {
self.variant(RSSI_CTRL_BYPASS_AGC_A::RSSI_CTRL_BYPASS_AGC_DEFAULT)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(tru... | Rust | 0 |
#!env python
#coding=utf-8
#
# Author: liaoxinxi@
#
# Created Time: Fri 05 Dec 2014 10:01:32 AM GMT-8
#
# FileName: testrequest.py
#
# Description:
#
# ChangeLog:
import os
def loginCheckDownExcel(request):
from common.generateExcel import generateExcel
filename=r"ExcelTemplate_down.xlsx"
... | Python | 1 |
# Copyright (c) 2017 Mark D. Hill and David A. Wood
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditio... | Python | 1 |
scanners.iter().enumerate() {
for (j, scanner2) in merged_scanners.iter().enumerate() {
if j >= i {
// man distance the same both ways
continue;
}
let loc1 = scanner1.location.unwrap();
let loc2 = scanner2.location.unwrap();
... | Rust | 0 |
],
# comments and literals
'whitespace': [
(r'(\n\s*)(#.*)$', bygroups(Whitespace, Comment.Preproc)),
(r'\s+', Whitespace),
(r'/\*', Comment.Multiline, 'comment'),
(r'//.*$', Comment.Single)
],
'comment': [
(r'[^/*]+', Comment... | Python | 1 |
, input_right.execute(state))
};
let df_left = df_left?;
let df_right = df_right?;
let left_names = self
.left_on
.iter()
.map(|e| e.evaluate(&df_left, state).map(|s| s.name().to_string()))
.collect::<Result<Vec<_>>>()?;
let righ... | Rust | 0 |
CustomSession._config = config
CustomSession._gameType = self._selectedGameType
startGame(CustomSession)
else:
bs.containerWidget(edit=uiGlobals["mainMenuWindow"], transition='outRight')
uiGlobals["mainMenuWindow"] = SelectGameWindow(transition="inLeft").getRootW... | Python | 1 |
_381 = PC<Bls12_381, UniPoly_381>;
type PC_Bls12_377 = PC<Bls12_377, UniPoly_377>;
fn rand_poly<E: PairingEngine>(
degree: usize,
_: Option<usize>,
rng: &mut rand::prelude::StdRng,
) -> DensePoly<E::Fr> {
DensePoly::<E::Fr>::rand(degree, rng)
}
fn constant_poly<E: P... | Rust | 0 |
tion Source.
pub mod transaction_source;
/// Merkle Trie implementation.
pub mod trie;
/// Merkle Trie storage.
pub mod trie_store;
const MAX_DBS: u32 = 2;
#[cfg(test)]
pub(crate) const DEFAULT_TEST_MAX_DB_SIZE: usize = 52_428_800; // 50 MiB
#[cfg(test)]
pub(crate) const DEFAULT_TEST_MAX_READERS: u32 = 512;
#[macro_... | Rust | 0 |
t socket_color = style.socket_color(&ui.theme);
let socket_triangles = |socket_type, n_sockets, layout| {
socket_rectangles(n_sockets, layout)
.enumerate()
.flat_map(move |(i, rect)| {
let (tri_a, tri_b) = widget::primitive::shape::rectangle::trian... | Rust | 0 |
anced(
glow::TRIANGLE_STRIP,
0,
4,
amount as i32,
);
}
i += MAX_INSTANCES;
}
unsafe {
gl.bind_vertex_array(None);
gl.use_program(None);
gl.disable... | Rust | 0 |
aTurn {
// Starting width
pub width_start: ProtocolLinearDimension,
// Starting radius
pub radius_start: ProtocolLinearDimension,
// Ending width
pub width_end: ProtocolLinearDimension,
// Ending radius
pub radius_end: ProtocolLinearDimension,
// Section turning angle (always positiv... | Rust | 0 |
# Python bytecode 2.7 (decompiled from Python 2.7)
# Embedded file name: scripts/common/queues/LimitedThroughputQueue.py
import BigWorld
class LimitedThroughputQueue:
def __init__(self, actionsPerSecond, maxActionsPerBatch=1):
self.__queue = []
self.__actionsPerSecond = actionsPerSecond
se... | Python | 1 |
from .gtts_tts import gTTS
from .google_texttospeech_tts import Google_TextToSpeech
from .openai_gpt_tts import OpenAIGPT
from .openai_tts1_tts import OpenAITTS1
class TextToSpeechFactory:
tts_engines_mapping = {
"gtts": gTTS,
"google_texttospeech": Google_TextToSpeech,
"openai_gpt": OpenAI... | Python | 1 |
# ===== ๊ฐ์ ๋ B-RAG ํ๋กฌํํธ ํ
์คํธ ์
=====
# ๋
ธํธ๋ถ์์ ์ด ์ฝ๋๋ฅผ ๋ณต์ฌํ์ฌ ์ ์
์ ๋ถ์ฌ๋ฃ๊ณ ์คํํ์ธ์
import sys
import os
from pathlib import Path
# ๊ฒฝ๋ก ์ค์
if '/Users/minu/dev/Liberty/Liberty_ai' not in sys.path:
sys.path.append('/Users/minu/dev/Liberty/Liberty_ai')
# ํ๊ฒฝ๋ณ์ ์ค์ (ํ์์)
os.environ['PYTHONPATH'] = '/Users/minu/dev/Liberty/Liberty_ai... | Python | 1 |
set(xx, y, bit as i32);
}
y += direction;
}
direction = -direction; // Reverse the direction.
y += direction;
x -= 2; // Move to the left.
}
// All bits should be consumed.
if bit_index != data_bits.get_size() {
... | Rust | 0 |
display.update()
clock.tick(30)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
if input_text.strip():
... | Python | 1 |
#[macro_use]
extern crate log;
#[macro_use]
extern crate engine;
// TODO(cristicbz): This is only needed because of the lack of `macro_reexport`.
#[macro_use]
extern crate glium;
extern crate idcontain;
extern crate time;
extern crate vec_map;
extern crate math;
extern crate wad;
mod errors;
mod game;
mod game_sha... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2025 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 |
arget=serve_thread_tcp, args=('', 3141, HTTP_Proxy,)))
if settings.Config.SMB_On_Off:
if settings.Config.LM_On_Off:
from servers.SMB import SMB1LM
threads.append(Thread(target=serve_thread_tcp, args=('', 445, SMB1LM,)))
threads.append(Thread(target=serve_thread_tcp, args=('', 139, SMB1LM,)))
else:
... | Python | 1 |
Ok(vec![0x00, 0x00, 0x10, 0x00]));
//! ```
//!
//! ```
//! # #[macro_use] extern crate strict_encoding_derive;
//! use strict_encoding::StrictEncode;
//!
//! #[derive(StrictEncode, StrictDecode)]
//! #[strict_encoding(by_order, repr = u16)]
//! #[repr(u8)]
//! enum U16 {
//! Bit8 = 1, // this will be encoded as 0x... | Rust | 0 |
grad_mask_com = grad_output[n, :, h, w].view(feature_H_, feature_W_)
else: # dis
c = h * feature_W_ + w
grad_mask_com = grad_output[n, c, :, :].view(feature_H_, feature_W_)
grad_mask_ori = torch.zeros(mask_H_, mask_W_, dt... | Python | 1 |
import streamlit as st
import requests
from PIL import Image
import io
API_URL = "https://api-inference.huggingface.co/models/ZB-Tech/Text-to-Image"
headers = {"Authorization": "Bearer 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"}
# variables
progress_text = "Operation in progress. Please wait. _may take up to a minute_"... | Python | 1 |
, ty, body)
}
}
App(ref f, ref arg) => {
if f.is_lam() || f.is_pi() {
try!(write!(fmt, "("))
} else {
try!(Ok(()))
}
try!(write!(fmt, "{:?}", f));
if f.is_lam() || f.is_pi() {
try!(write!(fmt, ")"))
} else {
try!... | Rust | 0 |
client.resolve(&service).await?,
};
Ok(uid)
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum Identifier<R: Identity> {
Uid(R::Uid),
Account(R::AccountId),
Service(Service),
}
impl<R: Identity> core::fmt::Display for Identifier<R> {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Res... | Rust | 0 |
# Copyright 2025 Intel Corporation
#
# 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 agreed to in wri... | Python | 1 |
fn compare_and_swap(&self, before: usize, after: usize) {
compare_and_swap(&self.cur, before, after);
compare_and_swap(&self.cur_safe, before, after);
}
fn increment<F: Fn() -> bool, G: Fn()>(&self, target: usize, wait_fn: F, advance_fn: G) {
// Check using `cur_safe`, to ensure we... | Rust | 0 |
() {
let data = vec![1, 2, 3, 4];
let data1 = &data;
// ๅผ็ๅฐๅๆฏไปไน๏ผๅผ็จ็ๅฐๅๅๆฏไปไน๏ผ
println!(
"addr of value: {:p}({:p}), addr of data {:p}, data1: {:p}",
&data, data1, &&data, &data1
);
println!("sum of data1: {}", sum(data1));
// ๅ ไธๆฐๆฎ็ๅฐๅๆฏไปไน๏ผ
println!(
"addr of items: [{... | Rust | 0 |
#!/usr/bin/env python
# BRICKPI LEGO EV3 ULTRASONIC SENSOR EXAMPLE.
############################################
#
#
# This example will show you how to use the LEGO EV3 Ultrasonic sensor with the BrickPi.
# Note you must have the latest firmware installed on the BrickPi or this example to work.
# Connect the EV3 ... | Python | 1 |
scanner_subscription(
ctx: &mut Context,
buf: &mut BytesMut,
req: &CancelScannerSubscription,
) -> Result<DispatchId, EncodeError> {
// no response
const VERSION: i32 = 1;
buf.push_int(CANCEL_SCANNER_SUBSCRIPTION);
buf.push_int(VERSION);
buf.push_int(req.req_id);
Ok(DispatchId::One... | Rust | 0 |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
n1 = []
n2 = []
while l1:
... | Python | 1 |
}
else if (params.name < 90000) {
name='80K-90K'
}
else if (params.name < 100000) {
... | Python | 1 |
usize = 104;
pub const SALT_LENGTH : usize = 64;
pub const EDHOC_MAC :usize = 64;
pub const HASHFUNC_OUTPUT_LEN_BITS: usize = 256;
pub const CONNECTION_IDENTIFIER_LENGTH: usize = 8;
/// EDHOC `message_1`.
#[derive(Debug, PartialEq)]
pub struct Message1 {
pub method: u8,
pub suite: u8,
pub pub_ek_i: Vec<... | Rust | 0 |
/// desired target velocities
target_velocities: &'a [f64],
/// position gains
position_gains: &'a [f64],
/// velocity gains
velocity_gains: &'a [f64],
},
/// Velocity control with the desired joint velocities
Velocities(&'a [f64]),
/// Torque control with the... | Rust | 0 |
t: str) -> Dict:
# """Enhanced resume parser with accurate experience calculation"""
# parser = AccurateResumeParser()
# return parser.parse_resume_accurate(resume_text)
# # Example usage
# if __name__ == "__main__":
# sample_resume = """
# John Doe
# Senior Software Engineer
# WORK EX... | Python | 1 |
i32,
pub flags: u32,
}
#[test]
fn bindgen_test_layout_AndroidBitmapInfo() {
assert_eq!(
::std::mem::size_of::<AndroidBitmapInfo>(),
20usize,
concat!("Size of: ", stringify!(AndroidBitmapInfo))
);
assert_eq!(
::std::mem::align_of::<AndroidBitmapInfo>(),
4usize,
... | Rust | 0 |
rap_or(1);
Ok(Box::new(tractops::nn::Conv::new(
DataFormat::NCHW,
KernelFormat::OIHW,
dilations(node)?,
kernel_shape,
pad(node)?,
strides(node)?,
group as usize,
)))
}
pub fn average_pool(node: &NodeProto) -> TractResult<Box<Op>> {
let kernel_shape: T... | Rust | 0 |
stem_Wmi'*"]
pub const MI_ERRORCATEGORY_INVALID_ARGUMENT: MI_ErrorCategory = 5i32;
#[doc = "*Required features: 'Win32_System_Wmi'*"]
pub const MI_ERRORCATEGORY_INVALID_DATA: MI_ErrorCategory = 6i32;
#[doc = "*Required features: 'Win32_System_Wmi'*"]
pub const MI_ERRORCATEGORY_INVALID_OPERATION: MI_ErrorCategory = 7i32... | Rust | 0 |
to()
};
query.insert("name".into(), name.into());
let uri = make_uri(
client.get_portal_url(),
endpoint_path,
opt.api_key,
None,
query,
);
let mut req = req.uri(uri);
if let Some(custom_user_agent) = opt.custom_user_agent {
req = req.header("Us... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.