text stringlengths 3.07k 22.1k |
|---|
import numpy as np
import os
import json
import keras.backend as K
from keras.callbacks import CSVLogger, ModelCheckpoint
from keras.models import model_from_json, Model
from keras.layers import Dense, Input
from dcase_models.util.files import save_json
from dcase_models.util.metrics import evaluate_metrics
from dcas... |
import tensorflow as tf
# the regularization part for the convolutional layers and dense layers.
l2_reg1 = tf.contrib.layers.l2_regularizer(5e-3)
l2_reg2 = tf.contrib.layers.l2_regularizer(0.0)
# the intializer for kenel and bias
kernel_initializer = tf.initializers.variance_scaling()
bias_initializer = tf.init... |
import csv
from .csvdialect import XBRLCSVDialect
from .validators import isValidIdentifier
from .column import FactColumn, PropertyGroupColumn, CommentColumn
from .specialvalues import processSpecialValues
from .values import ParameterReference, RowNumberReference, ExplicitNoValue, parseNumericValue, NotPresent
from .... |
import pandas as pd
import numpy as np
import xgboost as xgb
from collections import Counter
import random
from sklearn.metrics import accuracy_score, confusion_matrix
# from xgboost.sklearn import XGBClassifier
from sklearn.model_selection import train_test_split
# from sklearn import cross_validation, metrics
from sk... |
import os
from flask import Flask, request, jsonify
from flask_cors import CORS
from jwt import encode, decode
from jose.exceptions import JWSError
from passlib.context import CryptContext
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Column, Integer, String
# service name (initially used for sqlite f... |
import uuid
import numpy as np
from mujoco_py import const as mj_const
from gym.envs.robotics import rotations
def quat_angle_diff(quat_a, quat_b):
quat_diff = rotations.quat_mul(quat_a, rotations.quat_conjugate(quat_b))
angle_diff = 2 * np.arccos(np.clip(quat_diff[..., 0], -1., 1.))
return np.abs(rotat... |
import mimetypes
import os
import re
import shutil
import sys
import tarfile
import tempfile
import time
import zipfile
from contextlib import closing
from botocore.exceptions import ClientError
from webapp_deploy.aws import cf_client, parse_s3_url, s3_client
from webapp_deploy.config import (
cf_distribution_id,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to convert plain text wikipedia documents to conll format.
The documents are processed using as labels the entites in urls_dir.
"""
from __future__ import unicode_literals, print_function
import argparse
import cPickle as pickle
import os
import sys
from bs4 im... |
"""client.py
The client script continuously measures write performance, submitting the results to a server, as well as \
logging to client_{pid}.log. The client will run the specified run time, or defaults to a random time \
that will write at least 2 files if not provided. Writing is performed in chunks to a tempor... |
import numpy as np
from scipy import signal, optimize, interpolate
import warnings
def normalize_by_brightest(two_d_spectrum, n=10):
"""
:param two_d_spectrum: ndarray 2 dimensional, where two_d_spectrum[i] is the ith one d spectrum.
:return: two_d_spectrum where each row has been divided by norm,
... |
try: import define
except: from utils import define
try: import util
except: from utils import util
def get_NYU40_color_palette():
return [
(0, 0, 0),
(174, 199, 232), # wall
(152, 223, 138), # floor
(31, 119, 180), # cabinet
(255, 187, 120), # bed
(188, 189, 34), ... |
import datetime as dt
import logging
from typing import Sequence, Tuple, Union
import alphalens
import numpy as np
import pandas as pd
from jqfactor_analyzer import FactorAnalyzer
from scipy.stats.mstats import winsorize
from statsmodels.stats import descriptivestats
from . import AShareDataReader, DateUtils
from .co... |
import numpy as np
import scipy as sp
#STEPS/REASONING FOR FAST FIRSTPASS DECODER FUNCTION
#no need to create the many matrices of independent pixels. for each pixel
#the linear predictor would be a n_voxels sized vector where each voxel value
#is simply the value of its receptive field at the position of the pixel ... |
# Copyright 2019-2021 Cambridge Quantum Computing
#
# 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... |
import asyncio
from collections.abc import Coroutine
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from represent import ReprHelper
from sqlalchemy import util
from sqlalchemy.engine import Engine
async def _run_in_executor(_executor, _func, _loop=None, *args, **kwargs):
# use _... |
#!/usr/bin/env python3
# -*- encoding: UTF8 -*-
import unittest
from dnsuptools import dnsupdate
from tests.passwords import inwxUserDict, inwxPasswdDict
#turl = "test23.bahn.cf"
turl = "test42.bahn.cf"
#turl = "bahn.cf"
def filterResult(x, pkeys, skeys):
if type(pkeys) is not list:
pkeys = [pkeys]
i... |
import logging
import re
from datetime import datetime
from pprint import pprint
from typing import List, Optional, Union
from dictalchemy.utils import fromdict
from pydantic import BaseModel
from sqlalchemy.orm.exc import MultipleResultsFound
from sqlalchemy.orm.session import make_transient
from opennem.core.loader... |
import asyncio
import json
import logging
import time
from collections import OrderedDict
from io import BytesIO
from typing import Set, List, Union, Optional, Dict, Mapping, Any
from urllib.parse import parse_qs
from ipaddress import IPv4Address, IPv6Address, ip_address
from multidict import MultiDict, CIMultiDict, is... |
#!/usr/bin/env python3
# manual
"""
This script allows you to manually control the simulator or Duckiebot
using the keyboard arrows.
"""
import sys
import argparse
import pyglet
from pyglet.window import key
import numpy as np
import gym
import gym_duckietown
from gym_duckietown.envs import DuckietownEnv
from gym_duc... |
"""
Name: raw_data_cleanup_ziplevel.py
Purpose: For businesses with *ZIP-code level* (not parcel-level) geographic accuracy,
Take in the raw Data Axle CSV and make an output with the following fields:
-all input fields (name, address, lat/long, NAICS, etc.)
-flag field indicating if the record is a ... |
from pprint import pprint
from typing import List, Dict
from math import log, ceil
import argparse
import pandas as pd
from dwave.system import LeapHybridSampler
import dimod
def knapsack_bqm(cities, values, weights, total_capacity, value_r=0, weight_r=0):
"""
build the knapsack binary quadratic model
S... |
import pygame as pg
import time
# Will solve the given sudoku and draw the process using pygame
# This significantly reduces the speed of the algorithm
def checkValue(sudoku, value, x, y):
lstx = []
lsty = []
lstr = []
if x > 5:
xlimU = 5
xlimA = 9
elif x > 2:
xlimU = 2
... |
import numpy as np
import math
import cv2
import numba
import random
def get_rotation_matrix(angle: float, image_shape: tuple) -> (np.ndarray, np.ndarray):
[image_height, image_width, image_channel] = image_shape
t1 = np.array([[1, 0, -image_height / 2.], [0, 1, -image_width / 2.], [0, 0, 1]])
r1 = np.arr... |
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (C) 2018, M.B.Moessner
#
# 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 code must retain the above copyright
# notice, this list o... |
# monkey patching solidpython to be more pythonic
import solid
from solid.utils import *
import os
import json
import math
__version__ = "0.1.0"
def ff_translate(x, y=0, z=0):
if isinstance(x, (list, tuple)):
return solid.translate(x)
else:
return solid.translate([x, y, z])
def ff_rotate(a=... |
from datetime import datetime
import math
from typing import List, Tuple
from matplotlib.axes import Axes
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
from planner.cbFunctions import heuristicFunction, cbf
from planner.drone import DroneGoalState, DroneState
from planner.flyZone import FlyZone
... |
import base64
import os
import datetime
import plaid
import json
import time
from flask import Flask
from flask import render_template
from flask import request
from flask import jsonify
app = Flask(__name__)
# Fill in your Plaid API keys - https://dashboard.plaid.com/account/keys
PLAID_CLIENT_ID = os.getenv('PLAID_... |
import numpy as np
import sys
import os
class CrossEntropy:
"""May be used as cost function in the NeuralNetwork class. Both the function
itself and the derivative are provided as methods."""
@staticmethod
def function(a, y):
return np.sum(-y * np.log(a) - (1 - y) * np.log(1 - a))
@static... |
# Copyright (c) 2021, Hitachi America 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 by appli... |
import datetime
import json
import os
from unittest.mock import patch, mock_open, Mock, call, DEFAULT
from nose.tools import eq_, raises, assert_raises
from PIL import Image
old_mode = os.environ.get('MODE', None)
os.environ['MODE'] = 'test'
from server import (
is_authorized,
get_new_oid,
get_img_date,
... |
from bisect import bisect_right
from collections import defaultdict
from enum import Enum, unique
from heapq import heappush, heappushpop
from io import StringIO
from logging import DEBUG, getLogger, INFO
from pathlib import Path
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple
from dgl import u... |
import itertools
import pint
from xarray import DataArray, Dataset, IndexVariable, Variable
from .compat import call_on_dataset
from .errors import format_error_message
no_unit_values = ("none", None)
unit_attribute_name = "units"
slice_attributes = ("start", "stop", "step")
temporary_name = "<this-array>"
def arr... |
#!/usr/bin/env python
"""
Typical Usage:
coords2dihedrals_projected.py 180 < 12column_text_file.dat
This script reads a 12-column numeric text file representing the positions
of 4 atoms. Then it calculates the "projected dihedral", which I define
as the difference in direction between two infinitely long lines:
-T... |
from functools import partial
import copy
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from raft import RAFT, CentroidRegressor, ThingsClassifier
import dorsalventral.models.bootnet as bootnet
import dorsalventral.models.layers as layers
import dorsalventral.models.targets as t... |
import time
from pathlib import Path
from collections import deque
from typing import Optional
import numpy as np
from lib.opengl.core.base import *
from lib.opengl import *
from lib.opengl.postproc import PostProcNode
from lib.gen.automaton import ClassicAutomaton
ASSET_PATH = Path(__file__).resolve().parent.parent... |
import tensorflow as tf
import glob
import numpy as np
import random
import cv2
import multiprocessing
image_size = 64
SEED = 50129
#Retrieves images' paths from directory
def GetImagesPaths(path_pattern, status):
pattern = path_pattern + status + '/*.jpg'
paths = glob.glob(pattern)
print (pattern + '. #files: ' +... |
"""
###########################################################################
# @file Algorithm.py
# @brief Core function conducting clustering part of CHIMERA
#
# @author <NAME>
#
# @Link: https://www.cbica.upenn.edu/sbia/software/
#
# @Contact: <EMAIL>
###############################################################... |
# View3D, Copyright (c) 2018 Alliance for Sustainable Energy, LLC
# 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 code must retain the above copyright notice, this... |
# Copyright (c) 2021 AllSeeingEyeTolledEweSew
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERC... |
from __future__ import print_function
import rospy
import numpy as np
import pandas as pd
import time
import math
import random
import tf
from gym import spaces
from .turtlebot_robot_env import TurtlebotRobotEnv
from gym.envs.registration import register
from gazebo_msgs.msg import ModelState
from geometry_msgs.msg i... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
import os
from .models import *
from bob.db.base.driver import Interface as BaseInterface
import bob.core
logger = bob.core.log.setup('bob.db.fargo')
def add_clients(session, imagesdir):
"""Add clients
This function adds clients to the database.
Parame... |
# encoding: utf-8
#
# This file was taken from webpyte (r179):
# http://code.google.com/p/webpyte/source/browse/trunk/webpyte/email_validator.py
# According to the docstring, it is licensed as 'public domain'
#
# Modifications:
# * Wed Mar 25 2009 <NAME>
# - Removed 'from __future__ import absolute_import to stay comp... |
import re
from django.conf import settings
from rest_framework.generics import GenericAPIView
from django.http import HttpResponse
import logging
from django.db.models import Q
from functools import reduce
from operator import or_
from webfront.exceptions import EmptyQuerysetError, BadURLParameterError
from webfront.... |
import os
import io
import re
import numpy as np
import pandas as pd
import pickle
from PGCAltas.utils.webUniversal import base64UUID
from PGCAltas.utils.errors import OSPathError, DataFrameFitError, ReaderLoadError
from .. import PATH_
class DataReaderBase(object):
"""
Examples:
r = DataReader('GSE1... |
"""
This solves the particle mesh given intial density field, time steps and cosmology.
Additional options to choose smoothening and use 2LPT initial conditions
Use kick-drift-kick for evolution
In acceleration, poisson is solved by (/k**2) and derivative with (i*k)
"""
import numpy
import math
import cosmology
impo... |
import hashlib
import numpy as np
from keras.preprocessing import sequence
from mcts import parameters as p
class SMILES:
"""
Class representing a SMILES
"""
def __init__(self, element=None):
"""
Initialise the new SMILES
:param element: the list of token corresponding to th... |
"""Tests with the ATTAS aircraft short-period mode estimation."""
import importlib
import os
import numpy as np
import scipy.io
import scipy.linalg
import sympy
import sym2num.model
import fem
import symfem
# Reload modules for testing
for m in (fem, symfem):
importlib.reload(m)
def load_data():
# Retri... |
"""Tests for graph_update Keras layers."""
import enum
import os
from absl.testing import parameterized
import tensorflow as tf
from tensorflow_gnn.graph import adjacency as adj
from tensorflow_gnn.graph import graph_constants as const
from tensorflow_gnn.graph import graph_tensor as gt
from tensorflow_gnn.graph.kera... |
import logging
logger = logging.getLogger("sideserver")
# uvicorn notes:
# Access log LogRecord contains non-picklable in scope
# Can we document the Config() and serve()?
# Method to trigger shutdown?
# Set up signal handlers outside of serve(), same place as the reloader?
# disable sys.exit(1) ?
# Detect whether st... |
import itertools
import datetime
import pandas as pd
import numpy as np
import requests
import math
import os
import warnings
import torch
import multiprocessing
import GPUtil
from torch import nn
from torch.autograd import Variable
from torch.utils.data import Dataset, DataLoader
from sklearn.model_selection import tr... |
"""
@brief Unit tests for image_utils.py module.
@author <NAME> <<EMAIL>>
"""
import os
import unittest
import numpy as np
from scipy import interpolate
import lsst.afw
import lsst.eotest.image_utils as imutils
from lsst.eotest.sensor import MaskedCCD, AmplifierGeometry
from lsst.eotest.sensor.AmplifierGeometry import... |
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth import logout
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from .models import Viagem, Motorista, Veiculo
from .form import VeiculoForm, Motoris... |
import json
from numpy.core.numeric import NaN
import pandas as pd
from telegram import ChatAction
import telegram
from telegram.ext.conversationhandler import ConversationHandler
DATA_ANALISIS_ALL_MEMBER = 0
DATA_DESCRIPTION = 0
DATA_ANALISIS_ONE_MEMBER = 0
ENABLE_ANALISIS = 0
def enable_analisis(update, context):
... |
from tika import parser
import unicodedata
import os
import sys
import json
import nltk
# nltk.download('stopwords')
## use OCR to convert PDF/DOCX files to text files
# python object that containes the JSON data
reqBody = json.loads(sys.argv[1])
# get directory names where resumes are stored - call it 'RESUMES... |
################################################################################
################################################################################
import ConfigParser
import weakref
from pprint import pformat
import urllib
import re
import constants
import session
from rpc import *
import logging, logg... |
"""A convolutional neural network for CIFAR-10 classification.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from utils import cifar
from utils.utils import put_kernels_on_grid
EPOCH = 36000
BATCH_SIZE = 128
def weight_variab... |
from __future__ import annotations
import subprocess as sp
import sys
from ..environment import (
Environment,
Dependency,
HeaderDependency,
LibraryDependency,
ProgramDependency,
Installer,
GNUInstaller,
GurobiInstaller,
)
from ...errors import InstallError, UninstallError
wrapped_pyt... |
import csv
import requests
import datetime
from jhu.loc import Distance
from tp.gremlin import TinkerPopAble
#https://stackoverflow.com/a/35371451/1497139
class COVIDCases():
'''
raw time series csv data of Johns Hopkins University at https://github.com/CSSEGISandData/COVID-19
'''
BASE_URL_TIME... |
# =============================================================================
# Libs
# =============================================================================
from torch.utils.data import Dataset
import torch.nn.functional as F
from collections import Counter
from os.path import exists
import torch.optim as opt... |
# 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 pkg_resources
import types
import time
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import seaborn as sns
from IPython import display
import math
from pprint import pprint
import pandas as pd
import numpy as np
import nltk
import matplotlib.pypl... |
# -*- coding:utf-8 -*-
# author: lyl
"""
1. 登录认证;
2. 增删改查和搜索
3.1 增 add # add monkey 12 132xxx <EMAIL>
3.2 删 delete # delete monkey
3.3 改 update # update monkey set age = 18
3.4 查 list # list
3.5 搜 find # find monkey
3. 格式化输出
"""
# 标准模块
import sys
import ge... |
from typing import List, Optional
import torch, spacy, logging
import numpy as np
from allennlp.common.util import JsonDict, sanitize
from allennlp.common.checks import ConfigurationError
from allennlp.data import DatasetReader, Instance
from allennlp.data.tokenizers import WordTokenizer
from allennlp.models import M... |
# 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 agreed ... |
# encoding:utf-8
import cv2,os,numpy as np,random
from skimage import exposure
from skimage import util
import ast
import math
from multiprocessing import Process, Pool
import logging
logging.basicConfig(level = logging.DEBUG,format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(... |
import asyncio
import functools
import caproto as ca
from ...asyncio.server import AsyncioAsyncLayer, ServerExit
from ...asyncio.utils import (AsyncioQueue, _create_bound_tcp_socket,
_create_udp_socket, _DatagramProtocol,
_TaskHandler, _TransportWrapper,
... |
import os
import yaml
import cerberus
import hailjwt as hj
from . import api, schemas
from .poll_until import poll_until
class Job:
def __init__(self, client, id, attributes=None, parent_ids=None, _status=None):
if parent_ids is None:
parent_ids = []
if attributes is None:
... |
## @package pypowerextender
# @file PowerExtender.py
# @author <NAME>
# @brief Defines function to interface the power-extender board
# @version 0.0.1
# @date 2021-07-20
from enum import IntEnum
import smbus
import time
from . import ADS1115_Registers
from . import PCA9557_Registers
PERIPHERAL_GPIO_ADDRESS = 0x18 #... |
"""
cli exposed via flask *function-name
wrap create_app with the @command_line_interface decorator
`export FLASK_APP=cluster` is necessary.
`flask --help` to show available functions
to add another cli write a click.command() function and add the function name into CLICK_COMMANDS (at bottom of file)
"""
import dat... |
from collections import defaultdict
from django.contrib.auth.models import User
from django.db import models
from django.db.models import Prefetch
from django.utils import timezone
from workflows.models.option import Option
from workflows.models.output import Output
from workflows.models.input import Input
from workf... |
#!/usr/bin/env python
# $Id: which_split_test.py 125167 2014-10-29 01:16:40Z jvansanten $
# $Revision: 125167 $
# $LastChangedDate: 2014-10-28 21:16:40 -0400 (Tue, 28 Oct 2014) $
# $LastChangedBy: jvansanten $
from I3Tray import *
from icecube import icetray, dataclasses, dataio
from icecube.icetray import pypick, I3... |
import logging
import pytest
import six
import ddtrace
from ddtrace.constants import ENV_KEY
from ddtrace.constants import VERSION_KEY
from ddtrace.contrib.logging import patch
from ddtrace.contrib.logging import unpatch
from ddtrace.contrib.logging.patch import RECORD_ATTR_SPAN_ID
from ddtrace.contrib.logging.patch ... |
# Author: <NAME>, TU Darmstadt (<EMAIL>)
# Parts of this code were adapted from https://github.com/ucbdrive/hd3
import argparse
import logging
import os
import shutil
import torch
from tensorboardX import SummaryWriter
from datasets import datasets_flow
from models_refine.refinement_networks import PPacNet
import pro... |
# -*- coding: utf-8 -*-
import mltk
from mltk.data import ArraysDataStream, DataStream
import tensorkit as tk
from tensorkit import tensor as T
import sys
import torch
import numpy as np
from flow_next.common import TrainConfig, DataSetConfig, make_dataset, train_model, ImageAugmentationMapper, get_mapper
from flow_ne... |
import enum
import signal
import random
import asyncio
import heapq
import uuid
import functools
import traceback
import socket
import os
import raft.raft_pb2 as raft_pb2
from raft.util import RaftDebugger, ignore_stale
# TODO: implement signal handlers.
# TODO: multiplex commands + logs
# TODO: create isready meth... |
#!/usr/bin/env python
from pathlib import Path
import numpy as np
import h5py
from typing import Tuple
import xarray
"""
inputs:
spec: excitation rates, 3-D , dimensions time x altitude x reaction
output:
ver: a pandas DataFrame, wavelength x altitude
br: flux-tube integrated intensity, dimension lamb
See Eqn 9 of A... |
import torch
import time
import trimesh
import numpy as np
import torch.optim as optim
from torch import autograd
from utils.libmise import MISE
from utils import libmcubes
from utils.libsimplify import simplify_mesh
def make_3d_grid(bb_min, bb_max, shape):
''' Makes a 3D grid.
Args:
bb_min (tuple): ... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
"""
Channel Attention and Spaitial Attention from
<NAME>., <NAME>., <NAME>., & <NAME>. CBAM: Convolutional Block Attention Module. ECCV2018.
"""
class ChannelAttention(nn.Module):
def __init__(self, in_planes, ratio=8):
su... |
from __future__ import print_function
import argparse
import os
from os.path import exists, join
import logging
import numpy as np
import cv2
import torch
from torch.utils import data
from torch import nn, optim
from torch.nn import functional as F
from datasets.dataloader import load_data
from models.convVAE import Co... |
from pathlib import Path
import pandas as pd
from shapely.geometry import Point
import shapely.ops
import json
from explore import all_crop_codes
import glob
import re
import geopandas as gpd
import numpy as np
import os
import utm
import pyproj
def _get_coords(shp):
p = [coord for coords_list in shp.coords[:] f... |
'''
https://programming.vip/docs/r-breaker-strategy-for-commodity-futures.html
https://github.com/myquant/strategy/blob/master/R-Breaker/info.md
The R-Breaker strategy was developed by <NAME> and published in 1994.
After that, it was ranked one of the top 10 most profitable trading strategies
by Fut... |
from typing import List, Union, Dict, Any, Tuple
import sys
import zipfile
import io
import os
import hashlib
import logging
import tempfile
import shutil
from glob import glob
import requests
import pandas as pd
import requests
import layoutparser as lp
import pandas as pd
from tqdm import tqdm
from PyPDF2 import Pdf... |
import csv
import json
import re
import sys, os
import requests
from biorun import utils
from biorun.libs import placlib as plac
logger = utils.logger
# SRR numbers: SRR5260547
SRR = re.compile(r'(ERR|SRR|DRR)\d+')
# Bioproject numbers: PRJNA374918
PRJ = re.compile(r'PRJ([A-Z])+\d+')
# Genbank accessions: NC_0455... |
#!/usr/bin/env python2.7
'''
iBRAINTool is helper command line utility class for simplifying handling of
iBRAIN project flags, files, etc. This includes basic operations like refresh
the project modification date or restarting the modules.
Requires PyPlato: https://github.com/ewiger/plato
sudo easy_install PyPlato
Th... |
import numpy as np
import scipy.interpolate
import time
from liegroups import SE3
from pyslam.utils import stackmul, bilinear_interpolate
from numba import guvectorize, float32, float64
SE3_ODOT_SHAPE = np.empty(6)
@guvectorize([(float32[:], float32[:], float32[:, :]),
(float64[:], float64[:], float... |
from sys import argv
import struct
from .aesengine import AESEngine
from .crypt_file import CryptFile
import hashlib
from os import SEEK_CUR, SEEK_SET
from binascii import unhexlify
fs_type_map = [
'none',
'normal',
'what',
'firm',
'agbsave'
]
keyslot_map = [
[0x03, 0x04, 0x05],
[None, None, None],
[None, 0x0... |
"""Render functions and helpers
Render functions and helpers
============================
:mod:`pylons.templating` includes several basic render functions,
:func:`render_mako`, :func:`render_genshi` and :func:`render_jinja2`
that render templates from the file-system with the assumption that
variables intended for th... |
from __future__ import print_function
import boto3
import datetime
import dateutil.parser
import random
def lambda_handler(event, context):
""" Route the incoming request based on type (LaunchRequest, IntentRequest,
etc.) The JSON body of the request is provided in the event parameter.
"""
print("event... |
'''
A module for I/O between Vaex and Google BigQuery.
Requires:
- google.cloud.bigquery
- google.cloud.bigquery_storage
'''
import tempfile
import pyarrow as pa
import pyarrow.parquet as pq
from vaex.docstrings import docsubst
import vaex.utils
google = vaex.utils.optional_import("google", modules=[
"google... |
import logging
import datetime
import time
import quickfix as fix
import quickfix44 as fix44
import app.pxm44 as pxm44
logger = logging.getLogger(__name__)
class PriceFeed(fix.Application):
def __init__(self, message_queue, shutdown_event, subscriptions):
logger.info('Initialising Price Feed')
... |
"""
@author - thisIsShubhamSharma
Date - 03-01-2021
Main driver file - Displays board and handels user input.
"""
import os
import sys
import pygame as p
import chess_engine
import chess_ai
p.init()
WIDTH = HEIGHT = 512
DIMENSION = 8
SQ_SIZE = HEIGHT // DIMENSION
MAX_FPS = 15
IMAGES = {}
'''
initialize a global di... |
# gdpyt-analysis: utils.boundary
"""
Notes
"""
# imports
from os.path import exists, join
import numpy as np
from skimage.io import imread, imsave
from skimage.exposure import rescale_intensity
import skimage
from matplotlib import pyplot as plt
from skimage.draw import polygon, disk, circle_perimeter, ellipse
from sc... |
# %%
import sys
sys.path.append("../../..")
from scipy.linalg import null_space
import copy
import numpy as np
from numpy.linalg import matrix_rank, matrix_power, cholesky, inv
import torch
from torch.optim import Adam
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
import util.geometry_util ... |
# Import Packages
import argparse
import os
import sys
import time
import datetime
import glob
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
import pandas as pd
import numpy as np
... |
import typing
import gym
from gym import wrappers
import random
import math
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from collections import namedtuple
import os
from .base_agent import BaseAgent, AgentHyperPar... |
from flask import Flask, render_template, request, flash, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from sqlalchemy import text, update, func
from flask_wtf import FlaskForm
from werkzeug.security import generate_password_hash, check_password_hash
from wtforms imp... |
import mindspore
import mindspore.common.dtype as mstype
import mindspore.nn as nn
import mindspore.ops as ops
import numpy as np
from mindspore import Tensor
####################################################################
# ------------------------- SPL LOSS -------------------------------
#####################... |
from glob import glob
import time
import os
import torch
import torch.backends.cudnn as cudnn
from torch.optim.lr_scheduler import ReduceLROnPlateau
from fastai import *
from fastai.core import *
from fastai.torch_core import *
from fastai.basic_data import *
from fastai.basic_train import LearnerCallback, Learner
fro... |
"""jello - query JSON at the command line with python syntax"""
import os
import sys
import ast
import json
from jello.dotmap import DotMap
# make pygments import optional
try:
from pygments import highlight
from pygments.style import Style
from pygments.token import (Name, Number, String, Keyword)
fr... |
"""
Author: <NAME>
BSD 3-Clause License
Copyright (c) 2019, The Regents of the University of Minnesota
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.