text stringlengths 3.07k 22.1k |
|---|
# -*- coding: utf-8 -*-
"""
@FileName : dcgan_.py
@Description : None
@Author : 齐鲁桐
@Email : <EMAIL>
@Time : 2019-08-18 23:37
@Modify : None
"""
from __future__ import absolute_import, division, print_function
import glob
import os
import time
import matplotlib.pyplot as plt
import numpy as ... |
# Import external packages
import math
import argparse
import time
import os
import pandas as pd
from tqdm import tqdm
import pickle
import copy
import torch
import spacy
import torch.nn.functional as F
import torch.nn as nn
import torch.optim as optim
from torchtext.legacy.data import Field, BucketIterator, TabularDa... |
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# ABN 41 687 119 230.
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(DATA61_BSD)
#
... |
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.optim
import torch.nn.functional as F
import torch.optim.lr_scheduler as lr_scheduler
import time
import os
import glob
from itertools import combinations
import ipdb
import h5py
from data.datamgr import SimpleDataMa... |
# Copyright <2020> <<NAME> <https://chenwang.site>, Carnegie Mellon University>
# 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
... |
from pytest import raises
from ruler import Rule, Optional, OneOf, Grammar, RegexRule
from ruler.base_rules import BaseRule, BaseCompoundRule, RuleNamingError
from ruler.rules import CompoundRule
class TestRegexRule:
def test_whole_match(self):
r = RegexRule('abcde')
assert r.match('abcde')
... |
#! -*- coding: utf-8 -*-
# 用Seq2Seq做小学数学应用题
# 数据集为ape210k:https://github.com/Chenny0808/ape210k
# 介绍链接:https://kexue.fm/archives/7809
from __future__ import division
import json, re
from tqdm import tqdm
from bert4torch.models import build_transformer_model
from bert4torch.tokenizers import Tokenizer, load_vocab
from ... |
"""
Genetic Evolve Strategy for Exploring:
1. Candidate Block List
Normal Conv2D with the `SAME` padding strategy
Residual Block
Pooling Layer with maxpooling/meanpooling, 50/50 chances each.
2. Evaluation
Each individual will be trained for 30 epochs on a MOT16 held-out Dataset
CMC_top_1, mAP are ... |
#-
# ===========================================================================
# Copyright 2015 Autodesk, Inc. All rights reserved.
#
# Use of this software is subject to the terms of the Autodesk license
# agreement provided at the time of installation or download, or which
# otherwise accompanies this softwa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from argparse import ArgumentParser, FileType
from collections import OrderedDict
from tempfile import NamedTemporaryFile, mkdtemp
import numpy as np
from pyfr.inifile import Inifile
from pyfr.progress_bar import ProgressBar
from pyfr.readers.native... |
import logging
import json
try:
import winreg
except ImportError:
winreg = None
from pathlib import Path
from shutil import copyfile
from urllib.parse import urlparse, urlunparse
from appdirs import user_config_dir, user_data_dir, user_cache_dir
PROGRAMS_KEY = "Software\\Microsoft\\Windows\\CurrentVersion\\... |
import random
import discord
from discord.ext import commands
from discord import Embed
import os
import re
import datetime
import sqlite3
from time import sleep
from threading import Thread, Lock
import asyncio
from typing import List, Tuple, Dict
import pickle
import atexit
datetime_fmt = re.compile(r"(\d{4})-((?:0... |
from __future__ import annotations
import logging
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Dict, Iterator, Optional, Type
from snecs.typedefs import EntityID
from scripts.engine.component import Aesthetic, Position
from scripts.engine.core.constants import (
AfflictionCategoryType,
... |
import json
import os
import re
import logging
from six import text_type
from otest import Done
from otest import Unknown
from otest.func import factory as ofactory
from otest.summation import completed
from otest.summation import eval_state
from otest.summation import represent_result
from otest.prof_util import fr... |
#! /usr/bin/env python
# -*- mode: python -*-
import sys
sys.path.insert(0, '/data/project/whois/local/lib/python2.7/site-packages')
import six
from ipwhois import IPWhois, WhoisLookupError
import cgitb
import os
from six.moves import urllib
import cgi
import json
import socket
import re
SITE = '//whois.toolforge.org... |
import category_encoders as ce
import numpy as np
import pandas as pd
import sklearn.decomposition as decomposition
from fancyimpute import SimpleFill
from sklearn.externals import joblib
from sklearn.feature_extraction import text
from sklearn.preprocessing import Normalizer, MinMaxScaler
from steppy.base import BaseT... |
import numpy as np
import torch
import torch.nn as nn
from torch import nn
from torch.optim.lr_scheduler import ReduceLROnPlateau
from fairseq import utils
from torch.utils.data import TensorDataset, DataLoader
from tqdm import tqdm
def combine_knn_and_vocab_probs(knn_p, vocab_p, coeff):
combine_probs = torch.st... |
import subprocess
from io import StringIO
import pandas as pd
from AnalysisModule.routines.util import removefile
"""
a wrapper for jchemsuite
"""
Jia2019Si = """_feat_Mass
Molecular mass of _raw_SMILES (possibly a salt)
_feat_AtomCount_C
(atomcount -z 6)
Number of carbon atoms. (integer)
_feat_AtomCount_N
(atomc... |
# Load a ONNX model
import numpy as np
import torch
from helpers import trt_helper
from helpers import trt_int8_calibration_helper as int8_helper
import time
from calib import ImageBatchStream
import argparse
class CNN(torch.nn.Module):
def __init__(self, num_classes=10,):
super(CNN, self).__init__()
... |
from __future__ import absolute_import
import tensorflow as tf
import multiprocessing
import anchors
from object_detection import preprocessor
from collections import OrderedDict
import glob
MAX_NUM_INSTANCES = 50
def pad_to_fixed_size(data, pad_value, output_shape):
"""Pad data to a fixed length at the first d... |
import logging
import os
import sys
import time
from profess.Http_commands import Http_commands
from plotter.plot import Plotter
from data_management.utils import Utils
logging.basicConfig(format='%(asctime)s %(levelname)s %(name)s: %(message)s', level=logging.DEBUG)
logger = logging.getLogger(__file__)
files_names... |
import io
import os
import pickle
import numpy as np
import torch
from PIL import Image
from learn2learn.vision.datasets import TieredImagenet
class TieredImageNet(TieredImagenet):
def __init__(self, root, partition="train", mode='coarse', transform=None, target_transform=None, download=False):
self.root... |
import argparse
import importlib
from amaranth import *
from thirdparty.amaranth_soc import wishbone
from thirdparty.lambdasoc.cpu.minerva import MinervaCPU
from thirdparty.lambdasoc.periph.intc import GenericInterruptController
from thirdparty.lambdasoc.periph.serial import AsyncSerialPeripheral
from thirdparty.lamb... |
try:
# import warnings
import tela
except ImportError:
from Aboutn import tela
representacao= (5,) + ((4,) * (len(tela.sentidos) + 1))
algarismos = "01"#'ai'#' \t'
f_max = 100
tamanho = 0 #73 == 5 + (4 * (len(tela.sentidos) + 1))
def __len__ ():
global tamanho
for r in representacao:
tamanho += r
return ta... |
#!/usr/bin/env python3
import argparse
import errno
import json
import os
import pprint
import requests
import signal
import sys
import time
import yaml
# global constants
PROGNAME = 'pipeline-commander'
HOME = os.path.expanduser( '~' )
DEFAULT_CONFIG = os.path.join( HOME, '.config', PROGNAME + '.yml' )
USAGE_STR=""... |
"""Check and Setup Phylotyper Ontology and Subtyping Schemes
Example:
$ python ontolog.py -s stx1
"""
import logging
import os
from rdflib import Graph, Literal, XSD
from modules.phylotyper.exceptions import ValuesError, DatabaseError
from middleware.graphers.turtle_utils import generate_uri as gu
from middlew... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from scipy.fftpack import dct
from collections import deque
class MFCCKaldi:
'''
TODO port Kaldi mfcc to Python. Use similar parameters as
in suggested in __init__ function
'''
def __init__(self, sourcerate=16000, framesize=512,
... |
#!/usr/bin/python
# Copyright (c) 2017, 2018, 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 ... |
#!/usr/bin/env python3
""" Module for defining and working with a tartan run """
import datetime
import sys
import os
import glob
from pcheck import utils
class TartanRun:
""" TartanRun class """
def __init__(self, raptr_records, item_type, tartan_root):
""" Initialization method """
if item_... |
#Auto mesh generator
#Importing libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pygmsh as pg
from PIL import Image
from scipy import ndimage as ndi
from skimage import io, filters,feature
from skimage.measure import find_contours, approximate_polygon, \
subdivide... |
"""Module exposing a Bundle, which is a repository of sprites, screens and level templates."""
from dataclasses import dataclass
from json import JSONDecodeError, load
from typing import Dict, Tuple, Any
from jsonschema import validate, ValidationError
from bansoko.game import GameError
from bansoko.game.leve... |
import numpy as np
from itertools import count
from collections import defaultdict
from .util import *
class Tough_Mesh():
"""
A container class for all the mesh objects.
Not super-neccessary since only one is loaded into memory at a time, but helped keep track with order-shuffling.
Calls the routine... |
import logging
import math
import random
import audio
import org.threejs as three
from controls import Keyboard, ControlAxis
from units import Ship, Asteroid, Bullet
from utils import wrap, now, FPSCounter, coroutine, clamp, set_limits
DEBUG = True
logger = logging.getLogger('root')
logger.addHandler(logg... |
"""
``editquality autolabel -h``
::
Filters a set of revision IDs for use in an edit quality labeling campaign
by whether they need review or not. This script uses a MediaWiki API
check the reverted status of an edit and to mark edits by trusted users
(that have not been reverted) as not needing revie... |
import glob
import os
import re
import gzip
import csv
from pathlib import Path
from typing import List, Union
from collections import defaultdict
from kgdata.config import WIKIDATA_DIR
from tqdm import tqdm
from multiprocessing import Process, Queue
def save_record_id_to_wikidata_id(outfile, q):
file_counter = 0... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Micropy-Stubs
Copyright (c) 2019 <NAME>
Crawls file tree looking for info.json files,
sorting them by either firmware or device.
If a firmware file is found, it creates the file structure required.
If a device file is found, it will then download its required modules... |
#!/usr/bin/python
print(f'Loading {__file__}')
### Andrei - importing channel access function - sprry for that DAMA :) 12 Dec 2019
from bluesky.plan_stubs import one_1d_step, abs_set, wait, sleep
import time
from collections import ChainMap
import bluesky.plans as bp
import matplotlib.ticker as mtick
get_fields = db... |
"""
******
Common
******
:Author: <NAME>
"""
# Copyright (c) 2019-2021 MQTTany contributors
#
# 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 limitatio... |
"""
Copyright (c) 2019 <NAME>. All rights reserved.
(c) 2021 42<NAME>
SPDX-License-Identifier: MIT
"""
# Standard Python deps
from enum import Enum
from enum import IntEnum
import errno
import re
import sys
from dataclasses import dataclass
# Internal deps
from . import args
from . import log
# External d... |
"""
File : Tetris game on the Raspberry PI
Authors : <NAME> & <NAME>
Date : January 2019
---------------------------------
Move your shape with right/left button.
Rotate it with the middle button.
Complete a line to increase your score.
Good luck !
"""
from sense_hat import SenseHat
from time import sleep, time
from r... |
# Copyright 2021 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
# ******************************************************************************
# Copyright (c) 2020, 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 reta... |
"""
Betty365 - Unofficial Bet365 WebSocket Stream Data Processor
Author: @ElJaviLuki
"""
# DEPENDENCIES
from random import random
import websockets
from readit import StandardProtocolConstants, ReaditMessage
# Generate URIs
def generate_uid():
return str(random())[2:]
def generate_premws_uri():
retu... |
import nltk
import subprocess
import os
from rouge import Rouge
from collections import Counter
import numpy as np
import itertools
import numpy as np
def _get_ngrams(n, text):
ngram_set = set()
text_length = len(text)
max_index_ngram_start = text_length - n
for i in range(max_index_ngram_start + 1):
... |
# Copyright 2014-2021 The aiosmtpd Developers
# SPDX-License-Identifier: Apache-2.0
import asyncio
import inspect
import socket
import ssl
from contextlib import suppress
from functools import wraps
from smtplib import SMTP as SMTPClient
from typing import Any, Callable, Generator, NamedTuple, Optional, Type, TypeVar
... |
import csv
import json
import random
from typing import Dict, List, Optional, Tuple
import torch
from transformers.tokenization_utils import PreTrainedTokenizerBase
def load_json_data(path: str) -> Tuple[List[str], List[List[str]], List[str]]:
"""Load dialogue summarization dataset json files of https://aihub.or... |
#!/usr/bin/env python
#
# Copyright 2014 - 2016 The BCE Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the license.txt file.
#
import bce.option as _opt
import bce.math.constant as _math_cst
import bce.decompiler.mexp.to_mathml as _mexp_decompiler
i... |
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import scipy.stats as sts
from finn.util.gdrive import *
import sklearn
from sklearn.linear_model import LinearRegression
from sklearn.svm import SVR
from sklearn import model_selection
from sklearn.preprocessing import LabelEncode... |
from __future__ import annotations
from typing import Any, NamedTuple, TYPE_CHECKING
import asyncio
import csv
import gzip
import os
import sys
from collections import Counter, defaultdict
from pathlib import Path
if TYPE_CHECKING:
from collections.abc import Iterable
from tabulate import tabulate
from tqdm im... |
import time
from absl import app, flags, logging
from absl.flags import FLAGS
import cv2
import tensorflow as tf
import numpy as np
from yolov3_tf2.models import (
YoloV3, YoloV3Tiny
)
from yolov3_tf2.dataset import transform_images
from yolov3_tf2.utils import draw_bbox
from yolov3_tf2.utils import read_class_name... |
"""Repeating tasks and monitors for a Bus."""
import os
import re
import sys
import time
import threading
from magicbus.plugins import SimplePlugin
from magicbus.compat import get_thread_ident, TimerClass
# _module__file__base is used by Autoreload to make
# absolute any filenames retrieved from sys.modules which ar... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
import datetime
class Config(object):
"""基本配置参数"""
DEBUG = False
TESTING = False
BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SECRET_KEY = os.environ.get('SECRET... |
import datetime
import logging
import os
from pathlib import Path
from shutil import copyfile
from typing import Any, Dict, Optional, Tuple
import imageio
import matplotlib.pylab as plt
import numpy as np
from audio_utils import float_to_wav
from audio_utils.mel import plot_melspec
from general_utils import parse_json... |
import open3d.core as o3c
import numpy as np
import pytest
from open3d.ml.contrib import knn_search, radius_search
def test_knn_search():
query_points = np.array(
[[0.064705, 0.043921, 0.087843], [0.064705, 0.043921, 0.087843]],
dtype=np.float32)
dataset_points = np.array(
[[0.0, 0.0, ... |
import numpy as np
import pandas as pd
import glob
from tqdm import tqdm_notebook
from matplotlib import pyplot as plt
import sys
import pydicom
from mask_functions import rle2mask, mask2rle
import keras as K
from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau
from keras.callbacks import TensorBoard
from mod... |
# Copyright 2017 BrainPad Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
#!/usr/bin/env python3
import json
import bisect
import itertools
import functools
import collections
import logging
logger = logging.getLogger(__name__)
# TODO:
# - store the maximum weight modifier for a given slot
# - When pruning, know the highest possible modifier for all remaining slots
# - How do you know?... |
"""
Copyright (c) 2016 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
The code, technical concepts, and all information contained herein, are the pr... |
from Kernel import *
from LaserCommandConstants import *
from zinglplotter import ZinglPlotter
from CH341DriverBase import *
"""
MoshiboardDevice is the backend for Moshiboard devices.
The device is primary composed of three main modules.
* A generic spooler to take in lasercode.
* An interpreter to conve... |
import discord
from discord.ext import commands
from jikanpy import Jikan
from datetime import datetime
from dotenv import load_dotenv
from os import getenv
from services import utils
from services.anime import anime
from services.search import search
from services.schedule import schedule
PREFIX = '!'
load_dotenv('e... |
"""
Common processing functions for grayscale images: (x, y), where x,y in range (0,255)
"""
def _memoryview_safe(x):
"""Make array safe to run in a Cython memoryview-based kernel. These
kernels typically break down with the error ``ValueError: buffer source
array is read-only`` when running in dask di... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... |
# -*- coding: utf-8 -*-
# *******************************************************
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
# * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
# * WARRANTIES OR C... |
'''
Script to test using Ray for distributed sampling.
'''
from abc import ABC, abstractmethod
from collections import defaultdict
import gym
import numpy as np
import ray
import torch
import torch.nn as nn
from torch.optim import Adam
class SimpleAgent(ABC):
@abstractmethod
def act(self, obs):
"Sa... |
import csv
import datetime
import copy
'''
Calculates cost of employee pay including pension and NI contributions
Takes as input a csv file with a format of:
Header row
Name: str, Pensionable: bool, Role1 start date: dd/mm/yy, Role1 hours: float, Role1 rate: float, Role1 type: str, Role2 start date...
Can comp... |
import logging
import sys
import torch
import math
from tensorboardX import SummaryWriter
import matplotlib.pyplot as plt
from tqdm import tqdm
import numpy as np
import os
from script.cuda import to_device
from script.visualization import plot_sample_trajectories, plot_gaussian_ellipse, plot_potential_zone
confidenc... |
"""
Red-Black Tree
--------------
"""
class Node(object):
"""
Binary search tree Node class
"""
def __init__(self, value, color=True):
self.value = value
self.color = color
self.left = None
self.right = None
self.parent = None
def grandparent(self):
"""
Get grandparent of node... |
#!/usr/bin/env python
"""Collection of simple functions useful in computational chemistry scripting.
Many of the following functions are used to make operations on xyz coordinates
of molecular structure. When refering to ``xyz_data`` bellow, the following
structures (also used in :py:mod:`~comp_chem_utils.molecule_dat... |
#!/usr/bin/env python3
"""land_satellite_listener.py: Facillitates communication between Land Server and BBB."""
__author__ = "<NAME> (briellelaw), <NAME> (jahn18)"
__copyright__ = "Copyright 2020 UBC Sailbot"
from nt_connection.Connection import Connection
from nt_connection.Help import Help
import generated_python... |
#!/usr/bin/env python
#
# Copyright 2020 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
#
# 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/li... |
from django.db import models
# Create your models here.
'''
轮播图表 表名slidershows 类名SliderShow
name
img
sort
trackid
'''
class SliderShow(models.Model):
name = models.CharField(max_length=40)
img = models.CharField(max_length=200)
sort = models.IntegerField()
trackid = models.CharFiel... |
import os, numpy as np, sys, cv2
from PIL import Image
from utils import is_path_exists, mkdir_if_missing, load_list_from_folder, fileparts, random_colors
from kitti_utils import read_label, compute_box_3d, draw_projected_box3d, Calibration
import json
max_color = 30
colors = random_colors(max_color) # Generate r... |
#
# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/
# Written by <NAME> <<EMAIL>>,
# <NAME> <<EMAIL>>
#
from glob import iglob
from os import path, rename
import time
from collections import namedtuple
import sys
import numpy as np
import torch
import torch.nn.functional as F
from radam import RAda... |
import pandas as pd
import numpy as np
import json
import glob
from IPython import embed
import sys
from collections import defaultdict
import collections
def highlight_best_with_std(df, larger_is_better_dict, top=2):
""" actually operates on dataframes
here, takes df with mean (to determine best), and o... |
# Copyright (c) 2017 crocoite contributors
#
# 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, merge, publi... |
# Copyright 2015 Wanderu, 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 applicable law or agreed to in writing... |
#!/usr/bin/env python3
import logging
import os
import pickle
import random
import re
import sys
import time
import traceback
from datetime import datetime as dt
from subprocess import run
import feedparser
import html2markdown
from fuzzywuzzy import process
from telegram import Update, ParseMode
from telegram.ext im... |
"""Search functionality and objective function tooling."""
from __future__ import print_function
import re
import ast
import sys
import copy
import random
import inspect
import functools
import contextlib
import collections
import numpy
import astpath
from six import iteritems, itervalues
from past.builtins import x... |
"""Git tools for Python."""
from pathlib import Path, PurePosixPath
from datetime import datetime
import json
from copy import copy
from git import Repo, InvalidGitRepositoryError
# ============================ Custom exceptions =============================
class DirtyRepo(Exception):
"""Specific exception in... |
from contextlib import contextmanager
from copy import deepcopy
import numpy as np
from numpy import linalg as npl
from meshpy import tet
from scipy.spatial import cKDTree
from mesh_sphere_packing import logger, TOL
@contextmanager
def redirect_tetgen_output(fname='./tet.log'):
"""Context manager to redirect st... |
# Import external modules
from google.appengine.api import memcache
from google.appengine.ext import ndb
import logging
import random
import time
# Import app modules
from configuration import const as conf
from constants import Constants
import text
const = Constants()
const.MAX_RETRY = 3
const.MIN_REAGGREGATE_DELAY... |
"""
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 absolute_import
from __future__... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# Modified by <NAME> and <NAME>
# Modified by <NAME>
# ------------------------------------------------------------------------------
from __future_... |
"""Directed-acyclic graph models of computational workflows
The `Workflow` class models computational workflows as a directed-acyclic graph,
where nodes are tasks to complete, and edges represent dependencies between
those tasks. It includes methods for building workflows (new_task, add_task,
remove_task) in addition ... |
import tensorflow as tf
import numpy as np
import math
import glob
#import msssim
from scipy import misc
import matplotlib.animation as animation
from pylab import *
from frame_interpolator import *
import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt
def normalize_frames(frames, medians):
r... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
#... |
from pagedb import PageDB
import ipaddress
from bs4 import BeautifulSoup
import re
def addSuffix(line, dict):
#not empty or comment line or consist of invalid charachters
if((line != '') and (line[:2] != '//') and (line.find('?') == -1)):
domains = line.split('.')
TLD = domains[-1]
if(TLD not in dict):
dict... |
from qtrade_client.api import QtradeAPI
import random
import json
import time
import os
import sys
from log import Logger
from datetime import datetime
import requests
from dateutil import parser
from auth import QtradeAuth
DEBUG = False
DEMO = False
DEMO_MARKETS = ["NYZO", "BIS"]
log_obj = Logger("qtrader.log", "W... |
"""Colors."""
from .hsv import HSV
from .srgb import SRGB
from .srgb_linear import SRGB_Linear
from .hsl import HSL
from .hwb import HWB
from .lab import LAB
from .lch import LCH
from .display_p3 import Display_P3
from .a98_rgb import A98_RGB
from .prophoto_rgb import ProPhoto_RGB
from .rec2020 import Rec2020
from .xyz... |
import sys
from operator import itemgetter
from Model import Model
import random
import math
import pandas as pd
def find_initial_score(n):
i = 0
sums = 0
scores = []
scoring_sum = 0
if n > 5:
for k in range(2):
remain = n - k
sums = remain + sums
else:
... |
import config
import os
import sys
import math
import random
import numpy as np
import tensorflow as tf
import data_processer
import lib.seq2seq_model as seq2seq_model
def show_progress(text):
sys.stdout.write(text)
sys.stdout.flush()
def read_data_into_buckets(enc_path, dec_path, buckets):
"""Read twee... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator 192.1... |
#!/usr/bin/env python
"""
Multi-Resolution (2) Binary Classification with underline Gaussian Distributions
<NAME> & <NAME>,
Electrical and Computer Engineering Dept.,
University of Maryland
"""
#%% Import Modules
import pickle
import numpy as np
# import pandas as pd
import matplotlib.pyplot as plt
# fr... |
from api import app, db
from api.models import POI, Media, Link, Story, StoryPOI, Map
from api.utils import create_response, row_constructor
from api.auth_tokens import token_required
from flask import Blueprint, request, jsonify
import json
from datetime import date
from dateutil.parser import parse
POIS_URL... |
import pprint
from twocode import utils
from twocode.utils.node import Node
import twocode.parser.grammar
import copy
LOG = set()
#LOG.add("PERF")
class Parser:
def __init__(self, rules):
"""
DESIGN:
finds ways to build symbols out of symbols for every position in the ... |
#! /usr/bin/env python3
# <NAME> <<EMAIL>>
# Extracts P25 insert sizes from qualimapReports
# Calculates % >=Q30 from q30.txt
# Calculates % alignment from subsampled_mapping_stats.tsv
# Takes 4 arguments:
# 1. qualimapReports_paths.txt
# 2. q30_reads_paths.txt
# 3. subsampled_mapping_stats_paths.txt
# 4. se (single-e... |
import pandas as pd
from hydroDL.data import usgs, gageII, gridMET, ntn, GLASS, transform, dbBasin
import numpy as np
import matplotlib.pyplot as plt
from hydroDL.post import axplot, figplot
from hydroDL import kPath, utils
import json
import os
import importlib
from hydroDL.master import basinFull
from hydroDL.app.wa... |
# Copyright (C) 2019 Alteryx, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
from os import environ
import re
from flask import Flask, abort, g, redirect, render_template, request
# import httpagentparser
import requests
from cache import Dummycached, Memcached
COMPROMISE_MORALS = False
#
# the app
#
app = Flask(__name__)
# app store URLs
ANDROID_URL = "https://play.google.com/store/ap... |
from django.db import models
import uuid
import json
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.core.files.base import ContentFile
from assets.models import Asset, AssetGroup, AssetTag
from ops.models.project import GitProject
from ops.models.alert ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.