text stringlengths 6.04k 39.5k |
|---|
"""
Artificial Intelligence for Humans
Volume 2: Nature-Inspired Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2014 by <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
... |
# -*- coding:utf-8 -*-
import argparse
import torch
import os
import cv2
import pyssim
import codecs
from scipy.ndimage import gaussian_filter
from numpy.lib.stride_tricks import as_strided as ast
from PIL import Image
from torch.autograd import Variable
import torch.nn as nn
import numpy as np
import time, math
import... |
# Copyright (c) 2015, <NAME> (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from GPy.inference.latent_function_inference.var_dtc import VarDTC
from GPy.util.linalg import jitchol, tdot, dtrtri, dtrtrs, backsub_both_sides,\
dpotrs, dpotri, symmetrify, mdot
from GPy... |
from collections.abc import AsyncIterator, Iterable, Mapping, Set
from contextlib import asynccontextmanager
from dataclasses import dataclass, replace
from datetime import datetime, timedelta, timezone
from typing import Any, Optional
import sqlalchemy as sa
import sqlalchemy.dialects.postgresql as sapg
import sqlalc... |
"""Various useful contexts.
"""
import functools
import os
import signal
import time
import threading
import warnings
def is_main_thread():
"""Return True if this is the main thread."""
return threading.current_thread() is threading.main_thread()
class NoInterrupt(object):
"""Suspend the various signa... |
import json
import re
from typing import OrderedDict
import torch
import numpy as np
import matplotlib.pyplot as plt
import io
import cv2
import pickle
import wandb
import cvgutils.Dir as Dir
import cvgutils.Image as cvgim
import cvgutils.Utils as cvgutil
from tensorboardX import SummaryWriter
# from torch.utils.tensor... |
"""Hive sync manager."""
import logging
from time import perf_counter as perf
import ujson as json
import queue
from concurrent.futures import ThreadPoolExecutor
from hive.db.db_state import DbState
from hive.utils.timer import Timer
from hive.steem.block.stream import MicroForkException
from hive.steem.massive_blo... |
# -*- coding: UTF-8 -*-
# !/usr/bin/python
# @time :2019/6/19 21:32
# @author :Mo
# @function :tf-idf
from tookit_sihui.utils.file_utils import save_json
from tookit_sihui.utils.file_utils import load_json
from tookit_sihui.utils.file_utils import txt_write
from tookit_sihui.utils.file_utils import txt_read
imp... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import scipy.linalg
import scipy.special
from . import thops
def nan_throw(tensor, name="tensor"):
stop = False
if ((tensor!=tensor).any()):
print(name + " has nans")
stop = True
if (to... |
#!/usr/bin/env python3
# Author: <NAME>
# Contact: <EMAIL>
"""Define data preprocessing operations for **PETGEM**."""
# ---------------------------------------------------------------
# Load python modules
# ---------------------------------------------------------------
import numpy as np
import h5py
import meshio
... |
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.backends.backend_pdf import PdfPages
"""
Notes for future:
You set up the basic elements of a curve, but not everything
is truly automated. Need to:
1. Automate ... |
'''
Created on Nov 25, 2011
@author: cryan
Code for numerical optimal control.
'''
import numpy as np
from numpy import sin,cos
from copy import deepcopy
from scipy.constants import pi
from scipy.linalg import expm
from scipy.linalg import eigh
from scipy.optimize import fmin_l_bfgs_b
import matplotlib.pyplot a... |
__author__ = "<NAME>"
__maintainer__ = "<NAME>"
__license__ = "MIT"
__version__ = "0.0.1"
__status__ = "Prototype"
__name__ = "WeightedGraph"
# POSTGRESQL QUERY to get a csv of all relevant transitionss
# SELECT DISTINCT (p.token) as token, (SELECT '["' || string_agg(s.page, '" , "' ORDER BY s.timestamp asc)||'"]' FRO... |
import struct
from typing import Any, Optional, Tuple, List
import pidal.err as err
from pidal.logging import logger
from pidal.protocol.mysql import Command, ServerStatus
from pidal.protocol.util import byte2int, int2byte, dump_packet
from pidal.stream import Stream
from pidal.node.result import result
NULL_COLUM... |
import os
import time
import psutil
import pprint
import torch
import torch.nn.functional as F
import numpy as np
from models.classification_heads import ClassificationHead
from models.R2D2_embedding import R2D2Embedding
from models.protonet_embedding import ProtoNetEmbedding
from models.ResNet12_embeddin... |
import re
from builtins import str
try:
from UserDict import UserDict
except ImportError:
from collections import UserDict
from adsrefpipe.refparsers.xmlFile import XmlString
from adsrefpipe.refparsers.unicode import UnicodeHandler
unicode_handler = UnicodeHandler()
class ReferenceError(Exception):
"""
... |
#
import math
import os
# import neural_renderer as nr
import numpy as np
# torch.cuda.set_device(5)
# # os.environ["CUDA_VISIBLE_DEVICES"] = '3,4'
# torch.backends.cudnn.benchmark = True
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import functional as F
from torchvision impor... |
from functools import partial
from typing import Any, Dict, List, Optional, Tuple, Union
import havsfunc as haf
import lvsfunc as lvf
import vapoursynth as vs
import vardefunc as vdf
from vsutil import (depth, fallback, get_depth, get_w, get_y, insert_clip,
iterate, join, plane)
core = vs.core
d... |
#!/usr/bin/env python
"""
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 later version.
This program is distributed in the hope that it will ... |
import scipy.io.wavfile as scwav
import numpy as np
import pylab
import librosa
import pyworld as pw
import os
import scipy.io as scio
from glob import glob
from tqdm import tqdm
from concurrent.futures import ProcessPoolExecutor
from functools import partial
from sklearn.manifold import TSNE
def _power_to_db(S):
... |
"""High-level API for saving/loading responses from FE simulation."""
from __future__ import annotations
# Print debug information for this file.
import os
from collections import deque
from copy import deepcopy
from typing import Callable, List, Optional
import numpy as np
from bridge_sim.model import (
Config,... |
import pickle
import tensorflow as tf
import numpy as np
NUM_HEADING_BIN = 12
NUM_OBJECT_POINT = 512
NUM_SIZE_CLUSTER = 8
g_type2class = {'car': 0, 'Van': 1, 'Truck': 2, 'pedestrian': 3,
'Person_sitting': 4, 'bicycle': 5, 'Tram': 6, 'Misc': 7}
g_class2type = {g_type2class[t]: t for t in g_type2class}
... |
# encoding: utf-8
import MySQLdb as mdb
import time
import datetime
import logging
import json
from django.conf import settings
from django.http import HttpResponse, JsonResponse
from django.views.generic import CreateView, DeleteView, ListView, View
from django.conf import settings
from .models import Picture
from .re... |
import os
import sys
import time
import logging
import argparse
import matplotlib; matplotlib.use('Agg')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from itertools import filterfalse
from collections import Counter
from matplotlib import font_manager
from GetConfig import getConfig
try:
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from unittest import TestCase
import binascii
import hexdump
# Public import
import mciutil
# Private functions
from mciutil.mciutil import (
_convert_text_asc2eb, _get_de43_fields, _mask_pan, b, flip_message_encoding, _get_icc_fields
)
CONFIG = {
... |
from helpers import quote, quote_length, login_required, stuck, get_metadata, get_courses, get_progression, get_now, good_work, yt_playlist
import bcrypt
from flask import Flask, flash, redirect, render_template, request, session, send_file
from flask_session import Session
from flask_mail import Mail, Message
from wer... |
import logging
import shutil
from os import scandir
from pathlib import PurePosixPath
from pprint import pformat
from time import time
from docopt import docopt
from .config import DAGRConfig
from .dagr_logging import init_logging
from .dagr_logging import log as dagr_log
from .DAGRCache import DAGRCache
from .DAGRIo... |
"""
sphinx.util.typing
~~~~~~~~~~~~~~~~~~
The composite types for Sphinx.
:copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import typing
from struct import Struct
from types import TracebackType
from typing import Any, Callabl... |
# -*- coding: utf-8 -*-
"""
Utility functions for PypeIt parameter sets
"""
import os
import time
import glob
import warnings
import textwrap
from IPython import embed
import numpy as np
from astropy.table import Table
from configobj import ConfigObj
from pypeit import msgs
#--------------------------------------... |
import numpy as np
import tensorflow as tf
# Disable unnecessary tfp warning, refer to https://stackoverflow.com/questions/35911252/disable-tensorflow-debugging-information
tf.logging.set_verbosity(tf.logging.INFO)
## Issue: as tfp isn't include in tensorflow 1.10.0, just workaround it! Orlando
# import tensorflow_prob... |
# -*- coding: utf-8 -*-
from datetime import datetime
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import subprocess
import os
import csv
from program_files.Spreadsheet_Energy_System_Model_Generator import sesmg_main
from program_files.Demo_Tool import demo_tool
from program_files.urban_... |
# Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import time
from _pydev_bundle._pydev_filesystem_encoding import getfilesystemencoding
from _pydev_imps._pydev_saved_modules import threading
from _pydevd_bundle import pydevd_xml
from _pydevd_bundle.pydevd_constants import GlobalDebuggerHolder
from _pydevd_bundle.pydevd_constants import get_thread_id, IS_PY3K
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ResNet-based Multi-Label Classification for Quantitative Precipitation Estimation.
- ref: https://www.kaggle.com/kumar1541/resnet-in-keras
- Read in QPESUMS data and precipitation data
- Initialize the CNN model
- Train and test
- Output the model
This version is based ... |
#!/usr/bin/env python
# Copyright 2014-2021 The PySCF Developers. 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
#
# U... |
import collections
import copy
import tensorflow as tf
import numpy as np
import os
import multiprocessing
import functools
from abc import ABC, abstractmethod
from rl.tools.utils.misc_utils import unflatten, flatten, cprint
tf_float = tf.float32
tf_int = tf.int32
"""
For compatibility with stop_gradient
"""
def t... |
from __future__ import print_function
import os
import sys
import re
import ssg.build_yaml
languages = ["anaconda", "ansible", "bash", "oval", "puppet", "ignition"]
lang_to_ext_map = {
"anaconda": ".anaconda",
"ansible": ".yml",
"bash": ".sh",
"oval": ".xml",
"puppet": ".pp",
"ignition": ".y... |
# -*- coding: utf-8 -*-
"""
eve.io.base
~~~~~~~~~~~
Standard interface implemented by Eve data layers.
:copyright: (c) 2017 by <NAME>.
:license: BSD, see LICENSE for more details.
"""
import datetime
import simplejson as json
from copy import copy
from flask import request, abort
from eve.utils i... |
import datetime, statistics, bisect, os
from django.utils.functional import cached_property
from django.urls import reverse
from django.db import models
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from assessment import settings
from assessment.builder.models import... |
# Copyright (c) 2016-2017 Anki, 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 in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#!/usr/bin/env python
#
# esp-idf NVS partition generation tool. Tool helps in generating NVS-compatible
# partition binary, with key-value pair entries provided via a CSV file.
#
# Copyright 2018 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... |
'''
If this is running then python is obviously installed, but we need to make sure that python3 is installed.
What we need to do:
0. (optional) Check disk space
0.1: The same env checks in run.py?
1: Make sure this is python 3.5+
1.1: If we installed python 3.5, restart using that
2. Check ... |
#!/usr/bin/env python
# Copyright: (c) 2013, Google Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
'''
GCE external inventory script
=================================
Generates inventory that Ansible can understand by making API requests
Google Compute Engine via th... |
#!/usr/bin/evn python
"""
CMSC733 Spring 2019: Classical and Deep Learning Approaches for
Geometric Computer Vision
Project1: MyAutoPano: Phase 1 Starter Code
Author(s):
<NAME> (<EMAIL>)
M.Eng. Robotics,
University of Maryland, College Park
"""
# Python libraries
import argparse
import numpy as np
... |
'''
https://github.com/paaatcha/MetaBlock
'''
import os
import torch
import torch.nn as nn
import torch.optim as optim
from tqdm import tqdm
from .checkpoints import load_model, save_model
from .eval_kd import metrics_for_eval_kd
# from torch.utils.tensorboard import SummaryWriter
from tensorboardX import SummaryWrite... |
# -*- coding: utf-8 -*-
# MLToolkit (mltoolkit)
__name__="mltk"
"""
MLToolkit - a verstile helping library for machine learning
===========================================================
'MLToolkit' is a Python package providing a set of user-friendly functions to
help building machine learning models in d... |
import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.autograd import Variable
import numpy as np
from skimage import transform
import sys
sys.path.insert(0, '/root/LKVOLearner/DEN')
import modeling
import fdc
import den
sys.path.insert(0,"~/LKVOLearner/src/util")
import util
DISP... |
'''
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "... |
# -*- coding: utf-8 -*-
##########################################################################
# pySAP - Copyright (C) CEA, 2017 - 2018
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-e... |
#!/usr/bin/env python
# Copyright (C) 2007 <NAME>' <<EMAIL>>.
# Use of this source code is governed by MIT license that can be
# found in the LICENSE file.
import contextlib
import errno
import select
import socket
import sys
import time
from pyftpdlib._compat import PY3
from pyftpdlib.ioloop import Acceptor
from py... |
# 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2018 <NAME>
""" Container class for optical usage information
.. Created on Thu Jan 25 11:01:04 2018
.. codeauthor: <NAME>
"""
import math
import numpy as np
from rayoptics.parax.firstorder import compute_first_order, list_parax_trace
from rayoptics.raytr... |
import copy
import logging
import math
import pathlib
import types
from unittest import mock
import pytest
from connexion.apis.flask_api import Jsonifier
from connexion.exceptions import InvalidSpecification
from connexion.json_schema import resolve_refs
from connexion.middleware.security import SecurityOperation
from... |
import os
import shutil
import random
import math
import time
import argparse
import yaml
from collections import OrderedDict
import sys
# for import parent utils
sys.path.append('../')
import utils
import modules
import datasets
import models
import numpy as np
import torch
import torch.nn as nn
import torch.optim... |
from collections import namedtuple
import torch
import pyro
import pyro.distributions as dist
from pyro.distributions.util import scalar_like
from pyro.infer.mcmc.hmc import HMC
from pyro.ops.integrator import velocity_verlet
from pyro.util import optional, torch_isnan
def _logaddexp(x, y):
minval, maxval = (x,... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
#!/usr/bin/env python3
"""
This script parses the list of C++ runtime parameters and writes the
necessary header files and Fortran routines to make them available
in Castro's C++ routines and (optionally) the Fortran routines
through meth_params_module.
parameters have the format:
name type default need-in-fort... |
# -*- coding: utf-8 -*-
"""
Created on 17-8-1
@author: hy_qiu
"""
import base64
import random
import time
import cv2
import numpy
import requests
MAIN_WINDOW_NAME = 'verify'
value1 = 4
max_value2 = 18 #最大旋转角度,10的倍数
value2 = max_value2 // 2 #起始角度,90
value3 = 2
curidx = 0
#RGB Format
COLORS = [... |
#!/usr/bin/env python
DOCUMENTATION = '''
---
module: dockerimp
short_description: improved docker container management module
description:
- Manage docker containers with ansible
options:
name:
description:
- Set the name of the container
required: false
default: null
... |
import logging
from pathlib import Path
from typing import Dict, Text, List, Any, Optional, Union
import rasa.shared.data
from rasa.shared.exceptions import YamlException
import rasa.shared.utils.io
from rasa.shared.core.constants import LOOP_NAME
from rasa.shared.nlu.constants import ENTITIES, INTENT_NAME_KEY
from ra... |
from __future__ import absolute_import
import os
import re
import sys
import tempfile
import mimetypes
import subprocess
import click
FILENAME = object()
OUTPUT_FOLDER = object()
unpackers = []
def register_unpacker(cls):
unpackers.append(cls)
return cls
def fnmatch(pattern, filename):
filename = os.... |
# -*- coding: utf-8 -*-
import pickle
from itertools import permutations
import numpy as np
import pandas as pd
import pandas.testing as pdt
import pyarrow as pa
import pyarrow.parquet as pq
import pytest
import simplejson
from dask.dataframe.utils import make_meta as dask_make_meta
from kartothek.core._compat impo... |
# 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, software
# distributed under ... |
"""Sensitive variant calling using VarDict.
Defaults to using the faster, equally sensitive Java port:
https://github.com/AstraZeneca-NGS/VarDictJava
if 'vardict' or 'vardict-java' is specified in the configuration. To use the
VarDict perl version:
https://github.com/AstraZeneca-NGS/VarDict
specify 'vardict-perl'.... |
# Copyright 2019, The TensorFlow Federated 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 o... |
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O... |
# coding=utf-8
"""Some generic utilities"""
# Copyright 2012-2014 <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 b... |
# -*- coding: utf-8 -*-
import logging
import utool as ut
import numpy as np # NOQA
(print, rrr, profile) = ut.inject2(__name__, '[_wbia_object]')
logger = logging.getLogger('wbia')
def _find_wbia_attrs(ibs, objname, blacklist=[]):
r"""
Developer function to help figure out what attributes are available
... |
"""Colormaps."""
# --- import --------------------------------------------------------------------------------------
import collections
import numpy as np
from numpy import r_
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as mplcolors
import matplotlib.gridspec as grd
# --- define --... |
"""
Functions to determine defaults
Layouts
-------
TODO: make sure soopervisor documentation also uses these two terms (simple and
packaged)
There are two layouts that can be used, simple and package.
Simple
------
A project composed of a pipeline.yaml and optionally extra pipeline.{name}.yaml
files (all of them mus... |
from pymatgen.core.structure import Molecule
from pymatgen.core.operations import SymmOp
from pymatgen.symmetry.analyzer import PointGroupAnalyzer
from pymatgen.symmetry.analyzer import generate_full_symmops
import numpy as np
from numpy.linalg import eigh
from numpy.linalg import det
from copy import deepcopy
from mat... |
"""AccessoryDriver - glues together the HAP Server, accessories and mDNS advertising.
Sending updates to clients
The process of sending value changes to clients happens in two parts - on one hand, the
value change is indicated by a Characteristic and, on the other, that change is sent to a
client. To begin, typically... |
import os
import numpy as np
import gym
from gym.utils import seeding
from .cake_paddle import CakePaddle, RENDER_RATIO
from .manual_control import manual_control
from pettingzoo import AECEnv
from pettingzoo.utils import wrappers
from pettingzoo.utils.agent_selector import agent_selector
from pettingzoo.utils.to_paral... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
$ python2.7 smb_exploit.py 192.168.206.152
[+] [192.168.206.152] is likely VULNERABLE to MS17-010! (Windows 7 Ultimate 7600)
$ python2.7 smb_exploit.py 192.168.206.130
[+] [192.168.206.130] is likely VULNERABLE to MS17-010! (Windows 5.1)
"""
from ctypes import *
import s... |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... |
##############################################################################
# Copyright Kitware 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/lice... |
import sys
sys.path.append("Mask_RCNN")
import os
import sys
import glob
import osmmodelconfig
import skimage
import math
import imagestoosm.config as osmcfg
import model as modellib
import visualize as vis
import numpy as np
import csv
import QuadKey.quadkey as quadkey
import shapely.geometry as geometry
import shape... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import ctypes
from ctypes import Structure, Union, c_ubyte, c_long, c_ulong, c_ushort, \
c_wchar, c_void_p, c_uint
from ctypes import byref, POINTER, sizeof
from ctypes.wintypes import ULONG, BOOLEAN, BYTE, WORD, DWORD... |
#-*- coding:utf-8 -*-
from pyecharts import Kline, Line, Page,Overlap,Bar,Pie,Timeline
from pandas import DataFrame as df
import re
import tushare as ts
import time
import pandas as pd
try:
xrange # Python 2
except NameError:
xrange = range # Python 3
def calculateMa(data, Daycount):
sum = 0
... |
# 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/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... |
import socket
import time
import os
import numpy as np
import matplotlib.pyplot as plt
from src.algorithms.QDoubleDeepLearn import QLearn # can be QLearn, QDeepLearn, QDoubleDeepLearn or RandomAgent
from src.environments.jsbsim.JSBSimEnv import Env # can be jsbsim.JSBSimEnv or xplane.XPlaneEnv
from src.scenarios.delt... |
"""This module contains classes and functions for defining preconditions and
postconditions for database state. The conditions can be used in unit tests
to efficiently evaluate the expected database state.
"""
# Copyright (c) 2021, Aalborg University (<EMAIL>)
# All rights reserved.
# Redistribution and use in ... |
'''
VAE-LSTM by <NAME>
BI-LSTM by <NAME>
Parameter tuning and interface implementation
Code reference: DeepJazz (Baseline)
Author: <NAME>
Project: deepjazz
Purpose: Generate jazz using a deep learning model (lstm in deepjazz).
Some code adapted from Evan Chow's jazzml, https://github.com/evancchow/jazzml ... |
#
# Copyright 2018-2021 Elyra 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 writ... |
"""Wraps library calls to openjpeg.
"""
import ctypes
import sys
from ..config import glymur_config
_, OPENJPEG = glymur_config()
# Maximum number of tile parts expected by JPWL: increase at your will
JPWL_MAX_NO_TILESPECS = 16
J2K_MAXRLVLS = 33 # Number of maximum resolution level authorized
PATH_LEN = 4096 #... |
########################################################################
#
# Date: Sept 2012 Author: <NAME>
#
# <EMAIL>
#
# The Scripps Research Institute (TSRI)
# Molecular Graphics Lab
# La Jolla, CA 92037, USA
#
# Copyright: <NAME> and TSRI
#
#################################################... |
# Copyright (c) 2020 <NAME> & <NAME>
# FEniCS Project
# SPDX-License-Identifier: MIT
import libtab
import numpy
import pytest
import sympy
from .test_lagrange import sympy_disc_lagrange
def sympy_nedelec(celltype, n):
x = sympy.Symbol("x")
y = sympy.Symbol("y")
z = sympy.Symbol("z")
from sympy impor... |
"""Task runner"""
from multiprocessing import Process, Queue as MQueue
from threading import Thread
import pickle
import queue
import cloudpickle
from .exceptions import InvalidTask, CatchedException
from .exceptions import TaskFailed, SetupError, DependencyError, UnmetDependency
from .task import Stream, DelayedLoa... |
"""
The :mod:`sklearn.utils` module includes various utilities.
"""
import numbers
import platform
import struct
import numpy as np
from scipy.sparse import issparse
import warnings
from .murmurhash import murmurhash3_32
from .validation import (as_float_array,
assert_all_finite,
... |
# -*- coding: iso-8859-15 -*-
#
# profiler.py
#
# Copyright (C) 2016 <NAME>, Universidad de Granada
#
# 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
# ... |
from pdfminer.utils import PDFDocEncoding
from pdfminer.psparser import PSLiteral
from pdfminer.pdftypes import PDFObjRef
from decimal import Decimal, ROUND_HALF_UP
import numbers
from operator import itemgetter
import itertools
from functools import lru_cache as cache
DEFAULT_X_TOLERANCE = 3
DEFAULT_Y_TOLERANCE = 3
... |
# -*- coding: utf-8 -*-
# AUTHOR: <NAME>
# DATE: 19-9-19
import logging
import os
import torch.optim as optim
import torch.distributed as dist
from itertools import product
from .dee_helper import logger, DEEExample, DEEExampleLoader, DEEFeatureConverter, \
convert_dee_features_to_dataset, prepare_doc_batch_dict,... |
"""
Application File
"""
import csv
import flask
import flask.logging
from flask import Flask, Response, make_response, request, render_template
from io import StringIO
import logging
import os
import re
import sys
import traceback
import urllib.parse
from webapp import default_config
from webapp.common import to_xml_... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import math
import tqdm
from .temporal_transformer_windowed import tcn_unit_attention_block
from .temporal_transformer import tcn_unit_attention
from .gcn_attention import gcn_unit_attention
from .... |
import numpy as np
from random import random
from numba import njit
import random as rand
import matplotlib.pyplot as plt
class RotSurCode():
nbr_eq_classes = 4
def __init__(self, size):
self.system_size = size
self.qubit_matrix = np.zeros((self.system_size, self.system_size), dtype=np.uint8)... |
# Copyright (c) 2010 <NAME>
# Copyright (c) 2010, 2014 dequis
# Copyright (c) 2012 <NAME>
# Copyright (c) 2012-2014 <NAME>
# Copyright (c) 2012 <NAME>
# Copyright (c) 2013 horsik
# Copyright (c) 2013 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associate... |
#!/usr/bin/env python3
# Copyright (c) 2019-2021 <NAME>
# https://www.veriblock.org
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework addition to include VeriBlock PoP functions"""
import struct
import time
from typ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# coding=utf-8
# Copyright 2012 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright (c) 2011 University of Southern California / ISI
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... |
# Copyright 2019 The Cirq Developers
#
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.