text stringlengths 3.07k 22.1k |
|---|
from boto3 import Session
from collections import OrderedDict
from moto.core import BaseBackend, BaseModel
from .exceptions import InvalidRequestException
class Location(BaseModel):
def __init__(
self, location_uri, region_name=None, typ=None, metadata=None, arn_counter=0
):
self.uri = locat... |
"""
Internal shared-state variables such as config settings and host lists.
"""
import os
import sys
from optparse import make_option
from fabric.network import HostConnectionCache
from fabric.version import get_version
from fabric.utils import _AliasDict, _AttributeDict
#
# Win32 flag
#
# Impacts a handful of pla... |
"""
Author: Benny
Date: Nov 2019
"""
import os
import sys
import torch
import numpy as np
import datetime
import logging
import provider
import importlib
import shutil
import argparse
from pathlib import Path
from tqdm import tqdm
from data_utils.ModelNetDataLoader import ModelNetDataLoader
BASE_DIR = os.path.dirna... |
"""Parses changelogs written in simple markdown
The markdown has to follow a certain pattern:
# Changelog Title <-⊣
⊦ Header
Introductory lines. <-⊣
## [version string] - YYYY-MM-DD <-⊣
⊦ Page
### Ch... |
#! /Library/Frameworks/Python.framework/Versions/3.5/bin/python3
# -*- coding: utf8 -*-
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import sys, os
from time import time
from source import furigana
from openpyxl import *
from random import randint
import random
from time import s... |
# -*- coding: utf-8 -*-
"""
pyte.streams
~~~~~~~~~~~~
This module provides three stream implementations with different
features; for starters, here's a quick example of how streams are
typically used:
>>> import pyte
>>>
>>> class Dummy(object):
... def __init__(self):
... ... |
import datetime
import json
import re
from PIL import Image
from rest_framework import status
from rest_framework.response import Response
from interface_test.models import TestCase
def timestamp_to_datetime(summary, type=True):
if not type:
time_stamp = int(summary["time"]["start_at"])
summary[... |
import sys
import torch
import os
import json
import pathlib
import pickle
from torchvision import transforms
#from importlib.resources import path
import pathlib
#from metalsiteprediction.data_loading import preprocessing
import preprocessing
class CustomTransform:
def __call__(self, protein_file):
r... |
import os
import uuid
import torch
import numpy as np
import sys
from typing import Union, List
from ast import literal_eval
from scenarios import ScenarioSetting, RescueTheGeneralScenario
from strategies import RTG_ScriptedEnv
from algorithms import MarlAlgorithm, PMAlgorithm, MultiAgentVecEnv
import str... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import hashlib
import io
import json
import mimetypes
import os
import zipfile
from collections import OrderedDict
from xml.etree.ElementTree import SubElement
import html5lib
from django.conf import s... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
import os
import cv2
import numpy as np
import random
import torc... |
import asyncio
import inspect
from datetime import timedelta
from typing import Dict, Tuple, List, Iterable, Callable, Union, \
Awaitable, Any, Set
import aiohttp
import pendulum
import re
import structlog
from tarsnapper.expire import expire
from k8s_snapshots import events, errors, serialize
from k8s_snapshots.... |
# Copyright (c) 2020-present, Assistive Robotics Lab
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
"""
Seq2Seq Encoders and Decoders.
Reference:
[1] https://pytorch.org/tutorials/intermediate/seq2seq_translation_tut... |
##################################################
# Copyright (c) <NAME> [GitHub D-X-Y], 2019 #
#####################################################################################################
# modified from https://github.com/pytorch/examples/blob/master/reinforcement_learning/reinforce.py #
###################... |
import numpy as np
from fmm_source import ggq_dist
from basic_operations import Vlm, operation
from scipy.special import binom
class CAO_basis:
"""build variables for contracted atomic basis"""
def __init__(self, x, element, n, pow, basis_type="STO_3G"):
self.x = x
self.element = element
... |
#!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""Spawn NPCs into the simulation"""
import glob
import os
import sys
import... |
import sublime
import sys
import threading
# Helper module
try:
from .helper import H
except:
from helper import H
# Settings variables
try:
from . import settings as S
except:
import settings as S
# DBGp protocol constants
try:
from . import dbgp
except:
import dbgp
# Config module
from .c... |
#!/bin/zsh
# Simple Calculator GUI with Arithmetic features.
# <NAME> III: https://github.com/Coalemus
# Copyright (c) <NAME>
from tkinter import *
from tkinter import ttk
root = Tk()
root.title("Calculator GUI Choose Arithmetic:")
root.columnconfigure(0, weight=1)
root.rowconfigure(0, weight=1)
mainframe = ttk.Fra... |
from CommonServerPython import *
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' CONSTANTS '''
FE_DATE_FORMAT = '%Y-%m-%dT%H:%M:%S'
OK_CODES = (200, 206)
class FireEyeClient(BaseClient):
def __init__(self, base_url: str,
username: str, password: str,
... |
import tensorflow as tf
import os
from tensorflow.python.tools import freeze_graph
from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
from tensorflow.python.framework import graph_util
import input_data
import models
def convert_frozen_graph_to_tflite(save_path=None,
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from aniso8601.exceptions import ISOFormatError
from aniso8601.builder import PythonTimeBuilder
from aniso8601.resoluti... |
import argparse
import math
import os
import csv
import json
import numpy as np
import os
from glob import glob
"""
# Sample metadata from BigEarthNet dataset
{"labels": ["Continuous urban fabric", "Discontinuous urban fabric", "Permanently irrigated land", "Rice fields"],
"coordinates": {"ulx": 540780, "uly": 431244... |
import time, os, shutil, sys, string, random, pprint, logging, datetime
import yaml
from pathlib import Path
from bottle import Bottle, run, route, request, abort, HTTPResponse
from truckpad.bottle.cors import CorsPlugin, enable_cors
from pytz import timezone
from models import db_init, Show, Movie, Track
from utils i... |
import os
import pathlib
import warnings
from copy import deepcopy
import gym
import numpy as np
import pytest
import torch as th
from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer
from stable_baselines3.common.envs import BitFlippingEnv
from stable_baselines3.common.evaluation import evaluate_policy
... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, 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 cop... |
# -*- coding: utf-8 -*-
# Builtin Modules
import time
import traceback
# 3rd-party Modules
import six
from celery.exceptions import SoftTimeLimitExceeded, TimeLimitExceeded
import celery.states as celery_status
# Project Modules
from worker import app
from worker.utils import toolkit, yaml_resources
from worker.util... |
import tensorflow as tf
from tensorflow import layers
from utils.loss import *
from utils.metrics import *
def fcn_head(input_tensor,filters,num_class,is_train):
eps = 1e-5
x = layers.conv2d(inputs = input_tensor,filters = filters,kernel_size = (3,3),padding = 'same',use_bias = False)
x = layers.batch_norm... |
"""Definitions of monomial orderings. """
from __future__ import print_function, division
from typing import Optional
__all__ = ["lex", "grlex", "grevlex", "ilex", "igrlex", "igrevlex"]
from sympy.core import Symbol
from sympy.core.compatibility import iterable
class MonomialOrder(object):
"""Base class for m... |
import os
import cv2
import numpy as np
import time
from torch.multiprocessing import Pool
from utils.nms_wrapper import nms
from utils.timer import Timer
from configs.CC import Config
import argparse
from layers.functions import Detect, PriorBox
from m2det import build_net
from data import BaseTransform
from utils.cor... |
import os
import sys
sys.path.append(os.getcwd())
import math
from workspace_intent_rl import workspace
import numpy as np
from utils.cal_methods import HistogramBinning, TemperatureScaling, evaluate, cal_results
def search_best_threshold(params, valid_output_info):
dataset_best_thresholds = []
dataset_best_v... |
import sys
import os
from datetime import datetime
VERSION_INFO = \
"""----------------------------
| BaseModel
| Version: 1.0.0
| Available feature
| * Snapshot
| Modified date: 2018.08.29.
----------------------------"""
print(VERSION_INFO)
def remove_flag(dir):
dirList = os.listdir(dir)
... |
# This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from marshmallow import fields, post_dump
from indico.core.db.sqlalchemy.links import LinkType
from indic... |
import os
import sys
import time
import json
import torch
from torch import nn, optim
from torch.utils.data import DataLoader, sampler
from tqdm import tqdm
import matplotlib.pyplot as plt
import numpy as np
import cv2
import math
from argument import get_args
from backbone import darknet53
from dataset import BOP_D... |
""" Utilities for transforming the syntax/style/grammar of a document, usually asciidoc or markdown
Instantiates Objects derived from the `_sre.SRE_Pattern` class (compiled regular expressions) so they work with regex.sub()
"""
import logging
# Simport regex
from copy import copy
from nlpia.regexes import Pattern, R... |
from sqlalchemy import create_engine, Column, Integer, Sequence, String
from sqlalchemy import func, select
from sqlalchemy.dialects.postgresql import array_agg
from sqlalchemy.exc import IntegrityError
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm.... |
import inspect
import os
from collections.abc import Iterable
from functools import lru_cache
from pathlib import Path, PurePath
from typing import Any, Callable, Dict, Generator, List, Optional, Union
from . import log
from .exceptions import FunctionNotFoundError
from .util import find_workflow_path, import_file
fro... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) The James Hutton Institute 2016-2019
# (c) University of Strathclyde 2019-2020
# Author: <NAME>
#
# Contact:
# <EMAIL>
#
# <NAME>,
# Strathclyde Institute for Pharmacy and Biomedical Sciences,
# 161 Cathedral Street,
# Glasgow,
# G4 0RE
# Scotland,
# UK
#
# The MIT L... |
"""Support for openroute service travel time sensors."""
from datetime import timedelta
import logging
from typing import Callable, Dict, Optional, Union, List
import openrouteservice
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
A... |
"""Module for functions that load additional data necessary to instantiate the
ContractReceive* state changes, i.e. state changes for the blockchain events.
It is *very* important that every function here only fetches **confirmed** data,
otherwise the node will be susceptible to races due to reorgs. These races can
cr... |
from __future__ import unicode_literals
from .compat import test_integer, normalize_string
class Undefined(Exception):
pass
class Type(object):
"""Conceptually, an instance of this class is a value space, a set of
JSON values. As such, the only method defined by the Teleport specification
is :meth:... |
#!/usr/bin/env python3
import sys
import torch
import logging
import speechbrain as sb
import torchaudio
from hyperpyyaml import load_hyperpyyaml
from speechbrain.utils.distributed import run_on_main
"""Recipe for pretraining a wav2vec 2.0 model on CommonVoice EN. Note that it can be
trained with ANY dataset as long ... |
from __future__ import print_function
from __future__ import division
import tensorflow as _tf
import ctypes as _ctypes
import os as _os
from functools import wraps as _wraps
_this_path = _os.path.split(__file__)[0]
_so = _tf.load_op_library(_os.path.join(_this_path, 'simnet_ops.so'))
_mex_helper = _ctypes.CDLL(_o... |
from dataclasses import dataclass
from enum import IntEnum, auto
import torch
from luafun.utils.options import option
from luafun.game.ipc_send import TEAM_RADIANT, TEAM_DIRE
def enumitems(enumclass):
return enumclass.__members__.items()
def print_tensor(tensor, enumclass, pfun=print, i=None):
"""Print a ... |
##############################################################################
#
# Copyright (c) 2001-2012 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... |
# coding: utf-8
# 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... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
import typing as tp
import warnings
from pathlib import Path
from typing import Any, List, Optional, Type, Union
from ..core import plugins... |
def calderon(A, interior_op, exterior_op, interior_projector, scaled_exterior_projector, formulation, preconditioning_type):
if formulation == "alpha_beta":
if preconditioning_type == "calderon_squared":
A_conditioner = A
elif preconditioning_type == "calderon_interior_operator":
... |
from typing import Any, List, Mapping, Tuple, Union
from collections import OrderedDict
import torch
from catalyst.callbacks.backward import BackwardCallback
from catalyst.callbacks.criterion import CriterionCallback
from catalyst.callbacks.optimizer import OptimizerCallback
from catalyst.callbacks.scheduler import S... |
'''
测试模块,请把输入文件改成9a, 9b, 10a, 10b,之类。
'''
import csv
import numpy as np
import os
def read_predicted(filename):
'''
读取待测试的数据
:param filename: 文件名 请写成'fitXXXXX.txt'形式
:return: 返回待测试数据的ndarray形式
'''
predicted = []
size = 0
f = open(filename, 'r')
reader = csv.reader(... |
# 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, ... |
#!/usr/bin/env python3
from testUtils import Utils
import testUtils
from Cluster import Cluster
from WalletMgr import WalletMgr
from Node import Node
from TestHelper import TestHelper
import time
import decimal
import math
import re
###############################################################
# node_producer_wate... |
"""!
@brief A dataset creation which is compatible with pytorch framework
@author <NAME> {<EMAIL>}
@copyright University of illinois at Urbana Champaign
"""
import torch
import argparse
import os
import sys
import glob2
import numpy as np
from sklearn.externals import joblib
import scipy.io.wavfile as wavfile
from to... |
PING_WAIT = 300 # Seconds
PING_MIN_WAIT = 30 # How long !start has to wait after a !ping
MINIMUM_WAIT = 60
EXTRA_WAIT = 20
MAXIMUM_WAITED = 3 # limit for amount of !wait's
STATS_RATE_LIMIT = 15
VOTES_RATE_LIMIT = 15
ADMINS_RATE_LIMIT = 300
SHOTS_MULTIPLIER = .12 # ceil(shots_multiplier * len_players) = bullets given... |
#!/usr/bin/env python3
"""
TSL2572 Control Module via I2C
2018/11/15
"""
import smbus
import time
class TSL2572:
AGAIN_0_16 = 0
AGAIN_1 = 1
AGAIN_8 = 2
AGAIN_16 = 3
AGAIN_120 = 4
ATIME_50MS = 0xED
ATIME_200MS = 0xB6
ATIME_600MS = 0x24
def __init__(self, i2c_addr):
self.... |
"""
models
======
This module provides an implementation of quantile regression neural networks (QRNNs)
using the pytorch deep learning framework.
"""
import torch
import numpy as np
from torch import nn
from torch import optim
from tqdm.auto import tqdm
activations = {"elu" : nn.ELU,
"hardshrink" : nn... |
# 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, overload
from .. import _utilities
from... |
# Copyright (c) 2020 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: <NAME> <<EMAIL>>
import typing
import asyncio
import logging
import pytest
import pyuavcan
_logger = logging.getLogger(__name__)
@pytest.mark.asyncio # type: ignore
async def _unittest_slow_node_tra... |
"""
SLP Graph Search Client
Performs a background search and batch download of graph
transactions from a Graph Search server. For more information about
a Graph Search server see:
* gs++: https://github.com/blockparty-sh/cpp_slp_graph_search
* bchd: https://github.com/simpleledgerinc/bchd/tree/graphsearch
This class... |
import pydrake.systems.scalar_conversion as mut
import copy
import unittest
from pydrake.autodiffutils import AutoDiffXd
from pydrake.symbolic import Expression
from pydrake.systems.framework import (
DiagramBuilder,
LeafSystem_,
SystemScalarConverter,
)
from pydrake.common.cpp_template import TemplateCla... |
"""Visualize an absorption lookup table.
Author: <EMAIL>
"""
import re
from itertools import zip_longest
import matplotlib.pyplot as plt
import numpy as np
from cycler import cycler
from matplotlib.lines import Line2D
from scipy.interpolate import interp1d
import typhon.constants
from typhon.plots import (ScalingFor... |
import pygame
pygame.init()
win = pygame.display.set_mode((500,480))
pygame.display.set_caption("First Game")
walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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... |
import copy
import os.path as osp
import numpy as np
import pytest
import xtcocotools
from xtcocotools.coco import COCO
from mmpose.datasets.pipelines import (BottomUpGenerateTarget,
BottomUpGetImgSize,
BottomUpRandomAffine,
... |
# Copyright 2014 Open Source Robotics Foundation, 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""QSTAR Utilities
"""
from __future__ import print_function
from itertools import combinations, permutations
import copy, sys
from igraph import Graph as iGraph
import numpy as np
import warnings
def compute_episodes(world_qsr):
"""
Compute QSR Episodes from a QSRLib.... |
"""Minimum graph runtime that executes graph containing TVM PackedFunc."""
from .._ffi.base import string_types
from .._ffi.function import get_global_func
from .._ffi._ctypes.function import ModuleHandle
from ..rpc import base as rpc_base
from .. import ndarray as nd
from tvm import module
from nnvm._base import ctype... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com <EMAIL>
import mimetypes
import random
from io import BytesIO
from os.path import dirname, jo... |
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import argparse
import torch
import torch.utils.data
from torch import nn, optim
from torch.autograd import Variable
import torch.nn as nn
from torch.nn import functional as F
from torchvision import datasets, transforms
from torchvision.utils import save_image
from torch.utils.data import TensorDataset
import numpy as... |
"""jc - JSON Convert lib module"""
import sys
import os
import re
import importlib
from typing import Dict, List, Iterable, Union, Iterator
from jc import appdirs
__version__ = '1.18.6'
parsers = [
'acpi',
'airport',
'airport-s',
'arp',
'asciitable',
'asciitable-m',
'blkid',
'cksum',
... |
from tkinter import *
import tkinter.font as tkfont
import transnetv2
import os
import cv2
from PIL import Image, ImageTk
import utils
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.project_path = os.getcwd()
self.video_file = StringVar(master... |
# Copyright 2015 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.
import unittest
import mock
from dashboard import ttest
class TTestTest(unittest.TestCase):
"""Tests for the t-test functions."""
def setUp(self):
... |
import http.server
import socketserver
import webbrowser
import json
import shutil
import logging
from functools import partial
from collections import defaultdict
import numpy as np
import scipy
from scipy.cluster.hierarchy import linkage
from cblaster.classes import Session
from cblaster.helpers import get_project... |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
"""
brozzler/__init__.py - __init__.py for brozzler package, contains some common
code
Copyright (C) 2014-2017 Internet Archive
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.apach... |
import contextlib
import logging
import sys
try:
import cStringIO as StringIO
except ImportError:
import StringIO
from vistrails.core.modules.vistrails_module import Module
def execute(modules, connections=[], add_port_specs=[],
enable_pkg=True, full_results=False):
"""Build a pipeline and e... |
import json
import logging
import os
import uuid
from http import HTTPStatus
from typing import Dict, Optional
import requests
import tornado.httpserver
import tornado.ioloop
import tornado.web
from adserver.base import CEModel
from adserver.protocols.request_handler import RequestHandler
from adserver.protocols.seldo... |
# -*- coding: utf-8 -*-
# Copyright 2020 Matrix.org Foundation C.I.C.
#
# 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... |
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch
import torch.utils.data as data
from torch.autograd import Variable
import numpy as np
from matplotlib import pyplot as plt
import time, pickle, itertools
import sys
sys.path.insert(0, '/Users/chanaross/dev/Thesis/MachineLea... |
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# THIS SOFTWARE IS PRO... |
import os
import pytest
import numpy as np
from sphinx.errors import ConfigError, ExtensionError
import sphinx_gallery
from sphinx_gallery.gen_gallery import _complete_gallery_conf
from sphinx_gallery.scrapers import (figure_rst, mayavi_scraper, SINGLE_IMAGE,
matplotlib_scraper, I... |
from django.shortcuts import render, redirect
from django.http import HttpResponse, JsonResponse
from django.core.urlresolvers import reverse
from django.views.generic import View
from apps.user.models import User, Address
from apps.goods.models import GoodsSKU
from celery_tasks.tasks import send_email_2_user
from djan... |
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2017-2021 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from sphinx.errors import ConfigError
from sphinx.errors import SphinxError
class ConfluenceError(SphinxError):
category = 'sphinxcontrib.confluencebuilder error'
cl... |
#!/usr/bin/env python3
'''
Deterministic numerical solver for ODE systems
<NAME>.
used for
Cardenas & Santos-Vega, 2021
Coded by github.com/pablocarderam
Creates heatmaps of contact rate and mutant fitness cost used in Figure 3b-c
'''
### Imports ###
import numpy as np # handle arrays
import pandas as pd
from scipy... |
# 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 agreed to in... |
from timeit import default_timer as timer
import itertools
import generatebids as gb
import productmix as pm
import os
import csv
import gc
gc.disable() # Makes tests more reliable
def generate_file(experiment_name, n, m, M, q, rep):
filename = ("experiments/{0}/experiment-{1}-{2}-{3}-{4}-{5}.json"
... |
import ctypes
import numpy as np
import numpy
from typing import Any
import time
def gen_timeIndices(sampleRate: float, pulseWidth: float) -> numpy.ndarray[numpy.float64][10000]:
step = 1.0 / sampleRate
timeIndices = np.arange(
-pulseWidth / 2.0, pulseWidth / 2.0 - (1.0 / sampleRate) + step, step
)... |
# Copyright 2020 The TensorFlow 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 applica... |
import copy
from django.db.models import signals
from django.utils.encoding import force_unicode
from haystack.fields import *
from haystack.utils import get_identifier, get_facet_field_name
class DeclarativeMetaclass(type):
def __new__(cls, name, bases, attrs):
attrs['fields'] = {}
# Inh... |
import glob
import os
from imageio import imread, imsave, imwrite
from tqdm import tqdm
import shutil
import random
import numpy as np
import matplotlib.pyplot as plt
from utils.dataset_processing import grasp, image
import tensorflow as tf
from skimage.filters import gaussian
from utils.dataset_processing import evalu... |
'''
https://github.com/christiancosgrove/pytorch-spectral-normalization-gan
chainer: https://github.com/pfnet-research/sngan_projection
'''
# ResNet generator and discriminator
import torch
from torch import nn
import torch.nn.functional as F
# from spectral_normalization import SpectralNorm
import numpy as np
from ... |
import copy
import json
import logging
import time
import requests
from django.contrib.gis.geos import WKTWriter, GEOSGeometry
from django.core.cache import cache
from urllib.parse import urljoin
from eventkit_cloud.utils import gdalutils
from eventkit_cloud.auth.views import has_valid_access_token
from eventkit_clou... |
#!python3
'''
Functions for matching names with rosters
'''
import sys
import xlsxwriter
from botutils.tabletools import tableclass as tc
from botutils.tabletools import tabletools as tt
from botutils.tkintertools import tktools
from botutils.ADB import AlumniDatabaseInterface as aDBi
def get_field_names(match_table):... |
"""
Contains all of the Fides resources modeled as Pydantic models.
"""
from __future__ import annotations
from enum import Enum
from typing import Dict, List, Optional
from pydantic import validator, BaseModel, Field, HttpUrl
from fideslang.validation import (
FidesKey,
sort_list_objects_by_name,
no_sel... |
from IPython import embed as shell
import itertools
import numpy as np
import random
# SEED = 1234
NUM_PROBS = 1
filename = "probs/pickplace_prob.prob"
GOAL = "(RobotAt sawyer robot_end_pose)"
SAWYER_INIT_POSE = [-0.5, -0.1, 0.912]
SAWYER_END_POSE = [0, 0, 0]
R_ARM_INIT = [-0.3962099, -0.97739413, 0.04612799, 1.742... |
#!/usr/bin/python3
#
# Copyright 2007 Google 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 b... |
# Copyright 2018 DeepMind Technologies Limited. 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 ... |
import logging
import re
from typing import Union
from bot.constants import Config
from discord import Emoji, Member, PartialEmoji, PermissionOverwrite, User
from discord.errors import Forbidden, HTTPException
from discord.ext import commands
from discord.utils import find, get
log = logging.getLogger(__name__)
cla... |
from collections import Counter
import json
import os.path as osp
import time
import torch
import numpy as np
from mmal.data_utils import CustomDataset
from mmal.dist_utils import gather
from mmal.uncertainty_utils import calculate_entropy_np, get_unique_indices
import mmcv
from mmcv.runner import get_dist_info
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.