content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
# -*- encoding:utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
import pyparsing
from mysqlparse.grammar.data_type import data_type_syntax
| [
2,
532,
9,
12,
21004,
25,
40477,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
555,
715,
395,
198,
198,
11748,
279,
4464,
... | 3.075758 | 66 |
import pandas as pd
from spandex import TableLoader
import pandas.io.sql as sql
loader = TableLoader()
def db_to_df(query):
"""Executes SQL query and returns DataFrame."""
conn = loader.database._connection
return sql.read_frame(query, conn)
## Export to HDF5- get path to output file
h5_path = loader.ge... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
599,
392,
1069,
1330,
8655,
17401,
198,
11748,
19798,
292,
13,
952,
13,
25410,
355,
44161,
198,
198,
29356,
796,
8655,
17401,
3419,
198,
198,
4299,
20613,
62,
1462,
62,
7568,
7,
22766,
2599,... | 2.726799 | 959 |
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import seaborn as sns
import pandas as pd
from minder_utils.formatting.label import label_by_week, label_dataframe
from minder_utils.feature_engineering import Feature_engineer
from minder_utils.feature_engineering.calculation import *
from minder_utils.... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
19581,
355,
285,
19581,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
2000,
263,
62,
26791,
13,
... | 2.392432 | 2,352 |
# https://practice.geeksforgeeks.org/problems/cyclically-rotate-an-array-by-one2614/1
# Given an array, rotate the array by one position in clock-wise direction.
# Input:
# N = 5
# A[] = {1, 2, 3, 4, 5}
# Output:
# 5 1 2 3 4
if __name__ == "__main__":
a = [1, 2, 3,4,5]
print(rotate_cycle(a)) | [
198,
2,
3740,
1378,
39541,
13,
469,
2573,
30293,
2573,
13,
2398,
14,
1676,
22143,
14,
15539,
1146,
12,
10599,
378,
12,
272,
12,
18747,
12,
1525,
12,
505,
2075,
1415,
14,
16,
198,
198,
2,
11259,
281,
7177,
11,
23064,
262,
7177,
416... | 2.325758 | 132 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
2,
15069,
1853,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 3.993311 | 299 |
from .base import BaseTestCase
pass
| [
6738,
764,
8692,
1330,
7308,
14402,
20448,
628,
198,
6603,
198
] | 3.454545 | 11 |
from backend.settings import BASE_DIR
import os
import subprocess
import stat
rupture_dir = os.path.abspath(os.path.join(BASE_DIR, os.pardir))
client_dir = os.path.join(rupture_dir, 'client')
| [
6738,
30203,
13,
33692,
1330,
49688,
62,
34720,
198,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
1185,
628,
198,
3622,
495,
62,
15908,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
22179,
7,
33,
11159,
6... | 2.763889 | 72 |
from urllib.parse import urlencode
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
def provider_logout_url(request):
"""
This function is used to construct a logout URL that can be used to log the user out of
the Identity Provider (Authentication Service).
... | [
6738,
2956,
297,
571,
13,
29572,
1330,
2956,
11925,
8189,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
49315,
13,
19509,
23779,
1330,
651,
62,
14421,
62,
15654,
628,
198,
4299,
10131,
... | 2.783626 | 342 |
import pymongo
import dns
import serial
from pymongo import MongoClient
import struct
cluster = MongoClient("")
serialPort = serial.Serial(port= "COM1", baudrate=9600 ,bytesize =8 , timeout =None, parity='N',stopbits=1)
db=cluster["<greenHouse>"]
collection = db["greenhouses"]
while serialPort.readline():
resul... | [
11748,
279,
4948,
25162,
198,
11748,
288,
5907,
198,
11748,
11389,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
11748,
2878,
198,
198,
565,
5819,
796,
42591,
11792,
7203,
4943,
198,
46911,
13924,
796,
11389,
13,
32634,
7,
634,
... | 3.018519 | 324 |
# Copyright 2017 Artyom Losev
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT).
{
"name": """E-commerce Category Cache""",
"summary": """Use this module to greatly accelerate the loading of a page with a large number of produ... | [
2,
15069,
2177,
943,
774,
296,
44927,
85,
198,
2,
15069,
2864,
25910,
1530,
709,
21000,
81,
1279,
5450,
1378,
270,
12,
42068,
13,
10951,
14,
15097,
14,
42,
349,
1530,
709,
15309,
46273,
29,
198,
2,
13789,
17168,
357,
5450,
1378,
448... | 2.717532 | 308 |
import pkg_resources
__all__ = []
| [
11748,
279,
10025,
62,
37540,
198,
198,
834,
439,
834,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | 1.793103 | 29 |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 11 11:37:39 2014
@author: sm1fg
Construct the magnetic network and generate the adjustments to the
non-magnetic atmosphere for mhs equilibrium.
"""
import os
import warnings
import numpy as np
import astropy.units as u
from scipy.interpolate import RectBivaria... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
4280,
1367,
1367,
25,
2718,
25,
2670,
1946,
198,
198,
31,
9800,
25,
895,
16,
40616,
628,
220,
220,
220,
28407,
262,
14091,
3127,
290,
77... | 1.604538 | 11,546 |
from rest_framework import serializers
from s3_file_uploads.constants import ACCESS_CONTROL_TYPES, PRIVATE
from s3_file_uploads.models import UploadedFile
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
264,
18,
62,
7753,
62,
39920,
13,
9979,
1187,
1330,
15859,
7597,
62,
10943,
5446,
3535,
62,
9936,
47,
1546,
11,
4810,
3824,
6158,
198,
6738,
264,
18,
62,
7753,
62,
39920,
13,
275... | 3.25 | 48 |
"""
Copyright (c) 2015-present, Philippine-California Advanced Research Institutes-
The Village Base Station Project (PCARI-VBTS). All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
"""
from django.contrib import messages ... | [
37811,
198,
15269,
357,
66,
8,
1853,
12,
25579,
11,
29911,
12,
25284,
13435,
4992,
33656,
12,
198,
464,
14812,
7308,
9327,
4935,
357,
5662,
33604,
12,
44526,
4694,
737,
1439,
2489,
10395,
13,
198,
198,
1212,
2723,
2438,
318,
11971,
73... | 3.648515 | 202 |
'''1. Faa um programa que pede para o usurio digitar uma palavra e
imprima cada letra em uma linha.'''
#Informando frase a ser verificada
frase = input('Digite uma palavra: ')
#Convertendo frase em palavras, e imprimindo depois
for letra in frase:
print(letra) | [
7061,
6,
16,
13,
376,
7252,
23781,
1430,
64,
8358,
7190,
68,
31215,
267,
39954,
952,
3100,
7940,
334,
2611,
6340,
615,
430,
304,
198,
320,
1050,
8083,
269,
4763,
1309,
430,
795,
334,
2611,
9493,
3099,
2637,
7061,
198,
198,
2,
818,
... | 2.533333 | 105 |
from tfbldr.nodes import Conv2d
from tfbldr.nodes import ConvTranspose2d
from tfbldr.nodes import VqEmbedding
from tfbldr.nodes import BatchNorm2d
from tfbldr.nodes import Linear
from tfbldr.nodes import ReLU
from tfbldr.nodes import Sigmoid
from tfbldr.nodes import Tanh
from tfbldr.nodes import OneHot
from tfbldr.node... | [
6738,
256,
21855,
335,
81,
13,
77,
4147,
1330,
34872,
17,
67,
198,
6738,
256,
21855,
335,
81,
13,
77,
4147,
1330,
34872,
8291,
3455,
17,
67,
198,
6738,
256,
21855,
335,
81,
13,
77,
4147,
1330,
569,
80,
31567,
6048,
278,
198,
6738,... | 2.306859 | 1,385 |
# -*- coding: utf-8 -*-
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628
] | 1.785714 | 14 |
from typing import List
from typing import Union
import numpy as np
import torch
from cata.teachers.ensembles import base_teacher_ensemble
from cata.utils import custom_functions
| [
6738,
19720,
1330,
7343,
198,
6738,
19720,
1330,
4479,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
269,
1045,
13,
660,
17892,
13,
1072,
2022,
829,
1330,
2779,
62,
660,
3493,
62,
1072,
11306,
198,
6738,
269,
... | 3.62 | 50 |
import json
import logging
import os
import shlex
import subprocess
from pathlib import Path
from types import SimpleNamespace
import coloredlogs
import fire
from .adminFiles import (
DockerComposeFile,
DotenvFile,
GitlabCIFile,
JsonFile,
PackageJsonFile,
Pipfile,
RuntimeTxtFile,
YarnR... | [
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
427,
2588,
198,
11748,
850,
14681,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
3858,
1330,
17427,
36690,
10223,
198,
198,
11748,
16396,
6404,
82,
198,
11748,
2046,
198,
19... | 2.618661 | 493 |
a = 'ARRYR'
b = 'ARSYS'
levenshtein(a,b)
# ANSWER a)
# It quantifies the number of single-letter changes to morph one into the other
#
# ANSWER b)
# We could encode the 'price' of changing between particular amino acids
# thereby acknowledging that some substitutions are more or less costly/likely | [
64,
796,
705,
1503,
18276,
49,
6,
198,
65,
796,
705,
27415,
16309,
6,
198,
198,
293,
574,
1477,
22006,
7,
64,
11,
65,
8,
198,
198,
2,
3537,
17887,
1137,
257,
8,
198,
2,
632,
5554,
6945,
262,
1271,
286,
2060,
12,
9291,
2458,
28... | 3.333333 | 90 |
from dazzler.system import Page
from dazzler.components import core
from tests.components import ts_components as tsc
page = Page(
__name__,
core.Container([
tsc.TypedComponent(
'override',
children=core.Container('foobar'),
num=2,
text='foobar',
... | [
6738,
32282,
1754,
13,
10057,
1330,
7873,
198,
6738,
32282,
1754,
13,
5589,
3906,
1330,
4755,
198,
6738,
5254,
13,
5589,
3906,
1330,
40379,
62,
5589,
3906,
355,
256,
1416,
198,
198,
7700,
796,
7873,
7,
198,
220,
220,
220,
11593,
3672,... | 1.895408 | 392 |
"""
An application dedicated to creating, editing, and deleting Gists in GitHub
"""
from __future__ import absolute_import
import toga
import pyperclip
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
from .common.Search import search
from functools import partial
| [
37811,
198,
2025,
3586,
7256,
284,
4441,
11,
12857,
11,
290,
34817,
402,
1023,
287,
21722,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
11748,
284,
4908,
198,
11748,
12972,
525,
15036,
198,
6738,
284,
4908,
13,
... | 3.786667 | 75 |
from quanser.hardware import HIL, HILError, PWMMode
from quanser.multimedia import Video3D, VideoCapture, Video3DStreamType, MediaError, ImageFormat, ImageDataType
from quanser.devices import RPLIDAR, RangingMeasurements, RangingMeasurementMode, DeviceError, RangingDistance
from .q_misc import Utilities
import numpy as... | [
6738,
627,
504,
263,
13,
10424,
1574,
1330,
367,
4146,
11,
36210,
2538,
81,
1472,
11,
44141,
12038,
1098,
198,
6738,
627,
504,
263,
13,
16680,
20626,
1330,
7623,
18,
35,
11,
7623,
49630,
11,
7623,
18,
35,
12124,
6030,
11,
6343,
1233... | 3.233577 | 137 |
'''Crie um programa que simule o funcionamento de um caixa eletrnico. No incio, pergunte ao usurio qual ser o valor a ser sacado (nmero inteiro) e o programa vai informar quantas cdulas de cada valor sero entregues. OBS:
considere que o caixa possui cdulas de R$50, R$20, R$10 e R$1.'''
'''print('--' * 15)
print('{:^3... | [
7061,
6,
34,
5034,
23781,
1430,
64,
8358,
985,
2261,
267,
25439,
295,
3263,
78,
390,
23781,
1275,
844,
64,
304,
1616,
35906,
3713,
13,
1400,
753,
952,
11,
583,
70,
6311,
257,
78,
39954,
952,
4140,
1055,
267,
1188,
273,
257,
1055,
... | 2.089664 | 803 |
import itertools
import math
import simulate
import harvesting
import plot
from decimal import setcontext, ExtendedContext
# Don't raise exception when we divide by zero
#setcontext(ExtendedContext)
#getcontext().prec = 5
| [
11748,
340,
861,
10141,
198,
11748,
10688,
198,
11748,
29308,
198,
11748,
34102,
198,
11748,
7110,
198,
198,
6738,
32465,
1330,
900,
22866,
11,
24204,
21947,
198,
2,
2094,
470,
5298,
6631,
618,
356,
14083,
416,
6632,
198,
2,
2617,
22866... | 3.982143 | 56 |
import random
import string
import hashlib
# Implement the function valid_pw() that returns True if a user's password
# matches its hash. You will need to modify make_pw_hash.
| [
11748,
4738,
198,
11748,
4731,
198,
11748,
12234,
8019,
628,
198,
2,
48282,
262,
2163,
4938,
62,
79,
86,
3419,
326,
5860,
6407,
611,
257,
2836,
338,
9206,
198,
2,
7466,
663,
12234,
13,
921,
481,
761,
284,
13096,
787,
62,
79,
86,
6... | 3.75 | 48 |
from datetime import datetime
from hdx.data.dataset import Dataset
from hdx.scraper.utilities import (
get_isodate_from_dataset_date,
string_params_to_dict,
)
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
289,
34350,
13,
7890,
13,
19608,
292,
316,
1330,
16092,
292,
316,
198,
198,
6738,
289,
34350,
13,
1416,
38545,
13,
315,
2410,
1330,
357,
198,
220,
220,
220,
651,
62,
271,
375,
378,... | 2.537313 | 67 |
from random import randrange
from django.conf import settings
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from hitcount.models import HitCountMixin, HitCount
from imagekit.models import ProcessedImageField
from pilkit.processors import ResizeToFill
from django_cleanup im... | [
6738,
4738,
1330,
43720,
9521,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
25747,
1330,
42044,
6892,
341,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
2... | 3.4375 | 176 |
import configparser
import logging
from flask import Flask
from flask_pymongo import PyMongo
from Crypto.PublicKey import RSA
# Value mapping
LOG_LEVELS = {'INFO': logging.INFO, 'DEBUG': logging.DEBUG, 'WARN': logging.DEBUG, 'ERROR': logging.ERROR}
# Create application
app = Flask(__name__)
# Read external config
co... | [
11748,
4566,
48610,
198,
11748,
18931,
198,
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
79,
4948,
25162,
1330,
9485,
44,
25162,
198,
6738,
36579,
13,
15202,
9218,
1330,
42319,
198,
198,
2,
11052,
16855,
198,
25294,
62,
2538,
18697,
... | 2.817805 | 483 |
import sys
import numpy as np
import cv2
from easydict import EasyDict as edict
from base_tracker import BaseTracker
import path_config
sys.path.append("external/SiamDW/lib")
from tracker.siamrpn import SiamRPN
import models.models as models
from utils.utils import load_pretrain
| [
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
6738,
2562,
11600,
1330,
16789,
35,
713,
355,
1225,
713,
198,
6738,
2779,
62,
2213,
10735,
1330,
7308,
35694,
198,
11748,
3108,
62,
11250,
198,
198,
17597,
... | 3.27907 | 86 |
import math
import torch
| [
11748,
10688,
198,
11748,
28034,
628,
198
] | 3.857143 | 7 |
import urllib.request
from html.parser import HTMLParser
from urllib import parse
from modules.base.handle_timeout import timeout
| [
11748,
2956,
297,
571,
13,
25927,
198,
6738,
27711,
13,
48610,
1330,
11532,
46677,
198,
6738,
2956,
297,
571,
1330,
21136,
198,
6738,
13103,
13,
8692,
13,
28144,
62,
48678,
1330,
26827,
628,
198
] | 3.882353 | 34 |
import numpy as np
import torch
from torchvision.utils import make_grid
from base import BaseTrainer
from utils import inf_loop, MetricTracker, confusion_matrix_image
import copy
import sys
import time
from model.metric import Accuracy, TopkAccuracy
def get_top_k(x, ratio):
"""it will sample the top 1-ratio of th... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
10178,
13,
26791,
1330,
787,
62,
25928,
198,
6738,
2779,
1330,
7308,
2898,
10613,
198,
6738,
3384,
4487,
1330,
1167,
62,
26268,
11,
3395,
1173,
35694,
11,
10802,
62,
67... | 2.596552 | 290 |
from prob.problems import *
from opti.de import DE
from opti.cmaes import CMAES
from opti.cmaes_origin import CMAESO
from opti.cmaes_maes import CMAESM
from opti.cmaes_large import CMAESL
# beta
from opti.cmaes_bipop import CMAESB
if __name__ == "__main__":
TaskProb = Sphere(50, -50, 50)
Task = DE(TaskProb, ... | [
6738,
1861,
13,
1676,
22143,
1330,
1635,
198,
6738,
2172,
72,
13,
2934,
1330,
5550,
198,
198,
6738,
2172,
72,
13,
66,
2611,
274,
1330,
327,
5673,
1546,
198,
6738,
2172,
72,
13,
66,
2611,
274,
62,
47103,
1330,
327,
5673,
1546,
46,
... | 2.335616 | 146 |
from BaiduMapAPI.common import convertCoord, expandUp
import pytest | [
6738,
347,
1698,
84,
13912,
17614,
13,
11321,
1330,
10385,
7222,
585,
11,
4292,
4933,
198,
11748,
12972,
9288
] | 3.526316 | 19 |
"""
PyCBA - Utility functions for interacting with PyCBA
"""
import re
import numpy as np
from typing import Tuple
def parse_beam_string(
beam_string: str,
) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
"""
This function parses a beam descriptor string and returns CBA input vectors.
The ... | [
37811,
198,
20519,
34,
4339,
532,
34030,
5499,
329,
24986,
351,
9485,
34,
4339,
198,
37811,
198,
11748,
302,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
19720,
1330,
309,
29291,
628,
198,
4299,
21136,
62,
40045,
62,
8841,
7,
198,
2... | 2.430939 | 1,448 |
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
12131,
3012,
11419,
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,
733... | 2.28966 | 4,526 |
"""Constants for the System Bridge integration."""
import asyncio
from aiohttp.client_exceptions import (
ClientConnectionError,
ClientConnectorError,
ClientResponseError,
)
from systembridge.exceptions import BridgeException
DOMAIN = "system_bridge"
BRIDGE_CONNECTION_ERRORS = (
asyncio.TimeoutError,... | [
37811,
34184,
1187,
329,
262,
4482,
10290,
11812,
526,
15931,
198,
11748,
30351,
952,
198,
198,
6738,
257,
952,
4023,
13,
16366,
62,
1069,
11755,
1330,
357,
198,
220,
220,
220,
20985,
32048,
12331,
11,
198,
220,
220,
220,
20985,
34525,
... | 3.221374 | 131 |
"""
BIO measure - defines and describes a measure for BIO compliance
"""
from domain.base import Base
| [
37811,
198,
220,
220,
220,
347,
9399,
3953,
532,
15738,
290,
8477,
257,
3953,
329,
347,
9399,
11846,
198,
37811,
198,
6738,
7386,
13,
8692,
1330,
7308,
628
] | 3.821429 | 28 |
from cs50 import get_string
text = get_string("Text: ")
text_length = len(text)
letters = 0
sentences = 0
words = 1
for i in range(text_length):
if text[i].isalpha():
letters += 1
for i in range(text_length):
if ord(text[i]) == 46 or ord(text[i]) == 33 or ord(text[i]) == 63:
sentences += 1
f... | [
6738,
50115,
1120,
1330,
651,
62,
8841,
198,
198,
5239,
796,
651,
62,
8841,
7203,
8206,
25,
366,
8,
198,
5239,
62,
13664,
796,
18896,
7,
5239,
8,
198,
15653,
796,
657,
198,
34086,
3007,
796,
657,
198,
10879,
796,
352,
198,
198,
16... | 2.374517 | 259 |
from django.contrib import admin
from .models import Category, ImagePost, Location
# Register your models here.
admin.site.register(ImagePost)
admin.site.register(Category)
admin.site.register(Location)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
21743,
11,
7412,
6307,
11,
13397,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
198,
28482,
13,
15654,
13,
30238,
7,
5159,
6307,
8,
198,
28482,
13,
15654,
1... | 3.614035 | 57 |
import math
from random import randint
# pylint: disable=I0011,invalid-name
| [
11748,
10688,
198,
6738,
4738,
1330,
43720,
600,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
40,
405,
1157,
11,
259,
12102,
12,
3672,
198
] | 2.961538 | 26 |
from math import floor
remove_spaces = lambda inlst: [i for i in inlst if i != ' ']
| [
6738,
10688,
1330,
4314,
198,
198,
28956,
62,
2777,
2114,
796,
37456,
287,
75,
301,
25,
685,
72,
329,
1312,
287,
287,
75,
301,
611,
1312,
14512,
705,
705,
60,
198
] | 2.741935 | 31 |
import pytest
from pytest_mock import MockerFixture
from pystratis.api.balances import Balances
from pystratis.core.types import Address
from pystratis.core.networks import CirrusMain
| [
11748,
12972,
9288,
198,
6738,
12972,
9288,
62,
76,
735,
1330,
337,
12721,
37,
9602,
198,
6738,
12972,
2536,
37749,
13,
15042,
13,
6893,
1817,
1330,
8528,
1817,
198,
6738,
12972,
2536,
37749,
13,
7295,
13,
19199,
1330,
17917,
198,
6738,... | 3.333333 | 57 |
""" x = 2
while True:
y = n / (x * x)
if (x == y):
print(x)
if x == int(x):
return True
else:
return False
x = (y + x + x) / 3
print(x)"""
print(isPerCube()) | [
37811,
220,
220,
220,
2124,
796,
362,
198,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
331,
796,
299,
1220,
357,
87,
1635,
2124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
87,
6624,
331,
2599,... | 1.558824 | 170 |
## This program prints out the first 10 square roots that are even ##
for x in range(1,10):
y = (2*x)**2 # If n^2 is even hence n must be even as well
print(y)
| [
2235,
770,
1430,
20842,
503,
262,
717,
838,
6616,
11135,
326,
389,
772,
22492,
198,
198,
1640,
2124,
287,
2837,
7,
16,
11,
940,
2599,
198,
220,
220,
220,
331,
796,
357,
17,
9,
87,
8,
1174,
17,
220,
220,
220,
220,
220,
220,
220,
... | 2.521127 | 71 |
import sys
sys.path.append("/sandbox/code/github/threefoldtech/zeroCI/backend")
from redis import Redis
from health_recover import Recover
from utils.utils import Utils
recover = Recover()
if __name__ == "__main__":
health = Health()
health.test_zeroci_server()
health.test_redis()
health.test_wor... | [
11748,
25064,
198,
198,
17597,
13,
6978,
13,
33295,
7203,
14,
38142,
3524,
14,
8189,
14,
12567,
14,
15542,
11379,
13670,
14,
22570,
25690,
14,
1891,
437,
4943,
198,
198,
6738,
2266,
271,
1330,
2297,
271,
198,
198,
6738,
1535,
62,
260,... | 2.765625 | 128 |
"""Module containing class `RecordingImporter`."""
from pathlib import Path
import itertools
import logging
import os
from django.db import transaction
from vesper.command.command import CommandExecutionError
from vesper.django.app.models import (
DeviceConnection, Job, Recording, RecordingChannel, RecordingFil... | [
37811,
26796,
7268,
1398,
4600,
6690,
1284,
3546,
26634,
63,
526,
15931,
628,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
340,
861,
10141,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
198,
... | 2.846512 | 430 |
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import fields, models
| [
29113,
29113,
7804,
4242,
2235,
198,
2,
1114,
6634,
290,
5964,
19748,
11,
766,
11593,
805,
8409,
834,
13,
9078,
2393,
287,
8265,
6808,
198,
2,
8619,
198,
29113,
29113,
7804,
4242,
2235,
198,
6738,
16298,
2238,
1330,
7032,
11,
4981,
62... | 6.666667 | 42 |
import requests
def random_quote(type=''):
'''A function to get random quotes'''
if type == "today":
response_quote = requests.get("https://zenquotes.io/api/today/ff5e73b15a05ca51951b758bd7943ce803d71772")
if response_quote.status_code == 200:
quote_data = response_quote.json()
... | [
11748,
7007,
628,
198,
4299,
4738,
62,
22708,
7,
4906,
28,
7061,
2599,
198,
220,
220,
220,
705,
7061,
32,
2163,
284,
651,
4738,
13386,
7061,
6,
198,
220,
220,
220,
611,
2099,
6624,
366,
40838,
1298,
198,
220,
220,
220,
220,
220,
2... | 2.242613 | 643 |
from math import prod
from pathlib import Path
if __name__ == '__main__':
decoder = Decoder(Path('../data/16.txt').read_text().strip())
print(f'Result: {decoder.parse()}, versions sum: {decoder.versions_sum}')
| [
6738,
10688,
1330,
40426,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
875,
12342,
796,
34580,
7,
15235,
10786,
40720,
7890,
14,
1433,
13,
14116,
27691,
961,... | 2.881579 | 76 |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 3 17:13:15 2021
Database: https://www.kaggle.com/c/santander-customer-satisfaction
@author: Herikc Brecher
"""
# Import from libraries
from sklearn.model_selection import KFold
from sklearn.model_selection import cross_val_score
from sklearn.model_selection i... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
3300,
1526,
220,
513,
1596,
25,
1485,
25,
1314,
33448,
201,
198,
201,
198,
38105,
25,
3740,
1378,
2503,
13,
74,
9460,
293,
13,
785,
... | 2.79594 | 1,921 |
# write your code here
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Integer
from sqlalchemy.orm import sessionmaker
engine = create_engine('sqlite:///flashcard.db?check_same_thread=False')
Base = declarative_base()
Session = sessio... | [
2,
3551,
534,
2438,
994,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
876,
62,
8692,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
10903,
11,
34142... | 3.160839 | 143 |
from dataclasses import dataclass
from datetime import datetime
import json
from types import SimpleNamespace
import isce3
from isce3.core import LUT2d, Poly1d, Orbit
from isce3.product import GeoGridParameters
import numpy as np
from ruamel.yaml import YAML
from shapely.geometry import Point, Polygon
from compass.ut... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
33918,
198,
6738,
3858,
1330,
17427,
36690,
10223,
198,
198,
11748,
318,
344,
18,
198,
6738,
318,
344,
18,
13,
7295,
1330,
406,
3843,
... | 3.344595 | 148 |
from web import create_app
import ntplib
if __name__ == '__main__':
app = create_app(debug=False)
app.run(host='0.0.0.0', port=5000)
| [
6738,
3992,
1330,
2251,
62,
1324,
198,
11748,
299,
83,
489,
571,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
598,
796,
2251,
62,
1324,
7,
24442,
28,
25101,
8,
198,
220,
220,
220,
598,
13... | 2.327869 | 61 |
import datetime
from methinks.db import Entry
import pytest
from server.app import create_app
from server.app import db as _db
from sqlalchemy import event
from sqlalchemy.orm import sessionmaker
def test_insert(session):
e = Entry(text='My example', date=datetime.date.today())
session.add(e)
session.c... | [
11748,
4818,
8079,
198,
6738,
11248,
2973,
13,
9945,
1330,
21617,
198,
11748,
12972,
9288,
198,
6738,
4382,
13,
1324,
1330,
2251,
62,
1324,
198,
6738,
4382,
13,
1324,
1330,
20613,
355,
4808,
9945,
198,
6738,
44161,
282,
26599,
1330,
178... | 2.830709 | 254 |
import os
import environ
env = environ.Env(
# set casting, default value
DEBUG=(bool, False)
)
# reading .env file
environ.Env.read_env()
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development s... | [
11748,
28686,
198,
11748,
551,
2268,
198,
198,
24330,
796,
551,
2268,
13,
4834,
85,
7,
198,
220,
220,
220,
1303,
900,
13092,
11,
4277,
1988,
198,
220,
220,
220,
16959,
16193,
30388,
11,
10352,
8,
198,
8,
198,
2,
3555,
764,
24330,
... | 2.323591 | 1,437 |
#!/usr/bin/python2
"""
Simple socket server using threads
"""
import socket
import sys
from thread import *
import os
import logging
HOST = '' # Symbolic name meaning all available interfaces
PORT = 9998 # Arbitrary non-privileged port
LOG_FORMAT = '%(asctime)-15s %(message)s'
SMART_LOG = '/var/log/smart/smart... | [
2,
48443,
14629,
14,
8800,
14,
29412,
17,
198,
37811,
198,
220,
220,
220,
17427,
17802,
4382,
1262,
14390,
198,
37811,
198,
198,
11748,
17802,
198,
11748,
25064,
198,
6738,
4704,
1330,
1635,
198,
11748,
28686,
198,
11748,
18931,
198,
19... | 2.705556 | 180 |
import numpy as np
from utils.helpers import *
percentiles = [10, 25, 50, 75, 90]
percentile_keys = ["ten", "twenty_five", "fifty", "seventy_five", "ninty"]
def calc_drh(flow_matrix):
"""Dimensionless Hydrograph Plotter"""
average_annual_flow = calculate_average_each_column(flow_matrix)
number_of_rows = ... | [
11748,
299,
32152,
355,
45941,
198,
6738,
3384,
4487,
13,
16794,
364,
1330,
1635,
198,
198,
25067,
2915,
796,
685,
940,
11,
1679,
11,
2026,
11,
5441,
11,
4101,
60,
198,
25067,
576,
62,
13083,
796,
14631,
1452,
1600,
366,
4246,
3787,
... | 2.257956 | 597 |
import torch.nn as nn
__all__ = ["Model"]
| [
11748,
28034,
13,
20471,
355,
299,
77,
198,
198,
834,
439,
834,
796,
14631,
17633,
8973,
628
] | 2.588235 | 17 |
from django.contrib.auth.models import Group, Permission
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from .statistical import UserPagination
from apps.meiduo_admin.serializer.user_group import UserGroupSerializer, GroupPerSerializer
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
4912,
11,
2448,
3411,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62,
30604,
13,
1177,
28709,
1330,
9104,
7680,
7248,
198,
6738,
764,
14269,
19929,
... | 3.876712 | 73 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import url, include
from rest_framework import routers, serializers, viewsets
from . import views
router = routers.DefaultRouter()
router.register(r'announcements', views.AnnouncementViewSet)
urlpatterns = [
url... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
6738,
1334... | 2.958333 | 120 |
from app.db.wrappers import ClickHouse
DBS = {}
| [
6738,
598,
13,
9945,
13,
29988,
11799,
1330,
6914,
18102,
198,
198,
35,
4462,
796,
23884,
628,
198
] | 2.833333 | 18 |
from ravendb.documents.conventions.document_conventions import DocumentConventions
from ravendb.exceptions.exceptions import DatabaseDoesNotExistException
from ravendb.http.request_executor import RequestExecutor
from ravendb.http.server_node import ServerNode
from ravendb.http.topology import UpdateTopologyParameters
... | [
6738,
24343,
437,
65,
13,
15390,
2886,
13,
1102,
16593,
13,
22897,
62,
1102,
16593,
1330,
16854,
3103,
16593,
198,
6738,
24343,
437,
65,
13,
1069,
11755,
13,
1069,
11755,
1330,
24047,
13921,
3673,
3109,
396,
16922,
198,
6738,
24343,
437... | 3.773196 | 97 |
#!/usr/bin/env python3
import csv
import logging
import logging.config
import re
import argparse
import json
import sys
from .log import log
from . import datatypes
logger = logging.getLogger(__name__)
default_column_mapping = {
'DTSTART': 0,
'DTEND': 1,
'DTSTAMP': 2,
'UID': 3,
'CREATED': 4,
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
269,
21370,
198,
11748,
18931,
198,
11748,
18931,
13,
11250,
198,
11748,
302,
198,
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
25064,
198,
198,
6738,
764,
6404,
1330,
2... | 2.210706 | 2,055 |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 11 18:00:28 2021
@author: Mohammad Eslami
"""
try:
import rpy2
print('===> rpy2 version: ', rpy2.__version__)
from rpy2.robjects.packages import importr
# import rpy2's package module
import rpy2.robjects.packages as rpackages
# R vector of ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
2556,
1367,
1248,
25,
405,
25,
2078,
33448,
198,
198,
31,
9800,
25,
29674,
8678,
2543,
72,
198,
37811,
198,
198,
28311,
25,
220,
198,
220... | 2.816956 | 519 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-04 19:47
from __future__ import unicode_literals
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
16,
319,
1584,
12,
940,
12,
3023,
678,
25,
2857,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
19... | 2.690909 | 55 |
import json
import os
import pickle
import numpy as np
import pandas as pd
import pytest
from barrage.utils import io_utils
| [
11748,
33918,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
12972,
9288,
198,
198,
6738,
33633,
13,
26791,
1330,
33245,
62,
26791,
628,
628,
628,
628... | 3.243902 | 41 |
import asyncio
import requests
from bs4 import BeautifulSoup
from datetime import date, datetime
import discord
import numpy as np
from urllib.error import HTTPError
import yt_dlp as youtube_dl
from discord.ext import commands
import os
from pytz import timezone
from yt_dlp.utils import DownloadError, ExtractorError
fr... | [
11748,
30351,
952,
198,
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
11748,
36446,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2956,
297,
571,
13,
18224,
1330,
... | 2.488441 | 1,341 |
"""
Given an integer number n, return the difference between the product of its digits and the sum of its digits.
"""
| [
37811,
198,
15056,
281,
18253,
1271,
299,
11,
1441,
262,
3580,
1022,
262,
1720,
286,
663,
19561,
290,
262,
2160,
286,
663,
19561,
13,
198,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
220
] | 3.6 | 35 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from dotenv import load_dotenv
load_dotenv()
import os
import json
import requests
from concurrent.futures import ThreadPoolExecutor
from flask import Flask, flash, request, redirect, url_for, session
from video_captioning.main import upload_vid... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
198,
2,
49962,
739,
262,
17168,
5964,
13,
198,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
2220,
62,
26518,
24330,
3419,
198,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
700... | 3.272152 | 158 |
from http import HTTPStatus
from requests.exceptions import SSLError
from pytest import fixture
from unittest import mock
from tests.unit.mock_for_tests import (
CYBERCRIME_RESPONSE_MOCK,
EXPECTED_DELIBERATE_RESPONSE,
EXPECTED_OBSERVE_RESPONSE,
EXPECTED_RESPONSE_500_ERROR,
EXPECTED_RESPONSE_404_ER... | [
6738,
2638,
1330,
14626,
19580,
198,
6738,
7007,
13,
1069,
11755,
1330,
6723,
2538,
81,
1472,
198,
198,
6738,
12972,
9288,
1330,
29220,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
5254,
13,
20850,
13,
76,
735,
62,
1640,
62,... | 2.404223 | 663 |
#!/usr/bin/env python
# encoding: utf-8
"""
untitled.py
Created by Jrmie on 2013-10-26.
Copyright (c) 2013 __MyCompanyName__. All rights reserved.
"""
"""
# Problem 1
lim=1000
s=0
for i in range(lim):
if i%3==0 or i%5==0:
s+=i
print s
print sum([x for x in range(1000) if x % 3== 0 or x % 5== 0])
"""
"""
# Problem... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
37811,
198,
2797,
7803,
13,
9078,
198,
198,
41972,
416,
7504,
44871,
319,
2211,
12,
940,
12,
2075,
13,
198,
15269,
357,
66,
8,
2211,
11593,
366... | 2.097946 | 1,266 |
"""
@file
@brief Function to test others functionalities
"""
import os
import pandas
from pyquickhelper.loghelper import fLOG
from ..faq.faq_matplotlib import graph_cities
from ..special import tsp_kruskal_algorithm, distance_haversine
def american_cities(df_or_filename, nb_cities=-1, img=None, fLOG=fLOG):
"""
... | [
37811,
198,
31,
7753,
198,
31,
65,
3796,
15553,
284,
1332,
1854,
10345,
871,
198,
37811,
198,
11748,
28686,
198,
11748,
19798,
292,
198,
6738,
12972,
24209,
2978,
525,
13,
6404,
2978,
525,
1330,
277,
25294,
198,
6738,
11485,
13331,
80,
... | 2.110723 | 858 |
#task 1
r=float(input("Enter the radius of the circle?\n"))
pi=3.143
area=pi*r*r
print("Area of the circle is ",area)
#task 2
x=input("Enter the file name\n")
print(x+".py")
| [
2,
35943,
352,
198,
81,
28,
22468,
7,
15414,
7203,
17469,
262,
16874,
286,
262,
9197,
30,
59,
77,
48774,
198,
14415,
28,
18,
13,
21139,
198,
20337,
28,
14415,
9,
81,
9,
81,
198,
4798,
7203,
30547,
286,
262,
9197,
318,
33172,
20337... | 2.464789 | 71 |
"""Simple NTP spoofing tool."""
from pypacker.layer12.ethernet import Ethernet
from pypacker.layer3 import ip
from pypacker.layer4.udp import UDP
from pypacker.layer567 import ntp
from pypacker import psocket
# interface to listen on
IFACE = "wlan0"
# source address which commits a NTP request and we send a wrong ans... | [
37811,
26437,
399,
7250,
42078,
278,
2891,
526,
15931,
198,
6738,
279,
4464,
10735,
13,
29289,
1065,
13,
316,
2881,
316,
1330,
31903,
198,
6738,
279,
4464,
10735,
13,
29289,
18,
1330,
20966,
198,
6738,
279,
4464,
10735,
13,
29289,
19,
... | 2.241794 | 914 |
#!/usr/bin/env python3
from __future__ import print_function
from builtins import range, map
import unittest
import sys
import pickle
import numpy as np
from mpmath import mp
from testutils import DpkTestCase
from .numexpr import NumericExpression
from .numexpr import isclose
from .basics import OffsetExpression, D... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
3170,
1040,
1330,
2837,
11,
3975,
198,
198,
11748,
555,
715,
395,
198,
11748,
25064,
198,
11748,
2298,
293,
198,
198,... | 3.099502 | 201 |
from progression import Progression
if __name__ == "__main__":
fibonacci_progresssion = FibonacciProgression(first= 1, second= 2)
fibonacci_progresssion.print_progression(20)
| [
6738,
17085,
1330,
1041,
32383,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
12900,
261,
44456,
62,
33723,
82,
295,
796,
41566,
261,
44456,
2964,
32383,
7,
11085,
28,
352,
11,
1218,
28,
362,
... | 2.936508 | 63 |
import numpy as np
from numba import njit, prange
from openamundsen import constants, constants as c, heatconduction
from openamundsen.snowmodel import SnowModel
from . import snow
| [
11748,
299,
32152,
355,
45941,
198,
6738,
997,
7012,
1330,
299,
45051,
11,
778,
858,
198,
6738,
1280,
321,
917,
6248,
1330,
38491,
11,
38491,
355,
269,
11,
4894,
17561,
8110,
198,
6738,
1280,
321,
917,
6248,
13,
82,
2197,
19849,
1330,... | 3.528302 | 53 |
# scripts/custom_task_manager.py
import os
import subprocess
from abc import ABCMeta, abstractmethod
from pretty_printer import *
| [
2,
14750,
14,
23144,
62,
35943,
62,
37153,
13,
9078,
198,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
6738,
2495,
62,
1050,
3849,
1330,
1635,
628
] | 3.567568 | 37 |
from django.urls import path
from django.contrib.auth.views import LoginView
from .views.activity_view import *
from .views.activity_type_view import *
from .views.event_view import *
from .views.flow_view import *
from .views.lane_view import *
from .views.pool_view import *
from .views.process_type_view import *
from... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
33571,
1330,
23093,
7680,
198,
6738,
764,
33571,
13,
21797,
62,
1177,
1330,
1635,
198,
6738,
764,
33571,
13,
21797,
62,
4906,
62,
117... | 2.931902 | 1,351 |
import unittest
from pysapets.gorilla import Gorilla
from pysapets.animal import Animal
import pysapets.constants as constants
from unittest.mock import patch
from io import StringIO
from copy import deepcopy
| [
198,
11748,
555,
715,
395,
198,
6738,
279,
893,
499,
1039,
13,
7053,
5049,
1330,
19097,
5049,
198,
6738,
279,
893,
499,
1039,
13,
41607,
1330,
13792,
198,
11748,
279,
893,
499,
1039,
13,
9979,
1187,
355,
38491,
198,
6738,
555,
715,
... | 2.935065 | 77 |
########################################################################
# This script contains all the data analysis functions #
########################################################################
from __future__ import division
from pylab import *
import scipy, scipy.stats
import tables
import ... | [
29113,
29113,
7804,
198,
2,
770,
4226,
4909,
477,
262,
1366,
3781,
5499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
198,
29113,
29113,
7804,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
1... | 4.657343 | 143 |
import eventlet
eventlet.monkey_patch()
import time
from datetime import datetime, timedelta, timezone
import pytz
from email.utils import parsedate_tz
import json
from flask import Flask, request, render_template
from threading import Thread
from tweepy import OAuthHandler, API, Stream, Cursor
from flask_socketio i... | [
11748,
1785,
1616,
198,
198,
15596,
1616,
13,
49572,
62,
17147,
3419,
198,
198,
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
11,
640,
11340,
198,
11748,
12972,
22877,
198,
6738,
3053,
13,
26791,
1330,
44267,
37... | 3.078212 | 179 |
from django import forms
from django.contrib import admin
from .models import Attendance, Diet, Participant, Troop
from payment.admin import DiscountInline, PaymentInline
admin.site.register(Attendance, AttendanceAdmin)
admin.site.register(Diet, DietAdmin)
admin.site.register(Participant, ParticipantAdmin)
a... | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
46502,
590,
11,
16292,
11,
29880,
11,
8498,
404,
198,
198,
6738,
6074,
13,
28482,
1330,
43474,
818,
1370,
11,
28784,
... | 3.442308 | 104 |
from conf import celery_settings
from .app import app
| [
6738,
1013,
1330,
18725,
1924,
62,
33692,
198,
198,
6738,
764,
1324,
1330,
598,
628
] | 3.733333 | 15 |
from flask import Flask
from flask import render_template
import plotly.express as px
from plotly.offline import plot
app = Flask("Datenvisualisierung")
if __name__ == '__main__':
app.run(debug=True, port=5000)
| [
6738,
42903,
1330,
46947,
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
198,
11748,
7110,
306,
13,
42712,
355,
279,
87,
198,
6738,
7110,
306,
13,
2364,
1370,
1330,
7110,
198,
198,
1324,
796,
46947,
7203,
27354,
268,
41464,
271,
959,
2... | 3 | 74 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 2.272481 | 1,479 |
# -*- coding: utf-8 -*-
"""Script which can be used to compare the features obtained of two different influenza models
Usage:
get_model_statistics.py <model> [--country=<country_name>] [--no-future] [--basedir=<directory>] [--start-year=<start_year>] [--end-year=<end_year>] [--save] [--no-graph]
<baseline> ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
7391,
543,
460,
307,
973,
284,
8996,
262,
3033,
6492,
286,
734,
1180,
29491,
4981,
198,
198,
28350,
25,
198,
220,
651,
62,
19849,
62,
14269,
3969,
13,
9078... | 2.607177 | 1,031 |
from scipy.sparse import vstack
from sklearn.metrics.pairwise import cosine_similarity
import numpy as np
from sisu.preprocessing.tokenizer import is_relevant_sentence, make_sentences, sanitize_text
from gismo.gismo import Gismo, covering_order
from gismo.common import auto_k
from gismo.parameters import Parameters
fr... | [
6738,
629,
541,
88,
13,
82,
29572,
1330,
410,
25558,
198,
6738,
1341,
35720,
13,
4164,
10466,
13,
24874,
3083,
1330,
8615,
500,
62,
38610,
414,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
264,
46313,
13,
3866,
36948,
13,
30001... | 2.798197 | 2,552 |
import numpy as np
import os
from automr import dump_mat
from functools import partial, reduce
print = partial(print, flush=True)
einsum = partial(np.einsum, optimize=True)
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
6738,
3557,
81,
1330,
10285,
62,
6759,
198,
6738,
1257,
310,
10141,
1330,
13027,
11,
4646,
198,
4798,
796,
13027,
7,
4798,
11,
24773,
28,
17821,
8,
198,
68,
1040,
388,
796,
13027,... | 3.222222 | 54 |
from justgood import imjustgood
media = imjustgood("YOUR_APIKEY_HERE")
query = "gojek" # example query
data = media.playstore(query)
# Get attributes
number = 0
result = "Playstore :"
for a in data["result"]:
number += 1
result += "\n\n{}. {}".format(number, a["title"])
result += "\nDeveloper : {}".format... | [
6738,
655,
11274,
1330,
545,
3137,
11274,
198,
198,
11431,
796,
545,
3137,
11274,
7203,
56,
11698,
62,
17614,
20373,
62,
39,
9338,
4943,
198,
22766,
796,
366,
2188,
73,
988,
1,
1303,
1672,
12405,
198,
7890,
796,
2056,
13,
1759,
8095,
... | 2.735955 | 178 |
import numpy as np
# disjoint-set forests using union-by-rank and path compression (sort of).
| [
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
201,
198,
2,
595,
73,
1563,
12,
2617,
17039,
1262,
6441,
12,
1525,
12,
43027,
290,
3108,
19794,
357,
30619,
286,
737,
201,
198
] | 3.030303 | 33 |
num1 = 1
num2 = 20
num3 = 168
# dev first commit
num1 = 1
# resolve conflict
num2 = 88888888
# Test next commit
num3 = 99
| [
22510,
16,
796,
352,
198,
22510,
17,
796,
1160,
198,
220,
198,
22510,
18,
796,
23378,
198,
220,
198,
2,
1614,
717,
4589,
198,
22510,
16,
796,
352,
198,
198,
2,
10568,
5358,
198,
22510,
17,
796,
807,
3459,
3459,
28011,
198,
198,
2,... | 2.381818 | 55 |
from __future__ import unicode_literals
import frappe
from datetime import datetime
from frappe.model.document import Document
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
5306,
27768,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
5306,
27768,
13,
19849,
13,
22897,
1330,
16854,
198
] | 3.96875 | 32 |
#!/usr/bin/env python
import os
import sys
import hashlib
import httplib
import base64
import socket
from xml.dom.minidom import *
RAC_CODE = { 'x' : 'Unknown error',
'0x0' : 'Success',
'0x4' : 'Number of arguments does not match',
'0xc' : 'Syntax... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
12234,
8019,
198,
11748,
1841,
489,
571,
198,
11748,
2779,
2414,
198,
11748,
17802,
198,
198,
6738,
35555,
13,
3438,
13,
1084,
312,... | 1.551044 | 5,172 |
#!/usr/bin/env python
from __future__ import print_function
# Copyright 2019 Juliane Mai - juliane.mai(at)uwaterloo.ca
#
# License
# This file is part of the EEE code library for "Computationally inexpensive identification
# of noninformative model parameters by sequential screening: Efficient Elementary Effects (EEE)... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
2,
15069,
13130,
18322,
68,
36709,
532,
474,
377,
46470,
13,
76,
1872,
7,
265,
8,
84,
7050,
29680,
13,
6888,
198,
2,
198,
2... | 2.44455 | 4,202 |
"""
Leetcode #113
"""
from typing import List
if __name__ == "__main__":
root = TreeNode(5)
root.left = TreeNode(4)
root.left.left = TreeNode(11)
root.left.left.left = TreeNode(7)
root.left.left.right = TreeNode(2)
root.right = TreeNode(8)
root.right.left = TreeNode(13)
root... | [
37811,
198,
220,
220,
220,
1004,
316,
8189,
1303,
16616,
198,
37811,
628,
198,
6738,
19720,
1330,
7343,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
198,
220,
220,
220,
6808,
796,
12200,
19667,
7,
20,
... | 2.036789 | 299 |
from .alertsparser import AlertsParser
from .subwaytripsparser import SubwayTripsParser
from .stationscsvparser import StationsCsvParser
| [
6738,
764,
44598,
2777,
28198,
1330,
23276,
82,
46677,
198,
6738,
764,
7266,
1014,
28461,
862,
48610,
1330,
38923,
14824,
862,
46677,
198,
6738,
764,
301,
602,
6359,
36133,
28198,
1330,
520,
602,
34,
21370,
46677,
198
] | 3.702703 | 37 |
import os
import pygame
from input import Input
from stages.stage import Stage
from stages.stage_example import StageExample
from stages.stage1 import Stage1
from stages.stage2 import Stage2
from stages.stage3 import Stage3
from stages.stage4 import Stage4
from stages.stage5 import Stage5
from stages.stage6 import St... | [
11748,
28686,
198,
11748,
12972,
6057,
198,
198,
6738,
5128,
1330,
23412,
198,
198,
6738,
9539,
13,
14247,
1330,
15371,
198,
6738,
9539,
13,
14247,
62,
20688,
1330,
15371,
16281,
198,
6738,
9539,
13,
14247,
16,
1330,
15371,
16,
198,
673... | 2.791339 | 1,524 |