content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
import nltk
import codecs
import logging
import numpy as np
from scipy.ndimage import convolve1d
from util import get_lds_kernel_window, STSShotAverage
def process_sentence(sent, max_seq_len):
'''process a sentence using NLTK toolkit'''
return nltk.word_tokenize(sent)[:max_seq_len]
def load_tsv(data... | [
11748,
28686,
198,
11748,
299,
2528,
74,
198,
11748,
40481,
82,
198,
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
358,
9060,
1330,
3063,
6442,
16,
67,
198,
6738,
7736,
1330,
651,
62,
335,
82,
62,
33... | 1.956859 | 2,063 |
import pytest
from src.covid_email_alerts import main
from src.definitions import AWS_DIR_TEST
def test_full_single_county():
"""
A program run to a single county on the actual production SendGrid mailing list
WARNING: Be careful about running this function unless you really intend to send out
an ac... | [
11748,
12972,
9288,
198,
198,
6738,
12351,
13,
66,
709,
312,
62,
12888,
62,
44598,
82,
1330,
1388,
198,
6738,
12351,
13,
4299,
50101,
1330,
30865,
62,
34720,
62,
51,
6465,
628,
198,
4299,
1332,
62,
12853,
62,
29762,
62,
9127,
88,
33... | 2.522088 | 249 |
import sys
import pygame
from pygame.locals import *
screenWidth = 288
screenHeight = 512
pygame.init()
pygame.display.set_caption('Flappy Bird')
fpsClock = pygame.time.Clock()
screen = pygame.display.set_mode((screenWidth, screenHeight))
playerImageList = ['../assets/sprites/redbird-upflap.png',
... | [
11748,
25064,
198,
11748,
12972,
6057,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
198,
198,
9612,
30916,
796,
35419,
198,
9612,
23106,
796,
22243,
198,
198,
9078,
6057,
13,
15003,
3419,
198,
9078,
6057,
13,
13812,
13,
2617,
62,... | 2.396768 | 557 |
#coding=utf8
from django.contrib.auth.forms import AuthenticationForm
| [
2,
66,
7656,
28,
40477,
23,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
23914,
1330,
48191,
8479,
628
] | 3.380952 | 21 |
from csst.msc import CsstMscImgData
from csst.msc.instrument import CsstMscInstrumentProc
from astropy.io.fits import getdata
fp = "/data/cali_20211012/L0/150s/MSC_MS_210525120000_100000000_13_raw.fits"
bs = "/data/ref/MSC_CLB_210525190000_100000014_13_combine.fits"
dk = "/data/ref/MSC_CLD_210525192000_100000014_13_c... | [
6738,
50115,
301,
13,
907,
66,
1330,
327,
82,
301,
44,
1416,
3546,
70,
6601,
198,
6738,
50115,
301,
13,
907,
66,
13,
259,
43872,
1330,
327,
82,
301,
44,
1416,
818,
43872,
2964,
66,
198,
6738,
6468,
28338,
13,
952,
13,
21013,
1330,... | 2.220544 | 331 |
from django_north.management import migrations
from django_north.management.commands import runserver
| [
6738,
42625,
14208,
62,
43588,
13,
27604,
1330,
15720,
602,
198,
6738,
42625,
14208,
62,
43588,
13,
27604,
13,
9503,
1746,
1330,
1057,
15388,
628
] | 4.12 | 25 |
import argparse
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
from keras.callbacks import ModelCheckpoint, TensorBoard
from keras.applications.imagenet_utils import preprocess_input
from keras import optimizers
from squeezenet import SqueezeNet
import os
SIZE = 227
if __name__ == '__main... | [
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
9060,
1330,
7412,
6601,
8645,
1352,
198,
6738,
41927,
292,
13,
13345,
10146,
1330,
9104,
9787,
4122,
11,
309,
22854,
29828,
198,
6738,
4... | 3.326733 | 101 |
# Generated by Django 3.2.7 on 2021-10-13 13:55
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
22,
319,
33448,
12,
940,
12,
1485,
1511,
25,
2816,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
#!/usr/bin/env python3
import unittest
from PyQt5 import QtCore, QtWidgets
from pyqtcmd import History, Command, UICommand, UndoUICommandMixin, RedoUICommandMixin, NeedsSelectionUICommandMixin
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
11,
33734,
54,
312,
11407,
198,
198,
6738,
12972,
80,
23047,
9132,
1330,
7443,
11,
9455,
11,
471,... | 2.575 | 80 |
import matplotlib.pyplot as plt
a=[1,2,3,4,5]
b=[6,4,7,11,10]
x=[1,6,5,3,2]
plt.scatter(a,b,s=200,c='yellow',edgecolors='black',marker='o',alpha=1)
plt.scatter(a,x,s=200,c='orange',edgecolors='black',marker='1',alpha=1)
plt.legend(['b','x'],loc='best')
plt.title('scatter graph')
plt.xlabel('Xaxis')
plt.ylabe... | [
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
64,
41888,
16,
11,
17,
11,
18,
11,
19,
11,
20,
60,
201,
198,
65,
41888,
21,
11,
19,
11,
22,
11,
1157,
11,
940,
60,
201,
198,
87,
41888,
16,
11,
21,... | 1.915423 | 201 |
import sys
from typing import Dict, List, Union, Any
from collections import OrderedDict
import pyxb
if 'komle.bindings.v20.witsml' in sys.modules:
#Due to namespace collision we can't import bindings at the same time
from komle.bindings.v20._eml import TimeStamp
timestamp = TimeStamp
elif 'komle.bindings... | [
11748,
25064,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
4479,
11,
4377,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
11748,
12972,
30894,
198,
198,
361,
705,
74,
296,
293,
13,
21653,
654,
13,
85,
1238,
13,
86,
896,
4029,... | 2.173672 | 3,426 |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
# this a workaround for a numpy bug in file io (http://github.com/numpy/numpy#5655)
unpatched_loadtxt = np.loadtxt
np.loadtxt = my_loadtxt
dat = np.loadtxt('out.txt', dtype=np.complex)
def my_fill_between(ax, x, y1, y2, where, **kwargs):
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2,
428,
257,
46513,
329,
257,
299,
32152,
5434,
287,
2393,
33245,
357,
... | 2.132706 | 957 |
import torch
import torch.nn as nn
from .zen import ZenModel
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
764,
4801,
1330,
14760,
17633,
628,
628
] | 3.368421 | 19 |
# This example demonstrates a simple temperature sensor peripheral.
#
# The sensor's local value updates every second, and it will notify
# any connected central every 10 seconds.
import bluetooth
import random
import struct
import time
from ble_advertising import advertising_payload
from micropython import const
_I... | [
2,
770,
1672,
15687,
257,
2829,
5951,
12694,
25514,
13,
198,
2,
198,
2,
383,
12694,
338,
1957,
1988,
5992,
790,
1218,
11,
290,
340,
481,
19361,
198,
2,
597,
5884,
4318,
790,
838,
4201,
13,
198,
198,
11748,
48208,
16271,
198,
11748,
... | 2.682927 | 328 |
import argparse
import fnmatch
import logging
import os
import subprocess
from kubeflow.testing import test_helper, util
if __name__ == "__main__":
test_case = test_helper.TestCase(name='py_test', test_func=py_test)
test_suite = test_helper.init(name='py_checks', test_cases=[test_case])
test_suite.run()
| [
11748,
1822,
29572,
198,
11748,
24714,
15699,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
198,
6738,
479,
549,
891,
9319,
13,
33407,
1330,
1332,
62,
2978,
525,
11,
7736,
628,
628,
198,
361,
11593,
3672,
834,
6624,... | 2.821429 | 112 |
import os
import pickle
import numpy as np
import torch
import torchvision.transforms as transforms
from PIL import Image
from functools import partial
from torchvision import datasets
from torch.utils.data import DataLoader, Dataset
from .args import args
def load_pickle(pickle_file):
"""
Helper function t... | [
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
198,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,... | 2.338038 | 1,417 |
import os
import numpy as np
import pickle
| [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
628
] | 3.384615 | 13 |
"""utility functions for mand package"""
import os
from contextlib import contextmanager
import tempfile
import shutil
import importlib
import pkgutil
import random
import re
VALID_PACKAGE_RE = r'^[A-za-z_]+$'
def create_module_file(txt, directory):
"""Create a file in the given directory with
a valid module... | [
37811,
315,
879,
5499,
329,
6855,
5301,
37811,
198,
11748,
28686,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
11748,
20218,
7753,
198,
11748,
4423,
346,
198,
11748,
1330,
8019,
198,
11748,
279,
10025,
22602,
198,
11748,
4738,
198,
1174... | 2.612479 | 609 |
import nevergrad as ng
import numpy as np
import torch
from pix2latent.utils.image import binarize
class _BaseNevergradOptimizer():
"""
Base template for NeverGrad optimization. Should be used jointly with
BaseOptimizer.
For full list of available optimizers
> https://github.com... | [
11748,
1239,
9744,
355,
23370,
201,
198,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
28034,
201,
198,
201,
198,
6738,
279,
844,
17,
15460,
298,
13,
26791,
13,
9060,
1330,
9874,
283,
1096,
201,
198,
201,
198,
201,
198,
... | 2.017336 | 2,538 |
import zopfli
import zopfli.zopfli
| [
11748,
1976,
404,
2704,
72,
198,
11748,
1976,
404,
2704,
72,
13,
89,
404,
2704,
72,
198
] | 2.058824 | 17 |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 9 11:46:59 2018
Supporting functions for image undistortion.
If not specified, functions use the invertible Dhane distortion model.
@author: Guido de Croon.
"""
import numpy as np
def Dhane_distortion(x_p, y_p, k = 1.25, f = 1.0):
""" Takes normalized coordinates... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
2447,
220,
860,
1367,
25,
3510,
25,
3270,
2864,
198,
198,
15514,
278,
5499,
329,
2939,
3318,
396,
5817,
13,
220,
198,
1532,
407,
7368,
1... | 2.188348 | 1,768 |
from django import forms
from django.template import Context
from django.template.loader import get_template
from django.utils.translation import ugettext_lazy as _
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
28243,
1330,
30532,
198,
6738,
42625,
14208,
13,
28243,
13,
29356,
1330,
651,
62,
28243,
198,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
125... | 3.795455 | 44 |
from genres.tests.test_api import GenresAPITests
from core.tests.test_api.private import PrivateAPITests
class AdminPrivateGenresAPITests(GenresAPITests, PrivateAPITests):
'''Test genres API requests that require admin authentication.'''
class OwnerPrivateGenresAPITests(GenresAPITests, PrivateAPITests):
'''... | [
6738,
27962,
13,
41989,
13,
9288,
62,
15042,
1330,
5215,
411,
2969,
2043,
3558,
198,
6738,
4755,
13,
41989,
13,
9288,
62,
15042,
13,
19734,
1330,
15348,
2969,
2043,
3558,
628,
198,
4871,
32053,
29067,
13746,
411,
2969,
2043,
3558,
7,
... | 3.579439 | 107 |
#!/usr/bin/env python
import pika
import time
import sys
from common.connection import RabbitConnect
connection = RabbitConnect()
channel = connection.connect()
EXCHANGE_NAME = 'geographic-info'
# Durable queues
channel.exchange_declare(
exchange=EXCHANGE_NAME,
exchange_type='topic')
# Exclusive Queue for... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
279,
9232,
198,
11748,
640,
198,
11748,
25064,
198,
198,
6738,
2219,
13,
38659,
1330,
25498,
13313,
198,
198,
38659,
796,
25498,
13313,
3419,
198,
17620,
796,
4637,
13,
8443,
3419... | 2.664908 | 379 |
from typing import Dict, List
from pydantic import BaseModel
from oaff.app.responses.models.link import Link
| [
6738,
19720,
1330,
360,
713,
11,
7343,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
198,
198,
6738,
267,
2001,
13,
1324,
13,
16733,
274,
13,
27530,
13,
8726,
1330,
7502,
628
] | 3.393939 | 33 |
import os
import pathlib
import sys
import setuptools
import distutils.extension
import distutils.command.build_ext
# We subclass the build_ext command to build executables instead of building
# python extensions based on [1].
# This is sort of a hack to trick setuptools into thinking that the package is
# not pure.... | [
11748,
28686,
198,
11748,
3108,
8019,
198,
11748,
25064,
198,
198,
11748,
900,
37623,
10141,
198,
11748,
1233,
26791,
13,
2302,
3004,
198,
11748,
1233,
26791,
13,
21812,
13,
11249,
62,
2302,
198,
198,
2,
775,
47611,
262,
1382,
62,
2302,... | 2.699399 | 998 |
/home/runner/.cache/pip/pool/c0/e6/c3/73da9ac73f39c64aa1e94a334e92f494b910baf9253b8edef35951f3d1 | [
14,
11195,
14,
16737,
11757,
23870,
14,
79,
541,
14,
7742,
14,
66,
15,
14,
68,
21,
14,
66,
18,
14,
4790,
6814,
24,
330,
4790,
69,
2670,
66,
2414,
7252,
16,
68,
5824,
64,
31380,
68,
5892,
69,
39449,
65,
43234,
65,
1878,
24,
285... | 1.714286 | 56 |
S = 'Spam'
print(S, len(S))
print("Indexing from start")
print(S[0])
print(S[1])
print(S[2])
print(S[3])
# print(S[4])
print("Indexing from last")
print(S[-1])
print(S[-2])
print(S[-3])
print(S[-4])
# print(S[-5])
print(S[1:3])
S = S + "xyz"
print("S+xyz", S)
print("S**8", S*8)
| [
50,
796,
705,
4561,
321,
6,
198,
198,
4798,
7,
50,
11,
18896,
7,
50,
4008,
198,
198,
4798,
7203,
15732,
278,
422,
923,
4943,
198,
4798,
7,
50,
58,
15,
12962,
198,
4798,
7,
50,
58,
16,
12962,
198,
4798,
7,
50,
58,
17,
12962,
... | 1.845161 | 155 |
import pytest
from django.urls import reverse
from rest_framework import status
from api.models import Well, Inclinometry, Mer, Rate, WellHorizon, FieldCoordinate, WellCase, WellPump, WellPerforation
pytestmark = pytest.mark.django_db
| [
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
198,
6738,
40391,
13,
27530,
1330,
3894,
11,
554,
565,
259,
15748,
11,
4638,
11,
14806,
11,
3894,
27991,
8637,
11,
766... | 3.305556 | 72 |
#Известны количество жителей в государстве и площадь его территории. Определить плотность населения в этом государстве
a = int(input("количество жителей в государстве="))
b = int(input("площадь территории государства="))
print("Плотнотсть:",a/b) | [
2,
140,
246,
140,
115,
38857,
16843,
21727,
20375,
22177,
45035,
12466,
118,
25443,
119,
18849,
141,
229,
16843,
21727,
20375,
38857,
15166,
12466,
114,
18849,
20375,
16843,
30143,
16843,
140,
117,
12466,
110,
12466,
111,
15166,
21727,
3507... | 1.065217 | 230 |
from .theme import ThemeManager
| [
6738,
764,
43810,
1330,
26729,
13511,
198
] | 4.571429 | 7 |
"""
Revision ID: 2b0a203b1216
Revises: e1c59550dd51
Create Date: 2020-06-29 10:36:58.714041
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '2b0a203b1216'
down_revision = 'e1c59550dd51'
branch_labels = None
depends_on = None... | [
37811,
198,
198,
18009,
1166,
4522,
25,
362,
65,
15,
64,
22416,
65,
1065,
1433,
198,
18009,
2696,
25,
304,
16,
66,
3270,
22730,
1860,
4349,
198,
16447,
7536,
25,
12131,
12,
3312,
12,
1959,
838,
25,
2623,
25,
3365,
13,
45722,
50049,
... | 2.503876 | 129 |
import logging
from typing import Dict, List, Optional
from strips_hgn.config import TRAINING_DATA_TIMER_LOG_LEVEL
from strips_hgn.planning import STRIPSAction, STRIPSProblem
from strips_hgn.planning.fast_downward_api import get_optimal_actions_using_fd
from strips_hgn.training_data import StateValuePair
from strips_h... | [
11748,
18931,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
32233,
198,
198,
6738,
22670,
62,
71,
4593,
13,
11250,
1330,
29125,
1268,
2751,
62,
26947,
62,
51,
3955,
1137,
62,
25294,
62,
2538,
18697,
198,
6738,
22670,
62,
71,
4593,
... | 2.487706 | 3,945 |
from unityagents import UnityEnvironment
import numpy as np
import torch
import matplotlib.pyplot as plt
from agents.ddpg_agent import MADDPGCollective
import sys
if __name__ == "__main__":
main() | [
6738,
14111,
49638,
1330,
18714,
31441,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
6554,
13,
1860,
6024,
62,
25781,
1330,
45878,
6322,
38,
31337,
425,
... | 3.274194 | 62 |
"""Utility functions for PyBld."""
from traceback import print_exc
def Highlight_Custom(txt, pattern, color):
"""Highlight a string.
type:(str, pattern, tuple[str]) -> str
if type(txt) is unicode:
txt = txt.encode('UTF-8')
"""
from re import Pattern
retV = txt
if isinstance(patte... | [
37811,
18274,
879,
5499,
329,
9485,
33,
335,
526,
15931,
198,
6738,
12854,
1891,
1330,
3601,
62,
41194,
628,
198,
4299,
3334,
2971,
62,
15022,
7,
14116,
11,
3912,
11,
3124,
2599,
198,
220,
220,
220,
37227,
11922,
2971,
257,
4731,
13,
... | 2.300546 | 549 |
from __future__ import print_function, division
import unittest
from PyAstronomy import pyasl
# plt.contour(p, [l5pot*1.02, l3pot, l2pot, l1pot], colors=['g', 'c', 'b', 'r'], extent=[-1.5,2,-1.6,1.6])
# plt.text(l1, 0, 'L1', horizontalalignment='center')
# plt.text(l2, 0, 'L2', horizon... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
198,
11748,
555,
715,
395,
198,
6738,
9485,
33751,
1313,
9145,
1330,
12972,
292,
75,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
2,
220,
220,
220,
220,
220,
220,
220,
... | 2.010714 | 280 |
from enum import Enum
from unittest import TestCase
from piccolo.columns.choices import Choice
from piccolo.columns.column_types import Integer, Varchar
from piccolo.table import Table
from tests.example_apps.music.tables import Band, Manager
| [
6738,
33829,
1330,
2039,
388,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
8301,
45745,
13,
28665,
82,
13,
6679,
1063,
1330,
18502,
198,
6738,
8301,
45745,
13,
28665,
82,
13,
28665,
62,
19199,
1330,
34142,
11,
569,
998... | 3.521127 | 71 |
from .basic import *
from .convnet import *
| [
6738,
764,
35487,
1330,
1635,
198,
6738,
764,
42946,
3262,
1330,
1635,
198
] | 3.384615 | 13 |
from .PLA import DualPLA
from .PLA import PLA
| [
6738,
764,
45710,
1330,
20446,
45710,
198,
6738,
764,
45710,
1330,
45838,
198
] | 3.538462 | 13 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import path
from os.path import abspath
from os.path import join
from os import pardir
from urllib.request import urlopen
from numpy import asarray
from numpy import uint8
from cv2 import imdecode
from cv2 import IMREAD_COLOR
from cv2 import rectangle
from cv2 imp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
25064,
1330,
3108,
198,
6738,
28686,
13,
6978,
1330,
2352,
6978,
198,
6738,
28686,
13,
6978,
1330,
4654,
198,
673... | 2.911765 | 170 |
from datetime import datetime, timedelta
from pathlib import Path
import click
from cryptography.exceptions import UnsupportedAlgorithm
from certipie.cli.options import common_certificate_options
from certipie.cli.parameters import AutoCertDomainNameListParamType, validate_domain_name
from certipie.core import create... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
3904,
198,
6738,
45898,
13,
1069,
11755,
1330,
791,
15999,
2348,
42289,
198,
198,
6738,
5051,
541,
494,
13,
44506,
13,
25811,
133... | 2.669421 | 968 |
# $Id: dpkt.py 43 2007-08-02 22:42:59Z jon.oberheide $
# -*- coding: utf-8 -*-
"""Simple packet creation and parsing."""
from __future__ import absolute_import
import copy
import struct
from functools import partial
from .compat import compat_ord, compat_izip, iteritems, ntole
class Packet(_MetaPacket("Temp", ... | [
2,
720,
7390,
25,
288,
79,
21841,
13,
9078,
5946,
4343,
12,
2919,
12,
2999,
2534,
25,
3682,
25,
3270,
57,
474,
261,
13,
2023,
258,
485,
720,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
26437,
19638... | 2.105172 | 2,301 |
from .Handler import Handler, StackLine
from .StackOverflowIntegration import StackOverflowIntegration
from .SolutionsIntegration import SolutionsIntegration
| [
6738,
764,
25060,
1330,
32412,
11,
23881,
13949,
198,
6738,
764,
25896,
5886,
11125,
34500,
1358,
1330,
23881,
5886,
11125,
34500,
1358,
198,
6738,
764,
50,
14191,
34500,
1358,
1330,
23555,
34500,
1358,
198
] | 4.647059 | 34 |
# Generated by Django 3.0.3 on 2020-04-11 10:27
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
18,
319,
12131,
12,
3023,
12,
1157,
838,
25,
1983,
198,
198,
11748,
42625,
14208,
13,
3642,
822,
13,
7353,
34239,
13,
25747,
13,
17752,
65,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
... | 2.847458 | 59 |
#!/usr/bin/env python3
from OpenGL.GL import *
from OpenGL.GLUT import *
from opengl_app import OpenGLApp
# The main drawing function.
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
30672,
13,
8763,
1330,
1635,
198,
6738,
30672,
13,
8763,
3843,
1330,
1635,
198,
198,
6738,
1280,
4743,
62,
1324,
1330,
30672,
4677,
628,
198,
220,
220,
220,
1303,
383,
... | 2.787879 | 66 |
import graphene
from .main_types import Student
from .enums import Side, Role
| [
11748,
42463,
198,
6738,
764,
12417,
62,
19199,
1330,
13613,
198,
6738,
764,
268,
5700,
1330,
12075,
11,
20934,
628
] | 3.95 | 20 |
# Copyright 2019 Lukas Jendele and Ondrej Skopek.
# Adapted from The TensorFlow Authors, under the ASL 2.0.
#
# 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/licen... | [
2,
15069,
13130,
28102,
292,
449,
437,
11129,
290,
440,
358,
260,
73,
3661,
404,
988,
13,
198,
2,
30019,
276,
422,
383,
309,
22854,
37535,
46665,
11,
739,
262,
7054,
43,
362,
13,
15,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
1... | 3.137824 | 2,583 |
from loopDB import LoopDB
from tables import * | [
6738,
9052,
11012,
1330,
26304,
11012,
198,
6738,
8893,
1330,
1635
] | 4.181818 | 11 |
"""
Authors: Sridhar Gopinath, Nishant Kumar.
Copyright:
Copyright (c) 2020 Microsoft Research
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 th... | [
37811,
198,
198,
30515,
669,
25,
311,
6058,
9869,
402,
404,
259,
776,
11,
48438,
415,
26105,
13,
198,
198,
15269,
25,
198,
15269,
357,
66,
8,
12131,
5413,
4992,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
... | 3.71131 | 336 |
# AUTOGENERATED! DO NOT EDIT! File to edit: 04_gradient.ipynb (unless otherwise specified).
__all__ = ['GradientBase', 'SPSAGradient']
# Cell
import numpy
import scipy
from abc import ABC, abstractmethod
# Cell
class GradientBase(ABC):
"""A helper class that provides a standard means to create
classes to pr... | [
2,
47044,
7730,
1677,
1137,
11617,
0,
8410,
5626,
48483,
0,
9220,
284,
4370,
25,
8702,
62,
49607,
13,
541,
2047,
65,
357,
25252,
4306,
7368,
737,
198,
198,
834,
439,
834,
796,
37250,
42731,
1153,
14881,
3256,
705,
50,
3705,
4760,
63... | 2.360321 | 1,371 |
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import os
version_path = os.path.join(os.path.dirname(__file__), "karton/core/__version__.py")
version_info = {}
with open(version_path) as f:
exec(f.read(), version_info)
setup(
name="karton-... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
11748,
28686,
198... | 2.592697 | 356 |
from ._rowsubsampling import SubSampler
__all__ = ["SubSampler"]
| [
6738,
47540,
808,
7266,
37687,
11347,
1330,
3834,
16305,
20053,
198,
198,
834,
439,
834,
796,
14631,
7004,
16305,
20053,
8973,
198
] | 3 | 22 |
import lib.fhepy_gpu as fhe
import time
import timeit
| [
11748,
9195,
13,
69,
258,
9078,
62,
46999,
355,
277,
258,
198,
11748,
640,
198,
11748,
640,
270,
628,
628,
198
] | 2.761905 | 21 |
from clouds.workflows.prediction import attention
from clouds.workflows.prediction import neural_network | [
6738,
15114,
13,
1818,
44041,
13,
28764,
2867,
1330,
3241,
198,
6738,
15114,
13,
1818,
44041,
13,
28764,
2867,
1330,
17019,
62,
27349
] | 4.521739 | 23 |
import pytest
from django_countries import countries
from measurement.measures import Weight
from prices import Money
from ..models import (
ShippingMethod,
ShippingMethodChannelListing,
ShippingMethodType,
ShippingZone,
)
from ..utils import default_shipping_zone_exists, get_countries_without_shipping... | [
11748,
12972,
9288,
198,
6738,
42625,
14208,
62,
9127,
1678,
1330,
2678,
198,
6738,
15558,
13,
47336,
1330,
14331,
198,
6738,
4536,
1330,
12911,
198,
198,
6738,
11485,
27530,
1330,
357,
198,
220,
220,
220,
24147,
17410,
11,
198,
220,
22... | 2.373905 | 1,142 |
# import
from sklearn.metrics.pairwise import cosine_similarity, pairwise_distances
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
import numpy as np
# prepare corpus
corpus = []
for d in range(1400):
f = open("cranfield/d/"+str(d+1)+".txt")
corpus.append(f.read())
f.close()... | [
198,
2,
1330,
198,
6738,
1341,
35720,
13,
4164,
10466,
13,
24874,
3083,
1330,
8615,
500,
62,
38610,
414,
11,
5166,
3083,
62,
17080,
1817,
198,
6738,
1341,
35720,
13,
30053,
62,
2302,
7861,
13,
5239,
1330,
309,
69,
312,
69,
38469,
75... | 2.276249 | 981 |
from flask import Flask
app = Flask(__name__)
import code.login
import code.signup
import code.blogView
import code.main
import code.blobStorage
import code.bloglist
import code.statistics
import code.createBlog
| [
6738,
42903,
1330,
46947,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
11748,
2438,
13,
38235,
198,
11748,
2438,
13,
12683,
929,
198,
11748,
2438,
13,
14036,
7680,
198,
11748,
2438,
13,
12417,
198,
11748,
2438,
13,
2436... | 3.396825 | 63 |
"""
Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.
Example:
Input:
1
\
3
/
2
Output:
1
Explanation:
The minimum absolute difference is 1, which is the difference between 2 and 1 (or between 2 and 3).
Note:
There are ... | [
37811,
198,
198,
15056,
257,
13934,
2989,
5509,
351,
1729,
12,
31591,
3815,
11,
1064,
262,
5288,
4112,
3580,
1022,
3815,
286,
597,
734,
13760,
13,
198,
16281,
25,
198,
198,
20560,
25,
628,
220,
220,
352,
198,
220,
220,
220,
3467,
19... | 2.808036 | 224 |
# main.py
import utils
utils.intro_message()
user_input = input('Enter a word("q" to exit the program): ')
while user_input != 'q':
utils.translate(user_input)
user_input = input('Enter another word("q" to exit the program): ')
utils.exit_message()
| [
2,
1388,
13,
9078,
198,
198,
11748,
3384,
4487,
628,
198,
26791,
13,
600,
305,
62,
20500,
3419,
198,
7220,
62,
15414,
796,
5128,
10786,
17469,
257,
1573,
7203,
80,
1,
284,
8420,
262,
1430,
2599,
705,
8,
198,
198,
4514,
2836,
62,
1... | 2.787234 | 94 |
#given a list of integers
#return a list of lists of integers
| [
220,
220,
220,
1303,
35569,
257,
1351,
286,
37014,
198,
220,
220,
220,
1303,
7783,
257,
1351,
286,
8341,
286,
37014,
198
] | 3.181818 | 22 |
import pytest
from selenium import webdriver
@pytest.fixture(scope="class")
| [
11748,
12972,
9288,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
2625,
4871,
4943,
198
] | 3.12 | 25 |
import typer
import json
from typing import Optional, List
import podcastindex33 as pci
if __name__ == "__main__":
run()
| [
11748,
1259,
525,
198,
198,
11748,
33918,
198,
6738,
19720,
1330,
32233,
11,
7343,
198,
198,
11748,
9905,
9630,
2091,
355,
39886,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
1057,
3419,
198
] | 3.25641 | 39 |
# Copyright 2019 Xilinx Inc.
#
# 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 agreed to in writing, ... | [
2,
15069,
13130,
1395,
346,
28413,
3457,
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,
13789,
13,
198,
2... | 3.472727 | 330 |
# -*- coding: utf-8 -*-
# pdanshov feb 13 2018
'''
author: Peter Danshov
date: April 12 2018
version: 1.1.2
version 1.1.2
Apr 12th 2018
added variable & loop for counter, for each entry everytime the script runs
version 1.1.1
Feb 21st 2018
added variable for search term, and replaced url's with variabl... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
279,
67,
504,
28026,
730,
65,
1511,
2864,
198,
7061,
6,
198,
9800,
25,
5613,
360,
504,
28026,
198,
4475,
25,
3035,
1105,
2864,
198,
9641,
25,
352,
13,
16,
13,
1... | 2.684 | 250 |
import sqlalchemy as sa
from sqlalchemy import orm
from .base import ModelBase
| [
11748,
44161,
282,
26599,
355,
473,
198,
6738,
44161,
282,
26599,
1330,
393,
76,
198,
198,
6738,
764,
8692,
1330,
9104,
14881,
198
] | 3.478261 | 23 |
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import contextlib
import datetime
import subprocess
import types
from pathlib import Path
from typing import Iterator, List, Optional, Tuple, Type, Union
import arrow
from specfile.changelog import Changelog, ChangelogEntry
from specfile.... | [
2,
15069,
25767,
669,
284,
262,
6400,
270,
1628,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
198,
11748,
4732,
8019,
198,
11748,
4818,
8079,
198,
11748,
850,
14681,
198,
11748,
3858,
198,
6738,
3108,
8019,
1330,... | 2.265553 | 2,395 |
import logging
import os
import time
from typing import List, Optional
import cv2
import numpy as np
from skimage.metrics import structural_similarity
from utils import run_ffmpeg, setup_logger
from .config import Config
from .utils import crop_to_regions
| [
11748,
18931,
198,
11748,
28686,
198,
11748,
640,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
9060,
13,
4164,
10466,
1330,
13204,
62,
38610,
414,
198,
198,
... | 3.597222 | 72 |
"""Test the Food Dictionary widget."""
import os
import unittest
from unittest.mock import patch, mock_open
from PyQt5.QtTest import QTest
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication
import healthhelper.interface as interface
# Directory containing this file
this_dir = os.path.abspath(os.pa... | [
37811,
14402,
262,
7318,
28261,
26295,
526,
15931,
198,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
11,
15290,
62,
9654,
198,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14402,
1330,... | 2.862434 | 189 |
# V0
# TO CHECK : ARRAY -> BST : # 108 Convert Sorted Array to Binary Search Tree`
# V1
# https://blog.csdn.net/fuxuemingzhu/article/details/83961263
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = No... | [
2,
569,
15,
198,
2,
5390,
5870,
25171,
1058,
5923,
30631,
4613,
44992,
1058,
220,
1303,
15495,
38240,
311,
9741,
15690,
284,
45755,
11140,
12200,
63,
198,
198,
2,
569,
16,
220,
198,
2,
3740,
1378,
14036,
13,
6359,
32656,
13,
3262,
1... | 2.288809 | 277 |
from django.dispatch import receiver
from django.conf import settings
from . signals import custom_request_finished
from activity_log.models import ActivityLog
from . models import AdminNotified
@receiver(custom_request_finished) | [
6738,
42625,
14208,
13,
6381,
17147,
1330,
9733,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6738,
764,
10425,
1330,
2183,
62,
25927,
62,
43952,
198,
6738,
3842,
62,
6404,
13,
27530,
1330,
24641,
11187,
198,
6738,
764,
498... | 4.070175 | 57 |
from dataclasses import dataclass
from typing import (
Type, Hashable, Optional, ContextManager, List, Generic, TypeVar, ClassVar,
Tuple, Union, Dict, Any
)
from typing_extensions import Protocol
import agate
from dbt.contracts.connection import Connection, AdapterRequiredConfig
from dbt.contracts.graph.compi... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
357,
198,
220,
220,
220,
5994,
11,
21059,
540,
11,
32233,
11,
30532,
13511,
11,
7343,
11,
42044,
11,
5994,
19852,
11,
5016,
19852,
11,
198,
220,
220,
220,
309,
... | 3.156342 | 339 |
from matplotlib import pyplot as plt
import seaborn as sns
def plot_risk_reward(vol_df):
"""
Plot risk (volatility) vs reward (return).
Args:
vol_df (pandas.DataFrame): volatility DataFrame
Returns:
risk vs reward plot
"""
colors = sns.color_palette("husl"... | [
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
11748,
384,
397,
1211,
355,
3013,
82,
628,
198,
4299,
7110,
62,
19121,
62,
260,
904,
7,
10396,
62,
7568,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
... | 2.228541 | 932 |
# Copyright 2012 Google Inc. 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 applicable law or ... | [
2,
15069,
2321,
3012,
3457,
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,
351,
262,
13789,
... | 2.015839 | 947 |
import tkinter as tk
from tkinter import filedialog
from tkinter.ttk import Combobox
from os.path import expanduser, join
from logging import getLogger
from PIL import Image, ImageTk, ImageEnhance, ImageOps
from cv2 import cv2
from numpy import array, linspace, cos, pi, exp, uint8, zeros
from matplotlib import pyplot ... | [
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519,
198,
6738,
256,
74,
3849,
13,
926,
74,
1330,
14336,
672,
1140,
198,
6738,
28686,
13,
6978,
1330,
4292,
7220,
11,
4654,
198,
6738,
18931,
1330,
651,
... | 1.850824 | 1,153 |
# -*- coding: utf-8 -*-
import json
import os
import sys
from aldryn_client import forms
class CachedLoader(list):
"""
A list subclass to be used for the template loaders option
This subclass exposes the same interface as a list and allows subsequent
code to alter the list of template loaders withou... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
257,
335,
29441,
62,
16366,
1330,
5107,
628,
198,
4871,
327,
2317,
17401,
7,
4868,
2599,
198,
220,
22... | 3.284916 | 179 |
#
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PRO... | [
2,
198,
2,
15069,
357,
34,
8,
685,
42334,
60,
10898,
42990,
21852,
11,
3457,
13,
198,
2,
198,
2,
7473,
5222,
12,
49,
1797,
33538,
318,
11971,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
... | 3.288026 | 309 |
# Copyright (C) 2021 Nippon Telegraph and Telephone 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/LICE... | [
2,
15069,
357,
34,
8,
33448,
399,
3974,
261,
21821,
290,
44735,
10501,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
19... | 2.752459 | 610 |
import os
import requests
URL = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip'
script_dir = os.path.dirname(os.path.abspath(__file__))
| [
11748,
28686,
198,
11748,
7007,
628,
198,
21886,
796,
705,
4023,
1378,
2503,
13,
14036,
13,
29412,
32016,
13,
2398,
14,
24142,
12,
11299,
14,
39920,
14,
6999,
14,
3312,
14,
49345,
43832,
7680,
263,
13,
13344,
6,
198,
198,
12048,
62,
... | 2.630769 | 65 |
# Generated by Django 3.0.2 on 2020-01-16 23:32
from django.db import migrations, models
import multiselectfield.db.fields
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
17,
319,
12131,
12,
486,
12,
1433,
2242,
25,
2624,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
1963,
786,
801,
3245,
13,
9945,
13,
25747,
628
] | 2.97619 | 42 |
"""Reverter.
"""
from .auralisation import _DEFAULT_SETTINGS, recursive_mapping_update
from .propagation import *
import logging
from acoustics._signal import Signal
from acoustics.atmosphere import Atmosphere
import auraliser.tools
logger = auraliser.tools.create_logger(__name__)
import auraliser
from streaming im... | [
37811,
49,
964,
353,
13,
198,
37811,
198,
198,
6738,
764,
64,
1523,
5612,
1330,
4808,
7206,
38865,
62,
28480,
51,
20754,
11,
45115,
62,
76,
5912,
62,
19119,
198,
6738,
764,
22930,
363,
341,
1330,
1635,
198,
11748,
18931,
198,
198,
6... | 1.897688 | 2,336 |
from itertools import product
import numpy as np
from numpy.testing import assert_allclose
import pandas as pd
import pytest
from linearmodels.iv import IV2SLS
from linearmodels.panel.data import PanelData
from linearmodels.panel.model import BetweenOLS
from linearmodels.tests.panel._utility import (
access_attri... | [
6738,
340,
861,
10141,
1330,
1720,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
439,
19836,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
12972,
9288,
198,
198,
6738,
14174,
27530,
13,
... | 2.943723 | 231 |
# -*- coding: utf-8 -*-
import ast
import logging
import re
import shlex
import subprocess
from collections import defaultdict
from contextlib import contextmanager
from typing import (
cast,
TYPE_CHECKING,
Dict,
FrozenSet,
Generator,
List,
NamedTuple,
Optional,
Set,
Tuple,
T... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
6468,
198,
11748,
18931,
198,
11748,
302,
198,
11748,
427,
2588,
198,
11748,
850,
14681,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
4732,
8019,
1330,
4732,
371... | 2.680488 | 410 |
#!/usr/bin/env python
from app import app
app.run()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
598,
1330,
598,
198,
1324,
13,
5143,
3419,
198
] | 2.736842 | 19 |
"""
>>> from tuple_ext import *
>>> def printer(*args):
... for x in args: print x,
... print
...
>>> print convert_to_tuple("this is a test string")
('t', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', ' ', 's', 't', 'r', 'i', 'n', 'g')
>>> t1 = convert_to_tuple("this is")
>>> t2 = (... | [
37811,
201,
198,
33409,
422,
46545,
62,
2302,
1330,
1635,
201,
198,
33409,
825,
20632,
46491,
22046,
2599,
201,
198,
986,
220,
220,
220,
220,
329,
2124,
287,
26498,
25,
3601,
2124,
11,
201,
198,
986,
220,
220,
220,
220,
3601,
201,
1... | 2.04698 | 298 |
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
import threading
import time
import pytest
from pioreactor.actions.pump import add_alt_media
from pioreactor.actions.pump import add_media
from pioreactor.actions.pump import remove_waste
from pioreactor.exc import CalibrationError
from pioreacto... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
33918,
198,
11748,
4704,
278,
198,
11748,
640,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
31028,
382,
11218,
13,
... | 3.280255 | 157 |
def nome_cidade_pais(cidade, pais, populacao=''):
"""[Junta o nome de uma cidade e o de um país de forma elegante]
"""
if populacao:
cidade_pais = f'{cidade.title()}, {pais.title()} - população {populacao}'
else:
cidade_pais = f'{cidade.title()}, {pais.title()}'
return cidade_pais
| [
4299,
299,
462,
62,
66,
312,
671,
62,
8957,
271,
7,
66,
312,
671,
11,
14187,
271,
11,
16595,
330,
5488,
28,
7061,
2599,
198,
220,
220,
220,
13538,
17912,
41,
44424,
267,
299,
462,
390,
334,
2611,
269,
312,
671,
304,
267,
390,
23... | 1.962963 | 162 |
# ===============================================================================
# Copyright 2012 Jake Ross
#
# 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/licens... | [
2,
38093,
25609,
855,
198,
2,
15069,
2321,
14757,
9847,
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,
13789,
... | 4.411565 | 294 |
#!/usr/bin/python
"""vowel, `glide-`"""
# pkg
from hebphonics.grammar import Parser
# vowel
def test_holam_haser_default():
"""default `holam` is `holam-haser` (vowel-holam-haser-default)"""
word = r"צֹר" # tsor (Exodus 4:25)
parts = ["tsadi", "holam-haser", "resh"]
assert parts == Parser().parse(w... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
85,
322,
417,
11,
4600,
4743,
485,
12,
63,
37811,
198,
198,
2,
279,
10025,
198,
6738,
339,
65,
746,
38530,
13,
4546,
3876,
1330,
23042,
263,
198,
198,
2,
48617,
628,
198,
4299,
133... | 2.092369 | 1,245 |
from pycoin.encoding.sec import is_sec_compressed, sec_to_public_pair
from pycoin.serialize import h2b
from pycoin.ui.Parser import Parser
| [
198,
6738,
12972,
3630,
13,
12685,
7656,
13,
2363,
1330,
318,
62,
2363,
62,
5589,
2790,
11,
792,
62,
1462,
62,
11377,
62,
24874,
198,
6738,
12972,
3630,
13,
46911,
1096,
1330,
289,
17,
65,
198,
6738,
12972,
3630,
13,
9019,
13,
46677... | 3 | 47 |
from unittest import TestCase
from random import Random
from cipher21.key import Cipher21Key
from cipher21.constants import KEY_LENGTH
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
4738,
1330,
14534,
198,
198,
6738,
38012,
2481,
13,
2539,
1330,
44334,
2481,
9218,
198,
6738,
38012,
2481,
13,
9979,
1187,
1330,
35374,
62,
43,
49494,
628
] | 3.805556 | 36 |
from rest_framework import routers
from dhost.github.views import RepositoryViewSet, WebhookViewSet
router = routers.SimpleRouter()
router.register("repositories", RepositoryViewSet, basename="github_repo")
router.register("webhook", WebhookViewSet, basename="github_webhook")
urlpatterns = router.urls
| [
6738,
1334,
62,
30604,
1330,
41144,
198,
198,
6738,
288,
4774,
13,
12567,
13,
33571,
1330,
1432,
13264,
7680,
7248,
11,
5313,
25480,
7680,
7248,
198,
198,
472,
353,
796,
41144,
13,
26437,
49,
39605,
3419,
198,
472,
353,
13,
30238,
720... | 3.315217 | 92 |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (leoxiaobin@gmail.com)
# Modified by Bowen Cheng (bcheng9@illinois.edu)
# ------------------------------------------------------------------------------
fro... | [
2,
16529,
26171,
198,
2,
15069,
357,
66,
8,
5413,
198,
2,
49962,
739,
262,
17168,
13789,
13,
198,
2,
22503,
416,
20828,
28249,
357,
293,
1140,
544,
38954,
31,
14816,
13,
785,
8,
198,
2,
40499,
416,
46977,
27692,
357,
65,
2395,
782... | 3.683417 | 398 |
import mock
import pytest
from openapi_core.schema.links.models import Link
from openapi_core.schema.servers.models import Server
| [
11748,
15290,
198,
11748,
12972,
9288,
198,
198,
6738,
1280,
15042,
62,
7295,
13,
15952,
2611,
13,
28751,
13,
27530,
1330,
7502,
198,
6738,
1280,
15042,
62,
7295,
13,
15952,
2611,
13,
2655,
690,
13,
27530,
1330,
9652,
628
] | 3.384615 | 39 |
"""Test the X-Forwarded-For middleware."""
from ..middleware.xforwardedfor import xforwardedfor
def get_response_method(thing):
"""Do nothing."""
return thing
def test_setting_correctly(rf):
"""Override REMOTE_ADDR if HTTP_X_FORWARDED_FOR is present."""
request = rf.get('/')
request.META['REMOT... | [
37811,
14402,
262,
1395,
12,
39746,
276,
12,
1890,
3504,
1574,
526,
15931,
198,
198,
6738,
11485,
27171,
1574,
13,
87,
11813,
276,
1640,
1330,
2124,
11813,
276,
1640,
628,
198,
4299,
651,
62,
26209,
62,
24396,
7,
1197,
2599,
198,
220,... | 2.580977 | 389 |
"""
Code for understanding function definitions.
"""
from abc import abstractmethod
import ast
import asyncio
import collections.abc
import types
import asynq
import enum
from dataclasses import dataclass, replace
from itertools import zip_longest
from typing import Iterable, List, Optional, Sequence, Tuple, TypeVar,... | [
37811,
198,
198,
10669,
329,
4547,
2163,
17336,
13,
198,
198,
37811,
198,
6738,
450,
66,
1330,
12531,
24396,
198,
11748,
6468,
198,
11748,
30351,
952,
198,
11748,
17268,
13,
39305,
198,
11748,
3858,
198,
11748,
355,
2047,
80,
198,
11748... | 2.371644 | 4,507 |
import re
from log import gen_log
from piecewise import PiecewiseContext
| [
11748,
302,
201,
198,
6738,
2604,
1330,
2429,
62,
6404,
201,
198,
6738,
3704,
3083,
1330,
27053,
3083,
21947,
201,
198,
201,
198
] | 3.391304 | 23 |
from scipy.spatial import distance as dist
from imutils import perspective
from imutils import contours
import numpy as np
import argparse
import imutils
from cv2 import cv2
import math
import glob
import pickle
#warning you are now entering a bruh moment zone
#warning you are now exiting a bruh moment zone
... | [
6738,
629,
541,
88,
13,
2777,
34961,
1330,
5253,
355,
1233,
198,
6738,
545,
26791,
1330,
6650,
198,
6738,
545,
26791,
1330,
542,
4662,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
11748,
545,
26791,
198,
6738,
269,
... | 3.12828 | 343 |
from flask import jsonify
s1 = StationItem('testname1', 'testcity1', 12, 3)
s2 = StationItem('testname2', 'testcity2', 12, 3)
stationList = [s1, s2]
| [
6738,
42903,
1330,
33918,
1958,
628,
198,
82,
16,
796,
9327,
7449,
10786,
9288,
3672,
16,
3256,
705,
9288,
19205,
16,
3256,
1105,
11,
513,
8,
198,
82,
17,
796,
9327,
7449,
10786,
9288,
3672,
17,
3256,
705,
9288,
19205,
17,
3256,
110... | 2.603448 | 58 |
# Egan Mthembu
# A program that displays Fibonacci numbers using people's names.
def fib(n):
"""This function returns the nth Fibonacci number."""
i = 0
j = 1
n = n - 1
while n >= 0:
i, j = j, i + j
n = n - 1
return i
name = "Mthembu"
first = name[0]
last = name[-1]
firstno = ord(first)
lastno... | [
2,
412,
1030,
337,
1169,
2022,
84,
198,
2,
317,
1430,
326,
11298,
41566,
261,
44456,
3146,
1262,
661,
338,
3891,
13,
198,
198,
4299,
12900,
7,
77,
2599,
198,
220,
37227,
1212,
2163,
5860,
262,
299,
400,
41566,
261,
44456,
1271,
526,... | 2.719658 | 585 |
from dynamic_initial_data.base import BaseInitialData
mock_null_value = None
| [
6738,
8925,
62,
36733,
62,
7890,
13,
8692,
1330,
7308,
24243,
6601,
198,
198,
76,
735,
62,
8423,
62,
8367,
796,
6045,
628,
628,
628
] | 3.32 | 25 |