text stringlengths 3.07k 22.1k |
|---|
import json
import os
import shutil
import stat
import sys
import platform
import tarfile
import zipfile
from enum import Enum
import requests
import urllib3
import managed_tool
from maintenance import Maintenance
from tool import Tool
HOME_PATH = os.environ.get("HOME")
DEVTC_HOME_PATH = "{}/.devtc".format(HOME_PATH... |
import scipy
import pandas as pd
from scipy.signal import find_peaks,peak_widths
import scipy.signal
from scipy.signal import savgol_filter
from brian2 import *
from tqdm import tqdm
from sklearn.preprocessing import RobustScaler,StandardScaler
try:
import tensortools as tt
has_tt=True
except:
has_tt = Fals... |
#%%
"""
Created on June 27 2021
Construction of a yield curve for a given set of swap instruments
This code is purely educational and comes from "Financial Engineering" course by <NAME>
The course is based on the book “Mathematical Modeling and Computation
in Finance: With Exercises and Python and MATLAB Comput... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 7 17:51:42 2015
*REMOVED*
"""
import numpy as np
from matplotlib.path import Path
# -----------------------------------------------------------------------------#
def mesh_zone(contour_zone, step):
"""
This function takes as an input a contour represented ... |
# mmpdb - matched molecular pair database generation and analysis
#
# Copyright (c) 2015-2017, <NAME> Ltd.
#
# 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 above ... |
# -*- coding: utf-8 -*-
"""
@author: Diego
"""
import zipfile
import pandas as pd
from bs4 import BeautifulSoup
import requests
import io
import sqlite3
import os
import datetime
cwd = os.getcwd()
pd.set_option("display.width", 400)
pd.set_option("display.max_columns", 10)
pd.options.mode.chained_assignment = None
c... |
import math
import numpy as np
from scipy import ndimage
def gauss2d(sigma, fsize):
"""
Args:
sigma: width of the Gaussian filter
fsize: dimensions of the filter
Returns:
g: *normalized* Gaussian filter
"""
#
# You code here
#
def createfilters():
"""
Returns:... |
import numpy as np
from datetime import datetime
from .routine import get_fix_string, get_fix_list
from .routine import get_equal_strings, get_equal_lists
from .models.base_model import MODEL_NAME_LENGTH
UP_END = "┌"
DOWN_END = "└"
MIDDLE = "├"
LAST = "┤"
EMPTY = "│"
START_END = "┐"
SPACE = " "
USELESS_SUBKEYS = {
... |
from collections import OrderedDict
from django.core.serializers.json import DjangoJSONEncoder
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.db.models import Q
import json
from djang... |
from queue import Queue, Empty
from threading import Thread, Semaphore
from gridvm.network.nethandler import NetHandler
from gridvm.network.protocol.packet import PacketType
from gridvm.network.protocol.packet import Packet
from gridvm.network.protocol.packet import make_packet
class EchoCommunication:
def __ini... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import enchant
import regex as re
# creates a .csv file into which our results will go
outputFile = open("responses-and-notes-separated.csv", "w")
# creates the object that will take our data and write it to our .csv
outputWriter = csv.writer(outputFile)
# li... |
import pandas as pd
from sklearn.cross_validation import train_test_split
import numpy as np
from sklearn.metrics import mean_squared_error
import os
class collaborativeFiltering():
def __init__(self):
pass
def readSongData(self, top):
"""
Read song data from targeted url
"""
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised))
# Copyright (c) 2016-2021, <NAME>; <NAME>
# All rights reserved.
# =============================================================================
# DOCS
# =======================================... |
# Copyright (c) 2018 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... |
#!/usr/bin/env python3
import io
import re
import json
import pydoc
import zipfile
import traceback
import argparse
import collections
from datetime import datetime
import urllib.request as request
from itertools import count
Vec3d = collections.namedtuple('Vec3d', 'x,y,z')
Orient3d = collections.namedtuple('Orient3d'... |
# Import required modules
import csv
import cv2
import numpy as np
import os
import sklearn
import math
import matplotlib.pyplot as plt
import random
from scipy import ndimage
# get_data function obtained data from the working directory and returns the training/validation data in an array
def get_data():
# Used to... |
import os
import sys
if sys.version_info[0] < 3:
from cPickle \
import \
load, dump, dumps
else:
from pickle \
import \
load, dump, dumps
from yaku._config \
import \
DEFAULT_ENV, BUILD_CONFIG, BUILD_CACHE, CONFIG_CACHE, HOOK_DUMP, \
_OUTPUT
from yak... |
import enum
import json
import typing
import dataclasses
# === DEFINE ALL ENUMERATIONS === #
class PatchGeometry(enum.Enum):
D1_LINE_SEGMENT = 1
D2_CIRCLE = 2
D2_RECTANGLE = 3
D2_SWEEP_LINE = 4
D2_ELLIPSE = 5
D2_VORTEX = 6
D2_ANALYTICAL = 7
D3_SPHERE ... |
'''
Copyright 2021 Delta Electronic 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, s... |
# -*- coding: utf-8 -*-
"""
Copyright 2015-2021 The MITRE Corporation.
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unl... |
"""Collection of layers that are using producing weight allocations."""
import cvxpy as cp
from cvxpylayers.torch import CvxpyLayer
import torch
from torch.distributions import MultivariateNormal
import torch.nn as nn
from .misc import Cov2Corr, CovarianceMatrix, KMeans
class AnalyticalMarkowitz(nn.Module):
"""... |
import pytest
import time
from os import path
from flask import Flask, session, jsonify
from flask.sessions import SecureCookieSessionInterface
from beaker.middleware import SessionMiddleware
from flask_beaker_session import config, session as beaker_session, errors, session_interface
from unittest.mock import Mock
... |
import os
import sys
import json
import requests
import pathlib
import argparse
import time
import xml.etree.ElementTree as ET
from plexapi.server import PlexServer
from datetime import datetime, timezone
# example http://192.168.1.XXX:32400
PLEXURL = ''
# https://support.plex.tv/articles/204059436-finding-an-authenti... |
# coding: utf-8
# Copyright 2020 <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... |
from typing import Tuple, Dict, Callable, Iterator, Union, Optional, List
import numpy as np
import torch
from torch import Tensor
import botorch
import gpytorch
delta_n = lambda n: ((1 / 6) * n) ** (1 / 2) * (
1 / 3 * (1 + 2 * (1 - 3 / (5 * n)) ** (1 / 2))
) ** (1 / 2)
delta_n_lower_bound = lambda n: 1 / 3 * n ... |
"""passlib.handlers.django- Django password hash support"""
#=============================================================================
# imports
#=============================================================================
# core
from base64 import b64encode
from hashlib import md5, sha1
import re
import logging; ... |
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth import logout as log_out
from django.conf import settings
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from urllib.parse import urlencode
from django.temp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import json
import inspect
from argparse import ArgumentParser
SELF = inspect.getfile(inspect.currentframe())
ROOT = os.path.dirname(os.path.abspath(SELF))
settings_file_default = 'settings.json'
if not os.path.isfile(settings_file_default):
set... |
import numpy as np
def writeFFDFile(fileName, nBlocks, nx, ny, nz, points):
"""
Take in a set of points and write the plot 3dFile
"""
f = open(fileName, "w")
f.write("%d\n" % nBlocks)
for i in range(nBlocks):
f.write("%d %d %d " % (nx[i], ny[i], nz[i]))
# end
f.write("\n")
... |
import argparse
import numpy as np
import torch
from utils import get_model, compute_score, cifar10, cifar100, return_path_to_folder
class AdversarialAttack:
def __init__(self, model, dataset, n_epochs, step_size, opu_output, opu_input, pgd_attacks_iterations, binary_layer,
save_images, sign_bac... |
'''Optimize rateless codes for distributed computing
'''
import math
import random
import logging
import numpy as np
import pandas as pd
import pyrateless
import stats
import complexity
import overhead
import pynumeric
import tempfile
import subprocess
from os import path
from multiprocessing import Pool
def optimi... |
import spacy
from spacy.tokenizer import Tokenizer
import socket
from socket import error as SocketError
import errno
import selectors
import types
import time
import pandas as pd
from pypinyin import pinyin as pfmt
from pypinyin import Style
import opencc
from config import TOKENIZER_HOST, TOKENIZER_PORT, MAX_BUF, SOR... |
#! /usr/bin/env python
import os
import numpy as np
from astropy.io import fits
from astropy import units as u
import sys
import string
import matplotlib.pylab as plot
import nrm_analysis
from nrm_analysis.fringefitting.LG_Model import NRM_Model
from nrm_analysis.misctools import utils
from nrm_analysis import nrm_c... |
#!/usr/bin/env python3
"""
Analyse the nmap scan for iLO.
"""
import argparse
import xml.etree.ElementTree as ET
def extract_ilo_information(host):
"""
Extract relevant information for the iLO evaluation.
:param host: host element from nmaprun
:type host: xml.etree.ElementTree.Element
:returns: ... |
#!/usr/bin/env python
from PIL import Image, ImageDraw
import random as pyrandom
import sys
import os.path
import shutil
import re
import subprocess
import numpy as np
from glob import glob
import argparse
from skimage.filters.rank import entropy
from skimage.morphology import disk
from skimage.io import imread, imsav... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Brno University of Technology FIT
# Author: <NAME> <<EMAIL>>
# All Rights Reserved
import os
import re
import pickle
import logging
from shutil import rmtree
from subprocess import check_output
from tempfile import mkdtemp, NamedTemporaryFile
import... |
# coding: utf-8
try: # python3
from io import BytesIO
import urllib.request
except ImportError: # python2
import StringIO
import urllib
import random, csv, util, time, os
'''
makeRandomConfig:generate data by random function
:returns configuration parameters' name, and the configuration parame... |
"""
A pipeline module for rasterizing vector datasets.
"""
import logging
import os
import uuid
from typing import Any, List, Optional, Tuple, Union
import fiona
import fs
import geopandas as gpd
import numpy as np
from pydantic import Field, validator
from eolearn.core import (
CreateEOPatchTask,
EONode,
... |
#!/usr/bin/env python3
"""
Plot free energy landscapes using RMSD and radius of gyration stored in HDF5 files.
Usage:
command [options] HDF_FILES...
command -h | --help
Options:
-h, --help Show this screen.
-c, --common Create landscapes with same ranges in
... |
from django.apps import apps
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
from django.db.models import Manager
from .conf import get_available_languages, get_default_language
from .fields import TranslationField, translated_field_factory
from .manager import MultilingualManager, transform... |
from config import get_config
import os
from tqdm import tqdm
import mxnet as mx
import torch
import pickle
import bcolz
import cv2
import numpy as np
from pathlib import Path
from torch.utils.data import Dataset, ConcatDataset, DataLoader
from torchvision import transforms as trans
from torchvision.datasets import Ima... |
from schrodinger.structutils import rmsd, transform, interactions, analyze, measure
from schrodinger.structure import StructureReader, Structure
import numpy as np
import argparse
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.spatial.transform import Rotation
def main():
parse... |
import numpy as np
import re
import json
class Obscuration:
def __init__(self, lowCorner, highCorner, transmissionCoeff):
self.transmissionCoeff = transmissionCoeff
self.lowCorner = lowCorner
self.highCorner = highCorner
def getFactor(self, rayFrom, rayTo):
rayFrom = np.copy(... |
import os
import hashlib
import numpy as np
from pybullet_envs import env_bases
from pybullet_envs import scene_abstract
from d4rl.pointmaze_bullet import bullet_robot
from d4rl.pointmaze import maze_model
from d4rl import offline_env
class MazeRobot(bullet_robot.MJCFBasedRobot):
def __init__(self, maze_spec):
... |
import pygame as pg
import utils as u
import random
class Projectile(pg.sprite.Sprite):
def __init__(self, **kwargs):
self.cfg = kwargs
pg.sprite.Sprite.__init__(self)
self.image = kwargs["image"]
self.rect = self.image.get_rect()
if type(kwargs["owner"]) is Boss:
... |
#!/usr/bin/env python
import click
import pandas as pd
import numpy as np
from os import mkdir
from os.path import basename, join
from functools import partial
DATA_TYPES_NUMERIC = ('int', 'float')
FINAL_LIST = [
'study_id', 'host_scientific_name',
'latitude_deg', 'longitude_deg',
'envo_biome_3', 'empo... |
#
# Copyright 2015-2020 <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
"""
"""
from typing import Any, Callable, Iterable, Optional, Tuple
from .init_args import init_args
from .key_swap import key_swap
__all__ = [
'ExtraKeysError',
'_get_dict',
'InitArgsError',
'marshal_dict',
'unmarshal_dict',
'marshal_list',
'unmarshal_list',
]
def _get_dict(
obj:... |
from typing import List
import pytest
from thinc.api import fix_random_seed, Adam, set_dropout_rate
from thinc.api import Ragged, reduce_mean, Logistic, chain, Relu
from numpy.testing import assert_array_equal, assert_array_almost_equal
import numpy
from spacy.ml.models import build_Tok2Vec_model, MultiHashEmbed, Maxou... |
#!/usr/bin/python3
import os
import cv2
import sys
import rospy
import torch
import argparse
import numpy as np
from PIL import Image
import time
from cv_bridge import CvBridge
from sensor_msgs.msg import CompressedImage
from std_msgs.msg import Float32MultiArray
from std_msgs.msg import MultiArrayDimension
impo... |
import h5py
import numpy as np
from .core import CompartmentReaderABC
from bmtk.utils.hdf5_helper import get_attribute_h5
class _CompartmentPopulationReaderVer01(CompartmentReaderABC):
sonata_columns = ['element_ids', 'element_pos', 'index_pointer', 'node_ids', 'time']
def __init__(self, pop_grp, pop_name):... |
import os
import discord
from dotenv import load_dotenv
import datetime
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD_NAME')
bot = discord.Client()
@bot.event
async def on_ready():
for guild in bot.guilds:
if guild.name == GUILD:
break
print("OK")
@bot... |
#!/usr/bin/env python
"""
# > Various modules for handling data
# - Paper: https://arxiv.org/pdf/2002.01155.pdf
# Maintainer: Jahid (email: <EMAIL>)
# Interactive Robotics and Vision Lab (http://irvlab.cs.umn.edu/)
"""
from __future__ import division
from __future__ import absolute_import
import os
import random
im... |
from Bio.SubsMat import MatrixInfo
from Bio.Alphabet import IUPAC
from collections import OrderedDict
import numpy as np
import pandas as pd
import re
import os
import pickle
def Embed_Seq_Num(seq,aa_idx,maxlength):
seq_embed = np.zeros((1, maxlength)).astype('int64')
if seq != 'null':
n = 0
fo... |
import discord
import secrets
import itertools
import random
import re
import os
from keepAlive import keep_alive
import requests
import json
client = discord.Client()
prefix = '&'
diceTypes = [4,6,8,10,12,20,100]
dnd5e_races = ["DragonBorn", "Dwarf", "Elf", "Gnome", "Half-Elf", "Halfing", "Half-Orc", "Human", "Tief... |
import config
import json
import urllib.request, urllib.parse, urllib.error
import boto3
import botocore
import tempfile
import tarfile
import debian.arfile
import hashlib
import re
import sys
import os
def checksums(fname):
fh = open(fname, "rb")
md5 = hashlib.md5()
sha1 = hashlib.sha1()
sha256 = h... |
# -*- coding: utf-8 -*-
"""
Written by <NAME> and CONTRIBUTORS
Email: danaukes<at>asu.edu.
Please see LICENSE for full license.
"""
import popupcad
from popupcad.filetypes.operation2 import Operation2, LayerBasedOperation
import qt.QtCore as qc
import qt.QtGui as qg
from popupcad.filetypes.laminate import Laminate
f... |
import asyncio
import time
import uuid
from ruamel import yaml
from discord.ext import commands
import discord
from .spoilers import SADAMA_ROLE, VSPOILER_ROLE, SPOILER_ROLE
debug = 0
if debug == 1: # hanss314
MEMELORD_CHANNEL = 368282610910363648
JOINBOT_CHANNEL = 368282610910363648
MODERATOR_ROLE = 2... |
import re
from typing import Any, NamedTuple, Tuple
__all__ = ["expand_contractions"]
class Rule(NamedTuple):
pattern: Any
replacement: str
FLAGS = re.IGNORECASE
# Ordering of the rules matters.
# Contractions based on the following references:
# https://stackoverflow.com/a/19794953/519951
... |
import http
import logging
import sys
import time
from collections import abc
from copy import copy
from os import getpid
import click
TRACE_LOG_LEVEL = 5
class ColourizedFormatter(logging.Formatter):
"""
A custom log formatter class that:
* Outputs the LOG_LEVEL with an appropriate color.
* If a l... |
# Copyright 2019-2020 Xanadu Quantum Technologies 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... |
#!/usr/bin/env python3
# coding: utf-8
from wxpy import *
from wxpy.utils import start_new_thread
from config import *
import itchat
import re
import time
import os
import platform
import trigger
import notice
'''
使用 cache 来缓存登陆信息,同时使用控制台登陆
'''
console_qr = (False if platform.system() == 'Windows' else True)
bot = Bo... |
#!/usr/bin/env python
##############################################################################
#
# compare_selected_with_pairwise - read mods file and VHT from
# tap_frankwolfe_mpi stderr individual, selected
# (assumed interacting) pairwise, and all pairwise
# ... |
# Copyright (c) 2014-2020 The btcsuite developers
# Copyright (c) 2019-2020 The atomicswap-qt developers
#
# 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 wit... |
import copy
import falcon
import json
import os
import shutil
import subprocess
import sys
import traceback
from datetime import datetime, timedelta
from sqlalchemy import func, desc
from sqlalchemy.exc import SQLAlchemyError
import model
import endpoint
import util
from db import engine, session
from util import User... |
import os
import numpy as np
import torch
from torch.utils.data import Dataset
from utils.laserscan import LaserScan
EXTENSIONS_SCAN = ['.bin']
EXTENSIONS_LABEL = ['.npy']
def is_scan(filename):
return any(filename.endswith(ext) for ext in EXTENSIONS_SCAN)
def is_label(filename):
return any(filename.endswith(e... |
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
def generate_data_ajive_fig2(seed=None, all_components=False):
"""
Samples the data from AJIVE figure 2. Note here we use rows as observations
i.e. data matrices are n x d where n = # observations.
Parameter... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : <NAME>
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import os
import glob
from ipywidgets import (Text, Label, HBox, VBox, Layo... |
"""
Fullscreen multicolor image abstraction.
Assumptions:
- Input image 160x200 or 320x200 pixels. In case od 320 px width images,
it will be resized to 160x200 internally.
- Maximum 3 colors per char may be used, with one constant color
(background) available across all of the chars
"""
from c64im... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 2 20:56:50 2020
@author: danish
"""
import cv2
import ModelWrapper as mp
from keras.models import load_model
from preprocessing import Fit_Preprocessing, GlobalNormalization, ToJson
from preprocessing import ReadFileNames
import numpy as np
def WriteInfo(err, text, no... |
from io import StringIO
from pathlib import Path
from typing import Iterable, NamedTuple, TextIO
import click
from fasta_reader import FASTAItem, FASTAWriter, read_fasta
from hmmer import HMMER
from hmmer_reader import num_models, open_hmmer
from imm import Alphabet
from nmm import IUPACAminoAlphabet
from tqdm import ... |
import logging
import statistics
import time
from dataclasses import dataclass, field
from random import random
from typing import Optional, List, Dict, Set
import yaml
from dataclasses_json import dataclass_json #
from email_validator import validate_email, EmailNotValidError
from tinydb import Query
from ndw_chat.... |
# coding=utf-8
# Copyright 2018 The Mesh TensorFlow 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... |
from prov.model import ProvDocument, PROV
import logging
import datetime
# HuBMAP commons
from hubmap_commons import globus_groups
# Set logging fromat and level (default is warning)
# All the API logging is forwarded to the uWSGI server and gets written into the log file `uwsgo-entity-api.log`
# Log rotation is hand... |
"""View takes in a csv from client with full name, company and domain
This will put their full name and domain into ten different variations to
see if an email exists. Slow but mimicks human behavior. Each check utilizes
a proxy to reduce risk of limit on RealEmail API. Proxy Scraper scrapes 100 fresh
IP addresses an... |
import contextlib
import copy
import datetime
import io
import json
import logging
import os
import numpy as np
import pycocotools.mask as mask_util
from PIL import Image
from fvcore.common.file_io import PathManager
from fvcore.common.file_io import file_lock
from fvcore.common.timer import Timer
from tkdet.structur... |
"""
This modules implements the bulk of Bot Evolution.
"""
import numpy as np
import copy
import settings
from utility import seq_is_equal, distance_between, angle_is_between, find_angle
from neural_network import NNetwork, sigmoid, softmax
class Population:
"""
The environment of bots and food.
"""
... |
import os
from typing import Callable
from copy import deepcopy
from household_contact_tracing.infection import Infection
from household_contact_tracing.intervention import Intervention
from household_contact_tracing.branching_process_model import BranchingProcessModel
from household_contact_tracing.branching_process_... |
import os
from django.shortcuts import render, redirect
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from .models import SubmissionJudul, Bimbingan
from akun.models import AkunSiswa
from master.models import PembimbingSiswa
from letter.mo... |
#----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
from flask import Flask, render_template, request, jsonify, redirect, url_for
from flask_cors import CORS
import logging
from logging import Formatter,... |
from __future__ import print_function, absolute_import
from operator import add, mul
import numpy as np
try:
import bogota.datapool
from bogota.utils import action_profiles
except:
'Bogota import failed...'
class GameData(object):
def __init__(self, filename=None, normalize=1.):
# data = { (s... |
# -*- coding: utf-8 -*-
import numpy as np
import copy
from pyorderedfuzzy.ofnumbers import ofnumber
from pyorderedfuzzy.ofnumbers.ofnumber import OFNumber
import matplotlib.pyplot as plt
__author__ = "amarszalek"
# ctype::
# linear, gauss, empirical
# data::
# 'price': bid price
# 'volume':
# 'spread': ask - bid
... |
import functools
import hashlib
import hmac
import subprocess
from base64 import b64encode
from io import BytesIO
from typing import List, Any
import qrcode
from flask import abort
from flask import request
from flask import session
from flask_login import current_user
from flask_socketio import disconnect
from ldap3 ... |
# contig.py
# Generate statistics for one contig
# Part of Tapestry
# https://github.com/johnomics/tapestry
# MIT License
#
# Copyright (c) 2019 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# i... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Editor Switcher manager.
"""
# Standard library imports
import os.path as osp
# Third party imports
from qtpy.QtGui import QIcon
# Local imports
from spyder.co... |
import mpl_finance as mpf # 替换 import matplotlib.finance as mpf
import numpy as np
import matplotlib.pyplot as plt
class DefTypesPool():
def __init__(self):
self.routes = {}
def route_types(self, types_str):
def decorator(f):
self.routes[types_str] = f
return f
... |
import datetime
import random
import sys
import bz2
import time
import traceback
import itertools
from functools import partial
from pathlib import Path, PurePosixPath
from typing import Iterable, Union, Optional, Tuple, Callable, Literal, List
from urllib.parse import unquote, urlparse
from dateutil.relativedelta impo... |
import numpy as np
import pandas as pd
import pytest
import scipy.stats
from pyextremes.models import Emcee, get_model
@pytest.fixture(scope="function")
def extremes() -> pd.Series:
np.random.seed(0)
return pd.Series(
index=pd.date_range(start="2000-01-01", periods=1000, freq="1H"),
data=scip... |
import errno
import logging
import re
import shutil
from contextlib import contextmanager
from tempfile import mkdtemp
import ob2.util.github_api as github_api
from ob2.dockergrader.job import JobFailedError
@contextmanager
def get_working_directory():
"""
Creates a temporary directory and deletes it when fi... |
import numpy
from copy import deepcopy
from handwriting_features.data.utils.math import derivation
from handwriting_features.data.utils.dsp import LowPassFilter, GaussianFilter
from handwriting_features.features.implementation.conventional.spatial import stroke_length
from handwriting_features.features.implementation.c... |
# Keras implementation of the paper:
# 3D MRI Brain Tumor Segmentation Using Autoencoder Regularization
# by <NAME>. (https://arxiv.org/pdf/1810.11654.pdf)
# Author of this code: <NAME> (https://github.com/IAmSUyogJadhav)
from blocks import *
from utils import *
import torch
import torch.nn as nn
from collections impo... |
#!/usr/bin/python
##
# Copyright 2019 Touchlab
#
# Copyright 2010-2017 JetBrains s.r.o.
#
# 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
#
# Unl... |
from django.contrib.auth.models import Permission
from django.db import connections
from django.shortcuts import render
from django.db import transaction
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.decorators import permission_classes, api_view
from rest_fra... |
import os
from distutils import spawn
import re
import subprocess
import time
import unittest
import itertools
import asyncio
import sys
import vanir.tests
import vanir
@unittest.skipUnless(
spawn.find_executable('xprop') and
spawn.find_executable('xdotool') and
spawn.find_executable... |
"""
CLI command for "deploy" command
"""
import logging
import click
from samcli.cli.cli_config_file import TomlProvider, configuration_option
from samcli.cli.main import aws_creds_options, common_options, pass_context, print_cmdline_args
from samcli.commands._utils.options import (
capabilities_option,
guide... |
import base64
from dash import html
import io
import json
from typing import Tuple, List
import pandas as pd
import shap
from dice_ml import Model, Dice, Data
from matplotlib import pyplot as plt
from sklearn.ensemble import RandomForestClassifier
from sklearn.manifold import TSNE
from sklearn.model_selection import tr... |
#%%
# %load_ext autoreload
# %autoreload 2
import os, sys
sys.path.append('tools')
from get_iEEG_data import get_iEEG_data
from plot_iEEG_data import plot_iEEG_data
from line_length import line_length
from get_iEEG_duration import get_iEEG_duration
from pull_sz_starts import pull_sz_starts
from pull_sz_ends import pu... |
from __future__ import print_function
import os
import textwrap
import xml.etree.ElementTree as ET
def join_all_element_text(el, sep=""):
bits = []
for txt in el.itertext():
bits.append(txt)
return sep.join(bits)
def remove_empty_header_or_footer_lines(lines):
while lines and not lines[0].str... |
from kubernetes import client, config, watch
import logging
RESTART_POLICY = "Never"
class AccessModes(object):
READ_WRITE_MANY = "ReadWriteMany"
READ_WRITE_ONCE = "ReadWriteOnce"
READ_ONLY_MANY = "ReadOnlyMany"
class JobConditionType(object):
COMPLETE = "Complete"
FAILED = "Failed"
class Eve... |
import copy
import datetime
import json
import os
import time
import google.oauth2.id_token
from flask import Flask, abort, make_response, render_template, request, session
from google.auth.transport import requests
from google.cloud import datastore, secretmanager, storage
from cron.photos import crawl_photos, hash_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.