content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
| [
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,
15720,
602,
11,
4981,
628
] | 2.891892 | 37 |
# Copyright (c) 2016 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the S... | [
2,
15069,
357,
66,
8,
1584,
34198,
10442,
3457,
13,
198,
2,
198,
2,
7102,
37,
25256,
12576,
5357,
4810,
3185,
7112,
2767,
13153,
198,
2,
198,
2,
770,
670,
318,
2810,
366,
1921,
3180,
1,
290,
2426,
284,
262,
34198,
37709,
16984,
15... | 2.402394 | 23,805 |
'''
Created on Jan 6, 2016
@author: T0157129
'''
__all__ = [
'Character',
'Player',
'Enemy',
'Merchant'] | [
7061,
6,
198,
41972,
319,
2365,
718,
11,
1584,
198,
198,
31,
9800,
25,
309,
486,
3553,
18741,
198,
7061,
6,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
220,
220,
220,
705,
27275,
3256,
198,
220,
220,
220,
220,
220,
220,
70... | 1.927536 | 69 |
"""Collection of Unit tests for AHPGraph DeviceGraph."""
from AHPGraph import *
from test import *
from Devices import *
def AttributeTest() -> bool:
"""Test of DeviceGraph with attributes."""
t = test('AttributeTest')
attr = {'a1': 1, 'a2': 'blue', 'a3': False}
graph = DeviceGraph(attr)
t.test(... | [
37811,
36307,
286,
11801,
5254,
329,
28159,
6968,
1470,
16232,
37065,
526,
15931,
198,
198,
6738,
28159,
6968,
1470,
1330,
1635,
198,
6738,
1332,
1330,
1635,
198,
6738,
29362,
1330,
1635,
628,
198,
4299,
3460,
4163,
14402,
3419,
4613,
205... | 2.316465 | 3,893 |
import pytest
from miscutils.const import Const, ConstError
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
12747,
26791,
13,
9979,
1330,
4757,
11,
4757,
12331,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
628,
198
] | 3.192308 | 26 |
import logging
from connexion import problem
import sqlalchemy
from rhub.lab import model
from rhub.api import db, DEFAULT_PAGE_LIMIT
from rhub.auth.keycloak import KeycloakClient
from rhub.auth import ADMIN_ROLE
from rhub.auth.utils import route_require_admin
logger = logging.getLogger(__name__)
@route_require_... | [
11748,
18931,
198,
198,
6738,
369,
12413,
295,
1330,
1917,
198,
11748,
44161,
282,
26599,
198,
198,
6738,
9529,
549,
13,
23912,
1330,
2746,
198,
6738,
9529,
549,
13,
15042,
1330,
20613,
11,
5550,
38865,
62,
4537,
8264,
62,
43,
3955,
2... | 2.992 | 125 |
#%%
from classItem import Item
""""
"""
class Player():
""""
CLASS FOR PLAYER() THAT CAN BUY SELL ITEMS AND KEEP SCORE
"""
def set_name (self):
""""
SET NEW NAME FOR PLAYER
"""
print('player name is currently : ' + str(self.playerName))
print('# # # # PLEASE... | [
2,
16626,
220,
198,
6738,
1398,
7449,
1330,
9097,
198,
15931,
15931,
198,
198,
37811,
198,
198,
4871,
7853,
33529,
198,
220,
220,
220,
13538,
15931,
198,
220,
220,
220,
42715,
7473,
28180,
1137,
3419,
14603,
15628,
20571,
56,
7946,
3069... | 2.23937 | 635 |
import random
from uniborg.util import edit_or_reply
from . import *
RUNSREACTS = [
"`Congratulations and BRAVO!`",
"`You did it! So proud of you!`",
"`This calls for celebrating! Congratulations!`",
"`I knew it was only a matter of time. Well done!`",
"`Congratulations on your well-deserved succ... | [
11748,
4738,
198,
198,
6738,
555,
571,
2398,
13,
22602,
1330,
4370,
62,
273,
62,
47768,
198,
6738,
764,
1330,
1635,
628,
198,
49,
4944,
50,
2200,
2246,
4694,
796,
685,
198,
220,
220,
220,
366,
63,
45048,
290,
39947,
29516,
0,
63,
... | 2.817035 | 317 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 23 17:46:29 2019
@author: Jonas Rusiana
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn import metrics
datas... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
30030,
5979,
2242,
1596,
25,
3510,
25,
1959,
13130,
201,
198,
201,
198,
31,
9800,
25,
40458,
9223,
7484,
201,
198,
37811,
201,
198,
2... | 2.498005 | 1,253 |
from django.test import tag, TestCase
from steambird.models.coursetree import Period
# pylint: disable=invalid-name
@tag('unit')
| [
6738,
42625,
14208,
13,
9288,
1330,
7621,
11,
6208,
20448,
198,
198,
6738,
2876,
4131,
1447,
13,
27530,
13,
43220,
2617,
631,
1330,
18581,
628,
198,
2,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
198,
31,
12985,
10786,
20850,... | 3 | 44 |
from ts_eval.viz.eval_table import EvalTable
from . import BaseComponent
| [
6738,
40379,
62,
18206,
13,
85,
528,
13,
18206,
62,
11487,
1330,
26439,
10962,
198,
198,
6738,
764,
1330,
7308,
21950,
628
] | 3.409091 | 22 |
from tensorflow.python.keras.engine.training import Model
from tensorflow.keras.optimizers import Adam, SGD
from models.nets import *
from helper.losses import *
import math
| [
6738,
11192,
273,
11125,
13,
29412,
13,
6122,
292,
13,
18392,
13,
34409,
1330,
9104,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
40085,
11341,
1330,
7244,
11,
26147,
35,
198,
6738,
4981,
13,
45938,
1330,
1635,
198,
6738,
31904,
1... | 3.5 | 50 |
#!/usr/bin/env python
# encoding: utf-8
import npyscreen
#npyscreen.disableColor()
if __name__ == "__main__":
App = TestApp()
App.run()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
11748,
45941,
28349,
1361,
198,
2,
37659,
28349,
1361,
13,
40223,
10258,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628,
198,
361,
... | 2.178082 | 73 |
# -*- coding: utf-8 -*-
"""
@Time : 2020/12/31 11:48
@Auth : 高冷Aloof
@File :urls.py
@IDE :PyCharm
@Motto:ABC(Always Be Coding)
"""
from django.urls import path
from . import views
urlpatterns = [
path('books/', views.BookAPIView.as_view()),
path('books/<int:pk>', views.BookAPIView2.as_view()),
] | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
7575,
27332,
120,
248,
12131,
14,
1065,
14,
3132,
1367,
25,
2780,
198,
31,
30515,
27332,
120,
248,
16268,
45865,
37863,
115,
2348,
37711,
198,
31,
8979,
... | 2.053691 | 149 |
import requests
from copy import copy
from invoke import task
import os
from os import listdir, makedirs
from os.path import join, exists
from shutil import rmtree
from subprocess import run
from tasks.env import (
PROJ_ROOT,
FAASM_UPLOAD_HOST,
FAASM_UPLOAD_PORT,
NATIVE_BUILD_DIR,
)
PY_FUNC_DIR = join(... | [
11748,
7007,
198,
6738,
4866,
1330,
4866,
198,
6738,
26342,
1330,
4876,
198,
11748,
28686,
198,
6738,
28686,
1330,
1351,
15908,
11,
285,
4335,
17062,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
7160,
198,
6738,
4423,
346,
1330,
374,
167... | 2.110999 | 991 |
from office365.sharepoint.publishing.primary_city_time import PrimaryCityTime
from office365.sharepoint.publishing.site_page_collection import SitePageCollection
from office365.sharepoint.publishing.site_page_service import SitePageService
from office365.sharepoint.publishing.video_service_discoverer import VideoServic... | [
6738,
2607,
24760,
13,
20077,
4122,
13,
12984,
20020,
13,
39754,
62,
19205,
62,
2435,
1330,
21087,
14941,
7575,
198,
6738,
2607,
24760,
13,
20077,
4122,
13,
12984,
20020,
13,
15654,
62,
7700,
62,
43681,
1330,
14413,
9876,
36307,
198,
67... | 3.929293 | 99 |
import sys
import numpy.random
import pandas as pd
import numpy as np
from numpy.random import normal
from pandarallel import pandarallel
pandarallel.initialize(nb_workers=8, progress_bar=True)
if __name__ == '__main__':
df = pd.read_csv(sys.argv[1], sep='\t')
database = sys.argv[2]
crosstable = create... | [
11748,
25064,
198,
11748,
299,
32152,
13,
25120,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
25120,
1330,
3487,
198,
6738,
19798,
283,
29363,
1330,
19798,
283,
29363,
198,
79,
392... | 2.057734 | 918 |
#!/usr/bin/env python3
import functools
import urllib.parse
import requests
import requests_oauthlib
from . import error, utils
class BasicAuth(requests.auth.HTTPBasicAuth):
"""Basic Auth handler
Example:
>>> auth = haiker.BasicAuth('MyUsername', 'MyPassword')
>>> api = haiker.Haiker(auth)
"""
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1257,
310,
10141,
198,
11748,
2956,
297,
571,
13,
29572,
198,
11748,
7007,
198,
11748,
7007,
62,
12162,
1071,
8019,
198,
6738,
764,
1330,
4049,
11,
3384,
4487,
628,
198... | 2.410232 | 1,036 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Generate a toc.adoc file with the tool default variable and a specific asciidoc filename from adoc folder.
# Toll's default variables can be overridden by variables written in a specific asciidoc file from adoc folder.
import re
import sys
import os
if __name__ == '__m... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
378,
257,
284,
66,
13,
324,
420,
2393,
351,
262,
2891,
4277,
7885,
290,
257,
2176,
355,
979,
312,
420,
294... | 3.198113 | 106 |
import argparse
import zmq
import json
peer_list = []
# Parse command line arguments about server port number.
parser = argparse.ArgumentParser(description='DeAI server')
parser.add_argument('--port', default='5555', metavar='N',
help='input server port number (default: 5555)')
args = parser.parse... | [
11748,
1822,
29572,
198,
11748,
1976,
76,
80,
198,
11748,
33918,
198,
198,
33350,
62,
4868,
796,
17635,
198,
198,
2,
2547,
325,
3141,
1627,
7159,
546,
4382,
2493,
1271,
13,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
1121... | 2.644385 | 374 |
# Copyright 2016 ICFP Programming Contest 2016 Organizers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
2,
15069,
1584,
12460,
5837,
30297,
27297,
1584,
7221,
11341,
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,
13... | 3.705556 | 180 |
'''
@author: Devangini Patel
'''
print "fibonacci(5)", fibonacci(5) | [
7061,
6,
198,
31,
9800,
25,
6245,
648,
5362,
33110,
198,
7061,
6,
198,
198,
4798,
366,
69,
571,
261,
44456,
7,
20,
42501,
12900,
261,
44456,
7,
20,
8
] | 2.266667 | 30 |
import json
from collections import OrderedDict
import argparse
import sys
import json
from modules import validate_args
import os.path
from operator import itemgetter
import copy
if __name__=="__main__":
main()
| [
11748,
33918,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
33918,
198,
6738,
13103,
1330,
26571,
62,
22046,
198,
11748,
28686,
13,
6978,
198,
6738,
10088,
1330,
2378,
1136,
353,
198... | 3.338235 | 68 |
"""A very dumb example"""
import numpy as np
import pandas as pd
print("{mod}".format(mod=np))
| [
37811,
32,
845,
13526,
1672,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
4798,
7203,
90,
4666,
92,
1911,
18982,
7,
4666,
28,
37659,
4008,
198
] | 2.823529 | 34 |
######################################################################
# Unit tests for StompBuffer
######################################################################
import unittest
import types
import stomper
from stomper.stompbuffer import StompBuffer
CMD = 'SEND'
DEST = '/queue/a'
BODY = 'This is the body t... | [
29113,
29113,
4242,
2235,
198,
2,
11801,
5254,
329,
520,
3361,
28632,
198,
29113,
29113,
4242,
2235,
198,
198,
11748,
555,
715,
395,
198,
11748,
3858,
198,
198,
11748,
336,
296,
525,
198,
6738,
336,
296,
525,
13,
301,
3361,
22252,
133... | 3.105634 | 142 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# This is a Python dump created using dump2py.
# DJANGO_SETTINGS_MODULE was 'lino_book.projects.dumps.settings.b', TIME_ZONE was 'Europe/Tallinn'.
from __future__ import unicode_literals
import logging
logger = logging.getLogger('lino.management.commands.dump2py')
SOUR... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
2,
770,
318,
257,
11361,
10285,
2727,
1262,
10285,
17,
9078,
13,
198,
2,
13004,
1565,
11230,
62,
28480,
51,
20754,
... | 2.897275 | 477 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# DATE: 2021/9/15
# Author: clarkmonkey@163.com
from contextlib import contextmanager
from os import getpid
from pathlib import Path
from sqlite3.dbapi2 import Connection, Cursor, connect, OperationalError
from threading import Lock, local, get_ident
from time import time as c... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
360,
6158,
25,
33448,
14,
24,
14,
1314,
198,
2,
6434,
25,
537,
668,
49572,
31,
24136,
13,
785,
198,
198,
6738,
4732,
... | 2.251742 | 6,026 |
from cs50 import get_string
card_number = get_string("Number: ")
# Luhn's Algorithm
test_number = card_number[::-1]
odd_sum = sum([((int(digit) * 2) // 10) + ((int(digit) * 2) % 10) for digit in test_number[1::2]])
pair_sum = sum([int(digit) for digit in test_number[::2]])
# Checks provider if Luhn' valid
if (pair_s... | [
6738,
50115,
1120,
1330,
651,
62,
8841,
198,
198,
9517,
62,
17618,
796,
651,
62,
8841,
7203,
15057,
25,
366,
8,
198,
198,
2,
6026,
21116,
338,
978,
42289,
198,
9288,
62,
17618,
796,
2657,
62,
17618,
58,
3712,
12,
16,
60,
198,
5088... | 2.214286 | 336 |
"""
Utility functions surrounding terminal devices & I/O.
Much of this code performs platform-sensitive branching, e.g. Windows support.
This is its own module to abstract away what would otherwise be distracting
logic-flow interruptions.
"""
from contextlib import contextmanager
import os
import select
import sys
... | [
37811,
198,
18274,
879,
5499,
7346,
12094,
4410,
1222,
314,
14,
46,
13,
198,
198,
20045,
286,
428,
2438,
17706,
3859,
12,
30176,
49526,
11,
304,
13,
70,
13,
3964,
1104,
13,
198,
198,
1212,
318,
663,
898,
8265,
284,
12531,
1497,
644,... | 2.81203 | 1,995 |
import logging
from numbers import Number
from typing import Any
from typing import List
from typing import Sequence
from typing import Dict
from typing import Final
from typing import Type
from ..distributions import BaseDist
from ..distributions import Normal
from ..distributions import Exponential
from ..distribut... | [
11748,
18931,
198,
198,
6738,
3146,
1330,
7913,
198,
6738,
19720,
1330,
4377,
198,
6738,
19720,
1330,
7343,
198,
6738,
19720,
1330,
45835,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
8125,
198,
6738,
19720,
1330,
5994,
198,
... | 2.643969 | 1,028 |
# N: 頂点数
# G[v]: 頂点vの子頂点 (親頂点は含まない)
#
# - construct
# prv[u] = v: 頂点uの一つ上の祖先頂点v
# - lca
# kprv[k][u] = v: 頂点uの2^k個上の祖先頂点v
# depth[u]: 頂点uの深さ (根頂点は0)
import sys
sys.setrecursionlimit(500000)
N, Q = map(int, input().split())
G = [[] for _ in range(N + 1)]
for _ in range(N - 1):
a, b = map(int, input().split())
G... | [
2,
399,
25,
16268,
254,
224,
163,
224,
117,
46763,
108,
198,
2,
402,
58,
85,
5974,
16268,
254,
224,
163,
224,
117,
85,
15474,
255,
238,
165,
254,
224,
163,
224,
117,
357,
17358,
103,
165,
254,
224,
163,
224,
117,
31676,
28938,
1... | 1.433004 | 709 |
#
# Copyright (c) 2019-2020
#
# @author: Daniel Bankmann
# @company: Technische Universität Berlin
#
# This file is part of the python package pymloc
# (see https://gitlab.tubit.tu-berlin.de/bankmann91/python-mloc )
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
import pytest
from pymloc... | [
2,
198,
2,
15069,
357,
66,
8,
13130,
12,
42334,
198,
2,
198,
2,
2488,
9800,
25,
7806,
5018,
9038,
198,
2,
2488,
39722,
25,
5429,
46097,
26986,
270,
11033,
83,
11307,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
262,
21015,
5301,
12... | 2.842857 | 140 |
import os
import pandas as pd
import plotly.express as px # (version 4.7.0)
import plotly.graph_objects as go
import dash # (version 1.12.0) pip install dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_table
from base64 import b64e... | [
11748,
28686,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
7110,
306,
13,
42712,
355,
279,
87,
220,
1303,
357,
9641,
604,
13,
22,
13,
15,
8,
198,
11748,
7110,
306,
13,
34960,
62,
48205,
355,
467,
628,
198,
11748,
14470,
... | 2.37764 | 805 |
import cv2
import numpy as np
resim=cv2.imread("adileNasit.jpg")
#resmi uzatma
uzatilan_resim=cv2.copyMakeBorder(resim,100,100,100,100,cv2.BORDER_REPLICATE)
#resmi aynalama
aynalanan_resim=cv2.copyMakeBorder(resim,100,100,100,100,cv2.BORDER_REFLECT)
#resmi tekrar etme
tekrarlanan_resim=cv2.copyMakeBorde... | [
11748,
269,
85,
17,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
411,
320,
28,
33967,
17,
13,
320,
961,
7203,
324,
576,
45,
292,
270,
13,
9479,
4943,
201,
198,
201,
198,
2,
411,
11632,
334,
89,
265,
2611,
201,
19... | 2.056 | 375 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 18 17:45:32 2017
@author: Sujay
"""
import scipy.io
from nptdms import TdmsFile
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
file = scipy.io.loadmat('thermalLEDonly.mat')
data = file['data']
# Alternatively, use Python's T... | [
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,
2892,
8621,
1248,
1596,
25,
2231,
25,
2624,
2177,
198,
198,
31,
9800,
25,
1778,
33708,
19... | 1.98951 | 858 |
# coding=utf-8
# *** WARNING: this file was generated by the Kulado Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import kulado
import kulado.runtime
from .. import utilities, tables
| [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
50024,
4533,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,... | 3.723684 | 76 |
#
# 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 us... | [
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
393,
517,
198,
2,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
9387,
351,
198,
2,
428,
670,
329,
3224,
1321,
5115,
6634,
9238,
13,
198,
2,
383,
... | 3.267986 | 556 |
import logging
import string
from pyparsing import Optional, Suppress, Word
from regparser.grammar.utils import QuickSearchable
from regparser.layer.layer import Layer
logger = logging.getLogger(__name__)
level1 = Word("IVXLCDM").leaveWhitespace().setResultsName("l1")
level2 = Word(string.ascii_uppercase).leaveWhi... | [
11748,
18931,
198,
11748,
4731,
198,
198,
6738,
279,
4464,
945,
278,
1330,
32233,
11,
8105,
601,
11,
9678,
198,
198,
6738,
842,
48610,
13,
4546,
3876,
13,
26791,
1330,
12029,
18243,
540,
198,
6738,
842,
48610,
13,
29289,
13,
29289,
13... | 2.825153 | 326 |
'''Train CIFAR10 with PyTorch.'''
import argparse
import os
import time
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torchvision.transforms as transforms
from torch.utils.tensorboard import SummaryWriter
from utils import _compute_bag_metrics, search_count_all, _compute_instance_metrics, _sea... | [
7061,
6,
44077,
327,
5064,
1503,
940,
351,
9485,
15884,
354,
2637,
7061,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
28034,
13,
1891,
2412,
13,
66,
463,
20471,
355,
269,
463,
20471,
198,
11748,
28034,
13,
... | 2.587459 | 2,121 |
from bull_pen import make_bulls
import random
from round import Round
class Tournament():
"""Abstract Tournament Class"""
if __name__ == "__main__":
bulls = make_bulls()
tournament = Tournament(bulls)
print(tournament.make_bracket())
print(tournament.elite_eight())
print(tournament.final_four(... | [
6738,
6473,
62,
3617,
1330,
787,
62,
16308,
82,
198,
11748,
4738,
198,
6738,
2835,
1330,
10485,
198,
198,
4871,
9595,
33529,
198,
220,
220,
220,
37227,
23839,
9595,
5016,
37811,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
... | 3 | 120 |
# Generated by Django 2.2.7 on 2019-11-15 08:48
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
22,
319,
13130,
12,
1157,
12,
1314,
8487,
25,
2780,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
#!/usr/bin/env python3
#
# netrepl connect library
# this is a connection class to be used in other tools
#
# author: ulno
# create date: 2017-09-21
#
# based on telnet example at http://www.binarytides.com/code-telnet-client-sockets-python/
# Magic word for the protocol start
MAGIC = b"UlnoIOT-NetREPL:"
NETBUF_SIZE =... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
2010,
35666,
2018,
5888,
198,
2,
428,
318,
257,
4637,
1398,
284,
307,
973,
287,
584,
4899,
198,
2,
198,
2,
1772,
25,
14856,
3919,
198,
2,
2251,
3128,
25,
2177,
12,... | 2.977612 | 134 |
# Generated by Django 3.0.6 on 2020-05-29 07:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import uuid
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
21,
319,
12131,
12,
2713,
12,
1959,
8753,
25,
3682,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14... | 3.111111 | 72 |
#! /usr/bin/env python
"""Tests of functions in peyutil.tokenizer."""
import unittest
from copy import deepcopy
import os
from peyutil.test.support.pathmap import get_test_path_mapper
from peyutil import write_to_filepath
from peyutil import (NewickTokenizer, NewickEvents, NewickEventFactory, StringIO)
path_map = get_... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
51,
3558,
286,
5499,
287,
613,
88,
22602,
13,
30001,
7509,
526,
15931,
198,
11748,
555,
715,
395,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
28686,
198,
6738,
613,
88,
... | 2.153695 | 3,559 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (3,0,0):
new_instancemethod = lambda func, inst, cls: _BRepTop... | [
2,
770,
2393,
373,
6338,
7560,
416,
12672,
3528,
357,
4023,
1378,
2503,
13,
2032,
328,
13,
2398,
737,
198,
2,
10628,
362,
13,
15,
13,
940,
198,
2,
198,
2,
2141,
407,
787,
2458,
284,
428,
2393,
4556,
345,
760,
644,
345,
389,
1804... | 2.771678 | 4,244 |
#!/usr/bin/env python2.7
#Ryan G. Coleman
#buckets class is used for fast 3d point overlapping
#puts all points into buckets in each dimension
#only compare to reasonably nearby points
#assumes tolerance <<<< 1
from geometry import distL2Squared3
import math
class Bucket3d(object):
'''buckets class is used for fas... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
13,
22,
198,
198,
2,
21868,
402,
13,
22687,
198,
2,
27041,
1039,
1398,
318,
973,
329,
3049,
513,
67,
966,
32997,
198,
2,
1996,
82,
477,
2173,
656,
38674,
287,
1123,
15793,
198,
2,
... | 2.455008 | 1,967 |
# CDラジカセ
def get_E_Elc_audio_cd_radio_cassette_d_t( \
P_Elc_audio_cd_radio_cassette_rtd, \
P_Elc_audio_cd_radio_cassette_standby_rtd, \
t_audio_cd_radio_cassette_listening_d_t, \
t_audio_cd_radio_cassette_standby_d_t):
"""時刻別消費電力量を計算する
Parameters
----------
P_Elc_a... | [
2,
6458,
9263,
21091,
21763,
47271,
628,
198,
4299,
651,
62,
36,
62,
9527,
66,
62,
24051,
62,
10210,
62,
37004,
62,
66,
562,
5857,
62,
67,
62,
83,
7,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
350,
62,
9527,
66,
62,
24051,
... | 1.540687 | 1,659 |
import FWCore.ParameterSet.Config as cms
hcalNoise = cms.EDAnalyzer(
"HiHcalAnalyzer",
NoiseSummaryTag = cms.untracked.InputTag("hcalnoise"),
NoiseRBXTag = cms.untracked.InputTag("hcalnoise")
)
| [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
71,
9948,
2949,
786,
796,
269,
907,
13,
1961,
37702,
9107,
7,
198,
220,
220,
220,
366,
17250,
39,
9948,
37702,
9107,
1600,
198,
220,
220,
220,
30964,
22093,
2... | 2.051724 | 116 |
#
# Copyright (c) 2015-2020 Thierry Florac <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRAN... | [
2,
198,
2,
15069,
357,
66,
8,
1853,
12,
42334,
536,
959,
563,
4432,
330,
1279,
83,
2704,
273,
330,
5161,
14856,
400,
283,
13,
3262,
29,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
770,
3788,
318,
2426,
284,
262,
8617,
286,
... | 2.025349 | 11,756 |
from .equipment import Equipment
from .investment import ManualInvestment, Asset, OnlineInvestment
from .parity import Parity
from .users import User
from .article import Article
from .comment import ArticleComment, EquipmentComment
from .mobile_app import MobileApp
from .likes import Like
from .following import Follow... | [
6738,
764,
4853,
4667,
1330,
22412,
198,
6738,
764,
24859,
434,
1330,
17969,
19070,
434,
11,
31433,
11,
7467,
19070,
434,
198,
6738,
764,
1845,
414,
1330,
2547,
414,
198,
6738,
764,
18417,
1330,
11787,
198,
6738,
764,
20205,
1330,
10172... | 4.272059 | 136 |
#from pyhht.visualization import plot_imfs
from pyhht import EMD
from pyearth import Earth
import pandas as pd
import matplotlib.pyplot as plt
import pandas_datareader as pdr
from datetime import datetime
import numpy as np
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.ensemble import A... | [
2,
6738,
12972,
71,
4352,
13,
41464,
1634,
1330,
7110,
62,
320,
9501,
201,
198,
6738,
12972,
71,
4352,
1330,
412,
12740,
201,
198,
6738,
279,
1941,
400,
1330,
3668,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
2603,
2... | 1.960305 | 1,839 |
import pdb
import argparse
from matplotlib import pyplot as plt
import numpy as np
if __name__ == '__main__':
args = parse_args()
main(args)
| [
11748,
279,
9945,
198,
11748,
1822,
29572,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
... | 2.701754 | 57 |
# -*- coding: utf-8 -*-
"""
:author: 秋荏苒
:copyright: © 2019 by 秋荏苒 <nuanyang.44@gmail.com>.
:license: MIT, see LICENSE for more details.
"""
from flask import url_for
from test.base import BaseTestCase
from app.libs.extensions import db
from app.models import Admin
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
1058,
9800,
25,
13328,
100,
233,
164,
235,
237,
164,
233,
240,
198,
220,
220,
220,
1058,
22163,
4766,
25,
10673,
13130,
416,
13328,
100,
233... | 2.413793 | 116 |
try: # Python 2
from Tkinter import * # noqa
except ImportError: # Python 3
from tkinter import * # noqa
# vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
| [
28311,
25,
220,
1303,
11361,
362,
198,
220,
220,
220,
422,
309,
74,
3849,
1330,
1635,
220,
1303,
645,
20402,
198,
16341,
17267,
12331,
25,
220,
1303,
11361,
513,
198,
220,
220,
220,
422,
256,
74,
3849,
1330,
1635,
220,
1303,
645,
20... | 2.701493 | 67 |
from regression_tests import *
#class Test(Test):
#settings = TestSettings(
#input='mips-malware-29ce',
#args='-k --backend-no-opts'
#)
## TODO: there is plenty of strings, but we do not discover any of them.
## However, this empty test forces to check that decompilation was successful... | [
6738,
20683,
62,
41989,
1330,
1635,
198,
198,
2,
4871,
6208,
7,
14402,
2599,
198,
220,
220,
220,
1303,
33692,
796,
6208,
26232,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
15414,
11639,
76,
2419,
12,
7617,
1574,
12,
1959,
344,
... | 2.588608 | 158 |
from elo.elo import Rating
from elo.elo import Elo
__author__ = 'mivanov'
import pandas
import numpy as np
import os
import datetime
| [
6738,
1288,
78,
13,
22126,
1330,
12028,
198,
6738,
1288,
78,
13,
22126,
1330,
2574,
78,
198,
834,
9800,
834,
796,
705,
76,
13809,
709,
6,
198,
198,
11748,
19798,
292,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
... | 2.977778 | 45 |
from src import discordStuff
discordStuff.runBot()
| [
6738,
12351,
1330,
36446,
1273,
1648,
198,
198,
15410,
585,
1273,
1648,
13,
5143,
20630,
3419,
198
] | 3.058824 | 17 |
# UTF-8
# Visualize GEOS16 (west+east) RGB (true) color for a given
# time and location
# Amir Souri (ahsouri@cfa.harvard.edu;ahsouri@gmail.com)
# July 2021
| [
2,
41002,
12,
23,
198,
2,
15612,
1096,
22319,
2640,
1433,
357,
7038,
10,
23316,
8,
25228,
357,
7942,
8,
3124,
329,
257,
1813,
198,
2,
640,
290,
4067,
198,
2,
43931,
311,
10300,
357,
39095,
10300,
31,
12993,
64,
13,
9869,
10187,
13... | 2.711864 | 59 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from .utils import parse_limit
class RateLimitedFunction(object):
"""
Rate-limits the given function to ``limit`` frequency per key gen... | [
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,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,... | 3.304569 | 197 |
import sys
from rpython.tool.udir import udir
| [
11748,
25064,
198,
198,
6738,
374,
29412,
13,
25981,
13,
463,
343,
1330,
334,
15908,
628,
198
] | 2.882353 | 17 |
#!/usr/bin/env python3
import argparse
import fnmatch
import os
import json
import subprocess
YOUTUBE_DL_PATH = 'youtube-dl'
CONFIG_FILENAME = 'yps.json'
parser = argparse.ArgumentParser(description='Download and synchronise a directory with a youtube playlist')
parser.add_argument('--sync', required=False, nargs... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
24714,
15699,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
850,
14681,
628,
198,
56,
12425,
10526,
36,
62,
19260,
62,
34219,
796,
705,
11604... | 2.661316 | 623 |
import requests, json
from multiprocessing import Pool, cpu_count
from copy import deepcopy
from flask import Flask, redirect, url_for, render_template
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///gitStarredRepo.db'
app.config['SQLALCHEMY_TRACK_MODIFI... | [
11748,
7007,
11,
33918,
198,
6738,
18540,
305,
919,
278,
1330,
19850,
11,
42804,
62,
9127,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
42903,
1330,
46947,
11,
18941,
11,
19016,
62,
1640,
11,
8543,
62,
28243,
198,
6738,
42903,
62,
2... | 2.364557 | 395 |
from datetime import datetime, date, timedelta
from dmscripts.helpers.html_helpers import render_html
from dmscripts.helpers.logging_helpers import logging
from dmutils.formats import DATETIME_FORMAT, DISPLAY_DATE_FORMAT
logger = logging.getLogger('script')
MAILCHIMP_LIST_IDS = {
'digital-outcomes-and-speciali... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
3128,
11,
28805,
12514,
198,
198,
6738,
288,
907,
6519,
82,
13,
16794,
364,
13,
6494,
62,
16794,
364,
1330,
8543,
62,
6494,
198,
6738,
288,
907,
6519,
82,
13,
16794,
364,
13,
6404,
2667,
62,
... | 2.379098 | 3,081 |
brd = {
'name': ('StickIt! Buttons V2'),
'port': {
'pmod': {
'default' : {
'b0': 'd0',
'b1': 'd1',
'b2': 'd2',
'b3': 'd3'
}
},
'wing': {
'default' : {
'b0': 'd... | [
1671,
67,
796,
1391,
201,
198,
220,
220,
220,
705,
3672,
10354,
19203,
1273,
624,
1026,
0,
887,
27288,
569,
17,
33809,
201,
198,
220,
220,
220,
705,
634,
10354,
1391,
201,
198,
220,
220,
220,
220,
220,
220,
220,
705,
4426,
375,
10... | 1.266289 | 353 |
# -*- coding: utf-8 -*-
"""
documentation
"""
import molyso
from setuptools import setup, find_packages
setup(
name='molyso',
version=molyso.__version__,
description='MOther machine anaLYsis SOftware',
long_description='MOther machine anaLYsis SOftware - see https://github.com/modsim/molyso for detai... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
22897,
341,
198,
37811,
198,
198,
11748,
285,
3366,
568,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
40406,
7,
198,
220,
220,
... | 2.531381 | 478 |
from dotenv import load_dotenv
# Exports all the ENV Variables of the .env file
load_dotenv()
| [
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
2,
1475,
3742,
477,
262,
12964,
53,
15965,
2977,
286,
262,
764,
24330,
2393,
198,
2220,
62,
26518,
24330,
3419,
628,
628,
198
] | 3 | 33 |
from pyislands.permutation.crossover.cx import cyclic_crossover
| [
6738,
12972,
271,
4447,
13,
16321,
7094,
13,
66,
23954,
13,
66,
87,
1330,
11700,
291,
62,
66,
23954,
628,
198
] | 3.142857 | 21 |
import unittest
import os
import shutil
import json
import pandas as pd
os.environ["TESTING_LDT"] = "TRUE"
import ldt
from ldt.load_config import config
from ldt.helpers.ignore import ignore_warnings
path_to_resources = config["path_to_resources"]
class Tests(unittest.TestCase):
"""
The tests in this block... | [
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
33918,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
418,
13,
268,
2268,
14692,
51,
6465,
2751,
62,
11163,
51,
8973,
796,
366,
5446,
8924,
1,
198,
19... | 2.085501 | 3,076 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
from __future__ import absolute_import
__version__ = '0.0.1'
from .pandas_transformer import PandasTransformer
from .nx_transformer import GraphMLTransformer
from .rdf_transformer import RdfTransformer, ObanRdfTransformer, RdfOwlTransformer
from .sparql_transformer import SparqlTransformer, RedSparqlTransformer
from ... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
15,
13,
16,
6,
198,
198,
6738,
764,
79,
392,
292,
62,
7645,
16354,
1330,
16492,
292,
8291,
16354,
198,
6738,
764,
77,
87,
62,
7645,
16354,... | 3.314189 | 296 |
from __future__ import print_function
import sys, webbrowser, traceback
from tracestack.engines import GoogleEngine, StackEngine
from tracestack.utils import getch
class ExceptionHandler(object):
"""Callable exception handler that can replace sys.__excepthook__."""
def __init__(self, prompt=False, engine="de... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
25064,
11,
3992,
40259,
11,
12854,
1891,
198,
6738,
491,
330,
395,
441,
13,
1516,
1127,
1330,
3012,
13798,
11,
23881,
13798,
198,
6738,
491,
330,
395,
441,
13,
26791,
1330,
65... | 2.471667 | 600 |
r1 = float(input('Digite o primeiro lado: '))
r2 = float(input('Digite o segundo lado: '))
r3 = float(input('Digite o terceiro lado: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:
print('Os segmentos podem formar um triângulo ', end='')
if r1 == r2 == r3:
print('\033[31mEQUILÁTERO')
elif r1 ... | [
81,
16,
796,
12178,
7,
15414,
10786,
19511,
578,
267,
6994,
7058,
300,
4533,
25,
705,
4008,
198,
81,
17,
796,
12178,
7,
15414,
10786,
19511,
578,
267,
384,
70,
41204,
300,
4533,
25,
705,
4008,
198,
81,
18,
796,
12178,
7,
15414,
10... | 2.033898 | 236 |
# -*- coding: utf-8 -*-
"""DSML_Proj_01.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1LzFRTdgotPED3e-h8zF7nTSapBWgqQEq
# **Note: Works Best in Google Colab**
"""
!pip3 install geopandas
!pip install --upgrade plotly
# Commented out IPython ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
5258,
5805,
62,
2964,
73,
62,
486,
13,
541,
2047,
65,
198,
198,
38062,
4142,
7560,
416,
1623,
4820,
2870,
13,
198,
198,
20556,
2393,
318,
5140,
379,
198,
220,
... | 2.382599 | 19,642 |
"""
Authors: Elena Vasileva, Zoran Ivanovski
E-mail: elenavasileva95@gmail.com, mars@feit.ukim.edu.mk
Course: Mashinski vid, FEEIT, Spring 2021
Date: 26.03.2021
Description: function to load annotations for the GRAM Road-Traffic Monitoring dataset provided in XML format
Python version: 3.6
"""
# python imports
import... | [
37811,
198,
30515,
669,
25,
37254,
23663,
576,
6862,
11,
1168,
31884,
21798,
709,
20545,
198,
36,
12,
4529,
25,
1288,
268,
615,
292,
576,
6862,
3865,
31,
14816,
13,
785,
11,
48962,
31,
5036,
270,
13,
2724,
320,
13,
15532,
13,
28015,... | 2.446078 | 816 |
"""Run script for all linters."""
import subprocess
import sys
import typing
def main() -> None:
"""Run all linters.
Linter output will be sent to stdout.
This function will exit the script with return code 0 on success, and other
value on failure.
"""
is_success: bool = True
for linter_i... | [
37811,
10987,
4226,
329,
477,
9493,
1010,
526,
15931,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
19720,
628,
198,
4299,
1388,
3419,
4613,
6045,
25,
198,
220,
220,
220,
37227,
10987,
477,
9493,
1010,
13,
628,
220,
220,
220,
... | 2.246503 | 572 |
##############-----> Nested list question first solution <-------###############
main_list=[]
num_list=int(input("Enter how many indexes you want in main list => "))
counter=0
for i in range(num_list):
sub_list=[]
num_items=int(input("Enter how many indexes you want in sub list => "))
if num_items==0:
... | [
7804,
4242,
2235,
650,
3784,
399,
7287,
1351,
1808,
717,
4610,
1279,
26866,
7804,
4242,
21017,
220,
198,
198,
12417,
62,
4868,
28,
21737,
198,
22510,
62,
4868,
28,
600,
7,
15414,
7203,
17469,
703,
867,
39199,
345,
765,
287,
1388,
1351... | 2.210162 | 866 |
import os
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.model_selection import RepeatedKFold
from sklearn.metrics import classification_report
from ml_model import RandomForest
from ml_model import SVM
from mics ... | [
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
8997,
3351,
36213,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198... | 1.948344 | 2,536 |
print(
(
f := (
lambda t, i: t
if t[i] == 99
else f(
[
(
o := (
lambda y: lambda t, a, b, c: [
y(t, a, b) if x == c else i for x, i in enumerate(t)
... | [
4798,
7,
198,
220,
220,
220,
357,
198,
220,
220,
220,
220,
220,
220,
220,
277,
19039,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
256,
11,
1312,
25,
256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.358025 | 486 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import cm
import riskfolio.RiskFunctions as rk
__all__ = [
"plot_series",
"plot_frontier",
"plot_pie",
"plot_frontier_area",
"plot_risk_con",
"plot_hist",
"plot_drawdown",
]
rm_names = [
"Standard De... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
1330,
12067,
198,
11748,
2526,
13652,
13,
49,
1984,
24629,
2733,
355,
374,
... | 2.158106 | 11,954 |
import numpy as np
from matplotlib import pyplot as plt
from math import *
from utils import *
import statistics
DATASET_FOLDER = "calib_accel/"
raw = np.load(DATASET_FOLDER + 'raw.npy')
ax,ay,az = raw[:,3], raw[:,4], raw[:,5]
f = open(DATASET_FOLDER + "calib_accel.txt", 'w')
axb, axs = statistics.mean(ax), statis... | [
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
6738,
10688,
1330,
1635,
198,
198,
6738,
3384,
4487,
1330,
1635,
198,
11748,
7869,
198,
198,
35,
1404,
1921,
2767,
62,
37,
3535,
14418,
... | 2.230216 | 278 |
# -*- coding: utf-8 -*-
import os
from setuptools import find_packages, setup
# Include __about__.py.
__dir__ = os.path.dirname(__file__)
about = {}
with open(os.path.join(__dir__, 'tossi', '__about__.py')) as f:
exec(f.read(), about)
setup(
name='tossi',
version=about['__version__'],
license=about... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
628,
198,
2,
40348,
11593,
10755,
834,
13,
9078,
13,
198,
834,
15908,
834,
796,
28686,
... | 2.688073 | 545 |
import datetime
#Izbrisati nepotrebno u main i testu
#eps_start_end
#nauciti sta radi LAMBDA u GAE
#nauciti sta radi EPSILON u Adam
ENV_NAME = 'BipedalWalker-v3'
SEED = 9
NUMBER_OF_STEPS = 600 # probati 500, 600, 700, 800, ... 1500
NUMBER_OF_EPISODES = 100
BATCH_SIZE = 2048
MINIBATCH_SIZE = 32
UPDATE_STE... | [
11748,
4818,
8079,
201,
198,
201,
198,
2,
40,
89,
15311,
7246,
497,
13059,
34806,
3919,
334,
1388,
1312,
1332,
84,
201,
198,
2,
25386,
62,
9688,
62,
437,
201,
198,
2,
77,
14272,
8846,
336,
64,
19772,
406,
2390,
33,
5631,
334,
402,... | 2.084034 | 714 |
from django.contrib.auth.models import (
AbstractBaseUser,
BaseUserManager,
PermissionsMixin,
)
from django.utils import timezone
from django.core.mail import send_mail
from django.utils.translation import ugettext_lazy as _
from django.db import models
class UserManager(BaseUserManager):
"""
A cu... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
357,
198,
220,
220,
220,
27741,
14881,
12982,
11,
198,
220,
220,
220,
7308,
12982,
13511,
11,
198,
220,
220,
220,
2448,
8481,
35608,
259,
11,
198,
8,
198,
6738,
42625,
1... | 2.735905 | 337 |
"""
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)
You have the following 3 operations permitted on a word:
a) Insert a character
b) Delete a character
c) Replace a character
"""
| [
37811,
198,
15056,
734,
2456,
1573,
16,
290,
1573,
17,
11,
1064,
262,
5288,
1271,
286,
4831,
2672,
284,
10385,
1573,
16,
284,
1573,
17,
13,
357,
27379,
4905,
318,
14789,
355,
352,
2239,
2014,
198,
198,
1639,
423,
262,
1708,
513,
456... | 3.901408 | 71 |
# CSVLogging module. Provides output to CSV file for regular stats
import logging
| [
2,
44189,
11187,
2667,
8265,
13,
47081,
5072,
284,
44189,
2393,
329,
3218,
9756,
198,
198,
11748,
18931,
628
] | 4.421053 | 19 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
628,
198
] | 3 | 7 |
import sys, os, importlib, time, copy
import rasterio
import numpy as np
import pandas as pd
import geopandas as gpd
import osmnx as ox
import GOSTnets as gn
import skimage.graph as graph
from skimage.graph import _mcp
from rasterio.mask import mask
from rasterio import features
from shapely.geometry import box, Poin... | [
11748,
25064,
11,
28686,
11,
1330,
8019,
11,
640,
11,
4866,
198,
11748,
374,
1603,
952,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
30324,
392,
292,
355,
27809,
67,
198,
11748,
267,
5796,... | 2.284336 | 4,769 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
"""
Import Watford
"""
from data_collection.management.commands import BaseShpStationsShpDistrictsImporter
class Command(BaseShpStationsShpDistrictsImporter):
"""
Imports the Polling Station data from Watford
"""
council_id = 'E07000103'
districts_name = 'Watford_Polling_Districts'
stations... | [
37811,
198,
20939,
12242,
3841,
198,
37811,
198,
6738,
1366,
62,
43681,
13,
27604,
13,
9503,
1746,
1330,
7308,
2484,
79,
1273,
602,
2484,
79,
44857,
82,
3546,
26634,
198,
198,
4871,
9455,
7,
14881,
2484,
79,
1273,
602,
2484,
79,
44857... | 2.638158 | 152 |
#!/usr/bin/python3
from lxml import etree
''' LibXML2 API Documentation Data Classes '''
if __name__ == "__main__":
d = API_Doc.from_xmlfile('doc/libxml2-api.xml')
for v in d.typedefs.values(): print(v)
for v in d.functions.values(): print(v)
for v in d.structs.values(): print(v)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
198,
7061,
6,
7980,
55,
5805,
17,
7824,
43925,
6060,
38884,
705,
7061,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
129... | 2.353846 | 130 |
# Copyright 2021 Hathor Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
2,
15069,
33448,
36556,
273,
23500,
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.888199 | 161 |
import asyncio
import pytest
import queue
import traceback
import rx
import rx.operators as ops
from rx.subject import Subject
import rxsci as rs
from makinage.driver.app_sink import make_driver, Sink, Create, create_controllable_sink
@pytest.mark.asyncio
@pytest.mark.asyncio
| [
11748,
30351,
952,
198,
11748,
12972,
9288,
198,
11748,
16834,
198,
11748,
12854,
1891,
198,
198,
11748,
374,
87,
198,
11748,
374,
87,
13,
3575,
2024,
355,
39628,
198,
6738,
374,
87,
13,
32796,
1330,
15540,
198,
11748,
374,
34223,
979,
... | 2.9375 | 96 |
# coding=utf-8
# Copyright 2020 TF.Text 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
12131,
24958,
13,
8206,
46665,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
... | 3.603636 | 275 |
'''Test idlelib.help_about.
Coverage:
'''
from idlelib import aboutDialog as help_about
from idlelib import textView as textview
from idlelib.idle_test.mock_idle import Func
from idlelib.idle_test.mock_tk import Mbox
import unittest
About = help_about.AboutDialog
class DisplayFileTest(unittest.TestCase... | [
7061,
6,
14402,
21696,
8019,
13,
16794,
62,
10755,
13,
201,
198,
201,
198,
7222,
1857,
25,
201,
198,
7061,
6,
201,
198,
6738,
21696,
8019,
1330,
546,
44204,
355,
1037,
62,
10755,
201,
198,
6738,
21696,
8019,
1330,
2420,
7680,
355,
2... | 2.563725 | 204 |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
2,
15069,
2177,
3012,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 2.564598 | 7,864 |
# !usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'wtq'
import ast
import json
import redis
from config.config import REDIS_HOST, REDIS_PORT
r = redis.Redis(REDIS_HOST, REDIS_PORT)
def get_node_continuous_info(node_name):
"""
根据node_name 返回一段时间内的连续信息
:param node_name:
:return:
"""
c... | [
2,
5145,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
834,
9800,
834,
796,
705,
46569,
80,
6,
198,
198,
11748,
6468,
198,
11748,
33918,
198,
11748,
2266,
271,
198,
6738,
45... | 2.253425 | 292 |
import keras
from keras.datasets import mnist
from keras.utils import np_utils
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.models import Sequential
import matplotlib.pyplot as plt
# 保存模型,权重
import tempfile
from keras.models import save_model, load_model
import numpy as np
# 将数据读入
(x_train, ... | [
198,
11748,
41927,
292,
198,
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
285,
77,
396,
198,
6738,
41927,
292,
13,
26791,
1330,
45941,
62,
26791,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
360,
1072,
11,
14258,
448,
11,
13144,
341,
... | 2.113611 | 889 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-22 17:17
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
17,
319,
2177,
12,
3312,
12,
1828,
1596,
25,
1558,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.736842 | 57 |
import gc
import os
import keras
import numpy as np
import tensorflow as tf
from keras import backend as K
from keras.activations import relu, sigmoid
from keras.layers import Conv2D, Input
from keras.models import Model
from sklearn.model_selection import train_test_split, KFold
from tensorflow.python.keras.utils.np_... | [
11748,
308,
66,
198,
11748,
28686,
198,
198,
11748,
41927,
292,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
41927,
292,
1330,
30203,
355,
509,
198,
6738,
41927,
292,
13,
15791,
602,
1330,
82... | 2.898923 | 2,414 |
#!/usr/bin/env python3
# https://codeforces.com/problemset/problem/748/A
n,m,k = list(map(int,input().split()))
print((k+(m<<1)-1)//(m<<1), ((k-1)//2)%m+1, ['R','L'][k%2])
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
3740,
1378,
19815,
891,
273,
728,
13,
785,
14,
1676,
22143,
316,
14,
45573,
14,
48246,
14,
32,
198,
198,
77,
11,
76,
11,
74,
220,
220,
796,
1351,
7,
8899,
7,
600,
1... | 1.913043 | 92 |