text string | label_name string | labels int64 |
|---|---|---|
INSERT INTO opening_results
(record_id, skin_name, rarity, wear, is_rare)
VALUES (?, ?, ?, ?, ?)
''', (record_id, skin_name, rarity, wear, is_rare))
# 更新用户统计
self._update_user_stati... | Python | 1 |
# -*- coding: utf-8 -*-
# Copyright 2024 Spanish National Research Council (CSIC)
#
# 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
#
# Unle... | Python | 1 |
nmore_specifics: {}",
self.match_type,
pfx_str,
pfx_meta_str,
if let Some(ls) = self.less_specifics.as_ref() {
format!("{}", ls)
} else {
"".to_string()
},
if let Some(ms) = self.more_specifics.as_ref() {... | Rust | 0 |
(*(*l_cstr_index).tile_index.offset(it_tile as isize)).nb_tps =
(*(*(*p_j2k).cstr_index).tile_index.offset(it_tile as isize)).nb_tps;
let ref mut fresh36 = (*(*l_cstr_index).tile_index.offset(it_tile as isize)).tp_index;
*fresh36 = opj_malloc(
((*(*l_cstr_index).tile_index.offset(it_tile ... | Rust | 0 |
CARD = """
QFrame {
background-color: white;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
QFrame#MainCard:hover{
background-color: #f0f0f0;
border: 1px solid black;
}
"""
| Python | 1 |
from a register,
# then converts it to an int
def mem_read(self, mem_loc):
raw = self.mem_read_raw(mem_loc)
no_hex_prefix = raw[2:]
val = int(no_hex_prefix, 16)
return val
def tape_write_raw(self, tape_loc, val):
print("Writing to tape: " + val)
if self.v... | Python | 1 |
, getpwnam_r, gid_t, uid_t};
use crate::{errno_result, Result};
/// Safe wrapper for getting a uid from a user name with `getpwnam_r(3)`.
#[inline(always)]
pub fn get_user_id(user_name: &CStr) -> Result<uid_t> {
// libc::passwd is a C struct and can be safely initialized with zeroed memory.
let mut passwd: li... | Rust | 0 |
= config()
.uri("127.0.0.1:7687")
.user("my")
.password("<PASSWORD>")
.db("neo4j")
.fetch_size(500)
.max_connections(10)
.build()
.map_err(|e| eyre!("Fail to create custom configuration: {:#?}", e))?;
let graph = Graph::connect(config.clone())
... | Rust | 0 |
node_types.get(node_type, 0) + 1
edge_types = {}
for _, _, attr in graph.graph.edges(data=True):
edge_type = attr.get('type', 'UNKNOWN')
edge_types[edge_type] = edge_types.get(edge_type, 0) + 1
print("\n그래프 통계:")
p... | Python | 1 |
= self.latents.repeat(x.size(0), 1, 1)
x = self.proj_in(x)
if self.to_latents_from_mean_pooled_seq:
meanpooled_seq = masked_mean(x, dim=1, mask=torch.ones(x.shape[:2], device=x.device, dtype=torch.bool))
meanpooled_latents = self.to_latents_from_mean_pooled_seq(meanpooled_seq)... | Python | 1 |
ngle]
pub unsafe extern "C" fn lua_pushline(data: &mut &mut LuaCallbackType, queue: i32, a: *const ShaderPaintPoint, b: *const ShaderPaintPoint) {
let points = get_queue_or_raise_err(*data, queue);
glpoint::push_line(points, &*a, &*b);
}
#[no_mangle]
#[cfg(target_os = "android")]
pub unsafe extern "C" fn lua_l... | Rust | 0 |
g::new(config, scale_factor),
disabled: vec![],
window_has_focus: false,
modifiers: ModifiersState::empty(),
char_focus: false,
sel_focus: None,
nav_focus: None,
nav_fallback: None,
hover: None,
hover_icon: Curso... | Rust | 0 |
pp[1] = result.x[1]
pp[3] = result.x[2]
pp[4] = result.x[3]
pp[5] = result.x[4]
pp[6] = result.x[5]
chi2_new , _ , _, _, _, _ = self.chi2_calc(pp)
if result.success or chi2_new < chi2[iE,iN]:
params[0] = result.x[0]
params[1] = result.x[1]
params[3] = result.x[2]
params[4] ... | Python | 1 |
image(self, frame, vis_root=None):
if isinstance(frame, list):
frame_id = frame
elif "-" in frame:
start = int(frame.split("-")[0])
end = int(frame.split("-")[1])
frame_id = [i for i in range(start, end+1)]
else:
frame_id = [int(frame)]... | Python | 1 |
'''
Bài 11: Viết trò chơi bao - đá - kéo với luật chơi: bao thắng đá, đá thắng kéo, kéo
thắng bao. Người dùng nhập vào một trong ba ký tự b (bao), d (đá), k (kéo); máy
tính sinh ngẫu nhiên một trong ba ký tự trên, thông báo kết quả chơi.
'''
#Khởi tạo thư viện random
import random
ky_tu = input('Nhập kí tự (b - d - k),... | Python | 1 |
from fastapi.testclient import TestClient
def test_read_salaries(client: TestClient):
# Зарегистрируем и авторизуем пользователя
client.post(
"/users", json={"email": "testuser@example.com", "password": "password"}
)
response = client.post(
"/tokens", json={"email": "testuser@example.c... | Python | 1 |
Default::default()
}
pub fn with_pre_state_hash(mut self, pre_state_hash: &[u8]) -> Self {
self.pre_state_hash = pre_state_hash.to_vec();
self
}
pub fn with_current_protocol_version(mut self, protocol_version: ProtocolVersion) -> Self {
self.current_protocol_version = protoco... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class ItemPropertyInfo(object):
def __init__(self):
self._property_key = None
self._property_value_list = None
@property
def property_key(self):
return self._property_k... | Python | 1 |
# Copyright (c) 2023 PaddlePaddle Authors. 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 appli... | Python | 1 |
from lib.helper.ssti.languages import python
class Mako(python.Python):
def init(self):
self.update_actions({
'render' : {
'render': '${%(code)s}',
'header': '${%(header)s}',
'trailer': '${%(trailer)s}'
},
})
se... | Python | 1 |
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
# 1. 数据预处理
grid_x, grid_y = 4, 50
seq_len = 50
file_path = './RP_power_data.csv'
data = pd.read_csv(file_path, header=None)
x_coords... | Python | 1 |
}
first = false;
write!(f, "({}, {:?})", String::from_utf8_lossy(k), v)?;
}
write!(f, "])")
}
}
impl<'m, 'a> IntoStreamer<'a> for &'m PositiveBlob {
type Item = (&'a [u8], &'a [DocIndex]);
/// The type of the stream to be constructed.
type Into = Posi... | Rust | 0 |
rite(source, id, sync)
def read(self, destination: dict[str, torch.Tensor], sync: bool) -> tuple[int, float, dict[str, torch.Tensor]]:
"""Read the data and the timestamp. NOTE destination tensor is modified in place"""
id, destination = super().read(destination, sync)
return id, self.get_ti... | Python | 1 |
end: ImutExprRaw<'script>,
pub(crate) end_upper: Location,
}
impl<'script> Upable<'script> for SegmentRangeRaw<'script> {
type Target = Segment<'script>;
fn up<'registry>(self, helper: &mut Helper<'script, 'registry>) -> Result<Self::Target> {
let SegmentRangeRaw {
start_lower,
... | Rust | 0 |
"AGOL",
"IVO",
"NZFpC",
"OFED",
"XSELD",
"DCIX",
"IDTw",
"AIG.WS",
"OXLC",
"HFBL",
"IFMI",
"IMOSD",
"BSJC",
"BSJD",
"BSJE",
"BSJF",
"EMGX",
"EMVX",
"FPOpA",
"TBET",
"ANCB",
"C.WS.A",
"C.WS.B",
"ESTE",
"NLSN",
"BGX",
"HDGE",
"TRNM",
"XHE",
"XTL",
"XTN",
"AG... | Rust | 0 |
_DISTORTION_MAX_EDGE: f64 = 1.0;
pub const AL_DISTORTION_DEFAULT_EDGE: f64 = 0.2;
pub const AL_DISTORTION_MIN_GAIN: f64 = 0.01;
pub const AL_DISTORTION_MAX_GAIN: f64 = 1.0;
pub const AL_DISTORTION_DEFAULT_GAIN: f64 = 0.05;
pub const AL_DISTORTION_MIN_LOWPASS_CUTOFF: f64 = 80.0;
pub const AL_DISTORTION_MAX_LOWPASS_CUTOF... | Rust | 0 |
# -*- coding:utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.constants as sconst
import torch
import imageio.v2 as imageio
# x,y,z coordinates of 16 antennas, customized for your own antenna array
ANT_LOC = [[-0.24, -0.24, 0], [-0.08, -0.24, 0], [0.08, -0.24, 0], [0.24, -0... | Python | 1 |
le, contains (width, height, index)
img_height = properties[1]
idx = properties[2]
if self.ds_width and properties[3] is not None:
wh_ratio = properties[3]
img_width = img_height * (
1 if int(round(wh_ratio)) == 0 else int(round(wh_ratio))
)
... | Python | 1 |
h performance and accuracy
- Well-documented codebase
- Easy to use and extend
### Usage
Please refer to the original repository for detailed usage instructions and implementation details.
### Repository
This model is part of the Paper-Replications project available on GitHub.
"""
# Create filename
filen... | Python | 1 |
class DriverInfo:
"""
No-op informative class containing Amazon Redshift Python driver specifications.
"""
@staticmethod
def version() -> str:
"""
The version of redshift_connector
Returns
-------
The redshift_connector package version: str
"""
... | Python | 1 |
# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time : 2023/9/28
# @Author : fanke.chang
# @File : logging_config.py
# @Desc :
import logging
import os.path
import sys
__dir__ = os.path.dirname(os.path.abspath(__file__))
class SpecificWarningFilter(logging.Filter):
def filter(self, record):
... | Python | 1 |
Contents);
}
extern "C" {
pub fn vkCmdEndRenderPass(commandBuffer: VkCommandBuffer);
}
extern "C" {
pub fn vkCmdExecuteCommands(
commandBuffer: VkCommandBuffer,
commandBufferCount: u32,
pCommandBuffers: *const VkCommandBuffer,
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ... | Rust | 0 |
# Dictionary with words and hints for Hangman to be imported
words = [
{"word": "spring", "hint": "season (6 Letters)"},
{"word": "summer", "hint": "season (6 Letters)"},
{"word": "autumn", "hint": "season (6 Letters)"},
{"word": "winter", "hint": "season (6 Letters)"},
{"word": "strawberry", "hin... | Python | 1 |
# coding=utf-8
import requests
from core import printmodels
r = '\033[31m'
g = '\033[32m'
y = '\033[33m'
b = '\033[34m'
m = '\033[35m'
c = '\033[36m'
w = '\033[37m'
Headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0'}
Jce_Deface_image = 'files/pwn.gif'
ShellPresta = 'f... | Python | 1 |
from django.contrib import admin
from django.urls import path, include,re_path
from django.views.generic.base import RedirectView
from bot_connection.webhook import webhook
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('webhook/', webhook, name='webhook'),
pat... | Python | 1 |
>= cur_depth {
f(&mut v.depth);
}
1
}
Node::Function { variable: _, body } => for_each_unbound_req(body, cur_depth + 1, f) + 1,
Node::Apply { left, right } =>
for_each_unbound_req(left, cur_depth, f) + for_each_unbound_req(right, cur_depth, f)... | Rust | 0 |
PoliciesPerRoleQuota",
SummaryKeyType::AttachedPoliciesPerUserQuota => "AttachedPoliciesPerUserQuota",
SummaryKeyType::GlobalEndpointTokenVersion => "GlobalEndpointTokenVersion",
SummaryKeyType::GroupPolicySizeQuota => "GroupPolicySizeQuota",
SummaryKeyType::Groups => "Gr... | Rust | 0 |
64) ;4], n_derivatives: usize) -> Vec<[(f64, f64) ;4]> {
let mut w = vec![control_points];
let mut tmp :[(f64, f64) ;4] = Default::default();
let n = w.len();
for i in 0..n_derivatives-1 {
for j in 0..n-1 {
tmp[j].0 = ((n - 1) as f64) * (w[i][j + 1].0 - w[i][j].0);
tmp[... | Rust | 0 |
= len(closed_prs) - merged_count
# Calculate velocity ratio
open_count = len(open_prs)
total_closed = len(closed_prs)
return {
"open_prs": open_count,
"closed_prs": total_closed,
"merged_prs": merged_count,
"closed_without_merge": closed_without_merge,
... | Python | 1 |
import os
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.translation import gettext as _
from dropbox import Dropbox
from dropbox.sharing import RequestedVisibility, SharedLinkSettings
from corehq.apps.celery import task
from corehq.apps.dropbox.utils import up... | Python | 1 |
_Devices_Bluetooth'*"]
pub const AdvancedAudioDistributionServiceClassID_UUID16: u32 = 4365u32;
#[doc = "*Required features: 'Win32_Devices_Bluetooth'*"]
pub const AudioSinkServiceClassID_UUID16: u32 = 4363u32;
#[doc = "*Required features: 'Win32_Devices_Bluetooth'*"]
pub const AudioSinkSourceServiceClassID_UUID16: u32... | Rust | 0 |
t ok:
break
items.append(point[1])
point = point[0], point[1]+1
values = []
for i in items:
values.append(self.contents[i])
return values
def do_show(self, *args):
selection = self.getselection()
for resid in selection:
... | Python | 1 |
wrap().to_owned();
p.push_str(suffix);
PathBuf::from(p)
}
fn numbered_backup_path(path: &PathBuf) -> PathBuf {
let mut i: u64 = 1;
loop {
let new_path = simple_backup_path(path, &format!(".~{}~", i));
if !new_path.exists() {
return new_path;
}
i += 1;
}
}... | Rust | 0 |
{
calcSum(&mut r, &mut i, &mut sum, &init_r, init_i);
calcSum(&mut r, &mut i, &mut sum, &init_r, init_i);
clrPixels_nle(&sum, 4.0, &mut pix8);
}
return pix8;
}
fn calc_init_r_pair(x: f64, wid_ht: f64) -> __m128d {
mm::sub_pd(
mm::mul_pd(
// NB: mm::set_pd() reve... | Rust | 0 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... | Rust | 0 |
from db import db_client
from models.property import Property
import os
import json
# rag_system
from llm_generation.rag_utils import RAGSystem
# text_generator
from llm_generation.llm_generate import TextGenerator
# services_system_prompts
from services.services_system_prompts import SEARCH_SYSTEM_PROMPT
def sear... | Python | 1 |
import time #sleep을 위해 필요
from datetime import datetime #엑셀파일 저장시 시간기록
from selenium.webdriver import ChromeOptions #크롬 옵션
from selenium import webdriver #웹 열기
from selenium.webdriver.common.by import By # 객체 찾기
from selenium.webdriver.common.keys import Keys # 객체에 입력
from selenium.webdriver.chrome.service import Servi... | Python | 1 |
0x74, 0x61, 0x74, 0x22, 0x3A, 0x31, 0x2C, 0x22, 0x6D, 0x6F, 0x64, 0x75, 0x22,
0x3A, 0x22, 0x4C, 0x4F, 0x52, 0x41, 0x22, 0x2C, 0x22, 0x64, 0x61, 0x74, 0x72, 0x22, 0x3A,
0x22, 0x53, 0x46, 0x38, 0x42, 0x57, 0x35, 0x30, 0x30, 0x22, 0x2C, 0x22, 0x63, 0x6F, 0x64,
0x72, 0x22, 0x3A, 0x22, 0x34, 0x2F, 0... | Rust | 0 |
file = std::fs::File::open(path)?;
file.read_to_end(&mut buffer)?;
let mut flash_buf = [0xFF_u8; 256 * 1024];
let flash_end;
if buffer.len() > flash_buf.len() {
error!("File size too large!");
return Err(Error::FileSizeTooLarge);
}
flash_end = buffer.len();
flash_buf[0..fl... | Rust | 0 |
rt.block_on(iface.apply(cur_iface))?
} else {
// TODO: Create new interface
return Err(NisporError::invalid_argument(format!(
"Interface {} not found!",
iface.name
)));
... | Rust | 0 |
import re
class URLNotFoundException(Exception):
"""Exception raised when no URL is found in the string."""
pass
def find_urls_in_string(text: str) -> list[str]:
"""
Finds all URLs within a given string and returns them as a list.
This function uses a regular expression to identify URLs within... | Python | 1 |
import pytest
from playwright.sync_api import sync_playwright
""" This test file was generated using Playwright's codegen tool, which records browser
interactions and outputs test code. The generated logic was then adapted and
copied into this pytest-bassed test suite for consistency with our existing test framework... | Python | 1 |
ildren[3].width, 40.0);
assert_eq!(layout.children[3].height, 40.0);
assert_eq!(layout.children[3].x, 40.0);
assert_eq!(layout.children[3].y, 40.0);
assert_eq!(layout.children[4].width, 40.0);
assert_eq!(layout.children[4].height, 40.0);
assert_eq!(layout.children[4].x, ... | Rust | 0 |
"""
Rotated Geometry
================
Rotation of a block model geometry is a common operation in geoscience applications.
By rotating the geometry, we can align it with geological features.
Rotation is typically specified in degrees from the cardinal orthonormal axes (x, y, z).
"""
import pyvista as pv
from parq_bl... | Python | 1 |
on::{ChannelResponse, Response};
let response = poll_fn(|cx| conn.poll_recv(cx, transport.as_mut())).await?;
match response {
Response::Channel(id, ChannelResponse::OpenConfirmation) => {
tracing::debug!("open confirmation");
debug_assert_eq!(id, channel);
... | Rust | 0 |
rc<PackageRequest>>>()
.into_iter()
}
}
*/
// Copyright takubokudori.
// This source code is licensed under the MIT or Apache-2.0 license.
use crate::*;
use winapi::{shared::minwindef::FILETIME, um::minwinbase::SYSTEMTIME};
make_struct! {FILETIME,
#[derive(Default, Clone, Eq, PartialEq)]
pub struct Fil... | Rust | 0 |
ce "Adds spaces to the map"))
(@subcommand play =>
(about: "Plays the game (CTRL-c to exit)")
(@setting ColoredHelp)
(@arg FILE: * "File containing the map")
(@arg TICK_MS: {is_number} "Elapsed time between iterations in ms")
)
)
.get_matches();
... | Rust | 0 |
slice(&mut col[from..to]),
AnyColumnBuffer::Timestamp(col) => Self::fill_default_slice(&mut col[from..to]),
AnyColumnBuffer::F64(col) => Self::fill_default_slice(&mut col[from..to]),
AnyColumnBuffer::F32(col) => Self::fill_default_slice(&mut col[from..to]),
AnyColumnBuffe... | Rust | 0 |
# encoding=utf-8
# Author: GC Zhu
# Email: zhugc2016@gmail.com
import logging
import threading
class Log:
instance = None
_lock = threading.Lock()
@classmethod
def init(cls, log_file_path):
cls.instance = cls()
cls.instance.logger = cls._create_logger(log_file_path)
@staticmetho... | Python | 1 |
entity.borrow();
Ok(entity.size.height)
});
methods.add_method("location", |lua, entity, ()| {
let entity = entity.try_unwrap()?;
let location = lua.create_table()?;
{
let entity = entity.borrow();
location.set("x", entity.... | Rust | 0 |
= RestApiBuilder::new()
.with_bind(bind)
.add_resources(resources.clone())
.build_insecure()
.expect("Failed to build REST API")
.run_insecure();
match result {
Ok((shutdown_handle, join_handle)) => {
let port = shutdown_ha... | Rust | 0 |
xec_env = os.environ.copy()
exec_env["JAVA_HOME"] = compss_cfg.get_java_home()
exec_env["COMPSS_HOME"] = compss_cfg.get_compss_home()
print(f"[INFO] cmd: {cmd}")
p = subprocess.Popen(cmd, cwd=source_path, env=exec_env)
p.communicate()
exit_value = p.returncode
# ... | Python | 1 |
= 37,
RD_KAFKA_RESP_ERR_INVALID_REPLICATION_FACTOR = 38,
RD_KAFKA_RESP_ERR_INVALID_REPLICA_ASSIGNMENT = 39,
RD_KAFKA_RESP_ERR_INVALID_CONFIG = 40,
RD_KAFKA_RESP_ERR_NOT_CONTROLLER = 41,
RD_KAFKA_RESP_ERR_INVALID_REQUEST = 42,
RD_KAFKA_RESP_ERR_UNSUPPORTED_FOR_MESSAGE_FORMAT = 43,
RD_KAFKA_R... | Rust | 0 |
"upstreamInvoiceUrl": "https://img2.baidu.com/it/u=3734104099,2265105642&fm=253&fmt=auto&app=138&f=JPEG?w=708&h=500"
}
dt_list.append(dt_item)
data = {
"adminAreaCode": "江苏省;南京市;玄武区",
"businessDepartment": "销售支持部",
"b... | Python | 1 |
allet_name":"test_clear_config",
"institution_name" : "evernym enterprise",
"genesis_path":"/tmp/pool1.txn",
"wallet_key":"key"
}).to_string();
assert_eq!(process_config_string(&content), Ok(error::SUCCESS.code_num));
assert_eq!(get_config_value("pool_name")... | Rust | 0 |
}
#[doc = "Reader of field `TOKENENDPT`"]
pub type TOKENENDPT_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `TOKENENDPT`"]
pub struct TOKENENDPT_W<'a> {
w: &'a mut W,
}
impl<'a> TOKENENDPT_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'... | Rust | 0 |
elf):
return self._IsExpired
@IsExpired.setter
def IsExpired(self, IsExpired):
self._IsExpired = IsExpired
@property
def PermissionList(self):
return self._PermissionList
@PermissionList.setter
def PermissionList(self, PermissionList):
self._PermissionList = Pe... | Python | 1 |
"""
Velocity field about a Double point
Reproduce Figure 32.3 from [1]
Reference:
[1] Branlard (2017) Wind turbine aerodynamics and vorticity-based methods, Springer.
"""
import numpy as np
import matplotlib.pyplot as plt
from welib.tools.curves import streamQuiver
from welib.vortilib.elements.DoubletPoint imp... | Python | 1 |
import requests
import re
import streamlit as st
hf_token = st.session_state.get("hf_token", "") # replace with your HuggingFace API key
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1/v1/chat/completions"
headers = {"Authorization": f"Bearer {hf_token}"}
def query(payload... | Python | 1 |
kAllocationCallbacks>)
-> VdResult<SamplerYcbcrConversionKhrHandle> {
let allocator = allocator.unwrap_or(ptr::null());
let mut handle = 0;
let result = self.proc_addr_loader().vk.vkCreateSamplerYcbcrConversionKhr(
self.handle().to_raw(), create_info.as_raw(), allocator, ... | Rust | 0 |
n compute_gravity(ticks_in_max_jump: u8, max_jump_height_in_wc: u8) -> f32 {
// Derived using math from a GDC talk (for smooth parabolic jump):
// GDC link: https://www.gdcvault.com/play/1023559/Math-for-Game-Programmers-Building
// Video: https://www.youtube.com/watch?v=hG9SzQxaCm8
... | Rust | 0 |
def _pack_data (self):
cap = 0
en = 0
for i in range(0, 16):
if self.caps[i]: cap |= (1 << i)
if self.enabled_caps[i]: en |= (1 << i)
return struct.pack('!HH', cap, en)
def __str__ (self):
r = []
for i in range(0, 16):
if self.caps[i]:
if i < len(self.cap_names):
... | Python | 1 |
rglitch-realops/tools/session_alx_trading.json"
try:
# สร้างโฟลเดอร์ถ้ายังไม่มี
os.makedirs(os.path.dirname(output_file), exist_ok=True)
# บันทึกไฟล์หลัก
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(session_data, f, indent=2, ensure_ascii=False)
... | Python | 1 |
('parametriFit.csv', index=True)
x = ['20-25', '25-30', '30-35', '35-40', '40-45', '45-50', '50-55', '55-60', '60-65', '65-70', '70-75']
plt.errorbar(x, w, yerr= wErr)
plt.show()
'''
parametri, cov = optimize.curve_fit(funzione, vEff2, mediaArr2, p0=[pstart], sigma = mediaErr2)
errParametri = np.sqrt(np.diag(cov))
... | Python | 1 |
hashmap! {*ui_target => overlay_state})
+ match overlay_state {
OverlayState::Active => {
acc_overlay_state_map
.iter()
.filter_map(|(ui_target, overlay_state)| match overlay_state {
... | Rust | 0 |
ref(&self) -> &Self::Target {
unsafe { &self.ptr.as_ref().data }
}
}
impl<T> Copy for Gc<T> where T: Traceable + 'static + ?Sized {}
impl<T> Clone for Gc<T>
where
T: Traceable + 'static + ?Sized,
{
fn clone(&self) -> Self {
*self
}
}
pub(crate) struct GcInner {
head: PtrTraceable,
... | Rust | 0 |
to be specified in `get_renewer()`.
#[cfg(feature = "renewer-dlink")] mod dlink;
#[cfg(feature = "renewer-fritzbox-local")] mod fritzbox_local;
#[cfg(feature = "renewer-fritzbox")] mod fritzbox;
mod dummy;
pub trait Renewer {
fn from_config(renewer: &config::RenewerConfig) -> Result<Self>
where Self: Size... | Rust | 0 |
# this program creates a recipt based on user input
# Get item name from user
# get quantity from user
# get price from user
# do those steps 3 times
# calculate the subtotal
item_1 = input("Please Insert item name here: ")
quant_1 = int(input(f"Please enter the quantity of {item_1}: "))
price_1 = float(input(f"Please ... | Python | 1 |
# -*-coding:utf-8-*-
import os
import django
import operator
from user.models import *
from math import sqrt, pow
os.environ["DJANGO_SETTINGS_MODULE"] = "book.settings"
django.setup()
class UserCf:
# 基于用户协同算法来获取推荐列表
"""
利用用户的群体行为来计算用户的相关性。
计算用户相关性的时候我们就是通过对比他们对相同物品打分的相关度来计算的
举例:
--------+--... | Python | 1 |
ager():
slave_ips = ['192.168.1.101', '192.168.1.102', '192.168.1.103']
master_ip = '192.168.1.100'
master_port = 5000
result_port = 5001
torch_port = 5002
task_manager = TaskManager(slave_ips, master_ip, master_port, result_port, torch_port)
task = Task(duration = 2,
arr... | Python | 1 |
STARTED: AtomicUsize = ATOMIC_USIZE_INIT;
let _ = env_logger::init();
::std::thread::spawn(|| {
run_server(
"0.0.0.0:14005".parse().unwrap(),
0,
1,
None,
None,
2,
&STARTED,
... | Rust | 0 |
ok_or_else(err_pop)?;
let lhs = self.yy_node_stack.pop().ok_or_else(err_pop)?;
self.yy_node_stack.push(AstNode::Ge(Box::new(lhs), Box::new(rhs)));
Ok(())
}
///
fn action_comparison_gt(&mut self) -> Result<()> {
trace_action!(self, "comparison_greater_than");
let rhs = self.yy_node_stack.pop()... | Rust | 0 |
::splat(-25675); // -25675 == round(-(255.0 / 224.0) * 1.772 * (0.114 / 0.587) * 65536.0)
let cb2b = cb * i32x4::splat(132201); // 132201 == round((255.0 / 224.0) * 1.772 * 65536.0)
// This is 0.5 in 16.16 format, added to make the rightshift round correctly
let half = i32x4::splat(32768);
// We could... | Rust | 0 |
mages/favicon-192x192-full.png',
'properties': properties,
'actions': actions
#'extensions':{'extension1':'','extension2':''}
}
def _control_process_propertites(self, device_properties, action) -> None:
return {}
def _query_process_propertites(self, device_... | Python | 1 |
seconds=native_adapter_config.heartbeat_interval_seconds,
task_timeout_seconds=native_adapter_config.task_timeout_seconds,
death_timeout_seconds=native_adapter_config.death_timeout_seconds,
garbage_collect_interval_seconds=native_adapter_config.garbage_collect_interval_seconds,
trim_memo... | Python | 1 |
lor of a region in
a 2D etc.. This indo is in attributes attched to the main data array we found in Step 0.
It has 2 attributes: UNITS and LONG NAME for labeling the data when plotted.
3. The root has lots of attributes. It has stuff about time:
ITER = iterati... | Python | 1 |
let (_, pos) = gen(sr, &mut buffer[..]).unwrap();
//println!("result:\n{}", str::from_utf8(buf).unwrap());
pos as usize
};
println!("wrote {} bytes", index);
b.bytes = index as u64;
b.iter(|| {
let sr = fn_request(&request);
let... | Rust | 0 |
extent in &self.extents {
let extent_len = extent.0.end - extent.0.start;
if offset < file_offset + extent_len {
let device_offset = extent.0.start + offset - file_offset;
let to_read = min(extent.0.end - device_offset, (len - buf_offset) as u64) as usize;
... | Rust | 0 |
ndungan linguistik', 'mt': 'Bla kontenut lingwistiku', 'my': 'ဘာသာစကားနှင့် ပတ်သက်သောအရာ မရှိပါ', 'mzn': 'این زوون بشناسی\u200cیه نیّه', 'nb': 'uten språklig innhold', 'ne': 'भाषिक सामग्री छैन', 'nl': 'geen linguïstische inhoud', 'nn': 'utan språkleg innhald', 'no': 'uten språklig innhold', 'nqo': 'ߞߊ߲߫ ߘߐߞߏߟߏ߲', 'or':... | Python | 1 |
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
import torchvision.models as models
model_urls = {
'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac9.pth',
'vgg16': 'https://download.pytorch.org/models/vgg16-397923af.pth',
'vgg19': 'https://download.pytorch.org/models/vgg19-dcbb9e... | Python | 1 |
write_maybe_json!(
f,
json_printer,
"Number of blocks written (metadata) : {}",
meta_blocks_written
)?;
write_maybe_json!(
f,
json_printer,
"Number of blocks written (data)... | Rust | 0 |
legajos = []
nombres = ["Juan", "Laura", "Pedro", "Sofía", "Diego", "María", "Carlos", "Ana", "Luisa", "Javier", "Elena", "Pablo", "Isabel", "Andrés", "Lucía","Alejandro", "Carmen", "Daniel", "Patricia", "Raúl", "Natalia", "Roberto", "Clara", "Jorge", "Victoria", "Francisco", "Eva", "Gabriel", "Miguel", "Rosa"]
apel... | Python | 1 |
from llmebench.datasets import ANSFactualityDataset
from llmebench.models import FastChatModel
from llmebench.tasks import FactualityTask
def metadata():
return {
"author": "Mohamed Bayan Kmainasi, Rakif Khan, Ali Ezzat Shahroor, Boushra Bendou, Maram Hasanain, and Firoj Alam",
"affiliation": "Ara... | Python | 1 |
ock.show_gnome_notification.assert_called_once_with(
title="Port forwarding",
description=f"Active port is {active_port}"
)
# And we expect a notification when the port changes.
pfwidget.on_new_state(_make_state(active_port=5678))
notifications_mock.show_gnome_n... | Python | 1 |
import json
def getAppSecret(key):
with open('appSecrets.json', 'r') as f:
config = json.load(f)
secrets = config
return secrets[key] | Python | 1 |
import json
import random
import numpy as np
data = []
# 生成主要区域数据 (信号强度以dBm为单位)
interval = 5 # 控制点的间隔
offset_rand = 3
for x in np.arange(5, 95, interval): # 在X轴均匀取点
for y in np.arange(5, 95, interval): # 在Y轴均匀取点
# 检查是否在左下角弱信号区域
if x < (10 + random.uniform(-5, 5)) and y < (10 + random.uniform(-... | Python | 1 |
.10.1")]
mod cache_image_config {
use super::*;
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct CacheImageConfig {
pub generate_image: bool,
pub save_resize_status: bool,
pub entry_ageout: i32,
}
impl Default for CacheImageConfig {
fn default() -> Self {
... | Rust | 0 |
_bindgen_ty_7 = 268435520;
pub const KEYC_MOUSEDRAG3_STATUS_DEFAULT: _bindgen_ty_7 = 268435521;
pub const KEYC_MOUSEDRAG3_BORDER: _bindgen_ty_7 = 268435522;
pub const KEYC_MOUSEDRAGEND1_PANE: _bindgen_ty_7 = 268435523;
pub const KEYC_MOUSEDRAGEND1_STATUS: _bindgen_ty_7 = 268435524;
pub const KEYC_MOUSEDRAGEND1_STATUS_... | Rust | 0 |
match op_code.encoding() {
EncodingKind::Legacy | EncodingKind::D3NOW => continue,
EncodingKind::VEX | EncodingKind::EVEX | EncodingKind::XOP => {}
}
let mut uses_rm = false;
let mut uses_reg = false;
let mut other_rm = false;
let mut other_reg = false;
for &op_kind in op_code.op_kinds() {
mat... | Rust | 0 |
("0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"),
],
x_den: vec![
f.from("0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b"),
f.from("0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14"),
f.one(),
f.z... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.