content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
import signal
from datetime import datetime
from time import sleep
import click
import numpy as np
from . import backends
from .coupling import Plotter
@click.command()
@click.option("--goal", default=1.0, help="Goal in W")
@click.option("--logging", default=False, help="logging beahviour", ... | [
11748,
28686,
201,
198,
11748,
6737,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
6738,
640,
1330,
3993,
201,
198,
201,
198,
11748,
3904,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
6738,
764,
1330,
736,
24... | 2.93133 | 233 |
#!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 3/25/14
###Function: scatterplots of CDC severity index vs. prominent strain, vax match, vax coverage, and vax efficacy
###Import data: /home/elee/Dropbox/Elizabeth_Bansal_Lab/CDC_Source/Import_Data/c... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
29113,
7804,
4242,
2235,
198,
21017,
37906,
11055,
198,
21017,
13838,
25,
10674,
5741,
198,
21017,
10430,
25,
513,
14,
1495,
14,
1415,
198,
21017,
22203,
25,
41058,
489,
1747,
286,
20434,
... | 2.735326 | 2,777 |
from typing import List, Optional
from cloudrail.knowledge.context.aws.service_name import AwsServiceName
from cloudrail.knowledge.context.aws.aws_resource import AwsResource
class S3BucketLogging(AwsResource):
"""
Attributes:
bucket_name: The bucket which the logs associated with.
... | [
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
6738,
6279,
30224,
13,
45066,
13,
22866,
13,
8356,
13,
15271,
62,
3672,
1330,
5851,
82,
16177,
5376,
198,
6738,
6279,
30224,
13,
45066,
13,
22866,
13,
8356,
13,
8356,
62,
31092,
1330,
5851... | 2.931677 | 161 |
#!/usr/bin/env python
import glob
import os.path
import re
warnings = 0
if __name__ == '__main__':
print(120 * '-')
check_structure()
check_examples()
print(120 * '-')
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
15095,
198,
11748,
28686,
13,
6978,
198,
11748,
302,
198,
198,
40539,
654,
796,
657,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,... | 2.358025 | 81 |
import numpy as np
if __name__=="__main__":
main() | [
198,
11748,
299,
32152,
355,
45941,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
197,
12417,
3419
] | 2.47619 | 21 |
# -*- coding: utf-8 -*-
"""
radiospectra
============
Provide support for some type of radiospectra on solar physics.
"""
# Enforce Python version check during package import.
# This is the same check as the one at the top of setup.py
from __future__ import absolute_import, division, print_function
import sys
__mini... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
6335,
4267,
806,
430,
198,
25609,
198,
198,
15946,
485,
1104,
329,
617,
2099,
286,
40023,
806,
430,
319,
6591,
11887,
13,
198,
37811,
198,
2,
2039,
3174,
1... | 2.981651 | 327 |
import datetime
from aerismodsdk.utils.loggerutils import logger
# Print if verbose flag set
| [
11748,
4818,
8079,
198,
6738,
9551,
1042,
12978,
34388,
13,
26791,
13,
6404,
1362,
26791,
1330,
49706,
628,
198,
2,
12578,
611,
15942,
577,
6056,
900,
628,
628,
198
] | 3.413793 | 29 |
"""GRId LOgic Puzzle Solver"""
from .geometry import *
from .grids import *
from .symbols import *
| [
37811,
38,
7112,
67,
17579,
70,
291,
23966,
4294,
332,
37811,
198,
198,
6738,
764,
469,
15748,
1330,
1635,
198,
6738,
764,
2164,
2340,
1330,
1635,
198,
6738,
764,
1837,
2022,
10220,
1330,
1635,
198
] | 2.857143 | 35 |
import random
from flask_api import status
from models.main import *
from models.appendix import *
from models.prescription import *
from flask import Blueprint, request
from flask_jwt_extended import (create_access_token, create_refresh_token,
jwt_required, get_jwt_identity)
from dateti... | [
11748,
4738,
198,
6738,
42903,
62,
15042,
1330,
3722,
198,
6738,
4981,
13,
12417,
1330,
1635,
198,
6738,
4981,
13,
1324,
19573,
1330,
1635,
198,
6738,
4981,
13,
18302,
6820,
1330,
1635,
198,
6738,
42903,
1330,
39932,
11,
2581,
198,
6738... | 2.665505 | 287 |
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
print('===test===')
print(__file__)
print(os.path.dirname(__file__))
print(os.path.abspath(os.path.dirname(__file__)))
print(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) | [
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
35514,
198,
4798,
10786,
18604,
9288,
... | 2.418803 | 117 |
import argparse
import os
import shutil
import random
import cv2
import yaml
from imutils import paths
from sklearn.model_selection import train_test_split
from tqdm import tqdm
from dataset.constants import NORMALIZATION_WIDTH, NORMALIZATION_HEIGHT, RANDOM_SEED
from python_developer_tools.cv.datasets.datasets_utils ... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
4738,
198,
198,
11748,
269,
85,
17,
198,
11748,
331,
43695,
198,
6738,
545,
26791,
1330,
13532,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288... | 2.179367 | 853 |
from cython_npm.cythoncompile import export
# export('test_cythonarray.pyx')
import test_cythonarray
| [
6738,
3075,
400,
261,
62,
77,
4426,
13,
948,
400,
261,
5589,
576,
1330,
10784,
198,
2,
10784,
10786,
9288,
62,
948,
400,
261,
18747,
13,
9078,
87,
11537,
198,
11748,
1332,
62,
948,
400,
261,
18747,
198
] | 2.657895 | 38 |
"""
Module:
genie.libs.parser.ironware.show_routing
Author:
James Di Trapani <james@ditrapani.com.au> - https://github.com/jamesditrapani
Description:
Routing based parsers for IronWare devices
Parsers:
* show ip route
* show ip route summary
"""
from genie.metaparser import MetaParser
from geni... | [
37811,
198,
26796,
25,
198,
220,
220,
220,
2429,
494,
13,
8019,
82,
13,
48610,
13,
1934,
1574,
13,
12860,
62,
81,
13660,
198,
198,
13838,
25,
198,
220,
220,
220,
3700,
6031,
21914,
3216,
1279,
73,
1047,
31,
5266,
2416,
3216,
13,
7... | 1.917818 | 2,677 |
# Generated by Django 3.0.5 on 2020-04-27 14:15
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
20,
319,
12131,
12,
3023,
12,
1983,
1478,
25,
1314,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
import matplotlib.pyplot as plt
import pandas as pd
import sys
umiBinPath = sys.argv[1]
umiBins = pd.read_csv(umiBinPath, sep='\t')
#umiBins = umiBins[umiBins.iloc[:, 1] > 4]
plt.hist(umiBins.iloc[:, 1])
plt.ylabel('Count')
plt.xlabel('Cluster Size')
output = umiBinPath.split('.')[0] + '_hist.png'
plt.savefig(output... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
25064,
198,
198,
12994,
33,
259,
15235,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
12994,
33,
1040,
796,
279,
67,
13,
961,
6... | 2.161074 | 149 |
from typing import Callable, Type, TypeVar
protocol = TypeVar("protocol")
| [
6738,
19720,
1330,
4889,
540,
11,
5994,
11,
5994,
19852,
198,
198,
11235,
4668,
796,
5994,
19852,
7203,
11235,
4668,
4943,
628
] | 3.454545 | 22 |
from manimlib.constants import *
from manimlib.mobject.types.vectorized_mobject import VMobject
from manimlib.mobject.types.vectorized_mobject import VGroup
from manimlib.utils.rate_functions import smooth
from manimlib.utils.space_ops import get_norm
| [
6738,
582,
320,
8019,
13,
9979,
1187,
1330,
1635,
198,
6738,
582,
320,
8019,
13,
76,
15252,
13,
19199,
13,
31364,
1143,
62,
76,
15252,
1330,
16990,
15252,
198,
6738,
582,
320,
8019,
13,
76,
15252,
13,
19199,
13,
31364,
1143,
62,
76,... | 3.25641 | 78 |
#!/usr/bin/env python3
# Copyright 2021 Jetperch LLC
#
# 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 o... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
33448,
19013,
525,
354,
11419,
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,
2... | 3.513834 | 253 |
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import socket
import time
SEL_LDR_RSP_SOCKET_ADDR = ('localhost', 4014)
# Send an rsp message, but don't wait for or expect a repl... | [
2,
15069,
357,
66,
8,
2321,
383,
12547,
20985,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
... | 3.262626 | 99 |
import unittest
import os
from setuptools import setup, find_packages
from distutils.core import Command
from chatbot_utils import __version__
HERE = os.path.abspath(os.path.dirname(__file__))
README = os.path.join(HERE, "README.rst")
REQFILE = 'requirements.txt'
classifiers = [
'License :: OSI Approved :: Apac... | [
11748,
555,
715,
395,
198,
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
1233,
26791,
13,
7295,
1330,
9455,
198,
198,
6738,
8537,
13645,
62,
26791,
1330,
11593,
9641,
834,
628,
198,
39,
9338,
... | 2.728507 | 442 |
import matplotlib.pyplot as plt
import numpy.random as rnd
from matplotlib.patches import Ellipse
NUM = 250
ells = [Ellipse(xy=rnd.rand(2)*10, width=rnd.rand(), height=rnd.rand(), angle=rnd.rand()*360)
for i in range(NUM)]
fig = plt.figure(0)
ax = fig.add_subplot(111, aspect='equal')
for e in ells:
ax.ad... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
13,
25120,
355,
374,
358,
198,
6738,
2603,
29487,
8019,
13,
8071,
2052,
1330,
7122,
541,
325,
198,
198,
41359,
796,
8646,
198,
198,
19187,
796,
685,
3063... | 2.107143 | 224 |
from marshmallow import fields, validate
from api.utils.marshmallow_schemas import BaseSchema
class UserSchema(BaseSchema):
"""User serializer/validator."""
society_id = fields.String(dump_only=True, dump_to='societyId',
validate=[validate.Length(max=36)])
center_id = fiel... | [
6738,
22397,
42725,
1330,
7032,
11,
26571,
198,
198,
6738,
40391,
13,
26791,
13,
76,
5406,
42725,
62,
1416,
4411,
292,
1330,
7308,
27054,
2611,
628,
198,
4871,
11787,
27054,
2611,
7,
14881,
27054,
2611,
2599,
198,
220,
220,
220,
37227,
... | 2.25 | 280 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains item buttons for Outliner
"""
from __future__ import print_function, division, absolute_import
__author__ = "Tomas Poveda"
__license__ = "MIT"
__maintainer__ = "Tomas Poveda"
__email__ = "tpovedatd@gmail.com"
from artellapipe.tools.outliner.core... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
26796,
326,
4909,
2378,
12163,
329,
3806,
24683,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
... | 2.772727 | 132 |
from __future__ import annotations
import logging
import os
from os import path
import shutil
from typing import Optional
from . import base_step, schemas
from ..storage import make_provider
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
28686,
1330,
3108,
198,
11748,
4423,
346,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
764,
1330,
2779,
62,
9662,
11,
3897,
5356,
198,
6738,
11485,
... | 4.085106 | 47 |
# -*- coding: utf-8 -*-
"""
@author: Pankaj Mishra
"""
import torch
import mvtech
import torch.nn.functional as F
import os
import numpy as np
import pytorch_ssim
from einops import rearrange
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve, auc
from sklearn.metrics import precision_reca... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
9800,
25,
350,
962,
1228,
39523,
430,
198,
37811,
198,
198,
11748,
28034,
198,
11748,
285,
85,
13670,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
... | 2.126029 | 1,944 |
# -*- coding: utf-8 -*-
import logging
import numpy as np
import sklearn_lvq
import cvxpy as cp
from ..backend.jax.layer import create_tensor
from ..backend.jax.costfunctions import MinOfListDistCost, MinOfListDistExCost, RegularizedCost
from ..model import ModelWithLoss
from .utils import desc_to_dist
from .counterfa... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1341,
35720,
62,
6780,
80,
198,
11748,
269,
85,
87,
9078,
355,
31396,
198,
198,
6738,
11485,
1891,
437,
13,... | 2.484999 | 4,633 |
import tensorflow as tf
import game
import random
p1 = game.PerfectPongPlayer()
p2 = game.PerfectPongPlayer()
trainingGame = game.PongGame(p1, p2)
train_inputs = []
train_outputs = []
test_inputs = []
test_outputs = []
"""
for i in range(10000):
train_inputs.append(trainingGame.getBoardState(0))
train_outpu... | [
11748,
11192,
273,
11125,
355,
48700,
220,
198,
198,
11748,
983,
198,
11748,
4738,
198,
198,
79,
16,
796,
983,
13,
36635,
47,
506,
14140,
3419,
198,
79,
17,
796,
983,
13,
36635,
47,
506,
14140,
3419,
198,
34409,
8777,
796,
983,
13,
... | 2.493177 | 513 |
from setuptools import setup, find_packages
from os.path import join, dirname
import sys
if sys.version_info[0] != 3 or sys.version_info[1] < 6:
print("This script requires Python >= 3.6")
exit(1)
setup(
name="vkmix",
version="1.5",
author="alekssamos",
author_email="aleks-samos@yandex.ru",
url="... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
26672,
3672,
198,
11748,
25064,
198,
361,
25064,
13,
9641,
62,
10951,
58,
15,
60,
14512,
513,
393,
25064,
13,
9641,
62,
10951,
58,
... | 2.589862 | 217 |
"""The same environment, except the action space is for the attacker, not the defender."""
# THIS IS ENTIRELY UNTESTED.
import logging
import math
import gym
from gym.envs.maithra import erdosgame
from gym import spaces
from gym.utils import seeding
import numpy as np
import random
logger = logging.getLogger(__name__... | [
37811,
464,
976,
2858,
11,
2845,
262,
2223,
2272,
318,
329,
262,
15250,
11,
407,
262,
13191,
526,
15931,
198,
2,
12680,
3180,
47353,
41736,
11319,
4725,
51,
6465,
1961,
13,
198,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
11550,
... | 3.172973 | 185 |
"""
From SQLAlchemy quickstart gist by
https://github.com/nonchris/
Link to gist:
https://gist.github.com/nonchris/046f58bcefdcea5606f670b74f375254
discord bot template:
https://github.com/nonchris/discord-bot
"""
# core interface to the database
import os
import logging
import sqlalchemy.orm
from sqlalchemy import... | [
37811,
198,
4863,
16363,
2348,
26599,
2068,
9688,
50057,
416,
198,
5450,
1378,
12567,
13,
785,
14,
13159,
354,
2442,
14,
198,
198,
11280,
284,
50057,
25,
198,
5450,
1378,
70,
396,
13,
12567,
13,
785,
14,
13159,
354,
2442,
14,
45438,
... | 3.185106 | 470 |
from __future__ import absolute_import
input_name = '../examples/navier_stokes/stokes_slip_bc.py'
output_name = 'test_stokes_slip_bc.vtk'
from tests_basic import TestInput
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
15414,
62,
3672,
796,
705,
40720,
1069,
12629,
14,
77,
19492,
62,
301,
3369,
14,
301,
3369,
62,
6649,
541,
62,
15630,
13,
9078,
6,
198,
22915,
62,
3672,
796,
705,
9288,
62,
301,
... | 2.746032 | 63 |
"""
Welcomes new users to UQCS Slack and check for member milestones
"""
from uqcsbot import bot
import time
MEMBER_MILESTONE = 50 # Number of members between posting a celebration
MESSAGE_PAUSE = 2.5 # Number of seconds between sending bot messages
WELCOME_MESSAGES = [ # Welcome messages sent to new members
... | [
37811,
198,
54,
417,
8988,
649,
2985,
284,
471,
48,
7902,
36256,
290,
2198,
329,
2888,
41926,
198,
37811,
198,
6738,
334,
80,
6359,
13645,
1330,
10214,
198,
11748,
640,
198,
198,
44,
28952,
62,
44,
4146,
6465,
11651,
796,
2026,
220,
... | 2.797632 | 929 |
# -*- coding: utf-8 -*-
# admin.py - Waqas Bhatti (wbhatti@astro.princeton.edu) - Aug 2018
# License: MIT - see the LICENSE file for the full text.
"""This contains functions to drive admin related actions (listing users,
editing users, change user roles).
"""
#############
## LOGGING ##
#############
import logging... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
13169,
13,
9078,
532,
15329,
80,
292,
347,
11653,
72,
357,
39346,
11653,
72,
31,
459,
305,
13,
1050,
1939,
18483,
13,
15532,
8,
532,
2447,
2864,
198,
2,
13789,
25... | 1.929118 | 35,171 |
from pathlib import Path
from pymerra2 import download
download_dir = Path.cwd().joinpath("downloaded")
# Download Fire Weather indices from the public https NCCS portal.
# Filenames and path are quite different than the MERRA2 products, thus the different file.
url_template = (
"https://portal.nccs.nasa.gov/dat... | [
6738,
3108,
8019,
1330,
10644,
198,
6738,
12972,
647,
430,
17,
1330,
4321,
198,
198,
15002,
62,
15908,
796,
10644,
13,
66,
16993,
22446,
22179,
6978,
7203,
2902,
14578,
4943,
198,
198,
2,
10472,
3764,
15615,
36525,
422,
262,
1171,
3740,... | 2.231198 | 718 |
#-----------------------------------------------------------------------------
# Copyright (c) 2020, Greg Landrum
# All rights reserved.
#
# The full license is in the LICENSE file, distributed with this software.
#-----------------------------------------------------------------------------
import unittest
import int... | [
2,
10097,
32501,
198,
2,
15069,
357,
66,
8,
12131,
11,
8547,
6379,
6582,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
383,
1336,
5964,
318,
287,
262,
38559,
24290,
2393,
11,
9387,
351,
428,
3788,
13,
198,
2,
10097,
32501,
198,
... | 5.651515 | 66 |
"""
Playing With Stairs
Imagine you want to determine all the different ways you can reach a specific stair in a staircase by hopping one, two, or three stairs at a time. How many paths are there to the fourth stair? Here are all the different combinations:
"""
from visualiser.visualiser import Visualiser as vs
from ... | [
198,
37811,
198,
36530,
2080,
520,
3468,
198,
25153,
345,
765,
284,
5004,
477,
262,
1180,
2842,
345,
460,
3151,
257,
2176,
18761,
287,
257,
27656,
416,
47153,
530,
11,
734,
11,
393,
1115,
16046,
379,
257,
640,
13,
1374,
867,
13532,
... | 3.213198 | 197 |
from importlib import import_module
from django.conf import settings
from django.utils import six
def import_from_string(val, setting_name):
"""
Attempt to import a class from a string representation.
"""
try:
# Nod to tastypie's use of importlib.
module_path, class_name = val.rsplit(... | [
6738,
1330,
8019,
1330,
1330,
62,
21412,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
1330,
2237,
628,
198,
4299,
1330,
62,
6738,
62,
8841,
7,
2100,
11,
4634,
62,
3672,
2599,
198,
220,
220,
... | 2.710956 | 429 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 2 09:25:41 2019
@author: michaelek
"""
# import pytest
import numpy as np
import os
import yaml
import tethys_utils as tu
import pandas as pd
# from tethys_utils.datasets import get_path
pd.options.display.max_columns = 10
#############################################... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
5979,
220,
362,
7769,
25,
1495,
25,
3901,
13130,
198,
198,
31,
9800,
25,
285,
488,
3609,
293,
74,
198,
37811,
198,
2,
1330,
12972,
9288,... | 2.368492 | 1,479 |
import bottle_session
from bottle import Bottle, TEMPLATE_PATH
from bottle.ext import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
engine = create_engine('sqlite:///database.db', echo=True)
app = Bottle()
TEMPLATE_PATH.insert(0, 'app... | [
11748,
9294,
62,
29891,
198,
6738,
9294,
1330,
33608,
11,
309,
3620,
6489,
6158,
62,
34219,
198,
6738,
9294,
13,
2302,
1330,
44161,
282,
26599,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
6738,
44161,
282,
26599,
13,
2302,... | 3.004651 | 215 |
from . import traversal
from . import history
from . import reconstruction
from . import distribution
from . import manifold | [
6738,
764,
1330,
33038,
282,
198,
6738,
764,
1330,
2106,
198,
6738,
764,
1330,
25056,
198,
6738,
764,
1330,
6082,
198,
6738,
764,
1330,
48048
] | 4.96 | 25 |
from django.db.models import Count, Sum, F, FloatField
from django.db.models.functions import Cast
from rest_framework import viewsets, generics
from django_filters import rest_framework as rest_filters
import rest_framework
from . import models
from . import serializers
from . import filters
| [
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
2764,
11,
5060,
11,
376,
11,
48436,
15878,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12543,
2733,
1330,
5833,
198,
6738,
1334,
62,
30604,
1330,
5009,
1039,
11,
1152,
873,
198,
673... | 3.782051 | 78 |
"""
Test cases distinguishing the source types.
"""
import pytest
from astropy.visualization import LinearStretch
from sunpy.data.test import get_test_filepath
from sunpy.map import Map
from sunpy.map.sources.source_type import from_helioviewer_project, source_stretch
from sunpy.tests.helpers import skip_glymur
@py... | [
37811,
198,
14402,
2663,
38607,
262,
2723,
3858,
13,
198,
37811,
198,
11748,
12972,
9288,
198,
198,
6738,
6468,
28338,
13,
41464,
1634,
1330,
44800,
39181,
198,
198,
6738,
4252,
9078,
13,
7890,
13,
9288,
1330,
651,
62,
9288,
62,
7753,
... | 2.75766 | 359 |
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import os
import sys
import setuptools
from distutils import log
PY3 = sys.version_info[0] >= 3
from setuptools.command import bdist_egg as _bdist_egg
# We had to override this method so that setuptools would not write the
# bootstrap over the one we created.
_bdist... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
900,
37623,
10141,
198,
6738,
1233,
26791,
1330,
2604,
... | 2.785714 | 126 |
#!/usr/bin/env python3
# file: thread_demo_1.py
# Created by Guang at 19-7-15
# description:
# *-* coding:utf8 *-*
import threading
import time
class MyThread(threading.Thread):
"""自定义的多线程类"""
def other_func(self):
"""在这里定义其他方法"""
pass
if __name__ == '__main__':
main()
###########... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
2393,
25,
4704,
62,
9536,
78,
62,
16,
13,
9078,
198,
2,
15622,
416,
36980,
379,
678,
12,
22,
12,
1314,
198,
2,
6764,
25,
198,
198,
2,
1635,
12,
9,
19617,
25,
40477,
23,
... | 1.04908 | 652 |
from abc import ABCMeta
from collections import ChainMap
from collections.abc import Mapping
from typing import Iterable
class Callback(metaclass=ABCMeta):
""" Base class of Callback class
"""
class CallbackList(Callback):
""" Combine some callbacks
:param callbacks: callbacks
"""
@static... | [
6738,
450,
66,
1330,
9738,
48526,
198,
6738,
17268,
1330,
21853,
13912,
198,
6738,
17268,
13,
39305,
1330,
337,
5912,
198,
6738,
19720,
1330,
40806,
540,
628,
198,
4871,
4889,
1891,
7,
4164,
330,
31172,
28,
24694,
48526,
2599,
198,
220,... | 3.336735 | 98 |
import unittest
import psycopg2
import psycopg2.extras
from decimal import Decimal
from datetime import datetime, date, timedelta
from settings import DB_CONN_STRING
from cmanager import CreditManager
from cmanager.exceptions import (
InvalidPayment, InvalidWithdrawal,
WithdrawalDenied, InvalidParameterValue,... | [
11748,
555,
715,
395,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
17331,
22163,
70,
17,
13,
2302,
8847,
198,
6738,
32465,
1330,
4280,
4402,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
3128,
11,
28805,
12514,
198,
198,
6738,
6460,
1... | 2.638509 | 805 |
# 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... | [
2,
220,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
220,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
220,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
220,
5115,
6634,
9238,... | 3.718254 | 252 |
import unittest
import pprint
from QUANTAXIS import QUANTAXIS as QA
from QUANTAXIS.QAUtil.QADate import *
from QUANTAXIS.QAUtil.QADate_trade import *
#from QUANTAXIS.QAFetch.QATdx import (QA_fetch_get_option_contract_time_to_market)
from QUANTAXIS.QAFetch.QATdx import (QA_fetch_get_commodity_option_M_contract_time_to... | [
11748,
555,
715,
395,
198,
11748,
279,
4798,
198,
198,
6738,
19604,
1565,
5603,
55,
1797,
1330,
19604,
1565,
5603,
55,
1797,
355,
1195,
32,
198,
6738,
19604,
1565,
5603,
55,
1797,
13,
48,
32,
18274,
346,
13,
48,
2885,
378,
1330,
163... | 2.288018 | 434 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
from django.utils.translation import gettext as _
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from pretix.api.serializers.i18n import I18nAwareModelSerializer
from pretix.base.channels import get_all_sales_channels
from pretix.base.models import CheckinList
| [
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
355,
4808,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
1334,
62,
30604,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
198,
6738,
2181,
844,
13,
15042,
13,
46911... | 3.551724 | 87 |
"""
algorithm refactored from CairX/extract-colors-py by Thomas Cairns
"""
import collections
import math
from convcolors import rgb_to_lab
def diff_cie76(c1, c2):
"""
Color comparision using CIE76 algorithm.
Returns a float value where 0 is a perfect match and 100 is
opposing colors. Note that the r... | [
37811,
198,
282,
42289,
1006,
529,
1850,
422,
327,
958,
55,
14,
2302,
974,
12,
4033,
669,
12,
9078,
416,
5658,
327,
958,
5907,
198,
37811,
198,
11748,
17268,
198,
11748,
10688,
198,
6738,
3063,
4033,
669,
1330,
46140,
62,
1462,
62,
... | 2.244304 | 1,580 |
import numpy as np
import pickle
from os import path, mkdir
import argparse
from shutil import rmtree
# The shape is (100, 3, 300, 18, 2), we want (100, 2, 300, 18, 2) - where the second shape has the last value removed
# We want to remove the joins specified in remove_joints
# Function for creating dataset
# name: ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
6738,
28686,
1330,
3108,
11,
33480,
15908,
198,
11748,
1822,
29572,
198,
6738,
4423,
346,
1330,
374,
16762,
631,
198,
198,
2,
383,
5485,
318,
357,
3064,
11,
513,
11,
5867,
11,... | 3.449541 | 327 |
# Copyright 2018 BMW Car IT GmbH
#
# 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 writi... | [
2,
15069,
2864,
19339,
1879,
7283,
402,
2022,
39,
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,
1... | 3.211236 | 445 |
import pytest
import json
from pathlib import Path
from lib.common.storage import LocalStorage
@pytest.fixture
| [
11748,
12972,
9288,
198,
11748,
33918,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
9195,
13,
11321,
13,
35350,
1330,
10714,
31425,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
628,
198
] | 3.545455 | 33 |
import random
import time
print('Version 1.0.2.')
print('Designed by dwy.')
print('Coded by zcy.')
print('设定目标数字的区间。注意:此程序要求上下确界的整数位至少相差4。')
min=int(float(input('请输入目标数字的取值下确界:')))
max=int(float(input('请输入目标数字的取值上确界:')))
while min>=max-3:
print('所输入的数字不符合要求,请重新输入。注意:此程序要求上下确界的整数位至少相差4。')
min=int(input... | [
11748,
4738,
201,
198,
11748,
640,
201,
198,
4798,
10786,
14815,
352,
13,
15,
13,
17,
2637,
8,
201,
198,
4798,
10786,
5960,
3916,
416,
288,
21768,
2637,
8,
201,
198,
4798,
10786,
34,
9043,
416,
1976,
948,
2637,
8,
201,
198,
4798,
... | 1.331822 | 1,103 |
from __future__ import print_function
import ncepbufr
import sys
# print inventory of specified bufr file
bufr = ncepbufr.open(sys.argv[1])
for n,msg in enumerate(bufr.inventory()):
out = (n+1,)+msg
print('message %s: %s %s %s %s subsets' % out)
bufr.close()
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
299,
344,
79,
29325,
81,
198,
11748,
25064,
198,
198,
2,
3601,
13184,
286,
7368,
809,
8310,
2393,
198,
198,
29325,
81,
796,
299,
344,
79,
29325,
81,
13,
9654,
7,
17597,
13,
... | 2.514019 | 107 |
import logging
| [
11748,
18931,
198
] | 5 | 3 |
import os
import chess
| [
11748,
28686,
198,
11748,
19780,
628,
628,
628,
628
] | 3.333333 | 9 |
from robogym.envs.rearrange.common.base import RearrangeEnvConstants
from robogym.envs.rearrange.goals.pickandplace import PickAndPlaceGoal
from robogym.envs.rearrange.simulation.mesh import MeshRearrangeSim
from robogym.envs.rearrange.ycb import YcbRearrangeEnv
make_env = YcbPickAndPlaceEnv.build
| [
6738,
3857,
519,
4948,
13,
268,
14259,
13,
260,
3258,
858,
13,
11321,
13,
8692,
1330,
30144,
9521,
4834,
85,
34184,
1187,
198,
6738,
3857,
519,
4948,
13,
268,
14259,
13,
260,
3258,
858,
13,
2188,
874,
13,
27729,
392,
5372,
1330,
123... | 2.745455 | 110 |
from cruditor.filters import AnyChoiceFilter, MultiCharFilter
from examples.store.models import Person
| [
6738,
1067,
463,
2072,
13,
10379,
1010,
1330,
4377,
46770,
22417,
11,
15237,
12441,
22417,
198,
6738,
6096,
13,
8095,
13,
27530,
1330,
7755,
628,
198
] | 4.038462 | 26 |
from django.shortcuts import render, get_object_or_404, redirect
from .models import Artist,Genre,Categorie,Album,Song
from django.views.generic import ListView, DetailView
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
651,
62,
15252,
62,
273,
62,
26429,
11,
18941,
198,
6738,
764,
27530,
1330,
18902,
11,
13746,
260,
11,
34,
2397,
19257,
11,
2348,
4435,
11,
44241,
198,
6738,
42625,
14208,
13,
3357... | 2.907692 | 65 |
'''
Because of the interest of aerospace engineers and atmospheric scientists in
conditions at much higher altitudes than those of the U.S. Standard Atmosphere
1976(USSA 1976), members of the U.S. Committee on Extension to the Standard
Atmosphere(COESA 1976) agreed to extend it to 1000 km.
'''
import numpy as np
fr... | [
7061,
6,
198,
8128,
286,
262,
1393,
286,
40439,
12037,
290,
20938,
5519,
287,
220,
198,
17561,
1756,
379,
881,
2440,
5988,
10455,
621,
883,
286,
262,
471,
13,
50,
13,
8997,
33276,
1456,
220,
198,
38108,
7,
2937,
4090,
15408,
828,
18... | 2.177143 | 1,400 |
'''Device support files for pythonSoftIoc Python EPICS device support.
Note that these definitions don't strictly need to be loaded through the
iocbuilder in this way, but it makes structural sense this way.'''
import epicsdbbuilder
from . import device
class RecordWrapper(object):
'''This class wraps both a b... | [
7061,
6,
24728,
1104,
3696,
329,
21015,
18380,
40,
420,
11361,
14724,
19505,
3335,
1104,
13,
198,
198,
6425,
326,
777,
17336,
836,
470,
14084,
761,
284,
307,
9639,
832,
262,
198,
72,
420,
38272,
287,
428,
835,
11,
475,
340,
1838,
13... | 3.7897 | 233 |
from traitlets import default, Callable
from traitlets.config import LoggingConfigurable
from .utils import maybe_future
| [
6738,
1291,
2578,
912,
1330,
4277,
11,
4889,
540,
198,
6738,
1291,
2578,
912,
13,
11250,
1330,
5972,
2667,
16934,
11970,
198,
198,
6738,
764,
26791,
1330,
3863,
62,
37443,
628
] | 3.967742 | 31 |
import unittest
import re
from congressionalrecord.fdsys import cr_parser
# simple files to test basic boiler plate parsing
bolier_house_content = bolier_house_content()
bolier_senate_content = bolier_senate_content()
# Travis doesn't like this test
# # the parser is supposed to ignore front matter
... | [
11748,
555,
715,
395,
198,
11748,
302,
198,
198,
6738,
11702,
22105,
13,
69,
9310,
893,
1330,
1067,
62,
48610,
628,
198,
198,
2,
2829,
3696,
284,
1332,
4096,
36741,
7480,
32096,
628,
198,
198,
28984,
959,
62,
4803,
62,
11299,
796,
1... | 3.143911 | 271 |
# Generated by Django 3.1.8 on 2021-04-13 16:43
from decimal import Decimal
import django.core.validators
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
23,
319,
33448,
12,
3023,
12,
1485,
1467,
25,
3559,
198,
198,
6738,
32465,
1330,
4280,
4402,
198,
198,
11748,
42625,
14208,
13,
7295,
13,
12102,
2024,
198,
6738,
42625,
14208,
13,
9945,
133... | 3.125 | 48 |
from config import Config
from flask import Flask
from app.models import Cache
| [
6738,
4566,
1330,
17056,
198,
6738,
42903,
1330,
46947,
198,
198,
6738,
598,
13,
27530,
1330,
34088,
628
] | 4.5 | 18 |
import copy
import pytest
from ai_traineree.agents.d3pg import D3PGAgent
from conftest import deterministic_interactions
| [
11748,
4866,
198,
11748,
12972,
9288,
198,
198,
6738,
257,
72,
62,
27432,
45316,
13,
49638,
13,
67,
18,
6024,
1330,
360,
18,
6968,
36772,
198,
6738,
369,
701,
395,
1330,
2206,
49228,
62,
3849,
4658,
628
] | 3.324324 | 37 |
from imutils import paths
import random
import cv2
from sklearn.model_selection import train_test_split
import numpy as np
from keras.preprocessing.image import img_to_array
import os
from keras import backend as K
from keras.utils import np_utils
| [
6738,
545,
26791,
1330,
13532,
198,
11748,
4738,
198,
11748,
269,
85,
17,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
9... | 3.557143 | 70 |
"""
Sequence-like objects to build MolecularComponents and others.
"""
from string import ascii_letters
from collections import Counter
import logging
import re
import json
from typing import Union, Iterable
import requests
logger = logging.getLogger(__name__)
class Biosequence(str):
"""
Base class for stri... | [
37811,
198,
44015,
594,
12,
2339,
5563,
284,
1382,
38275,
7293,
3906,
290,
1854,
13,
198,
37811,
198,
6738,
4731,
1330,
355,
979,
72,
62,
15653,
198,
6738,
17268,
1330,
15034,
198,
11748,
18931,
198,
11748,
302,
198,
11748,
33918,
198,
... | 2.14147 | 5,973 |
# encoding=utf-8
from airtest.core.win import Windows
import unittest
import numpy
import win32api
from testconf import try_remove
SNAPSHOT = "win_snapshot.png"
if __name__ == '__main__':
unittest.main()
| [
2,
21004,
28,
40477,
12,
23,
198,
6738,
1633,
9288,
13,
7295,
13,
5404,
1330,
3964,
198,
11748,
555,
715,
395,
198,
11748,
299,
32152,
198,
11748,
1592,
2624,
15042,
198,
6738,
1332,
10414,
1330,
1949,
62,
28956,
628,
198,
15571,
2969... | 2.766234 | 77 |
# Copyright (c) 2013, Ahmed Mohammed Alkuhlani and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import (flt,cstr)
from frappe import _, throw
| [
2,
15069,
357,
66,
8,
2211,
11,
21157,
19773,
978,
74,
7456,
75,
3216,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
5306,
277... | 3.530303 | 66 |
'''
Calculate and save bins, beta and/or bispectrum.
'''
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import cProfile, pstats
import sys
import os
import numpy as np
from scipy.special import spherical_jn
sys.path.insert(0,'./../')
from sst import Fisher
... | [
7061,
6,
198,
9771,
3129,
378,
290,
3613,
41701,
11,
12159,
290,
14,
273,
47457,
806,
6582,
13,
198,
7061,
6,
198,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
9460,
11537,
198,
11748,
2603,
29487,
8019,
13,... | 2.011046 | 1,539 |
import pandas as pd
from time import time
import sys
from random import randint
import timeout_decorator
import hw2_part1_sol
import hw2_part2_sol
from pathlib import PurePath, Path
from hw2_part1 import run_deferred_acceptance, run_deferred_acceptance_for_pairs, count_blocking_pairs
from hw2_part2 import run_market_c... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
640,
1330,
640,
198,
11748,
25064,
198,
6738,
4738,
1330,
43720,
600,
198,
11748,
26827,
62,
12501,
273,
1352,
198,
11748,
289,
86,
17,
62,
3911,
16,
62,
34453,
198,
11748,
289,
86,
17,
62... | 2.380749 | 2,109 |
# Generated by Django 3.1.7 on 2021-03-02 15:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
3070,
12,
2999,
1315,
25,
940,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
142... | 3.019231 | 52 |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
from python.source.linked_list.linked_list import ListNode
if __name__ == '__main__':
head = ListNode(10)
first = ListNode(20)
head.next = first
seco... | [
2,
30396,
329,
1702,
306,
12,
25614,
1351,
13,
198,
2,
1398,
7343,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
1188,
28,
15,
11,
1306,
28,
14202,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
... | 2.368932 | 206 |
#!/usr/bin/env python
import os
import setuptools
__desc__ = """
This is a simple script that generates a 64bit UUID. The normal type of UUID
(e.g. those available in the uuid module) are 128bit, which provides
substantially greater ability to avoid collision between generated values.
However, it is sometimes convenie... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
28686,
198,
11748,
900,
37623,
10141,
198,
198,
834,
20147,
834,
796,
37227,
198,
1212,
318,
257,
2829,
4226,
326,
18616,
257,
5598,
2545,
471,
27586,
13,
383,
3487,
2099,
286,
... | 2.673913 | 966 |
import collections
import statistics
import math
import json
from DecisionTree import DecisionTree
from Tree import Tree
| [
11748,
17268,
198,
11748,
7869,
198,
11748,
10688,
198,
11748,
33918,
198,
198,
6738,
26423,
27660,
1330,
26423,
27660,
198,
6738,
12200,
1330,
12200,
628,
198
] | 4.769231 | 26 |
import board
import time
import terminalio
from digitalio import DigitalInOut, Pull
from adafruit_debouncer import Debouncer
from adafruit_matrixportal.matrixportal import MatrixPortal
# Modules
from cupid.cupid import Cupid
# Hardware initialization
pin_down = DigitalInOut(board.BUTTON_DOWN)
pin_down.switch_to_input... | [
11748,
3096,
198,
11748,
640,
198,
11748,
12094,
952,
198,
6738,
4875,
952,
1330,
10231,
818,
7975,
11,
21429,
198,
6738,
512,
1878,
4872,
62,
11275,
977,
2189,
1330,
8965,
977,
2189,
198,
6738,
512,
1878,
4872,
62,
6759,
8609,
634,
2... | 2.780675 | 652 |
from django.views.generic import ListView
from rest_framework.generics import ListAPIView
from tickets.models import Ticket
from .models import Event
from .serializers import EventSerializer
# Template Views
# API Views
| [
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
7343,
7680,
198,
6738,
1334,
62,
30604,
13,
8612,
873,
1330,
7343,
2969,
3824,
769,
198,
6738,
8587,
13,
27530,
1330,
24014,
198,
198,
6738,
764,
27530,
1330,
8558,
198,
6738,
764,
46911,
... | 3.947368 | 57 |
# Imports
# ---
# Function definition
# numbers are loaded into the following array.
inputNumbers = []
with open("input.txt", "r") as f:
lines = f.readlines()
for item in lines:
inputNumbers.append(int(item.strip("\n")))
print(findTwoNumbers(inputNumbers))
print("\n\n")
print(findThreeNumber... | [
2,
1846,
3742,
198,
2,
11420,
198,
198,
2,
15553,
6770,
628,
198,
198,
2,
3146,
389,
9639,
656,
262,
1708,
7177,
13,
198,
15414,
49601,
796,
17635,
198,
4480,
1280,
7203,
15414,
13,
14116,
1600,
366,
81,
4943,
355,
277,
25,
198,
2... | 2.816667 | 120 |
'''
Computes the y intercept for a univariate least squares regression.
'''
from pruneNulls import pruneNulls
import numpy as np
import scipy as sp
import scipy.stats as ss
def intercept(xarray, yarray):
"""
Computes the regression intercept for the x,y pairs
:param np.array.dtype=float xarray:
:param np.... | [
7061,
6,
220,
198,
220,
3082,
1769,
262,
331,
15788,
329,
257,
555,
42524,
1551,
24438,
20683,
13,
198,
7061,
6,
198,
198,
6738,
778,
1726,
35067,
82,
1330,
778,
1726,
35067,
82,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
... | 2.728972 | 214 |
if __name__ == '__main__':
"""
读取数据
整理数据
绘制图表
"""
print('')
| [
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5525,
107,
119,
20998,
244,
46763,
108,
162,
235,
106,
198,
220,
220,
220,
10545,
243,
112,
49426,
228,
46763,
108,
1... | 1.194444 | 72 |
# Copyright 2018 The TensorFlow 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
#
# Unless required by applica... | [
2,
15069,
2864,
383,
309,
22854,
37535,
46665,
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,
... | 3.755776 | 303 |
from enum import Enum
from django.db import models
from ..analytics.models import Dependency
from .utils import get_scm_module
| [
6738,
33829,
1330,
2039,
388,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
11485,
38200,
14094,
13,
27530,
1330,
37947,
1387,
198,
6738,
764,
26791,
1330,
651,
62,
1416,
76,
62,
21412,
628,
628,
198
] | 3.410256 | 39 |
#!/usr/bin/env python3
"""
TIGA/TCRD (Target Illumination GWAS Analytics) MySql client utilities
"""
###
import os,sys,re,time,json,logging,yaml,tqdm
import pandas as pd
#############################################################################
######################################################################... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
51,
3528,
32,
14,
4825,
35257,
357,
21745,
39256,
1883,
27164,
1921,
30437,
8,
2011,
50,
13976,
5456,
20081,
198,
37811,
198,
21017,
198,
11748,
28686,
11,
17597,
11,
2... | 5.717172 | 99 |
'''
URL: https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/
Difficulty: Medium
Description: Lowest Common Ancestor of a Binary Tree
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
According to the definition of LCA on Wikipedia: “The lowest common ances... | [
7061,
6,
198,
21886,
25,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
9319,
395,
12,
11321,
12,
1192,
395,
273,
12,
1659,
12,
64,
12,
39491,
12,
21048,
14,
198,
198,
28813,
22402,
25,
13398,
198,
198,
11828,
25,
7754,... | 2.753456 | 434 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import signal
import sys
gRunning = True
if __name__ == '__main__':
startServer()
print("end of process")
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
17802,
198,
11748,
6737,
198,
11748,
25064,
198,
198,
70,
28768,
796,
6407,
198,
198,
361,
11593,
3672,
834,
6624,
705,... | 2.693548 | 62 |
# -*- coding: utf-8 -*-
from iutils.render.render import Animate
from iutils.render.render import Render
__ALL__ = ['Animate', 'Render']
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
1312,
26791,
13,
13287,
13,
13287,
1330,
1052,
1920,
198,
6738,
1312,
26791,
13,
13287,
13,
13287,
1330,
46722,
198,
198,
834,
7036,
834,
796,
37250,
2025,
19... | 2.857143 | 49 |
from sklearn.decomposition import NMF, LatentDirichletAllocation
import numpy as np
import os
###
| [
6738,
1341,
35720,
13,
12501,
296,
9150,
1330,
28692,
37,
11,
5476,
298,
35277,
488,
1616,
3237,
5040,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
198,
21017,
220,
198,
220,
220,
220,
220,
198
] | 2.837838 | 37 |
TIME_TEXT_SIZE=180
DATE_TEXT_SIZE=45
AM_PM_TEXT_SIZE=115
TIME_REFRESH_RATE=200 | [
34694,
62,
32541,
62,
33489,
28,
15259,
198,
35,
6158,
62,
32541,
62,
33489,
28,
2231,
198,
2390,
62,
5868,
62,
32541,
62,
33489,
28,
15363,
198,
34694,
62,
2200,
10913,
44011,
62,
49,
6158,
28,
2167
] | 2.108108 | 37 |
"""Config for the Constrained Clustering algorithm."""
# Levy params (from original paper)
config = {
"nHMMStates" : 80,
"nclusters" : 6,
"neighbourhoodLimit" : 12
# "nHMMStates" : 80,
# "nclusters" : 8,
# "neighbourhoodLimit" : 8
#
# # ... | [
37811,
16934,
329,
262,
1482,
2536,
1328,
1012,
436,
1586,
11862,
526,
15931,
198,
198,
2,
32036,
42287,
357,
6738,
2656,
3348,
8,
198,
11250,
796,
1391,
198,
220,
220,
220,
366,
77,
39,
12038,
42237,
1,
220,
220,
220,
220,
220,
220... | 1.885185 | 270 |
import re
import sys
import time
import pendulum
import pytest
from dagster.core.errors import DagsterScheduleWipeRequired
from dagster.core.host_representation import (
ExternalRepositoryOrigin,
ManagedGrpcPythonEnvRepositoryLocationOrigin,
)
from dagster.core.scheduler.job import (
JobState,
JobStatu... | [
11748,
302,
198,
11748,
25064,
198,
11748,
640,
198,
198,
11748,
44017,
14452,
198,
11748,
12972,
9288,
198,
6738,
48924,
1706,
13,
7295,
13,
48277,
1330,
32167,
1706,
27054,
5950,
54,
3757,
37374,
198,
6738,
48924,
1706,
13,
7295,
13,
... | 2.947791 | 498 |
import UserInterFace
#Tests for User Option Return
| [
11748,
11787,
9492,
32388,
628,
198,
2,
51,
3558,
329,
11787,
16018,
8229,
198
] | 3.785714 | 14 |
openweathermap = {
"01d" : "28.bmp",
"01n" : "29.bmp",
"02d" : "30.bmp",
"02n" : "31.bmp",
"03d" : "32.bmp",
"03n" : "32.bmp",
"04d" : "41.bmp",
"04n" : "41.bmp",
"09d" : "34.bmp",
"09n" : "34.bmp",
"10d" : "35.bmp",
"10n" : "35.bmp",
"11d" : "33.bmp",
"11n" : "33... | [
9654,
23563,
8899,
796,
1391,
198,
220,
220,
220,
366,
486,
67,
1,
1058,
366,
2078,
13,
65,
3149,
1600,
198,
220,
220,
220,
366,
486,
77,
1,
1058,
366,
1959,
13,
65,
3149,
1600,
198,
220,
220,
220,
366,
2999,
67,
1,
1058,
366,
... | 1.57047 | 447 |
# Generated by Django 2.1.7 on 2019-05-18 18:06
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
22,
319,
13130,
12,
2713,
12,
1507,
1248,
25,
3312,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# -*- coding: utf-8 -*-
"""Tests for the alarms module."""
from __future__ import unicode_literals
from pysonos.alarms import is_valid_recurrence
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
262,
36302,
8265,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
279,
19699,
418,
13,
282,
8357,... | 2.865385 | 52 |
import os
_MONTHS_PER_YEAR = 12
data_url = os.environ.get('DATA_URL', 'https://okama.io/api/data/')
change_column_name = 'close_pctchange'
| [
11748,
28686,
198,
198,
62,
27857,
4221,
50,
62,
18973,
62,
56,
17133,
796,
1105,
198,
198,
7890,
62,
6371,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
26947,
62,
21886,
3256,
705,
5450,
1378,
482,
1689,
13,
952,
14,
15042,
14,
7890... | 2.35 | 60 |
#!/usr/bin/env python3
import parser
class Code:
"""
Code is responsible for generating the bits-strings that correspond to the parsed instructions parts: dest, comp and jmp.
It generates A-Instructions and C-Instructions via the gen_a_instruction() and gen_c_instruction() methods as strings
of binary ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
30751,
198,
198,
4871,
6127,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6127,
318,
4497,
329,
15453,
262,
10340,
12,
37336,
326,
6053,
284,
262,
44267,
7729,
3354,
... | 2.201136 | 1,760 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
16529,
35937,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
19... | 3.887383 | 959 |