filename stringlengths 13 19 | text stringlengths 134 1.04M |
|---|---|
the-stack_0_13099 | # Copyright (c) 2011 Tencent Inc.
# All rights reserved.
#
# Author: Huan Yu <huanyu@tencent.com>
# Feng Chen <phongchen@tencent.com>
# Yi Wang <yiwang@tencent.com>
# Chong Peng <michaelpeng@tencent.com>
# Wenting Li <wentingli@tencent.com>
# Date: October 20, 2011
# pylint: disable=t... |
the-stack_0_13101 | #!/usr/bin/python
import multiprocessing
import containerstats
import etcd
import platform
import docker
import time
import os
import requests
dockerconnection = docker.Client(base_url='unix://var/run/docker.sock', timeout=2)
dockerconnection.close()
def getstats(obj):
etcd.CreateDir(DDS_ETCD_URL, platform.node(... |
the-stack_0_13102 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Parsing routines for the ODB++ line record text format
according to the ODB++ 7.0 specification:
http://www.odb-sa.com/wp-content/uploads/ODB_Format_Description_v7.pdf
"""
from collections import defaultdict
from .Utils import readFileLines, readZIPFileLines
def filt... |
the-stack_0_13104 | import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
#get_ipython().magic('matplotlib inline')
b1 = tsds.load_ozone()
df = b1.mPastData
for k in [1 , 5]:
df[b1.mTimeVar + "_" + str(k) + '_Daily'] = pd.date_range('2000-1-1', periods=df.shape[0], freq=st... |
the-stack_0_13108 | import requests
import os
import time
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
# First we want to check the robots.txt file of our objective website
# A function get_robot_txt is constructed to check any url
def get_robot_txt(url):
if url.endswith('/'):
path ... |
the-stack_0_13109 | from typing import List, Tuple
import q_network
from q_network import Q
import numpy as np
# import gym
import tools
import torch
# buffer hyperparameters
batchsize = 200 # batchsize for buffer sampling
buffer_maxlength = 1000 # max number of tuples held by buffer
episodes_til_buffer_sample = 2
buffer = tools.Repla... |
the-stack_0_13110 | # pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103
from __future__ import absolute_import, division, print_function
import pytest
import numpy as np
from mock import MagicMock
from .. import parse
from ..data import ComponentID, Component, Data
from ..subset import Subset
class TestParse(object):
def test_... |
the-stack_0_13111 | # -*- coding: utf-8 -*-
"""
XForm Survey element classes for different question types.
"""
import os.path
import re
from pyxform.errors import PyXFormError
from pyxform.question_type_dictionary import QUESTION_TYPE_DICT
from pyxform.survey_element import SurveyElement
from pyxform.utils import (
basestring,
no... |
the-stack_0_13115 | # 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... |
the-stack_0_13116 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
import json
from dataclasses import dataclass, field
from json import JSONEncoder
from typing import Set, Dict, Union, List, Tu... |
the-stack_0_13117 | #! /usr/bin/env py.test
import time
from mwlib import myjson as json
from mwlib import serve
def mkcolldir(tmpdir, name):
cid = serve.make_collection_id({'metabook': json.dumps({'title': name, "type": "collection"})})
d = tmpdir.join(cid[0], cid[:2], cid).ensure(dir=1)
d.join("output.rl").write("bla")
... |
the-stack_0_13118 | import tensorflow as tf
from tqdm import tqdm
from ..texts._text_functions import str_idx, build_dataset
class Model:
def __init__(
self,
size_layer = 128,
num_layers = 1,
embedded_size = 128,
dict_size = 5000,
learning_rate = 1e-3,
output_size = 300,
... |
the-stack_0_13121 | """
Union of Features
==========================
This module contains steps to perform various feature unions and model stacking, using parallelism is possible.
..
Copyright 2019, Neuraxio Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance w... |
the-stack_0_13122 | # 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... |
the-stack_0_13123 | #!/usr/bin/python
import json
import tarfile
import time
import os
import shutil
import sys
import requests
import tempfile
import contextlib
import re
from requests.auth import HTTPBasicAuth
from subprocess import Popen, PIPE
class Export:
"""
This is a generic EuPathDB export tool for Galaxy. It is abstra... |
the-stack_0_13124 | # ---------------------------------------------------------------------
# Iskratel.MSAN.get_interface_status
# ---------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------... |
the-stack_0_13125 | """
File for test case generation
"""
import time
from typing import List
import kubernetes as k8s
from illuminatio.k8s_util import labels_to_string
from illuminatio.rule import Rule
from illuminatio.test_case import NetworkTestCase
from illuminatio.host import ClusterHost, GenericClusterHost
from illuminatio.util imp... |
the-stack_0_13127 | import glob
import os
import argparse
from mega_core.config import cfg
from predictor import VIDDemo
parser = argparse.ArgumentParser(description="PyTorch Object Detection Visualization")
parser.add_argument(
"method",
choices=["base", "dff", "fgfa", "rdn", "mega"],
default="base",
type=str,
help=... |
the-stack_0_13130 | """
this module is used to extract and preprocess from the raw data
N.B. but some preprocessing are done manually
"""
import os
import json
data_path = os.path.dirname(__file__) + '/../src/bangla/data/'
def get_word_list():
with open(data_path + 'words.txt', 'r', encoding='utf-8') as file:
... |
the-stack_0_13131 | import math
import pyaudio
import itertools
import numpy as np
from pygame import midi
BUFFER_SIZE = 256
SAMPLE_RATE = 44100
NOTE_AMP = 0.1
# -- HELPER FUNCTIONS --
def get_sin_oscillator(freq=55, amp=1, sample_rate=SAMPLE_RATE):
increment = (2 * math.pi * freq)/ sample_rate
return (math.sin(v) * amp * NOTE_A... |
the-stack_0_13133 | # -*- coding: utf-8 -*-
"""Cisco DNA Center GetAuditlogParentRecords data model.
Copyright (c) 2019-2021 Cisco Systems.
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, includ... |
the-stack_0_13134 | import os
from os.path import exists
import pytest
from pip._internal.cli.status_codes import PREVIOUS_BUILD_DIR_ERROR
from pip._internal.utils.marker_files import write_delete_marker_file
from tests.lib import need_mercurial
from tests.lib.local_repos import local_checkout
def test_cleanup_after_install(script, da... |
the-stack_0_13135 | import numpy as np
import matplotlib.pyplot as plt
from audio import spec2wav, wav2spec, read_wav, write_wav
if __name__ == '__main__':
sr = 22050
n_fft = 512
win_length = 400
hop_length = 80
duration = 2 # sec
wav = read_wav( "H:\\cs230\\wav_x\\1_1.wav", sr, duration )
spec, _ = wav2sp... |
the-stack_0_13137 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2017 Alex Forencich
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 righ... |
the-stack_0_13138 | import contextlib
import ctypes
import json
import os
import shutil
import struct
import subprocess
import sys
import tempfile
import time
from datetime import datetime, timedelta, timezone
from enum import Enum, auto
from hashlib import pbkdf2_hmac
from .aes import (
aes_cbc_decrypt_bytes,
aes_gcm_decrypt_and... |
the-stack_0_13140 | import os
import glob
import pandas as pd
game_files = glob.glob(os.path.join(os.getcwd(), 'games', '*.EVE'))
game_files.sort()
game_frames = []
for game_file in game_files:
game_frame = pd.read_csv(game_file, names=[
'type', 'multi2', 'multi3', 'multi4', 'multi5', 'multi6', 'event'])... |
the-stack_0_13141 | from collections import OrderedDict
from django.conf import settings
from systems.models.base import BaseModel
from utility.data import Collection, ensure_list, flatten, clean_dict, normalize_value, format_value, prioritize, dump_json
import re
import copy
import yaml
import logging
logger = logging.getLogger(__nam... |
the-stack_0_13142 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import json
import os
import re
import subpro... |
the-stack_0_13144 | # Copyright (c) 2022 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... |
the-stack_0_13146 | import asyncio
import json
import logging
import multiprocessing
import multiprocessing.context
import time
from collections import defaultdict
from pathlib import Path
from secrets import token_bytes
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
import aiosqlite
from blspy import G1Element, Priva... |
the-stack_0_13151 | from models import *
import sqlalchemy as db
from sqlalchemy.orm import *
from sqlalchemy import inspect
from sqlalchemy_schemadisplay import create_schema_graph
class DatabaseHelper(object):
# params
__session = None
__engine = None
def __new__(cls, *args, **kwargs):
if not hasattr(cls, '__in... |
the-stack_0_13154 | import os
import sys
import glob
import unittest
import datetime
def create_test_suite():
"""
Runs through the list of unit tests available in the src/test folder, executing
each in turn.
"""
testFolder = sys.path[0]
testFolderTokens = testFolder.split('/')
moduleStrings = []
if testFolderTokens[... |
the-stack_0_13155 | from distutils.version import LooseVersion
import pytest
import numpy as np
from collections import defaultdict
from itertools import combinations
from opensfm import multiview
from opensfm.synthetic_data import synthetic_examples
def pytest_configure(config):
use_legacy_numpy_printoptions()
def use_legacy_n... |
the-stack_0_13157 | """
Huang G. et al. "`Densely Connected Convolutional Networks
<https://arxiv.org/abs/1608.06993>`_"
"""
import tensorflow as tf
from ... import is_best_practice
from . import TFModel
from .layers import conv_block
class DenseNet(TFModel):
""" DenseNet
**Configuration**
inputs : dict
dict with ... |
the-stack_0_13159 | """From RAW data filter out sentences not containing the word mouse or mice."""
import click
import codecs
import os
import src.data.dataset as dataset
@click.command()
@click.argument('read_directory', type=click.Path(dir_okay=True),
default=dataset.DEFAULT_RAW_DATA_DIRECTORY)
@click.argument('save_... |
the-stack_0_13163 | # Demo: (Audio) -> (Label)
import gradio as gr
import numpy as np
from scipy.fftpack import fft
import matplotlib.pyplot as plt
from math import log2, pow
A4 = 440
C0 = A4*pow(2, -4.75)
name = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"]
def get_pitch(freq):
h = round(12*log2(freq/C0))
... |
the-stack_0_13164 | # -*- coding: utf-8 -*-
from typing import Dict
import os
import pkg_resources
from bag.design import Module
yaml_file = pkg_resources.resource_filename(__name__, os.path.join('netlist_info', 'r2r_dac.yaml'))
# noinspection PyPep8Naming
class adc_sar_templates__r2r_dac(Module):
"""Module for library adc_sar_... |
the-stack_0_13165 | # -*- coding:UTF-8 -*-
#
# Tencent is pleased to support the open source community by making QTA available.
# Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may not use this
# file except in compliance with the License. You may o... |
the-stack_0_13166 | """
Introducción a los Bloques condicionales.
Un bloque condicional puede probar diferentes condiciones
"""
import sys
try:
numero1 = int(input("Introduzca un primer número: "))
numero2 = int(input("Introduzca un segundo número: "))
except ValueError as e:
print("La conversión de al menos uno de los núme... |
the-stack_0_13169 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
the-stack_0_13170 | import json
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
vmanage_session = requests.session()
# Reserved sandbox
vmanage_node = {
"host": "10.10.20.90",
"username": "admin",
"password": "C1sco... |
the-stack_0_13171 | # Advice: use repr(our_file.read()) to print the full output of tqdm
# (else '\r' will replace the previous lines and you'll see only the latest.
from __future__ import unicode_literals
import sys
import csv
import re
import os
from nose import with_setup
from nose.plugins.skip import SkipTest
from nose.tools import ... |
the-stack_0_13172 | from google.cloud import storage
import googleapiclient.discovery
import shutil
import os
import time
from .function import port_open, post_slack
from .libraries import extra_libraries, important_libraries
from herpetologist import check_type
import subprocess
import cloudpickle
from typing import Callable, List
addi... |
the-stack_0_13174 | import contextlib
import glob
import json
import os
import sys
from sqlalchemy.orm import scoped_session
import get
import db
from flask import *
app = Flask(__name__)
@contextlib.contextmanager
def working_directory(path):
prev_cwd = os.getcwd()
os.chdir(path)
yield
os.chdir(prev_cwd)
# Get fil... |
the-stack_0_13176 | from ._builtin import Page, WaitPage
import random
from exp.util import Participant
from exp.payment import PaymentMethod, MethodThreeResults, MethodOneResults, MethodTwoResults
from exp.lottery import Lottery
class FinalPayoffResults(Page):
def vars_for_template(self):
experiment = Participant.get_exper... |
the-stack_0_13177 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def inorderTraversal(self, root: TreeNode) -> List[int]:
stack = []
res =... |
the-stack_0_13178 | import requests
from variables import rapidApiKey
def ipLocation(ipAddress):
url = "https://ip-location5.p.rapidapi.com/get_geo_info"
payload = "ip="+ipAddress
headers = {
'content-type': "application/x-www-form-urlencoded",
'x-rapidapi-key': rapidApiKey,
'x-rapidapi-host': "ip-loc... |
the-stack_0_13181 | class ExifFormat:
def __init__(self, id, name, size, short_name):
self.id = id
self.name = name
self.size = size
self.short_name = short_name # used with struct.unpack()
exif_formats = {
1: ExifFormat(1, 'unsigned byte', 1, 'B'),
2: ExifFormat(2, 'ascii string', 1, 's'),
... |
the-stack_0_13182 | # %%
#
example = """123 -> x
456 -> y
x AND y -> d
x OR y -> e
x LSHIFT 2 -> f
y RSHIFT 2 -> g
NOT x -> h
NOT y -> i"""
def load(l):
# connections to each wire, either an integer or a formula
cn = dict()
for l in l.splitlines():
expr, output = l.split(' -> ')
cn[output] = expr
return ... |
the-stack_0_13183 | import tensorflow as tf
from . import CustomDropout
from tensorflow.compat.v1.keras.layers import CuDNNLSTM
class BaselineModel(tf.keras.Model):
def __init__(self, input_size, slot_size, intent_size, layer_size=128):
super(BaselineModel, self).__init__()
self.embedding = tf.keras.layers.Embedding(... |
the-stack_0_13185 | import sys
from numpy.distutils.core import Extension, setup
__author__ = "Lars Andersen Bratholm"
__copyright__ = "Copyright 2017"
__credits__ = ["Lars Andersen Bratholm (2017) https://github.com/larsbratholm/fns"]
__license__ = "MIT"
__version__ = "0.0.1"
__maintainer__ = "Lars Andersen Bratholm"
__email__ = "lars.b... |
the-stack_0_13186 | #
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
the-stack_0_13187 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... |
the-stack_0_13189 | import cv2
import numpy as np
from pynput.keyboard import Key, Controller
import time
cap = cv2.VideoCapture(0)
facecascade = cv2.CascadeClassifier(r'C:\Users\yashd\Documents\Python\cv2_Face\haarcascade_frontalface_default.xml')
keyboard = Controller()
time.sleep(7)
while True:
ret,img = cap.read()
... |
the-stack_0_13190 | """
Wrapper for AWS Lambda.
"""
from __future__ import absolute_import
import traceback
import time
import functools
import warnings
from uuid import uuid4
import epsagon.trace
import epsagon.runners.aws_lambda
import epsagon.triggers.aws_lambda
import epsagon.wrappers.python_function
import epsagon.runners.python_fu... |
the-stack_0_13192 | # cellfreesim functions.py
import matplotlib.pyplot as plt
import tellurium as te # 2.1.5
import numpy as np
import sys
import progressbar as progressbar
import emcee
from scipy.integrate import odeint
#-----------------------------------------------------------------------------
# Define parsing functions
#---------... |
the-stack_0_13195 | import torch
import torch.nn as nn
import torch.nn.functional as F
class SimpleNNModel(nn.Module):
def __init__(self):
super(SimpleNNModel, self).__init__()
self.layer1 = nn.Linear(32*32, 512)
self.layer2 = nn.Linear(512, 32)
self.layer3 = nn.Linear(32, 10)
self.loss_fn = ... |
the-stack_0_13197 | #!/usr/bin/env python3
from __future__ import print_function
# Get all of the videos for the shows.
PBSKIDS_SHOWS = "http://pbskids.org/pbsk/video/api/getShows/"
PBSKIDS_VIDS = "http://pbskids.org/pbsk/video/api/getVideos/"
VIDEOS_CACHE = "videos.json"
# Find the shows. Write to shows.json.
import requests
import js... |
the-stack_0_13200 | # qubit number=4
# total number=41
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... |
the-stack_0_13201 | import os
import platform
import sys
from methods import get_compiler_version, using_gcc, using_clang
def is_active():
return True
def get_name():
return "X11"
def can_build():
if os.name != "posix" or sys.platform == "darwin":
return False
# Check the minimal dependencies
x11_error =... |
the-stack_0_13202 | class News:
'''
News class to define News Objects
'''
def __init__(self, name, description, url, urlToImage, content):
self.name = name
self.description = description
self.url = url
self.urlToImage = urlToImage
self.content = content
class Sources:
... |
the-stack_0_13203 | """
Created on Sat Nov 30 11:12:39 2019
@author: Bogdan
"""
import os
import sys
import numpy as np
from scipy.signal import convolve2d
project_path = os.getcwd()
while os.path.basename(project_path) != 'image-tinkering':
project_path = os.path.dirname(project_path)
sys.path.append(project_path)
from backend impor... |
the-stack_0_13205 | """
fs.expose.dokan
===============
Expose an FS object to the native filesystem via Dokan.
This module provides the necessary interfaces to mount an FS object into
the local filesystem using Dokan on win32::
http://dokan-dev.github.io/
For simple usage, the function 'mount' takes an FS object
and new device mo... |
the-stack_0_13206 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists of v... |
the-stack_0_13207 | from heapq import *
from typing import List, Union, Tuple
import numpy as np
from skimage.draw import line as skline
from seedpod_ground_risk.pathfinding.algorithm import Algorithm
from seedpod_ground_risk.pathfinding.environment import GridEnvironment, Node
from seedpod_ground_risk.pathfinding.heuristic import Heuri... |
the-stack_0_13212 | from math import radians
import numpy as np
import geopandas as gpd
import pandas as pd
from shapely.geometry import Point
from sklearn.cluster import DBSCAN
from tqdm import tqdm
from trackintel.geogr.distances import meters_to_decimal_degrees
def generate_locations(
staypoints,
method="dbscan",
epsilo... |
the-stack_0_13214 | import os
import sys
sys.path.append("../../../../monk_v1/");
sys.path.append("../../../monk/");
import psutil
from keras_prototype import prototype
from compare_prototype import compare
from common import print_start
from common import print_status
import tensorflow as tf
if(tf.__version__[0] == '2'):
import ten... |
the-stack_0_13215 | from fontTools.misc.py23 import bytesjoin, strjoin, tobytes, tostr
from fontTools.misc.textTools import safeEval
from fontTools.misc import sstruct
from . import DefaultTable
import base64
DSIG_HeaderFormat = """
> # big endian
ulVersion: L
usNumSigs: H
usFlag: H
"""
# followed by an array of usN... |
the-stack_0_13218 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import RecipeSerializer, RecipeDetailSerializer
RECIPES_... |
the-stack_0_13219 | from sqlalchemy import desc, func
from sqlalchemy.orm import Session
from sqlalchemy.sql.expression import and_
from app.models import Fund, Holding, News, Trades
def get_etf_profile(db: Session, symbol: str):
return db.query(Fund).filter(Fund.symbol == symbol).one()
def get_etf_current_holdings(db: Session, s... |
the-stack_0_13220 | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... |
the-stack_0_13221 | # coding: utf-8
import pprint
import re
import six
class ListScalingTagInfosByResourceIdRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
... |
the-stack_0_13222 | from BTcrypto import Crypto
from BT1.Encrypter import protocol_name
default_task_id = []
class SingleRawServer:
def __init__(self, info_hash, multihandler, doneflag, protocol):
self.info_hash = info_hash
self.doneflag = doneflag
self.protocol = protocol
self.multihandler = multih... |
the-stack_0_13224 | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# 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 th... |
the-stack_0_13226 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The QQcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the rawtransaction RPCs.
Test the following RPCs:
- createrawtransaction
- signrawtransactio... |
the-stack_0_13229 | # pylint: disable=no-self-use,invalid-name
import numpy
from flaky import flaky
from deep_qa.models.reading_comprehension import BidirectionalAttentionFlow
from deep_qa.common.params import Params
from ...common.test_case import DeepQaTestCase
class TestBidirectionalAttentionFlow(DeepQaTestCase):
@flaky
def ... |
the-stack_0_13231 | # dataset settings
dataset_type = 'CityscapesDataset'
data_root = 'data/cityscapes/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
crop_size = (512, 1024)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type='Resize',... |
the-stack_0_13232 | import random
import altair
import matplotlib.pyplot as plt
import pandas as pd
from bokeh.plotting import figure as bokeh_figure
from vizno.report import Report
xs = [random.random() for _ in range(100)]
ys = [x + random.random() * 0.1 for x in xs]
f = plt.figure()
ax = f.add_subplot(111)
ax.plot(xs, ys, ".")
ax.s... |
the-stack_0_13234 | import datetime
from dateutil.parser import parse
from mongoengine import DateTimeField, FileField
from mongoengine.connection import DEFAULT_CONNECTION_NAME
from mongoengine.python_support import str_types
import StringIO
from django.conf import settings
if settings.FILE_DB == settings.S3:
import crits.core.s3_t... |
the-stack_0_13236 | """Contains domain batch classes.
"""
__author__ = 'Paul Landes'
from typing import Tuple, Type, Any
from dataclasses import dataclass, field
import copy as cp
from zensols.config import Settings
from zensols.persist import persisted
from zensols.deeplearn.batch import (
DataPoint,
Batch,
BatchStash,
... |
the-stack_0_13238 | """deCONZ sensor platform tests."""
from copy import deepcopy
from homeassistant.components.deconz.const import CONF_ALLOW_CLIP_SENSOR
from homeassistant.components.deconz.gateway import get_gateway_from_config_entry
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import (... |
the-stack_0_13239 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... |
the-stack_0_13241 | # Copyright 2020 Canonical 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 agreed to in writing, s... |
the-stack_0_13242 | # (c) Copyright [2018-2021] Micro Focus or one of its affiliates.
# 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 applicabl... |
the-stack_0_13244 | import argparse
import collections
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw, ImageEnhance
import albumentations as A
import albumentations.pytorch
from tqdm.notebook import tqdm
import cv2
import re
import time
from retinanet import model
# fr... |
the-stack_0_13245 | # Copyright 2019 Thai-Son Nguyen
# Licensed under the Apache License, Version 2.0 (the "License")
import random
import struct
import os
import numpy as np
import torch
from torch.nn.utils.rnn import pack_sequence
from . import smart_open
class ScpStreamReader(object):
def __init__(self, scp_path, label_path=N... |
the-stack_0_13246 | from importlib import import_module
from os import path, listdir
from string import lower
from debug import logger
import paths
class MsgBase(object):
def encode(self):
self.data = {"": lower(type(self).__name__)}
def constructObject(data):
whitelist = ["message"]
if data[""] not in whitelist:
... |
the-stack_0_13247 | from ..Qt import QtGui, QtCore, isQObjectAlive
from ..GraphicsScene import GraphicsScene
from ..Point import Point
from .. import functions as fn
import weakref
import operator
from ..util.lru_cache import LRUCache
class GraphicsItem(object):
"""
**Bases:** :class:`object`
Abstract class providing useful... |
the-stack_0_13248 | import pytest
from thedarn.rules.gradle_wrapper import match, get_new_command
from thedarn.types import Command
@pytest.fixture(autouse=True)
def exists(mocker):
return mocker.patch('thedarn.rules.gradle_wrapper.os.path.isfile',
return_value=True)
@pytest.mark.parametrize('command', [
... |
the-stack_0_13250 | import pygame
aktualnie_wyswietlane = [[0 for col in range(14)] for row in range(5)]
aktualna_podpowiedz = [[0 for col_ in range(14)] for row_ in range(5)]
class Kod(object):
def main(self, aktualny_kolor):
Kod.reset(self)
self.pos = pygame.mouse.get_pos()
if self.stop == 0:
... |
the-stack_0_13253 | import setuptools
#README as long_descriptions
with open("README.md", "r") as readme:
long_description = readme.read()
setuptools.setup(
name='automatedweb',
version='1.0.2',
url='https://github.com/renanleonellocastro/automatedweb.git',
license='MIT License',
author='Renan Leonello Castro',
... |
the-stack_0_13255 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
the-stack_0_13257 | import argparse
import collections
import json
import os
import re
import string
import sys
from copy import deepcopy
from bs4 import BeautifulSoup
class EvalOpts:
r"""
The options which the matrix evaluation process needs.
Arguments:
data_file (str): the SQuAD-style json file of the dataset... |
the-stack_0_13259 | import asyncio
from collections import defaultdict, deque
from collections.abc import Mapping, Set
from contextlib import suppress
from datetime import timedelta
from functools import partial
import inspect
import itertools
import json
import logging
import math
from numbers import Number
import operator
import os
impo... |
the-stack_0_13260 | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
the-stack_0_13262 | import asyncio
import logging
import os
import sys
from logging.handlers import RotatingFileHandler
import aioredis
from cacheout import Cache
from houdini import PenguinStringCompiler
from houdini.data import db
from houdini.data.permission import PermissionCollection
from houdini.penguin import Penguin
from houdini... |
the-stack_0_13264 | #!/bin/env python
#
# utils.py: utility functions for RnaChipIntegrator
# Copyright (C) University of Manchester 2011-15 Peter Briggs, Leo Zeef
# & Ian Donaldson
#
"""
utils.py
Utility functions for RnaChipIntegrator:
- make_errline: highlight problem fields in a string
- truncate_text: truncate a text st... |
the-stack_0_13268 | import pandas as pd
chrom_sizes = pd.Series(
{1: 249250621,
10: 135534747,
11: 135006516,
12: 133851895,
13: 115169878,
14: 107349540,
15: 102531392,
16: 90354753,
17: 81195210,
18: 78077248,
19: 59128983,
2: 243199373,
20: 63025520,
21: 48129895,
... |
the-stack_0_13269 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: GPL-3.0
#
# GNU Radio Python Flow Graph
# Title: NOAA APT Decoder
# Author: Manolis Surligas, George Vardakis
# Description: A NOAA APT Decoder with automatic image synchronization
# GNU Radio version: 3.8.1.0
from gnuradio import analog
from... |
the-stack_0_13273 | import collections
import functools
import glob
import ntpath
import os
import random
import re
import subprocess
import sys
import tempfile
from collections import Counter
from pathlib import Path
from urllib.request import Request, urlopen
import fastnumbers
import humanize
import numpy as np
import pandas as pd
imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.