id stringlengths 3 8 | content stringlengths 100 981k |
|---|---|
3208364 | import discord
from discord.ext import commands
import database as db
import variables as var
from functions import get_prefix
def has_command_permission():
async def predicate(ctx: commands.Context):
plugin_name = ctx.cog.__cog_name__
cmd_name = ctx.command.name
guild_doc = await db.PERMI... |
3208370 | import pyOcean_cpu as ocean
import sys
def exceptionMsg() :
print("Expected error: %s" % str(sys.exc_info()[1]))
def failTest(command) :
try :
eval(command)
except :
exceptionMsg()
a = ocean.double(2)
print(a)
print(-a)
a = ocean.half(2)
print(a)
print(-a)
a = ocean.cdouble(1+2j)
print(-a)
a... |
3208430 | import base64
import binascii
import io
import tempfile
import flask
import google.cloud.storage as gcloud_storage
import google.cloud.exceptions as gcloud_exceptions
from werkzeug.contrib.cache import FileSystemCache
from .. import config, model, util
from .blueprint import coordinator_api
# Cache the worker blo... |
3208438 | import os
import sys
import shutil
import platform
import subprocess
import secrets
import click
import jinja2
from . import __version__
src = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'skeleton')
jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader(os.path.dirname(os.path.abspath(__file__)))... |
3208548 | from pathlib import (
Path,
)
BASE_PATH = Path(__file__).parent
CONFIG_FILE_PATH = BASE_PATH / "test_config.yml"
|
3208584 | from setuptools import setup
README_FILE = "README.md"
VERSION_FILE = "nalcos/_version.py"
with open(README_FILE, "r", encoding="utf-8") as f:
long_description = f.read()
exec(open(VERSION_FILE).read())
setup(
name="nalcos", # This is the name of the package
version=__version__, # The initial release ... |
3208587 | from .symbol import symbol
from .portfolio import portfolio
from .fund import fund
from .position import position
from .symbol_vendor import symbol_vendor
|
3208624 | from __future__ import print_function
import os
import json
import glob
import torch
import numpy as np
import torchvision.transforms as transforms
import torch.utils.data as data
import random
import h5py
class ShapeNetLoader(data.Dataset):
def __init__(self, data_dump_folder, indim=2, freeze_data=False, id=Non... |
3208626 | import os
import sys
import json
from .codecs import *
from collections import OrderedDict
class BaseEmoji:
def __init__(self):
self.emoji_file = '{}/data/emojis.json'.format(os.path.dirname(__file__))
self.all_emojis = self.load_emojis(self.emoji_file)
def load_emojis(self, file):
w... |
3208648 | import sys
sys.path.append("../../")
from appJar import gui
app = gui()
app.startLabelFrame("lf1", hideTitle=True)
app.addLabel("l1", "In the frame")
app.stopLabelFrame()
with app.labelFrame("lf2", hideTitle=True):
app.addLabel("l2", "In the frame")
app.go()
|
3208653 | import logging
import re
import glob
import codecs
import os
from io import StringIO
from optparse import make_option
from collections import ChainMap
import yaml, yaml.parser
import markdown
from django.db.models.fields.related import RelatedField
from django.core.management.base import BaseCommand, CommandError
fro... |
3208654 | import signal
import sys
import time
import os
from artemis.config import get_artemis_config_value
from artemis.remote.child_processes import PythonChildProcess, RemotePythonProcess
from artemis.remote.remote_execution import ParamikoPrintThread, execute_command
from artemis.remote.utils import get_local_ips, get_rem... |
3208668 | from collections import OrderedDict
import itertools
import sys
from tensorflow.keras.layers import Input
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.callbacks import TerminateOnNaN
from flowket.callbacks.monte_carlo import TensorBoardWithGeneratorValid... |
3208670 | from typing import List, Optional
from sqlalchemy.orm.session import Session
from src.challenges.challenge import (
ChallengeManager,
ChallengeUpdater,
FullEventMetadata,
UserChallenge,
)
class MobileInstallChallengeUpdater(ChallengeUpdater):
def update_user_challenges(
self,
sess... |
3208672 | from zorro.di import di, has_dependencies, dependency
from cairo import SolidPattern
import cairo
from .base import Widget
from tilenol.commands import CommandDispatcher
from tilenol.theme import Theme
from tilenol.ewmh import get_title
@has_dependencies
class Title(Widget):
dispatcher = dependency(CommandDispa... |
3208674 | import math
from pathlib import Path
from typing import Tuple
import moderngl
import moderngl_window as mglw
from moderngl_window import geometry
from moderngl_window.scene.camera import KeyboardCamera
import numpy as np
from pyrr import Matrix44
class Object:
def __init__(self) -> None:
self._scale =... |
3208691 | from sys import argv
samFile = open(argv[1], 'r')
outputFile = open(argv[2] + '.acpb', 'w')
#Process each line in the sam file
output = ""
for line in samFile.readlines():
#If the line does not begin with an @, i.e. the line contains an alignment, then process the line
lineDict = {}
if line[0] != '@':
componen... |
3208706 | import attr
from bokeh.models import VArea
from bokeh.models.sources import DataSource
from typing import List, Tuple, Type, cast
from jira_analysis.cycle_time.cycle_time import CycleTime
from jira_analysis.cycle_time.stats import (
rolling_average_cycle_time,
standard_deviations,
)
from jira_analysis.chart.b... |
3208714 | from .resnet import *
from .resnetDebug import *
from .resnet_var import *
from .resnet_var_ONI import *
from .vgg import *
from .vgg_ONI import *
|
3208735 | import unreal_engine as ue
from unreal_engine.classes import Object, Blueprint
levels = []
level_packages = []
# get all loaded worlds
for world in ue.all_worlds():
# retrieve the world levels (first persistent then streaming)
levels.append(world.PersistentLevel)
level_packages.append(world.PersistentLeve... |
3208773 | import pytest
import os
import sys
from subprocess import PIPE, Popen
from ensenso_nxlib.item import NxLibItem
from ensenso_nxlib.constants import *
from tests.remoteapi_test_helper import tcp_port, host_name
import time
import ensenso_nxlib.api as nxlib_remote
CURRENT_DIR = os.path.dirname(os.path.realpath(__file_... |
3208784 | import uuid
from stix2 import utils
from .constants import FAKE_TIME
def test_clock(clock):
assert utils.STIXdatetime.now() == FAKE_TIME
def test_my_uuid4_fixture(uuid4):
assert uuid.uuid4() == "00000000-0000-4000-8000-000000000001"
assert uuid.uuid4() == "00000000-0000-4000-8000-000000000002"
ass... |
3208788 | del_items(0x800A4EB4)
SetType(0x800A4EB4, "char StrDate[12]")
del_items(0x800A4EC0)
SetType(0x800A4EC0, "char StrTime[9]")
del_items(0x800A4ECC)
SetType(0x800A4ECC, "char *Words[118]")
del_items(0x800A50A4)
SetType(0x800A50A4, "struct MONTH_DAYS MonDays[12]")
|
3208803 | import os, sys
import numpy as np
here = os.path.abspath(os.path.dirname(__file__))
CODE_SUB_DIR = os.path.abspath(os.path.join(here, "..", ".."))
print(CODE_SUB_DIR)
sys.path.append(CODE_SUB_DIR)
from at_speech import SLLRLiblinear, SLLRSag, ThinResnet34Classifier
from at_speech.data_space.raw_data_space import Raw... |
3208804 | from imagedt.decorator import time_cost
import cv2 as cv
def brg2rgb(image):
(r, g, b) = cv.split(image)
return cv.merge([b, g, r])
def orb_detect(image_source, image_aim):
orb = cv.ORB_create()
kp1, des1 = orb.detectAndCompute(image_source, None)
kp2, des2 = orb.detectAndCompute(image_aim, Non... |
3208815 | from flask_restx import Namespace
ns_conf = Namespace('predictors', description='Predictor is the main object exposed by the API')
|
3208822 | class Solution(object):
def anagramMappings(self, A, B):
"""
:type A: List[int]
:type B: List[int]
:rtype: List[int]
"""
val_index = {}
ans = []
for i, n in enumerate(B):
val_index[n] = i
for n in A:
ans.append(val_index... |
3208830 | from awxkit.api import pages, client, resources # NOQA
from awxkit.config import config # NOQA
from awxkit import awx # NOQA
from awxkit.ws import WSClient # NOQA
|
3208847 | import ctypes
import os
from typing import List, Dict, Union
import numpy as np
from jinja2 import Template
from deep500.lv0.operators.cmake_wrapper import cmake, try_mkdirs
from deep500.lv0.operators.op_compiler import CompilableOp
from deep500.utils.tensor_desc import TensorDescriptor
from deep500.lv0.operators.ope... |
3208863 | from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
import os
import json
from bs4 import BeautifulSoup
import requests
import re
import datetime
from mp.models import Config
def get_one(request):
myconfig = Config.objects.all().first()
if myconfig.apichange:
res = re... |
3208893 | import benchmarkstt.docblock as docblock
from textwrap import dedent
import pytest
def test_text():
txt = " \t \t\n\n\t "
assert docblock.process_rst(txt, 'text') == ''
txt = '''
.. code-block:: text
Some block
In samem block
Still included
Not anymore
'''
print(... |
3208903 | import nose.tools as nt
from topik.fileio.in_json import read_json_stream, read_large_json, __is_iterable
from topik.fileio.tests import test_data_path
from ._solutions import solution_json_stream, solution_large_json
def test_read_document_json_stream():
documents = read_json_stream('{}/test_data_json_stream.jso... |
3208933 | from pulumi import export
import pulumi_keycloak as keycloak
realm = keycloak.Realm("new-python-realm",
realm="my-example-python-realm"
)
export("realm_id", realm.id)
|
3208967 | import oneflow as flow
from flowvision.utils.metrics import accuracy
from flowvision.models.alexnet import alexnet
def test_acc(preds, target):
return accuracy(preds, target, topk=(1, 5))
if __name__ == "__main__":
target = flow.arange(0, 16)
sample = flow.randn(16, 3, 224, 224)
model = alexnet()
... |
3209068 | import ast
import operator
from peval.tools import Dispatcher, immutableadict, ast_equal, replace_fields
from peval.core.gensym import GenSym
from peval.core.reify import KnownValue, is_known_value, reify
from peval.wisdom import is_pure, get_signature
from peval.core.callable import inspect_callable
from peval.tools ... |
3209072 | import sys
# Adapted for numpy/ma/cdms2 by convertcdms.py
#
# Test Colormap (Cp) module
#
############################################################################
# #
# Module: testcolormap module #... |
3209073 | import unittest
from geoscript.index import STRtree, QuadTree
from geoscript.geom import Bounds, Point
class IndexTest(unittest.TestCase):
def testQuadTree(self):
index = QuadTree()
index.insert(Bounds(0,0,10,10), Point(5,5))
index.insert(Bounds(2,2,6,6), Point(4,4))
index.insert(... |
3209087 | import unittest
import unittest.mock as mock
class TestSpeechLibrary(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
@mock.patch("zmq_integration_lib.zmq")
def test_speech_manager(self, mock_zmq):
pass
|
3209088 | import unittest
import warnings # for suppressing numpy.array PendingDeprecationWarning's
from importlib import reload
import sys
sys.path.append("..")
import numpy as np
import sympy as sp
import Ch6.utilities as ch6_utils
import Ch7.utilities as ch7_utils
reload(ch7_utils)
import control
def fullOrderCompensator(A,... |
3209111 | import os
from os import listdir
from os.path import isfile, join
import numpy as np
import skimage
import skimage.io as io
from PIL import Image
import matplotlib.pyplot as plt
lfsize = [372, 540, 8, 8]
def normalize_lf(lf):
return 2.0*(lf-0.5)
def denormalize_lf(lf):
return lf/2.0+0.5
def read_eslf(filena... |
3209172 | import numpy as np
from ..core.utils import indices_len, fix_loc, filter_cols
from ..table.module import TableModule
from ..table.table import Table
import numexpr as ne
def make_local(df, px):
arr = df.to_array()
result = {}
class _Aux: pass
aux = _Aux()
for i, n in enumerate(df.columns):
... |
3209175 | import os
import os.path
from subprocess import Popen, PIPE
import h5py
import numpy as np
import pytopkapi
def show_banner(ini_file, nb_cell, nb_time_step):
"""Show an ASCII banner at run time describing the model.
Parameters
----------
ini_file : str
The name of the PyTOPKAPI initializatio... |
3209181 | import pytest
from cayennelpp.lpp_type import LppType
@pytest.fixture
def baro():
return LppType.get_lpp_type(115)
def test_barometer(baro):
val = (1234.5,)
baro_buf = baro.encode(val)
assert baro.decode(baro_buf) == val
def test_barometer_negative_val(baro):
with pytest.raises(Exception):
... |
3209195 | from django.contrib.auth.models import User
from django.db import models
class Category(models.Model):
name = models.CharField(max_length=30)
user = models.ForeignKey(User, on_delete=models.CASCADE)
def __str__(self):
return self.name
class Product(models.Model):
name = models.CharField(max... |
3209270 | WEATHER = [
"rainy",
"thunderstorms",
"sunny",
"dusk",
"dawn",
"night",
"snowy",
"hazy rain",
"windy",
"partly cloudy",
"overcast",
"cloudy",
]
|
3209293 | with open('essay.txt', 'r') as fi, open('essay_formatted.txt', 'w') as fo:
lines = fi.readlines()
for line in lines:
if line.strip() != '':
fo.write(line.strip())
fo.write('\n') |
3209318 | import os
import shutil
from utilities.file_handler import save_pkl
models_dir = './bot_model'
def reset_botmodel():
if not os.path.exists(models_dir):
os.mkdir(models_dir)
else:
print("> Reset Model")
shutil.rmtree(models_dir)
os.mkdir(models_dir)
return
# save bot met... |
3209321 | import sys
import nbformat as nbf
filename = sys.argv[1]
print('Clearing cells from', filename)
ntbk = nbf.read(filename, nbf.NO_CONVERT)
for cell in ntbk.cells:
# if a cell has a remove-cell tag, remove the source and outputs
cell_tags = cell.get('metadata', {}).get('tags', [])
#print(cell_tags)
if ... |
3209326 | import argparse
sup_train=False
MAX_POS = 10
MAX_N_POSS_TEST = 100
MAX_N_POSS_TRAIN = 100
N_NEGS = 10
SAMPLE_NEGS = True
TYPE_OPT = 'mean'
parser = argparse.ArgumentParser()
parser.add_argument("--mode", type=str, help="train or eval", default='train')
parser.add_argument("--model_path", type=str, help="model path t... |
3209331 | import os
import math
import random
import numpy as np
import tensorflow as tf
import cv2
slim = tf.contrib.slim
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import sys
sys.path.append('../')
from nets import ssd_vgg_300, ssd_common
from preprocessing import ssd_vgg_preprocessing
import visualiza... |
3209349 | from collections import OrderedDict
from MDRSREID.Loss_Meter.ID_loss import IDLoss
from MDRSREID.Loss_Meter.ID_smooth_loss import IDSmoothLoss
from MDRSREID.Loss_Meter.triplet_loss import TripletLoss
from MDRSREID.Loss_Meter.triplet_loss import TripletHardLoss
from MDRSREID.Loss_Meter.permutation_loss import Permutatio... |
3209375 | from __future__ import division, print_function
import theano
from theano import tensor as T
from theano.tensor import signal
from theano.tensor.signal import pool
import numpy as np
import sys
def run_function_in_batches(func,
input_data_list,
learning_phase=No... |
3209416 | import sys
import os
import time
from signal import SIGTERM
class Daemon:
def __init__(self, stdout='/dev/null', stderr=None, stdin='/dev/null'):
self.stdout = stdout
self.stderr = stderr
self.stdin = stdin
self.startmsg = 'started with pid {}'
def deamonize(self, pidfile=None... |
3209426 | import math
import numpy as np
import os
import pandas as pd
import pickle
from decimal import Decimal
from itertools import accumulate, tee, chain
from typing import List, Tuple, Dict, Optional, Any, Set
from utils.plyfile import load_ply
READERS = {
'.ply': load_ply,
'.np': lambda file_path: pickle.load(op... |
3209518 | from Instrucciones.Sql_create.Tipo_Constraint import Tipo_Constraint, Tipo_Dato_Constraint
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Declaracion import Declaracion
from Instrucciones.TablaSimbolos.Tabla import Tabla
from Instrucciones.Excepcion import Excepcion
from Instruccione... |
3209552 | from django.conf import settings
def get_allowed_file_types(request=None):
try:
from constance import config
str_types = config.UPLOAD_FORM_ALLOWED_FILE_TYPES
except:
str_types = getattr(
settings,
'UPLOAD_FORM_ALLOWED_FILE_TYPES',
".jpg .jpeg .png .... |
3209584 | from abc import ABC, abstractmethod
from copy import deepcopy, copy
from typing import Tuple, Optional, Callable, Sequence
import numpy as np
from scipy.interpolate import interpn
from scipy.stats import multivariate_normal, beta
from pararealml.core.constrained_problem import ConstrainedProblem
from pararealml.core.... |
3209594 | import numpy as np
from sklearn import preprocessing
data = np.array([[3, -1.5, 2, -5.4], [0, 4, -0.3, 2.1], [1, 3.3, -1.9, -4.3]])
print(data)
#Mean removal
print("Mean: ",data.mean(axis=0))
print("Standard Deviation: ",data.std(axis=0))
data_standardized = preprocessing.scale(data)
print("Mean standardized d... |
3209623 | import threading
import time
from contextlib import contextmanager
class LockManager:
locks = {}
def get(self, key):
thread_id = threading.get_ident()
while self.locks.get(key) not in [None, thread_id, None]:
time.sleep(1)
self.locks[key] = thread_id
def release(self,... |
3209672 | import asyncio
import pathlib
import ssl
import websockets
import logging
import price
import parser_message
logging.basicConfig(filename='realtime.txt',level=logging.INFO)
stock_ids_hnx = open("StockIDs/HNX.txt", "r")
stock_ids_hsx = open("StockIDs/HSX.txt", "r")
stock_ids_upc = open("StockIDs/UPC.txt", "r")
list_id_... |
3209678 | import unittest
from pathlib import Path
from typing import List
import numpy as np
from PIL import Image, ImageFont
from resources.fonts import DemoFontPaths
from test.utils import demo_training_parameters, demo_picture_parameters
from text_depixelizer.HMM.depix_hmm import DepixHMM
from text_depixelizer.parameters i... |
3209681 | from lightweight_gan.lightweight_gan import LightweightGAN, Generator, Discriminator, Trainer, NanException
|
3209689 | from .dev import *
from .build import *
from .deploy import *
__all__ = (
# Dev Tasks
'rs',
'sh',
'startapp',
'dumpdata',
'loaddata',
'createdb',
'dropdb',
'clear',
'destroy',
'bootstrap',
# Build Tasks
'bower',
'npm',
'scaffold',
# Deploy Tasks
'gzip... |
3209696 | import sys
import time
import logging
from exabgp.logger.option import option
from exabgp.logger.handler import getLogger
from exabgp.logger.format import formater
from exabgp.logger.format import lazyformat
from exabgp.logger.format import lazyattribute
from exabgp.logger.format import lazynlri
from exabgp.logger.h... |
3209697 | import sys
if sys.version_info[0] == 2:
from activepapers.standardlib2 import *
else:
from activepapers.standardlib3 import *
del sys
|
3209701 | from diet_simple_package.schemas import input_schema, solution_schema
from diet_simple_package.solve_code import solve
__all__ = ["input_schema", "solution_schema", "solve"]
__version__ = "0.1.1"
|
3209726 | import numpy
import scipy.linalg
from . import linsys, utils
__all__ = [
"DeflatedCg",
"DeflatedMinres",
"DeflatedGmres",
"_DeflationMixin",
"ObliqueProjection",
"_Projection",
"Ritz",
"Arnoldifyer",
"bound_pseudo",
]
class _Projection(utils.Projection):
def __init__(self, li... |
3209731 | from collections import defaultdict
from itertools import groupby
import re
#TODO: Figure out a better way to do this
#hack to get scripts to run with django
import os
import sys
sys.path.append("..")
sys.path.append("../api")
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from courses.models import Course, Semest... |
3209746 | import torch
from torch_stft import STFT
import numpy as np
import librosa
import matplotlib.pyplot as plt
audio = librosa.load(librosa.util.example_audio_file())[0]
device = 'cpu'
filter_length = 1024
hop_length = 256
win_length = 1024 # doesn't need to be specified. if not specified, it's the same as filter_length
... |
3209760 | import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
import random
import numpy as np
import pickle
from pathlib import Path
from PIL import Image
import collections
import progressbar
import configargparse
import matplotlib.pyplot as plt
import utils.utils as ... |
3209814 | import os
import tempfile
import logging
import signal
import pytest
from pybnb.common import inf, nan
from pybnb.misc import (
_cast_to_float_or_int,
MPI_InterruptHandler,
metric_format,
time_format,
get_gap_labels,
as_stream,
get_default_args,
get_keyword_docs,
get_simple_logger,... |
3209821 | import inspect
import types
from crestdsl import sourcehelper as SH
import crestdsl.model as crest
import crestdsl.model.api as api
import crestdsl.ml as crestml
import logging
logger = logging.getLogger(__name__)
from pprint import pprint
class SystemCheck(object):
"""
Check whether an Entity object satisf... |
3209848 | import numpy, cdtime, vcs
from vcs.testing.common import test_values_setting
x=vcs.init()
x.drawlogooff()
f=x.createfillarea()
assert(vcs.queries.isfillarea(f))
test_values_setting(f,"style",[f,0,1,2,3,"hatch","pattern","hallow"],[-1,4,"foo",[],{},(),None])
test_values_setting(f,"index",[None,f,1,2,3,4,5,6,7,8,9,10,... |
3209888 | from sofi.ui import TableBody
def test_basic():
assert(str(TableBody()) == "<tbody></tbody>")
def test_custom_class_ident_style_and_attrs():
assert(str(TableBody(cl='abclass', ident='123', style="font-size:0.9em;", attrs={"data-test": 'abc'}))
== "<tbody id=\"123\" class=\"abclass\" style=\"font-si... |
3209921 | X = m.matrix(numpy.random.standard_normal((3,1000)))
C = m.matrix(m.array([[1,.3,.3],[.3,1.,.3],[.3,.3,1.]]))
U = m.cholesky(C)
Y = U*X
#And to test that this works:
m.corrcoef(Y[0,:],Y[1,:])
m.corrcoef(Y[0,:],Y[2,:])
m.corrcoef(Y[1,:],Y[2,:])
|
3209935 | import numpy as np
from importlib import reload
import utils.geometries as geometries; reload(geometries)
import utils.WignerD as WignerD
from lie_learn.representations.SO3 import wigner_d as wd
from lie_learn.representations.SO3 import spherical_harmonics as sh
from lie_learn.spaces import S2
import ipdb
import os
fro... |
3209964 | import json
import pandas as pd
import numpy as np
import os
from os.path import isfile, join
import datetime
import matplotlib.pyplot as plt
project_dir = os.path.dirname(os.path.dirname(os.getcwd()))
out_path = os.path.join(project_dir, "data", "pecan")
fig_path = os.path.join(project_dir, "data", "pecan_info")
de... |
3209989 | from commercetools.platform.models import message
def test_deserialize_order_created():
result = message.OrderCreatedMessage.deserialize(
{
"createdAt": "2021-01-30T16:34:06.907Z",
"id": "cb093b59-045d-47eb-8c6e-0a7fbf15b14b",
"notificationType": "Message",
... |
3210021 | from catalyst.rl import registry
from src.env import SkeletonEnvWrapper
from src.exploration import ContinuousActionBinarization
registry.Environment(SkeletonEnvWrapper)
registry.Exploration(ContinuousActionBinarization)
|
3210041 | import logging
from os import uname
from os.path import isfile
from time import time
from ast import literal_eval
import settings
from functions.filesystem.remove_file import remove_file
skyline_app = 'thunder'
skyline_app_logger = '%sLog' % skyline_app
logger = logging.getLogger(skyline_app_logger)
# The failover ... |
3210056 | import time
from opsbro.collector import Collector
class Timezone(Collector):
def launch(self):
self.logger.debug('getTimezone: starting')
res = {'timezone': time.tzname[1]}
return res
|
3210059 | import tensorflow as tf
import math
import numpy as np
class Classifier(object):
def __init__(self, batch_size, network,
observation_dim=814,
learning_rate=3e-4,
optimizer=tf.train.AdamOptimizer,
image_ch_dim=1,
num_labels = 10,
... |
3210087 | import asyncio
from typing import List, TYPE_CHECKING, Any, Dict
from txdbus import client # type: ignore
from txdbus.objects import ( # type: ignore
DBusObject,
DBusProperty,
RemoteDBusObject
)
from txdbus.interface import DBusInterface, Property # type: ignore
from bleak.backends... |
3210172 | from typing import TYPE_CHECKING, Dict
import anyio.abc
from .component import Component
if TYPE_CHECKING:
from ..base import ComponentInteraction
__all__ = ('ComponentHandler',)
class ComponentHandler:
"""Handler for components, dispatching waiting components.
Attributes:
components:
... |
3210177 | def merge_overlapping_spans(spans):
"""When dealing with overlapping time spans, calculate total time spent treating overlapping
periods as one. For example:
I've been coding at the office since 10:30 until 11:48. (78 minutes)
But really, at 11:30 we started lunch and discussion which lasted till 12:15.... |
3210233 | import logging
import re
from django.conf import settings
from rest_framework import mixins, permissions, serializers, viewsets
from rest_framework.parsers import FormParser, MultiPartParser
from apps.contributors.models import Contributor
from apps.photo.models import ImageFile
from .photos import ImageFileSerializ... |
3210237 | import Qt as Qt
import Qt.QtGui as QtGui
import Qt.QtCore as QtCore
from qtLearn.nodes import Node
import qtLearn.uiUtils as uiUtils
class ItemModel(QtCore.QAbstractItemModel, uiUtils.QtInfoMixin):
def __init__(self, rootNode, font=None):
super(ItemModel, self).__init__()
self._rootNode = None
... |
3210299 | from helium import click, Config
from helium._impl.util.lang import TemporaryAttrValue
from tests.api import BrowserAT
class ClickTest(BrowserAT):
def get_page(self):
return 'test_click.html'
def test_click(self):
click("Click me!")
self.assertEqual('Success!', self.read_result_from_browser())
def test_click_... |
3210303 | class WrongSetupException(Exception):
"""
Thrown when the protocol is not properly setup for the given action
"""
|
3210304 | from __future__ import absolute_import
try:
from ._version \
import \
__version__
except ImportError as e:
__version__ = "no-built"
from .package \
import\
PackageInfo
from .pool \
import\
Pool
from .repository \
import\
Repository
from .request \
im... |
3210335 | import ctypes, time, sys
from ctypes import *
while True:
libc = "/usr/lib/libSystem.B.dylib"
lib = ctypes.CDLL(libc)
load = "/Library/Application Support/helper.dylib"
handle = ctypes.CDLL(load)
time.sleep(callback_time) |
3210350 | import os
import re
from time import sleep
from opensextant import Place
from opensextant.gazetteer import DB, estimate_name_bias, GazetteerIndex, get_default_db
from opensextant.utility import replace_diacritics, load_list
def filter_out_feature(pl: Place, feats):
"""
Filter out places by their feature type... |
3210371 | from stacker.context import Context
from stacker.config import Config
from stacker.variables import Variable
from stacker_blueprints.asg import FlexibleAutoScalingGroup
from stacker.blueprints.testutil import BlueprintTestCase
class TestBlueprint(BlueprintTestCase):
def setUp(self):
self.launch_config = ... |
3210390 | import sys
import os
import struct
import time
import numpy as np
import array as arr
import configuration as cfg
from scipy.ndimage import convolve1d
def read8byte(x):
return struct.unpack('<hhhh', x)
class FrameConfig: #
def __init__(self):
# configs in configuration.py
self.numTxAntennas =... |
3210408 | from datetime import datetime
import numpy as np
def time_split(df, val_start_date, val_stop_date, split_field=None):
"""
Split on a datetime64 field. Take the date between val_start_date and val_stop_date as validation split
and leave the rest for as the train set
Args:
df (DataFrame): A pand... |
3210447 | from tkinter import *
from tkinter import ttk
from tkinter import scrolledtext
from pandas.core.frame import DataFrame
from prettytable import PrettyTable
from parserT28.utils.decorators import singleton
@singleton
class DataWindow(object):
def __init__(self):
self._console = None
self._data = '... |
3210456 | from requests import *
def check(HOST="172.17.0.2:3000"):
s = Session()
def pwn():
if b'html' in s.get(f"http://{HOST}/").content:
print("OK")
else:
print("Cannot visit HTML")
if b'html' in s.post(f"http://{HOST}/style", data={"style": "\"Raw"}).content:
... |
3210462 | import numpy as np
import os.path
from itertools import *
import pandas as pd
import logging
import time
import pysnptools.util as pstutil
from pysnptools.pstreader import PstReader
import warnings
import pysnptools.standardizer as stdizer
from bed_reader import open_bed
#!!why do the examples use ../tests/datasets in... |
3210465 | from nautobot.core.apps import HomePageItem, HomePagePanel
from .models import DummyModel
def get_dummy_data(request):
examples = DummyModel.objects.all()
if not examples:
examples = (
DummyModel.objects.create(name="Example 1", number=100),
DummyModel.objects.create(name="Exa... |
3210646 | import unittest
from .context import a11y # noqa
from a11y.process_a11y import A11yProcessor
class ProcessA11yTestCase(unittest.TestCase):
a11y_filename = 'tests/data/a11y.csv'
domain_filename = 'tests/data/domains.csv'
def setUp(self):
self.a11y = A11yProcessor(self.a11y_filename, self.domain... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.