content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import pytest
from plenum.common.exceptions import RequestRejectedException
from plenum.test.pool_transactions.helper import sdk_add_new_nym, sdk_add_new_node, sdk_pool_refresh
| [
11748,
12972,
9288,
198,
198,
6738,
458,
44709,
13,
11321,
13,
1069,
11755,
1330,
19390,
3041,
35408,
16922,
198,
6738,
458,
44709,
13,
9288,
13,
7742,
62,
7645,
4658,
13,
2978,
525,
1330,
264,
34388,
62,
2860,
62,
3605,
62,
3281,
76,... | 2.966667 | 60 |
#!/usr/bin/python
"""
Export neuroimaging results created with AFNI.
@author: R. Reynolds/C. Maumet
originally: @author: Camille Maumet <c.m.j.maumet@warwick.ac.uk>
"""
import sys
import os
from afni_exporter.afni_exporter import AFNItoNIDMExporter
if __name__ == "__main__":
# Remove first argument (script name)... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
198,
43834,
7669,
320,
3039,
2482,
2727,
351,
12341,
22125,
13,
198,
198,
31,
9800,
25,
371,
13,
21995,
14,
34,
13,
6669,
388,
316,
198,
11612,
3289,
25,
2488,
9800,
25,
7298,
8270,
... | 2.292793 | 444 |
from keras.models import model_from_json
import numpy as np
# Training and test data
test_file = '../input/test.csv'
model_file = '../output/digitrecognizer.model.json'
model_weights_file = '../output/digitrecognizer.model.best.hdf5'
output_file = '../output/predictions.csv'
# load json and create model
json_file =... | [
6738,
41927,
292,
13,
27530,
1330,
2746,
62,
6738,
62,
17752,
198,
11748,
299,
32152,
355,
45941,
220,
198,
198,
2,
13614,
290,
1332,
1366,
220,
198,
9288,
62,
7753,
796,
705,
40720,
15414,
14,
9288,
13,
40664,
6,
198,
19849,
62,
77... | 2.76506 | 332 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
383,
7054,... | 3.859031 | 227 |
from .vgg import *
from .resnet import *
from .presnet import *
from .resnet_bottle import * | [
6738,
764,
85,
1130,
1330,
1635,
198,
6738,
764,
411,
3262,
1330,
1635,
198,
6738,
764,
18302,
3262,
1330,
1635,
198,
6738,
764,
411,
3262,
62,
10985,
293,
1330,
1635
] | 3.066667 | 30 |
board = [
[1, 0, 0, 0, 6, 0, 9, 0, 0],
[9, 7, 4, 8, 5, 0, 0, 0, 0],
[0, 0, 0, 0, 9, 0, 0, 0, 0],
[0, 1, 7, 5, 0, 0, 0, 3, 0],
[0, 4, 0, 9, 0, 3, 0, 7, 0],
[0, 3, 0, 0, 0, 8, 2, 5, 0],
[0, 0, 0, 0, 3, 0, 0, 0, 0],
[0, 0, 0, 0, 8, 7, 5, 2, 4],
[0, 0, 2, 0, 4, 0, 0, 0, 6]
] # the board ... | [
3526,
796,
685,
198,
220,
220,
220,
685,
16,
11,
657,
11,
657,
11,
657,
11,
718,
11,
657,
11,
860,
11,
657,
11,
657,
4357,
198,
220,
220,
220,
685,
24,
11,
767,
11,
604,
11,
807,
11,
642,
11,
657,
11,
657,
11,
657,
11,
657... | 1.810169 | 295 |
"""
Define data structure that represents musical piece compliant with some rules.
This data structure contains two nested data structures:
1) melodic lines (loosely speaking, lists of pitches),
2) piano roll (`numpy` 2D-array with rows corresponding to notes,
columns corresponding to time steps, and cells containi... | [
37811,
198,
7469,
500,
1366,
4645,
326,
6870,
10530,
3704,
31332,
351,
617,
3173,
13,
198,
198,
1212,
1366,
4645,
4909,
734,
28376,
1366,
8573,
25,
198,
16,
8,
7758,
29512,
3951,
357,
5439,
577,
306,
5486,
11,
8341,
286,
22421,
828,
... | 2.266306 | 8,325 |
#!/usr/bin/env python
# coding: utf-8
import logging
import random
import numpy as np
from keras.models import Sequential
from keras.layers import InputLayer, Dense, Activation, Dropout
from keras.layers import Conv2D, MaxPooling2D, Flatten, ZeroPadding2D
from keras.datasets import cifar10
from keras.utils import to_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
628,
198,
11748,
18931,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738,
41927,
292... | 2.054768 | 4,656 |
from unittest import TestCase, mock, skipUnless
import pkgutil
from wiki_movie.video import WikiMovie
from wiki_movie.utils import repository_root
| [
6738,
555,
715,
395,
1330,
6208,
20448,
11,
15290,
11,
14267,
28042,
198,
11748,
279,
10025,
22602,
198,
198,
6738,
22719,
62,
41364,
13,
15588,
1330,
13078,
25097,
198,
6738,
22719,
62,
41364,
13,
26791,
1330,
16099,
62,
15763,
628
] | 3.725 | 40 |
__author__ = "Sam Young, Nicole Osborn"
from ..convert import get_dir, set_dir
from . import lightcurve
from .model import Model
from .lightcurve import Lightcurve
| [
834,
9800,
834,
796,
366,
16305,
6960,
11,
25176,
8834,
6286,
1,
198,
198,
6738,
11485,
1102,
1851,
1330,
651,
62,
15908,
11,
900,
62,
15908,
198,
6738,
764,
1330,
1657,
22019,
303,
198,
6738,
764,
19849,
1330,
9104,
198,
6738,
764,
... | 3.3 | 50 |
#!/usr/bin/env python
"""Module that is the main entry point of the automated judge
This module handles configuring Flask properly with all the controllers as well
as initializing logging and other support items.
"""
# Built-ins
import argparse
import glob
import importlib
import logging
import os
import os.path as pa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
26796,
326,
318,
262,
1388,
5726,
966,
286,
262,
16359,
5052,
198,
198,
1212,
8265,
17105,
4566,
870,
46947,
6105,
351,
477,
262,
20624,
355,
880,
198,
292,
4238,
2890,
18931,
2... | 2.691713 | 1,424 |
"""Selection sort Python implementation."""
| [
37811,
4653,
1564,
3297,
11361,
7822,
526,
15931,
628
] | 5 | 9 |
import sys
from ScienceDynamics.config.configs import PAPER_REFERENCES_SFRAME, PAPER_REFERENCES_TXT, PAPER_REFERENCES_COUNT_SFRAME, \
PAPERS_SFRAME, PAPERS_TXT, PAPER_URLS_SFRAME, PAPER_URLS_TXT, PAPER_KEYWORDS_SFRAME, PAPER_KEYWORDS_TXT, \
PAPER_KEYWORDS_LIST_SFRAME, FIELDS_OF_STUDY_SFRAME, FIELDS_OF_STUDY_TX... | [
11748,
25064,
198,
198,
6738,
5800,
35,
4989,
873,
13,
11250,
13,
11250,
82,
1330,
350,
2969,
1137,
62,
2200,
24302,
24181,
1546,
62,
50,
10913,
10067,
11,
350,
2969,
1137,
62,
2200,
24302,
24181,
1546,
62,
51,
25010,
11,
350,
2969,
... | 2.381598 | 7,010 |
#!/usr/bin/env python
'''
Simple script to demonstrate how to Convert to UCS Python while performing tasks
in the UCS Manager GUI
Requires the UCS SDK: pip install ucsmsdk
Michael Petrinovic 2018
'''
from ucsmsdk.ucshandle import UcsHandle
# Import my credentials for UCS Login from ucs_my_credentials.py in the same ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
198,
26437,
4226,
284,
10176,
703,
284,
38240,
284,
49553,
11361,
981,
9489,
8861,
198,
259,
262,
49553,
9142,
25757,
198,
198,
39618,
262,
49553,
26144,
25,
7347,
2721,
334,
... | 2.707207 | 666 |
import deepdanbooru as dd
from click.testing import CliRunner
import sqlite3
| [
11748,
2769,
25604,
2127,
27786,
355,
49427,
198,
6738,
3904,
13,
33407,
1330,
1012,
72,
49493,
198,
11748,
44161,
578,
18,
628
] | 3.545455 | 22 |
import _pickle
import os
DEFAULT_PADDING_LABEL = '<pad>' # dict index = 0
DEFAULT_UNKNOWN_LABEL = '<unk>' # dict index = 1
DEFAULT_RESERVED_LABEL = ['<reserved-2>',
'<reserved-3>',
'<reserved-4>'] # dict index = 2~4
# the first vocab in dict with the i... | [
11748,
4808,
27729,
293,
201,
198,
11748,
28686,
201,
198,
201,
198,
7206,
38865,
62,
47,
29266,
2751,
62,
48780,
3698,
796,
705,
27,
15636,
29,
6,
220,
1303,
8633,
6376,
796,
657,
201,
198,
7206,
38865,
62,
4944,
44706,
62,
48780,
... | 2.1 | 670 |
import sys
import os
from airflow.models import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from airflow.operators.python_operator import BranchPythonOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.... | [
11748,
220,
25064,
198,
11748,
28686,
198,
6738,
45771,
13,
27530,
1330,
360,
4760,
198,
6738,
45771,
13,
3575,
2024,
13,
41757,
62,
46616,
1330,
15743,
18843,
1352,
198,
6738,
45771,
13,
3575,
2024,
13,
29412,
62,
46616,
1330,
11361,
1... | 3.196891 | 193 |
#############################################
# tweetalyzer
# reads the twitter analytic CSV file and finds the top terms associated with good outcomes
import sys
import operator
import argparse
import csv
#############################################
# end removeStopChars
# end removeStopWords
##############... | [
220,
220,
220,
1303,
29113,
7804,
4242,
198,
2,
6126,
3400,
9107,
198,
198,
2,
9743,
262,
17044,
49166,
44189,
2393,
290,
7228,
262,
1353,
2846,
3917,
351,
922,
10906,
198,
198,
11748,
25064,
198,
11748,
10088,
198,
11748,
1822,
29572,
... | 3.928571 | 126 |
#
# 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, software
# ... | [
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
... | 2.370943 | 1,941 |
"""Tests for lisc.core.db"""
from lisc.utils.db import *
###################################################################################################
###################################################################################################
| [
37811,
51,
3558,
329,
300,
2304,
13,
7295,
13,
9945,
37811,
198,
198,
6738,
300,
2304,
13,
26791,
13,
9945,
1330,
1635,
198,
198,
29113,
29113,
29113,
21017,
198,
29113,
29113,
29113,
21017,
198
] | 7.617647 | 34 |
from pathlib import Path
import pickle
import random
import typer
from gitssues import __version__
app = typer.Typer()
bug = typer.Typer(help="Bug related commands")
app.add_typer(bug, name="bug")
@app.command(help="Shows CLI version")
@bug.command(help="Creates a bug in active sprint and assignes it to a user")... | [
6738,
3108,
8019,
1330,
10644,
198,
11748,
2298,
293,
198,
11748,
4738,
198,
198,
11748,
1259,
525,
198,
198,
6738,
17606,
824,
947,
1330,
11593,
9641,
834,
628,
198,
1324,
796,
1259,
525,
13,
25492,
525,
3419,
198,
25456,
796,
1259,
... | 3.017751 | 169 |
###########################################################
# Network in production mode
# FaceEmoji/Precidt
###########################################################
import os
import sys
import json
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
import torch
import torch.utils.data a... | [
29113,
14468,
7804,
21017,
198,
2,
7311,
287,
3227,
4235,
198,
2,
15399,
36,
5908,
7285,
14,
6719,
66,
312,
83,
198,
29113,
14468,
7804,
21017,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
33918,
198,
198,
11748,
299,
32152,
... | 2.796117 | 309 |
import logging
import os
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from lib_yolo import dataset_utils, yolov3, data_augmentation
| [
11748,
18931,
198,
11748,
28686,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
9195,
62,
88,
14057,
1330,
27039,
62,
267... | 3.035088 | 57 |
# Copyright 2020-present Tae Hwan Jung
#
# 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... | [
2,
15069,
12131,
12,
25579,
309,
3609,
367,
8149,
27134,
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.416261 | 1,439 |
'''
Alex Dless
MiTM Detect for gbu u-tushino
spec edit :D
'''
import sqlite3
from os import system
from re import search
from time import sleep
while 1:
sleep(30)
Sqlite.move2ban(Sqlite.get_arp())
print(Sqlite.view())
| [
7061,
6,
198,
15309,
360,
1203,
198,
41541,
15972,
35874,
329,
308,
11110,
334,
12,
83,
1530,
2879,
198,
16684,
4370,
1058,
35,
198,
7061,
6,
198,
198,
11748,
44161,
578,
18,
198,
6738,
28686,
1330,
1080,
198,
6738,
302,
1330,
2989,
... | 2.563218 | 87 |
"""molec_lines - functions related to molecular line radiation
Tom Kuiper, 2008 Nov 10."""
from Physics import *
import math as M
DEBUG = False
def E_K(E_inv_cm):
"""Converts energy in 1/cm to K"""
E_hz = E_inv_cm*c # (1/cm)*(cm/s)
E_ergs = h*E_hz # ergs
return E_ergs/k # K
def equilibrium_Boltzman_rat... | [
37811,
76,
2305,
66,
62,
6615,
532,
5499,
3519,
284,
18955,
1627,
11881,
198,
198,
13787,
509,
9019,
525,
11,
3648,
5267,
838,
526,
15931,
198,
198,
6738,
23123,
1330,
1635,
198,
11748,
10688,
355,
337,
198,
198,
30531,
796,
10352,
19... | 2.116711 | 377 |
# python3
# Copyright 2021 InstaDeep Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | [
2,
21015,
18,
198,
2,
15069,
33448,
2262,
64,
29744,
12052,
13,
1439,
2489,
10395,
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,
284... | 2.951794 | 892 |
from flask import Flask, render_template, url_for
app = Flask(__name__)
@app.route('/')
@app.route('/home')
@app.route('/slideshow')
if __name__ == '__main__':
app.secret_key = 'super_secrect_key'
app.debug = True
app.run(host='0.0.0.0', port=3000) | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
19016,
62,
1640,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
31,
1324,
13,
38629,
10786,
14,
11537,
198,
31,
1324,
13,
38629,
10786,
14,
11195,
11537,
198,
31,
1324,... | 2.369369 | 111 |
# 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, software
# d... | [
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
220,
220,
... | 3.398936 | 188 |
import discord
from discord.ext import commands
from commons import checks
from asyncio import sleep
class Admin(commands.Cog):
"""Commands for managing Discord servers."""
@checks.can_kick()
@commands.command()
async def kick(self, ctx, user : discord.Member):
"""Kicks a user from the server.... | [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
36523,
1330,
8794,
198,
6738,
30351,
952,
1330,
3993,
198,
198,
4871,
32053,
7,
9503,
1746,
13,
34,
519,
2599,
198,
220,
220,
220,
37227,
6935,
1746,
329,
11149,
39462,
... | 2.131266 | 1,935 |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
15069,
357,
66,
8,
12131,
11,
33448,
18650,
290,
14,
273,
663,
29116,
13,
198,
2,
770,
3788,
318,
925,
1695,
284,
345,
739,
262,
2846,
286,
262,
38644,
513,
13,
15,
5964,
393,
262,
2... | 2.213342 | 6,281 |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RUtf8(RPackage):
"""Process and print 'UTF-8' encoded international text
(Unicode).... | [
2,
15069,
2211,
12,
23344,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,... | 2.160428 | 561 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os, errno
import glob
import requests
import datetime
import tarfile
from math import cos, asin, sqrt
if __name__ == "__main__":
get_Weather(datetime.date(1901, 4, 13), 65, 20)
#download_weather_data()
# corr = data.corr... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
28686,
11,
11454,
3919,
198,
11748,
15095,
198,
11748,
7007,
198,
11748,
4818,
8079,
198,
117... | 2.310714 | 280 |
from .prettymonitor import PrettyMonitor | [
6738,
764,
37784,
41143,
1330,
20090,
35479
] | 5.714286 | 7 |
# -*- coding: utf-8 -*-
"""Test for updater.particle module"""
import numpy as np
import datetime
from ...models.measurement.linear import LinearGaussian
from ...resampler.particle import SystematicResampler
from ...types.detection import Detection
from ...types.hypothesis import SingleHypothesis
from ...types.particl... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
14402,
329,
2325,
729,
13,
3911,
1548,
8265,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4818,
8079,
198,
198,
6738,
2644,
27530,
13,
1326,
5015,
434,
... | 3.485507 | 138 |
from selenum import webdriver
driver = webdriver.Chrome()
driver.get("https://genius.com/search?q=Obama")
| [
6738,
384,
11925,
388,
1330,
3992,
26230,
198,
198,
26230,
796,
3992,
26230,
13,
1925,
5998,
3419,
198,
198,
26230,
13,
1136,
7203,
5450,
1378,
5235,
3754,
13,
785,
14,
12947,
30,
80,
28,
15948,
4943,
198
] | 2.918919 | 37 |
import base64
import copy
import glob
import os
from pathlib import Path
from typing import Optional, List, Dict, Any
import docker
import jsonschema
import requests
from aavm.exceptions import AAVMException
from aavm.schemas import get_index_schema
from cpk.types import Machine
from aavm.cli import aavmlogger
from ... | [
11748,
2779,
2414,
198,
11748,
4866,
198,
11748,
15095,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
32233,
11,
7343,
11,
360,
713,
11,
4377,
198,
198,
11748,
36253,
198,
11748,
44804,
684,
2395,
2611,
... | 2.938776 | 147 |
from .max_contiguous_subsequence_sum import *
| [
6738,
764,
9806,
62,
3642,
29709,
62,
7266,
43167,
62,
16345,
1330,
1635,
198
] | 3.285714 | 14 |
from cinemanio.core.factories import MovieFactory, PersonFactory
from cinemanio.core.tests.base import BaseTestCase
| [
6738,
13483,
272,
952,
13,
7295,
13,
22584,
1749,
1330,
15875,
22810,
11,
7755,
22810,
198,
6738,
13483,
272,
952,
13,
7295,
13,
41989,
13,
8692,
1330,
7308,
14402,
20448,
628
] | 3.774194 | 31 |
import os
from decouple import config
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
PHANTOMJS_DRIVER = config('PHANTOMJS_DRIVER', default=r'C:\phantomjs\bin\phantomjs.exe')
SCREENSHOT_PATH = os.path.join(ROOT_DIR, 'captchas')
PYTESSERACT_PATH = config('PYTESSERACT_PATH', default=r'C:\Program Files (x86)\Tesse... | [
11748,
28686,
198,
6738,
875,
43846,
1330,
4566,
198,
198,
13252,
2394,
62,
34720,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
4008,
198,
198,
11909,
8643,
2662,
20120,
62,
7707,
3... | 2.369863 | 146 |
import json
from datetime import datetime
from warnings import warn
import pandas as pd
import requests
try:
from tqdm import tqdm
except ImportError:
from va_efficiency.constants import tqdm
from va_efficiency.constants import COUNTS, OFFICE_IDS, EARLIEST, LATEST, MAX_RESULTS, URL_BASE
| [
11748,
33918,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
14601,
1330,
9828,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
7007,
198,
28311,
25,
198,
220,
220,
220,
422,
256,
80,
36020,
1330,
256,
80,
36020,
198,
1634... | 3.145833 | 96 |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("white")
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
82,
5907,
13,
2617,
62,
7635,
7203,
11186,
4943,
628
] | 2.771429 | 35 |
#
# -*- coding: utf-8 -*-
# Wireshark tests
# By Gerald Combs <gerald@wireshark.org>
#
# Ported from a set of Bash scripts which were copyright 2005 Ulf Lamping
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
'''Wireshark Lua scripting tests'''
import filecmp
import os.path
import shutil
import subprocess
import subpr... | [
2,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
370,
2387,
71,
668,
5254,
198,
2,
2750,
27027,
955,
1443,
1279,
26941,
31,
86,
2387,
71,
668,
13,
2398,
29,
198,
2,
198,
2,
4347,
276,
422,
257,
900,
... | 2.433657 | 309 |
import os
from os.path import join, dirname
from dotenv import load_dotenv
dotenv_path = join(dirname(__file__), "../.env")
load_dotenv(dotenv_path)
VONAGE_API_KEY = os.getenv("VONAGE_API_KEY")
VONAGE_API_SECRET = os.getenv("VONAGE_API_SECRET")
VONAGE_NUMBER = os.getenv("VONAGE_NUMBER")
COUNTRY_CODE = os.getenv("COUN... | [
11748,
28686,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
26672,
3672,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
26518,
24330,
62,
6978,
796,
4654,
7,
15908,
3672,
7,
834,
7753,
834,
828,
366,
492,
11757,
24330,
... | 2.203209 | 561 |
from SCA11H.commands.base.PostCommand import PostCommand
from SCA11H.commands.system.CommunicationSettings import CommunicationSettings, CommunicationMode
class SetCommunicationSettings(PostCommand):
""" Configure Communication Settings """
@staticmethod
@staticmethod
@staticmethod
@staticmeth... | [
6738,
6374,
32,
1157,
39,
13,
9503,
1746,
13,
8692,
13,
6307,
21575,
1330,
2947,
21575,
198,
6738,
6374,
32,
1157,
39,
13,
9503,
1746,
13,
10057,
13,
30813,
3299,
26232,
1330,
26117,
26232,
11,
26117,
19076,
628,
198,
4871,
5345,
3081... | 3.712644 | 87 |
from common.deprecated import deprecated
from enum import IntEnum
from field_type import FieldType
_INT_TO_LEN_MAP = {
FieldType.Int8:1,
FieldType.Int16:2,
FieldType.Int32:4,
FieldType.Int64:8,
}
#TODO: consider more optimal way to work with bytes | [
6738,
2219,
13,
10378,
31023,
1330,
39224,
198,
6738,
33829,
1330,
2558,
4834,
388,
198,
6738,
2214,
62,
4906,
1330,
7663,
6030,
198,
198,
62,
12394,
62,
10468,
62,
43,
1677,
62,
33767,
796,
1391,
198,
220,
220,
220,
7663,
6030,
13,
... | 2.65 | 100 |
import numpy as np
from algorith.data_structs.trees.bst_node import BstNode
if __name__ == "__main__":
# print_tree([1, 1, -1, 1, -1, -1])
# print_tree([1, 1, -1, -1, 1, -1])
# print_tree([1, -1, 1, 1, -1, -1])
print_tree([1, -1, 1, -1, 1, -1])
| [
11748,
299,
32152,
355,
45941,
198,
6738,
8385,
13,
7890,
62,
7249,
82,
13,
83,
6037,
13,
65,
301,
62,
17440,
1330,
347,
301,
19667,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
... | 1.970588 | 136 |
# vim: ft=python
import logging
from stephens_little_package import traceit, PrettyLog
log = logging.getLogger(__name__)
@traceit
| [
2,
43907,
25,
10117,
28,
29412,
198,
198,
11748,
18931,
198,
6738,
2239,
5135,
62,
31629,
62,
26495,
1330,
12854,
270,
11,
20090,
11187,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
31,
40546,
2... | 3.045455 | 44 |
"""
Test the MQTT reader, not available in most environments
"""
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], ".."))
from mabel.adapters.mongodb import MongoDbReader
from mabel.data import Reader
from mabel.data.formats import dictset
from rich import traceback
traceback.install()
if __name__ ... | [
37811,
198,
14402,
262,
337,
48,
15751,
9173,
11,
407,
1695,
287,
749,
12493,
198,
37811,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
28463,
7,
16,
11,
28686,
13,
6978,
13,
22179,
7,
17597,
13,
6978,
58,
15,... | 2.91791 | 134 |
from urllib import parse
from session import kuma
from random import choice
from screenshot import screenshot_mp
from tools import mention_other_bot, find_url
from pyrogram.enums.parse_mode import ParseMode
from pyrogram.enums.chat_action import ChatAction
from bot_db import url_blacklist, loading_image, weibo_domains
... | [
6738,
2956,
297,
571,
1330,
21136,
198,
6738,
6246,
1330,
479,
7487,
198,
6738,
4738,
1330,
3572,
198,
6738,
22032,
1330,
22032,
62,
3149,
198,
6738,
4899,
1330,
3068,
62,
847,
62,
13645,
11,
1064,
62,
6371,
198,
6738,
12972,
39529,
1... | 3.659091 | 88 |
import cv2
import time
video_capture = cv2.VideoCapture(0)
face_features = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
while True:
check, frame = video_capture.read()
gray_img = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# cv2.imshow('Capturing', gray_img)
# key = cv2.waitKey(1)
fac... | [
11748,
269,
85,
17,
198,
11748,
640,
198,
198,
15588,
62,
27144,
495,
796,
269,
85,
17,
13,
10798,
49630,
7,
15,
8,
198,
2550,
62,
40890,
796,
269,
85,
17,
13,
34,
28966,
9487,
7483,
10786,
3099,
5605,
28966,
62,
8534,
1604,
558,
... | 2.323129 | 294 |
"""migration
Revision ID: 41fce4a80ce1
Revises: c624c74e9b
Create Date: 2017-04-25 01:44:18.135688
"""
# revision identifiers, used by Alembic.
revision = '41fce4a80ce1'
down_revision = 'c624c74e9b'
from alembic import op
import sqlalchemy as sa
| [
37811,
76,
4254,
628,
198,
18009,
1166,
4522,
25,
6073,
69,
344,
19,
64,
1795,
344,
16,
198,
18009,
2696,
25,
269,
21,
1731,
66,
4524,
68,
24,
65,
198,
16447,
7536,
25,
2177,
12,
3023,
12,
1495,
5534,
25,
2598,
25,
1507,
13,
170... | 2.342593 | 108 |
# -*- coding: utf-8 -*-
'''
j.philipson
10:51 PM, 2/25/2021
'''
import os
if __name__ == '__main__':
listDirectoryContents() | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
73,
13,
28864,
541,
1559,
198,
940,
25,
4349,
3122,
11,
362,
14,
1495,
14,
1238,
2481,
198,
7061,
6,
628,
198,
11748,
28686,
628,
198,
361,
11593,
3672... | 2.163934 | 61 |
#!/usr/bin/env python
# coding: utf-8
"""
VolumesApi.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
16598,
8139,
32,
14415,
13,
9078,
628,
220,
383,
11459,
347,
10305,
13789,
628,
220,
15069,
357,
66,
8,
784,
1584,
11,
3433,
4... | 3.782692 | 520 |
'''
Parallelism tutorial copied from
https://emcee.readthedocs.io/en/latest/tutorials/parallel/
credit: Dan Foreman-Mackey
'''
import os
from multiprocessing import cpu_count
from multiprocessing import Pool
import emcee
import time
import numpy as np
import sys
os.environ["OMP_NUM_THREADS"] = "1"
print(emcee.__versio... | [
7061,
6,
198,
10044,
29363,
1042,
11808,
18984,
422,
198,
5450,
1378,
368,
344,
68,
13,
961,
83,
704,
420,
82,
13,
952,
14,
268,
14,
42861,
14,
83,
44917,
82,
14,
1845,
29363,
14,
198,
43082,
25,
6035,
4558,
805,
12,
14155,
2539,
... | 2.598513 | 538 |
from flask import render_template
from flask_babel import _
from flask_babel import lazy_gettext as _l
from wtforms.validators import InputRequired
from app.forms import SteuerlotseBaseForm
from app.forms.fields import SteuerlotseDateField, SteuerlotseStringField
from app.forms.steps.step import FormStep, DisplayStep
... | [
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
42903,
62,
65,
9608,
1330,
4808,
198,
6738,
42903,
62,
65,
9608,
1330,
16931,
62,
1136,
5239,
355,
4808,
75,
198,
6738,
266,
83,
23914,
13,
12102,
2024,
1330,
23412,
37374,
198,
198,
6738... | 3.553398 | 103 |
from .db import db
from .users import User
__all__ = [
"db",
"User",
]
| [
6738,
764,
9945,
1330,
20613,
198,
6738,
764,
18417,
1330,
11787,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
9945,
1600,
198,
220,
220,
220,
366,
12982,
1600,
198,
60,
198
] | 2.285714 | 35 |
import time
from datetime import datetime, timezone
from typing import List
from json import JSONDecodeError
from threading import Thread
import requests
from requests.auth import HTTPBasicAuth
BASE_URL = 'https://api.typegenie.net/api/v1'
SANDBOX_URL = 'https://staging-api.typegenie.net/api/v1'
| [
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
640,
11340,
198,
6738,
19720,
1330,
7343,
198,
6738,
33918,
1330,
19449,
10707,
1098,
12331,
198,
198,
6738,
4704,
278,
1330,
14122,
198,
198,
11748,
7007,
198,
6738,
7007,
13,
18... | 3.122449 | 98 |
from flask import request, session
import requests as R
import requests.exceptions as RE
import json as Json
import time as Time
import functools
import os
import traceback
from . import authRouter
from config import WX_APP_ID, WX_APP_SECRET, MACHINE_ID
from config import config
from app import db
from app import admi... | [
6738,
42903,
1330,
2581,
11,
6246,
198,
11748,
7007,
355,
371,
198,
11748,
7007,
13,
1069,
11755,
355,
4526,
198,
11748,
33918,
355,
449,
1559,
198,
11748,
640,
355,
3862,
198,
11748,
1257,
310,
10141,
198,
11748,
28686,
198,
11748,
128... | 2.980237 | 506 |
import json
from collections import Counter
| [
11748,
33918,
198,
6738,
17268,
1330,
15034,
628,
628,
628,
628,
198
] | 4.333333 | 12 |
# coding:utf-8
import json
import os
import time
import hashlib
from prettytable import PrettyTable
import textwrap
from prettytable import DOUBLE_BORDER
import urllib.parse
# 读取json文件
# 写入json文件
# 写入 TXT 文件
if __name__ == '__main__':
while True:
print('-' * 27 + '\n')
print('欢迎使用短链转换... | [
2,
19617,
25,
40477,
12,
23,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
12234,
8019,
198,
6738,
2495,
11487,
1330,
20090,
10962,
198,
11748,
2420,
37150,
198,
6738,
2495,
11487,
1330,
360,
2606,
19146,
62,
33,
12... | 1.369565 | 736 |
"""
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, software
distributed ... | [
37811,
198,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
220,
220,
921,
743,
7330,
257,
4866... | 2.666667 | 483 |
from typing import List, Any
import pytest
import torch
devices: List[str] = ["cpu"]
if torch.cuda.is_available():
devices.append("cuda")
@pytest.fixture(params=devices, scope='module')
@pytest.fixture(scope='module')
@pytest.fixture(scope='module')
x_tensors = [
torch.rand(4, 3, 96, 96), # Random 4D... | [
6738,
19720,
1330,
7343,
11,
4377,
198,
198,
11748,
12972,
9288,
198,
11748,
28034,
198,
198,
42034,
25,
7343,
58,
2536,
60,
796,
14631,
36166,
8973,
198,
361,
28034,
13,
66,
15339,
13,
271,
62,
15182,
33529,
198,
220,
220,
220,
4410,... | 2.362445 | 229 |
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, Dropout
from .vggish import VGGish
class VGGishMultiTask(Model):
"""
Logistic type classifier using VGGIsh as a feature extractor. Predict noise type and snr level
""" | [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
27530,
1330,
9104,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
360,
1072,
11,
14258,
448,
198,
198,
6738,
764,
85,
1130,
... | 3.063158 | 95 |
from __future__ import unicode_literals
__author__ = 'Daniel Lindsley & the Tastypie core team'
# This variable should include the Django-tastypie version number (indexes 0,1,2) and the Grok version for our fork (from index 3).
# This is required so that we have a distinct version number for each internal Grok versi... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
628,
198,
834,
9800,
834,
796,
705,
19962,
9329,
82,
1636,
1222,
262,
309,
459,
4464,
494,
4755,
1074,
6,
198,
198,
2,
770,
7885,
815,
2291,
262,
37770,
12,
83,
459,
4464,
... | 3.094017 | 234 |
"""GE Kitchen Sensor Entities"""
import async_timeout
import logging
from typing import Callable
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .const import DOMAIN
from .entities import GeErdBinarySensor
... | [
37811,
8264,
22541,
35367,
7232,
871,
37811,
198,
11748,
30351,
62,
48678,
198,
11748,
18931,
198,
6738,
19720,
1330,
4889,
540,
198,
198,
6738,
1363,
562,
10167,
13,
5589,
3906,
13,
31943,
1330,
14645,
32398,
198,
6738,
1363,
562,
10167,... | 2.974425 | 391 |
from typing import Any, Mapping, Optional
import numpy as np
from ignite.engine import Engine, Events
from somen.pytorch_utility.extensions.extension import PRIORITY_WRITER, Extension
| [
6738,
19720,
1330,
4377,
11,
337,
5912,
11,
32233,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
44794,
13,
18392,
1330,
7117,
11,
18715,
198,
198,
6738,
264,
3674,
13,
9078,
13165,
354,
62,
315,
879,
13,
2302,
5736,
13,
2302,
... | 3.462963 | 54 |
"""Tests for serializing a dataclass."""
from dataclasses import asdict
from dataclasses import dataclass
from functools import partial
from typing import Any
from typing import Callable
from typing import Dict
from typing import Iterable
from typing import List
from typing import NamedTuple
from typing import Tuple
fr... | [
37811,
51,
3558,
329,
11389,
2890,
257,
4818,
330,
31172,
526,
15931,
198,
6738,
4818,
330,
28958,
1330,
355,
11600,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
19720,
1330,
... | 2.744329 | 2,601 |
from django.db.models import F, Q, Field
from django.db.models.fields.related import ReverseSingleRelatedObjectDescriptor
from django.utils.functional import cached_property
| [
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
376,
11,
1195,
11,
7663,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
25747,
13,
5363,
1330,
31849,
28008,
9819,
10267,
24564,
1968,
273,
198,
6738,
42625,
14208,
13,
26791,
13,
45124,... | 3.64 | 50 |
# SPDX-FileCopyrightText: 2022 Liz Clark for Adafruit Industries
# SPDX-License-Identifier: MIT
import board
import busio
import adafruit_midi
import usb_midi
from adafruit_midi.control_change import ControlChange
from adafruit_midi.pitch_bend import PitchBend
from adafruit_midi.note_off import NoteOff
from adafruit_m... | [
2,
30628,
55,
12,
8979,
15269,
8206,
25,
33160,
28313,
11264,
329,
1215,
1878,
4872,
20171,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
198,
11748,
3096,
198,
11748,
1323,
952,
198,
11748,
512,
1878,
4872,
62,
13602... | 2.463235 | 544 |
from flask import send_from_directory
from app import app
@app.route("/", defaults={"path": ""})
| [
6738,
42903,
1330,
3758,
62,
6738,
62,
34945,
198,
198,
6738,
598,
1330,
598,
628,
198,
31,
1324,
13,
38629,
7203,
14,
1600,
26235,
28,
4895,
6978,
1298,
13538,
30072,
198
] | 3.225806 | 31 |
import pandas as pd
from pandas.testing import assert_frame_equal
from drem.transform.sa_geometries import extract_dublin_local_authorities
def test_extract_dublin_local_authorities() -> None:
"""Extracted DataFrame contains only Dublin local authorities."""
geometries = pd.DataFrame(
{
... | [
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
19798,
292,
13,
33407,
1330,
6818,
62,
14535,
62,
40496,
198,
198,
6738,
288,
2787,
13,
35636,
13,
11400,
62,
469,
908,
1678,
1330,
7925,
62,
67,
549,
2815,
62,
12001,
62,
9800,
871,
... | 1.92389 | 473 |
# -*- coding: utf-8 -*-
"""Tests for the common routines."""
__author__ = 'Diego Elio Pettenò'
__email__ = 'flameeyes@flameeyes.eu'
__copyright__ = 'Copyright © 2013, Diego Elio Pettenò'
__license__ = 'MIT'
import os
import sys
import unittest
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
262,
2219,
31878,
526,
15931,
198,
198,
834,
9800,
834,
796,
705,
32423,
2188,
2574,
952,
4767,
1452,
127,
110,
6,
198,
834,
12888,
834,
796,
705... | 2.622093 | 172 |
from fedot.core.data.data import InputData
from fedot.core.repository.quality_metrics_repository import MetricsRepository
def metric_evaluation(pipeline, train_data: InputData, test_data: InputData,
metrics: list, evaluated_metrics: list, vb_number: int = None):
""" Pipeline training and met... | [
6738,
11672,
313,
13,
7295,
13,
7890,
13,
7890,
1330,
23412,
6601,
198,
6738,
11672,
313,
13,
7295,
13,
260,
1930,
37765,
13,
13237,
62,
4164,
10466,
62,
260,
1930,
37765,
1330,
3395,
10466,
6207,
13264,
628,
198,
4299,
18663,
62,
182... | 2.803191 | 376 |
# Check Pytorch installation
import torch, torchvision
import mmseg
from mmseg.apis import inference_segmentor, init_segmentor, show_result_pyplot
from mmseg.core.evaluation import get_palette
import mmcv
from mmcv import Config
import matplotlib.patches as mpatches
from PIL import Image
import numpy as np
from mmseg.d... | [
2,
6822,
9485,
13165,
354,
9988,
198,
11748,
28034,
11,
28034,
10178,
198,
11748,
8085,
325,
70,
198,
6738,
8085,
325,
70,
13,
499,
271,
1330,
32278,
62,
325,
5154,
273,
11,
2315,
62,
325,
5154,
273,
11,
905,
62,
20274,
62,
9078,
... | 2.473258 | 1,851 |
inicio, fim = [int(n) for n in input().split()]
if inicio > fim:
tempo = 24 - inicio + fim
print('O JOGO DUROU {} HORA(S)'.format(tempo))
elif inicio == fim:
print('O JOGO DUROU 24 HORA(S)')
else:
tempo = fim - inicio
print('O JOGO DUROU {} HORA(S)'.format(tempo))
| [
259,
46441,
11,
277,
320,
796,
685,
600,
7,
77,
8,
329,
299,
287,
5128,
22446,
35312,
3419,
60,
201,
198,
201,
198,
361,
287,
46441,
1875,
277,
320,
25,
201,
198,
220,
220,
220,
28691,
796,
1987,
532,
287,
46441,
1343,
277,
320,
... | 2.041379 | 145 |
'''
File name: detectFaces.py
Use of OpenCV's implementation of Haar feature-based cascade classifier, to detect
human faces in images.
The script includes:
- FacesDetectorCV class: Face detector class based on openCV cascade classifier.
- Demonstration code.
Author: Vasileios S... | [
7061,
6,
198,
8979,
1438,
25,
4886,
37,
2114,
13,
9078,
198,
220,
220,
220,
5765,
286,
4946,
33538,
338,
7822,
286,
9398,
283,
3895,
12,
3106,
44847,
1398,
7483,
11,
284,
4886,
220,
198,
220,
220,
220,
1692,
6698,
287,
4263,
13,
1... | 2.312705 | 1,826 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from reportlab.lib.units import cm
from reportlab.lib import pagesizes
from reportlab.lib import enums
from reportlab.lib.colors import blue, red, black
import reportlab.lib.styles
from reportlab.platypus.paragraph import Paragraph
from reportlab.p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
989,
23912,
13,
8019,
13,
41667,
1330,
12067,
201,
198,
6738,
98... | 2.652418 | 889 |
import pickle
import json
import logging
import os
import openml
# prepare_openml100("/home/fr/fr_fr/fr_ak547/experiments")
| [
11748,
2298,
293,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
11748,
1280,
4029,
628,
628,
628,
198,
198,
2,
8335,
62,
9654,
4029,
3064,
7203,
14,
11195,
14,
8310,
14,
8310,
62,
8310,
14,
8310,
62,
461,
20,
28... | 2.75 | 48 |
import os, sys
import argparse
from Utils.Funcs import get_files_in_path, printProgressBar, loadFromJson
from pydub import AudioSegment
from python_speech_features import logfbank
import numpy as np
import pandas as pd
from DataProcess.DataClasses import Features, classToDic
import json
def main(featsFolder, jsonPath)... | [
11748,
28686,
11,
25064,
198,
11748,
1822,
29572,
198,
6738,
7273,
4487,
13,
24629,
6359,
1330,
651,
62,
16624,
62,
259,
62,
6978,
11,
3601,
32577,
10374,
11,
3440,
4863,
41,
1559,
198,
6738,
279,
5173,
549,
1330,
13491,
41030,
434,
1... | 2.45 | 1,080 |
import numpy as np
from qibo import models, gates
from typing import Dict, Optional
_CIRCUITS = {"supremacy": SupremacyLikeCircuit,
"ghz": PrepareGHZ,
"variational": VariationalCircuit,
"opt-variational": OptimizedVariationalCircuit,
"one-qubi... | [
11748,
299,
32152,
355,
45941,
201,
198,
6738,
10662,
26762,
1330,
4981,
11,
17435,
201,
198,
6738,
19720,
1330,
360,
713,
11,
32233,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198... | 1.986301 | 219 |
#!/usr/local/bin/python3
#
# Question list / form in HTML Format.
#
# Instructions should be printed on the back of each page.
# 1.75" x 0.666 Probable label size?
DOCUMENT_HEADER = """
<html>
<head>
<style>
* {
font-family: Helvetica, sans-serif;
}
h2 {
text-align: center;
margin: 0;
}
.answer-b... | [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
18,
198,
2,
198,
2,
18233,
1351,
1220,
1296,
287,
11532,
18980,
13,
198,
2,
198,
198,
2,
27759,
815,
307,
10398,
319,
262,
736,
286,
1123,
2443,
13,
198,
198,
2,
352,
13,
2425,
1,... | 2.564837 | 2,059 |
from datetime import date
from typing import Iterable
from dateutil.relativedelta import relativedelta
from django.http import JsonResponse
from ... import utils
from ...models import DataPoint, Series
from .serializers import JsonEncoder
# def data_raw(request: HttpRequest):
# start = request.GET.get('start', ... | [
6738,
4818,
8079,
1330,
3128,
198,
6738,
19720,
1330,
40806,
540,
198,
198,
6738,
3128,
22602,
13,
2411,
265,
1572,
12514,
1330,
48993,
1572,
12514,
198,
6738,
42625,
14208,
13,
4023,
1330,
449,
1559,
31077,
198,
198,
6738,
2644,
1330,
... | 2.503521 | 284 |
# Copyright 2011-2012 10gen, 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,
2813,
12,
6999,
838,
5235,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
198,
2,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
... | 2.447608 | 5,058 |
zaimportuj unittest
unittest.main('test.test_import')
| [
89,
1385,
634,
23577,
555,
715,
395,
198,
198,
403,
715,
395,
13,
12417,
10786,
9288,
13,
9288,
62,
11748,
11537,
198
] | 2.5 | 22 |
import math
def euclid_distance(point1, point2):
"""
Calculate the euclidean distance between two points
"""
return math.sqrt((point1[0] - point2[0])**2 + (point1[1] - point2[1])**2)
def offset(point1, point2, scale=1):
"""
Offsets a point by a given offset and scale
"""
return (int(ro... | [
11748,
10688,
198,
198,
4299,
304,
36616,
312,
62,
30246,
7,
4122,
16,
11,
966,
17,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
27131,
378,
262,
304,
36616,
485,
272,
5253,
1022,
734,
2173,
198,
220,
220,
220,
37227,
198,
... | 2.508816 | 397 |
import shutil
import os
import cv2
source2='/home/arqum/arqum/GandEclassification/crop_part1/'
source1='/home/arqum/arqum/GandEclassification/UTKFace/'
count=0
files1 = os.listdir(source1)
files2=os.listdir(source2)
for f1 in files1:
for f2 in files2:
if(f1==f2):
count=count+1
break
print(count)
| [
11748,
4423,
346,
198,
11748,
28686,
198,
11748,
269,
85,
17,
198,
198,
10459,
17,
11639,
14,
11195,
14,
283,
80,
388,
14,
283,
80,
388,
14,
38,
392,
36,
4871,
2649,
14,
31476,
62,
3911,
16,
14,
6,
198,
10459,
16,
11639,
14,
111... | 2.167832 | 143 |
# -----------------------------------------------------------
# Copyright (c) 2021. Danil Smirnov
#
# displays "Hello, world!". You can paste any name against 'world'
# -----------------------------------------------------------
from typing import Optional
if __name__ == '__main__':
test = TestUnit... | [
2,
220,
220,
220,
20368,
22369,
6329,
198,
2,
220,
220,
220,
15069,
357,
66,
8,
33448,
13,
6035,
346,
2439,
343,
37302,
198,
2,
198,
2,
220,
220,
220,
11298,
220,
366,
15496,
11,
995,
48220,
921,
460,
17008,
597,
1438,
1028,
705,
... | 3.081481 | 135 |
# RUN: %PYTHON %s | npcomp-opt -split-input-file -npcomp-cpa-type-inference -canonicalize | FileCheck %s --dump-input=fail
import numpy as np
from npcomp.compiler import test_config
from npcomp.compiler.frontend import EmittedError
import_global = test_config.create_import_dump_decorator()
global_data = (np.zeros((2... | [
2,
32494,
25,
4064,
47,
56,
4221,
1340,
4064,
82,
930,
45941,
5589,
12,
8738,
532,
35312,
12,
15414,
12,
7753,
532,
37659,
5589,
12,
66,
8957,
12,
4906,
12,
259,
4288,
532,
49883,
605,
1096,
930,
9220,
9787,
4064,
82,
1377,
39455,
... | 2.264984 | 317 |
import os
import sys
from pathlib import Path
import platform
# sys.path.append(os.path.join("..","pyemu"))
import numpy as np
import pandas as pd
import pyemu
from pyemu import os_utils
from pyemu.utils import PstFrom, pp_file_to_dataframe, write_pp_file
import shutil
ext = ''
local_bins = False # change if wanting... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
3859,
198,
198,
2,
25064,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7203,
492,
2430,
9078,
368,
84,
48774,
198,
11748,
299,
32152,
355,
45941,
19... | 1.92432 | 10,518 |
# Solution A
# Solution B
| [
2,
28186,
317,
628,
198,
2,
28186,
347,
198
] | 3.111111 | 9 |
# Copyright 2017. Allen Institute. All rights reserved
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follow... | [
2,
15069,
2177,
13,
9659,
5136,
13,
1439,
2489,
10395,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
17613,
11,
389,
10431,
2810,
326,
262,
198,
2,
1708,
3403,
389,
1138,
25,
198,
2,
... | 3.322772 | 1,010 |
"""
Copyright © 2021 HighlyIntelligentBeing <highlyintelligentbeing1707@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to us... | [
37811,
198,
15269,
10673,
33448,
38254,
5317,
32940,
18357,
1279,
47444,
600,
32940,
11873,
1558,
2998,
31,
14816,
13,
785,
29,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428... | 2.792072 | 1,438 |
# Solution
# Setup
q = Queue()
q.enqueue(1)
q.enqueue(2)
q.enqueue(3)
# Test size
print ("Pass" if (q.size() == 3) else "Fail")
# Test dequeue
print ("Pass" if (q.dequeue() == 1) else "Fail")
# Test enqueue
q.enqueue(4)
print ("Pass" if (q.dequeue() == 2) else "Fail")
print ("Pass" if (q.dequeue() == 3) e... | [
2,
28186,
220,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
2,
31122,
198,
80,
796,
4670,
518,
3419,
198,
80,
13,
268,
36560,
7,
16,
8,
198,
80,
13,
268,
36560,
7,
17,
8,
198,
80,
13,
268,
36560,
7,
18,
8,
198,
198,
2... | 2.303665 | 191 |
from django import forms
from .fields import TreeItemChoiceField
class TreeItemForm(forms.Form):
"""Generic sitetree form.
Accepts the following kwargs:
- `tree`: tree model or alias
- `tree_item`: ID of an initial tree item
"""
choice_field_class = TreeItemChoiceField
| [
6738,
42625,
14208,
1330,
5107,
198,
198,
6738,
764,
25747,
1330,
12200,
7449,
46770,
15878,
628,
198,
4871,
12200,
7449,
8479,
7,
23914,
13,
8479,
2599,
198,
220,
220,
220,
37227,
46189,
1650,
316,
631,
1296,
13,
628,
220,
220,
220,
... | 2.88785 | 107 |
import turtle as t
import random
jackie = t.Turtle()
t.colormode(255)
jackie.speed("fastest")
draw_spirograph(1)
screen = t.Screen()
screen.exitonclick()
| [
11748,
28699,
355,
256,
198,
11748,
4738,
198,
198,
19650,
494,
796,
256,
13,
51,
17964,
3419,
198,
83,
13,
4033,
579,
1098,
7,
13381,
8,
198,
19650,
494,
13,
12287,
7203,
7217,
395,
4943,
198,
198,
19334,
62,
2777,
72,
3828,
1470,
... | 2.532258 | 62 |
#!/usr/bin/python3
# File name : hs1xxSmartPlug.py
# Description : Hs1xxSmartPlug is a wrapper for Kasa HS1xx smart plug
from piServices.piConstants import *
from piServices.piUtils import timePrint
from tplink_smartplug import SmartPlug
class Hs1xxSmartPlug():
""" Implements direct interface to Kasa HS1xx Smar... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
9220,
1438,
220,
220,
1058,
289,
82,
16,
5324,
25610,
23257,
13,
9078,
198,
2,
12489,
1058,
367,
82,
16,
5324,
25610,
23257,
318,
257,
29908,
329,
15035,
64,
18070,
16,
5324,
4451,
... | 2.09603 | 2,645 |
# Adapted from
# http://nbviewer.ipython.org/github/Carreau/posts/blob/master/07-the-sound-of-hydrogen.ipynb
import struct
from io import BytesIO
import sys
import base64
import numpy as np
DEFAULT_RATE = 44100
| [
2,
30019,
276,
422,
198,
2,
2638,
1378,
46803,
1177,
263,
13,
541,
7535,
13,
2398,
14,
12567,
14,
34,
9624,
559,
14,
24875,
14,
2436,
672,
14,
9866,
14,
2998,
12,
1169,
12,
23661,
12,
1659,
12,
15511,
8648,
13,
541,
2047,
65,
19... | 2.721519 | 79 |
import random
from mabwiser.mab import MAB, LearningPolicy, NeighborhoodPolicy
from mabwiser.simulator import Simulator
from sklearn.preprocessing import StandardScaler
from time import time
size = 1000
decisions = [random.randint(0, 2) for _ in range(size)]
rewards = [random.randint(0, 1000) for _ in range(size)]
c... | [
11748,
4738,
198,
6738,
285,
397,
86,
5847,
13,
76,
397,
1330,
337,
6242,
11,
18252,
36727,
11,
37914,
36727,
198,
6738,
285,
397,
86,
5847,
13,
14323,
8927,
1330,
13942,
198,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
8997,
3351,... | 2.549878 | 2,466 |
import unittest
from mygrations.formats.mysql.file_reader.reader import reader
| [
11748,
555,
715,
395,
198,
198,
6738,
616,
2164,
602,
13,
687,
1381,
13,
28744,
13976,
13,
7753,
62,
46862,
13,
46862,
1330,
9173,
198
] | 3.2 | 25 |