content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/evn python3
# -*- config: utf-8 -*-
# Решите следующую задачу: напишите функцию, которая считывает с клавиатуры числа и
# перемножает их до тех пор, пока не будет введен 0. Функция должна возвращать
# полученное произведение. Вызовите функцию и выведите на экран результат ее работы.
if __name__ == '__mai... | [
2,
48443,
14629,
14,
8800,
14,
1990,
77,
21015,
18,
198,
2,
532,
9,
12,
4566,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
12466,
254,
16843,
141,
230,
18849,
20375,
16843,
220,
21727,
30143,
16843,
43666,
35072,
141,
236,
141,
... | 1.115502 | 329 |
# Generated by Django 3.0.2 on 2020-05-21 09:40
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
17,
319,
12131,
12,
2713,
12,
2481,
7769,
25,
1821,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import base64
import enum
import json
import requests
class ViberMessageType(enum.IntEnum):
"""Represents Viber message type"""
TextOnly = 106
TextImageButton = 108
TextOnly2Way = 206
TextImageButton2Way = 208
class ViberMessageSourceType(enum.IntEnum):
"""Represents Viber message source ty... | [
11748,
2779,
2414,
198,
11748,
33829,
198,
11748,
33918,
198,
11748,
7007,
628,
198,
4871,
569,
1856,
12837,
6030,
7,
44709,
13,
5317,
4834,
388,
2599,
198,
220,
220,
220,
37227,
6207,
6629,
569,
1856,
3275,
2099,
37811,
628,
220,
220,
... | 2.531494 | 1,667 |
#!/usr/bin/env python2
# Python libs
import math
# Ros libsSIMULATION:
import rospy
# Ros messages
from std_msgs.msg import Float64
from std_msgs.msg import Float32MultiArray
from sensor_msgs.msg import Imu
from geometry_msgs.msg import Twist
#Gravity
G = 9.81
FILTER_SIZE = 20
# IMU offset in real world
if rospy.ha... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
11361,
9195,
82,
198,
11748,
10688,
198,
198,
2,
10018,
9195,
82,
48913,
6239,
6234,
25,
198,
11748,
686,
2777,
88,
198,
198,
2,
10018,
6218,
198,
6738,
14367,
62,
907,
14542,... | 2.254011 | 374 |
import os
from django.core.files import File
from nose.tools import eq_
from kitsune.groups.models import GroupProfile
from kitsune.groups.tests import group_profile
from kitsune.sumo.helpers import urlparams
from kitsune.sumo.tests import TestCase
from kitsune.sumo.urlresolvers import reverse
from kitsune.users.tes... | [
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
16624,
1330,
9220,
198,
198,
6738,
9686,
13,
31391,
1330,
37430,
62,
198,
198,
6738,
19183,
1726,
13,
24432,
13,
27530,
1330,
4912,
37046,
198,
6738,
19183,
1726,
13,
24432,
13,
... | 3.457143 | 105 |
#! /usr/bin/python
"""
Entry point for scrapper module to be used in 2017 and 2013
in this module it will be defined all the logic behind the data scrapping from the website(s)
"""
import requests
import json
from .filter import Filter
from .data_transform import transform
| [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
37811,
198,
30150,
966,
329,
19320,
2848,
8265,
284,
307,
973,
287,
2177,
290,
2211,
198,
259,
428,
8265,
340,
481,
307,
5447,
477,
262,
9156,
2157,
262,
1366,
19320,
2105,
422,
262,
3052... | 3.481928 | 83 |
import numpy as np
from numba.decorators import jit, autojit
import hickle
import os, gzip
binary_search_numba = autojit(binary_search, nopython=True)
ex_numba = autojit(extract, nopython=True)
| [
11748,
299,
32152,
355,
45941,
198,
6738,
997,
7012,
13,
12501,
273,
2024,
1330,
474,
270,
11,
8295,
45051,
198,
11748,
289,
39423,
198,
11748,
28686,
11,
308,
13344,
198,
198,
39491,
62,
12947,
62,
77,
2178,
64,
796,
8295,
45051,
7,
... | 2.68 | 75 |
from setuptools import setup
setup(
name='fix-author',
version='1.1',
packages=['fix_author'],
install_requires=['rbnf', 'wisepy'],
license='MIT',
author='thautwarm',
keywords='git commit, fix author',
description='fix author info in git commits',
long_description=open('README.md').... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
13049,
12,
9800,
3256,
198,
220,
220,
220,
2196,
11639,
16,
13,
16,
3256,
198,
220,
220,
220,
10392,
28,
17816,
13049,
62,
9800,
6,
4357,
198,... | 2.626623 | 308 |
import csv
import base64
import pandas as pd
import datetime as dt
from realtime_details import (extract_places_regions, radius_multiplier)
logo_image = 'cartoon-globe.png'
en_logo = base64.b64encode(open(logo_image, 'rb').read())
entire_month = pd.read_csv('https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/... | [
11748,
269,
21370,
198,
11748,
2779,
2414,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
4818,
8079,
355,
288,
83,
198,
198,
6738,
1103,
2435,
62,
36604,
1330,
357,
2302,
974,
62,
23625,
62,
2301,
507,
11,
16874,
62,
47945,
959,
... | 2.622147 | 1,183 |
# Utility functions
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from functools import reduce
import operator
def product(seq):
"""The product of a sequence of numbers"""
return reduce(operator.__mul__, seq, 1)
def scan_reverse(f, arr):
... | [
2,
34030,
5499,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
1257,
310,
10141,
1330,
4646,
628,
198,... | 2.361635 | 318 |
from django.shortcuts import redirect
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
18941,
628
] | 4.333333 | 9 |
# Copyright 2016 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 ag... | [
2,
15069,
1584,
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.986684 | 751 |
import warnings
warnings.warn("sympy_compat module is deprecated. Use `import symengine` instead", DeprecationWarning,
stacklevel=2)
from symengine import *
| [
11748,
14601,
198,
40539,
654,
13,
40539,
7203,
1837,
3149,
88,
62,
5589,
265,
8265,
318,
39224,
13,
5765,
4600,
11748,
5659,
18392,
63,
2427,
1600,
2129,
8344,
341,
20361,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 3 | 57 |
import os
# list all include directories
include_directories = [os.path.sep.join(x.split('/')) for x in ['extension/httpfs/include', 'third_party/picohash', 'third_party/httplib']]
# source files
source_files = [os.path.sep.join(x.split('/')) for x in ['extension/httpfs/crypto.cpp', 'extension/httpfs/httpfs.cpp', 'exte... | [
11748,
28686,
198,
2,
1351,
477,
2291,
29196,
198,
17256,
62,
12942,
1749,
796,
685,
418,
13,
6978,
13,
325,
79,
13,
22179,
7,
87,
13,
35312,
10786,
14,
6,
4008,
329,
2124,
287,
37250,
2302,
3004,
14,
4023,
9501,
14,
17256,
3256,
... | 2.662069 | 145 |
#!/usr/bin/env python3
'''
To start, read the docblock of `provides.py`. The code in this file verifies
that a set of Items can be correctly installed (all requirements are
satisfied, etc). It then computes an installation order such that every
Item is installed only after all of the Items that match its Requires have... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
7061,
6,
198,
2514,
923,
11,
1100,
262,
2205,
9967,
286,
4600,
15234,
1460,
13,
9078,
44646,
383,
2438,
287,
428,
2393,
3326,
6945,
198,
5562,
257,
900,
286,
17230,
460,
307,
938... | 3.499133 | 577 |
# coding=utf-8
from comply.rules.rule import *
class SymbolUsed(Rule):
""" Always list used symbols as needed/required.<br/><br/>**_Not implemented._**
If your code is using a symbol, but not explicitly telling where it got it from, you might have
a hard time figuring out just how far your code reaches ... | [
2,
19617,
28,
40477,
12,
23,
198,
198,
6738,
11997,
13,
38785,
13,
25135,
1330,
1635,
628,
198,
4871,
38357,
38052,
7,
31929,
2599,
198,
220,
220,
220,
37227,
16622,
1351,
973,
14354,
355,
2622,
14,
35827,
29847,
1671,
14,
6927,
1671,... | 3.051852 | 135 |
SEQUENCE = [
'change_descriptions',
'last_review_timestamp',
'shipit_count',
'default_reviewer_repositories',
]
| [
5188,
10917,
18310,
796,
685,
198,
220,
220,
220,
705,
3803,
62,
20147,
1968,
507,
3256,
198,
220,
220,
220,
705,
12957,
62,
19023,
62,
16514,
27823,
3256,
198,
220,
220,
220,
705,
6720,
270,
62,
9127,
3256,
198,
220,
220,
220,
705,... | 2.285714 | 56 |
from django.apps import AppConfig
from django.db.migrations import state
from django.db.models import options
options.DEFAULT_NAMES = options.DEFAULT_NAMES + ('db_constraints',)
state.DEFAULT_NAMES = options.DEFAULT_NAMES
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198,
6738,
42625,
14208,
13,
9945,
13,
76,
3692,
602,
1330,
1181,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
3689,
198,
198,
25811,
13,
7206,
38865,
62,
45,
29559,
796,
3689,
... | 3.068493 | 73 |
import pickle
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
from ImageGenerator import *
from sklearn.model_selection import KFold
from keras.applications import VGG16
from keras.applications.resnet50 import ResNet50
from keras.layers import Input, Dropout, Den... | [
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
9060,
1330,
7412,
6601,
8645,
1352,
198,
6738,
41927,
292,
1330,
6436,
11341,
198,
6738,
7412,
8645,
1352,
1330,
1635,
198,
6738,
1341,
35... | 2.538462 | 1,118 |
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c
from esphome.const import CONF_ID
CODEOWNERS = ["@berfenger"]
DEPENDENCIES = ["i2c"]
MULTI_CONF = True
CONF_STORE_IN_EEPROM = "store_in_eeprom"
mcp4728_ns = cg.esphome_ns.namespace("mcp4728")
MCP4728Component = mcp4... | [
11748,
1658,
746,
462,
13,
8189,
5235,
355,
269,
70,
198,
11748,
1658,
746,
462,
13,
11250,
62,
12102,
341,
355,
269,
85,
198,
6738,
1658,
746,
462,
13,
5589,
3906,
1330,
1312,
17,
66,
198,
6738,
1658,
746,
462,
13,
9979,
1330,
71... | 2 | 328 |
import os
import time
import signal
import pika
INTERVAL = int(os.getenv('PYP_INTERVAL', 5))
RABBITMQ_HOST = os.getenv('PYP_RABBITMQ_HOST', 'rabbitmq')
RABBITMQ_VHOST = os.getenv('PYP_RABBITMQ_VHOST')
RABBITMQ_USER = os.getenv('PYP_RABBITMQ_USER')
RABBITMQ_PASS = os.getenv('PYP_RABBITMQ_PASS')
if __name__ == '__main_... | [
11748,
28686,
198,
11748,
640,
198,
11748,
6737,
198,
11748,
279,
9232,
198,
198,
41358,
23428,
796,
493,
7,
418,
13,
1136,
24330,
10786,
47,
48232,
62,
41358,
23428,
3256,
642,
4008,
198,
3861,
15199,
2043,
49215,
62,
39,
10892,
796,
... | 2.04898 | 490 |
# Code made for Sergio Andrés Díaz Ariza
# 29 July 2021
# License MIT
# Transport Phenomena: Pipe find Diameter
from scipy.optimize import minimize
import seaborn as sns
import numpy as np
import time
start_time = time.time()
sns.set()
# Optimice the function for T, and assign constraints to resolve for Rmin,E_cons... | [
2,
6127,
925,
329,
36759,
843,
81,
20954,
360,
8836,
1031,
6069,
4496,
198,
2,
2808,
2901,
33448,
198,
2,
13789,
17168,
198,
2,
19940,
34828,
3674,
64,
25,
36039,
1064,
360,
13173,
198,
198,
6738,
629,
541,
88,
13,
40085,
1096,
1330... | 2.587432 | 366 |
import os
import random
from PIL import Image, ImageDraw, ImageFont
import click
import textwrap
@click.command()
@click.option('--filename', type=click.Path(dir_okay=False), required=True)
@click.option('--text', type=str, required=True)
@click.option('--font', type=str, default='LiberationSans-Bold')
@click.opt... | [
11748,
28686,
198,
11748,
4738,
198,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
11,
7412,
23252,
198,
198,
11748,
3904,
198,
198,
11748,
2420,
37150,
628,
198,
198,
31,
12976,
13,
21812,
3419,
198,
31,
12976,
13,
18076,
10786,
... | 2.807339 | 218 |
import pytest
import ckan.tests.factories as factories
import ckan.plugins.toolkit as tk
import ckan.authz as authz
import ckan.model as model
import ckanext.hdx_theme.tests.hdx_test_base as hdx_test_base
from ckanext.hdx_org_group.helpers.static_lists import ORGANIZATION_TYPE_LIST
from ckanext.hdx_users.helpers.noti... | [
11748,
12972,
9288,
198,
198,
11748,
269,
27541,
13,
41989,
13,
22584,
1749,
355,
17590,
198,
11748,
269,
27541,
13,
37390,
13,
25981,
15813,
355,
256,
74,
198,
11748,
269,
27541,
13,
18439,
89,
355,
6284,
89,
198,
11748,
269,
27541,
... | 2.786408 | 206 |
import pytest
import os
@pytest.fixture(scope="session", autouse=True)
| [
11748,
12972,
9288,
201,
198,
11748,
28686,
201,
198,
201,
198,
201,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
2625,
29891,
1600,
1960,
1076,
28,
17821,
8,
201,
198
] | 2.516129 | 31 |
#! /usr/bin/env python3
#
# Simple UDP server companion for udp_client.c
# This expects to receive a particular message from the CC3000. Upon each
# receipt it will respond with its own message.
import socket
UDP_IP = "10.0.0.1"
UDP_PORT = 44444
MSG_EXP = "Hello World from CC3000"
MSG_EXP_BYTES = MSG_EXP.encode()
... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
17427,
36428,
4382,
15185,
329,
334,
26059,
62,
16366,
13,
66,
198,
2,
770,
13423,
284,
3328,
257,
1948,
3275,
422,
262,
12624,
23924,
13,
14438,
1123,
220,
198,
2... | 2.391101 | 427 |
import pytest
from constructure.utilities import MissingOptionalDependency, requires_package
from constructure.utilities.utilities import _CONDA_INSTALLATION_COMMANDS
| [
11748,
12972,
9288,
198,
198,
6738,
1500,
5620,
13,
315,
2410,
1330,
25639,
30719,
35,
2690,
1387,
11,
4433,
62,
26495,
198,
6738,
1500,
5620,
13,
315,
2410,
13,
315,
2410,
1330,
4808,
10943,
5631,
62,
38604,
7036,
6234,
62,
9858,
107... | 3.8 | 45 |
"""Setup."""
from setuptools import setup, find_packages
inst_reqs = ["rio-cogeo~=2.0a4", "rasterio[s3]~=1.1", "requests"]
extra_reqs = {"test": ["pytest", "pytest-cov"]}
setup(
name="app",
version="0.0.2",
description=u"cogeo watchbot",
python_requires=">=3",
keywords="AWS-Lambda Python",
pa... | [
37811,
40786,
526,
15931,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
8625,
62,
42180,
82,
796,
14631,
27250,
12,
1073,
469,
78,
93,
28,
17,
13,
15,
64,
19,
1600,
366,
81,
1603,
952,
58,
82,
18,
... | 2.308756 | 217 |
import uvicorn
from fastapi import FastAPI
from app.config import get_config
from app.db import db
from app.rest import posts
app = FastAPI(title="Async FastAPI")
app.include_router(posts.router, prefix='/api/posts')
@app.on_event("startup")
@app.on_event("shutdown")
if __name__ == "__main__":
uvicorn.run(... | [
11748,
334,
25531,
1211,
198,
6738,
3049,
15042,
1330,
12549,
17614,
198,
198,
6738,
598,
13,
11250,
1330,
651,
62,
11250,
198,
6738,
598,
13,
9945,
1330,
20613,
198,
6738,
598,
13,
2118,
1330,
6851,
198,
198,
1324,
796,
12549,
17614,
... | 2.666667 | 132 |
# Copyright (c) 2013 Rackspace Hosting, 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 ... | [
2,
15069,
357,
66,
8,
2211,
37927,
13200,
14504,
278,
11,
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,... | 2.806977 | 860 |
#!/usr/bin/env python
"""
Generate client and server CURVE certificate files then move them into the
appropriate store directory, private_keys or public_keys. The certificates
generated by this script are used by the stonehouse and ironhouse examples.
In practice this would be done by hand or some out-of-band process... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
8645,
378,
5456,
290,
4382,
327,
4261,
6089,
10703,
3696,
788,
1445,
606,
656,
262,
198,
13335,
3650,
8619,
11,
2839,
62,
13083,
393,
1171,
62,
13083,
13,
383,
20835,
... | 3.248826 | 213 |
import sys
import zlib
import base64
import requests
import auth_server.jwt as jwt
from json import dumps as json_dumps
from json import loads as json_loads
| [
11748,
25064,
198,
11748,
1976,
8019,
198,
11748,
2779,
2414,
198,
11748,
7007,
198,
11748,
6284,
62,
15388,
13,
73,
46569,
355,
474,
46569,
198,
6738,
33918,
1330,
45514,
355,
33918,
62,
67,
8142,
198,
6738,
33918,
1330,
15989,
355,
33... | 3.468085 | 47 |
# Aula 13 - Desafio 52: Numeros primos
# Ler um numero inteiro e dizer se ele eh ou nao primo
num = int(input('Digite um numero: '))
primo = 0
for n in range(1, num+1):
if num % n == 0:
primo += 1
print('\033[1;32m', end=' ')
else:
print('\033[m', end=' ')
print(f'{n}\033[m ', end=... | [
2,
317,
4712,
1511,
532,
2935,
1878,
952,
6740,
25,
399,
6975,
418,
2684,
418,
198,
2,
31831,
23781,
997,
3529,
493,
68,
7058,
304,
288,
7509,
384,
9766,
32622,
267,
84,
299,
5488,
2684,
78,
198,
198,
22510,
796,
493,
7,
15414,
10... | 2.050179 | 279 |
import cv2
import math
import numpy as np
from filterpy.kalman import KalmanFilter
from scipy.spatial import distance
from scipy.optimize import linear_sum_assignment
# local imported codes
from automatic_brightness import average_brightness, average_brightness_hsv
import parameters as parm
# Dilates the image mult... | [
11748,
269,
85,
17,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
8106,
9078,
13,
74,
282,
805,
1330,
12612,
805,
22417,
198,
6738,
629,
541,
88,
13,
2777,
34961,
1330,
5253,
198,
6738,
629,
541,
88,
13,
40085,
1... | 4.419355 | 713 |
import numpy as np
if __name__ == '__main__':
print('Numpy Version', np.__version__)
# broadcast_operate()
broadcast_operate_example()
| [
11748,
299,
32152,
355,
45941,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
3601,
10786,
45,
32152,
10628,
3256,
45941,
13,
834,
9641,
834,
8,
198,
220,
220,
220,
1303,
7025,
62,
3575,
... | 2.696429 | 56 |
# Copyright 2017 Google 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,
2177,
3012,
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,
921,
743,
... | 2.999631 | 10,842 |
from functools import singledispatch
import streamlit as st
from sagas.ofbiz.entities import MetaEntity
from sagas.ofbiz.services import OfService
from sagas.ofbiz.entities import OfEntity as e, format
from sagas.ofbiz.services import OfService as s, oc
from datetime import datetime
# product("GZ-2002", 'price')
# pr... | [
6738,
1257,
310,
10141,
1330,
31958,
8802,
963,
198,
11748,
4269,
18250,
355,
336,
198,
198,
6738,
45229,
292,
13,
1659,
42189,
13,
298,
871,
1330,
30277,
32398,
198,
6738,
45229,
292,
13,
1659,
42189,
13,
30416,
1330,
3226,
16177,
198,... | 3.026144 | 153 |
""" Functional tests for the Obey simple list app """
from .base import FunctionalTest
class LayoutAndStylingTest(FunctionalTest):
""" Tests of the layout and styling of the lists app."""
def test_layout_and_styling(self):
""" The home page looks roughly what we expect it to """
self.browser.... | [
37811,
44224,
5254,
329,
262,
440,
23454,
2829,
1351,
598,
37227,
198,
6738,
764,
8692,
1330,
44224,
14402,
628,
198,
4871,
47639,
1870,
18716,
1359,
14402,
7,
22203,
282,
14402,
2599,
198,
220,
220,
220,
37227,
30307,
286,
262,
12461,
... | 2.299479 | 384 |
from adfs_aws_login import conf
import pytest
import argparse
try:
# For Python 3.5 and later
import configparser
except ImportError:
# Fall back to Python 2
import ConfigParser as configparser # noqa: F401
args = {
"profile": "test-profile",
"user": "test@example.com",
"no_prompt": False... | [
6738,
512,
9501,
62,
8356,
62,
38235,
1330,
1013,
198,
11748,
12972,
9288,
198,
11748,
1822,
29572,
198,
198,
28311,
25,
198,
220,
220,
220,
1303,
1114,
11361,
513,
13,
20,
290,
1568,
198,
220,
220,
220,
1330,
4566,
48610,
198,
16341,... | 2.568 | 250 |
#!/usr/bin/env python3
"""Script for testing the TriFingerPro model."""
import time
import pybullet
from trifinger_simulation import (
sim_finger,
visual_objects,
)
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
7391,
329,
4856,
262,
7563,
37,
3889,
2964,
2746,
526,
15931,
198,
11748,
640,
198,
11748,
12972,
15065,
1616,
198,
6738,
491,
361,
3889,
62,
14323,
1741,
1330,
357,
198,
22... | 2.75641 | 78 |
from website.project.model import User
from website.util.permissions import reduce_permissions
from admin.users.serializers import serialize_simple_node
| [
6738,
3052,
13,
16302,
13,
19849,
1330,
11787,
198,
6738,
3052,
13,
22602,
13,
525,
8481,
1330,
4646,
62,
525,
8481,
198,
198,
6738,
13169,
13,
18417,
13,
46911,
11341,
1330,
11389,
1096,
62,
36439,
62,
17440,
628,
198
] | 4 | 39 |
# Generated by Django 3.2.8 on 2021-11-02 17:04
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
23,
319,
33448,
12,
1157,
12,
2999,
1596,
25,
3023,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
#!/usr/bin/python
from BoostBuild import Tester
t = Tester(pass_toolset=0)
t.run_build_system(extra_args="--debug --build-system=test")
t.cleanup()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
19835,
15580,
1330,
309,
7834,
198,
198,
83,
796,
309,
7834,
7,
6603,
62,
25981,
2617,
28,
15,
8,
198,
83,
13,
5143,
62,
11249,
62,
10057,
7,
26086,
62,
22046,
2625,
438,
24442... | 2.559322 | 59 |
import logging
import sys
from pathlib import Path
from typing import Any, Optional, Union
from ruamel.yaml import YAML
from cookietemple.lint.domains.cli import CliJavaLint, CliPythonLint
from cookietemple.lint.domains.gui import GuiJavaLint
from cookietemple.lint.domains.lib import LibCppLint
from cookietemple.lint... | [
11748,
18931,
198,
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4377,
11,
32233,
11,
4479,
198,
198,
6738,
7422,
17983,
13,
88,
43695,
1330,
575,
2390,
43,
198,
198,
6738,
4255,
1155,
368,
1154,
13,
75,
60... | 2.613342 | 1,544 |
from celery import Celery
app = Celery('tasks', broker='redis://localhost:6379/0', backend='redis://localhost:6379/1')
@app.task
| [
6738,
18725,
1924,
1330,
15248,
1924,
628,
198,
1324,
796,
15248,
1924,
10786,
83,
6791,
3256,
20426,
11639,
445,
271,
1378,
36750,
25,
21,
29088,
14,
15,
3256,
30203,
11639,
445,
271,
1378,
36750,
25,
21,
29088,
14,
16,
11537,
198,
1... | 2.791667 | 48 |
## interaction3 / arrays / foldable_constant_spiral.py
import numpy as np
from interaction3.abstract import *
from interaction3 import util
# default parameters
defaults = {}
# membrane properties
defaults['length'] = [35e-6, 35e-6]
defaults['electrode'] = [35e-6, 35e-6]
defaults['nnodes'] = [9, 9]
defaults['thick... | [
2235,
10375,
18,
1220,
26515,
1220,
5591,
540,
62,
9979,
415,
62,
2777,
21093,
13,
9078,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
10375,
18,
13,
397,
8709,
1330,
1635,
198,
6738,
10375,
18,
1330,
7736,
628,
198,
2,
4... | 2.123696 | 1,342 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2014 Tobias Weber <tobi-weber@gmx.de>
#
# 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 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
34,
8,
3050,
12,
4967,
46675,
28137,
1279,
83,
13411,
12,
732,
527,
31,
70,
36802,
13,
2934,
29,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
... | 2.697917 | 384 |
import numpy as np
from .cpd_nonlin import cpd_nonlin
def cpd_auto(K, ncp, vmax, desc_rate=1, **kwargs):
"""Main interface
Detect change points automatically selecting their number
K - kernel between each pair of frames in video
ncp - maximum ncp
vmax - special paramet... | [
11748,
299,
32152,
355,
45941,
198,
6738,
764,
13155,
67,
62,
13159,
2815,
1330,
269,
30094,
62,
13159,
2815,
198,
198,
4299,
269,
30094,
62,
23736,
7,
42,
11,
299,
13155,
11,
410,
9806,
11,
1715,
62,
4873,
28,
16,
11,
12429,
46265,... | 2.330275 | 1,199 |
import numpy as np
from scipy import ndimage
import imageio
from PIL import Image, ImageFilter
import argparse
import constants
if __name__ == "__main__":
main() | [
11748,
299,
32152,
355,
45941,
201,
198,
6738,
629,
541,
88,
1330,
299,
67,
9060,
201,
198,
11748,
2939,
952,
201,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
22417,
201,
198,
11748,
1822,
29572,
201,
198,
11748,
38491,
201,
198,
201,... | 2.765625 | 64 |
import asyncio
import logging
import uvloop
from vkwave.bots import SimpleLongPollBot
from vkwave.bots.core.dispatching import filters
from app import db
from app.config import config
from app.routers import home, registration
logging.basicConfig(level=logging.INFO)
uvloop.install()
loop = asyncio.get_event_loop()... | [
11748,
30351,
952,
198,
11748,
18931,
198,
198,
11748,
334,
85,
26268,
198,
6738,
410,
74,
19204,
13,
42478,
1330,
17427,
14617,
39176,
20630,
198,
6738,
410,
74,
19204,
13,
42478,
13,
7295,
13,
6381,
17147,
278,
1330,
16628,
198,
198,
... | 2.899563 | 229 |
import time
from grove.adc import ADC
adc = ADC()
while True:
soil_moisture = adc.read(0)
print("Soil moisture:", soil_moisture)
time.sleep(10) | [
11748,
640,
198,
6738,
7128,
303,
13,
324,
66,
1330,
49169,
198,
198,
324,
66,
796,
49169,
3419,
198,
198,
4514,
6407,
25,
198,
220,
220,
220,
9260,
62,
5908,
396,
495,
796,
512,
66,
13,
961,
7,
15,
8,
198,
220,
220,
220,
3601,
... | 2.358209 | 67 |
import casadi as cs
# plt.figure(1)
# plt.clf()
# plt.plot(sol.value(k))
# plt.figure(2)
# plt.clf()
# plt.plot(sol.value(eps_soft))
# plt.figure(3)
# plt.clf()
# plt.plot(sol.value(x)[3,:],label='infected')
# plt.plot(sol.value(x)[4,:],label='hospitalized')
# plt.plot(sol.value(x)[5,:],label='death')
# pl... | [
11748,
6124,
9189,
355,
50115,
628,
198,
220,
220,
220,
220,
628,
198,
198,
2,
458,
83,
13,
26875,
7,
16,
8,
220,
198,
2,
458,
83,
13,
565,
69,
3419,
198,
2,
458,
83,
13,
29487,
7,
34453,
13,
8367,
7,
74,
4008,
198,
198,
2,
... | 1.977376 | 221 |
import os, sys, argparse, mlflow, yaml
import numpy as np
import torch
import torch.nn as nn
import segmentation_models_pytorch as smp
from torch.utils.data import DataLoader
from albumentations import (
Compose, PadIfNeeded, Normalize, HorizontalFlip, VerticalFlip, RandomBrightnessContrast,
CropNonEmptyMaskI... | [
11748,
28686,
11,
25064,
11,
1822,
29572,
11,
285,
1652,
9319,
11,
331,
43695,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
10618,
341,
62,
27530,
62,
9078,
13165,
354,
... | 2.593155 | 3,623 |
from .exemplar_primitive_generators import EXEMPLAR_PRIMITIVE_GENERATORS
from .exemplar_derived_generators import EXEMPLAR_DERIVED_GENERATORS
from .exemplar_custom_generators import EXEMPLAR_CUSTOM_GENERATORS
EXEMPLAR_GENERATORS = EXEMPLAR_PRIMITIVE_GENERATORS + EXEMPLAR_DERIVED_GENERATORS + EXEMPLAR_CUSTOM_GENERATORS... | [
6738,
764,
1069,
18856,
283,
62,
19795,
1800,
62,
8612,
2024,
1330,
7788,
3620,
6489,
1503,
62,
4805,
3955,
2043,
9306,
62,
35353,
1137,
1404,
20673,
198,
6738,
764,
1069,
18856,
283,
62,
34631,
62,
8612,
2024,
1330,
7788,
3620,
6489,
... | 2.450382 | 131 |
from xml.etree import ElementTree
from bs4 import BeautifulSoup
import nltk
import json
import re
if __name__ == '__main__':
# parser = Parser('./data/ace_2005_td_v7/data/English/un/fp2/alt.gossip.celebrities_20041118.2331')
parser = Parser('./data/ace_2005_td_v7/data/English/un/timex2norm/alt.corel_20041228... | [
6738,
35555,
13,
316,
631,
1330,
11703,
27660,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
299,
2528,
74,
198,
11748,
33918,
198,
11748,
302,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198... | 2.354167 | 240 |
import io
import unittest
from aero_util.tecio import *
from . import common
| [
11748,
33245,
198,
11748,
555,
715,
395,
198,
6738,
257,
3529,
62,
22602,
13,
36281,
952,
1330,
1635,
198,
6738,
764,
1330,
2219,
198
] | 3.208333 | 24 |
import logging
logger = logging.getLogger(__name__)
from monai.transforms import (Compose, EnsureChannelFirstd, LoadImaged,
ScaleIntensityRanged, Spacingd)
from monailabel.interfaces.tasks.infer import InferTask, InferType
from monailabel.scribbles.transforms import AddBackgroundScribble... | [
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
198,
6738,
937,
1872,
13,
7645,
23914,
1330,
357,
7293,
577,
11,
48987,
29239,
5962,
67,
11,
8778,
3546,
1886,
11,
198,
220,
220,
220,... | 3.34655 | 1,261 |
'''
Author: zyq
Date: 2020-11-30 17:19:51
LastEditTime: 2020-12-09 17:24:59
LastEditors: Please set LastEditors
Description: 数值分析上机题 课本 P195 37题 3次样条插值
FilePath: /code/chapter4/q4-37-1.py
'''
import numpy as np
import matplotlib.pyplot as plt
from pylab import mpl
import sys, os
'''
description:
param {*} x n+1 个插值点
... | [
7061,
6,
198,
13838,
25,
1976,
88,
80,
198,
10430,
25,
12131,
12,
1157,
12,
1270,
1596,
25,
1129,
25,
4349,
198,
5956,
18378,
7575,
25,
12131,
12,
1065,
12,
2931,
1596,
25,
1731,
25,
3270,
198,
5956,
18378,
669,
25,
4222,
900,
458... | 1.298246 | 798 |
"""
This module provides methods to drop and re-create all tables.
"""
from db import create_session
import cql_queries
def create_database():
"""
Creates the database and establishes the connection.
"""
# connect to default database
cluster, session = create_session()
# create sparkify datab... | [
37811,
198,
1212,
8265,
3769,
5050,
284,
4268,
290,
302,
12,
17953,
477,
8893,
13,
198,
37811,
198,
6738,
20613,
1330,
2251,
62,
29891,
198,
11748,
269,
13976,
62,
421,
10640,
628,
198,
4299,
2251,
62,
48806,
33529,
198,
220,
220,
220... | 2.792576 | 458 |
match = "dc:title"
ns = {'dc': 'http://purl.org/dc/elements/1.1/'}
import xml.etree.ElementTree as ET
tree = ET.parse('country_data.xml') # $ decodeFormat=XML decodeInput='country_data.xml' decodeOutput=ET.parse(..) xmlVuln='XML bomb' getAPathArgument='country_data.xml'
root = tree.getroot()
root.find(match, namespac... | [
15699,
796,
366,
17896,
25,
7839,
1,
198,
5907,
796,
1391,
6,
17896,
10354,
705,
4023,
1378,
79,
6371,
13,
2398,
14,
17896,
14,
68,
3639,
14,
16,
13,
16,
14,
6,
92,
198,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12... | 2.673418 | 395 |
class DocumentPage(object,IDisposable):
"""
Represents a document page produced by a paginator.
DocumentPage(visual: Visual)
DocumentPage(visual: Visual,pageSize: Size,bleedBox: Rect,contentBox: Rect)
"""
def Dispose(self):
"""
Dispose(self: DocumentPage)
Releases all resources used by the ... | [
4871,
16854,
9876,
7,
15252,
11,
2389,
271,
1930,
540,
2599,
201,
198,
37227,
201,
198,
1432,
6629,
257,
3188,
2443,
4635,
416,
257,
42208,
20900,
13,
201,
201,
198,
220,
201,
201,
198,
16854,
9876,
7,
41464,
25,
15612,
8,
201,
201,... | 2.900245 | 1,223 |
from sqlalchemy import Boolean, Column, Integer, String
from db.session import Base
# JOBS MODEL
| [
6738,
44161,
282,
26599,
1330,
41146,
11,
29201,
11,
34142,
11,
10903,
198,
198,
6738,
20613,
13,
29891,
1330,
7308,
198,
198,
2,
32357,
4462,
19164,
3698,
628
] | 3.571429 | 28 |
from rest_framework import viewsets
from rest_framework.parsers import JSONParser
from rest_framework.permissions import IsAuthenticated
from tests import models, serializers
| [
6738,
1334,
62,
30604,
1330,
5009,
1039,
198,
6738,
1334,
62,
30604,
13,
79,
945,
364,
1330,
19449,
46677,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
1148,
47649,
3474,
198,
198,
6738,
5254,
1330,
4981,
11,
11389,
11341,
628
] | 4.317073 | 41 |
import yfinance as yf
import streamlit as st
import pandas as pd
import csv
import csv
tickers = []
with open(r'nasdaq_screener_1640497257523.csv') as f:
r = csv.reader(f)
header = next(r)
for row in r:
tickers.append([row[1],row[0]])
tname = []
for i in tickers:
tname.append(i[0])
st.write("... | [
11748,
331,
69,
14149,
355,
331,
69,
198,
11748,
4269,
18250,
355,
336,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
269,
21370,
198,
11748,
269,
21370,
198,
198,
83,
21630,
796,
17635,
198,
4480,
1280,
7,
81,
6,
24716,
48539,
... | 2.328502 | 414 |
import math
import random
def index_of_nearest(p, hot_points, distance_f=distance):
"""Given a point and a set of hot points it found the hot point
nearest to the given point. An arbitrary distance function can
be specified
:return the index of the nearest hot points, or None if the list of hot
... | [
11748,
10688,
198,
11748,
4738,
628,
628,
198,
4299,
6376,
62,
1659,
62,
710,
12423,
7,
79,
11,
3024,
62,
13033,
11,
5253,
62,
69,
28,
30246,
2599,
198,
220,
220,
220,
37227,
15056,
257,
966,
290,
257,
900,
286,
3024,
2173,
340,
1... | 2.588745 | 231 |
print('test321')
| [
4798,
10786,
9288,
36453,
11537,
198
] | 2.833333 | 6 |
from twilio.base.exceptions import TwilioRestException
from twilio.rest import Client
import os
import logging
LOGGER = logging.getLogger(__name__)
TWILIO_ACCOUNT_SID = os.environ.get('TWILIO_ACCOUNT_SID')
TWILIO_AUTH_TOKEN = os.environ.get('TWILIO_AUTH_TOKEN')
TWILIO_SERVICE_SID = os.environ.get('TWILIO_SERVICE_SI... | [
198,
6738,
665,
346,
952,
13,
8692,
13,
1069,
11755,
1330,
1815,
346,
952,
19452,
16922,
198,
6738,
665,
346,
952,
13,
2118,
1330,
20985,
198,
11748,
28686,
198,
11748,
18931,
628,
198,
25294,
30373,
796,
18931,
13,
1136,
11187,
1362,
... | 2.462121 | 132 |
import pytest
from assertpy import assert_that
import year2020.day19.reader as reader
import year2020.day19.solver as solver
@pytest.mark.parametrize('word', ['aab', 'aba'])
@pytest.mark.parametrize('word', ['abba', 'abbb', 'bab'])
@pytest.mark.solution
@pytest.mark.solution
| [
11748,
12972,
9288,
198,
6738,
6818,
9078,
1330,
6818,
62,
5562,
198,
198,
11748,
614,
42334,
13,
820,
1129,
13,
46862,
355,
9173,
198,
11748,
614,
42334,
13,
820,
1129,
13,
82,
14375,
355,
1540,
332,
628,
198,
198,
31,
9078,
9288,
... | 2.627273 | 110 |
from plugin import plugin
import random
@plugin("give me advice")
| [
6738,
13877,
1330,
13877,
198,
11748,
4738,
628,
198,
31,
33803,
7203,
26535,
502,
5608,
4943,
198
] | 4 | 17 |
#!/usr/bin/env python
# Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2010
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the Lice... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
33501,
9447,
33,
14,
34,
5064,
50,
7822,
13,
198,
2,
15069,
357,
34,
8,
449,
417,
647,
23092,
2238,
2926,
1279,
73,
417,
647,
31,
82,
31842,
13,
2398,
29,
4343,
12,
10333... | 2.688073 | 1,853 |
import subprocess
import os
import time
processes = []
processes.append(subprocess.Popen("python examples/boxes_2D_dqn__fill_multidim.py --save --name stack_s2v_ensemble_unlimited_neg_rew --model s2v --use-cuda", shell=True))
time.sleep(10)
processes.append(subprocess.Popen("python examples/boxes_2D_dqn__fill_multidim... | [
11748,
850,
14681,
198,
11748,
28686,
198,
11748,
640,
198,
198,
14681,
274,
796,
17635,
198,
14681,
274,
13,
33295,
7,
7266,
14681,
13,
47,
9654,
7203,
29412,
6096,
14,
29305,
62,
17,
35,
62,
49506,
77,
834,
20797,
62,
16680,
312,
... | 2.441727 | 695 |
from In.boxer.box import Box, BoxThemer
class BoxMessagesList(Box):
''''''
title = s('Messages')
@IN.register('BoxMessagesList', type = 'Themer')
| [
6738,
554,
13,
3524,
263,
13,
3524,
1330,
8315,
11,
8315,
464,
647,
198,
198,
4871,
8315,
36479,
1095,
8053,
7,
14253,
2599,
198,
197,
39115,
7061,
198,
197,
7839,
796,
264,
10786,
36479,
1095,
11537,
628,
198,
31,
1268,
13,
30238,
... | 2.763636 | 55 |
import argparse
from convlab2.e2e.rnn_rollout.deal_or_not import DealornotAgent
from convlab2.e2e.rnn_rollout.deal_or_not.model import get_context_generator
from convlab2 import DealornotSession
import convlab2.e2e.rnn_rollout.utils as utils
import numpy as np
session_num = 20
# agent
alice_agent = DealornotAgent('A... | [
11748,
1822,
29572,
198,
198,
6738,
3063,
23912,
17,
13,
68,
17,
68,
13,
81,
20471,
62,
2487,
448,
13,
31769,
62,
273,
62,
1662,
1330,
15138,
1211,
313,
36772,
198,
6738,
3063,
23912,
17,
13,
68,
17,
68,
13,
81,
20471,
62,
2487,
... | 2.420784 | 587 |
import json
import os
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
try:
HOST = os.environ["GOLLY_PELICAN_TEST_MOCKAPI_HOST"]
PORT = int(os.environ["GOLLY_PELICAN_TEST_MOCKAPI_PORT"])
except KeyError:
raise Exception(
"Error: you must define GOLLY_PELICAN_TEST_MOCKAPI... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
4704,
278,
198,
6738,
2638,
13,
15388,
1330,
7308,
40717,
18453,
25060,
11,
38288,
18497,
628,
198,
28311,
25,
198,
220,
220,
220,
367,
10892,
796,
28686,
13,
268,
2268,
14692,
11230,
3069,
5... | 2.643902 | 205 |
import unittest;
import math;
from secant_root_solve import secant_root_solve;
class Test_secant_root_solve(unittest.TestCase):
'''
Test_secantrootsolve.m
Test case for the Secant Root Solver function. Based on the solution to
Problem 2 of Homework 1 f AOE 4404 Numerical Methods
Use Graph... | [
11748,
555,
715,
395,
26,
198,
11748,
10688,
26,
198,
6738,
792,
415,
62,
15763,
62,
82,
6442,
1330,
792,
415,
62,
15763,
62,
82,
6442,
26,
198,
198,
4871,
6208,
62,
2363,
415,
62,
15763,
62,
82,
6442,
7,
403,
715,
395,
13,
1440... | 2.224456 | 597 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
espider.*
------------------------------------------------------------
Package espider is a simply constructed web crawling and scrabing framework that is easy to use.
This package includes modules mentioned below:
|name |description ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
220,
220,
220,
15024,
1304,
15885,
198,
220,
220,
220,
20368,
1783,
10541,
628,
220,
220,
220,
1... | 2.349229 | 713 |
from django.core import mail
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.http import Http404, QueryDict
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from organizations.tests.utils ... | [
6738,
42625,
14208,
13,
7295,
1330,
6920,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
... | 3.347594 | 187 |
import numpy as np
from scipy.optimize import newton
from collections import Counter
from sys import stderr, exit
FAST_EMBEDDING_AVAILABLE = True
try:
import hde_fast_embedding as fast_emb
except:
FAST_EMBEDDING_AVAILABLE = False
print("""
Error importing Cython fast embedding module. Continuing with s... | [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
40085,
1096,
1330,
649,
1122,
198,
6738,
17268,
1330,
15034,
198,
6738,
25064,
1330,
336,
1082,
81,
11,
8420,
198,
198,
37,
11262,
62,
3620,
33,
1961,
35,
2751,
62,
10116,
... | 2.068627 | 4,590 |
from unit_test_common import execute_csv2_request, initialize_csv2_request, ut_id, sanity_requests
from sys import argv
# lno: CV - error code identifier.
if __name__ == "__main__":
main(None)
| [
6738,
4326,
62,
9288,
62,
11321,
1330,
12260,
62,
40664,
17,
62,
25927,
11,
41216,
62,
40664,
17,
62,
25927,
11,
3384,
62,
312,
11,
34182,
62,
8897,
3558,
198,
6738,
25064,
1330,
1822,
85,
198,
198,
2,
300,
3919,
25,
26196,
532,
4... | 2.926471 | 68 |
#Project Euler Question 61
#Cyclical figurate numbers
oct_list = []
hept_list = []
hex_list = []
pent_list = []
squ_list = []
tri_list = []
n = 0
while True:
n += 1
oct_x = octagonal(n)
hept_x = heptagonal(n)
hex_x = hexagonal(n)
pent_x = pentagonal(n)
squ_x = sqaure(n)
tri_x = triangle(n)... | [
2,
16775,
412,
18173,
18233,
8454,
198,
2,
20418,
565,
605,
2336,
15537,
3146,
628,
198,
38441,
62,
4868,
796,
17635,
198,
258,
457,
62,
4868,
796,
17635,
198,
33095,
62,
4868,
796,
17635,
198,
16923,
62,
4868,
796,
17635,
198,
16485,... | 2.083756 | 394 |
# Generated by Django 3.2.7 on 2022-01-10 12:12
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
22,
319,
33160,
12,
486,
12,
940,
1105,
25,
1065,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
import config
import requests, bs4, urllib, os
dest_dir = os.path.join(config.DATASET_DIR, 'model_zip')
queries_dir = os.path.join(config.DATASET_DIR, 'queries_zip')
url = 'http://rll.berkeley.edu/bigbird/aliases/a47741b172/'
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
if not os.path.exists(queries_di... | [
11748,
4566,
198,
11748,
7007,
11,
275,
82,
19,
11,
2956,
297,
571,
11,
28686,
198,
198,
16520,
62,
15908,
796,
28686,
13,
6978,
13,
22179,
7,
11250,
13,
35,
1404,
1921,
2767,
62,
34720,
11,
705,
19849,
62,
13344,
11537,
198,
421,
... | 2.289189 | 370 |
import numpy as np
from matplotlib import pyplot as plt
import csv
import math
import pandas
if __name__=="__main__":
plot_log('result/log.csv')
| [
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
11748,
269,
21370,
198,
11748,
10688,
198,
11748,
19798,
292,
628,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
... | 2.8 | 55 |
"""Config flow for 1-Wire component."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry, ConfigFlow, OptionsFlow
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.core import HomeAssistant, callback
from hom... | [
37811,
16934,
5202,
329,
352,
12,
29451,
7515,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
4377,
198,
198,
11748,
2322,
37623,
5623,
355,
2322,
198,
198,
6738,
1363,
562,
10167,
13,
11250,
62,
298... | 2.194785 | 3,912 |
import torch
import torch.nn as nn
from abc import ABC
| [
11748,
28034,
201,
198,
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
6738,
450,
66,
1330,
9738,
201,
198,
201
] | 2.809524 | 21 |
# coding: utf-8
# Back to the main [Index](../index.ipynb)
# ### Combine archives
# The experiment, i.e. model with the simulation description, can be stored as Combine Archive.
# In[1]:
#!!! DO NOT CHANGE !!! THIS FILE WAS CREATED AUTOMATICALLY FROM NOTEBOOKS !!! CHANGES WILL BE OVERWRITTEN !!! CHANGE CORRESPONDI... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
5157,
284,
262,
1388,
685,
15732,
16151,
40720,
9630,
13,
541,
2047,
65,
8,
198,
198,
2,
44386,
29176,
22415,
198,
2,
383,
6306,
11,
1312,
13,
68,
13,
2746,
351,
262,
18640,
6764... | 2.42007 | 857 |
from six.moves import xrange
def get(obj, path):
"""
Looks up and returns a path in the object. Returns None if the path isn't there.
"""
for part in path:
try:
obj = obj[part]
except(KeyError, IndexError):
return None
return obj
def glob(obj, path, func, extra_arg):
"""
Resolves wi... | [
6738,
2237,
13,
76,
5241,
1330,
2124,
9521,
628,
198,
4299,
651,
7,
26801,
11,
3108,
2599,
198,
220,
37227,
198,
220,
29403,
510,
290,
5860,
257,
3108,
287,
262,
2134,
13,
16409,
6045,
611,
262,
3108,
2125,
470,
612,
13,
198,
220,
... | 3.126173 | 959 |
from mpf.tests.MpfFakeGameTestCase import MpfFakeGameTestCase
from mpf.tests.MpfGameTestCase import MpfGameTestCase
from unittest.mock import MagicMock
| [
6738,
29034,
69,
13,
41989,
13,
28861,
69,
49233,
8777,
14402,
20448,
1330,
337,
79,
69,
49233,
8777,
14402,
20448,
198,
198,
6738,
29034,
69,
13,
41989,
13,
28861,
69,
8777,
14402,
20448,
1330,
337,
79,
69,
8777,
14402,
20448,
198,
6... | 2.87037 | 54 |
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient, APITestCase
from .models import User
from .serializers import DefaultUserSerializer
client = APIClient()
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2149,
75,
1153,
11,
3486,
2043,
395,
20448,
198,
198,
6738,
764,
27530,
1330,
11787,
198,
6738,
76... | 3.606557 | 61 |
from django.contrib.messages import get_messages
from django.core.exceptions import ObjectDoesNotExist
from django.test import TestCase, tag
from django.urls import reverse
from django.utils import timezone
from BookClub.models import User, Meeting, Club, ClubMembership
from BookClub.tests.helpers import LogInTester
... | [
6738,
42625,
14208,
13,
3642,
822,
13,
37348,
1095,
1330,
651,
62,
37348,
1095,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
9515,
13921,
3673,
3109,
396,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
11,
7621,
198,... | 2.525455 | 550 |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33448,
383,
3012,
4992,
46665,
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,
... | 2.391119 | 4,684 |
import operator
import tempfile
import unittest
import fungraph
| [
11748,
10088,
198,
11748,
20218,
7753,
198,
11748,
555,
715,
395,
198,
198,
11748,
31317,
1470,
628,
198
] | 3.722222 | 18 |
from unittest import TestCase
from p14 import p14
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
279,
1415,
1330,
279,
1415,
198
] | 3.333333 | 15 |
from abc import ABC, abstractmethod
from typing import Union, Optional, Tuple, Dict, Any
from FaceEngine import DetectionFloat, HumanLandmark, HumanLandmarks17 # pylint: disable=E0611,E0401
from .image_utils.geometry import LANDMARKS, Point, Rect
class BaseEstimation(ABC):
"""
Base class for estimation str... | [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
4479,
11,
32233,
11,
309,
29291,
11,
360,
713,
11,
4377,
198,
198,
6738,
15399,
13798,
1330,
46254,
43879,
11,
5524,
22342,
4102,
11,
5524,
22342,
14306,
1558,
220,
... | 2.245363 | 2,588 |
# Generated by Django 3.0.2 on 2020-01-30 15:54
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
17,
319,
12131,
12,
486,
12,
1270,
1315,
25,
4051,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
# Generated by Django 3.2 on 2021-04-28 00:01
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
319,
33448,
12,
3023,
12,
2078,
3571,
25,
486,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List # noqa: F401
from typing_extensions import Literal # noqa: F401
EnumTypeNEMImportanceTransferMode = Literal[1, 2]
except ImportError:
pass
| [
2,
17406,
4142,
7560,
416,
279,
65,
17,
9078,
198,
2,
46996,
25,
572,
198,
6738,
11485,
1330,
1237,
672,
3046,
355,
279,
198,
198,
361,
11593,
24442,
834,
25,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
... | 2.475806 | 124 |
"""
Provides trees/bushes/etc.
"""
__copyright__ = """
MIT License
Copyright (c) 2019 tcdude
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... | [
37811,
198,
15946,
1460,
7150,
14,
10885,
956,
14,
14784,
13,
198,
37811,
198,
198,
834,
22163,
4766,
834,
796,
37227,
198,
36393,
13789,
198,
198,
15269,
357,
66,
8,
13130,
256,
10210,
2507,
198,
198,
5990,
3411,
318,
29376,
7520,
11... | 3.643392 | 401 |
"""Managers."""
# Django
from django.db import models
class ActiveManager(models.Manager):
"""Active manager."""
| [
37811,
5124,
10321,
526,
15931,
198,
198,
2,
37770,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
198,
4871,
14199,
13511,
7,
27530,
13,
13511,
2599,
198,
220,
220,
220,
37227,
13739,
4706,
526,
15931,
198
] | 3.243243 | 37 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import wavfile
from scipy.signal import fftconvolve
from librosa.core import load
from librosa.core import stft
from librosa.core import istft
from librosa import amplitude_to_db, db_to_amplitude
from librosa.display import specshow
from librosa.output i... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
952,
1330,
266,
615,
7753,
198,
6738,
629,
541,
88,
13,
12683,
282,
1330,
277,
701,
42946,
6442,
198,
198,
673... | 2.859922 | 257 |