content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""
Text generation using a Recurrent Neural Network (LSTM).
"""
import tensorflow as tf
import numpy as np
import random
import time
import sys
## RNN with num_layers LSTM layers and a fully-connected output layer
## The network allows for a dynamic number of iterations, depending on the inputs it receives.
##
##... | [
37811,
198,
8206,
5270,
1262,
257,
3311,
6657,
47986,
7311,
357,
43,
2257,
44,
737,
198,
37811,
628,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
11748,
640,
198,
11748,
25064,
62... | 2.434266 | 1,430 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 9 18:20:56 2020
@author: guth
"""
distanceEmpty = 50.0
distanceFull = 5.0
##### Remove if no serial required
useSerialMoisture = True
waterEmptyTank = True
targetMoisture = 68
savetyFromLooseMoistureSensor = False
debuglevel = 5
# 0 non... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
7031,
1737,
220,
860,
1248,
25,
1238,
25,
3980,
12131,
198,
198,
31,
9800,
25,
308,
1071,... | 2.659306 | 317 |
# IMPORT MODULES
import numpy as np
from scipy import optimize
from scipy import special
from reported_statistics import get_p
from typing import List
import time
class BinaryOutcomeModel(object):
"""
A binary outcome model class that Logit and Probit are built on.
:param add_intercept: If T... | [
2,
30023,
9863,
19164,
6239,
1546,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
629,
541,
88,
1330,
27183,
201,
198,
6738,
629,
541,
88,
1330,
2041,
201,
198,
6738,
2098,
62,
14269,
3969,
1330,
651,
62,
79,
201,
198,
673... | 2.252003 | 7,865 |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from tensorflow.contrib.tensorboard.plugins import projector
if __name__ == '__main__':
tensorboard_op()
pass | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
1069,
12629,
13,
83,
44917,
82,
13,
10295,
396,
1330,
5128,
62,
7890,
198,
6738,
11192,
273,
11125,
13,
3642,
822,
13,
83,
22854,
3526,
13,
37390,
1330,
43396,
62... | 2.928571 | 70 |
#!/usr/bin/env python
"""
# Author: Kang Tian
# File Name: function.py
# Description:
"""
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
def _peaks(meta):
"""
Find peaks of signals
"""
from scipy.signal import find_peaks
peaks, _ = find_peaks(meta.iloc[... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
2,
6434,
25,
27504,
20834,
198,
2,
9220,
6530,
25,
2163,
13,
9078,
198,
2,
12489,
25,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67... | 1.93819 | 5,161 |
import os
import pandas
import datetime
import numpy as np
import tensorflow as tf
from config import cfg
from keras.utils import to_categorical
from keras.datasets import imdb
from keras.preprocessing import sequence
# Unoptimized, just needed it to work for now
#--- Word level embedding --------------/
'''
#---... | [
11748,
28686,
198,
11748,
19798,
292,
198,
11748,
4818,
8079,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
4566,
1330,
30218,
70,
198,
6738,
41927,
292,
13,
26791,
1330,
284,
62,
66,
239... | 2.923875 | 289 |
# Copyright (c) Matt Colligan 2021
from __future__ import annotations
import typing
from pywayland.server import Signal
from wlroots import Ptr, ffi, lib
if typing.TYPE_CHECKING:
from pywayland.server import Display
from .seat import Seat
| [
2,
15069,
357,
66,
8,
4705,
7778,
5516,
33448,
198,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
19720,
198,
198,
6738,
12972,
1014,
1044,
13,
15388,
1330,
26484,
198,
198,
6738,
266,
75,
19150,
1330,
350,
2213,
11,
277... | 3.269231 | 78 |
a = {0, 1, 2, 3, 4}
b = {3, 2, 1}
print(a.issubset(b))
| [
64,
796,
1391,
15,
11,
352,
11,
362,
11,
513,
11,
604,
92,
201,
198,
65,
796,
1391,
18,
11,
362,
11,
352,
92,
201,
198,
4798,
7,
64,
13,
747,
549,
2617,
7,
65,
4008,
201,
198
] | 1.526316 | 38 |
# Generated by Django 3.1.4 on 2021-12-15 15:59
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
19,
319,
33448,
12,
1065,
12,
1314,
1315,
25,
3270,
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 |
import pickle
from listoperations import *
from chatbot import *
from spell import correction
with open('stopwords.pkl', 'rb') as f:
stop_words = pickle.load(f)
| [
198,
11748,
2298,
293,
198,
6738,
1351,
3575,
602,
1330,
1635,
198,
6738,
8537,
13645,
1330,
1635,
198,
6738,
4822,
1330,
17137,
198,
198,
4480,
1280,
10786,
11338,
10879,
13,
79,
41582,
3256,
705,
26145,
11537,
355,
277,
25,
198,
197,
... | 3.113208 | 53 |
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
16529,
1783,
10541,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
... | 4.360544 | 147 |
#!/usr/local/bin/python3
import re
PATTERN = re.compile("^(\\d+)-(\\d+) (\\w): (.*)")
def valid_sled_password(line):
"""
>>> valid_sled_password("1-3 a: abcde")
True
>>> valid_sled_password("1-3 b: cdefg")
False
>>> valid_sled_password("2-9 c: ccccccccc")
True
>>> valid_sled_passwor... | [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
18,
198,
198,
11748,
302,
198,
198,
47,
1404,
31800,
796,
302,
13,
5589,
576,
7203,
61,
7,
6852,
67,
10,
13219,
7,
6852,
67,
28988,
357,
6852,
86,
2599,
357,
15885,
8,
4943,
628,
... | 2.415172 | 725 |
expected_output = {
'total': 449,
'protocols': {
'connected': 3,
'static': 0,
'rip': 0,
'ospf': 446,
'bgp': 0,
'isis': 0
},
'netmask': {
24: 1,
26: 2,
27: 3,
28: 5,
29: 1,
30: 34,
31: 242,
32: 161
},
'next_hop_table': 5
}
| [
40319,
62,
22915,
796,
1391,
198,
220,
705,
23350,
10354,
604,
2920,
11,
198,
220,
705,
11235,
4668,
82,
10354,
1391,
198,
220,
220,
220,
705,
15236,
10354,
513,
11,
198,
220,
220,
220,
705,
12708,
10354,
657,
11,
198,
220,
220,
220... | 1.736527 | 167 |
err_msg = dict()
err_msg['mpmd_run_error'] = \
"ERROR: Internal error. Expected MPMD Run type, but the run does not " \
"contain " \
"child runs"
err_msg['run_node_config_missing'] = \
"ERROR: Internal error. Node config not found in run object."
err_msg['rc_env_out_fail'] = \
"ERROR: Could not s... | [
8056,
62,
19662,
796,
8633,
3419,
198,
198,
8056,
62,
19662,
17816,
3149,
9132,
62,
5143,
62,
18224,
20520,
796,
3467,
198,
220,
220,
220,
366,
24908,
25,
18628,
4049,
13,
1475,
7254,
4904,
12740,
5660,
2099,
11,
475,
262,
1057,
857,
... | 2.716981 | 159 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Package de Requêtage Skywise => SQL
"""
__version__ = "0.0.1"
from .core import swds_json,speakSW | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
220,
198,
37811,
198,
197,
27813,
390,
9394,
25792,
83,
496,
5274,
3083,
5218,
16363,
198,
37811,
198,
220,
198,
834,
... | 2.264706 | 68 |
import unittest
from programy.processors.pre.normalize import NormalizePreProcessor
from programy.bot import Bot
from programy.brain import Brain
from programy.config.sections.brain.brain import BrainConfiguration
from programy.config.sections.bot.bot import BotConfiguration
| [
11748,
555,
715,
395,
198,
6738,
1430,
88,
13,
14681,
669,
13,
3866,
13,
11265,
1096,
1330,
14435,
1096,
6719,
18709,
273,
198,
6738,
1430,
88,
13,
13645,
1330,
18579,
198,
6738,
1430,
88,
13,
27825,
1330,
14842,
198,
6738,
1430,
88,
... | 4.014493 | 69 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# Invenio-Drafts-Resources is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Draft Models API."""
from datetime import datetime
from invenio_db import db
from invenio_records.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
12131,
327,
28778,
13,
198,
2,
198,
2,
554,
574,
952,
12,
37741,
82,
12,
33236,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,... | 2.633639 | 1,635 |
CONFIG = {
'gal_type': 'exp',
'psf_type': 'gauss',
'shear_scene': True,
'n_coadd': 30,
'scale': 0.263,
'mask_and_interp': True,
'bad_columns_kws': dict(
widths=(1, 2),
p=(0.8, 0.2),
min_length_frac=(1, 1),
max_length_frac=(1, 1),
gap_prob=(0.30, 0.30),... | [
10943,
16254,
796,
1391,
198,
220,
220,
220,
705,
13528,
62,
4906,
10354,
705,
11201,
3256,
198,
220,
220,
220,
705,
862,
69,
62,
4906,
10354,
705,
4908,
1046,
3256,
198,
220,
220,
220,
705,
7091,
283,
62,
29734,
10354,
6407,
11,
19... | 1.669492 | 236 |
from .settings import *
import pygame
pygame.init()
pygame.font.init()
| [
6738,
764,
33692,
1330,
1635,
198,
11748,
12972,
6057,
198,
9078,
6057,
13,
15003,
3419,
198,
9078,
6057,
13,
10331,
13,
15003,
3419,
198
] | 2.958333 | 24 |
#!/usr/bin/env python3
import logging
import sys
# Don't freak out if pyserial isn't installed - unless they actually
# try to instantiate a SerialWriter
try:
import serial
SERIAL_MODULE_FOUND = True
except ModuleNotFoundError:
SERIAL_MODULE_FOUND = False
from os.path import dirname, realpath
sys.path.ap... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
18931,
198,
11748,
25064,
198,
198,
2,
2094,
470,
22601,
503,
611,
279,
893,
48499,
2125,
470,
6589,
532,
4556,
484,
1682,
198,
2,
1949,
284,
9113,
9386,
257,
23283,
... | 2.316129 | 1,240 |
import json
import webbrowser
from time import sleep
try:
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
except:
from Cryptodome.PublicKey import RSA
from Cryptodome.Cipher import PKCS1_OAEP
from base64 import b64encode
import requests
from requests.adapters import HTTPAdapter
f... | [
11748,
33918,
198,
11748,
3992,
40259,
198,
6738,
640,
1330,
3993,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
36579,
13,
15202,
9218,
1330,
42319,
198,
220,
220,
220,
422,
36579,
13,
34,
10803,
1330,
29673,
7902,
16,
62,
23621,
890... | 2.516378 | 519 |
from typing import List
import databases
import sqlalchemy
from pydantic import PrivateAttr
import ormar
from tests.settings import DATABASE_URL
database = databases.Database(DATABASE_URL, force_rollback=True)
metadata = sqlalchemy.MetaData()
| [
6738,
19720,
1330,
7343,
198,
198,
11748,
20083,
198,
11748,
44161,
282,
26599,
198,
6738,
279,
5173,
5109,
1330,
15348,
8086,
81,
198,
198,
11748,
393,
3876,
198,
6738,
5254,
13,
33692,
1330,
360,
1404,
6242,
11159,
62,
21886,
198,
198... | 3.410959 | 73 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from LinkedList import LinkedList
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
7502,
276,
8053,
1330,
7502,
276,
8053,
628
] | 3.209302 | 43 |
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from .models import Passenger, Booking, Flight
from django.core.mail import EmailMessage
import sendgrid
import os
from sendgrid.helpers.mail import *
from django.views.decorators.csrf import csrf_exempt
im... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
11,
367,
29281,
31077,
7738,
1060,
198,
6738,
764,
27530,
1330,
47239,
11,
4897,
278,
... | 3.284553 | 123 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-08 08:33
from __future__ import unicode_literals
from django.conf import settings
from django.apps import apps as global_apps
from django.db import migrations
import sys
import datetime
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
20,
319,
2177,
12,
3070,
12,
2919,
8487,
25,
2091,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 3.048193 | 83 |
from django.conf.urls import url, include
from schools import views
app_name = 'schools'
urlpatterns = [
url(r'^(?P<school_name>[^/]+)/', include([
url(r'^$', views.index, name='index'),
url(r'^user/$', views.user, name='user'),
url(r'^staff/$', views.staff, name='staff'),
url(r'^... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
198,
6738,
4266,
1330,
5009,
198,
198,
1324,
62,
3672,
796,
705,
14347,
82,
6,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
... | 2.134146 | 492 |
# Copyright (c) 2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
xarray with MetPy Tutorial
==========================
`xarray <http://xarray.pydata.org/>`_ is a powerful Python package that provides N-dimensional
labeled arrays and datasets ... | [
2,
15069,
357,
66,
8,
2864,
3395,
20519,
34152,
13,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
347,
10305,
513,
12,
2601,
682,
13789,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
12,
18,
12,
2601,
682,
1... | 3.129376 | 4,970 |
import ctypes
import os.path
import numpy as np
from clawpack.pyclaw import ClawSolver1D
| [
11748,
269,
19199,
198,
11748,
28686,
13,
6978,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
26573,
8002,
13,
9078,
43143,
1330,
30358,
50,
14375,
16,
35,
628
] | 3.137931 | 29 |
#local includes
from . import parser
#external includes
import collections | [
2,
12001,
3407,
198,
6738,
764,
1330,
30751,
198,
198,
2,
22615,
3407,
198,
11748,
17268
] | 4.6875 | 16 |
"""
Major surface scatter class
"""
| [
37811,
198,
24206,
4417,
41058,
1398,
198,
37811,
198,
220,
220,
220,
220,
198
] | 2.928571 | 14 |
# Copyright 2022 Jared Hendrickson
#
# 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 wri... | [
2,
15069,
33160,
19116,
42476,
261,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
74... | 3.822485 | 169 |
#!/usr/bin/env python
r"""get_score -- get score from table and do normalization
"""
from plumbum import cli, colors
from pathlib import Path
import pandas as pd
import sys
from ruamel import yaml
def StrOfSize(
size,
carry = 1000,
):
'''
递归实现,精确为最大单位值 + 小数点后三位
默认进位为1000
'''
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
81,
37811,
1136,
62,
26675,
1377,
651,
4776,
422,
3084,
290,
466,
3487,
1634,
198,
37811,
198,
198,
6738,
458,
2178,
388,
1330,
537,
72,
11,
7577,
198,
6738,
3108,
8019,
1330,
10644,
... | 1.986441 | 295 |
# find turning point routine
# classifies a given potential grid, into leads and dots given the lead potentials and the dot potentials
import numpy as np
def find_turning_points(V,mu_l,mu_d):
'''
Convinience Function
Input
V : Potential Profile
mu_l : lead potentials
mu_d : dot potentials
... | [
2,
1064,
6225,
966,
8027,
198,
2,
1398,
6945,
257,
1813,
2785,
10706,
11,
656,
5983,
290,
22969,
1813,
262,
1085,
2785,
82,
290,
262,
16605,
2785,
82,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4299,
1064,
62,
15344,
278,
62,
130... | 2.05158 | 1,551 |
# -*- coding: utf-8 -*-
# This fixture does a bunch of real HTTP request against a selected
# server (determined by the environment variable FERENDA_TESTURL,
# which is http://localhost:8000/ by default)
#
# When running against a local instance, it's important that this has
# been initialized with the documents in la... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
770,
29220,
857,
257,
7684,
286,
1103,
14626,
2581,
1028,
257,
6163,
198,
2,
4382,
357,
67,
23444,
416,
262,
2858,
7885,
376,
1137,
1677,
5631,
62,
51,
6465,
... | 2.990323 | 620 |
# -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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 requir... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
1303,
198,
2,
15069,
13130,
3012,
11419,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198... | 3.196181 | 1,728 |
import cv2
import random
import numpy as np
| [
11748,
269,
85,
17,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198
] | 2.034483 | 29 |
# -*- coding: utf-8 -*-
from scrapy import Request
from scrapy.spiders import Spider
from one.items import OneQuoteItem
from one.items import OneArticleItem
from one.items import OneQuestionItem
import re
class QuoteSpider(Spider):
""" 「ONE · 一个」 每日一句、每日一图爬虫
每日一句: 爬取的内容有期号、句子、发布日期
每日一图: ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
6738,
15881,
88,
1330,
19390,
201,
198,
6738,
15881,
88,
13,
2777,
4157,
1330,
12648,
201,
198,
201,
198,
6738,
530,
13,
23814,
1330,
1881,
25178,
7449,
201,
198,
... | 1.3163 | 1,546 |
# Tests Python 3.5+'s ops
# BINARY_MATRIX_MULTIPLY and INPLACE_MATRIX_MULTIPLY
# code taken from pycdc tests/35_matrix_mult_oper.pyc.src
m = [1, 2] @ [3, 4]
m @= [5, 6]
| [
2,
30307,
11361,
513,
13,
20,
10,
6,
82,
39628,
198,
198,
2,
347,
1268,
13153,
62,
41636,
7112,
55,
62,
44,
16724,
4061,
11319,
290,
3268,
6489,
11598,
62,
41636,
7112,
55,
62,
44,
16724,
4061,
11319,
198,
2,
2438,
2077,
422,
1297... | 1.988372 | 86 |
#! ../env/bin/python
# -*- coding: utf-8 -*-
from mypackage import myapp | [
2,
0,
11485,
14,
24330,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
616,
26495,
1330,
616,
1324
] | 2.4 | 30 |
from rest_framework import serializers
from cyder.api.v1.endpoints.api import CommonAPINestedAVSerializer
from cyder.api.v1.endpoints.dhcp import api
from cyder.cydhcp.site.models import Site, SiteAV
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
3075,
1082,
13,
15042,
13,
85,
16,
13,
437,
13033,
13,
15042,
1330,
8070,
2969,
1268,
7287,
10116,
32634,
7509,
198,
6738,
3075,
1082,
13,
15042,
13,
85,
16,
13,
437,
13033,
... | 3.074627 | 67 |
from builtins import str
from builtins import range
import os
import sys
from common.vrouter.base import BaseVrouterTest
from time import sleep
from tcutils.util import retry
sys.path.append(os.path.realpath('tcutils/pkgs/Traffic'))
from traffic.core.stream import Stream
from traffic.core.helpers import Host, Sender, R... | [
6738,
3170,
1040,
1330,
965,
198,
6738,
3170,
1040,
1330,
2837,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
2219,
13,
85,
472,
353,
13,
8692,
1330,
7308,
53,
472,
353,
14402,
198,
6738,
640,
1330,
3993,
198,
6738,
256,
8968,
4487... | 2.838298 | 235 |
"""Example on using shodan api, requires shodan api key."""
# Author: James Campbell
# Date: June 23rd 2016
# Date Updated: 3 July 2019
# What: Shodan example
from configs import globalshodankey # have a configs.py file with shodan api key
import shodan
shodan_api_key = globalshodankey # set in configs.py
try:
a... | [
37811,
16281,
319,
1262,
427,
45561,
40391,
11,
4433,
427,
45561,
40391,
1994,
526,
15931,
198,
2,
6434,
25,
3700,
14327,
198,
2,
7536,
25,
2795,
2242,
4372,
1584,
198,
2,
7536,
19433,
25,
513,
2901,
13130,
198,
2,
1867,
25,
911,
45... | 2.803089 | 259 |
import copy
from collections import OrderedDict, namedtuple
from typing import Dict, List
from influxdb.resultset import ResultSet
from influxpy.client import client_wrapper
from influxpy.compiler import InfluxCompiler
from influxpy.aggregates import BaseAggregate
from influxpy.fields import BaseDuration
from influxp... | [
11748,
4866,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
11,
3706,
83,
29291,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
198,
198,
6738,
25065,
9945,
13,
20274,
2617,
1330,
25414,
7248,
198,
198,
6738,
25065,
9078,
13,
16366,
1330,
... | 2.443882 | 1,185 |
#! /bin/env python
# encoding=utf-8
#
#############################################################################
#
# Copyright (c) 2019 Baidu.com, Inc. All Rights Reserved
#
############################################################################
"""
Specify the brief kvdict.py
Author: map(zhuoan@baidu.c... | [
2,
0,
1220,
8800,
14,
24330,
21015,
198,
2,
21004,
28,
40477,
12,
23,
198,
2,
220,
198,
29113,
29113,
7804,
4242,
2,
198,
1303,
220,
198,
1303,
15069,
357,
66,
8,
13130,
347,
1698,
84,
13,
785,
11,
3457,
13,
1439,
6923,
33876,
1... | 2.17313 | 722 |
t = int(input())
for _ in range(t):
n = int(input())
i = 1
while True:
b = int(bin(i)[2:]) * 9 # [2:] - remove leading 0b
i += 1
if b % n == 0:
print(b)
break
| [
83,
796,
493,
7,
15414,
28955,
201,
198,
201,
198,
1640,
4808,
287,
2837,
7,
83,
2599,
201,
198,
220,
220,
220,
299,
796,
493,
7,
15414,
28955,
201,
198,
201,
198,
220,
220,
220,
1312,
796,
352,
201,
198,
201,
198,
220,
220,
220... | 1.655172 | 145 |
from __future__ import print_function
from skimage.segmentation import random_walker_segmentation
from skimage.segmentation import random_walker
import numpy as np
import nibabel as nib
import pydicom
from skimage import io
from skimage.external.tifffile import imshow
from skimage.transform import resize
from matplotli... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
1341,
9060,
13,
325,
5154,
341,
1330,
4738,
62,
20783,
62,
325,
5154,
341,
198,
6738,
1341,
9060,
13,
325,
5154,
341,
1330,
4738,
62,
20783,
198,
11748,
299,
32152,
355,
45941,... | 2.318853 | 1,151 |
'''Store default parameters for game mechanics'''
import os
import random
import pathlib
path = pathlib.Path(__file__).parent.absolute()
import barnum
import pyfiglet
random.seed(12345)
poss_teams = [barnum.create_city_state_zip()[1] for i in range(16)][:16]
save_dir = '{0}/../data/games/'.format(path)
welcome_mes... | [
7061,
6,
22658,
4277,
10007,
329,
983,
12933,
7061,
6,
198,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
3108,
8019,
198,
6978,
796,
3108,
8019,
13,
15235,
7,
834,
7753,
834,
737,
8000,
13,
48546,
3419,
198,
198,
11748,
25203,
388... | 2.134236 | 812 |
###########################
# Keras-related functions #
###########################
import keras
from keras import Model as KerasModel
from keras import backend as K
from keras.layers import Input, Dense, Lambda, Dropout, BatchNormalization
from keras.layers import Layer
from keras import layers
from keras.regularizer... | [
14468,
7804,
21017,
198,
2,
17337,
292,
12,
5363,
5499,
1303,
198,
14468,
7804,
21017,
198,
198,
11748,
41927,
292,
198,
6738,
41927,
292,
1330,
9104,
355,
17337,
292,
17633,
198,
6738,
41927,
292,
1330,
30203,
355,
509,
198,
6738,
4192... | 2.263951 | 2,921 |
#
# @lc app=leetcode id=323 lang=python3
#
# [323] Number of Connected Components in an Undirected Graph
#
#
# Given n nodes labeled from 0 to n - 1 and a list of undirected edges
# (each edge is a pair of nodes), write a function to find the number of
# connected components in an undirected graph.
#
# Example 1:
#
# I... | [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
4686,
28,
32637,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
32637,
60,
7913,
286,
8113,
276,
36109,
287,
281,
13794,
1060,
276,
29681,
198,
2,
198,
2,
198,
2,
11259,
299,
13760,
1... | 2.320113 | 353 |
__author__ = "Toure Dunnon"
__license__ = "Apache License 2.0"
__version__ = "0.1"
__email__ = "toure@redhat.com"
__status__ = "Alpha"
"""
This will be the standard location for all test that are separated via component name, which will allow
for flexible test execution, instead of a all or nothing approach.
"""
import... | [
834,
9800,
834,
796,
366,
51,
280,
260,
5648,
13159,
1,
198,
834,
43085,
834,
796,
366,
25189,
4891,
13789,
362,
13,
15,
1,
198,
834,
9641,
834,
796,
366,
15,
13,
16,
1,
198,
834,
12888,
834,
796,
366,
83,
280,
260,
31,
445,
5... | 2.971564 | 211 |
import cv2
img = cv2.imread('test.jpg')
cv2.imshow('sample image',img)
cv2.waitKey(0)
cv2.destroyAllWindows() | [
11748,
269,
85,
17,
198,
220,
198,
9600,
796,
269,
85,
17,
13,
320,
961,
10786,
9288,
13,
9479,
11537,
198,
220,
198,
33967,
17,
13,
320,
12860,
10786,
39873,
2939,
3256,
9600,
8,
198,
220,
198,
33967,
17,
13,
17077,
9218,
7,
15,
... | 2.169811 | 53 |
# coding: utf-8
from django import forms
from django.utils.translation import ugettext_lazy as _
from urlparse import urlparse
from .models import FlickrLink
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
19016,
29572,
1330,
19016,
29572,
198,
6738,
764,
27530,
1... | 3.533333 | 45 |
# "How" an Edge object is to be printed
if __name__ == "__main__":
g = FlowNetwork()
g.add_vertex('0')
g.add_vertex('1')
g.add_vertex('2')
g.add_vertex('3')
g.add_vertex('4')
g.add_vertex('5')
g.add_edge('0', '1', 16)
g.add_edge('0', '2', 13)
g.add_edge('1', '2', 10)
... | [
198,
220,
220,
220,
1303,
366,
2437,
1,
281,
13113,
2134,
318,
284,
307,
10398,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
308,
796,
27782,
26245,
3419,
198,
220,
220,
220,
308,
13,
... | 1.779197 | 548 |
"""
CutBlur
Copyright 2020-present NAVER corp.
MIT license
"""
import importlib
import json
import os
import torch
import utils
from option import get_option
from solver import Solver
if __name__ == "__main__":
main()
| [
37811,
198,
26254,
3629,
333,
198,
15269,
12131,
12,
25579,
11746,
5959,
24614,
13,
198,
36393,
5964,
198,
37811,
198,
11748,
1330,
8019,
198,
11748,
33918,
198,
11748,
28686,
198,
198,
11748,
28034,
198,
198,
11748,
3384,
4487,
198,
6738... | 3.183099 | 71 |
# ----------------------------------------------------------------------------
# Copyright (c) 2017-, LabControl development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -------------------------------------------------... | [
2,
16529,
10541,
198,
2,
15069,
357,
66,
8,
2177,
20995,
3498,
15988,
2478,
1074,
13,
198,
2,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347,
10305,
13789,
13,
198,
2,
198,
2,
383,
1336,
5964,
318,
287,
262,
2393,
38559,... | 4.688525 | 122 |
# 0-1 KnapSack Problem using DP
print(Knapsack(456, [10, 20, 30, 50, 100, 150, 200, 300, 455, 456, 456], [60, 100, 120, 32, 434, 43, 657, 213, 43, 65, 75432], 11)) | [
2,
657,
12,
16,
6102,
499,
50,
441,
20647,
1262,
27704,
628,
198,
4798,
7,
25095,
1686,
441,
7,
29228,
11,
685,
940,
11,
1160,
11,
1542,
11,
2026,
11,
1802,
11,
6640,
11,
939,
11,
5867,
11,
46839,
11,
604,
3980,
11,
604,
3980,
... | 2.2 | 75 |
import unittest
import ray
import ray.rllib.agents.dqn as dqn
from ray.rllib.utils.framework import try_import_tf, try_import_torch
from ray.rllib.utils.test_utils import (
check_compute_single_action,
check_train_results,
framework_iterator,
)
tf1, tf, tfv = try_import_tf()
torch, nn = try_import_torch()... | [
11748,
555,
715,
395,
198,
198,
11748,
26842,
198,
11748,
26842,
13,
81,
297,
571,
13,
49638,
13,
49506,
77,
355,
288,
80,
77,
198,
6738,
26842,
13,
81,
297,
571,
13,
26791,
13,
30604,
1330,
1949,
62,
11748,
62,
27110,
11,
1949,
6... | 2.451429 | 175 |
#!/usr/bin/env python3
import random
import unittest
from util.challenges.array_challenges import get_missing_value
if __name__ == '__main__':
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
4738,
198,
11748,
555,
715,
395,
198,
198,
6738,
7736,
13,
36747,
34120,
13,
18747,
62,
36747,
34120,
1330,
651,
62,
45688,
62,
8367,
628,
198,
361,
11593,
3672,
834,
... | 2.894737 | 57 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
| [
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,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
198,
11748,
42625,
14208,
13,
7295,
13,
1... | 2.978261 | 46 |
n = int(input())
new = 0
proof = False
for x in range(1, n + 1):
for y in range(1, x + 1):
if new >= n:
proof = True
break
new += 1
print(str(new) + " ", end="")
if proof:
break
print() | [
77,
796,
493,
7,
15414,
28955,
198,
3605,
796,
657,
198,
13288,
796,
10352,
198,
198,
1640,
2124,
287,
2837,
7,
16,
11,
299,
1343,
352,
2599,
198,
220,
220,
220,
329,
331,
287,
2837,
7,
16,
11,
2124,
1343,
352,
2599,
628,
220,
2... | 1.882353 | 136 |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | [
2,
198,
2,
770,
2723,
2393,
318,
636,
286,
262,
13113,
11012,
1280,
2723,
1628,
13,
198,
2,
198,
2,
15069,
1584,
12,
25579,
6139,
25896,
3457,
13,
290,
262,
13113,
11012,
7035,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11... | 3.458065 | 310 |
import math
def myfloor(number: float) -> int:
"""We take as input a real number and give as output the greatest integer less than or equal to the number
>>> myfloor(2.4)
2
>>> myfloor(2)
2
>>> myfloor(2.0)
2
>>> myfloor(-3.1)
-4
"""
#if number >= 0:
# return int(n... | [
11748,
10688,
198,
198,
4299,
616,
28300,
7,
17618,
25,
12178,
8,
4613,
493,
25,
198,
220,
220,
220,
37227,
1135,
1011,
355,
5128,
257,
1103,
1271,
290,
1577,
355,
5072,
262,
6000,
18253,
1342,
621,
393,
4961,
284,
262,
1271,
220,
6... | 2.324153 | 472 |
from __future__ import annotations
import copy
import json
import dataclasses
import pathlib
from hashlib import sha256
from io import TextIOWrapper
from typing import Optional, List, Dict, cast, Union, Any
import atomicwrites
import toml
from toml.decoder import TomlDecodeError
from ..semver import VersionConstraint... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
11748,
4866,
198,
11748,
33918,
198,
11748,
4818,
330,
28958,
198,
11748,
3108,
8019,
198,
6738,
12234,
8019,
1330,
427,
64,
11645,
198,
6738,
33245,
1330,
8255,
40,
3913,
430,
2848,
198,
6738,
... | 2.518102 | 1,602 |
import logging
from sqlalchemy import create_engine, Column, String, Integer, DateTime,\
ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
Base = declarative_base()
engine = create_engine("sqlite:///db.sqlite")
session_factory = sessionmaker... | [
11748,
18931,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
11,
29201,
11,
10903,
11,
34142,
11,
7536,
7575,
11,
59,
198,
220,
220,
220,
8708,
9218,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
... | 2.80198 | 202 |
# %% [markdown]
# LINEトークを解析してみよう!
# Pythonian 20-08-29
# %%
# ======================================
# ライブラリ
# ======================================
import codecs
import re
import datetime
from time import strftime, gmtime
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as... | [
2,
43313,
685,
4102,
2902,
60,
198,
2,
48920,
13298,
42869,
31758,
164,
100,
96,
162,
252,
238,
22180,
28134,
2515,
123,
1792,
230,
29557,
171,
120,
223,
198,
2,
11361,
666,
1160,
12,
2919,
12,
1959,
198,
198,
2,
43313,
198,
2,
46... | 1.671341 | 9,128 |
# This python script will take care of anything
# required during building the images. It is
# used by Makefile.
import random
import re
import sys
if __name__ == '__main__':
arguments = sys.argv[1:]
if 'get-secret-key' in arguments:
get_secret_key()
if 'change-secret-key' in arguments:
... | [
2,
770,
21015,
4226,
481,
1011,
1337,
286,
1997,
198,
2,
2672,
1141,
2615,
262,
4263,
13,
632,
318,
198,
2,
973,
416,
6889,
7753,
13,
198,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
25064,
628,
628,
198,
361,
11593,
3672,
834,
... | 2.676136 | 176 |
"""
Defines python classes for the database.
Defines a score function for the bridge game.
"""
from . import db
from flask_login import UserMixin
# Class containing a game, a game contains both rounds and players through a class-relationship
# Class containing a round of a game
# Class which will contain the pla... | [
37811,
198,
7469,
1127,
21015,
6097,
329,
262,
6831,
13,
198,
7469,
1127,
257,
4776,
2163,
329,
262,
7696,
983,
13,
198,
37811,
198,
198,
6738,
764,
1330,
20613,
198,
6738,
42903,
62,
38235,
1330,
11787,
35608,
259,
628,
198,
2,
5016,... | 4.093458 | 107 |
import numpy as np
import tensorflow.keras.backend as K
import tensorflow as tf
from scipy.spatial.distance import cdist
def dice_coefficient(u,v):
"""
For binary vectors the Dice cooefficient can be written as
2 * |u * v| / (|u**2| + |v**2|)
| u * v | gives intersecting set
|u**2|, |v**2| number ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
13,
6122,
292,
13,
1891,
437,
355,
509,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
629,
541,
88,
13,
2777,
34961,
13,
30246,
1330,
269,
17080,
198,
198,
4299,
17... | 2.473623 | 853 |
from timeit import default_timer as timer
import numpy as np
import pandas as pd
from math import isnan
from sklearn import preprocessing
from sklearn.impute import KNNImputer, SimpleImputer
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline impor... | [
6738,
640,
270,
1330,
4277,
62,
45016,
355,
19781,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
10688,
1330,
2125,
272,
198,
6738,
1341,
35720,
1330,
662,
36948,
198,
6738,
1341,
35720,
13,
11011,... | 3.793103 | 145 |
"""
Unit tests for txtulip.
"""
| [
37811,
198,
26453,
5254,
329,
256,
742,
377,
541,
13,
198,
37811,
198
] | 2.461538 | 13 |
#!/usr/bin/env python
from bs4 import BeautifulSoup, Tag
import copy
from fuzzywuzzy import fuzz
from jinja2 import Template
import json
from html2text import html2text
import os
import re
import tempfile
from le_utils.constants import content_kinds, exercises, file_types, licenses
from le_utils.constants.languages ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
11,
17467,
198,
11748,
4866,
198,
6738,
34669,
86,
4715,
88,
1330,
26080,
198,
6738,
474,
259,
6592,
17,
1330,
37350,
198,
11748,
33918,
198,... | 2.185995 | 8,597 |
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from linkcheck.utils import check_links
from linkcheck.linkcheck_settings import RECHECK_INTERVAL
from linkcheck.linkcheck_settings import MAX_CHECKS_PER_RUN | [
6738,
2172,
29572,
1330,
787,
62,
18076,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
11,
9455,
12331,
198,
198,
6738,
2792,
9122,
13,
26791,
1330,
2198,
62,
28751,
198,
6738,
2792,
9122,
13,
8726,
9122,
... | 3.724638 | 69 |
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
#l1 = [4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]
#l1 = [20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50]
l1 = [4,6,8,10,12,14]
'''
step = 5
num = 10
l1 = []
for x in range(num):
l1.append((x*step))
print(l1)
'''
a = [
('solid', 'solid'), ... | [
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
628,
198,
2,
75,
16,
796,
685,
19,
11,
20,
11,
21,
11,
22,
11,
23,
11,
24,
11,
940,
11,
1157,
11,
1065,
... | 1.996134 | 3,363 |
from setuptools import setup, Extension
setup(name='goldenrecord',
version='0.1',
ext_modules=[Extension('_goldenrecord', sources=['Aggregator.cc', 'CSVReader.cc', 'Reader.cc', 'Rules.cc', 'Synthesize.cc', 'Table.cc', 'Wrapper.cc', 'Consolidation.cc', 'goldenrecord.i'],
swig_opts=['-c++', '-py3'], e... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
27995,
198,
40406,
7,
3672,
11639,
24267,
268,
22105,
3256,
198,
220,
220,
220,
220,
220,
2196,
11639,
15,
13,
16,
3256,
198,
220,
220,
220,
220,
220,
1070,
62,
18170,
41888,
11627,
3004,
10786... | 2.208202 | 317 |
# CPU: 0.06 s
cipher = input()
key = input()
plain = ""
for idx in range(len(cipher)):
cord = ord(cipher[idx]) - 65
kord = ord(key[idx]) - 65
pchar = chr(65 + (cord - kord) % 26)
plain += pchar
key += pchar
print(plain)
| [
2,
9135,
25,
657,
13,
3312,
264,
198,
66,
10803,
796,
5128,
3419,
198,
2539,
796,
5128,
3419,
198,
198,
25638,
796,
13538,
198,
1640,
4686,
87,
287,
2837,
7,
11925,
7,
66,
10803,
8,
2599,
198,
220,
220,
220,
15050,
796,
2760,
7,
... | 2.151786 | 112 |
# -*- coding: utf-8 -*-
# TDot (c) Ian Dennis Miller
from setuptools import setup
version = '0.1'
setup(version=version,
name='blackboard-scantron-bridge',
description="BSB makes it easy to transfer Scantron scores into a Blackboard grades database.",
packages=[
"bsb",
],
scripts=[
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
13320,
313,
357,
66,
8,
12930,
16902,
7920,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
9641,
796,
705,
15,
13,
16,
6,
198,
198,
40406,
7,
9641,
28,
... | 2.418546 | 399 |
import pytest
import collections
from glabra import graph
class DirectedGraph(object):
"""A DirectedEdgeGetter implementation only used for testing."""
| [
11748,
12972,
9288,
198,
11748,
17268,
198,
198,
6738,
1278,
397,
430,
1330,
4823,
198,
198,
4871,
4128,
276,
37065,
7,
15252,
2599,
198,
220,
37227,
32,
4128,
276,
37021,
3855,
353,
7822,
691,
973,
329,
4856,
526,
15931,
198
] | 3.9 | 40 |
#%% read in data - use a pandas dataframe just for convenience
import time
import pandas as pd
data = pd.read_table("~/Desktop/Project/data/melbourne_graph.txt",
sep = " ",
header = None,
names = ['vx', 'vy', 'weight'])
# d : landmark number
d = 1000
# degr... | [
2,
16626,
1100,
287,
1366,
532,
779,
257,
19798,
292,
1366,
14535,
655,
329,
15607,
198,
11748,
640,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
7890,
796,
279,
67,
13,
961,
62,
11487,
7203,
93,
14,
36881,
14,
16775,
14,
7890,
... | 2.21097 | 474 |
from .analyse import (calc_volume_closed, create_slices, calc_perimeter, calc_widths, calc_csa, est_volume,
visualise_slices, plot_slices, MeasurementsOut, CMapOut)
from .output import getPDF, generateRegBinsCsv, generateRegCsv
del analyse, output | [
6738,
764,
38200,
325,
1330,
357,
9948,
66,
62,
29048,
62,
20225,
11,
2251,
62,
82,
677,
274,
11,
42302,
62,
525,
16912,
11,
42302,
62,
10394,
82,
11,
42302,
62,
6359,
64,
11,
1556,
62,
29048,
11,
220,
198,
220,
220,
220,
220,
2... | 2.53271 | 107 |
# -*- coding: utf-8 -*-
import os,sys
import wsgiref.handlers
from django.conf import settings
settings._target = None
from django.utils import simplejson
from django.utils.translation import ugettext as _
import base,theme,utils
from model import *
from cache import *
##from app.pingback import autoPingbac... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
11748,
28686,
11,
17597,
201,
198,
11748,
266,
45213,
557,
69,
13,
4993,
8116,
201,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
201,
198,
33692,
13557,
16793,
7... | 2.105542 | 1,696 |
"""
Send a user's available teams mining
"""
from src.common.logger import logger
from src.common.txLogger import txLogger, logTx
from src.helpers.instantMessage import sendIM
from src.common.clients import makeCrabadaWeb3Client
from src.helpers.teams import fetchAvailableTeamsForTask
from src.models.User import User
... | [
37811,
198,
25206,
257,
2836,
338,
1695,
3466,
9691,
198,
37811,
198,
198,
6738,
12351,
13,
11321,
13,
6404,
1362,
1330,
49706,
198,
6738,
12351,
13,
11321,
13,
17602,
11187,
1362,
1330,
27765,
11187,
1362,
11,
2604,
46047,
198,
6738,
1... | 2.385354 | 833 |
# -*- coding: utf-8 -*-
# https://steem.esteem.ws/ + Interactive Steem API
# https://www.steem.center/index.php?title=Public_Websocket_Servers + Public Websocket Servers
# https://geo.steem.pl/ + Steem API nodes ordered from the nearest to farthest
# https://developers.steem.io/apidefinitions... | [
171,
119,
123,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
3740,
1378,
4169,
368,
13,
31869,
13,
18504,
14,
197,
197,
197,
197,
197,
197,
197,
197,
197,
197,
197,
197,
10,
21365,
2441,
368,
7824,
198,
... | 1.861207 | 2,320 |
# -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2007-2015, Isis Lovecruft
# :license: see LICENSE for licensing in... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
10290,
11012,
11,
257,
4022,
7696,
6082,
1080,
13,
198,
2,
198,
2,
1058,
41617,
25,
16530,
5896,
32838,
701,
1279,
271,
271,
31,... | 2.322654 | 1,311 |
#!/usr/bin/env python3
# Start the main program
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
7253,
262,
1388,
1430,
198,
12417,
3419,
198
] | 2.8 | 20 |
import sys
import my_map
import my_reduce
key_value = dict()
for filename in ['data_2010.txt', 'data_2011.txt', 'data_2012.txt', 'data_2013.txt', 'data_2014.txt', 'data_2015.txt']:
in_file = open(filename, 'r')
key_value_per_file = my_map.my_map(in_file)
for key in key_value_per_file:
if(key in key... | [
11748,
25064,
198,
11748,
616,
62,
8899,
198,
11748,
616,
62,
445,
7234,
198,
198,
2539,
62,
8367,
796,
8633,
3419,
198,
1640,
29472,
287,
37250,
7890,
62,
10333,
13,
14116,
3256,
705,
7890,
62,
9804,
13,
14116,
3256,
705,
7890,
62,
... | 2.238095 | 273 |
from pysnmp.entity.rfc3413.oneliner import cmdgen
| [
6738,
279,
893,
77,
3149,
13,
26858,
13,
81,
16072,
2682,
1485,
13,
26261,
7274,
1330,
23991,
5235,
628,
198
] | 2.6 | 20 |
import unittest
import constants
from gtfspy import TransitData, clone_transit_data, create_partial_transit_data, load_partial_transit_data
from test_utils.create_gtfs_object import create_full_transit_data
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
11748,
38491,
198,
6738,
308,
27110,
2777,
88,
1330,
22325,
6601,
11,
17271,
62,
7645,
270,
62,
7890,
11,
2251,
62,
47172,
62,
7645,
270,
62,
7890,
11,
3440,
62,
47172,
62,
7645,
270,
62,
7890,
198,
... | 2.965517 | 87 |
import pandas as pd
import numpy as np
import CommonFunctions as cf
import re
RAW_FILE_NAME = 'RawData/fantasypros_2018_Draft_Overall_Rankings.csv'
DATA_FILE_NAME = 'Data/fpRanks.csv'
if __name__ == "__main__": make_data()
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
8070,
24629,
2733,
355,
30218,
198,
11748,
302,
198,
198,
20530,
62,
25664,
62,
20608,
796,
705,
27369,
6601,
14,
69,
34921,
1676,
82,
62,
7908,
62,
3774... | 2.714286 | 84 |
from oscar.core.application import OscarConfig
| [
6738,
267,
13034,
13,
7295,
13,
31438,
1330,
15694,
16934,
628
] | 4.363636 | 11 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import torch
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28034,
220,
198
] | 2.137931 | 29 |
from psd_tools import PSDImage
psd_path = r'E:\develop_space\blender\scripts\bl_layers_image\test\test.psd'
test_psd_to_bl_image()
test_layer_to_bl_image()
test_layers_to_bl_image() | [
6738,
279,
21282,
62,
31391,
1330,
6599,
35,
5159,
198,
862,
67,
62,
6978,
796,
374,
6,
36,
7479,
16244,
62,
13200,
59,
2436,
2194,
59,
46521,
59,
2436,
62,
75,
6962,
62,
9060,
59,
9288,
59,
9288,
13,
862,
67,
6,
198,
198,
9288,... | 2.333333 | 78 |
# -*- coding: utf-8 -*-
from abc import ABC
from pathlib import Path
import pandas as pd
import scrapy
import base64
import itertools
from settings import YEAR, CRAWLING_OUTPUT_FOLDER
from src.crawl.utils import cleanup
BASE_URL = "https://www.einet.be/ficheueprintable.php?code={}" + \
f"&anneeaca={YEAR}_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
450,
66,
1330,
9738,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
15881,
88,
198,
11748,
2779,
2414,
198,
11748,
340,... | 1.818662 | 568 |
import discord
from discord.ext import commands
from Tools.utils import getConfig, getGuildPrefix, updateConfig
from datetime import datetime
from Tools.logMessage import sendLogMessage
| [
11748,
36446,
201,
198,
6738,
36446,
13,
2302,
1330,
9729,
201,
198,
6738,
20003,
13,
26791,
1330,
651,
16934,
11,
651,
38,
3547,
36698,
844,
11,
4296,
16934,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
6738,
20003,
13,
64... | 3.088235 | 68 |
from django.test.client import RequestFactory
from open_facebook.api import OpenFacebook, FacebookAuthorization
from django.core.handlers.base import BaseHandler
class RequestMock(RequestFactory):
'''
Didn't see another solution for this. Decided to read some snippets
and modded them into the requestfact... | [
6738,
42625,
14208,
13,
9288,
13,
16366,
1330,
19390,
22810,
198,
6738,
1280,
62,
19024,
13,
15042,
1330,
4946,
12025,
11,
3203,
13838,
1634,
198,
6738,
42625,
14208,
13,
7295,
13,
4993,
8116,
13,
8692,
1330,
7308,
25060,
628,
198,
4871... | 2.77381 | 336 |
import plone.api
from DateTime import DateTime
from OFS.ObjectManager import ObjectManager
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from ZODB.blob import Blob
from zope.interface.declarations import implementer
from .interfaces import ITrashedItem
@implementer(ITrashedItem)
| [
11748,
458,
505,
13,
15042,
201,
198,
6738,
7536,
7575,
1330,
7536,
7575,
201,
198,
6738,
3963,
50,
13,
10267,
13511,
1330,
9515,
13511,
201,
198,
6738,
18675,
13,
9876,
12966,
17041,
13,
9876,
30800,
8979,
1330,
7873,
30800,
8979,
201,... | 3.302083 | 96 |
from collections import deque
import pickle
import numpy as np
from mpi4py import MPI
class RolloutWorker:
"""Rollout worker generates experience by interacting with one or many environments.
Args:
make_env (function): a factory function that creates a new instance of the environment
when ... | [
6738,
17268,
1330,
390,
4188,
198,
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
285,
14415,
19,
9078,
1330,
4904,
40,
198,
198,
4871,
8299,
448,
12468,
263,
25,
198,
220,
220,
220,
37227,
26869,
448,
8383,
18616,
1... | 1.987946 | 2,074 |
import os
import ROOT as r
import numpy as np
from mods import configuration as config
##################################################
# Classes
##################################################
class TreeProcess:
""" For analysing .root samples """
def addBranch(self, ldmx_class, branch_name):
... | [
11748,
28686,
198,
11748,
15107,
2394,
355,
374,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
13743,
1330,
8398,
355,
4566,
198,
198,
29113,
14468,
2235,
198,
2,
38884,
198,
29113,
14468,
2235,
198,
198,
4871,
12200,
18709,
25,
628,
2... | 2.24098 | 2,245 |
""" Database Configuration for TuneCapsule
Copyright (c) 2021 IdmFoundInHim, under MIT License
"""
__all__ = ["initialize_database"]
import os
import sqlite3
from ._constants import DB_DIRECTORY, DB_LOCATION
| [
37811,
24047,
28373,
329,
42587,
34,
1686,
2261,
198,
198,
15269,
357,
66,
8,
33448,
5121,
76,
21077,
818,
39,
320,
11,
739,
17168,
13789,
198,
37811,
198,
834,
439,
834,
796,
14631,
36733,
1096,
62,
48806,
8973,
198,
198,
11748,
2868... | 3.261538 | 65 |
import re
import slugify
UPPERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽƁƂƄƆƇƉƊƋƎƏƐƑƓƔƖƗƘƜƝƟƠƢƤƦƧƩƬƮƯƱƲƳƵƷƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶǷǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺȻȽȾɁɃɄɅɆɈɊɌɎͰͲͶͿΆΈΉΊΌΎΏΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΪΫϏϒϓϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹϺϽϾϿЀЁ... | [
11748,
302,
198,
11748,
31065,
1958,
198,
198,
8577,
47,
4877,
796,
366,
24694,
32988,
17511,
23852,
42,
31288,
45,
3185,
48,
49,
2257,
52,
30133,
34278,
57,
127,
222,
127,
223,
5523,
5746,
127,
226,
127,
227,
127,
228,
127,
229,
12... | 0.487395 | 6,902 |
from CMDParser import CMDParser
import unittest
if __name__ == '__main__':
unittest.main()
| [
6738,
16477,
6322,
28198,
1330,
16477,
6322,
28198,
198,
11748,
555,
715,
395,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
628
] | 2.694444 | 36 |