content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import pytest
from app.routes import is_running_locally
@pytest.mark.parametrize('url,expected_res', [
('http://localhost:5000/test', True),
('http://127.0.0.1:5000/test', True),
('http://live.website/test', False),
])
| [
11748,
12972,
9288,
198,
198,
6738,
598,
13,
81,
448,
274,
1330,
318,
62,
20270,
62,
17946,
453,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
10786,
6371,
11,
40319,
62,
411,
3256,
685,
198,
220,
220,
220,
19203,
... | 2.516129 | 93 |
from kivy.app import App
from kivy.uix.button import Button
from kivy import utils
if __name__ == "__main__":
MainApp().run()
| [
6738,
479,
452,
88,
13,
1324,
1330,
2034,
198,
6738,
479,
452,
88,
13,
84,
844,
13,
16539,
1330,
20969,
198,
6738,
479,
452,
88,
1330,
3384,
4487,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
2... | 2.62 | 50 |
from __future__ import absolute_import, unicode_literals
from django.apps import AppConfig
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.72 | 25 |
import asyncio
import json
from typing import List
from websockets.legacy.client import WebSocketClientProtocol
from nbr.schemas.message import Content
from nbr.schemas.result import ExecutionStatus, RunResult
from nbr.schemas.session import Session
from nbr.utils.message import create_message
from nbr.utils.websocke... | [
11748,
30351,
952,
198,
11748,
33918,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
2639,
11603,
13,
1455,
1590,
13,
16366,
1330,
5313,
39105,
11792,
19703,
4668,
198,
198,
6738,
299,
1671,
13,
1416,
4411,
292,
13,
20500,
1330,
14041,
1... | 3.587629 | 97 |
# env.unwrapped.get_action_meanings()
#======================================================
# Agent classes
#======================================================
'''
Info:
Version: 1.0
Author: Young Lee
Created: Friday, 16 August 2019
'''
# Import modules
import os
import re
import sys
try:
ge... | [
2,
17365,
13,
403,
29988,
1496,
13,
1136,
62,
2673,
62,
32604,
654,
3419,
198,
198,
2,
10052,
4770,
50155,
198,
2,
15906,
6097,
198,
2,
10052,
4770,
50155,
198,
7061,
6,
198,
12360,
25,
220,
220,
220,
220,
220,
220,
220,
198,
1481... | 2.796926 | 1,236 |
from fastapi_integration.current_user_resolvers.role_checkers import RoleCheckerFactory
from galo_ioc import get_factory
__all__ = [
"load",
]
| [
6738,
3049,
15042,
62,
18908,
1358,
13,
14421,
62,
7220,
62,
411,
349,
690,
13,
18090,
62,
9122,
364,
1330,
20934,
9787,
263,
22810,
198,
6738,
308,
7335,
62,
72,
420,
1330,
651,
62,
69,
9548,
198,
198,
834,
439,
834,
796,
685,
19... | 2.811321 | 53 |
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Class representing instrumentation test apk and jar."""
import os
from devil.android import apk_helper
from pylib.instrumentation import test_jar
fr... | [
2,
15069,
357,
66,
8,
2211,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
1... | 3.576923 | 104 |
#
# Copyright 2019 BrainPad Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | [
2,
198,
2,
15069,
13130,
14842,
26114,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
... | 4.327044 | 159 |
from django import forms
from resources.models import Pet
| [
6738,
42625,
14208,
1330,
5107,
198,
198,
6738,
4133,
13,
27530,
1330,
4767,
628
] | 4.285714 | 14 |
from utils import normdata, myrmse
from sklearn.metrics import (
accuracy_score,
roc_curve,
auc,
roc_auc_score,
mean_squared_error,
)
import numpy as np
import random
import matplotlib.pyplot as plt
def performance_vs_confidence(
original_data,
imp_data,
missing_data,
testY,
te... | [
6738,
3384,
4487,
1330,
2593,
7890,
11,
616,
26224,
325,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
357,
198,
220,
220,
220,
9922,
62,
26675,
11,
198,
220,
220,
220,
686,
66,
62,
22019,
303,
11,
198,
220,
220,
220,
257,
1229,
... | 2.038827 | 3,786 |
import pytest
@pytest.fixture
def passed_submission_py() -> str:
"""
Function which returns a passed execution output in python
"""
return """
..
----------------------------------------------------------------------
Ran 2 tests in 0.000s
OK
"""
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
69,
9602,
198,
4299,
3804,
62,
7266,
3411,
62,
9078,
3419,
4613,
965,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
15553,
543,
5860,
257,
3804,
9706,
5072,
287,
21015,
198,
220... | 3.326087 | 92 |
import logging
import csv
import json
from platform import system
from sys import stderr, stdout
# not needed in python >= 3.6? as default dict keeps order
from collections import OrderedDict, deque
try:
from google.protobuf.json_format import MessageToDict
except ImportError:
# not in debian stretch dpkg/ap... | [
11748,
18931,
198,
11748,
269,
21370,
198,
11748,
33918,
198,
6738,
3859,
1330,
1080,
198,
198,
6738,
25064,
1330,
336,
1082,
81,
11,
14367,
448,
198,
198,
2,
407,
2622,
287,
21015,
18189,
513,
13,
21,
30,
355,
4277,
8633,
7622,
1502,... | 2.041204 | 2,791 |
import contextlib as cl
from . import accessors
@cl.contextmanager
@cl.contextmanager
| [
11748,
4732,
8019,
355,
537,
198,
198,
6738,
764,
1330,
1895,
669,
628,
198,
31,
565,
13,
22866,
37153,
628,
198,
31,
565,
13,
22866,
37153,
198
] | 3.37037 | 27 |
from error_handlers import captha
from error_handlers import rps
error_handlers_bp = (
rps.user,
captha.user,
)
| [
6738,
4049,
62,
4993,
8116,
1330,
1451,
12898,
198,
6738,
4049,
62,
4993,
8116,
1330,
374,
862,
198,
198,
18224,
62,
4993,
8116,
62,
46583,
796,
357,
198,
220,
220,
220,
374,
862,
13,
7220,
11,
198,
220,
220,
220,
1451,
12898,
13,
... | 2.520833 | 48 |
import pytest
from RNA_describe import RNA_describer
from RNA_describe import ORF_counter
from RNA_describe import ORF_RE
# The following unix command will run all tests.
# $ pytest
# The -v option will list each test and show progress.
# $ pytest -v
# By default, pytest captures stdout unless the tests fail.
# Use th... | [
11748,
12972,
9288,
198,
6738,
25897,
62,
20147,
4892,
1330,
25897,
62,
20147,
24735,
198,
6738,
25897,
62,
20147,
4892,
1330,
6375,
37,
62,
24588,
198,
6738,
25897,
62,
20147,
4892,
1330,
6375,
37,
62,
2200,
198,
198,
2,
383,
1708,
5... | 3.389831 | 118 |
from .navbar import nav_bar
from .visuals import gdp_viz | [
6738,
764,
28341,
5657,
1330,
6812,
62,
5657,
198,
6738,
764,
41464,
82,
1330,
308,
26059,
62,
85,
528
] | 2.947368 | 19 |
import argparse
import corenlp
import gzip
import inflect
from tqdm import tqdm
if __name__ == '__main__':
parser = argparse.ArgumentParser('Generate negative examples for LM agreement task.')
parser.add_argument('--source', required=True, type=str)
parser.add_argument('--output', default='verb_negative_... | [
198,
11748,
1822,
29572,
198,
11748,
4755,
21283,
79,
198,
11748,
308,
13344,
198,
11748,
1167,
801,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
2... | 3 | 127 |
# Valentin Macé
# valentin.mace@kedgebs.com
# Developed for fun
# Feel free to use this code as you wish as long as you quote me as author
"""
snake.py
~~~~~~~~~~
This module is for building the snake itself in the snake game
The snake:
- Is on the form of a list, each element for a body block (containing its coordi... | [
2,
17284,
259,
4100,
2634,
198,
2,
1188,
31371,
13,
76,
558,
31,
9091,
469,
1443,
13,
785,
198,
2,
6013,
276,
329,
1257,
198,
2,
18571,
1479,
284,
779,
428,
2438,
355,
345,
4601,
355,
890,
355,
345,
9577,
502,
355,
1772,
198,
19... | 2.354157 | 2,177 |
# project/test_basic.py
import os
import unittest
from app.app import Kanban_app
from app.models import db, User, Card
TEST_DB = 'test.db'
# execute before each test
# execute after each test
# methods to help pass data to views
# tests to run
# check home view works
# test user can reg... | [
2,
1628,
14,
9288,
62,
35487,
13,
9078,
198,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
598,
13,
1324,
1330,
14248,
3820,
62,
1324,
198,
6738,
598,
13,
27530,
1330,
20613,
11,
11787,
11,
5172,
198,
198,
51,
6465,
... | 3.2 | 195 |
"""
Direct access to the Pwned Passwords API for checking whether a
password is compromised.
"""
import hashlib
import logging
import sys
import requests
from django.conf import settings
from . import __version__
log = logging.getLogger(__name__)
API_ENDPOINT = "https://api.pwnedpasswords.com/range/{}"
REQUEST_TI... | [
37811,
198,
13470,
1895,
284,
262,
350,
675,
276,
6251,
10879,
7824,
329,
10627,
1771,
257,
198,
28712,
318,
19066,
13,
198,
198,
37811,
198,
198,
11748,
12234,
8019,
198,
11748,
18931,
198,
11748,
25064,
198,
198,
11748,
7007,
198,
673... | 2.626801 | 694 |
import numpy as np
from smartredis import Dataset
def test_add_get_tensor(mock_data):
"""Test adding and retrieving 1D tensors to
a dataset and with all datatypes
"""
dataset = Dataset("test-dataset")
# 1D tensors of all data types
data = mock_data.create_data(10)
add_get_arrays(dataset,... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
4451,
445,
271,
1330,
16092,
292,
316,
628,
198,
4299,
1332,
62,
2860,
62,
1136,
62,
83,
22854,
7,
76,
735,
62,
7890,
2599,
198,
220,
220,
220,
37227,
14402,
4375,
290,
50122,
352,
35,
... | 2.426494 | 1,238 |
from rest_framework import generics
from .models import Item
from .serializers import ItemSerializer
| [
6738,
1334,
62,
30604,
1330,
1152,
873,
198,
198,
6738,
764,
27530,
1330,
9097,
198,
6738,
764,
46911,
11341,
1330,
9097,
32634,
7509,
628,
198
] | 4.16 | 25 |
from distutils.core import setup, Extension
from Cython.Build import cythonize
# ext = Extension(name="wrap_fib", source=["cfibc.c", "wrap_fib.pyx"])
# ext = ["hermite_splines.pyx", "source_iteration.pyx", "splines.pyx"]
ext = ["multi_group.pyx", "x_sweeps.pyx"] #, "x_sweeps.pxd"]
setup(ext_modules=cythonize(ext, l... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
11,
27995,
198,
6738,
327,
7535,
13,
15580,
1330,
3075,
400,
261,
1096,
198,
198,
2,
1070,
796,
27995,
7,
3672,
2625,
37150,
62,
69,
571,
1600,
2723,
28,
14692,
12993,
571,
66,
13,
66,
1600,
... | 2.471014 | 138 |
import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bus_plan.settings')
application = Cling(get_wsgi_application())
| [
198,
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
18504,
12397,
1330,
651,
62,
18504,
12397,
62,
31438,
198,
6738,
42625,
62,
12708,
1330,
1012,
278,
198,
198,
418,
13,
268,
2268,
13,
2617,
12286,
10786,
35028,
1565,
11230,... | 2.887324 | 71 |
#!/usr/bin/env python3
# encoding: utf-8
import asyncio
asyncio.run(main())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
11748,
30351,
952,
198,
198,
292,
13361,
952,
13,
5143,
7,
12417,
28955,
198
] | 2.363636 | 33 |
#
# Embed a photo data inside a Tk frame
#
import tkinter as tk
import smimgpng as smimg
AUTHOR = "Alexandre Gomiero de Oliveira"
REPO = "https://github.com/gomiero/bin2src"
# Entry point: create the root window...
root = tk.Tk()
# ...the App instance...
app = App(master = root)
# ...and run the main loop.
app.mainlo... | [
2,
198,
2,
13302,
276,
257,
4590,
1366,
2641,
257,
309,
74,
5739,
198,
2,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
11748,
895,
9600,
11134,
355,
895,
9600,
198,
198,
32,
24318,
1581,
796,
366,
15309,
49078,
402,
296,
959,
78,... | 2.739496 | 119 |
import struct
| [
11748,
2878,
628
] | 5 | 3 |
import numpy as np
from instance_occlsegm_lib.datasets.apc.apc2016 import JskAPC2016Dataset
| [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
4554,
62,
420,
565,
325,
39870,
62,
8019,
13,
19608,
292,
1039,
13,
499,
66,
13,
499,
66,
5304,
1330,
449,
8135,
2969,
34,
5304,
27354,
292,
316,
628,
198
] | 2.5 | 38 |
import random
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
| [
11748,
4738,
198,
6738,
2172,
29572,
1330,
787,
62,
18076,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
628
] | 4.060606 | 33 |
from lib.mlnet import MLNet
from data.data_loader import DataLoader
from data.utils import split_and_pack
import tensorflow as tf
import numpy as np
import time
def get_descs_and_labels(net: MLNet, sess: tf.Session, modal,
paths_with_labels, process_fn, batch_size):
"""
This function ... | [
6738,
9195,
13,
4029,
3262,
1330,
10373,
7934,
198,
6738,
1366,
13,
7890,
62,
29356,
1330,
6060,
17401,
198,
6738,
1366,
13,
26791,
1330,
6626,
62,
392,
62,
8002,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
... | 2.212255 | 1,583 |
"""Testing invalid cookiecutter template repositories."""
import pytest
from tackle import exceptions, main
def test_should_raise_error_if_repo_does_not_exist(chdir):
"""Cookiecutter invocation with non-exist repository should raise error."""
chdir('/')
with pytest.raises(exceptions.UnknownSourceExceptio... | [
37811,
44154,
12515,
19751,
8968,
353,
11055,
38072,
526,
15931,
198,
11748,
12972,
9288,
198,
198,
6738,
9761,
1330,
13269,
11,
1388,
628,
198,
4299,
1332,
62,
21754,
62,
40225,
62,
18224,
62,
361,
62,
260,
7501,
62,
22437,
62,
1662,
... | 3.132231 | 121 |
import torch as ch
import pandas as pd
import numpy as np
from pathlib import Path
from pathos.multiprocessing import Pool
from argparse import ArgumentParser
from numpy.random import seed
import matplotlib as mpl
from matplotlib import rc
from matplotlib import pyplot as plt
import seaborn as sns
sns.set()
mpl.style.... | [
11748,
28034,
355,
442,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
3108,
418,
13,
16680,
541,
305,
919,
278,
1330,
19850,
198,
6738,
1822,
29572,
1330,
45751,... | 2.198406 | 1,129 |
#!/usr/bin/python3
import argparse
from http import server
import json
import subprocess
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
1822,
29572,
198,
6738,
2638,
1330,
4382,
198,
11748,
33918,
198,
11748,
850,
14681,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
22... | 2.933333 | 45 |
import mysql
import configparser
def initialize(config_path):
'''
Import a config .ini file.
It should have the following definition:
'''
config = configparser.ConfigParser()
config.read(config_path)
| [
11748,
48761,
198,
11748,
4566,
48610,
628,
628,
198,
4299,
41216,
7,
11250,
62,
6978,
2599,
198,
197,
7061,
6,
198,
197,
20939,
257,
4566,
764,
5362,
2393,
13,
198,
197,
1026,
815,
423,
262,
1708,
6770,
25,
198,
197,
7061,
6,
198,
... | 3.3125 | 64 |
# write tests for parsers
from seqparser import (
FastaParser,
FastqParser)
def test_freebie_parser_1():
"""
This one is a freebie
DO NOT MODIFY THIS FUNCTION
"""
assert True
def test_freebie_parser_2():
"""
This too is a freebie
DO NOT MODIFY THIS FUNCTION
"""
... | [
2,
3551,
5254,
329,
13544,
364,
198,
198,
6738,
33756,
48610,
1330,
357,
198,
220,
220,
220,
220,
220,
220,
220,
12549,
64,
46677,
11,
198,
220,
220,
220,
220,
220,
220,
220,
12549,
80,
46677,
8,
628,
198,
4299,
1332,
62,
5787,
12... | 2.828974 | 497 |
# Generated by Django 3.1.2 on 2022-03-26 11:11
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
17,
319,
33160,
12,
3070,
12,
2075,
1367,
25,
1157,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import pathlib
import ctypes
import numpy as np
from objc_util import c, create_objc_class, ObjCClass, ObjCInstance
import ui
#import pdbg
shader_path = pathlib.Path('./Shaders.metal')
# --- load objc classes
MTKView = ObjCClass('MTKView')
MTLCompileOptions = ObjCClass('MTLCompileOptions')
MTLRenderPipelineDescr... | [
11748,
3108,
8019,
198,
11748,
269,
19199,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
26181,
66,
62,
22602,
1330,
269,
11,
2251,
62,
26801,
66,
62,
4871,
11,
38764,
34,
9487,
11,
38764,
34,
33384,
198,
11748,
334,
72,
198,
... | 2.064007 | 1,078 |
'''NeteaseCloudMusicApiPy
NeteaseCloudMusicApi 的 Python 绑定
https://github.com/NKID00/NeteaseCloudMusicApiPy
MIT License
Copyright (c) 2020 NKID00
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software ... | [
7061,
6,
7934,
68,
589,
18839,
22648,
32,
14415,
20519,
198,
7934,
68,
589,
18839,
22648,
32,
14415,
13328,
248,
226,
11361,
13328,
119,
239,
22522,
248,
198,
5450,
1378,
12567,
13,
785,
14,
46888,
2389,
405,
14,
7934,
68,
589,
18839,... | 1.833562 | 4,380 |
# -*- coding: utf-8 -*-
import unittest
import unittest.mock as mock
from fastapi.testclient import TestClient
from projects.api.main import app
from projects.database import session_scope
import tests.util as util
app.dependency_overrides[session_scope] = util.override_session_scope
TEST_CLIENT = TestClient(app)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
555,
715,
395,
198,
11748,
555,
715,
395,
13,
76,
735,
355,
15290,
198,
198,
6738,
3049,
15042,
13,
9288,
16366,
1330,
6208,
11792,
198,
198,
6738,
4493,
13,
15... | 3.106796 | 103 |
from django.views.generic.base import TemplateView | [
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
8692,
1330,
37350,
7680
] | 4.166667 | 12 |
from __future__ import absolute_import, print_function, unicode_literals
import _test_utilities
# NOTHING FOR NOW
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
4808,
9288,
62,
315,
2410,
628,
198,
2,
5626,
39,
2751,
7473,
20229,
198
] | 3.342857 | 35 |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 3 21:40:05 2020
@author: Amir Moradi
"""
import cv2
from Utils.undistortion import undistortion
from Utils.angle_calculation import angle_calculation
import numpy as np
import serial
video_StreamL = cv2.VideoCapture(2) # index of left camera
video_StreamR = cv2.Video... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
4280,
220,
513,
2310,
25,
1821,
25,
2713,
12131,
198,
198,
31,
9800,
25,
43931,
3461,
9189,
198,
37811,
628,
198,
11748,
269,
85,
17,
19... | 1.665963 | 2,844 |
from dataclasses import dataclass
# from pprint import pprint
import aiohttp
import discord
from discord.ext import commands
from bot import constants
API_URL = "https://livescore6.p.rapidapi.com/matches/v2/"
LIVE_MATCHES_URL = API_URL + "list-live"
HEADERS = {
"x-rapidapi-key": constants.RAPIDAPI_KEY,
"x-r... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
2,
422,
279,
4798,
1330,
279,
4798,
198,
198,
11748,
257,
952,
4023,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
6738,
10214,
1330,
38491,
198,
198,
17614,
... | 2.492147 | 191 |
# -*- coding: utf-8 -*-
import family
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
220,
532,
9,
12,
198,
198,
11748,
1641,
198
] | 2.105263 | 19 |
#!/usr/bin/python2
# coding: utf-8
# Daniel Elsner
# Get the amino acid sequence from the correct url for a kegg entry...
# Use best with GNU parallel (Tange 2011a) and an input list containing all the gene IDs from a kegg pathway.
import sys
from bs4 import BeautifulSoup
import requests
url = sys.argv[1]
r = r... | [
2,
48443,
14629,
14,
8800,
14,
29412,
17,
198,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
7806,
2574,
82,
1008,
198,
2,
3497,
262,
23206,
7408,
8379,
422,
262,
3376,
19016,
329,
257,
885,
1130,
5726,
986,
198,
2,
5765,
12... | 3.014286 | 140 |
from .axle import * # noqa
from .cycle import * # noqa
| [
6738,
764,
897,
293,
1330,
1635,
220,
1303,
645,
20402,
198,
6738,
764,
13696,
1330,
1635,
220,
1303,
645,
20402,
198
] | 2.714286 | 21 |
from itertools import chain
from django.template.defaultfilters import linebreaksbr, urlize
from django.utils.html import format_html, mark_safe
from feincms3_forms.models import FormFieldBase
| [
6738,
340,
861,
10141,
1330,
6333,
198,
198,
6738,
42625,
14208,
13,
28243,
13,
12286,
10379,
1010,
1330,
1627,
30058,
1671,
11,
19016,
1096,
198,
6738,
42625,
14208,
13,
26791,
13,
6494,
1330,
5794,
62,
6494,
11,
1317,
62,
21230,
198,
... | 3.473684 | 57 |
# Copyright (C) 2017-2020 Pascal Pepe <contact@pascalpepe.com>
#
# 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 applic... | [
2,
15069,
357,
34,
8,
2177,
12,
42334,
35163,
49761,
1279,
32057,
31,
79,
27747,
431,
431,
13,
785,
29,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
... | 2.551965 | 1,145 |
"""
=====
About
=====
Acquire measurement information from DWD and filter using SQL.
=====
Setup
=====
::
pip install wetterdienst[sql]
"""
import logging
from wetterdienst import DWDStationRequest
from wetterdienst import TimeResolution, Parameter, PeriodType
log = logging.getLogger()
if __name__ == "__m... | [
37811,
198,
1421,
28,
198,
8585,
198,
1421,
28,
198,
12832,
29782,
15558,
1321,
422,
360,
22332,
290,
8106,
1262,
16363,
13,
628,
198,
1421,
28,
198,
40786,
198,
1421,
28,
198,
3712,
628,
220,
220,
220,
7347,
2721,
9583,
353,
67,
20... | 3 | 113 |
import sys
from enum import Enum
from PySide2.QtUiTools import QUiLoader #allows us to load .ui files
#be sure to import any widget that you want to manipulate
from PySide2.QtWidgets import QApplication, QPushButton, QGridLayout, QSizePolicy
from PySide2.QtCore import QFile, QObject
import random
#class construct... | [
11748,
25064,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
9485,
24819,
17,
13,
48,
83,
52,
72,
33637,
1330,
19604,
72,
17401,
1303,
47205,
514,
284,
3440,
764,
9019,
3696,
198,
198,
2,
1350,
1654,
284,
1330,
597,
26295,
326,
345,
... | 3.006803 | 147 |
# List GCP Regional project quotas
# Official GCP SDK (Python) Documentation: https://googleapis.github.io/google-api-python-client/docs/dyn/
import json
import ipcalc
import sys
import argparse
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
from google.cloud import resource_ma... | [
2,
7343,
402,
8697,
15994,
1628,
38736,
198,
2,
15934,
402,
8697,
26144,
357,
37906,
8,
43925,
25,
3740,
1378,
13297,
499,
271,
13,
12567,
13,
952,
14,
13297,
12,
15042,
12,
29412,
12,
16366,
14,
31628,
14,
67,
2047,
14,
198,
198,
... | 2.670628 | 589 |
from django import forms
from django.contrib import admin
from osmaxx.profile.models import Profile
admin.site.register(Profile, ProfileAdmin)
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
267,
5796,
897,
87,
13,
13317,
13,
27530,
1330,
13118,
628,
198,
28482,
13,
15654,
13,
30238,
7,
37046,
11,
13118,
46787,
8,
198
] | 3.560976 | 41 |
#
# Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC
#
""" unit tests for the model and descriptor packager """
import os
import random
import unittest
from xml.dom import minidom
from xml.etree import ElementTree as ET
from rdkit import Chem
from rdkit import RDConfig
from rdkit.Chem import Descripto... | [
2,
198,
2,
220,
15069,
357,
34,
8,
6244,
12,
11528,
220,
308,
2301,
6379,
6582,
290,
46863,
23455,
11419,
198,
2,
198,
37811,
4326,
5254,
329,
262,
2746,
290,
43087,
2353,
3536,
37227,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
... | 3.18552 | 221 |
from fractions import Fraction
import pytest
from mugen.utilities import conversion, general
@pytest.mark.parametrize(
"a_start, a_end, b_start, b_end, do_overlap",
[
(5, 10, 11, 12, False), # disjoint
(5, 10, 10, 12, False), # contiguous
(5, 10, 9, 12, True), # overlaps right
... | [
6738,
49876,
1330,
376,
7861,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
25152,
268,
13,
315,
2410,
1330,
11315,
11,
2276,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
220,
220,
366,
64,
62,
... | 1.847097 | 1,223 |
import unittest
import json
import os
import datetime
from prometheus_api_client import MetricsList
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
4818,
8079,
198,
6738,
1552,
36916,
62,
15042,
62,
16366,
1330,
3395,
10466,
8053,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,... | 3 | 50 |
from random import uniform
import numpy as np
from collections import OrderedDict, defaultdict
from itertools import tee
import time
# ----------------------------------------------- | [
6738,
4738,
1330,
8187,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
11,
4277,
11600,
198,
6738,
340,
861,
10141,
1330,
30479,
198,
11748,
640,
198,
198,
2,
20368,
24305
] | 5.083333 | 36 |
import pytest
from jamesbond import bonddata
def test_load_data():
"""
Test the row & column count (shape)
Test the first column from the last row of the dataset 'Spectre'.
"""
df = bonddata.load_data()
shape = df.shape
last_row_first_col = df.iloc[-1, 1]
assert shape == (24, 27)
a... | [
11748,
12972,
9288,
198,
6738,
474,
1047,
65,
623,
1330,
6314,
7890,
628,
198,
4299,
1332,
62,
2220,
62,
7890,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6208,
262,
5752,
1222,
5721,
954,
357,
43358,
8,
198,
220,
220,
220... | 2.613139 | 137 |
"""Unit test package for helplotlib."""
| [
37811,
26453,
1332,
5301,
329,
932,
29487,
8019,
526,
15931,
198
] | 3.636364 | 11 |
a=1,b=2
print(assertEqual(a,b)) #验证是否一致
| [
198,
64,
28,
16,
11,
65,
28,
17,
198,
198,
4798,
7,
30493,
36,
13255,
7,
64,
11,
65,
4008,
220,
1303,
165,
103,
234,
46237,
223,
42468,
28938,
99,
31660,
164,
229,
112,
198,
220,
220,
220,
220,
198,
220,
220,
220,
198
] | 1.181818 | 44 |
import numpy as np
import scipy
import matcompat
# if available import pylab (from matlibplot)
try:
import matplotlib.pylab as plt
except ImportError:
pass | [
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
198,
11748,
2603,
5589,
265,
198,
198,
2,
611,
1695,
1330,
279,
2645,
397,
357,
6738,
2603,
8019,
29487,
8,
198,
28311,
25,
198,
220,
220,
220,
1330,
2603,
29487,
8019,
1... | 2.79661 | 59 |
import copy
import datetime
import json
import logging
from django.http import HttpResponse
from django.utils.decorators import classonlymethod, method_decorator
from django.views.generic import View
from corehq.util.es.elasticsearch import ElasticsearchException, NotFoundError
from casexml.apps.case.models import C... | [
11748,
4866,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
26791,
13,
12501,
273,
2024,
1330,
1398,
8807,
24396,
11,
2446,
62,
... | 2.495305 | 3,834 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
#!/usr/bin/env python
# coding: utf-8
# In[69]:
# In[70]:
isPrime(7)
# In[71]:
isPrime(8)
# In[72]:
pno = []
# In[73]:
lst = list(range(0,2500))
# In[74]:
for item in lst:
if isPrime(item):
pno.append(item)
# In[75]:
print(pno)
# In[76]:
lst_prime_no = filter(isPrime,lst)
# I... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
3388,
5974,
628,
198,
198,
2,
554,
58,
2154,
5974,
628,
198,
271,
26405,
7,
22,
8,
628,
198,
2,
554,
58,
4869,
5974,
628,
... | 1.917098 | 193 |
# -*- coding: utf-8 -*-
from deliver.tests.test_base import BaseTest, load_msg, load_all_msg
class ConverterTest(BaseTest):
'''Tests for the UnicodeMessage class'''
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
5203,
13,
41989,
13,
9288,
62,
8692,
1330,
7308,
14402,
11,
3440,
62,
19662,
11,
3440,
62,
439,
62,
19662,
198,
198,
4871,
35602,
353,
14402,
7,
14881,
14402,
25... | 2.786885 | 61 |
import requests
import random
import os
DEVELOPMENT_MODE = os.getenv("DEVELOPMENT_MODE", True)
if DEVELOPMENT_MODE:
# Import package multirunnable
import pathlib
import sys
package_path = str(pathlib.Path(__file__).absolute().parent.parent.parent)
sys.path.append(package_path)
# multirunnable pac... | [
11748,
7007,
198,
11748,
4738,
198,
11748,
28686,
198,
198,
7206,
18697,
3185,
10979,
62,
49058,
796,
28686,
13,
1136,
24330,
7203,
7206,
18697,
3185,
10979,
62,
49058,
1600,
6407,
8,
198,
198,
361,
5550,
18697,
3185,
10979,
62,
49058,
... | 2.765306 | 196 |
# %%
import torch
import torchvision
import threading
import time
from utils import preprocess
import torch.nn.functional as F
import traitlets
import torchvision.transforms as transforms
from dataset import ImageClassificationDataset
device = torch.device('cuda')
TASK = 'balls'
CATEGORIES = ['red_ball','... | [
2,
43313,
201,
198,
11748,
28034,
201,
198,
11748,
28034,
10178,
201,
198,
11748,
4704,
278,
201,
198,
11748,
640,
201,
198,
6738,
3384,
4487,
1330,
662,
14681,
201,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
201,
198,
11748,
... | 2.53125 | 640 |
import unittest
try:
from mock import MagicMock
except ImportError:
from unittest.mock import MagicMock
from pubnub.pubnub import PubNub
import pubnub.enums
from pubnub.endpoints.push.remove_channels_from_push import RemoveChannelsFromPush
from tests.helper import pnconf, sdk_name
| [
11748,
555,
715,
395,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
15290,
1330,
6139,
44,
735,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
198,
6738,
2240,
77,
549,... | 2.864078 | 103 |
rhombusD1 = float(input("Enter Rhombus First Diagonal = "))
rhombusD2 = float(input("Enter Rhombus Second Diagonal = "))
rhombusArea = calRhombusArea(rhombusD1, rhombusD2)
print("The Area of a Rhombus = %.3f" %rhombusArea)
| [
198,
17179,
2381,
385,
35,
16,
796,
12178,
7,
15414,
7203,
17469,
10323,
2381,
385,
3274,
6031,
27923,
220,
796,
366,
4008,
198,
198,
17179,
2381,
385,
35,
17,
796,
12178,
7,
15414,
7203,
17469,
10323,
2381,
385,
5498,
6031,
27923,
79... | 2.43617 | 94 |
import sys, subprocess
import os
import os.path
import shutil
import re
import glob
from optparse import OptionParser
#-------------------------------------------------------------------------------
# the main function
# Below we deform the moving image segmentation by the current result as well as
# by a previous sto... | [
11748,
25064,
11,
850,
14681,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
4423,
346,
198,
11748,
302,
198,
11748,
15095,
198,
6738,
2172,
29572,
1330,
16018,
46677,
198,
198,
2,
10097,
24305,
198,
2,
262,
1388,
2163,
198... | 4.890511 | 137 |
# Copyright (c) 2017 Sony Corporation. 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 applic... | [
2,
15069,
357,
66,
8,
2177,
10184,
10501,
13,
1439,
6923,
33876,
13,
198,
2,
220,
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.813559 | 177 |
import re
| [
11748,
302,
628,
198
] | 3 | 4 |
import torch
import torch
import torch.nn as nn
import torch.nn.functional as F
def batch_cosine_fully_connected_layer(x_in, weight, scale=None, bias=None):
"""
Args:
x_in: a 3D tensor with shape
[meta_batch_size x num_examples x num_features_in]
weight: a 3D tensor with shape
... | [
11748,
28034,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
628,
628,
198,
4299,
15458,
62,
6966,
500,
62,
2759,
62,
15236,
62,
29289,
7,
87,
62,
259,
11,
3463,
11,... | 2.173278 | 479 |
# !/usr/bin/env python
# -*- coding:utf-8 -*-
import ctypes
from ctypes import *
import os
import numpy as np
import time
JPGENC_FORMAT_NV12 = 0x10
| [
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
220,
220,
198,
198,
11748,
269,
19199,
198,
6738,
269,
19199,
1330,
1635,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45... | 2.412698 | 63 |
# 보석 쇼핑
if __name__ == "__main__":
gems = ["DIA", "RUBY", "RUBY", "DIA", "DIA", "EMERALD", "SAPPHIRE", "DIA"]
print(solution(gems))
| [
2,
31619,
111,
112,
168,
226,
251,
23821,
229,
120,
47991,
239,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
23685,
796,
14631,
35,
3539,
1600,
366,
49,
10526,
56,
1600,
366,
49,
10526,... | 1.765432 | 81 |
import pygame
import numpy as np
from Source import UI_functions as UI
from Source import battleships_functions_bot as bfb
from Source import battleships_functions_check as bfc | [
11748,
12972,
6057,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
8090,
1330,
12454,
62,
12543,
2733,
355,
12454,
198,
6738,
8090,
1330,
10181,
5748,
62,
12543,
2733,
62,
13645,
355,
275,
21855,
198,
6738,
8090,
1330,
10181,
5748,
62,
... | 3.744681 | 47 |
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 30 15:20:09 2016
@author: hjalmar
"""
import tensorflow as tf
from ht_helper import HeSD, angle2class, FrameStepper, class2angle, whiten
from ht_helper import anglediff, get_max_gaze_line, CountdownPrinter
from ht_helper import angles2complex, complex2angles, softmax, get... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
7031,
5979,
1542,
1315,
25,
1238,
25,
2931,
1584,
198,
198,
31,
9800,
25,
289,
73,
282,
3876,
198,
37811,
198,
11748,
11192,
273,
11125,
355,
4... | 1.662766 | 14,785 |
import marshal
import imp
import struct
import os
import sys
import base64
import new
import dis
from dis import opmap, opname
class Bytecode():
'''
Class to store individual instruction as a node in the graph
'''
def len(self):
'''
Returns the length of the bytecode
1 for no ... | [
11748,
22397,
282,
198,
11748,
848,
198,
11748,
2878,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
2779,
2414,
198,
11748,
649,
198,
11748,
595,
198,
6738,
595,
1330,
1034,
8899,
11,
1034,
3672,
628,
198,
4871,
30589,
8189,
33529,
... | 1.970918 | 1,960 |
import logging
from collections import defaultdict
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Dict, List, Literal, NamedTuple, Optional
from eth_utils import to_checksum_address
from gevent.lock import Semaphore
from rotkehlchen.accounting.structures.balance import AssetBalance, Balance
... | [
11748,
18931,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
4377,
11,
360,
713,
11,
7343,
11,
25659,
1691,
11,
34441,
51,
29291,
11,
32233,
... | 3.038095 | 630 |
from rest_framework import decorators, permissions, response, status
from rest_framework.request import Request
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext as _
from .serializers import UserCreateSerializer
User = get_user_model()
@decorators.api_view(["POST"])
@dec... | [
6738,
1334,
62,
30604,
1330,
11705,
2024,
11,
21627,
11,
2882,
11,
3722,
198,
6738,
1334,
62,
30604,
13,
25927,
1330,
19390,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
142... | 3.5 | 106 |
# Generated by Django 2.1.7 on 2019-03-31 16:43
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,
3132,
1467,
25,
3559,
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 |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
2,
770,
2438,
318,
636,
286,
1195,
1984,
270,
13,
198,
2,
198,
2,
357,
34,
8,
15069,
19764,
2177,
11,
13130,
13,
198,
2,
198,
2,
770,
2438,
318,
11971,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
13,
921,
743,
198,
2,
7330... | 2.061843 | 4,091 |
# Generated by Django 3.2.10 on 2021-12-24 07:16
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
940,
319,
33448,
12,
1065,
12,
1731,
8753,
25,
1433,
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.840909 | 44 |
import requests
from bs4 import BeautifulSoup
from time import sleep
from retrying import retry
import json
import re
import pymongo
import datetime
from feichangzun import config
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 '
'(KHTML, like Gecko) Chrome/... | [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
640,
1330,
3993,
198,
6738,
1005,
14992,
1330,
1005,
563,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
279,
4948,
25162,
198,
11748,
4818,
8079,
198,
198,
6738,
... | 2.332288 | 319 |
from numpy import zeros
import time
n=6 # number of equations
A=[[10.0, -1.0, 4.0, 0.0, 2.0, 9.0, 19.0], [0.0, 25.0, -2.0, 7.0, 8.0, 4.0, 2.0], [1.0, 0.0, 15.0, 7.0, 3.0, -2.0, 13.0], [6.0, -1.0, 2.0, 23.0, 0.0, 8.0, -7.0], [-4.0, 2.0, 0.0, 5.0, -25.0, 3.0, -9.0], [0.0, 7.0, -1.0, 5.0, 4.0, -22.0, 2.0]] #the augmented... | [
6738,
299,
32152,
1330,
1976,
27498,
198,
11748,
640,
198,
198,
77,
28,
21,
1303,
1271,
286,
27490,
198,
32,
28,
30109,
940,
13,
15,
11,
532,
16,
13,
15,
11,
604,
13,
15,
11,
657,
13,
15,
11,
362,
13,
15,
11,
860,
13,
15,
11... | 1.62069 | 232 |
"""
Code up the game tic tac toe
1 class solution
"""
if __name__ == "__main__":
t = TicTacToe()
t.print_board()
t.play_game()
| [
37811,
198,
10669,
510,
262,
983,
256,
291,
26142,
21189,
198,
16,
1398,
4610,
198,
37811,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
256,
796,
309,
291,
51,
330,
2514,
68,
3419,
198,
220,... | 2.274194 | 62 |
from model.contact import Contact
testdata = [
Contact(firstname="name1", lastname="lastname1", middlename="middlename1",
nickname="nickname1", title="title1", company="company1",
address="address1", homephone="homephone1", mobilephone="mobphone1",
workphone="workphone1", fax="f... | [
6738,
2746,
13,
32057,
1330,
14039,
198,
198,
9288,
7890,
796,
685,
198,
220,
220,
220,
14039,
7,
11085,
3672,
2625,
3672,
16,
1600,
938,
3672,
2625,
12957,
3672,
16,
1600,
285,
1638,
11925,
480,
2625,
76,
1638,
11925,
480,
16,
1600,
... | 2.657143 | 140 |
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
"""
Configurati... | [
2,
16529,
35937,
201,
198,
2,
8090,
2393,
2810,
739,
24843,
13789,
11,
10628,
362,
13,
15,
11,
3269,
5472,
11,
201,
198,
2,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
201,
198,
2,
357,
66,
8,
15069,
19764,
11421,
... | 3.190871 | 6,507 |
from peewee import DoesNotExist
from datetime import datetime
from ServiceManager.utilities import generate_module_name
from shared.const import DBTypeIDs, DBClassIDs
from shared.utils import need_connection
from shared.db_models import *
from ServiceManager.logger import manager_logger as logger
@need_connection
... | [
6738,
613,
413,
1453,
1330,
8314,
3673,
3109,
396,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
4809,
13511,
13,
315,
2410,
1330,
7716,
62,
21412,
62,
3672,
198,
6738,
4888,
13,
9979,
1330,
20137,
6030,
47954,
11,
20137,
9... | 2.560651 | 3,009 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 Shlomi Fish <shlomif@cpan.org>
#
# Distributed under terms of the MIT license.
from pysol_cards.errors import SubclassResponsibility
| [
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,
43907,
25,
69,
12685,
28,
40477,
12,
23,
198,
2,
198,
2,
15069,
10673,
13130,
911,
75,
12753,
13388,
1279,
147... | 2.588235 | 85 |
from collections import defaultdict
from conceptnet5.edges import make_edge
from conceptnet5.formats.msgpack_stream import MsgpackStreamWriter
from conceptnet5.languages import ATOMIC_SPACE_LANGUAGES
from conceptnet5.nodes import split_uri
from conceptnet5.uri import get_uri_language, join_uri, Licenses
def prepare_... | [
6738,
17268,
1330,
4277,
11600,
198,
198,
6738,
3721,
3262,
20,
13,
276,
3212,
1330,
787,
62,
14907,
198,
6738,
3721,
3262,
20,
13,
687,
1381,
13,
19662,
8002,
62,
5532,
1330,
6997,
70,
8002,
12124,
34379,
198,
6738,
3721,
3262,
20,
... | 2.497292 | 1,108 |
from __future__ import annotations
from calendar import monthrange
from datetime import timedelta, date
from .timerange import TimeRange
from .date_range import daterange
class CalendarMonth(TimeRange):
"""
Represent a calendar month.
"""
@property
def next(self) -> CalendarMonth:
"""Re... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
11845,
1330,
1227,
9521,
198,
6738,
4818,
8079,
1330,
28805,
12514,
11,
3128,
198,
198,
6738,
764,
45016,
858,
1330,
3862,
17257,
198,
6738,
764,
4475,
62,
9521,
1330,
288,
729,
858,... | 2.809028 | 288 |
# Generated by Django 2.0.2 on 2018-02-06 22:35
from django.db import migrations, models
import markupfield.fields
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
17,
319,
2864,
12,
2999,
12,
3312,
2534,
25,
2327,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
41485,
3245,
13,
25747,
628
] | 3.078947 | 38 |
from django.contrib import admin
from .models import blogPost
admin.site.register(blogPost) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
4130,
6307,
628,
198,
198,
28482,
13,
15654,
13,
30238,
7,
14036,
6307,
8
] | 3.481481 | 27 |
red = 0xff3d3d
green = 0xb8ff3d
blue = 0x2e66ff
yellow = 0xfff94d | [
445,
796,
657,
47596,
18,
67,
18,
67,
201,
198,
14809,
796,
657,
30894,
23,
487,
18,
67,
201,
198,
17585,
796,
657,
87,
17,
68,
2791,
487,
201,
198,
36022,
796,
657,
87,
20972,
5824,
67
] | 1.837838 | 37 |
#!/usr/bin/env python
# Copyright 2018-2020 The PySCF Developers. 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
#
# U... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
2864,
12,
42334,
383,
9485,
6173,
37,
34152,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,... | 2.235692 | 1,625 |
import logging
import warnings
from abc import ABC, abstractmethod
from pathlib import Path
from timeit import default_timer as timer
from typing import Any, Dict, Optional
import docker
from gobbli.model.context import ContainerTaskContext
from gobbli.util import (
format_duration,
generate_uuid,
gobbli_... | [
11748,
18931,
198,
11748,
14601,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
640,
270,
1330,
4277,
62,
45016,
355,
19781,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
32233,
198,
... | 2.339353 | 4,264 |
from .tomorrow import threads
| [
6738,
764,
39532,
6254,
1330,
14390,
198
] | 4.285714 | 7 |
# -*- encoding: utf-8 -*-
import csv
import io
import itertools
import json
from aws_gate.constants import (
AWS_DEFAULT_PROFILE,
AWS_DEFAULT_REGION,
DEFAULT_LIST_OUTPUT_FIELDS,
DEFAULT_LIST_HUMAN_FIELDS,
DEFAULT_LIST_OUTPUT,
)
from aws_gate.query import get_multiple_instance_details
from aws_gate.... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
269,
21370,
198,
11748,
33245,
198,
11748,
340,
861,
10141,
198,
11748,
33918,
198,
198,
6738,
3253,
82,
62,
10494,
13,
9979,
1187,
1330,
357,
198,
220,
220,
220,... | 2.372881 | 177 |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import logging
import random
from typing import Any, Dict, List, Set
from terragraph_thrift.Controller.ttypes import IperfTransportProtocol
from terragraph_thrift.Topology.ttypes import NodeStatusType
from tglib.clients import APIServiceCl... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
5472,
12,
25579,
3203,
13,
1439,
6923,
33876,
13,
198,
198,
11748,
18931,
198,
11748,
4738,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
5345,
198,
198,
67... | 3.658915 | 129 |
# ------------------------------
# 228. Summary Ranges
#
# Description:
#
# Version: 2.0
# 09/25/18 by Jianfa
# ------------------------------
# Used for testing
if __name__ == "__main__":
test = Solution()
# ------------------------------
# Summary:
# | [
2,
34400,
26171,
198,
2,
29041,
13,
21293,
371,
6231,
198,
2,
220,
198,
2,
12489,
25,
198,
2,
220,
198,
2,
10628,
25,
362,
13,
15,
198,
2,
7769,
14,
1495,
14,
1507,
416,
40922,
13331,
198,
2,
34400,
26171,
198,
220,
220,
220,
... | 2.90625 | 96 |