id stringlengths 3 8 | content stringlengths 100 981k |
|---|---|
9988744 | from django.db import models
from django.test import TestCase
from cms.apps.testing_models.models import (TestOnlineBaseModel, TestPageBaseModel,
TestPublishedBaseModel, TestSearchMetaBaseModel,
TestSitemapModel)
from cms.sitemaps import (BaseSi... |
9988745 | import numpy as np
import tensorflow as tf
from tensorflow_similarity.retrieval_metrics import MapAtK
def test_concrete_instance():
rm = MapAtK(r={1: 4, 0: 4})
assert rm.name == "map@5"
# Check the name once we have updated the threshold
rm.distance_threshold = 0.1
assert rm.name == "map@5 : dis... |
9988758 | if __name__ == '__main__':
phrase = input()
print(''.join([phrase[len(phrase)-i-1] for i in range(len(phrase))]), end='')
print()
|
9988782 | from types import MemberDescriptorType
from .._operators import OP_NAMES, UNARY, BINARY, COMPARISON
from ..functions import call
ZOMBIE_CLASSES = {}
UNARY_METHODS = [OP_NAMES[op] for op in UNARY]
UNARY_METHODS.extend(["iter"])
BINARY_METHODS = [OP_NAMES[op].rstrip("_") for op in COMPARISON + BINARY]
RBINARY_METHODS =... |
9988786 | import re
import os
import sys
import numpy as np
import cPickle
import subprocess
from collections import defaultdict
from alphabet import Alphabet
UNKNOWN_WORD_IDX = 0
def load_data(fname):
lines = open(fname).readlines()
qids, questions, answers, labels = [], [], [], []
num_skipped = 0
prev = ''
qid2n... |
9988805 | from contextlib import suppress
with suppress(ImportError):
from .mxnet_person_feature_extractor import MxnetPersonFeatureExtractor
from .mxnet_person_reid import MxnetPersonReid
|
9988853 | import FWCore.ParameterSet.Config as cms
pfDeepCSVJetTags = cms.EDProducer('DeepFlavourJetTagsProducer',
src = cms.InputTag('pfDeepCSVTagInfos'),
checkSVForDefaults = cms.bool(False),
meanPadding = cms.bool(False),
NNConfig = cms.FileInPath('RecoBTag/Combined/data/DeepFlavourNoSL.json'),
toAdd = cm... |
9988933 | from __future__ import division
import re
import datetime
from unidecode import unidecode
from wtforms import StringField, TextAreaField, validators, DateTimeField, HiddenField
from wtforms.fields.html5 import URLField
from sqlalchemy import (
Column,
DateTime,
ForeignKey,
Integer,
String,
T... |
9988954 | import setuptools
import os
import shutil
source_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(source_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
with open(os.path.join(source_directory, 'linkedin', 'resources', 'version.py'), encoding='utf-8') as f:... |
9988962 | from pywps.inout.outputs import ComplexOutput
class OutputsSerializer(object):
@staticmethod
def to_json(outputs):
outputs_json = dict()
for identifier, output in outputs.iteritems():
# Common properties
output_json = dict(
workdir=output.workdir,
... |
9988963 | import matplotlib.pyplot as plt
import numpy as np
formula = (
r'$'
r'N = \int_{E_\mathrm{min}}^{E_\mathrm{max}} '
r'\int_0^A'
r'\int_{t_\mathrm{min}}^{t_\mathrm{max}} '
r'\Phi_0 \left(\frac{E}{1\,\mathrm{GeV}}\right)^{\!\!-\gamma}'
r' \, \mathrm{d}A \, \mathrm{d}t \, \mathrm{d}E'
r'$'
)
... |
9988996 | import datetime
import time
from functools import wraps
from flask import g, request, redirect, url_for, session, make_response
from wsgiref.handlers import format_date_time
from nebula.services import aws, ldapuser
from nebula.models import ssh_keys
from nebula.routes import errors
def is_logged_in():
"""Check i... |
9989016 | import os
import os.path
import unittest
from unittest.mock import patch
from programy.storage.stores.file.config import FileStorageConfiguration
from programy.storage.stores.file.config import FileStoreConfiguration
from programy.storage.stores.file.engine import FileStorageEngine
from programy.storage.stores.file.sto... |
9989020 | from __future__ import absolute_import, division, print_function
import time
import mmtbx.refinement.real_space.fit_residues
import mmtbx.refinement.real_space
pdb_answer = """\
CRYST1 23.341 28.568 19.164 90.00 90.00 90.00 P 1
ATOM 1 N PHE A 58 8.659 20.073 11.185 1.00 7.73 N
ATO... |
9989035 | from ethereum import tester as t
from itertools import permutations
from ethereum import utils
import sys
def sha3num(*args):
o = ''
for arg in args:
if isinstance(arg, (int, long)):
o += utils.zpad(utils.encode_int(arg), 32)
else:
o += arg
return utils.sha3(o)
def... |
9989045 | from .UdonPie import * # IGNORE_LINE
def _start():
func(100) # -> int function!!!
func(1.0) # -> float function!!!
def func(i: Int32) -> Void:
Debug.Log(Object('int function!!!'))
def func(s: Single) -> Void:
Debug.Log(Object('float function!!!'))
|
9989053 | import threading
import time
import string
import os
import random, copy, subprocess
import json, math
from functools import wraps
# must import logger after initlogging, ugly
from utils.log import logger
# grpc
from concurrent import futures
import grpc
from protos.rpc_pb2 import *
from protos.rpc_pb2_grpc import Ma... |
9989064 | from .Ischemic_Stroke.predict import *
from .Skull_Stripping.predict import *
from .Segment_GBM.predict import *
from .Segment_Brain_Mets.predict import * |
9989095 | load("//:import_external.bzl", import_external = "safe_wix_scala_maven_import_external")
def dependencies():
import_external(
name = "org_scalaz_scalaz_concurrent_2_12",
artifact = "org.scalaz:scalaz-concurrent_2.12:7.2.26",
artifact_sha256 = "8e1867620c984e3b2693c745050141213e01a9debd33076eca528e... |
9989131 | from dataclasses import dataclass, field
from sys import getsizeof
from typing import Any, Dict, List
from paralleldomain.model.annotation.common import Annotation
from paralleldomain.model.geometry.point_2d import Point2DGeometry
@dataclass
class Point2D(Point2DGeometry):
"""Represents a 2D Point.
Args:
... |
9989154 | from enum import Enum
DEFAULT_CRF = 15
DEFAULT_PRESET = 'fast'
class Resolution(Enum):
# Width, height, auto bitrate
LOW_DEF = (360, 240, 500, 'auto_bitrate_240')
STANDARD_DEF = (720, 480, 1600, 'auto_bitrate_480')
MEDIUM_DEF = (1280, 720, 4500, 'auto_bitrate_720')
HIGH_DEF = (1920, 1080, 8000, '... |
9989174 | import logging
import os
from typing import Union, Iterable
import baostock as bao
import colorama
import pandas as pd
from sz.stock_data.toolbox.data_provider import ts_code
from sz.stock_data.toolbox.helper import need_update
class HS300(object):
def __init__(self, data_dir: str):
self.data_dir: str ... |
9989182 | import network
import utime
from tepra import new_logger
log = new_logger('Wi-Fi :')
wifi = network.WLAN(network.STA_IF)
def up(ssid, psk):
if wifi.isconnected():
return True
log('Connecting to an AP')
log('SSID: {}, PSK: (hidden)', ssid)
wifi.active(True)
wifi.connect(ssid, psk)
... |
9989192 | from socket import *
import sys
import select
import os
import socket
import time
server_address = 'case2_socket'
# Make sure the socket does not already exist
try:
os.unlink(server_address)
except OSError:
if os.path.exists(server_address):
raise
# Create a UDS socket
sock = socket.socket(socket.AF_... |
9989204 | from django.utils.deprecation import MiddlewareMixin
class TransformMiddleware(MiddlewareMixin):
white_list = [
'api/user/auth'
]
def __call__(self, request):
"""
Change request body to str type
:param request:
:return:
"""
if isinstance(request... |
9989208 | import numpy as np
def plot_sphere_data(position, radius):
"""Given a position and radius, get the data needed to plot.
:param position: Position in (x, y, z) of sphere
:type position: numpy.ndarray
:param radius: radius of sphere
:type radius: int
:returns: (x, y, z) tuple of sphere data t... |
9989209 | import matplotlib.pyplot as plt
from sklearn import datasets
from np_ml import LLE
if __name__ == '__main__':
lle = LLE()
n_points = 1000
X, color = datasets.samples_generator.make_s_curve(n_points, random_state=0)
y = lle.fit(X)
plt.scatter(y[:, 0], y[:, 1], c=color)
plt.show() |
9989238 | import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.animation as animation
from mpl_toolkits.mplot3d.art3d import juggle_axes
"""
If you're on OSX and using the OSX backend, you'll need to change blit=True to blit=False in the FuncAnimation
initialization below... |
9989242 | import yaml
import os
import os.path as osp
import glob
import numpy as np
from easydict import EasyDict
from .utils import recreate_dirs
class Config:
def __init__(self, cfg_id, tmp=False, create_dirs=False):
self.id = cfg_id
cfg_path = 'cfg/**/%s.yml' % cfg_id
files = glob.glob(cfg_path... |
9989275 | from typing import Sequence, Union
import torch
from meddlr.ops import complex as cplx
from meddlr.utils.events import get_event_storage
class NoiseModel:
"""A model that adds additive white noise.
This model adds zero-mean Gaussian noise to a real-valued or
complex-valued input. The standard deviation... |
9989297 | from Bio import SeqIO
import sys, string
fasta_file = "/Users/saljh8/GitHub/altanalyze/AltDatabase/EnsMart72/Hs/SequenceData/Homo_sapiens.GRCh37.72.cdna.all.fa" # Input fasta file
result_file = "/Users/saljh8/GitHub/altanalyze/AltDatabase/EnsMart72/Hs/SequenceData/Homo_sapiens.GRCh37.72.cdna.all.filtered.fa" # Output f... |
9989298 | from sty import fg
from figcli.config.style.color import Color
from figcli.config.style.palette import Palette
from figcli.config.style.terms.term import Term
class iTerm(Term):
TERM_PROGRAM = 'iTerm.app'
BLUE = (7, 200, 239)
GREEN = (51, 222, 136)
RED = (240, 70, 87)
YELLOW = (249, 149, 72)
... |
9989310 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import cv2
from PIL import Image
import matplotlib.pyplot as plt
def disp2distribute(disp_gt, max_disp, b=2):
disp_gt = disp_gt.unsqueeze(1)
disp_range = torch.arange(0, max_disp).view(1, -1, 1, 1).float().cuda()
gt_dist... |
9989335 | import io
import json
from app import build_wsgi_app
from webtest import TestApp
app = TestApp(build_wsgi_app())
explorer_html = app.get("/api-explorer").text
spec_json = app.get("/openapi.json").json
explorer_html = explorer_html.replace("http://localhost/", "")
with io.open("../gh-pages/index.html", "w") as f:
... |
9989348 | from . import log_helper as log_helper_
log_helper = log_helper_.LogHelper()
__all__ = ['log_helper']
|
9989386 | import io
import natsort
from twisted.internet import reactor
from ygo.constants import AMOUNT_RACES, RACES_OFFSET
from ygo.duel_reader import DuelReader
from ygo.parsers.duel_parser import DuelParser
from ygo.utils import process_duel
def msg_announce_race(self, data):
data = io.BytesIO(data[1:])
player... |
9989427 | from __future__ import absolute_import, division, print_function
from builtins import super, range, zip, round, map
import logging
from read import Reader
from ditto.store import Store
logger = logging.getLogger(__name__)
m = Store()
reader = Reader()
reader.parse(m, "test_input.csv")
for i in m.models:
logger.d... |
9989466 | try:
import pandas as pd
using_pandas = True
except ImportError:
pd = 'pip install pandas'
using_pandas = False
|
9989497 | import os
import sys
import argparse
sys.path.append(os.getcwd())
from mindware.datasets.image_dataset import ImageDataset
from mindware.estimators import ImageClassifier
parser = argparse.ArgumentParser()
parser.add_argument('--n_jobs', type=int, default=1)
args = parser.parse_args()
n_jobs = args.n_jobs
print('n_j... |
9989516 | from typing import Optional
from pydantic import BaseModel
class TokenData(BaseModel):
username: Optional[str] = None
class Status(BaseModel):
message: str
|
9989579 | import os
import h5py
import pandas as pd
import numpy as np
def convert_nodes(nodes_file, node_types_file, **params):
is_h5 = False
try:
h5file = h5py.File(nodes_file, 'r')
is_h5 = True
except Exception as e:
pass
if is_h5:
update_h5_nodes(nodes_file, node_types_file... |
9989622 | import time, math
from fontTools.pens.basePen import BasePen
from fontTools.pens.transformPen import TransformPen
from coldtype.geometry import Rect, Point
try:
from pyaxidraw import axidraw
except:
print("Couldn’t import pyaxidraw")
pass
class AxiDrawPen(BasePen):
def __init__(self, dat, page, move_... |
9989662 | import numpy as np
from time import sleep
from shutil import rmtree
from cache_decorator import Cache
from .utils import standard_test_array
@Cache(
cache_dir="./test_cache",
args_to_ignore=["x"],
backup=False,
)
def cached_function(a, x):
sleep(2)
return [1, 2, 3]
def test_ignore_args():
stan... |
9989684 | from validator import Validator, TimestampField
class V(Validator):
create_at = TimestampField()
def test_ok():
data = {'create_at': 1532339910}
v = V(data)
assert v.is_valid()
def test_wrong_value():
data = {'create_at': 'abc'}
v = V(data)
assert not v.is_valid(), v.str_errors
de... |
9989698 | import os
import cv2
from tqdm import tqdm
directory = './video_result_demo/'
if not os.path.exists(directory):
os.makedirs(directory)
vis_dir = './demo_videos/'
for v_dir in tqdm(os.listdir(vis_dir)):
video_list = os.listdir(vis_dir + v_dir + '/')
video_list.sort()
video_name = directory + v_dir + '.... |
9989754 | from secure_ml.attack.base_attack import BaseAttacker
from secure_ml.attack.evasion_attack import Evasion_attack_sklearn
from secure_ml.attack.fsha import FSHA
from secure_ml.attack.fsha_mnist import Decoder, Discriminator, Pilot, Resnet
from secure_ml.attack.membership_inference import (AttackerModel,
... |
9989817 | import numpy as np
def get_disu_kwargs(nlay, nrow, ncol, delr, delc, tp, botm):
def get_nn(k, i, j):
return k * nrow * ncol + i * ncol + j
nodes = nlay * nrow * ncol
iac = np.zeros((nodes), dtype=int)
ja = []
area = np.zeros((nodes), dtype=float)
top = np.zeros((nodes), dtype=float)
... |
9989827 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="DocOnce",
version="1.5.13",
author='<NAME>, <NAME>',
author_email="<EMAIL>, <EMAIL>",
maintainer = "<NAME>",
maintainer_email = "<EMAIL>",
description="Markup lan... |
9989875 | import requests
import os
from tqdm import tqdm
def download_file_from_google_drive(id, destination, fname=None):
URL = "https://docs.google.com/uc?export=download"
session = requests.Session()
response = session.get(URL, params = { 'id' : id }, stream = True)
token = get_confirm_token(response)
... |
9989886 | size(600, 600)
# Create interesting effects by using
# appending transformations.
# All transformations in NodeBox are remembered.
# Every transformation you do is appended to the
# previous ones. Here, the scale and rotation are
# only changed a little bit, but by doing this multiple
# times, you will get full tra... |
9989903 | import os
import tempfile
import warnings
from typing import Any, Dict, List
import click
import pytest
from click.testing import CliRunner
from glum_benchmarks.cli_analyze import _identify_parameter_fnames
from glum_benchmarks.cli_run import cli_run
from glum_benchmarks.util import BenchmarkParams, benchmark_params_... |
9990014 | import numpy as np
import os
import sys
from scipy.io import loadmat
from scipy.misc import imread, imsave
import tensorflow as tf
from tqdm import trange
# add project root to path
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from utils import bilinear_sampler
os.envi... |
9990023 | import logging
from types import MethodType
log = logging.getLogger("prometheus.streaming")
METRIC_METHODS = ("inc", "dec", "set", "observe")
class BaseStreamingClient:
def __init__(self, format, transport):
self.format = format
self.transport = transport
def _monkey_patch_all(self):
... |
9990040 | from cbsettings.exceptions import NoMatchingSettings
from nose import with_setup
from nose.tools import assert_true, assert_raises
import socket
from .utils import load_settings
gethostname = socket.gethostname
def patched_gethostname(*args, **kwargs):
return 'testhost'
def patch_hostname():
socket.gethos... |
9990044 | import time
from ixnetwork_restpy import SessionAssistant
# create a test tool session
session_assistant = SessionAssistant(IpAddress='127.0.0.1', UserName='admin', Password='<PASSWORD>',
LogLevel=SessionAssistant.LOGLEVEL_INFO, ClearConfig=True)
ixnetwork = session_assistant.Ixne... |
9990054 | import os
import pikax
import settings
#
# do not remove curly brackets or change word inside
#
# Global Settings
LANGS = ['English', '中文']
LANG = LANGS[0]
GUI_LANG_TO_PIKAX_LANG = {
'English': 'English',
'中文': 'Chinese'
}
def set_next_lang():
global LANGS
next_index = (LANGS.index(LANG) + 1) % le... |
9990084 | import json
from time import sleep, time
from sixteen import logger
from sixteen.constant import NOTICE_COINS
from sixteen.models import session, dao_to_dict
from sixteen.models.Tables import CoinPrice, CoinPriceHistory
from sixteen.util.caches import put_zset_pip, get_list, get_queue_message, add_list, add_list_defau... |
9990095 | import math
import os
import sys
import numpy as np
from util import load_result
from itertools import combinations
from itertools import product
from ontology import Ontology
def get_max_tree_distance(ontology, tags, debug=False):
"""
Description:
Return max tree distance which can be derived with g... |
9990097 | import argparse
import bpy
import os
from terial.shapes.shapenet import get_synset_models, taxonomy
from toolbox.logging import init_logger
logger = init_logger(__name__)
MAX_SIZE = 5e7
_package_dir = os.path.dirname(os.path.realpath(__file__))
parser = argparse.ArgumentParser()
parser.add_argument('--category'... |
9990099 | import config
import matplotlib.pyplot as plt
from train import MusAE
from train_gm import MusAE_GM
from dataset import MidiDataset
import os
import numpy as np
import pretty_midi as pm
import pypianoroll as pproll
from keras import backend as K
import keras
import pprint
from mpl_toolkits.mplot3d import Axes3D
pp = p... |
9990119 | def get_assert_function(exc_type):
""" generate an assert function that raises exc_type """
def assert_condition(condition, details):
if not condition:
raise exc_type(details)
return assert_condition
|
9990152 | from typing import Dict, Optional, Tuple, Union
import torch
from kornia.augmentation.random_generator.base import RandomGeneratorBase
from kornia.augmentation.utils import _common_param_check
from kornia.geometry.bbox import bbox_generator
from kornia.geometry.transform.affwarp import _side_to_image_size
class Res... |
9990162 | import os
import ldfparser
if __name__ == "__main__":
path = os.path.join(os.path.dirname(__file__), 'lin22.ldf')
ldf = ldfparser.parse_ldf(path, capture_comments=True)
print(ldf.comments)
|
9990179 | import copy
from unittest import mock
import matplotlib
from matplotlib import pyplot as plt
from matplotlib._pylab_helpers import Gcf
import pytest
@pytest.fixture(autouse=True)
def mpl_test_settings(qt5_module, mpl_test_settings):
"""
Ensure qt5_module fixture is *first* fixture.
We override the `mpl... |
9990188 | class FakeStream:
def __init__(self, data=None):
if data is None:
data = []
self.data = data
self.die = False
def recv(self, a):
if self.die:
raise OSError()
if len(self.data) == 0:
raise BlockingIOError()
val = self.data.pop(0... |
9990192 | import uuid
from sqlalchemy import (Column, Integer, Numeric, Date, Time,
String, ForeignKey, Boolean, Index)
from sqlalchemy.schema import CheckConstraint
from sqlalchemy.orm import relationship, backref
from sqlalchemy.ext.hybrid import hybrid_property
from marcottievents.models import GUID
... |
9990209 | from unittest.mock import patch
import pytest
from allauth.socialaccount.models import SocialAccount
from django.contrib.auth.models import User
from django.test import TestCase
from django_dynamic_fixture import get
from messages_extends.models import Message
from readthedocs.builds import tasks as build_tasks
from ... |
9990225 | import numpy as np
from numpy.linalg import inv
from sklearn.datasets import load_boston
def squared_loss(y, pred):
return np.square(pred - y).mean() / 2
def squared_loss_gradient(y, pred):
return pred - y
class LinearRegression(object):
def __init__(self):
self.learning_rate = 0.1
se... |
9990231 | import arcade
import imgui
import imgui.core
from imdemo.page import Page
class Checkbox(Page):
def reset(self):
self.checkbox1_enabled = True
self.checkbox2_enabled = False
def draw(self):
imgui.begin("Example: checkboxes")
# note: first element of return two-tuple notifies... |
9990232 | from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from cms.toolbar_pool import toolbar_pool
from cms.toolbar_base import CMSToolbar
from cms.toolbar.items import Break
@toolbar_pool.register
class DiscountLinksToolbar(CMSToolbar):
''' Add discounts to the financial menu '''
... |
9990258 | from pyreact import useState, render, createElement as el
def App():
newItem, setNewItem = useState("")
editItem, setEditItem = useState("")
listItems, setListItems = useState([])
def handleSubmit(event):
event.preventDefault()
new_list = list(listItems) # Make a copy
if len(e... |
9990279 | import json
from transformers import *
import torch
from torch.utils.data import Dataset
import numpy as np
import copy
SPECIAL_TOKENS = ['[BOS]', '[EOS]', '[speaker1]', '[speaker2]', '[IMG]', '[TAG]', '[PAD]']
SPECIAL_TOKENS_DICT = {'bos_token':'[BOS]', 'eos_token':'[EOS]', 'additional_special_tokens':['[spea... |
9990309 | from datetime import datetime
from django.contrib import sitemaps
from django.urls import reverse
class StaticSitemapView(sitemaps.Sitemap):
priority = 0.5
changefreq = "daily"
def items(self):
return [
"weallcode-home",
"weallcode-our-story",
"weallcode-progr... |
9990341 | from .types import EnumType
from .models import BetfairModel
__all__ = ['EnumType', 'BetfairModel']
|
9990342 | from module import Module
import numpy as np
class Dropout(Module):
def __init__(self, p=0.5, v1=False, stochastic_inference=False):
super(Dropout, self).__init__()
self.p = p
self.train = True
self.stochastic_inference = stochastic_inference
# version 2 scales output duri... |
9990385 | import iarm.exceptions
from ._meta import _Meta
class UnconditionalBranch(_Meta):
def B(self, params):
"""
B label
Unconditional branch to the address at label
"""
label = self.get_one_parameter(self.ONE_PARAMETER, params)
self.check_arguments(label_exists=(label,... |
9990395 | from django.core import mail
from django.core.management import call_command
from django.urls import reverse
from guardian.shortcuts import get_users_with_perms
from ephios.core.models import AbstractParticipation, LocalParticipation, Notification
from ephios.core.services.notifications.backends import enabled_notific... |
9990396 | from pyworkflow.node import IONode, NodeException
from pyworkflow.parameters import *
import pandas as pd
import io
class TableCreatorNode(IONode):
"""Accepts raw-text CSV input to create data tables.
Raises:
NodeException: any error reading CSV file, converting
to DataFrame.
"""
... |
9990397 | from multiprocessing import Pipe, Pool
def proc_test1(conn):
conn.send("[小明]小张,今天哥们要见一女孩,你陪我呗,我24h等你回复哦~")
msg = conn.recv()
print(msg)
def proc_test2(conn):
msg = conn.recv()
print(msg)
conn.send("[小张]不去,万一被我帅气的外表迷倒就坑了~")
def main():
conn1, conn2 = Pipe()
p = Pool()
p.apply_as... |
9990409 | import pathlib
from setuptools import setup, find_packages
HERE = pathlib.Path(__file__).parent
VERSION = "1.0.0"
PACKAGE_NAME = "language-statistics"
AUTHOR = "<NAME>"
AUTHOR_EMAIL = "<EMAIL>"
URL = "https://github.com/Destaq/language-statistics"
LICENSE = "MIT License"
DESCRIPTION = "Generates a colored image show... |
9990418 | from .base import Message
from .message import AtableMessage, TextMessage, LinkMessage, MarkdownMessage, ActionCardMessage, SingleActionCardMessage, MultiActionCardMessage, FeedCardCardMessage
|
9990450 | def foo(event, context):
print event['data']
return 'foo'
def bar(event, context):
print event['data']
return'bar'
|
9990464 | from django import forms
from utils.forms import (
BootstrapMixin,
CustomNullBooleanSelect,
StaticSelectMultiple,
add_blank_choice,
)
from .enums import (
ContractsPolicy,
GeneralPolicy,
LocationsPolicy,
NetType,
Scope,
Traffic,
)
from .models import NetworkIXLan
class Networ... |
9990474 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
# Install Imbalanced-Learning with: pip install -U imbalanced-learn
# For further information: http://contrib.scikit-learn.org/imbalanced-learn/stable/index.html
from imblearn.over_sampling import SMOTE
from sklearn.datasets imp... |
9990513 | from ipykernel.kernelapp import IPKernelApp
from sage.repl.ipython_kernel.kernel import SageKernel
IPKernelApp.launch_instance(kernel_class=SageKernel)
|
9990544 | class NonCustom(object):
def __repr__(self):
return "noncustom"
class Custom(object):
def __hash__(self):
return 1
def __eq__(self, other):
return hash(self) == hash(other)
def __repr__(self):
return "custom"
d = dict()
d[True] = "true"
d[False] = "false"
d[1] =... |
9990597 | import sys
sys.path.append('../Grupo1/Instrucciones')
sys.path.append('../Grupo1/Utils')
sys.path.append('../Grupo1/Librerias/storageManager')
from jsonMode import *
from c3dGen import *
from instruccion import *
from Lista import *
from TablaSimbolos import *
from Error import *
class Create(Instruccion):
def... |
9990618 | from django.db import models
from django.utils.translation import gettext_lazy as _
from fluent_contents.models import ContentItemManager
from fluent_contents.models.db import ContentItem
class TwitterRecentEntriesItem(ContentItem):
"""
Content item to display recent entries of a twitter user.
"""
t... |
9990619 | import os
import sklearn
import subprocess
import bgen_reader
import copy
import warnings
from genome_integration.variants import SNP
from genome_integration.utils import PlinkFile
from .. samples import Sample
from .gcta_ma_utils import *
class BgenReader_using_library:
"""
This class is used to read in bge... |
9990635 | from .mcqa_data import McqaDataset
from .processors import (DataProcessor, RaceProcessor,
SynonymProcessor, SwagProcessor, ArcProcessor)
from .utils import (InputExample, InputFeatures, Split,
convert_examples_to_features, select_field)
__all__ = [
'McqaDataset',
'I... |
9990688 | from typing import Union
from genomics_data_index.api.query.SamplesQuery import SamplesQuery
from genomics_data_index.api.query.impl.cluster.ClusterScoreMethod import ClusterScoreMethod
from genomics_data_index.storage.SampleSet import SampleSet
class ClusterScoreMRCAJaccard(ClusterScoreMethod):
"""
A method... |
9990712 | from typing import cast, Dict
from haphilipsjs.typing import (
ActivitesTVType,
AmbilightCurrentConfiguration,
AmbilightSupportedStylesType,
AmbilightSupportedStyleType,
ApplicationIntentType,
ApplicationsType,
ChannelDbTv,
ChannelListType,
ComponentType,
ContextType,
Favorit... |
9990714 | import json
import logging
import os
import pickle
from bridgebots.double_dummy import DoubleDummyDeal
logging.basicConfig(level=logging.INFO)
HAND_RECORD_KEY = "handrecord"
processed_deals = set()
error_count = 0
duplicate_count = 0
with open("./results/double_dummy/all_deals.pickle", "wb") as dd_pickle_file:
... |
9990736 | from omniduct.databases.base import DatabaseClient
class StubDatabaseClient(DatabaseClient):
PROTOCOLS = []
DEFAULT_PORT = None
def _init(self):
pass
# Connection management
def _connect(self):
raise NotImplementedError
def _is_connected(self):
raise NotImplemented... |
9990775 | import socket
import time
import sys
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
server.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
# indefinitely when trying to receive data.
server.settimeout(0.2)
server.bind(("", 4444))
message = bytes(sys.argv[1],"UTF-8")
server.sendto(m... |
9990780 | import pandas as pd
import numpy as np
import os
import logging
import time
from pyarrow import ArrowIOError
from pyarrow.lib import ArrowInvalid
from polyfun_utils import check_package_versions, configure_logger, set_snpid_index, SNP_COLUMNS
if __name__ == '__main__':
import argparse
parser =... |
9990786 | import logging
from datetime import datetime, timedelta
from typing import Dict, Any
from django.conf import settings
from django.contrib.postgres.fields import HStoreField
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.timezone import now
from core.utils import get... |
9990851 | import logging
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class ListCommand(WikkedCommand):
def __init__(self):
super(ListCommand, self).__init__()
self.name = 'list'
self.description = "Lists page names in the ... |
9990878 | import time, requests
phone = 'Your Phone Number'
count = 0
while True:
r = requests.get('http://estock.xyzq.com.cn/validation/mobile?mobile=%s&_=1451390067874'%phone)
count += 1
print count
|
9990926 | from Account.model import Account
from Utils.Debug.Logger import Logger
from DB.Connection.LoginConnection import LoginConnection
class AccountManager(object):
def __init__(self):
self.account = None
def create(self, **kwargs):
name = kwargs.pop('name', '')
password = kwargs.pop('pas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.