text stringlengths 6.04k 39.5k |
|---|
# general imports
import numpy as np
import pandas as pd
import datetime as dt
# matplotlib
from matplotlib import pyplot as plt
from matplotlib.dates import date2num, num2date
from matplotlib import dates as mdates
from matplotlib import ticker
from matplotlib.colors import ListedColormap
from matplotlib.patches impo... |
#! -*- coding: utf-8 -*-
# 分词函数
import unicodedata, re
from bert4keras.snippets import is_string, is_py2
from bert4keras.snippets import open
from bert4keras.snippets import convert_to_unicode
from bert4keras.snippets import truncate_sequences
def load_vocab(dict_path, encoding='utf-8', simplified=False, startswith=... |
from __future__ import print_function
from sys import *
from op_list import *
from op_parse import *
from op_exec import get_storage_value, get_params, set_params, clear_params, print_stack, print_storage, execute, print_balances, get_balances, same_balance, send_ether, st
from op_exec import print_balance_difference, ... |
# Copyright 2017: Mirantis 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 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
"""Connector for Matrix (https://matrix.org)."""
import re
import json
import logging
import functools
from concurrent.futures import CancelledError
from urllib.parse import urlparse
import aiohttp
from matrix_api_async.api_asyncio import AsyncHTTPAPI
from matrix_client.errors import MatrixRequestError
from voluptuo... |
from __future__ import print_function
import logging
logger = logging.getLogger(__file__)
logging.basicConfig(
format="[%(asctime)s - %(filename)s:line %(lineno)s] %(message)s",
datefmt='%d %b %H:%M:%S')
logger.setLevel(logging.INFO)
import os
import sys
import time
import random
import numpy as np
from ker... |
import tables
import prctl
import numpy
import time
import logging
logger = logging.getLogger(__name__)
# Tables for storing the elements from queue
class translation_block_table(tables.IsDescription):
identity = tables.UInt64Col()
size = tables.UInt64Col()
ins_count = tables.UInt64Col()
... |
from xml.dom import minidom
from shapely.geometry import Polygon as shape_poly
from shapely.geometry import LineString as shape_string
import numpy as np
import random
import os
import cv2
from PIL import Image
def angle_between(p1, p2):
ang1 = np.arctan2(*p1[::-1])
ang2 = np.arctan2(*p2[::-1])
return (an... |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
import discord
from discord.ext import commands
from .utils import helper_functions as hf
import asyncio
from datetime import datetime, timedelta
import re
import os
dir_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
SP_SERV = 243838819743432704
JP_SERVER_ID = 189571157446492161
class Submod(c... |
import json
import logging
import pytest
import re
import retrying
import sdk_cmd
import sdk_install
import sdk_marathon
import sdk_plan
import sdk_tasks
import sdk_upgrade
import sdk_utils
from tests import config
log = logging.getLogger(__name__)
@pytest.fixture(scope="module", autouse=True)
def configure_packag... |
from sqlalchemy import create_engine, MetaData, Table, Integer, String, \
Column, DateTime, ForeignKey, Numeric, SmallInteger, CheckConstraint
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from datetime import datetime
engine = create_engine('sqlite:///C:\\Users\... |
#!/usr/bin/python
"""
# ==============================
# flowlib.py
# library for optical flow processing
# Author: <NAME>
# Date: 6th Aug 2016
# ==============================
"""
# TODO Maybe we don't need png
# import png
import numpy as np
import matplotlib.colors as cl
import matplotlib.pyplot as plt
from PIL impo... |
"""
Modeling of Imaging Systematics with multilayer neural networks
<NAME>, <EMAIL>
July 17. 2020
"""
import matplotlib.pyplot as plt
import os
import sys
import logging
import numpy as np
import fitsio as ft
from time import time
from glob import glob
import torch
import sysnet.sources as src
import ma... |
import math
from gym.spaces.discrete import Discrete
import numpy as np
from gym import spaces
import pybullet as p
from ray.rllib.env.multi_agent_env import MultiAgentEnv, ENV_STATE
from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary
from gym_pybullet_drones.envs.BaseAviary import DroneMo... |
"""
(C) 2014-2016 <NAME> and contributors
Licensed under BSD license
http://github.com/r0x0r/pywebview/
"""
import sys
import json
import subprocess
from threading import Event, Semaphore
import Foundation
import AppKit
import WebKit
from PyObjCTools import AppHelper, Conversion
from objc import nil, super, pyobjc_un... |
################################################################################
# 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... |
"""
Backend integrator and backends definitions. Currently supported are following
backends:
- `jitcdde`: (just-in-time compilation into C) which uses `jitcdde`
which translates symbolic derivatives into C code and then calls C functions
from Python interface:
- very reliable
- uses adaptive `dt` hence... |
#!/usr/bin/env python
from __future__ import absolute_import
import sys
import inspect
import io
import json
import time
import datetime
import uuid
import tempfile
import logging
import logging.handlers
import os.path
import os
import signal
import traceback
from bsddb3 import db
import tornado.httpserver
import to... |
from __future__ import print_function
import pycuda.gpuarray as gpuarray
import pycuda.autoinit
import pycuda.driver as driver
import pycuda.curandom as curandom
from pycuda.compiler import SourceModule
import numpy as np
import math
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import scipy.i... |
# -*- coding: utf-8 -*-
"""
========================
SSD1322 RESOURCE UTILITY
========================
This program provides functions for generating code from
bitmap (.bmp) and font (.tty) files for applications using the
SSD1322 OLED driver. The generated files are source (.c) and header (.h) files
for u... |
#Load the dependencies
import os
import copy
import yaml
import time
import random
import datetime
import numpy as np
import matplotlib.pyplot as plt
from collections import namedtuple
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as data
import torchvision.datasets as data... |
#!/usr/bin/env python
import yaml
import h5py
import io
import numpy
import os
import pandas
import re
import sklearn.model_selection
import torch
import datasets.padchestmap as padchestmap
from datasets.cxrdataset import CXRDataset, H5Dataset
from PIL import Image
padchesttochexpert = padchestmap.padchesttochexpert
p... |
#!/usr/bin/env python
#########################################
#
# interp.stats
#
# Statistics in python.
#
# @alex-hf 07-09-2018
# Last update : 20-01-2020
#########################################
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import time
import itertoo... |
import re
from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine
from SpiffWorkflow.bpmn.specs.UserTask import UserTask
from SpiffWorkflow.serializer.exceptions import MissingSpecError
from SpiffWorkflow.util.metrics import timeit, firsttime, sincetime
from lxml import etree
import shlex
from datetime im... |
"""
Handle historic data (ohlcv).
Includes:
* load data for a pair (or a list of pairs) from disk
* download data from exchange and store to disk
"""
import logging
import operator
from datetime import datetime
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import arrow
from pandas impo... |
"""
Functions for reading 1D JCAMP-DX files.
"""
import os
import re
from warnings import warn
import numpy as np
from . import fileiobase
__developer_info__ = """
JCAMP-DX file format information
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The format reference publications are available at:
<http://www.jcamp-dx... |
""" Evaluation script for auto-constraint model. """
import argparse
import dataclasses
import functools
import gzip
import hashlib
import itertools
import os
import pickle
import typing
import queue
import numpy as np
import torch
from torch import multiprocessing
import tqdm
from sketchgraphs.data import sequence ... |
import mne
import matplotlib
import zipfile
import hashlib
import zipfile
import PyQt5
import os
import PyQt5
import matplotlib
import matplotlib.pyplot as plt
import mne
import pandas as pd
import re
import numpy as np
import datetime
import re
import time
from glob import glob
from os import listdir
from os.path impo... |
"""
Data models based on:
https://storium.com/help/export/json/0.9.2
Empirically discovered nullable fields in the Storium export format:
"act_number"
"alt_text"
"attribution_text"
"attribution_url"
"author_character_seq_id"
"author_user_pid"
"card"
"challenge_completion_polarity"
"challenge_points"
"challenge_points... |
import errno
import json
import logging
import os
from typing import Dict
from galaxy import util
from galaxy.structured_app import MinimalManagerApp
from galaxy.tools.data import TabularToolDataTable
from galaxy.util.template import fill_template
log = logging.getLogger(__name__)
SUPPORTED_DATA_TABLE_TYPES = Tabula... |
import io
from itertools import product
from typing import List, Union
import numpy as np
import pandas as pd
from ixmp import IAMC_IDX
from message_ix import Scenario, make_df
SCENARIO = {
"austria": dict(model="Austrian energy model", scenario="baseline"),
"dantzig": {"model": "Canning problem (MESSAGE sch... |
# coding: utf-8
import sys
import weakref
import json
import datetime
import random
import functools
import posixpath
import multiprocessing
import shutil
import contextlib
from objecttools import ThreadedCachedProperty
from xxkcd._util import (
urlopen, reload, unescape, map, str_is_bytes, make_mapping_proxy,
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 29 15:19:16 2022
@author: lukepinkel
"""
import tqdm # analysis:ignore
import numba # analysis:ignore
import numpy as np # analysis:ignore
import scipy as sp # analysis:ignore
import scipy.stats # analysis:ignore
import pandas as pd
import matplot... |
# Copyright 2019 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... |
import multiprocessing.dummy
import time
from common.idgen import IDGEN
from common.timer import TIMER
from common import utils
from common.utils import decode_sleb128, encode_address
from common.constants import UNKNOWN_LABEL, LOC_VAR, FUN_ARG, VOID
from common.constants import ENUM_DW_FORM_exprloc, ENUM_ABBREV_CODE
... |
# coding=utf-8
# Copyright 2019 The Google Research 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 applicab... |
import os
import unittest
from django.test import TestCase
from djblets.siteconfig.models import SiteConfiguration
from reviewboard.diffviewer.models import DiffSet, FileDiff
from reviewboard.diffviewer.templatetags.difftags import highlightregion
import reviewboard.diffviewer.diffutils as diffutils
import reviewboar... |
#!/usr/bin/env python
import numpy as np
import pandas as pd
import pickle
from datetime import datetime, date
from sklearn.preprocessing import LabelEncoder
from sklearn.cross_validation import StratifiedShuffleSplit
print('Loading raw data...')
train_users_path = '../data/airbnb/train_users.csv'
test_users_path = ... |
"""Implements Sigma-GIRL
<NAME>, et al. "Truly Batch Model-Free Inverse Reinforcement Learning about Multiple Intentions."
International Conference on Artificial Intelligence and Statistics. PMLR, 2020.
Original implementation of PGIRL and Sigma-GIRL is at https://github.com/gioramponi/sigma-girl-MIIRL,
which roughly... |
from __future__ import print_function
import argparse
import os
import shutil
import time
import random
import cv2
import imageio
import utils
import numpy as np
import pickle
import scipy.misc
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.da... |
import itertools
import math
import operator
from collections import defaultdict
from functools import partial, reduce
import networkx as nx
import sympy
import common
import glucose_wrapper
# shims
new_var = partial(sympy.Symbol)
implies = sympy.Implies
equivalent = sympy.Equivalent
true = sympy.true
false = sympy.... |
# Author: <NAME> -- <<EMAIL>>
# License: BSD 3 - Clause License 2018
# This is an implementation of the technique described in:
# http://www.lcad.icmc.usp.br/~nonato/pubs/lamp.pdf
import matplotlib.pyplot as plt
import sys
import numpy as np
from scipy.spatial.distance import cdist
from scipy.optimize import minimiz... |
#!/usr/bin/env python
"""
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 ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 17 13:17:46 2020
@author: Michi
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import sys
import argparse
def get_fname_list(c_0, c_1, list_IDs_temp, data_root, list_IDs_temp_dict, dataset_balanced=True):
# np.array([s... |
from __future__ import division, print_function, absolute_import
import sys
import numpy as np
import vtk
from vtk.util import numpy_support
from scipy.ndimage import map_coordinates
from fury.colormap import line_colors
def set_input(vtk_object, inp):
""" Generic input function which takes into account VTK 5 o... |
# Copyright (c) 2015-2019 Cloudify Platform Ltd. 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... |
"""Mixin for all class-like abstract classes."""
import logging
from typing import Any
import attr
from pytype import datatypes
from pytype.abstract import abstract_utils
from pytype.abstract import function
from pytype.abstract import mixin # pylint: disable=unused-import
from pytype.pytd import mro
from pytype.pyt... |
#train_keras.py
"""Train NNs ensemble members for a given salient2's submodel
Example:
$ python src/models/salient2/train_keras.py d2wk_cop_sst_20170201 -n 50 -s 0
$ python src/models/salient2/train_keras.py d2wk_cop_sst_mei_mjo_20190731 -n 40 -s 0
$ python src/models/salient2/train_ke... |
# -*- coding: utf-8 -*-
# + {}
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import networkx as nx
import matplotlib as mpl
import numba
import squarify
import numpy as np
from math import pi
from sklearn.decomposition import PCA
from sklearn.mixture import GaussianMixture as GMM
from umap i... |
# Copyright 2018 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, ... |
# -*- encoding: utf-8 -*-
import collections
import datetime
import json
from django.http import HttpResponse
from django.shortcuts import render
from django.utils.datastructures import SortedDict
from accounts.models import User
from common.constants import PRIORITY_CHOICES, USER_STATUS_CHOICES, USER_STATUS_VOLUNTEE... |
#!/usr/bin/env python2
import sys
import os
import os.path
import re
import argparse
import datetime
import multiprocessing
import shlex
import shutil
import tempfile
import time
import subprocess
import glob
# Default flags for make
default_make_flags = ["-i", "-j" + str(multiprocessing.cpu_count())]
# Set YCM-Gen... |
from os.path import join, isdir
from operator import itemgetter
import sys
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier
from skle... |
#! /usr/bin/env python
# VERSION Track: this file is based on "ExtractPlots_v5", and "nZerosV0" was added to this version.
# this file is newer than "ExtractPlots_v5", but lacks the Root fitting in _v6
# one should merge the changes of _v6 (modified by H.Bakhshian) to this file.
import ROOT
ROOT.PyConfig.IgnoreComm... |
import os
import secrets
import time
from typing import Dict
from typing import List
from unittest.mock import Mock
import jwt
import pytest
from Crypto.PublicKey import RSA
from jupyterhub.app import JupyterHub
from oauthlib.oauth1.rfc5849 import signature
from tornado.httputil import HTTPServerRequest
from tornado.w... |
import numpy as np
import matplotlib.pyplot as plt
import numpy.linalg as LA
from scipy.sparse.linalg import svds, eigs
from numpy.linalg import svd
from sklearn import metrics
from datetime import datetime as dt
import os
import pandas as pd
import sys
import seaborn as sns
import mrc
from mrc import LazyImage
import... |
# ex: set sts=4 ts=4 sw=4 et:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Test drop command"... |
"""Support for Netatmo Smart thermostats."""
from __future__ import annotations
import logging
from typing import Any
import pyatmo
import voluptuous as vol
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
... |
from pypy.interpreter.pyparser import automata
from pypy.interpreter.pyparser.parser import Token
from pypy.interpreter.pyparser.pygram import tokens
from pypy.interpreter.pyparser.pytoken import python_opmap
from pypy.interpreter.pyparser.error import TokenError, TokenIndentationError, TabError
from pypy.interpreter.p... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import math
import tensorflow as tf
from tensorflow.python.training import moving_averages
import numpy as np
import niftynet.layer.convolution
import niftynet.layer.deconvolution
import niftynet.layer.bn
from niftynet.utili... |
#!/usr/bin/python3
# The point of this script is to convert Dfec-generated .decls data
# with Lackwit comparability info. into a form that Kvasir can
# understand so that we don't have to run Dfec at all.
# Takes a .decls file that Dfec produced (with Lackwit comparability),
# a .decls file that Kvasir produced (with... |
#! /usr/bin/env python3
#
# Provides :
# 1. an implementation of Linkable Spontaneus Anonymous Group Signature
# over elliptic curve cryptography
#
# Implementation of cryptographic scheme from: https://eprint.iacr.org/2004/027.pdf
#
#
# Written in 2017 by <NAME> and placed in the public domain.
# 2.
import os
import ... |
from copy import deepcopy
import logging
import numpy as np
import scipy.signal
from braindecode.datautil.iterators import get_balanced_batches
from .signalproc import concatenate_channels, select_trials
from .lda import lda_train_scaled, lda_apply
log = logging.getLogger(__name__)
def generate_filterbank(min_freq... |
import os
import sys
import time
import pytest
import asyncio
import random
import subprocess
from typing import List
from loguru import logger
from pytest import fixture
import bittensor
from bittensor.utils.balance import Balance
from bittensor.wallet import Wallet
from bittensor.substrate import Keypair
BLOCK_R... |
"""Provides a hook to interact with a dbt project."""
from __future__ import annotations
import dataclasses
import json
import os
import pickle
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import Any, Optional, Union
import dbt.flags as flags
from dbt.adapters.factory i... |
import argparse
import numpy as np
from world import World
from PythonQt import QtGui
from net import Controller
from sensor import RaySensor
from director import applogic
from moving_object import Robot
from moving_object import Commonship
from director import vtkAll as vtk
from director import objectmodel as om
from ... |
import numpy
from six import moves
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import configuration
from chainer import function_node
from chainer.functions.connection import convolution_2d
from chainer.utils import conv
from chainer.utils import conv_nd
from chainer.utils... |
"""Classes for representing mypy types."""
from abc import abstractmethod
from typing import Undefined, Any, typevar, List, Tuple, cast, Generic
import mypy.nodes
T = typevar('T')
class Type(mypy.nodes.Context):
"""Abstract base class for all types."""
line = 0
repr = Undefined(Any)
def ... |
from copy import deepcopy
import itertools
import pickle
from typing import Dict
import numpy as np
import pandas as pd
import pytest
from sklearn.preprocessing import StandardScaler
import torch
from pytorch_forecasting.data import (
EncoderNormalizer,
GroupNormalizer,
NaNLabelEncoder,
TimeSeriesData... |
PythonMin, PythonMax = min, max
from numpy import isnan, array, atleast_1d, asarray, all, searchsorted, logical_or, any, nan, \
vstack, inf, where, logical_not, min, abs, insert, logical_xor, argsort, zeros_like
# for PyPy
from openopt.kernel.nonOptMisc import isPyPy
try:
from numpy import append
except ImportErr... |
import numpy as np
def p_diabetes_china(age):
#diabetes prevalence for china
#https://jamanetwork.com/journals/jama/fullarticle/1734701
male = np.array([5.2755905511811, 8.346456692913385, 13.543307086614174, 17.95275590551181, 20.708661417322837, 21.653543307086615])
female = np.array([4.0157480314960... |
"""
This file contains searching algorithm for the task.
Define STATE and TRANSFER function.
Currently I regard a mask with some pixels filled by Tangram elements as STATE,
and Transfer function is adding another element on the mask.
Also, this file contains some hyperparameters for searching like
the o... |
import numpy as np
import pickle
from time import time
from scipy.optimize import minimize
from scipy.io import loadmat
from math import sqrt
def one_K_coding_scheme(training_label,n_class):
size = np.size(training_label)
out = np.zeros((size, n_class), dtype=np.int)
for i in range(size):
... |
"""vdomr main module
"""
import os
import traceback
import time
import multiprocessing
import uuid
import sys
# BOOKMARK VDOMR
# MEDIUM TODO make vdomr readme and release vdomr 1.0
# invokeFunction('{callback_id_string}', [arg1,arg2], {kwargs})
VDOMR_GLOBAL = dict(
mode='server', # colab, jp_proxy_widget, serv... |
import torch
import torch.nn as nn
import numpy as np
from onmt.models.stacked_rnn import StackedLSTM, StackedGRU
from onmt.modules import context_gate_factory, GlobalAttention
from onmt.utils.rnn_factory import rnn_factory
from onmt.modules.copy_generator import collapse_copy_scores
from onmt.utils.misc import aeq
im... |
################################################################################
# Copyright (c) 2009-2020, National Research Foundation (SARAO)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the License at
#
# ... |
from datetime import datetime
from socket import error as socket_error
import logging
import inspect
from concurrent.futures import CancelledError, TimeoutError
from queue import Empty
import time
from lxml import etree
from netconf_client.error import RpcError
from netconf_client.rpc import (
edit_config,
ge... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils.data import nowdate, getdate, cint, add... |
# Copyright (c) 2019 PaddlePaddle 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 appli... |
import pandas as pd
import tempfile
import numpy as np
import subprocess
import gzip
import sys
import threading
import queue
from pandas_plink import read_plink
gt_to_dosage_dict = {'0/0': 0, '0/1': 1, '1/1': 2, './.': np.NaN,
'0|0': 0, '0|1': 1, '1|0': 1, '1|1': 2, '.|.': np.NaN}
def _check_d... |
"""Lightweight macros for Python.
"""
from __future__ import print_function
import ast
import collections
import copy
import functools
class StatementWithBody:
"""Implement the square bracket syntax for Class, Def, If, While, Try, and
For statements.
"""
__slots__ = ()
def __getitem__(self, *bo... |
#!/usr/bin/env python3
# Created by <NAME> <<EMAIL>> at 2019-07-16
# ____ _ ____ ____ _ __
# / | (_)____/ __ \ / | | / /
# / /_| | / / ___/ / / / / /_| | | / /
# / ___ |/ / / / /_/ / / ___ | |/ /
# /_/ |_/_/_/ \____/ /_/ |_|___/
# Standard packages
import json
import logg... |
"""Testing hyperparameter optimization with optuna"""
import itertools
import unittest
import unittest.mock
import numpy
import optuna.trial
import gandy.optimization.hypersearch as opt
import gandy.models.models
class TestSearchableSpace(unittest.TestCase):
def test_class(self):
"""try all possible s... |
from numpy.core.numeric import outer
from sklearn.kernel_ridge import KernelRidge
from sklearn.model_selection import KFold,LeaveOneOut,StratifiedKFold
from sklearn.metrics import mean_absolute_error, mean_squared_error
from skopt import gp_minimize
from functools import partial
import numpy as np
import ray
from sklea... |
import operator
import attr
import networkx as nx
import torch
from ratsql.beam_search import Hypothesis
from ratsql.models.nl2code.decoder import TreeState, get_field_presence_info
from ratsql.models.nl2code.tree_traversal import TreeTraversal
@attr.s
class Hypothesis4Filtering(Hypothesis):
column_history = at... |
"""Generate cached GLD list. Convert annotation files.
"""
from multiprocessing import Pool
import os
import pickle
import random
from collections import OrderedDict
import numpy as np
import json
import urllib.request
import pandas as pd
RAW_IMAGE_DIR = '/home/gongyou.zyq/datasets/google_landmark/'
CACHE_TRAIN_CLEA... |
#!/usr/bin/python3
import sys
from sys import argv, exit, stderr
import os
import nbformat as nbf
import yaml
from collections import OrderedDict
import numpy as np
import re, ast
def represent_dictionary_order(self, dict_data):
return self.represent_mapping('tag:yaml.org,2002:map', dict_data.items())
def setup_y... |
#
# 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
# ... |
import numpy as np
from scipy.optimize import minimize, LinearConstraint, fsolve
from scipy.optimize import NonlinearConstraint
import scipy
import time
SCIPY_VERSION = scipy.__version__
def array_func(func):
"""
Decorator to handle various array arguments
"""
def unwrap(*args, **kwargs):
sel... |
# Copyright 2021 H2O.ai, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import filecmp
import functools as ft
import os
import re
import shutil
import sys
from llnl.util.link_tree import LinkTr... |
import numpy as np
import matplotlib.pyplot as plt
def pre_synaptic_simple(epsilon, w, z_post, z_pre):
increase = np.zeros_like(w)
n = w.shape[0]
for i in range(n):
for j in range(n):
increase[i, j] = z_pre[j] * z_post[i] - z_pre[j] * w[i, j]
return epsilon * increase
def post_... |
# Copyright (c) 2019 PaddlePaddle 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 appli... |
import itertools
import json
import logging
import os
import pickle
import urllib.request
import numpy as np
import pandas as pd
from lxml import html
BASE_PATH = os.path.dirname(__file__)
DATA_PATHS = {
"icu_name_to_department": "data/icu_name_to_department.json",
"pre_icubam": "data/pre_icubam_data.csv",
"de... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, <NAME> and Contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from erpnext.stock.stock_balance import get_balance_qty_from_sle
from dairy_erp.c... |
# Copyright 2021 [name of copyright owner]
# 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 i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.