text stringlengths 3.07k 12.6k |
|---|
"""This module tests the baseline function."""
# import functions and modules
import numpy as np
from voltcycle import file_read
from voltcycle import baseline
#Test functions:
def test_split():
"""
This function tests the split function.
The output of the function has to be np.array.
Split function sp... |
#!/usr/bin/env python3
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Verifies that new commits do not alter existing encoding patterns.
This test may be invoked in multiple ways:
1. Execute man... |
from datetime import datetime, timedelta
import threading
import logging
import time
from .schedules import one_time_schedule, interval_schedule, CalendarSchedule
logger = logging.getLogger(__name__)
class Reactor():
""" The reactor holds the main loop and constructs the plans """
def __init__(self):
... |
# Copyright 2020 <NAME>
# Copyright 2020 <NAME>, <NAME> and <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, <NAME>
#
# 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... |
#!/usr/bin/env python3
"""
expLoLer - explore LoL data
<EMAIL>
"""
from multiprocessing import Lock
from multiprocessing.pool import Pool
from os import listdir
from time import sleep
import json
import pickle
import requests
def api_get(endpoint: str, params: str = {}):
"""Base GET request for the Riot Game... |
import numpy as np
import pandas as pd
from html.parser import HTMLParser
import html
from sklearn import preprocessing
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.utils import shuffle
## TODO cosine without new users
# just desc
# dec and categ (handle categories differently ?)
# dec a... |
# Import Standard Libraries
import logging
import scipy as np
# Import Local Libraries
from Utilities import *
#===========================================================================
# EC2 Equations - Material properties
#===========================================================================
def elastic... |
# -*- coding: utf-8 -*-
# --------------------------
# Copyright © 2014 - Qentinel Group.
#
# 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/LIC... |
import os
import re
import numpy as np
from monty.io import zopen
from monty.serialization import loadfn, dumpfn
hf = re.compile(r"\s+SCF energy\s+=\s+([\-\.0-9]+)")
mp2 = re.compile(r"\s+MP2 energy\s+=\s+([\-\.0-9]+)")
ccsd_corr = re.compile(r"\s+CCSD correlation energy\s+=\s+([\-\.0-9]+)")
ccsd_total = re.compile(... |
import asyncio
from asyncio.streams import StreamWriter
from http.cookies import (
CookieError,
SimpleCookie
)
from http.client import responses as http_responses
from email.message import Message as EmailMessage
import urllib.parse
from .stream import LimitedReader
from .exceptions import BadRequestException
... |
#-*- coding: utf-8 -*-
# ============================================================================
# MIT License
#
# Copyright (c) 2019 hey-yahei
#
# 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 tensorflow as tf
# EPSILON is in preventing numeric overflow when encoding bounding boxes into delta form.
EPSILON = 1e-6
def intersection(bbox1, bbox2, scope=None):
"""Compute pairwise intersection areas between boxes.
Args:
bbox1: bbox holding N boxes
bbox2: bbox holding M boxes
... |
import codecs
import csv
import logging
from builtins import range
from fonduer.supervision.models import GoldLabel, GoldLabelKey
try:
from IPython import get_ipython
if "IPKernelApp" not in get_ipython().config:
raise ImportError("console")
except (AttributeError, ImportError):
from tqdm import ... |
"""
Merges two or more .json files in COCO Camera Traps format, optionally
writing the results to another .json file.
- Concatenates image lists, erroring if images are not unique.
- Errors on unrecognized fields.
- Checks compatibility in info structs, within reason.
combine_coco_camera_traps_files input1.json input2... |
#!/usr/bin/env python3
import numpy as np
import sys
from game import Game
#checks if the group of mons is valid and canonical
#which means no duplicates, must be in ascending order
def checkTeamSet(set):
counts = np.unique(set, return_counts=True)[1]
#no dupes, sorted
return np.all(np.unique(set, return... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... |
import uuid
from datetime import date, datetime, timezone
import mock
import pytest
from dateutil.relativedelta import relativedelta
import freezegun
from yamlscript import ExpressionGlobals, sub
class CustomGlobals(ExpressionGlobals):
@staticmethod
def my_func(i): return i*2
MOCK_NOW = datetime.utcnow()... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
import os
import sys
import logging
import yaml
import torch
import numpy as np
import pandas as pd
import sklearn.preprocessing as pre
from pprint import pformat
sys.path.append(os.getcwd())
def genlogger(outputfile, level="INFO"):
formatter = logging.Formatter(
... |
# Copyright 2017 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... |
# The opposite of deforming. See lightbus.utilities.deforming
import datetime
import inspect
import logging
from enum import Enum
from typing import Mapping, Type, get_type_hints, Union, TypeVar, Callable, Any
from base64 import b64decode
from lightbus.utilities.type_checks import (
type_is_namedtuple,
type_is... |
# -*- coding: utf8 -*-
# Copyright (c) 2019 <NAME>
#
# 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... |
# Copyright (c) AIRBUS 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.
from __future__ import annotations
from collections import defaultdict
from typing import Any, Dict, List, Set, Tuple
from skdecide import GoalMDPDoma... |
# Some functions are adapted from <NAME>:
# https://github.com/rowanz/neural-motifs
# Get counts of all of the examples in the dataset. Used for creating the baseline
# dictionary model
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import u... |
from itertools import chain
import json
import django
from django.core.urlresolvers import reverse
from django.conf import settings
from django.forms import widgets
from django.forms.util import flatatt
from django.utils.datastructures import MultiValueDict, MergeDict
from django.utils.html import escape, conditional_... |
# The MIT License (MIT)
#
# Copyright (c) 2018 <NAME>
#
# 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, me... |
# Copyright (c) Materials Virtual Lab.
# Distributed under the terms of the BSD License.
"""
Function to add edge data to MigrationGraph through 2 SC structures
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2021, The Materials Project"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__date__ = "February 2, 202... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from torch.nn.parameter import Parameter
from torch.autograd import Function
from torch.autograd import Variable
import numpy as np
from halp.utils.utils import void_cast_func, single_to_half_det, single_to_half_stoc
from ha... |
#
# File : gcc.py
# This file is part of CMCC IOT OS
# COPYRIGHT (C) 2012-2020, CMCC IOT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your... |
import collections, datetime, functools, itertools
import json, logging, pathlib, random, re
from logging import DEBUG, INFO, WARNING, ERROR, FATAL
import sds_ml
import sds_ml.sds_ml
import operator
SILENT = 0
log = logging.getLogger(__name__)
DimensionThreshold = collections.namedtuple("DimensionThreshold", ("dimens... |
import numpy as np
import trimesh
import json
import os
import logging
from pychop3d import bsp_tree
from pychop3d import bsp_node
from pychop3d.objective_functions import evaluate_utilization_objective, evaluate_nparts_objective
from pychop3d.configuration import Configuration
from trimesh.interfaces.blender import _... |
"""
Test basic Series functionality.
"""
import numpy as np
import pandas as pd
import pytest
import weld.grizzly as gr
types_ = ['int8', 'uint8', 'int16', 'uint16', 'int32',\
'uint32', 'int64', 'uint64', 'float32', 'float64']
def _test_binop(grizzly_op, pandas_op, name):
"""
Test binary operators, ... |
from typing import List, Union, Optional
import time
import math
import numpy as np
import itertools
import tqdm
from os import cpu_count
import concurrent.futures
from solver import Solver
from solver.s_n_k_mirror_solver import SnkMirrorSolver
from database import Graph, AngularGraphSolution
from utils import calculat... |
import os, unittest, numpy as np, pandas as pd
from typing import Tuple
from saspt.constants import TRACK, FRAME, PY, PX, RBME, RBME_MARGINAL, GAMMA, FBME
from saspt.lik import Likelihood, LIKELIHOODS, make_likelihood, RBMELikelihood
from saspt.trajectory_group import TrajectoryGroup
def assert_isinstance_all(type_, ... |
"""
--- Day 7: Some Assembly Required ---
This year, Santa brought little Bobby Tables a set of wires and bitwise logic gates!
Unfortunately, little Bobby is a little under the recommended age range, and he needs help assembling the circuit.
Each wire has an identifier (some lowercase letters) and can carry a 16-bit ... |
from django.db.models import Q
from django.db.models.constants import LOOKUP_SEP
from django.db.models.functions import Lower
from django.contrib.postgres.search import SearchVector
from django.core.exceptions import FieldDoesNotExist
from rest_framework_filters.backends import RestFrameworkFilterBackend
from rest_fra... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
# @author : <NAME>
# @Email : <EMAIL>
# @Project : Python_project
# @File : delicious_tagbased_tfidf.py
# @Software: PyCharm
# @Time : 2020/11/18 15:33
# code is far away from bugs with the god animal protecting
I love animals. They taste delicious.
┏ ┓ ... |
"""
"""
from jax import jit as jjit
from jax import numpy as jnp
from jax import vmap
@jjit
def _jax_get_dt_array(t):
dt = jnp.zeros_like(t)
tmids = 0.5 * (t[:-1] + t[1:])
dtmids = jnp.diff(tmids)
dt = dt.at[1:-1].set(dtmids)
t_lo = t[0] - (t[1] - t[0]) / 2
t_hi = t[-1] + dtmids[-1] / 2
... |
import datetime
import logging
from email.utils import parseaddr
import os
import requests
import vobject
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.conf import settings
from django.core.cache import cache
from django.core.mail import EmailMultiAlternatives
fro... |
# Copyright (c) 2021 <NAME>. All rights reserved
# Using this source code is governed by an MIT license
# you can find it in the LICENSE file.
from lox.ast.grammer import Expr, Binary, Unary, Grouping, Literal
from lox.ast.grammer import Stmt, PrintStatement, ExpressionStatement
from lox.ast.token import Token, TokenT... |
"""Bash-style brace expansion"""
import re
import string
import sys
from itertools import chain, product
__version__ = '0.1.5'
__all__ = ['braceexpand', 'alphabet', 'UnbalancedBracesError']
class UnbalancedBracesError(ValueError): pass
PY3 = sys.version_info[0] >= 3
if PY3:
xrange = range
alphabet = string.as... |
import cv2
import os
import sys
from PIL import Image
import numpy as np
from matplotlib import pyplot as plt
masks = ['Cytoskeleton', 'Desmosome', 'LipidDroplet', 'MitochondriaDark', 'MitochondriaLight', 'NuclearMembrane']
def watershed(img, save=None):
# cv2.namedWindow('img', cv2.WINDOW_NORMAL)
# cv2.resizeWin... |
from json import dump, load
class ConfigError(Exception):
pass
class Key:
def __init__(self, name, secret):
self.name = name
self.secret = secret
@classmethod
def from_file(cls, filename):
assert isinstance(filename, str)
with open(filename, 'r') as f:
da... |
import numpy as np
from deephyper.core.exceptions.problem import WrongProblemObjective
from deephyper.search import util
from deephyper.nas.space.node import ConstantNode, VariableNode
logger = util.conf_logger("deephyper.search.nas.run")
def load_config(config):
# ! load functions
config["load_data"]["func... |
import json
import flask
import sqlalchemy
from flask import request, jsonify
from sqlalchemy.orm.exc import NoResultFound
import zeeguu.core
from zeeguu.core.model import User, Cohort, Language, TeacherCohortMap, CohortArticleMap
from ._common_api_parameters import _convert_number_of_days_to_date_interval
from ._onl... |
import numpy as np
import torch
import torch.nn as nn
import warnings
from skimage.color import lab2rgb, rgb2lab
# ======================== For text embeddings ======================== #
SOS_token = 0
EOS_token = 1
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class Dictionary:
def __init_... |
from fontTools.misc.py23 import *
import weakref
from fontTools.ttLib import TTFont
from fontTools.pens.basePen import AbstractPen
from compositor.layoutEngine import LayoutEngine
from compositor.glyphRecord import GlyphRecord
from compositor.cmap import extractCMAP
from compositor.error import CompositorError
class... |
import os
import glob
import argparse
import numpy as np
from PIL import Image
import torch
from torch.utils.data import Dataset, DataLoader
from recon_pytorch.models.resnet_50 import resnet50_use
from recon_pytorch.load_data import BFM, Preprocess
from recon_pytorch.reconstruction_mesh import reconstruction, transfor... |
#
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, pu... |
import os
import logging
from logging.handlers import QueueHandler
from typing import Dict, Any
import yaml
import torch
from torch import nn
import torch.cuda
import torch.distributed as dist
from torch.utils.data import DataLoader
import torch.backends.cudnn
import cv_lib.utils as utils
import cv_lib.distributed.ut... |
"""
PR PDF
Main Server File
2020 maschhoff github.com/maschhoff
"""
import os
from flask import Flask, render_template, request, redirect
from datetime import datetime, date
import logging
import time
import threading
import shutil
import random
import json
import settings
import autoscan
import merge
import spli... |
import mock
import unittest
from vnc_api.vnc_api import *
from svc_monitor.virtual_machine_manager import VirtualMachineManager
from svc_monitor.config_db import *
class VMObjMatcher(object):
"""
Object for assert_called_with to check if vm object is created properly
"""
def __init__(self, index):
... |
from flask import Flask, request, redirect
import requests
from withings_api_example import config
import datetime
from sqlalchemy import create_engine
import psycopg2
import json
import datetime
import pandas as pd
def write_df_to_postgres(data_frame, table_name):
engine = create_engine("postgresql+psycopg2:... |
import os
import sys
from devp2p.service import BaseService
from ethereum.db import BaseDB
from gevent.event import Event
from gevent.hub import getcurrent
import leveldb
from ethereum import slogging
from ethereum.utils import encode_hex
import random
slogging.set_level('db', 'debug')
log = slogging.get_logger('db')
... |
from django import forms
from django.contrib import admin
from django.contrib.contenttypes.admin import GenericStackedInline
from django.utils.translation import ugettext_lazy as _
from django.utils.functional import curry
from django.http import HttpResponseRedirect
from .models import Subsystems,AutomationVariables,... |
# 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 ray
import torch
from lgp.abcd.agent import TrainableAgent
from lgp import paths
class RolloutActorLocal:
def __init__(self,
experiment_name: str,
agent : TrainableAgent,
env,
dataset_proc,
param_server_proc,
... |
import torch
import torch_blocksparse
from time import time
from utils import *
from nose.tools import nottest
from parameterized import parameterized
# run reference implementation
@nottest
def run_mm_reference(x, w, mode, trans_a, trans_b, layout, block, dy):
x = sparse_to_dense(x, layout, block) if mode == 'dsd' ... |
import errno
import os
import shutil
import unicodedata
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import colorama
import pathspec
from jinja2 import FileSystemLoader
from jinja2.sandbox import SandboxedEnvironment
from packaging import version
from pydantic import StrictBool
from yam... |
"""Types for Coverage File
Spec: https://github.com/cobertura/web/blob/master/htdocs/xml/coverage-04.dtd
Some amount of liberty is added by allowing optionals
"""
from functools import reduce
from operator import add
from pathlib import Path
from time import time_ns
from typing import List, Optional
from pydantic im... |
# ~\~ language=Python filename=shader_dsl.py
# ~\~ begin <<docs/python_dsl.md|shader_dsl.py>>[0]
# ~\~ begin <<docs/python_dsl.md|imports>>[0]
from __future__ import annotations
from dataclasses import dataclass
from typing import List, Dict, Tuple, Any, Union
# ~\~ end
# ~\~ begin <<docs/python_dsl.md|imports>>[1]
imp... |
import tensorflow as tf
import numpy as np
import cv2
import os
from data import pascal
from model.faster_rcnn import FasterRCNN
from config.config import cfg
from model.utils.nms.cpu_nms import cpu_nms
# Though pure python nms is slightly slower then cython implementation,
# still ~2 times faster then tf.image.non_max... |
#!/usr/bin/env python
# Quick rough & ready maze generator for Minecraft Pi edition.
# <NAME> 2013
# mcpipy.com retrieved from URL below, written by davef21370
# https://github.com/brooksc/mcpipy/blob/master/davef21370_maze.py
from __future__ import print_function
import mcpi.minecraft as minecraft
impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
import editdistance
from nlp import sbd
from utils import to_pickle, check_lang
from normalize import clean_wiki, clean_punct, clean_tag
from typing import List, Text, Iterator, Dict
def preprocess(rev_pair: Text) -> Dict[str, str]:
rev = di... |
import os
import pandas as pd
import requests
from tqdm import tqdm
tqdm.pandas()
from pandarallel import pandarallel
from gensim.summarization import keywords
from gpt2_client import *
import gpt_2_simple as gpt2
import tensorflow as tf
from itertools import groupby
from termcolor import colored, cprint
import sy... |
# Copyright 2020 gRPC 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 to in writing... |
import json
import configparser
import binascii
from itertools import chain
import os
tag = 'DB_COMM_MESSAGE: '
PATH_DRONEBRIDGE_TX_SETTINGS = "/boot/DroneBridgeTX.ini"
PATH_DRONEBRIDGE_RX_SETTINGS = "/boot/DroneBridgeRX.ini"
PATH_WBC_SETTINGS = "/boot/wifibroadcast-1.txt"
# As we send it as a single frame we do not ... |
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2017 Prof. <NAME> (<EMAIL>),
# Prof. <NAME> (<EMAIL>) and the RMG Team (<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of... |
import os
import time
import argparse
import os.path
import shutil
_PACKAGE_MANAGERS = {1: 'apt', 2: 'pacman', 3: 'dnf', 4: 'zypper', 5: 'eopkg', 6: 'yum'}
def parse_cmd():
# Parse command line arguments
parser = argparse.ArgumentParser(description='script for NVFBC Patch into OBS, v1.1.')
parser.add_arg... |
import pathlib
import re
import sys
from functools import cached_property
from typing import Iterator, List, Pattern
from packaging import version
from aio.run import checker
from envoy.base.utils import IProject, Project
INVALID_REFLINK = r"[^:]ref:`"
REF_WITH_PUNCTUATION_REGEX = r".*\. <[^<]*>`\s*"
# Make sure b... |
#!/usr/bin/python
from wikitools_py3 import wiki
from wikitools_py3.api import APIRequest
from wikitools_py3.exceptions import WikiError, NoPage
from wikitools_py3.wikifile import File
from wikitools_py3.page import Page
import logging
import traceback
import re
import os
logger = logging.getLogger('WikiReviewClass')... |
# -*- coding: utf-8 -*-
import random as rand
class PrimeTester(object):
def solovay_strassen(self, primo, acuracidade=5):
nro_tentativas = 0
if primo == 2 or primo == 3:
return (nro_tentativas, True)
if primo < 2:
raise ValueError('Entrada < 2')
if primo %... |
""" Stub Generator for IronPython
Extended script based on script developed by <NAME> at:
gitlab.com/reje/revit-python-stubs
This is uses a slightly modify version of generator3,
github.com/JetBrains/intellij-community/blob/master/python/helpers/generator3.py
Iterates through a list of targeted assemblies an... |
"""Standard Gibbs sampling algorithm on a Factor Graph.
- Compute conditional scores on a factor given a set of variables (i.e. labels)
- Take one Gibbs sampling step
- Gibbs sampling inference with annealing
"""
import random
import logging
from typing import List, Tuple, Callable
import numpy as np
import torch
from... |
# Copyright 2021 DeepMind Technologies 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
# %%
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--cell_line', nargs=1, type=str, help='cell line to run on')
parser.add_argument('--name', nargs=1, type=str, help='name of dataset')
parser.add_argument('--shuffle', nargs=1, type=str, help='Permute nodes or not')
args = parser.parse_args()
... |
# ===============================================================================
# Copyright 2015 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
# Author: <NAME>, Karlsruhe Institute of Technology, Germany
# Script to load the data related to the COVID-19 gathered by the Johns Hopkins University and to plot the phase diagram of the confirmed cases or deaths. X-axis is the gradient (=new case/day) and Y-axis is the curvature (=variation of new case/day)
# Source... |
from django import forms
from django.contrib import messages
from django.db.models import Q
from django.shortcuts import render
from django.views.generic import CreateView
from django.views.generic import DetailView
from django.views.generic import DeleteView
from django.views.generic import UpdateView
from django.vie... |
import requests
import time
from urllib.parse import unquote, urlencode
from datetime import datetime
from models import dev_db
from peewee import (
CharField,
IntegerField,
TextField,
DateTimeField,
IntegerField,
BigIntegerField,
BooleanField,
FloatField,
DecimalField,
Integr... |
""" Defines localization datamodel for PATH anlysis and more"""
from typing import IO
import numpy as np
import healpy as hp
import astropy_healpix
from astropy.table import Table
from astropy.coordinates import SkyCoord
from astropy import units
from astropy.wcs import WCS
from astropath import utils
from IPython ... |
#! /usr/bin/env python
#-*- coding: utf-8 -*-
# ***** BEGIN LICENSE BLOCK *****
# This file is part of Shelter Database.
# Copyright (c) 2016 Luxembourg Institute of Science and Technology.
# All rights reserved.
#
#
#
# ***** END LICENSE BLOCK *****
__author__ = "<NAME>"
__version__ = "$Revision: 0.2.1 $"
__date__ =... |
#! /usr/bin/env python
"""
Use the new function type approach to rewrite the dubins car problems
This time I will use 2 million states seen by the RL algorithm so they are comparable
"""
import copy
import glob
import os
import time
import numpy as np
import numba
import matplotlib
matplotlib.use('TkAgg')
import matp... |
#
# Copyright 2017 Human Longevity, 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 ... |
from api.models import Face
from api.models import Person
import base64
import pickle
import itertools
import ipdb
from scipy import linalg
from sklearn.decomposition import PCA
import numpy as np
from sklearn import cluster
from sklearn import mixture
from scipy.spatial import distance
from sklearn.preprocessing imp... |
#!/usr/bin/env python3
import roslib
roslib.load_manifest("multiple_grasping_pose_learning")
import rospy
import cv2
import collections
from cv_bridge import CvBridge
import numpy as np
from PIL import Image
from PIL import ImageDraw, ImageFont
from sensor_msgs.msg import Image as ImageMsg
from pycoral.adapters import... |
# -*- coding: utf-8 -*-
# @Time : 2019/8/26 9:12
# @Author : Tony
"""神经网络测试用例"""
import sys
import numpy as np
from datetime import datetime
from app.cta_strategy.neural_network import NeuralNetwork
from trader.constant import Exchange, Interval
from vnpy.trader.database import database_manager
def make_input_d... |
from abc import ABC, abstractmethod
from typing import Optional
import numpy as np
from fedot.core.data.data import OutputData
from fedot.core.log import Log, default_log
from fedot.core.repository.dataset_types import DataTypesEnum
class DataOperationImplementation(ABC):
""" Interface for data operations realis... |
import sys
import os
import shutil
import time
import csv
import re
from decimal import *
from datetime import datetime
from piecash import open_book, ledger, Account, Commodity, Transaction, Split, GnucashException
folder_path = sys.argv[1]
gnucash_db_path = sys.argv[2]
# este script necessita das notas de corretag... |
###
### Copyright (C) 2018-2019 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
from ....lib import *
from ....lib.gstreamer.msdk.util import *
from ....lib.gstreamer.msdk.vpp import VppTest
if len(load_test_spec("vpp", "deinterlace")):
slash.logger.warn(
"gst-msdk: vpp deinterlace with raw ... |
import numpy as np
import pandas as pd
from pathlib import Path
import bw2data as bd
import bw_processing as bwp
from fs.zipfs import ZipFS
from consumption_model_ch.utils import get_habe_filepath
# Local files
from .sensitivity_analysis import get_mask
DATA_DIR = Path(__file__).parent.resolve() / "data"
KONSUMGUET... |
"""Type mapping helpers."""
from __future__ import division
__copyright__ = "Copyright (C) 2011 <NAME>"
__license__ = """
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, inc... |
# -*- coding: utf-8 -*-
"""
transistor.utility.utils
~~~~~~~~~~~~
This module contains various utilities useful to maintain in Transistor source code.
:copyright: Copyright (C) 2018 by BOM Quote Limited
:license: The MIT License, see LICENSE for more details.
~~~~~~~~~~~~
"""
from functools import wraps
from time imp... |
'''
Created on Feb 21, 2020
@author: daniel
'''
import logging
import loraserver
import oy1110
import lr210
logging.basicConfig(level=logging.INFO)
LOGGER = logging.getLogger(__name__)
class RHTThermostat(object):
'''
Implements a thermostat based on both RH and temp data
'''
def __init__(self, min... |
#!/usr/bin/python
import time
import numpy as np
import sys
import wx
from wx.lib import masked
from floatcontrol import FloatCtrl
from wxmplot import PlotPanel
def next_data():
"simulated data"
t0 = time.time()
lt = time.localtime(t0)
tmin, tsec = lt[4],lt[5]
u = np.random.random()
v = np.rand... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Bulk saving objects for performance
"""
import logging
from typing import Any, Dict, Optional
from .db import DB
from .decorators impor... |
class ServiceError(Exception):
"""Base class for all :mod:`lms.services` exceptions."""
class LTILaunchVerificationError(ServiceError):
"""
Raised when LTI launch request verification fails.
This is the base class for all LTI launch request verification errors.
Different subclasses of this except... |
import glob
import copy
from pathlib import Path
from typing import NamedTuple
from scipy.spatial.transform import Rotation
from PIL import Image
class OBJMetadata(NamedTuple):
object_name: str
n_vertices: int
n_triangles: int
mtl_file: str
def get_renderer_args(args):
renderer_args = {
'... |
import cv2
import numpy as np
import math
import time
cap = cv2.VideoCapture(0)
test_img = cv2.imread('test_red.png')
kernel = np.ones((5, 5), np.uint8)
# imgray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# BGR
# ret,thresh = cv2.threshold(imgray, 127, 255, 0)
# image, contours, hierarchy = cv2.findContours(thresh,cv2.RET... |
from pytorch_lightning.accelerators import accelerator
from torch.nn.modules.activation import ReLU
from torch.nn.modules.conv import Conv2d
from torch.nn.modules.loss import MSELoss
from torchvision.models.densenet import _load_state_dict
from tools.misc import load_model
import os
from torch.utils.tensorboard impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.