text string | label_name string | labels int64 |
|---|---|---|
import streamlit as st
from scrape import scrape_website, split_dom_content, clean_body_content, extract_body_content
from parse import parse_with_ollama
st.title("AI Web Scrapper")
url = st.text_input("Enter a Website URL: ")
if st.button("Scrape Site"):
st.write("Scrapping the website")
result = scrape_w... | Python | 1 |
from pydantic import validator
from sqlalchemy import Column, DateTime, ForeignKey, Integer, null
from src.database.core import Base
from src.schemas import BookTankBase
from src.base import PrimaryKeyMixin, TimeStampMixin
from datetime import datetime
class Reserve(Base, PrimaryKeyMixin, TimeStampMixin):
customer... | Python | 1 |
]
runtime_env["conda"] = environment
else:
runtime_env["pip"] = [ # type:ignore
"layer",
*[p for p in layer_function.pip_dependencies],
]
return {
"num_cpus": layer_function.fabric.cpu,
"num_gpus": layer_functio... | Python | 1 |
mut fmap_opt: *mut fontmap_opt,
) -> *mut CIDSysInfo {
let mut csi: *mut CIDSysInfo = 0 as *mut CIDSysInfo;
let mut pdf_ver: i32 = 0;
let mut i: i32 = 0;
let mut csi_idx: i32 = -1i32;
let mut m: i32 = 0;
let mut n: size_t = 0;
pdf_ver = pdf_get_version() as i32;
if fmap_opt.is_null() || ... | Rust | 0 |
tribution and at https://raw.githubusercontent.com/lemonrock/security-keys-rust/master/COPYRIGHT. No part of security-keys-rust, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2021 The developers of security-keys-rus... | Rust | 0 |
ner
}
}
impl<T: Clone> Clone for Response<T> {
fn clone(&self) -> Self {
// note: we cannot clone the extensions because we cannot know
// which types were stored
let mut res = http::Response::builder()
.status(self.inner.status())
.version(self.inner.version());... | Rust | 0 |
"date":"05/16/2015",
"reason":"Reload Command",
"years":0,
"weeks":0,
"days":0,
"hours":0,
"minutes":0
},
"21:39:56":{
"date":"05/16/2015",
"reason":"Reload Command",
... | Python | 1 |
this Workflow, optionally updating fields.
Args:
update (Optional[Dict[str, Any]]): Optional dictionary of fields for the new Workflow.
Returns:
Workflow: A new Workflow instance.
"""
# Extract the fields to set for the new Workflow
fields_for_new_workfl... | Python | 1 |
oot of unity
/// * `omega_shares` must be a `(share_count + 1)`-th root of unity
///
/// An optional `paramgen` feature provides methods for finding suitable parameters satisfying
/// these somewhat complex requirements, in addition to several fixed parameter choices.
#[derive(Debug,Clone,PartialEq)]
pub struct PackedS... | Rust | 0 |
consistent constant flow (ZKS-54).
);
let new_pubkey_hash = CircuitElement::unsafe_empty_of_some_length(
zero_element.clone(),
franklin_constants::NEW_PUBKEY_HASH_WIDTH,
);
let pub_nonce = CircuitElement::unsafe_empty_of_some_length(
zero_element.clo... | Rust | 0 |
_bytes(&self) -> Result<[u8; 128], WasmiumError> {
let mut header_bytes = [0_u8; 128];
header_bytes[0..=31].copy_from_slice(self.identifier.as_bytes());
header_bytes[32..=63].copy_from_slice(self.hash.as_bytes());
match self.signature {
None => return Err(WasmiumError::Signa... | Rust | 0 |
ound(sample['anticipation_se'][1],2)
et = round(sample['action_se'][0],2)
times.append({'start_time': st, 'end_time': et, 'mid_time': round((st + et) / 2.0, 2)})
st = round(sample['action_se'][0],2)
et = round(sample['action_se'][1],2)
times.append({'start_time': st, 'end_time':... | Python | 1 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from multiplexer.modeling.box_regression import Box2BoxTransform
from multiplexer.modeling.roi_heads.box_head.roi_box_post_processor_base import BaseBoxPostProcessor
from multiplexer.modeling.roi_heads.box_head.roi_box_post_processor_rotated import... | Python | 1 |
Once},
Parser,
};
use self::ascii::AsciiChar;
/// Parses a byte and succeeds if the byte is equal to `c`.
///
/// ```
/// use combine::Parser;
/// use combine::parser::byte::byte;
/// assert_eq!(byte(b'!').parse(&b"!"[..]), Ok((b'!', &b""[..])));
/// assert!(byte(b'A').parse(&b""[..]).is_err());
/// assert!(byte(... | Rust | 0 |
# 11726 2xn 타일링
n = int(input())
sum_lst = [1]
for i in range(n-1):
a = sum_lst[i] + sum_lst[i-1]
sum_lst.append(a)
print(sum_lst[-1] % 10007) | Python | 1 |
}
#[doc = "Bit 4 - Send STALL"]
#[inline(always)]
pub fn usb_txcsrl7_stall(&self) -> USB_TXCSRL7_STALLR {
let bits = ((self.bits >> 4) & 1) != 0;
USB_TXCSRL7_STALLR { bits }
}
}
impl W {
#[doc = r"Writes raw bits to the register"]
#[inline(always)]
pub unsafe fn bits(&mut... | Rust | 0 |
00, 0x10, 0x20, 0x31, 0x32, 0x33,
0x20, 0x11,
];
let path = std::path::PathBuf::from(r"./samples/handcrafted_ident");
let val = get_file_as_byte_vec(&path).unwrap();
assert_eq!(data, val);
}
#[test]
fn test_parse_file() {
use deku::DekuContainerWrite;
... | Rust | 0 |
anyhow::{anyhow, Context, Result};
use nix::fcntl::{self, OFlag};
use nix::fcntl::{FcntlArg, FdFlag};
use nix::libc::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO};
use nix::pty;
use nix::sys::select::{select, FdSet};
use nix::sys::socket::{self, AddressFamily, SockAddr, SockFlag, SockType};
use nix::sys::wait::{self, W... | Rust | 0 |
th.floor(min(max(y0 / scale, 1), img_h - 1))
x1 = math.ceil(min(max(x1 / scale, 1), img_w - 1))
y1 = math.ceil(min(max(y1 / scale, 1), img_h - 1))
cv2.rectangle(draw_img, (x0, y0), (x1, y1), box_color, 2)
cv2.putText(draw_img, f'{name}: {score:.2f}',
(x0, max(y0 - 5, ... | Python | 1 |
Some(c) => c,
None => return false,
};
c == '$' || c == '_' || c == '\u{200c}' || c == '\u{200d}' || c.is_ascii_alphanumeric() || {
if c.is_ascii() {
false
} else {
UnicodeID::is_id_continue(c)
}
}
}
/// See... | Rust | 0 |
a[PI[16]] = last.rotate_left(RHO[16]); last = array[0];
array[0] = a[PI[17]]; a[PI[17]] = last.rotate_left(RHO[17]); last = array[0];
array[0] = a[PI[18]]; a[PI[18]] = last.rotate_left(RHO[18]); last = array[0];
array[0] = a[PI[19]]; a[PI[19]] = last.rotate_left(RHO[19]); last = array[0];
... | Rust | 0 |
, 0x4a, 0xa7}
DEFINE_GUID!{Annotation_Pattern_GUID,
0xf6c72ad7, 0x356c, 0x4850, 0x92, 0x91, 0x31, 0x6f, 0x60, 0x8a, 0x8c, 0x84}
DEFINE_GUID!{Text_Pattern2_GUID,
0x498479a2, 0x5b22, 0x448d, 0xb6, 0xe4, 0x64, 0x74, 0x90, 0x86, 0x06, 0x98}
DEFINE_GUID!{TextEdit_Pattern_GUID,
0x69f3ff89, 0x5af9, 0x4c75, 0x93, 0... | Rust | 0 |
# -*- coding: utf-8 -*-
import re
import json
from .parser import Parser
import config
import importlib
def search(number, sources: str = None, **kwargs):
""" 根据`番号/电影`名搜索信息
:param number: number/name depends on type
:param sources: sources string with `,` Eg: `avsox,javbus`
:param type: `adult`, `... | Python | 1 |
let pow5 = &TABLE_POW5[pow5_a..];
for (i, &p5) in pow5.iter().enumerate().take(pow5_b - pow5_a) {
if i >= d.num_digits {
return num_new_digits - 1;
} else if d.digits[i] == p5 {
continue;
} else if d.digits[i] < p5 {
return num_new_digits - 1;
... | Rust | 0 |
即一个1一个2两个1,故写作11-12-21
pub fn count_and_say(n: i32) -> String {
if n == 1 {
return "1".to_owned();
}
let pre_str = Solution::count_and_say(n - 1);
let mut curr_str = String::new();
let mut pre_char = None;
let mut pre_char_c... | Rust | 0 |
"native-tls"))]
pub fn new(config: &aws_types::config::Config) -> Self {
Self::from_conf(config.into())
}
/// Creates a new client from the service [`Config`](crate::Config).
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn from_conf(conf: crate::Config) -> Self {
let... | Rust | 0 |
": "btc",
"amount": "-0.25232073"
}, {
"currency": "mxn",
"amount": "1013.540958479115"
}],
"details": {
"tid": 51756,
"oid": "wri0yg8miihs80ngk"
}
... | Rust | 0 |
'''
Author: HDJ @https://github.com/Goodnameisfordoggy
LastEditTime: 2025-07-10 22:42:43
FilePath: \pythond:\LocalUsers\Goodnameisfordoggy-Gitee\JD-Automated-Tools\JD-AutomaticEvaluate\pc\src\logInWithCookies.py
Description: @VSCode
| 早岁已知世事艰,仍许飞鸿荡云间;
| 曾恋嘉肴香绕案,敲键弛张荡波澜。
|
| 功败未成身无畏,坚持未果心不悔;
|... | Python | 1 |
',
'Benny Andersson', 'Bj\xf6rn Ulvaeus')):
d = Definition()
for o in abba:
d.add_object(o, ['human', 'singer'])
d.add_property('female', abba[:2])
d.add_property('male', abba[2:])
d.add_property('keyboarder', [abba[2]])
d.add_property('guitarrist', [abba[3]])
... | Python | 1 |
from pathlib import Path
class DisplayablePath(object):
display_filename_prefix_middle = "├──"
display_filename_prefix_last = "└──"
display_parent_prefix_middle = " "
display_parent_prefix_last = "│ "
def __init__(self, path, parent_path, is_last):
self.path = Path(str(path))
... | Python | 1 |
(Decl::Fn(..)) => return,
Stmt::Decl(Decl::Var(VarDecl {
kind: VarDeclKind::Var,
decls,
..
}))
if decls.iter().all(|decl| decl.init.is_none()) =>
{
return;
}
_ => {}
}
if let Some(meta) = self.context.control_flow.meta(stmt.span().lo) {
... | Rust | 0 |
_error_metrics["mean_snr"] = mean_snr.astype(float)
all_error_metrics["mean_sdr"] = mean_sdr.astype(float)
all_error_metrics["mean_ditd"] = mean_ditd.astype(float)
all_error_metrics["mean_dild"] = mean_dild.astype(float)
all_error_metrics["mean_lre"] = mean_lre.astype(float)
all_error_metrics["model... | Python | 1 |
s()
return patching_metric(logits)
def act_patch(
model: HookedTransformer,
orig_input: Union[str, List[str], Int[Tensor, "batch seq_len"]],
patching_nodes: Union[IterNode, Node, List[Node]],
patching_metric: Union[Callable, Literal["loss", "loss_per_token"]],
new_input: Optional[Union... | Python | 1 |
vice=tensor.device
)
)
def get_shared_embeddings(
tie_embeddings,
input_vocabulary_size,
output_vocabulary_size,
d_model,
use_padding
):
if tie_embeddings:
return construct_shared_embeddings(
input_vocabulary_size,
output_vocabulary_size,
... | Python | 1 |
import logging
import pickle
try:
import kafka
except ImportError:
kafka = None
from .pubsub_manager import PubSubManager
logger = logging.getLogger('socketio')
class KafkaManager(PubSubManager): # pragma: no cover
"""Kafka based client manager.
This class implements a Kafka backend for event sha... | Python | 1 |
t.is_a("IfcAlignmentCant"):
last_segment_dist_along = 0.0
last_segment_cant_left = 0.0
last_segment_cant_right = 0.0
for rel in layout.IsNestedBy:
if 0 < len(rel.RelatedObjects):
last_segment = rel.RelatedObjects[-1]
... | Python | 1 |
H],
}
impl WFixedPositionConstraint {
pub fn from_params(
rbs1: [&RigidBody; SIMD_WIDTH],
rbs2: [&RigidBody; SIMD_WIDTH],
cparams: [&FixedJoint; SIMD_WIDTH],
) -> Self {
Self {
constraints: array![|ii| FixedPositionConstraint::from_params(rbs1[ii], rbs2[ii], cparams[... | Rust | 0 |
to the film grain parameters,"]
#[doc = " const char* parameter"]
pub const AV1E_SET_FILM_GRAIN_TABLE: aome_enc_control_id = 113;
#[doc = "Sets the noise level, int parameter"]
pub const AV1E_SET_DENOISE_NOISE_LEVEL: aome_enc_control_id = 114;
#[doc = "Sets the denoisers block size, unsigned int parameter"]
pub const ... | Rust | 0 |
import csv
def check_csv_columns(file_path):
with open(file_path, mode='r', encoding='utf-8') as file:
csv_reader = csv.reader(file)
line_number = 0
for row in csv_reader:
line_number += 1
if len(row) != 3:
print(f"Line {line_number}: {row}")
... | Python | 1 |
_arg!("-isystem", PathBuf, CanBeSeparated('='), PreprocessorArgumentPath),
take_arg!("-maxrregcount", OsString, CanBeSeparated('='), PassThrough),
flag!("-nohdinitlist", PreprocessorArgumentFlag),
flag!("-ptx", DoCompilation),
take_arg!("-rdc", OsString, CanBeSeparated('='), PreprocessorArgument),
t... | Rust | 0 |
#!/usr/bin/env python3
#####################################################################
# This script presents SPECTATOR mode. In SPECTATOR mode you play and
# your agent can learn from it.
# Configuration is loaded from "../../scenarios/<SCENARIO_NAME>.cfg" file.
#
# To see the scenario description go to "../../... | Python | 1 |
y-mesh",
"mesh",
"-i",
"../resources/logo.png",
"-o",
"../resources/logo.pretty.json",
"--json-pretty",
"--density-source",
"alpha",
]));
run_app(make_app().get_matches_from(vec![
"density-mesh",
... | Rust | 0 |
TIC_TEXT_3_1_0_ID,
BUTTON_3_2_ID
],
tree.read()
.root()
.unignored_children()
.map(|node| node.id())
.collect::<Vec<NodeId>>()[..]
);
assert!(tree
.read()
.node_by_id(PARAGRAPH... | Rust | 0 |
=> None,
}
}
fn attributes(&self) -> Option<u32> {
match self {
Self::Record { attributes, .. } => Some(*attributes as u32),
_ => None,
}
}
fn data_offset(&self) -> u32 {
match self {
Self::Record { data_offset, .. } => *data_offset,
Self::Resource { data_offset, .. } => *data_offset,
}
}
... | Rust | 0 |
from aiogram import Bot,Dispatcher,types,executor
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters.state import State,StatesGroup
from keyboards import car_menu
from datas import start_db,show_cars,add_to_db
class SellCar(StatesGroup... | Python | 1 |
ADDR0 OFFSET(0) NUMBITS(10) []
],
/// Bitfields of the `I2C_I2C_CMD_DATA1_0` register.
pub I2C_I2C_CMD_DATA1_0 [
/// Fourth data byte to send/receive.
DATA4 OFFSET(24) NUMBITS(8) [],
/// Third data byte to send/receive.
DATA3 OFFSET(16) NUMBITS(8) [],
/// ... | Rust | 0 |
topt::StructOpt;
use tokio::sync::mpsc::{self, UnboundedReceiver, UnboundedSender};
use tokio_stream::wrappers::{IntervalStream, UnboundedReceiverStream};
use std::{
any::{type_name, Any, TypeId},
collections::{HashMap, HashSet},
convert::Infallible,
pin::Pin,
time::Duration,
};
const RECONNECT_IN... | Rust | 0 |
0,
xflip: u & (1 << 5) != 0,
palette: if u & (1 << 4) == 1 {
Palette::OBP1
} else {
Palette::OBP0
},
}
}
}
<reponame>DomWilliams0/glium_shapes
mod common;
use glium::Surface;
fn main() {
// Setup glium display and shared ... | Rust | 0 |
+ one_meter = {:?} mm", two_meters.0);
//let one_feter = one_foot + one_meter;//error 2个相加的类型的泛型不同
}
<filename>src/licenses/workarounds.rs<gh_stars>100-1000
use crate::licenses::{
config::{Clarification, ClarificationFile, Config},
fetch::GitCache,
KrateLicense,
};
mod bitvec;
mod chrono;
mod clap;
mo... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 14 21:32:22 2024
@author: Dewi aulia nurjanah
065002400010
"""
class Data:
def __init__(self):
self.__nama = None
self.__nilai = None
def get_nama(self):
return self.__nama
def set_nama(self, nama):
self.__nama = nama
de... | Python | 1 |
xe1\xfds\xef\
Q\xe9\x11\xc8z\x9bX\x5c\x5c$\x91H\xf0\xeb\xbe\xb3\
$r>\x92\xb2F\xb2\x08b\xe4n\x92d2I|\
)EEM37\xde\xfd\xb7\xa3)\xf1\x1f\xc2i{\
\xcb\x10lf\xed\xed\xbb\xf9d\xfb\x0e\xce\xbdz\x81\x1d\
\x95ed\xb29b\xd3\xf7\xb8r\xc7&\xa9fI\xca\
:IE#\xa9\xe8\xa4U\x85\xb8\x22\xb2\xb8,\xa3\xda\
!\xfa\xff\xdeO\xe2A\xec\xdc\xf0\xf0\... | Python | 1 |
return true;
}
return false;
}
fn check_attribute(&self,
dice_value: i32,
skill_value: i32,
running_skill_score: i32,
difficulty: i32,
) -> i32 {
let mut run_skill_score = running_skill_score;
if dice_value > (skill_value + difficulty) {
... | Rust | 0 |
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ConditionOp {
// X == "Foo", equality
Equals,
// X != "Foo", inequality
NotEquals,
// X ~~ "Foo", regexp match
Match,
// X !~ "Foo", regexp non-match
NotMatch,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Symbol {
pub span... | Rust | 0 |
numa: Option<Vec<&'a str>>,
pub watchdog: bool,
#[cfg(feature = "tdx")]
pub tdx: Option<&'a str>,
#[cfg(feature = "gdb")]
pub gdb: bool,
pub platform: Option<&'a str>,
}
impl<'a> VmParams<'a> {
pub fn from_arg_matches(args: &'a ArgMatches) -> Self {
// These .unwrap()s cannot fail a... | Rust | 0 |
,{received_power_watts})
# 计算 CNR(线性值),假设 self.noise_power 是标量
CNR_linear = received_power_watts / noise_power
# print(f"CNR Linear:",{CNR_linear})
# 返回 CNR 的对数值(单位:dB),保持矩阵形状
# CNR = 10 * torch.log10(CNR_linear)
# print(f"CNR:",{CNR})
# print(f"[calculate_CNR_matrix] CNR matrix shape: {CNR... | Python | 1 |
self.maximum < self.minimum
}
// #####
// # L #
// #####
pub fn len(&self) -> usize {
if self.is_empty() {
0
} else {
(self.maximum - self.minimum) as usize
}
}
// #####
// # T #
// #####
pub fn to_human_presentable(&se... | Rust | 0 |
ax,0xff0
0xBB, 0xF0, 0x00, // mov bx,0xf0
0x0F, 0xAF, 0xC3, // imul ax,bx
];
machine.load_executable(&code, 0x085F);
machine.execute_instructions(3);
assert_eq!(0xFFFE, machine.cpu.get_r16(R::AX));
// 3082
machine.execute_instructions(3);
assert_eq!(0x0000, machine.cpu... | Rust | 0 |
tion:
>>> from humanfriendly.text import split
>>> split('foo,bar, baz,')
['foo', 'bar', 'baz']
Here is an example that parses a nested data structure (a mapping of
logging level names to one or more styles per level) that's encoded in a
string so it can be set as an environment variable:
... | Python | 1 |
import numpy as np
def iou(box, clusters):
"""
Calculates the Intersection over Union (IoU) between a box and k clusters.
:param box: tuple or array, shifted to the origin (i. e. width and height)
:param clusters: numpy array of shape (k, 2) where k is the number of clusters
:return: numpy array o... | Python | 1 |
Call(HYPERCALL_MSG, id)
}
pub fn KernelPanic(id: u64) {
HyperCall(HYPERCALL_PANIC, id >> 32);
HyperCall(HYPERCALL_PANIC, id);
}
pub fn KernelGetTime(clockId: i32) -> Result<i64> {
let call = GetTimeCall {
clockId,
..Default::default()
};
let addr = &call as *const _ as u64;
Hy... | Rust | 0 |
#
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2025 Carsten Igel.
#
# This file is part of simplepycons
# (see https://github.com/carstencodes/simplepycons).
#
# This file is published using the MIT license.
# Refer to LICENSE for more information
#
""""""
# pylint: disable=C0302
# Justification: Code is generated
... | Python | 1 |
{
'name': 'EDDE Course Management',
'version': '2.0',
'summary': 'Course and Registration Management for EDDE',
'description': """
This module provides management capabilities for courses and student registrations.
""",
'category': 'Education',
'author': 'EDDE',
'website': '',
... | Python | 1 |
tch_size, batch_size, feature_dim)),
torch.transpose(contrast_feature.expand((batch_size, batch_size, feature_dim)), 0, 1))
loss = -nn.LogSoftmax(0)(torch.div(anchor_dot_contrast, self.temperature)).diag().sum()
return loss
@cl... | Python | 1 |
without doing
// this could lead to inconsistencies. It's the plugin's responsibility to
// not perform any realtime-unsafe work when the initialize function is
// called a second time if it supports runtime preset loading.
permit_... | Rust | 0 |
from __future__ import annotations
import pytest
from dials.algorithms.image.centroid.generate_bias_lookup_table import (
compute_lookup_table,
)
def test_compute_lookup_table():
sigma, bias_sq = compute_lookup_table()
assert sigma == pytest.approx([0.01 * i for i in range(50)])
assert bias_sq == py... | Python | 1 |
S_SHORT: &'static str = "Mary";
static S_MEDIUM: &'static str = "Mary had a little lamb";
static S_LONG: &'static str = "\
Mary had a little lamb, Little lamb
Mary had a little lamb, Little lamb
Mary had a little lamb, Little lamb
Mary had a little lamb, Little lamb
Mary... | Rust | 0 |
from typing import Dict, List, Any, Literal
from pydantic import BaseModel, Field
class FulfillmentInfo(BaseModel):
tag: str
class SessionInfo(BaseModel):
session: str
parameters: Dict[str, Any] | None = None
class IntentInfo(BaseModel):
displayName: str
confidence: float
class ParameterInf... | Python | 1 |
de)
def test_reused_expr():
reused_expr = ast.ExpExpr(ast.NumVal(1.0), to_reuse=True)
expr = ast.BinNumExpr(reused_expr, reused_expr, ast.BinNumOpType.DIV)
expected_code = """
defmodule Model do
@compile {:inline, read: 2}
defp read(bin, pos) do
<<_::size(pos)-unit(64)-binary, value::floa... | Python | 1 |
from sympy import symbols
from tensorgrad.tensor import Variable, Sum, Product
from tensorgrad.extras.to_latex import to_latex, Rename
def test_variable_indexed():
i, j = symbols("i j")
X = Variable("X", i, j)
latex = to_latex(X) # index-based by default
assert latex == "X_{i,j}"
def test_variable... | Python | 1 |
_context: RenderContext,
pub physics_context: PhysicsContext,
pub audio_context: AudioContext,
}
impl Drop for Engine {
fn drop(&mut self) {
#[cfg(target_os = "android")]
ndk_glue::native_activity().finish();
}
}
impl Engine {
pub fn new() -> Self {
// Process Android event... | Rust | 0 |
labels() -> Vec<(HexAddress, Label)> {
vec![
((3, 14).into(), Label::y()),
((5, 9).into(), Label::City("O".to_string())),
((5, 9).into(), Label::y()),
((7, 3).into(), Label::y()),
((8, 4).into(), Label::y()),
((5, 11).into(), Label::City("M".to_string())),
((7... | Rust | 0 |
from model.minicpm import MiniCPM
from mteb import MTEB
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("main")
model_path = '../../pretrained/MiniCPM-2B-dpo-bf16'
adapter_path = '../../pretrained/adapter/20240422020420'
model = MiniCPM(model_path=model_path,
adapter... | Python | 1 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2022,2024 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the... | Python | 1 |
_rle: Option<u8>,
}
impl FSEScratch {
pub fn new() -> FSEScratch {
FSEScratch {
offsets: FSETable::new(),
of_rle: None,
literal_lengths: FSETable::new(),
ll_rle: None,
match_lengths: FSETable::new(),
ml_rle: None,
}
}
}
<gh... | Rust | 0 |
(one.copy());},
-1 => {return Some(one.copy());},
1 => {return Some(x.copy());},
_ => {return None;},
}
// return Some(x.Copy());
},
None => {
return None;
},
}
}
},
-1 => {
//比较第一个和最后一个的距离
if count == 0{
p... | Rust | 0 |
ze: Vec2 { x: 2, y: 4 },
};
assert!(left.overlaps(&right));
}
#[test]
fn does_not_overlap() {
let left =
Rect::<u8> { start: Vec2 { x: 9, y: 12 }, size: Vec2 { x: 10, y: 5 } };
let right =
Rect::<u8> { start: Vec2 { x: 12, y: 17 }, size: Vec2 { x: 5, y: 50 } };
assert!(!left.overla... | Rust | 0 |
import json
import threading
from kafka import KafkaConsumer
from app.models.schemas import KafkaMessage
from app.services.warehouse_service import process_message
import asyncio
import logging
from app.core.config import settings
logger = logging.getLogger(__name__)
class KafkaConsumerService:
def __init__(self,... | Python | 1 |
}
fn execute(&mut self) -> bool {
// Set noncanonical mode
if let Ok(orig) = Termios::from_fd(FD_STDIN) {
let mut noncan = orig.clone();
noncan.c_lflag &= !ICANON;
noncan.c_lflag &= !ECHO;
noncan.c_lflag &= !CREAD;
match tcsetattr(FD_S... | Rust | 0 |
r', 'hello', 'Hello', 0.0),
('rouge-l', 'r', 'hello world', 'hello', 1.0),
('rouge-l', 'r', 'hello world', 'Hello', 0.0),
('rouge-l', 'r', 'hello', 'hello world', 0.5),
('rouge-l', 'r', 'hello', 'Hello wo... | Python | 1 |
句柄
labels = [] # 用于存储图例标签
# 1. 绘制训练集曲线(实线)
for i, train_acc in enumerate(train_acc_list):
color = DEEP_COLOR[i % len(DEEP_COLOR)]
line = plt.plot(train_acc,
color=color,
linewidth=2,
linestyle='-',
... | Python | 1 |
def greet():
print("Hello, welcome!")
print("welcome aboard")
greet()
| Python | 1 |
Some('+') => {
value = &value[1..];
Sign::Positive
}
Some('-') => {
value = &value[1..];
Sign::Negative
}
_ => Sign::Positive,
};
let parts: Vec<_> = value.split('.').collect();
match *parts.as_slice() {
[secon... | Rust | 0 |
on cannot be changed.
T::Registrar::apply_lock(index);
Self::deposit_event(RawEvent::Created(index));
}
/// Contribute to a crowd sale. This will transfer some balance over to fund a parachain
/// slot. It will be withdrawable when the crowdloan has ended and the funds are unused.
#[weight = T::WeightIn... | Rust | 0 |
4"),
]);
let event1 = Rc::new(events::Version::V1 {
timestamp,
hostname: None,
event: events::EventType::LinuxKernelTrap(events::LinuxKernelTrap {
facility: rmesg::entry::LogFacility::Kern,
level: rmesg::entry::LogLevel::Warning,
... | Rust | 0 |
Name(_)
| TypedExpressionVariant::EnumTag { .. }
| TypedExpressionVariant::UnsafeDowncast { .. } => None,
}
}
fn const_eval_typed_ast_node(
context: &mut Context,
module: Module,
known_consts: &mut MappedStack<Ident, Constant>,
expr: &TypedAstNode,
) -> Option<Constant> {
match ... | Rust | 0 |
x0001,
LineLoop = 0x0002,
LineStrip = 0x0003,
Triangles = 0x0004,
TriangleStrip = 0x0005,
TriangleFan = 0x0006,
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[repr(u32)]
pub enum TextureParameterName {
MagFilter = 0x2800,
MinFilter = 0x2801,
WrapS = 0x2802,
WrapT = 0x2803,
Wra... | Rust | 0 |
#!/usr/bin/env python3
#
# Author:
# Tamas Jos (@skelsec)
#
#####
from pypykatz.registry import logger
class SOFTWARE:
def __init__(self, sam_hive, bootkey):
self.hive = sam_hive
self.bootkey = bootkey
self.default_logon_user = None
self.default_logon_domain = None
self.default_logon_password = None
... | Python | 1 |
rrent srcref, for debuggers
pub fn srcref() -> Robj {
unsafe { new_sys(R_Srcref) }
}
/// The nil object
pub fn nil_value() -> Robj {
unsafe { new_sys(R_NilValue) }
}
/// Unbound marker
pub fn unbound_value() -> Robj {
unsafe { new_sys(R_UnboundValue) }
}
/// Missing argument marker
pub fn missing_arg() -... | Rust | 0 |
ng::<$rng_core_type, $kex>),)+
}
impl KexRng<$kex> for $enum_name {}
impl NewFromKex<$kex> for $enum_name {
// Just build the default version
fn new_from_ephemeral_static<T: RngCore + CryptoRng>(rng: &mut T, pubkey: &<$kex as Kex>::Public) -> (KexRngPubkey, Self) {
... | Rust | 0 |
class Program_weight_tensor_meta_L_self_modules_hidden1_parameters_weight_:
name = "L_self_modules_hidden1_parameters_weight_"
shape = [30, 6]
dtype = "torch.float32"
device = "cpu"
mean = -0.053
std = 0.335
data = None
class Program_weight_tensor_meta_L_self_modules_hidden1_parameters_bia... | Python | 1 |
24_subborrowx_u32(&mut x93, &mut x94, x92, (0x0 as u32), x77);
let mut x95: u32 = 0;
let mut x96: fiat_p224_u1 = 0;
fiat_p224_subborrowx_u32(&mut x95, &mut x96, x94, (0x0 as u32), x76);
let mut x97: u32 = 0;
fiat_p224_cmovznz_u32(&mut x97, x96, (0x0 as u32), 0xffffffff);
let mut x98: u32 = 0;
let mut x99:... | Rust | 0 |
push_constant_size();
if size > declared_size || finished && size != declared_size {
Err(anyhow!(
"Provided push constant size {} does not match declared size {} in {:?} entry {:?}!",
size,
declared_size,
self.mo... | Rust | 0 |
"""private-gpt server."""
| Python | 1 |
;
use syn::{Ident, Result};
use super::SpannedParse;
#[derive(Debug, Clone)]
pub(crate) struct ResponseStructAttr {
pub(crate) ident: Ident,
pub(crate) span: Span,
}
impl SpannedParse for ResponseStructAttr {
fn parse(input: ParseStream, span: Span) -> Result<Self> {
let lookahead = input.lookahe... | Rust | 0 |
"trust-dns")]
#[cfg_attr(doc, doc(cfg(feature = "trust-dns")))]
pub(super) fn set_dnssec(&mut self, enable: bool) {
self.dnssec = enable;
}
/// Returns if DNSSEC is enabled for [`trust-dns`](trust_dns_resolver).
#[cfg(feature = "trust-dns")]
#[cfg_attr(doc, doc(cfg(feature = "trust-dns")))]
pub(in crate::qui... | Rust | 0 |
_database");
fetch_required_text(
"public/scenes/auto_load_manifest.txt",
"auto_load_manifest",
);
}
#[wasm_bindgen]
pub async fn start_loop() {
log::info!("Beginning engine loop...");
let event_loop = EventLoop::new();
let window = WindowBuilder::new()
.with_title("Title... | Rust | 0 |
#reversing a list in python
l=[]
n=int(input("enter the no.of elements:"))
for i in range(n):
ele=int(input("enter the element:"))
l.append(ele)
print(l)
l.reverse()
print("The reversed list:",l)
| Python | 1 |
4 RFSQX
176 ORE => 6 VJHF
";
assert_eq!(Reactions::parse(&input).max_fuel_produced(ore), 5_586_022);
let input = "
171 ORE => 8 CNZTR
7 ZLQW, 3 BMBT, 9 XCVML, 26 XMNCP, 1 WPTQ, 2 MZWV, 1 RJRHP => 4 PLWSL
114 ORE => 4 BHXH
14 VRPVC => ... | Rust | 0 |
return"胡泽红"
else:
print(f"请求失败,状态码: {response.status}, 消息: {await response.text()}")
#抓取的网站: [{'url': 'https://new.qq.com/rain/a/20241005A04DG600', 'siteName': '腾讯新闻'}, {'url': 'https://www.bilibili.com/video/BV1y9xsePEmJ/', 'siteName': '哔哩哔哩'}, {'url': 'https://k.sina.com.cn... | Python | 1 |
from . import MukeshXdb as db
fsub = db.force_sub
def fs_settings(chat_id: int):
_x = fsub.find_one({"chat_id": chat_id})
if _x:
return _x
return None
def add_channel(chat_id: int, channel):
fsub.update_one({"chat_id": chat_id}, {"$set": {"channel": channel}}, upsert=True)
def disapprove(... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.