text
string
label_name
string
labels
int64
import streamlit as st from openai import AzureOpenAI st.set_page_config(page_title="Setup Azure OpenAI", page_icon="🔑") st.title("🔑 Configura Azure OpenAI") # Campi di input endpoint = st.text_input("Endpoint Azure OpenAI", value="https://<resource>.openai.azure.com") api_key = st.text_input("API Key", type="passw...
Python
1
s r remove_writerz#BaseSelectorEventLoop.remove_writerqrr*cKtj||jr|jdk7r t d |j |S#t tf$rYnwxYw|j...
Python
1
creating a Cortex-M bus manager with `'static` lifetime. /// /// This macro is a convenience helper for creating a bus manager that lives for the `'static` /// lifetime an thus can be safely shared across tasks/execution contexts (like interrupts). /// /// This macro is only available with the `cortex-m` feature. /// ...
Rust
0
fn write_projective3<W: Write>(mut write: W, matrix: &Projective3<f64>) -> std::io::Result<()> { for row in 0..4 { for col in 0..4 { write!(write, "{}", matrix[(row, col)])?; if col < 3 { write!(write, " ")?; } } writeln!(write, "")?; ...
Rust
0
operation: operation, _: space(), child: appn().map(Box::new) } }; choice!(attempt(unary), appn()) } } parser!{ pub fn appn['a, Input]()(Input) -> Expr<'a> where [ Input: Stream<Item = Token<'a>> ] { let binary = value(|left, right| E...
Rust
0
os.environ['CLOSE_MATMUL_K_SHIFT'] = '1' # 'CLOSE_MATMUL_K_SHIFT' is a switch of matmul K-axis shift, set it to '1' to close matmul K-axis shift, set it to '0' to enable matmul K-axis shift. os.environ['PYTHONHASHSEED'] = str(seed) # 'PYTHONHASHSEED' refers to python hash seed, use a string of non-negative in...
Python
1
#!/usr/bin/env python3 # -*-coding:utf8-*- import math from typing_extensions import ( Literal, ) class ArmMsgFeedbackLowSpd: ''' msg_v1_feedback 驱动器信息高速反馈 0x6 节点 ID: 0x1~0x06 CAN ID: 0X261~0x266 Args: can_id: canid,表示当前电机序号 vol: 当前驱动器电压 foc_tem...
Python
1
let result = self.literal("\\d", settings); result } /// Adds the ```\D``` metacharacter, matches any non-digit character \[^0-9\]. pub fn non_digit(self, settings: &Settings) -> Self { let result = self.literal("\\D", settings); result } /// Adds the ```\s``` metac...
Rust
0
rged_df.to_csv(output_filepath, index=False) print("数据合并完成!") print(f"总共 {len(merged_df)} 条记录") print(f"时间范围: {merged_df['DateTime'].min()} 到 {merged_df['DateTime'].max()}") print(f"输出文件: {output_filepath}") return output_filepath def cleanup_temp_files...
Python
1
Json, Query}, Responder, }; use chrono::{Date, NaiveDate, Utc}; use njord_core::geocoding; use serde::{Deserialize, Serialize}; #[derive(Deserialize, Serialize)] pub(crate) enum WeeklyForecastResponce { Ok(HashMap<NaiveDate, f32>), Error { errors: Vec<String> }, } #[derive(Deserialize, Serialize)] pub(cra...
Rust
0
ds Ball Agent, is a bot that always drives //! blindly towards the ball no matter what is happening on the field (just //! like Dory from Finding Nemo). #![warn(future_incompatible, rust_2018_compatibility, rust_2018_idioms, unused)] #![cfg_attr(feature = "strict", deny(warnings))] #![warn(clippy::all)] use na::Vecto...
Rust
0
Ok((_, _)) => false, // did not consume all input Err(_) => false, } } // Check that the given parser parses to the given value, with no // errors or left-over inputs. fn check_valid_parse<A: PartialEq + FromAvro + Debug>(input: &[u8], expected: A) { match A::from_avro...
Rust
0
).unwrap(); client.execute("UPDATE Character.Health SET Hunger = $1, Thirst = $2 WHERE CharacterId = $3", &[&health.health.hunger, &health.health.thirst, &health.character_id]).unwrap(); } pub fn disable_character(character: CharacterId) { let mut client = db_postgres::get_connection().unwrap(); client.e...
Rust
0
se(shape.g1, hsm[4], rtol=1.e-6) np.testing.assert_allclose(shape.g2, hsm[5], rtol=1.e-6) # T from moments is M11x2, because weighted second moment is just sigma^2, not T=2*sigma^2 # T from hsm is 2*sigma^2/sqrt(1-e^2) because that sigma is det(M)^1/4, not Tr(M)/2 print('T: ', moments['...
Python
1
], [0x6e5a2cad, 0x36a4f6b7]), "2375eae98e1a0c07e21aa33a65782bba6941c79578214e9d508d6150314608db" ), ( // Len = 552 "e04c48e2dd05a0f0a5dd9913ba67ab6dbbe137d701b2ad356912cefdd23059af7c9d915aa32d46480adc57c044022efce061d4e20f8113758fe1726212c8118b659ee104cb", (32, 21, [0x34f4a136, 0x3a8d0746], [0x1649e0a2, 0x534...
Rust
0
''' Escribe una función que tome una tupla como entrada y devuelva una lista con los mismos elementos. ''' # Función "copiar_tupla" def copiar_tupla(t): # Convertir la tupla a una lista mediante el método list() return list(t) # Probar la función "copiar_tupla" t1 = (1, 2, 3, 'a', 'b') print("Tupla original:"...
Python
1
"""Repeater""" def main() : """Repeater""" txt = input() for _ in range(100) : print(txt) main()
Python
1
_init!( litex_vexriscv::chip::LiteXVexRiscv< LiteXArtyInterruptablePeripherals, >, litex_vexriscv::chip::LiteXVexRiscv::new( "LiteX on Arty A7", interrupt_service ) ); PANIC_REFERENCES.chip = Some(chip); // Enable RISC-V interrupts global...
Rust
0
== file: main.frisbee fun void main() { Int? i = nil; i.to_string(); // ERR: Use ?. operator to access methods for Maybe type } "# ); assert_semantic_check_is_fine!( maybe_method_call_simple, r#" ===== file: main.frisbee fun void main() { Int? i = nil; Strin...
Rust
0
Ok(Runfiles { mode: Mode::ManifestBased(path_mapping), }) } /// Returns the runtime path of a runfile. /// /// Runfiles are data-dependencies of Bazel-built binaries and tests. /// The returned path may not be valid. The caller should check the path's /// validity a...
Rust
0
#!/usr/bin/env python3 """ simple test of velocity control Copyright (c) 2023 ROX Automation - Jev Kuznetsov """ import time import odrive # type: ignore import odrive.enums as enums # type: ignore from utils import check_error from odrive_can.tools import UDP_Client # send data to plotjuggler udp = UDP_Client(...
Python
1
def arithmetic_operation(operator): operations = { '+': lambda x, y: x + y, '-': lambda x, y: x - y, '*': lambda x, y: x * y, '/': lambda x, y: x / y } return operations[operator if operator in operations else None] operation = arithmetic_operation('+') print(operation(1, 4...
Python
1
""" Module Purpose: Fetch historical climate data and offer functions for getting wind speed and snow precipitation Author: Lin Zhao, 249416700, lizhao@algomau.ca Date: 2025-03-15 """ import pandas as pd import numpy as py # Typo: should be `np` instead of `py` import os class ClimateData: """Handle historical ...
Python
1
) # Coordinates timeseries_US_coordinates_model = TimeseriesUSCoordinatesModel( Lat=float(data['Lat']) if data['Lat'] else 0, Long=float(data['Long_']) if data['Long_'] else 0 ) # Timeseries ...
Python
1
from unittest import TestCase import pygame from .cache import get_font, FontsDatabase, FontsMap from .constants import NOTO_SANS_MONO_MEDIUM_FONT_PATH, NOTO_SANS_MONO_MEDIUM_FONT_HEIGHT from .exception import UnattainableFontHeight class TestFontsDatabase(TestCase): def setUp(self) -> None: pygame.font...
Python
1
} extern "C" { pub fn ibv_ack_async_event(event: *mut ibv_async_event); } extern "C" { pub fn ibv_query_device( context: *mut ibv_context, device_attr: *mut ibv_device_attr, ) -> ::std::os::raw::c_int; } extern "C" { pub fn ibv_query_port( context: *mut ibv_context, port_...
Rust
0
'readable_name': key.replace('_', ' ').title(), 'available_scripts': categories_dictionary[category][key], 'anchor_link': '#' + key.replace('_', '-').lower(), 'powershell_example': _get_powershell_example(script) ...
Python
1
anup_class.return_value = mock_cleanup with patch("sys.argv", ["pypi_cleanup.py", "--test", "-u", "testuser"]): result = main() assert result == 0 mock_setup_logging.assert_called_once() mock_cleanup.run.assert_called_once() @patch("duckdb_packaging.pypi_cleanup.setup_...
Python
1
# 다음 변수 a를 print(type(a))로 넣었을 때 출력될 값과의 연결이 알맞지 않은 것은? # 1) 입력 : a =1, 출력 : class 'int' # 2) 입력 : a = 2.22, 출력 : class 'float' # 3) 입력 : a = 'p', 출력 : class 'char' # 4) 입력 : a = [1, 2, 3], 출력 : class 'list' print("정답은 3") print("왜냐: char->str")
Python
1
from __future__ import annotations from ._version import get_versions __ALL__ = ['version', '__version__', 'full_version', 'git_revision', 'release'] vinfo: dict[str, str] = get_versions() version = vinfo["version"] __version__ = vinfo.get("closest-tag", vinfo["version"]) full_version = vinfo['version'] git_revision...
Python
1
# This code is contributed by @iuliagroza # Time Complexity: O(|V|+|E|), where |V| is the number of vertices and |E| the number of edges # Space Complexity: O(|V|) # Shortest path (minimum number of edges) between a source node and all the others using BFS in a directed graph n = 5 m = 7 s = 2 edges = [[1, 2], [2, 1...
Python
1
""" Forum signals ============= This modules defines Django signals that can be triggered by the ``forum`` application. """ import django.dispatch # Arguments:"previous_parent" forum_moved = django.dispatch.Signal() # Arguments:"forum", "user", "request", "response" forum_viewed = django.dispatch.Signa...
Python
1
from galatea.darpa_imagenet.utils import count_images from galatea.darpa_imagenet.utils import ImageIterator import numpy as np from pylearn2.utils import serial from pylearn2.datasets.preprocessing import ExtractPatches from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix, DefaultViewConverter path = '...
Python
1
from django.db import models from common.constants.models import DEFAULT_MAX_LENGTH from common.models.deletable import DeletableModelMixin from common.models.historied import HistoriedModelMixin from common.models.importable import ImportableModelMixin from common.models.timestamped import TimestampedModelMixin from...
Python
1
orr r2, r2, #0xF00000 mcr p15, #0x00, r2, c1, c0, #0x02 mov r2, #0x40000000 fmxr fpexc, r2 fmdrr d0, r1, r1 fmdrr d1, r1, r1 fmdrr d2, r1, r1 fmdrr d3, r1, r1 fmdrr d4, r1, r1 fmdrr d5, r1, r1 ...
Rust
0
import yt_dlp # Function to choose format based on user input def download_video_or_audio(choice, video_url): if choice == 3: # MP3 format (audio only) ydl_opts = { 'format': 'bestaudio[ext=mp3]/bestaudio', # Directly download the best audio in MP3 format 'outtmpl': '%(title)s.%(e...
Python
1
import streamlit as st import pandas as pd import time from datetime import datetime ts=time.time() date=datetime.fromtimestamp(ts).strftime("%d-%m-%Y") timestamp=datetime.fromtimestamp(ts).strftime("%H:%M-%S") from streamlit_autorefresh import st_autorefresh count = st_autorefresh(interval=2000, limit=100, key="fi...
Python
1
} pub fn checkout(&self, mold_dir: &Path, use_git: bool) -> Result<(), Error> { let path = self.path(mold_dir); let func = if use_git { checkout_git } else { checkout }; let label = format!( "{} {} to {}...", "Updating".green(), path.display().to_stri...
Rust
0
set_cur_tag(self.__class__.__name__) msg = [ ChatMessage(content=SYSTEM_PROMPT, role=MessageRole.SYSTEM), ChatMessage( content=GENERATION_PROMPT.format( input_spec=input_spec, example_prompt=CLASSIFICATION_1_SHOT_EXAMPLES ), ...
Python
1
} #[test] fn class_negate_surrogates_max() { let cls = class(&[('\u{E000}', '\u{10FFFF}')]); assert_eq!(cls.negate(), class(&[('\x00', '\u{D7FF}')])); } #[test] fn class_negate_surrogates_max_edge() { let cls = class(&[('\u{E001}', '\u{10FFFF}')]); assert_eq!(cl...
Rust
0
from unittest.mock import AsyncMock import trio from trio_util import move_on_when, run_and_cancelling async def test_move_on_when(autojump_clock): event = trio.Event() async with move_on_when(event.wait) as cancel_scope: pass # context manager exits normally even if awaitable doesn't retur...
Python
1
class View: """ A class representing a view in the system. - name: str - the name of the view - run: function(ViewManager) - the function called every frame - start: function(ViewManager) - the function called when the view is created - stop: function(ViewManager) - the function called when the ...
Python
1
method.restore_firewall(1025, 2, False) assert mock_ipt_chain_exists.mock_calls == [ call(2, 'nat', 'sshuttle-1025') ] assert mock_ipt_ttl.mock_calls == [] assert mock_ipt.mock_calls == [ call(2, 'nat', '-D', 'OUTPUT', '-j', 'sshuttle-1025'), call(2, 'nat', '-D', 'PREROUTING...
Python
1
'''This entire file is licensed under MIT. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
Python
1
from moto.stepfunctions.parser.asl.component.state.exec.state_map.iteration.iteration_component import ( IterationComponent, ) from moto.stepfunctions.parser.asl.component.state.exec.state_map.iteration.iterator.distributed_iterator import ( DistributedIterator, ) from moto.stepfunctions.parser.asl.component.st...
Python
1
mat_data.into_iter(), ), 3, 3, ); // Build left-hand-side vector. let lhs = vec![1.0, 2.0, 3.0]; // Result should be [1.0, 2.0, 18.0] let expected = vec![1.0, 2.0, 18.0]; let mut out = vec![0.0; 3]; let mut out_par = vec![0.0; 3...
Rust
0
from pydub import AudioSegment from pydub.silence import split_on_silence # type:ignore from bragir.config import AudioConfig, config from bragir.audio.grouping import group_audio_segments from bragir.constants import DURATION_SECONDS_25MB from bragir.tracing.logger import logger def chunk_audio( file_path: str...
Python
1
nore] /// test "ignore" { /// assert_eq!(1, 2); /// } /// /// #[should_panic] /// test "should panic" { /// assert_eq!(1, 2); /// } /// /// #[should_panic(expected = "foo")] /// test "should panic with foo" { /// panic!("foo"); /// } /// # } /// ``` /// /// * `bench` - contains ben...
Rust
0
, indivisible units. /// Two billion ought to be enough for anybody! #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Deserialize, Serialize)] pub struct Money(i32); /// A unique identifier for a room, which hosts a game of hold'em. /// /// Again, two billion ought to be enough for anybody! #[derive(...
Rust
0
rame_system as system; use crate as utils; use crate::{DEFAULT_MIN_HANDLE_LEN, DEFAULT_MAX_HANDLE_LEN}; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>; type Block = frame_system::mocking::MockBlock<Test>; frame_support::construct_runtime!( pub enum Test where Block = Block,...
Rust
0
r; use ckb_jsonrpc_types::BlockTemplate; use ckb_logger::info; use ckb_snapshot::Snapshot; use ckb_store::ChainStore; use ckb_types::{ core::{ cell::{resolve_transaction, OverlayCellProvider, TransactionsProvider}, Cycle, EpochExt, ScriptHashType, TransactionView, UncleBlockView, Version, }, ...
Rust
0
venue.offererAddress.address, offerer=venue.managingOfferer, label=venue.common_name ) class OffererConfidenceRuleFactory(BaseFactory): class Meta: model = models.OffererConfidenceRule # One (and only one) must be set offerer: factory.SubFactory | None = None venue: factory.SubFactory | N...
Python
1
w: &'a mut W, } impl<'a> OUTFIFO_WDATA_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !0x01ff) | (value as u32 & 0x01ff); self.w } } #[doc = "Field `OUTFIFO_PUSH_CH2` reader - Set...
Rust
0
"content": system_prompt or "你是一个能分析图像的AI助手。请仔细观察图像,并根据用户的问题提供详细、准确的描述。" }, { "role": "user", "content": [ {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{image_base64}"}}, {"type": "text",...
Python
1
"""Support for Powerview scenes from a Powerview hub.""" import asyncio from aiohttp.client_exceptions import ServerDisconnectedError from aiopvapi.helpers.aiorequest import PvApiConnectionError, PvApiResponseStatusError DOMAIN = "hunterdouglas_powerview" MANUFACTURER = "Hunter Douglas" HUB_ADDRESS = "address" SC...
Python
1
"album": album_name }) else: print(f" ✅ MATCH: {found_artist}") else: print(f" ❌ FAILED: {result.get('error', 'Unknown')}") if mismatches: print_separator("MISMATCHES FOUND") print(f"\n🚨 Found {len(mismatches)} misma...
Python
1
/// True: A complex function is used to index the cache, potentially using all address bits. pub fn has_complex_indexing(&self) -> bool { get_bits(self.edx, 2, 2) == 1 } } #[derive(Debug)] #[cfg_attr(feature = "serialize", derive(Serialize, Deserialize))] pub struct MonitorMwaitInfo { eax: u32,...
Rust
0
from launch import LaunchDescription from launch_ros.actions import Node def generate_launch_description(): ld = LaunchDescription() robot_names = ["Robot_1", "Robot_2", "Robot_3"] robot_station_nodes = [] for name in robot_names: robot_station_nodes.append(Node( package = "my_py...
Python
1
"TERRAIN_ROUGHNESS": 0.2, # 优化:减少地形复杂度 } # ------------------------------------------------------------------------------ # SECTION 7: VISUALIZATION PARAMETERS (NEW for v2.0) # ------------------------------------------------------------------------------ VISUALIZATION = { "FIGURE_SIZE": (12, 10), #...
Python
1
<Matchup>, pub worst_matchups: Vec<Matchup>, pub total_matches: i64, } #[derive(Debug, Clone)] pub struct Matchup { pub champion_id: i64, pub wins: i64, pub matches: i64, pub winrate: f64, } impl<'de> Deserialize<'de> for MatchupData { fn deserialize<D>(deserializer: D) -> Result<MatchupDa...
Rust
0
import FWCore.ParameterSet.Config as cms process = cms.Process("BadChannelMerge") process.MessageLogger = cms.Service("MessageLogger", cerr = cms.untracked.PSet( enable = cms.untracked.bool(False) ), cout = cms.untracked.PSet( enable = cms.untracked.bool(True), threshold = cms.untra...
Python
1
IFOWriteLogic<D, N, NP1, BLOCK_SIZE> { fn default() -> Self { assert_eq!(N + 1, NP1); assert!(NP1 < 32); Self { write: Default::default(), data_in: Default::default(), full: Default::default(), almost_full: Default::default(), overf...
Rust
0
from safetensors.torch import load_file, save_file from internvl.model.svd_internvl_chat import SVDInternVLChatModel from internvl.utils.utils import rgetattr import torch from tqdm import tqdm def clamp(B_, correction, L): b = torch.abs(B_).mean(dim = 1, keepdim = True) c = torch.abs(correction).mean(dim = 1...
Python
1
_bbox(glyph_ids[i] as u32) .unwrap_or(GlyphBBox::zero()), _ => GlyphBBox::zero(), }; cacheGlyphBBox(f as u16, glyph_ids[i], &bbox); bbox }); let ht = bbox.yMax; let dp = -bbox.yMin; ...
Rust
0
oder.output_size(), **args.decoder_conf, ) # 6b. Attractor if getattr(args, "attractor", None) is not None: attractor_class = attractor_choices.get_class(args.attractor) attractor = attractor_class( encoder_output_size=encoder.output_size(), ...
Python
1
_type, status::Ok, "{\"player\": 2}"))) } else { Ok(Response::with((content_type, status::Ok, "{\"player\": null}"))) } } fn play_move(req: &mut Request) -> IronResult<Response> { let mutex = req.get::<Write<Games>>().unwrap(); let mut map = mutex.lock().unwrap(); let key: String = req.ext...
Rust
0
urn_dataset=True, stride=stride_val) print("Number of patches: {0}".format(num_patches)) print(patch_dataset) patch_dataset = patch_dataset.map(load_image_train_single, num_parallel_calls=tf.data.experimental.AUTOTUNE) # print(patch_dataset) patch...
Python
1
t(&mut self, newval: u64) { self.val = newval & 1148681787785871375; } // gets the value of the struct pub fn get(&self) -> u64 { self.val } /// extracts field val from current value pub fn f64mm_extract(&mut self) -> u64 { // bits 56..59 (self.val >> 56) & 0x...
Rust
0
::Error::{InvalidArgs, InvalidSyntax}; use crate::vm::{Error, Vm}; pub fn load_builtins(vm: &mut Vm) { vm.load_builtin("*", multiply); vm.load_builtin("/", divide); vm.load_builtin("+", plus); vm.load_builtin("-", minus); vm.load_builtin("<", lt); vm.load_builtin("<=", lteq); vm.load_builti...
Rust
0
import phonenumbers from phonenumbers import timezone, geocoder, carrier def get_phone_info(number): try: phone_number = phonenumbers.parse(number) if not phonenumbers.is_valid_number(phone_number): print("Invalid phone number.") return time_zone = timezone.time_zo...
Python
1
ll(), m_positionPtr: ptr::null(), m_openInternalEntities: ptr::null_mut(), m_freeInternalEntities: ptr::null_mut(), m_defaultExpandInternalEntities: false, m_tagLevel: 0, m_declEntity: ptr::null_mut(), m_doctypeName: ptr::null(), ...
Rust
0
() } fn char_count(&self) -> Chars { self.deref().char_count() } } #[derive(Debug, Clone)] struct TraverserWithOffset<F> { offset: Chars, callback: F, } impl<F> TraverserWithOffset<F> { pub fn new(callback: F) -> TraverserWithOffset<F> { let offset = 0.chars(); Tra...
Rust
0
tatue_cpu_meshes, statue_cpu_materials) = loaded.obj("examples/assets/COLOMBE.obj").unwrap(); let mut models = Vec::new(); let scale = Mat4::from_scale(10.0); for i in 0..8 { let angle = i as f32 * 2.0 * std::f32::consts::PI / 8.0; let rotation = Mat4::from_angle_y(radians(0.8 * std...
Rust
0
Commitment(c)) } pub fn from_ristretto(pt: RistrettoPoint) -> Self { Commitment(pt.compress()) } pub fn hash_points(a: Self, b: Self) -> Self { Self::new(&[&a.0.to_bytes()[..], &b.0.to_bytes()[..]].concat()[..]) } } impl Encode for ScalarData { fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R {...
Rust
0
if let Some(var_239) = &input.dry_run { scope_238.boolean(*var_239); } #[allow(unused_mut)] let mut scope_240 = writer.prefix("InternetGatewayId"); if let Some(var_241) = &input.internet_gateway_id { scope_240.string(var_241); } #[allow(unused_mut)] let mut scope_242 = writer...
Rust
0
api::bindgen_prelude::Result<napi::bindgen_prelude::sys::napi_value> { use std::ffi::CString; use std::ptr; let mut obj_ptr = ptr::null_mut(); napi::bindgen_prelude::check_status!( napi::bindgen_prelude::sys::napi_create_object(env, &mut obj_ptr), "Failed to create ...
Rust
0
f9af, &['\u{4561}']), (0xfa77, &['\u{52FA}']), (0x2209, &['\u{2208}', '\u{0338}']), (0xf76, &['\u{0FB2}', '\u{0F80}']), (0xf956, &['\u{7A1C}']), (0x1fcc, &['\u{0397}', '\u{0345}']), (0x1fa0, &['\u{03C9}', '\u{0313}', '\u{0345}']), (0x13c, &['\u{006C}', '\u{0327}']), (0x1eb3, &['\u{0061}'...
Rust
0
> // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software // and associated documentation files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or se...
Rust
0
# Generated by Django 3.2.16 on 2023-03-24 16:33 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("subnet_division", "0004_index_rule_on_delete"), ] operations = [ migrations.AlterField( model_name...
Python
1
import data_mnist import matplotlib.image import matplotlib.pyplot as plt import autograd.numpy as np import autograd.numpy.random as npr def load_mnist(): partial_flatten = lambda x: np.reshape(x, (x.shape[0], np.prod(x.shape[1:]))) one_hot = lambda x, k: np.array(x[:, None] == np.arange(k)[None, :], dtype=...
Python
1
import re from os import getenv from dotenv import load_dotenv from pyrogram import filters load_dotenv() # Get this value from my.telegram.org/apps API_ID = int(getenv("API_ID","")) API_HASH = getenv("API_HASH","") # Get your token from @BotFather on Telegram. BOT_TOKEN = getenv("BOT_TOKEN","6177975474:AAFgTXuMSGg6...
Python
1
import pandas as pd # Load the Excel file containing 28 worksheets excel_path = "/Users/dhairyasinghal/Desktop/Project/filenname.xlsx" # Update path if needed excel_file = pd.ExcelFile(excel_path) # Define the standard headers expected_headers = ['First Name', 'Last Name', 'Email', 'Phone', 'Title', 'Company'] # In...
Python
1
store test information during test execution. """ super(StepTestCase, self).tearDown() # Close any open project so that it doesn't persist to the next test closed = commander.execute('close', '') closed.thread.join() environ.configs.remove('results_directory', ...
Python
1
print(f" Line 1: {iss_tle['line1']}") # print(f" Line 2: {iss_tle['line2']}") # else: # print(f"\nTLE for {satno_to_find} not found.") # satno_to_find = 7530 # AO-07 # ao7_tle = get_tle_by_catalog_id(loaded_data, satno_to_find) # if ao7_tle: # ...
Python
1
bitrate! { (U32BitrateExt, u32, "u32"), (U64BitrateExt, u64, "u64"), (U128BitrateExt, u128, "u128"), (USizeBitrateExt, usize, "usize"), (I32BitrateExt, i32, "i32"), (I64BitrateExt, i64, "i64"), (I128BitrateExt, i128, "i128"), (ISizeBitrateExt, isize, "isize"), } //! 建玉一覧APIを実装する。 use cr...
Rust
0
let angle; match self.first { Some(start) => { angle = Self::get_angle(start, (x, y)); } None => return None, } if reset { self.first = None; self.id = None; } else { self.second = Some((x, y)); ...
Rust
0
nodes: Vec::new(), lights: Vec::new(), view_matrix: glm::look_at( &glm::vec3(0.0, 5.0, 5.0), &glm::vec3(0.0, 0.0, 0.0), &glm::vec3(0.0, 1.0, 0.0), ), // Use the _zo version to work with wgpu 0..1 depth coordinat...
Rust
0
ed<'a, I>> { debug_assert_ne!(types.len(), 0); suffixes.fill(I::from_index(0)); let mut buckets = Buckets::make_ends(text, buckets); let mut lms_count = 0; let mut last_lms = None; for suffix in 1..types.len() { let suffix = I::from_index(suffix); if is_lms(suffix, types) { ...
Rust
0
ponse, MerkleRootResponse, QueryMsg, ReleaseStateResponse, }; use crate::ContractError; use std::ops::Mul; const NATIVE_TOKEN: &str = "boot"; fn mock_env_time(time_delta: u64) -> Env { let mut env = mock_env(); env.block.time = env.block.time.plus_seconds(time_delta); ...
Rust
0
enches); use super::*; pub fn parse_sentence(s :&String, lang :&json::JsonValue)->Result<String, &'static str> { let ret; let spl = split(&s); let mut has_subject = true; if s.len() <= 1 { return Err("wrong clause"); } let subject_idx = first_phrase(&spl, true, false)?; let mut subject = v...
Rust
0
come constantsNrrrstr)r=es r1guard_as_python_constant(VariableTracker.guard_as_python_constantO5 "**, ," " #a& ! ! " :5:cFUR5 g![a gf=f)NTFrr)r=s r1is_python_const...
Python
1
a_2_1 + img_data_2_2) / 8 );"); println!("--Better case--"); println!("module.Assign( line0._e(img_data_0_0 + img_data_0_1 + img_data_0_2) );"); println!("module.Assign( line1._e(img_data_1_0 + img_data_1_1 + img_data_1_2) );"); println!("module.Assign( line2._e(img_data_2_0 + img_data_2_1 + img_data_2_2) )...
Rust
0
all_gen_kwargs[0]) for ctx in contexts], generate=True, gen_kwargs=copy.deepcopy(all_gen_kwargs[0]), ) ) ) res.extend(results) return re_ord.get_original(res) def loglikeliho...
Python
1
let v = self.0.borrow(cs); /// f(v) /// }) /// } /// } /// /// type MyBusManager<L, P> = shared_bus::BusManager<MyMutex<L>, P>; /// ``` pub trait BusMutex<T> { /// Create a new instance of this mutex type containing the value `v`. fn create(v: T) -> Self; /// Lock the mutex f...
Rust
0
# SPDX-License-Identifier: Apache-2.0 import pytest import torch from vllm.model_executor.layers.layernorm import RMSNorm from vllm.platforms import current_platform @pytest.mark.parametrize("num_tokens,hidden_size,add_residual,dtype", [ (7, 8, False, torch.half), (83, 768, False, torch.half), (83, 768,...
Python
1
stride=1, padding=self.padding, groups=x.size(1), bias=None) class UnsharpMask(nn.Module): def __init__(self, channels, kernel_size=11, padding=5, sigma=1.0, amount=1.0, threshold=0, norm_act=ABN): super(UnsharpMask, self).__init__() self.amount = amount self.thresh...
Python
1
() == 0 { rope = Rope::from_str(TEXT); } }) } fn removals_middle_large(bench: &mut Bencher) { let mut rope = Rope::from_str(TEXT); let tmp = rope.clone(); for _ in 0..(LEN_MUL - 1) { rope.append(tmp.clone()); } bench.iter(|| { let len = rope.len_chars(); ...
Rust
0
:Function, || { FunctionBuilder::new("getDetails") .abi_version(ton_abi::contract::ABI_VERSION_2_2) .time_header() .outputs(ConnectorDetails::param_type()) .build() }) } pub mod events { use super::*; pub fn enabled() -> &'static ton_abi::Event { ...
Rust
0
n std::error::Error>> { let p = Path::new(args.pgnfile.as_str()); let mut reader = Reader::new(p)?; let mut store = PostgresStore::open(args.postgres_uri.as_str())?; let mut count: usize = 0; loop { match reader.read_next() { ReadOutcome::Game(pgn) => { count +=...
Rust
0
domingo de la pasada semana"); example!(v, check_moment!(c, [2013, 10, 3]), "el tercer día de octubre"); // TODO: support "la primera semana del mes de octubre del dos mil catorce" example!(v, check_moment!(c, [2014, 10, 6], Grain::Week), "primera semana de octubre de dos mil catorce", "la primera semana d...
Rust
0