content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from enum import IntEnum
class GameObjectType(IntEnum):
"""
Enumerations for game objects
"""
APPLE = 1
BANANA = 2
GRAPES = 3
LEMON = 4
ORANGE = 5
PINEAPPLE = 6
| [
6738,
33829,
1330,
2558,
4834,
388,
628,
198,
4871,
3776,
10267,
6030,
7,
5317,
4834,
388,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2039,
6975,
602,
329,
983,
5563,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3486,
16... | 2.186813 | 91 |
import unittest
from test_case import TestCase
import pinocchio as pin
pin.switchToNumpyMatrix()
from pinocchio.utils import rand, zero
import numpy as np
import warnings
# common quantities for all tests.
# They correspond to the default values of the arguments, and they need to stay this way
r_coeff = 0.0
inv_dampi... | [
11748,
555,
715,
395,
198,
6738,
1332,
62,
7442,
1330,
6208,
20448,
198,
11748,
6757,
420,
40900,
355,
6757,
198,
11635,
13,
31943,
2514,
45,
32152,
46912,
3419,
198,
6738,
6757,
420,
40900,
13,
26791,
1330,
43720,
11,
6632,
198,
11748,... | 3.20339 | 118 |
# How to merge two dictionaries using **
# in python 3.5+
first_dict = {'orange': 1, 'apples': 2}
second_dict = {'bananas': 3, 'pears': 4}
combined_dict = {**first_dict, **second_dict}
print(combined_dict)
# {'orange': 1, 'apples': 2, 'bananas': 3, 'pears': 4}
| [
2,
1374,
284,
20121,
734,
48589,
3166,
1262,
12429,
198,
2,
287,
21015,
513,
13,
20,
10,
198,
198,
11085,
62,
11600,
796,
1391,
6,
43745,
10354,
352,
11,
705,
1324,
829,
10354,
362,
92,
198,
12227,
62,
11600,
796,
1391,
6,
3820,
1... | 2.481132 | 106 |
from django.contrib.auth.models import User
from django.db import transaction, connection, IntegrityError
from django.test import TransactionTestCase, skipUnlessDBFeature
from .models import Test
from .test_utils import TestUtilsMixin
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
11,
4637,
11,
39348,
12331,
198,
6738,
42625,
14208,
13,
9288,
1330,
45389,
14402,
20448,
11,
14267,
28042,
11012,
38816,... | 3.95 | 60 |
from threading import Thread
from unittest import TestCase
from metrology.instruments.meter import Meter
| [
6738,
4704,
278,
1330,
14122,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
1138,
31142,
13,
259,
2536,
2886,
13,
27231,
1330,
46423,
628
] | 3.962963 | 27 |
from output.models.nist_data.list_pkg.g_month.schema_instance.nistschema_sv_iv_list_g_month_enumeration_1_xsd.nistschema_sv_iv_list_g_month_enumeration_1 import (
NistschemaSvIvListGMonthEnumeration1,
NistschemaSvIvListGMonthEnumeration1Type,
)
__all__ = [
"NistschemaSvIvListGMonthEnumeration1",
"Nists... | [
6738,
5072,
13,
27530,
13,
77,
396,
62,
7890,
13,
4868,
62,
35339,
13,
70,
62,
8424,
13,
15952,
2611,
62,
39098,
13,
77,
1023,
2395,
2611,
62,
21370,
62,
452,
62,
4868,
62,
70,
62,
8424,
62,
268,
6975,
341,
62,
16,
62,
87,
212... | 2.236025 | 161 |
import tensorflow as tf
from tensorflow import keras
print(tf.VERSION)
print(tf.keras.__version__)
from tensorflow.keras.applications.inception_v3 import InceptionV3
from tensorflow.keras.applications.xception import Xception
from tensorflow.keras.applications.densenet import DenseNet169,DenseNet201,DenseNet121
from ... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
1330,
41927,
292,
198,
198,
4798,
7,
27110,
13,
43717,
8,
198,
4798,
7,
27110,
13,
6122,
292,
13,
834,
9641,
834,
8,
198,
198,
6738,
11192,
273,
11125,
13,
6122,
29... | 2.704414 | 4,327 |
import logging
import sys
# Un-comment to see the response from Bluedart printed in stdout.
from bluedart.services.pickup_service import BlueDartPickupRequest
from examples.example_profile import PROFILE
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
pickup = BlueDartPickupRequest(PROFILE)
# Shipper De... | [
11748,
18931,
198,
198,
11748,
25064,
198,
198,
2,
791,
12,
23893,
284,
766,
262,
2882,
422,
1086,
1739,
433,
10398,
287,
14367,
448,
13,
198,
6738,
698,
1739,
433,
13,
30416,
13,
27729,
929,
62,
15271,
1330,
4518,
35,
433,
31686,
9... | 3.034722 | 432 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
2,
15069,
1853,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 3.871698 | 265 |
import os
import random
import shutil as shell
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import image_toolkit
| [
11748,
28686,
198,
11748,
4738,
198,
11748,
4423,
346,
355,
7582,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
2939,
62,
25981,
15813,
62... | 2.311688 | 77 |
#!/usr/bin/env python
# coding: utf-8
"""
Concatenate PCs from all spatiotemporal covariates and temporal covariates
to construct the pandas dataframe for final Covariates
used to train XGBoost, Lasso, Encoder-Decoder, etc.
"""
import pandas as pd
import cfg_target as cfg
import preprocess
if __name... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
19617,
25,
3384,
69,
12,
23,
201,
198,
37811,
201,
198,
3103,
9246,
268,
378,
21869,
422,
477,
15246,
5151,
368,
35738,
44829,
689,
290,
21964,
44829,
689,
201,
198,
1462,
56... | 2.679389 | 131 |
#!python
# Setup file dla pybench
#
# This file has to zaimportuj all tests to be run; it jest executed as
# Python source file, so you can do all kinds of manipulations here
# rather than having to edit the tests themselves.
#
# Note: Please keep this module compatible to Python 1.5.2.
#
# Tests may include features ... | [
2,
0,
29412,
198,
198,
2,
31122,
2393,
288,
5031,
12972,
26968,
198,
2,
198,
2,
770,
2393,
468,
284,
1976,
1385,
634,
23577,
477,
5254,
284,
307,
1057,
26,
340,
474,
395,
10945,
355,
198,
2,
11361,
2723,
2393,
11,
523,
345,
460,
... | 2.775623 | 361 |
# Generated by Django 2.0.5 on 2018-07-26 21:08
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
20,
319,
2864,
12,
2998,
12,
2075,
2310,
25,
2919,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
from coffer.utils import isRoot, text, getRootDir, getArg
from coffer import remove
import os
import sys
| [
6738,
19540,
263,
13,
26791,
1330,
318,
30016,
11,
2420,
11,
651,
30016,
35277,
11,
651,
28100,
198,
6738,
19540,
263,
1330,
4781,
198,
11748,
28686,
198,
11748,
25064,
198
] | 3.5 | 30 |
import os
from dotenv import load_dotenv
load_dotenv()
NAME = os.environ.get('DB_USER_NAME')
PASSWORD = os.environ.get('DB_PASSWORD')
HOST = os.environ.get('DB_HOST')
DB_NAME = os.environ.get('DB_NAME')
| [
11748,
28686,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
2220,
62,
26518,
24330,
3419,
198,
198,
20608,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
11012,
62,
29904,
62,
20608,
11537,
198,
47924,
54,
12532,
220,
79... | 2.37931 | 87 |
import traceback
import os
import base64
import geojson
import json
from six.moves.urllib.parse import urlparse
from wsgiref.util import FileWrapper
from django.db.models import Q, Min
from django.db import transaction, connection
from django.http import HttpResponse, HttpResponseRedirect
from django.core.files.base im... | [
11748,
12854,
1891,
198,
11748,
28686,
198,
11748,
2779,
2414,
198,
11748,
4903,
13210,
1559,
198,
11748,
33918,
198,
6738,
2237,
13,
76,
5241,
13,
333,
297,
571,
13,
29572,
1330,
19016,
29572,
198,
6738,
266,
45213,
557,
69,
13,
22602,... | 3.639188 | 837 |
from magma.t import Type
from fault.infix import Infix
import pysv
| [
6738,
2153,
2611,
13,
83,
1330,
5994,
198,
6738,
8046,
13,
10745,
844,
1330,
4806,
844,
198,
11748,
279,
893,
85,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628
] | 2.615385 | 39 |
from rest_framework import serializers
from .models import Breed, Anime, Website
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
764,
27530,
1330,
45958,
11,
27812,
11,
15887,
628,
628
] | 4.25 | 20 |
# Generated by Django 2.1.7 on 2019-03-30 09:38
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
22,
319,
13130,
12,
3070,
12,
1270,
7769,
25,
2548,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
"""
Log functional tests
"""
import os
import sys
import logging # To display the logging values
sys.path.insert(0, os.path.abspath('.'))
import log
if __name__ == '__main__':
test_logs()
| [
37811,
198,
11187,
10345,
5254,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
18931,
220,
1303,
1675,
3359,
262,
18931,
3815,
198,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
28686,
13,
6978,
13,
397,
2777,
776,
1... | 2.842857 | 70 |
input_data = input()
result_list = [str(x) for x in input_data]
result_tuple = tuple(result_list)
print(result_list)
print(result_tuple)
| [
15414,
62,
7890,
796,
5128,
3419,
198,
198,
20274,
62,
4868,
796,
685,
2536,
7,
87,
8,
329,
2124,
287,
5128,
62,
7890,
60,
198,
20274,
62,
83,
29291,
796,
46545,
7,
20274,
62,
4868,
8,
198,
4798,
7,
20274,
62,
4868,
8,
198,
4798... | 2.653846 | 52 |
#!/bin/python3
# move files to directories according to file name pattern
import os
import shutil
# get into the Datastructures directory
os.chdir('./DataStructures')
# Datastructuressession01Slide1.ppt
for f in os.listdir("."):
folder_name = f[14:23]
# print(folder_name)
if not os.path.exists(folder_n... | [
2,
48443,
8800,
14,
29412,
18,
198,
2,
1445,
3696,
284,
29196,
1864,
284,
2393,
1438,
3912,
198,
198,
11748,
28686,
198,
11748,
4423,
346,
628,
198,
2,
651,
656,
262,
16092,
459,
1356,
942,
8619,
198,
418,
13,
354,
15908,
7,
4458,
... | 2.446927 | 179 |
from time import sleep
print('\033[1;31m PROGRESSÃO ARITMÉTICA \033[m')
print('=-' * 20)
primeiro_termo = int(input('Primeiro termo: '))
razão = int(input('Razão: '))
contador = 0
mais = 1
total = 0
while mais != 0:
while contador < 10:
print('{}'.format(primeiro_termo), end='')
print(' -> ' if cont... | [
6738,
640,
1330,
3993,
198,
4798,
10786,
59,
44427,
58,
16,
26,
3132,
76,
38688,
49,
7597,
5746,
46,
5923,
2043,
44,
38351,
51,
25241,
3467,
44427,
58,
76,
11537,
198,
4798,
10786,
10779,
6,
1635,
1160,
8,
198,
35505,
7058,
62,
4354... | 2.26383 | 235 |
print (gcd(78, 252)) | [
198,
4798,
357,
70,
10210,
7,
3695,
11,
25264,
4008
] | 2.1 | 10 |
from telegram.ext import Defaults
from telegram.ext import Updater
from config import BOT_TOKEN
from config import SUDO_USERS
updater = Updater(
token=BOT_TOKEN,
defaults=Defaults(
parse_mode='HTML',
disable_web_page_preview=True,
quote=False,
run_async=True,
),
)
dp = upd... | [
6738,
573,
30536,
13,
2302,
1330,
2896,
13185,
198,
6738,
573,
30536,
13,
2302,
1330,
3205,
67,
729,
198,
198,
6738,
4566,
1330,
347,
2394,
62,
10468,
43959,
198,
6738,
4566,
1330,
311,
8322,
46,
62,
2937,
4877,
198,
198,
929,
67,
7... | 2.456338 | 355 |
# Copyright (c) 2011 - 2017, Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | [
2,
15069,
357,
66,
8,
2813,
532,
2177,
11,
8180,
10501,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
... | 2.098652 | 19,442 |
import unittest
import cscl_examples.smt_qfbv_solver.sorts as sorts
import cscl_examples.smt_qfbv_solver.syntactic_scope as synscope
import cscl_examples.smt_qfbv_solver.ast as ast
| [
11748,
555,
715,
395,
198,
11748,
269,
38528,
62,
1069,
12629,
13,
5796,
83,
62,
80,
21855,
85,
62,
82,
14375,
13,
82,
2096,
355,
10524,
198,
11748,
269,
38528,
62,
1069,
12629,
13,
5796,
83,
62,
80,
21855,
85,
62,
82,
14375,
13,
... | 2.459459 | 74 |
# Portions copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
# pyre-unsafe
"""A flow graph representation for Python bytecode"""
from __future__ import annotations
import sys
from contextlib import contextmanager
from types import CodeType
from typing import Generator, List, Optional
from . i... | [
2,
4347,
507,
6634,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
357,
4023,
1378,
2503,
13,
19024,
13,
785,
8,
198,
2,
12972,
260,
12,
13271,
8635,
198,
37811,
32,
5202,
4823,
10552,
329,
11361,
18022,
8189,
37811,
198,
67... | 2.856784 | 796 |
from __future__ import unicode_literals
import os
import sys
import logging
import transaction as db_transaction
from pyramid.paster import (
get_appsettings,
setup_logging,
)
from billy.models import setup_database
from billy.models.model_factory import ModelFactory
from billy.api.utils import get_processor_... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
18931,
198,
198,
11748,
8611,
355,
20613,
62,
7645,
2673,
198,
6738,
27944,
13,
79,
1603,
1330,
357,
198,
220,
220,
220,
651,
... | 3.367347 | 98 |
import enum
| [
11748,
33829,
628,
628,
198
] | 3.2 | 5 |
# 给你一个整数数组 arr 和一个目标值 target ,请你返回一个整数 value ,使得将数组中所有大于 value 的值变成 value 后,数组的和最接近 target (最接近表示两者之差的绝对值最小)。
#
# 如果有多种使得和最接近 target 的方案,请你返回这些整数中的最小值。
#
# 请注意,答案不一定是 arr 中的数字。
#
#
#
# 示例 1:
#
# 输入:arr = [4,9,3], target = 10
# 输出:3
# 解释:当选择 value 为 3 时,数组会变成 [3, 3, 3],和为 9 ,这是最接近 target 的方案。
# 示例 2:
#
# 输入:arr = [2,... | [
2,
13328,
119,
247,
19526,
254,
31660,
10310,
103,
46763,
112,
46763,
108,
46763,
108,
163,
119,
226,
1849,
3258,
10263,
240,
234,
31660,
10310,
103,
33566,
106,
43718,
229,
161,
222,
120,
1849,
16793,
27332,
120,
234,
46237,
115,
19526... | 1.123235 | 779 |
import py
from pypy.jit.codegen.i386.test.test_genc_ts import I386TimeshiftingTestMixin
from pypy.jit.timeshifter.test import test_timeshift
from pypy.jit.codegen.llvm.rgenop import RLLVMGenOp
from pypy.jit.codegen.llvm.llvmjit import llvm_version, MINIMAL_VERSION
| [
11748,
12972,
198,
6738,
279,
4464,
88,
13,
45051,
13,
8189,
5235,
13,
72,
21734,
13,
9288,
13,
9288,
62,
5235,
66,
62,
912,
1330,
314,
21734,
28595,
71,
13309,
14402,
35608,
259,
198,
6738,
279,
4464,
88,
13,
45051,
13,
22355,
71,
... | 2.576923 | 104 |
# -*- coding: utf-8 -*-
from redis import StrictRedis
import redis_lock
import time
redis = StrictRedis(host="127.0.0.1",
port=6379,
db=0)
lock = redis_lock.Lock(redis, "test")
while True:
if lock.acquire(blocking=False):
print("获得锁")
time.sleep(1)
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
2266,
271,
1330,
520,
2012,
7738,
271,
198,
11748,
2266,
271,
62,
5354,
198,
11748,
640,
628,
198,
445,
271,
796,
520,
2012,
7738,
271,
7,
4774,
2625,
16799,
13,... | 1.737991 | 229 |
#!/usr/bin/env python
import os
import sys
import signal
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
sys.path.append(os.path.join(BASE_DIR, 'tests'))
sys.path.append(os.path.join(BASE_DIR, 'dbes'))
signal.signal(signal.SIGTERM, sigterm_handler)
os.environ.setdefau... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
6737,
198,
198,
33,
11159,
62,
34720,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
400... | 2.476923 | 195 |
#
# gendata.py
#
# Generate example data for machine learning tests.
#
# Tucker Balch
# Nov 10, 2010
#
import numpy
import math
#
# Makes a ripple effect
#
#part1 = numpy.random.normal(loc=[0,0],scale=[5,5],size=[10000,2])
#part1y = part1[:,0]*part1[:,0] + part1[:,1]*part1[:,1]
#part1y = numpy.sqrt(part1[:,0]**2 + par... | [
2,
198,
2,
308,
437,
1045,
13,
9078,
198,
2,
198,
2,
2980,
378,
1672,
1366,
329,
4572,
4673,
5254,
13,
198,
2,
198,
2,
25951,
8528,
354,
198,
2,
5267,
838,
11,
3050,
198,
2,
198,
11748,
299,
32152,
198,
11748,
10688,
198,
198,
... | 2.046422 | 517 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from geodiff_worker import GeoDiffWorker
import os
def main():
"""Main entry point to the program."""
# Get the location of the AMQP broker (RabbitMQ server) from
# an environment variable
amqp_url = os.environ['AMQP_URL']
task_queue = os.environ['TA... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
4903,
375,
733,
62,
28816,
1330,
32960,
28813,
12468,
263,
198,
11748,
28686,
198,
198,
4299,
1388,
3352... | 2.404167 | 240 |
import sys
import subprocess
cmd = [sys.executable, 'speedtest.py', '--source', '127.0.0.1']
p = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
stdout, stderr = p.communicate()
if p.returncode != 1:
raise SystemExit('%s did not fail with exit code 1' % ' '.join(cmd))
if 'In... | [
11748,
25064,
198,
11748,
850,
14681,
198,
198,
28758,
796,
685,
17597,
13,
18558,
18187,
11,
705,
12287,
9288,
13,
9078,
3256,
705,
438,
10459,
3256,
705,
16799,
13,
15,
13,
15,
13,
16,
20520,
198,
198,
79,
796,
850,
14681,
13,
47,... | 2.395833 | 192 |
products = {}
command = input()
while command != "statistics":
command = input()
while command != "statistics":
tokens = command.split(": ")
product = tokens[0]
quantity = int(tokens[1])
if product not in products:
products[product] = 0
products[product] += quantity
print("Products in s... | [
29498,
796,
23884,
198,
21812,
796,
5128,
3419,
198,
4514,
3141,
14512,
366,
14269,
3969,
1298,
198,
220,
220,
220,
3141,
796,
5128,
3419,
198,
4514,
3141,
14512,
366,
14269,
3969,
1298,
198,
220,
220,
220,
16326,
796,
3141,
13,
35312,
... | 2.914773 | 176 |
import base64
from aws_cdk import (
core,
aws_ec2 as ec2,
aws_autoscaling as autoscaling,
aws_elasticloadbalancingv2 as elb
)
| [
11748,
2779,
2414,
198,
198,
6738,
3253,
82,
62,
10210,
74,
1330,
357,
198,
220,
220,
220,
4755,
11,
198,
220,
220,
220,
3253,
82,
62,
721,
17,
355,
9940,
17,
11,
198,
220,
220,
220,
3253,
82,
62,
2306,
17500,
4272,
355,
1960,
1... | 1.808511 | 94 |
# 1. import everything
import numpy as np
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
import pandas as pd
from flask import Flask, jsonify
#################################################
# Database Setup
###########... | [
2,
352,
13,
1330,
2279,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
44161,
282,
26599,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
2306,
296,
499,
1330,
3557,
499,
62,
8692,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
23575,... | 2.868571 | 525 |
# coding:utf-8
from LxData.datObjects import _datObjRaw
from LxGraphic import grhCfg, grhObjAbs
from LxGraphic.grhObjects import _grhObjStack, _grhObjQuery
from .. import houBscCfg, houBscObjAbs
GRH_OBJ_QUERYRAW_CREATOR = ObjQueryrawCreator()
GRH_OBJ_QUERY_BUILDER = ObjQueryBuilder(
houBscCfg.HouBscUtil... | [
2,
19617,
25,
40477,
12,
23,
198,
6738,
406,
87,
6601,
13,
19608,
10267,
82,
1330,
4808,
19608,
49201,
27369,
198,
198,
6738,
406,
87,
38,
22262,
1330,
1036,
71,
34,
40616,
11,
1036,
71,
49201,
24849,
198,
198,
6738,
406,
87,
38,
... | 2.824859 | 177 |
import torch
import torch.nn as nn
import numpy as np
import torchvision.transforms as T
from utils import *
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
309,
198,
6738,
3384,
4487,
1330,
1635,
198
] | 3.40625 | 32 |
import sys
script, filename = sys.argv
txt = open(filename)
print "Your filename is %r" % filename
print txt.read()
print "Type the filename again:"
file_again = raw_input('> ')
txt_again = open(file_again)
print txt_again.read()
| [
11748,
25064,
198,
198,
12048,
11,
29472,
796,
25064,
13,
853,
85,
198,
14116,
796,
1280,
7,
34345,
8,
198,
198,
4798,
366,
7120,
29472,
318,
4064,
81,
1,
4064,
29472,
198,
4798,
256,
742,
13,
961,
3419,
198,
198,
4798,
366,
6030,
... | 2.9125 | 80 |
from .extensions import broker
# Define your asynchronous actors here. For example:
#
# @broker.actor
# def process_job(param):
# pass
| [
6738,
764,
2302,
5736,
1330,
20426,
198,
198,
2,
2896,
500,
534,
39354,
10544,
994,
13,
1114,
1672,
25,
198,
2,
198,
2,
220,
220,
220,
220,
2488,
7957,
6122,
13,
11218,
198,
2,
220,
220,
220,
220,
825,
1429,
62,
21858,
7,
17143,
... | 2.666667 | 57 |
import numpy as np
from abc import ABC, abstractmethod
Q1_quad = np.array([[1, 0], [0, 1]])
Q2_quad = np.array([[5, 0], [0, 1]])
Q3_quad = np.array([[np.sqrt(3) / 2, -0.5], [0.5, np.sqrt(3) / 2]]).transpose() @ np.array(
[[5, 0], [0, 1]]) @ np.array(
[[np.sqrt(3) / 2, -0.5], [0.5, np.sqrt(3) / 2]])
## con... | [
11748,
299,
32152,
355,
45941,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
198,
48,
16,
62,
47003,
796,
45941,
13,
18747,
26933,
58,
16,
11,
657,
4357,
685,
15,
11,
352,
11907,
8,
198,
48,
17,
62,
47003,
796,
45941,
13,... | 1.795367 | 259 |
# Gets master list of venue information from NUSMods' GitHub
# Preprocesses data with venue availability before insertion into database
import urllib.request
import requests
import json
import pandas as pd
data_url = "https://raw.githubusercontent.com/nusmodifications/nusmods/" \
+ "master/website/src/data/venues.... | [
2,
29620,
4958,
1351,
286,
14359,
1321,
422,
399,
2937,
24239,
6,
21722,
198,
2,
3771,
14681,
274,
1366,
351,
14359,
11500,
878,
36075,
656,
6831,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
... | 2.367911 | 723 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
import json
import os
import re
from PyQt5.QtCore import QRegExp, QUrl
from PyQt5.QtGui import QTextCursor, QColor, QDesktopServices
from PyQt5.QtWidgets import QDialog, QMessageBox, QTextEdit
from ui_correct import Ui_CorrectDialog
from readers import find_reader
i... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
13... | 2.591241 | 137 |
from idea_core.idea_base import Idea
| [
6738,
2126,
62,
7295,
13,
485,
64,
62,
8692,
1330,
37560,
198
] | 3.083333 | 12 |
print("\n\nWELCOME TO PIZZA PI R SQUARED. \n\nWhat's it do? \n\nIt lets you determine whether buying a small pizza or a large pizza is a better value.")
diameter_one = float(input("\nWhat's the first pizza's diameter (in inches)?"))
cost_one = float(input("\nHow much does the first pizza cost? (in dollars and cents)... | [
4798,
7203,
59,
77,
59,
77,
54,
3698,
9858,
36,
5390,
350,
14887,
34892,
30434,
371,
45880,
1503,
1961,
13,
3467,
77,
59,
77,
2061,
338,
340,
466,
30,
220,
3467,
77,
59,
77,
1026,
8781,
345,
5004,
1771,
7067,
257,
1402,
14256,
393... | 2.970223 | 403 |
"""
Tests for salt.utils.jinja
"""
import salt.config
import salt.loader
# dateutils is needed so that the strftime jinja filter is loaded
import salt.utils.dateutils # pylint: disable=unused-import
import salt.utils.files
import salt.utils.json
import salt.utils.stringutils
import salt.utils.yaml
from salt.utils.ji... | [
37811,
198,
51,
3558,
329,
8268,
13,
26791,
13,
18594,
6592,
198,
37811,
198,
198,
11748,
8268,
13,
11250,
198,
11748,
8268,
13,
29356,
198,
198,
2,
3128,
26791,
318,
2622,
523,
326,
262,
965,
31387,
474,
259,
6592,
8106,
318,
9639,
... | 2.808602 | 465 |
# -*- coding: utf-8 -*-
from tests.utils import BaseIntegrationTest
from tests.apps.basic_app import app
__author__ = 'sobolevn'
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
5254,
13,
26791,
1330,
7308,
34500,
1358,
14402,
198,
6738,
5254,
13,
18211,
13,
35487,
62,
1324,
1330,
598,
198,
198,
834,
9800,
834,
796,
705,
568,
2127,
... | 2.714286 | 49 |
from sqlalchemy import create_engine
from sqlalchemy import Table, MetaData
import os
password = os.environ.get("PASSWORD")
engine = create_engine(f'postgres://postgres:{password}@localhost/red30')
with engine.connect() as connection:
meta = MetaData(engine)
sales_table = Table('sales', meta, autoload=True, autolo... | [
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
6738,
44161,
282,
26599,
1330,
8655,
11,
30277,
6601,
198,
11748,
28686,
198,
198,
28712,
796,
28686,
13,
268,
2268,
13,
1136,
7203,
47924,
54,
12532,
4943,
198,
198,
18392,
796,
2251... | 3.1 | 190 |
import sys
# Задание: Первая строка входа содержит целые числа 1 ≤ W ≤ 10 и 1 ≤ n ≤ 300 - вместимость рюкзака
# и число золотых слитков. Следующая строка содержит nn целых чисел 0 ≤ w1, ....., wn ≤ 10^5,
# задающих веса слитков. Найдите максимальный вес золота, который можно унести в рюкзаке.
# Input:
# 10 3
# 1 4 8
... | [
11748,
25064,
198,
198,
2,
12466,
245,
16142,
43666,
16142,
22177,
18849,
16843,
25,
12466,
253,
16843,
21169,
38857,
16142,
40623,
220,
21727,
20375,
21169,
25443,
118,
16142,
12466,
110,
141,
227,
25443,
112,
16142,
220,
21727,
25443,
112... | 1.229851 | 335 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from epivizfileserver import parser
import sys
import os
__author__ = "Jayaram Kancherla"
__copyright__ = "Jayaram Kancherla"
__license__ = "mit"
# Data location
# data_path = sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '/dat... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
12972,
9288,
198,
6738,
2462,
452,
528,
16624,
18497,
1330,
30751,
198,
11748,
25064,
198,
11748,
28686,
198,... | 2.541667 | 144 |
# tensors
import torch
import numpy as np
# init a tensor
# directly from data
data = [[1, 2], [3, 4]]
x_data = torch.tensor(data)
# from numpy array
np_array = np.array(data)
x_np = torch.from_numpy(np_array)
# from another tensor
x_ones = torch.ones_like(x_data)
print(f"Ones Tensor: \n {x_ones} \n")
x_rand = torc... | [
2,
11192,
669,
198,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
2315,
257,
11192,
273,
198,
2,
3264,
422,
1366,
198,
7890,
796,
16410,
16,
11,
362,
4357,
685,
18,
11,
604,
11907,
198,
87,
62,
7890,
796,
280... | 2.311893 | 824 |
"""
OpenNSA NML topology model.
Author: Henrik Thostrup Jensen <htj@nordu.net>
Copyright: NORDUnet (2011-2013)
"""
import itertools
import datetime
from twisted.python import log
from opennsa import constants as cnt, nsa, error
LOG_SYSTEM = 'opennsa.topology'
INGRESS = 'ingress'
EGRESS = 'egress'
cla... | [
37811,
198,
11505,
47549,
399,
5805,
1353,
1435,
2746,
13,
198,
198,
13838,
25,
6752,
12602,
536,
455,
12618,
32623,
1279,
4352,
73,
31,
77,
585,
84,
13,
3262,
29,
198,
198,
15269,
25,
399,
12532,
3118,
316,
357,
9804,
12,
6390,
8,
... | 2.734104 | 173 |
from setuptools import setup, find_packages
# set the __version__
exec(open('nuctools/_version.py').read())
setup(
name='nuctools',
version=__version__,
description="nuclear data reduction tools",
author="Jesse Brown",
author_email="brownjm1968@gmail.com",
packages=['nuctools'],
license='B... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
2,
900,
262,
11593,
9641,
834,
198,
18558,
7,
9654,
10786,
77,
4782,
10141,
47835,
9641,
13,
9078,
27691,
961,
28955,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
... | 2.484848 | 198 |
import os
import shutil
import logging
import asyncio
from aiohttp import web
from tempfile import mkstemp
from pantomime import normalize_mimetype, normalize_extension
from convert.converter import FORMATS, PdfConverter
from convert.converter import ConversionFailure
MEGABYTE = 1024 * 1024
BUFFER_SIZE = 8 * MEGABYTE... | [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
18931,
198,
11748,
30351,
952,
198,
6738,
257,
952,
4023,
1330,
3992,
198,
6738,
20218,
7753,
1330,
33480,
927,
79,
198,
6738,
279,
11456,
524,
1330,
3487,
1096,
62,
76,
320,
2963,
431,
... | 2.785124 | 242 |
from clarifai.rest import ClarifaiApp
from clarifai.rest import Image as ClImage
import pprint
print ('First Clarifai Image Analysis...')
app = ClarifaiApp(api_key='58f63802f55d48dda796b79ccf2b4792')
model = app.models.get('general-v1.3')
image = ClImage(file_obj=open('../../../images/top-hp-001.jpg','rb'))... | [
6738,
10212,
361,
1872,
13,
2118,
1330,
15420,
361,
1872,
4677,
201,
198,
6738,
10212,
361,
1872,
13,
2118,
1330,
7412,
355,
1012,
5159,
201,
198,
11748,
279,
4798,
201,
198,
201,
198,
4798,
19203,
5962,
15420,
361,
1872,
7412,
14691,
... | 2.48855 | 262 |
"""Sliding windows for connectivity functions."""
from frites.io import set_log_level, logger
import numpy as np
def define_windows(times, windows=None, slwin_len=None, slwin_start=None,
slwin_stop=None, slwin_step=None, verbose=None):
"""Define temporal windows.
This function can be used... | [
37811,
11122,
2530,
9168,
329,
19843,
5499,
526,
15931,
198,
6738,
277,
23156,
13,
952,
1330,
900,
62,
6404,
62,
5715,
11,
49706,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
8160,
62,
28457,
7,
22355,
11,
9168,
28,
14202,... | 2.501896 | 2,110 |
import itertools
import os
import sys
import click
from tabulate import tabulate
import utilities_common.cli as clicommon
from swsscommon.swsscommon import ConfigDBConnector
#
# 'kdump' group (show kdump ...)
#
@click.group(cls=clicommon.AliasedGroup, name="kdump")
def kdump():
"""Show kdump configuration, dump ... | [
11748,
340,
861,
10141,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
3904,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
198,
11748,
20081,
62,
11321,
13,
44506,
355,
537,
291,
2002,
261,
198,
6738,
1509,
824,
11321,
13,
2032,... | 2.624434 | 1,326 |
import re
| [
11748,
302,
198
] | 3.333333 | 3 |
from app import oauth
import os
google = oauth.remote_app(
'google',
consumer_key=str(os.getenv('GOOGLE_CLIENT_ID')),
consumer_secret=str(os.getenv('GOOGLE_CLIENT_ID_SECRET')),
request_token_params={
'scope': 'https://www.googleapis.com/auth/userinfo.email'
},
base_url='https://www.goo... | [
6738,
598,
1330,
267,
18439,
198,
11748,
28686,
628,
198,
13297,
796,
267,
18439,
13,
47960,
62,
1324,
7,
198,
220,
220,
220,
705,
13297,
3256,
198,
220,
220,
220,
7172,
62,
2539,
28,
2536,
7,
418,
13,
1136,
24330,
10786,
38,
6684,
... | 2.424863 | 732 |
#!/usr/bin/env python3
# author: grey@christoforo.net
import ipaddress
import numpy
import sys
import time
import math
import k2450 # functions to talk to a keithley 2450 sourcemeter
import rs # grey's sheet resistance library
# for plotting
import matplotlib.pyplot as plt
plt.switch_backend("Qt5Agg")
# debugging/te... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
1772,
25,
13791,
31,
43533,
78,
1640,
78,
13,
3262,
198,
11748,
20966,
21975,
198,
11748,
299,
32152,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
10688,
198,
198,
11748,
479... | 3.043165 | 139 |
import requests as r
import os
import json
url = "https://api.forecast.io/forecast/" + os.environ['DARK_SKY_KEY']
| [
11748,
7007,
355,
374,
198,
11748,
28686,
198,
11748,
33918,
198,
198,
6371,
796,
366,
5450,
1378,
15042,
13,
754,
2701,
13,
952,
14,
754,
2701,
30487,
1343,
28686,
13,
268,
2268,
17816,
35,
14175,
62,
18831,
56,
62,
20373,
20520,
198... | 2.738095 | 42 |
"""Sensor definitions."""
import importlib
import logging
import yaml
LOGGER = logging.getLogger(__name__)
DEFAULTS = {
'sensors': [
{'class': 'RiseAndFallSensor'},
{'class': 'CpuLoadAverage'},
{'class': 'ConstantSensor'},
{'class': 'ConstantSensor', 'kwargs': {'value': 5, 'name... | [
37811,
47864,
17336,
526,
15931,
198,
11748,
1330,
8019,
198,
11748,
18931,
198,
198,
11748,
331,
43695,
628,
198,
25294,
30373,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
7206,
7708,
35342,
796,
1391,
198,
220,
... | 2.217391 | 184 |
from lemoncheesecake.matching.matcher import Matcher, MatchResult
| [
6738,
18873,
2395,
274,
46557,
13,
15699,
278,
13,
6759,
2044,
1330,
6550,
2044,
11,
13225,
23004,
628,
628
] | 3.631579 | 19 |
import threading
import random
import time
gMoney = 10000
gCondition = threading.Condition()
#生产者 消费者是多线程的一种模式
gTotalTimes = 10
gTime = 0
# 生产者
#消费者
if __name__ == "__main__":
main() | [
11748,
4704,
278,
198,
11748,
4738,
198,
11748,
640,
198,
70,
26788,
796,
33028,
198,
70,
48362,
796,
4704,
278,
13,
48362,
3419,
198,
198,
2,
37955,
12859,
100,
38519,
10545,
114,
42062,
112,
117,
38519,
42468,
13783,
248,
163,
118,
... | 1.854369 | 103 |
"""Unit tests for reviewboard.reviews.admin."""
from __future__ import unicode_literals
from django.core import urlresolvers
from reviewboard.reviews.models import DefaultReviewer
from reviewboard.testing.testcase import TestCase
class DefaultReviewerFormTests(TestCase):
"""Tests for reviewboard.reviews.admin:... | [
37811,
26453,
5254,
329,
2423,
3526,
13,
19023,
82,
13,
28482,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
7295,
1330,
19016,
411,
349,
690,
198,
198,
6738,
2423,
... | 2.396352 | 603 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
from .ranking import * | [
6738,
764,
28405,
1330,
1635
] | 4.4 | 5 |
from dataclasses import dataclass
from typing import Dict
from typing import Iterable
from typing import Optional
from typing import Union
import click
@dataclass(frozen=True, repr=False)
class ForwardingPortArgument(click.ParamType):
"""
Command line type for an integer or a pair of integers.
Helpful... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
40806,
540,
198,
6738,
19720,
1330,
32233,
198,
6738,
19720,
1330,
4479,
198,
198,
11748,
3904,
628,
198,
31,
19608,
330,
31172,
7... | 2.938725 | 408 |
# https://www.hackerrank.com/challenges/s10-normal-distribution-1/problem
# Enter your code here. Read input from STDIN. Print output to STDOUT
from math import erf
m, sd = list(map(int, input().split(" ")))
q1 = float(input())
q2a, q2b = list(map(float, input().split(" ")))
p1 = 0.5 + 0.5 *erf((q1-m)/(sd*2**0.5))
p2 ... | [
2,
3740,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
14,
82,
940,
12,
11265,
12,
17080,
3890,
12,
16,
14,
45573,
198,
198,
2,
6062,
534,
2438,
994,
13,
4149,
5128,
422,
48571,
1268,
13,
12578,
5072,
284,
48571,
12... | 2.159794 | 194 |
"""
https://leetcode.com/explore/challenge/card/march-leetcoding-challenge-2021/589/week-2-march-8th-march-14th/3666/
"""
from collections import deque
from kevin.utils.bst import TreeNode
| [
37811,
198,
5450,
1378,
293,
316,
8189,
13,
785,
14,
20676,
382,
14,
36747,
3540,
14,
9517,
14,
76,
998,
12,
293,
14784,
7656,
12,
36747,
3540,
12,
1238,
2481,
14,
44169,
14,
10464,
12,
17,
12,
76,
998,
12,
23,
400,
12,
76,
998,... | 2.56 | 75 |
from __future__ import absolute_import
import six
from sentry.app import locks
from sentry.models import OrganizationOption
from sentry.plugins import providers
from sentry.models import Integration
from sentry.utils.http import absolute_uri
from sentry.integrations.exceptions import ApiError, IntegrationError
from s... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
2237,
198,
6738,
1908,
563,
13,
1324,
1330,
19253,
198,
6738,
1908,
563,
13,
27530,
1330,
12275,
19722,
198,
6738,
1908,
563,
13,
37390,
1330,
9549,
198,
6738,
1908,
563,
... | 3.830357 | 112 |
from pymysqlreplication import BinLogStreamReader
from unimeta.libs.liburl import parse_url
from pymysqlreplication.row_event import (
DeleteRowsEvent,
UpdateRowsEvent,
WriteRowsEvent,
)
from typing import Dict
from devtools import debug
from unimeta.event import Event, EventType
from unimeta.table import T... | [
6738,
279,
4948,
893,
13976,
35666,
3299,
1330,
20828,
11187,
12124,
33634,
198,
6738,
28418,
17167,
13,
8019,
82,
13,
8019,
6371,
1330,
21136,
62,
6371,
198,
6738,
279,
4948,
893,
13976,
35666,
3299,
13,
808,
62,
15596,
1330,
357,
198,... | 3.376344 | 186 |
"""
.. _intermediate_using_spark_tasks:
Creating spark tasks as part of your workflow OR running spark jobs
------------------------------------------------------------------------
This example shows how flytekit simplifies usage of pyspark in a users code.
The task ``hello_spark`` runs a new spark cluster, which whe... | [
37811,
198,
492,
4808,
3849,
13857,
62,
3500,
62,
2777,
668,
62,
83,
6791,
25,
198,
198,
32071,
9009,
8861,
355,
636,
286,
534,
30798,
6375,
2491,
9009,
3946,
198,
10097,
982,
198,
198,
1212,
1672,
2523,
703,
6129,
660,
15813,
7106,
... | 3.242487 | 965 |
import os
from langdetect import detect
import pandas as pd
import dask.dataframe as dd
from utils import get_project_path
# Parameters.
abs_project_path = get_project_path(__file__)
df_path = os.path.join(abs_project_path, "/data/dota2_chat_messages.csv")
# Loading the data.
df = pd.read_csv(df_path)
# Replacing na... | [
11748,
28686,
198,
6738,
42392,
15255,
478,
1330,
4886,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
288,
2093,
13,
7890,
14535,
355,
49427,
198,
6738,
3384,
4487,
1330,
651,
62,
16302,
62,
6978,
198,
198,
2,
40117,
13,
198,
8937... | 2.735202 | 321 |
#-----------------------------------------------------------------------------
# Name: Assertions (assertions.py)
# Purpose: To provide examples of how to use assertions in Python to
# ensure your programs are working as expected.
#
# Author: Mr. Seidel
# Created: 06-Sep-2018
# Updated: 0... | [
2,
10097,
32501,
198,
2,
6530,
25,
220,
220,
220,
220,
220,
220,
220,
2195,
861,
507,
357,
30493,
507,
13,
9078,
8,
198,
2,
32039,
25,
220,
220,
220,
220,
1675,
2148,
6096,
286,
703,
284,
779,
29965,
287,
11361,
284,
198,
2,
197... | 3.361472 | 462 |
"""
This file creates all the dataloaders used in the vision experiments.
"""
import os
import random
import tarfile
import numpy as np
import torch
import torchvision
class FilteredDataset(torch.utils.data.Dataset):
"""A dataset class used to apply a filter to a dataset based on some metainfo.
Args:
... | [
37811,
198,
1212,
2393,
8075,
477,
262,
4818,
282,
1170,
364,
973,
287,
262,
5761,
10256,
13,
198,
37811,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
13422,
7753,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
117... | 2.309582 | 5,333 |
import unittest
from one_away import *
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
530,
62,
8272,
1330,
1635,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.542857 | 35 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import abc
class AdversarialDefensiveModel(ADType, nn.Module):
"""
Define some basic properties.
"""
if __name__ == "__main__":
model = AdversarialDefensiveModel()
model.child1 = AdversarialDefensiveModel()
model.chil... | [
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
450,
66,
198,
198,
4871,
1215,
690,
36098,
7469,
2021,
17633,
7,
2885,
6030,
11,
299,
77,
13,
26796,
... | 2.609756 | 205 |
from __future__ import print_function
import imp
import numpy as np
import math
import torch
import torch.utils.data
from torch.utils.data import DataLoader
import torch.nn.functional as F
import torch.nn as nn
from train.augment.augmentor import Augmentor
from time import time
downsample_avg = nn.AvgPool2d(kernel... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
848,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
26791,
13,
7890,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17... | 2.959184 | 147 |
from django.core.management.base import BaseCommand
from django.db import transaction
import photograph
import cv
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
198,
11748,
8408,
198,
11748,
269,
85,
628
] | 4.107143 | 28 |
from tests.test_utils import TestUtils, TestWrapper
# Workflow
# Logged out
# Missing fields
# Invalid Fields
| [
6738,
5254,
13,
9288,
62,
26791,
1330,
6208,
18274,
4487,
11,
6208,
36918,
2848,
628,
198,
2,
5521,
11125,
628,
198,
2,
50098,
503,
628,
198,
2,
25639,
7032,
628,
198,
198,
2,
17665,
23948,
198
] | 3.305556 | 36 |
# -*- coding: utf-8 -*-
from common.base_test import BaseTest
import lemoncheesecake.api as lcc
from lemoncheesecake.matching import check_that, equal_to, is_not_none, require_that
SUITE = {
"description": "Method 'get_block_virtual_ops'"
}
@lcc.prop("main", "type")
@lcc.prop("positive", "type")
@lcc.prop("nega... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
2219,
13,
8692,
62,
9288,
1330,
7308,
14402,
198,
198,
11748,
18873,
2395,
274,
46557,
13,
15042,
355,
300,
535,
198,
6738,
18873,
2395,
274,
46557,
13,
15699,
278... | 2.688976 | 254 |
import pandas as pd
import numpy as np
from sklearn.metrics import roc_auc_score
from farm.utils import MLFlowLogger
from haystack.retriever.elasticsearch import ElasticsearchRetriever
from sklearn.metrics.pairwise import cosine_similarity
from covid_nlp.eval import evalQuestion
class evalPretrainedTransformers(objec... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
686,
66,
62,
14272,
62,
26675,
198,
6738,
5318,
13,
26791,
1330,
10373,
37535,
11187,
1362,
198,
6738,
27678,
25558... | 2.897436 | 312 |
# Generated by Django 3.1.6 on 2021-03-13 21:39
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
21,
319,
33448,
12,
3070,
12,
1485,
2310,
25,
2670,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
# -*- coding: utf-8 -*-
"""
.. image:: https://img.shields.io/pypi/pyversions/mydatapreprocessing.svg
:target: https://pypi.python.org/pypi/mydatapreprocessing/
:alt: Py versions
.. image:: https://badge.fury.io/py/mydatapreprocessing.svg
:target: https://badge.fury.io/py/mydatapreprocessing
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
37811,
201,
198,
492,
2939,
3712,
3740,
1378,
9600,
13,
26662,
82,
13,
952,
14,
79,
4464,
72,
14,
9078,
47178,
14,
1820,
19608,
499,
260,
36948,
13,
2... | 2.584934 | 1,978 |
##########################################################################
#
# Various functions for transforming financial data.
#
##########################################################################
# SimFin - Simple financial data for Python.
# www.simfin.com - www.github.com/simfin/simfin
# See README.md for ... | [
29113,
29113,
7804,
2235,
198,
2,
198,
2,
26386,
5499,
329,
25449,
3176,
1366,
13,
198,
2,
198,
29113,
29113,
7804,
2235,
198,
2,
3184,
18467,
532,
17427,
3176,
1366,
329,
11361,
13,
198,
2,
7324,
13,
14323,
15643,
13,
785,
532,
732... | 2.908545 | 3,827 |
# Standard lib modules
import unittest
from unittest.mock import patch
from .context import Clappform
from .settings import settings
from Clappform.auth import Auth as Auth
| [
2,
8997,
9195,
13103,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
764,
22866,
1330,
1012,
1324,
687,
198,
6738,
764,
33692,
1330,
6460,
198,
6738,
1012,
1324,
687,
13,
18439,
1330,
2... | 3.804348 | 46 |
import os
from distutils.version import LooseVersion
from conftest import unit_stop
from unit.applications.lang.python import TestApplicationPython
from unit.option import option
| [
11748,
28686,
198,
6738,
1233,
26791,
13,
9641,
1330,
6706,
577,
14815,
198,
198,
6738,
369,
701,
395,
1330,
4326,
62,
11338,
198,
6738,
4326,
13,
1324,
677,
602,
13,
17204,
13,
29412,
1330,
6208,
23416,
37906,
198,
6738,
4326,
13,
18... | 4.022222 | 45 |
s = Student("becky", 1)
s2 = Student("Dave", 13)
print(Student.setScore(s, 0, 60))
print(Student.getHighScore(s))
| [
628,
198,
82,
796,
13613,
7203,
27343,
88,
1600,
352,
8,
198,
82,
17,
796,
13613,
7203,
27984,
1600,
1511,
8,
198,
198,
4798,
7,
38778,
13,
2617,
26595,
7,
82,
11,
657,
11,
3126,
4008,
198,
4798,
7,
38778,
13,
1136,
11922,
26595,
... | 2.458333 | 48 |
from click.testing import CliRunner
from popper import __version__
from popper import _version_file
from popper.commands import cmd_version
from .test_common import PopperTest
| [
6738,
3904,
13,
33407,
1330,
1012,
72,
49493,
198,
198,
6738,
745,
2848,
1330,
11593,
9641,
834,
198,
6738,
745,
2848,
1330,
4808,
9641,
62,
7753,
198,
6738,
745,
2848,
13,
9503,
1746,
1330,
23991,
62,
9641,
198,
6738,
764,
9288,
62,
... | 3.708333 | 48 |
from fastapi import FastAPI
from app.routers import meesman, brandnewday, zwitserleven
tags_metadata = [
{
"name": "Brand New Day",
}, {
"name": "Meesman",
}, {
"name": "Zwitserleven",
},
]
app = FastAPI(
title="Quotes",
description='''
The purpose of this project is to... | [
6738,
3049,
15042,
1330,
12549,
17614,
198,
198,
6738,
598,
13,
472,
1010,
1330,
502,
274,
805,
11,
4508,
3605,
820,
11,
1976,
86,
896,
263,
293,
574,
198,
198,
31499,
62,
38993,
796,
685,
198,
220,
220,
220,
1391,
198,
220,
220,
... | 3.060417 | 480 |
"""
Buffer stdout and/or stderr during test execution, appending any
output to the error reports of failed tests.
This allows you to use print for debugging in tests without making
your test runs noisy.
This plugin implements :func:`startTest`, :func:`stopTest`,
:func:`setTestOutcome`, :func:`outcomeDetail`, :func:`b... | [
37811,
198,
28632,
14367,
448,
290,
14,
273,
336,
1082,
81,
1141,
1332,
9706,
11,
598,
1571,
597,
198,
22915,
284,
262,
4049,
3136,
286,
4054,
5254,
13,
198,
198,
1212,
3578,
345,
284,
779,
3601,
329,
28769,
287,
5254,
1231,
1642,
1... | 2.707851 | 777 |
import pycountry_un as wesp
import pycountry
| [
11748,
12972,
19315,
62,
403,
355,
266,
9774,
198,
11748,
12972,
19315,
628
] | 3.538462 | 13 |
#!/usr/bin/python
CONFIG = {
}
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
10943,
16254,
796,
1391,
198,
198,
92,
198
] | 1.941176 | 17 |
from bs4 import BeautifulSoup
from kik_unofficial.datatypes.exceptions import KikApiException
| [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
6738,
479,
1134,
62,
403,
16841,
13,
19608,
265,
9497,
13,
1069,
11755,
1330,
40571,
32,
14415,
16922,
628,
628,
198
] | 3.193548 | 31 |
import itertools
from typing import List
import json
import logging
import torch
from tqdm import tqdm
import pickle
from pytorch_transformers.tokenization_bert import BertTokenizer
from torch.utils.data import TensorDataset
import os
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',... | [
11748,
340,
861,
10141,
198,
6738,
19720,
1330,
7343,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28034,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
2298,
293,
198,
6738,
12972,
13165,
354,
62,
35636,
364,
13,
300... | 2.297794 | 272 |