text stringlengths 3.07k 22.1k |
|---|
import os
import glob
from collections import OrderedDict
from luigi import Parameter, WrapperTask
from tasks.ca.statcan.geo import (GEOGRAPHIES, GeographyColumns, Geography,
GEO_CT, GEO_PR, GEO_CD, GEO_CSD, GEO_CMA, GEO_DA, GEO_FSA, GEO_DB)
from tasks.ca.statcan.census2016.cols_census... |
#!/usr/bin/env python
import bz2
from collections import defaultdict
from itertools import product
from operator import itemgetter
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
import re
import sys
def identifyORFs(nuc_seq, start_codons, stop_codons, min_ORF_len):
"""Expects 'nuc_s... |
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.contrib.contenttypes.models import ContentType
from rest_framework import serializers, pagination
from rest_framework.parsers import JSONParser
from rest_framework.compat import smart_text
from fum.models import (
Users, Groups, Se... |
'''
@File : rrteAutoLog.py
@Date : 2020/09/20
@Author : Wang.Yu
@Version : 1.0
@Contact : <EMAIL>
@License : (C)Copyright 2020 Yokogawa China Co., Ltd.
'''
#import pdb
#import logging
import os
import shutil
import datetime
import re
from configparser import ConfigParser
from host import *
from rrte import *
class ... |
"""
Contributors can be viewed at:
http://svn.secondlife.com/svn/linden/projects/2008/pyogp/lib/base/trunk/CONTRIBUTORS.txt
$LicenseInfo:firstyear=2008&license=apachev2$
Copyright 2009, Linden Research, Inc.
Licensed under the Apache License, Version 2.0.
You may obtain a copy of the License at:
http://www.apa... |
import json
import os
import shutil
from datetime import datetime
from helpers import console_printer, date_helper
_base_datetime_created = datetime.strptime(
"2017-10-03T05:04:03.003", "%Y-%m-%dT%H:%M:%S.%f"
)
def get_id_object_from_json_file(fixture_file_local):
"""Returns the _id object for the given vali... |
import sublime
import sublime_plugin
import re
import time
from .view import find_help_view, update_help_view
from .common import log, hh_syntax, current_help_file, current_help_package
from .common import load_resource
from .data import HeaderData, HistoryData
###---------------------------------------------------... |
# HSMM (Explicit Duration HMM) Core Algorithms
# Consider this as the prototype for "hsmm_core_x.pyx",
# which is the Cython version.
import numpy as np
from scipy.special import logsumexp
# ctypedef double dtype_t
# compute for u_t(j, d)
def _u_only(n_samples, n_states, n_durations,
log_obsprob, u):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/RiskEvidenceSynthesis) on 2019-07-29.
# 2019, SMART Health IT.
import sys
from dataclasses import dataclass
from typing import ClassVar, Optional, List
from .fhirabstractbase import empty_li... |
from modules.Utils import crandn
import numpy as np
from scipy.linalg import toeplitz
def get_observation(h, t_BS, t_MS, snr, n_pilots, n_antennas_BS):
n_antennas_mult = h.shape[-1]
n_antennas_MS = int(n_antennas_mult / n_antennas_BS)
n_batches = h.shape[0]
n_coherence = h.shape[1]
X = pilot_matrix... |
import os
import argparse
import re
import traceback
import sys
import maiconverter
from maiconverter.maicrypt import finale_file_encrypt, finale_file_decrypt
from maiconverter.maima2 import MaiMa2
from maiconverter.maisxt import MaiSxt
from maiconverter.simai import parse_file, SimaiChart
from maiconverter.converter ... |
import torch
from torch.autograd import Variable
import torch.optim as optim
import torch.nn.functional as F
import sys
from dataset import MitbinDataset
from model import TCN
import numpy as np
import argparse
from collections import defaultdict
from sklearn.metrics import roc_auc_score
from sklearn.metrics import auc... |
import itertools
import pytest
import pytorch_testing_utils as ptu
import torch
import torch.nn.functional as F
from torch import nn
import pystiche_papers.ulyanov_et_al_2016 as paper
from pystiche import image, misc
def test_join_channelwise(subtests, image_small_0, image_small_1):
join_image = paper.join_cha... |
#!/usr/bin/env python
# coding: utf-8
# In[278]:
import pandas as pd
import seaborn as srn
import statistics as sts
import numpy as np
import matplotlib.pyplot as plt
# In[279]:
# Consultando dados Fifa 21
fonte = "C://Fifa 21//fifa21.csv"
# Leitura do arquivo e criando DataFrame
df = pd.read_csv(fonte, sep=';... |
import torch
import torch.nn as nn
from deeplodocus.utils.generic_utils import get_specific_module
from deeplodocus.app.layers.empty import EmptyLayer
class YOLOv3(nn.Module):
"""
Original article: https://pjreddie.com/media/files/papers/YOLOv3.pdf
"""
def __init__(
self,
ba... |
import difflib, os
from git3Client.dlt.contract import get_factory_contract
from git3Client.gitCommands.add import add
from git3Client.gitCommands.commit import commit
from git3Client.gitInternals.gitCommit import get_all_local_commits
from git3Client.gitInternals.gitObject import read_object, unpack_object
from git... |
# -*- coding: utf-8 -*-
"""
BCI Workshop Auxiliary Tools
Created on Fri May 08 15:34:59 2015
@author: Cassani
"""
import matplotlib.pyplot as plt
import numpy as np
from sklearn import svm
# import winsound
def plotmultichannel(data, params=None):
# TODO Receive Labels as arguments
"""
Creates a plot to pr... |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 18 15:33:01 2019 by <NAME> - <EMAIL>
"""
import torch
import torchvision.transforms.functional as TF
import os
import matplotlib.pyplot as plt
import numpy as np
import random
from time import localtime, strftime
################################
### Dat... |
#!/usr/bin/env python
import cv2
import os
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.interpolate import CubicSpline
def img_open(img):
kernel = np.ones((5,5), np.uint8)
img = cv2.erode(img, kernel, iterations=1)
img = cv2.dilate(img, ke... |
import essentia
essentia.log.warningActive = False
import os
import math
import click
import shutil
import random
from glob import glob
from colorama import Fore
from datetime import datetime
from pablo import analysis, mutate, heuristics, producer, diglet
from pablo.models.sample import Slice
from pablo.models.song i... |
import os.path as osp
import sys
import datetime
import time
import torch
import numpy as np
import optuna
from optuna.trial import TrialState
from optuna.samplers import TPESampler
from functools import partial
from ruamel.yaml import YAML
import json
from scripts.default_config import (get_default_config,
... |
import importlib
import os
import shutil
from builders.htmlPhpAndMarkdown import builder as htmlPhpAndMarkdownBuilder
from builders.gallery import builder as galleryBuilder
import zachaire_files.fileManager as fm
from .cfgParser import DirBuildingCfgParser
from .fileManager import isNewerThan, mkdirParents, getExtens... |
"""
functions for deterministically preprocessing 2D images (or 3D with color
channels) mostly for the consumption of computer vision algorithms
"""
import math
import numpy as np
import skimage.transform
from .. import utils
def _center_coords_for_shape(shape):
"""
returns the center of an ndimage with a gi... |
# Copyright (C) 2016-2017 <EMAIL>.<EMAIL>
from hashlib import sha256
import random
import math
import os
import re
import shutil
import itertools
'''
Simple XOR operation encrypting
'''
class XOR:
def __init__(self, key, *job):
self.key = key
self.job = job
if self.j... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 29 15:19:36 2020
@author: <NAME>
@mail: <EMAIL>
Copyright 2020 <NAME>. All Rights Reserved.
See LICENSE file for details
"""
import networkx as nx
import numpy as np
from heapq import *
from datetime import datetime
#0:00:23.466188
class Node():
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# imports.
from ssht00ls.classes.config import *
import os, sys, json, subprocess
# execute.
def check_errors(output):
for i in [
"rsync: ", "rsync error: ",
"ssh: ", "ssh error: ",
"sshfs: ", "sshfs error: ",
"scp: ", "scp error: ",
"mount_smbfs: ", "mount_s... |
from prnu.VDIR.ops import *
class Estimator(object):
def __init__(self,x, name, reuse=False):
self.input=x
self.name=name
self.reuse= reuse
self.build_model()
def build_model(self):
with tf.variable_scope(self.name, reuse=self.reuse):
self.net = conv2d(sel... |
"""
An allocation takes care of binding different variables to concrete values.
The allocation of the parameters and random variables is handled outside the
scope of the model, as
- we only want one location where parameters and values are defined,
but they are used in different parts/classes of a simulation
- alloc... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from transport import * # general transport class
from mhfem_acc import *
import direct as Direct # direct S2 solver
''' Diamond differenced Sn solver
Inherits from transport.py
Includes
unaccelerated
eddington accelerated
S2... |
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2012-2021 NV Access Limited, <NAME> <<EMAIL>>
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
#
# This file represents the braille display driver f... |
from __future__ import annotations
from collections import defaultdict
from dataclasses import dataclass, field
from typing import Any, DefaultDict, Dict, Iterable, List, Tuple, Union
import avm2.abc.instructions
from avm2.abc.enums import ConstantKind, MethodFlags, TraitKind
from avm2.abc.types import (
ABCClass... |
import json
from pathlib import Path
from time import time
from tqdm import tqdm
import cv2
import torch
from mycv.paths import COCO_DIR
from mycv.datasets.constants import COCO_CATEGORY_LIST
from mycv.datasets.mycocoeval import myCOCOeval
from mycv.utils.general import ANSI
import mycv.utils.detection as detutils
imp... |
import matplotlib.pyplot as plt
import matplotlib as mpl
import time
from datetime import datetime
import pytz
import numpy as np
import threading
import requests as req
import json
# ################################### #
# @title Get Fields
url_field = "url_field" # @param {type:"string"}
# api_name_field = "report... |
import numpy
import random
VALID = range(8)
numpFALSE = numpy.array((False, False))
movelist = [
[[(0, 1), (1, 1), (-1, 1)], [(0, -1), (1, -1), (-1, -1)]], # pawn
[(1, 0), (-1, 0), (0, 1), (0, -1)], # rook
[(-1, -2), (1, -2), (2, -1), (2, 1), (1, 2),
(-1, 2), (-2, 1), (-2, -1)], # knight
[(1, ... |
# Copyright 2022 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... |
__source__ = 'https://leetcode.com/problems/number-of-distinct-islands/'
# Time: O()
# Space: O()
#
# Description: Leetcode # 694. Number of Distinct Islands
#
# Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land)
# connected 4-directionally (horizontal or vertical.)
# You m... |
# Copyright 2020 The OpenAGI Datum Authors.
#
# 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 ... |
# Copyright (c) 2021 NVIDIA CORPORATION & 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
from ..data import base_legacy as db
from ..io import main_legacy as dio
from ..data import velocity_legacy as dbvel
from ..data.time import num2date
import numpy as np
# !!!FIXTHIS:
# This whole package needs to be rewritten in the 'new' style.
# import pylab as plb
# from pylab import plot,show
from ..rotate impor... |
import os
import pickle
import pandas as pd
import numpy as np
import time
# import matplotlib.pyplot as plt
# import warnings
import keras
from keras.preprocessing import sequence
import tensorflow as tf
from sklearn.preprocessing import OneHotEncoder
from sklearn.model_selection import train_test_split
from sklear... |
# 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... |
import numpy as np
import pytest
import physt
from physt import h2, histogram_nd, binnings
from physt.binnings import as_binning, BinningBase
from physt.histogram_nd import Histogram2D
vals = [
[0.1, 2.0],
[-0.1, 0.7],
[0.2, 1.5],
[0.2, -1.5],
[0.2, 1.47],
[1.2, 1.23],
[0.7, 0.5],
]
np.ra... |
import os
from wh_parser.whp.node import *
from wh_parser.whp.error import CompileError
import enum
import typing
class CodeFileType(enum.Enum):
PY = 'py'
Q = 'q'
reserved = {
'CALL': 'CALL',
'IMPORT': 'IMPORT',
'WITH': 'WITH',
'AS': 'AS',
'AND': 'AND',
'OR': 'OR'
}
config_list = (
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" hierarchialdataset.py
Description:
"""
# Package Header #
from ..__header__ import *
# Header #
__author__ = __author__
__credits__ = __credits__
__maintainer__ = __maintainer__
__email__ = __email__
# Imports #
# Standard Libraries #
import collections
# Third-Party... |
__author__ = '<NAME>'
from abc import abstractmethod
from enum import Enum
from datetime import datetime
import calendar
import pandas as pd
# --------------- TARIFF structures --------------- #
class TariffType(Enum):
FIX_CUSTOM_CHARGE = 'customer_fix_charge'
ENERGY_CUSTOM_CHARGE = 'customer_energy_charge'... |
import chainer
import chainer.links as L
import chainer.functions as F
import csv
from tqdm import tqdm
import six
from chainer import serializers, cuda
import numpy as np
from file import File
from iomanager import IOManager
from directory import Directory
from trainptb import RNNForLM
class TestSuite(IOManager):
... |
"""Image augmentation step for Bitti magazine logo detector
Takes in images and YOLO-formatted annotations, and subsequently uses.
`imgaug` lib to augment - rotations and projection transformations mostly -
both the images and the bounding boxes, saving the output to an S3 bucket.
"""
import csv
import uuid # for uni... |
from __future__ import division
import csv
import random
import numpy as np
import nibabel as nib
from nvidia.dali.pipeline import Pipeline
import nvidia.dali.ops as ops
import nvidia.dali.types as types
from src.dataset.numpy_data_augmentation import *
# Usual PyTorch dataset (this is a data reader)
class Fetal3DSeg... |
# -*- coding: utf-8 -*-
import sys
import csv
import time
from AirSimClient import *
from argparse import ArgumentParser ###
import numpy as np
import random ##
from matplotlib import pyplot as plt ##
import pylab
from collections import deque
from keras.layers import Dense
from keras.optimizers import Adam
from k... |
import asyncio
import json
import os
import sys
import webbrowser
from pathlib import Path
from typing import Any, Dict, Optional
import click
from aiohttp.client_exceptions import ClientConnectionError
from prompt_toolkit import PromptSession
from prompt_toolkit.patch_stdout import patch_stdout
from rich.markup impor... |
import json
import logging.config
import redis
from kafka import KafkaConsumer, KafkaProducer
from kafka.errors import KafkaError
from settings import KAFKA_SERVER, KAFKA_CLIENT_ID, KAFKA_API_VERSION, KAFKA_MONITORING_TOPICS, \
LOGGING, KAFKA_GROUP_ID, KAFKA_TRANSLATION_TOPIC, REDIS_HOST, REDIS_PORT, REDIS_NFVI_DB,... |
import os
import sys
import uuid
import time as _time
import random as _random
import heapq
import signal
import traceback
import multiprocessing as mp
from multiprocessing import connection
from broccoli import __version__
from broccoli.utils import get_colorizer, color, default, validate
from broccoli.components impo... |
#!/usr/bin/env python
############################################################################
# Copyright (c) 2011-2013 Saint-Petersburg Academic University
# All Rights Reserved
# See file LICENSE for details.
############################################################################
import os
import shutil
... |
import pdfrw
import random
import os
from datetime import date
import time
import copy
# ***** MUST pip install pdfrw *****
os.environ["PATH4PDF"] = 'website/static/pdf/undergraduate_registration_form.pdf'
# Map of PDF tags to the corresponding field name and data
# x = {PDF_TAG: [FIELD_NAME, DATASTORE_VALUE]}
x = {
... |
import numpy as np
import decimal
from nball4tree.config import DECIMAL_PRECISION
from nball4tree.util_train import get_children
from nball4tree.util_file import create_ball_file
from nball4tree.util_vec import vec_cos, vec_norm, vec_point, qsr_DC_degree, qsr_P_degree, rotate
decimal.getcontext().prec = DECIMAL_PRECIS... |
'''
nav - navigation
====================
helper functions and ajax APIs to support navigation and headers
'''
# standard
import json
from datetime import datetime
# from http://stackoverflow.com/questions/753052/strip-html-from-strings-in-python
from io import StringIO
from html.parser import HTMLParser
# pypi
from ... |
# coding: utf-8
"""
This schema is based on the SQL script available here:
https://github.com/i2b2/i2b2-data/blob/master/edu.harvard.i2b2.data/Release_1-7/NewInstall/Crcdata/scripts/crc_create_datamart_postgresql.sql
For more information, you can refer to this document:
https://www.i2b2.org/software/files/PDF/current/... |
#!/usr/bin/env python
import rospy
import json
from sensor_msgs.msg import Imu, MagneticField
from std_msgs.msg import String
class Filter:
def __init__(self, b, a=None, k=1):
"""
Creates a filter object
:param b: numerator coefficients of the transfer function (coeffs of X)
:par... |
# -*- coding: utf-8 -*-
import os
from contextlib import contextmanager
from tinydb import TinyDB
from tinydb.database import Table
from tinydb.storages import MemoryStorage
from tinydb.utils import itervalues
MODELS_DIR = os.path.join(os.path.dirname(__file__), "dbs")
if not os.path.exists(MODELS_DIR):
os.mkdir(... |
#
# Frame.events - QAEventGroup setattr filter
# Frame.events.EventID - ndarray
# Frame.events.hits - [ndarray, ...] --- ???
# Frame.events.Muon - QABranch setattr filter
# Frame.events.Muon.pairs - QABranchCombo setattr ... |
'''
search.py: part of pybraincompare package
Generate search interfaces to compare images
'''
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from pybraincompare.template.templates import (
get_template,
add_string,
add_javascript_function,
remo... |
# -*- coding: utf-8 -*-
# test/unit/importhook/test_taskimporter.py
# Copyright (C) 2016 authors and contributors (see AUTHORS file)
#
# This module is released under the MIT License.
"""Test taskfilematch()"""
# ============================================================================
# Imports
# ================... |
from channels.base import Channel, ChannelsError, ChannelBoard, ChannelThread, ChannelPost
from channels.base import ChannelAttachment, SettingDefinition, Client, PostingError
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup
import requests
import re
import time
... |
import json
import os
import subprocess as sp
from functools import partial
from pathlib import Path
from typing import Iterable, List
import pytest
import torch
import ginza.command_line as cli
TEST_TEXT = "#コメント\n今日はかつ丼を食べた。\n明日は東京で蕎麦を食べる。明後日は酒が飲みたい。"
run_cmd = partial(sp.run, encoding="utf-8", stdout=sp.PIPE)
... |
#!/usr/bin/python
# Copyright (c) 2018 StackHPC 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... |
"""
Script for testing the Dense and Convolutional Bayesian Layers using the MNIST dataset.
Currently used architecture: LeNet-5
@author: <NAME>
Cyprus University of Technology
"""
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision imp... |
"""Use and abuse Python built-in objects, functions and classes."""
# ignore some coding flaws
# pylint: disable=bad-builtin
# pylint: disable=eval-used
# pylint: disable=exec-used
# pylint: disable=too-few-public-methods
# pylint: disable=undefined-variable
# pylint: disable=unused-variable
import io
import os
impor... |
import abc
import logging
from typing import Dict, List, Optional, Set
import rx
import attr
import schedule
from rx import operators as rx_ops
from paho.mqtt.client import MQTTMessage
from rx.core import Observer
from rx.disposable import Disposable
from worker_bunch.astral_times.astral_times_manager import AstralTi... |
# coding: utf-8
from __future__ import division
import math
import random
from abc import ABCMeta, abstractmethod
import attr
import six
from typing import NamedTuple, TYPE_CHECKING
from six.moves import range
from python_synth import helpers
from python_synth.constants import ADSR_STATUS, ANALOGUE_MAX
from python_s... |
import os
from typing import Any, Dict, Union
import numpy as np
import pandas as pd
from lrgwd.extractor.config import GWFU_FN, GWFV_FN, LABELS_FN, TENSORS_FN
from lrgwd.split.config import (TEST_GWFU_FN, TEST_GWFV_FN, TEST_LABELS_FN,
TEST_TENSORS_FN, TRAIN_GWFU_FN, TRAIN_GWFV_FN,
... |
from __future__ import absolute_import
import numpy as np
import torch
import torch.nn as nn
from transformers import AutoModel, AutoConfig
from .torch_layers import Encoder, TimeDistributed, EncoderWithoutEmbedding, Embedder, PositionalEncoding, PositionalEncoder
class Transformer(nn.Module):
def __init__(self,... |
import webapp2
from models import Game
from models import User
from google.appengine.ext import ndb
import logging
import json
from datetime import datetime
from google.appengine.api import users
from google.appengine.api import namespace_manager
from collections import defaultdict
import math
import datetime
class St... |
import csv
import sys
import wave
from _datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
import pyaudio
from scipy.fftpack import fft
# Based on the source code of 'Rattlesnake', a script for active noise cancellation.
# > Source: https://github.com/loehnertz/rattlesnake
# > Author: <NAME>... |
#!/usr/bin/python2.7
from argparse import ArgumentParser
import xmlschema
from xmlschema.validators import XsdElement, XsdAnyElement, XsdComplexType, XsdAtomicBuiltin, XsdSimpleType, XsdList, XsdUnion
# sample data is hardcoded
def valsmap(v):
# numeric types
v['decimal'] = '-3.72'
v['float'] = '-... |
# 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... |
# MIT License
# Copyright (c) 2018 shotariya
# 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, merg... |
#!/usr/bin/env python
import _pycaffe as caffe
from cv2 import *
import pdb
import numpy as np
import time
from argparse import ArgumentParser
import os
from tqdm import tqdm
import shutil
import subprocess
MODEL_LOC = "/content/drive/My Drive/IMP_STYLE/train_8.caffemodel"
MODEL_PROTO = "prototxt/8/"
CONTENT_LOC = "/... |
import argparse
import torch
import torch.nn as nn
import torchvision.transforms as transforms
import torch.nn.functional as F
# from torchvision import models
from model.wide_res_net import WideResNet
from model.smooth_cross_entropy import smooth_crossentropy
from data.cifar import Cifar
from utility.log import Log
fr... |
import os
import warnings
import tensorflow as tf
import stable_baselines.common.hvac_action_mask as hvac
from stable_baselines import PPO2, A2C
from stable_baselines.common.policies import MlpPolicy
from stable_baselines.common.vec_env import DummyVecEnv
from stable_baselines.common.callbacks import BaseCallback
fro... |
"""C representation of Python types."""
from typing import List, Tuple, Any
import ctypes as c
from exonum_runtime.runtime.types import (
ArtifactId,
InstanceSpec,
StateHashAggregator,
ArtifactProtobufSpec,
CallInfo,
CallerService,
CallerTransaction,
Caller,
ExecutionContext,
I... |
import os
import numpy as np
import json
from PIL import Image
from PIL import ImageDraw
def compute_convolution(I, T, stride=1):
'''
This function takes an image <I> and a template <T> (both numpy arrays)
and returns a heatmap where each grid represents the output produced by
convolution at each loc... |
"""
MIT License
Copyright (c) 2019 GamingGeek
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... |
import sqlite3
import unqlite
import leveldb
import shutil
import os
import logging
import json
log = logging.getLogger(__name__)
known_dbs = ['lbryfile_desc.db', 'lbryfiles.db', 'valuable_blobs.db', 'blobs.db',
'lbryfile_blob.db', 'lbryfile_info.db', 'settings.db', 'blind_settings.db',
'b... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import ast
import six
import token
import tokenize
import unittest
from .context import asttokens
from . import tools
class TestASTTokens(unittest.TestCase):
def test_tokenizing(self):
# Test that we produce meaningful tokens on ini... |
# -*- coding: utf-8 -*-
__author__ = 'Adward'
# Python utils imports
import math
import os
import sys
from time import time
import sqlite3
# Standard scientific Python imports
import matplotlib.pyplot as plt
import numpy as np
# Import classifiers and performance metrics
from sklearn.preprocessing import *
from skle... |
import glob
import os
import matplotlib.pyplot as plt
#import pandas as pd
import numpy as np
from scipy.ndimage import gaussian_filter1d as gaussfil
import h5py
import math
import argparse
parser = argparse.ArgumentParser(description = 'Compute efreq and velocities for trigonal lattice')
parser.add_argument('--nbands... |
#!/usr/bin/env python3
"""Wrapper Script.
This wrapper script will be replaced by the pipelie executables
that we are going to label. This script checks the command line
argument whenever it is triggered and copies files that are
different. In this way we can pinpoint the origin of differences.
"""
import subprocess... |
# Handshake Automatic Importer by <NAME> 5/17/18
# TODO Error handle for finding elements
import configparser
import os
import time
import tkinter
from datetime import datetime
from pathlib import Path
from tkinter import *
from tkinter import messagebox
from tkinter.filedialog import askopenfilename
from selenium imp... |
import bpy
from bpy.props import FloatProperty, FloatVectorProperty
import arm.api
import arm.material.mat_state as mat_state
import arm.material.cycles as cycles
import arm.material.make_attrib as make_attrib
import arm.material.make_finalize as make_finalize
import arm.material.mat_utils as mat_utils
import arm.asse... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
"""
Neural Networks with No Imports (in Python).
"""
MERSENNE_PRIME = 162259276829213363391578010288127
A = 2305843009213693951
B = 15485863
def random(seed):
"""Pseudo-random number generator in the range [0, 1).
“Mersenne prime twister”."""
state = seed
for _ in range(20):
state = (state*A... |
"""
Copyright (c) 2021, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import json
from re import A
import types
import torch
import numpy as np
from torch.utils.data ... |
from matplotlib import pyplot as plt
import numpy as np
import spikeforest
class CrossCorrelogramsWidget:
def __init__(self, max_samples=None, auto=True, *, sorting, samplerate, unit_ids=None, _figure=None, _axs=None):
self._SX = sorting
self._unit_ids = unit_ids
self._figure = _figure
... |
import re
import mmap
import argparse
import json
from collections import OrderedDict
from base64 import b64decode
from datetime import datetime
def main(args):
all_urls = False
info_list_obj = []
# Define regex patterns
pattern_common = r"(?:https\:\/\/mail\.google\.com\/mail\/u)(?:\/(?P<user_no>[0-... |
"""
Contains utils for matrices and vectors such as transposing and
secure signing
"""
from typing import Sequence, TypeVar, Union, cast, overload
import mpyc.random
from mpyc.runtime import mpc
from mpyc.sectypes import SecureFixedPoint, SecureObject
from tno.mpc.mpyc.stubs.asyncoro import mpc_coro_ignore, returnTyp... |
from __future__ import print_function
import logging
import time
import sys
import string
import re
import googleapiclient
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
from googleapiclient.errors import HttpError
import requests
i... |
# The MIT License (MIT)
#
# Copyright (c) 2019 <NAME> for Adafruit Industries LLC
# Copyright (c) 2020 <NAME>, adaptations for micropython-inkplate6
#
# 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 S... |
import numpy as np
import matplotlib.pyplot as plt
# these are the control variables, change them to customize the execution of this program
# number of experiments to run, large number means longer execution time
cntExperiments = 1001
# number of episodes per experiment, large number means longer execution time
MAX_... |
import ast
import pytest
from bpc_utils import BaseContext, Config, UUID4Generator, parso_parse
from bpc_utils.typing import TYPE_CHECKING
if TYPE_CHECKING:
import parso # isort: split
from bpc_utils import Linesep # pylint: disable=ungrouped-imports
from bpc_utils.typing import Tuple # pylint: disabl... |
# encoding: utf-8
import numpy as np
from collections import Counter
import itertools
import tensorflow as tf
from sklearn.linear_model import LogisticRegression
from src.models import STNEConv
from src.classify import Classifier, read_node_label
import time
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.