text
string
label_name
string
labels
int64
from collections import OrderedDict from typing import Dict, override import torch from mlora.config import LoRAConfig from mlora.model.args import LinearInfo from mlora.model.modules import LoRA from .context import TaskContext from .inference import InferenceTaskContext from .train import TrainTaskContext def _i...
Python
1
s there are no other references to that memory and that the memory lives until the /// transaction is complete and that completion has been returned from the `wait` function. In /// addition there must not be any mutable references to the data pointed to by `iovecs` until /// the operation completes. Ensu...
Rust
0
) as *mut Chunk<K, V, A, ALLOC>; debug_assert_ne!(cloned_old_ptr as usize, 0); debug_assert_ne!(old_chunk.ptr as usize, 0); libc::memcpy( cloned_old_ptr as *mut c_void, old_chunk.ptr as *const c_void, old_total_size, ); ...
Rust
0
FacetType::Enumeration => ENUMERATION, FacetType::Length => LENGTH, FacetType::MaxExclusive => MAX_EXCLUSIVE, FacetType::MaxInclusive => MAX_INCLUSIVE, FacetType::MaxLength => MAX_LENGTH, FacetType::MinExclusive => MIN_EXCLUSIVE, Facet...
Rust
0
".to_owned()); assert_eq!(custom_config.info, Some("custom_info".to_owned())); std::fs::remove_dir_all(path).unwrap(); }); } } //! Timed future use core::future::Future; use core::{fmt, task, time, mem}; use core::pin::Pin; use crate::oneshot::Oneshot; use crate::oneshot::Timer as ...
Rust
0
import unittest from spade_llm.core.api import AgentId from spade_llm.core.api import Message from spade_llm.core.messaging import DictionaryMessageService class TestDictionaryMessageService(unittest.IsolatedAsyncioTestCase): async def test_get_or_create_source(self): dms = DictionaryMessageService() ...
Python
1
[points[0], points[1], points[2]], weight, } } fn compute_quad_pow2(&self, tolerance: f32) -> Option<u8> { if tolerance < 0.0 || !tolerance.is_finite() { return None; } if !self.points[0].is_finite() || !self.points[1].is_finite() || ...
Rust
0
, base_model=args.pretrained_model_name_or_path, train_text_encoder=args.train_text_encoder, instance_prompt=args.instance_prompt, validation_prompt=args.validation_prompt, repo_folder=args.output_dir, ) upload_folde...
Python
1
from random import choice, random, randrange import numpy as np # If the code is not Cython-compiled, we need to add some imports. from cython import compiled if not compiled: from mazelib.generate.MazeGenAlgo import MazeGenAlgo class GrowingTree(MazeGenAlgo): """ The Growing-Tree maze-generating algori...
Python
1
erialize)] /// Serde-friendly `Diff` shadow. pub enum Diff<T> where T: Serialize { #[serde(rename = "=")] Same, #[serde(rename = "+")] Born(T), #[serde(rename = "-")] Died(T), #[serde(rename = "*")] Changed(ChangedType<T>), } impl<T, U> From<account_diff::Diff<T>> for Diff<U> where T: Eq, U: Serialize + From<T...
Rust
0
# Copyright 2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Owner key/value data placed on a machine while it is owned.""" import re from django.db.models import ( CASCADE, CharField, ForeignKey, Manager, Model, ...
Python
1
lsp_types::Position>>, } impl Request for ConvertOffsets { type Params = ConvertOffsetsParams; type Result = Option<ConvertOffsetsResult>; const METHOD: &'static str = "rhai/convertOffsets"; } } use stm32f4xx_hal as hal; use hal::pac::{I2S2EXT, SPI2}; pub fn setup_i2s2(spi2: &mu...
Rust
0
) + SelectFields(fields=[ "target", "target_img", "y", "x", "pad_left", "context_len", "pred_len", "periodicity", ...
Python
1
r]: # Fetch and check the key api_key = os.getenv("OPENAI_KEY") if api_key is None: m = ( "Could not find the API key to access the openai API. Ensure you have an API key " "set up via https://beta.openai.com/account/api-keys, then make it available as " "an envir...
Python
1
to use " r"`rlf\.ElectricalNetwork` instead of `rlfs\.ElectricalNetwork`\?" ), ): rlfs.ElectricalNetwork.from_dict(data={"version": 2, "is_multiphase": True}) with pytest.raises(AssertionError, match=r"Unsupported network file version 2, expected >=3"): rlfs.ElectricalNetwo...
Python
1
llocator. /// /// Marks the chunk to be freed to detect double-frees later on /// and places sanitization hooks over the freed region to detect /// use-after-frees. pub fn uc_free(uc: &mut super::Unicorn<RefCell<Heap>>, ptr: u64) -> Result<(), uc_error> { #[cfg(debug_assertions)] println!("[-] Freeing {:#010x}"...
Rust
0
['hash'] for hash in hashes: if hash['nome'] == nome and hash['hash'] != hash_salvo: arquivos_modificados.append({'nome': nome, 'hash': hash['hash']}) break conn.close() return arquivos_modificados def atualizar_tabela_de_hash_dos_arquivos(arquivos_modificad...
Python
1
rence_id] = self.env.docname, target_id domain.labels[reference_id] = ( self.env.docname, target_id, f"Change: {clean_astext(title[0])}", ) if change_node.attributes["breaking"]: breaking_notice = nodes.inline("breaking...
Python
1
webpage = self._download_webpage(url, video_id) data_url = self._html_search_regex( r'content_api:\s*(["\'])(?P<url>https?://(?:(?!\1).)+)\1', webpage, 'content api url', group='url') media_config = traverse_obj( self._download_json(data_url, video_id), ('config', {b...
Python
1
: Option<T>, /// Value found. pub found: T, } #[derive(PartialEq, Eq, Clone, Copy, Debug, Encode, Decode)] /// Error indicating an expected value was not found. pub struct Mismatch<T> { /// Value expected. pub expected: T, /// Value found. pub found: T, } #[derive(PartialEq, Eq, Clone, Copy, Debug)] pub enum Bl...
Rust
0
to this * software under copyright law. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES...
Rust
0
import random import string lower = string.ascii_lowercase upper = string.ascii_uppercase symbols = "!@#~$%^&*()_+}{|"":><?}" numbers = "0123456789" all = lower + upper + symbols + numbers while True: print("Choose options:\n1)Creat a password\n2)Exit") choice = input("Your option :") if choice == "1": ...
Python
1
def solution(order): sub = [] cur = 1 cnt = 0 for o in order: while cur <= len(order) and (not sub or sub[-1] != o): sub.append(cur) cur += 1 if sub and sub[-1] == o: sub.pop() cnt += 1 else: break return cnt
Python
1
= LineStyle::None } border_right_style { "border-right-style", LineStyle, initial = LineStyle::None } border_top_width { "border-top-width", LineWidth, initial = LineWidth::MEDIUM } border_left_width { "border-left-width", LineWidth, initial = LineWidth::MEDIUM } border_bottom_width { "...
Rust
0
from odoo import models class PosPaymentMethod(models.Model): _inherit = "pos.payment.method" # will be overridden. def _payment_request_from_kiosk(self, order): pass
Python
1
write(dockerfile_string) with open(os.path.dirname(os.path.realpath(__file__)) + "/../configfinder/.dockerignore", "w") as dockerfp: dockerfp.write("env") di = DockerImage(dockerfile_path=os.path.dirname(os.path.realpath(__file__)) + "/../configfinder/dockerfile", im...
Python
1
_background; pub mod document_statistics; pub mod gltf_node_tree; pub mod tree; <filename>src/librustc/middle/typeck/infer/lattice.rs // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under th...
Rust
0
to a graph is a different story...but it's //! possible :) //! //! ## Installing //! //! `cargo-graph` can be installed with `cargo install` //! //! ```ignore //! $ cargo install cargo-graph //! ``` //! //! This may require a nightly version of `cargo` if you get an error about the //! `install` command not being foun...
Rust
0
#======================================================================= # RegIncr_test.py #======================================================================= import random import pytest from pymtl import * from RegIncrSC import RegIncrSC simple_test_vectors = [ ( 4, 5), ( 6, 7), ( 2, 3), (15, 1...
Python
1
.arg().into_cmd()) } pub fn index<T>(self, arg: T) -> cmd::index::Index where T: cmd::index::Arg, { cmd::index::Index(arg.arg().into_cmd()) } pub fn args<T>(self, arg: T) -> cmd::args::Args<T> { cmd::args::Args(arg) } } // Helper for making writing examples less ve...
Rust
0
exec_request_3) .expect_success() .commit(); // Ensure that initial bid entries exist for validator 1 and validator 2 let initial_bids: Bids = builder.get_value(auction, BIDS_KEY); assert_eq!( initial_bids.keys().copied().collect::<BTreeSet<_>>(), BTreeSet::from_iter(vec![*V...
Rust
0
"""Functions for modifying Divisions.ndf""" from src.constants.generated.gameplay.decks import divs_not_released from src.utils.logging_utils import setup_logger from src import ModConfig logger = setup_logger(__name__) def edit_gen_gp_decks_divisions(source_path) -> None: """GameData/Generated/Gameplay/Decks/D...
Python
1
import json def getUser(key,users_json): secrets = users_json return secrets[key]
Python
1
# -*- coding: utf-8 -*- # Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
1
#Question: Find number of leaves,half nodes and full nodes in a binary tree import sys sys.path.append("./mylib") import Tree fn = 0 hn = 0 leaf = 0 #Modified inorder recursive traversal using global variables def inorderRecursive(root): global fn,hn,leaf if root is None: return if(root.getLeft(...
Python
1
plemented!("Dummy executor can't actually spawn!") } <filename>src/sys/pkg/bin/omaha-client/src/configuration.rs // Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use crate::{ app_set::{EagerPackage, F...
Rust
0
} // Execute the lottery let lottery_msg = ExecuteMsg::ExecuteLottery {}; let info = mock_info("addr0001", &[]); let res = execute(deps.as_mut(), env.clone(), info.clone(), lottery_msg).unwrap(); // Check how much aust was redeemed let sent_amount = if ...
Rust
0
group(test_vec.base_group_state); // Keep deriving new secrets with respect to the given update secret. Check all the // resulting keys against the test vector. for epoch in case1.epochs.into_iter() { let update_secret = UpdateSecret(epoch.update_secret); let (app_secret...
Rust
0
lator.AddTransform(18.2,t3) interpolator.AddTransform(24.4,t4) #puts [interpolator GetNumberOfTransforms] # Create the RenderWindow, Renderer and both Actors # ren1 = vtkRenderer() renWin = vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Add the actors to the...
Python
1
= -5 + ((index2 as i32) -1); } } inc_vec(scores, Some(num), Some(group_start + 1), last_group_limit); let mut cddr_group: Vec<i32> = group.clone(); cddr_group.remove(0); cddr_group.remove(0); let mut word_index: i32 = (words_length - 1) as i32; let ...
Rust
0
ids[0]; let context_properties = ContextProperties::new().platform(platform_id); let context = core::create_context(Some(&context_properties), &[device_id], None, None)?; let src_cstring = CString::new(src)?; let program = core::create_program_with_source(&context, &[src_cstring])?; core::bu...
Rust
0
""" Classifies: CHEBI:47622 acetate ester """ """ Classifies: CHEBI:33282 acetate ester """ from rdkit import Chem from rdkit.Chem import AllChem def is_acetate_ester(smiles: str): """ Determines if a molecule is an acetate ester based on its SMILES string. An acetate ester contains the acetate group (-OC(...
Python
1
from session_manager import SessionManager from model_router import call_groq_model, MODEL_OPTIONS def print_model_menu() -> None: print("\nChoose a model:") for k, (name, desc) in MODEL_OPTIONS.items(): print(f" [{k.upper()}] {name} – {desc}") print("Welcome to ModelMemz (Groq-powered chat with memo...
Python
1
e::span; use rune_tests::*; #[test] fn test_bad_attributes() { assert_compile_error! { r#"pub fn main() { #[foo] #[bar] let x = 1; }"#, span, Custom { message } => { assert_eq!(message, "attributes are not supported"); assert_eq!(span, span!(16, 29)); } }; } <gh_...
Rust
0
s None: pct_missings = np.arange(0., 1 + 1e-8, 0.1) Y_pu = {} np.random.seed(random_state) n_samples = len(Y) for pct in pct_missings: y = np.argmax(Y, 1) flip = np.random.rand(n_samples) y[(y != 0) & (flip < pct)] = 0 Y_pu[pct] = np.eye(Y.shape[1])[y] if ...
Python
1
# Copyright (c) 2017, the ElectrumX authors # # All rights reserved. # # The MIT License (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 limit...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.construct import init from .application_app_contacts_range import ApplicationAppContactsRange class ContactsRangeConfigurationApplicationResponseBody(object): _types = { "con...
Python
1
.drop_index("idx_shtetl_stores_kosher_agency", "shtetl_stores") op.drop_index("idx_shtetl_stores_status", "shtetl_stores") op.drop_index("idx_shtetl_stores_is_approved", "shtetl_stores") op.drop_index("idx_shtetl_stores_is_active", "shtetl_stores") op.drop_index("idx_shtetl_stores_plan_type", "shtetl_st...
Python
1
gid={:?}", getuid(), getgid()); } } <reponame>akappel/coffee use coffee::graphics::{ Color, Frame, Mesh, Rectangle, Shape, Window, WindowSettings, }; use coffee::load::Task; use coffee::{Game, Timer}; fn main() -> coffee::Result<()> { Example::run(WindowSettings { title: String::from("Rectangle - ...
Rust
0
), ])); table.add_row(Row::new(vec![ TableCell::new_with_alignment("Version", 1, Alignment::Left), TableCell::new_with_alignment( c.values.get("version").unwrap_or(&"".to_string()), 1, Alignment::Left, ), ...
Rust
0
x28 - OpCode { name: "PLP", func: plp, address_mode: AddressMode::Implied, }, // 0x29 - OpCode { name: "AND", func: and, address_mode: AddressMode::Immediate, }, // 0x2A - OpCode { name: "ROL", func: rol_a, address_mode:...
Rust
0
nast, pos::Pos, relative_path::RelativePath, s_set::SSet, shallow_decl_defs::{self, ShallowClassConst, ShallowMethod, ShallowProp, ShallowTypeconst}, shape_map::ShapeField, typing_defs, typing_defs::{ EnumType, FunArity, FunElt, FunParam, FunParams, FunType, ParamMode, ParamMutab...
Rust
0
[inline] pub fn is<T: Any>(&self) -> bool { <dyn Reporter>::is::<T>(&*self.reporter) } } impl fmt::Debug for Report { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.pad("Report(...)") } } /// Sets this report as the global default for the duration of the entire program. /...
Rust
0
3935\n"); new_ucmd!() .args(&[ "92233720368547758076549841651981984981498415651", "-", "922337203685", ]) .succeeds() .stdout_only("92233720368547758076549841651981984059161211966\n"); new_ucmd!() .args(&["9", "/", "0"]) .fail...
Rust
0
: &Pubkey, additional_seed: &Option<AddressSeed>, network: &Pubkey, ) -> (Pubkey, u8) { Pubkey::find_program_address( &[ &authority.to_bytes(), GATEWAY_TOKEN_ADDRESS_SEED, &additional_seed.unwrap_or_default(), &network.to_bytes(), ], &i...
Rust
0
).to_vec()), }, Case { data: "*-1\r\n".to_string().into_bytes(), want: Value::NullArray, }, Case { data: "*0\r\n".to_string().into_bytes(), want: Value::Bulk(Vec::new()), }, Case { ...
Rust
0
381917894711603833208051177722232017256448 * column16_row192). let mut val = prime_field::fmul( /*column20_row209*/ ctx[map::MM_OODS_VALUES+182].clone(), prime_field::fadd( /*column16_row1*/ ctx[map::MM_OODS_VALUES+88].clone(), sub( prime_field::get_k_modulus(), prime_field::fmul( uint256_ops::get_uint256...
Rust
0
} d.update(); } <reponame>resin-io-modules/libnm-rs<filename>src/device_macvlan.rs<gh_stars>1-10 // This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files // DO NOT EDIT use crate::Device; use crate::Object; #[cfg(any(feature = "v1_2", feature = "dox"))] #[cfg_attr(feature = "dox", doc...
Rust
0
import inspect import re from hashlib import sha256 from typing import List from .audiofolder import audiofolder from .csv import csv from .imagefolder import imagefolder from .json import json from .pandas import pandas from .parquet import parquet from .sql import sql # noqa F401 from .text import text def _hash_...
Python
1
# mypy: allow-untyped-defs import torch from functorch.experimental.control_flow import cond class CondClosedOverVariable(torch.nn.Module): """ torch.cond() supports branches closed over arbitrary variables. """ def forward(self, pred, x): def true_fn(val): return x * 2 d...
Python
1
s no website' ' configuration.\',empty_prefix_key=storage_url]' ' gs://bucket').format( shim_util._get_gcloud_binary_path('fake_dir')), info_lines) @mock.patch.object(web.WebCommand, '_SetWeb', new=mock.Mock()) def test_shim_translates_set_command(self): with SetBotoC...
Python
1
>, C::NonceSize: Mul<G::EmbedNonce>, EmbedNonceSize<G>: ArrayLength<u8>, Sum<EmbedNonceSize<G>, C::TagSize>: ArrayLength<u8>, <C::NonceSize as Mul<G::EmbedNonce>>::Output: Add<C::TagSize> { type FinalizeSize = Sum<EmbedNonceSize<G>, C::TagSize>; }<gh_stars>10-100 use std::error::Erro...
Rust
0
) { assert!(index < 64); ops.ldzi( MemArgs { reg_offset: index as u64, size: MemSize::_64, } .encode(), ptr as *mut (), ); } /// Store 512 bits (64 bytes) `z[index][0..64]` to memory with interleaving. /// /// `index` must be in range `0..64`. #[inlin...
Rust
0
ntType.STANDUP, author_id="architect_principal_001", title="Daily Standup - Architecture", content="## Yesterday\n- Reviewed authentication requirements\n- Created initial task breakdown\n\n## Today\n- Finalizing API design\n- Creating detailed tasks\n\n## Blockers\n- None" )...
Python
1
293524555), 177.85792019232), (48.457725703128, 48.811757421639, 75.400981011302), True)} fontInfo = {'face': ('Sans Serif', 'Normal', 16)} clipPlaneInfo = {} silhouettes = {0: True, 2415: True} replyobj.status("Restoring window...", blankAfter=0, secondary=True) restoreWindowSize(windowSize) replyobj.status("...
Python
1
_eq!(new.interlaced, reference.interlaced); assert_eq!(new.palette, reference.palette); assert_eq!(new.buffer, reference.buffer); } } } #[test] fn encode_roundtrip_few_colors() { const WIDTH: u16 = 128; const HEIGHT: u16 = 128; // Build an image with a single red pixel,...
Rust
0
test_thread_test_avoid_copying_the_body_spawn() { avoid_copying_the_body(|v| { thread::spawn(move || v()); }); } pub fn test_thread_test_avoid_copying_the_body_thread_spawn() { avoid_copying_the_body(|f| { thread::spawn(move || { f(); }); }) } pub fn test_thread_te...
Rust
0
self.redraw() self.setFonts() if len(activelayer) == 1: self.viewer.updateViewer(layer=activelayer[0]) def scaling(self, layer, method): oldmethod = self.viewer.display[layer]['scaling'] if method != oldmethod: self.viewer.display[layer]['scaling'] =...
Python
1
, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #![feature(phase)] extern crate memcached; #[phase(plugin, link)] extern crate log; extern crate time; use std::rand::random; use memcached::client::{Client, AddrType}; use memcached::client::AddrType::TcpAddr; use memcache...
Rust
0
.value(right).unwrap_or(0); let array_offset = usize::try_from(l + r).ok()?.checked_mul(i16::SIZE)?; let vector_offset: u16 = Stream::read_at(kerning_array_data, array_offset)?; Stream::read_at(kerning_vector_data, usize::from(vector_offset)) } } } impl core::fmt::D...
Rust
0
l axes behaviour min_val = np.array([-1.0, -1.0, -1.5]) max_val = np.array([1.0, 0.5, 0.5]) max_range = (max_val - min_val).max() Xb = 0.5 * max_range * np.mgrid[-1:2:2, -1:2:2, -1:2:2][0].flatten() + 0.5 * (max_val[0] + min_val[0]) Yb = 0.5 * max_range * np.mgrid[-1:2:2, -1:2:2, -1:2:2][1].flatten(...
Python
1
:32", 27, 4, "keyblock", "Encryption key4 or user data", None), ('BLOCK_KEY5', "security", 9, 0, 0, "bytes:32", 28, 5, "keyblock", "Encryption key5 or user data", None), ('BLOCK_SYS_DATA2', "security", 10, 0, 0, "bytes:32", 29, 6, None, "Sys...
Python
1
 c@sddlZejjZejjjZejjjdZejjjdZ ejjjdZ ejjjdZ ide6de6de 6d e 6d e 6Z dS( iNiiiisInvalid parameter(s)sMarshaling data failedsGet of required API failedsLibrary call faile...
Python
1
#!/usr/bin/env python # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Reval = re-eval. Re-evaluate saved detections...
Python
1
from youtubesearchpython.__future__ import * import asyncio async def main(): search = Search('NoCopyrightSounds', limit = 1, language = 'en', region = 'US') result = await search.next() print(result) videosSearch = VideosSearch('NoCopyrightSounds', limit = 10, language = 'en', region = 'US') vid...
Python
1
import requests import json url = "http://127.0.0.1:5000/v1/completions" headers = {"Content-Type": "application/json"} # Funcion para crear la historia def datos_historia(): print("\nEspecifica los datos de la historia que quieres crear") personaje_principal = input("Nombre del presonaje principal: ") pe...
Python
1
"""Tests for the AVM Fritz!Box integration.""" from __future__ import annotations from unittest.mock import Mock from homeassistant.components.diagnostics import REDACTED from homeassistant.components.fritzbox.const import DOMAIN as FB_DOMAIN from homeassistant.components.fritzbox.diagnostics import TO_REDACT from ho...
Python
1
texte = input("Entrez un texte : ") mot = input("Mot à chercher : ") compte = texte.count(mot) print(f"Le mot '{mot}' apparaît {compte} fois.")
Python
1
.as_object().unwrap(); assert!(targets.contains_key("127.0.0.1:8022")); assert!(targets.contains_key("127.0.0.1:8023")); } #[fuchsia_async::run_singlethreaded(test)] async fn test_add_manual_target() { let mt = Mock::default(); mt.add("127.0.0.1:8...
Rust
0
imageWidth, lineVelocity, region_size, maxLineAcceleration=(3, 0.5), maxInitSpeed=3): region_width, region_height = region_size speed, angle = lineVelocity X += int(speed * n...
Python
1
{}, with parameters: {:,d}".format( # net_struc_str, n # ) # ) # logger.info(s) # def load(self): # load_path_G = self.opt["path"]["pretrain_model_G"] # if load_path_G is not None: # logger.info("Loading model for G [{:s}] ......
Python
1
0x01F8, word_18 = 0x1591, word_1A = 0x0000, ), ) # id: 0x10003 offset: 0x176 @scena.EventData('EventData') def EventData(): return ( ) # id: 0x10004 offset: 0x176 @scena.ActorData('ActorData') def ActorData(): return ( ScenaActorData( trigge...
Python
1
ctory4, Factory5, Factory6, Factory7, Factory8, User, RandomNote, RandomChord, } impl Wavetable { const ALL: [Wavetable; 11] = [ Wavetable::Factory1, Wavetable::Factory2, Wavetable::Factory3, Wavetable::Factory4, Wavetable::Factory5, Wavet...
Rust
0
#!/usr/bin/env python from __future__ import division from collections import Counter # load data and keep around in convenient forms with open('user_brand.csv') as f: data = [line.strip().split(",") for line in f] brandsfor = dict() for user, brand in data: brandsfor.setdefault(user, set()).add(brand) # count fr...
Python
1
from .social_media import SocialMedia # Document (defines text property) # ↓ # SocialMedia (inherits text from Document) # ↓ # Tweets (inherits text from SocialMedia which got it from Document) # Note I would not use multi-level inheritance in the real world # Most modern programming emphasizes: # Composition ...
Python
1
)) # Build a progress bar with an arrow of equal signs; special cases for # empty and full if numHashes == 0: self.progBar = "[>%s]" % (" " * (allFull - 1)) elif numHashes == allFull: self.progBar = "[%s]" % ("=" * allFull) else: self.progBar ...
Python
1
from nhlpy.api import teams, standings, schedule, game_center, stats, misc, helpers, players from nhlpy.http_client import HttpClient from nhlpy.config import ClientConfig class NHLClient: """ This is the main class that is used to access the NHL API. You can instantiate this class and then access the va...
Python
1
gchangfan/DiffusionPDE/data/training/NS_heat/T/range_allT.mat" range_allT = sio.loadmat(range_allT_paths)['range_allT'] range_allT = torch.tensor(range_allT, device=device) self.max_T = range_allT[0, 1] self.min_T = range_allT[0, 0] def forward(self, T0, coords): # T0: [batc...
Python
1
{}\n\n {:?}", message, output) } Some(0) => {} _ => panic!("{:?}", output), }, } } } // box1.rs // // At compile time, Rust needs to know how much space a type takes up. This becomes problematic // for recursive types, where a value can have as par...
Rust
0
spot! Can move over. to[nx][ny] = *pos; } else { // Spot was taken, stay in place. to[x][y] = *pos; } } } } } fn reset(map: &mut Vec<Vec<char>>) { map.iter_mut().for_each(|row| row.iter_mut().for_ea...
Rust
0
s_directory, "nutrition_label_2.jpg") # Create and submit the analysis request analysis_request = NutritionAnalysisInput( instruction_text="Please analyze these nutrition labels and extract all nutritional information.", images=[instructor.Image.from_path(image_path_1), instructor.Image.from_pat...
Python
1
; // EXTERN_C const IID IID_ISWbemServices; DEFINE_GUID! {IID_ISWbemServices, 0x76a6415c, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} RIDL! {#[uuid(0x76a6415c, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] interface ISWbemServices(ISWbemServicesVtbl): IDispatch(IDispatchVtbl) { ...
Rust
0
!(); } } #[derive(Debug, Eq, Hash, Clone, Copy)] pub struct Point { x: usize, y: usize, } #[derive(Debug, Eq, Hash, Clone, Copy)] pub struct LayeredPoint { x: usize, y: usize, l: usize, } impl LayeredPoint { fn inner(&self, w: usize, h: usize) -> bool { !self.outer(w, h) } ...
Rust
0
import argparse import json import os import os.path as osp from collections import defaultdict from tqdm import tqdm def get_args(): parser = argparse.ArgumentParser() parser.add_argument('--video_folder', required=True, help='Path to the down loaded realestate10k txt files') parser.add_argument('--save_...
Python
1
import os import argparse def main(feature_bin_path, match_bin_path, camera_bin_path, output_path): """Create image database depend on images.bin Args: feature_bin_path (str): Path to features.bin for read match_bin_path (str): Path to matches.bin path for read camera_bin_path (str): P...
Python
1
""" Greeks用于衡量期权的价格敏感性, 即相对于标的资产参数的变化 Delta: 衡量期权价格相对于标的资产价格的敏感性 Gamma: Delta相对于标的价格的变化率 """ from BinomialLROption import BinomialLROption import numpy as np class BinomialLRWithGreeks(BinomialLROption): def __new_stock_price_tree__(self): # create additional layer of nodes to our original stock price tr...
Python
1
hape(-1, 1))) entity = OTXDataItem( image=to_dtype(to_image(img_data), torch.float32), img_info=ImageInfo( img_idx=index, img_shape=img_shape, ori_shape=img_shape, image_color_channel=self.image_color_channel, ...
Python
1
""" Author: Gaál István Tamás Task: Homework-10 """ def get_quotes_top_ten_category_xpath(index) -> str: return f'/html/body/div/div[2]/div[2]/span[{index}]' def get_quotes_from_the_tag(index): return f'/html/body/div/div[2]/div[1]/div[{index}]' def get_quote_text_from_the_chosen_tag_xpath(index): return...
Python
1
pub filter_prof: bool, /// Current search contents. pub search: String, /// Edit mode. #[serde(skip)] edit: bool, } impl Builds { pub const fn new() -> Self { Self { entries: Vec::new(), display_notes: true, filter_prof: false, searc...
Rust
0
, combinator::{map, map_parser, map_res}, multi::fold_many1, sequence::tuple, }; use simple_error::SimpleError; use strum::VariantNames; use strum_macros::{EnumString, EnumVariantNames}; pub const BINARY_BOARDING: Command = Command::new(sub_command, "binary-boarding", run); #[derive(Debug, EnumString, Enu...
Rust
0