text string | label_name string | labels int64 |
|---|---|---|
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-Licens... | Python | 1 |
0]["content"] = before_document + doc_tree[0]["content"]
doc_tree[-1]["content"] = doc_tree[-1]["content"] + after_document
if saved_stuff:
for el in doc_tree:
el["content"] = re.compile(r"%[ce] ").sub(lambda x: saved_stuff.pop(0), el["content"])
if self.config["htm... | Python | 1 |
to reward the user)
pub ConcernVotes get(fn votes_concern): map hasher(identity)
IdentityId<T> => Vec<ConcernCID> = Vec::new();
/// Total votes for concerns
pub ConcernVoteCount get(fn vote_count_concern): u32 = 0;
/// Tickets used as reference for council polls targeting proposals
pub CouncilVoteTickets... | Rust | 0 |
import time
import requests
import json
def rotate(send,programs):
yaws=[0,90,180,270]
for yaw in yaws:
command=f"bot.chat('/execute as bot at @s run tp @s ~ ~ ~ {yaw} 0');"
send(command,programs=programs)
# time.sleep(1)
def change_to_bot(send,programs):
command = "bot.chat('/spec... | Python | 1 |
from django.contrib import admin
from app.common.admin import BaseModelAdmin
from .models import Crypto, Order
@admin.register(Crypto)
class CryptoAdmin(BaseModelAdmin):
list_display = ("name", "is_active")
@admin.register(Order)
class OrderAdmin(BaseModelAdmin):
list_display = (
"crypto",
... | Python | 1 |
from __future__ import absolute_import, division, print_function
from PySide2.QtCore import QTimer
from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEnginePage
import sys, os
WeblglChecklibpath = os.path.join(os.path.dirname(os.path.abspath(__file__)), "webgl_check.js")
htmlstr1 = """
<html lang="en">
<he... | Python | 1 |
#!/usr/bin/env python
################################################################################
# defaultdict examples
import torch
from collections import defaultdict
word_count = defaultdict(lambda: 0) # return 0 if absent key
sentence = "the man and the dog and the tree"
for word in sentence.split():
word_... | Python | 1 |
"""
Python mapping for the QuartzComposer framework.
This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
"""
def _setup():
import sys
import Foundation
from Quartz import CoreGraphics
import objc
from . ... | Python | 1 |
r("Invalid value for reverse. Use 'yes' or 'no'.")
else:
raise ValueError("Invalid vignette_shape. Use 'circle', 'oval', or 'square'.")
# Apply GaussianBlur to the alpha mask for feathering
alpha_mask = alpha_mask.filter(ImageFilter.GaussianBlur(RADIUS))
... | Python | 1 |
e
ignored_regex = None
dom = None
try:
dom = se.easy_xml.EasyXmlTree(xhtml)
except Exception:
return (False, None)
# Ignore some SE files.
# Default ignore list.
if ignored_types is None:
ignored_regex = "(colophon|titlepage|imprint|copyright-page|halftitlepage|toc|loi)"
elif len(ignored_types) > 0:
... | Python | 1 |
#!/usr/bin/env python3.11
# Copyright 2024, Gurobi Optimization, LLC
# This example formulates and solves the following simple QCP model:
# maximize x
# subject to x + y + z = 1
# x^2 + y^2 <= z^2 (second-order cone)
# x^2 <= yz (rotated second-order cone)
# x, y, z... | Python | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from typing import List
from pxr import Usd
def find_prims_by_name(stage: Usd.Stage, prim_name: str) -> List[Usd.Prim]:
found_prims = [x for x in stage.Traverse() if x.GetName(... | Python | 1 |
ontent and process it for tokens
else:
text_content = list_str
try:
encoding = tiktoken.get_encoding(encoding_name)
return len(encoding.encode(text_content))
except Exception as e:
logger.warning(f"Error encodin... | Python | 1 |
"kissat")? {
/// None => panic!("problem is SAT"),
/// Some(solution) => match solution.get_const_value(&Symbol(String::from("x")).into()) {
/// Some(Term::Constant(c)) => match c.as_ref() {
/// Constant::Numeral(x) => assert!(x >= &(5u8.into())),
/// _ => panic!("expected numer... | Rust | 0 |
n_file)
assert mesh is not None
assert mesh.n_points == 8 # cube has 8 vertices
assert mesh.n_cells > 0 # should have faces
# Check cell data
assert "object_type" in mesh.cell_data
assert "object_id" in mesh.cell_data
def test_read_cityjson_with_pathlib_path(sample_cityjson_file):
"""T... | Python | 1 |
ps)
if stride != 1:
raise NotImplementedError(
"IrrepsArray.slice_by_mul does not support strides."
)
irreps = []
list = []
i = 0
for (mul, ir), x in zip(self.irreps_array.irreps, self.irreps_array.chunks):
if start <= i and i ... | Python | 1 |
self) -> IonCResult<ION_TYPE>;
/// Returns the type of the current position.
///
/// ## Usage
/// ```
/// # use std::convert::*;
/// # use ion_c_sys::*;
/// # use ion_c_sys::reader::*;
/// # use ion_c_sys::result::*;
/// # fn main() -> IonCResult<()> {
/// let mut reader = IonC... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
override the default manager
"""
from django.db import models
from django.db.models.query import QuerySet
class EventQuerySet(QuerySet):
"""
The admin will always order the result
(see dkago/contrib/admin/views/main.py ling 260)
It will keep the right order and avoid th... | Python | 1 |
#!/usr/bin/env python
# -*- encoding: UTF-8 -*-
#
# 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.
#
# T... | Python | 1 |
__all__ = ["React"]
import tacticenv
class React():
@classmethod
def load_libraries(cls, widget):
from tactic.ui.tools import BaseReactWdg as ReactWdg
tactic_src_dir = tacticenv.get_install_dir()
react_dir = "%s/src/tactic/react" % tactic_src_dir
#jsx_path = "%s/redux/stor... | Python | 1 |
& decode the value from storage.
///
/// Note that if you want to do some checks based on the value
/// and write changes after that you should rather be using `mutate`.
///
/// The function returns `None` if the value was not found in storage,
/// otherwise a decoding of the value to requested type.
pub fn get<... | Rust | 0 |
let vmx_misc = unsafe { Msr::new(IA32_VMX_MISC).read() };
let timer_rate = 2_u64.pow(((vmx_misc & 0xf)).try_into().unwrap());
// Calculate the number of preemption timer ticks to achieve the wanted
// number of fires per second (passed in argument)
// let ti... | Rust | 0 |
_correct = Matrix::from(&[
[ sqrt2, 0.0, 0.0, 0.0, 0.0],
[1.0/sqrt2, f64::sqrt(3.0/2.0), 0.0, 0.0, 0.0],
[1.0/sqrt2, f64::sqrt(3.0/2.0), f64::sqrt(7.0), 0.0, 0.0],... | Rust | 0 |
>Vc @ sk d Z d d l Z e j d k r' e n e Z d d l Z d d l Z d e j f d YZ e j
Z d S( sA autogenerated by genpy from nav_msgs/GetMapGoal.msg. Do not edit.iNi t
GetMapGoalc B sb e Z d Z d Z e Z d Z g Z g Z d Z d Z
d Z d ... | Python | 1 |
_1() {
assert_eq!(my_atoi("42"), 42);
}
#[test]
fn test_2() {
assert_eq!(my_atoi(" -42"), -42);
}
#[test]
fn test_3() {
assert_eq!(my_atoi("4193 with words"), 4193);
}
}
use std::io::{Read, Write};
use crate::error::{Error, Result};
use crate::{ULEB128_U3... | Rust | 0 |
,
pub gamemode: VarInt,
}
#[derive(Debug, Clone, PartialEq, Encode, Decode)]
pub struct PlayerInfoUpdateLatency {
pub uuid: Uuid,
pub ping: VarInt,
}
#[derive(Debug, Clone, PartialEq, Encode, Decode)]
pub struct PlayerInfoUpdateDisplayName {
pub uuid: Uuid,
pub has_display_name: Boolean,
#[dec... | Rust | 0 |
# metrics_calculator.py
import numpy as np
from signal_processor import SignalProcessor
import json
class MetricsCalculator:
"""
Classe para cálculo de métricas do ECG.
"""
def __init__(self, signal_processor):
self.signal_processor = signal_processor
def calculate_metrics(self, signal... | Python | 1 |
", {})
if not provider_id:
results.append(
{"id": None, "success": False, "error": "ID провайдера не указан"}
)
continue
try:
# Проверяем существование провайдера
existing_provider = get_provide... | Python | 1 |
ce_mesh = device_mesh
# register input_fn as module forward pre hook
if input_fn is not None:
# check the input_fn signature
num_args = len(inspect.signature(input_fn).parameters)
if num_args == 2:
# input_fn only takes in inputs and device mesh
logger.warning(
... | Python | 1 |
)
if __name__ == "__main__":
pretrained_dir = os.path.abspath("./pretrained_spanbert")
bert = SpanBERT(pretrained_dir=pretrained_dir)
examples = [
{"tokens": "Bill Gates is the founder of Microsoft".split(), "subj": ('Bill Gates', "PERSON", (0,1)), "obj": ('Microsoft', "ORGANIZATION", (6,6))},
... | Python | 1 |
, JsonSchema, Clone)]
#[serde(untagged)]
pub enum Condition {
/// Check if field satisfies provided condition
Field(FieldCondition),
/// Check if points id is in a given set
HasId(HasIdCondition),
/// Nested filter
Filter(Filter),
}
#[derive(Debug, Deserialize, Serialize, JsonSchema, Clone)]
#[... | Rust | 0 |
o_final_dis <= min_final_meter:
# print("Find goal")
goal_node.parent_index = current.parent_index
goal_node.angle = current.angle
goal_node.cost = current.cost
break
# Remove the item from the open set
del open_set... | Python | 1 |
name = name.replace("1资讯", "凤凰资讯台")
name = name.replace("2中文", "凤凰台")
name = name.replace("3XG", "香港台")
name = name.replace("上海卫视", "东方卫视")
name = name.replace("全纪实", "乐游纪实")
... | Python | 1 |
that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If... | Rust | 0 |
ame_dn = win32security.TranslateName(options.account_name,
win32api.NameUnknown,
win32api.NameFullyQualifiedDN)
log(2, "NameFullyQualifiedDNis '%s'",options.account_name_dn)
# do it... | Python | 1 |
a9-120c-4c92-bed0-9f037537d4f2/",
"crosscheck_author_name": "Василиса Прекрасная",
}
],
},
disable_antispam=True,
)
@pytest.mark.parametrize("should_send", [True, False])
def test_send_if_should(notification, answer, mocker, should_send):
mocker.... | Python | 1 |
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under... | Python | 1 |
";
// let input_fname = "input/15-demo.txt";
// Input data processing
let data: Vec<String> = fs::read_to_string(input_fname)
.expect("Unable to read file.")
.split("\n")
.map(|x| x.to_string())
.collect();
let mut grid: Vec<Vec<u32>> = Vec::new();
for row in data {... | Rust | 0 |
{
ColorSet(!0)
}
pub fn remove(&mut self, c: Color) -> bool {
let res = self.contains(c);
self.0 &= !(1 << (c as u8));
res
}
pub fn contains(&self, c: Color) -> bool {
(self.0 & 1 << (c as u8)) != 0
}
pub fn without_color(mut self, c: Color) -> Self {
... | Rust | 0 |
or WAHA disponível")
# 2. Inicializar conector
print("\n🔌 2. Inicializando conector...")
if not self.initialize_connector():
print("❌ Falha ao inicializar conector")
return False
print("✅ Conector inicializado")
# 3. Verificar status da ... | Python | 1 |
})
}
fn draw_first_tab<B>(f: &mut Frame<B>, app: &App, area: Rect)
where
B: Backend,
{
let chunks = Layout::default()
.constraints([Constraint::Length(7)].as_ref())
.split(area);
draw_ssm_text(f, app, chunks[0]);
}
fn draw_ssm_text<B>(f: &mut Frame<B>, app: &App, area: Rect)
where
... | Rust | 0 |
: struct.BTreeMap.html
#[stable(feature = "rust1", since = "1.0.0")]
pub struct IntoIter<K, V> {
front: Handle<NodeRef<marker::Owned, K, V, marker::Leaf>, marker::Edge>,
back: Handle<NodeRef<marker::Owned, K, V, marker::Leaf>, marker::Edge>,
length: usize,
}
#[stable(feature = "collection_debug", since = "... | Rust | 0 |
, 115, 64, 238, 176, 220, 45, 192, 68, 110, 22, 152, 116, 80,
142, 140, 194, 87, 181, 89, 105, 7, 178, 116, 88, 132, 64, 93, 221, 2, 101, 38, 212,
119, 41, 233, 180, 120, 15, 141, 3, 22, 76, 121, 31, 156, 41, 67, 220, 0, 255, 255,
129, 128, 130, 38, 111, 188, 190,
];
... | Rust | 0 |
from typing import List
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from ..dependencies import get_token_header, get_db
from ..domain.car import service, schemas
router = APIRouter(
prefix="/cars",
tags=["cars"],
dependencies=[],
responses={404: {"descr... | Python | 1 |
data[p - 1] = num::zero();
}
if (nrt + 1) < p {
edata[nrt] = adata[nrt * n + (p - 1)];
}
edata[p - 1] = num::zero();
// Generate U.
for j in nct..m {
for i in 0..m {
udata[i * m + j] = num::zero();
}
udata[j * m + j] = num::one();
}
for k in (0..nct).rev(... | Rust | 0 |
ogeneous()
}
/// Builds a 3D homogeneous rotation matrix from an axis and an angle (multiplied together).
///
/// Returns the identity matrix if the given argument is zero.
/// This is identical to `Self::new_rotation`.
#[inline]
pub fn from_scaled_axis(axisangle: Vector3<N>) -> Self {
... | Rust | 0 |
ine.strip().split("\t")
if content:
contents.append(content)
labels.append(categories[label])
except:
pass
self.news_train_contents = contents
self.news_train_labels = labels
def get_content_and_... | Python | 1 |
::max_value()`.
//!
//! ## Related Modules
//!
//! * [`System`](../frame_system/index.html)
//! * [`Support`](../frame_support/index.html)
// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
use asset;
use pallet_balances;
mod math;
use crate::sp_api_hidden_includes_decl_stora... | Rust | 0 |
sion: precision as u8,
})
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn to_string() {
let mut it = IntervalYM::new(1, 2);
it.precision = 0;
assert_eq!(it.to_string(), "+1-02");
it.precision = 1;
assert_eq!(it.to_string(), "+1-02");
it.pre... | Rust | 0 |
nicusMarinePart,
):
message = (
f"Please note that the dataset {dataset_id}"
f", version '{dataset_version.label}'"
f", part '{dataset_part.name}' "
f"is not yet released officially. It will be available by default "
f"on the toolbox on the {dataset_part.released_date}."
... | Python | 1 |
# Generated by Django 5.0.2 on 2024-03-27 14:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ecomApp', '0014_alter_client_photo_alter_product_photo_and_more'),
]
operations = [
migrations.RemoveField(
model_name='product'... | Python | 1 |
res
};
Ok(res.into())
})
}
}
#[wasm_bindgen(typescript_custom_section)]
const FROM_PRIOR_PACK_TS: &'static str = r#"
interface FromPrior {
pack(
issuer_kid: string | null,
did_resolver: DIDResolver,
secrets_resolver: SecretsResolver,
): Promise<[str... | Rust | 0 |
(&mut buf) {
if s == 0 { break }
let out = calculate(buf.trim());
println!("{:X}", out);
}
}
<reponame>L2-Technology/sensei
// This file is Copyright its original authors, visible in version control
// history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE... | Rust | 0 |
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import requests
from pyefun import *
import logging
import hashlib
logger = logging.getLogger()
def 取md5(内容):
m = hashlib.md5(内容.encode("utf8"))
... | Python | 1 |
ams["stop_sequences"]:
if stop_seq in response:
stop_seq_found = stop_seq
# identify text to yield
text: Optional[str] = None
if stop_seq_found:
text = response[: response.index(stop_seq_found)]
else:
te... | Python | 1 |
R_yx) / (4 * y)
z = (R_yz + R_zy) / (4 * y)
elif max_index == 3:
w = (R_yx - R_xy) / (4 * z)
x = (R_zx + R_xz) / (4 * z)
y = (R_yz + R_zy) / (4 * z)
return np.array([w, x, y, z])
def se3_to_components(se3):
"""Converts an SE3 rotation matrix to linear translation and Eule... | Python | 1 |
end_tag, tag
)));
}
//Got the correct end tag
if content.len() > 0 {
return Ok(content);
} else {
return Ok(vec![]);
}
}
... | Rust | 0 |
out = self.bn3(self.conv3(out))
out += identity
return F.relu(out)
if __name__ == "__main__":
print("现在我们创建一个简单的多层感知机")
model = FullyConnectedNet()
input_tensor_fc = torch.randn(2, 784)
# 通过模型传递虚拟张量
output_fc = model(input_tensor_fc)
# ————————————————————————————————... | Python | 1 |
from pydantic import BaseModel, EmailStr, Field
class RegisterSchema(BaseModel):
cedula: str = Field(..., description="Cédula del usuario")
nombre: str = Field(..., description="Nombre")
apellidos: str = Field(..., description="Apellidos")
correo: EmailStr = Field(..., description="Correo electrónico v... | Python | 1 |
{
g,
ids: vec![UNVISITED; n],
sccs: Vec::new(),
low_link: vec![0; n],
id: 0,
stack: Vec::new(),
on_stack: vec![false; n],
}
}
}
impl UnweightedAdjacencyList {
pub fn scc(&self) -> SccResult {
let n = self.node_... | Rust | 0 |
"clockRate"] == 90000
# audio の outbound-rtp を取得して確認
audio_outbound_rtp_stats = [
stat
for stat in stats
if stat.get("type") == "outbound-rtp" and stat.get("kind") == "audio"
]
assert len(audio_outbound_rtp_stats) == 1, (
f"Expected 1 audi... | Python | 1 |
.
///
/// Most variants are boxed to reduce the size.
pub enum Union {
/// The Unit value - ().
Unit((), Tag, AccessMode),
/// A boolean value.
Bool(bool, Tag, AccessMode),
/// An [`ImmutableString`] value.
Str(ImmutableString, Tag, AccessMode),
/// A character value.
Char(char, Tag, Acc... | Rust | 0 |
len()).as_bytes());
// Write the data
self.buffer.extend(data);
Ok(())
}
/// Add a record containing the provided string.
fn put_string(&mut self, data: &str) -> Result<(), UpmError> {
self.put_bytes(data.as_bytes())?;
Ok(())
}
/// Add a record containing th... | Rust | 0 |
void);
pub type GtkCellAreaContextPrivate = *mut _GtkCellAreaContextPrivate;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GtkCellEditableIface {
pub g_iface: gobject::GTypeInterface,
pub editing_done: Option<unsafe extern "C" fn(*mut GtkCellEditable)>,
pub remove_widget: Option<unsafe extern "C" fn(*mut G... | Rust | 0 |
SHA1,
}
impl Nsec3HashAlgorithm {
/// <http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml>
pub fn from_u8(value: u8) -> ProtoResult<Self> {
match value {
1 => Ok(Self::SHA1),
// TODO: where/when is SHA2?
_ => Err(ProtoErrorKind::UnknownAlgo... | Rust | 0 |
CFX, 9 VPVL, 37 CXFTF => 6 GNMV
145 ORE => 6 MNCFX
1 NVRVD => 8 CXFTF
1 VJHF, 6 MNCFX => 4 RFSQX
176 ORE => 6 VJHF
");
assert_eq!(table.requirements(ChemicalAmount::from_string("1 FUEL")), vec![ChemicalAmount::from_string("180697 ORE")]);
}
#[test]
fn example_a5() {
let tabl... | Rust | 0 |
# Sort opportunities by quality
opportunities["top_value_plays"].sort(key=lambda x: x['discount_percentage'], reverse=True)
opportunities["best_cash_flow_properties"].sort(key=lambda x: x['estimated_yield'], reverse=True)
opportunities["energy_arbitrage_targets"].sort(key=lambda x: x... | Python | 1 |
art_logits, axis=-1)
end_logits = tf.squeeze(input=end_logits, axis=-1)
loss = None
if start_positions is not None and end_positions is not None:
labels = {"start_position": start_positions}
labels["end_position"] = end_positions
loss = self.hf_compute_loss(l... | Python | 1 |
dLongDocMap, SorterDocMap};
use core::codec::{PostingIterator, PostingIteratorFlags};
use core::doc::Fieldable;
use core::doc::IndexOptions;
use core::index::merge::{MergePolicy, MergeScheduler};
use core::index::writer::{
DocumentsWriterPerThread, TrackingTmpDirectory, TrackingTmpOutputDirectoryWrapper,
Tracki... | Rust | 0 |
err1)),
},
}
}
fn describe(&self) -> String {
format!("or({}, {})", self.0.describe(), self.1.describe())
}
}
pub fn or<T: Debug, M0: MatchArg<T>, M1: MatchArg<T>>(
matcher0: M0,
matcher1: M1,
) -> OrMatchArg<T, M0, M1> {
OrMatchArg(matcher0, matcher1, PhantomData)
... | Rust | 0 |
import sys
from pathlib import Path
import asyncio
sys.path.append(str(Path(__file__).parent.parent))
import g4f
from testing.log_time import log_time, log_time_async, log_time_yield
_providers = [
g4f.Provider.H2o,
g4f.Provider.You,
g4f.Provider.HuggingChat,
g4f.Provider.OpenAssistant,
g4f.Pro... | Python | 1 |
import numpy as np
def get_nl_com(old_allocation, new_allocation, qubit):
return np.sum(np.abs(old_allocation[qubit] - new_allocation[qubit])) // 2
def has_pair(qubit, interactions):
return sum(interactions[qubit]) > 0
def is_qubit_placed(qubit, new_allocation):
return any(new_allocation[qubit])
def ... | Python | 1 |
from decimal import Decimal
from typing import Optional, Union
from agenthalo.core.token import TokenInfo
from agenthalo.services.chains.evm.constants_erc20 import ERC20_ABI
from eth_typing import ChecksumAddress
from web3.contract import Contract
from web3.types import TxReceipt, Wei
from .evm import EVMClient, EVMS... | Python | 1 |
# i = 10
# while i < 15:
# print(i)
# i = i+1
# there is not do while loop in python
i = 1
while True:
print(i, end= " ")
i = i + 1
if(i > 5):
break | Python | 1 |
|| {
process_memx_memcpy_basic(black_box(&mut v), black_box(pat_bytes));
memory_barrier(&mut v);
})
});
cache_flush(&v, pat_bytes);
#[cfg(all(
any(target_arch = "x86_64", target_arch = "x86"),
target_feature = "sse2"
))]
{
c.bench_function("mem... | Rust | 0 |
push_rectangle_indices(bui + 1, bui, bli + 1, bli, out);
}
}
/// Creates the faces from a circle and a point that is shared by all triangle.
#[cfg(feature = "dim3")]
#[inline]
pub fn push_degenerate_top_ring_indices(
base_circle: u32,
point: u32,
nsubdiv: u32,
out: &mut Vec<[u32; DIM]>,
) {... | Rust | 0 |
e crate::octets;
use crate::packet;
use crate::ranges;
use crate::stream;
pub const MAX_CRYPTO_OVERHEAD: usize = 8;
pub const MAX_STREAM_OVERHEAD: usize = 12;
pub const MAX_STREAM_SIZE: u64 = 1 << 62;
#[cfg(feature = "quic-dgram")]
pub const MAX_DGRAM_OVERHEAD: usize = 8;
#[derive(Clone, PartialEq)]
pub enum Frame {... | Rust | 0 |
&\frac{\log(1+(\frac{2\lambda - 1}{1 - \lambda})x)}{\log(\frac{\lambda}{1-\lambda})} & \text{ otherwise}
\end{aligned}
\right. }
Args:
value (Tensor): The input tensor, meaning the quantile.
Returns:
Tensor: the value of the r.v. co... | Python | 1 |
# Generated by Django 5.1.5 on 2025-01-29 05:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0008_alter_product_extra'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='extra',... | Python | 1 |
kebab-case")]
pub enum Args {
/// Optimize and execute a brainfuck file
Run {
/// The file to run
file: PathBuf,
#[clap(flatten)]
settings: Settings,
},
/// Optimize and run a brainfuck file along with all intermediate steps
Debug {
/// The file to debug
... | Rust | 0 |
const buttons = activeTab.query('button');
for(let btn of buttons) {
const text = btn.getText ? btn.getText() : '';
const tooltip = btn.tooltip || '';
if(text.includes('엑셀') || text.includes('Exce... | Python | 1 |
ccds to skip. Default is default_bad_ccds.
}
# And some other attributes that are required to be present if you do the above.
_single_params = [] # If there are sets of parameters where one and only one is required,
# put them here. We don't have any for this class.
_takes_rn... | Python | 1 |
r c R [ U [ 5 ( a U $ [ U [ S5 [ 45 ( a U $ 0 n[ U 5 H n UR U5 M U$ ! [ [ 4 a4 n[ SU5 UR 5 H u ... | Python | 1 |
"""
Example script demonstrating how to use the Ollama provider with the model importer.
"""
import os
import sys
import logging
# Add the parent directory to the path so we can import the modules
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from exo.agents.models impo... | Python | 1 |
ime - start_time)
# Use processing times from last 200 frames.
if len(processing_times) > 200:
processing_times.popleft()
_, f_width = frame.shape[:2]
# mean processing time [ms]
processing_time = np.mean(processing_times) * 1000
f... | Python | 1 |
name = "Abhishek"
age = 22
pi = 3.14
print(name)
print(age)
print(pi) | Python | 1 |
]
pub struct State {
rpc_endpoint: String,
}
#[async_std::main]
async fn main() -> tide::Result<()> {
let args = match args::parse() {
Ok(x) => x,
Err(e) => {
panic!("Args parsing error: {}", e);
}
};
let state = State {
rpc_endpoint: args.rpc_endpoint.clone... | Rust | 0 |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import numpy as np
import pandas as pd
import argparse
from collections import OrderedDict
from sklearn import m... | Python | 1 |
#Write a Python program to reverse a string
def string(str1):
w=""
index=len(str1)
while index > 0:
w+=str1[index-1]
index=index-1
return w
print(string("blair")) | Python | 1 |
import sys
import requests
from bs4 import BeautifulSoup
url="https://tianqi.2345.com/wea_history/{}.htm"
# 定义请求头
user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
headers = {
'User-Agent': user_agent
}
# 在cityCode.txt中查找cityName对... | Python | 1 |
import os
import tempfile
import subprocess
from pyrogram import Client, filters
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, CallbackQuery
from pydub import AudioSegment
from config import *
app = Client("bot", api_id=API_ID, api_hash=API_HASH, bot_token=API_TOKEN)
@app.on_message(filters.c... | Python | 1 |
from kaldo.forceconstants import ForceConstants
from kaldo.phonons import Phonons
from kaldo.conductivity import Conductivity
import matplotlib.pyplot as plt
import ase.io
"""
Unit and regression test for the kaldo package.
"""
# Import package, test suite, and other packages as needed
from kaldo.forceconstants impor... | Python | 1 |
# Doc: https://huggingface.co/docs/transformers/v4.30.0/en/main_classes/optimizer_schedules#transformers.get_constant_schedule_with_warmup
import inspect
import torch
from transformers import (
get_constant_schedule_with_warmup,
get_cosine_schedule_with_warmup,
get_linear_schedule_with_warmup,
)
from minV... | Python | 1 |
import os
from defines import *
import addserver
import deleteserver
import main
if __name__ == '__main__':
cprint('Welcome to the main menu', 'yellow')
try:
while True:
cprint('1. Start the program', 'blue')
cprint('2. Add a server', 'blue')
cprint('3. Delete a ser... | Python | 1 |
if is_found == false {
output.push_str(&format!("rm -rf {:#?}\n", &entry.path()));
}
}
if !output.is_empty() {
println!("Run these commands manually in bash:\n{}", output);
}
println!("remotes_delete finished.");
}
/// fetch the explicit trusted reviewers from the /trust/*.... | Rust | 0 |
", "湖南省大庸县");
map.insert("433129", "湖南省桑植县");
map.insert("433130", "湖南省龙山县");
map.insert("439000", "湖南省省直辖行政单位");
map.insert("439001", "湖南省醴陵市");
map.insert("439002", "湖南省湘乡市");
map.insert("439003", "湖南省耒阳市");
map.insert("439004", "湖南省汨罗市");
map.insert("43... | Rust | 0 |
(&mut self, mut f: F)
where F: FnMut(GotMax<T>) {
while self.can_flush() {
// debug_assert_eq!(self.phase2_ids.len(), self.got_max_timestamp.len(),
// "{:?} != {:?}",
// self.phase2_ids, self.got_max_timestamp);
let g = self.got_max_timestamp.pop().exp... | Rust | 0 |
#[inline]
pub fn from_origin(origin: impl Into<GridPoint>, x: Face, y: Face, z: Face) -> Self {
Self {
x: x.normal_vector(),
y: y.normal_vector(),
z: z.normal_vector(),
w: origin.into().to_vec(),
}
}
#[inline]
pub fn to_free(self) -> Ma... | Rust | 0 |
nergy",
col.front().unwrap(),
"# of Tracks",
));
let temp = col.pop_front().unwrap();
col.push_back(temp);
charts.push(chart_maker::make_histogram(
tempo,
"Tempo",
col.front().unwrap(),
"# of Tracks",
));
... | Rust | 0 |
المحدد إلى PDF",
font=self.arabic_font_bold,
fg="white",
bg="#9C27B0",
command=lambda: self.export_selected_form_to_pdf(tree))
export_single_btn.pack(side=tk.LEFT, ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.