id stringlengths 3 8 | content stringlengths 100 981k |
|---|---|
3247116 | import collections
from collections import defaultdict, OrderedDict
import dill
import json
from .abstract_test import load_test, read_pred_file
from .test_types import MFT, INV, DIR
from .viewer.suite_summarizer import SuiteSummarizer
class TestSuite:
def __init__(self, format_example_fn=None, print_fn... |
3247148 | import abc
from typing import List, Dict
import time
from spruned.application import exceptions
from spruned.application.logging_factory import Logger
class RPCAPIService(metaclass=abc.ABCMeta):
errors_ttl = 5
max_errors_before_downtime = 1
errors = []
client = None
throttling_error_codes = []
... |
3247185 | import FWCore.ParameterSet.Config as cms
process = cms.Process("SKIM")
process.configurationMetadata = cms.untracked.PSet(
version = cms.untracked.string('$Revision: 1.4 $'),
name = cms.untracked.string('$Source: /cvs/CMSSW/CMSSW/DPGAnalysis/Skims/python/ZeroBiasPDSkim_cfg.py,v $'),
annotation = cms.untra... |
3247195 | from __future__ import print_function
import sys
import os
import io
try:
from setuptools import setup, find_packages
from setuptools.command.install import install as _install
except ImportError:
from distutils.core import setup
from distutils.command.install import install as _install
def find... |
3247200 | from django.core.exceptions import PermissionDenied
from django_filters.views import FilterView
from django_tables2.views import SingleTableMixin
from guardian.mixins import LoginRequiredMixin
from service_catalog.filters.global_hook_filter import GlobalHookFilter
from service_catalog.models import GlobalHook
from ser... |
3247214 | import os
import argparse
# late import of alembic because it destroys loggers
def get_config(directory, x_arg=None, opts=None):
from alembic.config import Config as AlembicConfig
class Config(AlembicConfig):
def get_template_directory(self):
package_dir = os.path.abspath(os.path.dirname(_... |
3247216 | import unittest
from katas.kyu_7.every_archer_has_its_arrows import archers_ready
class ArchersReadyTestCase(unittest.TestCase):
def test_true(self):
self.assertTrue(archers_ready([5, 6, 7, 8]))
def test_false(self):
self.assertFalse(archers_ready([]))
def test_false_2(self):
se... |
3247246 | from src import view
from model.math import converter
class Converter:
def __init__(self):
self.model = converter.Converter()
def index(self):
template = view.lookup.get_template('math/unit_converter.mako')
model = converter.Converter()
distance = ""
pressure =... |
3247260 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class VGAE(nn.Module):
def __init__(self, adj, dim_in, dim_h, dim_z, gae):
super(VGAE,self).__init__()
self.dim_z = dim_z
self.gae = gae
self.base_gcn = GraphConvSparse(dim_in, dim_h, adj)
... |
3247263 | import os.path
from concurrent.futures import ProcessPoolExecutor as Pool
from pandaharvester.harvestercore.work_spec import WorkSpec
from pandaharvester.harvestercore.plugin_base import PluginBase
from pandaharvester.harvestercore import core_utils
# logger
baseLogger = core_utils.setup_logger('dummy_mcore_monitor')... |
3247291 | from homura import download
from .config_crawler import get_splash_uri, get_save_path
def get_screenshot(url, filename):
download(url=get_splash_uri(url),path=get_save_path(filename)) |
3247297 | import apysc as ap
from apysc._validation import color_validation
from tests import testing_helper
def test_validate_hex_color_code_format() -> None:
testing_helper.assert_raises(
expected_error_class=ValueError,
func_or_method=color_validation.validate_hex_color_code_format,
kwar... |
3247328 | from py3pin.Pinterest import Pinterest
username = "username"
password = "password!"
email = "email"
# cred_root is the place the user sessions and cookies will be stored you should specify this to avoid permission issues
cred_root = "cred_root"
pinterest = Pinterest(
email=email, password=password, username=user... |
3247335 | import torch
import torchvision
from torch.nn import Parameter
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class TDNN(nn.Module):
def __init__(self,feature_len):
super(TDNN, self).__init__()
self.h1 = nn.Conv1d(feature_len,512,5) #连续抽5帧
self.relu1 = nn.ReLU()
... |
3247365 | import numpy as np
import csv
import random
from PIL import Image
from wordcloud import WordCloud, STOPWORDS
from palettable.colorbrewer.sequential import Greens_9
def color_func(word, font_size, position, orientation, random_state=None, **kwargs):
return tuple(Greens_9.colors[random.randint(2,8)])
csv_path = "ye... |
3247395 | import io
import os
import platform
import subprocess
import zipfile
import pandas as pd
import requests
from powersimdata.network.usa_tamu.constants.zones import abv2state
def download_demand_data(
es=None, ta=None, fpath="", sz_path="C:/Program Files/7-Zip/7z.exe"
):
"""Downloads the NREL EFS base demand d... |
3247401 | import pandas as pd
from fuzzywuzzy import fuzz
from tqdm import tqdm
MATCH_PATH = "/data/full_prediction_check.csv"
RECORD_PATH = "/code/Step3Output.csv"
THRESHOLD = .78
eliminate_list = ['ribo', 'non', 'gene', 'acid']
def _remove_suspicious_matches(df_row):
for item in eliminate_list:
in_row1 = item in... |
3247411 | from __future__ import absolute_import, division, print_function
import numpy as np
import theano
import theano.tensor as T
class Optimizer(object):
def __init__(self, lr_init=1e-3):
self.lr = theano.shared(
np.asarray(lr_init, dtype=theano.config.floatX), borrow=True)
def set_learning_r... |
3247433 | import unittest
import tohil
from tohil import tclobj
class Test_td_iter(unittest.TestCase):
def test_td_iter1(self):
"""tohil.tcldict iterator """
t = tohil.tcldict("a 1 b 2 c 3 d 4 e 5 f 6")
self.assertEqual(list(t), ["a", "b", "c", "d", "e", "f"])
def test_td_iter2(self):
... |
3247438 | from django.test import TestCase
class StatusViewTest(TestCase):
def test_status_url_exists_at_desired_location(self):
response = self.client.get('/api/status/')
self.assertEqual(response.status_code, 200) |
3247447 | from abc import abstractmethod, ABC
import numpy as np
class Encoder(ABC):
"""Abstract Base Class for Encoders.
Attributes
----------
dataset_metadata : dict
Dataset-specific values and information.
classes : dict
Class/value pairs for dataset annotations.
class_ids : list
... |
3247469 | import logging
import os
import requests
import time
from flask import Flask, request, jsonify
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO)
logger = logging.getLogger(__name__)
sentry_... |
3247495 | EDGE = "101"
MIDDLE = "01010"
CODES = {
"L": (
"0001101",
"0011001",
"0010011",
"0111101",
"0100011",
"0110001",
"0101111",
"0111011",
"0110111",
"0001011",
),
"R": (
"1110010",
"1100110",
"1101100",
... |
3247501 | import pytest
import psycopg2
import os
# We run this test several times, and make sure that each one gets a clean
# database
@pytest.mark.parametrize("iteration", [1, 2])
def test_db_empty(heroku_style_pg, iteration):
with psycopg2.connect(os.environ["DATABASE_URL"]) as conn:
with conn.cursor() as cur:
... |
3247507 | import cv2
from SpaceXtract.general_extract import BaseExtract, RelativeExtract
import random
class Util():
def __init__(self, extractor: BaseExtract):
self.extractor = extractor
def search_switch(self, cap, key, thresh=0.5):
left = 0
right = cap.get(cv2.CAP_PROP_FRAME_COUNT) - 1
... |
3247517 | import sys
import os
parent_dir = os.path.dirname(os.path.realpath(__file__)) + "/../"
sys.path.append(parent_dir) # a bit of a hack, but it makes the import the same
from objects.file import File
def get_file_path(path):
return os.path.dirname(os.path.realpath(__file__)) + "/" + path
class TestFileMethods:
... |
3247537 | from contextlib import ExitStack as does_not_raise # noqa: N813
import numpy as np
import pandas as pd
import pytest
from sid.virus_strains import _factorize_boolean_infections
from sid.virus_strains import factorize_boolean_or_categorical_infections
from sid.virus_strains import factorize_categorical_infections
from... |
3247555 | from collections import namedtuple
from enum import IntEnum
from tests.shared import pack_values
Cost = namedtuple('Cost', 'resource_count bits packed_ids packed_amounts')
CostWithLords = namedtuple(
'Cost', 'resource_count bits packed_ids packed_amounts lords')
Troop = namedtuple('Troop', 'type tier agility attac... |
3247561 | import argparse
import json
import os
import shutil
import sys
import logging
import zipfile
import uuid
from zipfile import ZIP_DEFLATED
from urllib.parse import quote
parser = argparse.ArgumentParser("Take a directory of bdio files, copy and unzip each file,"
"update the project and ... |
3247596 | import torch
import torch.nn as nn
import torch.nn.functional as F
#from model.grad_reverse import grad_reverse
###############################################################################
#
# PhiGnetwork retuns u = phi(G(x)) where
#
# x = image
# z = G(x) = exactly Feature() in MCD-DA
# u = phi(z) = the la... |
3247617 | import h5py
import numpy as np
import yaml
import warnings
from os import path
class Parameters:
"""
==================================================================================
==================================================================================
>> @AUTHOR: <NAME>, Lanwrence L... |
3247626 | import os
import numpy as np
import tensorflow as tf
LOGGER = None
def init_logger(hparams):
global LOGGER
LOGGER = Logger(hparams)
def log_scalar(tag, value):
global LOGGER
LOGGER.log_scalar(tag, value)
def log_histogram(tag, values):
global LOGGER
LOGGER.log_histogram(tag, values)
def log_graph()... |
3247633 | import json
import os.path
import torch.utils.data
from glob import glob
from .spacenet6 import SpaceNet6Dataset, SpaceNet6TestDataset
from ..transforms import get_augmentation, get_preprocess
from ..utils import train_list_filename, val_list_filename
def get_dataloader(
config,
is_train
):
"""
"""
... |
3247729 | import os
from pathlib import Path
import logging
import click
import numpy as np
import pandas as pd
import SimpleITK as sitk
from src.resampling.utils import (get_np_volume_from_sitk,
get_sitk_volume_from_np)
# Default paths
path_in = 'data/hecktor_nii/'
path_out = 'data/bbox_nii/... |
3247734 | from numpy.lib.index_tricks import ndindex
from numpy.core.multiarray import normalize_axis_index
import cupy
__all__ = ["apply_along_axis"]
def apply_along_axis(func1d, axis, arr, *args, **kwargs):
"""
Apply a function to 1-D slices along the given axis.
Execute `func1d(a, *args, **kwargs)` where `func... |
3247768 | import random
import audiomate
from bench import resources
def run(source_corpus):
audiomate.Corpus.from_corpus(source_corpus)
def test_from_corpus(benchmark):
source_corpus = resources.generate_corpus(
200,
(5, 5),
(5, 5),
(4, 4),
(4, 4),
random.Random(x=23... |
3247798 | from __future__ import division
def length(vector):
return sum(x * x for x in vector) ** 0.5
def normalize(vector):
d = length(vector)
return tuple(x / d for x in vector)
def distance(p1, p2):
return sum((a - b) ** 2 for a, b in zip(p1, p2)) ** 0.5
def cross(v1, v2):
return (
v1[1] * v2[... |
3247914 | import json
from datetime import datetime
from fennel import models
from fennel.exceptions import JobNotFound
from fennel.job import Job
def get_status(app, uuid):
resp = app.client.hget(app.keys.status_prefix + f":{uuid}", "status")
if not resp:
raise JobNotFound(uuid)
return resp
def get_job(... |
3248002 | import base64
import io
from unittest.mock import patch
from PIL import Image
from remote.utilities.image import AvatarSize
from tests.fixture import TestFixture
from tests.test_app import TestBase
class TestImage(TestBase, TestFixture):
def test_images_info_api_doc(self):
response = self.client.get("/i... |
3248039 | from django.shortcuts import render
from django.shortcuts import redirect
from django.template import RequestContext
from .forms import CaseForm
from cases.models import Case
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django.shortcuts import get_object_or_404
fr... |
3248050 | def english_standard():
from .EnglishStandard import EnglishStandard
return EnglishStandard()
def english_cowboy():
from .EnglishCowboy import EnglishCowboy
return EnglishCowboy()
def spanish():
from .Spanish import Spanish
return Spanish()
|
3248084 | import logging
import gevent.monkey
def patch_opencensus(event):
# Switch from the default runtime context using ContextVar to one
# using thread locals. Needed until gevent supports ContextVar.
# See https://github.com/gevent/gevent/issues/1407
import opencensus.common.runtime_context as runtime_con... |
3248101 | import unittest
class TestMatrixMultiplicationCost(unittest.TestCase):
def test_find_min_cost(self):
matrix_mult_cost = MatrixMultiplicationCost()
self.assertRaises(TypeError, matrix_mult_cost.find_min_cost, None)
self.assertEqual(matrix_mult_cost.find_min_cost([]), 0)
matrices = ... |
3248118 | import contextlib
import copy
import inspect
# import json
import jsonschema
import tempfile
import os
# import re
import shutil
import sys
import time
import uuid
from celery import Task, registry
from celery.app.task import TaskType
from django.conf import settings as rodan_settings
from django.core.files import F... |
3248127 | import os, glob
import configargparse
import traceback
import logging
import numpy as np
import youtube_dl
import itertools
from multiprocessing import Pool
def read_txt(file_list):
vid_data = []
for file in file_list:
with open(file) as f:
data = f.read().split("\n")
url = da... |
3248217 | import argparse
import pathlib
import h5py
from tqdm import tqdm
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="VR state saving and replay demo")
parser.add_argument("--input", required=True, type=str, help="Input file to convert to time ordered hdf5")
parser.add_argument("--outp... |
3248233 | a = int(input('Digite um numero: '))
b = int(input('Digite outro numero: '))
c = a - b
if c > 0:
print(f'O numero {c} é maior que Zero')
#https://pt.stackoverflow.com/q/414121/101
|
3248241 | import json, cgi, os, sys, requests, hashlib, time, tempfile, time, timeit
from pymongo import *
from urllib import *
import urllib
from datetime import datetime, timedelta
from libs.contents.contents import *
from core.core import *
# from core.lang import *
# avpath = ''
avpath = '/home/user/workspace/2/avconv/... |
3248249 | from penaltymodel.maxgap.generation import *
from penaltymodel.maxgap.interface import *
from penaltymodel.maxgap.package_info import *
|
3248284 | from . import select
from . import utils
from scipy import sparse
import numpy as np
import pandas as pd
import scipy.signal
def library_size(data):
"""Measure the library size of each cell.
Parameters
----------
data : array-like, shape=[n_samples, n_features]
Input data
Returns
--... |
3248290 | from ..abc.sink import Sink
class UnitTestSink(Sink):
def __init__(self, app, pipeline, id=None, config=None):
super().__init__(app, pipeline, id=id, config=config)
self.Output = []
def process(self, context, event):
self.Output.append((context, event))
|
3248299 | import tensorflow as tf
import tensorflow.keras.layers as layers
from tensorflow.keras.layers import Dense, Conv2D, BatchNormalization, Flatten, Dropout
from tensorflow.keras import Model
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
class Sampling(layers.Layer):
def call(self, inputs):
z_mean, z_sig... |
3248401 | from collections import deque
from ParadoxTrading.Indicator.IndicatorAbstract import IndicatorAbstract
from ParadoxTrading.Utils import DataStruct
class Plunge(IndicatorAbstract):
def __init__(
self,
_fast_ema_period: int = 50,
_slow_ema_period: int = 100,
_atr_per... |
3248409 | import math
import threading
import time
import mido
import numpy as np
from modules.midiplayer import instruments_map, drum_set, mcsparser
from static import ref_strings
from modules.__init__ import Command, FileIOModule
from utils import downloader, message_utils
palette = 'ca1edb62574398ff'
insts = [
'note.h... |
3248447 | import pygame
from game import Game
import constants as c
import socket
import time
import pickle
from sprite import Sprite
import threading
def network_data_handle():
""" The method handles the in/out data when playing over a network or internet
It is used as a thread to decouple the pygame loop from t... |
3248454 | from core.advbase import *
class Harle(Adv):
comment = "no counter on s1"
def prerun(self):
self.s2_debuff = Debuff("crit_vuln", 0.5, 60, mtype="dummy").no_bufftime()
Modifier("ravens_vengeance", "crit", "chance", 0.5, get=self.s2_debuff.get).on()
self.team_evasion = 0
def s2_pro... |
3248477 | import torch.nn as nn
import torch.nn.functional as F
from .ppm import PPM
from ..base import BaseModel
from ..encoders import get_encoder
class PSPNet(BaseModel):
def __init__(self,
encoder_name='resnet50',
encoder_weights='imagenet',
bins=(1, 2, 3, 6),
... |
3248493 | import torch.nn as nn
class IdentityLayer(nn.Module):
def __init__(self):
super().__init__()
def forward(self, source):
return source |
3248515 | import socket
from .thread import SocketThread
class ListenThread(SocketThread):
def before_actions(self):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.sock.bind(('', 5342))
s... |
3248518 | from flask import Flask
from flask import request
from up2down_model.up2down_model import up2down
app = Flask(__name__)
@app.route('/',methods=['GET'])
def get_couplet_down():
couplet_up = request.args.get('upper','')
couplet_down = up2down.get_down_couplet([couplet_up])
return couplet_up + "," + coupl... |
3248554 | from django.contrib.flatpages.models import FlatPage
from django.core.exceptions import ValidationError
from django.test import TestCase, override_settings
from django.utils.translation import activate
from oscar.core.validators import (
ExtendedURLValidator, URLDoesNotExistValidator)
class TestExtendedURLValida... |
3248580 | import math
from compas.geometry import Point
from compas.geometry import Quaternion
from compas.geometry import Rotation
from compas.geometry import Transformation
from compas.geometry import Translation
# transform with identity matrix
x = Transformation()
a = Point(1, 0, 0)
b = a.transformed(x)
assert a == b
# tr... |
3248612 | from pure_pagination.paginator import Paginator, EmptyPage, InvalidPage, PageNotAnInteger
from pure_pagination.mixins import PaginationMixin
|
3248624 | from chainercv.links.model.resnet.resblock import Bottleneck # NOQA
from chainercv.links.model.resnet.resblock import ResBlock # NOQA
from chainercv.links.model.resnet.resnet import ResNet # NOQA
from chainercv.links.model.resnet.resnet import ResNet101 # NOQA
from chainercv.links.model.resnet.resnet import ResNet1... |
3248645 | import chars2vec
dim = 50
path_to_model = 'path/to/model/directory'
X_train = [('mecbanizing', 'mechanizing'), # similar words, target is equal 0
('dicovery', 'dis7overy'), # similar words, target is equal 0
('prot$oplasmatic', 'prtoplasmatic'), # similar words, target is equal 0
('... |
3248658 | from gevent import spawn, monkey, sleep, socket
monkey.patch_all()
import pytest # noqa
zk_address = ('localhost', 2181)
zk_url = '%s:%s' % zk_address
class TestFailover():
@classmethod
def setup_class(cls):
cls.instances = {}
@classmethod
def teardown_class(cls):
for instance in c... |
3248691 | import unittest
class TestListMain(unittest.TestCase):
def test_imports(self):
try:
from dreamcoder.domains.list.main import (
retrieveJSONTasks,
list_features,
isListFunction,
isIntFunction,
train_necessary,
... |
3248742 | from __future__ import annotations
from typing import ClassVar, Dict
from ..exceptions import InvalidIntent
class Intents:
VALID_INTENTS: ClassVar[Dict[str, int]] = {
"guilds": 0,
"members": 1,
"bans": 2,
"emojis": 3,
"integrations": 4,
"webhooks": 5,
"in... |
3248774 | from keras.layers import Embedding, Dense, LSTM
from keras.models import Sequential
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import numpy as np
from sklearn.metrics import confusion_matrix
import pandas as pd
# get dataset
data = pd.read_csv('./spam_dataset.... |
3248783 | import re
from random import randint
from typing import Match
from typing import Optional
from retrying import retry
import apysc as ap
from apysc._display.stage import get_stage_variable_name
from apysc._expression import expression_data_util
class TestCircle:
@retry(stop_max_attempt_number=15, ... |
3248805 | from collections import namedtuple
CurrySpec = namedtuple("CurrySpec", "arg_names arg_defaults")
ArgValues = namedtuple("ArgValues", "args kwargs")
def num_args(arg_values):
return len(arg_values.args) + len(arg_values.kwargs)
def num_positional_args(arg_values):
return len(arg_values.args)
def num_curry... |
3248820 | from torch.utils.data import Dataset
import torch
import pickle
import os
import numpy as np
class TSP(object):
NAME = 'tsp' # Travelling Salesman Problem
def __init__(self, p_size, init_val_met = 'greedy', with_assert = False, step_method = '2_opt', P = 10, DUMMY_RATE = 0):
self.size =... |
3248834 | current_var_num = 0
current_block_num = 0
def get_temp_var_name():
"""
获取一个新的临时变量名
:return: 临时变量名
"""
global current_var_num
name = '_v' + str(current_var_num)
current_var_num += 1
return name
def get_temp_block_name():
"""
获取一个新的代码块名
:return: 代码块名
"""
global curr... |
3248850 | from .infrastructure import DockerUtils, GlobalConfiguration, Logger
from container_utils import ContainerUtils, ImageUtils
import docker, os, platform, sys
def test():
# Create our logger to generate coloured output on stderr
logger = Logger(prefix="[{} test] ".format(sys.argv[0]))
# Create our Docker ... |
3248867 | from flask import Blueprint
question = Blueprint('question', __name__)
from . import views # noqa
|
3248878 | from termcolor import colored
import time
from src.feed_dicts import *
import sys
def export_predictions(sess, model, FLAGS, positive_test_batcher, negative_test_batcher,
string_int_maps, out_file, threshold_map=None):
'''
export hard decisions based on thresholds
'''
print('Eval... |
3248897 | import argparse
def options():
parser = argparse.ArgumentParser()
parser.add_argument('--datapath', type=str, default='/sequoia/data2/teboli/irc_nonblind/data/training_uniform')
parser.add_argument('--n_in', type=int, default=2, help='CPCR iterations; S in the paper.')
parser.add_argument('--n_out', t... |
3248906 | import pytest
from faker import Faker
from jina import Document, DocumentArray, DocumentArrayMemmap
from .pages import Pages
from .utils.benchmark import benchmark_time
fake = Faker()
Faker.seed(42)
NUM_DOCS = 10000
@pytest.fixture
def docs():
return [Document(text=fake.text()) for _ in range(NUM_DOCS)]
def t... |
3248919 | from django.test import TestCase
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from contextlib import contextmanager
import importlib
import datetime
CANVAS_OAUTH_SETTINGS_MODULE_NAME = "canvas_oauth.settings"
@contextmanager
def required_oauth_settings(oauth_settings={}):... |
3248953 | import sys
def get_max_chain_length(ls, c=None):
l = 0
for i, s1 in enumerate(ls):
if not c or s1[0] == c:
l = max(
l,
get_max_chain_length([s2 for j, s2 in enumerate(ls) if i != j], s1[-1]),
)
return l + 1 if c else l if l > 1 else None
te... |
3248959 | import os
import socket
import os
from flask import Flask, request
#https://docs.aws.amazon.com/xray-sdk-for-python/latest/reference/basic.html
# #Lets try to use AWS X-ray for metrics / logging if available to us
try:
from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core import patch_all
from... |
3248965 | import nltk
sent = nltk.data.load('grammars/large_grammars/atis_sentences.txt')
sent = nltk.parse.util.extract_test_sentences(sent)
print(len(sent))
testingsent=sent[25]
print(testingsent[1])
print(testingsent[0])
sent=testingsent[0]
|
3248985 | from dateutil.rrule import *
from prometheus_client import Histogram
from company_jira import jira
from util import *
from jira_util import *
PROJECT_TIME_HISTOGRAM = Histogram(
'project_time_days',
'Lead time in days.',
['project', 'metric'],
buckets=[
0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12,... |
3248990 | import base64
from ....text.textstyle import TextStyle
from ....utils.geom import Rect, find_centroid
from .utils import apply_rotation
def set_font_from_style(xml, style):
if style.font is not None:
xml.set("font-family", style.font)
if style.size is not None:
xml.set("font-size", style.size... |
3249048 | import glob
import os
import csv
import random
""" Takes in orientation noise values (x,y,z) from txt file and splits into train and test sets """
# Create train and test output files
train_coords_dir = "./train_noise"
if not os.path.isdir(train_coords_dir):
os.mkdir(train_coords_dir)
test_coords_dir = "./test_noi... |
3249062 | from .utils import *
from .evaluator import *
from .sampling import *
from .graph_utils import *
from .spmm_utils import *
from .transform import *
|
3249100 | import logging
import secrets
from collections import OrderedDict
from typing import MutableMapping, cast
import attr
from homeassistant.core import (callback, HomeAssistant)
from homeassistant.loader import bind_hass
from homeassistant.const import (
ATTR_NAME,
CONF_CONDITIONS,
)
from . import... |
3249128 | import matplotlib.pyplot as plt
import numpy as np
from turorials.perlin_noise.open_simplex import generate_noise_map
# DIM = (8, 8)
DIM = (16, 16)
# DIM = (32, 32)
# FILL_RATIO = 0.30
FILL_RATIO = 0.35
# FILL_RATIO = 0.40
BOUNDARY_SIZE = 1
# NB_SMOOTHING = 2
NB_SMOOTHING = 2
# NB_SMOOTHING = 3
SMOOTH_SIZE = 1
RU... |
3249143 | from allauth.account.forms import SignupForm, ChangePasswordForm as BaseChangePasswordForm
from allauth.utils import set_form_field_order
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.core.exceptions import ValidationError
from django.utils.translation impor... |
3249156 | from drdown.medicalrecords.models.model_risk import Risk
from django import forms
class RiskForm(forms.ModelForm):
class Meta:
model = Risk
fields = ["priority_speech_theraphy", "priority_psychology",
"priority_physiotherapy", "priority_cardiology",
"priority_n... |
3249165 | import argparse
from compat import stdin, stdout
def parse_argv():
parser = argparse.ArgumentParser('wrap input lines of width of WIDTH')
parser.add_argument('-w', '--width', type=int, required=True)
return parser.parse_args()
def flush(buf):
stdout.write(b''.join(buf + [b'\n']))
def main():
... |
3249200 | import math
import lab.torch as B
__all__ = ["Discretisation1d"]
class Discretisation1d:
def __init__(self, points_per_unit, multiple, margin):
self.points_per_unit = points_per_unit
self.resolution = 1 / self.points_per_unit
self.multiple = multiple
self.margin = margin
def... |
3249203 | from __future__ import print_function
def handler(event, context):
print(event)
return True
|
3249263 | from __future__ import absolute_import
from django.utils.translation import ugettext as _
from ajax.compat import getLogger
from django.http import Http404
from django.conf import settings
from decorator import decorator
from ajax.exceptions import AJAXError, PrimaryKeyMissing
from functools import wraps
from django.ut... |
3249332 | import pytest
import numpy as np
import pandas as pd
import numpy.testing as npt
import pandas.testing as pdt
from scipy.stats import logistic
import zepid as ze
from zepid import (RiskRatio, RiskDifference, OddsRatio, NNT, IncidenceRateRatio, IncidenceRateDifference,
Sensitivity, Specificity, Diagn... |
3249340 | from typing import Optional
from ..exception import DataTypeException
from ..utils.typing.conversion import object_to_str
"""Generator for transaction data"""
def generate_data_value(transaction) -> Optional[dict]:
"""
Generates data value in transaction from the other data like content_type, content, metho... |
3249351 | from TOSSIM import *
from tinyos.tossim.TossimApp import *
from random import *
import sys
#n = NescApp("TestNetwork", "app.xml")
#t = Tossim(n.variables.variables())
t = Tossim([])
r = t.radio()
f = open("sparse-grid.txt", "r")
lines = f.readlines()
for line in lines:
s = line.split()
if (len(s) > 0):
if s[0... |
3249359 | import FWCore.ParameterSet.Config as cms
calibration = cms.VPSet(
cms.PSet(
etaMax = cms.double(0.435),
etaMin = cms.double(0),
l1tCalibrationFactors = cms.vdouble(
1.26146717329, 1.26146717329, 1.26146717329, 1.26146717329, 1.26146717329,
1.26146717329, 1.2614671732... |
3249390 | from django.urls import reverse, resolve
from tethys_sdk.testing import TethysTestCase
class TestTethysServicesUrls(TethysTestCase):
def set_up(self):
pass
def tear_down(self):
pass
def test_service_urls_wps_services(self):
url = reverse('services:wps_service', kwargs={'service'... |
3249429 | from distutils.core import setup
setup(
name='django-query-parameters',
version='0.2.3',
author='<NAME>',
author_email='<EMAIL>',
packages=['query_parameters','query_parameters.templatetags'],
scripts=[],
url='https://github.com/jskopek/django-query-parameters',
license='LICENSE',
d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.