text stringlengths 3.07k 22.1k |
|---|
# -*- coding: utf-8
from __future__ import unicode_literals
from decimal import Decimal, getcontext
import math
try:
import cPickle as pickle
except ImportError:
import pickle
import json
from django.test import TestCase
from rest_framework import serializers
from shop.money.money_maker import AbstractMoney, Mo... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket 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 applicab... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module provides pre-/post-processors for the mod:`behave4cmd0.command_shell`.
"""
from __future__ import absolute_import, print_function
import re
import sys
from six import string_types
# -------------------------------------------------------------------------... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Copyright 2017-2019 Baidu 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... |
import sys
import numpy as np
from PIL import Image
from richlog import get_logger
from . import imgops
from . import item
from . import minireco
from . import resources
from . import util
LOGFILE = 'drop-recognition.html'
class RecognizeSession:
def __init__(self):
self.recognized_groups = []
... |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-26 23:05
# Ported from the PyTorch implementation https://github.com/zysite/biaffine-parser
import tensorflow as tf
from params_flow import LayerNormalization
from hanlp.utils.tf_util import tf_bernoulli
class Biaffine(tf.keras.layers.Layer):
def __init__(s... |
#!/usr/bin/env python
# coding: utf-8
# # Mask R-CNN Demo
#
# A quick intro to using the pre-trained model to detect and segment objects.
# In[1]:
import os, sys
import torch, torchvision
import numpy as np
import cv2
from sklearn.cluster import KMeans
import matplotlib.colors as mcolors
import multiprocessing
fr... |
# Lint as: python3
"""Multi vision configuration definition."""
from typing import List
import dataclasses
from official.core import exp_factory
from official.modeling import hyperparams
from official.modeling import optimization
from official.core import config_definitions as cfg
from official.modeling.multitask im... |
"""\
Functions to import modules
@copyright: 2016 <NAME>
@copyright: 2020 <NAME>
@license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY
"""
import os, re, sys, zipfile, logging
from collections import OrderedDict
import common, config, misc
# Regex tp match section headers; optionally with a hotkey c... |
#!/usr/bin/env python
import os
import sys
import glob
import subprocess
from setuptools import find_packages, setup, Extension
from setuptools.command.build_ext import build_ext
from setuptools.command.install import install
VERSION_MAJOR = 0
VERSION_MINOR = 0
VERSION_MICRO = 1
VERSION = '%d.%d.%d' % ( VERSION_MAJO... |
"""
ddupdate plugin API.
A plugin is either a service plugin or an address plugin.
Service plugins register the ip address with a dynamic dns service provider.
They implement the ServicePlugin abstract interface. Naming of these plugins
is normally based on the website used to register since these by definition
are u... |
import random
import numpy as np
import os
import feather
import hashlib
import re
import time
import heapq
import pickle
import dask.dataframe as dd
def read_data(data_folder, filename, nrows, text_column, config):
"""
Reads the dataframe with all data instances.
:param data_folder: str, name of the fold... |
import argparse
import os
import re
from typing import Optional
import py.path
import pytest
from _pytest.config import ExitCode
from _pytest.config import UsageError
from _pytest.main import resolve_collection_argument
from _pytest.main import validate_basetemp
from _pytest.pytester import Testdir
@pytest.mark.par... |
# Copyright (c) 2011 OpenStack, LLC.
# 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 requi... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 OpenStack Foundation
#
# 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 app... |
import csv
from ermin import syntax as es
from ermin import unfccc_utils
from pathlib import Path
import pandas as pd
# load iterable filter (rather than old list-based filter)
# To avoid loading filtered file into memory
# from https://stackoverflow.com/questions/33715579/python-3-module-itertools-has-no-attribute-if... |
from __future__ import absolute_import, division, print_function
from future.types.newstr import newstr
import inspect
import re
import sys
import json
import os
from builtins import (str)
from collections import OrderedDict
from cloudformation_validator.Violation import Violation
def lineno():
"""Returns the curr... |
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import random
import math
import PIL.Image
from scipy.ndimage.filters import gaussian_filter
import inception5h
model = inception5h.Inception5h()
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.5)
session = tf.Sessi... |
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
"""
import os
from os.path import join, exists
import argparse
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, ConcatDataset, random_split
import random
import json
from dataset import Dictionary, VQAFeatureDataset, V... |
"""
Itertools recipes
(copied and pasted from http://docs.python.org/library/itertools.html)
with some modifications.
"""
from itertools import *
from collections import Iterable
def take(n, iterable):
"Return first n items of the iterable as a list"
return list(islice(iterable, n))
def tabulate(function, ... |
import tensorflow as tf
import numpy as np
import gpflow
from elfi.methods.bo.iwvi.layers import RegularizerType
class DGP_VI(gpflow.models.GPModel):
def __init__(self, X, Y, layers, likelihood,
num_samples=1,
minibatch_size=None,
name=None):
gpflow.Par... |
from __future__ import (
annotations,
)
import os
import warnings
from abc import (
ABC,
abstractmethod,
)
from collections import (
defaultdict,
)
from collections.abc import (
Callable,
)
from contextlib import (
suppress,
)
from pathlib import (
Path,
)
from typing import (
TYPE_CHEC... |
from omegaconf import OmegaConf
import random
import numpy as np
import torch
import pdb
import os
import pymysql
C = OmegaConf.create()
# default seed 1024
C.seed = random.randint(0, 1000000)
C.max_pad_length = 50 + 1
C.attr_dim = 4 + 512 + 18
C.lambdav = 0.001
C.max_age = 56
C.CausalD = False
C.CausalD_wo_dag = F... |
"""
SqueezeNet, implemented in Gluon.
Original paper: 'SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size,'
https://arxiv.org/abs/1602.07360.
"""
__all__ = ['SqueezeNet', 'squeezenet_v1_0', 'squeezenet_v1_1', 'squeezeresnet_v1_0', 'squeezeresnet_v1_1']
import os
from mxnet ... |
import numpy as np
from qcodes.instrument.base import Instrument
from qcodes.utils.validators import Numbers
from qcodes.instrument.parameter import MultiParameter, Parameter, ArrayParameter
from qcodes.instrument.channel import InstrumentChannel, ChannelList
class MockParabola(Instrument):
'''
Holds dummy pa... |
import os
from collections import defaultdict
from typing import Union
import numpy as np
from yt._maintenance.deprecation import issue_deprecation_warning
from yt.frontends.ramses.definitions import VAR_DESC_RE, VERSION_RE
from yt.utilities.cython_fortran_utils import FortranFile
from yt.utilities.exceptions import ... |
# coding=utf-8
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from PIL import Image
from PIL import ImageDraw
import os.path as osp
import numpy as np
import json
class CPDataset(data.Dataset):
"""Dataset for CP-VTON+.
"""
def __init__(self, opt):
super... |
import unittest
import gc
from mock import MagicMock, patch
from malcolm.core.controller import Controller
from malcolm.core.process import Process
from malcolm.core.hook import Hook
from malcolm.core.part import Part
from malcolm.core.alarm import Alarm, AlarmSeverity
from malcolm.core.context import Context
from mal... |
#
# Copyright(c) 2019-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
import pytest
import random
from ctypes import c_uint32
from api.cas import casadm
from api.cas.cache_config import SeqCutOffPolicy
from api.cas.core import SEQ_CUTOFF_THRESHOLD_MAX, SEQ_CUT_OFF_THRESHOLD_DEFAULT
from api.cas.casad... |
# Copyright 2012 OpenStack LLC.
# 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... |
import contextlib
import logging
import os
import pkgutil
import sys
from io import UnsupportedOperation
from multiprocessing import Process, Queue
import leapp.libraries.actor
from leapp.actors import get_actors, get_actor_metadata
from leapp.exceptions import ActorInspectionFailedError, MultipleActorsError, Unsuppor... |
"""Arguably the most important file in the data analysis process. This script
is used to obtain fitting data from galaxy builder metadata and subject files.
"""
import os
import requests
from io import BytesIO
import numpy as np
import pandas as pd
import json
from PIL import Image
# from astropy.wcs import WCS
import... |
"""Representation of a WeMo Bridge (Link) device."""
import io
import time
from html import escape
from lxml import etree as et
from ..color import get_profiles, limit_to_gamut
from . import Device
CAPABILITY_ID2NAME = dict(
(
('10006', "onoff"),
('10008', "levelcontrol"),
('30008', "slee... |
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import os, sys
import pickle
import argparse
import datetime
import json
from math import degrees
import Satmind.actor_critic as models
from Satmind.env_orekit import OrekitEnv
import Satmind.utils
from Satmind.replay_memory import Uniform_Memor... |
from __future__ import print_function, division
import os
import json
import shutil
import torch
import torch.nn as nn
import torch.optim as optim
from torch_scatter import scatter_add, scatter_max
from utils import randomSeed
import config as cfg
class ConvLayer(nn.Module):
"""
Convolutional operation on ... |
##############################################################
## danpy timer class, is_number func, and save_figures func ##
## By: <NAME> ##
## Last Modified: 08/28/2020 ##
##############################################################
import numpy ... |
import game_framework
from pico2d import *
import game_world
# Boy Run Speed
PIXEL_PER_METER = (10.0 / 0.3) # 10 pixel 30 cm
RUN_SPEED_KMPH = 20.0 # Km / Hour
RUN_SPEED_MPM = (RUN_SPEED_KMPH * 100.0 / 60.0)
RUN_SPEED_MPS = (RUN_SPEED_MPM / 60.0)
RUN_SPEED_PPS = (RUN_SPEED_MPS * PIXEL_PER_METER)
# Boy Action Speed... |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
import pygame as pg
import json
from os.path import join
from concurrent.futures import ThreadPoolExecutor
background_tile_size = 100
road_size = 125
SCREEN_WIDTH = 1000
SCREEN_HEIGHT = 800
class Tile(pg.sprite.Sprite): # Load main tile class
def __init__(self, image):
pg.sprite.Sprite.__init__(self)
... |
import logging
from datetime import datetime, timedelta
from time import sleep
from typing import Dict, Optional, Tuple, Union
import requests
from six.moves.urllib_parse import urljoin
from dbnd._core.current import try_get_databand_run
from dbnd._core.errors.base import (
DatabandApiError,
DatabandAuthent... |
## This code is written by <NAME>, <<EMAIL>>
## (C) 2011 mlpy Developers.
## See: Practical Guide to Wavelet Analysis - <NAME> and <NAME>.
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, ei... |
# -*- coding: utf-8 -*-
# pylint: disable=bad-continuation, too-few-public-methods
""" 'label' command.
See http://github3py.readthedocs.org/en/master/issues.html#github3.issues.label.Label
"""
# Copyright © 2015 <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not us... |
import numpy as np
import time
import copy
import multiprocessing as mp
from multiprocessing.managers import SyncManager
from queue import PriorityQueue
from .XpcsAna.Xpcs import Xpcs
from .XsvsAna.Xsvs import Xsvs
from .SaxsAna.Saxs import Saxs
from .ProcData.Xdata import Xdata
from .Decorators import Decorators
from ... |
import re
from uuid import uuid4
from glycan_profiling.serialize.hypothesis import GlycanHypothesis
from glycan_profiling.serialize.hypothesis.glycan import (
GlycanComposition as DBGlycanComposition, GlycanClass,
GlycanCompositionToClass, GlycanTypes)
from glycan_profiling.serialize import DatabaseBoundOper... |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2019, Battelle Memorial Institute.
#
# 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... |
#!/usr/bin/env python
import asyncio
from abc import ABC
from collections import deque
from enum import Enum
import logging
import pandas as pd
import re
from typing import (
Dict,
Deque,
Optional,
Tuple,
List)
import time
from hummingbot.core.event.events import OrderBookTradeEvent, TradeType
from ... |
import os
from argparse import ArgumentParser
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import pickle
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
from vis_paper_test import get_framework_name
seven_tab10_colors = [
(0.121... |
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import iccas as ic
from iccas.charts.common import DEFAULT_CMAP, legend
from iccas.i18n import translated
from iccas.i18n.lib import NullTranslation, ... |
import time
import argparse
import warnings
from datetime import datetime
import torch
import torch.optim as optim
import torch.backends.cudnn as cudnn
from torch.utils.tensorboard import SummaryWriter
import torch.utils.data.distributed
import torchvision.models as models
cudnn.benchmark = True
from models.resnet_i... |
# SPDX-License-Identifier: BSD-3-Clause AND Apache-2.0
# Copyright 2018 Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code... |
import logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
import gevent
from gevent import monkey
monkey.patch_all()
from gevent.pywsgi import WSGIServer
import copy
import json
import threading
import traceback
import time
from datetime imp... |
'''ShuffleNetV2 in PyTorch.
See the paper "ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design" for more details.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from collections import OrderedDict
from torch.nn import init
import math
... |
# A modified version of the implementation from the following paper:
# TENER: Adapting Transformer Encoder for Named Entity Recognition
# <NAME>, <NAME>, <NAME>, <NAME>
import math
import torch
import torch.nn.functional as F
from torch import Tensor, nn
from hanlp.common.structure import ConfigTracker
class Relati... |
import copy
import datetime
import functools
import logging
import random
from typing import (
Callable,
Dict,
Generator,
Iterable,
List,
Mapping,
MutableMapping,
MutableSequence,
NamedTuple,
Optional,
Sequence,
Sized,
Tuple,
Union,
cast,
)
from uuid import UU... |
"""Declare API endpoints for live session with Django RestFramework viewsets."""
from logging import getLogger
import smtplib
from django.conf import settings
from django.core.mail import send_mail
from django.db.utils import IntegrityError
from django.http import Http404
from django.shortcuts import get_object_or_404... |
from django.db.models import Q, Count
from django.shortcuts import get_object_or_404
from rest_framework import generics, permissions, status
from rest_framework.response import Response
from ubfquiz.models import Answer, Question, Quiz, QuizTaker, UsersAnswer
from ubfquiz.serializers import MyQuizListSerializer, QuizD... |
import re
from cast.Lexer import Lexer, PatternMatchingLexer
from cast.Token import ppToken
from cast.pp_Parser import pp_Parser
from cast.SourceCode import SourceCodeString
from cast.Logger import Factory as LoggerFactory
moduleLogger = LoggerFactory().getModuleLogger(__name__)
def parseDefine( match, lineno, colno,... |
import trimesh
import numpy
from bedrock import bedrock
import os
import shutil
from openpyxl import Workbook
from zipfile import ZipFile
from tkinter import DoubleVar,StringVar,IntVar, Label, Entry, Tk, Button
from tkinter import filedialog
import threading
import LevelDatNbt as worldNBT
from trimesh.transformations ... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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... |
import argparse
from typing import Dict, List, Optional, Union
import torch
from tap import Tap
from typing_extensions import Literal
from nifr.data.celeba import CelebAttrs
from ethicml.data import GenfacesAttributes
__all__ = ["InnArgs", "VaeArgs", "Ln2lArgs", "SharedArgs", "CelebAttrs"]
class StoreDictKeyPair(a... |
#!/usr/bin/env python
"""
The PyBitmessage startup script
"""
# Copyright (c) 2012-2016 <NAME>
# Copyright (c) 2012-2020 The Bitmessage developers
# Distributed under the MIT/X11 software license. See the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Right now, PyBitmessage only ... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Leland Stanford Junior University
# Copyright (c) 2018 The Regents of the University of California
#
# This file is part of pelicun.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... |
import Testing.ZopeTestCase
import codecs
import os
import shutil
import sys
import tempfile
import unittest
class DummyConnection(object):
def __init__(self, db):
self.__db = db
def db(self):
return self.__db
class DummyDBTab(object):
def __init__(self, databases=None):
self._... |
#!/usr/bin/env python
#
# esp-idf serial output monitor tool. Does some helpful things:
# - Looks up hex addresses in ELF file with addr2line
# - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R)
# - Run flash build target to rebuild and flash entire project (Ctrl-T Ctrl-F)
# - Run app-flash build target to rebuild and f... |
# Copyright 2019 Deepmind Technologies Limited.
#
# 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... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import dask
from dask_kubernetes import KubeCluster
import numpy as np
# In[2]:
# Specify a remote deployment using a load blanacer
dask.config.set({"kubernetes.scheduler-service-type": "LoadBalancer"})
# In[3]:
cluster = KubeCluster.from_yaml('worker-spec.yaml'... |
"""Tools for voice-driven window management.
Originally from dweil/talon_community - modified for newapi by jcaw.
"""
# TODO: Map keyboard shortcuts to this manager once Talon has key hooks on all
# platforms
import time
from operator import xor
from typing import Optional
from talon import ui, Module, Context, ... |
import warnings
from numbers import Number
from typing import Iterable, List, Optional, Union
import numpy as np
from ..C import (
LEN_RGB,
LEN_RGBA,
RGB,
RGB_RGBA,
RGBA_ALPHA,
RGBA_MAX,
RGBA_MIN,
RGBA_WHITE,
)
from .clust_color import assign_colors_for_list
def process_result_list(r... |
from flask_api import status
from models.main import *
from models.appendix import *
from models.prescription import *
from flask import Blueprint, request
from flask_jwt_extended import (create_access_token, create_refresh_token,
jwt_required, get_jwt_identity)
from sqlalchemy import as... |
import asyncio
import datetime
import html
import re
import typing
from operator import itemgetter
from typing import List
import piazza_api.exceptions
from piazza_api import Piazza
# Exception for when a post ID is invalid or the post is private etc.
class InvalidPostID(Exception):
"""
Exception raised when... |
'''
Created on Nov 28, 2016
@author: andrey.justo
'''
SBOX = [
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B,
0xFE, 0xD7, 0xAB, 0x76, 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0,
0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, 0xB7, 0xFD, 0x93, 0x26,
0x36, 0x3F, 0xF7, 0... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import pandas as pd
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import dash_table
import dash_cytoscape as cyto
import os # for He... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing import assert_allclose
import pytest
from astropy.io import fits
from astropy.tests.helper import remote_data
from .make_test_data import make_test_image
from ..fitter import EllipseFitter, CentralEllipseFitter
from... |
import boto3
from botocore.exceptions import ClientError
import logging
import pandas as pd
import zipfile
import os
from activitysim.core import config
from activitysim.core import inject
logger = logging.getLogger(__name__)
def exists_on_s3(s3_client, bucket, key):
try:
s3_client.head_object(Bucket=b... |
from __future__ import division
import copy
from distutils.version import LooseVersion
import math
import warnings
try:
import cv2
except ImportError:
cv2 = None
import numpy as np
import scipy.ndimage
import six
import skimage
import skimage.color
import skimage.transform
# -------------------------------... |
#!/usr/bin/python
# sudo apt install python-pip python-yaml
# pip install --upgrade pip
# pip install tweepy py2neo retrying
# check tweepy api:
# - http://docs.tweepy.org/en/v3.5.0/api.html
# - https://github.com/tweepy/tweepy/
# code adapted from
# - https://github.com/neo4j-contrib/twitter-neo4j/blob/master/docke... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import os
from builtins import object, str
import mock
from pants.binari... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from builtins import object, str
from pants.base.build_environment import... |
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
import gspread
from flask import Flask
import os
from google.auth.transport.requests import Request
# App config
app = Flask(__name__)
app.config.from_object('config.Config')
PROCESS_LOG = ap... |
# coding: utf-8
"""
Author:
<NAME>,<EMAIL>
Reference:
[1] <NAME>, <NAME>, <NAME>, et al. Deep Session Interest Network for Click-Through Rate Prediction[J]. arXiv preprint arXiv:1905.06482, 2019.(https://arxiv.org/abs/1905.06482)
"""
from collections import OrderedDict
from tensorflow.python.keras.initializ... |
# -*- coding:utf-8 -*-
"""
File Name: inferece3_RulerDivDet.py
Description : DF第三步:Retinanet工程-标尺及标尺刻度检测
Author : royce.mao
date: 2019/09/02
"""
import argparse
import skimage
import os
import cv2
import tqdm
import time
import torch
import numpy as np
import tensorflow as tf
from util... |
# Copyright 2017 Capital One Services, 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 agreed to in... |
'''
Unit tests for utils
'''
from __future__ import print_function, absolute_import
import numpy
import nose.tools
import sed_eval
event_list = [
{'event_label': 'alert', 'event_offset': 17.1469, 'event_onset': 15.78237},
{'event_label': 'clearthroat', 'event_offset': 5.32103, 'event_onset': 4.42416},
{'... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
# Copyright 2017 the pycolab 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
import os
import nengo
from nengo.utils.filter_design import cont2discrete
import nengo_dl
import numpy as np
import pandas as pd
import tensorflow as tf
from keras.callbacks import TensorBoard, Callback
import argparse
import logging
import json
import nni
from sklearn.preprocessing import MinMaxScaler
from scipy.sign... |
from __future__ import division
from lib.visual import *
from lib.functions import *
import torchvision.transforms as st
from sklearn.metrics import confusion_matrix
from tqdm import tqdm_notebook as tqdm
from tools.agri_ckpt_best import *
import time
import itertools
ckpt_root_semi = '../ckpt/semi_supervise_traine... |
# Copyright: <NAME>, 2020
import argparse
import yaml
import random
import os
import torch
import torch.nn as nn
from dataloader import read_cluster_file_from_yaml
from dataloader import divide_clusters_train_test
from dataloader import pocket_loader_gen
from dataloader import merge_clusters
from model import Graphsite... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
# Copyright (c) 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 ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""RAMSES RF - Protocol/Transport layer.
Helper functions.
"""
import ctypes
import sys
import time
from datetime import datetime as dt
from typing import Optional, Union
from .const import DEVICE_TYPES, NON_DEVICE_ID, NUL_DEVICE_ID
class FILETIME(ctypes.Structure):... |
"""
@author: <NAME>, <NAME>
@date: 20201101
@contact: <EMAIL>
"""
import os
import random
import cv2
import torch
import numpy as np
from torch.utils.data import Dataset
def transform(image):
""" Transform a image by cv2.
"""
img_size = image.shape[0]
# random crop
if random.rand... |
import argparse
import pathlib
import os
import h5py
import numpy as np
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--dataset_dir', default="s3dis_raw", type=str, help='Path to .npy format dataset')
parser.add_argument('--output_dir', default="", type=str, help='Path to outp... |
# -*- coding: utf-8 -*-
from datetime import datetime
import unittest
from mock import Mock, sentinel, patch, ANY
from nose.tools import assert_equal, assert_true
import pytz
from six import advance_iterator
from twilio.rest.resources.imports import json
from twilio.rest.resources import Resource, NextGenListResource... |
"""Module containing Builder_elph and Builder_many_body_elph classes."""
from .builder_base import BuilderBase
from .builder_base import attribute_map
from .builder_base import BuilderManyBody
from ..indexing import StateIndexingDM
from ..indexing import StateIndexingDMc
from ..baths import PhononBaths
from .validati... |
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
#
# Copyright (c) 2015 Juniper Networks, Inc.
# All rights reserved.
#
# Use is subject to license terms.
#
# 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... |
from os import listdir, path, system
import sys, platform
from Qt import QtGui
from Qt import QtCore
from Qt import QtWidgets
from Qt.QtWidgets import QMainWindow
from Qt.QtWidgets import QApplication
from Qt.QtCore import QCoreApplication
from Qt.QtWidgets import QMessageBox
from Qt.QtWidgets import QInputDialog
from ... |
import json
import redis
import logging
import os
import secrets
from datetime import datetime
from urllib.parse import urlparse
import redis
from rcon.cache_utils import get_redis_pool, get_redis_client
logger = logging.getLogger("rcon")
ALL_MAPS = (
"foy_warfare",
"stmariedumont_warfare",
"utahbeach_... |
# Copyright (C) 2014 <NAME> <<EMAIL>>
__version__ = '0.2.5a'
__date__ = '2014-09-27'
__author__ = '<NAME> <<EMAIL>>'
__license__ = 'MIT'
import collections
import copy
import numbers
import pprint
from .util import rpartial, foldr, install_symbols_module
from .expressions import mcompose, promote, Name
from .operat... |
import asyncio
import discord
import random
import json
import time
import os
from discord.ext import commands
from Cogs import Message
from Cogs import FuzzySearch
from Cogs import GetImage
from Cogs import Nullify
from Cogs import Message
from Cogs import DL
from Cogs import Admin
def setup(bot):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.