content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python3
import collections
import logging
import json
import os
import re
import sys
import requests
import time
import tqdm
AddressDatabase = collections.namedtuple('AddressDatabase', ['version', 'address_file', 'geo_tagging_file'])
AddressDatabaseRecord = collections.namedtuple('AddressDatabase... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
17268,
198,
11748,
18931,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
7007,
198,
11748,
640,
198,
198,
11748,
256,
80,
36020,
62... | 2.478667 | 750 |
"""Defines single port on raspberry pi.
Because it is a composition of an interface it belongs to, it is more
like a proxy for commands that are sent from single port to gpio.
"""
import logging
from base import InOutInterface
| [
37811,
7469,
1127,
2060,
2493,
319,
38973,
31028,
13,
198,
198,
8128,
340,
318,
257,
11742,
286,
281,
7071,
340,
14448,
284,
11,
340,
318,
517,
220,
198,
2339,
257,
15741,
329,
9729,
326,
389,
1908,
422,
2060,
2493,
284,
27809,
952,
... | 4.017241 | 58 |
import logging
import os
import sys
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.abspath(os.path.join(CURRENT_DIR, os.pardir))
CONFIG_DPATH = os.path.join(ROOT_DIR, "config")
# for pip-environment
sys.path.append(ROOT_DIR)
import hydra
import numpy as np
import torch
import torchvision... | [
11748,
18931,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
34,
39237,
62,
34720,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
4008,
198,
13252,
2394,
62,
34720,
796,
28686,
13,
6... | 2.495751 | 353 |
#!/usr/bin/env python3
import netifaces
print(netifaces.interfaces())
for i in netifaces.interfaces():
print('\n**************Details of Interface - ' + i + ' *********************')
print(netifaces.ifaddresses(i))
try:
print('MAC: ', end='') # This print statement will always print MAC without a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
2010,
361,
2114,
198,
198,
4798,
7,
3262,
361,
2114,
13,
3849,
32186,
28955,
198,
198,
1640,
1312,
287,
2010,
361,
2114,
13,
3849,
32186,
33529,
198,
220,
220,
220,
3... | 2.696203 | 237 |
# Lifted from: https://stackoverflow.com/a/40338475
import pygame
if __name__ == '__main__':
main() | [
2,
21073,
1513,
422,
25,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
64,
14,
1821,
2091,
5705,
2425,
198,
198,
11748,
12972,
6057,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419
] | 2.52381 | 42 |
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(input())
s = input().strip()
t = input().strip()
ans = n * 2
for i in range(0, n):
if s[i:n] == t[0:n-i]:
ans -= (n - i)
break
print(ans)
| [
11748,
25064,
198,
15414,
796,
25064,
13,
19282,
259,
13,
961,
1370,
198,
17597,
13,
2617,
8344,
24197,
32374,
7,
940,
12429,
767,
8,
198,
198,
77,
796,
493,
7,
15414,
28955,
198,
82,
796,
5128,
22446,
36311,
3419,
198,
83,
796,
512... | 2.097345 | 113 |
import os
import tessy
from setuptools import setup
README = ""
if os.path.isfile("README.md"):
with open("README.md") as f:
README = f.read()
setup(
name="tessy",
version=tessy.VERSION,
author="K4rian",
author_email="contact@k4rian.com",
url="https://github.com/k4rian/tessy",
l... | [
11748,
28686,
198,
11748,
256,
408,
88,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
628,
198,
15675,
11682,
796,
13538,
198,
198,
361,
28686,
13,
6978,
13,
4468,
576,
7203,
15675,
11682,
13,
9132,
1,
2599,
198,
220,
220,
220,
351,
... | 2.478836 | 378 |
#######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause
######################################################... | [
29113,
14468,
4242,
21017,
198,
2,
15069,
357,
66,
8,
1853,
11,
15690,
13543,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
2393,
318,
9387,
739,
513,
12,
565,
682,
347,
10305,
5964,
13,
198,
2,
383,
1844,
5964,
4381,
460,
... | 2.107613 | 11,021 |
"""
Module that implements command line interface for the package
"""
from typing import Any, Callable, TypeVar
import click
from .config import SHConfig
from .download import DownloadClient, DownloadRequest
FC = TypeVar("FC", bound=Callable[..., Any])
@click.command()
def main_help() -> None:
"""
Welcome... | [
37811,
198,
26796,
326,
23986,
3141,
1627,
7071,
329,
262,
5301,
198,
37811,
198,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
5994,
19852,
198,
198,
11748,
3904,
198,
198,
6738,
764,
11250,
1330,
6006,
16934,
198,
6738,
764,
15002,... | 2.628641 | 1,236 |
# Generated by Django 3.2 on 2021-04-08 17:42
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
319,
33448,
12,
3023,
12,
2919,
1596,
25,
3682,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 2.904762 | 42 |
#!/usr/bin/python
#
# Author: Manuel Parra Z.
# Date: 10/12/2017
# License: MIT License
# Hardware:
# - Arduino Uno R3
# - TMP36GZ Sensor.
# Description: Project to read from the serial port the ambient temperature,
# then publish the temperature in the cloud using gspread.
# Link: https://github.com/mparr... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
198,
2,
6434,
25,
25995,
2547,
430,
1168,
13,
198,
2,
7536,
25,
838,
14,
1065,
14,
5539,
198,
2,
13789,
25,
17168,
13789,
198,
2,
28715,
25,
198,
2,
220,
220,
220,
220,
220,
2... | 2.448655 | 818 |
__all__ = ('TestLoadingError',)
class TestLoadingError(BaseException):
"""
Raised when exception occurs when a test file is loaded.
Attributes
----------
source_exception : `BaseException`
The source exception.
"""
| [
834,
439,
834,
796,
19203,
14402,
19031,
12331,
3256,
8,
628,
198,
4871,
6208,
19031,
12331,
7,
14881,
16922,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7567,
1417,
618,
6631,
8833,
618,
257,
1332,
2393,
318,
9639,
13,
198,
... | 2.886364 | 88 |
# Copyright (c) 2019 - The Procedural Generation for Gazebo authors
# For information on the respective copyright owner see the NOTICE file
#
# 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
#
#... | [
2,
15069,
357,
66,
8,
13130,
532,
383,
23652,
1523,
16588,
329,
21347,
1765,
78,
7035,
198,
2,
1114,
1321,
319,
262,
11756,
6634,
4870,
766,
262,
28536,
2393,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
... | 2.312762 | 12,623 |
import dash
from dashify.visualization.controllers.data_controllers import ExperimentController, GridSearchController
from flask import request
from dashify.metrics.processor import MetricDataProcessor
import flask
from flask import jsonify
import uuid
from dashify.visualization.data_export.analysis_file import Analysi... | [
11748,
14470,
198,
6738,
14470,
1958,
13,
41464,
1634,
13,
3642,
36667,
13,
7890,
62,
3642,
36667,
1330,
29544,
22130,
11,
24846,
18243,
22130,
198,
6738,
42903,
1330,
2581,
198,
6738,
14470,
1958,
13,
4164,
10466,
13,
41341,
1330,
3395,
... | 3.258706 | 201 |
# -*- encoding: utf-8 -*-
'''
@File : CommandLine.py
@Time : 2019/11/20 11:28:10
@Author : Sirius
'''
import sys, getopt
import json
import os
from BearSki.utils.command import command_parser
from BearSki.utils.command import base_command
from BearSki.utils.arguments import runArg
from BearSki.utils.error... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
31,
8979,
220,
220,
220,
1058,
220,
220,
9455,
13949,
13,
9078,
198,
31,
7575,
220,
220,
220,
1058,
220,
220,
13130,
14,
1157,
14,
1238,
1367,
25,
2078... | 2.525773 | 194 |
# -*- coding: utf-8 -*-
from .chromaticity_coordinates import CCS_ILLUMINANTS
from .sds_d_illuminant_series import (
SDS_BASIS_FUNCTIONS_CIE_ILLUMINANT_D_SERIES, )
from .hunterlab import TVS_ILLUMINANTS_HUNTERLAB
from .sds import SDS_ILLUMINANTS
from .tristimulus_values import TVS_ILLUMINANTS
__all__ = [
'CCS... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
764,
28663,
1512,
414,
62,
37652,
17540,
1330,
327,
7902,
62,
8267,
5883,
1268,
1565,
4694,
198,
6738,
764,
82,
9310,
62,
67,
62,
359,
7230,
415,
62,
25076,... | 2.057269 | 227 |
from policy_engine.context import OperatorContext
from policy_engine import util
from policy_engine import errors
| [
6738,
2450,
62,
18392,
13,
22866,
1330,
35946,
21947,
198,
6738,
2450,
62,
18392,
1330,
7736,
198,
6738,
2450,
62,
18392,
1330,
8563,
628,
628,
198
] | 4.538462 | 26 |
# -*- coding: utf-8 -*-
"""
Created on Mon April 19 15:39:12 2021
@author: katie
"""
import random
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
2892,
3035,
220,
678,
1315,
25,
2670,
25,
1065,
33448,
201,
198,
201,
198,
31,
9800,
25,
479,
265,
494,
201,
198,
37811,
201,
198,
... | 2.156863 | 51 |
from pandas import read_csv
from pandas import datetime
from pandas import DataFrame
from pandas import concat
from matplotlib import pyplot
from sklearn.metrics import mean_squared_error
# Create lagged dataset
# persistence model
# walk-forward validation
# plot predictions and expected results
| [
6738,
19798,
292,
1330,
1100,
62,
40664,
198,
6738,
19798,
292,
1330,
4818,
8079,
198,
6738,
19798,
292,
1330,
6060,
19778,
198,
6738,
19798,
292,
1330,
1673,
265,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
198,
6738,
1341,
35720,
... | 3.777778 | 81 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""Utility function for weight initialization"""
import torch.nn as nn
from fvcore.nn.weight_init import c2_msra_fill
def init_weights(model, fc_init_std=0.01, zero_init_final_bn=True):
"""
Performs ResNet style w... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
198,
37811,
18274,
879,
2163,
329,
3463,
37588,
37811,
198,
198,
11748,
28034,
13,
2047... | 2.014175 | 776 |
"""BetFund namespace."""
from .client import * # noqa: F403, F401
from .libs import * # noqa: F403, F401
from .snapshot import * # noqa: F403, F401
from .temporal import * # noqa: F403, F401
| [
37811,
13056,
24553,
25745,
526,
15931,
198,
6738,
764,
16366,
1330,
1635,
220,
1303,
645,
20402,
25,
376,
31552,
11,
376,
21844,
198,
6738,
764,
8019,
82,
1330,
1635,
220,
1303,
645,
20402,
25,
376,
31552,
11,
376,
21844,
198,
6738,
... | 2.635135 | 74 |
# weekends - [start, end] or None
| [
198,
198,
2,
21511,
532,
685,
9688,
11,
886,
60,
393,
6045,
198,
220,
220,
220,
220,
628,
628,
628,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198
] | 1.866667 | 30 |
import pandas as pd
import numpy as np
from os.path import expanduser, isfile
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import normalize
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import f1_score
home = expanduser("~")
dataFile = home + '/data/255-te... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28686,
13,
6978,
1330,
4292,
7220,
11,
318,
7753,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
6738,
1341,
35720,
1... | 2.565217 | 391 |
# Exercício Python 093:
# Crie um programa que gerencie o aproveitamento de um jogador de futebol.
# O programa vai ler o nome do jogador e quantas partidas ele jogou.
# Depois vai ler a quantidade de gols feitos em cada partida.
# No final, tudo isso será guardado em um dicionário, incluindo o total de gols feitos dur... | [
2,
1475,
2798,
8836,
66,
952,
11361,
657,
6052,
25,
198,
2,
327,
5034,
23781,
1430,
64,
8358,
308,
567,
10782,
494,
267,
257,
1676,
303,
270,
3263,
78,
390,
23781,
48342,
7079,
390,
277,
1133,
28984,
13,
198,
2,
440,
1430,
64,
410... | 2.351485 | 404 |
# -*- coding:utf-8 -*-
"""
"""
import numpy as np
from hypernets.core.ops import Identity
from hypernets.core.search_space import HyperSpace, Int, Real, Choice, Bool
from hypernets.core.searcher import OptimizeDirection
from hypernets.searchers.evolution_searcher import Population, EvolutionSearcher
# def test... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
37811,
198,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
8718,
45938,
13,
7295,
13,
2840,
1330,
27207,
198,
6738,
8718,
45938,
13,
7295,
13,
12947,
62,
1... | 2.071903 | 904 |
import numpy as np
import torch
import pandas as pd
import sklearn.metrics as sk_metrics
from constants import *
def accuracy(output, target, topk=(1,)):
"""
Computes the accuracy over the k top predictions for the specified values of k
Args:
output: prediction output
target: targe... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
1341,
35720,
13,
4164,
10466,
355,
1341,
62,
4164,
10466,
198,
198,
6738,
38491,
220,
220,
1330,
1635,
628,
198,
4299,
9922,
7,
22915,
... | 2.34589 | 1,460 |
# -*- coding: utf-8 -*-,
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe import _, throw
from frappe.utils import today, flt, cint, fmt_money, formatdate, getdate, a... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
20995,
198,
2,
15069,
357,
66,
8,
1853,
11,
39313,
27768,
21852,
18367,
83,
13,
12052,
13,
290,
25767,
669,
198,
2,
13789,
25,
22961,
3611,
5094,
13789,
410,
18,
13,
4091,
5964... | 2.836478 | 636 |
import numpy as np
import librosa
import pickle
import os
import pdb
with open('data_indicator/music/solo/solo_pairs.txt','r') as fid:
audios = [line.strip().split(' ')[0] for line in fid.readlines()]
audio_dir = './MUSIC/solo/audio'
save_dir = './MUSIC/solo/audio_frames'
#def audio_extract(wav_name, sr=22000):
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
9195,
4951,
64,
198,
11748,
2298,
293,
198,
11748,
28686,
198,
11748,
279,
9945,
198,
198,
4480,
1280,
10786,
7890,
62,
521,
26407,
14,
28965,
14,
82,
14057,
14,
82,
14057,
62,
79,
3468,
13,
... | 2.39645 | 169 |
"""
@Author : Niama ELKHBIR
@Last update : 22/03/2020
"""
## TODO :
# Globals :
# Imports :
from math import cos, sin, pi
##
# angles : list of floats, with size 360
# descriptors : list of floats, with size 64
# Mean cosinus of the angles of self
# Mean s... | [
37811,
201,
198,
31,
13838,
1058,
11556,
1689,
17852,
42,
39,
3483,
49,
201,
198,
31,
5956,
4296,
1058,
2534,
14,
3070,
14,
42334,
201,
198,
37811,
201,
198,
2235,
16926,
46,
1058,
201,
198,
201,
198,
2,
40713,
874,
1058,
201,
198,
... | 2.253247 | 154 |
"""
Profile ../profile-datasets-py/div52_zen10deg/045.py
file automaticaly created by prof_gen.py script
"""
self["ID"] = "../profile-datasets-py/div52_zen10deg/045.py"
self["Q"] = numpy.array([ 1.60776800e+00, 2.67751100e+00, 9.24532800e+00,
7.54866100e+00, 8.23327700e+00, 5.40321700e+0... | [
37811,
198,
220,
220,
220,
13118,
11485,
14,
13317,
12,
19608,
292,
1039,
12,
9078,
14,
7146,
4309,
62,
4801,
940,
13500,
14,
40350,
13,
9078,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
3557,
39056,
88,
2727,
416,
1534,
62,
5235,... | 1.629309 | 5,541 |
# Generated by Django 3.2.11 on 2022-02-09 12:08
from django.db import migrations, models
import django.utils.timezone
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
1157,
319,
33160,
12,
2999,
12,
2931,
1105,
25,
2919,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
26791,
13,
2435,
11340,
628
] | 2.95122 | 41 |
import datetime
import hashlib
import logging
import os
import random
import re
import string
if __name__ == "__main__":
print('This script only contains functions and cannot be called directly. See demo scripts for usage examples.')
exit(1)
# Normalize path (replace '\' and '/' with '\\').
# Calculate fil... | [
11748,
4818,
8079,
198,
11748,
12234,
8019,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
4731,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
10786,
1... | 3.44697 | 132 |
from memberapp.models import Member, Association
from memberapp.filters import MemberFilter, AssosFilter
from django_filters.views import FilterView
from django.conf import settings
class MemberListView(FilterView):
"""Subclass of django_filters.views.FilterView to list members."""
model = Member
template... | [
6738,
2888,
1324,
13,
27530,
1330,
10239,
11,
5396,
198,
6738,
2888,
1324,
13,
10379,
1010,
1330,
10239,
22417,
11,
2195,
418,
22417,
198,
6738,
42625,
14208,
62,
10379,
1010,
13,
33571,
1330,
25853,
7680,
198,
6738,
42625,
14208,
13,
1... | 2.45098 | 867 |
import datetime
import pytest
from django.utils.timezone import make_aware
from patreonmanager.models import Patron, Payment, Reward
@pytest.fixture
@pytest.fixture
@pytest.fixture | [
11748,
4818,
8079,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
42625,
14208,
13,
26791,
13,
2435,
11340,
1330,
787,
62,
9685,
198,
198,
6738,
1458,
21833,
37153,
13,
27530,
1330,
43315,
11,
28784,
11,
32307,
628,
198,
31,
9078,
9288,
... | 3.15 | 60 |
#!/usr/bin/env python
import logging
import sys
from iff.ilbm import ILBM
from pprint import pprint
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
18931,
198,
11748,
25064,
198,
198,
6738,
611,
69,
13,
346,
20475,
1330,
14639,
12261,
198,
6738,
279,
4798,
1330,
279,
4798,
628,
198,
198,
361,
11593,
3672,
834,
6624,
70... | 2.75 | 80 |
# Copyright (c) 2021 Sony Group Corporation. 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 app... | [
2,
15069,
357,
66,
8,
33448,
10184,
4912,
10501,
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,
118... | 3.145522 | 536 |
i=int(input("Değer giriniz:")) #Sayi kaça kadar sıralanacak.
x=0
y=int(input("Atlanacak sayi")) #Hangi sayi atlansın.
for x in range(i): #Döngü x i'ye gelene kadar dönsün.
x+=1 # X her defasında 1 arttırılsın.
if x==y: #Eğer x y'ye denk gelirse;
continue #Bu sayıyı atla ve döngüye devam et.
print(x)... | [
72,
28,
600,
7,
15414,
7203,
5005,
33133,
263,
37370,
259,
528,
11097,
4008,
1303,
25515,
72,
38387,
50041,
479,
324,
283,
264,
30102,
1373,
272,
330,
461,
13,
198,
87,
28,
15,
198,
88,
28,
600,
7,
15414,
7203,
2953,
9620,
330,
46... | 1.911917 | 193 |
import json
from io import BytesIO
import requests
from PIL import Image
from utils import exceptions
config = json.load(open("config/config.json"))
MAX_FILE_SIZE = config.get("max_file_size", 5000000) # in bytes
| [
11748,
33918,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
198,
11748,
7007,
198,
6738,
350,
4146,
1330,
7412,
198,
198,
6738,
3384,
4487,
1330,
13269,
198,
198,
11250,
796,
33918,
13,
2220,
7,
9654,
7203,
11250,
14,
11250,
13,
17752,... | 3.235294 | 68 |
import time
from games_puzzles_algorithms.search.search import Search, Node
class DepthFirstSearch(Search):
"""Depth first search class."""
def __init__(self, problem, time_limit):
"""
Initialize the search.
Create the root node with the problem and set a time limit for search.
... | [
11748,
640,
198,
6738,
1830,
62,
79,
4715,
829,
62,
282,
7727,
907,
13,
12947,
13,
12947,
1330,
11140,
11,
19081,
628,
198,
4871,
36350,
5962,
18243,
7,
18243,
2599,
198,
220,
220,
220,
37227,
48791,
717,
2989,
1398,
526,
15931,
628,
... | 2.203445 | 1,219 |
# Copyright (c) 2008, Humanized, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of c... | [
2,
15069,
357,
66,
8,
3648,
11,
5524,
1143,
11,
3457,
13,
201,
198,
2,
1439,
2489,
10395,
13,
201,
198,
2,
201,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
201,
198,
2,
17613,
11,
389,
1... | 2.427553 | 10,242 |
from django.contrib import messages
from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.forms import PasswordChangeForm
from django.shortcuts import render, redirect
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
4296,
62,
29891,
62,
18439,
62,
17831,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
23914,
1330,
30275,
19400,
8479,
198,
... | 3.788462 | 52 |
# -*- coding: utf-8 -*-
# Author: TDC Team
# License: MIT
import pandas as pd
import numpy as np
import os, sys, json
import warnings
warnings.filterwarnings("ignore")
from ..utils import bm_group_load, print_sys, fuzzy_search
from ..utils import create_fold,\
create_fold_setting_cold,\
create_combination_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
6434,
25,
309,
9697,
4816,
198,
2,
13789,
25,
17168,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
11,
25064,
11... | 2.672182 | 3,203 |
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
colours = sns.color_palette('rocket', 4)
plt.style.use(['science', 'grid'])
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
299,
32152,
355,
45941,
198,
4033,
4662,
796,
3013,
82,
13,
8043,
62,
18596,
5857,
10786,
30431,
3256,
604,
8,
198,
489,
... | 2.649123 | 57 |
#
# PySNMP MIB module DNOS-DNS-RESOLVER-CONTROL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DNOS-DNS-RESOLVER-CONTROL-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:36:41 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python ve... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
45080,
2640,
12,
35,
8035,
12,
19535,
3535,
5959,
12,
10943,
5446,
3535,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
1... | 2.633229 | 3,509 |
import torch
import torch.nn as nn
import torch.nn.parallel
import functools
from torch.optim import lr_scheduler
from torch.nn import init
import numpy as np
##
def weights_init(mod):
"""
Custom weights initialization called on netG, netD and netE
:param m:
:return:
"""
classname = mod.__class... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
1845,
29363,
198,
11748,
1257,
310,
10141,
198,
6738,
28034,
13,
40085,
1330,
300,
81,
62,
1416,
704,
18173,
198,
6738,
28034,
13,
20471,
1330,
... | 2.367713 | 446 |
# Copyright Notice:
# Copyright 2016-2019 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Interface-Emulator/blob/master/LICENSE.md
from copy import deepcopy
_TEMPLATE = {u'@odata.context': '{rb}$metadata#SimpleStorage.SimpleStorage',
u... | [
2,
15069,
17641,
25,
198,
2,
15069,
1584,
12,
23344,
14848,
10234,
13,
1439,
2489,
10395,
13,
198,
2,
13789,
25,
347,
10305,
513,
12,
2601,
682,
13789,
13,
1114,
1336,
2420,
766,
2792,
25,
3740,
1378,
12567,
13,
785,
14,
23127,
1023... | 2.096398 | 944 |
from ._sort import sort | [
6738,
47540,
30619,
1330,
3297
] | 4.6 | 5 |
# FLASK
from flask import Flask, request, jsonify
from flask_cors import CORS, cross_origin
# WEB SCRAPING
from bs4 import BeautifulSoup
from selenium import webdriver
import requests
import random
# MACHINE LEARNING
# import base64
# import numpy as np
# import io
# from PIL import Image
# import keras
# from keras im... | [
2,
9977,
1921,
42,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
33918,
1958,
198,
6738,
42903,
62,
66,
669,
1330,
327,
20673,
11,
3272,
62,
47103,
198,
2,
12887,
33,
6374,
49,
2969,
2751,
198,
6738,
275,
82,
19,
1330,
23762,
50,
1... | 2.645941 | 579 |
# Copyright (c) 2015, Michael Boyle
# See LICENSE file for details: <https://github.com/moble/scri/blob/master/LICENSE>
from math import sqrt
import numpy as np
import quaternion
from spherical_functions import ladder_operator_coefficient as ladder
from spherical_functions import clebsch_gordan as CG
from . import j... | [
2,
15069,
357,
66,
8,
1853,
11,
3899,
37619,
198,
2,
4091,
38559,
24290,
2393,
329,
3307,
25,
1279,
5450,
1378,
12567,
13,
785,
14,
39949,
293,
14,
1416,
380,
14,
2436,
672,
14,
9866,
14,
43,
2149,
24290,
29,
198,
198,
6738,
10688... | 2.026665 | 6,713 |
from __future__ import division
from six.moves import range
import math
from scitbx.array_family import flex
from scitbx.matrix import col
switch = 0.12366
upper_cutoff = 0.5 - switch
xupper_cutoff = 0.5 + switch
lower_cutoff = -0.5 + switch # units of pixels
xlower_cutoff = -0.5 - switch # units of pixels
"""Above fo... | [
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
2237,
13,
76,
5241,
1330,
2837,
198,
11748,
10688,
198,
6738,
629,
270,
65,
87,
13,
18747,
62,
17989,
1330,
7059,
198,
6738,
629,
270,
65,
87,
13,
6759,
8609,
1330,
951,
198,
198,
3194... | 3.056948 | 439 |
"""
This module sets up all the necessary configurations for the app
"""
import os
class Config:
"""Parent configuration class."""
DEBUG = False
TESTING = False
SECRET_KEY = os.getenv('SECRET_KEY')
class Development(Config):
"""Configurations for Development."""
ENV = "dev... | [
37811,
201,
198,
1212,
8265,
5621,
510,
477,
262,
3306,
25412,
329,
262,
598,
201,
198,
37811,
201,
198,
201,
198,
11748,
28686,
201,
198,
201,
198,
4871,
17056,
25,
201,
198,
220,
220,
220,
37227,
24546,
8398,
1398,
526,
15931,
201,
... | 2.406032 | 431 |
from __future__ import print_function, division, absolute_import
from numba.testing import discover_tests, run_tests
import sys
if __name__ == '__main__':
sys.exit(0 if test() else 1)
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
11,
4112,
62,
11748,
198,
6738,
997,
7012,
13,
33407,
1330,
7073,
62,
41989,
11,
1057,
62,
41989,
198,
11748,
25064,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,... | 3.183333 | 60 |
import logging
import torch.nn as nn
from mmcv.cnn import ConvModule, constant_init, kaiming_init
from torch.nn.modules.batchnorm import _BatchNorm
from ..registry import BACKBONES
from .base_backbone import BaseBackbone
from .utils import InvertedResidual, load_checkpoint
@BACKBONES.register_module()
class MobileN... | [
11748,
18931,
198,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
8085,
33967,
13,
66,
20471,
1330,
34872,
26796,
11,
6937,
62,
15003,
11,
479,
1385,
278,
62,
15003,
198,
6738,
28034,
13,
20471,
13,
18170,
13,
43501,
27237,
13... | 2.001435 | 1,394 |
from hw_asr.model.baseline_model import BaselineModel, BaselineGRU
from hw_asr.model.quartznet_model import QuartzNetModel
from hw_asr.model.dsmodel import DeepSpeechModel
from hw_asr.model.ds2model import DeepSpeechModel2
__all__ = [
"BaselineModel",
"BaselineGRU",
"QuartzNetModel",
"DeepSpeechModel",... | [
6738,
289,
86,
62,
292,
81,
13,
19849,
13,
12093,
4470,
62,
19849,
1330,
6455,
4470,
17633,
11,
6455,
4470,
10761,
52,
198,
6738,
289,
86,
62,
292,
81,
13,
19849,
13,
421,
13636,
3262,
62,
19849,
1330,
45976,
7934,
17633,
198,
6738,... | 2.525547 | 137 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django_dri.fields
| [
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,
198,
11748,
42625,
14208,
62,
7553,
13,
2... | 2.933333 | 45 |
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["ImmunizationProgramEligibility"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class ImmunizationProgramEligibility:
"""
Immunization Program Eligib... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
277,
71,
343,
13,
37540,
13,
40148,
6781,
1330,
6127,
11964,
198,
198,
6738,
267,
2840,
62,
69,
71,
343,
13,
26791,
1330,
6127,
11964,
3103,
984,
628,
198,
834,
439,
834,
796,
14631,
24... | 2.94926 | 473 |
'''
Main autotracker process
'''
import asyncio
import importlib
import logging as log
import queue
import threading
from ..config import CONFIG
from .exceptions import AutotrackerException, NoConnection, ParseError, NoDevice
from . import usb2snes
gui = importlib.import_module(
'..{0:s}.autotracker'.format(CON... | [
7061,
6,
198,
13383,
1960,
313,
81,
10735,
1429,
198,
7061,
6,
198,
198,
11748,
30351,
952,
198,
11748,
1330,
8019,
198,
11748,
18931,
355,
2604,
198,
11748,
16834,
198,
11748,
4704,
278,
198,
198,
6738,
11485,
11250,
1330,
25626,
198,
... | 1.931725 | 2,446 |
#!/usr/bin/env python
import midca
from midca.examples import predicateworld
from midca.logging import Logger
import inspect, os
# Domain Specific Imports
from midca.domains.blocksworld import util
from midca.domains.blocksworld.plan import methods, operators
'''
This script runs a simple version of MIDCA in blocksw... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
220,
198,
11748,
3095,
6888,
198,
6738,
3095,
6888,
13,
1069,
12629,
1330,
44010,
6894,
198,
6738,
3095,
6888,
13,
6404,
2667,
1330,
5972,
1362,
198,
11748,
10104,
11,
28686,
198,
198,
2,
2... | 3.044326 | 564 |
import requests
from bs4 import BeautifulSoup
import re
import json
from tqdm import tqdm
if __name__ == '__main__':
spider = CoronaVirusSpider()
spider.run()
| [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
302,
198,
11748,
33918,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
... | 2.896552 | 58 |
from AbstractPowerCalculator import AbstractPowerCalculator
from LinearInterpolationPowerCalculator import interp
'''
Elite Novo Force 3/8 power calculator. Thanks @MichMarrazzo
'''
| [
6738,
27741,
13434,
9771,
3129,
1352,
1330,
27741,
13434,
9771,
3129,
1352,
198,
6738,
44800,
9492,
16104,
341,
13434,
9771,
3129,
1352,
1330,
987,
79,
628,
198,
7061,
6,
198,
9527,
578,
5267,
78,
5221,
513,
14,
23,
1176,
28260,
13,
6... | 3.607843 | 51 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
| [
2,
15069,
1946,
383,
18255,
1505,
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,
198,
198,
37811... | 3.982759 | 58 |
from master.workflow.preprocess.workflow_pre import WorkFlowPre
from master import models
class WorkflowFeedFr2Wcnn(WorkFlowPre):
"""
"""
def __init__(self, key = None):
"""
init key variable
:param key:
:return:
"""
if key is not None :
self.ke... | [
6738,
4958,
13,
1818,
11125,
13,
3866,
14681,
13,
1818,
11125,
62,
3866,
1330,
5521,
37535,
6719,
198,
6738,
4958,
1330,
4981,
198,
198,
4871,
5521,
11125,
18332,
6732,
17,
54,
66,
20471,
7,
12468,
37535,
6719,
2599,
198,
220,
220,
22... | 1.977547 | 2,984 |
import numpy as np
from GomokuTools import GomokuTools as gt
def won_or_lost(board):
"""
Returns :1, if the current board will for sure be won in 1 or two moves by the current
player, -1, if the game is for sure lost in one or two moves by the current player.
Returns 0 otherwise
"""
... | [
11748,
299,
32152,
355,
45941,
198,
6738,
402,
296,
11601,
33637,
1330,
402,
296,
11601,
33637,
355,
308,
83,
628,
198,
198,
4299,
1839,
62,
273,
62,
33224,
7,
3526,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
1058,
... | 2.227171 | 449 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-01-04 09:37
from __future__ import unicode_literals
from django.db import migrations
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
# Code adapted from DjangoUnleashed Migrating Flatpages
FLATPAGES = [
{
... | [
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1314,
319,
13130,
12,
486,
12,
3023,
7769,
25,
2718,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,... | 1.952442 | 778 |
#! /usr/bin/python
import hashlib, getpass
import sys
if len(sys.argv) > 1 and sys.argv[1] == '-s':
sha = True
else:
sha = False
while True:
try:
passhash = hashlib.sha1(getpass.getpass()).hexdigest().upper()
if sha:
print passhash
except EOFError:
print
br... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
12234,
8019,
11,
651,
6603,
198,
11748,
25064,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
1875,
352,
290,
25064,
13,
853,
85,
58,
16,
60,
6624,
705,
12,
82,
10354,
19... | 1.815642 | 358 |
n=int(input())
games=input()
a = 0
d = 0
for i in games:
if "A" in i:
a += 1
else:
d+=1
if a>d:
print("Anton")
elif a==d:
print("Friendship")
else:
print("Danik")
| [
77,
28,
600,
7,
15414,
28955,
201,
198,
19966,
28,
15414,
3419,
201,
198,
64,
796,
657,
201,
198,
67,
796,
657,
201,
198,
1640,
1312,
287,
1830,
25,
201,
198,
220,
220,
220,
611,
366,
32,
1,
287,
1312,
25,
201,
198,
220,
220,
... | 1.710938 | 128 |
# Put the following JSON data into a file called status.json
#
# [
# {
# "state": "up",
# "server": "001"
# },
# {
# "state": "down",
# "server": "002"
# },
# {
# "state": "up",
# "server": "003"
# },
# {
# "state": "up",
# "s... | [
2,
5930,
262,
1708,
19449,
1366,
656,
257,
2393,
1444,
3722,
13,
17752,
198,
2,
198,
2,
220,
220,
220,
685,
198,
2,
220,
220,
220,
220,
220,
1391,
198,
2,
220,
220,
220,
220,
220,
220,
220,
366,
5219,
1298,
366,
929,
1600,
198,
... | 2.098571 | 700 |
import gzip
import numpy as np
import sys
class Data(object):
"""Data loader."""
# load (at most max_vectors) word vectors from a file
# also load the label of each word or skip the word if no label is found
# skip vectors of words that are not found in filter_dict (if provided)
# expected form... | [
11748,
308,
13344,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
198,
4871,
6060,
7,
15252,
2599,
628,
220,
220,
220,
37227,
6601,
40213,
526,
15931,
628,
198,
220,
220,
220,
1303,
3440,
357,
265,
749,
3509,
62,
303,
521... | 3.372449 | 196 |
"""The core entrypoint for the gradescope frontend.
More complete documentation is in `__init__.py`.
"""
from os.path import join as pathjoin
from shutil import copyfileobj
from tempfile import TemporaryDirectory
from typing import Optional
from zipfile import ZipFile
from dill import dump # type: ignore
from impor... | [
37811,
464,
4755,
5726,
4122,
329,
262,
19051,
66,
3008,
2166,
437,
13,
198,
198,
5167,
1844,
10314,
318,
287,
4600,
834,
15003,
834,
13,
9078,
44646,
198,
37811,
198,
198,
6738,
28686,
13,
6978,
1330,
4654,
355,
3108,
22179,
198,
673... | 2.731877 | 1,007 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import onnx
import os
import networkx as nx
from typing import Text, Sequence, Any, Optional, Dict, Union, TypeVar, Callable, Tuple, List, cast
def _sanitize_str(s): ... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
319,
77,
87,... | 2.076474 | 3,256 |
import pyb
import machine
import time
import micropython
# upytester pyboard library
from upyt.cmd import instruction
from upyt.cmd import send
import upyt.sched
# Callbacks
_start_time = None
_ext_int = None # interrupt object placeholder
_led = pyb.LED(1) # LED to illuminate when timing starts
@instruction
| [
11748,
12972,
65,
198,
11748,
4572,
198,
11748,
640,
198,
11748,
12314,
1773,
7535,
198,
198,
2,
510,
88,
4879,
353,
12972,
3526,
5888,
198,
6738,
510,
20760,
13,
28758,
1330,
12064,
198,
6738,
510,
20760,
13,
28758,
1330,
3758,
198,
... | 3.291667 | 96 |
"""Tests for Pipeline class"""
import pytest
from cognigraph.nodes.pipeline import Pipeline
import numpy as np
from numpy.testing import assert_array_equal
from cognigraph.tests.prepare_pipeline_tests import (
create_dummy_info,
ConcreteSource,
ConcreteProcessor,
ConcreteOutput,
)
@pytest.fixture(scop... | [
37811,
51,
3558,
329,
37709,
1398,
37811,
198,
11748,
12972,
9288,
198,
6738,
8866,
45920,
13,
77,
4147,
13,
79,
541,
4470,
1330,
37709,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
18747,
62,
... | 2.651323 | 869 |
"""
Courtesy of Guido: https://www.python.org/download/releases/2.2/descrintro/#__new__
To create a singleton class, you subclass from Singleton; each subclass will have a single instance,
no matter how many times its constructor is called. To further initialize the subclass instance, subclasses should
override 'init'... | [
37811,
198,
31825,
286,
1962,
17305,
25,
3740,
1378,
2503,
13,
29412,
13,
2398,
14,
15002,
14,
260,
29329,
14,
17,
13,
17,
14,
20147,
22272,
305,
31113,
834,
3605,
834,
198,
198,
2514,
2251,
257,
2060,
1122,
1398,
11,
345,
47611,
42... | 3.990385 | 104 |
"""Test that the loop is fixed."""
import pytest
def test_list_animals():
"""test the bucket function."""
from fix_loop import list_animals
test_value = list_animals(['dog', 'cat', 'elephant'])
assert test_value == '1. dog\n2. cat\n3. elephant\n' | [
37811,
14402,
326,
262,
9052,
318,
5969,
526,
15931,
628,
198,
11748,
12972,
9288,
628,
198,
4299,
1332,
62,
4868,
62,
11227,
874,
33529,
198,
220,
220,
220,
37227,
9288,
262,
19236,
2163,
526,
15931,
198,
220,
220,
220,
422,
4259,
62... | 2.714286 | 98 |
print('Hello')
print("Updating file to push changes") | [
4798,
10786,
15496,
11537,
198,
4798,
7203,
4933,
38734,
2393,
284,
4574,
2458,
4943
] | 3.785714 | 14 |
import matplotlib.pyplot as plt
import seaborn as sns
def set_rcparams(width=6.69291, fontsize=16, for_article=True, for_beamer=False):
"""
Setting rcparams of matplotlib ready for publishing
"""
height = width / 1.618
if for_article or for_beamer:
params = {
#'backend': 'pdf'... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
198,
4299,
900,
62,
6015,
37266,
7,
10394,
28,
21,
13,
3388,
33551,
11,
10369,
7857,
28,
1433,
11,
329,
62,
20205,
28,
17821,
... | 1.942222 | 675 |
from kivy.app import App
from kivy.clock import Clock
from kivy.metrics import dp
from kivy.properties import StringProperty
from kivymd.button import MDFlatButton
class AddressButton(MDFlatButton):
"""
Overrides MDFlatButton, makes the font slightly smaller on mobile
by using "Body1" rather than "Button"... | [
6738,
479,
452,
88,
13,
1324,
1330,
2034,
198,
6738,
479,
452,
88,
13,
15750,
1330,
21328,
198,
6738,
479,
452,
88,
13,
4164,
10466,
1330,
288,
79,
198,
6738,
479,
452,
88,
13,
48310,
1330,
10903,
21746,
198,
6738,
479,
452,
4948,
... | 2.568898 | 508 |
# Copyright (c) Syn AUTHORS, 2012, under the terms and conditions of the
# AUTHORS file.
import json
| [
2,
15069,
357,
66,
8,
16065,
37195,
20673,
11,
2321,
11,
739,
262,
2846,
290,
3403,
286,
262,
198,
2,
37195,
20673,
2393,
13,
198,
198,
11748,
33918,
628
] | 3.551724 | 29 |
import numpy as np
import pygame as pg
from prepare import GAMEPAD, MOVES, QUANTUM_COMPUTER_1P, QUANTUM_COMPUTER_2P
class Input(object):
"""Handle input events"""
@property
@running.setter
| [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
6057,
355,
23241,
198,
198,
6738,
8335,
1330,
49965,
8905,
2885,
11,
28184,
1546,
11,
19604,
8643,
5883,
62,
9858,
30076,
1137,
62,
16,
47,
11,
19604,
8643,
5883,
62,
9858,
30076,
1137,
... | 2.710526 | 76 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ignore")
import yfinance as yf
yf.pdr_override()
import datetime as dt
# input
symbol = 'AAPL'
start = dt.date.today() - dt.timedelta(days = 365*2)
end = dt.date.today()
# Read data
df = yf.download(symbol... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
14601,
198,
40539,
654,
13,
24455,
40539,
654,
7203,
46430,
4943,
198,
11748,
331,
69,
14149,... | 2.249448 | 906 |
import numpy as np
from robolearn.torch.utils.nn import FlattenMlp
from robolearn.utils.serializable import Serializable
from robolearn.models import QFunction
| [
11748,
299,
32152,
355,
45941,
198,
6738,
686,
2127,
35720,
13,
13165,
354,
13,
26791,
13,
20471,
1330,
1610,
41769,
44,
34431,
198,
6738,
686,
2127,
35720,
13,
26791,
13,
46911,
13821,
1330,
23283,
13821,
198,
6738,
686,
2127,
35720,
1... | 3.5 | 46 |
""" Description here
Author: Leonard Berrada
Date: 2 Nov 2015
"""
from regression import RegressionModel
from auto_correlated import AutoCorrelation
from auto_regressive import AutoRegressive
from kalman import KalmanFilter
from GaussianProcess.GP_model import GaussianProcess | [
37811,
12489,
994,
198,
198,
13838,
25,
20131,
4312,
81,
4763,
198,
10430,
25,
362,
5267,
1853,
198,
37811,
198,
198,
6738,
20683,
1330,
3310,
2234,
17633,
198,
6738,
8295,
62,
10215,
5363,
1330,
11160,
10606,
49501,
198,
6738,
8295,
62... | 4.028986 | 69 |
from fastapi import APIRouter
from app.api.routes.cleanings import router as cleanings_router
router = APIRouter()
router.include_router(cleanings_router, prefix="/cleanings", tags=["cleanings"])
| [
198,
6738,
3049,
15042,
1330,
3486,
4663,
39605,
198,
198,
6738,
598,
13,
15042,
13,
81,
448,
274,
13,
27773,
654,
1330,
20264,
355,
3424,
654,
62,
472,
353,
628,
198,
472,
353,
796,
3486,
4663,
39605,
3419,
628,
198,
472,
353,
13,
... | 3.014925 | 67 |
import math
from typing import IO, TypeVar
import numpy as np
from numpy.typing import NDArray
from ._registry import register
NDArrayBool = NDArray[np.bool_]
DT = TypeVar("DT", bound=np.generic)
@register(day=3)
| [
11748,
10688,
198,
6738,
19720,
1330,
24418,
11,
5994,
19852,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
774,
13886,
1330,
25524,
19182,
198,
198,
6738,
47540,
2301,
4592,
1330,
7881,
198,
198,
8575,
19182,
33,
... | 2.873418 | 79 |
import os
import h5py
import imageio
import numpngw
import numpy as np
save_pairs_segmentation("/share_hd1/db/StrokeCT.h5", "/share_hd1/db/stroke_ct")
| [
11748,
28686,
198,
198,
11748,
289,
20,
9078,
198,
11748,
2939,
952,
198,
11748,
299,
931,
782,
86,
198,
11748,
299,
32152,
355,
45941,
628,
628,
198,
21928,
62,
79,
3468,
62,
325,
5154,
341,
7203,
14,
20077,
62,
31298,
16,
14,
9945... | 2.4 | 65 |
"""Declares specification of the Transformer model."""
import numpy as np
from ctranslate2.specs import attention_spec
from ctranslate2.specs import common_spec
from ctranslate2.specs import model_spec
class TransformerSpec(model_spec.ModelSpec):
"""Describes a Transformer model.
The specification is invar... | [
37811,
37835,
3565,
20855,
286,
262,
3602,
16354,
2746,
526,
15931,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
269,
7645,
17660,
17,
13,
4125,
6359,
1330,
3241,
62,
16684,
198,
6738,
269,
7645,
17660,
17,
13,
4125,
6359,
... | 3.40411 | 146 |
from Qt import QtWidgets, QtCore
from .widgets import (
GridLabelWidget,
SpacerWidget
)
from .base import BaseWidget
| [
6738,
33734,
1330,
33734,
54,
312,
11407,
11,
33734,
14055,
198,
198,
6738,
764,
28029,
11407,
1330,
357,
198,
220,
220,
220,
24846,
33986,
38300,
11,
198,
220,
220,
220,
1338,
11736,
38300,
198,
8,
198,
6738,
764,
8692,
1330,
7308,
3... | 2.953488 | 43 |
#!/usr/bin/env python
# curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
# python get-pip.py
import argparse
import logging
import sys
import os
import json
logging.basicConfig()
LOG = logging.getLogger(__name__)
LOG.setLevel(logging.DEBUG) # JPEELER: change to INFO later
if __name__ == "__main__":
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
29249,
366,
5450,
1378,
18769,
26418,
13,
79,
4464,
64,
13,
952,
14,
1136,
12,
79,
541,
13,
9078,
1,
532,
78,
366,
1136,
12,
79,
541,
13,
9078,
1,
198,
2,
21015,
651,
12,
79... | 2.537313 | 134 |
import csv
from functools import lru_cache
from pathlib import Path
from typing import Dict
from typing import Iterable
from typing import Optional
from typing import Set
from typing import Tuple
from typing import Type
from typing import Union
import warnings
from django.apps import AppConfig
from django.apps import ... | [
11748,
269,
21370,
198,
6738,
1257,
310,
10141,
1330,
300,
622,
62,
23870,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
40806,
540,
198,
6738,
19720,
1330,
32233,
198,
6738,
19720,
1330,
... | 2.30514 | 4,942 |
# Generated by Django 2.2.1 on 2019-06-02 11:30
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
16,
319,
13130,
12,
3312,
12,
2999,
1367,
25,
1270,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from dragonfly import Function, MappingRule
from castervoice.asynch.hmc_rules.hmc_support import kill
from castervoice.lib import control, settings
from castervoice.lib.ctrl.mgr.rule_details import RuleDetails
from castervoice.lib.merge.state.short import R
| [
6738,
10441,
12254,
1330,
15553,
11,
337,
5912,
31929,
198,
198,
6738,
31680,
38888,
13,
292,
2047,
354,
13,
71,
23209,
62,
38785,
13,
71,
23209,
62,
11284,
1330,
1494,
198,
6738,
31680,
38888,
13,
8019,
1330,
1630,
11,
6460,
198,
673... | 3.493333 | 75 |
from .core import Serializable
from ..utils import parse_time
class Embed(Serializable):
"""Class that formats an embed"""
__slots__ = (
'color', 'title', 'url', 'author',
'description', 'fields', 'image',
'thumbnail', 'footer', 'timestamp',
'type', 'video', 'provider'
)
... | [
6738,
764,
7295,
1330,
23283,
13821,
198,
6738,
11485,
26791,
1330,
21136,
62,
2435,
628,
198,
4871,
13302,
276,
7,
32634,
13821,
2599,
198,
220,
220,
220,
37227,
9487,
326,
17519,
281,
11525,
37811,
198,
220,
220,
220,
11593,
6649,
174... | 2.091542 | 1,005 |
from solutions_2018 import day15 as tscr
import pytest
sample_data_str_0 = "\n".join((
"#######",
"#.G...#",
"#...EG#",
"#.#.#G#",
"#..G#E#",
"#.....#",
"#######"))
sample_final_0 = "\n".join((
"#######",
"#G....#",
"#.G...#",
"#.#.#G#",
"#...#.#",
"#....G#",
"#... | [
6738,
8136,
62,
7908,
1330,
1110,
1314,
355,
256,
1416,
81,
198,
11748,
12972,
9288,
628,
198,
39873,
62,
7890,
62,
2536,
62,
15,
796,
37082,
77,
1911,
22179,
19510,
198,
220,
220,
220,
366,
4242,
21017,
1600,
198,
220,
220,
220,
25... | 1.832792 | 1,848 |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2018 Robert Bosch GmbH
All rights reserved.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
@author: David Reeb, Andreas Doerr, Sebastian Gerwinn, Barbara Rakitsch
"""
import numpy as np
import tensorflo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
15269,
357,
66,
8,
2864,
5199,
14548,
354,
402,
2022,
39,
198,
3237,
2489,
10395,
13,
198,
198,
1212,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
... | 2.808081 | 297 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import Counter
import os
import zipfile
import random
import math
import tensorflow as tf
from tensorflow.contrib.tensorboard.plugins import projector
import numpy as np
from six.moves import... | [
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
17268,
1330,
15034,
198,
11748,
28686,
198,
11748,
19974,
7753,
198,
11748,... | 3.064732 | 448 |
# pylint: disable=invalid-name,too-many-public-methods,line-too-long
import copy
import git # type: ignore
import locale
import os
import pathlib
import time
import unittest
from click.testing import CliRunner
from datetime import datetime, timedelta, timezone
from typing import Dict, Optional
from gitprivacy.gitpri... | [
2,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
11,
18820,
12,
21834,
12,
11377,
12,
24396,
82,
11,
1370,
12,
18820,
12,
6511,
198,
11748,
4866,
198,
11748,
17606,
220,
1303,
2099,
25,
8856,
198,
11748,
36693,
198,
11748,
28... | 2.909502 | 221 |
# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
2,
15069,
2177,
8180,
10501,
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,
743,
7330... | 2.292566 | 3,753 |
import numpy as np
import scipy.stats as stats
import itertools
from math import ceil
from scipy.optimize import minimize
from scipy.special import expit
from sklearn.utils import check_random_state, check_array
from tqdm import tqdm
from .array_utils import (
triu_indices_from_3d, diag_indices_from_3d, nondiag_... | [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
34242,
355,
9756,
198,
11748,
340,
861,
10141,
198,
198,
6738,
10688,
1330,
2906,
346,
198,
198,
6738,
629,
541,
88,
13,
40085,
1096,
1330,
17775,
198,
6738,
629,
541,
88,
... | 2.290877 | 10,654 |
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Contains PackIndexFile and PackFile implementations"""
import zlib
from gitdb.exc import (
BadObject,
... | [
2,
15069,
357,
34,
8,
3050,
11,
2813,
26190,
42511,
357,
1525,
1313,
25147,
31,
14816,
13,
785,
8,
290,
20420,
198,
2,
198,
2,
770,
8265,
318,
636,
286,
15151,
11012,
290,
318,
2716,
739,
198,
2,
262,
968,
347,
10305,
13789,
25,
... | 2.343824 | 14,839 |
from typing import Dict, Optional, Tuple
from descartes import PolygonPatch
import matplotlib.pyplot as plt
import numpy as np
from shapely.geometry import Point
from shapely.geometry.base import BaseGeometry
from osm_painter.model.style import Style
from osm_painter.utils import transform_coords
from .drawable impo... | [
6738,
19720,
1330,
360,
713,
11,
32233,
11,
309,
29291,
198,
198,
6738,
1715,
433,
274,
1330,
12280,
14520,
33952,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
5485,
306,
... | 3.43299 | 97 |