text string | label_name string | labels int64 |
|---|---|---|
#[serde(default)]
pub expressions: Vec<String>,
#[serde(default)]
pub aggregates: HashMap<String, Aggregate>,
}
impl ViewConfig {
fn _apply<T>(field: &mut T, update: Option<T>) -> bool {
match update {
None => false,
Some(update) => {
*field = upda... | Rust | 0 |
, 'exponential', 'kaiser']:
raise ValueError(
"The '" + window + "' window needs one or "
"more parameters -- pass a tuple."
)
else:
winstr = window
else:
raise ValueError(f"{type(window)} as window type is not supported.")
try... | Python | 1 |
import math
def quadratic(a,b,c):
d=b**2-4*a*c
if d<0:
print('no real roots')
elif d==0:
root=-b/2*a
return root
else:
root1=(-b+math.sqrt(d))/(2*a)
root2=(-b-math.sqrt(d))/(2*a)
print('root1 is=',root1,'root2 is=',root2)
a=int(input('enter no.'))
... | Python | 1 |
end = captures[2].parse::<u32>().ok()?;
Some(Self {
char_policy_range: range_start..=range_end,
char_policy: captures[3].chars().next()?,
password: captures[4].to_owned(),
})
}
pub fn char_count_in_range(&self) -> bool {
let char_count = self
... | Rust | 0 |
metadata: None,
}
}
}
#[doc = "List of dashboards."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct DashboardListResult {
#[doc = "The array of custom resource provider manifests."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub value: Vec<Dashboard... | Rust | 0 |
let Err(err) = run() {
eprintln!("{}", err);
exit(1);
}
// Tells cargo to only rebuild if the proto directory (or, implicitly,
// this file) changed
println!("cargo:rerun-if-changed=./proto");
}
<filename>lumol-core/src/energy/mod.rs
// Lumol, an extensible molecular simulation engine
... | Rust | 0 |
= AtomicBool::new(false);
/// Safe access to WDOG1
///
/// This function returns `Some(Instance)` if this instance is not
/// currently taken, and `None` if it is. This ensures that if you
/// do get `Some(Instance)`, you are ensured unique access to
/// the peripheral and there cannot be data... | Rust | 0 |
are returned as abs paths
/// * Doesn't include the path itself only its children nor is this recursive
///
/// ### Examples
/// ```
/// use rivia::prelude::*;
///
/// let (vfs, tmpdir) = assert_vfs_setup!(Vfs::stdfs(), "stdfs_func_dirs");
/// let dir1 = tmpdir.mash("dir1");
/// let... | Rust | 0 |
```rust
/// use dasp_signal::{self as signal, Signal};
/// use dasp_signal::bus::SignalBus;
///
/// fn main() {
/// let frames = [[0.1], [0.2], [0.3], [0.4], [0.5], [0.6]];
/// let signal = signal::from_iter(frames.iter().cloned());
/// let bus = signal.bus();
/// let mu... | Rust | 0 |
start_idx..self.parts.len() {
let depth_change = self.parts[part_idx].num_embedded() as i32 - 1;
depth += depth_change;
debug_assert!(depth >= 0);
if depth == 0 {
return part_idx + 1;
}
}
debug_assert!(false, "incorrectly con... | Rust | 0 |
. When it reaches zero, we assume no pages are still mmapped, and
/// it's safe to destroy current virtual memory entry.
/// Obviously this doesn't cover all cases, but it's worth pointing out that
/// it's unspecified behavior to munmap() a page that's not established via
/// mmap(). So in practice it ... | Rust | 0 |
import streamlit as st
from api import call_gemini
def render(api_key):
st.header("📝 MCQ Maker")
lesson_objective = st.text_input("Enter Lesson Objective:")
key_concepts = st.text_input("Enter Key Concepts:")
if st.button("Generate MCQs"):
if not api_key:
st.error("Please add your ... | Python | 1 |
import asyncio
from gtts import gTTS
import io
from fastapi.responses import StreamingResponse
from fastapi import FastAPI,HTTPException,APIRouter
from TTS.tts_engine import generate_audio
generate_audio_router = APIRouter()
valid_languages = {
"punjabi":"pa",
"english":"en",
"hindi":"hi"
}
@generate_aud... | Python | 1 |
ved().pos, 0);
cursor += 4;
assert_eq!(*cursor.current(), 5);
assert_eq!(cursor.as_slice_loaded(), &[1, 2, 3, 4, 5]);
cursor.save();
assert_eq!(cursor.saved().pos, 4);
cursor -= 3;
assert_eq!(*cursor.current(), 2);
assert_eq!(cursor.as_slice_loaded(), &[2, 3, 4, 5]);
}
#[test]
fn e... | Rust | 0 |
f(&DOMHTMLButtonElement::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::will-validate\0".as_ptr() as *const _,
Some(transmute::<_, unsafe exte... | Rust | 0 |
"""
Utility functions for interacting with Pinecone - in particular, functions to get the embeddings
from text using Pinecone API, and then upload the embeddings to Pinecone index.
The index will be used in the app to provide RAG inference for real-time question answering with LLMs.
"""
def get_text_embeddings_fro... | Python | 1 |
Expr::tbl(update_user_table, IamAccount::Id).equals(IamAccountIdent::Table, IamAccountIdent::UpdateUser),
)
.and_where(Expr::tbl(IamAccountIdent::Table, IamAccountIdent::RelAccountId).eq(account_id))
.order_by(IamAccountIdent::UpdateTime, Order::Desc)
.done();
let items =... | Rust | 0 |
nce for this operation. See sliding_nonce.move for details.
RotateAuthenticationKeyWithNonceAdmin { sliding_nonce: u64, new_key: Bytes },
/// Rotate the authentication key of `to_recover` to `new_key` using the `KeyRotationCapability`
/// stored under `recovery_address`.
///
/// ## Aborts
/// *... | Rust | 0 |
<gh_stars>1-10
use std::pin::Pin;
use futures::task::{Context, Poll};
use crate::actor::Actor;
use crate::fut::{ActorFuture, ActorStream};
/// A combinator used to convert stream into a future, future resolves
/// when stream completes.
///
/// This structure is produced by the `ActorStream::finish` method.
#[deriv... | Rust | 0 |
roundtrip("a");
roundtrip(r"\[");
roundtrip_with(|b| b.octal(true), r"\141");
roundtrip(r"\x61");
roundtrip(r"\x7F");
roundtrip(r"\u0061");
roundtrip(r"\U00000061");
roundtrip(r"\x{61}");
roundtrip(r"\x{7F}");
roundtrip(r"\u{61}");
roundtri... | Rust | 0 |
st CHARSET: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ\
abcdefghijklmnopqrstuvwxyz\
0123456789";
const LEN: usize = 16;
let mut rng = rand::thread_rng();
let name: String = (0..LEN)
.map(|_| {
let idx = rng.gen_range(0, CHARSET.len());
... | Rust | 0 |
sys.exit()
def display_lives(self):
for live in range(self.lives - 1):
x = self.live_x_start_pos + (live * (self.live_surf.get_size()[0] + 10))
screen.blit(self.live_surf,(x,8))
def display_score(self):
score_surf = self.font.render(f'score: {self.score}',False,'white')
score_rect = score_surf.get_rec... | Python | 1 |
if not db_task:
logger.warning(f"未找到任务日志,celery_task_id: {celery_task_id}")
return None
if started_at is None:
started_at = datetime.utcnow()
db_task.status = 'STARTED'
db_task.started_at = started_at
db_task.worker_name ... | Python | 1 |
(),
term_en: "".to_string(),
term_jp: "".to_string(),
disabled: false,
};
let rakuten = Rakuten {
client: reqwest::blocking::Client::builder().build().unwrap(),
};
match rakuten.get_lowest_prices(item) {
Ok(prices) => {
println!("lowest price new: {}... | Rust | 0 |
format/tree/v1.4.5#d3-format. And for dates
see: https://github.com/d3/d3-time-
format/tree/v2.2.3#locale_format. We add two
items to d3's date formatter: "%h" for half of
the year as a decimal number as well as "%{n}f"
for... | Python | 1 |
ueWriteError` on any I/O error occurred while writing either the
/// marker or the data.
pub fn write_i16<W: Write>(wr: &mut W, val: i16) -> Result<(), ValueWriteError> {
write_marker(wr, Marker::I16)?;
write_data_i16(wr, val)?;
Ok(())
}
/// Encodes and attempts to write an `i32` value as a 5-byte sequence... | Rust | 0 |
{
_x
} else {
continue;
}
}};
}
macro_rules! ok_or_error {
($e:expr) => {{
match $e {
Ok(_x) => (),
Err(e) => {
error!("Error: {:?}", e);
}
}
}};
}
fn sock_unix_path(fd: RawFd) -> Result<PathBuf, E... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
LambdaScrapers Module
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, or
(at your option) any later version.
This... | Python | 1 |
.10], vec![0..2, 2..4, 4..7, 7..8]] {
let sub = mwork("1", sub);
let result = subtract(inter.clone(), sub);
assert!(result.is_empty());
}
}
#[test]
fn complex() {
// Test case 1
let inter_1 = mwork("1", vec![1..3, 2..8, 2..4, 5..6, 7..9, 10..11, 0... | Rust | 0 |
1)? & !page_size_m1;
let num_growth_bytes = num_bytes - nonnull_slice_len(ptr);
let ptr_end = (ptr.as_ptr() as *mut u8).wrapping_add(nonnull_slice_len(ptr));
let ptr_growth_start = libc::mmap(
ptr_end as _,
num_growth_bytes,
libc::PROT_WRITE | libc::PROT_REA... | Rust | 0 |
ords)
# by converting the token to tuple of characters and add </w> to the last character
word = tuple(token[:-1]) + (token[-1] + WORD_BOUNDARY,)
# get all pairs of adjacent characters
pairs = _get_pairs(word)
# merge symbol pairs until there are no possible merges left
... | Python | 1 |
= Duration::from_millis(1000);
const ALIEN_BULLET_LESS_EIGHT_DURATION: Time = Duration::from_millis(70);
const ANIMATE_ALIEN_BULLET_DURATION: Time = Duration::from_millis(20);
const ALIEN_STEP_DOWN: u32 = 8;
const ALIEN_ONE_PADDING: u32 = 10;
const ALIEN_TOP_LEFT_X_START_POSITION: u32 = 220;
const ALIEN_TOP_LEFT_Y_STA... | Rust | 0 |
from ananta.tui import ListBoxWithScrollBar
import urwid
import pytest
# Mark all tests in this file as TUI tests
pytestmark = pytest.mark.tui
class TestListBoxWithScrollBar:
def test_render_with_scrollbar(self):
"""Test that the scrollbar is rendered when the content is larger than the view."""
... | Python | 1 |
# coding: utf-8
"""
Codebeamer swagger API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
i... | Python | 1 |
libc::setfsuid(user.uid);
libc::setgid(user.primary_group);
};
}
pub fn set_file_owner<T>(path: T, user: &User) -> Result<()>
where
T: AsRef<Path>,
{
let path = CString::new(path.as_ref().as_os_str().as_bytes())?;
let r = unsafe { libc::chown(path.as_ptr(), user.uid, user.primary_group) };
... | Rust | 0 |
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.read_csv('WHO COVID-19 cases.csv')
df.drop(columns=['Country_code', 'New_cases', 'New_deaths'], inplace=True)
df['Date_reported'] = pd.to_datetime(df['Date_reported'])
df = df[df['Continent'] != 'Uncategorized']
total_cases = df.groupb... | Python | 1 |
nix::sys::signal::{signal, SigHandler, Signal};
use std::env;
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() != 2 {
println!("Usage: {} <target program>", args[0]);
std::process::exit(1);
}
let target = &args[1];
// Disable handling of ctrl+c in this proc... | Rust | 0 |
import config
from device import ch9329
import time
import mPosition
# 定义几个方向的变量,记录按键是否按下.为了避免冲突,我们在前面加一个 x 或者 y
# 移动方法
def yidong(juese_zuobiao, mubiao_zuobiao):
# global x_left, x_right, y_up, y_down
x_left = 0
x_right = 0
y_up = 0
y_down = 0
print(f'人物坐标:{juese_zuobiao}, 目标坐标:{mubiao_zuobi... | Python | 1 |
"""Debian logo"""
from archey.colors import Colors
COLORS = [Colors.RED_BRIGHT, Colors.RED_NORMAL]
LOGO = [
"""{c[0]} _sudZUZ#Z#XZo=_ """,
"""{c[0]} _jmZZ2!!~---~!!X##wx """,
"""{c[0]} .<wdP~~ -!YZL, """,
"""{c[0]} .mX2' _xaaa__ XZ[.""",
"""{c[0]}... | Python | 1 |
!($i, $($args)*) {
$crate::IResult::Done(i, o) => $crate::IResult::Done(i, $gen(o)),
$crate::IResult::Error => alt!($i, $($rest)*)
}
};
($i:expr, $e:ident => { $gen:expr } | $($rest:tt)*) => {
alt!($i, call!($e) => { $gen } | $($rest)*)
};
($i:expr, $e:ident => ... | Rust | 0 |
def chatbot():
print("ChatBot: Hello! Type 'bye' to quit.")
while True:
user = input("You: ").lower()
if user in ["hi", "hello"]:
print("ChatBot: Hi there!")
elif user == "how are you":
print("ChatBot: I'm doing great, thanks!")
elif user == "bye":
... | Python | 1 |
LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, or distributed except according to those terms.
////////////////////////////////////////////////////////////////////////////////
#![cfg... | Rust | 0 |
x = input()
i = int(x)
f = float(x)
s = str(x)
c = complex(x)
print(i, type(i))
print(f, type(f))
print(s, type(s))
print(c, type(c))
| Python | 1 |
ut map: HashMap<isize, usize> = HashMap::new(); // Space Complexity O(n)
let mut result: Vec<isize> = Vec::with_capacity(2); // Space Complexity O(1).
for (index, &num) in nums.iter().enumerate() {
let diff = target - num;
if map.contains_key(&diff) {
result.pus... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bizmeka 로그인 후 상태 확인
"""
import asyncio
from playwright.async_api import async_playwright
import os
async def bizmeka_login_with_check():
"""로그인 후 상세 확인"""
print("\n[BIZMEKA LOGIN CHECK]")
print("="*50)
os.makedirs("logs/bizmeka", exist_ok=Tru... | Python | 1 |
e}")
# 后台输入函数
def send_background_key(hwnd, key_code, is_down=True):
"""后台发送键盘消息"""
flags = win32con.WM_KEYDOWN if is_down else win32con.WM_KEYUP
scan_code = win32api.MapVirtualKey(key_code, 0)
lParam = 0x00000001 | (scan_code << 16)
if not is_down:
lParam |= 0xC0000000
win32api.Post... | Python | 1 |
, input, target):
if self.zero_mean:
input_mean = torch.mean(input, dim=-1, keepdim=True)
target_mean = torch.mean(target, dim=-1, keepdim=True)
input = input - input_mean
target = target - target_mean
alpha = (input * target).sum(-1) / (((target ** 2).su... | Python | 1 |
.position = prev.position + next_velocity;
});
self.time += 1;
out_bodies
}
pub fn tick_par_reduce(&mut self) -> &[Body] {
let (in_bodies, out_bodies) = if (self.time & 1) == 0 {
(&self.bodies.0, &mut self.bodies.1)
} else {
(&self.bodies.1,... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# 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... | Python | 1 |
def dollars_to_dirhams(dollars):
return dollars * 10
def meters_to_kilometers(meters):
return meters / 1000
| Python | 1 |
.collect::<Vec<_>>()
.into();
Some(Path {
id: vec![(None, 0)],
nodes,
edges,
user_split: PathSplit {
cuts: MyVec(vec![0]),
alphas: MyVec(vec![self.last_pref]),
dimension_costs: MyVec(vec![total_d... | Rust | 0 |
# coding: utf-8
#Copyright (C) 2024 Xiaomi Corporation.
#The source code included in this project is licensed under the Apache 2.0 license.
import argparse
import subprocess
import sys
import time
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.dirname(os.path.dirname(os.pa... | Python | 1 |
OVERFLOWED: EventId =
EventId(unsafe { NonZeroU32::new_unchecked(EventId::MAX_INTERNAL_ID - 4) });
/// The report destination buffer is too small to fit a header and/or the frontier clocks
pub const EVENT_INSUFFICIENT_REPORT_BUFFER_SIZE: EventId =
EventId(unsafe { NonZeroU32::new_unchecked(Event... | Rust | 0 |
shaders/test.vert",
"examples/texture_example/resources/shaders/test.frag",
);
let material = Material::new(&shader);
let mut square = Shape::new_with_usage(
&square_v,
&square_i,
&material,
&[0, 1, 2],
gl::DYNAMIC_DRAW,
);
square.set_texture_path("ex... | Rust | 0 |
oot = Self::find_internal(&mut self.set, i);
let avg_set_size = self.set.len() / self.subset_count;
let mut subset = HashSet::with_capacity(avg_set_size);
let set = &mut self.set;
self.map
.iter()
.filter(|(_, &i)| root == Self::find_internal(set, i))
.for_each(|(&elem, _)| {
subset.insert(elem);
... | Rust | 0 |
ite(mut self, rewrite: bool) -> Self {
self.rewrite = rewrite;
self
}
/// Convert ironman data to plaintext
pub fn melt(&self, data: &[u8]) -> Result<(Vec<u8>, HashSet<u16>), Eu4Error> {
let mut out: Vec<u8> = b"EU4txt\n".to_vec();
let mut unknown_tokens = HashSet::new();
... | Rust | 0 |
ster resets it
// to 00h.
// Note: The divider is affected by CGB double speed mode, and will increment at 32768Hz in double speed.
div: u8,
// This timer is incremented by a clock frequency specified by the TAC register ($FF07). When the value overflows
// (gets bigger than FFh) then it will be res... | Rust | 0 |
st NL80211_ATTR_RESP_IE: nl80211_attrs = 78;
pub const NL80211_ATTR_PREV_BSSID: nl80211_attrs = 79;
pub const NL80211_ATTR_KEY: nl80211_attrs = 80;
pub const NL80211_ATTR_KEYS: nl80211_attrs = 81;
pub const NL80211_ATTR_PID: nl80211_attrs = 82;
pub const NL80211_ATTR_4ADDR: nl80211_attrs = 83;
pub const NL80211_ATTR_SU... | Rust | 0 |
foo>"
)
);
}
#[test]
fn removed() {
test!(
|c| {
skip_eof_chunk!(c);
assert!(!c.removed());
c.remove();
assert!(c.removed());
c.before("... | Rust | 0 |
64) -> ResultReaddir {
let ospath = path_to_str(path);
let mut result = Vec::new();
let cb = &mut |entry: ListEntry| {
result.push(DirectoryEntry {
name: OsString::from(&*entry.name),
kind: if entry.is_branch {
FileType::Directory
... | Rust | 0 |
(
5921,
("ILP", "NWWE", -22.588899612426758, 167.45599365234375),
),
(5922, ("FBD", "OAFZ", 37.121101, 70.518097)),
(5924, ("UNKNOWN", "OEDW", 24.5, 44.400001525878906)),
(5925, ("AJF", "OESK", 29.78510093688965, 40.099998474121094)),
(
5926,
("WAE", "OEWD", 20.504299... | Rust | 0 |
[sp, #-0x10]!
; ldr x0, >self_regs_addr
; stp x2, x3, [x0, #0x10]
; stp x4, x5, [x0, #0x20]
; stp x6, x7, [x0, #0x30]
; stp x8, x9, [x0, #0x40]
; stp x10, x11, [x0, #0x50]
; stp x12, x13, [x0, #0x60]
; stp x14, x15, [x0, #... | Rust | 0 |
from flask import Flask
from flask_login import LoginManager
from flask_sqlalchemy import SQLAlchemy
from os import path
import os
from werkzeug.security import generate_password_hash, check_password_hash
db = SQLAlchemy()
DB_NAME = "database.db"
tables = []
def infinite_couterchange(new_value):
infinite_counte... | Python | 1 |
from django.urls import path
from . import views
urlpatterns = [
path('test/', views.test_websocket, name='test_websocket'),
path('audio-test/', views.audio_ws_test, name='audio_ws_test'),
] | Python | 1 |
y, not a file")
os.makedirs(save_directory, exist_ok=True)
qformer_tokenizer_path = os.path.join(save_directory, "qformer_tokenizer")
self.qformer_tokenizer.save_pretrained(qformer_tokenizer_path)
# We modify the attributes so that only the tokenizer and image processor are saved in the... | Python | 1 |
#!/usr/bin/env python3
"""
Script to update visual test baselines.
Run this when you've intentionally changed something visual and need to
update the reference images for regression testing.
Usage (from repository root):
uv run python scripts/update_baselines.py
This will:
1. Generate all visual test plots
2. Sa... | Python | 1 |
import pyspark.sql.functions as F
from butterfree.constants import DataType
from butterfree.transform import FeatureSet
from butterfree.transform.features import Feature, KeyFeature, TimestampFeature
from butterfree.transform.transformations import SparkFunctionTransform
from butterfree.transform.utils import Function... | Python | 1 |
SERVICE_ASYNC_INFO, lpcsaddrbuffer: *mut ::core::ffi::c_void, lpdwbufferlength: *mut u32, lpaliasbuffer: ::windows_sys::core::PWSTR, lpdwaliasbufferlength: *mut u32) -> i32;
#[doc = "*Required features: `\"Win32_Networking_WinSock\"`*"]
pub fn GetHostNameW(name: ::windows_sys::core::PWSTR, namelen: i32) -> i32... | Rust | 0 |
&mut Child) {
use std::thread;
use std::time::Duration;
let mut master = unsafe { File::from_raw_fd(master_fd) };
'events: loop {
for event in console.window.events() {
let event_option = event.to_option();
let console_w = console.ransid.state.w;
let conso... | Rust | 0 |
)
if is_wall(self.x, self.y + 8) or is_wall(self.x + 7, self.y + 8):
if self.direction < 0 and (
is_wall(self.x - 1, self.y + 4) or not is_wall(self.x - 1, self.y + 8)
):
self.direction = 1
elif self.direction > 0 and (
is_wall... | Python | 1 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | Python | 1 |
from enum import Enum
from urllib.parse import quote
class DexEnum(str, Enum):
WOOFI = "Woofi"
PUMP_FUN = "Pump.fun"
WHIRLPOOL = "Whirlpool"
VIRTUALS = "Virtuals"
DAOS_FUN = "Daos.fun"
LIFINITY_V2 = "Lifinity V2"
STABBLE_STABLE_SWAP = "Stabble Stable Swap"
TOKEN_MILL = "Token Mill"
... | Python | 1 |
st = "Assalam o Alaikum ! Ramzan Mubarak is Coming, May Allah fulfill our wishes and forgive our sins"
f = open('myFile.txt', 'w')
f.write(st)
f.close()
| Python | 1 |
#!/usr/bin/python3
class CalculatorController:
"""
A class that represents a calculator controller.
Attributes:
history (list): A list to store the history of operations.
Methods:
calculate(expression): Calculates the result of the given expression.
add_to_history(operation): ... | Python | 1 |
ring
/// [`center`]: crate::String::center
/// [encoding-aware]: crate::Encoding
/// [Conventionally UTF-8]: crate::Encoding::Utf8
#[derive(Debug, Clone)]
pub struct Center<'a, 'b> {
pub left: Take<Cycle<slice::Iter<'b, u8>>>,
pub next: Option<&'a [u8]>,
pub s: Chars<'a>,
pub right: Take<Cycle<slice::It... | Rust | 0 |
&(Op::Beq, "beq", OpC::B, &|p| {
p.ex.br = if p.rf.rt == p.rf.rs { true } else { false };
}),
// Branches to the branch address if register p.rf.rs is not equal to p.rf.rt.
&(Op::Bne, "bne", OpC::B, &|p| {
p.ex.br = if p.rf.rt != p.rf.rs { true } else { false };
}),
// Branche... | Rust | 0 |
'_' => false,
// Anything else will be replaced with the '_' character.
_ => true,
},
"_",
);
Ok(name)
}
/// Find the target directory.
pub fn get_meta_target_directory(opt: &Opt) -> CVResult<PathBuf> {
// FIXME: add '--cfg=verify' to RUSTFLAGS?... | Rust | 0 |
class MyClass:
x = 5 | Python | 1 |
des articles, s'ils ont été récupérés
if articles:
sortie = "" # str vide initialisée pour la sortie
for index, art in enumerate(articles): # boucle avec index pour suivre la position
article_url = art['url'] # récupère l'URL
try:
#... | Python | 1 |
info")
)
# Timeout configuration prioritizes command line arguments
gunicorn_config.timeout = (
global_args.timeout * 2
if global_args.timeout is not None
else int(os.getenv("TIMEOUT", 150 * 2))
)
# Keepalive c... | Python | 1 |
mbobox(top_frame, values=group_names, state='readonly')
cbo_group.pack(side='left', padx=5)
cbo_group.bind('<<ComboboxSelected>>', lambda e: update_table(get_foods_by_group(cbo_group.get())))
# Table danh sách món ăn
columns = ('MaMonAn', 'TenMonAn', 'DonViTinh', 'DonGia', 'TenNhom')
tree = ttk.Treeview(root, columns=... | Python | 1 |
i64_ty = context.i64_type();
let fn_type = i8_ty.fn_type(&[i16_ty.into()], false);
let read_mem_external = module.add_function("readMemExternal", fn_type, None);
let inaccessible_mem_only = context.create_enum_attribute(INACCESSIBLE_MEM_ONLY, 0);
let no_unwind = context.create_enum_attribute(NO_UNWIND,... | Rust | 0 |
();
let mut vni = Vec::new();
for vertex in &line[1..] {
let args: Vec<_> = vertex
.split('/')
.chain(std::iter::repeat(""))
.take(3)
.collect();
let vert_index = parse_index(args[0], vertices.len());
vi.push(vert_index.ok_or_else(|| invali... | Rust | 0 |
# Copyright (c) Microsoft. All rights reserved.
from pytest import mark, raises
from semantic_kernel.exceptions import ValBlockSyntaxError
from semantic_kernel.functions.kernel_arguments import KernelArguments
from semantic_kernel.kernel import Kernel
from semantic_kernel.template_engine.blocks.block_types import Blo... | Python | 1 |
olds to perform inference.
:param result_path: Directory path to save the results (text file containig categorical emotion and continuous emotion dimension prediction per image).
:param context_norm: List containing mean and std values for context images.
:param body_norm: List containing mean and std values for... | Python | 1 |
eature = "defmt")]
pub trait ToFrame: core::fmt::Debug + defmt::Format + Sync {
fn to_frame(&self) -> Frame;
}
#[cfg(not(feature = "defmt"))]
pub trait ToFrame: core::fmt::Debug + Sync {
fn to_frame(&self) -> Frame;
}
#[cfg(feature = "fonts")]
pub mod fonts {
use super::*;
impl ToFrame for &[u8; 5] {... | Rust | 0 |
import sys
import json
import requests
import warnings
from urllib3.exceptions import InsecureRequestWarning
from dotenv import load_dotenv
import os
# ✅ Load .env file from a specific path
load_dotenv(dotenv_path="/home/nifi/nifi2/HR_Bot/.env")
warnings.simplefilter('ignore', InsecureRequestWarning)
def fetch_resum... | Python | 1 |
#
# This file is part of the Chemical Data Processing Toolkit
#
# Copyright (C) Thomas Seidel <thomas.seidel@univie.ac.at>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versi... | Python | 1 |
ddd
11-12 n: nnnnnnnnnndp
10-11 f: wfflfwfffrfblsgfvrff
16-17 x: xxxxxxxxxxxxxxxfx
2-4 k: kkckk
3-5 g: tpggzglgzw
10-14 v: vvvvhqtbvmvvvzn
8-11 z: zzzzbtczzfvgzz
4-5 l: dsvlllgldllcb
6-7 b: bkbzbsb
2-5 m: xrmmmmmmmmdmmmmmm
3-4 f: fdft
2-3 j: jjpjl
5-8 g: ggjqmrgngdgmbz
4-6 x: xnxwzk
11-17 h: hhhhhhhhdhhhhhhhfhhh
5-13 f... | Rust | 0 |
0.0
});
return DataTypes::FloatType(FloatType{value : return_value / denom});
}
}
impl CalculateVariance for IntegerType {
fn variance(columns : &Vec<DataTypes>) -> DataTypes {
let mean_value : i64 = IntegerType::mean(&columns).ivalue();
let denom : i64 = colu... | Rust | 0 |
mages = columns[9].find_elements(By.XPATH, ".//img[contains(@class, 'a-img')]")
for img in energy_images[1:]:
alt = img.get_attribute("alt")
# print(alt)
energy_list.append(alt)
energy_list_per_move = []
move_energies = []
f... | Python | 1 |
# SPDX-License-Identifier: MIT
import struct
from enum import IntEnum
from ..utils import *
from ..malloc import Heap
from .dart8020 import DART8020, DART8020Regs
from .dart8110 import DART8110, DART8110Regs
__all__ = ["DART"]
class DART(Reloadable):
PAGE_BITS = 14
PAGE_SIZE = 1 << PAGE_BITS
def __ini... | Python | 1 |
import time
import threading
def process(name, duration):
for i in range(duration):
print(f"{name} is running... {i+1}")
time.sleep(1)
def timer_interrupt():
while True:
time.sleep(10) # Fill in the blank: Set the timer interval (in seconds)
print("Timer interrupt: Switching p... | Python | 1 |
f.write_str("expected another byte, found none")
}
DecompressError::OffsetOutOfBounds => {
f.write_str("the offset to copy is not contained in the decompressed buffer")
}
DecompressError::UncompressedSizeDiffers { actual, expected } => {
... | Rust | 0 |
roof` - raw bytes
/// * `raw_tx` - raw bytes
#[weight = 1000]
fn execute_redeem(origin, redeem_id: H256, tx_id: H256Le, tx_block_height: u32, merkle_proof: Vec<u8>, raw_tx: Vec<u8>)
-> DispatchResult
{
let vault_id = ensure_signed(origin)?;
ext::secur... | Rust | 0 |
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, TypeVar
from attrs import define as _attrs_define
from attrs import field as _attrs_field
if TYPE_CHECKING:
from ..models.model_with_circular_ref_in_additional_properties_a import ModelWithCircularRefInAdditionalPropertiesA
T = TypeVar("... | Python | 1 |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE_Lavis file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import webdataset as wds
from video_llama.datasets.datasets.base_dataset import BaseDataset
... | Python | 1 |
at when displayed uses the local time zone.
fn into_local_display(self) -> Self::D;
/// Turns self into a displayable type that when displayed uses the UTC time zone.
fn into_utc_display(self) -> Self::D;
}
/// Implements `Display` in a pretty style for some Tm instance.
///
/// The format is `month day ye... | Rust | 0 |
"""
This node is responsible for creating the steps for the research process.
"""
# pylint: disable=line-too-long
from datetime import datetime
from langchain_core.messages import HumanMessage
from langchain_core.runnables import RunnableConfig
from copilotkit.langchain import copilotkit_customize_config
from pydanti... | Python | 1 |
def single_root_words(root, *words):
return [word for word in words if word.lower() in root.lower() or root.lower() in word.lower()]
result1 = single_root_words('rich', 'richest', 'orichalcum', 'cheers', 'riches')
result2 = single_root_words('Disablement', 'Able', 'Mable', 'Disable', 'Bagel')
print(result1)
print... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.