text string | label_name string | labels int64 |
|---|---|---|
import collections
import copy
import json
import threading
import time
import traceback
import uuid
from typing import Optional, Dict, Any, List, ClassVar, Set, Union
from action_msgs.msg import GoalStatus
from geometry_msgs.msg import Point
from rclpy.action import ActionClient, get_action_server_names_and_types_by_... | Python | 1 |
x": {
"success": None if "matrix" not in share_destinations else True
}
}, content_type='application/json', status=200)
def sanitize(data):
return data.replace("<", "<").replace(">", ">")
async def _confirm_try_install(sender, custom_node_url, msg):
json_obj = await core.get_da... | Python | 1 |
String>,
lines: Vec<String>,
}
enum ParseState {
Rules,
Lines,
}
pub fn parse(input: &[String]) -> Result<Input, Error> {
let mut lines = Vec::new();
let mut rules = HashMap::new();
let mut state = ParseState::Rules;
for line in input {
match state {
_ if line.len(... | Rust | 0 |
gem)
except Exception as e:
app.logger.error(f"Erro ao processar a mensagem com o agente: {e}")
resposta_texto = "Desculpe, houve um erro ao processar sua solicitação."
return enviar_resposta(resposta_texto)
def gerar_saudacao() -> str:
hora_atual = datetime.now().hour
if hora_atual < ... | Python | 1 |
None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
e... | Python | 1 |
"""
Pacote de testes para o sistema de automação.
Este pacote contém os testes unitários e de integração para os diferentes
módulos do sistema.
"""
# Importações comuns para testes podem ser adicionadas aqui
__all__ = ['unit', 'integration']
| Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import account_edi_document
from . import account_edi_format
from . import account_move
from . import ir_attachment
from . import l10n_es_edi_tbai_certificate
from . import res_company
from . import res_config_set... | Python | 1 |
from django.contrib import admin
# Register your models here.
# 36) myapp/admin.py
from django.contrib import admin
from .models import Product
@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
list_display = ('name', 'price', 'stock')
search_fields = ('name',)
list_filter = ('price',)
| Python | 1 |
import re
def read_input(day, sample=False):
sample_or_real = '.sample' if sample else ''
with open(f'input/day{day}{sample_or_real}.txt') as f:
lines = f.read().splitlines()
index = {}
for row in range(len(lines)):
for col in range(len(lines[row])):
if lines[row][col] == '.':
continue
... | Python | 1 |
wb.save(archivo_excel)
print(f"Archivo Excel creado: {archivo_excel} en la misma caroeta del archivo .py") #luego tengo que ver como hacer para que me lo genere en otra parte
except Exception as e:
print(f"Error al generar Excel: {e}")
def _formatear_en... | Python | 1 |
scale
pub fn set_screen_scale(n: u32, factor: f32) {
unsafe { Fl_set_screen_scale(n as i32, factor) }
}
/// Get the screen scale
pub fn screen_scale(n: u32) -> f32 {
unsafe { Fl_screen_scale(n as i32) }
}
/// Return whether scaling the screen is supported
pub fn screen_scaling_supported() -> bool {
unsaf... | Rust | 0 |
""" Management command to backpopulate User Tours. """
import time
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from common.djangoapps.student.models import CourseEnrollment
from lms.djangoapps.user_tours.models import UserTour
User = get_user_model()
class Co... | Python | 1 |
from collections.abc import Iterable
from change_point_algorithms import CusumV0
from change_point_algorithms.online_detection.cusum import cusum_alg_generator, cusum_alg_v0_rust_hybrid
from examples.generate_data import generate_normal
def cusum_for_sequence(arr, mean: float, std_dev: float, h: float, alpha: float):... | Python | 1 |
4, 0xee, 0xa4, 0x97, 0xf3, 0xa8,
0xb2, 0x12, 0xdb, 0xa4, 0x27, 0x57, 0x36, 0xc9, 0x8, 0x22, 0x5c, 0x54, 0xf7, 0x99, 0x7b, 0xa3, 0x2f, 0xb8,
0x5c, 0xd5, 0x16, 0xb8, 0x19, 0x27, 0x6b, 0x71, 0x97, 0x14, 0x5b, 0xe8, 0x1f, 0x23, 0xe8, 0x5c, 0xb8, 0x1b,
0x73, 0x4b, 0x6e, 0x7a, 0x3, 0x13, 0xff, 0x97, 0... | Rust | 0 |
r() + "_TYPE") for tok in toks]
if enum:
messages[-1] = enum
for base, field, attr_name, repeated_field in zip(
messages, messages[1:], toks[1:], repeated_iter
):
base.fields[attr_name] = (
DummyField(message=field, repeated=repeated_field)
if isinstance(fiel... | Python | 1 |
"""Testing utilities"""
import pyverilog.utils.version
from util.vdiff import VerilogASTDiff
from pyverilog.vparser.parser import parse
class VerilogParser(object):
"""parses Verilog code into AST, useful for comparing verilogs"""
@staticmethod
def parse(verilog_filename, include_list=None, define_list=No... | Python | 1 |
.f_in_list("thermal_gap")?;
fill.thermal_bridge_width = i.f_in_list("thermal_bridge_width")?;
fill.smoothing = i.maybe_s_in_list("smoothing");
fill.corner_radius = i.maybe_f_in_list("radius").unwrap_or(0.0);
i.close(fill)
}
}
// (segment (start 211 61.1) (end 211.1 61) (width 0.2032... | Rust | 0 |
,
device_context_index: u8,
) -> Result<()> {
// Note that it could be slot context or device context. They have the same size. Won't
// make a difference here.
let ctx: EndpointContext = self
.mem
.read_obj_from_addr(
input_context_ptr
... | Rust | 0 |
Expr.Add,
Expr.Nop,
Expr.Return,
),
)
def _loc_29AF(): pass
label('loc_29AF')
If(
(
(Expr.Eval, "OP_29(0x006F, 0x01, 0x0400)"),
Expr.Return,
),
'loc_29C8',
)
ExecExpressionWithReg(
0x0002,
(... | Python | 1 |
grouped[date].append(entry)
days = sorted(grouped.keys())
from datetime import datetime
lines = [f"📅 *Прогноз погоди на 5 днів у {city.title()}*\n"]
for day in days[:5]:
entries = grouped[day]
... | Python | 1 |
"""
https://www.krptn.dev/
A user authentication and access management system (IAM) with [Encryption at rest derived from credentials](https://www.krptn.dev/news/zero-knowledge/).
How we achieve this?
- All Data is encrypted (any data can be request by the developer to be secured)
- Only the appropriate users' cred... | Python | 1 |
#!/usr/bin/env python
#
# <xbar.title>UptimeKuma Monitor</xbar.title>
# <xbar.version>v1.1</xbar.version>
# <xbar.author>mariogarridopt</xbar.author>
# <xbar.author.github>mariogarridopt</xbar.author.github>
# <xbar.desc>Show UptimeKuma status</xbar.desc>
# <xbar.dependencies>python</xbar.dependencies>
# <xbar.abouturl... | Python | 1 |
#!/usr/bin/env python3
"""
AutoGen MCP + Cogni Memory Integration - WORKING VERSION
Based on successful commit 77a6b4b that achieved 21/21 tools discovery
This is the PROVEN working approach using stdio transport with proper path resolution.
"""
import asyncio
import logging
import os
from pathlib import Path
# Auto... | Python | 1 |
));
pnk!(hdr.version_create_by_branch(vn, bn));
assert!(hdr.branch_has_versions(bn));
}
#[test]
fn test_branch_create_by_base_branch() {
let hdr = MapxRawMkVs::new(2);
pnk!(hdr.version_create(VersionName(b"manster0")));
let bn1 = BranchName(b"test1");
let vn11 = VersionName(b"testversion11");
... | Rust | 0 |
hl(location, cpu, bus),
ADC(location) => alu::adc(location, cpu, bus),
AND(location) => alu::and(location, cpu, bus),
XOR(location) => alu::xor(location, cpu, bus),
OR(location) => alu::orr(location, cpu, bus),
SBC(location) => alu::sbc(location, cpu, bus),
... | Rust | 0 |
ENTS",
"GL_MAX_GEOMETRY_INPUT_COMPONENTS",
"GL_MAX_GEOMETRY_OUTPUT_COMPONENTS",
"GL_MAX_GEOMETRY_OUTPUT_VERTICES",
"GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS",
"GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS",
"GL_MAX_GEOMETRY_UNIFORM_COMPONENTS",
"GL_MAX_INTEGER_SAMPLES",
"GL_MAX_SAMPLE_MASK_WORDS",... | Rust | 0 |
match arg {
FnArg::Captured(arg) => Ok(arg.ty.clone()),
FnArg::Ignored(ty) => Ok(ty.clone()),
other => Err(Error::new(
other.span(),
"expected non-self argument with type",
)),
}
}
fn get_fn_return_type(ty: &ReturnType) -> Type {
match ty {
R... | Rust | 0 |
id,
r#type: r#type.ok_or(::serde::de::Error::missing_field("Type"))?,
vpn_gateway_id: vpn_gateway_id,
vpn_tunnel_options_specifications: vpn_tunnel_options_specifications,
})
}
}
d.deserialize_map(Visitor)
}
}
... | Rust | 0 |
q == 0 {
warn!("Unable to determine processor frequency");
}
// load kernel and determine image size
let vm_slice = std::slice::from_raw_parts_mut(vm_mem, vm_mem_length);
let mut image_size = 0;
elf.program_headers
.iter()
.try_for_each(|program_header| match program_header.p_type {
PT_LOAD => {... | Rust | 0 |
connected to the rest of the graph
NewVertex
as (self.0) : C
where C::Graph: Graph<Directedness=Directed>
}
<gh_stars>0
//! This is a straight-forward command line utility that can dump constraints written by a tracing runtime.
//! It achieves this by running an instrumented target program with the necessary environ... | Rust | 0 |
:graphene_quaternion_init_from_quaternion(alloc, src.to_glib_none().0);
from_glib_full(alloc)
}
}
pub fn new_from_radians(rad_x: f32, rad_y: f32, rad_z: f32) -> Quaternion {
assert_initialized_main_thread!();
unsafe {
let alloc = graphene_sys::graphene_quaternion... | Rust | 0 |
M(BYTES) BYTES,
MAX(BYTES) MAXBYTES
FROM DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME, FILE_ID) FREE
WHERE DF.TABLESPACE_NAME = FREE.TABLESPACE_NAME(+)
AND DF.TABLESPACE_NAME NOT LIKE 'UNDO%'
AND DF.FILE_ID = FREE.FILE_ID(+)
GR... | Python | 1 |
lues)
for j in range(len(mkt)):
if mkt.iloc[j,2] == month_end_dates[i]:
mkt.iloc[j,3] = total_sum
##把每一天的权重设成改月月底占市值权重
mkt['weights'] = (mkt['final'] / mkt['total_mkt']).fillna(method='bfill')
daily_value = state['trade_vol... | Python | 1 |
graphic returns the same points, if the manifold is already
# in the necessary geometry
assert M.inverse_stereographic(X1, X2) == (M, X1, X2), (
"Inverse stereographic does not return the original points for X1"
)
assert M_stereo.stereographic(X1_stereo, X2_stereo) == (M_stereo, X1_stereo, X2_st... | Python | 1 |
for avgtype, precision, recall, f1 in vad_results:
print(
f"VAD {avgtype} F1: {f1:<10.3f} {precision:<10.3f} Recall: {recall:<10.3f}",
file=fp)
print(f"FER: {fer:.2f}", file=fp)
print(f"AUC: {auc:.2f}", file=fp)
print(f"Pfa: {p_... | Python | 1 |
True if topic_a is a prerequisite of topic_b
"""
# Define some known prerequisites
prerequisites = PREREQUISITES
topic_a_lower = topic_a.lower()
topic_b_lower = topic_b.lower()
return topic_b_lower in prerequisites.get(topic_a_lower, [])
def _is_ex... | Python | 1 |
import time
from machine import Pin, ADC
sensor = ADC(4)
def read_temperature():
adc_value = sensor.read_u16()
voltage = adc_value * (3.3 / 65535) # Converting ADC value to voltage
temperature_celsius = 27 - (voltage - 0.706) / 0.001721 # Converting voltage to Celsius
return round(temperature_celsi... | Python | 1 |
a 32-bit counter. The prescaler has an additional
/// interrupt that can be triggered on incrementing.
/// input clock to expire a 32-bit counter.
/// 2. Use 1 Hz RC clock, 16-bit prescaler is ignored and can be used
/// separately. This requires the RTC module is setup and enabled.
///
/// (1) is independent... | Rust | 0 |
pooled_prompt_embeds, text_ids) = pipe.encode_prompt(
prompt,
prompt_2=None,
device=torch_device,
max_sequence_length=inputs["max_sequence_length"],
)
output_with_embeds = pipe(
prompt_embeds=prompt_embeds,
pooled_prompt_embeds=pool... | Python | 1 |
ave the symbol table for at least some
// symbolication purposes.
Mapping::mk(map, |data, stash| {
let (macho, data) = find_header(data)?;
let endian = macho.endian().ok()?;
let obj = Object::parse(macho, endian, data)?;
Context::new(stash, obj, None)
... | Rust | 0 |
: str,
parents: t.Tuple[t.Type],
attrs: t.Dict[str, t.Any],
) -> "CheckLastError":
attrs['__DEFER_STEP_ERRORS__'] = True
for attr_name in attrs:
attr = attrs[attr_name]
# wrap only methods
if not isinstance(attr, types.FunctionType):
... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
group_l10n_in_reseller = fields.Boolean(implied_group='l10n_in.group_l10n_in_reseller', str... | Python | 1 |
#!/usr/bin/env python3
# Purpose: Generate binary labels for reference sequences (1 for ILP, 0 for non-ILP)
# Inputs:
# - input/ref_ILPs.fasta (annotated sequences)
# - preprocess/ref_features.csv (feature matrix)
# Output: preprocess/ref_labels.csv (labels)
# Notes: Matches sequence IDs to ensure alignment with f... | Python | 1 |
fn find_contestant(&mut self, handle: &str) -> Option<usize> {
self.standings.iter().position(|x| x.0 == handle)
}
/// Remove a contestant with the given handle, and return it if it exists.
pub fn remove_contestant(&mut self, handle: &str) -> Option<(String, usize, usize)> {
let pos = self... | Rust | 0 |
# *********************************************************************
# FUNCTION TO INTERPOLATE THE INPUT PLANETARY MODEL
#
# Copyright (c) 2014-2019: HILARY R. MARTENS, LUIS RIVERA, MARK SIMONS
#
# This file is part of LoadDef.
#
# LoadDef is free software: you can redistribute it and/or modify
# it ... | Python | 1 |
) -> String {
let mut params: Vec<(&str, &str)> = vec![];
if let Some(last_item_id) = &last_item_id {
params.push(("untilId", last_item_id));
}
match sender_filter {
SenderFilter::All => (),
SenderFilter::LoginUser => params.push(("list", "self")),
SenderFilter::Followi... | Rust | 0 |
skip_serializing_if = "String::is_empty",
deserialize_with = "crate::utils::deserialize_null_string::deserialize"
)]
pub name: String,
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct AppsListInstallationsResponse {
#[serde(
default,
skip_serializi... | Rust | 0 |
essing non-existent resource."""
# response = await client.get("/admin/resources/non/existent/uri", headers=TEST_AUTH_HEADER)
# # Unhandled exception returns 500
# assert response.status_code == 500
# FIXME: This test should be updated to check for 404 instead of 500
# async def test_ad... | Python | 1 |
class Paused(Generic[S], NonTerminalExecutionState[S]):
pass
class Succeeded(Generic[S], TerminalExecutionState[S]):
pass
class Failed(Generic[S], TerminalExecutionState[S]):
pass
class Canceled(Generic[S], TerminalExecutionState[S]):
pass
class SystemError(Generic[S], TerminalExecutionState[S... | Python | 1 |
= l1gvkthhect
'# documentation_contrast_horizon -> wait_junctions_buzzer'
def plj7h_moj1b(afcpnsflf4w: ravegyvh8x0, k_6sq1s8xp9, xaas_wtadxm: d1iwmybe4oe):
"""# documentation_contrast_horizon -> wait_junctions_buzzer"""
'# documentation_contrast_horizon -> wait_junctions_buzzer'
global puymrrozlc4
... | Python | 1 |
'originalFile': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
'published': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'slug': ('autoslug.fields.AutoSlugField', [], {'unique': 'True', 'max_length': '50', 'populate_from... | Python | 1 |
ool, Ordering};
use std::sync::Arc;
use std::time::Duration;
use tokio::io::{AsyncBufReadExt, BufReader};
use tokio::process::{Child, ChildStderr, ChildStdin, ChildStdout, Command};
use tokio::sync::{mpsc, Mutex, Notify, RwLock};
use tokio::{select, task, time};
/// keeps track of the initialize/initialized handshake ... | Rust | 0 |
value = float(value)
except ValueError:
pass
elif value.lower() == "true":
value = True
elif value.lower() == "false":
value = False
else:
try:
... | Python | 1 |
import time
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
import os
location = os.getcwd()
def chrome_setup():
from selenium.webdriver.chrome.service import Service
# to download the file in desired location
preferences = {"downloa... | Python | 1 |
lst = [4.0,3.75,3.75,3.5]
lst2 = [2,2,3,3]
for n in enumerate(zip(lst,lst2)):
print(n)
print(n[0],n[1][0],n[1][1])
| Python | 1 |
# Python
import unittest
from unittest.mock import Mock
# ATS
from pyats.topology import Device
# Genie
from genie.libs.ops.eigrp.nxos.eigrp import Eigrp
from genie.libs.ops.eigrp.nxos.tests.eigrp_output import EigrpOutput
# nxos show eigrp
from genie.libs.parser.nxos.show_eigrp import ShowIpv4EigrpNeighborsDetail,\... | Python | 1 |
class Solution:
def divide(self,nums,low,high):
if low==high:
return
mid=(low+high)//2
self.divide(nums,low,mid)
self.divide(nums,mid+1,high)
self.merge(nums,low,mid,high)
def merge(self,nums,low,mid,high):
left=low
right=mid+1
temp=[]... | Python | 1 |
angle::new(Point::new(0,0),
Point::new(screensize.x / 2, screensize.y / 2 - 1))));
uptime_tv.untrusted = false;
uptime_tv.style = blitstr::GlyphStyle::Small;
uptime_tv.draw_border = false;
uptime_tv.margin = Point::new(3, 0);
write!(uptime_tv, "Booting up...").expect("|status: could... | Rust | 0 |
#Programa 4.7 "Agregar un ciclo for a p-6 para indicarle cuantas veces debe realizar las operaciones.
#En Cada iteración los numeros que se pasaran en los argumentos seran el doble del anterior"
#Elaborado el 14/11/2024
#Elaborado por : Evelyn Jocelyn León de Luna
def operaciones(num1, num2, digitos):
suma = num... | Python | 1 |
vice.total_size(), 0);
// To test DoubleSpend and AlreadyInPool conditions, we need to add
// a valid transaction.
let valid_transaction = test_transaction(
&[
OutPoint::new(pool.tx_hash.clone(), 5),
OutPoint::new(pool.tx_hash.clone(), 6),
],
2,
);
m... | Rust | 0 |
// Serde has a method that will read directly from a reader. However,
// its own documentation says this method is less efficient than
// reading a full file into a string and then calling ::from_str.
// Hence, I'm doing taking more performant path.
let mut buffered = BufReader:... | Rust | 0 |
srt(self, srt_content: str) -> List[Dict[str, Any]]:
"""解析SRT內容為片段列表"""
segments = []
blocks = re.split(r'\n\s*\n', srt_content.strip())
for block in blocks:
if not block.strip():
continue
lines = block.strip().split('\n')
... | Python | 1 |
}
unsafe impl<T: Sync> Sync for RwLockReadGuard<'_, T> {}
unsafe impl<T: Send> Send for RwLockWriteGuard<'_, T> {}
unsafe impl<T: Sync> Sync for RwLockWriteGuard<'_, T> {}
unsafe impl<T> StableDeref for RwLockReadGuard<'_, T> {}
unsafe impl<T> StableDeref for RwLockWriteGuard<'_, T> {}
use core::marker::PhantomData;
... | Rust | 0 |
# -*- coding: utf-8 -*-
# @Author : llc
# @Time : 2022/1/1 16:54
import pytest
from flask_openapi3 import Info, OpenAPI
info = Info(title="book API", version="1.0.0")
app = OpenAPI(__name__, info=info)
app.config["TESTING"] = True
@pytest.fixture
def client():
client = app.test_client()
return client... | Python | 1 |
re are any GridFS in Sptial collection are generated during scenario analysis,
# the format of such GridFS file is: <SubbasinID>_<CoreFileName>_<ScenarioID>
# e.g., SLPPOS_UNITS_12345678
regex_str = '\\d+_\\S+_%d' % scenario_id
for i in spatial_gfs.find({'filename': {'$regex': regex_st... | Python | 1 |
has an arrhythmia.",
"Diapers.",
"I cook naked, I clean....I clean naked, I drive naked.",
"Naked.",
"Naked.",
"Naked. ",
"But I really enjoy dancing.",
"Forty bucks?",
"Are they Sable?",
"(gesturing) There's this.",
"Jerry.",
"Hey!",
"(startles Jerry and George) ha ha ha ha.",
"Nice sidle, h... | Rust | 0 |
# dialects/mssql/aioodbc.py
# Copyright (C) 2005-2024 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
# mypy: ignore-errors
r"""
.. dialect:: mssql+aioodbc
:name: aioodbc
... | Python | 1 |
rcc.cr.write(|w| w.pllon().set_bit());
while rcc.cr.read().pllrdy().bit_is_clear() {}
rcc.cfgr.modify(|_, w| unsafe {
w.ppre().bits(ppre_bits).hpre().bits(hpre_bits).sw().bits(2)
});
} else {
// use HSI as source
rcc.cfgr
... | Rust | 0 |
'''
Warning! Your mileage may vary
Based on:
- Read this for EC2 setup info and the approach - http://www.dikant.de/2010/10/08/setting-up-a-vpn-server-on-amazon-ec2/
- https://gist.github.com/1130401
- EC2 fabric bits via - https://github.com/slacy/fabric-ec2
'''
import boto
import re
from fabric.api import *
fro... | Python | 1 |
import argparse
import cv2
import time
import numpy as np
from coordinate_transform import windowToFieldCoordinates
# MOUSE STUFFZ
def onmouse(event, x, y, flags, param):
# create a black image/frame
img = np.zeros((480, 640, 3), np.uint8)
bottomLeft = [100, 400, 0]
topLeft = [220, 200, 0]
topRigh... | Python | 1 |
proto;
use crate::topic::Topic;
use futures::{
io::{AsyncRead, AsyncWrite},
AsyncWriteExt, Future,
};
use libp2p_core::{upgrade, InboundUpgrade, OutboundUpgrade, PeerId, UpgradeInfo};
use prost::Message;
use std::{error, fmt, io, iter, pin::Pin};
/// Implementation of `ConnectionUpgrade` for the floodsub proto... | Rust | 0 |
# class Solution:
# def isAnagram(self, s: str, t: str) -> bool:
# if len(s) != len(t):
# return False
# if sorted(t) == sorted(s):
# return True
# return False
class Solution:
def isAnagram(self, s: str, t: str) -> bool:
char_m... | Python | 1 |
import tensorflow as tf
"""
Contributor: Vladimir Samodelkin
"""
@tf.function
def load_resize_image(img_path, shape=(256, 256, 3)):
"""
Loading and resizing of images
Args:
img_path: Path to the image
shape: Shape used for resizing
Returns:
Preprocessed image
"""
im... | Python | 1 |
x355031cedb324efd, "6p833mqv697g", -2.563025741, -89.584123636},
{0xe2fb3bec228ff341, "wcxmrv12jztn", 9.387858697, 134.287858814},
{0xab272d165e6227c0, "pdmku5kyd8mw", -76.489818122, 165.06523157},
{0x0b47dee4b350af9a, "1e3xxt5mb2rt", -70.371935572, -110.056550871},
{0x3ff35bc77aeacf9a, ... | Rust | 0 |
210083805e93bd941770109bcc797784a71db9e48913f702c56e60b1c3e2ff379a60");
check_lax_sig!("3044022023ee4e95151b2fbbb08a72f35babe02830d14d54bd7ed1320e4751751d1baa4802206235245254f58fd1be6ff19ca291817da76da65c2f6d81d654b5185dd86b8acf");
}
#[test]
fn sign_and_verify() {
let mut s = Secp256k1::new... | Rust | 0 |
import libcst
import pytest
from swesmith.bug_gen.procedural.python.control_flow import (
ControlIfElseInvertModifier,
ControlShuffleLinesModifier,
)
@pytest.mark.parametrize(
"src,expected",
[
# Simple if-else inversion
(
"""
def foo(x):
if x > 0:
return 1
... | Python | 1 |
from flask import Flask, request
from flask_cors import CORS
from time import sleep
from db.characters import get_all_characters, get_character_by_id, remove_character, add_character
app = Flask(__name__)
CORS(app)
@app.route("/characters")
def all_characters():
return get_all_characters()
@app.route("/charact... | Python | 1 |
class TestIncrementalTypecheckSameFile {}
"""
)
self.test_driver.check_cmd(["No errors!"])
# Notice how the only change is the removed doc block.
with open(
os.path.join(
self.test_driver.repo_dir, "test_incremental_typecheck_same_f... | Python | 1 |
-> overcurrent_crowns_misalinement'
raise None
s9jgtq1d3on &= hgga12_fobp
import io891z14hvn, hyc4ru1x3c_ as bnkmwuwciua, ti0k9rnus_k, tnwphjrl74w
assert 0.0, 0j
rtv2rpg4zm4.rc41uw8o6ie: b'' = ngx4w33y49o
nonlocal nyivv37iupv
pass
@0.0(z94u2k76sd4, False, zu7uaqni692, jc48uk9c23o, vd6gggg_2c... | Python | 1 |
# Copyright (C) 2010-2023 Bastian Kleineidam
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distr... | Python | 1 |
# Time: O(m * n)
# Space: O(m * n)
class Solution(object):
def pacificAtlantic(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: List[List[int]]
"""
PACIFIC, ATLANTIC = 1, 2
def pacificAtlanticHelper(matrix, x, y, prev_height, prev_val, visited, res):
... | Python | 1 |
.output("frag_color", Type::Vec4);
if let Some(output) = output {
ctx.set_output(output_global, output);
} else {
ctx.set_output(
output_global,
Expression::vec(&[0.5.into(), 0.5.into(), 0.5.into(), ... | Rust | 0 |
article_count = item.get("articles_count", 0)
topics = item.get("key_topics", [])
top_topics = topics[:3] if topics else []
html += f"""
<div class="toc-item">
<a href="#issue-{issue_num}" class="toc-link">
<div class="to... | Python | 1 |
n and semantic memory?")
chat("Thanks! Can you recall my name again?") # Test memory after potential summary
# Check the final state (if persistence is enabled)
if mongodb_checkpointer:
try:
final_state = app.get_state(config)
print("\n--- Final Conversation State (from Mong... | Python | 1 |
onfig enable and wether Audio SRAM can be put into Deep Sleep by the Audio hardware\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modif... | Rust | 0 |
doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, SCL_A> {
use crate::Variant::*;
match self.bits {
0 => Val(SCL_A::SCL_SRC_DIO_0),
1 => Val(SCL_A::SCL_SRC_DIO_1),
2 => Val(SCL_A::SCL_SRC_DIO_2),
... | Rust | 0 |
it asyncio.sleep(0.1)
nonlocal done_count
done_count += 1
pool = AutoscaledPool(
system_status=system_status,
run_task_function=run,
is_task_ready_function=lambda: future(True),
is_finished_function=lambda: future(False),
concurrency_settings=ConcurrencySetti... | Python | 1 |
elem_tdo: *mut *mut OCIType,
) -> sword;
}
extern "C" {
pub fn OCITypeElemFlags(env: *mut OCIEnv, err: *mut OCIError, elem: *const OCITypeElem) -> ub4;
}
extern "C" {
pub fn OCITypeElemNumPrec(
env: *mut OCIEnv,
err: *mut OCIError,
elem: *const OCITypeElem,
) -> ub1;
}
extern "C"... | Rust | 0 |
low_cpu_mem_usage=True
).eval()
else:
model = AutoModelForCausalLM.from_pretrained(
MODEL_PATH,
load_in_4bit=False,
trust_remote_code=True,
torch_dtype=torch_type,
low_cpu_mem_usage=True
).to(... | Python | 1 |
ta.varbinds)
except asyncio.InvalidStateError:
del self.requests[key]
@property
def is_connected(self) -> bool:
return bool(self.transport is not None and not self.transport.is_closing())
async def _send(self, message: SnmpMessage, addr: Address) -> List[SnmpVarbind]:
... | Python | 1 |
se thiserror::Error;
use crate::view::settings::SettingsView;
const MAX_TEXT_LENGTH: usize = 512;
#[derive(Error, Debug)]
pub enum GlossError {
#[error(transparent)]
Ichiran(#[from] IchiranError),
#[error("Text too long ({length}/{MAX_TEXT_LENGTH} chars)")]
TextTooLong { length: usize },
}
#[derive(... | Rust | 0 |
lue> = HashSet::new();
loop {
match input.read() {
Ok(row) => {
if !seen.contains(&row.cells()[idx]) {
seen.insert(row.cells()[idx].clone());
let _ = output.send(row);
... | Rust | 0 |
diag), dim=-1)
Im_Ext = torch.cat((Im_up, Im_mid, Im_down), dim=-2)
Im_out = Im_Ext[:, :, h - bdr[0]: 2 * h + bdr[1], w - bdr[2]: 2 * w + bdr[3]]
return Im_out
def LFdivide(lf, patch_size, stride):
U, V, C, H, W = lf.shape
data = rearrange(lf, 'u v c h w -> (u v) c h w')
bdr = (patch_size - s... | Python | 1 |
const ACMP4_CMP_IGEN_TRIM_UP_0: u32 = 0b0;
/// 0b1: increases
pub const ACMP4_CMP_IGEN_TRIM_UP_1: u32 = 0b1;
}
}
/// ACMP1 sample_lv source select
pub mod ACMP1_SAMPLE_SYNC_EN {
/// Offset (8 bits)
pub const offset: u32 = 8;
/// Mask (1 bit: 1 << 8)... | Rust | 0 |
import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
os.makedirs("graphics/results", exist_ok=True)
subjects = [f"P{i:02d}" for i in range(1, 11)]
fractal_means = []
logpower_means = []
for i in range(1, 11):
fractal_path = f"results/Fractal/Training/P{i:02d}.csv"
logpower_path = ... | Python | 1 |
arg: Mat2) -> Self {
Mat4::from(Mat3::from(arg))
}
}
impl From<DMat2> for Mat4 {
fn from(arg: DMat2) -> Self {
Mat4::from(Mat2::from(arg))
}
}
impl From<Mat3> for Mat4 {
fn from(arg: Mat3) -> Self {
Mat4::new(
arg.m00, arg.m01, arg.m02, 0.0,
arg.m10, arg... | Rust | 0 |
import json
import numpy as np
from scipy.stats import wilcoxon
from tqdm import tqdm
from metrics_evaluation.metrics.ruby.similarity import ruby, string_similarity, tree_similarity, graph_similarity
data = json.load(open("to-grade/conala.json", "r"))
models = ["baseline", "tranx-annot", "best-tranx", "best-tranx-r... | Python | 1 |
eld is `INPUTPULL`"]
#[inline(always)]
pub fn is_inputpull(&self) -> bool { *self == MODE4_A::INPUTPULL }
#[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
#[inline(always)]
pub fn is_inputpullfilter(&self) -> bool { *self == MODE4_A::INPUTPULLFILTER }
#[doc = "Checks if the value... | Rust | 0 |
Hours,
#[value = 7]
InvalidWorkstation,
#[value = 8]
PasswordExpired,
#[value = 9]
PasswordMustChange,
#[fallback]
Other(u16),
}
impl fmt::Display for AuthStatusCode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Success => write!... | Rust | 0 |
_epi64() {
let a = _mm256_set1_epi64x(8);
let b = _mm256_set1_epi64x(2);
let c = _mm256_set1_epi64x(1);
let r = _mm256_maskz_shrdv_epi64(0, a, b, c);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_shrdv_epi64(0b00001111, a, b, c);
let e = _mm256_... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.