text string | label_name string | labels int64 |
|---|---|---|
Info] };
// TODO: Always available?
unsafe { Id::retain_autoreleased(obj).unwrap() }
}
pub fn process_name(&self) -> Id<NSString, Shared> {
let obj: *mut NSString = unsafe { msg_send![Self::class(), processName] };
unsafe { Id::retain_autoreleased(obj).unwrap() }
}
}
<gh_sta... | Rust | 0 |
impl ResponseBodyOps for Host {
fn response_data(&self, start: usize, max_size: usize) -> host::Result<ByteString> {
hostcalls::get_buffer(BufferType::HttpResponseBody, start, max_size)
}
}
impl ResponseTrailersOps for Host {
fn response_trailers(&self) -> host::Result<HeaderMap> {
hostcal... | Rust | 0 |
pe(
inputs, shape=[batch_size * max_time, np.prod(inputs.shape.as_list()[-3:])])
for i in range(1, 5, 1):
with tf.variable_scope('fc%d' % (i)) as scope:
outputs = tf.contrib.layers.fully_connected(
inputs=outputs,
num_outputs=2048,... | Python | 1 |
import os
from rdkit import Chem
# os.environ["CUDA_VISIBLE_DEVICES"] = "4"
from unimol_tools import MolTrain2
import numpy as np
import pandas as pd
from multiprocessing import freeze_support
def main():
# read from excel
def norm_smiles(raw_smiles):
mol = Chem.MolFromSmiles(raw_smiles)
if mo... | Python | 1 |
]
mod hot_reload;
#[cfg(all(debug_assertions, feature = "hot-reload"))]
mod libloader;
#[cfg(not(all(debug_assertions, feature = "hot-reload")))]
mod libloader {
pub(crate) struct LibLoader {}
}
mod alloc;
mod geometry;
mod layout;
mod parser;
pub mod app;
pub mod grc;
pub mod key;
pub mod lenses;
pub mod render... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2024 Google LLC. 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 requir... | Python | 1 |
"""Create a password for a software component"""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
@click.argument('identif... | Python | 1 |
import numpy as np
from sklearn.metrics import accuracy_score
from keras.datasets import reuters
from keras.preprocessing.sequence import pad_sequences
from keras.utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense, LSTM, Activation
from keras import optimizers
from keras.wra... | Python | 1 |
_header_table_index: u16,
}
impl ElfHeader {
/// Create an object from byte array.
pub fn try_new(binary: &[u8]) -> Result<ElfHeader> {
if binary.len() < SIZE_ELF32_HEADER {
return Err(LoaderError::TooShortBinary {});
}
// unwrap the result of read_u* because the binary has ... | Rust | 0 |
sion)]
aws_smithy_types::Number::NegInt((input.asn).into()),
);
}
if let Some(var_250) = &input.auth_key {
object.key("authKey").string(var_250);
}
if let Some(var_251) = &input.address_family {
object.key("addressFamily").string(var_251.as_str());
}
if let So... | Rust | 0 |
ytes - Unknown (type?) (Int)
/// [1] Byte - Boolean? Unknown
/// [1] Byte - Boolean? Unknown
/// [1] Byte - Boolean? Unknown
/// [1] Byte - Boolean? Unknown
/// [4] Bytes - Unknown (Int)
/// .Lev File Spec
/// First Table (Height)
///
/// Each Row is 36 Bytes long. Number of Rows is relative to ((X*Y) / 256) (dimension... | Rust | 0 |
ification of the
hybridisation state deliver approximately the same result (small
deviation arises from the difference in the parameters for the
oxygen atom of the hydroxyl group in the carboxyl group that
propagates to the amino group).
Moreover, it is verified whether the respective UserWarning ab... | Python | 1 |
#!/usr/bin/python3
from keyman_config.gsettings import GSettings
GSETTINGS_ENGINE_BASE = 'com.keyman.engine'
GSETTINGS_ADDITIONAL_KEYBOARDS_KEY = 'additional-keyboards'
class CustomKeyboards():
def __init__(self):
self.gsettings = GSettings(GSETTINGS_ENGINE_BASE)
def add(self, keyboard):
if... | Python | 1 |
)
}
}
use serde::Deserialize;
use std::error::Error;
use std::fs::File;
use std::io::{BufReader, Read};
use std::net::SocketAddr;
use std::str;
#[derive(Deserialize)]
pub struct Config {
pub statsd_addr: SocketAddr,
pub carbon_addr: SocketAddr,
pub flush_interval: u64,
}
impl Config {
pub fn load(... | Rust | 0 |
import itertools
import re
LANGUAGE_UNICODE_RANGE_MAP = {
"ZH": [(0x4E00, 0x9FFF)],
"JP": [(0x4E00, 0x9FFF), (0x3040, 0x309F), (0x30A0, 0x30FF), (0x31F0, 0x31FF)],
"EN": [(0x0000, 0x007F)],
}
SYMBOLS_MAPPING = {
":": ",",
";": ",",
",": ",",
"。": ".",
"!": "!",
"?": "?",
"\n": ... | Python | 1 |
macro_rules! stop { () => ( cpu.stop(); ) }
// Fetch the next instruction from memory
let op = mem.lb(cpu.bump());
// Decode and execute the instruction, returning the number of cycles required to run it.
// See http://imrannazar.com/Gameboy-Z80-Opcode-Map for decode table
// See http://probl... | Rust | 0 |
lImage(index),
));
index
});
SpinelImage(*index)
}
fn get_current_image(&mut self, context: &ViewAssistantContext) -> SpinelImage {
self.get_image(context.image_index)
}
fn render_with_clip(
&mut self,
composition: &SpinelComposition,
... | Rust | 0 |
import copy
def safety_check(*args):
"""
安全性检测算法(Safety Algorithm)
参数:
allocated: 已分配矩阵(list of list of int)
need: 需求矩阵(list of list of int)
available: 可用资源向量(list of int)
返回:
(is_safe, safe_sequence)
is_safe: bool, 是否是一个安全状态
safe_sequence: 若安全,返回一个安全序... | Python | 1 |
fn precalc() -> Vec<u16> {
let mut tab = Vec::new();
for i in 0..359 {
tab.push(((f64::from(i).to_radians().sin() + 1.0) * 50.0).round() as u16);
}
tab
}
fn main() -> Result<(), std::io::Error> {
cc::Build::new()
.file("src/hello.c")
.compile("hello");
let tab =... | Rust | 0 |
sh(b'0');
buffer.push(HEX_DIGITS[(c >> 4) as usize]);
buffer.push(HEX_DIGITS[(c & 0xF) as usize]);
}
}
}
from = pos + 1;
if let Some(new_pos) = &bytes[from ..].iter().position(|c| match *c {b'"' | b'\\' | 0..=31 => true, _ => false})
{ pos = from + *new_pos;
}
else
{ buffer.extend_from_sl... | Rust | 0 |
from typing import Annotated
from fastapi import Depends, HTTPException, status
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
from sqlalchemy.ext.asyncio import AsyncSession
from app.core.database import get_db
from app.features.auth.service import AuthService
from app.features.auth.models impor... | Python | 1 |
also:
http://docs.python.org/3/library/subprocess#subprocess.Popen.kill
r" )r s r killSubprocessTransport.kill
"!r Nr7 r8 r9 r: r< |