text string | label_name string | labels int64 |
|---|---|---|
ring_cstr((*font_ptr).m_psName);
}
#[no_mangle]
pub unsafe extern "C" fn XeTeXFontMgr_weightAndWidthDiff(
mut self_0: *const XeTeXFontMgr,
mut a: *const XeTeXFontMgrFont,
mut b: *const XeTeXFontMgrFont,
) -> libc::c_int {
if (*a).weight as libc::c_int == 0i32 && (*a).width as libc::c_int == 0i32 {
... | Rust | 0 |
on,
LogicalType::Enum,
LogicalType::Uint8,
LogicalType::Uint16,
LogicalType::Uint32,
LogicalType::Uint64,
LogicalType::Interval,
];
check_sort_order(unsigned, SortOrder::Unsigned);
// Signed comparison (physical type does not matter)
let signed = vec![
LogicalType::Int8,
LogicalType::In... | Rust | 0 |
import json
import jinja2
from basic import client, read_resource
from basic.util import wait_task, trace
class Doc:
def __init__(self, index):
self.index = index
self.doc_template = jinja2.Template(read_resource("doc.json"))
@trace
def count(self):
res = client.http.get(f"/{self.... | Python | 1 |
a), res);
let a = vec![1, 2, 1, -8, 8, -4, 4, -4, 2, -2];
let res = true;
assert_eq!(Solution::can_reorder_doubled(a), res);
}
<filename>src/slash/argument/autocomplete/into_stream_hack.rs
#[doc(hidden)]
pub struct IntoStreamWrap<'a, T>(pub &'a T);
#[doc(hidden)]
pub trait ConvertStreamFrom<T> {
type O... | Rust | 0 |
mory['node2'],sim_global_DA)
# graph_1=self.pivotalconstruct(x[:,:self.out_steps,::][..., : 1].transpose(1,-1),node_graph,self.top_k)
# graph_2=self.pivotalconstruct(x[:,self.out_steps:self.out_steps*2,::][..., : 1].transpose(1,-1),node_graph,self.top_k)
# graph_3=self.pivotalc... | Python | 1 |
ain.rs<gh_stars>1-10
#![allow(dead_code)]
#![allow(unused)]
extern crate num_traits;
extern crate rand;
extern crate sdl2;
extern crate serde_json;
#[macro_use]
extern crate num_derive;
#[macro_use]
mod utility;
#[macro_use]
mod render;
mod background;
mod block;
mod controller;
mod editor;
mod enemy;
mod entity;
mod... | Rust | 0 |
### LISTS ###
# Lists are another kind of data type in python. Lists are represented using square brackets
# Lists can store different kinds of data in them Eg : Integers, Floats, Strings, Tuples, Dictionaries, Boolean and Lists itself
# Lists declared within a list are called as nested list
# Lists have the property o... | Python | 1 |
..Default::default()
})
.unwrap();
}
#[test]
fn test_parse_error_expected_array() {
test_format(FormatTest {
input: r##"{
property: {]
}
"##,
error: Some(r#"Parse error: 2:16: Invalid Array token found while parsing an Object of 0 properties (mismatched braces?):
property: {]
... | Rust | 0 |
>,
constraints: Vec<(
LinearCombination<Scalar>,
LinearCombination<Scalar>,
LinearCombination<Scalar>,
String,
)>,
inputs: Vec<(Scalar, String)>,
aux: Vec<(Scalar, String)>,
}
#[derive(Clone, Copy)]
struct OrderedVariable(Variable);
impl Eq for OrderedVariable {}
impl P... | Rust | 0 |
import pytest
from datasets import DatasetDict # type: ignore
from artifex.models.base_model import BaseModel
from artifex.core import ValidationError
@pytest.mark.unit
@pytest.mark.parametrize(
"dataset",
[ ("dataset",) ] # wrong type, should be a datasets.DatasetDict
)
def test_tokenize_dataset_validation... | Python | 1 |
\xf6\xd9g\xb1{\xf7\xeeF\xdb\xe2\xe3\xe3\
1v\xecX\x12+\x89@\xdf>A\xb8\xf1\xd7\xbf\xfe\
\x15\x1f\x7f\xfc1\x00\x12+)C\xcey\x82\xf8?6\
m\xda\x84\xb9s\xe7\xba\x86\x81c\xc6\x8c\x81J\xa5\x12\
\xdb,\x82\x05z\x84\x10\x04\x00\xbb\xdd\x8e\xa4\xa4$\x94\
\x95\x95A\xa1P\x88m\x0e\xe1\x03\xeaq\x11\x04\x11r\
P\xa0\x09A\x10!\xc7\xff\x07... | Python | 1 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Load Simulation Data
simulation_data = pd.read_csv("results.csv")
time = simulation_data["time(s)"]
photon_avg = simulation_data["avg_photon_density"]
axion_avg = simulation_data["avg_axion_density"]
neutrino_avg = simulation_data["avg_neutrino_... | Python | 1 |
DMod> str::FromStr for DynGf<M> {
type Err = <u32 as str::FromStr>::Err;
fn from_str(s: &str) -> Result<Self, Self::Err> { u32::from_str(s).map(Self::new) }
}
impl<M: DMod> ZeroOne for DynGf<M> {
fn zero() -> Self { Self::from_raw(0) }
fn one() -> Self { 1.into() }
}
<filename>src/pools/pool_internal/i... | Rust | 0 |
-> HwResult<&[u8]> {
preceded(tag(" "), take_while(|c| c == b' '))(input)
}
fn opt_space_arg<'a>(input: &'a [u8]) -> HwResult<'a, Option<String>> {
alt((
map(peek(end_of_message), |_| None),
map(preceded(spaces, a_line), Some),
))(input)
}
fn hedgehog_array(input: &[u8]) -> HwResult<[Hedg... | Rust | 0 |
, 0xD7, 0x00, 0xFF],
"goldenrod" => [0xDA, 0xA5, 0x20, 0xFF],
"gray" => [0x80, 0x80, 0x80, 0xFF],
"green" => [0x00, 0x80, 0x00, 0xFF],
"greenyellow" => [0xAD, 0xFF, 0x2F, 0xFF],
"honeydew" => [0xF0, 0xFF, 0xF0, 0xFF],
"hotpink" => [0xFF, 0x69, 0xB4, 0xFF],
"indian... | Rust | 0 |
Literal::Float(i as f64 * j),
}
},
NumericLiteral::Float(i) => {
match other {
NumericLiteral::Integer(j) => NumericLiteral::Float(i * j as f64),
NumericLiteral::Float(j) => NumericLiteral::Float(i * j),
... | Rust | 0 |
size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN"]
#[doc = " - if an error occurred: ZSTD_CONTENTSIZE_ERROR"]
#[doc = ""]
#[doc = " note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode."]
#[doc = " When `return==ZSTD_CONTENTSIZ... | Rust | 0 |
import json
import numpy as np
import matplotlib.pyplot as plt
def plot_runtime_only(json_file):
with open(json_file, 'r') as file:
data = json.load(file)
print("Data loaded from JSON file:")
print(data) # debug print
all_runtime_trends = []
max_generations = 0
overall_runtime = 0
... | Python | 1 |
ystemAccountProviderWithAuthorityAsync(&self, webAccountProviderId: HSTRING, authority: HSTRING, out: *mut *mut foundation::IAsyncOperation<super::super::super::credentials::WebAccountProvider>) -> HRESULT,
#[cfg(feature="windows-system")] fn FindSystemAccountProviderWithAuthorityForUserAsync(&self, webAccountProvi... | Rust | 0 |
nto its corresponding SystemFunctions class.
"""
os_class = {
OS.LINUX: OsFunctionsLinux(),
OS.MACOS: OsFunctionsMacOs(),
OS.WINDOWS: OsFunctionsWindows(),
}.get(os, None)
if not os_class:
raise SystemError("Could not determine Operating System")
return os_class
def... | Python | 1 |
# -*- coding: utf-8 -*-
#
# Random/__init__.py : PyCrypto random number generation
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worl... | Python | 1 |
"""
Helpers for various likelihood-based losses. These are ported from the original
Ho et al. diffusion models codebase:
https://github.com/hojonathanho/diffusion/blob/1e0dceb3b3495bbe19116a5e1b3596cd0706c543/diffusion_tf/utils.py
"""
import numpy as np
import torch as th
def normal_kl(mean1, logvar1, mean2, logvar... | Python | 1 |
, D, E, R, FN: Fn(&A, &B, &C, &D, &E) -> R> IsLambda5<A, B, C, D, E, R> for Lambda<FN> {
fn apply(&self, a: &A, b: &B, c: &C, d: &D, e: &E) -> R {
(self.apply)(a, b, c, d, e)
}
fn deps(&self) -> Vec<Dep> {
self.deps.clone()
}
}
impl<A, B, C, D, E, F, R, FN: Fn(&A, &B, &C, &D, &E, &F) ->... | Rust | 0 |
::Keyframe {
frame_info: keyframe,
},
tag: None,
})
}
pub fn start_epoch(epoch_id: u64) {
report_keyframe("start_epoch".to_string(), Keyframe::NewEpoch { epoch_id });
}
pub fn start_round(round_id: u64, epoch_id: u64) {
report_keyframe(
"start_round".to_string(),
... | Rust | 0 |
str().unwrap()));
config.src_base = PathBuf::from(path.to_string());
}
flags.push("-Zmir-emit-validate=1".to_owned());
config.target_rustcflags = Some(flags.join(" "));
config.target = target.to_owned();
compiletest::run_tests(&config);
}
fn run_pass(path: &str) {
eprintln!("## Running ... | Rust | 0 |
ithm, Algorithm::SHA1);
assert_eq!(value.value, "d6a770ba38583ed4bb4525bd96e50461655d2759");
}
#[test]
fn document_comment_can_be_parsed() {
let (_, value) = tag_value_to_atom("DocumentComment: <text>Sample Comment</text>").unwrap();
assert_eq!(value, Atom::DocumentComment("Sample C... | Rust | 0 |
"Female" }
},
];
// add the owners
let ids: Vec<ID> = owners_service.insert_many(owners, None).unwrap();
println!("{:?}", ids);
let pets = vec![
{
doc! { "name": "Fido", "pet_type": "Dog", "age": 10, "gender": "Male", "owner": &ids[0].to_bson() }
},
{
... | Rust | 0 |
#!/usr/bin/env python3
'''
@author: David Shaw, shawd@vmware.com
Inspired by EAS Inspector for Fiddler
https://easinspectorforfiddler.codeplex.com
----- The MIT License (MIT) -----
Filename: ASWBXMLByteQueue.py
Copyright (c) 2014, David P. Shaw
Permission is hereby granted, free of charge, to any person obtaining a ... | Python | 1 |
gas_schedule::GasAlgebra;
use move_vm_runtime::native_functions::NativeContext;
use move_vm_types::{
gas_schedule::NativeCostIndex,
loaded_data::runtime_types::Type,
natives::function::{native_gas, NativeResult},
pop_arg,
values::{Value, Vector, VectorRef},
};
use smallvec::smallvec;
use std::colle... | Rust | 0 |
len {
let (lower_index, middle_index, upper_index) = if i == coords_len - 2 {
// i = N-2
(coords_len - 2, coords_len - 1, 0)
} else if i == coords_len - 1 {
// i = N-1
(coords_len - 1, 0, 1)
} else {
// i... | Rust | 0 |
input.height() == height {
return input.convert::<PO, CO>();
}
A::scale(&input.into(), width, height)
}
/// Scale by the given factor.
#[inline]
pub fn by<'i, A, I, PI, CI, PO, CO>(input: I, factor: f32) -> Buffer<PO, CO, Vec<CO>>
where
A: Scaler<PI, CI, PO, CO>,
PO: From<PI>,
PO: pixel::Write<CO>,
CO: pixel:... | Rust | 0 |
npl_sem, timeout: ble_npl_time_t) -> ble_npl_error_t {
ble_npl_error_BLE_NPL_ENOENT
}
#[no_mangle]
extern "C" fn ble_npl_sem_release(sem: *mut ble_npl_sem) -> ble_npl_error_t {
ble_npl_error_BLE_NPL_ENOENT
}
#[no_mangle]
extern "C" fn ble_npl_sem_get_count(sem: *mut ble_npl_sem) -> u16 {
0
}
// Callouts
... | Rust | 0 |
表示', 0x00000016, (0x11, 0x0, 0x0), (0xFF, 0x1, 0x0))
ExecExpressionWithReg(
0x00,
(
(Expr.TestScenaFlags, ScenaFlag(0x0440, 4, 0x2204)),
Expr.Nop,
Expr.Return,
),
)
MenuCmd(0x08, 0x01, 'マップジャンプのキャンセル禁止', 0x00000017, (0x11, 0x0, 0x0), (0xFF, 0x1, ... | Python | 1 |
# -*- coding: utf-8 -*-
"""Atividade_1
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1tStkc6XQyhJflLn1fkv-beEBI_7OPebp
"""
# Objetivo:
# - Ler arquivo no formato "FASTA" com várias sequências de DNA
# - realizar cálculos com informações da sequências... | Python | 1 |
File::create(path)?;
let mut wtr = BufWriter::new(wtr);
qoi_write_from_buffer(&mut wtr, desc, buf, channels)?;
wtr.flush()?;
Ok(())
}
/// Writes QOI format (with header) to [`Write`]. Pixels are obtained from [`IntoIterator`].
///
/// Encodes exactly `desc.pixel_count()` pixels.
///
/// # Errors
///... | Rust | 0 |
import streamlit as st
import pandas as pd
import json
import networkx as nx
import plotly.graph_objects as go
import plotly.express as px
from rdflib import Graph
import numpy as np
from collections import defaultdict, Counter
import os
from sklearn.preprocessing import StandardScaler
from sklearn.metrics.pairwise imp... | Python | 1 |
from_position(position);
world.insert((), vec![(transform_component, light_component)]);
}
fn add_point_light(
_resources: &mut Resources,
world: &mut World,
position: glam::Vec3,
light_component: PointLightComponent,
) {
let transform_component = TransformComponent::from_position(position);
... | Rust | 0 |
import re
from urllib.parse import urlparse
tag_regex = re.compile(r"汉化|漢化|粵化|DL版|修正|中国|翻訳|翻译|翻譯|中文|後編|前編|カラー化|個人|" +
r"無修|重修|重嵌|机翻|機翻|整合|黑字|Chinese|Japanese|\[Digital]|vol|\[\d+]")
def set_author_ahead(title: str) -> str:
author_ = re.findall(r"\[.*?]", title)
if bool(re.search(r"[((... | Python | 1 |
Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Hash, MzReflect)]
pub enum VariadicFunc {
Coalesce,
Greatest,
Least,
Concat,
MakeTimestamp,
PadLeading,
Substr,
Replace,
JsonbBuildArray,
JsonbBuildObject,
ArrayCreate {
// We need to know the element type to type ... | Rust | 0 |
}
let end_pos = execute(&mut segments);
println!("Program END at {}: {:?}", end_pos, segments);
}
fn execute(segments: &mut Vec<i32>) -> usize {
let mut idx: usize = 0;
loop {
let instr: Instruction = segments[idx].into();
match instr.opcode {
Opcode::Add => op_add(segments... | Rust | 0 |
_type = "BigInt"]
pub per_order_total_fees_in_cents: i64,
#[sql_type = "BigInt"]
pub user_count: i64,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq, Queryable, QueryableByName)]
pub struct TicketSalesPerEventFees {
#[sql_type = "Nullable<dUuid>"]
pub organization_id: Option<Uu... | Rust | 0 |
"""
This file trains and saves the sklearn linear model to the model stash directory for the core to test against
"""
from tests.model_builder.utils import install_package
install_package("skl2onnx==1.16.0")
install_package("scikit-learn==1.4.0")
import os
import onnx
from surrealml.model_templates.sklearn.sklearn_li... | Python | 1 |
# Instructions
# Use the Airflow context in the pythonoperator to complete the TODOs below. Once you are done, run your DAG and check the logs to see the context in use.
import datetime
import logging
from airflow import DAG
from airflow.models import Variable
from airflow.operators.python_operator import PythonOpera... | Python | 1 |
,
VideoFormat::Gbr10le => ffi::GST_VIDEO_FORMAT_GBR_10LE,
VideoFormat::Nv16 => ffi::GST_VIDEO_FORMAT_NV16,
VideoFormat::Nv24 => ffi::GST_VIDEO_FORMAT_NV24,
VideoFormat::Nv1264z32 => ffi::GST_VIDEO_FORMAT_NV12_64Z32,
VideoFormat::A42010be => ffi::GST_VIDEO_FORM... | Rust | 0 |
_count);
// Like JS with objects we can use spread-lie "update" syntax to build
// new instances of a struct from a current struct's values.
let user_three = User {
email: String::from("<EMAIL>"),
..user_one
};
println!("User Active - {}", user_three.active);
println!("User Na... | Rust | 0 |
# coding=utf-8
"""
Example: Using enhanced JQL search methods in Jira Cloud.
This script demonstrates:
1. Fetching issues using `enhanced_jql` (nextPageToken-based pagination).
2. Getting an approximate issue count with `approximate_issue_count`.
3. Fetching issues using `enhanced_jql_get_list_of_tickets` (legacy star... | Python | 1 |
import discord
from discord.ext import commands
from typing import Final
NO_AVATAR_MESSAGE: Final[str] = "ユーザーはアイコンを設定していません。"
ERROR_MESSAGE: Final[str] = "アバターの取得中にエラーが発生しました: {}"
EMBED_COLOR: Final[int] = discord.Color.blue().value
class Avatar(commands.Cog):
"""ユーザーのアバター(アイコン)を表示する機能"""
def __init__(sel... | Python | 1 |
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS... | Python | 1 |
iAcy` + "," + `(orgAcy - fiAcy)` + '\n')
# Initialize the number of threads and injections
# numThreads = 5
# numInjections = 100
# Now start performing fault injections, and collect statistics
# myStats = []
# for i in range(numThreads):
# myStats.append( ti.FIStat("Perceptron") )
... | Python | 1 |
:Error>> {
/// let leaves = [
/// Sha256::hash("a".as_bytes()),
/// Sha256::hash("b".as_bytes()),
/// Sha256::hash("c".as_bytes()),
/// ];
///
/// let merkle_tree = MerkleTree::<Sha256>::from_leaves(&leaves);
/// # Ok(())
/// # }
pub fn from_leaves(leaves: &[T::Hash])... | Rust | 0 |
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': '... | Python | 1 |
(2))
@singlechoice("unit_promote_unique_equip1_level", "专武1等级", 0, lambda : db.unit_unique_equip_level_candidate(1))
@singlechoice("unit_promote_equip_5", "右下装备星级", -1, [-1,0,1,2,3,4,5])
@singlechoice("unit_promote_equip_4", "左下装备星级", -1, [-1,0,1,2,3,4,5])
@singlechoice("unit_promote_equip_3", "右中装备星级", -1, [-1,0,1,2,3... | Python | 1 |
#!/usr/bin/python
###############
# shmTest.py
#
# Copyright David Baddeley, 2012
# d.baddeley@auckland.ac.nz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | Python | 1 |
<'a> fmt::Display for UpstreamDescriptor<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}://{}", &self.scheme, &self.host)?;
if self.port() != self.scheme.default_port() {
write!(f, ":{}", self.port())?;
}
write!(f, "/")
}
}
impl FromStr for... | Rust | 0 |
rate_operation_describe_orderable_cluster_options(
input: &crate::input::DescribeOrderableClusterOptionsInput,
) -> Result<aws_smithy_http::body::SdkBody, aws_smithy_http::operation::SerializationError> {
let mut out = String::new();
#[allow(unused_mut)]
let mut writer = aws_smithy_query::QueryWriter::n... | Rust | 0 |
}
// 0 refers to the texture unit, not the texture id
self.pipeline.set_texture(Some(0));
} else {
self.pipeline.set_texture(None);
}
self.pipeline.set_blend_mode(batch.key.blend);
self.pipeline.apply(ctx)?;
... | Rust | 0 |
_flags = [
"p",
"p_max",
"p_min",
"p_rms",
"p_max_all",
"p_min_all",
"p_final",
"u",
"u_max",
"u_min",
"u_rms",
"u_max_all",
"u_min_all",
"u_final",
... | Python | 1 |
ale_z = pixel_size
elif orientation == "竖向(z延申)":
world_x = base_x
world_y = (base_y + j * pixel_size) # if not invert_y else (base_y - j * pixel_size)
world_z = base_z + i * pixel_size
scale_x = pixel_size
scale_y = rect_h * p... | Python | 1 |
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
import pickle
# train and save model
def train_model():
#load dataset
data = load_iris()
X, y = data.data, data.target
print(X)
# Train model
model = RandomForestClassifier()
model.fit(X,y)
prin... | Python | 1 |
.get("current")
.and_then(|temperature| temperature.as_i64())
})
}
fn ata_smart_attributes_airflow_temperature_cel(
_block_device: &BlockDevice,
json: &Value,
) -> Option<i64> {
trace!("checking ata_smart_attributes Airflow_Temperature_Cel");
json.get("ata_smart_attributes")
... | Rust | 0 |
});
unsafe
{
let val = port.read() | (1 << (if ir < 8
{
ir
}
else
{
ir - 8
}));
port.write(val);
}
}
#![feature(core_intrinsics)]
fn main() {
unsafe {
let _x: f32 = core::intrinsics::fmul_fast(3.4f32, f32::INFINITY); //~ ERROR `fmul_fast` intrinsic called with non-finite value as s... | Rust | 0 |
et mut rng = RandomGaussianGenerator::<F>::new();
let data_shape = csrmat.shape();
let m = data_shape.0;
let n = data_shape.1;
let l = m.min(n).min(rank);
if rank > l {
log::info!("reducing asked rank in subspace_iteration to {}", l);
}
//
let omega = rng.generate_matrix(Dim([dat... | Rust | 0 |
detr_101": {
"feat_channels": [384, 384, 384],
},
}
def __new__(
cls,
model_name: str,
num_classes: int,
eval_spatial_size: tuple[int, int] | None = None,
) -> RTDETRTransformerModule:
"""Constructor for RTDETRTransformer."""
if model_name... | Python | 1 |
tor3::from_rotation_yz(0.5 * PI), 1.0),
size: Vec2::new(5.0, 5.0),
});
let light2_geometry = scene.add_geometry(Geometry::Quad {
local_from_quad: Similarity3::new(Vec3::new(-6.0, 3.0, 0.0), Rotor3::from_rotation_xz(-0.5 * PI), 1.0),
size: Vec2::new(5.0, 5.0),
});
let light3_geome... | Rust | 0 |
#[serde(skip_serializing_if = "Option::is_none")]
pub sound: Option<PushSound>,
/// Optional thread id that is used by the OS to group multiple messages
/// that are related to the same "thread" (e.g. conversation or topic).
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_id: Opti... | Rust | 0 |
().available_plugins(¶ms),
"config_changed" => self.main_win().borrow_mut().config_changed(¶ms),
"def_style" => self.main_win().borrow_mut().def_style(¶ms),
"find_status" => self.main_win().borrow_mut().find_status(¶ms),
"up... | Rust | 0 |
382 ???
Ok(())
}/*******************************************************************************************
*
* raylib [core] example - Initialize 3d camera free
*
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for... | Rust | 0 |
normalize(v_world_normal),
normalize(context_main_light_pos - v_world_pos.xyz)
),
0.05
);
",
)
.with_out_expr("f_color", color_expr);
shader::Core {
vertex: core.vertex,
fragment,
}
}
pub f... | Rust | 0 |
s in later inputs too (eg: when reading multiple
// files):
// https://docs.rs/encoding_rs/0.8.30/encoding_rs/struct.Encoding.html#method.new_decoder_with_bom_removal
//
// We can try to maintain separate decoders for each unique stream (eq: by filepath
// whe... | Rust | 0 |
s) -> Group | None: ...
def find_one(self, **kwargs) -> Group | None:
"""Find one group.
Parameters
----------
prefix: str
Filter by group name prefix. Casing is ignored.
Returns
-------
Group | None
See Also
--------
* ... | Python | 1 |
om.random(mf.mo_coeff.shape)
mycc = cc.CCSD(mf).density_fit(auxbasis='ccpvdz-ri')
mycc.max_memory = 0
eri_df = mycc.ao2mo(mo)
self.assertAlmostEqual(lib.fp(eri_df.oooo),-493.98003157749906, 9)
self.assertAlmostEqual(lib.fp(eri_df.ovoo),-203.89515661847452, 9)
self.assert... | Python | 1 |
import fnmatch
import os
def generateMakefile(rootdir = '.', outputName = 'dps_cert_gen_mac'):
sourceFiles = []
includePaths = set()
for looproot, _, filenames in os.walk(rootdir):
for filename in filenames:
if fnmatch.fnmatch(filename, '*.c*'):
sourceFiles.append([filename[:filename.index('.')] + '.o', lo... | Python | 1 |
#-*- coding: utf-8 -*-
import unittest
from aeroporto import aeroporto
class AeroportoTestCase(unittest.TestCase):
def test_vazio(self):
patio = ['*']
self.assertEqual(0, aeroporto(patio))
def test_com_um_lugar(self):
patio = ['* ']
self.assertEqual(1, aeroporto(patio))
de... | Python | 1 |
.masquerade_as_nightly_cargo()
.with_stdout("hello from somedep")
.run();
}
#[cargo_test]
fn required_features_inactive_dep() {
// required-features with an inactivated dep.
let p = project()
.file(
"Cargo.toml",
r#"
[package]
name ... | Rust | 0 |
actix_web::HttpResponse::build(StatusCode::NO_CONTENT)
.content_type("application/octet-stream")
.cookie(cookie)
.finish()
}
}
<reponame>erichall/rustbridge.io
extern crate rustbridge;
fn main() {
rustbridge::website::start();
}
// Copyright 2018 <NAME> .
//
// Permission... | Rust | 0 |
60)
self.assertEqual(proc.exitcode, 0)
def test_dynamic_class_reset_on_unpickle_new_proc(self):
# a dynamic class
class Klass:
classvar = None
# serialize Klass in this process
saved = dumps(Klass)
# Check the reset problem in a new process
mp =... | Python | 1 |
que identification for the text.
# epub_uid = ''
# A tuple containing the cover image and cover page html template filenames.
# epub_cover = ()
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
# epub_guide = ()
# HTML files that should be inserted before the pages created by sphinx.
# ... | Python | 1 |
import brownie
import pytest
pytestmark = [pytest.mark.usefixtures("add_initial_liquidity", "approve_bob"), pytest.mark.lending]
@pytest.mark.itercoins("sending", "receiving", underlying=True)
def test_min_dy_too_high(bob, swap, underlying_coins, underlying_decimals, sending, receiving):
amount = 10 ** underlyin... | Python | 1 |
# -*- coding: utf-8 -*-
"""
암호분석 2024 : Caesar 암호 라이브러리 (CaesarLib.py)
"""
UpAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
LowAlphabet = "abcdefghijklmnopqrstuvwxyz"
#암호화 함수
def caesar_encrypt(key, plain_msg):
cipher_msg = ""
for ch in plain_msg: #문자열에서 한글자씩 추출
if ch in UpAlphabet: # ch가 대문자이면,
... | Python | 1 |
import csv
from bs4 import BeautifulSoup
def get_flag_urls(html_file_path):
# Read the HTML file
with open(html_file_path, "r", encoding="utf-8") as file:
soup = BeautifulSoup(file, "html.parser")
# Find the table (assuming it's the first table in the document)
table = soup.find("table")
... | Python | 1 |
UInt::<usize, 2>::new([6, 0]) / XUInt::new([5, 0]),
XUInt::new([1, 0])
);
}
#[test]
fn div_7_by_5() {
assert_eq!(
XUInt::<usize, 2>::new([7, 0]) / XUInt::new([5, 0]),
XUInt::new([1, 0])
);
}
#[test]
fn div_8_by_5() {
assert_eq... | Rust | 0 |
import json
import requests
import sys
kb_id = sys.argv[1]
def stream_requests(data_raw):
url = 'http://0.0.0.0:8777/api/local_doc_qa/local_doc_chat'
response = requests.post(
url,
json=data_raw,
timeout=60,
stream=True
)
for line in response.iter_lines(decode_unicode=Fa... | Python | 1 |
#!/usr/bin/env python3
"""
Script to explore ENTSO-E API data and find the 1.76 c/kWh price.
"""
import os
import sys
from datetime import datetime, timedelta
from services.electricity_service import ElectricityService
# Load environment variables from .env file
try:
from dotenv import load_dotenv
load_dote... | Python | 1 |
state_dict['iteration']
self.optimizer.load_state_dict(state_dict['optimizer'])
self.lr_scheduler.load_state_dict(state_dict['scheduler'])
print(f'==> Load pretrained params from {pretrained_path}.')
def gradient_penalty(self, real_samples, fake_samples):
... | Python | 1 |
KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use font::Metrics;
use crate::index::Point;
use crate::term::cell::Flags;
use crate::term::color::Rgb;
use crate::term::{RenderableCell, SizeInfo};
#[derive(Debug, Copy, Clone)]
p... | Rust | 0 |
# Generated by Django 3.2.15 on 2023-06-06 17:31
import private_storage.fields
import private_storage.storage.s3boto3
from django.db import migrations, models
from django.core.paginator import Paginator
def copy_from_in_app_message_to_markdownx_uploader(apps, schema_editor):
InAppMessageFile = apps.get_model('h... | Python | 1 |
str):
try:
data = correspondancy_dict[dataset](name=dataset)
if dataset in correspondancy_dict_DTI.keys():
data.convert_to_log(form="binding")
df = data.harmonize_affinities(mode="max_affinity")
else:
df = data.get_data()
except Exception as e:
... | Python | 1 |
from icolos.utils.enums.program_parameters import (
MacromodelEnum,
SchrodingerExecutablesEnum,
)
from icolos.utils.execute_external.execute import ExecutorBase
SEE = SchrodingerExecutablesEnum()
EE = MacromodelEnum()
class MacromodelExecutor(ExecutorBase):
"""For the execution of the "macromodel" binary... | Python | 1 |
not None # noqa: S101
assert len(stix_campaign.labels) > 0 # noqa: S101
# Then STIX campaign handles invalid dates
def _then_stix_campaign_handles_invalid_dates(stix_campaign: Any) -> None:
"""Check if STIX campaign handles invalid dates gracefully."""
assert stix_campaign is not None # noqa: S101... | Python | 1 |
gir-files)
// DO NOT EDIT
use EncodingProfile;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;
glib_wrapper! {
pub struct EncodingContainerProfile(Object<ffi::GstEncodingContainerProfile, ffi::GstEncodingContainerProfileClass>): EncodingProfile;
... | Rust | 0 |
_CHECK_SUBMISSION].
pub const UPDATE_EXPIRY_OFFSET: u64 = 100; // seconds
pub const AWS_REGION: &str = "eu-central-1";
<filename>client/src-tauri/src/api/controls.rs<gh_stars>0
use tauri::{command, State};
use shared::{launch::*, remote_conn_packet::*};
use super::{super::{Connection, Token}, remote_conn::*};
#[comm... | Rust | 0 |
se, 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 writing, software
// distributed under the License is distributed o... | Rust | 0 |
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, ".env"))
class Config:
SECRET_KEY = os.environ.get("SECRET_KEY") or "you-will-never-guess"
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL"
) or "sqlite:///" + ... | Python | 1 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
import click
from gammapy.analysis import Analysis, AnalysisConfig
log = logging.getLogger(__name__)
@click.command(name="config")
@click.option(
"--filename",
default="config.yaml",
help="Filename to store the default configu... | Python | 1 |
print(__doc__)
# 加载包
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
# 加载数据
iris = datasets.load_iris()
# 特征X保留全部行,只保留前两列,即Sepal length和Sepal width
X = iris.data[:, :2]
# 标签y
y = iris.target
# 训练四个SVM模型
# C为SVM模型的正则化参数
C = 1.0
# 线形核函数
svc = svm.SVC(kernel='linear', C=C).fit(X, y)... | Python | 1 |
sleep(1)
def read_text_from_image(image):
"""Reads text from an image file and outputs found text to text file"""
# Convert the image to grayscale
global s
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Perform OTSU Threshold
ret, thresh = cv2.threshold(gray_image, 0, 255, cv2.THRESH... | Python | 1 |
" => "types::VLNode",
"VLPath" => "types::VLPath",
"VLServer" => "types::VLServer",
"Window" => "types::Window",
"__GLXextFuncPtr" => "types::__GLXextFuncPtr",
"const GLXContext" => "const types::GLXContext",
"float" => "__gl_imports::raw::c_float",
"int" => "__gl... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class IrQWeb(models.AbstractModel):
_inherit = 'ir.qweb'
def _get_template_cache_keys(self):
return super()._get_template_cache_keys() + ["studio"]
def _prepare_environment(s... | Python | 1 |
## init
from llama_index.tools.azure_cv.base import (
CV_URL_TMPL,
AzureCVToolSpec,
)
__all__ = ["AzureCVToolSpec", "CV_URL_TMPL"]
| Python | 1 |
EQ_HEADER_MASK_U32) != 0 {
Err(PacketError::InvalidSequenceNumber)
} else {
if kind == PacketKind::Response {
seq |= PACKET_SEQ_RESPON_MASK_U32;
}
if origin == Role::Client {
seq |= PACKET_SEQ_CLIENT_MASK_U32;
}
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.