content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# ----------------------------------------------------------------------
# |
# | TypeAliasStatement.py
# |
# | David Brownell <db@DavidBrownell.com>
# | 2021-10-14 13:22:30
# |
# ----------------------------------------------------------------------
# |
# | Copyright David Brownell 2021
# | Distribut... | [
2,
16529,
23031,
201,
198,
2,
930,
201,
198,
2,
930,
220,
5994,
40489,
48682,
13,
9078,
201,
198,
2,
930,
201,
198,
2,
930,
220,
3271,
4373,
695,
1279,
9945,
31,
11006,
20644,
695,
13,
785,
29,
201,
198,
2,
930,
220,
220,
220,
... | 3.122478 | 694 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T E X A M P L E S
#
# www.pagebot.io
# Licensed under MIT conditions
#
# -----------------------------------------------------------------------------
#
# E20_U... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
2,
16529,
32501,
198,
2,
198,
2,
220,
220,
220,
220,
350,
317,
402,
412,
347,
440,
309,
220,
412,
1395,
317,
337,
... | 2.523238 | 1,915 |
from . import linalg
from .advanced import *
from .arithmetic import *
from .functions import *
from .linear_algebra import *
| [
6738,
764,
1330,
300,
1292,
70,
198,
198,
6738,
764,
32225,
2903,
1330,
1635,
198,
6738,
764,
283,
29848,
1330,
1635,
198,
6738,
764,
12543,
2733,
1330,
1635,
198,
6738,
764,
29127,
62,
282,
29230,
1330,
1635,
198
] | 3.342105 | 38 |
from setuptools import setup,find_packages
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programmi... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
19796,
62,
43789,
198,
198,
4871,
13350,
796,
685,
198,
220,
220,
220,
366,
41206,
12678,
7904,
513,
532,
12995,
1600,
198,
220,
220,
220,
366,
5317,
1631,
7591,
1240,
7904,
5800,
14,
25104,
16... | 2.890052 | 382 |
from multiprocessing import Process
import os
from CPAC.utils.utils import create_seeds_, create_group_log_template
from CPAC.utils import Configuration
import yaml
import time
from time import strftime
| [
6738,
18540,
305,
919,
278,
1330,
10854,
198,
11748,
28686,
198,
6738,
16932,
2246,
13,
26791,
13,
26791,
1330,
2251,
62,
325,
5379,
62,
11,
2251,
62,
8094,
62,
6404,
62,
28243,
198,
6738,
16932,
2246,
13,
26791,
1330,
28373,
198,
117... | 3.507937 | 63 |
from flask import Flask, render_template, request
import pymysql as asu
app = Flask(__name__)
@app.route('/')
if __name__ == '__main__':
app.run(debug = True) | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
198,
11748,
279,
4948,
893,
13976,
355,
355,
84,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
31,
1324,
13,
38629,
10786,
14,
11537,
198,
198,
361,
11593,
3672,... | 2.66129 | 62 |
# -*- coding: utf-8 -*-
"""UTILS MODULE
This module contains utility functions globally available to lenspack.
"""
import numpy as np
from astropy.units.core import Unit
from astropy.constants import G as G_newton
from astropy.constants import c as c_light
def round_up_to_odd(x):
"""Round up to the nearest od... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
3843,
45484,
33893,
198,
198,
1212,
8265,
4909,
10361,
5499,
18309,
1695,
284,
10317,
8002,
13,
198,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
... | 2.189354 | 3,945 |
import pytest
from pyspj.models import load_result, SimpleSPJResult, ContinuitySPJResult, ResultType
@pytest.mark.unittest
| [
11748,
12972,
9288,
198,
198,
6738,
279,
893,
79,
73,
13,
27530,
1330,
3440,
62,
20274,
11,
17427,
4303,
41,
23004,
11,
6389,
14834,
4303,
41,
23004,
11,
25414,
6030,
628,
198,
31,
9078,
9288,
13,
4102,
13,
403,
715,
395,
198
] | 3 | 42 |
from rl_games.common import object_factory
import rl_games.algos_torch
from rl_games.algos_torch import network_builder, pn_network_builder
from rl_games.algos_torch import models
NETWORK_REGISTRY = {}
MODEL_REGISTRY = {}
| [
6738,
374,
75,
62,
19966,
13,
11321,
1330,
2134,
62,
69,
9548,
198,
11748,
374,
75,
62,
19966,
13,
14016,
418,
62,
13165,
354,
198,
6738,
374,
75,
62,
19966,
13,
14016,
418,
62,
13165,
354,
1330,
3127,
62,
38272,
11,
279,
77,
62,
... | 2.743902 | 82 |
import math
from __builtin__ import round as _round
def clamp(x=0.0, min=0.0, max=1.0):
"""
Clamps the value x between min and max
:rtype: float
"""
pass
def gamma(c, g):
"""
Gamma color correction of c with a single scalar gamma value g
:rtype: float
"""
pass
d... | [
11748,
10688,
198,
198,
6738,
11593,
18780,
259,
834,
1330,
2835,
355,
4808,
744,
198,
198,
4299,
29405,
7,
87,
28,
15,
13,
15,
11,
949,
28,
15,
13,
15,
11,
3509,
28,
16,
13,
15,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
... | 2.704762 | 1,260 |
import re
| [
11748,
302,
628
] | 3.666667 | 3 |
# Optimal Account Balancing
# given a list of transactions between a group of people, with each transaction
# as a tuple (x, y, z), meaining person x send person y amount z of money
# assume x != y and z > 0, id x and y might not be linear
# return the minimum number of transactions required to settle the debt
# Optima... | [
2,
13123,
4402,
10781,
8528,
5077,
198,
2,
1813,
257,
1351,
286,
8945,
1022,
257,
1448,
286,
661,
11,
351,
1123,
8611,
198,
2,
355,
257,
46545,
357,
87,
11,
331,
11,
1976,
828,
502,
1397,
1048,
2124,
3758,
1048,
331,
2033,
1976,
2... | 4 | 156 |
import logging
import os
import shutil
from importlib.resources import read_text
from subprocess import check_call
import btemu.resources
if __name__ == '__main__':
main()
| [
11748,
18931,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
6738,
1330,
8019,
13,
37540,
1330,
1100,
62,
5239,
198,
6738,
850,
14681,
1330,
2198,
62,
13345,
198,
198,
11748,
275,
11498,
84,
13,
37540,
628,
628,
198,
361,
11593,
3672,
... | 3.290909 | 55 |
#coding=utf8
from uliweb import settings
from uliweb.utils.common import safe_str, import_attr
from uliweb.utils.storage import Storage
from uliweb.orm import do_, get_model
from uliweb.utils.sorteddict import SortedDict
from sqlalchemy import __version__ as sa_version, select, true, text, literal
import logging
DEBU... | [
2,
66,
7656,
28,
40477,
23,
198,
198,
6738,
334,
4528,
12384,
1330,
6460,
198,
6738,
334,
4528,
12384,
13,
26791,
13,
11321,
1330,
3338,
62,
2536,
11,
1330,
62,
35226,
198,
6738,
334,
4528,
12384,
13,
26791,
13,
35350,
1330,
20514,
... | 2.773519 | 287 |
"""
Stein Variational Gradient Descent for Deep ConvNet on GPU.
Current implementation is mainly using for-loops over model instances.
"""
import torch
import numpy as np
from time import time
from args import args, device
import h5py
import os
from models.model_det import DenseED
from models.Bayesian_model_NN import ... | [
37811,
198,
7447,
259,
15965,
864,
17701,
1153,
2935,
1087,
329,
10766,
34872,
7934,
319,
11362,
13,
198,
11297,
7822,
318,
8384,
1262,
329,
12,
5439,
2840,
625,
2746,
10245,
13,
198,
37811,
198,
198,
11748,
28034,
198,
11748,
299,
3215... | 2.213115 | 2,074 |
from action_handlers.action_handler import ActionHandler, Action
from telegram.inlinekeyboardmarkup import InlineKeyboardMarkup
from telegram.inlinekeyboardbutton import InlineKeyboardButton
from telegram.ext import Filters
from telegram.parsemode import ParseMode
from telegram.error import BadRequest
import constants ... | [
6738,
2223,
62,
4993,
8116,
13,
2673,
62,
30281,
1330,
7561,
25060,
11,
7561,
198,
6738,
573,
30536,
13,
45145,
2539,
3526,
4102,
929,
1330,
554,
1370,
9218,
3526,
9704,
929,
198,
6738,
573,
30536,
13,
45145,
2539,
3526,
16539,
1330,
... | 2.986034 | 716 |
from datetime import datetime
import unittest
from mock import patch
from zoomus import components
def suite():
"""Define all the tests of the module."""
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(RegisterV1TestCase))
return suite
if __name__ == '__main__':
unittest.main()... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
555,
715,
395,
198,
198,
6738,
15290,
1330,
8529,
198,
198,
6738,
19792,
385,
1330,
6805,
628,
198,
4299,
18389,
33529,
198,
220,
220,
220,
37227,
7469,
500,
477,
262,
5254,
286,
262,
82... | 2.891892 | 111 |
from peewee import (
SqliteDatabase,
Model,
CharField,
ForeignKeyField,
DateField,
DecimalField,
DateTimeField,
IntegerField,
TextField
)
import os
import click
from datetime import date, datetime, timedelta
from decimal import Decimal
from enum import IntEnum
db = SqliteDatabase(o... | [
6738,
613,
413,
1453,
1330,
357,
198,
220,
220,
220,
311,
13976,
578,
38105,
11,
198,
220,
220,
220,
9104,
11,
198,
220,
220,
220,
3178,
15878,
11,
198,
220,
220,
220,
8708,
9218,
15878,
11,
198,
220,
220,
220,
7536,
15878,
11,
19... | 2.912651 | 996 |
from queue import PriorityQueue
Coordinate = tuple[int, int]
map: list[list[int]] = []
PART_TWO = True
# For each position, we store the lowest cost path to get there.
lowest_cost: list[list[None | tuple[int, list[Coordinate]]]] = []
with open('2021-12-15.txt') as f:
for line in (l.strip() for l in f):
... | [
6738,
16834,
1330,
34416,
34991,
198,
198,
7222,
45480,
796,
46545,
58,
600,
11,
493,
60,
198,
198,
8899,
25,
1351,
58,
4868,
58,
600,
11907,
796,
17635,
198,
198,
30709,
62,
34551,
46,
796,
6407,
198,
198,
2,
1114,
1123,
2292,
11,
... | 2.110339 | 1,151 |
#!/usr/bin/python
import sys
import getopt
from gensim.models import Word2Vec
import pprint
from time import time
from pyonmttok import Tokenizer
#from smart_open import open
import json
from pyspark.sql import DataFrame
from pyspark.sql.types import StructType, StructField, StringType,ArrayType
from pyspark.sql.functi... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
25064,
198,
11748,
651,
8738,
198,
6738,
308,
641,
320,
13,
27530,
1330,
9678,
17,
53,
721,
198,
11748,
279,
4798,
198,
6738,
640,
1330,
640,
198,
6738,
12972,
261,
76,
926,
482,
133... | 2.724706 | 425 |
#!/usr/bin/env python
# This software is Copyright (c) 2019 - Dhiru Kholia, Copyright (c) 2018 -
# axcheron, and it is hereby released under the MIT License.
#
# Key parts of this program are borrowed from the pyvmx-cracker project.
#
# See https://github.com/axcheron/pyvmx-cracker for details.
import os
import re
im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
770,
3788,
318,
15069,
357,
66,
8,
13130,
532,
20529,
35406,
509,
3937,
544,
11,
15069,
357,
66,
8,
2864,
532,
198,
2,
7877,
2044,
261,
11,
290,
340,
318,
29376,
2716,
739,... | 2.491349 | 289 |
import torch
from .adabound import AdaBound, AdaBoundW
from .lars import LARSOptimizer
| [
11748,
28034,
198,
198,
6738,
764,
324,
397,
633,
1330,
47395,
49646,
11,
47395,
49646,
54,
198,
6738,
764,
75,
945,
1330,
47211,
15821,
457,
320,
7509,
628,
198
] | 3.103448 | 29 |
from print_running_function import print_running_function
import time
# Hackish method to import from another directory
# Useful while xendit-python isn't released yet to the public
import importlib.machinery
loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py")
xendit = loader.load_module... | [
6738,
3601,
62,
20270,
62,
8818,
1330,
3601,
62,
20270,
62,
8818,
198,
198,
11748,
640,
198,
198,
2,
18281,
680,
2446,
284,
1330,
422,
1194,
8619,
198,
2,
49511,
981,
2124,
437,
270,
12,
29412,
2125,
470,
2716,
1865,
284,
262,
1171,... | 3.343137 | 102 |
from django.urls import path
from . import views
urlpatterns = [
path('category/<int:category_slug>/',
views.store, name='products_by_category'),
path('category/<int:category_slug>/<int:subcategory_slug>/',
views.store, name='products_by_subcategory'),
path('category/<int:category_slug>/<... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
22872,
14,
27,
600,
25,
22872,
62,
6649,
1018,
29,
14,
3256,
198,
220,
220,
220,
220,
... | 2.477612 | 268 |
from typing import NoReturn
from .command_program import CommandProgram
from .utils import WindowsInstallationPackage, MacOSInstallationPackage, GNULinuxDistributionInstallationPackage
class TypescriptCommand(CommandProgram):
"""
Command to verify if ``tsc`` command is recognized by the operating system.
... | [
6738,
19720,
1330,
1400,
13615,
198,
198,
6738,
764,
21812,
62,
23065,
1330,
9455,
15167,
198,
6738,
764,
26791,
1330,
3964,
30838,
27813,
11,
4100,
2640,
30838,
27813,
11,
15484,
6239,
259,
2821,
20344,
3890,
30838,
27813,
628,
198,
4871... | 2.764505 | 586 |
import torch
from torch import nn
from fastNLP.modules.utils import initial_parameter
def allowed_transitions(id2label, encoding_type='bio'):
"""
:param dict id2label: key是label的indices,value是str类型的tag或tag-label。value可以是只有tag的, 比如"B", "M"; 也可以是
"B-NN", "M-NN", tag和label之间一定要用"-"隔开。一般可以通过Vocabulary... | [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
198,
6738,
3049,
45,
19930,
13,
18170,
13,
26791,
1330,
4238,
62,
17143,
2357,
628,
628,
198,
4299,
3142,
62,
7645,
1756,
7,
312,
17,
18242,
11,
21004,
62,
4906,
11639,
65,
952,
6,... | 1.85028 | 5,724 |
# %%
import sys
sys.path.insert(0, "..")
import time
import timeit
import numpy as np
import torch
import matplotlib.pyplot as plt
import cpab
import torch.autograd.profiler as profiler
import torch.utils.benchmark as benchmark
# %% SETUP
tess_size = 50
backend = "pytorch" # ["pytorch", "numpy"]
device = "gpu" #... | [
2,
43313,
198,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
366,
492,
4943,
198,
198,
11748,
640,
198,
11748,
640,
270,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
2603,
29487,
8019,
13,
... | 2.193132 | 3,407 |
# -*- coding: windows-1252 -*-
# dpp2607.py
#
# sends commands to DPP2607 ASIC using I2C
#
# Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
... | [
2,
532,
9,
12,
19617,
25,
9168,
12,
1065,
4309,
532,
9,
12,
198,
198,
2,
288,
381,
21719,
22,
13,
9078,
198,
2,
198,
2,
12800,
9729,
284,
360,
10246,
21719,
22,
48445,
1262,
314,
17,
34,
198,
2,
198,
2,
15069,
357,
34,
8,
21... | 2.104105 | 28,846 |
"""
Tests for the command module
"""
import os
import subprocess
import pytest
import pathlib
from pyassert import assert_that
# from aws-iam-tester import cli
script_path = pathlib.Path(__file__).parent.absolute()
# Keep this method last to avoid disrupting other methods
| [
37811,
198,
51,
3558,
329,
262,
3141,
8265,
198,
37811,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
12972,
9288,
198,
11748,
3108,
8019,
198,
198,
6738,
12972,
30493,
1330,
6818,
62,
5562,
198,
2,
422,
3253,
82,
12,
1789,
1... | 3.506329 | 79 |
#!/usr/bin/env python
# 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
# "L... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
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,
32... | 3.048872 | 2,394 |
"""
SC101 Baby Names Project
Adapted from Nick Parlante's Baby Names assignment by
Jerry Liao.
YOUR DESCRIPTION HERE
"""
import tkinter
import babynames
import babygraphicsgui as gui
FILENAMES = [
'data/full/baby-1900.txt', 'data/full/baby-1910.txt',
'data/full/baby-1920.txt', 'data/full/baby-1930.txt',
... | [
37811,
198,
6173,
8784,
14801,
28531,
4935,
198,
48003,
276,
422,
8047,
2547,
75,
12427,
338,
14801,
28531,
16237,
416,
198,
43462,
406,
13481,
13,
198,
198,
56,
11698,
22196,
40165,
15698,
198,
37811,
198,
198,
11748,
256,
74,
3849,
19... | 1.998373 | 5,533 |
ITEMS_PER_PAGE = 10
| [
2043,
39201,
62,
18973,
62,
4537,
8264,
796,
838,
628
] | 2.1 | 10 |
import collections
wall, goal = 1, 3
width_g, height_g = 28, 28
| [
11748,
17268,
201,
198,
201,
198,
11930,
11,
3061,
796,
352,
11,
513,
201,
198,
10394,
62,
70,
11,
6001,
62,
70,
796,
2579,
11,
2579,
201,
198,
201,
198,
201,
198,
201,
198
] | 2.205882 | 34 |
"""distutils.command.sdist
Implements the Distutils 'sdist' command (create a source distribution)."""
__revision__ = "$Id: sdist.py 81261 2010-05-17 10:54:43Z tarek.ziade $"
import os
import string
import sys
from glob import glob
from warnings import warn
from distutils.core import Command
from distutils import d... | [
37811,
17080,
26791,
13,
21812,
13,
82,
17080,
198,
198,
3546,
1154,
902,
262,
4307,
26791,
705,
82,
17080,
6,
3141,
357,
17953,
257,
2723,
6082,
21387,
15931,
198,
198,
834,
260,
10178,
834,
796,
17971,
7390,
25,
264,
17080,
13,
9078... | 2.857843 | 408 |
"""
Type and data-conversion test package.
Tests the following:
1) HDF5 to NumPy type mapping
2) Data conversion
"""
| [
198,
37811,
198,
220,
220,
220,
5994,
290,
1366,
12,
1102,
9641,
1332,
5301,
13,
628,
220,
220,
220,
30307,
262,
1708,
25,
628,
220,
220,
220,
352,
8,
5572,
37,
20,
284,
31835,
20519,
2099,
16855,
198,
220,
220,
220,
362,
8,
6060,... | 2.833333 | 48 |
n = int(raw_input("What would you like to use for n? "))
answer = 0
for x in range(1, n+1):
answer += x
print answer
| [
77,
796,
493,
7,
1831,
62,
15414,
7203,
2061,
561,
345,
588,
284,
779,
329,
299,
30,
366,
4008,
198,
41484,
796,
657,
198,
198,
1640,
2124,
287,
2837,
7,
16,
11,
299,
10,
16,
2599,
198,
220,
220,
220,
3280,
15853,
2124,
198,
198... | 2.5625 | 48 |
"""
picture.py
Author: Jackson Lake
Credit: HHS page Github Tutorial
Assignment:
Use the ggame library to "paint" a graphical picture of something (e.g. a house, a face or landscape).
Use at least:
1. Three different Color objects.
2. Ten different Sprite objects.
3. One (or more) RectangleAsset objects.
4. One (or ... | [
37811,
198,
34053,
13,
9078,
198,
13838,
25,
6612,
6233,
198,
23690,
25,
45497,
2443,
38994,
36361,
198,
198,
8021,
16747,
25,
198,
198,
11041,
262,
308,
6057,
5888,
284,
366,
79,
2913,
1,
257,
27831,
4286,
286,
1223,
357,
68,
13,
7... | 2.588785 | 1,070 |
# Generated by Django 2.0 on 2019-05-05 09:12
import datetime
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
319,
13130,
12,
2713,
12,
2713,
7769,
25,
1065,
198,
198,
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 3.088235 | 34 |
expected_output = {
"url": {
"ftp://user:password@172.16.4.253/router-dhcp": {
"read": "Dec 01 1997 12:01 AM",
"written": "Never",
"status": "Last read succeeded. Bindings have been loaded in RAM.",
"delay_in_secs": 300,
"timeout_in_secs": 300,
... | [
40319,
62,
22915,
796,
1391,
198,
220,
220,
220,
366,
6371,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
701,
79,
1378,
7220,
25,
28712,
31,
23628,
13,
1433,
13,
19,
13,
28592,
14,
472,
353,
12,
34985,
13155,
1298,
139... | 1.853081 | 211 |
expected_output = {
"vlans": {
"1": {
"vlan_id": "1",
"name": "default",
"state": "active",
"shutdown": False,
"mtu": 1500,
"said": 100001,
"trans1": 0,
"trans2": 0,
"type": "enet",
"inter... | [
40319,
62,
22915,
796,
1391,
198,
220,
220,
220,
366,
19279,
504,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
16,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
85,
9620,
62,
312,
1298,
... | 1.659555 | 2,203 |
from xarray_multiscale.reducers import windowed_mean, windowed_mode
import numpy as np
| [
6738,
2124,
18747,
62,
16680,
2304,
1000,
13,
445,
1229,
364,
1330,
4324,
276,
62,
32604,
11,
4324,
276,
62,
14171,
198,
11748,
299,
32152,
355,
45941,
198
] | 3.107143 | 28 |
import functools
import json
import operator
import os
from collections import Counter, namedtuple
from multiprocessing import Pool, cpu_count
from pprint import pprint
import requests
import xlrd
import xmltodict
from tqdm import tqdm
_alb_fields = [
"title",
"link",
"author",
"pubDate",
"descrip... | [
11748,
1257,
310,
10141,
198,
11748,
33918,
198,
11748,
10088,
198,
11748,
28686,
198,
6738,
17268,
1330,
15034,
11,
3706,
83,
29291,
198,
6738,
18540,
305,
919,
278,
1330,
19850,
11,
42804,
62,
9127,
198,
6738,
279,
4798,
1330,
279,
47... | 1.944882 | 1,270 |
from podcast_dl.site_parser import parse_site, InvalidSite
import pytest
@pytest.mark.parametrize(
"site,name",
(
("http://talkpython.fm", "talkpython"),
("https://talkpython.fm", "talkpython"),
("http://pythonbytes.fm", "pythonbytes"),
("https://pythonbytes.fm", "pythonbytes")... | [
6738,
9905,
62,
25404,
13,
15654,
62,
48610,
1330,
21136,
62,
15654,
11,
17665,
29123,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
220,
220,
366,
15654,
11,
3672,
1600,
198,
2... | 2.394822 | 309 |
import os
from time import sleep
import requests as r
import yaml
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def get_yaml(tp: str) -> dict:
"""
Convert YAML to python dict.
Open dev_settings if exist.
Other way open prod_settings.
:param tp: category of settings which... | [
11748,
28686,
198,
6738,
640,
1330,
3993,
198,
198,
11748,
7007,
355,
374,
198,
11748,
331,
43695,
198,
198,
33,
11159,
62,
34720,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
... | 2.413043 | 966 |
############################################
# imports
############################################
import fgclustering.utils as utils
import fgclustering.optimizer as optimizer
import fgclustering.plotting as plotting
############################################
# Forest-guided Clustering
###########################... | [
29113,
7804,
4242,
198,
2,
17944,
198,
29113,
7804,
4242,
198,
198,
11748,
277,
70,
565,
436,
1586,
13,
26791,
355,
3384,
4487,
198,
11748,
277,
70,
565,
436,
1586,
13,
40085,
7509,
355,
6436,
7509,
198,
11748,
277,
70,
565,
436,
15... | 2.997869 | 1,408 |
from cdhweb.pages.forms import SiteSearchForm
from cdhweb.pages.models import PageIntro
def page_intro(request):
"""Template context processor: if there is a PageIntro snippet
for this page, add it to the context for display."""
# wagtail stores link url without leading and trailing slashes,
# but req... | [
6738,
22927,
71,
12384,
13,
31126,
13,
23914,
1330,
14413,
18243,
8479,
198,
6738,
22927,
71,
12384,
13,
31126,
13,
27530,
1330,
7873,
5317,
305,
628,
198,
4299,
2443,
62,
600,
305,
7,
25927,
2599,
198,
220,
220,
220,
37227,
30800,
47... | 3.211321 | 265 |
touched_files = danger.git.modified_files + danger.git.created_files
has_source_changes = any(map(lambda f: f.startswith("danger_python"), touched_files))
has_changelog_entry = "CHANGELOG.md" in touched_files
is_trivial = "#trivial" in danger.github.pr.title
if has_source_changes and not has_changelog_entry and not is... | [
83,
30075,
62,
16624,
796,
3514,
13,
18300,
13,
41771,
62,
16624,
1343,
3514,
13,
18300,
13,
25598,
62,
16624,
198,
10134,
62,
10459,
62,
36653,
796,
597,
7,
8899,
7,
50033,
277,
25,
277,
13,
9688,
2032,
342,
7203,
38537,
62,
29412,... | 2.85 | 140 |
# coding: utf-8
"""
VPlex REST API
A definition for the next-gen VPlex API # noqa: E501
OpenAPI spec version: 0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Engine(object):
"""NOTE: This class is auto gene... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
23342,
2588,
30617,
7824,
628,
220,
220,
220,
317,
6770,
329,
262,
1306,
12,
5235,
23342,
2588,
7824,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
... | 2.239535 | 5,590 |
# A Dynamic Programming based on Python3
# program to count number of ways to
# cover a distance with 1, 2 and 3 steps
# driver program
dist = 4
print(printCountDP(dist))
| [
2,
317,
26977,
30297,
1912,
319,
11361,
18,
198,
2,
1430,
284,
954,
1271,
286,
2842,
284,
198,
2,
3002,
257,
5253,
351,
352,
11,
362,
290,
513,
4831,
628,
198,
198,
2,
4639,
1430,
198,
17080,
796,
604,
198,
4798,
7,
4798,
12332,
... | 3.55102 | 49 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import config
import sys, traceback
from datetime import datetime
from telegram import Bot, Update, User, Message
from telegram.ext import CommandHandler, Updater, MessageHandler, CallbackContext, Filters
from telegram.utils.request import Request
from telegram import Keyb... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
4566,
198,
11748,
25064,
11,
12854,
1891,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
573,
30536,
13... | 3.457627 | 118 |
#!/usr/bin/env python
from __future__ import division, print_function
import argparse
import numpy as np
from numpy import linspace, zeros, ones, sin, cos, arctan, pi
import os
def gen_blockmeshdict(foil="0012"):
"""
Write a `blockMeshDict` for a NACA foil at specified angle of attack.
"""
# Foil geom... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
1330,
300,
1040,
10223,
11,
1976,
27498,... | 1.838306 | 7,440 |
import json,logging
logger = logging.getLogger(__name__)
| [
11748,
33918,
11,
6404,
2667,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198
] | 2.809524 | 21 |
# There are two sorted arrays nums1 and nums2 of size m and n respectively.
# Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).
# Example 1:
# nums1 = [1, 3]
# nums2 = [2]
# The median is 2.0
# Example 2:
# nums1 = [1, 2]
# nums2 = [3, 4]
# The median is (2 + 3)/2 = 2... | [
2,
1318,
389,
734,
23243,
26515,
997,
82,
16,
290,
997,
82,
17,
286,
2546,
285,
290,
299,
8148,
13,
198,
198,
2,
9938,
262,
14288,
286,
262,
734,
23243,
26515,
13,
383,
4045,
1057,
640,
13357,
815,
307,
440,
7,
6404,
357,
76,
10... | 2.563492 | 126 |
import execute
import random
import traceback
# input sanity checker: prints 1 if valid
# correct checker: prints 1 if valid
# Returns score, status_message
| [
11748,
12260,
198,
11748,
4738,
198,
11748,
12854,
1891,
198,
198,
2,
5128,
34182,
2198,
263,
25,
20842,
352,
611,
4938,
198,
2,
3376,
2198,
263,
25,
20842,
352,
611,
4938,
198,
198,
2,
16409,
4776,
11,
3722,
62,
20500,
198
] | 3.878049 | 41 |
#/usr/bin/python3/
#coding=utf-8
#================ 简介 ===================
# 脚本: 伪·红石比较器
# 作者: 北方重工NK1
# 时间: 2017年12月10日 13:37:11
# 描述: 匹配元素_作业帮
#================ 简介 ===================
import re
Checking_Points1=r'<dt>考点:</dt>([\s\S]*?)</dd>'
Checking_Poi... | [
2,
14,
14629,
14,
8800,
14,
29412,
18,
14,
198,
2,
66,
7656,
28,
40477,
12,
23,
198,
2,
4770,
13328,
106,
222,
20015,
233,
36658,
855,
198,
2,
220,
220,
220,
220,
5525,
226,
248,
17312,
105,
171,
120,
248,
220,
220,
220,
220,
... | 1.557692 | 312 |
#!python3
# Definition for singly-linked list.
if __name__ == "__main__":
l1 = ListNode(2)
l1.next = ListNode(4)
l1.next.next = ListNode(3)
l2 = ListNode(5)
l2.next = ListNode(6)
l2.next.next = ListNode(4)
lsum = ListNode(7)
lsum.next = ListNode(0)
lsum.next.next = ListNode(8)
... | [
2,
0,
29412,
18,
628,
198,
2,
30396,
329,
1702,
306,
12,
25614,
1351,
13,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
300,
16,
796,
7343,
19667,
7,
17,
8,
198,
220,
220,
220,
300,
... | 2.137363 | 182 |
#
# Open Source SAM-BA Programmer
# Copyright (C) Dean Camera, 2016.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
#
# Released under a MIT license, see LICENCE.txt.
import abc
import logging
class TimeoutError(Exception):
"""Exception thrown when a read operation times... | [
2,
198,
2,
220,
220,
220,
220,
220,
4946,
8090,
28844,
12,
4339,
6118,
647,
198,
2,
220,
220,
220,
220,
15069,
357,
34,
8,
11325,
20432,
11,
1584,
13,
198,
2,
198,
2,
220,
34798,
685,
265,
60,
1440,
86,
4262,
66,
549,
1548,
68... | 2.372709 | 491 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# rebuild_frame.py
#
# Copyright 2016 Bruno S <bruno@oac.unc.edu.ar>
#
# This file is part of ProperImage (https://github.com/toros-astro/ProperImage)
# License: BSD-3-Clause
# Full Text: https://github.com/toros-astro/ProperImage/blob/master/LICENSE.txt
#
import os
im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
220,
17884,
62,
14535,
13,
9078,
198,
2,
198,
2,
220,
15069,
1584,
31045,
311,
1279,
1671,
36909,
31,
78... | 2.527938 | 1,038 |
# Generated by Django 2.2.13 on 2021-01-07 14:53
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1485,
319,
33448,
12,
486,
12,
2998,
1478,
25,
4310,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.822222 | 45 |
#!/usr/bin/env python
# Copyright (c) 2016, Francesco Pace
#
# 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... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
357,
66,
8,
1584,
11,
27025,
1073,
44111,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,... | 2.565693 | 822 |
"""
SaltEventProcessor Plugin
#########################
Processor plugin to emit events on task execution progress,
used by Nornir Proxy Runner modules to track tasks flow.
SaltEventProcessor does not work outside of SaltStack environment.
SaltEventProcessor reference
============================
.. autofunction:: ... | [
37811,
198,
43061,
9237,
18709,
273,
42636,
198,
14468,
7804,
2,
198,
198,
18709,
273,
13877,
284,
27588,
2995,
319,
4876,
9706,
4371,
11,
198,
1484,
416,
34121,
343,
38027,
21529,
13103,
284,
2610,
8861,
5202,
13,
198,
198,
43061,
9237... | 2.82 | 800 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
__copyright__ = 'Copyright 2018 by Fadhiil Rachman'
__version__ = '1.0.1'
__license__ = 'MIT'
__author__ = 'Fadhiil Rachman'
__author_email__ = 'fadhiilrachman@gmail.com'
__url__ = 'https://github.com/fadhiilr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
834,
22163,
4766,
834,
220,
220,
220,
220,
220,
220,
796,
705,
15269,
2864,
416,
376,
324,
5303,
... | 2.016304 | 184 |
import pytrellis
"""
Database copy utilities
This is used where there are several tiles with different types but the same or similar bit databases - such as all the
CIB tiles, some IO tiles, etc.
"""
def dbcopy(family, device, source, dest, copy_muxes=True, copy_words=True, copy_enums=True, copy_conns=True):
""... | [
11748,
12972,
83,
11252,
271,
198,
198,
37811,
198,
38105,
4866,
20081,
198,
198,
1212,
318,
973,
810,
612,
389,
1811,
19867,
351,
1180,
3858,
475,
262,
976,
393,
2092,
1643,
20083,
532,
884,
355,
477,
262,
198,
34,
9865,
19867,
11,
... | 2.312236 | 711 |
import numpy as np
from ligo.skymap import kde
import matplotlib
matplotlib.use('Agg')
from matplotlib.colors import to_rgb
from matplotlib import pyplot as plt
from mpl_toolkits.basemap import Basemap
#matplotlib.rc('text', usetex=True)
| [
11748,
299,
32152,
355,
45941,
198,
6738,
300,
14031,
13,
15688,
8899,
1330,
479,
2934,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
46384,
11537,
198,
6738,
2603,
29487,
8019,
13,
4033,
669,
1330,
284,
62,
81... | 2.75 | 88 |
"""count - itertools"""
# Apresentação do count
from itertools import count
# aceita número de ponto flutuante como step, mas n aceita um limite.
contador = count(start=5, step=0.05)
for v in contador:
print(round(v, 2)) # arredonda em duas casas decimais
if v > 10:
break
print(separador())
contador =... | [
37811,
9127,
532,
340,
861,
10141,
37811,
198,
2,
5949,
2028,
64,
16175,
28749,
466,
954,
198,
6738,
340,
861,
10141,
1330,
954,
198,
2,
31506,
5350,
299,
21356,
647,
78,
390,
279,
5957,
781,
315,
84,
12427,
401,
78,
2239,
11,
12422... | 2.413408 | 179 |
import logging
from time import sleep
from mongodb_consistent_backup.Common import DB, MongoUri, validate_hostname
from mongodb_consistent_backup.Errors import DBOperationError, Error, OperationError
from mongodb_consistent_backup.Replication import Replset
| [
11748,
18931,
198,
198,
6738,
640,
1330,
3993,
198,
198,
6738,
285,
506,
375,
65,
62,
5936,
7609,
62,
1891,
929,
13,
17227,
1330,
20137,
11,
42591,
52,
380,
11,
26571,
62,
4774,
3672,
198,
6738,
285,
506,
375,
65,
62,
5936,
7609,
... | 3.303797 | 79 |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 30 15:26:13 2016
@author: jtara1
General syntax for subreddits.txt:
: (colon character) denotes folder name
subreddit url or word denotes subreddit
For more examples see https://github.com/jtara1/RedditImageGrab/commit/8e4787ef9ac43ca694fc663be026f69a568bb622
Example o... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
2447,
1542,
1315,
25,
2075,
25,
1485,
1584,
198,
198,
31,
9800,
25,
474,
83,
3301,
16,
198,
198,
12218,
15582,
329,
46386,
13,
14116,
25... | 2.389313 | 1,179 |
from argparse import ArgumentParser
from jmm.scripts.generate_configuration import generate_configuration
from jmm.scripts.scrape import scrape
from jmm.scripts.valid_configuration import valid_configuration
from jmm.scripts.show_version import show_version
from jmm.scripts import command as COMMAND
if __name__ == '_... | [
6738,
1822,
29572,
1330,
45751,
46677,
198,
198,
6738,
474,
3020,
13,
46521,
13,
8612,
378,
62,
11250,
3924,
1330,
7716,
62,
11250,
3924,
198,
6738,
474,
3020,
13,
46521,
13,
1416,
13484,
1330,
42778,
198,
6738,
474,
3020,
13,
46521,
... | 3.539216 | 102 |
# This file is for testing and verifying the ratio-to-true calculation
# It will be done in real-time rather than as part of test 5
# As it will be much quicker to debug for #54
import pyautogui
import sys
import time
from windowcapture import WindowCapture
import os
print('Press Ctrl-C to quit.')
if __name__ == "_... | [
2,
770,
2393,
318,
329,
4856,
290,
45505,
262,
8064,
12,
1462,
12,
7942,
17952,
198,
2,
632,
481,
307,
1760,
287,
1103,
12,
2435,
2138,
621,
355,
636,
286,
1332,
642,
198,
2,
1081,
340,
481,
307,
881,
20061,
284,
14257,
329,
1303,... | 3.256637 | 113 |
#!/usr/bin/env python
# encoding: utf-8
r"""
Simple advection Riemann solvers
Basic advection Riemann solvers of the form (1d)
.. math::
q_t + A q_x = 0.
:Authors:
Kyle T. Mandli (2008-2-20): Initial version
"""
# ============================================================================
# Copyrig... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
81,
37811,
198,
26437,
512,
303,
596,
371,
26597,
1236,
1540,
690,
198,
198,
26416,
512,
303,
596,
371,
26597,
1236,
1540,
690,
286,
262,
1296,
... | 2.337705 | 610 |
# Generated by Django 3.1.3 on 2020-12-02 06:26
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
18,
319,
12131,
12,
1065,
12,
2999,
9130,
25,
2075,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from django.shortcuts import render
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
2,
13610,
534,
5009,
994,
13,
628
] | 3.764706 | 17 |
import argparse
import json
import os
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import torch.nn.functional as F
torch.backends.cudnn.benchmark = True
from model import MultiTaskImageNetwork
from data import CARLA_Data
from class_converter... | [
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
6738,
28034,
13,
26791,
13,
... | 2.68797 | 1,862 |
import numpy as np
import sympy as sp
import mpi4py.MPI as mpi
import pylbm
X, Y, LA = sp.symbols('X, Y, LA')
rho, qx, qy, T = sp.symbols('rho, qx, qy, T')
def run(dx, Tf, generator="cython", sorder=None, withPlot=True):
"""
Parameters
----------
dx: double
spatial step
Tf: double
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
10558,
88,
355,
599,
198,
11748,
285,
14415,
19,
9078,
13,
7378,
40,
355,
285,
14415,
198,
198,
11748,
279,
2645,
20475,
198,
198,
55,
11,
575,
11,
9131,
796,
599,
13,
1837,
2022,
10220,
10... | 1.662075 | 2,323 |
import warnings
from typing import Tuple, Dict
import streamlit as st
from gutenTAG import GutenTAG
from timeeval_gui.timeseries_config import TimeSeriesConfig
from timeeval_gui.utils import get_base_oscillations, get_anomaly_types, get_anomaly_params, \
get_base_oscillation_parameters
from .page import Page
from... | [
11748,
14601,
198,
6738,
19720,
1330,
309,
29291,
11,
360,
713,
198,
198,
11748,
4269,
18250,
355,
336,
198,
6738,
308,
7809,
42197,
1330,
402,
7809,
42197,
198,
198,
6738,
640,
18206,
62,
48317,
13,
22355,
10640,
62,
11250,
1330,
3862,... | 3.355769 | 104 |
# Generated by Django 3.1.11 on 2021-05-17 02:12
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
1157,
319,
33448,
12,
2713,
12,
1558,
7816,
25,
1065,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.8 | 30 |
import time
import click
import scapy.all as scapy
from networktoolkit import networkscan
def gen_arp_response(target_ip, spoof_ip):
"""Generates an ARP Response packet
:param target_ip: ip address to send packet to
:param spoof_ip: ip address to spoof
:return: A scapy packet
"""
if scan_... | [
11748,
640,
198,
198,
11748,
3904,
198,
11748,
629,
12826,
13,
439,
355,
629,
12826,
198,
198,
6738,
3127,
25981,
15813,
1330,
7686,
5171,
628,
198,
4299,
2429,
62,
5117,
62,
26209,
7,
16793,
62,
541,
11,
42078,
62,
541,
2599,
198,
... | 2.423673 | 904 |
from .models import Ticket, UserProfile, Order, TicketType, OrderType
# Retrieving user profile for the specified user
# Retrieving tickets for the specificied user profile
# Retrieving orders for the specified user profile
# Retrieving the total number of subalterns for a specific user profile
# Retrieving a list... | [
6738,
764,
27530,
1330,
24014,
11,
11787,
37046,
11,
8284,
11,
24014,
6030,
11,
8284,
6030,
198,
198,
2,
4990,
37418,
2836,
7034,
329,
262,
7368,
2836,
198,
198,
2,
4990,
37418,
8587,
329,
262,
2176,
798,
2836,
7034,
198,
198,
2,
49... | 3.977778 | 135 |
# Generated by Django 2.1.1 on 2018-11-08 16:04
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
16,
319,
2864,
12,
1157,
12,
2919,
1467,
25,
3023,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
from pagarme import transaction
from tests.resources.dictionaries import transaction_dictionary
import pytest
import time
| [
6738,
279,
32452,
1326,
1330,
8611,
198,
6738,
5254,
13,
37540,
13,
67,
2867,
3166,
1330,
8611,
62,
67,
14188,
198,
11748,
12972,
9288,
198,
11748,
640,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628
] | 3.810811 | 37 |
#Database setup file
#Useful when setting up for first time
import sqlite3
conn = sqlite3.connect("/home/contactbook/website/storage.db")
c = conn.cursor()
#Create tables for users and books
c.execute("DROP TABLE IF EXISTS users;")
c.execute("""
CREATE TABLE IF NOT EXISTS users(
id integer PRIMARY KE... | [
2,
38105,
9058,
2393,
201,
198,
2,
11041,
913,
618,
4634,
510,
329,
717,
640,
201,
198,
201,
198,
11748,
44161,
578,
18,
201,
198,
201,
198,
37043,
796,
44161,
578,
18,
13,
8443,
7203,
14,
11195,
14,
32057,
2070,
14,
732,
12485,
1... | 2.691525 | 295 |
import os
import sqlite3
from datetime import datetime
from pygate_grpc.client import PowerGateClient
api = os.getenv('POWERGATE_API')
token = os.getenv('POWERGATE_TOKEN')
powergate = PowerGateClient(api, False)
# get final storage deals info
storage_deals = powergate.deals.storage_deal_records(
include_pending=... | [
11748,
28686,
198,
11748,
44161,
578,
18,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
12972,
10494,
62,
2164,
14751,
13,
16366,
1330,
4333,
22628,
11792,
198,
198,
15042,
796,
28686,
13,
1136,
24330,
10786,
47,
36048,
38,
6158,
... | 2.581395 | 645 |
from django.db.backends import BaseDatabaseIntrospection
from sqlanydb import ProgrammingError, OperationalError
import re
import sqlanydb
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
| [
6738,
42625,
14208,
13,
9945,
13,
1891,
2412,
1330,
7308,
38105,
5317,
305,
31308,
198,
6738,
44161,
1092,
9945,
1330,
30297,
12331,
11,
6564,
864,
12331,
198,
11748,
302,
198,
11748,
44161,
1092,
9945,
628,
198,
38823,
62,
2539,
62,
26... | 2.628866 | 97 |
from sklearn.neural_network import MLPClassifier
from sklearn.model_selection import cross_validate
if __name__ == '__main__':
sklearn_reference_XOR() | [
6738,
1341,
35720,
13,
710,
1523,
62,
27349,
1330,
10373,
47,
9487,
7483,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
220,
1330,
3272,
62,
12102,
378,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220... | 3.1 | 50 |
# This is a standalone bundler. You can use this script by itself
# The output is a minimized JSON, which can be distributed
# Usage: py gbundle.py <inputPath>
# Output: bundle.json
# PY_INJECT
__main__()
| [
2,
770,
318,
257,
27669,
12207,
1754,
13,
921,
460,
779,
428,
4226,
416,
2346,
201,
198,
2,
383,
5072,
318,
257,
49491,
19449,
11,
543,
460,
307,
9387,
201,
198,
201,
198,
2,
29566,
25,
12972,
308,
65,
31249,
13,
9078,
1279,
15414... | 2.7875 | 80 |
from datetime import datetime
from pathlib import Path
from typing import Any, Dict, Optional
from python_on_whales.utils import DockerCamelModel
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
32233,
198,
198,
6738,
21015,
62,
261,
62,
1929,
2040,
13,
26791,
1330,
25716,
34,
17983,
17633,
628
] | 3.794872 | 39 |
##############################################################################
# Node Class
##############################################################################
| [
29113,
29113,
7804,
4242,
2235,
198,
2,
19081,
5016,
198,
29113,
29113,
7804,
4242,
2235,
628
] | 10.75 | 16 |
# Copyright (c) 2009-2013 Simon van Heeringen <s.vanheeringen@ncmls.ru.nl>
#
# This module is free software. You can redistribute it and/or modify it under
# the terms of the MIT License, see the file COPYING included with this
# distribution.
""" Configuration for GimmeMotifs """
import ConfigParser
import distutil... | [
2,
15069,
357,
66,
8,
3717,
12,
6390,
11288,
5719,
679,
1586,
268,
1279,
82,
13,
10438,
258,
1586,
268,
31,
10782,
4029,
82,
13,
622,
13,
21283,
29,
198,
2,
198,
2,
770,
8265,
318,
1479,
3788,
13,
921,
460,
17678,
4163,
340,
290... | 2.774809 | 262 |
# -*- coding: utf-8 -*-
# @File : SimpleRewMsfModule.py
# @Date : 2019/1/11
# @Desc :
from Lib.ModuleAPI import *
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
8979,
220,
1058,
17427,
30003,
10128,
69,
26796,
13,
9078,
198,
2,
2488,
10430,
220,
1058,
13130,
14,
16,
14,
1157,
198,
2,
2488,
24564,
220,
1058,
198,
198,
... | 2.245283 | 53 |
import torch
import numpy as np
import logging, yaml, os, sys, argparse, time, math
from tqdm import tqdm
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from scipy.io import wavfile
from random import sample
from Modules import GlowTTS
from Datasets import Text_to_Token, Token_Stack, Mel_Stack... | [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
18931,
11,
331,
43695,
11,
28686,
11,
25064,
11,
1822,
29572,
11,
640,
11,
10688,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
2603,
29487,
8019,
198,
6759,
... | 2.446759 | 864 |
# Generated by Django 1.10.7 on 2017-07-03 21:23
from django.conf import settings
from django.db import migrations
from corehq.sql_db.operations import RawSQLMigration
migrator = RawSQLMigration(('corehq', 'sql_proxy_accessors', 'sql_templates'), {
'PL_PROXY_CLUSTER_NAME': settings.PL_PROXY_CLUSTER_NAME
})
| [
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
22,
319,
2177,
12,
2998,
12,
3070,
2310,
25,
1954,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
198,
198,
6738,
4755,
71,
80,
... | 2.709402 | 117 |
# coding: utf-8
"""
vpc
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RouteParameter(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
410,
14751,
628,
220,
220,
220,
220,
198,
220,
220,
220,
2980,
515,
416,
25,
3740,
1378,
12567,
13,
785,
14,
2032,
7928,
12,
15042,
14,
2032,
7928,
12,
8189,
5... | 2.12362 | 2,718 |
import sdl2
import sdl2.ext
| [
11748,
264,
25404,
17,
198,
11748,
264,
25404,
17,
13,
2302,
628,
628
] | 2.384615 | 13 |
import random
array = random.sample(range(1,100),10)
print(array)
array.sort()
print(array)
print(binary_search(array,array[3]) == 3)
print(binary_search_recursive(array,array[3],0,9) == 3) | [
11748,
4738,
198,
198,
18747,
796,
4738,
13,
39873,
7,
9521,
7,
16,
11,
3064,
828,
940,
8,
198,
4798,
7,
18747,
8,
198,
18747,
13,
30619,
3419,
198,
4798,
7,
18747,
8,
198,
4798,
7,
39491,
62,
12947,
7,
18747,
11,
18747,
58,
18,... | 2.594595 | 74 |
import pygame
| [
11748,
12972,
6057,
628
] | 3.75 | 4 |
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn')
plt.rc('font', size=24) # controls default text sizes
plt.rc('axes', titlesize=24) # fontsize of the axes title
plt.rc('axes', labelsize=24) # fontsize of the x and y labels
plt.rc('xtick', labelsize=24) # fontsize of the ti... | [
11748,
299,
32152,
355,
45941,
220,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
489,
83,
13,
7635,
13,
1904,
10786,
325,
397,
1211,
11537,
198,
489,
83,
13,
6015,
10786,
10331,
3256,
2546,
28,
1731,
8,
220,
22... | 2.570707 | 198 |
import requests
import base64
import zlib
import re
from urllib.parse import quote, unquote
import urllib3
from flask import Flask, redirect, request, Response
from uuid import uuid4
from textwrap import wrap
from lxml import etree
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
xdmod = Flask(__name... | [
11748,
7007,
198,
11748,
2779,
2414,
198,
11748,
1976,
8019,
198,
11748,
302,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
9577,
11,
555,
22708,
198,
11748,
2956,
297,
571,
18,
198,
6738,
42903,
1330,
46947,
11,
18941,
11,
2581,
11,
18... | 2.658363 | 281 |
# echo server - client
# source code from here -> https://realpython.com/python-sockets/
import socket
HOST = '127.0.0.1'
PORT = 65432
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
s.sendall(b'Hello from client script')
data = s.recv(1024)
print ('Rece... | [
2,
9809,
4382,
532,
5456,
201,
198,
2,
2723,
2438,
422,
994,
4613,
3740,
1378,
5305,
29412,
13,
785,
14,
29412,
12,
82,
11603,
14,
201,
198,
201,
198,
11748,
17802,
201,
198,
201,
198,
39,
10892,
796,
705,
16799,
13,
15,
13,
15,
... | 2.47619 | 147 |
"""Defines the configuration for an ingest trigger"""
from __future__ import unicode_literals
import logging
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from ingest.triggers.ingest_trigger_condition import IngestTriggerCondition
from job.configuration.data.job_connection import ... | [
37811,
7469,
1127,
262,
8398,
329,
281,
26151,
7616,
37811,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
18931,
198,
198,
6738,
44804,
684,
2395,
2611,
1330,
26571,
198,
6738,
44804,
684,
2395,
2611,
... | 2.482811 | 2,618 |
import json
import re
from .base import Base
class Erlang(Base):
"""
Parses simple Erlang data format, as output by RabbitMQ status.
e.g.
[{pid,296},
{running_applications,
[{rabbitmq_management_visualiser,"RabbitMQ Visualiser","3.5.1"}]}]
... | [
11748,
33918,
198,
11748,
302,
198,
198,
6738,
764,
8692,
1330,
7308,
628,
198,
4871,
5256,
17204,
7,
14881,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
23042,
274,
2829,
5256,
17204,
1366,
5794,
11,
355,
... | 1.713436 | 841 |