text
stringlengths
6.04k
39.5k
#!/usr/bin/env python3 # # Copyright (c) 2013,<NAME> <<EMAIL>> # # This program 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...
# # Generate layers of a ukulele # import math from laser import trig from laser.util import * # dimensions scale=348 anchor_height=10 nut_height=5 nut_width=34 curve_height=100 body_height = scale/2 + 50 # body 'starts' at 12th fret (and its height includes the heel) twelfth=43 body_wing=53.5 heel_width=8 saddle=60...
#! /usr/bin/env python # coding: utf-8 from datetime import datetime, date from ._db import SimpleDB __author__ = '鹛桑够' def merge_where(where_value=None, where_is_none=None, where_cond=None, where_cond_args=None, prefix_value=None): args = [] if where_cond is None: where_cond = list() else: ...
""" This module reads a Polyspace options file (that was generated by watching a build) and generated CMakeLists.txt files for each directory in the target repository. """ import os import re from typing import Dict, List, Set, FrozenSet from collections import defaultdict from dicttoxml import dicttoxml from xml.dom.m...
########################################################################################## ## This script demonstrates how to do pooled impala calibration of PTW ## using SHPB/quasistatic data. ########################################################################################## import numpy as np from impala imp...
import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' # '3,2' #'3,2,1,0' from data_util import * # from unet_5_scale_more_aug.model import SaltNet as Net # from resnet34.model_resnet34_bn import SaltNet as Net from seresnet50.model_se_resnext50_bn import SeResNeXt50Unet as Net # from resnet_aug0.model import...
"""amazon module is a jungle containing different plants and creatures, for instance the boa which is a reptile like the turtle, however it may not moved around freely and can be constricted, hence boa constrictor""" import turtle from random import shuffle, randrange from math import radians, cos, sin def even(numbe...
# Copyright (c) 2010, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the foll...
from functools import partial from itertools import repeat from typing import Any, Dict, Iterator, List, Tuple import h5py import hdf5plugin from numpy import ndarray from .openpose import POSE_CLASSES from .pose import DumpReaderPoseBundle, UntrackedDumpReaderPoseBundle from .sparsepose import SparsePose, create_csr...
import torch import torch.nn as nn from mani_skill_learn.utils.data import dict_to_seq from mani_skill_learn.utils.torch import masked_average, masked_max from ..builder import BACKBONES, build_backbone from .point_transformer_utils import index_points, square_distance, PointNetSetAbstraction import torch.nn.function...
import tornado import logging import signal import socket import time import errno import coloredlogs import ctypes as C from datetime import datetime from threading import Thread, Event from optparse import OptionParser from katcp import AsyncDeviceServer, Sensor, ProtocolFlags from katcp.kattypes import (Int, request...
# -*- coding: utf-8 -*- """ Created on Mon Feb 1 20:34:30 2021 @author: AVALON """ import datetime import time import logging #from typing import Tuple, Dict, Any from telegram import (#ReplyKeyboardMarkup, #KeyboardButton, #ForceReply, ...
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: pirates.world.SectionAreaBuilder import random, re, types from pandac.PandaModules import * from direct.task.Task import Task from direc...
"""Module for encoding and decoding length delimited fields""" # Copyright (c) 2018-2022 NCC Group Plc # # 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 withou...
# # TODO: BIG DISCLAIMER -- The trace visualization / window does *not* make # use of the MVC pattern that the other widgets do. # # this is mainly due to the fact that it was prototyped last, and I haven't # gotten around to moving the 'logic' out of window/widget classes and into # a dedicated controller class. # # ...
import torch def convert_edvr(): ori_net = torch.load('experiments/pretrained_models/EDVR_REDS_SR_M.pth') crt_net = torch.load('xxx/net_g_8.pth') save_path = './edvr_medium_x4_reds_sr_official.pth' # for k, v in ori_net.items(): # print(k) # print('*****') # for k, v in crt_net.items...
import os import http import json import functools from urllib import parse import furl from waterbutler.core import path from waterbutler.core import streams from waterbutler.core import provider from waterbutler.core import exceptions from waterbutler.providers.googledrive import settings from waterbutler.provider...
import os import sys file_dir = os.path.dirname(os.path.abspath(__file__)) tools_dir_path = os.path.dirname(file_dir) sys.path.insert(0, tools_dir_path) from tools import ProgressIterator, DataML, random_set, get_y, add_constant, second_order_nic, minimize_error_aug, svm, allexcept, a_vs_b, weight_error, classified_e...
# Copyright (c) 2010, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the foll...
""" UI for scheduling and playout of clock chimes stored as .mp3 files Manage a church or other electronic carillon to playout .mp3 files of user-provided songs, peals, tolls, and hourly strikes at scheduled system time(s). Requires Python3 but no desktop environment. Creates a text based user interface between stdin...
# -*- coding: utf-8 -*- """ Created on Thu Sep 24 09:24:31 2020 @author: Amirh """ from ..utils._base_feature_selector import BaseFeatureSelector from ..functions import ff import numpy as np import random from sklearn.base import clone import time from scipy.stats import iqr class _AntColony(): def __init_...
import os import sys import json import datetime import numpy as np import skimage.io from imgaug import augmenters as iaa import matplotlib.pyplot as plt import matplotlib.patches as patches import time import concurrent.futures # Root directory of the project ROOT_DIR = os.getcwd() if ROOT_DIR.endswith("samples/pla...
import json import copy from datetime import datetime from lightwood.api import dtype import pandas as pd import numpy as np from mindsdb.api.mysql.mysql_proxy.datahub.datanodes.datanode import DataNode from mindsdb.api.mysql.mysql_proxy.utilities.sql import query_df from mindsdb.integrations.clickhouse.clickhouse im...
################################################################################ # This module aggregates the all psycho-linguistic measures into one matrix by # each 'AC_Doc_ID (item stem or option). # Parameters df_ac_pos: input pandas.DataFrame, it should have, at least, POS # count columns w...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications Copyright 2017 <NAME> # # 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/LICE...
import os import pickle import shap import logging import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd import lightgbm as lgb # from pub_class import * from scipy import stats from scipy.stats import levene from scipy.stats import ttest_ind from datetime import ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 16 14:31:21 2020 @author: lorenz """ import utils.DataHelpers as dh import utils.RotationCalculus as rc import numpy as np def toStackedTransformmatrix(quat, pos): nSamp = quat.shape[1] return np.block( [ [ 2*quat[0,:]**2 + 2*quat...
# -*- coding: utf-8; -*- # # Copyright (c) 2016 <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, including without limitation the rights # to use, copy, modify, m...
""" mapAveraging.py Superimpose and average maps using atom models as guide. This code use maps in mrc format This code uses ChimeraX for superimposing. Copyright [2013] EMBL - European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in complian...
from subprocess import call # import socks # import socket # socks.setdefaultproxy(proxy_type=socks.PROXY_TYPE_SOCKS5, addr="127.0.0.1", port=9050) # socket.socket = socks.socksocket import requests import urllib.request from bs4 import BeautifulSoup import json import re import os import time from time import...
import os import numpy as np from keras.utils import Sequence from datasets import UT, SBU, NTU, NTU_V2, YMJA from misc.data_io import get_data class DataGenerator(Sequence): def __init__(self, dataset_name, dataset_fold, subset, batch_size=32, reshuffle=False, shuffle_indiv_order=False, ...
import warnings warnings.simplefilter('default') import gc import numpy as np import pandas as pd from tqdm.notebook import tqdm from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import mean_squared_error from sklearn.model_selection import GroupKFold,KFold import joblib import torch import torch...
''' Capstone Project - <NAME> Traffic Light Classifier ''' import random import numpy as np import tensorflow as tf import os import scipy.ndimage import scipy.misc default_graph_path = './tensor/linux_tensor0.999' ######################################################################################...
import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry import logging import concurrent.futures from typing import List, Dict, Tuple import time import datetime import json import configparser logger = logging.getLogger(__name__) config = configparser.ConfigP...
from .utils import PyKEArgumentHelpFormatter import numpy as np from astropy.io import fits as pyfits from matplotlib import pyplot as plt from . import kepfunc from . import kepio from . import kepmsg from . import kepkey from . import kepfit from . import kepstat __all__ = ['kepdetrend'] def kepdetrend(infile, ra...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # ############################################################################## # # Based on: # Copyright (c) 2017-present, Faceb...
import numpy as np import os import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.optim.lr_scheduler import StepLR from torch.utils.data import DataLoader import torchvision.models as models from torchvision import transforms from tensorboardX import SummaryWriter ...
""" saddle_node_maps.py Implements the N to 1 map from ramp system saddles to hill system saddles for positive cyclic feedback systems. To do: implement the map for networks which are not cyclic feedback networks. Author: <NAME> TO DO: fix _get_x_jk. """ from scipy.optimize import bisect import numpy as np ...
import re from PyPoE.poe.file.stat_filters import StatFilterFile from PyPoE.poe.sim.formula import GemTypes, gem_stat_requirement from RePoE.parser.constants import CooldownBypassType from RePoE.parser.util import ( call_with_default_args, write_json, get_release_state, ignore_mod_domain, get_stat_...
"""High-level API for saving/loading responses from FE simulation.""" from __future__ import annotations from datetime import datetime from typing import List, Optional, Tuple import bridge_sim import numpy as np import pandas as pd from bridge_sim import temperature, util, creep from bridge_sim.crack import CrackDe...
#!/bin/python2 import commands import fcntl import json import random import re import socket import struct import urllib2 as urllib from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from SocketServer import ThreadingMixIn from cv2 import imshow, namedWindow, setWindowProperty from datetime import timedelta...
import logging import uuid from core.services.base import TradeRemediesApiView, ResponseSuccess from core.services.exceptions import InvalidRequestParams, NotFoundApiExceptions from django.utils import timezone, crypto from django.db import transaction from rest_framework import status from invitations.models import In...
'''Bitecodes - dynamic modification of python bytecode ''' import builtins as _builtins import ctypes import dis import enum from collections import namedtuple from collections.abc import Mapping from copy import copy as _copy, deepcopy as _deepcopy from functools import lru_cache, reduce from keyword import iskeywo...
# <pep8-80 compliant> # ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # ...
import io import os import re from collections import defaultdict from functools import reduce from logging import getLogger from typing import Dict, Sequence, Any import operator import pandas from ordered_set import OrderedSet from pandas import DataFrame from rpy2 import robjects # from rpy2.rinterface_lib.embedded...
# Copyright 2020 The SODA Authors. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2018 Pico Technology Ltd. See LICENSE file for terms. # Copyright (C) 2021-2022 <NAME> # # PS2000A BLOCK MODE to retrieve data from four channels with a trigger. from ctypes import c_int16, c_int32, c_float, byref, POINTER from picosdk.ps2000a import ps2000a...
import numpy as np from yt.funcs import mylog MY_DTYPE = np.float32 # Field name aliases particle_data_aliases = { 'pos':'particle_position', 'vel':'particle_velocity', 'pot':'Potential', 'rho':'density', 'hsml':'smoothing_length', 'sfr':'StarFormationRate', 'mass':'particle_mass', 'u'...
""" Intersection over union (IoU) utilities. | Copyright 2017-2022, Voxel51, Inc. | `voxel51.com <https://voxel51.com/>`_ | """ import contextlib import logging import numpy as np import eta.core.numutils as etan import eta.core.utils as etau import fiftyone.core.labels as fol import fiftyone.core.utils as fou impo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun May 12 16:42:19 2019 @author: smahanam """ ############### # Load modules ############### from netCDF4 import Dataset, stringtochar import numpy as np import csv import os import datetime import matplotlib.pyplot as plt from matplotlib.backends.backend...
import ee import requests import numpy as np import cmocean from rasterio.plot import show_hist, show import pandas as pd from sklearn import metrics import matplotlib.colors import matplotlib.pyplot as plt DW_CLASS_LIST = ['water','trees','grass','flooded_vegetation','crops','scrub','built_area','bare_ground','snow...
# Copyright(c) 2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the followi...
""" Created: 2020-07-15 Author: <NAME> """ from collections.abc import Iterable from pycqed.analysis import fitting_models as fit_mods from pycqed.analysis import measurement_analysis as ma import pycqed.measurement.hdf5_data as hd5 import lmfit import numpy as np import logging # Filter and optimization tools import...
from abc import ABCMeta, abstractmethod import logging import numpy as np from collections import OrderedDict, namedtuple from gtd.log import indent from wge.miniwob.action import MiniWoBTerminate from wge.rl import Policy, Justification from wge.miniwob.labeled_demonstration import WeightedProgram from wge.miniwob.p...
import pandas as pd import numpy as np import glob as glob import seaborn as sns import matplotlib.pyplot as plt def filter_TDP(data_frame, thresh = 0.3): """[optional function that removes molecules that do not transition below threshold at some point] Args: data_frame ([dataframe]): [dataframe that ...
#!/usr/bin/env python u""" mar_smb_cumulative.py Written by <NAME> (11/2019) Calculates cumulative anomalies of MAR surface mass balance products COMMAND LINE OPTIONS: --help: list the command line options --directory=X: set the full path to the MAR data directory --version=X: MAR version to run v3...
# @copyright@ # Copyright (c) 2006 - 2019 Teradata # All rights reserved. Stacki(r) v5.x stacki.com # https://github.com/Teradata/stacki/blob/master/LICENSE.txt # @copyright@ # # @rocks@ # Copyright (c) 2000 - 2010 The Regents of the University of California # All rights reserved. Rocks(r) v5.4 www.rocksclusters.org # ...
# -*- coding: utf-8 -*- import time from enum import IntEnum from PyQt5.QtCore import Qt, QTimer from PyQt5.QtWidgets import (QGridLayout, QDialog, QVBoxLayout, QCheckBox, QTabWidget, QWidget, QLabel, QSpinBox, QLineEdit, QTreeWidget, QTreeWidgetItem, QMenu, Q...
import numpy as np import pandas as pd import pickle as pkl import matplotlib.pyplot as plt import os from scipy.linalg import expm, sinm, cosm import sys sys.path.append(r'C:\Users\elira\Google Drive\butools2\Python') from butools.ph import * from butools.map import * from butools.queues import * from butools.mam imp...
# -*- coding: utf-8 -*- from uiautomator import Device import time import os from adb import ADB from logger import Logger from ConfigReader import ConfigReader def skip_text_guide(d, step): # 跳过文字引导 点击任意位置跳过 x = config.getdic('text_guide')['touch_x'] y = config.getdic('text_guide')['touch_y'] mylogger.i...
import warnings import numpy as np import statsmodels.formula.api as smf from scipy.special import kv from scipy.optimize import curve_fit, minimize, minimize_scalar, root_scalar import math from ecogdata.channel_map import ChannelMap from .variogram import cxx_to_pairs, concat_bins, binned_variance __all__ = ['mat...
from collections import namedtuple, defaultdict from typing import List, Dict, NamedTuple, Set, Union, Optional from abc import abstractmethod import itertools from .pylse_exceptions import PylseError from .core import Element class NormalizedTransition(NamedTuple): id: str source: str destination: str ...
import csv, time, copy, sys distributors = [ { 'name' : 'Digi-Key', 'min_order' : 33.00, 'shipping_before_min' : 12.00, 'shipping_after_min': 0.00, 'mult_import_tax' : 1.0, 'csv_columns' : ['SKU', 'OrderQty', 'RefDesList'], 'csv_column_names' : ['SKU', 'Quantity', 'Descriptio...
#!/usr/bin/env python # -*- coding:utf-8 -*- # # Copyright (c) 2013-present SMHI, Swedish Meteorological and Hydrological Institute # License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit). import time import json from django.http import HttpResponse,HttpResponseRedirect from django.t...
# -*- coding: utf-8 -*- """ Created on Mon Jun 3 12:10:04 2019 @author: sangupta Blog Post --> https://medium.com/lifeandtech/executable-gui-with-python-fc79562a5558 File --> https://drive.google.com/file/d/153pW74-0sXQcdai4AuyXI8Oas8gRfMOA/view """ try: import Tkinter as tk import tkMessageBox as tkm im...
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt ''' <NAME>, 2015 After running PHOT in IRAF, this program does differential photometry! INPUT: A TXDUMP-ed text file created from a set of IRAF PHOT outfiles. You should run TXDUMP with these extracted fields on *.mag.1 (or *.ma...
import sys import os sys.path.append(os.path.abspath(".")) sys.dont_write_bytecode = True __author__ = "COSAL" from utils import cache from mos.search.tree.java_utils.java_tree_formatter import pprint from mos.search.tree.common import Node as N, TYPES, OPERATORS, MODE, LITERAL from analysis.parsers import parser ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import warnings import numpy as np class OptimizeBlackDots(): """Optimization of position of black dots Class with functions for modifying the positions of black dots for PFS spectrograph """ def __init__(self, dots, list_of_mcs_data_all, list_of_d...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
from __future__ import annotations import re from dataclasses import dataclass, field, replace from typing import Optional, TypeVar, Type, Callable, NamedTuple, Iterable, TYPE_CHECKING, Union, Mapping from Cat.CatPythonGUI.GUI.codeEditor import AutoCompletionTree, buildSimpleAutoCompletionTree, choicesFromAutoCompleti...
import unittest from pyredis.exceptions import RedisError from pyredis.zset import ZSet from pyredis.hash import Hash from pyredis.set import Set from pyredis.list import List class ZSetTestCase(unittest.TestCase): def test_zadd(self): zset = ZSet() zset.zadd(a=5, b=3, c=1) self.assertEqua...
from datetime import datetime from pathlib import Path import torch import torch.nn.functional as F from accelerate import Accelerator from torch import optim from torch.utils.data import DataLoader from synthesizer import audio from synthesizer.models.tacotron import Tacotron from synthesizer.synthesizer_dataset imp...
import os import numpy as np import torch import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap from distributions.symmetric_distributions import RotationDistribution from loggers.plotting.JEM import ClassificationPlotter2Dim, JointEnergy from models.FullyConnected import FCRegularNet, FCCNInva...
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import ImageGrid import matplotlib.gridspec as gridspec from PIL import Image import numpy as np import os import argparse import re import shutil num_rows = 3 def main(): # get dir parser = argparse.Argumen...
## basic GTS-SYNOP observation monitor ## - scan the GTS directories every N minutes ## - make an SQLite database of all available messages ## - basic filtering for empty, corrupted data ## <NAME>, 2018 ## 2019-11-08 ported to python3 #import numpy from eccodes import * import datetime as dt import os import sqlite3 ...
bl_info = { "name": "Portal Level Format", "author": "<NAME>", "blender": (2,6,9), "version": (0,0,1), "location": "File > Import-Export", "description": "Region and Portal data format", "category": "Import-Export" } import bpy; import struct; im...
#!/usr/bin/env python # -*- coding: utf-8 -*- # maybe this module should be broken up into multiple files, or maybe not ... UA = "diffengine/0.2.2 (+https://github.com/docnow/diffengine)" import os import re import sys import json import time import yaml import bleach import codecs import jinja2 import shutil import...
#We have a data which classified if patients have heart disease or #not according to features in it. We will try to use this data to #create a model which tries predict if a patient has this disease #or not. We will model our data on different algorithm and we will #the model that gives the best accuracy! # for ba...
''' Prune lib fir general prepose Copyright (c) <NAME>, 2019 ''' import torch import torch.nn import numpy as np # Varies for different model # mapping the name of conv to its corresponding bn def mapping(conv_name): try: return conv_name[:-1] + str(int(conv_name[-1])+1) except ValueError: re...
""" macApp A macOS .app information retriever\n © <NAME> — 2020 """ from . import utils class NotAnApp(Exception): """ When the given path is not an app """ def __init__(self, message): super().__init__(message) class AppNameNotFound(Exception): """ When the app name is not found in t...
# -*- coding: utf-8 -*- """ last mod 6/3/19 sample form: x center, y center, angle, len, wid, speed, flattened 6x6 cov of all prepped sample: mean state w/o speed cov state w/o speed (H mtx implicitly [I 0]) msmt form: mean and cov of observables [x,y,a,l,w] prepped msmt: mean and cov of observa...
""" BUILD_FEATURES Module --------------------- @author : Stratoshad This module contains function that relate to data pre-processing or aggregation. """ from tqdm import tqdm import pandas as pd import numpy as np from datetime import datetime import warnings def process_cancellations(df, limit_rows=None): "...
import math import numpy as np from utils import * import tensorflow as tf import tensorflow.contrib.slim as slim import tensorflow.contrib as tf_contrib weight_init = tf.random_normal_initializer(mean=0.0, stddev=0.02) weight_regularizer = tf_contrib.layers.l2_regularizer(scale=0.0001) ####################...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # file from https://github.com/Nircek/resistorer # licensed under MIT license ''' MIT License Copyright (c) 2018-2019 Nircek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software")...
from __future__ import division import progressreporter import numpy as np from collections import defaultdict import json import itertools from sklearn import cluster, preprocessing, manifold, decomposition from sklearn.metrics.pairwise import euclidean_distances from scipy.spatial import distance from datetime import...
import os import subprocess import pandas as pd import time import numpy as np from typing import List, Union, Tuple import re import itertools from shutil import copyfile import csv from remote_que.logger import logger from remote_que.config import QUE_FILE_HEADER, QUE_FILE_HEADER_TYPE from remote_que.config import D...
''' Like the Python typing module, this library provides type classes for type hinting. The following type classes are provided. - polyphony.typing.bit - polyphony.typing.int<n> - polyphony.typing.uint<n> - polyphony.typing.List[T] - polyphony.typing.List[T][C] ※C indicates the capacity of the lis...
#!/usr/bin/env python3 from pyswagger import App, Security, spec from pyswagger.contrib.client.requests import Client from urllib.parse import urlparse, urlunparse, urlsplit, urlunsplit import json import sys import traceback import logging import multilevelcli import re log = None classes = {} instances = {} namespa...
''' An RMI framework for synapse. ''' import time import zlib import logging import threading import collections import synapse.glob as s_glob import synapse.link as s_link import synapse.synasync as s_async import synapse.common as s_common import synapse.dyndeps as s_dyndeps import synapse.eventbus as s_eventbus im...
#!/usr/bin/env python3 # Run via flask framework: # pip3 install flask # FLASK_APP=chainview-webserver.py flask run import sys import requests, json import datetime, time import decimal, math import sqlite3 from flask import Flask, url_for, abort, request, redirect from flask import render_template from chainview_con...
#!/usr/bin/python # -*- coding:utf-8 -*- """Utilities for reading parser train.conll, dev.conll files.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals # compatible with python3 unicode from collections import named...
from __future__ import print_function, division from sklearn.svm import OneClassSVM from keras.layers import Input, Dense, Flatten from keras.layers import BatchNormalization, Activation from keras.layers.advanced_activations import LeakyReLU from keras.layers.convolutional import Conv2D, Conv2DTranspose from keras.mo...
# The 6.00 Word Game import random from randomdict import RandomDict import threading import queue import textwrap VOWELS = 'aeiou' CONSONANTS = 'bcdfghjklmnpqrstvwxyz' HAND_SIZE = 7 SCRABBLE_LETTER_VALUES = { 'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8, 'k': 5, 'l': 1, 'm': ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import math from PyQt5 import QtCore, QtGui, QtWidgets, QtPrintSupport from PyQt5.QtCore import Qt import stiefo stiefoHeightPrint = 30 stiefoHeightScreen = 75 zeichneHilfslinien = True text_y_offset = 0.1 * stiefoHeightPrint def render_p...
import os import copy import numpy as np import torch import torch.nn.functional as F import dgl import argparse from gat import GAT from utils import evaluate, collate from utils import get_data_loader, save_checkpoint, load_checkpoint from utils import evaluate_model, test_model, generate_label from auxilary_loss im...
""" Module for bulk-exporting IsisCB data in EBSCO format. The strategy here is to favor extensibility/flexibility in defining output columns, at the expense of performance. The performance hit is probably OK, since these jobs will be performed asynchronously. """ from __future__ import print_function from __future__ ...
#!/usr/bin/python # Copyright (c) 2018, 2019, Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for ...
# -*- coding: utf-8 -*- """binomial_mix. <NAME>: <EMAIL> """ import numpy as np from scipy.special import gammaln, logsumexp from .model_base import ModelBase from .statistics import bic_criterion, entropy_criterion class MixtureBinomialSparseBatch(ModelBase): """Mixture of Binomial Models fitted on Batched Sp...
import cv2 import numpy as np import tensorflow as tf import os import glob import h5py # Get the Image def imread(path): img = cv2.imread(path) return img def imsave(image, path, config): #checkimage(image) # Check the check dir, if not, create one if not os.path.isdir(os.path.join(os.get...
""" Copyright (c) Microsoft Corporation. Licensed under the MIT license This code was based on the file run_cnaps.py (https://github.com/cambridge-mlg/cnaps/blob/master/src/run_cnaps.py) from the cambridge-mlg/cnaps library (https://github.com/cambridge-mlg/cnaps). The original license is included below: Copyright (...