text stringlengths 3.07k 22.1k |
|---|
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
import dask as da
from raptor.utils import BaseIndicator, _ema
class RSIIndicator(BaseIndicator):
def __init__(self, close: da.Series, window: int = 14, fillna: bool = False):
self._close = close
self._window = window
self._fillna = fillna
self._run()
def _run(self):
... |
"""mobile_modem_exporter v0.2.0-dev module.
Source code available at https://github.com/tykling/mobile_modem_exporter/
Can be installed from PyPi https://pypi.org/project/mobile_modem_exporter/
Read more at https://mobile-modem-exporter.readthedocs.io/en/latest/
"""
import argparse
import logging
import time
import ty... |
"""
Testing tool utilities.
"""
#################################################################################
# MIT License
#
# Copyright (c) 2018, <NAME>, Universitat Oberta de Catalunya (UOC),
# Universidad de la Republica Oriental del Uruguay (UdelaR).
#
# Permission is hereby granted, free of charge, to any per... |
"""
NOTE: this is only used for testing the cython / c implementation.
"""
# Third-party
import astropy.units as u
import numpy as np
from twobody.wrap import cy_rv_from_elements
from astroML.utils import log_multivariate_gaussian
# from scipy.stats import multivariate_normal
# Project
from ...samples import JokerSam... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# author: chinshin
# datetime: 2020/4/20 15:49
import os
from torch.utils.data import DataLoader
from argparse import ArgumentParser, Namespace
from bert.utils.logger_utils import create_logger
from bert.utils.data_utils import get_pubchem_zinc_path, get_availabl... |
# Copyright 2021 <NAME>
# See LICENSE file for licensing details.
#
# Learn more about testing at: https://juju.is/docs/sdk/testing
"""Collection of tests related to src/resource.py"""
import unittest
from resource import (
ClusterRole,
ClusterRoleBinding,
ConfigMap,
DaemonSet,
Deployment,
Miss... |
from __future__ import absolute_import, division
from toolz import memoize
import numpy as np
from .core import Expr
from .utils import ngjit, isreal
class Glyph(Expr):
"""Base class for glyphs."""
pass
class _PointLike(Glyph):
"""Shared methods between Point and Line"""
def __init__(self, x, y):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import Tuple
import jax.numpy as jnp
import numpy as np
import numpyro
import numpyro.distributions as dist
from astropy.io import fits
from jax import random
from jax.config import config as jax_config
from numpyro.distributions.transforms import AffineTransf... |
import bpy
from . import list_helper, collapsible, base
from .. import registry
from ..utils import is_helper_object
from ..details import ui as det_ui
from ..version_utils import assign_props, IS_28
items = (
('copy', '', '', 'COPYDOWN', 0),
('paste', '', '', 'PASTEDOWN', 1),
('clear', '', '', 'X', 2)
)... |
# --------------------------------------------------------
# Copyright (C) 2020 NVIDIA Corporation. All rights reserved.
# Nvidia Source Code License-NC
# Code written by <NAME> and <NAME>
# --------------------------------------------------------
import torch
import os
from torch import distributed, nn
from collectio... |
import os
import json
import re
import datetime
import requests
import hashlib
import random
import bisect
import requests
from amadeus import Client, Location, ResponseError, NotFoundError, ServerError
import googlemaps
from datetime import datetime, timedelta
from flask import request, Response, jsonify
from flas... |
import mdp.utils as utils
from mdp.lmdps import *
import numpy as np
class TestMDPEmbeddeding():
def __init__(self):
self.simple_test()
self.random_test()
@staticmethod
def simple_test():
"""
Explore how the unconstrained dynamics in a simple setting.
"""
#... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
The Phantom class is instantiated with a ground-truth phantom and corresponding material properties data. The get_projections method simulates data acquisition and returns radiographs for the specified theta values.
"""
import sys
import os
import numpy as np
impo... |
# -*- coding: utf-8 -*-
import os
# BigQuery
from google.cloud import bigquery
from google.oauth2 import service_account
# Data Science and Networks
import pandas as pd
import networkx as nx
import matplotlib
matplotlib.use('Agg') # Important because no GUI in vagrant or server
import matplotlib.pyplot as plt
import c... |
from abc import ABCMeta, abstractmethod
from collections.abc import Mapping
import re
import click
from ghutil.api.endpoint import GHEndpoint
from ghutil.showing import show_fields
from ghutil.util import cacheable
class Resource(GHEndpoint, metaclass=ABCMeta):
"""
An... |
from typing import Dict, List, Tuple, Union
from parsimonious.nodes import NodeVisitor
from py_models_parser.parsers.pydal import process_pydal_table_definition
from py_models_parser.types import (
orm_triggers,
ormar_and_piccollo_types,
pony_orm_fields,
)
class Visitor(NodeVisitor):
def visit_class... |
import logging
import os
import random
from typing import List, Tuple
import attr
import numpy as np
import pandas as pd
from flair.data import Sentence
from sklearn.datasets import dump_svmlight_file
from torch.utils.data import Dataset
from gleipnir.corpora import *
from gleipnir.data import CandidateGenerator
f... |
# -*- coding: utf-8 -*-
# Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
# -*- coding: utf8 -*-
__date__ = "13 March 2018"
__version__ = "1.1"
__license__ = "MIT"
__status__ = "Beta"
__author__ = "<NAME>"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__credits__ = []
__all__ = []
__copyright__ = """Copyright 2018 <NAME>
Permission is hereby granted, free... |
# 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... |
from flask import Blueprint, request
from flask import render_template, abort, redirect, url_for, flash
from flask_login import current_user, login_required
from portality.core import app
from portality import models
from portality.bll import DOAJ
from portality.bll.exceptions import AuthoriseException, ArticleMergeCo... |
from __future__ import absolute_import, unicode_literals
from functools import wraps
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.shortcuts import get_object_or_404, redirect as _redirect
from django.views.generic import ListView, DetailView, TemplateView
from django.contrib im... |
#%%
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np # numpy for arrays
from tqdm import tqdm
import SpecCAF.Solver as Solver
import SpecCAF.spherical as spherical
from matplotlib import pyplot as plt
from scipy.interpolate import interp1d,interp2d
from scipy.signal import find_peaks
from scipy.ndimag... |
#!/usr/bin/env python3
# encoding=utf8
"""
Fetch image metadata and download thumbnails.
"""
import csv
import errno
import os
import requests
from time import sleep
import urllib.parse
DESCRIPTIONS_CSV = 'neighborhood_centroids.csv'
OUTPUT_FILE = 'neighborhood_centroids_descriptions.csv'
STATUS_FILE = 'image_status... |
import numpy as np
from .testutil import datadir
from brainstat.stats.terms import Term
from brainstat.stats.SLM import SLM
import pickle
def dummy_test(infile, expfile, simple=True):
ifile = open(infile, "br")
Din = pickle.load(ifile)
ifile.close()
Y = Din["Y"]
M = Din["M"]
# assign slm pa... |
#!/usr/bin/env python3
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
import torchvision.datasets as dset
from datasets import CIFAR100
import torchvision.transforms as transforms
from torchvision.utils import save_i... |
#!/usr/bin/env python
# coding=utf-8
import grpc
from datetime import datetime, timezone
import sys, netns, time
import logging
import socket
import os, re
import signal
import traceback
import json
import requests, urllib3, pynetbox
import sdk_service_pb2
import sdk_service_pb2_grpc
import config_service_pb2
from ... |
import numpy as np
# import plotly.plotly as py
# import plotly.graph_objs as go
# import glob
from numpy.linalg import eig, inv
# from sklearn.decomposition import PCA
# import mdtraj as md
# from scipy.spatial import ConvexHull
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
# import pandas as... |
"""Actions for linking object code produced by compilation"""
load(":private/pkg_id.bzl", "pkg_id")
load(":private/set.bzl", "set")
load(":private/path_utils.bzl", "get_lib_name")
load("@bazel_skylib//lib:paths.bzl", "paths")
load(":private/packages.bzl", "expose_packages")
def _backup_path(target):
"""Return a p... |
#############################################################################
# NOTICE #
# #
# This software (or technical data) was produced for the U.S. Government #
# under ... |
# -*- coding: utf-8 -*-
__version__ = "0.1.0"
import sys, ntpath, glob
from scipy import spatial, linalg
import numpy as np
import pandas as pd
import datetime as dt
# =========================================================
class mbdata:
def __init__(self, xyzDir, xyzFmt, rastDir, rastFmt, flowAz):
... |
# -*- coding: utf-8 -*-
import logging
import shutil
from contextlib import contextmanager
from io import StringIO
from pathlib import Path
from subprocess import Popen, PIPE, TimeoutExpired
from tempfile import gettempdir
from threading import Thread
from time import perf_counter, time, sleep
from typing import Call... |
import functools
import math
import os
import random
import time
import json
import sys
import inspect
import shutil
import torch
import infirunner.steppers
import infirunner.param
import numpy as np
from contextlib import contextmanager
from torch.utils.tensorboard import SummaryWriter
from infirunner.util import ... |
#!/usr/bin/env python3
import gatt
import struct
import math
from enum import Enum
from threading import Timer
class PolarDevice(gatt.Device):
"""
PolarDevice is a sub-class of gatt.Device() that handles
the connection to a Polar OH1 device.
"""
CP_CHAR_UUID = "fb005c81-02e7-f387-1cad-8acd2d8df0c8... |
# Copyright (c) 2009 <NAME> <<EMAIL>>
# See the COPYRIGHT file for more information
from __future__ import division, absolute_import
import time
import re
import os
import getopt
import hashlib
from OpenSSL import SSL
from twisted.web import client
from twisted.internet import reactor, ssl
from twisted.python import... |
# encoding=utf8
# 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
# Un... |
"""
Extract beats from mitdb dataset with size = 2 * window_size
and compute temporal features from each beat
Author: <NAME>
VARPA
University of A Coruna
April 2017
"""
import numpy as np
import matplotlib.pyplot as plt
import os
import csv
import pickle
import numpy as np
import matplotlib.pyplot as plt
import os.p... |
import asyncio
import json
import logging
import os
from tempfile import NamedTemporaryFile, TemporaryDirectory
from typing import NamedTuple, Optional, Tuple, Dict
from .supervisor import get_supervisor
_unit_file = """[Unit]
Description=JOB one-shot service
[Service]
Type=exec
WorkingDirectory={wd}
StandardOutput=... |
import tensorflow as tf
# import tensorflow_probability as tfp
import numpy as np
# from research2018 import layers
import tf_contextual_prediction_with_expert_advice as cpea
from research2018 import data
class DataNormalizer(object):
def __init__(self, x):
self._abs_min = np.abs(x).min(axis=0, keepdims=... |
import json
import math
import pathlib
import os
from datetime import date, timedelta
from configparser import ConfigParser
from decimal import Decimal
from pprint import pprint
from binance.client import Client
from forex_python.converter import CurrencyCodes, CurrencyRates
from decouple import config
import telegra... |
import requests
from utils import dictmapper, MappingRule as to
import cleanup
import config
BASE_HEADERS = {'Accept': 'application/json'}
MetricsBase = dictmapper('MetricsBase',
{'citations': to(['citations'],
cleanup._parse_numbers_to_int),
... |
from shutil import copytree, copy2, rmtree
from os import walk, path, remove, system, makedirs
from filecmp import clear_cache, cmp
from re import search
from tkinter import Tk, ttk, Label
from pathlib import Path
from datetime import datetime
from time import sleep
# Shows Game, Folder, and File drill-down p... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... |
#!/usr/bin/python3
import meraki
#import copy
import asyncio
import os
from time import *
from meraki import aio
import tqdm.asyncio
#import time
import get_keys as g
import datetime
#import random
#import click
#from deepdiff import DeepDiff
#import inspect
log_dir = os.path.join(os.getcwd(), "Logs/")
if not os... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------#
"""
Author: <NAME>
Created Time: 10:58, Jan. 28, 2015
FEL experiment panel for Dalian Coherent Light Source.
This is the main GUI frame.
"""
#------------------------------------------------------... |
from distutils.version import LooseVersion
import pytest
import numpy as np
import astropy
from astropy.io import fits
from astropy import table
from astropy import wcs as fitswcs
from astropy.utils.data import get_pkg_data_filename
from astropy.modeling import polynomial
from astropy.modeling.models import (
Shif... |
#!/usr/bin/env python3
import os, sys, random
from os.path import dirname, realpath, exists
from pkg_resources import resource_string, resource_listdir, resource_exists
import argparse, textwrap
try:
import re2 as re
except:
import re
# (oneline, multiline, bottom, top, linkl, linkr)
# {one,multi}line := (left, rig... |
import os
import subprocess
import fileinput
import sys
from random import shuffle
import math
# randX = random.uniform(scene_min_x + d, scene_max_x - d)
# randY = random.uniform(scene_min_y + d, scene_max_y - d)
# randZ = random.uniform(scene_min_z + d, scene_max_z - d)
xml_file = "ajax.xml"
def run_nori_and_change... |
import os
import re
import shutil
import abc
import MyUtilities.common
data_files_zip = []
absPath = re.sub("([^\\\\])[\\\\]([^\\\\])", r"\1/\2", os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
class Utilities(MyUtilities.common.EnsureFunctions):
pass
class Exe_Base(Utilities, metaclass = abc.ABCMeta... |
from collections import defaultdict
from dataclasses import MISSING, Field, fields
from typing import Dict, Tuple, Type, Union, Callable, Optional, Any
from .abstractions import W, AbstractLoader, AbstractDumper, AbstractParser
from .bases import M, AbstractMeta
from .models import JSONField, JSON, Extras, _PatternedD... |
#!/usr/bin/env python
"""
Extracts faces from images and recognize the persons inside each image
and returns the images the bounding boxes and the recognized faces
"""
# MIT License
#
# Copyright (c) 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and ass... |
from physDBD import ConvertMomentsToNMomentsLayer, DeathRxnLayer, \
BirthRxnLayer, EatRxnLayer, ConvertNMomentsTEtoMomentsTE
# Depreciation warnings
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
import copy
import os
import shutil
import numpy as np
import tensorflow as tf
cla... |
# MIT License
#
# Copyright (c) 2019 <NAME> (haftungsbeschränkt)
# ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
try:
import Tkinter as tk
from Tkinter import messagebox
except ImportError:
import tkinter as tk
from tkinter import messagebox
try:
import ttk
py3 = False
except ImportError:
import tkinter.ttk as ttk
py3 = ... |
'''
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SALT RSS Image Convolution
This program convolves 2 SALT RSS spectra images to the lowest resolution
of the two.
The files required are:
(1) The 2D spectrum FITS file of the first source.
(2) The 2D ARC FITS file of the first source.
(3) The... |
#
# MIT License
#
# (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
#
# 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... |
import copy
import os
import tempfile
import time
import numpy as np
from ray.rllib.agents.pg import PGTrainer, PGTorchPolicy
from ray.tune.logger import UnifiedLogger
from ray.tune.result import DEFAULT_RESULTS_DIR
from marltoolbox.examples.rllib_api.pg_ipd import get_rllib_config
from marltoolbox.envs.matrix_sequen... |
"""Initial database
Revision ID: 7c3929047190
Revises:
Create Date: 2021-03-13 13:22:38.768112
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7c3929047190'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto ge... |
# Common definitions for GAN metrics: provides iterators over the datasets,
# file caching, progress reports and printing.
import os
import time
import hashlib
import numpy as np
import tensorflow as tf
import dnnlib
import dnnlib.tflib as tflib
from training import misc
from training import dataset
# Base class for... |
import argparse
import cv2
import numpy as np
import torch
from time import *
from models.with_mobilenet import PoseEstimationWithMobileNet
from modules.keypoints import extract_keypoints, group_keypoints
from modules.load_state import load_state
from modules.pose import Pose, track_poses
from val import normalize, pa... |
#!/usr/bin python3
# Imports
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Python:
from datetime import datetime
import logging
from io import BytesIO
# 3rd party:
from pandas import DataFrame
from sqlalchemy import text
from matplotlib.pyplot import subplots, close
fro... |
# -*- Python -*-
"""Build macro that compiles a TensorFlow graph into a cc_library.
To use from your BUILD file, add the following line to load the macro:
load("//tensorflow/compiler/aot:tfcompile.bzl", "tf_library")
Then call the macro like this:
tf_library(
name = "test_graph_tfmatmul",
config = "test_gr... |
#!/usr/bin/env python
"""
Experimental script to provide an alternative method of manually updating draft services, for example if a user
has accessibility issues that prevent them using the site, they could submit their answers to us via CSV.
- Look up draft service ID by service name
- Map question numbers to conten... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <<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 ... |
#!/usr/bin/env python3
"""A python script to perform watermark embedding/detection
on the basis of singular value decomposition (SVD) and cepstrum method."""
# Copyright (C) 2020 by <NAME>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License... |
from __future__ import absolute_import, division, print_function
import re
import traceback
import warnings
from datetime import datetime
from functools import partial
import numpy as np
import pandas as pd
from ..core import indexing
from ..core.formatting import first_n_items, format_timestamp, last_item
from ..co... |
from protgraph.unexpected_exception import UnexpectedException
def execute_mutagen(graph, mutagen_feature):
"""
This function adds vertices and edges depending on the feature mutagen.
Effectively, the mutagen information get executed. This method can skip
feature mutagens which may reference ONLY isof... |
"""
Laplacian matrix of graphs.
"""
# Copyright (C) 2004-2013 by
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils import require, not_implemented_for
__author__ = "\n".join(['<NAME> <<EMAIL>>',
... |
#
# The SELDnet architecture
#
import logging
from keras.layers import Bidirectional, Conv2D, MaxPooling2D, Conv1D, Concatenate
from keras.layers import GRU
from keras.layers.core import Dense, Dropout, Reshape, Permute
from keras.layers.normalization import BatchNormalization
from keras.layers.wrappers import TimeDis... |
#-------------------------------------------------------------------------------
# Instituto Tecnologico de Costa Rica-Area Academica Ingenieria en Computadores
# Introduccion al Reconocimiento de Patrones - Tarea Corta 2 - Containers Jobs
# Estudiante-carnet: <NAME> - 2013030976
# Based on code from - Basado en codigo... |
# Lint as: python3
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
from flask import Flask, render_template, request, url_for, redirect, session
from mmxai.interpretability.classification.lime import lime_mmf
from shap4mmf import shap_mmf
from mmxai.interpretability.classification.torchray.extremal_perturbation import torchray_mmf
from mmxai.text_removal.smart_text_removal import Smar... |
from __future__ import annotations
import asyncio
import logging
import shutil
from typing import Optional, List, Union, TYPE_CHECKING, Set, Dict
import tweepy
from gif_pipeline.database import Database
from gif_pipeline.chat import Chat, Channel
from gif_pipeline.helpers.helpers import Helper, find_video_for_message... |
# Copyright 2017-2022 RStudio, PBC
#
# 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... |
# 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 to in... |
"""
Main class of Robocop module. Gathers files to be scanned, checkers, parses CLI arguments and scans files.
"""
import inspect
import os
import sys
from collections import Counter
from robot.api import get_resource_model
from robot.errors import DataError
import robocop.exceptions
from robocop import checkers, rep... |
import requests
from datetime import datetime
from bs4 import BeautifulSoup
from Competition import Competition
from Racer import Racer
class ResultsFinder:
def __init__(self, competitions_links_list, racer_list):
self.competitions_links_list = competitions_links_list
self.racer_list = racer_list... |
import random
import msgpack
import logging
import traceback
import time
import math
from os.path import isfile
CHAT_ALPHABET = "abcdefghijklmnopqrstuvwxyz0123456789-_.,?!@:;=+-'\"()[]{}#/\\ "
log = 0
def alphafilter(c):
return c.lower() in CHAT_ALPHABET
def weighted_random(l):
if not isinstance(l, list):... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# The source code in this module was created by <NAME>
# from University Clermont Auvergne, CNRS, SIGMA Clermont, Institu... |
import asyncio
import concurrent.futures
import io
import os
import platform
import re
import socket
import subprocess
from typing import Union
import aiohttp
import discord
import mcstatus
from bs4 import BeautifulSoup
from discord import Embed
from discord.ext import commands
import lib.hypixel
from ansura import A... |
"""
Testing for Theil-Sen module (sklearn.linear_model.theil_sen)
"""
# Author: <NAME> <<EMAIL>>
# License: BSD 3 clause
import os
import sys
from contextlib import contextmanager
import numpy as np
import pytest
from numpy.testing import assert_array_equal, assert_array_less
from numpy.testing import assert_array_alm... |
#!/usr/bin/env python
from random import Random
import pytest
import networkx as nx
from networkx import convert_node_labels_to_integers as cnlti
class TestDistance:
def setup_method(self):
G = cnlti(nx.grid_2d_graph(4, 4), first_label=1, ordering="sorted")
self.G = G
def test_eccentricity... |
# 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, ... |
# Copyright 2020 NTRLab
#
# 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, softw... |
import base64
import contextlib
import os
from .analysis import get_names
from .emitter import Emitter, FileWriter
from .consts import (
INDENT, MAX_HIGHLIGHT_RANGE,
POSITION_ENCODING, PROTOCOL_VERSION,
)
class DefinitionMeta:
"""
A bag of properties around a single source definition.
This contai... |
# pylint: disable=no-encoding-in-file,resource-leakage
'''
This is a shim that handles checking and updating salt thin and
then invoking thin.
This is not intended to be instantiated as a module, rather it is a
helper script used by salt.client.ssh.Single. It is here, in a
separate file, for convenience of developmen... |
import logging
from os.path import exists
import cv2
import numpy as np
from pdf2image import convert_from_path
def collect_contours(image):
""" Sub function used by scrapper.\n
@param image: an opencv image\n
@return returns an ordered list of contours found in the image.\n
This function was heavily... |
from __future__ import absolute_import
import os
import logging
import ast
import datetime
import time
from web3 import HTTPProvider, Web3
from sqlalchemy_utils import database_exists, create_database
from sqlalchemy import exc
from celery import Task
from celery.schedules import timedelta, crontab
import redis
from ... |
"""Editor related to `Shapes`.
As you can easily assumes, `editor` is a high-level api, so
* This sub-module can call other more premitive api freely.
* On contrary, the more premitive sub-modules should not call this.
"""
import numpy as np
import _ctypes
from pywintypes import com_error
from fairypptx import c... |
# Purpose: This script calculates StreetConnectivity (3 plus leg intersections per km2)
# It outputs PFI, 3 legIntersections, and street connectivity to an SQL database.
# Buffer area is referenced in SQL table nh1600m
# Author: <NAME>
import arcpy
import os
import sys
import time
import psycopg2
im... |
#!/usr/bin/env python
"""
Learns context2vec's parametric model
"""
import argparse
import time
import sys
import numpy as np
from chainer import cuda
import chainer.links as L
import chainer.optimizers as O
import chainer.serializers as S
import chainer.computational_graph as C
from chainer.optimizer_hooks import Gra... |
import logging
import sys
from mongoengine.fields import (
BooleanField,
DateTimeField,
FileField,
FloatField,
ImageField,
IntField,
ListField,
ObjectIdField,
ReferenceField,
StringField
)
from . import filters
from ..base import BaseInterface
from ..._compat import as_unicode
... |
from struct import pack, unpack, calcsize, error as StructError
from gzip import GzipFile
import zlib
from UserDict import DictMixin
import os, io
TAG_END = 0
TAG_BYTE = 1
TAG_SHORT = 2
TAG_INT = 3
TAG_LONG = 4
TAG_FLOAT = 5
TAG_DOUBLE = 6
TAG_BYTE_ARRAY = 7
TAG_STRING = 8
TAG_LIST = 9
TAG_COMPOUND = 1... |
# Copyright 2016 Brocade Communications System, 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
#... |
from __future__ import absolute_import, print_function
import os
import time
import pytest
import subprocess
import signal
from os.path import abspath, dirname, exists, join, split
from tests.plugins.utils import trace, info, fail, ok, red, warn, white
from tests.plugins.phantomjs_screenshot import get_phantomjs_scr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import pandas as pd
import numpy as np
import random
from keras import backend as K
from keras.models import Sequential, load_model
from keras.layers import Dense, Dropout
from keras.callbacks import ModelCheckpoint
from keras.optimizers import SGD
from src.gpo... |
# MIT License
#
# Copyright (C) IBM Corporation 2019
#
# 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... |
# -*- coding: utf-8 -*-
"""Implementation of reasoning layers.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras.layers import Layer, InputSpec, conv_utils
from keras import regularizers, initializers, constraints
import keras.backend as K
impo... |
# Copyright 2013 BrewPi
# This file is part of BrewPi.
# BrewPi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# BrewPi is distribut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.