input
stringlengths
2.65k
237k
output
stringclasses
1 value
'bundleId': 'string', 'isStaticIp': True|False, 'privateIpAddress': 'string', 'publicIpAddress': 'string', 'ipv6Address': 'string', 'hardware': { 'cpuCount': 123, 'disks': [ { 'name': 'string', 'arn': 'string', 'supportCode': 'string', 'createdAt': datetime(2015, 1, 1), 'location': { 'availabilityZone': '...
= aRNApipe_path.strip("\r") genome = "" # Open the configuration file for the run and extract # the value of genome_build f = open(path, 'r') for i in f: i = i.strip("\n").split("\t") if len(i) > 1: if i[0] == "genome_build": genome = i[1] break f.close() genome = genome.strip("\r") # Did we extract a v...
connection = vpn_service.get_connection(u'1') self.assertIsNotNone(connection) self.assertFalse(connection.is_dirty) def test_sweep_connection_dirty(self): """Sync did not update connection - delete.""" # Create a service and connection vpn_service = self.driver.create_vpn_service(self.service123_data) vpn_serv...
<gh_stars>0 #!/usr/bin/env python ''' http://www.last.fm/music/+free-music-downloads/acoustic ''' import os import sys import random import hashlib import subprocess from datetime import datetime, timedelta OUT_DIR = os.path.expanduser('~/video_archive/music/') # # a terrible ordered dict # FILES = { # 0:dict( # ...
: return ( ( self . priority == 254 and self . mpriority == 255 and self . weight == 0 and self . mweight == 0 ) ) if 38 - 38: OoOoOO00 / OOooOOo % OoooooooOO * I1ii11iIi11i if 7 - 7: I11i * O0 + Oo0Ooo / O0 * oO0o + i11iIiiIii if 74 - 74: OoOoOO00 def print_state_change ( self , new_state ) : Oo000 = self . prin...
from __future__ import print_function import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import argparse from tqdm import tqdm import os import cv2 import pickle import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from t...
<gh_stars>1-10 import numpy as np import yfinance import pandas as pd from gym.utils import seeding import gym from gym import spaces import matplotlib import matplotlib.pyplot as plt import pickle from stable_baselines3.common.vec_env import DummyVecEnv from stable_baselines3.common import logger matplotlib.use("Agg"...
<gh_stars>10-100 """A version of transform's T5 models with support for custom positional attention bias, and a fixed forward masking in the decoder""" import copy import torch from torch import nn from torch.nn import CrossEntropyLoss from transformers.file_utils import add_start_docstrings_to_model_forward, replac...
CB LEU B 15 74.441 2.005 6.508 1.00 0.00 C ATOM 6 CG LEU B 15 73.315 1.794 7.526 1.00 0.00 C ATOM 7 CD2 LEU B 15 73.362 0.379 8.081 1.00 0.00 C ATOM 8 CD1 LEU B 15 73.387 2.816 8.654 1.00 0.00 C ATOM 1 N ALA B 16 76.446 4.570 5.146 1.00 0.00 N ATOM 2 CA ALA B 16 77.695 4.815 4.434 1.00 0.00 C ATOM 3 C ALA B 16 78.875 4...
pickle.loads(pickle.dumps(ts_fixture, protocol=protocol)) assert ts.tables == ts_fixture.tables # Do some thing to check the ts is init'd properly ts.draw_text() class TestFileUuid(HighLevelTestCase): """ Tests that the file UUID attribute is handled correctly. """ def validate(self, ts): with tempfile.Tempo...
# -*- coding: utf-8 -*- """ All unit tests for the newspaper library should be contained in this file. """ import sys import os import unittest import time import traceback import re from collections import defaultdict, OrderedDict import concurrent.futures TEST_DIR = os.path.abspath(os.path.dirname(__file__)) PARENT_...
refactor migration has run 'core.TopicPage', ] template_choices = (('learn/detail_page.html', 'Learn'),) class Meta: verbose_name = 'Detail page' verbose_name_plural = 'Detail pages' ################ # Content fields ################ hero = StreamField( [ ('Image', core_blocks.ImageBlock(template='core/in...
# Copyright 2020 NREL # 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 agreed to in writing, software # distri...
mysqldb.username(query_str) if username_result == 'L1001': response['code'] = 'L1001' response['message'] = '系统异常' return response elif username_result == None: response['code'] = 'L1003' response['message'] = '认证失败' return response else: sql_result = mysqldb.port_list(username_result['username'], pagenum, pa...
import time import datetime import serial import threading import json import traceback import queue import os import pty import subprocess from multiprocessing import Process import glob from elasticsearch import Elasticsearch from .data_consumers import Datastore, Logger from .http_cmd import create_usb_session_endp...
from __future__ import unicode_literals import unittest import chance import chance_exceptions import datetime import re import dictionaries from chance import text_type class TestChanceBooleanFunction(unittest.TestCase): def test_boolean_returns_bool(self): for x in range(0, 200): self.assertTrue(isinstance(cha...
<gh_stars>1-10 def normalize_and_rgb(images): import numpy as np #normalize image to 0-255 per image. image_sum = 1/np.sum(np.sum(images,axis=1),axis=-1) given_axis = 0 # Create an array which would be used to reshape 1D array, b to have # singleton dimensions except for the given axis where we would put -1 #...
models.DecimalField(default=0, max_digits=2, decimal_places=1, blank=True, null=True) number_of_films_as_actor = models.PositiveIntegerField(default=0) number_of_ratings_as_actor = models.PositiveIntegerField(default=0) average_rating_as_actor = models.DecimalField(default=0, max_digits=2, decimal_places=1, blank=Tr...
<gh_stars>0 #!/usr/bin/env python import argparse import matplotlib.pyplot as plt import numpy as np import os from os import path import sys import warnings DEFAULT_HEARTBEAT_DIR='heartbeat_logs' DEFAULT_PLOTS_DIR='plots' DEFAULT_APPLICATION_PROFILER='APPLICATION' HB_LOG_IDX_START_TIME = 7 HB_LOG_IDX_END_TIME = HB_...
from common.numpy_fast import clip, interp from selfdrive.car.tesla.values import CruiseButtons from selfdrive.config import Conversions as CV import time from common.params import Params from cereal import car ACCEL_MAX = 0.6 #0.6m/s2 * 36 = ~ 0 -> 50mph in 6 seconds ACCEL_MIN = -3.5 _DT = 0.05 # 20Hz in our case, s...
#!/usr/bin/env python3 import yaml from pprint import pprint import os import sys import collections import time import copy from . import university_info MAJORS_LOCATION = "../majors/" # relative path to folder containing the major requirements JSONs CERTIFICATES_LOCATION = "../certificates/" # relative path to fold...
<filename>acipdt/main.py import acipdt import xlrd import xlwt import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning from xlutils.copy import copy from orderedset import OrderedSet import sys import time import ipaddress import getpass import os # Log levels 0 = None, 1 = Class only, ...
AC.dt64_2_dt([time2use])[0].strftime('%Y/%m/%d %H:%M') # Print out status pstr = "'plotting 2layer @ {:.1f}$^{}$N on {}" print(pstr.format(lat2use, '{\circ}', dstr)) # Select for level and variable, and average over time ds_tmp = ds.sel(lat=lat2use, time=time2use) # Set title title_str = '[{}] & [{}] @ {:.1f}$^{...
max_level: raise AAAException("Unauthorized role") registration_code = uuid.uuid4().hex creation_date = str(datetime.utcnow()) # send registration email email_text = bottle.template(email_template, username=username, email_addr=email_addr, role=role, creation_date=creation_date, registration_code=registrati...
('t_3', 'v_6')}, '>': {('c_1', 'v_1'), ('t_3', 'v_4'), ('t_1', 'v_5'), ('t_2', 'v_1'), ('t_3', 'v_2'), ('t_1', 'v_3'), ('t_1', 'v_4'), ('t_2', 'v_6'), ('c_1', 'v_5'), ('t_2', 'v_3'), ('t_1', 'v_6'), ('c_1', 't_1'), ('t_3', 'v_5'), ('t_1', 'v_2'), ('c_1', 'v_4'), ('t_3', 'v_1'), ('c_1', 't_2'), ('t_2', 'v_4'), ('c_1...
roi_h, roi_w, 1) mask of valid pixels """ depth_map_shape = depth_map.shape if len(depth_map_shape) != 2: raise ValueError('Invalid depth_map_shape', depth_map_shape) all_inst_depth_crops, all_inst_valid_masks = np_instance_crop( boxes_2d=boxes_2d, boxes_3d=boxes_3d, instance_masks=instance_masks, input_map=...
""" Font Bakery callable is the wrapper for your custom check code. Separation of Concerns Disclaimer: While created specifically for running checks on fonts and font-families this module has no domain knowledge about fonts. It can be used for any kind of (document) checking. Please keep it so. It will be valuable fo...
direction = end - start length = np.linalg.norm(direction) if above: ax.plot([start[0], end[0]], [start[1], end[1]], [start[2], end[2]], color=color) else: mid1 = start + 0.4 * direction mid2 = start + 0.6 * direction ax.plot([start[0], mid1[0]], [start[1], mid1[1]], [start[2], mid1[2]], color=color) ax.plot([...
"""This algorithm implements the Wang Generalization algotithm with constraint checking This algorithm simplifies lines. It detects for each line the bends. It analyze the bend and remove the bends that are below a certain diameter. The point and lines that do not need to be simplified are still used to enforce to...
# -*- coding: utf-8 -*- """ Loads, parses and classifies the text from manuscripts. Notes: * The first ms you load becomes your base text. * I'm not currently doing anything with the book's title, e.g. κατα ιωαννην * I'm not handling gap tags very smartly """ from collections import defaultdict import logging logger =...
<reponame>chianfern/rmf_traffic_editor import fiona import gzip import json import math import numpy as np import os import sqlite3 import tempfile import yaml from ament_index_python.packages import get_package_share_directory from pyproj import Transformer from pyproj.crs import CRS from xml.etree.ElementTree import...
<gh_stars>0 import os import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from CustomButton import CustomButton from Flag import Flag from arrow import Arrow from Mitigation_01 import MitigationWindow def resource_path(relative_path): if hasattr(sys, '_MEIPASS'): return ...
<reponame>kdart/pycopia3 #!/usr/bin/python3.4 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # 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 # ...
""" Classes related to DiamondFire (DF) variable types. """ import typing import math import re import collections import operator import json import nbtlib as nbt from nbtlib.tag import Base from .. import constants from ..enums import ( Material, HideFlags, SoundType, ParticleType, CustomSpawnEggType, PotionEffect, ...
<reponame>entityoneuk/lusid-python-tools<gh_stars>1-10 import argparse import copy import csv import os import numpy as np import lusid from collections.abc import Mapping import pandas as pd from detect_delimiter import detect import requests import json import inspect import functools from pathlib import Path import ...
that someone is a particular role # (there are no examples of this right now, but it could be possible in the future). For example, # if !shoot was rewritten so that there was a "gunner" and "sharpshooter" template, one could # prove they are sharpshooter -- and therefore prove should they miss that the target is we...
where you want to move the event to. Moves an event to a different folder (calendar). :: event = service.calendar().get_event(id='KEY HERE') event.move_to(folder_id='NEW CALENDAR KEY HERE') """ if not folder_id: raise TypeError(u"You can't move an event to a non-existant folder") if not isinstance(folder_id, B...
+ str(fid_lookup)) fid_disp = re.sub(r"^.*\.([^\.]+)\.([^\.]+)$", r"\1.\2", fid_lookup) func_disp = feature_id_to_function[genome_ref][fid_lookup] genome_sci_name = genome_ref_to_sci_name[genome_ref] html_report_chunk += ['<tr bgcolor="' + row_color + '">'] #html_report_chunk += ['<tr bgcolor="'+'white'+'">'] # ...
<reponame>LauraOlivera/gammapy<gh_stars>0 # Licensed under a 3-clause BSD style license - see LICENSE.rst """Spectral models for Gammapy.""" import operator import numpy as np import scipy.optimize import scipy.special import astropy.units as u from astropy import constants as const from astropy.table import Table from...
import numpy as np import joblib import torch from torch import nn from torch.autograd import Variable from .gru import GRUCell, GRUODECell class ForecastRNN(nn.Module): """ Helper for pytorch reimplementation Uses variable sized/depth GRU with linear layer to get output right """ def __init__(self, input_dim,...
0.05*len(EDFEnergyProfile) #If threshold jump observed, save current intersect region index (k) if Intersections[j]+RegionThreshold < Intersections[j+1]: IntersectionRegions.append(Intersections[k:j]) k = j+1 #Save final intersect region index elif j == len(Intersections)-2: Inters...
backgroundColor: A tuple indicating the color of the level's background. playerStartPositions: A list of four tuples indicating which columns and rows each player starts on. blackHolePositions: A list of four tuples indicating which columns and rows each black hole sprite starts on. itemTiles: A list of tuples indi...
<reponame>zjzh/nova<filename>nova/virt/libvirt/vif.py # Copyright (C) 2011 <NAME> # Copyright (C) 2011 Nicira, Inc # Copyright 2011 OpenStack Foundation # All Rights Reserved. # Copyright 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complia...
from enum import Enum import random from copy import deepcopy class Role(Enum): NOTHING = 0 VILLAGER = 1 WEREWOLF = 2 SEER = 3 TROUBLEMAKER = 4 ROBBER = 5 HUNTER = 6 TANNER = 7 MINION = 8 MASON = 9 DRUNK = 10 INSOMNIAC = 11 DOPPELGANGER = 12 class Card(): def __init__(self, role, alt_role=Role.NOTHING):...
""" Implements indexing on a dbarray. dbarray indexing maps a raw bracket index to a set of maximal C-contiguous simple index bounds containing the indexed data. The dbindx an index of a dbarray. A dbindex is created from either a bracketed expression, i.e., dbarray[raw_idx], or from explicit dbindex creation functio...
<gh_stars>1-10 import argparse import torch import pickle import math import constant as Constants import numpy as np import matplotlib.pyplot as plt import random from tqdm import tqdm from plot import display_multi_poses, display_pose from sklearn.decomposition import PCA from sklearn import preprocessing def loadp...
self.font_text, text = "Blood Pressure", padx = 4, pady = 4) self.Pressure_Label.grid(row = 10, column = 0, sticky = "ew") self.Pressure_Entry = tk.Entry(self.RightFrame, font = self.font_text, textvariable = self.Pressure, width = 10) self.Pressure_Entry.grid(row = 10, column = 1, sticky = "ew") self.Pulse_Label...
<gh_stars>0 import re import logging import datetime import requests from .write import Write from .trigger import run_task from .proxies import get_proxy from .user_agent import get_user_agent from .exceptions import DownloadValueError, HTTPIgnoreCodeError logger = logging.getLogger(__name__) class Download: def ...
#!/usr/local/bin/python2.6 -tt # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (...
<reponame>NMTHydro/Recharge<filename>utils/EC_and_Soil_Moisture_Analysis/EC_analysis.py # =============================================================================== # Copyright 2018 gabe-parrish # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wit...
one sensor's reading. df_sensor = get_Yahoo_record(filepath, ['value', 'anomaly']) # Create first Dataframe, if nothing so far. if df is None: df = df_sensor.rename(columns={'value': sensor_id}) else: if np.any(df['datetime'] != df_sensor['datetime']): raise ValueError('Join between non-matching dates.') df[s...
<reponame>kenneth2001/Virus import asyncio import requests from bs4 import BeautifulSoup from datetime import date, datetime import discord import numpy as np from urllib.error import HTTPError import yt_dlp as youtube_dl from discord.ext import commands import os from pytz import timezone from yt_dlp.utils import Down...
0x1B, 0x2B, 0x03, 0x02, 0x10, 0x06, 0x03, 0x02, 0x1C, 0x27, 0x07, 0x14, 0x36, 0x0B, 0x03, 0x02, 0x37, 0x08, 0x27, 0x13, 0x10, 0x2B, 0x03, 0x02, 0x20, 0x0D, 0x03, 0x02, 0x36, 0x0C, 0x0C, 0x37, 0x37, 0x03, 0x02, 0x37, 0x17, 0x2C, 0x03, 0x02, #"Sidewalk crouches at her feet" 0x37, 0x0C, 0x21, 0x2E, 0x17, 0x17, 0x2A, 0x0...
None: """ This method is used to retrieve a list of existing properties that match the given property ID in the form "<device access ID>.<device ID>.<property ID>". The wildcard character "*" is supported for <device access ID> and <device ID> fields. For example "*.inv.3136" represents all properties with ID 3136...
assert ((np.abs(tmp)) < 1e-5).all() # vH ~ uH cur_vH = vH_0 next_vH = np.reshape(vHs_1_T_opt[0, :].T, (self.n_vH, 1)) next_uH = np.reshape(uHs_1_T_opt[0, :].T, (self.n_uH, 1)) assert next_vH.shape == cur_vH.shape == next_uH.shape tmp = next_vH - cur_vH - self.dt * next_uH / self.mass assert ((np.abs(tmp)) < 1e-...
# load extern modules import gym import csv import time import numpy as np from stable_baselines.bench import Monitor from supervisors.utils import distance_from_obstacles from env.utils import obs_lidar_pseudo import threading from supervisors.cbf import initialize_gp_dynamics, predict_successor_state_gp, initialize_s...
not None: self.Certificate_Signature.export(outfile, level, 'X509CertificateObj:', name_='Certificate_Signature') def hasContent_(self): if ( self.Certificate is not None or self.Certificate_Signature is not None ): return True else: return False def exportLiteral(self, outfile, level, name_='X509CertificateO...
<reponame>lanl/minRL<gh_stars>0 # This material was prepared as an account of work sponsored by an agency of the # United States Government. Neither the United States Government nor the United # States Department of Energy, nor Battelle, nor any of their employees, nor any # jurisdiction or organization that has cooper...
'''GDELTeda.py Project: WGU Data Management/Analytics Undergraduate Capstone <NAME> August 2021 Class for collecting Pymongo and Pandas operations to automate EDA on subsets of GDELT records (Events/Mentions, GKG, or joins). Basic use should be by import and implementation within an IDE, or by editing sect...
#!/usr/bin/env python # Copyright (c) 2013 VMware, Inc. 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...
from beem.utils import formatTimeString, resolve_authorperm, construct_authorperm, addTzInfo from beem.nodelist import NodeList from beem.comment import Comment from beem import Steem from beem.account import Account from beem.instance import set_shared_steem_instance from beem.blockchain import Blockchain import time ...
<reponame>mahmoud/hematite # -*- coding: utf-8 -*- from datetime import datetime, timedelta from hematite.constants import (REQUEST_HEADERS, RESPONSE_HEADERS, FOLDABLE_HEADERS, HEADER_CASE_MAP) from hematite.serdes import (quote_header_value, unquote_header_value, http_date_to_bytes, http_date_from_bytes, rang...
<reponame>nils-werner/pytorch-lightning<filename>pytorch_lightning/utilities/distributed.py # Copyright The PyTorch Lightning team. # # 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://...
), imath.V2i( 10 ) ) ) ) globals = GafferOSL.OSLShader() globals.loadShader( "Utility/Globals" ) outP = GafferOSL.OSLShader() outP.loadShader( "ImageProcessing/OutLayer" ) outP["parameters"]["layerColor"].setInput( globals["out"]["globalP"] ) outU = GafferOSL.OSLShader() outU.loadShader( "ImageProcessi...
large will usually lead to" " bad results. You could try setting max_size parameters " "on your collections and turning " "max_leaves down on recursive() calls." ) % (state.overrun_examples, state.valid_examples), HealthCheck.data_too_large, ) if state.invalid_examples == max_invalid_draws: fail_health_check( ...
# -*- coding: utf-8 -*- import asyncio import re from typing import Coroutine, Generator, Union from unittest.mock import patch from aiohttp import hdrs from aiohttp import http from aiohttp.client import ClientSession from aiohttp.client_reqrep import ClientResponse from asynctest import fail_on, skipIf from asynctes...
# -*- coding: utf-8 -*- from .compat import PY2, LOCALE, unicode, str_compat from .handlers import commands as hc @str_compat class ProtocolError(IOError): def __str__(self): if self.errno is None and PY2: message = self.message else: # метод __str__ вернет str, если strerror является str # метод __str__ вер...
is not None: print(diccionario) tabla_padre = tablaSimbolos.get(useActual).getTabla(tabla.padre) if tabla_padre is not None: print("Tiene Padre :)") if rs == 0: consola += "Se actualizó con éxito la tupla" + str(tupla) + "\n" elif rs == 1: listaSemanticos.append(Error.ErrorS("Error Semantico", "Fallo al ...
entity_registry_enabled_default=False, disabled=True, disabled_reason="Not exposed via MQTT in firmware 053.1", ), GoEChargerSensorEntityDescription( key="emfh", name="ESP minimum free heap since boot", entity_category=EntityCategory.DIAGNOSTIC, device_class=None, native_unit_of_measurement=None, state_class=...
= [tag_id, ctx.guild.id] else: args = [tag_id, ctx.guild.id, ctx.author.id] clause = f'{clause} AND owner_id=$3' query = f'DELETE FROM tag_lookup WHERE {clause} RETURNING tag_id;' deleted = await ctx.db.fetchrow(query, *args) if deleted is None: await ctx.send('Could not delete tag. Either it does not exist or...
fields to weight src_cv: CloudVolume for forward field dst_cv: CloudVolume for inverted field bbox: boundingbox of region to process mip: field MIP level optimizer: bool to use the Optimizer instead of the net """ start = time() chunks = self.break_into_chunks(bbox, cm.vec_chunk_sizes[mip], cm.vec_voxel_offset...
import os import re import nipype from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPath, BaseInterface, OutputMultiPath, BaseInterfaceInputSpec, isdefined) from Extra.base import MINCCommand, MINCCommandInputSpec, Info from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPa...
--help\n'.format(app_name) def is_valid_medialive_channel_arn(mlive_channel_arn): """Determine if the ARN provided is a valid / complete MediaLive Channel ARN""" if mlive_channel_arn.startswith("arn:aws:medialive:") and "channel" in mlive_channel_arn: return True else: return False def extract_media...
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.1 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (3,0,0): new_instancemethod = lambda func, inst, cls: _BOPTools....
"""Trains a tensorflow.keras model for car following behavior.""" import tensorflow as tf import numpy as np from havsim import helper import math from IPython import embed def generate_lane_data(veh_data): """ Generates Labels for Lane-Changing Model for a given vehicle Args: veh_data: (helper.VehicleData) repres...
green;') return True, nom def guardar(self): control, nom = self.validar_nom() if control == True: dia = str(self.data.date().day()) mes = str(self.data.date().month()) ano = str(self.data.date().year()) total = self.importe.value() IVA = self.iva.value() if total != 0 and IV...
@property def angles(self) -> Optional[List[Tuple[int, int, int]]]: """A List of angles from the topology.""" angles = [] topology = self.to_topology() for node in topology.nodes: bonded = sorted(list(nx.neighbors(topology, node))) # Check that the atom has more than one bond if len(bonded) < 2: continue #...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import mxnet as mx import numpy as np from config import config def Conv(**kwargs): body = mx.sym.Convolution(**kwargs) return body def Act(data, act_type, name): if act_type=='prelu': body = mx.sym.Leak...
with gaps in fewer than `maximum_gap_frequency` fraction of the sequences. Examples -------- >>> from skbio.alignment import Alignment >>> from skbio.sequence import DNA >>> sequences = [DNA('AC--', id="seq1"), ... DNA('AT-C', id="seq2"), ... DNA('TT-C', id="seq3")] >>> a1 = Alignment(sequences) >>> a2 = a1....
<reponame>RHolmewood/FetchRobot_Project2<gh_stars>0 # This Python file uses the following encoding: utf-8 """autogenerated by genpy from grasping_msgs/FindGraspableObjectsAction.msg. Do not edit.""" import codecs import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import acti...
''' datetime.tzinfo timezone definitions generated from the Olson timezone database: ftp://elsie.nci.nih.gov/pub/tz*.tar.gz See the datetime section of the Python Library Reference for information on how to use these modules. ''' # The IANA (nee Olson) database is updated several times a year. OLSON_VERSION = '2016...
'24' in question: pass else: break if candidate in question: anno_value = candidate break if anno_type == '流量' or anno_type == '价格': l, r = anno_start_index, anno_index while r < len(question) and question[r] == '0': anno_value = anno_value + '0' r += 1 while l > 0 and question[l-1].isdigit(): ...
550 }, "7": { "level": 7, "exp": 500, "cost": 0, "order_good_min": 1, "order_good_max": 3, "order_refresh_min": 120, "order_refresh_max": 120, "worker_gold": 0.7, "video_gold": 600 }, "8": { "level": 8, "exp": 600, "cost": 0, "order_good_min": 1, "order_good_max": 3, "order_refresh_min": 120, "order...
import json import threading import time import os import stat import ssl from decimal import Decimal from typing import Union, Optional, Dict, Sequence, Tuple from numbers import Real from copy import deepcopy from aiorpcx import NetAddress from . import util from . import constants from .util import base_units, bas...
"""Parsers for pw.x output.""" import re from pathlib import Path from typing import ( Any, Dict, Generic, Iterable, List, Mapping, Match, MutableMapping, Optional, Pattern, Sequence, Tuple, TypeVar, Union, ) import numpy as np from pwproc.geometry import Basis, GeometryData, RelaxData, Species, Tau fr...
share is not None: pulumi.set(__self__, "share", share) @property @pulumi.getter(name="dbName") def db_name(self) -> Optional[pulumi.Input[str]]: """ The display name of the database to be created from the backup. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characte...
<filename>electroncash/synchronizer.py #!/usr/bin/env python3 # # Electrum ABC - lightweight eCash client # Copyright (C) 2020 The Electrum ABC developers # Copyright (C) 2017-2022 The Electron Cash Developers # Copyright (C) 2014 <NAME> # # Permission is hereby granted, free of charge, to any person # obtaining a copy...
$t/$i """ tags = {} categories = {} context = [] context_stack = [] format_string = mapping_string use_expression = False if mapping_string[0] in ("'", '"'): use_expression = True format_string, mapping_string = mapping_string.split("#", 1) for key, replacement in cls.filetypes: mapping_string = mapping...
plugin is always deployed. # - The image format plugins are always deployed. # - The print support plugin is always deployed. # - SQL driver plugins are deployed if the application uses the Qt SQL # module. # - Script plugins are deployed if the application uses the Qt Script # module. # - The SVG icon plugin is deploy...
<filename>haskell/private/cc_libraries.bzl """Tools for handling and linking static and dynamic libraries. This includes C and Haskell libraries as both are tracked in CcInfo providers. """ load("@bazel_skylib//lib:dicts.bzl", "dicts") load("@bazel_skylib//lib:paths.bzl", "paths") load( ":private/packages.bzl", "gh...
intents=intents.Intents.ALL, token="lol", http_settings=http_settings, proxy_settings=proxy_settings, ) @pytest.mark.parametrize( ("compression", "expect"), [ (None, f"v={shard._VERSION}&encoding=json"), ("transport_zlib_stream", f"v={shard._VERSION}&encoding=json&compress=zlib-stream"), ], ) def test__ini...
"""library functions for pipelines """ #--- standard library imports # import os import sys import subprocess import logging import shutil import smtplib from email.mime.text import MIMEText from getpass import getuser #import socket import time from datetime import datetime from datetime import timedelta import calen...
rad to ° Pi = 3.141592653589793 results[k]['value'] = results[k]['value'] * 180 / Pi elif ('nOpa' in resSplit[-1]) or ('nTot' in resSplit[-1]): # Sky coverage from [0-1] to tenth of sky results[k]['value'] = results[k]['value'] * 10 k += 1 map_dymola_and_json(results, dic['case'], res_fin, case_dict) return re...
import os import sys import socket import time import thread import threading import multiprocessing import shutil import code import ssl import json import traceback import logging from dynamo.core.components.appserver import AppServer from dynamo.core.components.appmanager import AppManager import dynamo.core.server...
assert gt_masks.dtype == np.bool_, "Expected bool but got {}".format( gt_masks.dtype) # It's common to add GT Boxes to ROIs but we don't do that here because # according to <NAME> paper, it doesn't help. # Trim empty padding in gt_boxes and gt_masks parts instance_ids = np.where(gt_class_ids > 0)[0] assert inst...
column_format + 'c|' latex = df.to_latex(column_format=column_format) # replace \toprule, \midrule, \bottomrule with \hline (looks better plus don't need to import \usepackage{booktabs} rules = ['\\toprule', '\\midrule', '\\bottomrule'] latex = latex.replace(rules[0], '\\hline') latex = latex.replace(rules[1], '\\...
<reponame>THU-luvision/Occuseg<filename>examples/ScanNet/train_instance.py # import open3d from datasets import ScanNet from utils import evaluate_scannet, evaluate_stanford3D,WeightedCrossEntropyLoss, FocalLoss, label2color,evaluate_single_scan,cost2color from model import ThreeVoxelKernel from model import DenseUNet...
#!/usr/bin/env python # coding: utf-8 # Copyright (c) 2020 <NAME> # ## Train SparseChem on Chembl_mini # Output to `experiments/SparseChem` import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" import argparse import sys import os.path import time import json import functools import types import wandb import pprin...
# -*- coding: utf-8 -*- """ Functions to calculate rankings. @author: Scott """ # %% Setup import pandas as pd import numpy as np import json # %% Functions def find_teams(results, debug=False): """ Create a list of all teams in results database. Parameters ---------- results : TYPE Game results database. ...
<filename>loggerapp/datalogger/driver/pymba/pymba/vimbadll.py # -*- coding: utf-8 -*- from __future__ import absolute_import from sys import platform as sys_plat import platform import os from ctypes import * from . import vimbastructure as structs from .vimbaexception import VimbaException if sys_plat ==...