text string | label_name string | labels int64 |
|---|---|---|
')),
('job', models.CharField(default='', max_length=255, verbose_name='工作')),
('city', models.CharField(default='', max_length=255, verbose_name='城市')),
('signature', models.CharField(default='', max_length=255, verbose_name='个性签名')),
('hour', models.Inte... | Python | 1 |
ml"), "w") as f:
f.write(html)
def run_clustering(self, embeddings):
distances = ((embeddings[1:] - embeddings[:-1])
** 2).sum(axis=1) ** 0.5
threshold = distances.max()
texts_per_clusters = self.cfg["kmeans_texts_per_clusters"] if "kmeans_texts_per_cluste... | Python | 1 |
ISTEN_ADDR";
pub const DEPRECATED_ENV_PRIVATE_FORWARD: &str = "LINKERD2_PROXY_PRIVATE_FORWARD";
// Limits the number of HTTP routes that may be active in the proxy at any time. There is
// an inbound route for each local port that receives connections. There is an outbound
// route for each protocol and authority.
pub... | Rust | 0 |
ctions:
#simple function: use only space if possible
assert len(
args) == 1, "Simple function %s must have 1 argument" % function
arg = args[0].__pretty__()
if arg.binding <= prettyForm.DIV:
#optimization: no parentheses necessary
... | Python | 1 |
.org/wiki/Rijndael_S-box
static SBOX: [u32; 256] = [
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE... | Rust | 0 |
import scrapy
import re
#scrapy crawl myspider --nolog
class MyspiderSpider(scrapy.Spider):
name = "myspider"
allowed_domains = ["www.creditsailing.com"]
start_urls = ["http://www.creditsailing.com/school/major_score/all/2023/3018341.html",'http://www.creditsailing.com/school/major_score/all/2023/3018304... | Python | 1 |
}
pub fn caller(&self, caller: &Address) -> &Self {
self.inner.borrow_mut().caller = caller.clone();
self
}
pub fn entry_address(&self, entry: &Address) -> &Self {
self.inner.borrow_mut().entry_address = entry.clone();
self
}
pub fn current_blockhash(&self, bloc... | Rust | 0 |
class Movie:
def __init__(self, title, director, duration, watched_minute = 0):
self.title = title
self.director = director
self.duration = duration
self.watched_minute = watched_minute
def watch(self, minute):
if self.watched_minute + minute >= self.duration:
... | Python | 1 |
import wx
import threading
from leginon.gui.wx.Choice import Choice
from leginon.gui.wx.Entry import FloatEntry
import leginon.gui.wx.Node
import leginon.gui.wx.Settings
import leginon.gui.wx.ToolBar
import leginon.gui.wx.Reference
class SettingsDialog(leginon.gui.wx.Settings.Dialog):
def initialize(self):
return ... | Python | 1 |
Error('Could not parse address %s' % addr)
return hexlify(bytearray(addr)).decode('ascii')
def test_ipv6_local():
'''
Check for (local) IPv6 support.
'''
import socket
# By using SOCK_DGRAM this will not actually make a connection, but it will
# fail if there is no route to IPv6 localhost.
... | Python | 1 |
# -*- 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 |
ecifier;
if normalized_specifier.starts_with("node:") {
normalized_specifier = normalized_specifier.replace("node:", "").into();
}
ast::CallExpr {
callee: ast::ExprOrSuper::Expr(Box::new(ast::Expr::Ident(ast::Ident::new(
"require".into(),
DUMMY_SP,
)))),
args: vec![ast::ExprOrSpread {... | Rust | 0 |
(
"vulnerable_code_cannot_be_controlled_by_adversary",
"Vulnerable code cannot be controlled by adversary",
),
(
"vulnerable_code_not_in_execute_path",
"Vulnerable code not in ... | Python | 1 |
import os
import io
import re
import subprocess
import logging
import random
import torch
import numpy as np
## This code is borrowed from
# https://github.com/researchmm/STTN/blob/master/core/dist.py
def get_world_size():
"""Find OMPI world size without calling mpi functions
:rtype: int
"""
if os.env... | Python | 1 |
#!/usr/bin/env python
'''
Floodfill sample.
Usage:
floodfill.py [<image>]
Click on the image to set seed point
Keys:
f - toggle floating range
c - toggle 4/8 connectivity
ESC - exit
'''
import numpy as np
import cv2
if __name__ == '__main__':
import sys
try: fn = sys.argv[1]
except... | Python | 1 |
import setuptools
with open('VERSION.txt', 'r') as f:
version = f.read().strip()
setuptools.setup(
name="odoo9-addons-oca-e-commerce",
description="Meta package for oca-e-commerce Odoo addons",
version=version,
install_requires=[
'odoo9-addon-product_multi_link',
'odoo9-addon-websi... | Python | 1 |
, Eq)]
// pub struct TreeNode {
// pub val: i32,
// pub left: Option<Rc<RefCell<TreeNode>>>,
// pub right: Option<Rc<RefCell<TreeNode>>>,
// }
//
// impl TreeNode {
// #[inline]
// pub fn new(val: i32) -> Self {
// TreeNode {
// val,
// left: None,
// right: None
// }
// }
// }
#!... | Rust | 0 |
epare_dict(max_ent_with_only_pos,a,ps,rs,fs,pns,rns,fns)
# print_stats(a,ps,rs,fs,pns,rns,fns)
# a,ps,rs,fs,pns,rns,fns = me_classifier(["polarity"])
# max_ent_with_only_polarity = {}
# metrics["max_ent_with_only_polarity"]=prepare_dict(max_ent_with_only_polarity,a,ps,rs,fs,pns,rns,fns)
# print_stats(a,ps,rs,fs,pns,rn... | Python | 1 |
gular expression string passed as this
argument, if supplied
name, name_regex: as for text and text_regex, but matched against the
name HTML attribute of the link tag
url, url_regex: as for text and text_regex, but matched against the
URL of the link tag (note this matches aga... | Python | 1 |
m output type with all other
/// node types.
fn get_by_id(
conn: &PgConnection,
id: Uuid,
) -> ResponseResult<Option<Node>> {
Ok(Self::find(conn, id)
.optional()?
// Self::Model -> Self -> Node
.map(|row: Self::Model| row.into().into()))
}
}
/... | Rust | 0 |
"!< set the level of an atom"]
pub const clingo_heuristic_type_clingo_heuristic_type_level: clingo_heuristic_type = 0;
#[doc = "!< configure which sign to chose for an atom"]
pub const clingo_heuristic_type_clingo_heuristic_type_sign: clingo_heuristic_type = 1;
#[doc = "!< modify VSIDS factor of an atom"]
pub const cl... | Rust | 0 |
// fn new<Ctx, T, S>(args: T::SelectorArgs) -> Self
// where
// Ctx: Context, // TODO FromContext?
// // S: ISelector,
// T: Select<Ctx, S>,
// Self: From<S>,
// {
// Self::from(T::new_selector(args))
// }
// fn select<Ctx, T, S>(&self, T) -> Result<S::Output, ()... | Rust | 0 |
new_local(file_set);
let mut change = Change::new();
change.set_roots(vec![source_root]);
let mut crate_graph = CrateGraph::default();
// FIXME: cfg options
// Default to enable test for single file.
let mut cfg_options = CfgOptions::default();
cfg_options.insert... | Rust | 0 |
def preprocess_mpt(sources, tokenizer: transformers.PreTrainedTokenizer
) ->Dict:
conv = conversation_lib.default_conversation.copy()
roles = {'human': conv.roles[0], 'gpt': conv.roles[1]}
conversations = []
for i, source in enumerate(sources):
if roles[source[0]['from']] != conv.roles[0]:
... | Python | 1 |
, Write},
path::{Path, PathBuf},
};
#[cfg(feature = "config_parsing")]
use crate::config::{Deserialize, Deserializers};
#[cfg(feature = "config_parsing")]
use crate::encode::EncoderConfig;
use crate::{
append::Append,
encode::{pattern::PatternEncoder, writer::simple::SimpleWriter, Encode},
};
/// The fil... | Rust | 0 |
s as this support isn't implemented yet.
} else {
dump_filelines(&[$($pos),*]);
panic!();
}
})
}
// we can't use a function as it will alter the backtrace
macro_rules! check {
($counter:expr; $($pos:expr),*) => ({
if *$counter == 0 {
dump_and_die!($($... | Rust | 0 |
based on input string
pub fn calculate(input: &str) -> Result<f64, String> {
match calculator::ExprParser::new().parse(input) {
Ok(v) => calculate_expr(&*v),
Err(_) => Err(String::from("parsing error"))
}
}
// recursively evaluate each expression
fn calculate_expr(expr: &Expr) -> Result<f64, St... | Rust | 0 |
addition to find each multiple. If we instead slice by spoke, then each iteration only requires
/// adding p * WHEEL_SIZE, or equivalently, just the index p _within_ the spoke vector. Compilers
/// can further optimize constant p-increment iteration with loop unrolling and SIMD instructions.
pub struct WheelSegment {... | Rust | 0 |
import torch
import torch.nn as nn
import math
class SimplE(nn.Module):
def __init__(self, num_ent, num_rel, emb_dim, device):
super(SimplE, self).__init__()
self.num_ent = num_ent
self.num_rel = num_rel
self.emb_dim = emb_dim
self.device = device
self.ent_h_embs ... | Python | 1 |
W(crate::W<CORE_X_IRAM0_DRAM0_DMA_SPLIT_LINE_CONSTRAIN_3_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CORE_X_IRAM0_DRAM0_DMA_SPLIT_LINE_CONSTRAIN_3_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
... | Rust | 0 |
print("Hello User!")
n = int(input("Enter number 1: "))
n1 = int(input("Enter number 2: "))
addi = n + n1
sub = n1 - n
mul = n * n1
div = n1 / n
print("The values of the operations are:")
print(f"Addition: {addi}")
print(f"Subtraction: {sub}")
print(f"Multiplication: {mul}")
print(f"Division: {div}") | Python | 1 |
seaside4);
kingdoms.kingdom_mut(KingdomName::Seaside).set_exit_moon(seaside5);
moons[cascade18].add_prereq_moon(seaside5);
moons[lake26].add_prereq_moon(seaside5);
moons[wooded49].add_prereq_moon(seaside5);
moons.push(Moon::new("On the Cliff Overlooking the Beach", KingdomName::S... | Rust | 0 |
p0) != 0 {
(*pe).type_0 = 3i32;
(*pe).p[0].x = (*p1).x;
(*pe).p[0].y = (*p1).y;
(*cp).x = (*p2).x;
(*pe).p[1].x = (*cp).x;
(*cp).y = (*p2).y;
(*pe).p[1].y = (*cp).y
} else if pdf_coord__equal(p1, p2) != 0 {
(*pe).type_0 = 4i32;
(*pe).p[0].x = (... | Rust | 0 |
# Python3 code to demonstrate working of remove redundant substrings from a string list
# using list comprehension + join() + enumerate()
list1 = ['Gfg', 'Gfg is best', 'Geeks', 'Gfg is for Geeks']
list1.sort(key=len)
res = [val for idx, val in enumerate(list1) if val not in ', '.join(list1[idx + 1:])]
print('The fi... | Python | 1 |
) -> Vec<&'static str> {
use columns::{
AddressSignatures, Blocktime, DeadSlots, DuplicateSlots, ErasureMeta, Index, Orphans,
PerfSamples, Rewards, Root, ShredCode, ShredData, SlotMeta, TransactionStatus,
TransactionStatusIndex,
};
vec![
ErasureMe... | Rust | 0 |
crate aoc2020;
use std::fs;
use aoc2020::*;
fn main() {
run_day1();
run_day2();
run_day3();
run_day4();
run_day5();
}
fn run_day1() {
let data = read_lines("data/day1.txt");
println!("======== Day 1 ========");
println!("Part 1: {}", day1::find_product(&data));
println!("Part 2:... | Rust | 0 |
}
}
}
<gh_stars>10-100
use crate::items::{Config, Expr};
use crate::parse::{IncludeOptions, TokenStream};
use std::path::{Path, PathBuf};
use std::process::Command;
pub fn find_rebar_config_dir() -> Option<PathBuf> {
let mut dir = std::env::current_dir().ok()?;
while !dir.join("rebar.config").exis... | Rust | 0 |
# https://pypi.org/ # Repository
from faker import Faker
import requests
fake = Faker()
print(fake.name())
print(fake.address())
| Python | 1 |
// Read-write values (empty)
pub mod RW {}
}
/// Synchronization enable
pub mod SE {
/// Offset (16 bits)
pub const offset: u32 = 16;
/// Mask (1 bit: 1 << 16)
pub const mask: u32 = 1 << offset;
/// Read-only values (empty)
pub mod R {}
/// Wr... | Rust | 0 |
seq_labels.append(input_feature.seq_labels)
return cls(input_ids, seq_lens, tok_to_orig_start_index,
tok_to_orig_end_index, labels, seq_labels)
@dataclass
class DataCollator:
"""
Collator for DuIE.
"""
def __call__(self, examples: List[Dict[str, Union[list, np.ndarra... | Python | 1 |
from pydantic import BaseModel, Field, validator
from typing import Optional
from bson.objectid import ObjectId
class DataChunk(BaseModel):
id : Optional[ObjectId] = Field(None, alias="_id")
chunk_text : str = Field(..., min_lenght=1)
chunk_metadata: dict
chunk_order: int = Field(..., gt=0)
chunk_p... | Python | 1 |
name = ["Ram", "Shyam", "Hari"]
# name.append("Gopal") # Adds an element at the end of the list
# name.append(["Ayush", "Piyush"])
# name.extend(["Ayush", "Piyush"]) # Adds the element of the list to the end of the current list
# name.insert(0, "Piyush") # Insert the elements at the given index
# del name[2] # ... | Python | 1 |
_System_Iis\"`*"]
pub const HSE_IO_ASYNC: u32 = 2u32;
#[doc = "*Required features: `\"Win32_System_Iis\"`*"]
pub const HSE_IO_CACHE_RESPONSE: u32 = 32u32;
#[doc = "*Required features: `\"Win32_System_Iis\"`*"]
pub const HSE_IO_DISCONNECT_AFTER_SEND: u32 = 4u32;
#[doc = "*Required features: `\"Win32_System_Iis\"`*"]
pub... | Rust | 0 |
).add(PaintCmd::LineSegment {
points,
style: LineStyle::new(line_width, color),
});
ui.interact_hover(rect)
}
}
// ----------------------------------------------------------------------------
pub struct DragValue<'a> {
value: &'a mut f32,
speed: f32,
}
impl<'a> Dra... | Rust | 0 |
Self::Output {
self.displ = self.displ.wrapping_sub(rhs as i64);
self
}
}
)+
};
}
mem_plus_displ!(i8 i16 i32 i64 isize u8 u16 u32 u64 usize);
impl Add<AsmMemoryOperand> for AsmMemoryOperand {
type Output = AsmMemoryOperand;
#[inline]
fn add(mut self, rhs: AsmMemoryOperand) -> Self::Output {
i... | Rust | 0 |
rehash(new_leaf, parents)?
}
// If the "tip" is an extension node, then we must modify or
// replace it, adding a node where necessary.
extension @ Trie::Extension { .. } => {
let SplitResult {
new_node,
... | Rust | 0 |
MONTHS_IT = [
'Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno',
'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'
]
# Default upload folder relative to project root when running from source
DEFAULT_UPLOAD_FOLDER = 'uploads'
# Columns used to build the normalized per-employee datas... | Python | 1 |
pub struct Solution;
#[cfg(test)]
mod tests {
use crate::problem_0204::count_primes;
#[test]
fn test_1() {
assert_eq!(count_primes(10), 4);
}
}
/*
* Copyright (c) 2017-2018 Boucher, Antoni <<EMAIL>>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this ... | Rust | 0 |
import argparse
import os
from gnuradio.bindtool import BindingGenerator
import pathlib
import tempfile
parser = argparse.ArgumentParser(description='Bind a GR In-Tree Module')
parser.add_argument('names', type=str, nargs='+',
help='Names of gr modules to bind (e.g. fft digital analog)')
parser.ad... | Python | 1 |
l)(msg)
else:
print("[%s] %s" % (level.upper(), msg))
# $Log: not supported by cvs2svn $
# Revision 1.1 2008/07/17 16:41:36 moscicki
# migration of 5.0.2 to HEAD
#
# the doc and release/tools have been taken from HEAD
#
# Revision 1.43.4.6 2008/02/12 14:08:02 amuraru
# *** empty log message ***
#
# Rev... | Python | 1 |
WARE_IMAGE_DOWNLOAD = 17,
SPDK_NVME_OPC_DEVICE_SELF_TEST = 20,
SPDK_NVME_OPC_NS_ATTACHMENT = 21,
SPDK_NVME_OPC_KEEP_ALIVE = 24,
SPDK_NVME_OPC_DIRECTIVE_SEND = 25,
SPDK_NVME_OPC_DIRECTIVE_RECEIVE = 26,
SPDK_NVME_OPC_VIRTUALIZATION_MANAGEMENT = 28,
SPDK_NVME_OPC_NVME_MI_SEND = 29,
SPDK_NVM... | Rust | 0 |
class Solution:
def scoreOfParentheses(self, s: str) -> int:
res = d = 0
for i in range(len(s)):
if s[i] == '(':
d += 1
else:
d -= 1
if s[i - 1] == '(': res += 2 ** d
return res
| Python | 1 |
}
fn number_of_polynomials(&self) -> usize {
self.get_ranged_polynomials().len()
}
fn get_ranged_polynomials(&self) -> &Vec<(Range<f64>, Polynomial)>;
}
// =============================================================================
// High level functions
// ====================================... | Rust | 0 |
# Assuming you have the dataset in the following format
# weather_data = {'Weather Condition': ['Sunny', 'Cloudy', 'Rainy'], 'Frequency': [150, 100, 75]}
# Example dataset
weather_data = {'Weather Condition': ['Sunny', 'Cloudy', 'Rainy', 'Windy', 'Snowy'],
'Frequency': [200, 150, 100, 80, 50]}
# Conve... | Python | 1 |
1");
write_float_scientific::<_, OCTAL>(0.0586419725308642e2f64, &options, "5.6723600776646231e0");
write_float_scientific::<_, OCTAL>(0.0293209862654321e2f64, &options, "2.73517003773231144e0");
write_float_scientific::<_, OCTAL>(0.01466049313271605e2f64, &options, "1.35647401775514462e0");
// Check n... | Rust | 0 |
from update import BasicUpdateBlock
from extractor import BasicEncoder
import torch
import torch.nn as nn
import torch.nn.functional as F
def bilinear_sampler(img, coords, mode='bilinear', mask=False):
""" Wrapper for grid_sample, uses pixel coordinates """
H, W = img.shape[-2:]
xgrid, ygrid = coords.spl... | Python | 1 |
params(th0, hb.bias0).to_point();
a * p1
});
let p2 = p2.unwrap_or_else(|| {
let p2 = Point::new(1.0, 0.0) - HyperBezier::v_for_params(-th1, hb.bias1);
a * p2
});
let k_scale = v.hypot().recip();
Segment {
p0,
p1,
... | Rust | 0 |
.copy()
for k, v in id2label.items():
if "I-" in v:
id2label[k] = v.replace("I-", "B-")
gts = [id2label[i] for i in gts.tolist()]
preds = torch.stack(
[
preds[:, 0],
preds[:, 1] + preds[:, 2],
preds[:, 3] + p... | Python | 1 |
eg"
else:
raise ValueError(f"Unsupported file type: {file_extension}")
def create_i6d_for_attachment(attachment_file, output_dir):
file_name = attachment_file.name
file_content = attachment_file.getvalue()
md5_hash = compute_mp5(file_content)
mime_type = determine_mime_type(file_name)
... | Python | 1 |
to results tab after generation
generate_btn.click(
fn=lambda: gr.update(selected=1),
outputs=tabs,
show_progress=False
)
# Custom event handling for timetable selection
app.load(None, js="""
document.addEventListener('timetable-selec... | Python | 1 |
Colors(display = self.display,
onerror = onerror,
cmap = self.id,
plane_mask = plane_mask,
pixels = pixels)
def store_colors(self, items, onerror = None):
request.StoreColors(display = self.display,
... | Python | 1 |
from __future__ import unicode_literals, division, absolute_import, print_function
__license__ = 'GPL v3'
__copyright__ = '2011, Grant Drake'
# The class that all Interface Action plugin wrappers must inherit from
from calibre.customize import InterfaceActionBase
class ActionModifyEpub(InterfaceActionBase):
''... | Python | 1 |
#!/bin/python
# python2
# Extract acoustic features (only llds) (csv)
import os
# Audio folders
folder_audio_train = "./wav_train/" # Folder containing the audio files of the training partition
folder_audio_test = "./wav_test/" # Folder containing the audio files of the test partition
# openSMILE
exe_opensmile =... | Python | 1 |
import sys
import os
import cv2
import json
import retinex
data_path = 'data'
img_list = os.listdir(data_path)
if len(img_list) == 0:
print 'Data directory is empty.'
exit()
with open('config.json', 'r') as f:
config = json.load(f)
for img_name in img_list:
if img_name == '.gitkeep':
contin... | Python | 1 |
/trigger-placeholder-empty-7-1/poison-num-20-comment-code-targeted/fine-tuning-codegen-350M-multi-fp16-lr1e-05-epochs3-batch3*8/trSize80000-160') # baseline attack
rootPath = Path('../attack/results/related_files/socket_socket/trigger-placeholder-alltokens-7-1/poison-num-20-comment/fine-tuning-codegen-350M-multi-... | Python | 1 |
(',');
sum.push_str(&inputs[j]);
sum.push(']');
while explode_snail(&mut sum) || split_snail(&mut sum) {
}
let ans = get_snail_magnitude(&mut sum);
max_mag = i64::max(max_mag, ans);
}
}
}
retu... | Rust | 0 |
args,
);
if let Err(err) = &result {
println!(
"Error while building file '{}': {}",
source_path.display(),
err
);
success = false;
}
}
if !success {
return Err(BuildFailed.into());
}
//... | Rust | 0 |
N, K = map(int, input().split())
K = str(K) # 문자열로 변환
count = 0
for h in range(N + 1):
for m in range(60):
for s in range(60):
# 시간 형식을 두 자리로 맞춰서 문자열로 만듦
time_str = str(h).zfill(2) + str(m).zfill(2) + str(s).zfill(2)
if K in time_str:
count += 1
print(c... | Python | 1 |
Url,
/// Ensures that this authentication server runs as a specific node_id
#[clap(short, long)]
pub node_id: Option<u32>,
}
#[derive(Parser)]
pub enum SubCommand {
/// Hosts the authentication service
#[clap()]
Auth(OptsAuth),
/// Starts a web server that will load Tokera file systems and ... | Rust | 0 |
"network.ip6.out_bcast_octets_per_sec",
"network.icmp.in_msgs_per_sec",
"network.icmp.in_errors",
"network.icmp.in_dest_unreachs",
"network.icmp.out_msgs_per_sec",
"network.icmp.out_errors",
"network.icmp.out_dest_unreachs",
"network.icmp6.in_msgs_per_sec",
"network.icmp6.in_errors",
... | Rust | 0 |
#
# Copyright © 2025 Agora
# This file is part of TEN Framework, an open source project.
# Licensed under the Apache License, Version 2.0, with certain conditions.
# Refer to the "LICENSE" file in the root directory for more information.
#
import asyncio
from ten_runtime import (
AsyncExtensionTester,
AsyncTenE... | Python | 1 |
ish (traditional)
SWE = 41, // Swedish
SWEFMI = 42, // Swedish (FileMaker custom)
TUR = 43, // Turkish
UKR = 44, // Ukrainian
// New to FileMaker Pro 8.5
CHI = 45, // Chinese (PinYin)
CHIStroke = 46, // Chinese (Stroke-radical)
// New to F... | Rust | 0 |
decimal") => file_size_opts::DECIMAL,
_ => file_size_opts::BINARY,
};
let verbose = matches.is_present("verbose");
let walk = Walk::new(&paths, num_threads, filesize_type);
let (size, errors) = walk.run();
print_result(size, &errors, &size_format, verbose);
}
use near_sdk::borsh::{self, Bo... | Rust | 0 |
'''no of prisoners, no. of chocolates, which person to start'''
n=6#int(input)
c=10#int(input)
s=3#int(input)
ans=(s+c-1)%n
if ans==0:
print(n)
| Python | 1 |
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
if required:
ayers = update_required(ayers, ayersreq)
nathan = update_required(nathan, porterreq)
jane = update_required(jane, smithreq)
emma = update_required(emma, carthyreq)... | Python | 1 |
self.data[childs[t]].count += 1
else:
nd = self.Data(t, len(self.data))
childs[t] = len(self.data)
self.data.append(nd)
result += self.data[childs[t]].count - 1
cur = childs[t]
return result
def lcp_max(self, value: str)... | Python | 1 |
#
# 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 |
{1d6da}'), ('\u{1d6dc}',
'\u{1d6fa}'), ('\u{1d6fc}', '\u{1d714}'), ('\u{1d716}', '\u{1d734}'),
('\u{1d736}', '\u{1d74e}'), ('\u{1d750}', '\u{1d76e}'), ('\u{1d770}',
'\u{1d788}'), ('\u{1d78a}', '\u{1d7a8}'), ('\u{1d7aa}', '\u{1d7c2}'),
('\u{1d7c4}', '\u{1d7cb}')
];
pub const Ll_t... | Rust | 0 |
import sys
from collections import deque
input = sys.stdin.readline # 빠른 입력
print = sys.stdout.write # 빠른 출력, 출력은 반드시 문자열로
# 1->익은 토마토, 0->익지 않은 토마토, -1-> 토마토가 들어가있지 않은 칸
#상하좌우
dx = [0,0,-1,1]
dy = [1,-1,0,0]
def bfs():
# [1] q생성, v[] 방문 배열 생성
q = deque()
v = [[0]*M for _ in range(N)]
# 초기 데이터 q에 데... | Python | 1 |
== scalar_shape || shape0 == scalar_shape1;
let x1_is_scalar = shape1 == scalar_shape || shape1 == scalar_shape1;
let ret = if x0_is_scalar && !x1_is_scalar {
let elem = x0[ndarray::IxDyn(&[])];
Ok(x1.map(move |&a| a $bin_op elem ))
} else if x1_is_s... | Rust | 0 |
letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
else:
# EIG TESTS
cmdbase="xeigtst"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out"
if (not just_errors and not short_summary):
print "--> Testing "+name+" "+dtests[1][dtest]+" [ "+cmdbase+" ]"
... | Python | 1 |
import streamlit as st
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
st.title('Dynamic Pressure Profile')
st.sidebar.title('Inputs')
k= st.sidebar.slider('Perm(md)',min_value = 10, max_value= 200, value= 100)
mu = st.sidebar.slider('Viscosity(cp)',min_value = 10, max_value= 50, value= 15)
q = ... | Python | 1 |
info = {
"name": "nnh",
"date_order": "DMY",
"january": [
"saŋ tsetsɛ̀ɛ lùm"
],
"february": [
"saŋ kàg ngwóŋ"
],
"march": [
"saŋ lepyè shúm"
],
"april": [
"saŋ cÿó"
],
"may": [
"saŋ tsɛ̀ɛ cÿó"
],
"june": [
"saŋ njÿolá'"
... | Python | 1 |
ER_2D_ARRAY`]
/// * [`GL_SAMPLER_2D_ARRAY_SHADOW`]
/// * [`GL_SAMPLER_2D_MULTISAMPLE`]
/// * [`GL_SAMPLER_2D_MULTISAMPLE_ARRAY`]
/// * [`GL_SAMPLER_2D_RECT`]
/// * [`GL_SAMPLER_2D_RECT_SHADOW`]
/// * [`GL_SAMPLER_2D_SHADOW`]
/// * [`GL_SAMPLER_3D`]
/// * [`GL_SAMPLER_BUFFER`]
/// * [`GL_SAMPLER_CUBE`]
/// * [`GL_SAMPLE... | Rust | 0 |
&run_with_style_for_test())
.unwrap();
assert_eq!(
*style.paragraph_properties,
ParagraphProperties {
style: Some(String::from("Child")),
start_on_next_page: Some(true),
keep_lines_on_one_page: Some(true),
text_... | Rust | 0 |
"""Tests for utility functions."""
import pytest
import json
from src.utils import (
is_port_open,
format_llama_cpp_command,
validate_openai_request,
extract_model_name,
format_error_response,
get_system_memory_usage
)
from src.config import ModelConfig
def test_is_port_open():
"""Test po... | Python | 1 |
lect GPU
# accelerator = None
# device = "cuda:" + str(gpu) if torch.cuda.is_available() and gpu >= 0 else "cpu"
# if device.startswith("cuda"):
# accelerator = "cuda"
accelerator = "cuda" if torch.cuda.is_available() and gpu >= 0 else None
if accelerator == "cuda":
device = gpu
... | Python | 1 |
from art import tprint
from modules.utils import (
custom_logger, get_file, keyHandler, path, absolute_path, custom_input, clear
)
init_logger = custom_logger(__name__)
logger = init_logger["logger"]
yellow = init_logger["yellow"]
reset = init_logger["reset"]
def clear_screen():
clear()
tprint("MHXX TO M... | Python | 1 |
from bittranslate.content_filter import (
contains_url,
contains_author_list,
contains_formula,
)
def test_contains_url_true():
text = "Check out this website: https://example.com"
assert contains_url(text) is True
def test_contains_url_false():
text = "This text does not contain a URL."
... | Python | 1 |
preads,
volumes_df=train_volumes
)
new_features = feature_eng.generate_advanced_features(
prices_df=new_prices,
spreads_df=new_spreads,
volumes_df=new_volumes
)
# Create labels (entry signals based on z-score)
train_labels = (abs(train_spreads['zscore']) > 2... | Python | 1 |
u32::MAX as usize {
error!("Too many tagged fields to encode ({} fields)", num_tagged_fields);
return Err(EncodeError);
}
total_size += types::UnsignedVarInt.compute_size(num_tagged_fields as u32)?;
total_size += compute_unknown_tagged_fields_size(&se... | Rust | 0 |
{
*self = *self + other;
}
}
impl ops::Mul<f64> for Vec2 {
type Output = Self;
fn mul(self, s: f64) -> Self {
Vec2 {
x: self.x * s,
y: self.y * s,
}
}
}
impl std::fmt::Display for Vec2 {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result... | Rust | 0 |
return await self._delete()
async def test(self) -> dict | None:
"""Test a webhook.
Creates a webhook dispatch with a dummy payload.
https://docs.apify.com/api/v2#/reference/webhooks/webhook-test/test-webhook
Returns:
The webhook dispatch created by the test.
... | Python | 1 |
ls_file = 'labels.json'
test_data = pd.read_csv('release_test_patients.csv')
if os.path.exists(labels_file):
with open(labels_file, 'r') as f:
all_labels = json.load(f)
else:
all_labels = sorted({
disease for diagnoses in test_data['DIFFERENTIAL_DIAGNOSIS']
for disease, _ in ast.litera... | Python | 1 |
vage3x3 = 1253,
RaynorCommando = 1254,
Overmind = 1255,
OvermindRemains = 1256,
InfestedMercHaven = 1257,
MonlythArtifactForceField = 1258,
MonlythForceFieldStatue = 1259,
Virophage = 1260,
PsiShockWeapon = 1261,
TychusCommando = 1262,
Brutalisk = 1263,
Pygalisk = 1264,
ValhallaBaseDestructibleDoorDead = 12... | Rust | 0 |
(H_out, W_out, C) → reshape(-1, C)
warped = warped.squeeze(0).permute(1, 2, 0).reshape(-1, C)
return warped
def find_nearest_bucket_size(input_width, input_height, mode="x64", bucket_size=512):
buckets = {
512: [[ 256, 768 ], [ 320, 768 ], [ 320, 704 ], [ 384, 640 ], [ 448, 576 ], [ 512, 512 ]... | Python | 1 |
"name": "example.com.",
"type": 28,
"TTL": 1726,
"data": "fc00:e968:6179::de52:7100"
}
]
}"#];
for test in tests {
// Strip comments in the test, as a easy way to keep this test data annotated.
let mu... | Rust | 0 |
Left,
SoundIoChannelIdTopFrontCenter,
SoundIoChannelIdTopFrontRight,
SoundIoChannelIdTopBackLeft,
SoundIoChannelIdTopBackCenter,
SoundIoChannelIdTopBackRight, // Last of the more commonly supported ids.
SoundIoChannelIdBackLeftCenter, // First of the less commonly supported ids.
SoundIoChan... | Rust | 0 |
self.to_glib_none().0, "notify::sensitive",
transmute(notify_sensitive_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_property_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + 's... | Rust | 0 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import pytest # noqa: F401
import torch
import theseus as th
from theseus.constants import __FROM_THESEUS_LAYER_TOKEN__
from tests.theseus... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.