content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
# coding: utf-8
from __future__ import unicode_literals
import factory
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
8860,
628
] | 3.173913 | 23 |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
def GetRGBColor(colorName):
'''
Return the red, green and blue components for a
color as doubles.
'''
rgb = [0.0, 0.0, 0.0] # black
vtk.vt... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
11748,
410,
30488,
201,
198,
6738,
410,
30488,
13,
9288,
1330,
23983,
201,
198,
6738,
410,
30488,
13,
22602,
13,
44374,
1330,
410,
30488,
3855,
6601,
30016,
201,
198,
36392,
42,
6... | 2.311701 | 2,111 |
#!/usr/bin/env python3
import pandas as pd
# import numpy as np
from sklearn import (svm, preprocessing)
from sklearn.model_selection import train_test_split, KFold
from sklearn.metrics import (recall_score, precision_score, accuracy_score, confusion_matrix,)
#precision_recall_curve,auc,roc_auc_score,roc_curve,recall_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
2,
1330,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
1330,
357,
82,
14761,
11,
662,
36948,
8,
198,
6738,
1341,
35720,
13,
19849,
62... | 2.92891 | 211 |
#!/usr/bin/python -tt
"""NetMagis DB helper."""
import psycopg2
import netspot_settings
def main():
"""Main."""
pass
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
532,
926,
198,
198,
37811,
7934,
13436,
271,
20137,
31904,
526,
15931,
198,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
31720,
13059,
62,
33692,
198,
198,
4299,
1388,
33529,
198,
220,
37227,
13383... | 2.555556 | 63 |
from os.path import dirname, join
ROOT = dirname(dirname(__file__))
DATA = join(ROOT, 'data')
TRAIN_DATA = join(DATA, 'sst2', 'stsa.binary.phrases.train')
VALIDATION_DATA = join(DATA, 'sst2', 'stsa.binary.dev')
TEST_DATA = join(DATA, 'sst2', 'stsa.binary.test')
PRETRAINED_EMBEDDINGS_FILE = join(DATA, 'GoogleNews-vecto... | [
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
4654,
198,
198,
13252,
2394,
796,
26672,
3672,
7,
15908,
3672,
7,
834,
7753,
834,
4008,
198,
26947,
796,
4654,
7,
13252,
2394,
11,
705,
7890,
11537,
198,
51,
3861,
1268,
62,
26947,
796,
... | 2.298387 | 248 |
"""
# coding:utf-8
@Time : 2021/12/06
@Author : jiangwei
@File : decorators.py
@Desc : decorators
@email : qq804022023@gmail.com
@Software: PyCharm
"""
from flask import request, jsonify
from bbs.setting import basedir
import os
from functools import wraps
def track_error(func):
"""
track running ... | [
37811,
198,
2,
19617,
25,
40477,
12,
23,
198,
31,
7575,
220,
220,
220,
1058,
33448,
14,
1065,
14,
3312,
198,
31,
13838,
220,
1058,
474,
15483,
42990,
198,
31,
8979,
220,
220,
220,
1058,
11705,
2024,
13,
9078,
198,
31,
24564,
220,
... | 2.838095 | 210 |
# ----------------------------------------------------------
# --- Quick 'n' dirty CFF file extractor
#
# File: extract-sfc.py
# Author: Jille
# Revision: 1
# Purpose: MIB2 sfc file exporter
# Comments: Usage: extract-sfc.py <filename> <outdir>
# Changelog: First version
# -------------------... | [
2,
20368,
22369,
438,
198,
2,
11420,
12029,
705,
77,
6,
11841,
327,
5777,
2393,
7925,
273,
198,
2,
198,
2,
9220,
25,
220,
220,
220,
220,
220,
220,
220,
220,
197,
2302,
974,
12,
82,
16072,
13,
9078,
198,
2,
6434,
25,
220,
220,
... | 2.483193 | 952 |
"""Module contains superclass for parsers."""
from abc import ABC, abstractmethod
from datetime import date, timedelta
from html_table_extractor.extractor import Extractor
from lxml.html import tostring
| [
37811,
26796,
4909,
2208,
4871,
329,
13544,
364,
526,
15931,
198,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
4818,
8079,
1330,
3128,
11,
28805,
12514,
198,
6738,
27711,
62,
11487,
62,
2302,
40450,
13,
2302,
40450,
1330... | 3.867925 | 53 |
import json
import logging
import os
from bd2k.util.strings import interpolate as fmt
from fabric.operations import run
from cgcloud.core.box import Box
from cgcloud.fabric.operations import sudo
log = logging.getLogger( __name__ )
| [
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
6738,
275,
67,
17,
74,
13,
22602,
13,
37336,
1330,
39555,
378,
355,
46996,
198,
6738,
9664,
13,
3575,
602,
1330,
1057,
198,
198,
6738,
269,
70,
17721,
13,
7295,
13,
3524,
... | 3.277778 | 72 |
from pytestqt import qtbot
import pytest
import os
| [
6738,
12972,
9288,
39568,
1330,
10662,
83,
13645,
198,
11748,
12972,
9288,
198,
11748,
28686,
628,
198
] | 3.117647 | 17 |
# coding=utf-8
from st2common import log as logging
from st2common.runners.base_action import Action
from powerdns.exceptions import PDNSCanonicalError, PDNSError
import powerdns
__all__ = ["PowerDNSClient"]
LOG = logging.getLogger(__name__)
| [
2,
19617,
28,
40477,
12,
23,
198,
6738,
336,
17,
11321,
1330,
2604,
355,
18931,
198,
6738,
336,
17,
11321,
13,
36740,
13,
8692,
62,
2673,
1330,
7561,
198,
6738,
1176,
67,
5907,
13,
1069,
11755,
1330,
14340,
8035,
6090,
261,
605,
123... | 3 | 82 |
a= 10
b= 5
op = "/"
if op == "+":
res=a+b
print("Operao Soma, o Resultado foi de:", a ,"+", b ,"=" , res )
if op == "-":
res=a-b
print("Operao Subtrao, o Resultado foi de:", a ,"-", b ,"=" , res )
if op == "/":
res=a/b
print("Operao Subtrao, o Resultado de:", a ,"/", b ,"=" , res )
if op =... | [
198,
64,
28,
838,
220,
198,
65,
28,
642,
198,
404,
796,
12813,
1,
198,
361,
1034,
6624,
43825,
1298,
198,
220,
220,
220,
581,
28,
64,
10,
65,
198,
220,
220,
220,
3601,
7203,
18843,
5488,
311,
6086,
11,
267,
25414,
4533,
11511,
7... | 2.082645 | 242 |
from flask import Flask
from flask import request
from flask import jsonify
from flask_redis import FlaskRedis
app = Flask(__name__)
#provide the redis configuration in the app configs to use this
redis_store = FlaskRedis(app)
if __name__ == '__main__':
app.run()
| [
198,
6738,
42903,
1330,
46947,
220,
198,
6738,
42903,
1330,
2581,
198,
6738,
42903,
1330,
33918,
1958,
628,
198,
198,
6738,
42903,
62,
445,
271,
1330,
46947,
7738,
271,
220,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
... | 3.087912 | 91 |
from autogluon.tabular.models.lr.lr_model import LinearModel
| [
198,
6738,
1960,
49006,
261,
13,
8658,
934,
13,
27530,
13,
14050,
13,
14050,
62,
19849,
1330,
44800,
17633,
628,
628
] | 3.095238 | 21 |
import sqlite3 as sqlite
import os
from Utils import *
iphoneBackupDir = "IphoneBackup"
m_nsAliasName = "wxid_t798rxqmvz7s11"
PARSED_DB_PATH = "DataStore/Contact.db"
PARSED_DATA_CONNECTION = ConnectNonEncryptedDB(PARSED_DB_PATH)
userAlias, userChatEncryption, userDB = GetUpdateContactInfo(PARSED_DATA_CONNECTION, m_ns... | [
11748,
44161,
578,
18,
355,
44161,
578,
198,
11748,
28686,
198,
6738,
7273,
4487,
1330,
1635,
198,
198,
13323,
505,
7282,
929,
35277,
796,
366,
40,
4862,
7282,
929,
1,
198,
76,
62,
5907,
40489,
5376,
796,
366,
49345,
312,
62,
83,
43... | 2.604317 | 139 |
# coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from google.protobuf.json_format import MessageToJson, Parse
from qrl.core import config
from qrl.core.Transaction import StakeTransaction
from qrl.generated ... | [
2,
19617,
28,
40477,
12,
23,
201,
198,
2,
4307,
6169,
739,
262,
17168,
3788,
5964,
11,
766,
262,
19249,
201,
198,
2,
2393,
38559,
24290,
393,
2638,
1378,
2503,
13,
44813,
1668,
13,
2398,
14,
677,
4541,
14,
2781,
12,
43085,
13,
101... | 2.793478 | 276 |
import os
import gym
import numpy as np
| [
11748,
28686,
198,
11748,
11550,
198,
11748,
299,
32152,
355,
45941,
628,
628,
198
] | 3.142857 | 14 |
from setuptools import setup, find_packages
setup(
name='copkmeans',
version='1.5',
description='',
author='',
author_email='',
url='https://github.com/Behrouz-Babaki/COP-Kmeans',
license=license,
packages=find_packages(),
include_package_data=True,
zip_safe=False
)
| [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
22163,
74,
1326,
504,
3256,
198,
220,
220,
220,
2196,
11639,
16,
13,
20,
3256,
198,
220,
220,
220,
6764,
11639,
3256,
198... | 2.425197 | 127 |
"""
Class:
- NameValueObject
Summary:
- It is usually a good idea to replace common primitives, such as strings, with suitable
value objects.
While I can represent a phone number as a string, turning it into a phone number object
makes variables and parameters m... | [
37811,
198,
220,
220,
220,
5016,
25,
198,
220,
220,
220,
220,
220,
220,
220,
532,
6530,
11395,
10267,
628,
220,
220,
220,
21293,
25,
198,
220,
220,
220,
220,
220,
220,
220,
532,
632,
318,
3221,
257,
922,
2126,
284,
6330,
2219,
268... | 3.236994 | 173 |
import pygame
from src.spritesheet import SpriteSheet, balls, blocks, sliders
from src.statemachine import Statemachine
from src.states.gameoverstate import GameOver
from src.states.highscoreState import Highscore
from src.states.levelpassedstate import LevelPassed
from src.states.playstate import Play
from src.states... | [
11748,
12972,
6057,
198,
198,
6738,
12351,
13,
2777,
23156,
25473,
1330,
33132,
3347,
316,
11,
11333,
11,
7021,
11,
1017,
4157,
198,
6738,
12351,
13,
14269,
368,
20480,
1330,
5133,
368,
20480,
198,
6738,
12351,
13,
27219,
13,
6057,
2502... | 2.933868 | 499 |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | [
2,
19617,
28,
40477,
23,
198,
198,
2,
15069,
2864,
28591,
5097,
2606,
35,
13,
9858,
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,
... | 3.73743 | 179 |
# SPDX-FileCopyrightText: Copyright (c) 2022 Alec Delaney
# SPDX-License-Identifier: MIT
"""
`circuitpython_typing.device_drivers`
================================================================================
Type annotation definitions for device drivers. Used for `adafruit_register`.
* Author(s): Alec Delaney
""... | [
2,
30628,
55,
12,
8979,
15269,
8206,
25,
15069,
357,
66,
8,
33160,
38285,
4216,
22297,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
37811,
198,
63,
21170,
5013,
29412,
62,
774,
13886,
13,
25202,
62,
36702,
63,
198,... | 3.632258 | 155 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from ..elements import Attribute
from ..elements.elementbase import LogicElement
from ..tags.context import ContextElementBase, DataSetter
from .. import logic
from ..urlmapper import URLMapper, Missing... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
11485,
68,
3639,
1330,
3460,
4163,
198,
6738,
11485,
68... | 2.159622 | 4,448 |
#!/usr/bin/env python
'''
Environment Node
Author Curt Henrichs
Date 5-16-19
Provides environment context for ITER runner.
'''
# __MODES__ for environment object type
MODE_COLLISION_MOVEIT = 'collision_moveit'
MODE_MARKER = 'marker'
import os
import tf
import yaml
import json
import time
import uuid
import rospy... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
7061,
6,
198,
31441,
19081,
198,
13838,
19569,
6752,
7527,
82,
198,
10430,
642,
12,
1433,
12,
1129,
198,
198,
15946,
1460,
2858,
4732,
329,
314,
5781,
17490,
13,
198,
198,
7061,
... | 3.129231 | 650 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:owefsad
# software: PyCharm
# project: lingzhi-webapi
from rest_framework import serializers
from dongtai.models import User
from dongtai.models.department import Department
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
1772,
25,
322,
891,
82,
324,
198,
2,
3788,
25,
9485,
1925,
1670,
198,
2,
1628,
25,
18459,
89,
5303,
12,
12384,
1504... | 2.911392 | 79 |
#!/usr/bin/env python
'''
Objects for representation of proper nouns used in keywords.
'''
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-branches
# pylint: disable=too-many-instance-attributes
from media.xml.namespaces import Namespaces
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
198,
10267,
82,
329,
10552,
286,
1774,
23227,
82,
973,
287,
26286,
13,
198,
7061,
6,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
18820,
12,
32146,
12,
11377,
12,
24396,
82... | 2.977528 | 89 |
import math
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from events.location import get_client_ip, get_geoip
from events.models import Team
KM_PER_DEGREE_LAT = 110.574
KM_PER_DEGREE_LNG = 111.320 # At the equator
DEFAULT_NEAR_DISTANCE = 100 # kilometeres
| [
11748,
10688,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
2995,
13,
24886,
1330,
651,
62,
16366,
62,
541,
11,
651... | 2.781818 | 110 |
# *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: Tim Meunier
# Description: Unit tests for the perfomer encrypted
# circuit log file parser
# ************************************... | [
2,
41906,
17174,
9,
198,
2,
220,
15069,
2211,
17168,
12406,
18643,
220,
220,
198,
2,
220,
4935,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6226,
1503,
198,
2,
220,
46665,
25,
220,
220,
220,
220,
220,
220,
220,
22... | 2.991379 | 232 |
# -*- coding: utf-8 -*-
"""
tests.unit.runners.test_asam
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the asam runner
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.runners.asam as asam
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41989,
13,
20850,
13,
36740,
13,
9288,
62,
292,
321,
198,
27156,
15116,
8728,
198,
198,
26453,
5254,
329,
262,
355,
321,
17490,
198,
37811,
198,
198,
6738,
... | 3.219697 | 132 |
temps = [221, 233, 132, -9999, 434]
new_temps = [i for i in temps if i != -9999]
print(new_temps) | [
11498,
862,
796,
685,
26115,
11,
30435,
11,
21761,
11,
532,
24214,
11,
604,
2682,
60,
198,
198,
3605,
62,
11498,
862,
796,
685,
72,
329,
1312,
287,
2169,
862,
611,
1312,
14512,
532,
24214,
60,
198,
198,
4798,
7,
3605,
62,
11498,
8... | 2.2 | 45 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import Quandl
setup(name = 'Quandl',
description = 'Package for Quandl API access',
version = Quandl.__version__,
author = ", ".join(Quandl.__authors__),
maintainer = Quandl.__maintainer__,
mai... | [
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
11748,
2264,
392,
75,
198,
198,
40406,
7,
3672,
796,
705,
4507,
3... | 2.288793 | 232 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
383,
7054,... | 3.84739 | 249 |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
from gym import envs
from . import maze2d, puddleworld
| [
2,
15069,
357,
66,
8,
5413,
13,
1439,
2489,
10395,
13,
198,
198,
2,
49962,
739,
262,
17168,
5964,
13,
4091,
38559,
24290,
13,
9132,
2393,
287,
262,
1628,
6808,
198,
2,
329,
1336,
5964,
1321,
13,
198,
2,
38093,
25609,
28,
198,
198,... | 4.741935 | 62 |
from os.path import join as pjoin
# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 0
_version_minor = 9
_version_micro = 8 # use '' for first of series, number for 1 and above
_version_extra = 'dev'
# _version_extra = '' # Uncomment this for full releases
# Construct ful... | [
6738,
28686,
13,
6978,
1330,
4654,
355,
279,
22179,
198,
198,
2,
18980,
2938,
416,
9058,
13,
9078,
290,
2205,
14,
10459,
14,
10414,
13,
9078,
25,
4731,
286,
1296,
366,
55,
13,
56,
13,
57,
1,
198,
62,
9641,
62,
22478,
796,
657,
1... | 2.871823 | 905 |
import torch
import torchvision.utils as vutils
import math
import numpy as np
from survae.distributions import DataParallelDistribution
from survae.utils import elbo_bpd
from .utils import get_args_table, clean_dict
# Path
import os
import time
from survae.data.path import get_survae_path
# Experiment
from .base im... | [
11748,
28034,
198,
11748,
28034,
10178,
13,
26791,
355,
410,
26791,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
3343,
3609,
13,
17080,
2455,
507,
1330,
6060,
10044,
29363,
20344,
3890,
198,
6738,
3343,
3609,
13,... | 3.517007 | 147 |
import os
import numpy as np
import pandas as pd
import xarray as xr
import pickle as pkl
from datetime import datetime
from scipy import ndimage as ndi
import SimpleITK as sitk
import skimage as skim
from skimage import feature, morphology
import glob
def add_liver_mask(ds, moving_name='19', extra_name='extra1'):
... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2124,
18747,
355,
2124,
81,
198,
11748,
2298,
293,
355,
279,
41582,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
629,
541,
88,
... | 2.515487 | 452 |
from enum import Enum
def col(self, metric, section=None):
"""Return the column for the supplied metric from the dataframe."""
if not section:
colname = metric.value
else:
colname = self.sep.join([metric.value, self.sep, section])
if colname not in self.df... | [
6738,
33829,
1330,
2039,
388,
628,
628,
220,
220,
220,
825,
951,
7,
944,
11,
18663,
11,
2665,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
262,
5721,
329,
262,
14275,
18663,
422,
262,
1366,
14535,
526,
1593... | 2.386139 | 202 |
# -*- coding: utf-8 -*-
import codecs
import subprocess
from tempfile import NamedTemporaryFile
from ikazuchi.core.handler.base import BaseHandler
from ikazuchi.core.handler.utils import get_and_check_file_access
from ikazuchi.core.translator import TRANSLATE_API as API
from ikazuchi.ikazuchi import (base_parser, sub... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
40481,
82,
198,
11748,
850,
14681,
198,
6738,
20218,
7753,
1330,
34441,
12966,
5551,
8979,
198,
198,
6738,
220,
1134,
1031,
22200,
13,
7295,
13,
30281,
13,
8... | 2.877996 | 459 |
#!/usr/bin/env python3
"""
@author Corentin Goetghebeur (github.com/CorentinGoet).
"""
from lexer_pkg.lexer import Lexer
from parser_pkg.parser import Parser
from CLI.CLIinterface import CLI
import sys
import os
from CLI.actions import Actions
from pretty_printer_pkg.pretty_printer import PrettyPrinter
def main():
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
31,
9800,
7231,
429,
259,
1514,
316,
70,
258,
1350,
333,
357,
12567,
13,
785,
14,
14055,
429,
259,
5247,
316,
737,
198,
37811,
198,
6738,
31191,
263,
62,
35339,
13,
... | 2.298984 | 689 |
from abc import ABC, abstractmethod
from environment.controller import Controller
from environment.game_state import GameState
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
2858,
13,
36500,
1330,
22741,
198,
6738,
2858,
13,
6057,
62,
5219,
1330,
3776,
9012,
628,
198
] | 4.777778 | 27 |
##!/usr/bin/python
import numpy as np
import pylab as plt
import matplotlib as mpl
import seaborn as sns
sns.set_context("poster",font_scale=1.5)
sns.set_style({'font.family':'Times New Roman'})
mpl.rcParams['lines.linewidth'] = 2
data = np.genfromtxt(fname='cor.dat')
ncols = data.shape[1]
#for x in range(1,ncol... | [
2235,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
279,
2645,
397,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
198,
82,
5907,
... | 1.952381 | 525 |
# This sample tests that inferred types for tuples strip
# literals under the appropriate circumstances.
from typing import List, Literal, Tuple
a1 = (1, 2)
t1: Literal["tuple[Literal[1], Literal[2]]"] = reveal_type(a1)
a2 = list((1, 2))
t2: Literal["list[int]"] = reveal_type(a2)
a3: List[Literal[1]] = list((1,))... | [
2,
770,
6291,
5254,
326,
41240,
3858,
329,
12777,
2374,
10283,
198,
2,
4187,
874,
739,
262,
5035,
5917,
13,
628,
198,
6738,
19720,
1330,
7343,
11,
25659,
1691,
11,
309,
29291,
628,
198,
64,
16,
796,
357,
16,
11,
362,
8,
198,
83,
... | 2.328829 | 222 |
import unittest
from theatre_au import Clock
from actor_au import Troupe
from domain_model import construct_universe, action_log, generate_XES, new_trace
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
21421,
62,
559,
1330,
21328,
198,
6738,
8674,
62,
559,
1330,
22141,
431,
198,
6738,
7386,
62,
19849,
1330,
5678,
62,
403,
3997,
11,
2223,
62,
6404,
11,
7716,
62,
55,
1546,
11,
649,
62,
40546,
628,
... | 3.074627 | 67 |
import logging
from pathlib import Path
from dataclasses import dataclass
from typing import Union
import pygame as pg
import chess.settings as s
from chess.states.state import State
from chess.panels.intro.title import Title
from chess.panels.intro.menu import Menu
from chess.panels.console import Console
from chess... | [
11748,
18931,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
4479,
198,
198,
11748,
12972,
6057,
355,
23241,
198,
198,
11748,
19780,
13,
33692,
355,
264,
198,
6738,
19780,
... | 3.454545 | 143 |
from imageai.Prediction.Custom import CustomImagePrediction
import os
execution_path = os.getcwd()
predictor = CustomImagePrediction()
predictor.setModelPath(model_path=os.path.join(execution_path, "idenprof_full_resnet_ex-001_acc-0.119792.h5")) # Download the model via this link https://github.com/OlafenwaMoses/Ima... | [
6738,
2939,
1872,
13,
39156,
2867,
13,
15022,
1330,
8562,
5159,
39156,
2867,
198,
11748,
28686,
198,
198,
18558,
1009,
62,
6978,
796,
28686,
13,
1136,
66,
16993,
3419,
628,
198,
79,
17407,
273,
796,
8562,
5159,
39156,
2867,
3419,
198,
... | 2.875576 | 217 |
import re
from django.conf import settings
from django.contrib.auth.backends import ModelBackend
from itsdangerous import BadData
from apps.users.models import User
#
from meiduo.settings.dev import logger
from utils.secret import SecretOauth
def get_user_by_account(account):
"""
account
:param accou... | [
11748,
302,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
1891,
2412,
1330,
9104,
7282,
437,
198,
6738,
663,
38537,
516,
1330,
7772,
6601,
198,
198,
6738,
6725,
13,
18417,
... | 2.271565 | 626 |
"""
Definitions of nodes for graph computation.
"""
import warnings
from ... import settings
if settings.DEBUG_NODE_CREATION:
warnings.warn("Printing automatic node creation info! Output will be verbose.")
from . import base, inputs, indexers, networks, targets, physics, loss
| [
37811,
198,
7469,
50101,
286,
13760,
329,
4823,
29964,
13,
198,
37811,
198,
11748,
14601,
198,
198,
6738,
2644,
1330,
6460,
198,
198,
361,
6460,
13,
30531,
62,
45,
16820,
62,
43387,
6234,
25,
198,
220,
220,
220,
14601,
13,
40539,
7203... | 3.763158 | 76 |
import json
import os
import re
from typing import Dict, List, Type
from loguru import logger
from prometheus_ecs_discoverer import s
from prometheus_ecs_discoverer.discovery import Target
# Copyright 2018, 2019 Signal Media Ltd. Licensed under the Apache License 2.0
# Modifications Copyright 2020 Tim Schwenke. Lice... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
5994,
198,
198,
6738,
2604,
14717,
1330,
49706,
198,
198,
6738,
1552,
36916,
62,
721,
82,
62,
15410,
659,
11751,
1330,
264,
198,
6738,
1... | 2.131673 | 2,529 |
import sys
import numpy as np
assert len(sys.argv) == 6
x = np.random.randn(*map(int, sys.argv[1:-1]))
np.save(sys.argv[-1], x)
| [
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
198,
30493,
18896,
7,
17597,
13,
853,
85,
8,
6624,
718,
198,
87,
796,
45941,
13,
25120,
13,
25192,
77,
46491,
8899,
7,
600,
11,
25064,
13,
853,
85,
58,
16,
21912,
16,
60,
4008... | 2.15 | 60 |
from unittest.mock import patch
import mlflow
from soam.core import SoamFlow
from soam.workflow import Slicer
from tests.helpers import sample_data_df # pylint: disable=unused-import
| [
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
11748,
285,
1652,
9319,
198,
198,
6738,
523,
321,
13,
7295,
1330,
1406,
321,
37535,
198,
6738,
523,
321,
13,
1818,
11125,
1330,
311,
677,
263,
198,
6738,
5254,
13,
16794,
364,
... | 3.016129 | 62 |
import enum
import cv2
import numpy
import requests
import config
from model.model import KerasModel
from model.training_data import TrainingData
| [
11748,
33829,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
198,
11748,
7007,
198,
198,
11748,
4566,
198,
6738,
2746,
13,
19849,
1330,
17337,
292,
17633,
198,
6738,
2746,
13,
34409,
62,
7890,
1330,
13614,
6601,
628,
198
] | 3.75 | 40 |
# Author: Karan Goda
# https://www.codewars.com/kata/57b06f90e298a7b53d000a86
# Test cases
print(queue_time([1, 2, 3], 1)) # Ans is 3
print(queue_time([1, 2, 3], 2)) # Ans is 3
print(queue_time([1, 2, 3, 5], 3)) # Ans is 6
| [
2,
6434,
25,
9375,
272,
1793,
64,
198,
2,
3740,
1378,
2503,
13,
19815,
413,
945,
13,
785,
14,
74,
1045,
14,
3553,
65,
3312,
69,
3829,
68,
27728,
64,
22,
65,
4310,
67,
830,
64,
4521,
198,
198,
2,
6208,
2663,
198,
4798,
7,
36560... | 2.196078 | 102 |
from setuptools import setup, find_packages
with open('requirements/requirements.txt') as f:
requirements = f.read().splitlines()
with open('requirements/requirements-test.txt') as f:
test_requirements = f.read().splitlines()
setup(
name='monstermash',
author='Mitchell Lisle',
author_email='m.... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
4480,
1280,
10786,
8897,
18883,
14,
8897,
18883,
13,
14116,
11537,
355,
277,
25,
198,
220,
220,
220,
5359,
796,
277,
13,
961,
22446,
35312,
6615,
3419,
628,
198,
4480... | 2.514563 | 309 |
# -*- coding: utf-8 -*-
"""Contains Base Date-Picker input class for widgets of this package."""
from django.forms.widgets import DateTimeBaseInput
from flatpickr._settings import WidgetSettings
from flatpickr._media import WidgetMedia
from flatpickr._config import WidgetConfig
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
4264,
1299,
7308,
7536,
12,
47,
15799,
5128,
1398,
329,
40803,
286,
428,
5301,
526,
15931,
198,
198,
6738,
42625,
14208,
13,
23914,
13,
28029,
11407,
1330,
7536,
... | 3.5125 | 80 |
# BioPandas
# Author: Sebastian Raschka <mail@sebastianraschka.com>
# License: BSD 3 clause
# Project Website: http://rasbt.github.io/biopandas/
# Code Repository: https://github.com/rasbt/biopandas
"""
BioPandas module for working with Protein Data Bank (PDB)
files in pandas DataFrames.
"""
from .pandas_pdb import P... | [
2,
16024,
47206,
292,
198,
2,
6434,
25,
26190,
28513,
354,
4914,
1279,
4529,
31,
325,
65,
459,
666,
8847,
354,
4914,
13,
785,
29,
198,
2,
13789,
25,
347,
10305,
513,
13444,
198,
2,
4935,
15887,
25,
2638,
1378,
8847,
18347,
13,
125... | 2.787402 | 127 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 3.256684 | 187 |
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
gi.require_version('AppIndicator3', '0.1')
from gi.repository import AppIndicator3 as AppIndicator
| [
198,
11748,
308,
72,
198,
198,
12397,
13,
46115,
62,
9641,
10786,
38,
30488,
3256,
705,
18,
13,
15,
11537,
198,
6738,
308,
72,
13,
260,
1930,
37765,
1330,
402,
30488,
198,
198,
12397,
13,
46115,
62,
9641,
10786,
4677,
5497,
26407,
1... | 2.626866 | 67 |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
#import inspect
import os,sys
import csv
import argparse
import subprocess
import gzip
import glob
import logging
##
## This script decorates the Cosmic coding vari... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.449513 | 1,951 |
import socket
from HTMLParser import HTMLParser
indexFile = open('index.html','r')
index = indexFile.read()
page404File = open('page404.html','r')
page404 = page404File.read()
# server host and port definition
HOST = '' # server ip (empty)
PORT = 8080 # server port
# create a socket with IPv4 (AF_INET)... | [
11748,
17802,
201,
198,
6738,
11532,
46677,
1330,
11532,
46677,
201,
198,
201,
198,
9630,
8979,
796,
1280,
10786,
9630,
13,
6494,
41707,
81,
11537,
201,
198,
9630,
796,
6376,
8979,
13,
961,
3419,
201,
198,
201,
198,
7700,
26429,
8979,
... | 2.777358 | 530 |
#
# Status Indicator Circuit Controller Test
# Author: Francis T
#
# Tests the status indicator circuit controller
#
import unittest
import status_controller as statc
if __name__ == "__main__":
unittest.main()
| [
2,
198,
2,
220,
220,
12678,
1423,
26407,
13588,
22741,
6208,
198,
2,
220,
220,
6434,
25,
12155,
309,
198,
2,
220,
220,
220,
198,
2,
220,
220,
30307,
262,
3722,
16916,
10349,
10444,
198,
2,
198,
198,
11748,
555,
715,
395,
198,
1174... | 3.09589 | 73 |
import os
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense, InputLayer, Flatten
from tensorflow.keras.models import clone_model
| [
11748,
28686,
198,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
24604,
1843,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
360,
1072,
11,
23412,
49925,
11,
1610,
41769,
198,
6738,
11192,
273,
11125,
13,
6122,
... | 3.326531 | 49 |
from __future__ import absolute_import
import re
import requests
import time
import random
from conmato.utils import *
def confirm_joining(session, member, action, group_id=GROUP_ID):
"""
action = ['accept', 'reject']
"""
url = MEMBERS_URL.format(group_id)
payload = {
'_tta': mem... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
302,
198,
198,
11748,
7007,
198,
11748,
640,
220,
198,
11748,
4738,
198,
198,
6738,
369,
76,
5549,
13,
26791,
1330,
1635,
628,
628,
198,
4299,
6216,
62,
40044,
7,
29891,... | 2.432268 | 1,314 |
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#TOFILL
if __name__ == '__main__':
param = [
([4, 7, 10, 12, 12, 24, 29, 38, 45, 51, 53, 54, 59, 68, 72, 73, 85, 86, ... | [
2,
15069,
357,
66,
8,
13130,
12,
25579,
11,
3203,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
4... | 1.867195 | 1,009 |
import pandas
from imblearn.over_sampling import RandomOverSampler
from nltk.tree import Tree
from scipy.sparse import hstack
from sklearn.base import TransformerMixin, BaseEstimator
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.pipeline i... | [
11748,
19798,
292,
198,
6738,
545,
903,
1501,
13,
2502,
62,
37687,
11347,
1330,
14534,
5886,
16305,
20053,
198,
6738,
299,
2528,
74,
13,
21048,
1330,
12200,
198,
6738,
629,
541,
88,
13,
82,
29572,
1330,
289,
25558,
198,
6738,
1341,
35... | 2.777778 | 342 |
import re
import os
import traceback
import importlib.util
from prompt_toolkit import prompt
from prompt_toolkit.history import FileHistory
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.validation import ValidationError
from colored import fg, bg, attr
import torch.optim as optim
... | [
11748,
302,
198,
11748,
28686,
198,
11748,
12854,
1891,
198,
11748,
1330,
8019,
13,
22602,
198,
198,
6738,
6152,
62,
25981,
15813,
1330,
6152,
198,
6738,
6152,
62,
25981,
15813,
13,
23569,
1330,
9220,
18122,
198,
6738,
6152,
62,
25981,
... | 3.496894 | 161 |
"""Basic unit test for lambdata"""
import unittest
import random
from example_module import favorite_animals, colors, add, increment, becca, rand_num
if __name__ == "__main__":
unittest.main()
| [
37811,
26416,
4326,
1332,
329,
19343,
7890,
37811,
198,
198,
11748,
555,
715,
395,
198,
11748,
4738,
198,
198,
6738,
1672,
62,
21412,
1330,
4004,
62,
11227,
874,
11,
7577,
11,
751,
11,
18703,
11,
307,
13227,
11,
43720,
62,
22510,
628,... | 2.957746 | 71 |
# system imports
import sys
import os
import time
# local imports
from function.find import Find
from connector.switch import Switch
| [
198,
2,
1080,
17944,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
640,
198,
198,
2,
1957,
17944,
198,
6738,
2163,
13,
19796,
1330,
9938,
198,
6738,
21716,
13,
31943,
1330,
14645,
628
] | 4.121212 | 33 |
#!/usr/bin/python
SHOW_ERRORS = True
import sys
def error_fx(text):
'''The default error handling, print the text to the console.
replace with your own function if you want, have it print to your
wx application or whatever.'''
sys.stderr.write(text)
def show_error(text):
'''
Send an error if SHO... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
9693,
3913,
62,
24908,
50,
796,
6407,
198,
11748,
25064,
198,
198,
4299,
4049,
62,
21373,
7,
5239,
2599,
198,
220,
220,
220,
705,
7061,
464,
4277,
4049,
9041,
11,
3601,
262,
2420,
284,
262,... | 2.574297 | 1,992 |
# Copyright 2020 Northern.tech AS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
2,
15069,
12131,
8342,
13,
13670,
7054,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
35... | 2.681677 | 644 |
"""
Description - Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements at higher indexes. We are given an Array of integers, We have to find out the first index i from left such that -
A[0] + A[1] + ... A[i-1] = A[i+1] + A[i+2] ... A[n-1]
Input
[-7, 1... | [
37811,
198,
198,
11828,
532,
7889,
24741,
6376,
286,
281,
7177,
318,
281,
6376,
884,
326,
262,
2160,
286,
4847,
379,
2793,
39199,
318,
4961,
284,
262,
2160,
286,
4847,
379,
2440,
39199,
13,
775,
389,
1813,
281,
15690,
286,
37014,
11,
... | 2.35 | 560 |
# coding: utf-8
"""
kozmic.projects
~~~~~~~~~~~~~~~
.. attribute:: bp
:class:`flask.Blueprint` that provides all the means for managing and
viewing projects.
"""
from flask import Blueprint
from flask.ext.login import login_required
bp = Blueprint('projects', __name__)
def register_views():
from . i... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
37811,
198,
7204,
89,
9383,
13,
42068,
198,
15116,
8728,
4907,
93,
198,
198,
492,
11688,
3712,
275,
79,
628,
220,
220,
220,
1058,
4871,
25,
63,
2704,
2093,
13,
14573,
4798,
63,
326,
3769,
477,
... | 3.223301 | 103 |
from wsgiref.simple_server import make_server
server = make_server('localhost', 8000, app=application)
server.serve_forever() | [
6738,
266,
45213,
557,
69,
13,
36439,
62,
15388,
1330,
787,
62,
15388,
198,
198,
15388,
796,
787,
62,
15388,
10786,
36750,
3256,
38055,
11,
598,
28,
31438,
8,
198,
15388,
13,
2655,
303,
62,
754,
332,
3419
] | 3.315789 | 38 |
from itertools import groupby, chain
def determine_symbols_and_max_repeats(sequences):
"""determines unique set of symbols used in sequences, and maximum number
of repeats of those symbols (consecutive repeats, not just repeats in the
sense of occurrences). Any symbol with a maximum number of repeats > 1... | [
6738,
340,
861,
10141,
1330,
1448,
1525,
11,
6333,
628,
198,
4299,
5004,
62,
1837,
2022,
10220,
62,
392,
62,
9806,
62,
45956,
1381,
7,
3107,
3007,
2599,
198,
220,
220,
220,
37227,
67,
13221,
274,
3748,
900,
286,
14354,
973,
287,
163... | 2.418655 | 1,383 |
#!/usr/bin/env python3
import rospy
from std_msgs.msg import Float32
rospy.init_node('radius_publisher')
pub = rospy.Publisher('/radius', Float32, queue_size=1)
rate = rospy.Rate(1)
if __name__ == '__main__':
while not rospy.is_shutdown():
pub.publish(0.5)
rate.sleep() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
686,
2777,
88,
198,
6738,
14367,
62,
907,
14542,
13,
19662,
1330,
48436,
2624,
198,
198,
305,
2777,
88,
13,
15003,
62,
17440,
10786,
42172,
62,
12984,
8191,
11537,
198,... | 2.263566 | 129 |
import pandas as pd
import numpy as np
identity_func = lambda a, b: b
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
738,
414,
62,
20786,
796,
37456,
257,
11,
275,
25,
275,
198
] | 2.730769 | 26 |
# Py2Exe setup file
from distutils.core import setup
import py2exe
setup(console=['words.py'])
| [
2,
9485,
17,
3109,
68,
9058,
2393,
198,
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
11748,
12972,
17,
13499,
198,
198,
40406,
7,
41947,
28,
17816,
10879,
13,
9078,
6,
12962,
628
] | 2.939394 | 33 |
# Author: O-O
# Date: 6/23/2019
# Description: A Simple Reverse Lookup Program.
import webbrowser
# Generates URLS.
# Precondition: A String.
# Postcondition: Web-Browser Controller (Opens URLS)
# Start Program.
# Precondition: A String.
# Postcondition: None.
# Run Program.
# input("Phone Number: ")
main(input("Ph... | [
2,
6434,
25,
440,
12,
46,
198,
2,
7536,
25,
718,
14,
1954,
14,
23344,
198,
2,
12489,
25,
317,
17427,
31849,
6803,
929,
6118,
13,
198,
198,
11748,
3992,
40259,
198,
198,
2,
2980,
689,
37902,
6561,
13,
198,
2,
3771,
31448,
25,
317... | 3.082569 | 109 |
# Shows the tempos for all of the songs in a director
# requires eyeD3, available from http://eyed3.nicfit.net/
import sys
import os
import eyeD3
import tempo
def show_tempo(mp3):
"given an mp3, print out the artist, title and tempo of the song"
tag = eyeD3.Tag()
tag.link(mp3)
my_tempo = tempo.get_te... | [
2,
25156,
262,
2169,
1930,
329,
477,
286,
262,
7259,
287,
257,
3437,
198,
2,
4433,
4151,
35,
18,
11,
1695,
422,
2638,
1378,
18834,
18,
13,
6988,
11147,
13,
3262,
14,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
4151,
35,
... | 2.343243 | 370 |
from django.conf.urls import patterns, url
from quotes import views
from views import *
urlpatterns = patterns('',
url(r'^sdf$', index, name='index'),
url(r'^$', GameView.as_view(), name='game'),
url(r'^post$', AnswerView.as_view(), name='answer'),
url(r'^edit$', QuoteUpdate.as_view(), name='update'),
)
... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
19016,
201,
198,
6738,
13386,
1330,
5009,
201,
198,
6738,
5009,
1330,
1635,
201,
198,
220,
201,
198,
6371,
33279,
82,
796,
7572,
10786,
3256,
201,
198,
197,
6371,
7,
81,
6... | 2.58871 | 124 |
import setuptools
setuptools.setup(
name="modelmonitor",
author="Tim Book",
author_email="timothykbook@gmail.com",
description="A library for monitoring data changes over time",
url="https://github.com/timbook/modelmonitor",
packages=setuptools.find_packages(),
python_requires='>=3.6',
)
| [
11748,
900,
37623,
10141,
198,
198,
2617,
37623,
10141,
13,
40406,
7,
198,
220,
220,
220,
1438,
2625,
19849,
41143,
1600,
198,
220,
220,
220,
1772,
2625,
14967,
4897,
1600,
198,
220,
220,
220,
1772,
62,
12888,
2625,
16514,
14863,
74,
... | 2.864865 | 111 |
import configparser
from datetime import datetime
import os
from pyspark.sql import SparkSession
from pyspark.sql.functions import udf, col, monotonically_increasing_id
from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format, dayofweek
from pyspark.sql.types import *
config = configpa... | [
11748,
4566,
48610,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
28686,
198,
6738,
279,
893,
20928,
13,
25410,
1330,
17732,
36044,
198,
6738,
279,
893,
20928,
13,
25410,
13,
12543,
2733,
1330,
334,
7568,
11,
951,
11,
937,
18970,... | 2.431725 | 1,948 |
# Generated by Django 3.0.5 on 2020-08-26 20:00
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
20,
319,
12131,
12,
2919,
12,
2075,
1160,
25,
405,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import pyxel
WIDTH = 128
HEIGHT = 128
IMG_NO = 0
App()
| [
11748,
12972,
87,
417,
198,
198,
54,
2389,
4221,
796,
13108,
198,
13909,
9947,
796,
13108,
198,
3955,
38,
62,
15285,
796,
657,
628,
198,
198,
4677,
3419,
198
] | 2.034483 | 29 |
from .models import PurchaseOrder, PurchaseOrderLine
from .serializers import PurchaseOrderSerializer, PurchaseOrderLineSerializer
from rest_framework import viewsets, permissions
| [
6738,
764,
27530,
1330,
27637,
18743,
11,
27637,
18743,
13949,
198,
6738,
764,
46911,
11341,
1330,
27637,
18743,
32634,
7509,
11,
27637,
18743,
13949,
32634,
7509,
198,
6738,
1334,
62,
30604,
1330,
5009,
1039,
11,
21627,
628,
198
] | 4.789474 | 38 |
# Author: Karl Gemayel
# Created: 8/5/20, 8:25 AM
import logging
import math
import os
from textwrap import wrap
import pandas as pd
from typing import *
import seaborn
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
from mg_general import Environment
from mg_io.general import load_obj, ... | [
2,
6434,
25,
15415,
15669,
323,
417,
198,
2,
15622,
25,
807,
14,
20,
14,
1238,
11,
807,
25,
1495,
3001,
198,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
28686,
198,
6738,
2420,
37150,
1330,
14441,
198,
198,
11748,
19798,
292,
... | 2.995556 | 225 |
from flask import Flask, jsonify, abort, make_response
from flask_restful import Api, Resource, reqparse, fields, marshal, abort
from py2neo import *
import json
from flask_cors import CORS
from ipaddress import *
import werkzeug
import os
from netaddr import *
import re
import random
import time
import CSVSplit_genera... | [
6738,
42903,
1330,
46947,
11,
33918,
1958,
11,
15614,
11,
787,
62,
26209,
198,
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
11,
20857,
11,
43089,
29572,
11,
7032,
11,
22397,
282,
11,
15614,
198,
6738,
12972,
17,
710,
78,
1330,
1635,
... | 2.779385 | 553 |
import os
import unittest
from searcher.Vulnerability import Vulnerability
from searcher.Searcher import Searcher
import json
from static_analyzer import file_get_contents
if __name__ == '__main__':
unittest.main()
| [
11748,
28686,
198,
11748,
555,
715,
395,
198,
6738,
9622,
2044,
13,
53,
40920,
1330,
569,
40920,
198,
6738,
9622,
2044,
13,
50,
50194,
1330,
42016,
2044,
198,
11748,
33918,
198,
198,
6738,
9037,
62,
38200,
9107,
1330,
2393,
62,
1136,
... | 3.279412 | 68 |
from histogram import display_histogram
main()
| [
6738,
1554,
21857,
1330,
3359,
62,
10034,
21857,
201,
198,
201,
198,
12417,
3419,
201,
198
] | 3.1875 | 16 |
from django.db import models
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198
] | 3.5625 | 16 |
import RPi.GPIO as GPIO
| [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198
] | 2.666667 | 9 |
from django.shortcuts import render, redirect
from django.http import HttpResponse
import csv
from apps.members.models import Member
from .models import GenerateReportForm
from django.db.models import Q
from django.contrib.auth.decorators import login_required
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
11748,
269,
21370,
198,
6738,
6725,
13,
30814,
13,
27530,
1330,
10239,
198,
6738,
764,
27530,
1330,
2980,
378,
... | 3.71831 | 71 |
from setuptools import setup, find_packages
setup(
name='evolute',
version='0.9.0',
packages=find_packages(),
url='https://github.com/csxeba/evolute.git',
license='MIT',
author='Csaba Gr',
author_email='csxeba@gmail.com',
description='Evolutionary algorithm toolbox',
long_descriptio... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
1990,
3552,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
24,
13,
15,
3256,
198,
220,
220,
220,
10392,
28,
19796,
62,
... | 2.631579 | 152 |
# %%
import datetime
import time
import pandas as pd
from io import StringIO
from function_grab import grab_price
import numpy as np
import warnings
import random
data = {}
n_days = 120
date = datetime.datetime.now()
fail_count = 0
allow_continuous_fail_count = 15 # 12
while len(data) < n_days:
... | [
2,
43313,
201,
198,
11748,
4818,
8079,
201,
198,
11748,
640,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
6738,
33245,
1330,
10903,
9399,
201,
198,
6738,
2163,
62,
32393,
1330,
5552,
62,
20888,
201,
198,
11748,
299,
32152,
355... | 2.097918 | 1,777 |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
import json
# Your Codec object will be instantiated and called as such:
# codec = Codec()
# codec.deserialize(codec.serialize(root))
| [
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
7,
15252,
2599,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2124,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2100,
... | 2.601695 | 118 |
from collections import defaultdict
from lhc.interval import IntervalBinner
| [
6738,
17268,
1330,
4277,
11600,
198,
6738,
300,
71,
66,
13,
3849,
2100,
1330,
4225,
2100,
33,
5083,
628
] | 4.052632 | 19 |
#!/usr/bin/env python
# Copyright (c) 2016 The UUV Simulator Authors.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
357,
66,
8,
1584,
383,
471,
31667,
13942,
46665,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,... | 2.440419 | 1,242 |
#! /usr/bin/env python
import sys
import os
import re
import glob
import argparse
import project_util
batch_number_pattern = re.compile(r'batch(?P<batch_number>\d+)')
sim_number_pattern = re.compile(r'-sim-(?P<sim_number>\d+)-')
run_number_pattern = re.compile(r'-run-(?P<sim_number>\d+)\.log')
... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
15095,
198,
11748,
1822,
29572,
198,
198,
11748,
1628,
62,
22602,
628,
198,
43501,
62,
17618,
62,
33279,
796,
302,
... | 2.289308 | 159 |
import datetime
| [
11748,
4818,
8079,
628
] | 4.25 | 4 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
# Generated by Django 1.11.14 on 2018-08-03 13:24
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1415,
319,
2864,
12,
2919,
12,
3070,
1511,
25,
1731,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.833333 | 30 |