text string | label_name string | labels int64 |
|---|---|---|
import tkinter as tk
from tkinter import filedialog, messagebox, scrolledtext
import google.generativeai as genai
import json
import os
# Load API key from config.json
def load_api_key():
try:
with open("config.json", "r") as file:
config = json.load(file)
api_key = config.get("GOOGLE_A... | Python | 1 |
def test_deprecate_class_obj(self):
class Args:
arg = 5
with self.assertWarns(FutureWarning) as warning:
arg = deprecate(('arg', self.higher_version, 'message'), take_from=
Args())
assert arg == 5
assert str(warning.warning
) == f'The `arg` attribute is deprecated a... | Python | 1 |
e as a 3 dimensional matrix with shape [nrows, ncols, 4]
# :func:`pyvista.numpy_to_texture`.
#
# Here we can download an image that has an alpha channel:
rgba = examples.download_rgba_texture()
rgba.n_components
# %%
# Render it
curvsurf.plot(texture=rgba, show_grid=True)
# %%
# Repeating Textures
# +++++++++++++++... | Python | 1 |
}
/// }
/// Ok(Async::Ready(self.polled_count))
/// }
/// }
///
/// let mut executor = InPlaceExecutor::new().unwrap();
/// let monitor = executor.spawn_monitor(HeavyCalculation::new(100));
/// let result = executor.run_fiber(monitor).unwrap();
/// assert_eq!(result, Ok(11));
/// ```
pub fn yield_po... | Rust | 0 |
ReferenceEnums as spinChunkScan3dCoordinateSystemReferenceEnums;
#[doc = "< The first (X or Theta) coordinate"]
pub const _spinChunkScan3dCoordinateSelectorEnums_ChunkScan3dCoordinateSelector_CoordinateA:
_spinChunkScan3dCoordinateSelectorEnums = 0;
#[doc = "< The second (Y or Phi) coordinate"]
pub const _spinChunk... | Rust | 0 |
"""Validates State Proof."""
import json
from collections import (
OrderedDict,
)
from rlp import (
encode as rlp_encode,
decode as rlp_decode,
DecodingError,
)
from .utils import (
sha3_256,
NIBBLE_TERMINATOR,
unpack_to_nibbles,
)
from .constants import (
NODE_TYPE_BLANK,
NODE_TYP... | Python | 1 |
Some(transmute(notify_multi_queue_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
#[cfg(any(feature = "v1_2", feature = "dox"))]
fn connect_property_owner_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn noti... | Rust | 0 |
import os
from typing import List
from crewai import Agent, Crew, Process, Task, LLM
from crewai.project import CrewBase, agent, crew, task
from crewai_tools.tools.file_writer_tool.file_writer_tool import FileWriterTool
from dotenv import load_dotenv
from pydantic import BaseModel
load_dotenv()
class Sentence(BaseM... | Python | 1 |
should be wrapped in an `Arc<T>` (as an example) to make it cloneable.**
/// # Examples
/// ```
/// use signals2::*;
///
/// let sig: Signal<()> = Signal::new();
/// sig.connect(|| println!("Hello, world!"));
/// sig.emit(); // prints "Hello, world!"
/// ```
/// The only required template parameter for a `Signal` is ... | Rust | 0 |
def nth_term_hp(a, d, n):
"""Calculates the nth term of a harmonic progression iteratively.
Args:
a: The first term.
d: The common difference.
n: The term number.
Returns:
float: The nth term of the harmonic progression.
:param a:
:param d:
:param n:
:return:
"""
return 1 ... | Python | 1 |
'''
SFT 脚本
'''
import logging
import math
import os
import sys
from dataclasses import dataclass, field
from torchdata.datapipes.iter import IterableWrapper
from itertools import chain
import deepspeed
from typing import Optional,List,Dict
from torch.utils.data import Dataset
import json
import datasets
import panda... | Python | 1 |
== 6 {
1i32
} else if current_block == 11 {
0i32
} else {
0i32
})
}
}
<reponame>henlo-birb/gdrust
use crate::godot_panic;
use gdnative::prelude::{NativeClass, Object, RefInstance, SubClass};
use gdnative::thread_access::ThreadAccess;
use gdnative::{G... | Rust | 0 |
# Copyright 2018 The TensorFlow 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 applicab... | Python | 1 |
ommands.len(), 100);
assert_eq!(stats.hashtags.len(), 100);
assert_eq!(stats.bttv_emotes.len(), 100);
assert_eq!(stats.ffz_emotes.len(), 100);
assert_eq!(stats.twitch_emotes.len(), 100);
Ok(())
}
#[test]
fn sanity_check_message_count_fits_in_u64() {
let _: u... | Rust | 0 |
ntries = [0u16; 3];
let (i, ()) = fill(version_entry, &mut entries)(i)?;
Ok((i, Version { major: entries[0], minor: entries[1], patch: entries[2] }))
}
#[cfg(test)]
pub mod bcd_tests {
use super::*;
#[test]
fn bcd() {
// let version = Version { major: 123, minor: 456, patch: 999};
... | Rust | 0 |
"""
事件過濾器模組
此模組實現了事件過濾器,用於過濾和路由事件。
"""
import logging
import re
from abc import abstractmethod
from typing import Any, Dict, List, Optional, Pattern, Union
from .event import Event, EventSeverity, EventSource, EventType
from .event_processor import EventProcessor
# 設定日誌
logger = logging.getLogger("events.event_filt... | Python | 1 |
"""
序列思维适配器单元测试
"""
import unittest
from unittest.mock import Mock, patch, MagicMock
import sys
import os
# 添加项目根目录到Python路径
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../..'))
try:
from mcptool.adapters.sequential_thinking_adapter import SequentialThinkingAdapter
except ImportError:
# 如果... | Python | 1 |
red+listfollow.json()['error'] , end ='\r');sleep(2); print(' ', end = '\r')
else:
try:
listfollow = listfollow.json()['data']
except:
print(red+'Hết Nhiệm Vụ Follow ', end = '\r');sleep(2); print(' ... | Python | 1 |
ect::<Vec<&'static str>>();
if cfg!(target_os = "macos") {
build.define("OS_MACOSX", Some("1"));
build.define("ROCKSDB_PLATFORM_POSIX", Some("1"));
build.define("ROCKSDB_LIB_IO_POSIX", Some("1"));
}
if cfg!(target_os = "linux") {
build.define("OS_LINUX", Some("1"));
... | Rust | 0 |
from rcb.views import *
from django.urls import path
urlpatterns=[
path('captain/',captain,name='captain'),
] | Python | 1 |
import sqlite3
import numpy as np
import os
from sklearn.metrics.pairwise import cosine_similarity
# Function to retrieve embedding paths from the database
def get_embedding_paths(db_path):
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
cursor.execute("SELECT file_path FROM embeddings")
paths =... | Python | 1 |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import logging
import sys
from pyasn1 import __version__
from pyasn1 import error
from pyasn1.compat.octets import octs2ints
__all__ = ['Debug', 'setLogger', 'he... | Python | 1 |
pos in all_neighbors {
let (x, y) = pos;
let mut count = 0;
for (x_offset, y_offset) in &OFFSETS {
if black_tiles.contains(&(x + x_offset, y + y_offset)) {
count += 1;
}
}
if black_tiles.contains(&pos) {
if count == 1 || count == 2 {
next_black_tiles.insert(pos);
}
} else {
... | Rust | 0 |
f64,
beta: f64,
a: f64,
b: f64,
ln_beta: f64,
}
impl Beta {
/// Create a beta distribution with shape parameters `alpha` and `beta`
/// on interval `[a, b]`.
///
/// It should hold that `alpha > 0`, `beta > 0`, and `a < b`.
#[inline]
pub fn new(alpha: f64, beta: f64, a: f64, b: ... | Rust | 0 |
from PIL import Image
import pytesseract
import cv2
import numpy as np
# Path to the screenshot image file
screenshot_path = 'path_to_your_screenshot.png'
# Open the image using Pillow
img = Image.open(screenshot_path)
# Use pytesseract to extract text
extracted_text = pytesseract.image_to_string(img)
# Print the e... | Python | 1 |
ning permissions and
// limitations under the License.
use super::helper;
use syn::spanned::Spanned;
use quote::ToTokens;
/// List of additional token to be used for parsing.
mod keyword {
syn::custom_keyword!(Error);
syn::custom_keyword!(pallet);
syn::custom_keyword!(getter);
syn::custom_keyword!(OptionQuery);
... | Rust | 0 |
"""Tests the `gemini.tool` module."""
from enum import Enum
from typing import Literal
import pytest
from google.ai.generativelanguage import FunctionCall
from google.generativeai.types import ( # type: ignore
FunctionDeclaration,
Tool,
)
from mirascope.core.base.tool import BaseTool
from mirascope.core.gem... | Python | 1 |
def td_learner(env, n_trials, gamma=0.98, alpha=0.001):
""" Temporal Difference learning
Args:
env (object): the environment to be learned
n_trials (int): the number of trials to run
gamma (float): temporal discount factor
alpha (float): learning rate
Returns:
ndarray, ndarray: the value fun... | Python | 1 |
# -*- coding: utf-8 -*-
"""GOOG_stock.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1_S-6lsr7IoEWn1gCrmBlA1rJiEyqUICB
"""
# Description: This program predicts the price of GOOG stock for a specific day
# using the Machine Learning ... | Python | 1 |
);
}
context.swap_buffers().unwrap();
}
});
// Keep track of the health of the rendering thread
let render_thread_healthy = Arc::new(RwLock::new(true));
let render_thread_watchdog = Arc::clone(&render_thread_healthy);
thread::spawn(move || {
if !render_threa... | Rust | 0 |
import pandas as pd
import numpy as np
csv_file_path = '/home/nmh/ds/project/data_ver3_coordinated.csv'
data = pd.read_csv(csv_file_path)
output_path = '/home/nmh/ds/project/data_ver3_coordinated_filtered_ver1.csv'
def count_complete_rows(csv_file_path):
data = pd.read_csv(csv_file_path)
complete_rows = data.... | Python | 1 |
"""
A python script to list changed files in a specified pull request.
Usage:
---------------------------------------------------------------------------
# List changed files in https://github.com/mlflow/mlflow/pull/3191
$ python dev/list_changed_files.py --repository mlflow/mlflow --pr-num 3191
----------------------... | Python | 1 |
"""tests for lognormal probability distribution"""
import numpy as np
import pytest
from PySDM.initialisation.spectra import Lognormal
class TestSpectraLognormal:
"""checks ctor args against computed values"""
@staticmethod
@pytest.mark.parametrize(
"m_mode, s_geom",
(
(0.01,... | Python | 1 |
user_id(&self, name: &str) -> Option<usize> {
match sqlx::query!(
"SELECT id FROM users WHERE name = $1",
name,
).fetch_one(&self.pool).await {
Err(_) => None,
Ok(row) => {
let id: i32 = row.id;
Some(id as usize)
... | Rust | 0 |
.into_iter().rev() {
let val = arena.add(val);
let mut current_block = arena.block_with_size(2);
current_block[0] = val;
current_block[1] = hd;
hd = current_block.build();
}
hd
}
}
impl IntoOcamlRep for PathBuf {
fn into_ocamlrep<'a>(s... | Rust | 0 |
a
dDF @ s& d Z ddlZddlZddlZdZddlm Z m
Z
mZ ddlmZ ddlm
Z ddlmZ ddlmZmZ dd lmZ dd
lmZ eekredeeejdkrdd
lmZ eZejdkrejdkree jdd dk reZddlmZ m!Z"m#Z$m%Z& d}ddZ'd~ddZ(i Z)dd Z*ejdkrd... | Python | 1 |
(writer, 0x68),
I32Popcnt => op!(writer, 0x69),
I32Add => op!(writer, 0x6a),
I32Sub => op!(writer, 0x6b),
I32Mul => op!(writer, 0x6c),
I32DivS => op!(writer, 0x6d),
I32DivU => op!(writer, 0x6e),
I32RemS => op!(writer, 0x6f),
I32RemU => op!(writer, 0x70),
I32And => op!(writer, 0x71),
I32Or ... | Rust | 0 |
cmd = [vector_search_path, "index", str(project_root)]
logger.info(
"MCP Vector Search: Starting background indexing for improved code search"
)
# Start the indexing process in the background
process = subprocess.Popen(
cmd,
stdout=subproc... | Python | 1 |
x_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::rules\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_rules_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
}
impl fmt::Display for DOMCSSStyleSheet {
fn fmt(&self, ... | Rust | 0 |
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
from collections import OrderedDict
from pathlib import Path
import torch
def convert_resnet(src_dict, dst_dict):
"""convert resnet checkpoints from torchvision."""
for key, value in src_dict.items():
if not key.startswith('fc'):
... | Python | 1 |
StdRng::seed_from_u64(n0 as u64)
} else {
StdRng::seed_from_u64(rand::random())
};
#[derive(Clone, Debug)] struct Rng(StdRng);
impl Callable for Rng {
fn arity(&self) -> usize { 0 }
fn call(&mut self, _pos: SourcePos, _interpreter: &mut Interpreter, _args: Vec<(Box<dyn Value>, SourcePos... | Rust | 0 |
file_path))
}
// -------------------------------------- Metric recording ------------------------------------------------
#[allow(dead_code)]
static RECORDER: PrintRecorder = PrintRecorder;
#[derive(Default)]
pub struct PrintRecorder;
impl Recorder for PrintRecorder {
fn increment_counter(&self, key: Key, value:... | Rust | 0 |
8; 0x100], version: u32) -> u32 {
assert!((4..=9).contains(&version));
static LIST: [u32; 18] = [
0x6C, 0x7C, 0xDC, 0x83, 0x0A, 0xD2, 0xB3, 0x50, 0x61,
0xD7, 0x17, 0x47, 0x16, 0x54, 0x61, 0xDC, 0xBD, 0xDB,
];
let version = version as usize;
let a = LIST[(version - 4) * 3 + 0] as usiz... | Rust | 0 |
_vec_vec(add_matrices(func_match_matrix(command_1, r_mat_a), func_match_matrix(command_2, r_mat_b)));
},
"subtract" => {
result = string_from_vec_vec(subtract_matrices(func_match_matrix(command_1, r_mat_a), func_match_matrix(command_2, r_mat_b)));
... | Rust | 0 |
.put_object(&chunker, &mut repo, "1", obj1.clone())
.await
.unwrap();
archive_2
.put_object(&chunker, &mut repo, "2", obj2.clone())
.await
.unwrap();
let mut restore_1 = Cursor::new(Vec::<u8>::new());... | Rust | 0 |
s_and_labels_to_dataset(
file_paths=file_paths,
labels=labels,
label_mode=label_mode,
num_classes=len(class_names) if class_names else 0,
max_length=max_length,
shuffle=shuffle,
shuffle_buffer_size=shuffle_buffer_size,
seed=... | Python | 1 |
rial_indices):
# Check the six neighboring voxels
neighbors = [
(i-1, j, k), (i+1, j, k),
(i, j-1, k), (i, j+1, k),
(i, j, k-1), (i, j, k+1)
]
# If any neighbor is outside the matrix or is void, this is a surface element
for ni, nj, nk... | Python | 1 |
)
}
}
}
/// Access control method for the HTTP API
#[derive(Clone, Debug)]
pub enum AccessControl {
/// Access is not restricted (for use with local IP addresses)
Insecure(SocketAddr),
/// Access is restricted
WithToken(AccessInfo),
}
impl AccessControl {
/// The address to bind the se... | Rust | 0 |
#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i16"))]
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
pub unsafe fn vmulq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
simd_mul(a, b)
}
/// Multiply
#[inline]
#[target_feature(enable = "neon")]
#[cfg_attr(target_arch = "arm", targ... | Rust | 0 |
_eq!(
network_names,
vec![&"goerli".to_string(), &"mainnet".to_string()]
);
assert_eq!(goerli_capability, archive);
assert_eq!(mainnet_capability, traces);
}
}
<reponame>ambidextrousTx/ToyRustPrograms<gh_stars>0
// Using structs to represent 2D points
// and calculati... | Rust | 0 |
{
let line_idx = match cursor_y.checked_sub(render_y) {
Some(idx) => {
if idx >= render_height {
// Out-of-bounds, content is above
return None;
}
idx as usize
}
// Out-of-bounds, content... | Rust | 0 |
import heapq
def a_star():
# Define the adjacency matrix of the graph
adjacency_matrix = [[0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 0, 0, ... | Python | 1 |
import json
import shutil
import zipfile
from loguru import logger
from tools import configs
from tools.configs import path_define
from tools.configs.options import FontFormat
from tools.services.font_service import DumpLog
def make_release_zips(dump_logs: list[DumpLog], font_formats: list[FontFormat]):
path_de... | Python | 1 |
:os::raw::c_uint;
extern "C" {
#[doc = " Allocate an AVPacket and set its fields to default values. The resulting"]
#[doc = " struct must be freed using av_packet_free()."]
#[doc = ""]
#[doc = " @return An AVPacket filled with default values or NULL on failure."]
#[doc = ""]
#[doc = " @note thi... | Rust | 0 |
#!/usr/bin/env python3
"""
CPU Usage LED Simulator
CSC 454 | Tech Platforms Summer 2025 FINAL PROJECT
REQUIREMENTS AS LISTED IN PROJECT DESCRIPTION:
Using psutil, simulate a CPU monitor that:
• Lights up virtual LEDs (ASCII or GUI)
• Color/brightness changes based on CPU %
• Alert system if CPU > 90%
"""
__author... | Python | 1 |
, None, None, None, None);
m.solve();
if Model::version().starts_with("2.9.") {
assert_eq!(Status::Finished, m.status());
assert_eq!(SecondaryStatus::HasSolution, m.secondary_status());
} else... | Rust | 0 |
# -*- coding: utf-8 -*-
# -*- test-case-name: pytils.test.test_translit -*-
# pytils - simple processing for russian strings
# Copyright (C) 2006-2007 Yury Yurevich
#
# http://www.pyobject.ru/projects/pytils/
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Gener... | Python | 1 |
import random
string = "另一种愿望这回若是打下了晋阳必然不会让赵匡胤跑掉"
my_list = list(string)
new_list = random.sample(my_list, len(my_list))
print(new_list) | Python | 1 |
import os
import numpy as np
import pybullet as p
from .robot import Robot
class Sawyer(Robot):
def __init__(self, controllable_joints='right', slider=True, floating=False):
self.slider = slider
self.floating = floating
if not floating:
if not slider:
right_arm_j... | Python | 1 |
start_str}-{end_str}"
try:
resp = requests.get(url)
if resp.status_code == 200:
data = resp.json()
events = data.get('events', [])
if events:
# Look at first game
event = events[0]
event_id = event.... | Python | 1 |
recated and replaced with NvAPI_GPU_GetAllClockFrequencies()
///
/// memory_clock = clocks[8] * 0.001f;
///
/// if clocks[30] != 0 {
/// core_clock = clocks[30] * 0.0005f
/// shader_clock = clocks[30] * 0.001f
/// } else {
/// core_clock = clocks[0] * 0.00... | Rust | 0 |
j):
"""Retrieves Graph element."""
graph = ops.get_default_graph()
if not isinstance(obj, six.string_types):
if not hasattr(obj, "graph") or obj.graph != graph:
raise ValueError("Passed %s should have graph attribute that is equal "
"to current graph %s." % (obj, graph))
retur... | Python | 1 |
n send it to the server, but don't wait for a reply.
fn async_send_instruction(
&self,
keypair: &Keypair,
instruction: Instruction,
) -> io::Result<Signature>;
/// Attempt to transfer lamports from `keypair` to `pubkey`, but don't wait to confirm.
fn async_transfer(
&sel... | Rust | 0 |
row[f'{key}/Delta'] = mean - old_data
if self._headers_windows[key] is None:
self._data[key] = []
def get_stats(
self,
key: str,
min_and_max: bool = False,
) -> tuple[float, ...]:
"""Get the statistics of the key.
Args:
key (str)... | Python | 1 |
f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FullscreenMode::{}",
match *self {
FullscreenMode::CurrentMonitor => "CurrentMonitor",
FullscreenMode::AllMonitors => "AllMonitors",
_ => "Unknown",
}
)
... | Rust | 0 |
182];
vk_fmt![ASTC_12x12_UNORM_BLOCK, 183];
vk_fmt![ASTC_12x12_SRGB_BLOCK, 184];
use proc_macro::TokenStream;
mod field_access_derive;
mod metadata_derive;
#[proc_macro_derive(FieldAccess, attributes(custom_parser))]
pub fn field_access_macro_derive(input: TokenStream) -> TokenStream {
let ast = syn... | Rust | 0 |
tate::Terminated
}
}
(IterBorderState::Iterating(x, y), ..) => {
let (x, y) = (*x, *y);
if y == border.y + 1 && x == border.x {
IterBorderState::Terminated
} else if y == border.y && (... | Rust | 0 |
pop() {
waker.wake();
}
}
/// Get information about all known pending futures
#[allow(unused)]
pub fn get_pending_info(&self) -> Vec<(usize, Option<CallerInfo>)> {
self.pending
.iter()
.map(|id|
(id.clone(), self.info.get(id).unwrap(... | Rust | 0 |
/// Associated comment, if any.
pub comment: Option<String>,
/// The entire serialized certificate, used for exporting
pub serialized: Vec<u8>,
}
impl Certificate {
/// Reads an OpenSSH certificate from a given path.
///
/// # Example
///
/// ```rust
/// # use sshcerts::Certificat... | Rust | 0 |
if entity_name in self.synonym_dict:
synonyms = self.synonym_dict[entity_name]
if isinstance(synonyms, list):
expanded.update(synonyms)
else:
expanded.add(synonyms)
# 反向查找
for key, sy... | Python | 1 |
ub id: String,
/// ID of the remote source.
pub source_id: u32,
/// Name of the remote source.
pub source_name: String,
/// Remote movie webpage URL.
pub url: String,
}
/// Movie people data.
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
#[non_exhaustive]
pub struct People {
... | Rust | 0 |
"BSCU",
"EQOP",
"FLRG",
"FRCpK",
"OACB.U",
"PTVE",
"RTP.U",
"STWOU",
"SUMO",
"TDSA",
"TDSB",
"TDSD",
"TDSE",
"VNMC",
"VNSE",
"AHACU",
"ATHA",
"BIVI",
"CCIV",
"CCIV.WS",
"CMPS",
"ETAC",
"ETACW",
"HGEN",
"LUMN",
"NMMCU",
"U",
"ACEV",
"COFpK",
"DEN",
"DFHT",
... | Rust | 0 |
2845582962, -89.2845153809, -66.4581871033, -66.4581441879}},
{"ghz87yh", Box{71.7956542969, 71.7970275879, -34.2828369141, -34.281463623}},
{"cf", Box{56.25, 61.875, -101.25, -90.0}},
{"gd1n5pnc8p7", Box{57.3434360325, 57.3434373736, -20.9526403248, -20.9526389837}},
{"hef9dvw3q", Box{-68.6121511459, -68.612108230... | Rust | 0 |
b3) e021
unsafe {
let mut tmp: __m128 = _mm_mul_ps(_mm_shuffle_ps(a, a, 0 /* 0, 0, 0, 0 */), b);
tmp = _mm_mul_ps(_mm_set_ps(-2., -2., -2., 0.), tmp);
tmp = _mm_add_ps(a, tmp);
tmp
}
}
// Apply a motor to a motor (works on lines as well)
// in points to the start of an array o... | Rust | 0 |
import pygame
def tocar_audio(arquivo):
# Inicializa o mixer do pygame
pygame.mixer.init()
# Carrega o arquivo MP3
pygame.mixer.music.load(arquivo)
# Reproduz o áudio
pygame.mixer.music.play()
# Mantém o programa rodando enquanto o áudio toca
while pygame.mixer.music.get_... | Python | 1 |
import click
from pcapi.utils.blueprint import Blueprint
from .unstack_batch_cloud_task_queue import unstack_batch_queue
blueprint = Blueprint(__name__, __name__)
@blueprint.cli.command("unstack_batch_queue")
@click.option("--queue-name", required=True, help="Queue name (not full path)", type=str)
@click.option("... | Python | 1 |
(bars);
(stock_bar_set, covered_date_ranges)
};
observer(ctx, &stock_bar_set);
let mut stock_bars_map = stock_bars_map.borrow_mut();
stock_bars_map
.insert(stock_symbol.clone(), (stock_bar_s... | Rust | 0 |
tree.extend([[np.nan, np.nan, np.nan, -1, 0] + [np.nan] * len(classes_)
for _ in range(idx - len(tree) + 1)])
# Process condition node
if node.get("role") == "C" and node.get("triples"):
feature_str = node["triples"][0]
... | Python | 1 |
from typing import List
from rich.console import Console
from ..apps import App
from ..apps import AppFactory
from ..common.log import LOG
from ..common.utils import get_from_dict_or_env
from ..database import ConversationTokenBufferMemory
from ..engine.initialize import init_tool_engine as init_engine
from ..models... | Python | 1 |
device, material_pipeline): &mut SystemParamItem<Self::Param>,
) -> Result<Self::PreparedAsset, PrepareAssetError<Self::ExtractedAsset>> {
let buffer = render_device.create_buffer_with_data(&BufferInitDescriptor {
contents: extracted_asset.time.as_std140().as_bytes(),
label: None,
... | Rust | 0 |
d.ExcelWriter(output_path, engine="openpyxl") as writer:
df.to_excel(writer, sheet_name="All Referrals", index=False)
for status, subset in df.groupby("Referral Status"):
clean_name = f"{status.title()} Referrals"
subset.to_excel(writer, sheet_name=clean_name[:31], index=False)
... | Python | 1 |
rabMoveDirection::NorthWest;
} else if keyboard_input.pressed(KeyCode::A) && keyboard_input.pressed(KeyCode::S) {
walk_velocity.direction = CrabMoveDirection::SouthWest;
} else if keyboard_input.pressed(KeyCode::A) {
walk_velocity.direction = CrabMoveDirection::West;
} el... | Rust | 0 |
t|9||psddj
di t qV|7rtd|pd d t|7 d |5d|pd d g dadWdbid7dOdTdUd g dVdWdXid7dOddYdZgd[d\d]id^idcddt
|5}:|:dk
r@d};|5D ]8}8z)t |8tr|db |8std|pd d |8d|pd d dWdbidWdW q t
y d7};Y qw |;
s@td|
pd d |5d|
pd d g dadWdbid7dOdTdUd g d... | Python | 1 |
fo::Var1(name, vs)])
}
pub fn create_variable2(var_type: VariableType, name: String, vs: i32, ms: i32) -> Self
{
Declaration::Variable(var_type, vec![VarInfo::Var2(name, vs, ms)])
}
pub fn create_variable3(var_type: VariableType, name: String, vs: i32, ms: i32, cs: i32) -> Self
{
... | Rust | 0 |
h.square(L2_dis / (self.voxel_size * 1.5))) * pred_inlier.float()
)
output_dict['refined_transform'] = refined_transform @ transform
return output_dict
def cal_leading_eigenvector(self, M:torch.Tensor, num_iterations=10):
leading_eig = torch.ones_like(M[..., :1])
... | Python | 1 |
enType font collection. In that case the returned value would be
/// the index of this face in that collection. If the face is not part of a
/// collection then the returned value would always be zero.
#[inline]
pub fn face_index(&self) -> u32 {
self.face_info().face_index
}
/// Returns... | Rust | 0 |
``
/// let mut ascii = 'A';
///
/// ascii.make_ascii_lowercase();
///
/// assert_eq!('a', ascii);
/// ```
///
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline]
pub fn make_ascii_lowercase(&mut... | Rust | 0 |
}
}
#[derive(Debug,PartialEq,Clone)]
pub struct Bnode {
data: OP,
left: Option<indextree_ng::NodeId>,
right: Option<indextree_ng::NodeId>,
parent: Option<indextree_ng::NodeId>,
}
pub fn build_a_tree(arena: &mut Arena<Bnode>) -> indextree_ng::NodeId {
... | Rust | 0 |
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCustomHostnameFallbackOriginResult:
"""
## Example Usage
```python
import pulumi
import pulumi_cloudflare as cloudflare
example_custom_hostname_fallback_origin = cloudflare.get_custom_hostname_fallback_origin(zone_id="023e105f4ecef... | Python | 1 |
concat!(
"Offset of field: ",
stringify!(libraw_fuji_info_t),
"::",
stringify!(DriveMode)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct libraw_sensor_highspeed_crop_t {
pub cleft: ushort,
pub ctop: ushort,
pub cw... | Rust | 0 |
}
parameter_type_with_key! {
pub ExistentialDeposits: |_currency_id: CurrencyId| -> Balance {
Default::default()
};
}
impl orml_tokens::Config for Runtime {
type Event = Event;
type Balance = Balance;
type Amount = Amount;
type CurrencyId = CurrencyId;
type WeightInfo = ();
type ExistentialDeposits = Exist... | Rust | 0 |
# Modify your transpose function from the previous exercise so that it works with any MxN matrix with at least one row and one column.
"""
Init a new_matrix containing the number of necessary rows. This will be equal to the number of columns in matrix.
Iterate over the matrix.
For row_index, row in matrix:
# [1,... | Python | 1 |
# Example file for Advanced Python: Hands On by Joe Marini
# Using the statistics package
import json
import statistics
# open the sample weather data file and use the json module to load and parse it
with open("../../sample-weather-history.json", "r") as weatherfile:
weatherdata = json.load(weatherfile)
# selec... | Python | 1 |
f.do_classifier_free_guidance else latents
latent_model_input = self.scheduler.scale_model_input(latent_model_input, t)
# predict the noise residual
noise_pred = self.unet(
latent_model_input,
t,
encoder_hidden_... | Python | 1 |
], # marker colour
# color='y',
marker = 'o', # marker shape
s=6 # marker size
)
ax.set_xlabel(Y_pca_names[int(col2)-1], labelpad=18)
ax.set_ylabel... | Python | 1 |
arg(cid.as_ref());
if let Some(args) = ipget_args {
cmd.args(args.as_ref().split(' '));
}
let output = cmd.output()?;
if is_verbose {
io::stdout().write_all(&output.stdout)?;
io::stderr().write_all(&output.stderr)?;
}
failure::ensure!(
output.status.success(),... | Rust | 0 |
GizmoResult::Commit
} else {
GizmoResult::Update
}
} else {
GizmoResult::NoChange
}
}
fn draw_scale_gizmo(
debug_draw: &mut DebugDraw2DResource,
editor_draw: &mut EditorDraw2DResource,
selection_world: &mut EditorSelectionResource,
subworld: &SubWorl... | Rust | 0 |
#[ignore]
async fn test_proxy_get_activities() -> Result<(), Error> {
let config = GarminConfig::get_config(None)?;
let mut session = GarminConnectClient::new(config.clone());
session.init().await?;
let user_summary = session
.get_user_summary((Utc::now() - Duration... | Rust | 0 |
; aes::KEY_LEN_128],
prefix: Vec<u8>,
target: Vec<u8>,
}
impl RandEcbOracle {
/// Create a new oracle, generating a random prefix and key
pub fn new() -> Self {
let mut rng = thread_rng();
let key = gen_rand_key(&mut rng);
// range is valid, cannot panic
let prefix = g... | Rust | 0 |
ame>phanikishoreg/llvm-rs
//! This library provides wrappers for LLVM that are memory-safe and follow
//! Rust idioms.
//!
//! The original LLVM reference is available [here](http://llvm.org/doxygen/)
//! but take note that this isn't as thorough as this documentation.
#![cfg_attr(feature = "cargo-clippy", allow(clippy... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.