text stringlengths 3.07k 22.1k |
|---|
import argparse
import os
from tqdm import tqdm
from datasets import kss_wav, public_korean_wav, selvas_wav, check_file_integrity, generate_mel_f0, f0_mean
from multiprocessing import cpu_count
from hparams import create_hparams
import torch
# TODO: lang code is written in this procedure. Langcode==1 for korean-only c... |
from pydantic import validator, ValidationError, Field
from .types import BaseModel, Union, Optional, Literal, List
from typing import Dict
import pathlib
class ParasiticValues(BaseModel):
mean: int = 0
min: int = 0
max: int = 0
class Layer(BaseModel):
name: str
gds_layer_number: int
gds_dat... |
"""
A set of large-scale tests which test code updates against previously-run "golden"
results.
The idea here is that any new updates (except for major versions) should be non-breaking;
firstly, they should not break the API, so that the tests should run without crashing without
being changed.
Secondly, the actual res... |
"""
Orbitscalc
Copyright 2021 <NAME>
Licensed under the Apache License, Version 2.0
"""
from skyfield.api import EarthSatellite, load
from datetime import timedelta
from copy import copy
from orbitscalc.general_utility import data_with_unit, CustomEnum, to_percent_max100
from orbitscalc.ground_station import GroundSta... |
from ..lfx import RequestHelper
from ..editor import VimView
from ..core.edit import parse_workspace_edit
# from ..core.protocol import Diagnostic
from ..core.sessions import Session
from ..core.protocol import Request, RequestMethod, Point, Range
from ..core.typing import Any, List, Dict, Callable, Optional, Union, Tu... |
annotations_dic = \
{"lipsUpperOuter": [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291,78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],
"lipsLowerOuter": [146, 91, 181, 84, 17, 314, 405, 321, 375, 291,78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],
"lipsUpperInner": [78, 191, 80, 81, 82, 13, 312, 311, 310, ... |
import logging
import random
from typing import List, Any
from src.models import *
from src.helpers import viz_maze
logger = logging.getLogger(__name__)
class MazeGenerator:
def __init__(self, traps: dict, dimension: int):
self.dimension = dimension
self.traps = traps
self.maze = None
... |
import matplotlib.pyplot as plt
from cleanco import cleanco
from nltk.corpus import names, gazetteers
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk.stem.lancaster import LancasterStemmer
from nltk.tokenize import TweetTokenizer
plt.style.use('ggplot')
import nltk
import scipy.sta... |
import copy
import numpy as np
from nltk import WordNetLemmatizer
from intermediate_representation import lf
from spider.example import Example
# Take care, this imports are necessary due to the dynamic "eval()" command further down
from intermediate_representation.semQL import Sup, Sel, Order, Root, Filter, A, N, C,... |
import argparse
import logging
import os
import numpy as np
import torch.cuda
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
cudnn.benchmark = True
from utils.iam_loader import IAMLoader
from config import *
from m... |
''' Spline2.py: wrapper for B. Thijsse et al.'s hyper-spline routines.
Yet another spline interpolation routine. The problem: given a set of
experimental data with noise, find the spline with the optimal number of
knots.
Solution:
They use the usual kind of routines to determine least-squares
splines from ... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appli... |
from PyQt5 import QtCore, QtGui, QtWidgets
import qdarkstyle
from threading import Thread
from collections import deque
from datetime import datetime
import time
import sys
import cv2, torch
from PIL import Image as im
from utils.augmentations import letterbox
import imutils
import numpy as np
model = torch.hub.load('... |
#!/usr/bin/env python
# encoding: utf-8
import unittest
from hebrew_tokenizer import tokenize
def compare(test_name, sentences, tokenization_ground_truth, print_results=False, with_whitespaces=False):
for n, (s, s_ground_truth) in enumerate(zip(sentences, tokenization_ground_truth)):
s_tokens = [(t, grp) ... |
#!/usr/bin/env python3
# coding: utf-8
# SPDX-License-Identifier: Apache-2.0
# Copyright 2020 AntiCompositeNumber
# 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/l... |
####################################################################
# Copyright (c) 2020 <NAME> #
# #
# This source code is licensed under the MIT license found in the #
# LICENSE file in the root directory of this source tr... |
#! /usr/bin/env python
###############################################################################
# tf_agents_C51.py
#
# Training script of a Categorial DQN agent. It is patterned after the examples in the
# tf-agents library.
#
# It does include callbacks that are compatible with viewing training progress on
#... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... |
#!/usr/bin/env python3
'''
booksdatasource.py
Interface by <NAME>, 21 September 2021
Code by <NAME>, <NAME>
revised by <NAME> and <NAME>, 9 October 2021
For use in the "books" assignment at the beginning of Carleton's
CS 257 Software Design class, Fall 2021.
'''
from functools import cmp_to... |
# -*- coding: utf-8 -*-
import click
import colorlog
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import pandas as pd
import numpy as np
import os
handler = colorlog.StreamHandler()
handler.setFormatter(
colorlog.ColoredFormatter("%(log_color)s%(levelname)s:%(name)s:%(message... |
from __future__ import absolute_import
from builtins import zip
from builtins import range
from builtins import object
from nose.tools import (assert_equal, assert_not_equal, assert_almost_equal,
raises)
from nose.plugins.skip import Skip, SkipTest
from .test_helpers import (
true_func, asse... |
import os, glob
import subprocess
from os import listdir
from os.path import isfile, join
import time
import traceback
import shutil
import numpy as np
import csv
import time
def checkForUpdate(count, lastUpdate):
sn = os.environ['SERVERNUM']
hdfs = os.environ['HDFS']
updateCount = -1
print("UPDATE CHE... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import os.path
import sys
import subprocess
from os import path
from time import sleep
import ctypes
#5 no M makes the text blink
clear = lambda: os.system('clear')
green = "\033[1;32;2m"
greenblink = "\033[1;32;5m"
yellow = "\033[1;33;2m"
yellowblink = "\033[1;3... |
"""
Packing module
==============
:synopsis: Prepares packed spheres for tessellation.
.. moduleauthor:: <NAME> <<EMAIL>>
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from __future__ import division, print_function
import struct
import os
import time
import random
import subprocess
import numpy as np
import p... |
import torch
import torch.nn as nn
import numpy as np
import torch.distributions as TD
import scipy
import scipy.linalg
from copy import deepcopy
from multipledispatch import dispatch
from collections import Iterable
import sdepy
from .em import batchItoEuler
from .em_proxrec import torchBatchItoEulerProxrec
class OU_... |
import numpy as np
from PIL import Image, ImageDraw, ImageFont
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.transforms as transforms
import torch.autograd as autograd
from torch.autograd import Variable
cuda = True if torch.cuda.is_available() else False
Tensor = torch.cuda.Flo... |
import bottle
import json
import logbook
from utils.i18n import _, translate
from lib import exception_safe
class ErrorWithFormattedMessage(Exception):
def __init__(self, message=None, *args, **kwargs):
super().__init__()
assert not (kwargs and args)
self.message_args = args
self... |
from nemo.collections.nlp.data.dialogue_state_tracking.sgd.input_example import InputExample
from nemo.collections.nlp.models.dialogue_state_tracking.sgdqa_model import SGDQAModel
from nemo.collections.nlp.data.dialogue_state_tracking import Schema, SGDDataProcessor, SGDDataset
from nemo.core.config import hydra_runner... |
"""
IDE: PyCharm
Project: simulating-doctor-patient-interviews-using-neural-networks
Author: Robin
Filename: testing.py
Date: 16.07.2019
"""
import csv
import scipy
import torch
from sklearn.metrics import classification_report
from torchtext.data import TabularDataset, BucketIterator, Field
from tqdm import tqdm
f... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
""" Originally from CRESI project. We modified the code to accomodate
different number of input channels, e.g. 5-channel RGB+LIDAR input images.
"""
import math
import torch
from torch import nn
###################... |
# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.scatterlayout import ScatterLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from k... |
####################################################
# The Constexpr file is used by the compiler to evaluate
# specifically constant expressions ( expressions containing
# only constant / macro values. )
#
# Constexpr evaluation is done through a slight modification
# to the ExpressionEvaluators,... |
# /!usr/bin/env python3
"""
Define decision makers (either human participants or CNN models).
"""
from modelvshuman import constants as c
from modelvshuman.plotting.colors import *
from modelvshuman.plotting.decision_makers import DecisionMaker
def plotting_definition_template(df):
"""Decision makers to compare... |
from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import cv2
# Note origin is top-left corner of the image
# Formula for bx,by,bh,w
# bx=sigmoid(tx)+cx , by=sigmoid(ty)+cy
# where tx,ty is prediction ... |
import os
import pytest
from datetime import datetime
from decimal import Decimal
from en16931.entity import Entity
from en16931.invoice import Invoice
from en16931.invoice_line import InvoiceLine
from en16931.tax import Tax
class TestInvoiceAttributes:
def test_default_id_number(self):
i = Invoice()
... |
# iris/train.py
import json
from argparse import Namespace
from typing import Dict, Tuple
import numpy as np
import optuna
import pandas as pd
import torch
import torch.nn as nn
from numpyencoder import NumpyEncoder
from sklearn.preprocessing import LabelEncoder
# from config import config
from config.config import l... |
import pdb
import logging
from pathlib import Path
import PIL # type: ignore
import click
from typing import Tuple
from guppy import hpy # type: ignore
import numpy as np # type: ignore
import matplotlib.pyplot as plt # type: ignore
import torch
from sklearn.metrics import pairwise_distances # type: ignore
from tqdm i... |
from django.shortcuts import render
from django.core import serializers
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.conf import settings
import json
impo... |
import os
import os.path as osp
import json
import pydicom
import imageio
import argparse
import numpy as np
from glob import glob
from tqdm import tqdm
from sklearn.metrics import cohen_kappa_score
import sys
sys.path.append("..")
from GLD.utils import AverageMeter, cal_dice, Logger
from data_processing import calc_i... |
import torch
import numpy
import environment as env
from environment import get_valid_directions, move, prettyprint
class Policy(nn.Module):
def __init__(self):
super(Policy, self).__init__()
self.input_dim = 4 # onehot of possible paths
self.output_dim = 4 # action probs
self... |
"""
Set of functions related to Deirokay validation.
"""
import functools
import json
import warnings
from copy import deepcopy
from datetime import datetime
from os.path import splitext
from types import ModuleType
from typing import Optional, Union
import pandas
from jinja2 import BaseLoader
from jinja2 import Stri... |
"""
Provides infilling support for stitched IFCB rev 1 images
Based on pyifcb API
"""
import numpy as np
from scipy.interpolate import Rbf
from functools32 import lru_cache
from ifcb.data.utils import BaseDictlike
from ifcb.data.stitching import Stitcher
_LEGACY_EPS = 0.000001
def normz(a):
m = np.max(a) + _LE... |
import requests
from multiprocessing import Process, Queue, Manager
import json
import random
import sys
import time
import click
import zmq
import multiprocessing
import logging
logging.basicConfig(filename='broker.log', filemode='w', level=logging.INFO)
# from multichannel.worker_tasks import deep_github_worker_t... |
from utils._type import *
import datetime as dt
import traceback
import discord
import humanize
import re
from discord.ext import commands, tasks
from utils.useful import Embed, Cooldown, send_traceback
from utils.json_loader import read_json
class Core(commands.Cog):
def __init__(self, bot):
... |
""" The authentication views. """
import morepath
from onegov.core.markdown import render_untrusted_markdown
from onegov.core.security import Public, Personal
from onegov.org import _, OrgApp
from onegov.org import log
from onegov.org.elements import Link
from onegov.org.layout import DefaultLayout
from onegov.org.ma... |
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2008 <NAME> <<EMAIL>>
import os.path
from twisted.python import util
from twisted.web import resource, static
from coherence import __version__
from coherence.extern.et import ET, indent
from coh... |
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
import disciplina as disc
import os.path
import pickle
#Exceptions de tratamento
class PreenchaTudo(Exception):
pass
class FaltouAno(Exception):
pass
class FaltouCode(Exception):
pass
class FaltouSemestre(Exception):
pass
c... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import operator
import numpy as np
from zarr.compat import integer_types, PY2, reduce
def normalize_shape(shape):
"""Convenience function to normalize the `shape` argument."""
if shape is None:
raise TypeErro... |
import threading
import settings as s
from collections import namedtuple, deque
from api.actions import Actions
from analytics_frame import Analytics
from api.agent_analytics_frame import AgentAnalyticsFrameAPI
import random
import math
import copy
from sklearn.preprocessing import MinMaxScaler
import numpy as np
imp... |
from copy import copy
from django.conf.urls import url
from django.urls import reverse
from .. import Event, Task, mixins
from ..activation import StartActivation, ViewActivation, STATUS
class BaseStart(mixins.TaskDescriptionViewMixin,
mixins.NextNodeMixin,
mixins.ActivateNextMixin,
... |
#!/usr/bin/env python
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Copies file_manager/main.html to file_manager/test.html.
Modifies it to be able to run the CrOS FileManager app
as a regular web p... |
#idea: build an app to sign up for tests that takes 5 inputs: first name, last name, email,student ID, and a dropdown menu to select which test they are signing up for and when a button is pressed all of the information is stored in a table and all fields are wiped
#download pgAdmin?
import tkinter as tk
from tkinte... |
from uuid import uuid4
from shutil import rmtree
from random import shuffle
from zipfile import ZipFile
from string import hexdigits
from requests import Session
from datetime import datetime
from hashlib import md5, sha1
from OpenSSL.crypto import X509
from re import findall, compile
from os import access, R_OK, listd... |
# Copyright (c) 2018 PrimeVR
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php
from lib.claimed_nuggets import ClaimedNuggets
from lib.nugget import BasicNugget, SpecialNugget, TbdNugget, DirectQueryNugget
from lib.special_coins imp... |
####################################################
# Block
########################
blocks_head = []
class Block:
name = "Block"
tag = "div"
content_seperator = ""
allows_nesting = True
def __init__(self, parent):
self.parent = parent
self.parent.add(self) if parent else None
... |
from abc import ABC, abstractmethod
from contextlib import contextmanager
from shlex import shlex
from typing import Any, Callable, Dict, Generic, Iterable, Iterator, List, Optional, TypeVar, Union
_T = TypeVar('_T')
"""
What kind of user inputs are there?
344 - simple int
- 10_000_00 - not so simple int
22.3 - simp... |
import tensorflow as tf
import os
import numpy as np
import pandas as pd
from skimage import io
from skimage.transform import resize
from skimage.filters import gaussian
# from deepflash import unet, preproc, utils
from df_resources import unet, preproc, utils, pixelshift37
from skimage.measure import label, regionpr... |
import pygame, os
import game_module as gm
import random
os.environ['SDL_VIDEO_CENTERED'] = '1' # centrowanie okna
pygame.init()
## ustawienia ekranu i gry
screen = pygame.display.set_mode(gm.SIZESCREEN)
pygame.display.set_caption('Prosta gra platformowa...')
clock = pygame.time.Clock()
# klasa gracza
cl... |
from flask import render_template, redirect, request, url_for, session, g, jsonify
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import or_
from flask_login import LoginManager, login_required, login_user, \
logout_user, current_user, UserMixin
from requests_oauthlib import OAuth2Session
from requests.exc... |
import json
import os
import time
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
import jax
import jax.numpy as jnp
import optax
from flax import jax_utils
from flax.serialization import from_bytes, to_bytes
from flax.training.common_utils import get_metrics... |
try:
from typing import Optional, List, Dict, Tuple
except ImportError:
pass
import re
import os
from collections import OrderedDict
from function import Function
from glob import glob
OBJECT_PREFIX = 'o'
NAMESPACE_PREFIX = 'n'
list_pattern = r'\[(.*?)(?:,(?: ?...)?)?\]'
type_pattern = r'(?P<type>... |
from astropy.io import fits
from astropy.stats import sigma_clip, sigma_clipped_stats
from astropy.modeling import models, fitting
import numpy as np
from matplotlib import pyplot as plt
from utils import *
from tqdm import tqdm
def find_slit_edges(master_flat_name, edge_cut=50, threshold=20, gap=20, has_primary=Fa... |
#! /usr/bin/python3
from gg_sdk import GG, GGThunk
import sys
import math
VPXENC = 'vpxenc --ivf --codec=vp8 --good --cpu-used=0 --end-usage=cq --min-q=0 --max-q=63 --cq-level={quality} --buf-initial-sz=10000 --buf-optimal-sz=20000 --buf-sz=40000 --undershoot-pct=100 --passes=2 --auto-alt-ref=1 --threads=1 --token-pa... |
"""
Subclasses the bokeh serve commandline handler to extend it in various
ways.
"""
import ast
import base64
import logging # isort:skip
import os
from glob import glob
from types import ModuleType
from bokeh.command.subcommands.serve import Serve as _BkServe
from bokeh.command.util import build_single_handler_appl... |
# Electron ID [DEEP TRAINING] steering code
#
# <NAME>, 2020
# <EMAIL>
# icenet system paths
import _icepaths_
import uproot
import math
import numpy as np
import torch
import argparse
import pprint
import os
import datetime
import json
import pickle
import sys
import yaml
import copy
#import graphviz
import torch_g... |
import os
import pytest
from git import Repo
from dvc.scm import SCM, Git, NoSCM
from dvc.scm.base import SCMError
from dvc.system import System
from tests.basic_env import TestGit, TestGitSubmodule
from tests.utils import get_gitignore_content
def test_init_none(tmp_dir):
assert isinstance(SCM(os.fspath(tmp_di... |
"""Support for Nature Remo AC."""
import logging
from homeassistant.core import callback
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
DEFAULT_MAX_TEMP,
DEFAULT_MIN_TEMP,
HVAC_MODE_AUTO,
HVAC_MODE_COOL,
HVAC_MODE_DRY,
HVAC_MODE_F... |
# -*- coding: utf-8 -*-
"""
@author: 2series
"""
class Node(object):
def __init__(self, name):
"""Assumes name is a string"""
self.name = name
def getName(self):
return self.name
def __str__(self):
return self.name
class Edge(object):
def __init__(self, src, dest):
... |
#!/usr/bin/env python3
"""Solve subset sum problem."""
import argparse
import sys
import os
import platform
from collections import defaultdict
from collections import Counter
from datetime import datetime as dt
from math import log
import ctypes
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__version__ = 0.1
# within ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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
from ... import _utilities, _tables
from... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import platform
import multiprocessing.pool
from setuptools import setup, Extension
lib_name = 'duckdb'
extensions = ['parquet', 'icu', 'fts', 'tpch', 'tpcds', 'visualizer']
if platform.system() == 'Windows':
extensions = ['parquet', 'icu', 'ft... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... |
#!/usr/bin/python3 -B
# Copyright 2018-2020 <NAME>. 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 requir... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
from os.path import join
import argparse
import numpy as np
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from pt.common.settings import results_path, TRAIN, VAL
from pt.common.utils import (
safe_makedirs, append_log, setup_log)
from pt.common.optimizers import get_optimizer, ... |
import numbers
import warnings
import weakref
from enum import Enum
from types import DynamicClassAttribute
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Optional, Union
from torch.utils.data import DataLoader
from ignite.engine.utils import _check_signature
if TYPE_CHECKING:
f... |
#!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... |
import textwrap
from discord.ext import commands, menus
import discord
import orjson
class CryptoMenu(menus.ListPageSource):
def __init__(self, data):
super().__init__(data, per_page=99)
async def format_page(self, menu, entries):
return discord.Embed(
color=discord.Color.blurple... |
from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
import future.utils
from functools import reduce
import fractions
import operator
import os
import re
import sys
import tempfile
from html.parser import... |
"""
This module is used to call Quantum Espresso simulation and parse its output
The user need to supply a complete input script with single-point scf
calculation, CELL_PARAMETERS, ATOMIC_POSITIONS, nat, ATOMIC_SPECIES
arguments. It is case sensitive. and the nat line should be the first
argument of the line it appear... |
import sys,os
import math
import random
#import mpmath
import operator
import csv
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pylab as pyl
import itertools
import scipy as sp
from scipy import stats
from scipy import optimize
from scipy.integrate import quad
#import scikits.statsmodels as sm
... |
import random
import time
import warnings
import sys
import argparse
import shutil
import os.path as osp
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.optim import SGD
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import DataLoader
import torchvision.transform... |
# @Author: Ivan
# @LastEdit: 2020/9/25
import os
import random
import cv2 # install
import numpy as np # install
def load_img_from_folder(root, nb_classes, nb_per_class, width, height, depth, train_proportion, valid_proportion,
test_proportion, shuffle=True, rescale=True, normalize=True):
... |
import ast
import sqlite3
import sys
import traceback
import unittest
from io import StringIO
from time import sleep
from unittest import mock
from littleutils import SimpleNamespace, only
import sorcery as spells
from sorcery import unpack_keys, unpack_attrs, print_args, magic_kwargs, maybe, args_with_source, spell
... |
"""Test config utils."""
# pylint: disable=too-many-public-methods,protected-access
import os
import tempfile
import unittest
import unittest.mock as mock
import pytest
from voluptuous import MultipleInvalid
from homeassistant.core import DOMAIN, HomeAssistantError, Config
import homeassistant.config as config_util
f... |
"""
High performance schedule for conv2d_nchw
Target NVIDIA GPU P100
====================================
**Author**: `<NAME>`
"""
import tvm
from flextensor.measure import _evaluate
from flextensor.nn import YoloConvLayer10
def schedule_yolo_conv_cuda(s, outputs, inputs, weight):
# inline the padding operation... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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
from ... import _utilities, _tables
from... |
import tensorflow as tf
import numpy as np
import time
def constfn(val):
def f(frac):
return val * frac
return f
class Model(object):
def __init__(self, env, world, policies, ncommtime=20, nminibatches=4, noptepochs=4):
self.env = env
self.world = world
self.policies = poli... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import time_diff_in_seconds, now, now_datetime, DATETIME_FORMAT
from dateutil.relativedelta import relativedelta
from six import string_types
@fr... |
# Copyright 2017 Google 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,... |
# ---------------------------------------------------------------------
# Cisco.IOS profile
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python module... |
#/usr/bin/env python
"""
Input/Output classes that are used by 3D-DAOSTORM, sCMOS, Spliner
and Multiplane analysis.
Hazen 09/17
"""
import numpy
import os
import sys
from xml.etree import ElementTree
import storm_analysis.sa_library.datareader as datareader
import storm_analysis.sa_library.parameters as params
impor... |
#!/usr/bin/env python
"""
Usage:
$ python rebuild-deploy-branch.py icds-staging [-v] [--no-push] [fetch] [sync] [rebuild]
See docs/commcare-cloud/deploy-branches.md
"""
from __future__ import print_function
from gevent import monkey
monkey.patch_all()
import os
import re
from contextlib2 import ExitStack
import gev... |
"""
This module provides the Scan Op
See scan.py for details on scan
"""
from __future__ import print_function
__docformat__ = 'restructedtext en'
__authors__ = ("<NAME> "
"<NAME> "
"<NAME> "
"<NAME> ")
__copyright__ = "(c) 2010, Universite de Montreal"
__contact__ = "<NAM... |
# Copyright 2020 The Oppia 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 applicable ... |
# Copyright 2021 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import argparse
import multiprocessing
import os
import sys
from configparser import ConfigParser
from configparser import ExtendedInterpolation
from pathlib import Path
from typing import Any
from typing import AnyStr
from maps_generator.utils.md5 import md5_ext
from maps_generator.utils.system import total_virtual_m... |
import threading
import pytest
import os
import time
import json
from time import sleep
from pymilvus import connections
from chaos.checker import (CreateChecker, InsertFlushChecker,
SearchChecker, QueryChecker, IndexChecker, Op)
from common.cus_resource_opts import CustomResourceOperations... |
import sys
sys.path.append('./util')
sys.path.append('./model')
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.nn.functional as F
from torchvision import transforms
import numpy as np
import argparse
import os
import time
import gc
import tensorflow as t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.