text
string
label_name
string
labels
int64
hape[0]): for j in range(policy.shape[1]): if policy[i, j]: if policy[i, j] == 'up': ax.arrow(j, i, 0, -0.3, head_width=0.1, head_length=0.2, fc='k', ec='k') elif policy[i, j] == 'down': ax.arrow(j, i, 0, 0.3, head_width=0.1, head_length=0.2, fc='k', e...
Python
1
] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> BUSFAULTENAR { match value { false => BUSFAULTENAR::_0, true => BUSFAULTENAR::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline] pub fn is_0(&self) -> bool { *self == BU...
Rust
0
art, end, values each defining time interval where value is to be used Returns: array of values on the time grid """ assert ('start' in inp) if isinstance(inp['start'],pd.DatetimeIndex): inp['start'] = inp['start'...
Python
1
import subprocess import pandas as pd import json def get_wifi_profiles(): # command : netsh wlan show profiles try: command = "netsh wlan show profiles" result = subprocess.run( # ["netsh", "wlan", "show", "profiles"], command, capture_output=True, ...
Python
1
ding(numpify=False) def test_padding_from_array(self): self._check_padding(numpify=True) @require_torch def test_padding_accepts_tensors_pt(self): feat_extract = self.feature_extraction_class(**self.feat_extract_dict) speech_inputs = self.feat_extract_tester.prepare_inputs_for_comm...
Python
1
import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation from matplotlib.animation import PillowWriter import pandas as pd from matplotlib import cm def main(): # Load n-body simulation data from a CSV file output = pd.read_csv("./output.csv") output_groupped = out...
Python
1
"""ANTLR3 runtime package""" # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code ...
Python
1
vec![Output::default(DataType::Metric)] } fn source_type(&self) -> &'static str { "nginx_stub" } } #[derive(Debug, Snafu)] enum NginxBuildError { #[snafu(display("Failed to parse endpoint: {}", source))] HostInvalidUri { source: http::uri::InvalidUri }, } #[derive(Debug, Snafu)] enum Ngin...
Rust
0
LONG, }} STRUCT!{struct D3DMATRIX { m: [[::c_float; 4]; 4], }} STRUCT!{struct D3DVIEWPORT9 { X: ::DWORD, Y: ::DWORD, Width: ::DWORD, Height: ::DWORD, MinZ: ::c_float, MaxZ: ::c_float, }} pub const D3DMAXUSERCLIPPLANES: ::DWORD = 32; pub const D3DCLIPPLANE0: ::DWORD = (1 << 0); pub const D3DC...
Rust
0
model_lower = model.lower() print( f"DEBUG: Checking max_tokens for model: {model} (lowercase: {model_lower})" ) # High context models - set reasonable output limits, not full context window if "flash-lite" in model_lower or "gemini-2.5-flash-lite" in model_lower: ...
Python
1
he passed fileobj will be advanced to that offset as well. """ size = 4 header = fileobj.read(4) if header != b"fLaC": size = None if header[:3] == b"ID3": size = 14 + BitPaddedInt(fileobj.read(6)[2:]) fileobj.seek(size - 4...
Python
1
_batch::RecordBatch; use stable_eyre::eyre::WrapErr; #[derive(Clone, Debug, Default, PartialEq)] pub struct DailyData<'a> { // irrigation related pub irrigation: &'a [f32], // weather related pub temp_max: &'a [f32], // tmax pub temp_min: &'a [f32], // tmin ...
Rust
0
#!/usr/bin/env python3 # Lab: Stored XSS into HTML context with nothing encoded # Lab-Link: https://portswigger.net/web-security/cross-site-scripting/stored/lab-html-context-nothing-encoded # Difficulty: APPRENTICE from bs4 import BeautifulSoup import requests import sys import urllib3 urllib3.disable_warnings(urllib3....
Python
1
4444" class CT(m.C_Tpl): pass obj = CT() assert obj.say_something(3) == "B says hi 3 times" assert obj.unlucky_number() == 4444 assert obj.lucky_number() == 888.0 assert obj.say_everything() == "B says hi 1 times 4444" class CCR(CR): def lucky_number(self): re...
Python
1
id = 99; //! let data = fourleaf::to_vec(val).unwrap(); //! //! // Finally, another v2 program reads that in. The non-v1 things are still //! // preserved. //! let val = fourleaf::from_slice_copy::<v2::Message>(&data, &config) //! .unwrap(); //! assert_eq!(99, val.id); //! assert!(val.frobnicate); //! match val.ope...
Rust
0
import win32debug, sys, os class A(object): def __init__(self, a): self.a = a def f_cellvar(self, param1, param2): local1 = 5 # c is cell variable because it is used in f_cellfreevar cell1 = {1: 2, 3: 4} def f_cellfreevar(param): # cell1 is free variable b...
Python
1
import re from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from locations.categories import Categories, apply_category from locations.structured_data_spider import StructuredDataSpider class GolubCorporationUSSpider(CrawlSpider, StructuredDataSpider): name = "golub_co...
Python
1
let time = time.unwrap_or_else(|| { time::OffsetDateTime::try_now_local() .unwrap_or_else(|_| time::OffsetDateTime::now_utc()) .time() }); let now = time::OffsetDateTime::try_now_local().unwrap_or_else(|_| time::OffsetDateTime::now_utc()); let mut desired = now.date().with...
Rust
0
for FieldDescriptorProto { fn from(desc: &FieldDescriptor) -> FieldDescriptorProto { let type_name = match &desc.field_type { FieldType::Message(name) | FieldType::Enum(name) => Some(name.to_string()), _ => None, }; FieldDescriptorProto { name: Some(desc....
Rust
0
""" Interface customization ======================= Use custom color, font size... .. image:: ../../_static/examples/ex_custom_interface.png """ from visbrain.gui import Signal from visbrain.utils import generate_eeg sf = 512. # sampling frequency n_pts = 4000 # number of time points n_trials = 125 # number of tr...
Python
1
impl_traits!([C] S11, A, B, C, D, E, F, G, H, I, J, K); impl_traits!([C] S12, A, B, C, D, E, F, G, H, I, J, K, L); impl<'a, Args, Rets, Inner> IsExport for Func<'a, Args, Rets, Inner> where Args: WasmTypeList, Rets: WasmTypeList, Inner: Kind, { fn to_export(&self) -> Export { let func = unsafe...
Rust
0
65e041ca3de".into(), subject: "Patient/9774f67f-a238-4daf-b4e6-679deeef3811".into(), authored_on: "2020-02-03T00:00:00+00:00".try_into().unwrap(), requester: "Practitioner/20597e0e-cb2a-45b3-95f0-dc3dbdb617c3".into(), insurance: "Coverage/1b1ffb6e-eb05-43d7-87eb-e7818fe96...
Rust
0
RYNVPROC', 'PFNGLXFREEMEMORYNVPROC', 'GLX_NV_swap_group', 'glXJoinSwapGroupNV', 'glXBindSwapBarrierNV', 'glXQuerySwapGroupNV', 'glXQueryMaxSwapGroupsNV', 'glXQueryFrameCountNV', 'glXResetFrameCountNV', 'PFNGLXJOINSWAPGROUPNVPROC', 'PFNGLXBINDSWAPBARRIERNVPROC', 'PFNGLXQUERYSWAPGROUPNVPROC', 'PFNGLXQUERYMAXSWAPGROUPSNVP...
Python
1
nown operation encountered" else: result["operation"] = operation # More confusing duplicate code blocks if "videos" in content_data: for vid in content_data["videos"]: if "title" not in vid: vid["title"] = "No Title" if "duration" not in vid: ...
Python
1
steps per epoch: {}'.format(steps_per_epoch)) curr_step = session.run(model.global_step) assert curr_step % steps_per_epoch == 0 # Get the current learning rate for the model based on the current epoch curr_lr = get_lr(curr_epoch, model.hparams, iteration=0) tf.logging.info('lr of {} for epoch {}'....
Python
1
return currency_symbol @classmethod def __get_pydantic_core_schema__(cls, _: type[Any], __: GetCoreSchemaHandler) -> core_schema.CoreSchema: """ Return a Pydantic CoreSchema with the currency subset of the [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) format. It excludes ...
Python
1
int, arg4: *mut ::libc::c_int, ) -> *mut ::libc::c_char; } extern "C" { pub fn strlcat( arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char, arg3: ::libc::c_uint, ) -> ::libc::c_uint; } extern "C" { pub fn strlcpy( arg1: *mut ::libc::c_char, arg2: *cons...
Rust
0
import __xmltv from epg.model import Channel, Program from datetime import datetime, date, timezone def update( channel: Channel, scraper_params: str, dt: date = datetime.today().date() ) -> bool: if scraper_params.find("@http") == -1: scraper_url = scraper_params else: scraper_id = scrape...
Python
1
import sqlite3 conn = sqlite3.connect('youtube_videos.db') cursor = conn.cursor() cursor.execute(''' CREATE TABLE IF NOT EXISTS videos ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, time TEXT NOT NULL ) ''') def list_videos(): cursor.execute("SELECT * FROM vid...
Python
1
print( XY::new(middle + sip_label.chars().count() + 1, 0), &sip_data, ); } fn layout(&mut self, size: Vec2) { self.current_size.replace(size); } fn required_size(&mut self, constraint: XY<usize>) -> XY<usize> { XY::new(constraint.x, 1) } } <gh_stars>...
Rust
0
the offset 3, or it was incorrect"); assert!(actual_as_string.contains(expected_sum_of_offset_4), "There was not a sum of the offset 4, or it was incorrect"); assert!(actual_as_string.contains(expected_sum_of_offset_5), "There was not a sum of the offset 5, or it was incorrect"); assert!(actual_as_string.c...
Rust
0
""" main.py The main entry point that initializes Pygame, sets up the simulation and UI, and enters the core game loop. """ import pygame import sys from config import SCREEN_WIDTH, SCREEN_HEIGHT, FPS from assets import load_background_image, load_car_images from events import handle_events from rendering import dra...
Python
1
4-10-06/ListOnPremisesInstances>`_ **Request Syntax** :: response_iterator = paginator.paginate( registrationStatus='Registered'|'Deregistered', tagFilters=[ { 'Key': 'string', 'Value': 'string',...
Python
1
from collections import Counter class FindSumPairs(object): def __init__(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] """ self.nums1 = nums1 self.nums2 = nums2 self.nums2_count = Counter(nums2) def add(self, index, val): ...
Python
1
nly way to do compaction. /// pub fn compact_into(&mut self, new_capacity: Option<usize>) -> Result<NP_Buffer<NP_Memory_Owned>, NP_Error> { let capacity = Some(match new_capacity { Some(x) => { x as usize }, None => self.memory.read_bytes().len() }); let old_ro...
Rust
0
, seen_ms_ago: Some(u32::from_le_bytes([100, 0, 0, 0])), status: Some(u32::from_le_bytes([1, 0, 0, 0])), signal: Some(i32::from_le_bytes([76, 235, 255, 255])), }; assert_eq!(bss, expected_bss) } } <reponame>isabella232/marshal-1 extern crate difference; extern cr...
Rust
0
p.scale(-1.0) Ustep = mcscf_obj.form_rotation_matrix(xstep) totalU = core.doublet(totalU, Ustep, False, False) # Build the rotation directly (not recommended) # orbs_mat = mcscf_obj.Ck(start_orbs, total_step) # Finally rotate and set orbitals orbs_mat = core.dou...
Python
1
#!/usr/bin/env python3 # # Cross Platform and Multi Architecture Advanced Binary Emulation Framework # import ctypes from qiling.hw.misc.cm_scb import CortexMScb class CortexM3Scb(CortexMScb): class Type(ctypes.Structure): _fields_ = [ ('CPUID' , ctypes.c_uint32), ('ICSR' ...
Python
1
GPL-3.0-or-later WITH Classpath-exception-2.0 // 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 d...
Rust
0
| error!("server error: {}", e)); info!("Starting Server..."); rt::run(server); } use std::ops::Range; use crate::AppState; use crate::data::{BashoInfo, BashoId}; use crate::data::leaders::HistoricLeader; use super::{BaseTemplate, IdentityExt, Result}; use actix_web::web; use actix_identity::Identity; use ask...
Rust
0
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 2008-2016 California Institute of Technology. # Copyright (c) 2016-2020 The Uncertainty Quantification Foundation. # License: 3-clause BSD. The full license text is available at: # - https://github.com/uqfoundation/di...
Python
1
import sys import unittest import jsonschema from genson import SchemaNode, SchemaBuilder PYTHON_VERSION = sys.version[:sys.version.find(' ')] class BaseTestCase(unittest.TestCase): def setUp(self): self.builder = self.CLASS() self._objects = [] self._schemas = [] def set_schema_opt...
Python
1
: x.format.into(), desc: Some((&x.desc).into()), level: x.level, size_bytes: x.size_bytes, } } } impl From<&Antichain<u64>> for ProtoU64Antichain { fn from(x: &Antichain<u64>) -> Self { ProtoU64Antichain { elements: x.elements().to_vec(), ...
Rust
0
#!/usr/bin/env python3 import sys from math import sin, cos, sqrt def flatten(l): return [item for sublist in l for item in sublist] # E-Ink display takes 16 colour values 0x0f, 0x1f, 0x2f, ... 0xff. def pixels_to_bytes(pixels): return bytes(map(lambda x: (x << 4) | 0xf, flatten(pixels))) hardcode = [ [...
Python
1
umpy_to_vtk(contig) id = vtkImageData() id.SetExtent(0, height-1, 0, width-1, 0, 0) id.GetPointData().SetScalars(vtkarray) self.threadedwriter.EncodeAndWrite(id, adjustedName) else: with open(adjustedName, mode='wb') as file: file.write...
Python
1
ar (admin only)""" test_year = { "tahun": "2024/2025", "semester": "Ganjil", "is_active": False # Don't make it active to avoid conflicts } success, response = self.run_test( "Create academic year", "POST", "tahun-...
Python
1
# -*- coding: utf-8 -*- # Thin wrapper so that /admin_prompt URL keeps working. from src.ui.admin_prompt import main as _render _render()
Python
1
max_strategies_per_symbol, filters, max_profit_per_market) #for date, portfolio in best_system_portfolio.items(): # st.write(f"{date}: {portfolio}") # I CREATE THE ACTUAL DATAFRAME WITH THE SYSTEMS RESULTED BY BEST SYSTEM...
Python
1
.agent.memory.buffer = self.agent.memory.buffer + Human_prompt + 'AI: ' + AI_prompt print("======>Current memory:\n %s" % self.agent.memory) state = state + [(f"![](/file={image_filename})*{image_filename}*", AI_prompt)] print("Outputs:", state) return state, state, txt + ' ' + image_fil...
Python
1
"""Model refresh service for automatically updating LLM model information.""" from .backup_manager import BackupManager from .database_updater import DatabaseUpdater from .model_comparator import ModelComparator from .refresh_manager import ModelRefreshManager __all__ = [ "ModelRefreshManager", "DatabaseUpdat...
Python
1
eys() if i.startswith('test_')] def widget_names(): return [i[len('test_'):] for i in test_names()] if args.print_tests: print('\n'.join(sorted(widget_names()))) return 0 # Disable garbage collection to avoid runtime errors. gc.disable() os.environ['QT_SCALE_FACTOR'] = str...
Python
1
::path::Path; const VERTEX_SRC: &str = r#" #version 450 core layout (location = 0) in vec2 v_pos; layout (location = 1) in vec2 v_uv; layout (location = 0) out vec2 a_uv; void main() { a_uv = v_uv; gl_Position = vec4(v_pos, 0.0, 1.0); } "#; const FRAGMENT_SRC: &str = r#" ...
Rust
0
from fastapi import APIRouter router = APIRouter() @router.get("/") def cover_letter(): return {"message": "Cover Letter API is working!"}
Python
1
import streamlit as st import pandas as pd from sklearn.tree import DecisionTreeRegressor import matplotlib.pyplot as plt # Load the RUED dataset data = pd.read_csv('datasetrued.csv') # Replace this with your actual dataset file path # Ensure the relevant columns are numeric data['Jumlah Penduduk'] = pd.to_numeric(d...
Python
1
"https://lf-bot-studio-plugin-resource.coze.cn/obj/bot-studio-platform-plugin-tos/artist/image/b02f0ace38e14ef892a99f62492019bd.mp3" ], "bgm": "https://lf6-lv-music-tos.faceu.com/obj/tos-cn-ve-2774/ocM2U8riP8GkR1w5RQQWIQBxrBMmIA6t7CinZ", "company_name": "常熟优帮财税", # 🔥 修复:使用正确的字段名 ...
Python
1
STACK_POOL.with(|pool| unsafe { if let Some(stack) = self.raw_impl.take().unwrap().take_stack() { (&mut *pool.get()).give_stack(stack); } }); } } pub struct Coroutine<F, T> where T: Send + 'static, F: FnMut(CoroutineRef<F, T>) { coro: Unsaf...
Rust
0
rmal_Agenesis_of_the_Septi_Pellucidi)', # 'class 3(Abnormal_Cerebellar_Hypoplasia)', # 'class 4(Abnormal_Dandy_Walker_VariantMalformation)', # 'class 5(Abnormal_Megacisterna_Magna)', # 'class 6(Abnormal_Venous_Malformation)'] # size(target_names) # print(c...
Python
1
.generic_args[len..] } } pub fn take(&self, len: usize) -> PathSegments<'a> { assert_eq!(self.segments.len(), self.generic_args.len()); PathSegments { segments: &self.segments[..len], generic_args: &self.generic_args[..len] } } pub fn iter(&self) -> impl Iterator<Item = PathSegment<'a>> ...
Rust
0
f let Some(&(rule, part)) = path.last() { match (matcher.rules[rule].as_ref(), part) { (None, _) => { unreachable!("resolve None?"); } (Some(Node::Char(_)), _) => { return true; } (Some(Node::Alt(_, _)), _) => { return true...
Rust
0
return None; } if trimmed_selected_range != trimmed_file_range { cov_mark::hit!(not_all_selected); return None; } let target = TextRange::new( source_file.syntax().text_range().start(), source_file.syntax().text_range().end(), ); let module_name = module.nam...
Rust
0
alue of the field is `V37`"] #[inline(always)] pub fn is_v37(&self) -> bool { **self == THRESHOLDVDDH_A::V37 } #[doc = "Checks if the value of the field is `V38`"] #[inline(always)] pub fn is_v38(&self) -> bool { **self == THRESHOLDVDDH_A::V38 } #[doc = "Checks if the val...
Rust
0
ath(&current_iter).unwrap()); vec_tree_path_to_delete.push(model.path(&next_iter).unwrap()); current_iter = next_next_iter.clone(); continue 'main; } loop { // (H1 -> C1 -> C2 -> Cn -> END) -> (NO CHANGE, BECAUSE IS GOOD) ...
Rust
0
frappe.bold(label), frappe.bold(user), frappe.bold(doc.apply_user_permission_on), ) ) return False def apply_permissions_for_non_standard_user_type(doc, method=None): """Create user permission for the non standard user type""" if not frappe.db.table_exists("User Type") or frappe.flags.in_migrate...
Python
1
'static>(source1: &Rc<MutCell<Vec<T1>>>, source2: &Rc<MutCell<Vec<T2>>>, source3: &Rc<MutCell<Vec<T3>>>) -> Rc<MutCell<Vec<(T1, T2, T3)>>> { Array::map3(&Rc::from(move |x: &T1, y: &T2, z: &T3| (x.clone(), y...
Rust
0
tree = model::Cache::new(network.genesis()); let cfilters = model::FilterCache::new(FilterHeader::genesis(network)); let peers = HashMap::new(); let time = LocalTime::now(); let clock = AdjustedTime::new(time); let rng = fastrand::Rng::new(); let c...
Rust
0
32 as u64 { (*app_data).thumbnail = new((thumb_data_len as u32 as u64) .wrapping_mul(::std::mem::size_of::<u8>() as u64) as u32) as *mut u8; ttstub_input_read(handle.0.as_ptr(), (*app_data).thumbnail as *mut i8, thumb_data_len); } else { (*app_data).thumbnail = 0 as *...
Rust
0
"""Snyk source.""" from pydantic import HttpUrl from shared_data_model.meta.entity import Color, Entity, EntityAttribute, EntityAttributeType from shared_data_model.meta.source import Source from shared_data_model.parameters import Severities, access_parameters SNYK = Source( name="Snyk", description="Snyk v...
Python
1
tecedent moisture condition """ theta = (sw_frac - Smin) / (Smax - Smin) lower = theta <= 0.25 upper = theta >= 0.75 inner = ~(lower | upper) cn100 = cn / 100 return np.where(cn == 100, cn, 100 * ( (cn100 * inner) + ...
Python
1
', '9.1.0.4', 'up') time.sleep(2) route1 = vnet_obj.check_priority_vnet_ecmp_routes(dvs, vnet_name, ['9.1.0.1','9.1.0.2'], tunnel_name, route_ids=route1) check_state_db_routes(dvs, vnet_name, "100.100.1.1/32", ['9.1.0.1','9.1.0.2']) # The default Vnet setting does not advertise prefix ...
Python
1
await itx.response.defer() await cmd_rewind(SlashMessage(itx), time or "") except Exception as e: await itx.followup.send(f"エラー発生: {e}") @tree.command(name="forward", description="再生位置を早送り") @app_commands.describe(time="例: 10s, 1m, 1:00 (省略可)") async def sc_forward(itx: discord.Interaction, time: ...
Python
1
lse, # Whether the model returns attentions weights. output_hidden_states = False, # Whether the model returns all hidden-states. ) model.to(device) model.eval() checkpt = torch.load(PATH + '/models/model.ckpt') model.load_state_dict(checkpt['model_state_dict']) # Load previously saved csv into a dataframe. filena...
Python
1
import numpy as np from calib_utils.linalg_utils import get_transform, transform_data, plot_pointclouds class Solver: def __init__(self): pass def solve_transforms(self, robot_pts, cam_pts, visualize=False): if visualize: plot_pointclouds( [robot_pts, cam_pts] ...
Python
1
lf._get_random_response("unknown") buttons = ["Menu principal", "Falar com atendente"] return ChatbotResponse(text=text, buttons=buttons, button_text="Precisa de ajuda?") def process_message(self, user_id: str, message: str) -> ChatbotResponse: """ Processa uma mensagem ...
Python
1
""" Write a python function to count the number of lists in a given number of lists. assert count_list([[1, 3], [5, 7], [9, 11], [13, 15, 17]]) == 4 """ def count_list(lists): count = 0 for i in lists: if type(i) == list: count += 1 return count assert count_list([[1, 3], [5, 7], [9, 1...
Python
1
*m; tmp += i; if tmp < 0.0000005 {tmp = 0.0} tmp = f32::min(tmp, self.max); *m = tmp; *o = tmp; } } } pub struct AGC { memory: VecDeque<f32>, target: f32, linear_equalizer: f32 } impl AGC { pub fn new(cap: usiz...
Rust
0
} } #[doc = "Reader of field `SENSITIVE_DMA_APBPERI_MAC_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_3`"] pub type SENSITIVE_DMA_APBPERI_MAC_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_3_R = crate::R<u8, u8>; #[doc = "Write proxy for field `SENSITIVE_DMA_APBPERI_MAC_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_3`"] pub struct SENSITIVE_DMA_APBPERI_MAC_PMS...
Rust
0
ted_x = (ix as f32 / segments as f32 - 0.5) * 2.0; // Clamp radius at 1.0 or lower so the bowl has a flat lip near the corners. let clamped_radius = (shifted_z.powi(2) + shifted_x.powi(2)).sqrt().min(1.0); let x = shifted_x * bowl_size.x / 2.0; let z = shifted_z * bowl_si...
Rust
0
able(Index::Aux(2))) => {}, // _ => panic!("one variable is incorrect") // } match (tmp.dummy_variable(), zero) { (Variable(Index::Aux(1)), Variable(Index::Aux(1))) => {}, _ => panic!("zero variable is incorrect") } tmp } fn new_empty_gate(&...
Rust
0
import requests import psutil # Для получения нагрузки import time from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad import base64 import hashlib import json from datetime import datetime SERVER_ID = 1 # Уникальный ID каждого сервера CENTRAL_SERVER_URL = "http://127.0.0.1:5000/api/update_load"...
Python
1
Point { array: [-65, 57] }, Point { array: [-9, 66] }, Point { array: [52, 40] }, Point { array: [13, -70] }, Point { array: [93, -1] }, Point { array: [47, 38] }, Point { array: [-85, -119] }, Point { array: [-91, 52] }, Point { array: [-107, 69] }, Point { arra...
Rust
0
erface-name-3.rs"); t.compile_fail("tests/contract/common/ui/fail/37-invalid-item-in-interface.rs"); t.compile_fail("tests/contract/common/ui/fail/38-invalid-item-in-extern.rs"); t.compile_fail("tests/contract/common/ui/fail/39-too-many-extern-in-interface.rs"); t.compile_fail("tests/contract/common/ui/...
Rust
0
class Solution: def findMin(self, nums: List[int]) -> int: low = 0 high = len(nums) -1 ans = nums[0] while low <= high: mid = (low + high) // 2 if ans > nums[mid]: ans = nums[mid] if nums[mid] > nums[high]: low = mi...
Python
1
from flet.utils.platform_utils import is_mobile def open_in_browser(url): if not is_mobile(): import webbrowser webbrowser.open(url)
Python
1
PTForSemanticSegmentation(config) if "ade" in checkpoint_url else DPTForDepthEstimation(config) model.load_state_dict(state_dict) model.eval() # Check outputs on an image size = 480 if "ade" in checkpoint_url else 384 image_processor = DPTImageProcessor(size=size) image = prepare_img() enc...
Python
1
// You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // Se...
Rust
0
") # Create a frame to hold the buttons button_frame = tk.Frame(root) button_frame.pack(pady=10) # Create buttons for each option buttons = [] for i in range(len(options)): button = tk.Button( button_frame, text=options[i], width=15, heig...
Python
1
ponsável {resp}: {', '.join(dados['ssas'])}") for resp, dados in diagnostico["por_responsavel_prog"].items(): if dados["total"] != len(dados["ssas"]): issues.append( f"Inconsistência na contagem de SSAs para responsável programação {resp}: " ...
Python
1
delete_property!(id: 15))?; assert!(!info.to_string().contains("UEhist")); info.apply(&delete_property!(id: 16))?; assert!(!info.to_string().contains("DEhist")); info.apply(&delete_property!(id: 17))?; assert!(!info.to_string().contains("bool")); info.apply(&delete_node!(...
Rust
0
def get_valid_rounds(): while True: try: rounds = int(input("Hány kört szeretnétek játszani? ")) if rounds <= 0: print("Hiba: A körök számának pozitívnak kell lennie.") elif rounds % 2 == 0: print( "Hiba: Páratlan számú ...
Python
1
FLATE_INDEX].as_raw_fd(); let virtq_deflate_ev_fd = self.queue_evts[DEFLATE_INDEX].as_raw_fd(); let virtq_stats_ev_fd = self.queue_evts[STATS_INDEX].as_raw_fd(); let stats_timer_fd = self.stats_timer.as_raw_fd(); let activate_fd = self.activate_evt.as_raw_fd(); ...
Rust
0
[doc = " Memory allocation node parameters"] #[repr(C)] #[derive(Copy, Clone)] pub struct cudaMemAllocNodeParams { #[doc = "< in: array of memory access descriptors. Used to describe peer GPU access"] pub poolProps: cudaMemPoolProps, #[doc = "< in: number of memory access descriptors. Must not exceed the n...
Rust
0
import spacy from spacy.matcher import PhraseMatcher from spacy.tokens import Span import json with open("exercises/en/countries.json", encoding="utf8") as f: COUNTRIES = json.loads(f.read()) with open("exercises/en/country_text.txt", encoding="utf8") as f: TEXT = f.read() nlp = spacy.load("en_core_web_sm") m...
Python
1
import sys import pytest from . import util from numpy.testing import IS_PYPY @pytest.mark.slow class TestBlockDocString(util.F2PyTest): sources = [util.getpath("tests", "src", "block_docstring", "foo.f")] @pytest.mark.skipif(sys.platform == "win32", reason="Fails with MinGW64 Gfortr...
Python
1
json>لا<end_json> Input: هل المبتدأ في جملة (الطالبان مجدان ونشيطان) هو (مثنى مذكر) Output: <start_json>نعم<end_json> Input: هل المبتدأ في جملة (العاملون متفانون في العمل) هو (جمع مذكر) Output: <start_json>نعم<end_json> Input: هل المبتدأ في جملة (الصديقات مستمتعات في الرحلة) هو (جمع مؤنث) Output: <start_json>نعم<end...
Python
1
Right => Some(b"\x1b[C"), KeyCode::Home => Some(b"\x1b[H"), KeyCode::End => Some(b"\x1b[F"), KeyCode::Up => Some(b"\x1b[A"), KeyCode::Down => Some(b"\x1b[B"), KeyCode::Tab => Some(b"\x09"), KeyCode::Delete => Some(b"\x1b[3~"), KeyCode::Insert => Some(b"\x1b[2~"), ...
Rust
0
import os import time import subprocess from pathlib import Path WATCHED_EXTENSIONS = ['.htm', '.html', '.js', '.css', '.tis', '.sciter'] WATCH_FOLDER = Path('src/ui') SCRIPT_TO_RUN = Path('res/inline-sciter.py') def get_file_mtimes(folder): mtimes = {} for path in folder.rglob("*"): if path.suffix.lo...
Python
1
]["ns"]["capacity"] = lv if large_demand: G.nodes["s0"]["demand"] = -lv G.nodes["c1"]["demand"] = lv if large_weight: G["s1"]["ns"]["weight"] = lv # Execute without raising fc, fd = nx.network_simplex(G) def test_network_simplex_unbounded_flow(): G = nx.DiGraph() # Add...
Python
1
dicionario_01 = { 'nome': 'Jardel', 'sobrenome': 'Knirsch', 'cidade': 'Santa Maria', } dicionario_02 = { 'idade': 26, 'cidade': 'Restinga Seca' } dicionario_01.update(dicionario_02) print(dicionario_01)
Python
1
processing.run( "gdal:warpreproject", { 'INPUT': layer_path, 'SOURCE_CRS': appResources.qgis.core.QgsCoordinateReferenceSystem('EPSG:31256'), 'TARGET_CRS': appResources.qgis.core.QgsCoordinateReferenceSystem('EPSG:4326'), ...
Python
1
# Copyright 2016 The TensorFlow Authors. 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 # # Unless required by appl...
Python
1