id stringlengths 3 8 | content stringlengths 100 981k |
|---|---|
1624011 | def main(request, response):
headers = []
headers.append((b"Access-Control-Allow-Origin", b"*"))
return headers, b"{ \"result\": \"success\" }"
|
1624016 | import operator
import os
import warnings
from functools import reduce
from rbnf.core.Optimize import optimize
from rbnf.core.ParserC import Literal, Atom as _Atom, State
from rbnf.core.Tokenizer import Tokenizer
from rbnf.edsl.core import _FnCodeStr
from rbnf.core import ParserC
from rbnf.edsl import *
from rbnf.edsl.... |
1624128 | import sys
sys.path.append("../")
from autogl.datasets import build_dataset_from_name
from autogl.solver.classifier.link_predictor import AutoLinkPredictor
from autogl.module.train.evaluation import Auc
import yaml
import random
import torch
import numpy as np
if __name__ == "__main__":
from argparse import Argu... |
1624157 | import os
import sys
import unittest
sys.path.insert(0, os.path.abspath('..'))
import pydidyoumean
runningOnPython2 = sys.version_info[0] == 2
if runningOnPython2:
from cStringIO import StringIO
else:
from io import StringIO
class TestGeneral(unittest.TestCase):
def test_validateTestFolderContents(self)... |
1624160 | import sys
import gym
import pathlib2
import agents
import ignite.engine
import args as argument_parser
from utils import path_plot
from utils.step_generator import StepGenerator
from ignite.contrib.handlers import ProgressBar
from utils.lap_time_measure import LapTimeMeasure
from utils.state_recorder import StateRecor... |
1624167 | from django.db import models
from ..restaurants.models import Restaurants
class Foods(models.Model):
CATEGORIES = (
(0, 'ایرانی'),
(1, 'فستفود'),
(2, 'نوشیدنی'),
(3, 'پیشغذا')
)
name = models.CharField(max_length=50)
restaurant = models.ForeignKey(Restaurants, related... |
1624197 | from magma import *
from mantle import And
from .ring import Ring
__all__ = ['CascadedRing']
def CascadedRing(nlist, has_ce=False, **kwargs):
"""
n cascaded shift registers in a ring
"""
if has_ce:
ce = In(Bit)()
args = ['CE', ce]
else:
ce = 1
args = []
for i ... |
1624199 | import unittest
import torch
from torch import nn
from ner.active_heuristic import (
Random,
Uncertantiy,
KNNEmbeddings,
)
from . import utils
class TestActiveHeuristics(unittest.TestCase):
'''
Test cases for active_heuristics
'''
def test_random(self):
'''
run test c... |
1624241 | import unittest
import mock
from click.testing import CliRunner
import msword_cli
from .util import MockApp
from pywintypes import com_error
class TestListCommand(unittest.TestCase):
def setUp(self):
self.runner = CliRunner()
@mock.patch('msword_cli.WORD.Documents', Count=0)
@mock.patch('mswor... |
1624284 | import unittest
import os
import zserio
from testutils import getZserioApi, getApiDir
class PackedAutoArrayStructRecursionTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "array_types.zs").packed_auto_array_struct_recursion
def testBitSizeOfLength1(self)... |
1624299 | from dirty_models import BooleanField, EnumField, IntegerField, StringIdField
from enum import Enum
from . import BaseModelManager
from ..models import BaseModel, DateTimeField
from ..results import Result
class Stream(BaseModel):
"""
Connection stream model.
"""
class State(Enum):
"""
... |
1624315 | import unittest
from katas.beta.multiples_2 import multiples
class MultiplesTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(multiples(49), 'Fizz')
def test_equals_2(self):
self.assertEqual(multiples(147), 'Fang')
def test_equals_3(self):
self.assertEqual(mul... |
1624332 | import json
import logging
from todos.makeresult import make_result
from todos import client, TODOS
from faunadb import query
def create(event, context):
data = json.loads(event['body'])
if 'text' not in data:
logging.error("Validation Failed")
raise Exception("Couldn't create the todo item."... |
1624380 | import numpy as np
import matplotlib.pyplot as plt
#import scikits.timeseries as ts
#import scikits.timeseries.lib.plotlib as tpl
import statsmodels.api as sm
#from statsmodels.sandbox import tsa
from statsmodels.sandbox.tsa.garch import * # local import
#dta2 = ts.tsfromtxt(r'gspc_table.csv',
# datecols=0, ... |
1624388 | class PNSignalResult(object):
def __init__(self, result):
"""
Representation of signal server response
:param result: result of signal operation
"""
self.timetoken = result[2]
self._result = result
def __str__(self):
return "Signal success with timetoken... |
1624410 | import click
import marshmallow as ma
from marshmallow import ValidationError
class MarshmallowClickMixin(click.ParamType):
def get_metavar(self, param):
return self.__class__.__name__
def convert(self, value, param, ctx, **kwargs):
try:
return self.deserialize(value, **kwargs)
... |
1624421 | from .agent import Agent
from ..network.network import *
from .mcts import *
from ..utils import *
MIN = -99999999
MAX = 99999999
score_5 = 5
score_4_live = 4.5
score_4_and_3_live = 4.3
score_4 = 4
score_double_3_live = 3.8
score_3_live = 3.5
score_3 = 3
score_double_2_live = 3
score_2_live = 2.5
score_2 = 2
class ... |
1624428 | from revscoring.features import wikitext as wikitext_features
from revscoring.features import revision_oriented
from revscoring.features.modifiers import sub
from revscoring.languages import english
from . import mediawiki, wikipedia, wikitext
local_wiki = [
revision_oriented.revision.comment_matches(
r"c... |
1624439 | import hypothesis.extra.numpy as hnp
import hypothesis.strategies as st
import numpy as np
import pytest
from hypothesis import given, settings
from numpy.testing import assert_array_equal
from mygrad import Tensor
from tests.custom_strategies import tensors, valid_constant_arg
real_types = (
hnp.integer_dtypes()... |
1624460 | from __future__ import print_function
import os
from csv import DictReader
import click
from openelex import models
from openelex import COUNTRY_DIR
FIXTURE_DIR = os.path.join(COUNTRY_DIR, 'fixtures')
COLLECTIONS = ['office', 'party',]
UPSERT_FIELDS = {
'party': ('abbrev',),
'office': ('state', 'name', 'dist... |
1624467 | import pathlib
import pytest
from mock import MagicMock
import boto3
from moto import mock_sqs
from . import DummyPlugin
TEST_DIR = pathlib.Path(__file__).parent.absolute()
@pytest.fixture
def aws_env(monkeypatch):
monkeypatch.setenv("AWS_DEFAULT_REGION", "us-west-2")
@pytest.fixture
def test_dir():
return... |
1624487 | defines = {
"output": "../lib/resty/openssl/x509/csr.lua",
"output_test": "../t/openssl/x509/csr.t",
"type": "X509_REQ",
"has_sign_verify": True,
"sample": "test.csr",
"sample_signature_nid": 65,
"sample_signature_name": "RSA-SHA1",
"fields":
[
{
"field": "subject_name",
"type": ... |
1624610 | import numpy as np
import os
from bolero.behavior_search import BlackBoxSearch
from bolero.representation import ConstantBehavior
from bolero.optimizer import NoOptimizer
from bolero.utils.testing import assert_pickle
from nose.tools import assert_false, assert_true, assert_raises_regexp
from numpy.testing import asser... |
1624641 | import time
import shutil
import dlib
import numpy as np
import PIL.Image
import torch
from torchvision.transforms import transforms
import dnnlib
import legacy
from configs import GENERATOR_CONFIGS
from dlib_utils.face_alignment import image_align
from dlib_utils.landmarks_detector import LandmarksDetector
from tor... |
1624646 | from flask import jsonify, request
from meltano.api.api_blueprint import APIBlueprint
from meltano.api.models import db
from meltano.api.security import block_if_api_auth_required
from .embeds_helper import EmbedsHelper, InvalidEmbedToken
embedsBP = APIBlueprint("embeds", __name__, require_authentication=False)
@em... |
1624671 | import sys
import numpy as np
import tensorflow as tf
from tensorflow.python.training import training_util
from .. import evaluator, metrics
from ..configuration import *
from .doc2vec_train_doc_prediction import doc2vec_prediction_model
from .doc2vec_train_doc_prediction import DocPredictionDataset
class DocPredicti... |
1624673 | import os
from kluctl.tests.test_base import DeploymentTestBase
from kluctl.utils.yaml_utils import yaml_load_file
cur_dir = os.path.dirname(__file__)
class TestTemplating(DeploymentTestBase):
def get_jinja2_vars(self):
return {
'a': 'a1',
'b': 'b1',
'include_var': 'd1... |
1624687 | from click.testing import CliRunner
from mock import Mock, patch
from sigopt.cli import cli
class TestClusterCreateCli(object):
def test_cluster_create(self):
services = Mock()
runner = CliRunner()
with \
runner.isolated_filesystem(), \
patch('sigopt.orchestrate.controller.OrchestrateServic... |
1624706 | import math
from collections import OrderedDict
from functools import partial
import torch.nn as nn
import torch
from torch.nn import Module as Module
from src.models.tresnet.layers.anti_aliasing import AntiAliasDownsampleLayer
from .layers.avg_pool import FastGlobalAvgPool2d
from src.models.tresnet.layers.... |
1624775 | from delorean import Delorean
from pytz import all_timezones
class UtcDatetime(object):
"""Class for manage datetimes. The timezone is always internally in UTC. Its used for unify serialization
and ease complexity of manage datetimes with timezones. Always use this class for datetime management"""
def __... |
1624794 | from __future__ import (
annotations,
)
from collections.abc import (
MutableSet,
)
from typing import (
Any,
Callable,
Generic,
Iterable,
Iterator,
Optional,
TypeVar,
get_args,
)
from minos.common import (
DataDecoder,
DataEncoder,
DeclarativeModel,
ModelType,
... |
1624822 | import pytest
@pytest.mark.nightly
@pytest.mark.github_only
def test_run_stub_test():
"""
Empty test just to make sure our nightly job has something to do
"""
pass
|
1624831 | import ray
from mprl.utility_services.cloud_storage import connect_storage_client
from mprl.utility_services.worker import ConsoleManagerInterface
from mprl.utility_services.lock_server.lock_client_interface import LockServerInterface
from mprl.utility_services.payoff_table import PayoffTable, PolicySpec
import logging... |
1624832 | import os, sys
import numpy as np
import torch.backends.cudnn as cudnn
import torch
from tqdm import tqdm
import argparse
import cv2
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from pixielib.pixie import PIXIE
from pixielib.visualizer import Visualizer
from pixielib.datasets.hand... |
1624835 | import sys, struct, random, string, meterpreter_bindings
# A stack of this stuff was stolen from the Python Meterpreter. We should look
# to find a nice way of sharing this across the two without the duplication.
#
# START OF COPY PASTE
#
# Constants
#
# these values will be patched, DO NOT CHANGE THEM
DEBUGGING = F... |
1624845 | from veroviz._common import *
from veroviz._validation import valCreateArcsFromLocSeq
from veroviz._validation import valCreateArcsFromNodeSeq
from veroviz._createEntitiesFromList import privCreateArcsFromLocSeq
def createArcsFromLocSeq(locSeq=None, initArcs=None, startArc=1, objectID=None, leafletColor=config['VRV_D... |
1624963 | import pytest
from skil.utils.io import serialize_config, deserialize_config
from skil import Experiment
import os
import sys
if sys.version_info >= (3, 3):
import unittest.mock as mock
else:
import mock as mock
MOCK_CONFIG = {
'experiment_id': 'foo',
'experiment_name': 'bar',
'workspace_id': 'b... |
1624964 | class Solution:
def reverseWords(self, s: str) -> str:
listOfWords = [word.strip() for word in s.strip().split(' ') if word != '']
def helper(left, right):
if left < right:
listOfWords[left], listOfWords[right] = listOfWords[right], listOfWords[left]
helpe... |
1624966 | from flask_caching import Cache
cache = Cache()
# Add some basic rate limiting.
# https://flask-limiter.readthedocs.io/en/stable/
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
limiter = Limiter(key_func=get_remote_address)
|
1624993 | from .. import ccllib as lib
from ..core import check
from ..background import omega_x
from .massdef import MassDef, MassDef200m
import numpy as np
class HaloBias(object):
""" This class enables the calculation of halo bias functions.
We currently assume that all halo bias functions can be written
as func... |
1625042 | import importlib.resources
import pathlib
import typing
import attr
import click
import pytest
import _pytest
import plotman.errors
import plotman.job
import plotman.plotters
import plotman.plotters.bladebit
import plotman.plotters.chianetwork
import plotman.plotters.madmax
import plotman._tests.resources
@pytest.f... |
1625049 | import sys, string, json, time
import subprocess
import benchClient
regionAMIs = {
"us-east-1": "ami-0313472d535df8cfd",
"us-east-2": "ami-0eb2012f23aeda71a",
"us-west-1": "ami-01312f0ad647427de",
"us-west-2": "ami-01240c2bd44b025ee",
}
'''
regionAMIs = {
"us-east-1... |
1625078 | from __future__ import absolute_import, division, print_function, unicode_literals
from . import BaseSignal
class Signal(BaseSignal):
""" Ranking signal based on the URL presence in DMOZ
"""
def get_value(self, document, url_metadata):
return (
float(bool(url_metadata["url"].dmoz_ti... |
1625080 | from litex.build.generic_platform import *
from litex.build.xilinx import XilinxPlatform, VivadoProgrammer
_io = [
# SYS clock 100 MHz (input) signal. The sys_clk_p and sys_clk_n
# signals are the PCI Express reference clock.
#set_property PACKAGE_PIN B6 [get_ports sys_clk_p]
("clk100", 0, Pins("B6"), ... |
1625115 | import torch
from .FC import FC
class MLP(torch.nn.Module):
def __init__(self, in_size, hidden_size, out_size, dropout_r = 0., use_relu = True):
super(MLP, self).__init__()
self.fc = FC(in_size = in_size, out_size = hidden_size, dropout_r = dropout_r, use_relu = use_relu)
self.linear =... |
1625184 | import logging
from pajbot.managers.handler import HandlerManager
from pajbot.modules import BaseModule, ModuleSetting
from pajbot.modules.chat_alerts import ChatAlertModule
log = logging.getLogger(__name__)
class LiveAlertModule(BaseModule):
ID = __name__.split(".")[-1]
NAME = "Live Alert"
DESCRIPTION ... |
1625236 | import tensorflow as tf
class EnvSummaryLogger:
"""
Helper class to summarize all environments at the same time on the same plots.
"""
def __init__(self, sess, summary_dirs):
self.sess = sess
self.summary_writer = [tf.summary.FileWriter(summary_dirs[i], self.sess.graph)
... |
1625257 | from keras.layers import Input, Dense
from keras.models import Model
InputTensor = Input(shape=(100,))
H1 = Dense(10, activation='relu')( InputTensor)
H2 = Dense(20, activation='relu')(H1)
Output = Dense(1, activation='softmax')(H2)
model = Model(inputs=InputTensor, outputs=Output)
model.summary()
|
1625259 | import functools
import ipaddress
import json
import logging
import re
import operator
import testinfra
import time
from typing import Optional, Dict
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import pytest
LOGGER = logging.getLogger(__name__)
... |
1625277 | import os
import torch
from PIL import Image
from skimage import io
from torch.utils.data import Dataset
import h5py
from .upna_preprocess import *
from .utils import *
from bingham_distribution import BinghamDistribution
def make_hdf5_file(config, image_transform):
dataset_path = config["preprocess_path"]
csv... |
1625279 | from agnes.algos import A2C, PPO, PPORND
from agnes.nns import MLP, CNN, RNN, RNNCNN, GRUCNN, LSTMCNN
from agnes.runners import Single, DistributedMPI, CompetitiveRunner
from agnes.common import TensorboardLogger, StandardLogger, CsvLogger, log
from agnes.common import make_env, make_vec_env
|
1625321 | import numpy as np
import tensorflow as tf
__author__ = '<NAME>'
def print_metrics_dict(metrics):
for name, val in metrics.items():
print('--------------', name, '--------------')
if isinstance(val, tf.Tensor):
val = val.numpy()
if name == 'confusion':
print(np.arr... |
1625327 | import operator
import re
from datetime import date, datetime, timedelta
from crispy_forms.bootstrap import FormActions
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Field, Layout, Submit
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.model... |
1625332 | import matplotlib as mpl
import matplotlib.pyplot as plt
import datetime
import numpy as np
import pandas as pd
import seaborn as sns
import yaml
import math
import os
from skopt.plots import plot_objective
from fbprophet.plot import add_changepoints_to_plot
# Set some matplotlib parameters
mpl.rcParams['figure.figsiz... |
1625365 | from bluedot import MockBlueDot
from time import sleep, time
mbd = MockBlueDot(auto_start_server = False)
def pressed(pos):
print("Pressed: x={} y={} angle={} distance={} middle={} top={} bottom={} left={} right={} time={}".format(pos.x, pos.y, pos.angle, pos.distance, pos.middle, pos.top, pos.bottom, pos.left, p... |
1625385 | st= input("Enter the string \n")
st=st+"A"
t=0
c=0
l= len(st)
for i in range(1,l):
if ord(st[i])>=65 and ord(st[i])<=90:
print(st[t:i])
t=i
c+=1
print(c)
|
1625395 | from odoo import fields, models
class PosConfig(models.Model):
_inherit = "pos.config"
include_discount_in_prices = fields.Boolean(
string="Include Discount in Prices",
help="If box is unchecked the displayed prices will not include discounts",
)
|
1625425 | import datetime as dt
import os
import time
from absl import app
from absl import flags
import apache_beam as beam
from apache_beam.runners.portability import fn_api_runner
from budget_accounting import BudgetAccountant
from dataclasses import dataclass
from private_beam import DPEngine, BeamOperations, LocalOperatio... |
1625458 | from coldtype import *
from coldtype.fx.skia import phototype
audio = __sibling__("media/68.wav")
midi = Programs.Midi(__sibling__("media/68.mid"), text=0, bpm=151)
midi.hide()
@animation(timeline=midi.t, bg=hsl(0.4, 0.8, l=0.2), render_bg=1, audio=audio)
def drumsolo(f):
d = midi.t[0].fifve(f.i)
lk1 = {
... |
1625475 | from numbers import Real
from typing import Optional
import numpy as np
import mygrad._utils.graph_tracking as _tracking
from mygrad.operation_base import Operation
from mygrad.tensor_base import Tensor, asarray
from mygrad.typing import ArrayLike
class MarginRanking(Operation):
def __call__(self, x1, x2, y, ma... |
1625479 | from xml.sax import *
from xml.sax.handler import ContentHandler
from typing import List, Dict, Callable
import sys
import re
import click
class Element:
"""Just like DOM element except it only knows about ancestors"""
# XML tag name
# name: str
# parent element
# parent: Element
# attribut... |
1625501 | import logging
import time, datetime
from thespian.test import *
from thespian.actors import *
askTimeout = datetime.timedelta(seconds=5)
class Whale(Actor):
def receiveMessage(self, msg, sender):
if isinstance(msg, tuple):
self.send(sender, msg[1] * msg[0])
class Shrimp(Actor):
def rece... |
1625502 | import shamirsecret
from unittest import TestCase
# Basic tests for this module. Should output nothing on success.
class TestShamirSecret(TestCase):
def test_math(self):
# first check some of the math...
self.assertTrue(shamirsecret._multiply_polynomials([1,3,4],[4,5]) == [4,9,31,20])
self.assertTrue... |
1625526 | from numpy.random.mtrand import RandomState
import numpy as np
from .abstract import Agent
epsilon_greedy_args = {
'epsilon': 0.01,
'random_seed': np.random.randint(2 ** 31 - 1),
# Select an Action that is ABSOLUTELY different to the Action
# that would have been selected in case when Epsilon-Greedy ... |
1625537 | import time
ZERO = 0
def f1(n):
"Arbitrary test function."
i = 0
x = 1
while i<n:
j = 0 #ZERO
while j<=i:
j = j + 1
x = x + (i&j)
i = i + 1
return x
try:
import pypyjit
except ImportError:
print "No jit"
else:
pypyjit.enable(f1.func_... |
1625550 | from org.transcrypt.stubs.browser import __pragma__
from org import threejs as three
def pad_wrap(min, max, val):
if val < min:
return max
if val > max:
return min
return val
XWRAP = 0
XNWRAP = 0
YWRAP = 0
YNWRAP = 0
def set_limits(x: float, y: float):
nonlocal... |
1625564 | import math
import torch
import torch.nn as nn
from .ocean import Ocean_
from .oceanplus import OceanPlus_
from .oceanTRT import OceanTRT_
from .siamfc import SiamFC_
from .connect import box_tower, AdjustLayer, AlignHead, Corr_Up, MultiDiCorr, OceanCorr
from .backbones import ResNet50, ResNet22W
from .mask import MMS,... |
1625579 | import pytest
@pytest.mark.parametrize(
"url",
[
"https://example.com",
],
)
def test_valid_url(new_command, url):
"""Test that valid URLs are accepted."""
assert new_command.validate_url(url)
@pytest.mark.parametrize(
"url",
[
"not a URL!", # Free text.
],
)
def tes... |
1625598 | import os
import shutil
import tarfile
import tempfile
import lnt.server.config
from lnt.util import logger
class Instance(object):
"""
Wrapper object for representing an LNT instance.
"""
@staticmethod
def frompath(path):
"""
frompath(path) -> Insance
Load an LNT instanc... |
1625604 | import mpylib
import opcode
import ulogging
ulogging.basicConfig(level=ulogging.DEBUG)
opcode.config.MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE = 1
op = mpylib.get_opcode_ns()
with open("testout.mpy", "wb") as f:
mpy = mpylib.MPYWriter(f)
mpy.write_header(
mpylib.MPY_VERSION,
mpylib.MICROPY_P... |
1625656 | from .api import nets
from .api import detect
from .api import draw
from .api import crop
from .api import show |
1625668 | from django.test import TestCase
from moneyed import Money
from .. import enums, models
from .factories import WalletFactory, WalletTrxFactory
class TransactionManagerTests(TestCase):
def test_compute_balances(self):
wallet_obj = WalletFactory.create()
wallet_obj1 = WalletFactory.create()
... |
1625699 | def test_get_node_metrics(CLIENT):
def _assert(response):
# e.g. docs/api_reponses/rpc_metrics.json
assert isinstance(response, list)
assert len(response) > 300
_assert(CLIENT.get_node_metrics())
def test_get_node_metric(CLIENT):
def _assert(response):
# e.g. docs/api_repo... |
1625712 | from a10sdk.common.A10BaseClass import A10BaseClass
class SslSid(A10BaseClass):
"""Class Description::
SSL session ID persistence.
Class ssl-sid supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param dont_honor_conn_rul... |
1625809 | from ally import *
from xml.etree.ElementTree import tostring
## These values are from Ally Invest API Applications page.
CONSUMER_KEY = "CONSUMER KEY"
CONSUMER_SECRET = "CONSUMER SECRET"
OAUTH_TOKEN = "OAUTH TOKEN"
OAUTH_SECRET = "OAUTH TOKEN SECRET"
if __name__ == "__main__":
ally = AllyAPI(OAUTH_SECRET, OAUTH... |
1625857 | from mnist import MNIST
import numpy as np
import math
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.metrics import accuracy_score
from collections import Counter
import matplotlib.pyplot as plt
import time
# --------------------------------------------------------
# Global Variables
training... |
1625882 | from armulator.armv6.opcodes.abstract_opcode import AbstractOpcode
from bitstring import BitArray
from armulator.armv6.configurations import arch_version
class Smull(AbstractOpcode):
def __init__(self, setflags, m, d_hi, d_lo, n):
super(Smull, self).__init__()
self.setflags = setflags
self... |
1625887 | import datetime
import getpass
import json
import sys
import mgear
import mgear.core.icon as ico
import pymel.core as pm
from maya.app.general.mayaMixin import MayaQWidgetDockableMixin
from mgear import shifter
from mgear.core import transform, node, attribute, applyop, pyqt, utils, curve
from mgear.vendor.Qt import Q... |
1625898 | from dataclasses import dataclass, field
from enum import Enum
from typing import List, Optional
from shared.xml_classes.common_messages.v2_g_ci_common_types import (
EvsestatusType,
ListOfRootCertificateIdsType,
MeterInfoType,
RationalNumberType,
ReceiptType,
V2GrequestType,
V2GresponseType... |
1625900 | import importlib
from datetime import timedelta
from functools import wraps
from types import ModuleType
from unittest import mock
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
import strawberry_django_jwt.object_types
from strawberry_django_jwt imp... |
1625909 | import numpy as np
import scipy
from ._simsig_tools import _check_list,_rand_uniform
from ._generator_base import generator_base
#------------------------------------------------------------------------------------
__all__=['harmonics','Harmonics']
#------------------------------------------------------------------... |
1625966 | from utils import tk_dynamic as tkd, tk_utils, autocompletion
from utils.item_name_lists import NO_UNIQUE_MAP
import tkinter as tk
from tkinter import ttk
import time
class Drops(tkd.Frame):
def __init__(self, main_frame, parent, **kw):
tkd.Frame.__init__(self, parent, **kw)
self.drops = dict()
... |
1626010 | import os
SECRET_KEY = 'amplitude-test'
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'
SESSION_COOKIE_HTTPONLY = True
SESSION_SAVE_EVERY_REQUEST = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAM... |
1626039 | description = 'Virtual cryostat'
group = 'optional'
devices = dict(
T = device('nicos.devices.generic.DeviceAlias'),
Ts = device('nicos.devices.generic.DeviceAlias'),
T_cryo = device('nicos.devices.generic.VirtualRealTemperature',
description = 'A virtual (but realistic) temperature controller',
... |
1626046 | import logging
from flask import Blueprint, request
from followthemoney import model
from followthemoney.compare import compare
from aleph.settings import MAX_EXPAND_ENTITIES
from aleph.model import Judgement
from aleph.logic.profiles import get_profile, decide_pairwise
from aleph.logic.expand import entity_tags, expa... |
1626049 | from pandas_datareader import DataReader
import numpy as np
import pandas as pd
import datetime
# Grab time series data for 5-year history for the stock (here AAPL)
# and for S&P-500 Index
start_date = datetime.datetime.now() - datetime.timedelta(days=1826)
end_date = datetime.date.today()
stock = 'MSFT'
i... |
1626071 | from django.conf.urls import url
from . import views, views_api
# NOTE: file/folder/hyperlink objects can be referred to as 'item', but only if
# ObjectPermissionMixin is used in the view
app_name = 'filesfolders'
urls_ui = [
url(
regex=r'^(?P<project>[0-9a-f-]+)$',
view=views.ProjectFile... |
1626087 | import os
import cv2
import sys
import pdb
import six
import glob
import time
import torch
import random
import pandas
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
# import pyarrow as pa
from PIL import Image
import torch.utils.data as data
import matplotlib.pyplot... |
1626116 | import torch
from torch import nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair
import tree_filter_cuda as _C
class _Refine(Function):
@staticmethod
def forward(ctx, feature_in, edge_weight, sorted_index, sorted_parent, sor... |
1626134 | import asyncio
import json
from pyee import AsyncIOEventEmitter
import websockets
from .__version__ import __version__
from .libs.utils.util import ObnizUtil
class ObnizConnection:
def __init__(self, id, options):
self.id = id
self.socket = None
self.socket_local = None
self.debug... |
1626167 | from pprint import pprint
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
# Import the deployment specific modules
from libcloud.compute.deployment import ScriptDeployment
from libcloud.compute.deployment import MultiStepDeployment
cls = get_driver(Provider.EXOSCALE)
dri... |
1626168 | import unittest
from unittest.mock import Mock, MagicMock, patch, call
import numpy as np
from pymatgen.core.lattice import Lattice
from pymatgen.core.structure import Molecule, Structure
from pymatgen.core.operations import SymmOp
from bsym.interface.pymatgen import ( unique_symmetry_operations_as_vectors_from_structu... |
1626195 | from google.cloud import bigquery
import os, re
import ftplib
# writeable part of the filesystem for Cloud Functions instance
gc_write_dir = "/tmp"
def get_file_ftp(host, path_to_file, ftp_configuration):
"""
Copy an existing file from FTP via ftp://*host*/*path_to_file* link to home directory.
Th... |
1626211 | class FacepyError(Exception):
"""Base class for exceptions raised by Facepy."""
class FacebookError(FacepyError):
"""Exception for Facebook errors."""
def __init__(self, message=None, code=None, error_data=None, error_subcode=None,
is_transient=None, error_user_title=None, error_user_msg=... |
1626244 | import logging
import os.path
import sys
import time
dirname = os.path.dirname(os.path.abspath(__file__))
sys.path.append(dirname)
sys.path.append(os.path.join(dirname, '..'))
from cassandra.cluster import Cluster
from cassandra.io.asyncorereactor import AsyncoreConnection
from cassandra.query import SimpleStatement
... |
1626259 | import datetime
import urllib.request, urllib.parse, urllib.error
from http.cookiejar import CookieJar
import os
import re
from .central import CentralBase
from ..utils import utils
class CSLWeekly(CentralBase):
def __init__(self, name, storage):
CentralBase.__init__(self, name, storage)
self.base... |
1626260 | import sys
print 'Count:', len(sys.argv)
print 'Type:', type(sys.argv)
for arg in sys.argv:
print 'Argument:', arg
|
1626273 | from tslearn.utils import to_time_series_dataset
from tslearn.clustering import silhouette_score
import tslearn.clustering as clust
from scipy import signal
import itertools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from gippy import GeoImage
import gippy.algorithms as alg
import re
from os... |
1626276 | import numpy as np
import sys
import time
from sklearn.model_selection import RepeatedKFold
from sklearn.model_selection import GroupKFold
from sklearn.base import BaseEstimator
from scipy.linalg import cholesky, solve_triangular
from sklearn.metrics.pairwise import euclidean_distances
from sklearn.decomposition import... |
1626278 | import pytest
import textwrap
from ansible_builder.steps import AdditionalBuildSteps
@pytest.mark.parametrize('verb', ['prepend', 'append'])
def test_additional_build_steps(verb):
additional_build_steps = {
'prepend': ["RUN echo This is the prepend test", "RUN whoami"],
'append': textwrap.dedent(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.