text stringlengths 3.07k 22.1k |
|---|
"""
Quantilization functions and related stuff
"""
from pandas.core.api import DataFrame, Series
from pandas.core.categorical import Categorical
from pandas.core.index import _ensure_index
import pandas.core.algorithms as algos
import pandas.core.common as com
import pandas.core.nanops as nanops
import numpy as np
... |
import os
import logging
import tempfile
from datetime import datetime
import json
import traceback
import time
from rafiki.config import LOGS_FOLDER_PATH
logger = logging.getLogger(__name__)
JOB_LOGGER_DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S'
def configure_logging(process_name):
# Configure all logging to a log f... |
import os
import redis
from flask import Flask, flash, request, redirect
from flask import send_from_directory, render_template, session
from flask_autoindex import AutoIndex
from werkzeug.utils import secure_filename
from random import randint
from PIL import Image
from hondabox import RES_LIST, auto_scale, solid_colo... |
from pprint import pprint
import numpy as np
import cv2
import os
import matplotlib.pyplot as plt
from keras.models import Model
from keras.layers import BatchNormalization, LeakyReLU, Conv2D
from keras.layers import Conv2DTranspose, Input, Concatenate
from keras.applications import MobileNetV2
import keras.backend as ... |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import dace
from dace.config import set_temporary
from dace.library import change_default
from dace.memlet import Memlet
from dace.codegen.exceptions import CompilerConfigurationError, CompilationError
import dace.libraries.blas as blas
import ... |
#!/usr/bin/python
#
# Copyright (c) 2018 <NAME> <<EMAIL>>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: azure_rm_rediscache_info
version_added: "0.1.... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2016 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, pub... |
import distutils
from abc import abstractmethod, ABC
import bisect
from copy import copy
from functools import lru_cache
from typing import Generic, List, Optional, Dict, Any, NamedTuple, Union, Set, Tuple, TypeVar
from ciphey.iface import (
T,
Cracker,
Config,
Searcher,
ParamSpec,
CrackInfo,
... |
"""
Este arquivo define a classe "Markov", que representa um modelo de Markov genérico.
"""
import numpy as np
from random import seed, random
import json
from time import strftime
import os
from pprint import pprint
overridenProbabilityP = 0.55
overridenProbabilityQ = 1 - overridenProbabilityP
class MarkovGraph:
... |
from numpy import diag, arange, ones, sqrt, dot, ravel
from scipy import rand
from pyamg.util.linalg import norm
from scipy.sparse import csr_matrix
from pyamg.gallery import poisson
from pyamg.multilevel import multilevel_solver, coarse_grid_solver
from numpy.testing import TestCase, assert_almost_equal, assert_equa... |
import glob
import json
import subprocess
import time
import pytest
import os
import contextlib
from os.path import join
from aiven.client.client import Error
from tests import AivenExampleTest, ServiceSpec
@contextlib.contextmanager
def chdir(path):
prev_cwd = os.getcwd()
os.chdir(path)
try:
y... |
import time
from binascii import hexlify, unhexlify
from copy import copy
from tempfile import TemporaryDirectory
import pytest
from ledger.compact_merkle_tree import CompactMerkleTree
from ledger.merkle_verifier import MerkleVerifier
from ledger.hash_stores.hash_store import HashStore
from ledger.tree_hasher import ... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
"""
Python module for computing thermocouple emf values from temperatures.
This module just contains the generic thermocouple class and helper
functions.
"""
__author__ = "<EMAIL>"
__copyright__ = "public domain"
import numpy as np
# scipy.optimize will be imported when needed.
optimize = None
def ensure_import_op... |
"""
Authors: <NAME>, <NAME>
Contact: <EMAIL>
Unit tests for the gbdxtools.Idaho class
"""
import os
from gbdxtools import Interface
from gbdxtools import IdahoImage
from gbdxtools.rda.graph import get_rda_graph
from gbdxtools.images.meta import DaskImage
from auth_mock import get_mock_gbdx_session
import vcr
import te... |
import os
import json
from typing import Union
import logging
from timeit import default_timer as timer
import random
import pandas as pd
from ipapi.database.base import DbInfo
import tqdm
import ipapi.database.base as dbb
import ipapi.database.db_factory as dbf
from ipapi.tools.common_functions import f... |
from __future__ import annotations
import argparse
import os
from typing import Any, Callable, Sequence
from click import secho
from pdm._types import Protocol
class ActionCallback(Protocol):
def __call__(
self,
parser: argparse.ArgumentParser,
namespace: argparse.Namespace,
val... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# pylint: disable=no-self-use
import os
import pprint
import pytest
skip_if_ci = pytest.mark.skipif(
os.environ.get('CI', "false") == "true", reason="Not running on CI"
)
def get_test_default_layers(dbsession, default_ogc_server):
from c2cgeoportal_commons.models.main import LayerWMTS, LayerWMS
default_... |
import re
from urllib.parse import unquote
import numpy as np
import pandas as pd
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView
from flaim.database.product_mappings import PRODUCT_STORES, REFERENCE_CATEGORIES_DICT, \
REFERENCE_SUBCATEGORIES_CODING_DICT
fro... |
import os
import time
import yaml
import torch
import torch.nn as nn
import torchvision.utils as vutils
from torch.optim.sgd import SGD
from tensorboardX import SummaryWriter
from torch.utils.data import DataLoader
from GANs import dc_G, dc_D
from optims import ACGD, BCGD, ICR
from train_utils import get_data, weigh... |
import random
import numpy as np
import matplotlib.pyplot as plt
class ImageCropper:
def __init__(self, img_rows, img_cols, target_rows, target_cols, pad):
self.image_rows = img_rows
self.image_cols = img_cols
self.target_rows = target_rows
self.target_cols = target_cols
... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
import time
from django.shortcuts import render
from django.views.generic.base import View
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
from .models import *
from courses.models import *
from pure_pagination import Paginator, EmptyPage, PageNotAnInteger
from utils.mymixin ... |
# MIT License
# Copyright (c) 2018-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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: <NAME> 2017
"""
import math
import numpy as np
from numpy.random import randn
import copy
import matplotlib.pyplot as plt
import BicycleUtils as bu
plt.rcParams['figure.figsize'] = (12, 7)
def rk4(y, x, dx, f):
"""computes 4th order Runge-Kutta for dy/d... |
import configparser
import datetime
import json
import os
import re
import shutil
import socket
import subprocess
import sys
import time
import uuid
import bech32
import eth_account
import eth_utils
import rlp
import yaml
from cprotobuf import Field, ProtoEntity
from dateutil.parser import isoparse
from eth_account.me... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gluon import *
import datetime, random,cStringIO
import os, glob
from gluon.contrib.appconfig import AppConfig
class varsForm(object):
vars={}
def _decodifica(self,v):
if v:
try:
r=v.to_unicode()
except:
... |
import xlrd
from pathlib import Path
from datetime import datetime
from .models import *
import pandas as pd
register = pd.read_excel(r'C:\Users\RegistroNacional\Documents\rnabases\rnapython\c.xlsx')
register.columns = [c.replace(' ', '_') for c in register.columns]
def Apellidos(str1,str2):
surname = " "
... |
# PyTorch StudioGAN: https://github.com/POSTECH-CVLab/PyTorch-StudioGAN
# The MIT License (MIT)
# See license file or visit https://github.com/POSTECH-CVLab/PyTorch-StudioGAN for details
# src/utils/ckpt.py
from os.path import join
import os
import glob
import torch
import numpy as np
import utils.log as log
try:
... |
#!/usr/bin/env python
# coding: utf-8
# <center>
# <h1><b>Homework 4</b></h1>
# <h1>PHYS 580 - Computational Physics</h1>
# <h2>Prof<NAME></h2>
# </br>
# <h3><b><NAME></b></h3>
# <h4>https://www.github.com/ethank5149</h4>
# <h4><EMAIL></h4>
# </br>
# </br>
# <h3><b>October 30, 2020</b></h3>
# </center>
# <hr>
# # Pro... |
"""Pycln path finding utility."""
import os
import sys
from distutils import sysconfig
from functools import lru_cache
from pathlib import Path
from typing import Generator, List, Optional, Pattern, Set
from pathspec import PathSpec
from .. import ISWIN
from . import regexu
from .report import Report
# Constants.
EX... |
from typing import Any, List
from pytorch_lightning import LightningModule
from torch import nn
from torch.optim.lr_scheduler import CosineAnnealingLR, ReduceLROnPlateau
from transformers import AdamW
from bin.transformers.huggingface_llrd import layerwise_learning_rate_decay
from bin.transformers.tfidf_mlp import TF... |
import ast
import operator as op
from collections import UserList
from .exceptions import *
__all__ = ("DraconicConfig", "OperatorMixin", "approx_len_of", "safe_dict", "safe_list", "safe_set")
# ===== config =====
DISALLOW_PREFIXES = ['_', 'func_']
DISALLOW_METHODS = ['format', 'format_map', 'mro']
class DraconicC... |
# Copyright 2012 OpenStack Foundation.
# 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 requ... |
# Copyright (c) 2021 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... |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
'''
'''
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import astropy.coordinates as coordinates
import astropy.units as units
if sys.version_info.major == 2:
fmap = map
elif sys.version_info.major == 3:
fmap = lambda x, *args: list(map(x, *args))
xrange = range
ON = "ON"
OFF = "... |
# from __future__ import print_function, unicode_literals, absolute_import, division
import os
from random import triangular
import shutil
from dl4mic.reporting import pdf_export
import time
import numpy as np
import csv
import pandas as pd
from .. import models
# ------- Variable specific to CARE -------
from csbd... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# Copyright (c) Megvii, Inc. and its affiliates.
"""do the evaluation work with single gpu
"""
import argparse
import os
import megengine as mge
import megengine.data as data
import megengine.data.transform as T
import megengine.functional as F
import numpy as np
from tqdm.auto import tqdm
from recognition.datasets ... |
"""
TODO:
* Fix all tests marked as @skip_postgres_test
If postgres then test next after the code below freezes:
bot.run()
# now connection has closed
bot.cache_reader_service.backend.connect()
# do some checks
"""
from copy import deepcopy
import itertools
import time
import logging
import six
impo... |
import os
from dataclasses import dataclass
import networkx as nx
import numpy as np
import pandas as pd
from numpy.linalg import norm
kg_per_amu = 1.66054e-27
atom_masses = {
"H": 1,
"C": 12,
"O": 16,
"Cl": 35
}
@dataclass
class Atom:
symbol: str
m: float
x: np.array
v: np.array
... |
import numpy as np
from phonopy.harmonic.displacement import (get_least_displacements,
directions_axis, get_displacement,
is_minus_displacement)
from phonopy.structure.cells import get_smallest_vectors
def direction_to_displacement(... |
"""
Build all the conda recipes in the given directory sequentially if they do not
already exist on the given binstar channel.
Building is done in order of dependencies (circular dependencies are not supported).
Once a build is complete, the distribution will be uploaded (provided BINSTAR_TOKEN is
defined), and the nex... |
#!/usr/bin/env python
"""
@package mi.dataset.parser.adcpt_m_log9
@file marine-integrations/mi/dataset/parser/adcpt_m_log9.py
@author <NAME>
@brief Parser for the adcpt_m_log9 dataset driver
This file contains code for the adcpt_m_log9 parser and code to produce data
particles. This parser is for recovered data only ... |
import asyncio
import logging
from typing import Dict, Optional, Tuple
from gear import Database
from .cloud.azure.instance_config import AzureSlimInstanceConfig
from .cloud.azure.resource_utils import azure_worker_properties_to_machine_type
from .cloud.gcp.instance_config import GCPSlimInstanceConfig
from .cloud.gcp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Plot csi of Linux 802.11n CSI Tool, observe csi quickly
Usage:
python3 csishow.py ../material/5300/dataset/sample_0x1_ap.dat -t 1
"""
import argparse
import csiread
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
import sc... |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 21 08:16:48 2018
@author: <NAME>
This need to be runned at the cli just when you want to generate a new trained model
Thanks for <NAME>, amazing library for Deep Forests, gcForest https://github.com/kingfengji/gcForest
"""
import numpy as np
import pickle
import os
impor... |
import os
import discord
from discord.ext import commands
from discord import utils
import json
import os.path
import time
import SimpleJSON
Path = "/DaeGal/Data/Guild/"
class Guild(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_member_join(s... |
#Trace parameters of a function
#@author zhuangshao
#@category Dex
#@keybinding
#@menupath
#@toolbar
from ghidra.app.util.importer import MessageLog
from ghidra.file.formats.android.dex.analyzer import DexHeaderFormatAnalyzer
from ghidra.file.formats.android.dex.analyzer import DexAnalysisState
from ghidra.file.for... |
import torch
import numpy as np
from model.lookup import lookup
def preprocess_match(match_result):
match_result = match_result[0]
kps0 = match_result["kps0"]
kps1 = match_result["kps1"]
matches = match_result["matches"]
if len(matches) == 0:
return None, None
kps0 = torch.stack([kp... |
import datetime
from typing import Any, Dict, List, Optional, Set
import ujson
from django.db import IntegrityError
from django.http import HttpRequest, HttpResponse
from django.utils.timezone import now as timezone_now
from django.utils.translation import ugettext as _
from zerver.decorator import REQ, has_request_v... |
# Copyright (C) 2020-21 <NAME>
#
# Distributed under terms of the MIT license.
import logging
import time
import urllib
from iotlab_controller import common, nodes
from iotlab_controller.experiment.base import BaseExperiment, ExperimentError
from iotlab_controller.riot import RIOTFirmware
from .file_handler import D... |
# -*- coding: utf-8 -*-
#
# Terracoin-Electrum - lightweight Terracoin client
# Copyright (C) 2019 Dash 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,
# inc... |
import argparse
import os
import shutil
import time
import warnings
import extension as ext
import torchvision.transforms as transforms
has_DALI = True
try:
from nvidia.dali.plugin.pytorch import DALIClassificationIterator
from nvidia.dali.pipeline import Pipeline
import nvidia.dali.ops as ops
import ... |
# VI_merge_functions_v3
# File for VI merging functions for both notebook and command-line use.
#
import os, sys, glob
import fnmatch
import re
from astropy.table import Table, join, vstack
import pandas as pd
def choose_best_z(vi):
#make new column with best redshift estimate for each VI - take VI redshift if avail... |
"""
MIT License
Copyright (c) 2019 Chodera lab // Memorial Sloan Kettering Cancer Center,
Weill Cornell Medical College, Nicea Research, and Authors
Authors:
<NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to de... |
import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test
dll = CDLL(_ctypes_test.__file__)
try:
CALLBACK_FUNCTYPE = WINFUNCTYPE
except NameError:
# fake to enable this test on Linux
CALLBACK_FUNCTYPE = CFUNCTYPE
class POINT(Structure):
_fields_ = [("x... |
# -*- coding: UTF-8 -*-
## Zap-History Browser by AliAbdul
from __future__ import print_function
from Components.ActionMap import ActionMap
from Components.config import config, ConfigInteger, ConfigSelection, \
ConfigYesNo, ConfigSet, ConfigSubsection, getConfigListEntry
from Components.ConfigList import ConfigListS... |
#!/usr/bin/env python3
from gi.repository import Gtk, Gdk, GdkPixbuf
from nwg_panel.tools import check_key, get_icon, update_image, load_autotiling
import nwg_panel.common
class SwayTaskbar(Gtk.Box):
def __init__(self, settings, i3, position, display_name="", icons_path=""):
self.position = position
... |
import paddle
import numpy as np
import os
import json
from concurrent import futures
import contextlib
import socket
import grpc
import logging
from core.proto import common_pb2_grpc, common_pb2
from .layer_handler import HostLayerHandler
from core import util
_LOGGER = logging.getLogger(__name__)
class FLExec... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 8 13:34:14 2021
@author: user
"""
import numpy as np
import faiss
import pandas as pd
import time
import psutil
from datetime import datetime
main_dir = 'Embeddings/newDatasets'
def fileread(filename, column, deliminator = '|',
Truthtable... |
# The purpose of this test is to check that we have implementation parity between
# a Python `torch.nn` module and its corresponding C++ `torch::nn` module. Concretely,
# this test does the following:
#
# 1. Get a test params dict from common_nn.py, run forward and backward on the
# Python module created using the test... |
import ast
import re
from datetime import datetime
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import wandb
color_list = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf']
def retrieve_values_from_name(fn... |
from random import shuffle
from time import time
from notify import send_email, html_response
import json
import variables
import numpy as np
# initialize the global variables
next_event = variables.NEXT_EVENT
def display_team(team):
'''
Writes the team onto a file or command line.
'''
composition ... |
from numpy.lib.function_base import median
from config.config import *
from enum import Enum
import msgpack
import time
from udacidrone import Drone
from udacidrone.connection import MavlinkConnection
from udacidrone.messaging import MsgID
from utils.frames import *
from utils.mapping import *
from utils.planning impor... |
"""GraphQL Base WebSocket instance"""
from abc import ABCMeta, abstractmethod
import asyncio
import json
import logging
from typing import (
Any,
AsyncIterator,
Callable,
Dict,
Iterable,
List,
Mapping,
MutableMapping,
Optional,
Set,
Tuple,
Union,
)
from bareasgi import ... |
"""TiTiler.PgSTAC custom Mosaic Backend and Custom STACReader."""
import json
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import attr
import morecantile
from cachetools import TTLCache, cached
from cachetools.keys import hashkey
from cogeo_mosaic.backends import BaseBackend
from cogeo_mosaic.erro... |
#!/usr/bin/env python
"""
ONS Address Index - Automatic Testing of Different Datasets
===========================================================
A simple wrapper to call all independent address linking datasets in serial.
Could be parallelised trivially, however, the linking code is memory hungry
so the node needs to... |
"""
Represent an exception with a lot of information.
Provides 2 useful functions:
format_exc: format an exception into a complete traceback, with full
debugging instruction.
format_outer_frames: format the current position in the stack call.
Adapted from IPython's VerboseTB.
"""
# Authors: <NAME> < gae... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# -*- coding: utf-8 -*-
#
# Collection of actions to the ardublocklyserver for relieved HTTP requests.
#
# Copyright (c) 2015 carlosperate https://github.com/carlosperate/
# Licensed under the Apache License, Version 2.0 (the "License"):
# http://www.apache.org/licenses/LICENSE-2.0
#
from __future__ import unicode_li... |
# Copyright 2017 the GPflow 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 writi... |
from __future__ import division
import time
import math
import random
from operator import itemgetter
from pandemic.simulation.model.actions import DriveFerry, DiscoverCure, ChooseCard, DirectFlight
from pandemic.simulation.model.enums import Virus
class SpMctsState:
def is_terminal(self) -> bool:
raise... |
# Copyright (c): <NAME> 2017-2019.
# Author: <NAME>
# Email: <EMAIL>
# Update Date: 2019/4/4 下午2:42
import time
import numpy as np
import torch
import tqdm
from .Environment import Env
from .Summary import Summarizer
from VSR.Util.Config import Config
def _ensemble_expand(feature):
r0 = feature
r1 = np.rot... |
"""
Dirac on a Graph API.
<NAME>
Ref:
- The Dirac operator of a graph, <NAME> (https://arxiv.org/abs/1306.2166)
"""
from collections import UserList
from itertools import groupby
import numpy as np
class Cliques(UserList):
def __init__(self, data=None, total_count=None):
if data is None:
dat... |
from flask import Blueprint
from flask import g
from flask import jsonify, request
from sqlalchemy import desc
from voluptuous import Coerce, Match, Length, Range, Optional
from voluptuous import Required, Any, All
from morio.core.auth import login_required, login_optional
from morio.core.error import (
ConflictEx... |
from math import log10, log, floor
from scipy import interpolate
import numpy as np
class TsPoint:
def __init__(self, x, y, slope):
self.x = x
self.y = y
self.slope = slope
lumLow = [ log10(0.0001), log10(0.02) ] # luminance
stopsLow = [ -16.0, -6.5 ] ... |
import os
import re
from cs50 import SQL
from flask import Flask, flash, redirect, render_template, request, session
from flask_session import Session
from tempfile import mkdtemp
from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError
from werkzeug.security import check_password_hash, ge... |
# Copyright (C) 2020 FireEye, 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: [package root]/LICENSE.txt
# Unless required by applicable law or agreed to in writing,... |
#!/usr/bin/env python
# encoding: utf-8
#
# This file is part of waf-tools.
#
# Copyright (c) 2020, 2021, 2022 <NAME> <<EMAIL>>
#
# 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 Softwar... |
# Adaptd from https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/ensemble/_stacking.py
from copy import deepcopy
from joblib import Parallel, delayed
from sklearn.base import ClassifierMixin, is_classifier, clone
from sklearn.ensemble._stacking import _BaseStacking
from sklearn.model_selection import check... |
# This is a demo program of a pianta that randomly respawns and after some number of clicks
# will explode and then respawn.
# It currently does not use tweened animations (todo) and does not play well with navmeshes (todo)
# The program simulates its own synchronous physics for the pinata. The colored squares from th... |
# -*- coding: utf-8 -*-
"""
Decider Worker
===============
The decider worker is focused on orchestrating which activity needs to be
executed and when based on the flow procided.
"""
from boto.swf.exceptions import SWFDomainAlreadyExistsError
from boto.swf.exceptions import SWFTypeAlreadyExistsError
import boto.swf.l... |
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
from __future__ import print_function
import numpy as np
import argparse
import torch
import torch.utils.data as data_utils
import torch.optim as optim
from torch.autograd import Variable
from dataloader import MnistBags_outlier_fair
from model import LSTM_based_infoLoss
import pdb
import matplotlib
matplotlib.use(... |
#!/usr/bin/env python3
import argparse
import subprocess
import os
import sys
import reprlib
import logging
def detect_file_format(args):
if args.read1.endswith('.gz') and args.read2.endswith('.gz'):
return args.read1, args.read2
if args.read1.endswith('.bz2') and args.read2.endswith('.bz2'):
logging.info('BZ2... |
from typing import List
from discord.ext import commands, menus
from .utils import checks, views
import discord
from discord import app_commands
import itertools
class TagList(menus.ListPageSource):
def __init__(self, data, *args, **kwargs):
super().__init__(data,*args, **kwargs)
def format_page(self,... |
#!/usr/bin/env python
"""run_connector.py
Jobs = AAtoGoC, PFtoGoC, GoCtoGoC, GoCtoGoCgap, GlotoGrC
Usage:
run_connector.py (-i PATH) (-o PATH) (-p PATH) [--parallel] (all | <jobs>...)
run_connector.py (-h | --help)
run_connector.py --version
Options:
-h --help Show this screen
--... |
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import math
import torch
from torch import nn
from collections import namedtuple
from .base import MIN_SCORE
from .attention import MultiHeadedAttention
def make_mask(lens: torch.Tensor):
masks = torch.ones(max(lens), lens.size(0), dtype=torch.uint8, device=lens.d... |
import json
import os
import random
import numpy as np
import pandas as pd
from config import DBGConfig
dbg_config = DBGConfig()
tscale = dbg_config.tscale
tgap = 1.0 / tscale
video_info_file = dbg_config.video_info_file
video_filter = dbg_config.video_filter
video_filter_file = dbg_config.video_filter_file
data_d... |
# Copyright (c) 2016 by <NAME> and the other collaborators on GitHub at
# https://github.com/rmjarvis/Piff All rights reserved.
#
# Piff is free software: Redistribution and use in source and binary forms
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistribut... |
#! /usr/bin/env python
"""Draw shapes and patterns from primative forms.
CLASSES
DrawingBase() Base class to define drawable shapes and pattern.
AngledGrid(DrawingBase) Grid of parallel lines angled to the vertical.
Rectangle(DrawingBase) Filled Rectangle
"""
import math
from typing import Tuple, List, Optional
... |
import requests
import openpyxl
from openpyxl.styles import Font
from openpyxl.styles import Alignment
from openpyxl.styles import NamedStyle
import time
def bjurls():
urls = [{"url":"https://www.yilaitong.net/?m=Android&c=Supplier&a=shopSupplier&sid=435","home":"2d09","sale":"苹果"},
{"url":"ht... |
# This file is part of Androguard.
#
# Copyright (c) 2012 <NAME> <<EMAIL>>
# 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/LICEN... |
"""Milestone based pricing"""
import pytest
from decimal import Decimal
from eth_utils import to_wei
from eth_tester.exceptions import TransactionFailed
from web3.contract import Contract
from ico.tests.utils import time_travel
from ico.state import CrowdsaleState
from ico.utils import decimalize_token_amount
@pyte... |
#!/usr/bin/env python3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2010 California Institute of Technology. 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... |
# -*- coding: utf-8 -*-
"""Feature bagging detector
"""
# Author: <NAME> <<EMAIL>>
# License: BSD 2 clause
from __future__ import division
from __future__ import print_function
import numpy as np
import numbers
from joblib import Parallel
from joblib.parallel import delayed
from sklearn.base import clone
from sklear... |
"""
SLP Graph Search Client
Performs a background search and batch download of graph
transactions from a Graph Search server. For more information about
a Graph Search server see:
* gs++: https://github.com/blockparty-sh/cpp_slp_graph_search
* bchd: https://github.com/simpleledgerinc/bchd/tree/graphsearch
This class... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.