text
stringlengths
3.07k
12.6k
# Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np import pytest from openvino.tools.pot.statistics.function_selector import AGGREGATION_FN, ACTIVATIONS_STATS_FN, WEIGHTS_STATS_FN, \ get_aggregation_function, get_stats_function_for_activations, get_stats_function_...
import torch from tqdm import tqdm from torch.distributions.exponential import Exponential from torch.distributions.categorical import Categorical # Code that implements the LV model from "Sequential Neural Likelihood" (SNL) (https://arxiv.org/abs/1805.07226). # The code is inspired by the code provided in the sup. m...
#!/usr/bin/env python3 import time import json import os from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot from PyQt5.QtWidgets import QApplication from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler from tupelo_utils.shortcodes import _filetype_cor, _file_list_grab,...
import string def filter_words_to_possible_words(words, incorrect_chars, correct_chars, chars_out_of_place): """ Filters the available words. First it finds available words with the provided 'chars_out_of_place' characters such that those characters do not appear in the same location as described by c...
# -*- encoding: utf-8 -*- """ keri.app.configing module """ import os import json import hjson import msgpack import cbor2 as cbor from hio.help import helping from hio.base import filing, doing from .. import help logger = help.ogler.getLogger() def openCF(cls=None, filed=True, **kwa): """ Returns cont...
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with th...
import pycurl from io import BytesIO from crawl_server import logger from urllib.parse import unquote, urljoin import os from html.parser import HTMLParser from itertools import repeat from crawl_server.crawler import RemoteDirectory, File from multiprocessing.pool import ThreadPool import config from dateutil.parser ...
# -*- coding: utf-8 -*- """This submodule contains file format related utility code for Prance.""" __author__ = '<NAME>' __copyright__ = 'Copyright (c) 2016-2018 <NAME>' __license__ = 'MIT +no-false-attribs' __all__ = () class ParseError(ValueError): pass # pragma: nocover def __format_preferences(filename, con...
# -*- coding: utf-8 -*- import os class UninstallEntry: def __init__(self, key): self._key = key self._d = {} def add(self, raw_line): # Line Format # (4space)(ENTRY-NAME)(4space)(TYPE-NAME)(4space)(VALUE) # # * VALUE は存在しない時がある. # * VALUE が 4space を含む可...
import model.block_advanced as B import torch import torch.nn as nn import torch.nn.utils.prune as prune from model import common from model.block_advanced import conv_layer, SRB def make_model(args, parent=False): model = RFDNAdvanced(args) return model def _merge_identity_mask(current_mask, new_mask, devi...
from django.conf import settings from urllib.parse import urljoin, urlparse from civictechprojects.models import Event from civictechprojects.caching.cache import ProjectCache, GroupCache from common.helpers.constants import FrontEndSection from common.helpers.front_end import section_url from common.helpers.redirector...
import PySimpleGUI as sg import os import numpy import Timer # TODO ''' 1. Add in app ability to change habit and timer reward values 2. Subtract an amount from the current balance 3. Fix timer (when closing main window the timer should close too) ''' path = os.getcwd() def calculate_overall_money(file_name, money_...
# encoding=utf8 __author__ = 'wcong' import datetime import logging from twisted.python.failure import Failure import scrapy from ants.utils import log import downloader from ants.utils.extension import ExtensionManager from ants.signalmanager import SignalManager from ants.http import Response, Request from ants imp...
from __future__ import absolute_import from __future__ import unicode_literals import json from django.test import SimpleTestCase from corehq.util.test_utils import generate_cases from corehq.apps.app_manager.models import AdvancedForm, Form, PreloadAction, CaseReferences, CaseSaveReference from corehq.apps.app_manage...
""" CSE101: Introduction to Programming Assignment 3 Name : <NAME> Roll-no : 2019440 """ import math import random def dist(p1, p2): """ Find the euclidean distance between two 2-D points Args: p1: (p1_x, p1_y) p2: (p2_x, p2_y) Returns: Euclidean distance between...
''' Create the bot's content ''' from bot import settings from bot.blacklist import check_blacklist from datetime import datetime import json import random import re import time from urllib.parse import urlencode from urllib.request import Request, urlopen from TwitterAPI import TwitterAPI API = TwitterAPI(settings....
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
# import sys # sys.path.append("/opt/vlab/tener/src/") import numpy as np import tensorflow as tf import tensorflow_addons as tfa from tener.utils import CustomSchedule from tener.models.model_utils import create_masks, get_sequence_length, create_look_ahead_mask, create_padding_mask from tener.models.attention.multi...
import logging import time import numpy as np from gestalt.engine.som import utils LOG = logging.getLogger(__name__) class FeatureMap(object): def __init__(self, width=0, height=0, dimension=0, randomize=False): if randomize: fill_method = np.random.rand else: fill_meth...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import pypinyin import jieba def cut_3(txt, last: str = None, behind: str = None): print(last, txt, behind) cut_list = list(jieba.lcut(txt, cut_all = True)) print(cut_list) length = len(cut_list) # 1,三个字是字是连一起的,无法拆分 if length == 1: return "2"...
from ..typecheck import * from ..import core from . html import div, span, phantom_sizer, element from . layout import Layout from . style import css from . image import view_background_lightness import os import sublime import threading class LayoutComponent (Layout): def __init__(self, item: Union[div, span]) -> ...
from gevent import monkey monkey.patch_all() import collections import gevent from gevent.lock import BoundedSemaphore from gevent import pool import urllib3 urllib3.disable_warnings() import requests from timeit import default_timer from parsel import Selector as _ParselSelector from typing import Callable, Dict...
import cv2 import numpy as np import dlib from facial_landmarks_detection import * print('import Success!!') def generateEyeRegion(landmarks,eyeIndices): """ Input : 68 facial landmark points, Indices of left or right eyes. Output : region covering respective eye, whose indices have been provided. """...
import enum import socket class WaypointMissionState(enum.Enum): """ All the possible state of WaypointMissionOperator. - NOT_SUPPORTED: The connected product does not support waypoint mission. - READY_TO_UPLOAD: The aircraft is ready to upload a mission. - UPLOADING: The uploading is ...
import matplotlib.pyplot as plt import numpy as np from config import * def get_name_dict(): with open('config/data_names.json') as ifs: return eval(''.join(ifs.readlines())) def get_algorithm_name_dict(): with open('config/algorithm_info.json') as ifs: return json.load(ifs)["algorithm_abbr...
""" Fluid Progressive is a special system that allows the implementation of fluid to be as readable as possible, by progressing through the code, adding parents and widgets in the order the code adds them. ie startvertical() addbutton("button1") addbutton("button2") a...
import pafy , vlc , urllib.request , re , inquirer , sys from time import sleep from rich.progress import track, Progress from youtubesearchpython import PlaylistsSearch from os import system from colors import bcolors def isWindows(): if sys.platform == "win32": return True elif sys.platform == "linux...
import numpy as np import tensorflow as tf import h5py from sklearn.preprocessing import OneHotEncoder import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import time import visualizationHelper startTime = time.time() print('==> Experiment 1i') def loadData(filepath): print('==> Loading data fr...
class Node: def __init__(self, name): self.name = name self.left = None self.right = None self.up = None self.down = None self.col = None class Column_Node: def __init__(self, size, name): self.size = size self.name = name self.left = None...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- from io import BytesIO from urllib.request import urlopen from zipfile import ZipFile import jsonschema import platform import hashlib import random import string import shutil import json import yaml import stat import os from tempor import ROOT_DIR, CONFIG_DIR, BIN_DIR,...
""" 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻: Design TomCruise class and DulquerSalman class which inherit from Actor class so that the following code provides the expected output. You can not change any of the given code. Do not modify the given parent class. Note: add_movie() method in both child classes should work for any number of par...
# Thanks to <NAME> for fishtest and consequently this script. # raw.githubusercontent.com/glinscott/fishtest/dfde4103771b8a30ca0b46926566d823c463cfed/fishtest/fishtest/stat_util.py import math def erf(x): # Python 2.7 defines math.erf(), but we need to cater for older versions. a = 8 * (math.pi - 3) / (3 * m...
# Copyright 2015 <NAME>. All rights reserved. import argparse from csv import DictReader import json import time from functools import reduce from email_hunter import EmailHunterClient THROTTLE = 0.2 def reduce_sources(sources): def reducer(value, element): value.append(element['uri']) return va...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #**************************************************************************************************************************************************** # Copyright 2020 NXP # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifi...
import pytest from .fixtures import * @pytest.mark.parametrize(["num_partitions", "rows"], [(7, 30), (3, 125), (27, 36)]) def test_update_table(num_partitions, rows, store): fixtures = UpdateFixtures(rows) original_df = fixtures.make_df() update_df = fixtures.generate_update_values() partition_size =...
""" The training code lifes in this file. First I import all the custom written classes and then I try and train the network on the cats vs dogs dataset """ import numpy as np import matplotlib.pyplot as plt import dill from imports.layer_conv_V3 import Layer_conv from imports.layer_dense import Layer_Dense from im...
#!/usr/bin/env python from __future__ import with_statement import argparse import os import stat import StringIO import sys import urlparse import zipfile from distutils import version as dist_version import yaml import requests USER_AGENT = 'appengine.py' VERSION_URL = 'https://appengine.google.com/api/updateche...
import re from datetime import datetime import json import urllib.parse import os.path from decimal import Decimal DEFAULT_STR_PAD = 16 DEFAULT_KEY_PAD = 16 DEFAULT_CODE_PAD = 12 DEFAULT_NUM_PAD = 12 DEFAULT_INT_PAD = 8 DEFAULT_DECIMALS = 5 DEFAULT_DIRECTION = "right" DEFAULT_SPACES_AFTER = 2 NULL_STR = "null" NULL_NU...
from sklearn.neighbors import KNeighborsRegressor from sklearn.linear_model import Ridge from sklearn.svm import SVR from sklearn.model_selection import cross_val_predict from sklearn.metrics import mean_squared_error from sklearn.metrics import mean_absolute_error from sklearn.preprocessing import scale from math impo...
import os import matplotlib.pyplot as plt import pandas as pd import numpy as np from datetime import datetime from tqdm import tqdm from sklearn.model_selection import train_test_split from tensorflow.keras.preprocessing.image import ImageDataGenerator import preprocessing as pre def load_dataset_from_images(dataset_...
"""@package docstring Provides the web service API. """ import google.appengine.api.memcache import google.appengine.api.users import datetime import simplejson import db import handlers import models class Comment(handlers.Handler): """Provides web service methods that handle requests to /api/comment.""" ...
import itertools import numpy as np import matplotlib.pyplot as plt import xarray as xr def make_2d(ary): """Convert any array into a 2d numpy array. In case the array is already more than 2 dimensional, will ravel the dimensions after the first. """ ary = np.atleast_2d(ary.T).T # flatten ou...
# stdlib import copy import os from pathlib import Path import time from typing import Any from typing import Tuple # third party import pytest import torch # syft absolute import syft as sy IN_DIM = 100 OUT_DIM = 10 class SyNet(sy.Module): """ Simple test model """ def __init__(self) -> None: ...
import pytest from PyQt5 import QtCore from pytestqt import qt_compat from pytestqt.qt_compat import qt_api from model import Model from mainframe import MainWindow import re @pytest.fixture def app(qtbot): model = Model() widget = MainWindow(model) qtbot.addWidget(widget) return widget @pytest.fi...
import os import sys import re import numpy as np import multiprocessing from joblib import Parallel, delayed import PySimpleGUI as sg def salva_arquivo_novo(arquivo, nome): if type(arquivo).__module__ == np.__name__: if "-atualizar" in sys.argv: sg.Popup( 'Mandou atualizar o a...
# This routine reads version-7.0.1 RSS WindSat daily files # # filename name of data file with path in form satname_yyyymmdd_v7.0.1.gz # where satname = name of satellite (wsat) # yyyy = year # mm = month # dd = day of month # missing = fill value used for missing data; # ...
import argparse import os import subprocess import SimpleITK as sitk import numpy as np from nipype.interfaces.ants import N4BiasFieldCorrection from natsort import natsorted def ReadImage(file_path): ''' This code returns the numpy nd array for a MR image at path''' return sitk.GetArrayFromImage(sitk.ReadI...
"""Tests for the fixes of GFDL-ESM4.""" import iris import numpy as np import pytest from cf_units import Unit from esmvalcore.cmor._fixes.cmip6.gfdl_esm4 import Fgco2, Omon, Siconc from esmvalcore.cmor.fix import Fix from esmvalcore.cmor.table import get_var_info @pytest.fixture def siconc_cubes(): """Sample c...
import numpy as np import matplotlib.pyplot as plt from collections import namedtuple from sympy import Point, Line KDTreeNode = namedtuple("KDTreeNode", ["value", "left", "right"]) # make sure that the items of coord_matrix does not exceed upper/lower # limits def cut_matrix(m, lower_limit, upper_limit): m[m < l...
import librosa import numpy as np from .utils import Util from sklearn.preprocessing import StandardScaler import pandas as pd from numpy.linalg import det from multiprocessing.dummy import Pool as ThreadPool #from multiprocessing import Pool from concurrent.futures import ThreadPoolExecutor class FeatureAggregator(ob...
from ray.rllib.env.env_context import EnvContext from ray import tune import ray.rllib.agents.ppo as ppo from maze_env import QuarkMaze3 import maze_env_4 from ray.rllib.policy.sample_batch import SampleBatch import tensorflow as tf import numpy as np from ray.rllib.models.tf.fcnet import FullyConnectedNetwork from ray...
from sklearn import datasets from utils import eucledian_distance import collections import operator from sklearn.cluster import DBSCAN from sklearn.model_selection import train_test_split import numpy as np # max(stats.iteritems(), key=operator.itemgetter(1))[0] #DBSCAN Reference : https://github.com/chrisjmccormick...
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2021 <NAME> (The Compiler) <<EMAIL>> # # This file is part of qutebrowser. # # qutebrowser 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, e...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import argparse import configparser from flask import Flask, request, jsonify from flask.views import View import logging logger = logging.getLogger(os.path.basename(sys.argv[0])) app = Flask('jack-the-service') class InvalidAPIUsage(Exception):...
import random import io import os import discord import tokage import functools from discord.ext import commands from pybooru import Danbooru from pybooru.exceptions import PybooruHTTPError import pixiv from .util.checks import right_channel from .util.da import DeviationCollector class Animu: AWWNIME = 'https...
# -*- coding:utf-8 -*- import re import codecs from ..utils.log_util import LogInfo class FreebaseHelper: def __init__(self, meta_dir): self.meta_dir = meta_dir self.type_pred_dict = {} # <type, set([pred])> self.type_name_dict = {} self.sup_type_dict = {} self.sub_type_d...
import requests import json from datetime import date import random import us from botcommands.covid_county import get_county from datetime import datetime, timedelta # # States Testing Data Current covidtracking.com # States Testing Historical covidtracking.com # Raw County level Data https://static.usafacts.org/ # ...
from .field import Field from .core import BeamMix, Phase, MultPhase, IntAttenuator, CircAperture, GaussHermite, GaussLaguerre, Interpol from .misc import PI,Tilt def PointSource(Fin, x=0.0, y=0.0): """ Fout=PointSource(Fin, x=0, y=0) :ref:`Creates a point source. <Begin>` Args:: requ...
from collections import Counter import torch from torch.utils.data import Dataset import numpy as np from PIL import Image import random import cv2 import albumentations as A import torchvision.transforms as transforms from lib.rand_augment import RandomAugment from cfg.cfg import cfg train_transforms = transforms...
#!/usr/bin/env python3 from modbus_control import ModbusControl from conext_regmap import Conext, BinaryState from midnite_classic_regmap import MidniteClassic from system_manager import SystemManager, DeviceInfo, DATA_FIELDS from influxdb import InfluxDBClient import dataclasses import signal import time from typin...
import numpy as np import time from nspyre import * import traceback from lantz.drivers.ni.simple_daq import Read_DAQ from lantz.drivers.toptica import DLC from lantz.drivers.toptica.highfinesse_ws7 import WS7 from lantz.drivers.thorlabs.fabryperot import FabryPerot from lantz.drivers.sainsmart.relay import Relay fro...
from PIL import Image import requests from io import BytesIO import turtle import sys import time # Test image: 10x10 Maze1 = "https://i.ibb.co/kJMFzHx/10-by-10-orthogonal-maze.png" # Test image: 15x15 Maze2 = "https://i.ibb.co/Xt2NTGn/15-by-15-orthogonal-maze.png" # Test image: 20x20 Maze3 = "https://...
import os import numpy as np import librosa import numpy as np import time as timelib import scipy import soundfile as sf import scipy.signal as sps from scipy import interpolate # GPU Setup def test_GPU(args): # Initialize GPUs import tensorflow as tf print("Num GPUs Available: ", len(tf.config.list_phy...
from subprocess import check_call import ruffus import tasks import os import sys import argparse # Read mapping preprocessing for DNase-seq on U2OS and HEK293T # Using GRCh37 (hg19) as ref since GUIDE-seq and CIRCLE-seq # are both annotated by GRCh37 def mappipe(ifold, ref_file, minlen=20, rclip=0): ifold = ...
# Copyright (c) 2010-2011 Lazy 8 Studios, LLC. # All rights reserved. import json from front import activity_alert_types from front.lib import urls, xjson from front.models import chips from front.models import user as user_module from front.tests import base def current_app_version(): return "1.0" class TestUser...
""" Date - 7/25/17 Writen for the Gamble Lab @ Albert Einstein College of Medicine Simple program for overlapping gappedPeak objects created by gappedPeakReader(). The program will output to a fisher exact test result text file. NOTE : pyinterval package will need to be downloaded. Output Fisher Exact Test : FileN...
import asyncio import time from datetime import timedelta, datetime import discord from discord.ext import commands class Research(commands.Cog): def __init__(self, bot): self.bot = bot # Start background tasks self.bot.loop.create_task(self._init_delete_old_research()) async def _...
# Copyright 2020-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 agre...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function """ vcd-cli extention to create and destroy a Log Insight VM in the cloud for testing against. """ from pyvcloud.vcd.vapp import VApp from pyvcloud.vcd.vdc import VDC from pyvcloud.vcd.client import NSMAP from vcd_cli.utils import std...
import aiohttp import asyncio import blinker import uuid import logging import sqlalchemy import json import random from common import http from common import utils from common.config import config __all__ = ["PubSub", "signals"] signals = blinker.Namespace() log = logging.getLogger('common.pubsub') class Topic: d...
import torch import torch.nn as nn import torch.nn.functional as F from SpectralNorm import * torch.manual_seed(0) ## Random Normal Initialization def normal_init(m, mean, std): if isinstance(m, nn.ConvTranspose2d) or isinstance(m, nn.Conv2d): m.weight.data.normal_(mean, std) m.bias.data.zero_() #...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import tensorflow.contrib.slim as slim # maxout_flag # 1: according to Maxout network from https://arxiv.org/pdf/1302.4389.pdf # 0: maxout with dimention reduction maxout_fl...
# Copyright 2022 The Kubeflow 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 required by applicabl...
from multicrypto.ellipticcurve import secp256k1 from multicrypto.base58 import bytes_to_base58, base58_to_int, base58_to_bytes, validate_base58, \ base58 from multicrypto.bech32 import encode from multicrypto.coins import coins from multicrypto.utils import double_sha256, encode_point, hash160 G = secp256k1.G # ...
import torch import torchaudio import torchaudio.compliance.kaldi as kaldi import os import numpy as np from tqdm import tqdm from torch.utils.data import DataLoader from torch.utils.data import Dataset #torchaudio提取fank特征 class get_features(): def __init__(self,audio_path): self.audio_path = audio_path ...
import numpy as np from backend.tools import DebugTools from ..models.models import Verse, ScoreBreakdown, Sentence from ...backend import SETTINGS def sigmoid(x): return 1 / (1 + np.exp(-x)) # Score = word_decay * admin_score * normalized user vote * popularity score * connected bonus * (tfidf) class Scoring...
import datetime from flask import jsonify, request, url_for, make_response from json import dumps from schema import ( #Schema, SchemaError, #SchemaForbiddenKeyError, #SchemaMissingKeyError, #SchemaUnexpectedTypeError, #SchemaWrongKeyError, ) from . import app, log from . import dataset # # Co...
from logzero import logger from flask import Blueprint, render_template, request, redirect, url_for, flash import bleach from flask import jsonify from base.utils.auth import get_jwt, jwt_required, admin_required, get_current_user from base.forms import FileUploadForm from caendr.services.nemascan_mapping i...
# 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/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
from tkinter import * import requests from bs4 import BeautifulSoup import sys import webbrowser from tkinter.filedialog import asksaveasfile from tkinter import messagebox def ghubinfo(): global uname uname = ebox_email.get() url = "https://github.com/"+uname r = requests.get(url...
# Copyright 2016-2022 Blue Marble Analytics LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
from dataclasses import field from datetime import datetime from decimal import Decimal from enum import Enum from typing import Any from typing import Dict from typing import Generic from typing import Optional from typing import Tuple from typing import TypeVar from pydantic import BaseModel from pydantic.dataclasse...
import gym from keras.optimizers import Adam import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '../')) from src.r2d3 import Actor from src.processor import PendulumProcessorForDQN from src.policy import EpsilonGreedy, AnnealingEpsilonGreedy from src.image_model import DQNImageModel from src...
import pytest from pytest import raises import numpy as np import numpy.testing as npt import matplotlib.pyplot as plt import pyfar as pf from pyfar.dsp import InterpolateSpectrum # TODO: Finish `test_interpolation()` for 'magnitude_minimum' def test_init(): """Test return objects""" fd = pf.FrequencyData([1...
import math from PIL import Image import asyncio from io import BytesIO import os import mercantile import fiona from shapely import speedups if speedups.available: speedups.enable() from shapely import geometry as shp import ujson from .tbutils import ObjDict, TileNotFound def num2box(z, x, y, srid='4326'): ...
from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, PasswordChangeForm from django.contrib.auth import authenticate, login, logout, update_session_auth_hash from django.contrib.auth.models imp...
# Copyright 2018 <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/LICENSE-2.0 # # Unless required by applicable law or agreed to...
import argparse from io import StringIO import math import sys from bs4 import BeautifulSoup, PageElement, Tag, NavigableString from .compat import stream_configure def digitlize(n): if n == 0: return 1 else: return int(math.log10(abs(n))) + 1 class HtmlNode(object): ...
# -*- coding: utf-8 -*- from f6a_tw_backend.constants import * from f6a_tw_backend.django_constants import * from django.shortcuts import render from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from f6a_tw_backend import cfg from f6a_tw_backend i...
import os import sqlite3 import datetime import math from .common import * from itertools import groupby from itertools import tee class WmtSession: def __init__(self, name, start, duration = None, id = None, end = None): self.name = name self.start = start self.id = id self.duration = duration if end is no...
from __future__ import absolute_import, division, print_function import sys hpdl_database = { "Only ND1 protonated" : { ("CG", "ND1") : [1.371, 0.009], ("ND1", "CE1") : [1.338, 0.008], ("CE1", "NE2") : [1.316, 0.009], ("NE2", "CD2") : [1.377, 0.007], ("CD2", "CG") : [1.356...
import cv2 import imutils import math import numpy as np from scipy import ndimage from scipy.ndimage import label from skimage.feature import peak_local_max from skimage.morphology import watershed from skimage.color import label2rgb import time #import matplotlib as mpl #import matplotlib.pyplot as plt #from matplot...
#!/usr/bin/python3 import bat from bat import log_to_dataframe, dataframe_to_matrix import pandas as pd import numpy as np import sklearn from sklearn.ensemble import IsolationForest from sklearn.decomposition import PCA from sklearn.cluster import KMeans import tkinter from geoip import geolite2 clean_df = log_to_da...
from django import template from django.core.urlresolvers import reverse from django.conf import settings from django.contrib.sites.models import Site from django.template.base import TemplateSyntaxError from django.utils.text import ugettext_lazy as _ from news.models import News register = template.Library() @regi...
# Person(INT id, VARCHAR(63) birthName, INT dynasty, BOOLEAN isMale, DATE birthday, DATE deathday, INT fatherID, # INT real_fatherID, INT motherID, INT spouseID, INT religionID, INT cultureID, FLOAT fertility, FLOAT health, FLOAT wealth, # INT hostID, FLOAT prestige, FLOAT piety, INT provinceL...
import json import numpy as np from annoy import AnnoyIndex import os import subprocess import sys import random from sklearn.neighbors import KDTree import argparse import time def str2bool(v): if isinstance(v, bool): return v if v.lower() in ('yes', 'true', 't', 'y', '1'): return True eli...
# Copyright 2019 Saarland University, Spoken Language Systems LSV # Author: <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/LICENSE-2.0 # # THIS CO...
from datetime import datetime from enum import unique from app import db from app import login from flask_login import UserMixin from markupsafe import Markup import markdown import os import random import string from werkzeug.security import generate_password_hash, check_password_hash @login.user_loader def load_user...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import subprocess import os import json import urllib2 import requests import socket from chunked import chunked from cascade import cascade class Latest(dict): def __init__(self, path): self.path = os.path.join(path, ".latest.txt") self.reset() ...
from em_psse import * import networkx as nx import argparse import logging logger = logging.getLogger('em.parse_raw') parser = argparse.ArgumentParser(description='Parse PSSE Files') parser.add_argument('--input', help="Input RAW file") parser.add_argument( '-d', '--debug', help="Print lots of debugging stateme...