input
stringlengths
2.65k
237k
output
stringclasses
1 value
# coding=utf-8 """Class related metaclasses. This module defines: * Class, * PlainClass, * Attribute, """ from typing_extensions import Literal from typing import List, Optional, Dict, Union, Any import abc import collections from modelscript.megamodels.elements import SourceModelElement from modelscript.megamodels.m...
represents an available package upgrade. COMPLIANCE: This represents a Compliance Note DSSE_ATTESTATION: This represents a DSSE attestation Note """ NOTE_KIND_UNSPECIFIED = 0 VULNERABILITY = 1 BUILD = 2 IMAGE = 3 PACKAGE = 4 DEPLOYMENT = 5 DISCOVERY = 6 ATTESTATION = 7 UPGRADE = 8 COMPLIANCE = 9 DSSE_ATTE...
<filename>pyswip/core.py # -*- coding: utf-8 -*- # pyswip -- Python SWI-Prolog bridge # Copyright (c) 2007-2018 <NAME> # # 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,...
import mock import os import pandas as pd from datetime import datetime from flexmock import flexmock from sportsreference import utils from sportsreference.constants import AWAY from sportsreference.nfl.constants import BOXSCORE_URL, BOXSCORES_URL from sportsreference.nfl.boxscore import Boxscore, Boxscores MONTH = ...
import pygame from settings import * from collections import deque from ray_casting import mapping from numba.core import types from numba.typed import Dict from numba import int32 class Sprites: def __init__(self): self.sprite_parameters = { 'sprite_barrel': { 'sprite': pygame.image.load('sprites/barrel/base/0.p...
conformally rescaled metrci. This (conformal) laplacian is only used in the definition of Ricci that shows up in the evolution equation for At (under the trace free operation), and even then only in the part that multiplies the metric and which will drop out on taking the trace free part. So, in fact, the code cou...
# test_objects.py -- tests for objects.py # Copyright (C) 2007 <NAME> <<EMAIL>> # # 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; version 2 # of the License or (at your option) any later version...
<reponame>RangeKing/PaddleViT # Copyright (c) 2021 PPViT 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 # # Unles...
'''Our interval is 200 Myr''' # Prerequisites # For this test we're not going to use the default data self.classifier.t_m = 150.0 self.classifier.dt = np.array([ [ 50., 50., 50., 50., 50., ], [ 50., 50., 50., 50., 50., ], [ 50., 50., 50., 50., 50., ], [ 50., 50., 50., 50., 50., ], [ 50., 50., 50., 50., 50., ]...
recorder.", ) def test_get_span_offset_non_analog(self): """Test get span and offset of non analog channel""" return_var = self.gen.ghs_get_span_and_offset("A", 25) self.assertEqual( return_var[0], "InvalidChannelType", "Failed on get span and offset of non analog channel.", ) def test_set_get_filter_frequ...
443. Disabled by default. """ return pulumi.get(self, "host_port") @host_port.setter def host_port(self, value: Optional[pulumi.Input['ControllerHostPortArgs']]): pulumi.set(self, "host_port", value) @property @pulumi.getter def hostname(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[Mapping[str, pu...
Order_Placed = max(0,AI_Order) else: # here, the agent action is relative to the order received Order_Placed = max(0,Order_Received[AI_Entity_Index] + AI_Relative_Order) else: Order_Placed = max(0, L_hat[Entity_Index] + alpha_s[Entity_Index] * ( S_prime[Entity_Index] - S - beta[Entity_Index] * SL) + eps) else...
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -----------------------------------------------------------------------...
#!/usr/bin/env python import collections import sys import copy from functools import cmp_to_key import argparse ap = argparse.ArgumentParser(description="Identify teams that can be swapped between games inside matches") ap.add_argument("infile", help="Input schedule") ap.add_argument("matchno", type=int, help="Which ...
'kwlpumps' assert str(f) == '/yasup?sup=kwlpumps' f.query = '' assert str(f) == '/yasup' f.path = '' assert str(f) == '' f.args['no'] = 'dads' f.query.params['hi'] = 'gr8job' assert str(f) == 'no=dads&hi=gr8job' def test_load(self): comps = [('', '', {}), ('?', '%3F', {}), ('??a??', '%3F%3Fa%3F%3F', {}), ...
# -*- coding: utf-8 -*- try: # Python 2.7 from collections import OrderedDict except: # Python 2.6 from gluon.contrib.simplejson.ordered_dict import OrderedDict from gluon import current from gluon.html import A, URL from gluon.storage import Storage from s3 import s3_fullname T = current.T settings = current.d...
if is_admin is None or not is_admin: resp = make_response(jsonify(error='Not permitted to view this content. Must be an admin user.'), 403) resp.mimetype = "application/javascript" return resp # choose how many images to request num_labeled_images = request.args.get('num_labeled_images', None) print('num_label...
<gh_stars>100-1000 import tensorflow as tf from tensorflow.contrib.framework.python.ops import arg_scope from utils_fn import * from ops import * from loss import * from metrics import * class InpaintModel(): def __init__(self, args): self.model_name = "InpaintModel" # name for checkpoint self.dataset...
<reponame>bjoern1001001/python-neo # -*- coding: utf-8 -*- ''' Tools for use with neo tests. ''' import hashlib import os import numpy as np import quantities as pq import neo from neo.core import objectlist from neo.core.baseneo import _reference_name, _container_name from neo.core.container import Container from n...
<gh_stars>0 # -*- coding: utf-8 -*- """ *************************************************************************** test_qgssymbollayer.py --------------------- Date : October 2012 Copyright : (C) 2012 by <NAME> Email : massimo dot endrighi at geopartner dot it ****************************************************...
<filename>manim/camera/camera.py "A camera converts the mobjects contained in a Scene into an array of pixels." __all__ = ["Camera", "BackgroundColoredVMobjectDisplayer"] from functools import reduce import itertools as it import operator as op import time import copy from PIL import Image from scipy.spatial.distan...
from sklearn.base import BaseEstimator from sklearn.metrics import normalized_mutual_info_score, mutual_info_score, silhouette_score, davies_bouldin_score, calinski_harabasz_score, v_measure_score, adjusted_mutual_info_score, log_loss from sklearn.metrics.pairwise import pairwise_distances from sklearn.feature_extracti...
""" stscan ~~~~~~ Implements the "prospective" space-time permutation scan statistic algorithm. This was originally described in (1) in reference to disease outbreak detection. The algorithm is implemented in the software package (2). We apply it to crime predication as in (3). We look at events which have occurred i...
[1] + placed + [(p - 1) for p in placed] + [(p + 1) for p in placed] queue = sorted(set(queue)) seen = set(queue) while queue: lowest = queue.pop() if lowest == 0: continue needed_budget = (37 - len(placed)) * lowest for p in placed: needed_budget += max(0, lowest - p) if budget < needed_budget: continue r...
from __future__ import absolute_import, division, print_function import io from unittest import TestCase import numpy as np from math import log import Bio.PDB from Bio import AlignIO from Bio.Seq import Seq from Bio.PDB.MMCIF2Dict import MMCIF2Dict from Bio.PDB.PDBExceptions import PDBConstructionWarning from biostr...
NextIsSelected = None locals()['None'] = None NotAdjacent = None OnlyOneSection = None PreviousIsSelected = None SectionPosition = None SelectedPosition = None SortDown = None SortIndicator = None SortUp = None StyleOptionType = None StyleOptionVersion = None ...
<reponame>ARte-team/ARte #!/usr/bin/env python3 # Copyright (C) 2018 Freie Universität Berlin # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import re import os import sys import subprocess from...
#!/usr/bin/python # ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - <NAME> <<EMAIL>> # # 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 ...
itemsize = 4 else: raise NotImplementedError (`bits`) else: itemsize = bits/8 # in order to allocate the numpy array, we must count the directories: # code borrowed from TIFF.iter_images(): depth = 0 while True: depth += 1 if self.LastDirectory(): break self.ReadDirectory() self.SetDirectory(0) # we pr...
the specification (or Insert other doco here)" ), ) self.assertEqual( force_bytes(inst.rest[0].resource[5].interaction[3].code), force_bytes("delete"), ) self.assertEqual( force_bytes(inst.rest[0].resource[5].interaction[3].documentation), force_bytes( "Implemented per the specification (or Insert other doco ...
layers_dict["decoder_deconv_1"] = decoder_deconv_1 layers_dict["decoder_deconv_2"] = decoder_deconv_2 layers_dict["decoder_deconv_3_upsamp"] = decoder_deconv_3_upsamp layers_dict["decoder_mean_squash"] = decoder_mean_squash self._layers_dict = layers_dict self.encoder = None self.decoder = None # entire model ...
address, items in blocks: if address <= start <= endex <= address + len(items): return items[(start - address):(endex - address)] else: raise ValueError('contiguous slice not found') else: items = [] for address in range(start, endex, step): index = locate_at(blocks, address) if index is None: raise ValueErro...
<gh_stars>0 import logging from typing import List, Tuple from climsoft_api.api.form_daily2 import schema as form_daily2_schema from climsoft_api.utils.query import get_count from fastapi.exceptions import HTTPException from opencdms.models.climsoft import v4_1_1_core as models from sqlalchemy.orm.session import Sessio...
secrets.choice([0-randremove_notes, 0, randremove_notes]))) events_matrix.append(rec_event) min_note = int(min(min_note, rec_event[4])) max_note = int(max(max_note, rec_event[4])) ev += 1 itrack +=1 # Going to next track... #print('Doing some heavy pythonic sorting...Please stand by...') #print('Removi...
Science Mode. """ ModeName = ScienceMode[0] Settings = ScienceMode[3] ################################################### "Synchronize simulation Timesteps with OHB Data" Mode_start_date = ephem.Date( ephem.Date(ScienceMode[1]) + ephem.second * Timestamp_fraction_of_second ) TimeDifferenceRest = round( (ab...
<reponame>eulerkaku/movement_validation # -*- coding: utf-8 -*- """ Velocity calculation methods: used in locomotion and in path features """ from __future__ import division import warnings import numpy as np __ALL__ = ['get_angles', 'get_partition_angles', 'h__computeAngularSpeed', 'compute_velocity', 'get_fram...
"""supports/wraps nx_graphs from NetworkX""" import copy import logging import math from pathlib import PurePath import matplotlib.patches as patches import matplotlib.pyplot as plt import networkx as nx # library import numpy as np # import sknw # must pip install sknw from networkx.algorithms import tree from skimag...
<reponame>SeraphRoy/PyPy-Functional<filename>pypy/module/cpyext/pyerrors.py import os from rpython.rtyper.lltypesystem import rffi, lltype from pypy.interpreter.error import OperationError, oefmt from pypy.interpreter import pytraceback from pypy.module.cpyext.api import cpython_api, CANNOT_FAIL, CONST_STRING from pyp...
<reponame>tidoust/bikeshed # coding=utf-8 # # Copyright © 2013 Hewlett-Packard Development Company, L.P. # # This work is distributed under the W3C® Software License [1] # in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTI...
import torch import numpy as np import random import torch.nn.functional as F from torch import nn from utils.nodepiece_tokenizer import NodePiece_Tokenizer from torch.nn import TransformerEncoderLayer, TransformerEncoder from tqdm import tqdm from collections import defaultdict from typing import Optional from torch...
>>> print(s.to_markdown(tablefmt="grid")) +----+----------+ | | animal | +====+==========+ | 0 | elk | +----+----------+ | 1 | pig | +----+----------+ | 2 | dog | +----+----------+ | 3 | quetzal | +----+----------+ """ return self.to_frame().to_markdown( buf, mode, index, storage_options=storage_options, ...
#!/usr/bin/python from __future__ import print_function ####################################################################### # GoodVibes.py # # Evaluation of quasi-harmonic thermochemistry from Gaussian. # # Partion functions are evaluated from vibrational frequencies # # and rotational temperatures from the standa...
0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.0924962, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic'...
""""" GBDX Notebook: "Identifying Destroyed Buildings with Multispectral Imagery" Link: https://notebooks.geobigdata.io/hub/notebooks/5b47cfb82486966ea89b75fd?tab=code Author: <NAME> Date created: 7/5/2018 Date last modified: 7/13/2018 Python Version: 2.7.15 """ import cPickle import folium from functools impor...
is rejected. """ mock_check_for_resource_operations.return_value = False response = self.authenticated_regular_client.delete(self.url_for_workspace_resource) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) mock_delete_file.delay.assert_not_called() # check that the resource still exists Resourc...
import fnmatch import os from collections import OrderedDict, defaultdict from conans.client.conanfile.configure import run_configure_method from conans.client.generators.text import TXTGenerator from conans.client.graph.build_mode import BuildMode from conans.client.graph.graph import BINARY_BUILD, Node, CONTEXT_HOST...
<gh_stars>100-1000 #!/usr/bin/env python3 """Downloader of sample audio data Configuration are in the directory downloder_conf. Usage: download_speech_corpus.py <config> [-h] [-q] [-f] [-m] Parameters: <config> The path of configuration file -h, --help Show this help and exit -q, --quiet Don't show any messages...
de Pedras - RN', 'pt': 'Lagoa de Pedras - RN'}, '55843693':{'en': 'Touros - RN', 'pt': 'Touros - RN'}, '55843694':{'en': 'Monte das Gameleiras - RN', 'pt': 'Monte das Gameleiras - RN'}, '55843695':{'en': 'Lagoa de Velhos - RN', 'pt': 'Lagoa de Velhos - RN'}, '55843696':{'en': u('Cai\u00e7ara do Norte - RN'), 'pt': ...
# 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 (the # "License"); you may not use...
import copy import os import torch import torchvision import warnings import math import utils.misc import numpy as np import os.path as osp import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import models.modified_resnet_cifar as modified_resnet_cifar import models.modified_resnetmtl_cif...
#!/usr/bin/env python # Copyright (c) 2019 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ Summary of useful helper functions for scenarios """ import math import shapely.geometry import shapely.affinity import numpy as np ...
0, 'gaslimit': 0, } gas = 1000000 new_vm = evm.EVM(constraints, address, data, caller, value, bytecode, gas=gas, world=world) new_vm._push(0) new_vm._push(16) last_exception, last_returned = self._execute(new_vm) self.assertEqual(last_exception, None) self.assertEqual(new_vm.pc, 1) self.assertEqual(new_vm.st...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
'and' and 'word-separator' are used as separator between the last two arguments. If more than two arguments are given, other arguments are joined using MediaWiki message 'comma-separator'. :param args: text to be expanded """ needed_mw_messages = ('and', 'comma-separator', 'word-separator') if not args: return...
######################################################################## # # Date: 2014 Authors: <NAME> # # <EMAIL> # # The Scripps Research Institute (TSRI) # Molecular Graphics Lab # La Jolla, CA 92037, USA # # Copyright: <NAME> and TSRI # ######################################################################### # # ...
data_transfer_template_for_random_access_buffers_file.read() data_transfer_template_for_random_access_buffers_file.close() data_transfer_template_for_continuous_access_buffers_file = open( 'non_chunked_data_transfer_template_for_continuous_access_buffers.h', 'r') data_transfer_template_for_continuous_access_buffer...
# ECOR 1051 Milestone 3 P8: Final Filter Function Code # Team 109 # Date of Submission: April 2, 2020 # Team Members: # <NAME> 101143478 (Team Leader) # <NAME> 101148917 # <NAME> 101150112 from Cimpl import * from simple_Cimpl_filters import grayscale #Red Filter Function def red_channel(image: Image) -> Image: ...
"""This file is part of DeepLens which is released under MIT License and is copyrighted by the University of Chicago. This project is developed by the database group (chidata). tiered_videoio.py uses opencv (cv2) to read and write files to disk. It contains primitives to encode and decode archived and regular video f...
Extract data dfs = {} for cruise_name in cruise_files.keys(): print('Extracting: ', cruise_name, cruise_files[cruise_name]) # cruise_name = cruise_files.keys()[0] df = pd.read_excel(folder+cruise_files[cruise_name]) names_dict = { 'Date': 'date', 'UTC': 'date', 'time (UTC)': 'time', 'lat': 'LAT', 'lon': 'LON' ...
<filename>phy/plot/interact.py # -*- coding: utf-8 -*- """Common layouts.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import logging import numpy as np from phylib.utils import emit from...
<reponame>RobertoRoos/ingenialink-python import time import threading import canopen import struct import xml.etree.ElementTree as ET from .._utils import * from .constants import * from ..servo import SERVO_STATE from .._ingenialink import ffi, lib from .dictionary import DictionaryCANOpen from .registers import Regi...
v = max(abs(max_stress), abs(min_stress)) if abs(v) < 1e-5: v = 1e-5 scaling_factor = abs(1./v) scaling_factors.append(scaling_factor) ax3.set_xlim(min_x, max_x) if plot_over_time: ax3.set_xlabel('t') margin = abs(max_value - min_value) * 0.1 ax3.set_ylim(min_value - margin, max_value + margin) ax3.set_yl...
c.config and c.config.create_nonexistent_directories else: create = (g.app and g.app.config and g.app.config.create_nonexistent_directories) if c: theDir = g.os_path_expandExpression(theDir, c=c) dir1 = theDir = g.os_path_normpath(theDir) ok = g.os_path_isdir(dir1) and g.os_path_exists(dir1) if ok: return ok i...
product_mapping=[]; product_mapping = self.reactionMapping['products_metaboliteMappings'][product_cnt].convert_stringMapping2ArrayMapping(); # check that the product positions == product elements if len(self.reactionMapping['products_positions_tracked'][product_cnt])!=len(self.reactionMapping['products_elements_trac...
import re import os import math import google import requests import pickle from hashlib import sha512 from dateutil.parser import parse from entities.acurerate_attributes import P, C, T from urllib.parse import urlparse from string import ascii_letters # Go to Settings - get package google.cloud.translate, google.c...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: <NAME> # @Date: 2018-02-02 14:06:34 import datetime import json import logging import math import random import time import numpy as np import scipy.stats as st from dateutil import parser import iblrig.ambient_sensor as ambient_sensor import iblrig.bonsai as b...
= 'direct', xray_structure = xrs).f_calc() return get_map_from_map_coeffs(map_coeffs=weight_f_array, crystal_symmetry=crystal_symmetry) def get_bounds_for_helical_symmetry(params, box=None,crystal_symmetry=None): original_cell=box.map_data.all() new_cell=box.map_box.all() z_first=box.gridding_first[2] z_last=...
#!/usr/bin/python # -*- coding: ascii -*- # # Copyright and User License # ~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright <EMAIL> for the # European Organization for Nuclear Research (CERN) # # Please consult the flair documentation for the license # # DISCLAIMER # ~~~~~~~~~~ # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" #...
<filename>UnoInsp/src/unoinsp.py #!/opt/libreoffice5.2/program/python # -*- coding: utf-8 -*- import gettext import os import sys if sys.platform.startswith('win'): # Windowsの場合。 import locale if os.getenv('LANG') is None: # 環境変数LANGがない場合 lang, enc = locale.getdefaultlocale() # これで日本語の場合('ja_JP', 'cp932')が返る。 os.en...
<filename>ai4water/postprocessing/SeqMetrics/_regression.py<gh_stars>10-100 import warnings from math import sqrt from typing import Union from scipy.stats import gmean, kendalltau import numpy as np from .utils import _geometric_mean, _mean_tweedie_deviance, _foo, list_subclass_methods from ._SeqMetrics import Metr...
import os import re import redis import pickle import zlib import warnings import pygsheets import pandas as pd from copy import deepcopy from django.conf import settings from rest_framework import status # Global module variables REDIS_EXPIRATION_TIME = os.getenv('MEDICINE_REDIS_EXPIRATION') or 3600 REDIS_HOSTNAME =...
#!/usr/bin/python import socket import time import picamera import threading #should probably change threads to processes. Sometime. import multiprocessing #using processes instead of threads for frame advance. import filmCap from time import sleep import RPi.GPIO as GPIO from filmCap import config from filmCap import ...
<reponame>qobi/amazing-race from __future__ import print_function import pickle import tf import cv2 import os import numpy as np import math import sys import scipy import argparse from mpl_toolkits.mplot3d import Axes3D import time from scipy.optimize import linear_sum_assignment import matplotlib matplotlib.use('A...
# # Copyright <NAME> 2009 # """ Code that counts the number of sequences for which a gapped PWM has at least one site in (using varying thresholds). """ import logging, sys, pylab as P, numpy as N, hmm, hmm.pssm.logo as L, infpy.roc as roc, cPickle from optparse import OptionParser from hmm.pssm import seq_to_numpy,...
<gh_stars>1000+ import abc import copy import datetime import json from dataclasses import dataclass, field from io import BytesIO from typing import Any, Dict, Optional, Tuple, Union import ijson import requests import requests.exceptions from anchore_engine.clients.grype_wrapper import GrypeWrapperSingleton from an...
compatibility. """ if out: return OpTreeNode.build("assign", out, self.T) return self.T def __add__ (self, other): return OpTreeNode.build("add", self, other) def __sub__ (self, other): return OpTreeNode.build("sub", self, other) def __mul__ (self, other): return OpTreeNode.build("mul", self, other) def __div_...
<reponame>geransmith/axonius_api_client # -*- coding: utf-8 -*- """API models for working with device and user assets.""" import copy import sys from ...constants import (DEFAULT_PATH, FIELD_JOINER, FIELD_TRIM_LEN, FIELD_TRIM_STR, SCHEMAS_CUSTOM) from ...exceptions import ApiError from ...tools import (calc_percent, ...
<filename>metalibm-master/metalibm_core/targets/intel/x86_processor.py # -*- coding: utf-8 -*- ############################################################################### # This file is part of metalibm (https://github.com/kalray/metalibm) ###########################################################################...
<reponame>Lachimax/FRB<gh_stars>0 """ Module for an FRB event """ import inspect from pkg_resources import resource_filename import os import glob import copy import numpy as np import pandas as pd from astropy.coordinates import SkyCoord from astropy import units from linetools import utils as ltu from frb impor...
Care,1970-01-01 16:25:00,5.85,323.0,4.78 4469,5,474.0,745,Adult Care,1970-01-01 16:25:00,0.64,103.0,1.52 4470,6,28396.0,746,Work and Education,1970-01-01 16:26:00,38.5,2439.0,36.09 4471,10,24402.0,746,Leisure,1970-01-01 16:26:00,33.08,2285.0,33.81 4472,3,8572.0,746,Housework,1970-01-01 16:26:00,11.62,880.0,13.02 4...
#! /usr/bin/env python # Copyright (c) 2019 Uber Technologies, Inc. # # 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 appli...
stage = 4, block = 'a', trainable = True ) x4 = identity_block_2D( x4, 3, [128, 128, 256], stage = 4, block = 'b', trainable = True ) x4 = identity_block_2D( x4, 3, [128, 128, 256], stage = 4, block = 'c', trainable = True ) # =============================================== # Convolution Section 5 # =========...
<filename>stemdl/inputs.py """ Created on 10/8/17. @author: <NAME>. email: <EMAIL> """ import tensorflow as tf import numpy as np import sys import os from itertools import chain, cycle from tensorflow.python.ops import data_flow_ops import horovod.tensorflow as hvd import lmdb import time from mpi4py import MPI glob...
-self.__data def __abs__(self): return abs(self.__data) def __mul__(self, other): if isinstance(other, Scalar): return self.__data * other.__data else: return self.__data * other # Hope that other defines multiplication with a simple scalar numeric def __add__(self, other): if isinstance(other, Scalar): re...
(""'vacation corrections', 7) , (""'remaining vacation', 8) , (""'additional_submitted', 9) , (""'flexi_time', 10) , (""'flexi_sub', 11) , (""'flexi_max', 12) , (""'flexi_rem', 13) , (""'special_leave', 14) , (""'special_sub', 15) ) header_classes = \ { 'remaining vacation' : 'emphasized' } def __init__ (...
= re.match("\"(.*)\"", label).group(1) # remove quotation marks # if label not in labelsToClusterId.keys(): # labelsToClusterId[label] = len(labelsToClusterId) + 1 if label == "Utilities": selectedVariables.append(varId) hiddenVarIds.append(1) elif label == "Information Technology": selectedVariables.append(va...
#!/usr/bin/env python from __future__ import print_function from future.standard_library import install_aliases install_aliases() from urllib.parse import urlparse, urlencode from urllib.request import urlopen, Request from urllib.error import HTTPError import json import os from flask import Flask from flask impor...
CompressionType=None, Guid=None, GuidHdrLen=None, GuidAttr=[], Ui=None, Ver=None, InputAlign=[], BuildNumber=None, DummyFile=None, IsMakefile=False): Cmd = ["GenSec"] if Type: Cmd += ("-s", Type) if CompressionType: Cmd += ("-c", CompressionType) if Guid: Cmd += ("-g", Guid) if DummyFile: Cmd += ("-...
8, 10], "3": [2, 4, 5, 7, 9], "5": [3, 4, 5, 9, 10], "7": [1, 5, 6, 7, 9], } idx_kov = {key: np.array(val) for key, val in idx_kov.items()} idx_vig = {key: np.setdiff1d(np.arange(1, 11), np.array(val), assume_unique=True) for key, val in idx_kov.items()} abi_kov, abi_vig = [ pd.concat( [abi_raw.loc[:, key].ilo...
import tensorflow as tf from tensorflow.keras.losses import ( sparse_categorical_crossentropy, binary_crossentropy, ) import logging from logging import handlers from time import perf_counter import os import numpy as np import pandas as pd from xml.etree.ElementTree import SubElement from xml.etree import ElementTre...
# # soaplib - Copyright (C) Soaplib contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This l...
# coding=utf-8 # Author: Hongzhong # 2017-12-28 11:43$id from __future__ import print_function from lru import LRU from intervaltree import IntervalTree from .minute_bars import BcolzMinuteBarWriter, BcolzMinuteBarMetadata, BcolzMinuteWriterColumnMismatch, BcolzMinuteBarReader from .minute_bars import OHLC_RAT...
import math import os import sys import cv2 from PIL import Image from PyQt5.QtGui import QPixmap, QImage, QPainter, QPen, QColor from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel, QVBoxLayout, QHBoxLayout, QFileDialog, \ QGridLayout, QLineEdit, QRadioButton, QMessageBox, QInputDialog ...
from Ciphey.ciphey.languageCheckerMod.chisquared import chiSquared import unittest from loguru import logger logger.remove() class testChi(unittest.TestCase): def test_chi_english_yes(self): """Checks to see if it returns True (it should)""" self.chi = chiSquared() """ Tests to see whether a sentene is classif...
corresponding to enumerator', self.filename, deftok.span) return Enum(typename, enumerators, default), name def enumerator_list(self): enumerators = [] value = 0 while True: if self.get().kind not in (MetaTokenKind.NAME, MetaTokenKind.NUMBER, MetaTokenKind.NUMNAME): break name = self.cur.string if self.ge...
#!/usr/bin/python """ A Python Tk application to edit Jamf computer records. """ # -*- coding: utf-8 -*- # Copyright (c) 2018 University of Utah Student Computing Labs. ################ # All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and ...
""" multivariative simplicial weighted interpolation and extrapolation. This is an implementation of four different interpolation and extrapolation technics. F_w - is for average weighted interpolation, also called baricentric. It is a global scheme. F_b - is a baricentric weighted simplicial interpolation. It is lo...
def summary_mask(anat_data, mask_data): """Will calculate the three values (mean, stdev, and size) and return them as a tuple. :type anat_data: NumPy array :param anat_data: The anatomical scan data. :type mask_data: NumPy array :param mask_data: The binary mask to mask the anatomical data with. :rtype: tuple ...
import os,sys,subprocess,shutil,time,traceback,fileinput import yaml g_dbg = '-dbg' in sys.argv or False g_dbgexec = g_dbg or ('-dbgexec' in sys.argv or False) try: import mako.template as mako_temp except ImportError: mako_temp = None pass k_vt_col_map = { '':'\x1b[0m', 'default':'\x1b[0m', 'black':'\x1b[30m', 'r...
= c_void_p isl.isl_union_map_intersect_params.argtypes = [c_void_p, c_void_p] isl.isl_union_map_intersect_range.restype = c_void_p isl.isl_union_map_intersect_range.argtypes = [c_void_p, c_void_p] isl.isl_union_map_is_bijective.restype = c_bool isl.isl_union_map_is_bijective.argtypes = [c_void_p] isl.isl_union_map_is_e...