text stringlengths 3.07k 22.1k |
|---|
from django.db import connection, models
from django.db.models import Q
from django.db.transaction import atomic
from credit import InvalidCreditStateException
from credit.constants import LOG_ACTIONS, CREDIT_STATUS, CREDIT_RESOLUTION
class CreditQuerySet(models.QuerySet):
def credit_pending(self):
retur... |
from rent_cafe_scraper import house_scraper
from open_table_scraper import generate_restaurant_score
from googleMapApi import googleMapApi
from util import *
import numpy as np
import user_interface
from tqdm import tqdm
import time
import sys
def match_house(search_zipcode, price_ceiling):
house_df = house_scrap... |
#!/usr/bin/env python
# work with MPU6050_kalman.ino
from PyQt5 import QtCore, QtWidgets, uic, QtGui
from pyqtgraph import PlotWidget
from PyQt5.QtWidgets import QApplication, QVBoxLayout
import pyqtgraph as pg
import numpy as np
import datetime
import serial
import sys
import os
import time
from time import sleep
fro... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import numpy as np
from scipy.interpolate import interp2d, UnivariateSpline, griddata
from scipy import constants
e = constants.elementary_charge
def calc_svcx_st(T):
tint = np.array([-1, 0, 1, 2, 3])
tnnt = np.array([0, 1, 2])
cx = np.array([[-1.4097E+01, ... |
import numpy
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans
from sklearn.metrics.cluster import v_measure_score
from scipy.spatial.distance import cdist
def initial_clustering(kpred, datapoints):
model = KMeans(n_clusters=kpred).fit(datapoints)
pred_c... |
from django.db import models
LANGUAGES = (
('en', 'English'),
('es', 'Spanish'),
('it', 'Italian')
)
class Channel(models.Model):
name = models.CharField(max_length=50)
enabled = models.BooleanField(default=False)
status = models.BooleanField(default=False, blank=True, editable=False)
url... |
import sys
import math
import os
import shutil
import logging
import tempfile
from .base import *
from .dataset import *
from .stagerunner import *
if sys.version_info.major == 3:
import dampr.settings as settings
else:
import settings
class Source(object):
CNT = 0
def __init__(self, name):
s... |
import json
from collections import OrderedDict
from multiprocessing import Manager, Process, Lock, Value
from os import listdir, mkdir
from os.path import join, basename, exists
from src.Common import config
from src.Common.Extraction import LabelExtractor
from src.Common.utils import get_debug_report_paths, get_repo... |
import json
import re
import datetime
import pycurl
import certifi
from io import BytesIO
from lxml import etree
class ScrapeException(Exception):
pass
class RequestException(Exception):
pass
class AppID():
def __init__(self, id, name):
self.id = id
self.name = name
def __eq__(self, o):
return s... |
from . import importer
from . import gatherers
from . import typing
from .typing import Var, tyinstance, Misc
from . import flags
from . import typefinder
from . import inferfinder
from . import inference
from . import relations
from . import annotation_removal
from . import logging
from .exc import StaticTypeError
fro... |
import os
import torch as th
import pybullet_envs
import gym
import numpy as np
from stable_baselines3 import SAC, PPO
from stable_baselines3.common.env_util import make_vec_env
from stable_baselines3.common.vec_env import VecNormalize
from stable_baselines3.common.evaluation import evaluate_policy
import base64
fr... |
#!/bin/python3
from math import ceil
def f2(dist):
return dist ** 1.435
dp_dict = {}
def dp(m1,m2,pos,draw_adv):
if pos == 0:
return (1,0)
if pos == 10:
return (0,0)
if m1 == 0:
if m2 >= 10-pos:
return (0,0)
return (1,0)
if m2 == 0:
... |
'''
################################
# Pre-process AICC19 data #
################################
'''
import os
import cv2
import time
import numpy as np
from sklearn.model_selection import train_test_split
# importing shutil module
import shutil
class dataset_parameters():
def __init__(self):
self.... |
import numpy as np
import random
from collections import namedtuple, deque
from model import QNetwork
import torch
import torch.nn.functional as F
import torch.optim as optim
BUFFER_SIZE = int(1e5) # replay buffer size
BATCH_SIZE = 128 # minibatch size
GAMMA = 0.99 # discount factor
TAU = 1e-3 ... |
# -*- coding: utf-8 -*-
"""Supports the Ion Velocity Meter (IVM) onboard the Communication
and Navigation Outage Forecasting System (C/NOFS) satellite, part
of the Coupled Ion Netural Dynamics Investigation (CINDI). Downloads
data from the NASA Coordinated Data Analysis Web (CDAWeb) in CDF
format.
The IVM is composed ... |
import argparse
import pandas as pd
import sys, os
import numpy
from util import top_words, nltk_helper
import nltk
from collections import Counter
from collections import defaultdict
# helper function to parse lyrics string in the csv
def __get_lyrics(song):
lyrics_str = song['lyrics']
# Split into the word... |
#!/usr/bin/pythonRoot
from __future__ import division
from PIL import Image
from PIL import ImageFilter
from PIL import ImageFont
from PIL import ImageDraw,ImageOps
from flup.server.fcgi import WSGIServer
from subprocess import call
from multiprocessing import Process,Pipe
from configobj import ConfigObj
import cgitb
i... |
from pandas import DataFrame as DF
from pandas import Series
import numpy as np
class NelsonRule:
RULES = {
1:{
'num':1,
'desc':'One point is more than 3 standard deviations from the mean',
'problem':'One sample is grossly out of control.',
},
2:{
... |
""" Module containing classes to perform analysis of the tree search results.
"""
import json
import hashlib
import numpy as np
import networkx as nx
from aizynthfinder.chem import Molecule, UniqueMolecule
from aizynthfinder.utils.image import GraphvizReactionGraph
class TreeAnalysis:
"""
Class that encapsu... |
from typing import Dict, List
from kf_lib.kung_fu import boosts as b
from kf_lib.things import weapons
from kf_lib.utils import add_sign
class Tech:
def __init__(
self,
name,
fav_moves: set = None,
is_upgradable=False,
is_advanced=False,
is... |
import time
import logging
import pytest
import uuid
from pytest_zafira.constants import PARAMETER, TEST_STATUS, CONFIG
from .api import zafira_client
from .utils import Context
from .exceptions import ZafiraError
class PyTestZafiraPlugin:
"""
Contains hook implementations and helper methods
"""
ZAF... |
import time
import bpy
from .. import registry, utils
from ..details import types as det_types
from . import utils as utils_props
def _gen_time_prop(prop, description=''):
fmt = '%Y.%m.%d %H:%M'
fmt_day = '%Y.%m.%d'
def getter(self):
tval = getattr(self, prop)
return time.strftime(fmt, ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2020) Hewlett Packard Enterprise Development LP
#
# 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/licen... |
import asyncio
import logging
from typing import Any, Awaitable, Dict, List, Optional, Union
import aiohttp
from ..store import DataStore, DataStoreInterface
from ..typedefs import Item
from ..ws import ClientWebSocketResponse
logger = logging.getLogger(__name__)
class BybitDataStore(DataStoreInterface):
def _... |
#
# 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 us... |
from pwn.internal.shellcode_helper import *
import pwn
import string
@shellcode_reqs(arch=['i386', 'amd64', 'arm', 'thumb'])
def mov(dest, src, stack_allowed = True, arch = None):
"""Does a mov into the dest while newlines and null characters.
The src can be be an immediate or another register.
If the st... |
"""
Fits each training star to the full atmosphere model, possibly plus interp if given. Save the resultant parameters, errors, and shapes.
Then makes plots of the rho stats, parameter distributions, and star residuals
"""
from __future__ import print_function, division
import numpy as np
import matplotlib
matplotlib.... |
# coding: utf-8
from pandas import *
from numpy import *
import tushare as ts
import os
import sqlite3
import threading
import time
from pyquery import PyQuery as pq
from urllib.request import urlopen, Request
import json
from datetime import datetime,date
from tushare.stock import cons as ct
import os
import requests... |
"""
The validation module implements the :py:func:`parse_input` function.
.. testsetup::
import typing
import validobj
"""
from typing import Set, Union, Any, Optional, TypeVar, Type
try:
from typing import Literal
except ImportError: # pragma: nocover
HAVE_LITERAL = False
else:
HAVE_LITERAL... |
"""
Simple runner to prepare subsets of the PlantVillage dataset for running FedAvg workers.
Create train, test and validation sets for training a classifier for leaf diseases.
Create as many subsets as needed for the training and validation data, with predefined
distributions for the training sets between the various... |
#!/usr/bin/python3
# coding=utf-8
#
# Copyright © 2018 UnravelTEC
# <NAME> <<EMAIL>>
#
# 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 3 of the License, or
# (at your option) any ... |
import random
import math
from pysc2.env import sc2_env
from absl import app
import numpy as np
import pandas as pd
from pysc2.agents import base_agent
from pysc2.lib import actions
from pysc2.lib import features
_NO_OP = actions.FUNCTIONS.no_op.id
_SELECT_POINT = actions.FUNCTIONS.select_point.id
_BUILD_SUPPLY_DEP... |
# engine/strategies.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Strategies for creating new instances of Engine types.
These are s... |
# Copyright 2015 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 by applicable law or a... |
"""
This script is used to compare the strategies/algorithms in the FE-HPO selection
problem and Bayesian optimization based solution (Auto-scikitlearn)
"""
import os
import sys
import pickle
import argparse
import tabulate
import numpy as np
from sklearn.metrics import balanced_accuracy_score
sys.path.append(... |
import ctypes
from typing import Iterator, List, Tuple
import win32api
import win32con
import win32gui
import win32process
from pynput.keyboard import Controller, Key
from systa.exceptions import NoMatchingWindowError
user32 = ctypes.WinDLL("user32", use_last_error=True)
MIN_ALL = 419
MIN_ALL_UNDO = 416
def get_w... |
# -*- coding: utf-8 -*-
from os import path
import imp
import inspect
import pkg_resources
import traceback
import sys
from twisted.internet import reactor
from ..events import Hook, ServerInput, ServerStarted, ServerStopping
class PluginLoadError(Exception):
def __init__(self, message, exc=None):
self.... |
# -*- coding: utf-8 -*-
from collections import OrderedDict, defaultdict
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db.models import ProtectedError, FieldDoesNotExist
from django.db.models.fields.related import ForeignObjectRel
... |
"""
Basic data structures
"""
import io
import re
from stanfordnlp.models.common.conll import FIELD_TO_IDX as CONLLU_FIELD_TO_IDX
multi_word_token_line = re.compile("([0-9]+)\-([0-9]+)")
class Document:
def __init__(self, text):
self._text = text
self._conll_file = None
self._sentences... |
import numpy as np
from utils.losses_pytorch import weighted_mse_loss, iou_loss, CrossEntropy2d
import torch
from torch.autograd import Variable
from learning.utils_learn import clamp_tensor
def get_torch_std(info):
std_array = np.asarray(info["std"])
tensor_std = torch.from_numpy(std_array)
tensor_std = t... |
import os
from tempfile import TemporaryDirectory
from forest.cmake_tools import CmakeTools
from forest.common import eval_handler
from forest.common import print_utils
from forest.common.fetch_handler import CustomFetcher
from forest.common.print_utils import ProgressReporter
from forest.common import proc_utils
cl... |
"""The beam search module."""
from collections import OrderedDict
from six.moves import range
import logging
import numpy
from picklable_itertools.extras import equizip
import theano
from theano import function
from blocks_extras.bricks.sequence_generator2 import SequenceGenerator
from blocks.filter import VariableFi... |
# from tqdm import tqdm
from time import time
import numpy as np
import random
import re
import torch
from torch.utils.data import DataLoader, random_split
import torch.optim as optim
import torch.nn as nn
import torchvision.transforms as transforms
from sklearn.linear_model import LogisticRegression
from sklearn.ense... |
import re
from collections import OrderedDict
from datetime import datetime
import moment
# Regex list of lowercase months with characters after the first three made optional
MONTH_NAMES = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august',
'september', 'october', 'november', 'december']
MONTH... |
'''Example script showing how to use a stateful LSTM model
and how its stateless counterpart performs.
More documentation about the Keras LSTM model can be found at
https://keras.io/layers/recurrent/#lstm
The models are trained on an input/output pair, where
the input is a generated uniformly distributed
random seque... |
import base64
import functools
import pickle
import sys
from collections import OrderedDict, namedtuple
from datetime import datetime
ObjReference = namedtuple("ObjReference", "value_type class_name identifier")
# This file encodes/decodes values to send over the wire
if sys.version_info[0] >= 3:
class Invalid... |
# Copyright 1999-2020 Alibaba Group Holding 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 a... |
# -*- coding: utf-8 -*-
#
# SelfTest/Cipher/test_pkcs1_15.py: Self-test for PKCS#1 v1.5 encryption
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone i... |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 7 18:31:38 2021
@author: yoonseok
대상기간 : 1998 - 2020
적용대상 : 사업보고서 제출대상
"""
from bs4 import BeautifulSoup
import os
import glob
import pandas as pd
import numpy as np
from tqdm import tqdm
def col_span_count(soup):
try:
result = int(soup["colspan"])
e... |
# -*- coding: utf-8 -*-
import asyncio
from datetime import date
from unittest.case import skip
import aiomysql
import logging
import unittest
from pymysql.err import OperationalError
logging.basicConfig(level=logging.INFO)
def log(sql, args =()):
logging.info('SQL:%s, ARGS:%s' % (sql, args))
# SQL操作
__pool = ... |
from __future__ import division, print_function, unicode_literals
import re
from functools import wraps
from hashlib import sha1
from inspect import getframeinfo, stack
from os import path, stat
from socket import (
error as socket_error,
timeout as timeout_error,
)
from types import GeneratorType
import cli... |
import datetime
from freezegun import freeze_time
from ecmwf.opendata.date import canonical_time, end_step, full_date
@freeze_time("2022-01-21T13:21:34Z")
def test_date_1():
assert full_date("20010101") == datetime.datetime(2001, 1, 1)
assert full_date(20010101) == datetime.datetime(2001, 1, 1)
assert ... |
# coding:utf-8
import datetime
from flask import request, g, jsonify, current_app
from ihome import db, redis_store
from ihome.utils.commons import login_required
from ihome.utils.response_code import RET
from ihome.models import House, Order
from . import api
@api.route("/orders", methods=["POST"])
@login_required... |
from __future__ import absolute_import, division, print_function
import mmtbx.dynamics
from mmtbx.dynamics import constants
from mmtbx.dynamics import cartesian_dynamics
import mmtbx.restraints
import mmtbx.monomer_library.pdb_interpretation
import mmtbx.monomer_library.server
from cctbx.array_family import flex
from l... |
"""
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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... |
import time
import asyncio
import discord
from discord.ext import commands
from discord.utils import escape_markdown
from youmu.modules import permissions
from youmu.reusables import send_large_message
from youmu.reusables import list_helpers
from youmu.embeds import GroupFeed as GroupFeedEmbeds
class FakeUser:
d... |
import discord
import secrets
from asyncio import sleep
from aiohttp import ClientSession, BasicAuth
class Conversation:
steps = {}
def __init__(self, dm_channel):
self.channel = dm_channel
self._current = "init"
async def go(self):
if hasattr(self._current, '__call__'):
... |
#!/usr/bin/env python3
import argparse
import os
import sys
from typing import Any
from selfdrive.car.car_helpers import interface_names
from selfdrive.test.openpilotci import get_url, upload_file
from selfdrive.test.process_replay.compare_logs import compare_logs, save_log
from selfdrive.test.process_replay.process_r... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
import sys
import textwrap
import six
import pytest
from _pytest.monkeypatch import MonkeyPatch
@pytest.fixture
def mp():
cwd = os.getcwd()
sys_path = list(sys.path)
yield Mo... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
"""
This is for test:
this version support request header not support response header
"""
from __future__ import absolute_import
import os.path
import time
import copy
import contextlib
import threading
import uuid
from thriftpy2.thrift import TClient, TApplicationException, TMessageType, \
... |
# predict_promoter_signal.py
# given a fasta file of upstream regions for a set of
# genes, run these seqs through bioprospector to search
# for promoter motifs. By default, we search for motifs
# of the structure: hexamer , 15-18bp spacer , hexamer
# and bioprospector is run 20 times then summarized to
# pick the "... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 8 13:18:12 2021
@author: <NAME>
Date: May 15, 2021
This code defines geoemtrical elements by a set of points. It also calculates the
normal vector for each surface of that geometry.
Definition parameters:
- In geo_pointsX() functions, the ... |
#
# Copyright 2021 Espressif Systems (Shanghai) 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright [2017] <NAME> [<EMAIL>]
#
# 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
#
# Unles... |
from dataclasses import dataclass, field
import os
import time
from threading import Lock
from typing import Dict, Iterable, Iterator, Optional, Tuple
from ouster.client import (LidarPacket, ImuPacket, Packet, PacketSource,
SensorInfo)
from ouster.pcap import _pcap
# TODO: Look into at pos... |
import torch
import torch.nn as nn
from torch.nn import init
from torchvision import models
from torch.autograd import Variable
# import pretrainedmodels
######################################################################
def weights_init_kaiming(m):
classname = m.__class__.__name__
# print(classname)
i... |
from pytorch3d.renderer.cameras import OpenGLOrthographicCameras, SfMOrthographicCameras
from pytorch3d.io import load_objs_as_meshes
from pytorch3d.renderer import (DirectionalLights, MeshRasterizer, MeshRenderer,
OpenGLPerspectiveCameras, RasterizationSettings,
... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from torch.autograd import Variable
import math
import copy
from load_data import EXTRA_CHARS
class OneHotEmbedding(nn.Module):
def __init__(self, alphabet_size):
super().__init__()
self.alphabet_size = alphabet_... |
from dateutil import parser
import datetime
import urllib
import re
import git
import sqlalchemy
import yaml
import os
import pandas as pd
import pytz
import db_ops
import parse_ddl
# Load the config yaml file
CONFIG_FILE = os.path.join(os.path.dirname(__file__), 'config.yaml')
with open(CONFIG_FILE) as yaml_file:
... |
# Development tool - utility commands plugin
#
# Copyright (C) 2015-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope... |
import logging
from collections import namedtuple
from dtest import RUN_STATIC_UPGRADE_MATRIX
from conftest import cassandra_dir_and_version
import ccmlib.repository
from ccmlib.common import get_version_from_build
from enum import Enum
logger = logging.getLogger(__name__)
# UpgradePath's contain data about upgra... |
from pycqed.measurement import measurement_control as mc
import adaptive
from pycqed.instrument_drivers.meta_instrument.LutMans import flux_lutman as flm
from pycqed.instrument_drivers.virtual_instruments import noise_parameters_CZ_new as npCZ
from pycqed.simulations import cz_superoperator_simulation_new_functions a... |
#-------------------------------------------------------------------------------
# A set of methods to help reading and writing Spheral Polyhedra to/from files.
#-------------------------------------------------------------------------------
from SpheralCompiledPackages import *
import numpy as np
import stl
#--------... |
#!/usr/bin/env python
# ======================================================================
#
# <NAME>
# U.S. Geological Survey
#
# ======================================================================
#
import math
import logging
import numpy
import os
class B... |
"""
File name : Temperature dependent air properties
Author : <NAME>
Email : <EMAIL>
Date : September/2020
Last edit : September/2020
Language : Python 3.8 or >
Aeronautical Institute of Technology - Airbus Brazil
Description:
-
Inputs:
-
Outputs:
-
TODO's:
-
"""
# ========================... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicab... |
# vim: set encoding=utf-8
#
# Copyright (c) 2015 Intel Corporation
#
# 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 requi... |
#---------------------------------------
# Import Libraries
#---------------------------------------
import sys
import clr
import json
import codecs
import os
import time
import threading
from collections import deque
clr.AddReference("IronPython.SQLite.dll")
clr.AddReference("IronPython.Modules.dll")
#------------... |
"""
Used only for REPL Completion.
"""
import inspect
import os
from pathlib import Path
from jedi.parser_utils import get_cached_code_lines
from jedi import settings
from jedi.cache import memoize_method
from jedi.inference import compiled
from jedi.file_io import FileIO
from jedi.inference.names import NameWrapper... |
# pylint: disable=redefined-outer-name,protected-access
import ast
import importlib.util
from subprocess import CalledProcessError
from unittest.mock import ANY, patch, sentinel
from uuid import uuid4
from zipfile import ZipFile
import pytest
from docker.errors import APIError, ContainerError, ImageLoadError
from req... |
"""
Import and export hyperspectral data. For hyperspectral images this is mostly done using GDAL,
while for point clouds and hyperspectral libraries a variety of different methods are included.
"""
from .headers import *
from .images import *
from .clouds import *
from .libraries import *
from .pmaps import *
from .c... |
from pathlib import Path
import math
import open3d as o3d
import open3d.core as o3c
import nnrt
import pytest
import numpy as np
from data import StaticCenterCrop, DeformDataset
@pytest.mark.parametrize("device", [o3d.core.Device('cuda:0'), o3d.core.Device('cpu:0')])
def test_compute_anchors_euclidean_nnrtf_vs_lega... |
import datetime
import subprocess
import os
import argparse
import threading
DeploymentFlag="==> v1beta1/Deployment\n"
# DeploymentColume=['NAME','DESIRED','CURRENT','UP-TO-DATE','AVAILABLE','AGE']
# SecretFlag="==> v1/Secret\n"
# SecretColume=[]
# IngressFlag="==> v1beta1/Ingress\n"
# IngressColume=[]
# ServiceFlag="... |
"""
NASBench-301 search space (a `cnn` search space), evaluator (API query)
"""
import copy
from collections import namedtuple
from ConfigSpace.read_and_write import json as cs_json
import numpy as np
import nasbench301 as nb
from aw_nas.evaluator.base import BaseEvaluator
from aw_nas.common import CNNSearchSpace
fr... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2021 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import os
from math import isnan
import numpy as np
import pandas.testing as pdt
import pytest
import pandapower as pp
def asse... |
"""
This module contains functions for soiling models
"""
import datetime
import numpy as np
import pandas as pd
from scipy.special import erf
from pvlib.tools import cosd
def hsu(rainfall, cleaning_threshold, tilt, pm2_5, pm10,
depo_veloc=None, rain_accum_period=pd.Timedelta('1h')):
"""
Calculates ... |
"""
Copyright (c) 2018 Intel Corporation
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 wri... |
# WorQ - Python task queue
#
# Copyright (c) 2012 <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,... |
"""
Functions to support the analyze capability in this tool
"""
import fnmatch
import copy
import re
from policy_sentry.querying.actions import remove_actions_not_matching_access_level
from policy_sentry.querying.all import get_all_actions
from policy_sentry.util.actions import get_lowercase_action_list
from policy_se... |
from JumpScale import j
import JumpScale.baselib.serializers
from JumpScale.grid.serverbase import returnCodes
from JumpScale.core.errorhandling.ErrorConditionHandler import BaseException
import inspect
import copy
import time
import ujson
class Session():
def __init__(self, ddict):
self.__dict__ = ddict... |
import gzip
import logging
import os
import shutil
from io import BytesIO
from tempfile import NamedTemporaryFile
from typing import Optional, Tuple, Any, IO
from urllib import request
from urllib.parse import urlparse
from urllib.error import URLError
import requests
from irrd.conf import get_setting, RPKI_IRR_PSEUD... |
import numpy as np
import pyhdf.SD as h4
import h5py as h5
def rdh5(h5_filename):
x = np.array([])
y = np.array([])
z = np.array([])
f = np.array([])
h5file = h5.File(h5_filename, 'r')
f = h5file['Data']
dims = f.shape
ndims = np.ndim(f)
#Get the scales if they exist:
for i in... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2015 <NAME>.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFile
fr... |
# ===================================================================
#
# Copyright (c) 2014, Legrandin <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source... |
import contextlib
import os
from datetime import datetime, timezone
from enum import Enum
from pathlib import Path
from typing import (
IO,
TYPE_CHECKING,
Any,
Callable,
DefaultDict,
Dict,
Iterator,
List,
Mapping,
Optional,
Sequence,
Set,
TextIO,
Tuple,
Type,
... |
"""
Copyright 2021 Nirlep_5252_
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
d... |
import os
import glob
import pickle
import pathlib
import argparse
import numpy as np
from model import *
from sklearn.model_selection import train_test_split
import random
def get_args():
parser = argparse.ArgumentParser(description="")
### mode ###
# custom mode is for case study:
# - custom mode on... |
#-------------------------------------------------------------------------------
# elftools: dwarf/dwarf_expr.py
#
# Decoding DWARF expressions
#
# <NAME> (<EMAIL>)
# This code is in the public domain
#-------------------------------------------------------------------------------
from collections import namedtuple
fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.